1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BjxZzSo2.js","../chunks/D3qLCeEK.js","../chunks/OHQUSm6n.js","../chunks/CvScdOYl.js","../chunks/B3u1aZXl.js","../chunks/C20P4rQ5.js","../chunks/uBIymjUX.js","../chunks/BsYsIQqH.js","../chunks/D5yrmAF2.js","../chunks/BC9AvlhT.js","../chunks/CKI5P1oU.js","../chunks/BHZEFfbq.js","../chunks/DqjvRISI.js","../chunks/DHWg9jzn.js","../chunks/DJZZOeQz.js","../chunks/-1P4KsUQ.js","../chunks/BWMbMj16.js","../chunks/CVZBB9nh.js","../chunks/jUHDc502.js","../chunks/CLGBbb0t.js","../chunks/DQLDhuPM.js","../chunks/Cpr6SAIt.js","../chunks/CPCpK95Z.js","../chunks/BUUlJ0oN.js","../chunks/HMsgQqBX.js","../chunks/Wpgp0Rtj.js","../chunks/Cz5Vn86C.js","../chunks/DPTtEIyt.js","../chunks/DAqEFG53.js","../chunks/H61HIjkG.js","../chunks/BJ1d7ekV.js","../chunks/trEOremz.js","../chunks/CXZKoSmh.js","../chunks/ClsyBc6U.js","../chunks/DaA5bz6U.js","../chunks/DMtHx07I.js","../chunks/DvEdIpCM.js","../chunks/wSXpF74M.js","../chunks/HwYlcfZ4.js","../chunks/BicNdS6S.js","../chunks/A3q_22ew.js","../chunks/DJTKAFpX.js","../chunks/Cp5RX2Mc.js","../chunks/sK4C7CSZ.js","../chunks/vKQZa10Y.js","../chunks/BLIbdSfq.js","../chunks/k35WkBNo.js","../chunks/XhqYKcwG.js","../chunks/qM7mvJO0.js","../chunks/DKffTCCv.js","../chunks/mtU8XXpd.js","../chunks/Dhe3CXS6.js","../chunks/CEYxtf8I.js","../chunks/BsXrfiZh.js","../chunks/B9miPBSB.js","../chunks/y5Xg-5h5.js","../chunks/EcpzOZ9w.js","../chunks/BMJE9YdN.js","../chunks/B55tVAdJ.js","../chunks/DQ5lfDIw.js","../chunks/CKu0qDqv.js","../chunks/XGXlAIBr.js","../chunks/DmZjHTID.js","../chunks/BRu0wVEv.js","../chunks/BneyK67T.js","../chunks/D6Q3Berv.js","../chunks/DU8XGmWo.js","../chunks/COEUYYRa.js","../chunks/Z9AkIDqX.js","../chunks/DkMAWo2j.js","../chunks/Dz2LOgrZ.js","../chunks/DK5lI6Yq.js","../chunks/xXXzmVBF.js","../chunks/BcxdJoOt.js","../chunks/CTcfFpCM.js","../chunks/lbEFI-P1.js","../chunks/BkI0w2NH.js","../chunks/DzR0fZlA.js","../chunks/B-FqU4_J.js","../chunks/DhLJ1pL6.js","../chunks/Dsarg3vf.js","../chunks/BWbaIg1O.js","../chunks/46Mv6zl1.js","../chunks/aUqMHmzX.js","../chunks/CZHKtjzS.js","../chunks/BsOJ7-Ui.js","../chunks/CXukiGwX.js","../chunks/BaHcjt6-.js","../chunks/BrcMZxWh.js","../chunks/Ix-Ye6gv.js","../chunks/BGdALAIZ.js","../chunks/CgnLB8Jc.js","../chunks/CZc3Gf_x.js","../chunks/PZpczxDq.js","../chunks/BLj0YJ2c.js","../chunks/GHgPLyqk.js","../chunks/CxPpKooY.js","../chunks/B9v_h88R.js","../chunks/BJRbKqus.js","../chunks/C4qNvMun.js","../chunks/N0efLTOH.js","../chunks/DwYvSxx6.js","../chunks/DR72z4et.js","../chunks/D_kEQWzr.js","../chunks/Dsew_TID.js","../chunks/BT8VXtzF.js","../chunks/CJd7nfQm.js","../chunks/BJ0rLy3v.js","../chunks/Bz_IibO6.js","../chunks/B-YVrFDF.js","../chunks/CGRZ9B4G.js","../chunks/qxGgLbp0.js","../chunks/CFRD5164.js","../chunks/BFaBkNqh.js","../chunks/DOnznRpt.js","../chunks/PRGScv09.js","../chunks/D0hOvpYG.js","../chunks/CwBYrs4z.js","../chunks/CCneC5tF.js","../chunks/YYIyJWdw.js","../chunks/DXipmDLt.js","../chunks/Cm3pyIGR.js","../chunks/C8JN8I_B.js","../chunks/BL7XeJ7s.js","../chunks/CFe4PVuz.js","../chunks/JVCTHOxB.js","../chunks/CwuBXZap.js","../chunks/hFv0pVtC.js","../chunks/CLeCoBMY.js","../chunks/CAnkEznZ.js","../chunks/NFZNtbZf.js","../chunks/D1Qqnzxc.js","../chunks/DO867s_y.js","../chunks/BjCq3V-c.js","../chunks/CLDrsr5a.js","../chunks/RGhdMv3a.js","../chunks/CRPwa2dn.js","../chunks/pZHjd98a.js","../chunks/DSpIxIHb.js","../chunks/DCAyzoQs.js","../chunks/CGrPdQPS.js","../chunks/DBKwObGH.js","../chunks/DLxKOJr3.js","../chunks/DntlYlvK.js","../chunks/CzZ9Zc-O.js","../chunks/B9ryHuDY.js","../chunks/DhCM1d1l.js","../chunks/Crvo8itx.js","../chunks/B2DP2htb.js","../chunks/IQtkpfKe.js","../chunks/BzpBc7U9.js","../chunks/DWQN_xAm.js","../chunks/-Uls_YXh.js","../chunks/jQJLnOwW.js","../chunks/CXx8BtGS.js","../chunks/B3hVquA_.js","../chunks/ClwBzIQ-.js","../chunks/B3B8hjh_.js","../chunks/C26QHWbw.js","../chunks/6jSIVKmy.js","../chunks/BR5DT3D7.js","../chunks/0WtAOt-7.js","../chunks/Bsxx8BNa.js","../chunks/CA4nUoYT.js","../chunks/BzbV_h8t.js","../chunks/BU4vuoSr.js","../chunks/B-vg3xF-.js","../chunks/Bx-g6jrJ.js","../chunks/Cxv3VV5O.js","../chunks/Blg3WApt.js","../chunks/ZKRTTRy9.js","../chunks/C_0LxCVy.js","../chunks/BMi8Y9lh.js","../chunks/DmO5J-YD.js","../chunks/C9sI3Ts9.js","../chunks/Cn8pMisG.js","../chunks/D2GNDUCR.js","../chunks/Dhnl9weK.js","../chunks/Cm95ymFa.js","../chunks/CasDg9wQ.js","../chunks/3j5uC-iK.js","../chunks/0bhPPwi_.js","../chunks/DppBhVJN.js","../chunks/CgvSmoUN.js","../chunks/CSw9mI6E.js","../chunks/DlspKKDF.js","../chunks/BQPZE1D9.js","../chunks/B_NZq1Vk.js","../chunks/of2rkZLV.js","../chunks/CiWozuBc.js","../chunks/Z25Q_eXn.js","../chunks/AArhseWI.js","../chunks/DP2QZd51.js","../chunks/DPzg6c3C.js","../chunks/oclPyaLO.js","../chunks/Clg5P5KY.js","../chunks/WtwIK9_h.js","../chunks/DR3C1yxy.js","../chunks/BC3JH32E.js","../chunks/DhXmsu6r.js","../chunks/CxvgeWoJ.js","../chunks/CwF7Tkpg.js","../chunks/dGE5rT3f.js","../chunks/DJY5u0_n.js","../chunks/BgTLrJqP.js","../chunks/CfhcXg-b.js","../chunks/CvPh4fW6.js","../chunks/Ducu8QRi.js","../chunks/DIQQc5X8.js","../chunks/BaYl6d8w.js","../chunks/D3InB-8l.js","../chunks/CC2Qu5mz.js","../chunks/DBHVHnyQ.js","../chunks/5ONLzIKf.js","../chunks/BQtImTAG.js","../chunks/sLhRiJ44.js","../chunks/Dl8xgxdz.js","../chunks/CMuobrDT.js","../chunks/ChLhRQ1-.js","../chunks/BkIaSe84.js","../chunks/U6gbcL6u.js","../chunks/B1MDynJ-.js","../chunks/DvLpQ4O4.js","../chunks/Bym6LCTQ.js","../chunks/UvpzYuP4.js","../chunks/Cc_6mL_R.js","../chunks/DPHhWEAA.js","../chunks/DUi9eEhq.js","../chunks/BOgepwfe.js","../chunks/CtNmxX81.js","../chunks/BcmHqZM8.js","../chunks/DJtcA1OM.js","../chunks/DLLblqNm.js","../chunks/Disq1e65.js","../chunks/1k3l-bGq.js","../chunks/D3_Ci_q7.js","../chunks/7eiqWfKe.js","../chunks/BUdNwSAD.js","../chunks/25zxRAGP.js","../chunks/C5BGzpJG.js","../chunks/Bmt9b4mE.js","../chunks/B0KvD6nJ.js","../chunks/CHMVzUK_.js","../chunks/CbiDxulp.js","../chunks/Dopn7Fsd.js","../chunks/Bgd2qm_I.js","../chunks/DO2bN3uA.js","../chunks/B08DYM2N.js","../chunks/DRpyOyB6.js","../chunks/CCcbJWDp.js","../chunks/DxqG1aTX.js","../chunks/CEGRPn5D.js","../chunks/yhou7yh7.js","../chunks/_v4rXvbq.js","../chunks/xihTtKlq.js","../chunks/YoVcPx9O.js","../chunks/6s2U2Teo.js","../assets/DockTabs.Dl9Q9K1n.css","../assets/Profiler.B3-s1BFb.css","../chunks/4J7HBFTx.js","../chunks/CtQhd2V6.js","../chunks/_jJWPUKI.js","../assets/ExportSettingsSection.DNFO1XUf.css","../assets/PublishExportModal.DabB4Zy1.css"])))=>i.map(i=>d[i]); 2import{$ as e,$t as t,A as n,B as r,Bt as i,C as a,Cn as o,Ct as s,E as c,En as l,F as u,Ft as d,Gt as f,Ht as p,I as m,It as h,Kt as g,L as _,M as v,Mt as y,N as b,Nt as x,O as S,Ot as C,P as w,Q as T,Qt as E,R as D,Rt as O,S as k,Sn as A,T as ee,Ut as j,V as M,Vt as te,W as ne,Wt as N,X as P,Xt as re,Y as ie,Yt as F,Z as ae,Zt as I,_t as L,at as oe,b as R,bn as se,bt as ce,c as le,cn as ue,ct as de,d as z,dt as fe,en as pe,et as B,f as me,ft as V,g as he,gn as H,gt as ge,h as U,hn as W,i as _e,in as ve,it as G,j as ye,jt as be,k as xe,kt as K,l as Se,ln as Ce,m as we,mt as Te,nn as q,nt as Ee,o as J,on as De,ot as Oe,p as ke,pn as Ae,pt as je,q as Me,qt as Ne,r as Pe,rn as Fe,rt as Ie,s as Le,sn as Re,st as Y,tn as ze,tt as Be,u as Ve,un as He,ut as X,v as Ue,vt as Z,w as We,wn as Ge,wt as Q,x as Ke,xn as qe,y as Je,yn as Ye,yt as Xe,z as Ze,zt as Qe}from"../chunks/D3qLCeEK.js";import{c as $e,o as et}from"../chunks/OHQUSm6n.js";import{t as $}from"../chunks/uBIymjUX.js";import"../chunks/xihTtKlq.js";import"../chunks/6s2U2Teo.js";import{a as tt,n as nt}from"../chunks/CvScdOYl.js";import{$ as rt,$n as it,$r as at,A as ot,An as st,Ar as ct,At as lt,B as ut,Bn as dt,C as ft,Cn as pt,Cr as mt,D as ht,Dn as gt,Dr as _t,Er as vt,F as yt,Fn as bt,Ft as xt,G as St,Gn as Ct,Gt as wt,Hn as Tt,Hr as Et,Ht as Dt,I as Ot,In as kt,It as At,Jn as jt,Jr as Mt,Jt as Nt,K as Pt,Kn as Ft,Kr as It,Kt as Lt,M as Rt,Mn as zt,N as Bt,Nr as Vt,On as Ht,Or as Ut,P as Wt,Pn as Gt,Pr as Kt,Pt as qt,Qn as Jt,Rn as Yt,Rr as Xt,Rt as Zt,S as Qt,Sr as $t,St as en,T as tn,Tn as nn,U as rn,Un as an,Ur as on,Ut as sn,V as cn,Vn as ln,Vr as un,Wn as dn,Wr as fn,X as pn,Xn as mn,Xr as hn,Xt as g
2n,Y as _n,Yn as vn,Yr as yn,Yt as bn,Zn as xn,Zr as Sn,Zt as Cn,_n as wn,_r as Tn,_t as En,a as Dn,an as On,b as kn,bn as An,bt as jn,ct as Mn,dr as Nn,dt as Pn,ei as Fn,er as In,f as Ln,fr as Rn,ft as zn,gn as Bn,hn as Vn,hr as Hn,i as Un,ir as Wn,it as Gn,j as Kn,jn as qn,jr as Jn,jt as Yn,k as Xn,kn as Zn,kr as Qn,kt as $n,lr as er,mr as tr,mt as nr,n as rr,nn as ir,nt as ar,or,pr as sr,pt as cr,q as lr,qn as ur,qr as dr,qt as fr,r as pr,rr as mr,rt as hr,sn as gr,sr as _r,st as vr,t as yr,tr as br,ur as xr,vr as Sr,vt as Cr,w as wr,wn as Tr,wr as Er,x as Dr,y as Or,yt as kr,z as Ar,zn as jr,zt as Mr}from"../chunks/BC9AvlhT.js";import{i as Nr,n as Pr,r as Fr,t as Ir}from"../chunks/_jJWPUKI.js";import{a as Lr,c as Rr,l as zr,n as Br,r as Vr,s as Hr}from"../chunks/wSXpF74M.js";import{i as Ur,n as Wr,t as Gr}from"../chunks/B3u1aZXl.js";import{A as Kr,B as qr,C as Jr,D as Yr,F as Xr,G as Zr,I as Qr,J as $r,K as ei,L as ti,M as ni,N as ri,P as ii,Q as ai,R as oi,S as si,T as ci,U as li,V as ui,X as di,Y as fi,Z as pi,_ as mi,a as hi,at as gi,b as _i,c as vi,d as yi,et as bi,f as xi,ft as Si,g as Ci,h as wi,i as Ti,j as Ei,k as Di,lt as Oi,m as ki,n as Ai,nt as ji,o as Mi,ot as Ni,p as Pi,pt as Fi,q as Ii,rt as Li,s as Ri,t as zi,tt as Bi,u as Vi,ut as Hi,v as Ui,w as Wi,x as Gi,y as Ki}from"../chunks/BjxZzSo2.js";import{C as qi,S as Ji,_ as Yi,a as Xi,c as Zi,h as Qi,i as $i,l as ea,m as ta,r as na,v as ra,y as ia}from"../chunks/HwYlcfZ4.js";import{a as aa,c as oa,l as sa,o as ca,s as la}from"../chunks/BicNdS6S.js";import{_ as ua,h as da,i as fa,s as pa,y as ma}from"../chunks/A3q_22ew.js";import{a as ha,c as ga,d as _a,i as va,n as ya}from"../chunks/DJTKAFpX.js";import{n as ba}from"../chunks/vKQZa10Y.js";import{A as xa,B as Sa,D as Ca,E as wa,F as eee,H as Ta,I as Ea,K as Da,O as Oa,S as ka,T as Aa,V as tee,_ as ja,a as Ma,b as Na,c as Pa,d as Fa,g as Ia,h as La,i as Ra,j as nee,l as za,m as ree,n as Ba,o as Va,p as Ha,q as Ua,r as Wa,s as Ga,u as Ka,v as qa,x as Ja,y as Ya,z as Xa}from"../chunks/DkMAWo2j.js";import{n as Za}from"../chunks/ChLhRQ1-.js";import{C as Qa,D as $a,E as eo,O as to,S as no,T as ro,_ as io,a as ao,b as oo,c as so,d as co,f as lo,g as uo,h as fo,i as po,k as mo,l as ho,m as go,n as _o,o as vo,p as yo,r as bo,s as xo,t as So,u as Co,v as wo,w as To,x as Eo,y as Do}from"../chunks/CtQhd2V6.js";import{$ as Oo,A as ko,At as Ao,B as jo,Bt as Mo,C as No,Ct as Po,D as Fo,Dt as Io,E as Lo,Et as Ro,F as zo,Ft as Bo,G as Vo,H as Ho,Ht as Uo,I as Wo,It as Go,K as Ko,L as qo,Lt as Jo,M as Yo,Mt as Xo,N as Zo,Nt as Qo,O as $o,Ot as es,P as ts,Pt as ns,Q as rs,R as is,Rt as as,S as os,St as ss,T as cs,Tt as ls,U as us,Ut as ds,V as fs,Vt as ps,W as ms,X as hs,Y as gs,Z as _s,_ as vs,a as ys,at as bs,b as xs,bt as Ss,c as Cs,ct as ws,d as Ts,dt as Es,et as Ds,f as Os,ft as ks,g as As,gt as js,h as Ms,ht as Ns,i as Ps,it as Fs,j as Is,jt as Ls,k as Rs,kt as zs,l as Bs,lt as Vs,m as Hs,mt as Us,n as Ws,nt as Gs,o as Ks,ot as qs,p as Js,pt as Ys,q as Xs,r as Zs,rt as Qs,s as $s,st as ec,t as tc,tt as nc,ut as rc,v as ic,vt as ac,w as oc,wt as sc,x as cc,xt as lc,y as uc,yt as dc,z as fc,zt as pc}from"../chunks/C20P4rQ5.js";import{i as mc,n as iee,o as aee,r as oee,t as see}from"../chunks/DhCM1d1l.js";import{i as hc,n as gc,o as cee,r as _c,s as vc,t as lee}from"../chunks/DOnznRpt.js";import{p as yc}from"../chunks/CKI5P1oU.js";import{i as bc,r as xc,s as uee}from"../chunks/CLGBbb0t.js";import{E as dee,O as Sc,T as Cc,a as wc,b as Tc,c as Ec,d as Dc,f as Oc,g as kc,h as Ac,i as jc,l as Mc,n as Nc,p as fee,s as Pc,t as Fc,u as Ic,v as Lc,w as Rc,x as zc}from"../chunks/BsYsIQqH.js";import{i as Bc,n as pee,t as Vc}from"../chunks/Cpr6SAIt.js";import{a as Hc,i as Uc,o as Wc,r as Gc,t as Kc}from"../chunks/DQLDhuPM.js";import{a as mee,n as hee,o as gee}from"../chunks/DMtHx07I.js";import{i as qc,n as _ee,o as Jc}from"../chunks/CPCpK95Z.js";import{i as vee}from"../chunks/BUUlJ0oN.js";import{n as Yc}from"../chunks/BHZEFfbq.js";import{d as yee,i as Xc,l as Zc,n as Qc,r as bee,t as $c,u as xee}from"../chunks/DHWg9jzn.js";import{d as See,f as Cee,g as wee,i as el,m as Tee,n as tl,p as Eee,r as Dee,s as nl,t as rl}from"../chunks/D5yrmAF2.js";import{i as Oee,n as kee}from"../chunks/DJZZOeQz.js";import{A as Aee,C as jee,E as il,O as Mee,_ as Nee,b as Pee,d as Fee,g as al,h as ol,s as sl,v as Iee,y as cl}from"../chunks/HMsgQqBX.js";import{a as Lee,o as Ree}from"../chunks/DvEdIpCM.js";import{s as zee,u as Bee}from"../chunks/sK4C7CSZ.js";import{a as ll,c as Vee,i as ul,n as dl,o as fl}from"../chunks/k35WkBNo.js";import{c as Hee,d as pl,f as Uee,i as Wee,l as ml,s as Gee}from"../chunks/BLIbdSfq.js";import{n as Kee}from"../chunks/DPTtEIyt.js";import{a as hl,c as gl,d as _l,f as qee,g as vl,h as Jee,i as Yee,m as Xee,n as Zee,o as Qee,r as $ee,s as ete}from"../chunks/qM7mvJO0.js";import{i as tte}from"../chunks/DKffTCCv.js";import{i as yl,t as bl}from"../chunks/XhqYKcwG.js";import{i as nte}from"../chunks/mtU8XXpd.js";import{i as xl,t as rte}from"../chunks/BWMbMj16.js";import{n as Sl,t as Cl}from"../chunks/Dhe3CXS6.js";import{c as ite,i as wl,n as ate,o as Tl,s as El,t as Dl,u as ote}from"../chunks/CEYxtf8I.js";import{n as Ol,t as kl}from"../chunks/BsXrfiZh.js";import{A as ste,C as Al,D as jl,E as Ml,O as Nl,T as cte,_ as Pl,a as Fl,b as Il,c as Ll,d as Rl,f as lte,g as zl,h as ute,k as Bl,m as Vl,n as dte,o as Hl,p as fte,r as Ul,s as pte,t as Wl,u as mte,v as hte,w as gte,x as Gl,y as Kl}from"../chunks/B9miPBSB.js";import{i as ql}from"../chunks/H61HIjkG.js";import{i as _te,m as Jl,o as Yl,r as Xl}from"../chunks/Cz5Vn86C.js";import{f as vte,n as Zl,u as Ql}from"../chunks/DAqEFG53.js";import{a as $l,f as eu,g as yte,h as bte,i as tu,l as xte,m as nu,n as Ste,o as ru,p as iu,r as Cte,s as au,t as wte}from"../chunks/y5Xg-5h5.js";import{a as ou,n as Tte,r as Ete,t as Dte}from"../chunks/trEOremz.js";import{_ as Ote,a as su,c as cu,d as lu,f as kte,g as uu,l as du,m as Ate,n as jte,p as fu,r as Mte,u as Nte}from"../chunks/BJ1d7ekV.js";import{B as pu,C as mu,D as hu,F as Pte,G as gu,I as Fte,L as Ite,O as Lte,P as _u,R as Rte,S as zte,V as vu,W as yu,_ as bu,a as xu,b as Su,c as Bte,d as Cu,f as wu,g as Tu,i as Eu,k as Du,l as Vte,n as Hte,r as Ou,s as Ute,t as Wte,u as Gte,v as ku,w as Kte,x as Au,y as ju,z as qte}from"../chunks/CXZKoSmh.js";import{C as Mu,S as Nu,_ as Jte,b as Yte,c as Pu,f as Fu,g as Xte,h as Zte,i as Qte,l as $te,n as ene,r as tne,t as Iu,v as Lu,x as Ru,y as zu}from"../chunks/EcpzOZ9w.js";import{m as nne,n as Bu,s as rne,t as ine,u as ane}from"../chunks/ClsyBc6U.js";import{n as Vu}from"../chunks/B55tVAdJ.js";import{n as one,r as Hu}from"../chunks/BMJE9YdN.js";import{c as Uu,r as Wu,s as Gu}from"../chunks/DQ5lfDIw.js";import{a as sne,c as Ku,d as cne,i as lne,l as une,m as dne,n as fne,o as qu,p as pne,r as mne,s as hne,t as gne}from"../chunks/DaA5bz6U.js";import{n as Ju,r as _ne}from"../chunks/XGXlAIBr.js";import{i as Yu,l as Xu,n as vne,o as Zu,r as yne,t as Qu}from"../chunks/DmZjHTID.js";import{c as bne,i as $u,n as ed,r as xne,s as Sne}from"../chunks/CKu0qDqv.js";import{r as Cne,t as td}from"../chunks/BRu0wVEv.js";import{t as nd}from"../chunks/BneyK67T.js";import{c as rd,i as wne,l as id,n as Tne,r as ad,u as od}from"../chunks/D6Q3Berv.js";import{C as sd,D as cd,E as Ene,F as Dne,O as ld,S as One,_ as kne,c as ud,d as Ane,h as dd,s as fd,t as jne,w as Mne,y as Nne}from"../chunks/jUHDc502.js";import{a as pd,c as Pne,l as Fne,n as Ine,o as Lne,r as Rne,t as zne}from"../chunks/DU8XGmWo.js";import{i as Bne,n as md,r as Vne,t as Hne}from"../chunks/Dz2LOgrZ.js";import{A as Une,L as Wne,N as Gne,O as hd,P as Kne,c as gd,d as qne,f as _d,g as vd,h as Jne,j as yd,k as bd,l as xd,m as Sd,n as Yne,p as Cd,u as Xne,v as Zne,x as Qne,y as w
2d}from"../chunks/xXXzmVBF.js";import{a as Td,i as Ed,r as $ne,t as Dd}from"../chunks/CTcfFpCM.js";import{_ as Od,a as ere,c as kd,d as Ad,f as tre,i as jd,l as Md,m as Nd,n as nre,o as Pd,r as rre,u as Fd,v as Id,y as Ld}from"../chunks/BcxdJoOt.js";import{a as Rd,i as ire,r as zd,s as Bd,t as are}from"../chunks/lbEFI-P1.js";import{C as Vd,E as Hd,S as Ud,T as Wd,a as ore,c as Gd,f as Kd,g as sre,h as qd,l as cre,m as Jd,o as Yd,p as lre,s as Xd,t as Zd,v as Qd,w as $d,x as ure,y as dre}from"../chunks/BkI0w2NH.js";import{_ as fre,a as pre,b as ef,c as tf,f as nf,g as mre,h as hre,i as rf,l as af,m as of,n as gre,o as sf,p as cf,s as _re,u as lf,v as vre,y as uf}from"../chunks/B-FqU4_J.js";import{a as df}from"../chunks/COEUYYRa.js";import{i as ff,n as yre,o as pf,r as mf,s as hf,t as gf}from"../chunks/DzR0fZlA.js";import{d as _f,f as bre,l as xre,o as vf,p as Sre,r as Cre,s as wre}from"../chunks/DhLJ1pL6.js";import{S as Tre,a as yf,b as bf,c as Ere,d as Dre,i as Ore,m as kre,n as Are,o as jre,p as xf,r as Mre,s as Nre,v as Sf}from"../chunks/DK5lI6Yq.js";import{i as Pre,n as Cf,t as Fre}from"../chunks/Dsarg3vf.js";import{a as wf,n as Ire,r as Lre,t as Rre}from"../chunks/46Mv6zl1.js";import{i as zre,t as Bre}from"../chunks/BWbaIg1O.js";import{i as Vre,r as Hre,t as Tf}from"../chunks/BsOJ7-Ui.js";import{a as Ure,d as Wre,f as Gre,h as Kre,i as qre,l as Ef,m as Jre,n as Df,o as Yre,p as Of,u as Xre,v as Zre}from"../chunks/CZHKtjzS.js";import"../chunks/BaHcjt6-.js";import{a as kf,c as Af,d as Qre,f as jf,h as Mf,i as Nf,l as Pf,p as Ff,r as If,t as Lf,u as Rf}from"../chunks/CVZBB9nh.js";import{a as zf,c as Bf,i as $re,o as Vf,s as Hf}from"../chunks/D0hOvpYG.js";import{a as Uf,f as eie,n as tie,o as nie,r as rie,s as Wf,t as iie}from"../chunks/PRGScv09.js";import{a as aie,i as oie,n as sie,o as cie,r as lie,s as uie,t as die}from"../chunks/CwBYrs4z.js";import{i as Gf,n as fie,o as pie,t as Kf}from"../chunks/CCneC5tF.js";import{n as mie}from"../chunks/DXipmDLt.js";import{n as qf,r as hie}from"../chunks/Cm3pyIGR.js";import{a as Jf,c as gie,d as Yf,f as _ie,h as vie,l as yie,m as Xf,n as bie,o as Zf,p as xie,s as Qf,t as $f}from"../chunks/C8JN8I_B.js";import{a as ep,n as Sie}from"../chunks/BrcMZxWh.js";import{u as tp}from"../chunks/BLj0YJ2c.js";import{C as np,E as rp,S as ip,T as ap,_ as op,a as sp,b as cp,c as lp,d as up,f as dp,g as fp,h as pp,i as mp,l as Cie,m as hp,n as gp,o as _p,p as wie,r as vp,s as yp,t as bp,u as xp,v as Sp,w as Cp,x as wp}from"../chunks/Ix-Ye6gv.js";import{a as Tp,o as Ep,s as Tie}from"../chunks/BGdALAIZ.js";import{i as Eie,t as Die}from"../chunks/CgnLB8Jc.js";import{_ as Oie,b as kie,d as Aie,f as Dp,l as jie,m as Mie,n as Nie,o as Pie,r as Fie,s as Iie,x as Lie,y as Rie}from"../chunks/CZc3Gf_x.js";import{$t as zie,B as Op,Bt as Bie,Ct as kp,D as Vie,E as Ap,Et as jp,F as Hie,Ft as Uie,G as Mp,Gt as Np,H as Wie,Ht as Pp,I as Fp,It as Gie,K as Ip,Kt as Lp,L as Rp,Lt as Kie,Mt as qie,N as Jie,Nt as Yie,O as Xie,P as zp,Pt as Zie,Q as Qie,Qt as $ie,R as Bp,Rt as eae,St as tae,Tt as nae,U as Vp,Ut as rae,V as iae,Vt as Hp,W as Up,Wt as aae,X as Wp,Yt as oae,Zt as sae,_t as cae,a as lae,an as Gp,at as uae,b as Kp,bt as dae,c as qp,cn as Jp,ct as Yp,d as fae,dt as pae,et as mae,ft as Xp,g as hae,gt as Zp,h as Qp,ht as $p,i as em,in as gae,k as _ae,lt as tm,m as vae,mt as nm,nn as yae,nt as bae,on as rm,ot as xae,p as Sae,pt as im,q as am,qt as Cae,r as om,rn as sm,sn as wae,st as Tae,ut as Eae,vt as Dae,w as Oae,wt as kae,x as Aae,xt as jae,yt as cm,z as lm,zt as Mae}from"../chunks/PZpczxDq.js";import{D as um,E as dm,I as Nae,O as Pae,_ as Fae,a as Iae,b as Lae,c as fm,d as Rae,h as zae,i as Bae,k as pm,m as Vae,n as Hae,o as mm,p as Uae,r as hm,s as gm,t as Wae,v as Gae,w as _m,x as Kae}from"../chunks/-1P4KsUQ.js";import{a as qae,i as vm,o as Jae,t as Yae}from"../chunks/BL7XeJ7s.js";import{A as Xae,C as Zae,D as Qae,E as ym,O as $ae,S as eoe,T as toe,a as noe,c as bm,d as xm,f as Sm,g as Cm,h as roe,i as ioe,k as wm,l as aoe,m as ooe,n as
2soe,o as coe,p as loe,r as Tm,t as uoe,u as doe,v as foe,x as Em,y as poe}from"../chunks/BFaBkNqh.js";import{a as moe,n as Dm,r as Om}from"../chunks/N0efLTOH.js";import{r as hoe}from"../chunks/CLeCoBMY.js";import{a as goe,c as _oe,d as voe,i as yoe,l as boe,n as xoe,o as Soe,r as Coe,u as km}from"../chunks/CAnkEznZ.js";import{_ as woe,a as Toe,c as Am,d as Eoe,f as jm,g as Doe,h as Ooe,i as Mm,l as Nm,n as koe,o as Pm,p as Fm,r as Aoe,s as joe,u as Moe}from"../chunks/hFv0pVtC.js";import{D as Im,E as Lm,O as Noe,T as Rm,_ as Poe,f as zm,h as Foe,k as Bm,p as Vm,r as Ioe,t as Hm,u as Um,v as Loe}from"../chunks/NFZNtbZf.js";import{r as Roe}from"../chunks/D1Qqnzxc.js";import{_ as Wm,d as zoe,f as Boe,h as Voe,i as Hoe,n as Uoe,o as Gm,p as Woe,s as Goe,y as Koe}from"../chunks/JVCTHOxB.js";import{a as qoe,c as Km,d as Joe,f as qm,i as Yoe,l as Jm,n as Ym,o as Xoe,r as Zoe,t as Qoe,u as $oe}from"../chunks/CSw9mI6E.js";import{C as Xm,D as ese,E as Zm,I as tse,L as nse,M as rse,N as ise,O as ase,P as Qm,R as $m,S as eh,a as ose,b as th,c as nh,d as rh,i as sse,k as cse,l as ih,m as lse,n as ah,o as oh,s as use,t as sh,u as ch,w as lh,x as uh,y as dh}from"../chunks/B3B8hjh_.js";import{a as dse,i as fh,n as ph,t as mh}from"../chunks/C26QHWbw.js";import{a as hh,c as fse,n as pse,o as gh,r as mse,s as hse,t as gse}from"../chunks/CFRD5164.js";import{a as _se,c as _h,d as vse,f as yse,i as vh,l as yh,n as bse,o as xse,p as bh,r as Sse,s as xh,t as Cse,u as Sh}from"../chunks/Clg5P5KY.js";import{n as Ch,t as wh}from"../chunks/B1MDynJ-.js";import{n as Th,r as wse,t as Tse}from"../chunks/Bgd2qm_I.js";import{a as Eh,c as Dh,d as Oh,f as kh,i as Ah,l as Ese,m as jh,n as Dse,o as Mh,p as Nh,r as Ph,s as Fh,t as Ose}from"../chunks/DlspKKDF.js";import{n as kse,r as Ase}from"../chunks/CRPwa2dn.js";import{a as jse,c as Ih,i as Mse,n as Nse,o as Pse,r as Fse,s as Ise}from"../chunks/B_NZq1Vk.js";import{a as Lse,c as Lh,i as Rh,l as Rse,n as zh,o as Bh,s as zse,u as Vh}from"../chunks/BQPZE1D9.js";import{S as Bse,b as Vse,c as Hse,g as Hh,h as Uh,m as Use,o as Wse,p as Wh,r as Gse,t as Kse,x as qse}from"../chunks/DO867s_y.js";import{a as Gh,c as Kh,d as Jse,f as qh,i as Yse,l as Xse,n as Jh,o as Yh,r as Zse,s as Xh,t as Zh}from"../chunks/CiWozuBc.js";import{a as Qse,c as $se,d as Qh,f as $h,l as eg,m as tg,n as ng,p as rg,r as ig,s as ece,t as tce,u as ag}from"../chunks/Z25Q_eXn.js";import{r as og}from"../chunks/of2rkZLV.js";import{a as nce,c as rce,d as sg,f as cg,i as ice,l as ace,m as oce,n as lg,o as sce,r as ug,t as dg,u as fg}from"../chunks/CgvSmoUN.js";import{c as cce,i as lce,l as uce,n as dce,r as fce,u as pce}from"../chunks/Dopn7Fsd.js";import{_ as mce,a as hce,d as pg,f as mg,g as gce,h as _ce,o as vce,t as hg,y as yce}from"../chunks/0WtAOt-7.js";import{c as bce,i as xce,l as Sce,n as Cce,o as gg,r as _g,t as vg}from"../chunks/BR5DT3D7.js";import{_ as wce,a as yg,c as Tce,d as bg,f as Ece,h as Dce,i as xg,m as Oce,o as kce,p as Ace,r as jce,s as Mce,t as Nce,y as Pce}from"../chunks/6jSIVKmy.js";import{_ as Sg,a as Cg,c as wg,d as Tg,l as Fce,o as Eg,s as Ice,u as Dg,v as Lce,y as Rce}from"../chunks/BjCq3V-c.js";import{i as zce,t as Bce}from"../chunks/oclPyaLO.js";import{$ as Vce,A as Hce,B as Og,C as kg,D as Uce,E as Wce,F as Ag,G as jg,H as Mg,I as Gce,J as Kce,K as Ng,L as qce,N as Jce,P as Pg,Q as Fg,R as Yce,S as Xce,T as Ig,U as Lg,V as Rg,W as zg,X as Zce,Y as Qce,Z as Bg,_ as Vg,a as Hg,at as $ce,b as Ug,c as Wg,ct as Gg,dt as ele,et as tle,ft as Kg,g as nle,h as rle,ht as ile,i as qg,it as Jg,j as ale,k as Yg,lt as ole,m as sle,mt as Xg,n as Zg,nt as cle,o as Qg,ot as lle,p as ule,pt as $g,q as e_,r as dle,rt as t_,s as fle,st as n_,t as r_,tt as ple,u as i_,ut as mle,v as hle,w as a_,x as o_,z as s_}from"../chunks/CLDrsr5a.js";import{a as c_,c as l_,d as gle,f as u_,i as d_,l as _le,n as vle,p as f_,r as yle,s as p_,u as m_}from"../chunks/BMi8Y9lh.js";import{a as ble,c as h_,f as g_,h as xle,l as Sle,p as Cle,r as wle}from"../chunks/DUi9eEhq.js";import{_ as __,a as Tle,b as v_,c as Ele,d as Dle,f as y_,g as b_,h as x_,i as S_,l as C_,m as Ole,n as kle,o as w_,p as T_,r as E_,s as D_,t as Ale,u as O_,y as k_}from"../chunks/BOgepwfe.js";import{n as jle,r as Mle,t as A_}from"../chunks/CtNmxX81.js";import{r as Nle}from"../chunks/Bsxx8BNa.js";import{a as Ple,i as Fle,n as Ile,s as j_,u as Lle}from"../chunks/BgTLrJqP.js";import{a as M_,c as N_,i as Rle,l as P_,n as F_,r as I_,s as zle,t as Ble,u as L_}from"../chunks/DRpyOyB6.js";import{$ as Vle,An as R_,At as Hle,Bn as Ule,Bt as z_,C as B_,Ct as Wle,Fn as V_,Ft as H_,Gt as U_,Hn as Gle,Ht as Kle,In as qle,It as Jle,Jt as Yle,Kn as Xle,Kt as Zle,Lt as Qle,Mn as $le,Mt as eue,Nt as tue,Qt as nue,Rn as rue,Rt as iue,S as aue,St as oue,U as sue,Un as W_,Ut as cue,Vn as lue,Vt as uue,Wt as due,Xt as fue,Y as pue,Yt as G_,Z as mue,Zt as hue,_ as K_,_n as gue,_r as q_,_t as _ue,b as vue,bt as yue,et as bue,f as xue,fn as Sue,g as J_,gt as Cue,h as Y_,hr as wue,ht as Tue,ir as Eue,it as X_,jn as Z_,jt as Due,kn as Q_,kt as Oue,lt as kue,m as $_,mn as Aue,nn as jue,o as Mue,on as Nue,pn as Pue,pt as Fue,qt as ev,rt as Iue,sn as Lue,tn as tv,tt as Rue,un as zue,ut as Bue,v as nv,vt as Vue,wt as Hue,x as Uue,xt as Wue,y as rv,yr as Gue,yt as Kue,z as que,zn as iv,zt as Jue}from"../chunks/DmO5J-YD.js";import{A as Yue,C as Xue,D as Zue,E as Que,O as av,S as $ue,T as ede,a as tde,c as nde,d as ov,f as sv,g as cv,h as rde,i as lv,j as uv,k as ide,l as ade,m as ode,n as
2sde,o as cde,p as dv,r as fv,s as lde,t as ude,u as pv,w as dde,x as fde,y as mv}from"../chunks/RGhdMv3a.js";import{a as pde,c as mde,d as hde,i as gde,l as hv,n as _de,o as vde,r as yde,t as bde}from"../chunks/pZHjd98a.js";import{a as gv,c as _v,d as xde,f as Sde,i as vv,n as Cde,p as wde,r as Tde,t as Ede,u as Dde}from"../chunks/DSpIxIHb.js";import{i as Ode,n as kde}from"../chunks/DBKwObGH.js";import{a as yv,c as bv,d as xv,f as Ade,g as jde,h as Mde,i as Nde,l as Sv,m as Cv,n as Pde,p as wv,s as Fde,u as Ide}from"../chunks/CGrPdQPS.js";import{d as Tv,f as Lde,g as Rde,h as zde,i as Bde,m as Ev,n as Dv,o as Ov,p as Vde,s as Hde,t as Ude,u as Wde}from"../chunks/DCAyzoQs.js";import{a as kv,c as Gde,f as Av,g as Kde,h as qde,i as jv,l as Mv,m as Nv,n as Jde,o as Pv,r as Yde,t as Xde,u as Zde,v as Qde,y as $de}from"../chunks/C9sI3Ts9.js";import{S as efe,_ as tfe,a as nfe,b as rfe,c as ife,f as afe,g as ofe,h as sfe,i as cfe,l as Fv,n as Iv,o as lfe,p as ufe,r as Lv,t as dfe,x as ffe,y as pfe}from"../chunks/Cn8pMisG.js";import{r as mfe}from"../chunks/D2GNDUCR.js";import{o as hfe,r as gfe,s as Rv}from"../chunks/CxPpKooY.js";import{i as _fe,n as vfe,r as yfe}from"../chunks/C_0LxCVy.js";import{f as zv,g as bfe,h as xfe,i as Sfe,l as Bv,m as Vv,n as Hv,s as Uv,t as Cfe,u as Wv}from"../chunks/CXx8BtGS.js";import{i as wfe,r as Gv,s as Kv,t as qv}from"../chunks/DLxKOJr3.js";import{a as Jv,n as Tfe,t as Yv}from"../chunks/Cm95ymFa.js";import{a as Efe,i as Dfe,r as Xv}from"../chunks/CA4nUoYT.js";import{c as Ofe,l as kfe,r as Afe,s as jfe,t as Mfe,u as Nfe}from"../chunks/DntlYlvK.js";import{i as Zv,n as Pfe,o as Qv,s as Ffe,t as Ife}from"../chunks/CzZ9Zc-O.js";import{a as $v,n as ey,o as ty}from"../chunks/Crvo8itx.js";import{C as ny,S as Lfe,_ as ry,a as iy,b as Rfe,c as zfe,d as Bfe,f as Vfe,h as ay,i as oy,l as Hfe,m as sy,o as cy,p as Ufe,r as ly,s as Wfe,t as uy,u as dy,x as Gfe}from"../chunks/B9ryHuDY.js";import{a as Kfe,i as qfe,s as Jfe,t as Yfe}from"../chunks/IQtkpfKe.js";import{A as Xfe,D as Zfe,E as Qfe,O as fy,S as py,T as $fe,_ as epe,a as my,c as hy,d as tpe,f as gy,g as _y,h as vy,i as npe,j as rpe,k as ipe,l as ape,m as ope,n as yy,o as spe,p as cpe,r as lpe,s as by,t as xy,u as Sy,v as Cy,w as wy,y as Ty}from"../chunks/BzpBc7U9.js";import{i as upe}from"../chunks/DWQN_xAm.js";import{a as dpe,f as fpe,i as Ey,l as Dy,m as ppe,p as mpe,r as Oy,s as ky}from"../chunks/jQJLnOwW.js";import{A as hpe,C as Ay,D as jy,E as gpe,M as _pe,O as My,S as Ny,T as vpe,_ as ype,a as Py,b as Fy,d as Iy,f as Ly,g as Ry,h as zy,i as By,j as bpe,k as xpe,l as Spe,m as Vy,n as Cpe,o as wpe,p as Hy,r as Tpe,s as Uy,t as Wy,u as Epe,v as Dpe,w as Ope,x as kpe,y as Ape}from"../chunks/BzbV_h8t.js";import{_ as jpe,a as Mpe,c as Npe,d as Ppe,f as Fpe,h as Gy,l as Ipe,m as Ky,n as Lpe,p as Rpe,r as qy,s as zpe,t as Bpe,u as Jy,v as Vpe}from"../chunks/ClwBzIQ-.js";import{r as Hpe,t as Yy}from"../chunks/3j5uC-iK.js";import{a as Upe,c as Xy,i as Wpe,l as Zy,n as Gpe,o as Qy,r as $y,t as eb}from"../chunks/CasDg9wQ.js";import{a as tb,c as nb,f as Kpe,i as qpe,l as rb,n as Jpe,r as ib,s as Ype,t as ab}from"../chunks/DppBhVJN.js";import{n as ob}from"../chunks/0bhPPwi_.js";import{a as sb,g as Xpe,i as cb,l as lb,m as ub,p as Zpe,r as Qpe,s as $pe,t as eme,u as tme}from"../chunks/BJ0rLy3v.js";import{a as db,i as nme,n as fb,r as pb,s as mb,t as rme}from"../chunks/B-vg3xF-.js";import{a as ime,t as ame}from"../chunks/BU4vuoSr.js";import{a as hb,c as gb,d as ome,f as _b,g as vb,h as yb,i as bb,l as sme,m as cme,n as lme,o as xb,p as ume,r as dme,s as fme,t as pme,u as Sb}from"../chunks/Cxv3VV5O.js";import{a as mme,t as Cb}from"../chunks/Bx-g6jrJ.js";import{C as wb,D as hme,E as gme,O as _me,S as Tb,T as vme,_ as Eb,a as yme,c as bme,d as Db,f as Ob,g as xme,h as Sme,k as kb,l as Cme,m as wme,n as Tme,o as Ab,p as Eme,r as Dme,s as jb,u as Mb,v as Ome,w as kme,x as Ame,y as jme}from"../chunks/CFe4PVuz.js";import{a as Nb,n as Mme,o as Nme,r as Pb,t as Fb}from"../chunks/Blg3WApt.js";import{_ as Pme,a as Ib,c as Fme,d as Ime,f as Lb,g as Lme,h as Rme,i as zme,l as Bme,m as Rb,n as zb,p as Vme,r as Hme,s as Ume,t as Bb,u as Vb,v as Hb,y as Ub}from"../chunks/qxGgLbp0.js";import{C as Wme,S as Wb,_ as Gme,a as Kme,b as qme,c as Gb,d as Kb,f as Jme,g as qb,h as Yme,i as Jb,l as Xme,n as Yb,o as Zme,p as Xb,s as Zb,u as Qb,v as $b,x as ex,y as tx}from"../chunks/CGRZ9B4G.js";
2import{d as nx,f as Qme,i as $me,l as rx,n as ehe,o as ix,p as the,r as ax,s as nhe,t as rhe,u as ox}from"../chunks/BQtImTAG.js";import{a as ihe,i as ahe,r as sx}from"../chunks/sLhRiJ44.js";import{a as ohe,c as cx,d as she,f as lx,g as che,h as lhe,l as uhe,m as ux,n as dhe,o as dx,p as fx,r as px,s as fhe,t as phe,u as mhe}from"../chunks/Dl8xgxdz.js";import{a as hhe,i as mx,o as ghe,r as hx,t as gx}from"../chunks/DPHhWEAA.js";import{t as _he}from"../chunks/DO2bN3uA.js";import{n as vhe,r as yhe,t as bhe}from"../chunks/D3InB-8l.js";import{n as _x}from"../chunks/CC2Qu5mz.js";import{a as xhe,c as vx,d as yx,i as She,l as Che,n as bx,o as xx,r as whe,s as The,t as Ehe,u as Sx}from"../chunks/DBHVHnyQ.js";import{n as Dhe,r as Cx,t as wx}from"../chunks/BT8VXtzF.js";import{a as Tx,c as Ohe,d as khe,i as Ahe,l as jhe,n as Ex,o as Dx,r as Ox,s as kx,t as Mhe,u as Nhe}from"../chunks/Bz_IibO6.js";import{a as Ax,c as jx,l as Phe,n as Fhe,o as Ihe,r as Mx,s as Lhe,t as Rhe}from"../chunks/CJd7nfQm.js";import{C as zhe,D as Nx,E as Bhe,S as Px,T as Fx,_ as Ix,a as Vhe,b as Hhe,c as Uhe,d as Whe,f as Ghe,g as Khe,h as qhe,i as Jhe,l as Lx,m as Rx,n as Yhe,p as Xhe,r as Zhe,t as zx,u as Qhe,v as $he,w as ege,x as tge,y as nge}from"../chunks/DvLpQ4O4.js";import{n as Bx,r as Vx,t as rge}from"../chunks/UvpzYuP4.js";import{i as ige,n as age,t as oge}from"../chunks/CHMVzUK_.js";import{$ as Hx,A as Ux,B as Wx,C as Gx,D as sge,E as Kx,F as cge,G as qx,H as Jx,I as Yx,J as lge,K as Xx,L as Zx,M as Qx,N as $x,O as eS,P as uge,Q as tS,R as nS,S as dge,T as rS,U as iS,V as aS,W as oS,X as sS,Y as cS,Z as lS,_ as fge,a as uS,b as dS,c as fS,d as pS,et as mS,f as hS,g as gS,h as _S,i as vS,j as yS,k as bS,l as pge,m as mge,n as hge,o as xS,p as SS,q as CS,r as gge,s as wS,t as TS,u as _ge,v as ES,w as DS,x as OS,y as vge,z as yge}from"../chunks/YoVcPx9O.js";import{a as kS,c as AS,d as jS,f as MS,i as NS,n as bge,o as PS,p as FS,r as IS,s as xge,t as Sge,u as LS}from"../chunks/CvPh4fW6.js";import{n as Cge,r as wge}from"../chunks/Ducu8QRi.js";import{i as Tge}from"../chunks/DIQQc5X8.js";import{a as Ege,i as RS,n as Dge,r as Oge,t as kge}from"../chunks/CfhcXg-b.js";import{a as Age,c as jge,i as zS,l as BS,o as Mge,s as VS,t as HS}from"../chunks/WtwIK9_h.js";import{a as US,n as Nge,r as WS,t as GS}from"../chunks/DR3C1yxy.js";import{n as KS}from"../chunks/CxvgeWoJ.js";import{A as qS,B as JS,C as Pge,D as YS,E as Fge,F as Ige,L as Lge,M as XS,N as ZS,O as QS,P as $S,R as eC,S as tC,T as nC,V as rC,_ as iC,a as Rge,b as aC,c as oC,d as sC,f as cC,g as lC,h as zge,i as uC,j as Bge,k as dC,l as Vge,m as Hge,n as Uge,o as Wge,p as Gge,r as Kge,s as fC,t as pC,u as mC,v as hC,w as gC,x as qge,y as Jge,z as _C}from"../chunks/Disq1e65.js";import{i as Yge,n as vC,t as yC}from"../chunks/DLLblqNm.js";import{n as Xge,t as Zge}from"../chunks/U6gbcL6u.js";import{a as Qge,c as bC,d as $ge,f as xC,h as e_e,i as SC,l as CC,m as t_e,n as n_e,o as r_e,r as wC,s as i_e,t as TC,u as a_e}from"../chunks/BaYl6d8w.js";import{c as EC,d as o_e,f as DC,l as OC,o as kC,r as s_e,u as c_e}from"../chunks/ZKRTTRy9.js";import{a as AC,c as l_e,i as jC,l as u_e,n as MC,o as d_e,s as f_e,t as p_e,u as NC}from"../chunks/BcmHqZM8.js";import{a as m_e,d as h_e,i as g_e,l as __e,n as v_e,o as PC,r as y_e,s as FC,t as b_e,u as x_e}from"../chunks/Cc_6mL_R.js";import{a as S_e,n as IC,o as C_e,r as LC,t as w_e}from"../chunks/D3_Ci_q7.js";import{a as T_e,i as E_e,n as RC,o as zC,r as D_e,s as BC,t as VC}from"../chunks/Bym6LCTQ.js";import{a as HC,c as O_e,d as k_e,f as UC,i as WC,l as A_e,m as GC,o as KC,p as qC,r as JC,s as YC,t as j_e,u as XC}from"../chunks/1k3l-bGq.js";import{i as M_e,o as N_e,r as ZC,s as P_e}from"../chunks/B0KvD6nJ.js";import{c as F_e,n as I_e,r as L_e,t as R_e}from"../chunks/B9v_h88R.js";import{C as z_e,E as B_e,T as V_e,_ as QC,a as H_e,b as $C,f as U_e,i as W_e,m as G_e,p as K_e,u as ew,v as q_e,w as tw,x as nw}from"../chunks/GHgPLyqk.js";import{a as rw,c as J_e,i as iw,o as aw,r as Y_e,s as X_e,t as Z_e}from"../chunks/C4qNvMun.js";import{_ as Q_e,a as ow,c as $_e,d as sw,f as eve,g as cw,i as tve,l as lw,m as nve,n as rve,o as ive,p as uw,r as ave,s as ove,t as sve,u as cve,v as lve}from"../chunks/CMuobrDT.js";import{a as uve,i as dve,n as fve,o as dw,r as pve,t as fw}from"../chunks/CwF7Tkpg.js";import{n as mve,t as hve}from"../chunks/5ONLzIKf.js";import{a as gve,i as _ve,n as vve,o as yve,t as pw}from"../chunks/7eiqWfKe.js";import{a as bve,i as mw,n as xve,r as Sve}from"../chunks/25zxRAGP.js";import{a as Cve,i as hw,n as gw,o as _w,r as wve,t as Tve}from"../chunks/BUdNwSAD.js";import{a as vw,c as Eve,d as yw,i as Dve,l as Ove,n as kve,o as Ave,s as jve,t as Mve,u as Nve}from"../chunks/B-YVrFDF.js";var bw=[[`*`,()=>$(()=>import(`../chunks/BjxZzSo2.js`).then(e=>e.O),__vite__mapDeps([0,1,2,3,4]),import.meta.url)],[`*`,()=>$(()=>import(`../chunks/C20P4rQ5.js`).then(e=>e.u),__vite__mapDeps([5,1,2,6,3]),import.meta.url)],[`*`,()=>$(()=>import(`../chunks/BsYsIQqH.js`).then(e=>e.m),__vite__mapDeps([7,1,2,3]),import.meta.url)],[`kit`,()=>$(()=>import(`../chunks/D5yrmAF2.js`).then(e=>e.l),__vite__mapDeps([8,1,2,6,9,0,3,4,5,10,11,12,13,14]),import.meta.url)],[`kitEntities`,()=>$(()=>import(`../chunks/BEGKUHeU.js`),[],import.meta.url)],[`behaviours`,()=>$(()=>import(`../chunks/BuiBbCDp.js`),[],import.meta.url)],[`meshEdit`,()=>$(()=>import(`../chunks/-1P4KsUQ.js`).then(e=>e.f),__vite__mapDeps([15,1,2,3,9,0,4,5,6,16,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94]),import.meta.url)],[`perf`,()=>$(()=>import(`../chunks/GHgPLyqk.js`).then(e=>e.g),__vite__mapDeps([95,1,2,37,3,0,4,38,39,40,41,9,19,21,26,27,70,20,96,97,98]),import.meta.url)],[`perfDetailed`,()=>$(()=>import(`../chunks/2MySZksn.js`),[],import.meta.url)],[`perfBeacon`,()=>$(()=>import(`../chunks/C4qNvMun.js`).then(e=>e.n),__vite__mapDeps([99,1,2,3,0,4,5,6,19,100,97,98,95,37,38,39,40,41,9,21,26,27,70,20,96]),import.meta.url)],[`staleModules`,()=>$(()=>import(`../chunks/oYjzKsjL.js`),[],import.meta.url)],[`perfMoment`,()=>$(()=>import(`../chunks/BVyq38Vq.js`),[],import.meta.url)],[`profilerView`,()=>$(()=>import(`../chunks/DwYvSxx6.js`),__vite__mapDeps([101,1,2,6,5,3]),import.meta.url)],[`profilerModel`,()=>$(()=>import(`../chunks/DR72z4et.js`),__vite__mapDeps([102,97,98,1]),import.meta.url)],[`vrRecIndicator`,()=>$(()=>import(`../chunks/D_kEQWzr.js`).then(e=>e.r),__vite__mapDeps([103,1,2,9,0,3,4,19,104]),import.meta.url)],[`tours`,()=>$(()=>import(`../chunks/BT8VXtzF.js`).then(e=>e.i),__vite__mapDeps([105,1,2,3]),import.meta.url)],[`toursBuiltin`,()=>$(()=>import(`../chunks/CJd7nfQm.js`).then(e=>e.i),__vite__mapDeps([106,1,2,3,4,0,5,6,107,105,108,21]),import.meta.url)],[`tourVR`,()=>$(()=>import(`../chunks/C0ORrlfb.js`),[],import.meta.url)],[`xrOffer`,()=>$(()=>import(`../chunks/D11ETurt.js`),[],import.meta.url)],[`perfLiveSource`,()=>$(()=>import(`../chunks/B6YQZQvL.js`),[],import.meta.url)],[`perfLiveSink`,()=>$(()=>import(`../chunks/B-YVrFDF.js`).then(e=>e.r),__vite__mapDeps([109,1,2,0,3,4,5,6,110,10,76,111,69,9,44,70,20,21,19,7,13,55,72,73,74,75,77,78,67,71,79,112,113,114,45,46,50,47,8,11,12,14,27,48,49,18,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,68,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,124,125,126,100,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98,169,170,97,95,96]),import.meta.url)],[`perfLiveWire`,()=>$(()=>import(`../chunks/ZKRTTRy9.js`).then(e=>e.s),__vite__mapDeps([170,1]),import.meta.url)],[`vrControls`,()=>$(()=>import(`../chunks/C_0LxCVy.js`).then(e=>e.t),__vite__mapDeps([171,1,2,9,0,3,4,5,6,114,11,46,45,49,47,8,10,12,13,14,27,48,26,32,30,31,56,19,54,60,24,20,21,23,25,28,29,34,35,36,37,38,39,40,41,7,42,22,43,44,50,16,51,52,53,55,33,57,58,59,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,88,93,94,89,90,91,92,15,113,115,116,117,118,119,120,121,122,123,112,132,130,131,159,160,161,172,173,104,174,139,140,141,138,175,157,158,135,136,137,176,96,177,154,142,178,156,125,126,100,127,128,129,133,134,162,155,163,143,164,153,144,145,146,147,148,149,150,151,152,179,180,181,107,182,183,184,185,186,187,188,189,190]),import.meta.url)],[`autosave`,()=>$(()=>import(`../chunks/jQJLnOwW.js`).then(e=>e.o),__vite__mapDeps([153,1,2,6,3,9,0,4,38,40,69,44,5,70,20,21,7,13,10,25,48,14,55,32,30,31,18,19,22,23,11,12,8,24,26,27,28,29,33,34,35,36,37,39,41,42,43,45,46,47,49,50,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,125,126,100,127,128,129,130,131,132,133,17,87,134,135,117,118,119,120,121,136,137,139,140,141,138,154,123,155,143,144,145,146,147,148,149,150,151,152]),import.meta.url)],[`voiceChat`,()=>$(()=>import(`../chunks/6jSIVKmy.js`).then(e=>e.g),__vite__mapDeps([159,1,2,3,0,4,5,6,53,29,10,160,161,9]),import.meta.url)],[`audioEngine`,()=>$(()=>import(`../chunks/H61HIjkG.js`).then(e=>e.t),__vite__mapDeps([29,1,10,2]),import.meta.url)],[`musicClock`,()=>$(()=>import(`../chunks/DntlYlvK.js`).then(e=>e.n),__vite__mapDeps([143,1,2,5,6,3,10,7,22,29,76,17,9,0,4,18,19,20,21,23,11,12,13,8,14,24,25,26,27,28,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84,85,86,87]),import.meta.url)],[`audioDevices`,()=>$(()=>import(`../chunks/CGrPdQPS.js`).then(e=>e.r),__vite__mapDeps([140,1,2,9,0,3,4,5,6,10,22,29,17,18,19,7,20,21,23,11,12,13,8,14,24,25,26,27,28,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,141,138]),import.meta.url)],[`audioPatch`,()=>$(()=>import(`../chunks/DCAyzoQs.js`).then(e=>e.a),__vite__mapDeps([139,1,2,3,9,0,4,5,6,10,29,82,74,17,18,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,75,76,77,78,79,80,81,83,84,85,86,87,140,141,138]),import.meta.url)],[`vrPatch`,()=>$(()=>import(`../chunks/DKikWXRg.js`),[],import.meta.url)],[`musicToolbox`,()=>$(()=>import(`../chunks/APHIl06N.js`),[],import.meta.url)],[`micCapture`,()=>$(()=>import(`../chunks/AArhseWI.js`),__vite__mapDeps([191,1,2,69,9,44,5,6,3,70,20,21,71,72,10,73,74,75,76,77,0,4,78,67,79]),import.meta.url)],[`annotationsHandler`,()=>$(()=>import(`../chunks/BzbV_h8t.js`).then(e=>e.c),__vite__mapDeps([164,1,2,3,9,0,4,5,6,113,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,153,125,126,100,127,128,129,130,131,132,133,134,135,136,137,139,140,141,138,154,155,143,144,145,146,147,148,149,150,151,152]),import.meta.url)],[`flowRuntime`,()=>$(()=>import(`../chunks/jUHDc502.js`).then(e=>e.m),__vite__mapDeps([18,1,2,6,3,9,0,4,5,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86]),import.meta.url)],[`history`,()=>$(()=>import(`../chunks/CVZBB9nh.js`).then(e=>e.s),__vite__mapDeps([17,1,2,9,0,3,4,5,6,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87]),import.meta.url)],[`materialsHandler`,()=>$(()=>import(`../chunks/CXx8BtGS.js`).then(e=>e.c),__vite__mapDeps([154,1,2,6,9,0,3,4,5,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,123]),import.meta.url)],[`objectActions`,()=>$(()=>import(`../chunks/BFaBkNqh.js`).then(e=>e._),__vite__mapDeps([113,1,2,6,9,0,3,4,5,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url)],[`commandsHandler`,()=>$(()=>import(`../chunks/ClwBzIQ-.js`).then(e=>e.o),__vite__mapDeps([156,1,2,6,3,9,0,4,38,69,44,5,70,20,21,10,24,23,8,11,12,13,14,25,43,27,55,7,34,19,35,36,37,39,40,41,42,22,45,46,47,48,49,50,16,51,52,53,54,26,28,29,31,56,32,30,33,57,58,59,18,60,61,62,63,64,65,66,67,68,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,117,118,119,120,121,125,126,100,127,128,129,130,131,157,115,116,158,112,113,114,122,93,88,94,89,90,91,92,15,123,159,160,161,133,134,162,135,136,137,140,141,138,154,155,163,143,164,153,132,139,144,145,146,147,148,149,150,151,152]),import.meta.url)],[`moduleSDK`,()=>$(()=>import(`../chunks/DaA5bz6U.js`).then(e=>e.u),__vite__mapDeps([34,1,2,3,5,6,19,21,20,35,24,0,4,23,8,9,10,11,12,13,14,25,36,37,38,39,40,41,7,42,22,43,44,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59]),import.meta.url)],[`moduleLifecycle`,()=>$(()=>import(`../chunks/DP2QZd51.js`),__vite__mapDeps([192,1,2,6,9]),import.meta.url)],[`drawMode`,()=>$(()=>import(`../chunks/BMi8Y9lh.js`).then(e=>e.o),__vite__mapDeps([172,1,2,9,0,3,4,5,6,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87]),import.meta.url)],[`pathCapture`,()=>$(()=>import(`../chunks/Cfqz5Nlw.js`),[],import.meta.url)],[`lockControl`,()=>$(()=>import(`../chunks/CFRD5164.js`).then(e=>e.i),__vite__mapDeps([112,1,2,0,3,4,5,6,113,9,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url)],[`prefabs`,()=>$(()=>import(`../chunks/C9sI3Ts9.js`).then(e=>e.p),__vite__mapDeps([174,1,2,6,9,0,3,4,5,70,20,21,67,17,18,10,19,7,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,69,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,113,114,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,139,140,141,138]),import.meta.url)],[`physics`,()=>$(()=>import(`../chunks/B3B8hjh_.js`).then(e=>e.v),__vite__mapDeps([157,1,2,6,9,0,3,4,38,39,5,7,48,10,14,32,13,30,31,57,58,18,19,20,21,22,23,11,12,8,24,25,26,27,28,29,33,34,35,36,37,40,41,42,43,44,45,46,47,49,50,16,51,52,53,54,55,56,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,158,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url)],[`sim`,()=>$(()=>import(`../chunks/DPzg6c3C.js`),__vite__mapDeps([193,43,1,9,44,57,58,18,2,6,3,0,4,5,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,45,46,47,48,49,50,16,51,52,53,54,55,56,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,157,17,87,115,116,158,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,194]),import.meta.url)],[`joints`,()=>$(()=>import(`../chunks/PRGScv09.js`).then(e=>e.u),__vite__mapDeps([115,1,2,9,0,3,4,5,6,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,116]),import.meta.url)],[`possess`,()=>$(()=>import(`../chunks/Bn62zCip.js`),[],import.meta.url)],[`
2handModels`,()=>$(()=>import(`../chunks/C5fdiIrF.js`),[],import.meta.url)],[`terrainSculpt`,()=>$(()=>import(`../chunks/Clg5P5KY.js`).then(e=>e.m),__vite__mapDeps([195,1,2,9,0,3,4,5,6,87,93,16,74,67,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,73,75,76,77,78,79,80,81,82,83,84,85,86,88,94,89,90,91,92,113,114,115,116,117,118,119,120,121,122,15,123,112]),import.meta.url)],[`userModules`,()=>$(()=>import(`../chunks/Cxv3VV5O.js`).then(e=>e._),__vite__mapDeps([168,1,2,6,5,3,21,34,19,20,35,24,0,4,23,8,9,10,11,12,13,14,25,36,37,38,39,40,41,7,42,22,43,44,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59,70,75,128,98]),import.meta.url)],[`environment`,()=>$(()=>import(`../chunks/RGhdMv3a.js`).then(e=>e.b),__vite__mapDeps([135,1,2,3,9,0,4,5,6,10,24,20,21,23,8,11,12,13,14,25,34,19,35,36,37,38,39,40,41,7,42,22,43,44,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59,70,82,74,117,18,60,61,62,63,64,65,66,67,68,69,71,72,73,75,76,77,78,79,80,81,83,84,85,86,118,17,87,119,120,121,136,137]),import.meta.url)],[`sceneMusic`,()=>$(()=>import(`../chunks/DSpIxIHb.js`).then(e=>e.l),__vite__mapDeps([138,1,2,3,69,9,44,5,6,70,20,21,10,29,71,72,73,74,75,76,77,0,4,78,67,79]),import.meta.url)],[`animatedImports`,()=>$(()=>import(`../chunks/BjCq3V-c.js`).then(e=>e.i),__vite__mapDeps([133,1,2,6,9,0,3,4,69,44,5,70,20,21,126,100,36,37,38,39,40,41,10,7,42,35,22,23,12,13,8,11,14,24,25,43,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,19,32,30,33,57,58,59,34,17,18,60,61,62,63,64,65,66,67,68,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,129]),import.meta.url)],[`fileHandler`,()=>$(()=>import(`../chunks/WtwIK9_h.js`).then(e=>e.n),__vite__mapDeps([196,1,2,6,3,9,0,4,69,44,5,70,20,21,126,100,18,10,19,7,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,116,125,127,128,129,130,131,133,134,135,117,118,119,120,121,136,137,154,123,155,145,146,147,148,149,150,156,157,115,158,112,113,114,122,93,88,94,89,90,91,92,15,159,160,161,162,140,141,138,163,143,164,153,132,139,144,151,152,197,198,199,200]),import.meta.url)],[`fileWindows`,()=>$(()=>import(`../chunks/BK8cfPnv.js`),[],import.meta.url)],[`sceneBounds`,()=>$(()=>import(`../chunks/CRPwa2dn.js`).then(e=>e.t),__vite__mapDeps([136,1,2,6,9,0,3,4]),import.meta.url)],[`cameraClip`,()=>$(()=>import(`../chunks/B_NZq1Vk.js`).then(e=>e.t),__vite__mapDeps([187,1,2,3,0,4,136,6,9]),import.meta.url)],[`ping`,()=>$(()=>import(`../chunks/CasDg9wQ.js`).then(e=>e.s),__vite__mapDeps([179,1,2,3,9,0,4,5,6,112,113,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,180,159,160,161]),import.meta.url)],[`sessions`,()=>$(()=>import(`../chunks/CFe4PVuz.js`).then(e=>e.A),__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url)],[`geometryEdit`,()=>$(()=>import(`../chunks/CCneC5tF.js`).then(e=>e.r),__vite__mapDeps([118,1,2,9,0,3,4,5,6,43,44,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87]),import.meta.url)],[`lightParams`,()=>$(()=>import(`../chunks/pZHjd98a.js`).then(e=>e.s),__vite__mapDeps([137,1,2,6,3,9,37,0,4,38,39,40,41]),import.meta.url)],[`shadowDefaults`,()=>$(()=>import(`../chunks/BGYDxqRT.js`),[],import.meta.url)],[`palette`,()=>$(()=>import(`../chunks/YYIyJWdw.js`).then(e=>e.n),__vite__mapDeps([119,1]),import.meta.url)],[`viewModeCtl`,()=>$(()=>import(`../chunks/46Mv6zl1.js`).then(e=>e.i),__vite__mapDeps([82,1,2,6,9,0,3,4,74]),import.meta.url)],[`inputRuntime`,()=>$(()=>import(`../chunks/DppBhVJN.js`).then(e=>e.o),__vite__mapDeps([182,1,2,5,6,3,62,183,0,4,114,9,53,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,54,5
25,56,57,58,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,93,88,94,89,90,91,92,15,113,115,116,117,118,119,120,121,122,123,184,100,185,186,187,136,132,130,131,188,189,190]),import.meta.url)],[`shortcutsRegistry`,()=>$(()=>import(`../chunks/CgvSmoUN.js`).then(e=>e.p),__vite__mapDeps([183,1,2,6,3,0,4,5,114,9,53,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,93,88,94,89,90,91,92,15,113,115,116,117,118,119,120,121,122,123,184,100,185,186,187,136,132,130,131,188,189,190]),import.meta.url)],[`themes`,()=>$(()=>import(`../chunks/CwF7Tkpg.js`).then(e=>e.s),__vite__mapDeps([201,1,2,3]),import.meta.url)],[`textSelection`,()=>$(()=>import(`../chunks/BZD8v_67.js`),[],import.meta.url)],[`vrRadialMenu`,()=>$(()=>import(`../chunks/Cn8pMisG.js`).then(e=>e.C),__vite__mapDeps([175,1,2,6,0,3,4,19,113,9,5,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,157,158,112,159,160,161,135,136,137,174,139,140,141,138]),import.meta.url)],[`vrBindings`,()=>$(()=>import(`../chunks/BJ0rLy3v.js`).then(e=>e.c),__vite__mapDeps([107,1,2,3,0,4]),import.meta.url)],[`vrSettingsSchema`,()=>$(()=>import(`../chunks/DmO5J-YD.js`).then(e=>e.Ln),__vite__mapDeps([173,1,2,6,3,9,0,4,5,114,19,11,8,10,12,13,14,46,45,48,49,47,27,26,60,24,20,21,23,25,28,29,34,35,36,37,38,39,40,41,7,42,22,43,44,50,16,51,52,53,54,55,31,56,32,30,33,57,58,59,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,88,93,94,89,90,91,92,15,113,115,116,117,118,119,120,121,122,123,112,132,130,131,159,160,161,172,104,174,139,140,141,138,175,157,158,135,136,137,176,96,177,154,142,178,156,125,126,100,127,128,129,133,134,162,155,163,143,164,153,144,145,146,147,148,149,150,151,152,179,180,181,107]),import.meta.url)],[`vrTourTargets`,()=>$(()=>import(`../chunks/dGE5rT3f.js`),__vite__mapDeps([202,1,2,0,3,4,175,6,19,113,9,5,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,157,158,112,159,160,161,135,136,137,174,139,140,141,138]),import.meta.url)],[`vrPrefs`,()=>$(()=>import(`../chunks/Dhnl9weK.js`).then(e=>e.a),__vite__mapDeps([177,1,2,3]),import.meta.url)],[`vrPalette`,()=>$(()=>import(`../chunks/D2GNDUCR.js`).then(e=>e.i),__vite__mapDeps([176,1,9]),import.meta.url)],[`vrWindowPoses`,()=>$(()=>import(`../chunks/0bhPPwi_.js`).then(e=>e.s),__vite__mapDeps([181,1,2,3,9]),import.meta.url)],[`vrKeyboard`,()=>$(()=>import(`../chunks/Cm95ymFa.js`).then(e=>e.o),__vite__mapDeps([178,1,2]),import.meta.url)],[`faceEdit`,()=>$(()=>import(`../chunks/PZpczxDq.js`).then(e=>e.J),__vite__mapDeps([93,1,2,6,3,9,0,4,5,16,74,67,87,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,73,75,76,77,78,79,80,81,82,83,84,85,86,88,94,89,90,91,92]),import.meta.url)],[`meshToolParams`,()=>$(()=>import(`../chunks/Ix-Ye6gv.js`).then(e=>e.y),__vite__mapDeps([89,1,2]),import.meta.url)],[`avatarModel`,()=>$(()=>import(`../chunks/B3XJDrYC.js`),[],import.meta.url)],[`explorer`,()=>$(()=>import(`../chunks/DkMAWo2j.js`).then(e=>e.f),__vite__mapDeps([69,1,2,9,44,5,6,3,70,20,21]),import.meta.url)],[`bottomDock`,()=>$(()=>import(`../chunks/BcxdJoOt.js`).then(e=>e.s),__vite__mapDeps([73,1,2,74,3]),import.meta.url)],[`explorerDrop`,()=>$(()=>import(`../chunks/MphbKily.js`),[],import.meta.url)],[`assetShare`,()=>$(()=>import(`../chunks/DK5lI6Yq.js`).then(e=>e.l),__vite__mapDeps([71,1,2,6,69,9,44,5,3,70,20,21,72,10,73,74,75,76,77,0,4,78,67,79]),import.meta.url)],[`soundRuntime`,()=>$(()=>import(`../chunks/Z9AkIDqX.js`).then(e=>e.t),__vite__mapDeps([68,1,9,69,2,44,5,6,3,70,20,21,29,10,71,72,73,74,75,76,77,0,4,78,67,79]),import.meta.url)],[`dungeonPlay`,()=>$(()=>import(`../chunks/BsOJ7-Ui.js`).then(e=>e.n),__vite__mapDeps([85,1]),import.meta.url)],[`modelLoader`,()=>$(()=>import(`../chunks/DJY5u0_n.js`),__vite__mapDeps([203,1,2,9,0,3,4,41,69,44,5,6,70,20,21,126,100,25,127,128,129,162,204,125,40,130,131]),import.meta.url)],[`sceneAssets`,()=>$(()=>import(`../chunks/DBKwObGH.js`).then(e=>e.r),__vite__mapDeps([141,1,2,0,3,4,69,9,44,5,6,70,20,21,7,138,10,29,71,72,73,74,75,76,77,78,67,79]),import.meta.url)],[`THREE`,()=>$(()=>import(`../chunks/BC9AvlhT.js`).then(e=>e.a),__vite__mapDeps([9,1]),import.meta.url)],[`GLTFExporterModule`,()=>$(()=>import(`../chunks/B3hVquA_.js`).then(e=>e.n),__vite__mapDeps([155,1,9]),import.meta.url)],[`snapping`,()=>$(()=>import(`../chunks/DOnznRpt.js`).then(e=>e.a),__vite__mapDeps([114,1,2,3,9,0,4]),import.meta.url)],[`flowSockets`,()=>$(()=>import(`../chunks/RgmHI0Tj.js`),[],import.meta.url)],[`networkQuality`,()=>$(()=>import(`../chunks/CA4nUoYT.js`).then(e=>e.n),__vite__mapDeps([163,1,2,5,6,3]),import.meta.url)],[`packs`,()=>$(()=>import(`../chunks/hFv0pVtC.js`).then(e=>e.m),__vite__mapDeps([127,1,2,6,3,69,9,44,5,70,20,21,100,128,129]),import.meta.url)],[`customNodes`,()=>$(()=>import(`../chunks/DU8XGmWo.js`).then(e=>e.i),__vite__mapDeps([66,1,2,5,6,3,7]),import.meta.url)],[`nodesHandler`,()=>$(()=>import(`../chunks/y5Xg-5h5.js`).then(e=>e.u),__vite__mapDeps([55,1,2,6,5,3,7]),import.meta.url)],[`nodeCatalog`,()=>$(()=>import(`../chunks/CKu0qDqv.js`).then(e=>e.a),__vite__mapDeps([60,1,2,13,10,8,6,9,0,3,4,5,11,12,14,24,20,21,23,25,28,27,29,26,34,19,35,36,37,38,39,40,41,7,42,22,43,44,45,46,47,48,49,50,16,51,52,53,54,55,31,56,32,30,33,57,58,59,61,62]),import.meta.url)],[`objectMenu`,()=>$(()=>import(`../chunks/gil9v7kl.js`),[],import.meta.url)],[`animationPreview`,()=>$(()=>import(`../chunks/CLDrsr5a.js`).then(e=>e.l),__vite__mapDeps([134,1,2,9,0,3,4,5,6,10,7,18,19,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87]),import.meta.url)],[`aiProviders`,()=>$(()=>import(`../chunks/DlspKKDF.js`).then(e=>e.u),__vite__mapDeps([185,1,2,3]),import.meta.url)],[`aiTools`,()=>$(()=>import(`../chunks/CfhcXg-b.js`).then(e=>e.o),__vite__mapDeps([205,1,2,6,0,3,4,5,7,55,60,13,10,8,9,11,12,14,24,20,21,23,25,28,27,29,26,34,19,35,36,37,38,39,40,41,42,22,43,44,45,46,47,48,49,50,16,51,52,53,54,31,56,32,30,33,57,58,59,61,62,64,63,65,18,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,113,114,122,93,88,94,89,90,91,92,15,123,157,158,112,185,154,144,206,207,208]),import.meta.url)],[`aiAssistant`,()=>$(()=>import(`../chunks/BB99feom.js`),[],import.meta.url)],[`meshProvi
2ders`,()=>$(()=>import(`../chunks/CvPh4fW6.js`).then(e=>e.l),__vite__mapDeps([206,1,2,3]),import.meta.url)],[`meshJobs`,()=>$(()=>import(`../chunks/x-6eMXYe.js`),[],import.meta.url)],[`flowGraphsCtl`,()=>$(()=>import(`../chunks/CzZ9Zc-O.js`).then(e=>e.a),__vite__mapDeps([144,1,2,5,6,3,7,55,83,17,9,0,4,18,10,19,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87]),import.meta.url)],[`objectFlow`,()=>$(()=>import(`../chunks/aUqMHmzX.js`).then(e=>e.t),__vite__mapDeps([83,1,2,5,6,3,7]),import.meta.url)],[`peerServer`,()=>$(()=>import(`../chunks/BaYl6d8w.js`).then(e=>e.p),__vite__mapDeps([209,1,2,3]),import.meta.url)],[`cloudHooks`,()=>$(()=>import(`../chunks/B-FqU4_J.js`).then(e=>e.r),__vite__mapDeps([78,1,2]),import.meta.url)],[`cloudPlugin`,()=>$(()=>import(`../chunks/HNZigDPa.js`),[],import.meta.url)],[`connectionState`,()=>$(()=>import(`../chunks/BkI0w2NH.js`).then(e=>e.u),__vite__mapDeps([76,1,2,3,10]),import.meta.url)],[`peerApproval`,()=>$(()=>import(`../chunks/DLxKOJr3.js`).then(e=>e.o),__vite__mapDeps([142,1,2,5,6,3,76,10]),import.meta.url)],[`particleRuntime`,()=>$(()=>import(`../chunks/BWbaIg1O.js`).then(e=>e.r),__vite__mapDeps([81,1,2,9,37,3,0,4,38,39,40,41,5,6,61,82,74]),import.meta.url)],[`particleActions`,()=>$(()=>import(`../chunks/C26QHWbw.js`).then(e=>e.r),__vite__mapDeps([158,1,2,0,3,4,5,6,10,61,81,9,37,38,39,40,41,82,74,17,18,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,62,63,64,65,66,67,68,69,70,71,72,73,75,76,77,78,79,80,83,84,85,86,87]),import.meta.url)],[`particlePresets`,()=>$(()=>import(`../chunks/XGXlAIBr.js`).then(e=>e.i),__vite__mapDeps([61,1]),import.meta.url)],[`waterVolumes`,()=>$(()=>import(`../chunks/BMJE9YdN.js`).then(e=>e.i),__vite__mapDeps([57,1,58]),import.meta.url)],[`waterRuntime`,()=>$(()=>import(`../chunks/D3InB-8l.js`).then(e=>e.a),__vite__mapDeps([210,1,2,9,37,3,0,4,38,39,40,41,10,46,58,57,59,67,211]),import.meta.url)],[`waterPresets`,()=>$(()=>import(`../chunks/DQ5lfDIw.js`).then(e=>e.o),__vite__mapDeps([59,1,58]),import.meta.url)],[`waterActions`,()=>$(()=>import(`../chunks/DBHVHnyQ.js`).then(e=>e.f),__vite__mapDeps([212,1,2,3,0,4,5,6,57,58,59,17,9,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,210,211]),import.meta.url)],[`waterPrefs`,()=>$(()=>import(`../chunks/CC2Qu5mz.js`).then(e=>e.t),__vite__mapDeps([211,1,2,3]),import.meta.url)],[`waterSdk`,()=>$(()=>import(`../chunks/DvEdIpCM.js`).then(e=>e.r),__vite__mapDeps([36,1,2,6,9,37,3,0,4,38,39,40,41,5,10,7,42,35,20,21,22,23,12,13,8,11,14,24,25,43,44,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,19,32,30,33,57,58,59]),import.meta.url)],[`waterVrPanels`,()=>$(()=>import(`../chunks/DmO5J-YD.js`).then(e=>e.ft),__vite__mapDeps([173,1,2,6,3,9,0,4,5,114,19,11,8,10,12,13,14,46,45,48,49,47,27,26,60,24,20,21,23,25,28,29,34,35,36,37,38,39,40,41,7,42,22,43,44,50,16,51,52,53,54,55,31,56,32,30,33,57,58,59,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,88,93,94,89,90,91,92,15,113,115,116,117,118,119,120,121,122,123,112,132,130,131,159,160,161,172,104,174,139,140,141,138,175,157,158,135,136,137,176,96,177,154,142,178,156,125,126,100,127,128,129,133,134,162,155,163,143,164,153,144,145,146,147,148,149,150,151,152,179,180,181,107]),import.meta.url)],[`version`,()=>$(()=>import(`../chunks/Cpr6SAIt.js`).then(e=>e.a),__vite__mapDeps([21,1]),import.meta.url)],[`whatsNew`,()=>$(()=>import(`../chunks/Bz_IibO6.js`).then(e=>e.f),__vite__mapDeps([108,1,2,3,5,6,21]),import.meta.url)],[`confirmDialog`,()=>$(()=>import(`../chunks/lbEFI-P1.js`).then(e=>e.n),__vite__mapDeps([75,1,2]),import.meta.url)],[`scenePhysics`,()=>$(()=>import(`../chunks/qM7mvJO0.js`).then(e=>e.p),__vite__mapDeps([48,1,2,5,6,3,10,14]),import.meta.url)],[`playInteract`,()=>$(()=>import(`../chunks/D52m1aMD.js`),[],import.meta.url)],[`moveSmoothing`,()=>$(()=>import(`../chunks/DvHa9y6q.js`),[],import.meta.url)],[`knock`,()=>$(()=>import(`../chunks/dqdJv3xh.js`),[],import.meta.url)],[`playSettings`,()=>$(()=>import(`../chunks/XhqYKcwG.js`).then(e=>e.r),__vite__mapDeps([47,1,2,5,6,3,8,9,0,4,10,11,12,13,14,45,46,27,48,49]),import.meta.url)],[`colliderSpec`,()=>$(()=>import(`../chunks/Dsarg3vf.js`).then(e=>e.r),__vite__mapDeps([80,1,9]),import.meta.url)],[`colliderHelpers`,()=>$(()=>import(`../chunks/B5OvgZy9.js`),[],import.meta.url)],[`colliderDecompose`,()=>$(()=>import(`../chunks/CiD-lDCf.js`),[],import.meta.url)],[`colliderEdit`,()=>$(()=>import(`../chunks/Dn6HR0pC.js`),[],import.meta.url)],[`editSession`,()=>$(()=>import(`../chunks/BrcMZxWh.js`).then(e=>e.t),__vite__mapDeps([88,1,17,2,9,0,3,4,5,6,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87]),import.meta.url)],[`trackpadNav`,()=>$(()=>import(`../chunks/BKGjJWjU.js`),[],import.meta.url)],[`vrSleeve`,()=>$(()=>import(`../chunks/5ONLzIKf.js`).then(e=>e.r),__vite__mapDeps([213,1,2,9,0,3,4,5,6,114,25,43,44,18,10,19,7,20,21,22,23,11,12,13,8,14,24,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,117,118,119,120,121,132,130,131,173,88,93,94,89,90,91,92,15,113,115,116,122,123,112,159,160,161,172,104,174,139,140,141,138,175,157,158,135,136,137,176,96,177,154,142,178,156,125,126,100,127,128,129,133,134,162,155,163,143,164,153,144,145,146,147,148,149,150,151,152,179,180,181,107,171,182,183,184,185,186,187,188,189,190]),import.meta.url)],[`gridSettings`,()=>$(()=>import(`../chunks/BROAL0jj.js`),[],import.meta.url)],[`viewPrefs`,()=>$(()=>import(`../chunks/CTcfFpCM.js`).then(e=>e.o),__vite__mapDeps([74,1,2,3]),import.meta.url)],[`cameraBookmarks`,()=>$(()=>import(`../chunks/BQPZE1D9.js`).then(e=>e.r),__vite__mapDeps([186,1,2,3,0,4,5,6,113,9,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,187,136]),import.meta.url)],[`cameraObjects`,()=>$(()=>import(`../chunks/BQtImTAG.js`).then(e=>e.a),__vite__mapDeps([214,1,2,9,0,3,4,5,6,46,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,113,114,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url)],[`cameraHelpers`,()=>$(()=>import(`../chunks/sLhRiJ44.js`).then(e=>e.t),__vite__mapDeps([215,1,2,3,9,0,4,46,82,6,74,214,5,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,75,76,77,78,79,80,81,83,84,85,86,87,113,114,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url)],[`onionSkin`,()=>$(()=>import(`../chunks/DVd13MSK.js`),[],import.meta.url)],[`cameraPreview`,()=>$(()=>import(`../chunks/Dl8xgxdz.js`).then(e=>e.i),__vite__mapDeps([216,1,2,9,0,3,4,5,6,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,214,113,114,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,215]),import.meta.url)],[`addObjects`,()=>$(()=>import(`../chunks/C2taVf9R.js`),[],import.meta.url)],[`cameraPip`,()=>$(()=>import(`../chunks/DM1rB6Yy.js`),[],import.meta.url)],[`inputDevice`,()=>$(()=>import(`../chunks/B3u1aZXl.js`).then(e=>e.r),__vite__mapDeps([4,1]),import.meta.url)],[`sceneTemplates`,()=>$(()=>import(`../chunks/CMuobrDT.js`).then(e=>e.h),__vite__mapDeps([217,1,2,6,0,3,4,5,78,77,67,128,167,7,24,20,21,23,8,9,10,11,12,13,14,25,27,34,19,35,36,37,38,39,40,41,42,22,43,44,45,46,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59,75,165,140,17,18,60,61,62,63,64,65,66,68,69,70,71,72,73,74,76,79,80,81,82,83,84,85,86,87,141,138,166,168,98]),import.meta.url)],[`bvhPicking`,()=>$(()=>import(`../chunks/ChLhRQ1-.js`).then(e=>e.t),__vite__mapDeps([218,1,9]),import.meta.url)],[`multiTransform`,()=>$(()=>import(`../chunks/C8JN8I_B.js`).then(e=>e.i),__vite__mapDeps([122,1,2,6,3,9,0,4,5,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,116]),import.meta.url)],[`objectOrigin`,()=>$(()=>import(`../chunks/D0hOvpYG.js`).then(e=>e.r),__vite__mapDeps([116,1,2,9,0,3,4,5,6,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87]),import.meta.url)],[`moduleGallery`,()=>$(()=>import(`../chunks/B-vg3xF-.js`).then(e=>e.o),__vite__mapDeps([166,1,2,128]),import.meta.url)],[`uvEditor`,()=>$(()=>import(`../chunks/BkIaSe84.js`),__vite__mapDeps([219,87,1]),import.meta.url)],[`uvUnwrap`,()=>$(()=>import(`../chunks/U6gbcL6u.js`).then(e=>e.r),__vite__mapDeps([220,1,9]),import.meta.url)],[`meshTopology`,()=>$(()=>import(`../chunks/BLj0YJ2c.js`).then(e=>e.c),__vite__mapDeps([94,1,87]),import.meta.url)],[`meshBudget`,()=>$(()=>import(`../chunks/BaHcjt6-.js`).then(e=>e.a),__vite__mapDeps([87,1]),import.meta.url)],[`proportional`,()=>$(()=>import(`../chunks/BGdALAIZ.js`).then(e=>e.c),__vite__mapDeps([90,1,2,3]),import.meta.url)],[`proportionalRing`,()=>$(()=>import(`../chunks/CgnLB8Jc.js`).then(e=>e.n),__vite__mapDeps([91,1,2,9,0,3,4,90]),import.meta.url)],[`scenePick`,()=>$(()=>import(`../chunks/B1MDynJ-.js`).then(e=>e.r),__vite__mapDeps([221,1,2,9,0,3,4,218,93,6,5,16,74,67,87,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,73,75,76,77,78,79,80,81,82,83,84,85,86,88,94,89,90,91,92,15,195,113,114,115,116,117,118,119,120,121,122,123,112]),import.meta.url)],[`snapEngine`,()=>$(()=>import(`../chunks/0gjYRn5S.js`),[],import.meta.url)],[`meshPivot`,()=>$(()=>import(`../chunks/CZc3Gf_x.js`).then(e=>e.p),__vite__mapDeps([92,1,2,3,9,0,4,5,6,90]),import.meta.url)],[`selectionPrefs`,()=>$(()=>import(`../chunks/CH53TUjZ.js`),[],import.meta.url)],[`editOverlays`,()=>$(()=>import(`../chunks/COEUYYRa.js`).then(e=>e.n),__vite__mapDeps([67,1]),import.meta.url)],[`objectPermissions`,()=>$(()=>import(`../chunks/DzR0fZlA.js`).then(e=>e.a),__vite__mapDeps([77,1,2,0,3,4,5,6,78,67]),import.meta.url)],[`scenePost`,()=>$(()=>import(`../chunks/BzpBc7U9.js`).then(e=>e.C),__vite__mapDeps([150,1,2,5,6,3,146,10,17,9,0,4,18,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87]),import.meta.url)],[`postEffe
2cts`,()=>$(()=>import(`../chunks/BsmNaVJ6.js`),[],import.meta.url)],[`viewportOverrides`,()=>$(()=>import(`../chunks/DhCM1d1l.js`).then(e=>e.a),__vite__mapDeps([146,1,2,3]),import.meta.url)],[`postprocessing`,()=>$(()=>import(`../chunks/DvLpQ4O4.js`).then(e=>e.O),__vite__mapDeps([222,1,9]),import.meta.url)],[`shaderBackends`,()=>$(()=>import(`../chunks/B2DP2htb.js`).then(e=>e.i),__vite__mapDeps([148,1,6]),import.meta.url)],[`shaderGraph`,()=>$(()=>import(`../chunks/B9ryHuDY.js`).then(e=>e.g),__vite__mapDeps([145,1,2,6,0,3,4,146,10,147,148,149,9,69,44,5,70,20,21,71,72,73,74,75,76,77,78,67,79]),import.meta.url)],[`shaderSync`,()=>$(()=>import(`../chunks/_RMVvhDD.js`),[],import.meta.url)],[`shaderTextures`,()=>$(()=>import(`../chunks/IQtkpfKe.js`).then(e=>e.o),__vite__mapDeps([149,1,9,69,2,44,5,6,3,70,20,21,71,72,10,73,74,75,76,77,0,4,78,67,79]),import.meta.url)],[`shaderCatalog`,()=>$(()=>import(`../chunks/Crvo8itx.js`).then(e=>e.i),__vite__mapDeps([147,1]),import.meta.url)],[`units`,()=>$(()=>import(`../chunks/Bym6LCTQ.js`).then(e=>e.c),__vite__mapDeps([223,1,2,3]),import.meta.url)],[`postBackends`,()=>$(()=>import(`../chunks/UvpzYuP4.js`).then(e=>e.i),__vite__mapDeps([224,1,222,9]),import.meta.url)],[`workspace`,()=>$(()=>import(`../chunks/-Uls_YXh.js`).then(e=>e.r),__vite__mapDeps([152,1,2,5,6,3,73,74]),import.meta.url)],[`editResume`,()=>$(()=>import(`../chunks/DWQN_xAm.js`).then(e=>e.r),__vite__mapDeps([151,1,152,2,5,6,3,73,74]),import.meta.url)],[`moduleRequirements`,()=>$(()=>import(`../chunks/BU4vuoSr.js`).then(e=>e.r),__vite__mapDeps([165,1,2,0,3,4,7,24,6,20,21,23,8,9,5,10,11,12,13,14,25,34,19,35,36,37,38,39,40,41,42,22,43,44,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59,140,17,18,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,141,138,166,128]),import.meta.url)],[`hudDocs`,()=>$(()=>import(`../chunks/CXZKoSmh.js`).then(e=>e.h),__vite__mapDeps([32,1,2,6,3,10,13,30,31]),import.meta.url)],[`hudSync`,()=>$(()=>import(`../chunks/Cc_6mL_R.js`).then(e=>e.c),__vite__mapDeps([225,1,2,5,6,3,10,32,13,30,31,17,9,0,4,18,19,7,20,21,22,23,11,12,8,14,24,25,26,27,28,29,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87]),import.meta.url)],[`idb`,()=>$(()=>import(`../chunks/Dz2LOgrZ.js`).then(e=>e.a),__vite__mapDeps([70,1,20,2,21]),import.meta.url)],[`hudKinds`,()=>$(()=>import(`../chunks/BJ1d7ekV.js`).then(e=>e.o),__vite__mapDeps([30,1,31,2]),import.meta.url)],[`hudImages`,()=>$(()=>import(`../chunks/DPHhWEAA.js`).then(e=>e.n),__vite__mapDeps([226,1,69,2,9,44,5,6,3,70,20,21,71,72,10,73,74,75,76,77,0,4,78,67,79]),import.meta.url)],[`gameState`,()=>$(()=>import(`../chunks/DHWg9jzn.js`).then(e=>e.s),__vite__mapDeps([13,1,2,10]),import.meta.url)],[`gameSync`,()=>$(()=>import(`../chunks/r00zVI56.js`),[],import.meta.url)],[`hudActions`,()=>$(()=>import(`../chunks/CvZ3WBVk.js`),[],import.meta.url)],[`moduleNodeIO`,()=>$(()=>import(`../chunks/CPCpK95Z.js`).then(e=>e.r),__vite__mapDeps([22,1]),import.meta.url)],[`moduleToolboxes`,()=>$(()=>import(`../chunks/CEYxtf8I.js`).then(e=>e.a),__vite__mapDeps([52,1,2]),import.meta.url)],[`splineTube`,()=>$(()=>import(`../chunks/DUi9eEhq.js`).then(e=>e.g),__vite__mapDeps([227,1,9]),import.meta.url)],[`splineTool`,()=>$(()=>import(`../chunks/BOgepwfe.js`).then(e=>e.v),__vite__mapDeps([228,1,2,9,0,3,4,5,6,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,172,227]),import.meta.url)],[`splineEdit`,()=>$(()=>import(`../chunks/veptfTmH.js`),[],import.meta.url)],[`terrainCarve`,()=>$(()=>import(`../chunks/CtNmxX81.js`).then(e=>e.i),__vite__mapDeps([229,1,9,227]),import.meta.url)],[`flattenActions`,()=>$(()=>import(`../chunks/CKkrQfIm.js`),[],import.meta.url)],[`hudViewportDrag`,()=>$(()=>import(`../chunks/gsHEtleH.js`),[],import.meta.url)],[`gamepadPrefs`,()=>$(()=>import(`../chunks/DmZjHTID.js`).then(e=>e.c),__vite__mapDeps([62,1,2,3]),import.meta.url)],[`charController`,()=>$(()=>import(`../chunks/CZHKtjzS.js`).then(e=>e.r),__vite__mapDeps([84,1,2,6,9,0,3,4,8,5,10,11,12,13,14,48,85]),import.meta.url)],[`hudRichText`,()=>$(()=>import(`../chunks/C7ctNVlq.js`),[],import.meta.url)],[`moduleHudKinds`,()=>$(()=>import(`../chunks/trEOremz.js`).then(e=>e.o),__vite__mapDeps([31,1,2]),import.meta.url)],[`hudMinimap`,()=>$(()=>import(`../chunks/BbPXzLaN.js`),[],import.meta.url)],[`hudArrange`,()=>$(()=>import(`../chunks/COdqS90v.js`),[],import.meta.url)],[`gamePresence`,()=>$(()=>import(`../chunks/BcmHqZM8.js`).then(e=>e.r),__vite__mapDeps([230,1,2,0,3,4,5,6,13,10,32,30,31,76,78,184,100]),import.meta.url)],[`levels`,()=>$(()=>import(`../chunks/qxGgLbp0.js`).then(e=>e.o),__vite__mapDeps([111,1,2,6,0,3,4,69,9,44,5,70,20,21,10,19,7,
213,55,72,73,74,75,76,77,78,67,71,79,112,113,114,45,46,50,47,8,11,12,14,27,48,49,18,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,68,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,124,125,126,100,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98,169]),import.meta.url)],[`peerVars`,()=>$(()=>import(`../chunks/ClsyBc6U.js`).then(e=>e.p),__vite__mapDeps([33,1,2,5,6,3,10]),import.meta.url)],[`projectManifest`,()=>$(()=>import(`../chunks/xXXzmVBF.js`).then(e=>e.b),__vite__mapDeps([72,1,2,3,5,6,10,70,20,21,73,74,75,76,77,0,4,78,67]),import.meta.url)],[`projectFile`,()=>$(()=>import(`../chunks/D3XMbCQo.js`),[],import.meta.url)],[`transientObjects`,()=>$(()=>import(`../chunks/CXukiGwX.js`).then(e=>e.s),__vite__mapDeps([86,1,2,0,3,4,5,6]),import.meta.url)],[`spawner`,()=>$(()=>import(`../chunks/DJtcA1OM.js`),__vite__mapDeps([231,1,2,9,0,3,4,5,6,86,113,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,157,158,112]),import.meta.url)],[`triggerSync`,()=>$(()=>import(`../chunks/DjPGwZN6.js`),[],import.meta.url)],[`saveName`,()=>$(()=>import(`../chunks/DR3C1yxy.js`).then(e=>e.i),__vite__mapDeps([197,1,2,3]),import.meta.url)],[`sceneIdentity`,()=>$(()=>import(`../chunks/DLLblqNm.js`).then(e=>e.r),__vite__mapDeps([232,1,2,0,3,4,72,5,6,10,70,20,21,73,74,75,76,77,78,67,153,9,38,40,69,44,7,13,25,48,14,55,32,30,31,18,19,22,23,11,12,8,24,26,27,28,29,33,34,35,36,37,39,41,42,43,45,46,47,49,50,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,68,71,79,80,81,82,83,84,85,86,125,126,100,127,128,129,130,131,132,133,17,87,134,135,117,118,119,120,121,136,137,139,140,141,138,154,123,155,143,144,145,146,147,148,149,150,151,152,124,115,116,112,113,114,122,93,88,94,89,90,91,92,15,142,156,157,158,159,160,161,162,163,164,165,166,167,168,98,111,169]),import.meta.url)],[`importDuplicates`,()=>$(()=>import(`../chunks/Blg3WApt.js`).then(e=>e.i),__vite__mapDeps([169,1,2,6,3,69,9,44,5,70,20,21]),import.meta.url)],[`peerScenes`,()=>$(()=>import(`../chunks/CGRZ9B4G.js`).then(e=>e.m),__vite__mapDeps([110,1,2,0,3,4,5,6,10,76,111,69,9,44,70,20,21,19,7,13,55,72,73,74,75,77,78,67,71,79,112,113,114,45,46,50,47,8,11,12,14,27,48,49,18,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,68,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,124,125,126,100,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98,169]),import.meta.url)],[`sharedLibrary`,()=>$(()=>import(`../chunks/Disq1e65.js`).then(e=>e.I),__vite__mapDeps([233,1,2,6,3,69,9,44,5,70,20,21,10,72,73,74,75,76,77,0,4,78,67,79,71]),import.meta.url)],[`transferLedger`,()=>$(()=>import(`../chunks/DhLJ1pL6.js`).then(e=>e.u),__vite__mapDeps([79,1,2]),import.meta.url)],[`explorerView`,()=>$(()=>import(`../chunks/D4VKaV2p.js`),[],import.meta.url)],[`filePreview`,()=>$(()=>import(`../chunks/1k3l-bGq.js`).then(e=>e.n),__vite__mapDeps([234,1,2,3]),import.meta.url)],[`saveAs`,()=>$(()=>import(`../chunks/D3_Ci_q7.js`).then(e=>e.i),__vite__mapDeps([235,1,2,6,0,3,4,5,174,9,70,20,21,67,17,18,10,19,7,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,69,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,113,114,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,139,140,141,138,196,126,100,125,127,128,129,130,131,133,134,135,136,137,154,155,145,146,147,148,149,150,156,157,158,112,159,160,161,162,163,143,164,153,132,144,151,152,197,198,199,200]),import.meta.url)],[`windowTabs`,()=>$(()=>import(`../chunks/Z25Q_eXn.js`).then(e=>e.h),__vite__mapDeps([190,1,2,3]),import.meta.url)],[`colocation`,()=>$(()=>import(`../chunks/0WtAOt-7.js`).then(e=>e.c),__vite__mapDeps([161,1,2,9,0,3,4,5,6,10]),import.meta.url)],[`colocationCalibrate`,()=>$(()=>import(`../chunks/7eiqWfKe.js`).then(e=>e.r),__vite__mapDeps([236,1,2,9,0,3,4,5,6,76,10,132,40,130,131,161,173,114,19,11,8,12,13,14,46,45,48,49,47,27,26,60,24,20,21,23,25,28,29,34,35,36,37,38,39,41,7,42,22,43,44,50,16,51,52,53,54,55,31,56,32,30,33,57,58,59,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84,85,86,17,87,88,93,94,89,90,91,92,15,113,115,116,117,118,119,120,121,122,123,112,159,160,172,104,174,139,140,141,138,175,157,158,135,136,137,176,96,177,154,142,178,156,125,126,100,127,128,129,133,134,162,155,163,143,164,153,144,145,146,147,148,149,150,151,152,179,180,181,107,171,182,183,184,185,186,187,188,189,190]),import.meta.url)],[`colocationPresence`,()=>$(()=>import(`../chunks/BR5DT3D7.js`).then(e=>e.a),__vite__mapDeps([160,1,2,3,5,6,161,9,0,4,10]),import.meta.url)],[`xrAnchors`,()=>$(()=>import(`../chunks/BUdNwSAD.js`).then(e=>e.s),__vite__mapDeps([237,1,2,0,3,4]),import.meta.url)],[`colocationAnchors`,()=>$(()=>import(`../chunks/-Gzd7PHX.js`),[],import.meta.url)],[`colocationNudge`,()=>$(()=>import(`../chunks/25zxRAGP.js`).then(e=>e.t),__vite__mapDeps([238,1,2,3,9,0,4,5,6,132,40,130,131,161,10,175,19,113,114,45,46,50,47,8,11,12,13,14,27,48,49,18,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,157,158,112,159,160,135,136,137,174,139,140,141,138,171,172,173,104,176,96,177,154,142,178,156,125,126,100,127,128,129,133,134,162,155,163,143,164,153,144,145,146,147,148,149,150,151,152,179,180,181,107,182,183,184,185,186,187,188,189,190,236]),import.meta.url)],[`mountedVolumes`,()=>$(()=>import(`../chunks/UZUV0BFN.js`),[],import.meta.url)],[`storageUsage`,()=>$(()=>import(`../chunks/C5BGzpJG.js`),__vite__mapDeps([239,79,1,2]),import.meta.url)],[`scenePrivacy`,()=>$(()=>import(`../chunks/CMcOMWsT.js`),[],import.meta.url)],[`touchControl
2s`,()=>$(()=>import(`../chunks/DRCkAJBM.js`),[],import.meta.url)],[`touchActions`,()=>$(()=>import(`../chunks/B9miPBSB.js`).then(e=>e.S),__vite__mapDeps([54,1,2,3]),import.meta.url)],[`touchSpec`,()=>$(()=>import(`../chunks/XsOx-XVl.js`),[],import.meta.url)],[`playMode`,()=>$(()=>import(`../chunks/CSw9mI6E.js`).then(e=>e.s),__vite__mapDeps([184,1,2,6,0,3,4,5,100]),import.meta.url)],[`exportBuilder`,()=>$(()=>import(`../chunks/Bmt9b4mE.js`).then(e=>e.i),__vite__mapDeps([240,1,2,6,0,3,4,21,100]),import.meta.url)],[`exportStores`,()=>$(()=>import(`../chunks/B0KvD6nJ.js`).then(e=>e.n),__vite__mapDeps([241,1,2,3]),import.meta.url)],[`exportBoot`,()=>$(()=>import(`../chunks/N0efLTOH.js`).then(e=>e.t),__vite__mapDeps([100,1]),import.meta.url)],[`exportRuntime`,()=>$(()=>import(`../chunks/BZ_zsr8m.js`),[],import.meta.url)],[`gameSettings`,()=>$(()=>import(`../chunks/Cz5Vn86C.js`).then(e=>e.s),__vite__mapDeps([26,1,2,3,27]),import.meta.url)],[`objectListNav`,()=>$(()=>import(`../chunks/BXXNBGoP.js`),[],import.meta.url)],[`inviteLinks`,()=>$(()=>import(`../chunks/DnnWYRF3.js`),[],import.meta.url)],[`helperLayer`,()=>$(()=>import(`../chunks/k35WkBNo.js`).then(e=>e.r),__vite__mapDeps([46,1,2,3,0,4]),import.meta.url)],[`explorerClipboard`,()=>$(()=>import(`../chunks/CnkOo-4I.js`),[],import.meta.url)],[`lookPresence`,()=>$(()=>import(`../chunks/DfmNsAjG.js`),[],import.meta.url)],[`postGraphs`,()=>$(()=>import(`../chunks/BJDqSmhM.js`),[],import.meta.url)],[`postGraphPresets`,()=>$(()=>import(`../chunks/CHMVzUK_.js`).then(e=>e.r),__vite__mapDeps([242,1]),import.meta.url)],[`materialSharing`,()=>$(()=>import(`../chunks/BL7XeJ7s.js`).then(e=>e.r),__vite__mapDeps([123,1,2,3,0,4]),import.meta.url)],[`diagnostics`,()=>$(()=>import(`../chunks/DQLDhuPM.js`).then(e=>e.n),__vite__mapDeps([20,1,2,21]),import.meta.url)],[`wireValidate`,()=>$(()=>import(`../chunks/DXipmDLt.js`).then(e=>e.r),__vite__mapDeps([120,1]),import.meta.url)],[`wireErrors`,()=>$(()=>import(`../chunks/Cm3pyIGR.js`).then(e=>e.i),__vite__mapDeps([121,1,2,5,6,3,20,21]),import.meta.url)],[`safeStorage`,()=>$(()=>import(`../chunks/CvScdOYl.js`).then(e=>e.r),__vite__mapDeps([3,1]),import.meta.url)],[`sceneBudget`,()=>$(()=>import(`../chunks/HwYlcfZ4.js`).then(e=>e.g),__vite__mapDeps([38,1,2,4,0,3]),import.meta.url)],[`overloadGuard`,()=>$(()=>import(`../chunks/BicNdS6S.js`).then(e=>e.i),__vite__mapDeps([39,1,2,0,3,4,38]),import.meta.url)],[`qualityGovernor`,()=>$(()=>import(`../chunks/wSXpF74M.js`).then(e=>e.o),__vite__mapDeps([37,1,2,3,0,4,38,39,40,41,9]),import.meta.url)],[`importBudget`,()=>$(()=>import(`../chunks/BC3JH32E.js`).then(e=>e.n),__vite__mapDeps([198,1,38,2,4,0,3]),import.meta.url)],[`importGate`,()=>$(()=>import(`../chunks/DhXmsu6r.js`).then(e=>e.n),__vite__mapDeps([199,1,2,0,3,4,38,75,198]),import.meta.url)],[`decimate`,()=>$(()=>import(`../chunks/CxvgeWoJ.js`).then(e=>e.t),__vite__mapDeps([200,1,9,198,38,2,4,0,3]),import.meta.url)],[`playCursor`,()=>$(()=>import(`../chunks/Dhe3CXS6.js`).then(e=>e.i),__vite__mapDeps([51,1,2,0,3,4,47,5,6,8,9,10,11,12,13,14,45,46,27,48,49,16]),import.meta.url)],[`gameStorage`,()=>$(()=>import(`../chunks/DqjvRISI.js`).then(e=>e.t),__vite__mapDeps([12,1,3]),import.meta.url)],[`gameKit`,()=>$(()=>import(`../chunks/CbiDxulp.js`),__vite__mapDeps([243,23,1,2,11,0,3,4,26,27,28,10,29,56,19,47,5,6,8,9,12,13,14,45,46,48,49,54,32,30,31,60,24,20,21,25,34,35,36,37,38,39,40,41,7,42,22,43,44,50,16,51,52,53,55,33,57,58,59,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,244,113,114,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,184,100,221,218,195,112,245,132,130,131,173,159,160,161,172,104,174,139,140,141,138,175,157,158,135,136,137,176,96,177,154,142,178,156,125,126,127,128,129,133,134,162,155,163,143,164,153,144,145,146,147,148,149,150,151,152,179,180,181,107,171,182,183,185,186,187,188,189,190,103,246,216,214,215,226,217,167,165,166,168,98,247]),import.meta.url)],[`moduleWorld`,()=>$(()=>import(`../chunks/DKffTCCv.js`).then(e=>e.r),__vite__mapDeps([49,1,2,0,3,4,45,9,46]),import.meta.url)],[`playSpawn`,()=>$(()=>import(`../chunks/mtU8XXpd.js`).then(e=>e.r),__vite__mapDeps([50,1,2,9,0,3,4,47,5,6,8,10,11,12,13,14,45,46,27,48,49]),import.meta.url)],[`packRefs`,()=>$(()=>import(`../chunks/JVCTHOxB.js`).then(e=>e.l),__vite__mapDeps([125,1,2,6,9,0,3,4,40,69,44,5,70,20,21,126,100,127,128,129,130,131]),import.meta.url)],[`loadStates`,()=>$(()=>import(`../chunks/NFZNtbZf.js`).then(e=>e.g),__vite__mapDeps([130,1,2,3]),import.meta.url)],[`placeholders`,()=>$(()=>import(`../chunks/D1Qqnzxc.js`).then(e=>e.i),__vite__mapDeps([131,1,2,9,0,3,4,5,6,130]),import.meta.url)],[`replaceModel`,()=>$(()=>import(`../chunks/BhWU6GAR.js`),[],import.meta.url)],[`lod`,()=>$(()=>import(`../chunks/DJTKAFpX.js`).then(e=>e.o),__vite__mapDeps([41,1,2,3,9,0,4]),import.meta.url)],[`lodGroup`,()=>$(()=>import(`../chunks/BgTLrJqP.js`).then(e=>e.o),__vite__mapDeps([204,1,2,6,9,0,3,4,41,69,44,5,70,20,21,126,100,128,127,129,125,40,130,131,162]),import.meta.url)],[`lodGroupActions`,()=>$(()=>import(`../chunks/DRpyOyB6.js`).then(e=>e.o),__vite__mapDeps([248,1,2,0,3,4,5,6,77,78,67,17,9,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,73,74,75,76,79,80,81,82,83,84,85,86,87,162,204,126,100,128,127,129,125,130,131]),import.meta.url)],[`lodLevelEdit`,()=>$(()=>import(`../chunks/BwcP_lQ9.js`),[],import.meta.url)],[`packBehavior`,()=>$(()=>import(`../chunks/CWIbvi7U.js`),[],import.meta.url)],[`sceneLoader`,()=>$(()=>import(`../chunks/A3q_22ew.js`).then(e=>e.v),__vite__mapDeps([40,1,2]),import.meta.url)],[`startView`,()=>$(()=>import(`../chunks/DO867s_y.js`).then(e=>e.s),__vite__mapDeps([132,1,2,6,0,3,4,40,5,130,131,9]),import.meta.url)],[`sceneSwitch`,()=>$(()=>import(`../chunks/Bx-g6jrJ.js`).then(e=>e.i),__vite__mapDeps([167,1,2,6,3,0,4,5,7,24,20,21,23,8,9,10,11,12,13,14,25,27,34,19,35,36,37,38,39,40,41,42,22,43,44,45,46,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59,75,165,140,17,18,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,141,138,166,128,168,98]),import.meta.url)],[`sceneScope`,()=>$(()=>import(`../chunks/DPTtEIyt.js`).then(e=>e.s),__vite__mapDeps([27,1,2]),import.meta.url)],[`kitInstancing`,()=>$(()=>import(`../chunks/BRQuHKv2.js`),[],import.meta.url)],[`scriptSockets`,()=>$(()=>import(`../chunks/BZQ-8wxB.js`),[],import.meta.url)],[`scriptLint`,()=>$(()=>import(`../chunks/BneyK67T.js`).then(e=>e.n),__vite__mapDeps([64,1,63]),import.meta.url)],[`aiExtensions`,()=>$(()=>import(`../chunks/DIQQc5X8.js`).then(e=>e.t),__vite__mapDeps([208,1]),import.meta.url)],[`graphText`,()=>$(()=>import(`../chunks/Ducu8QRi.js`).then(e=>e.t),__vite__mapDeps([207,1]),import.meta.url)]],Pve={};function Fve(){return Promise.all(bw.map(([,e])=>e())).then(e=>{let t={};
2return bw.forEach(([n],r)=>{n===`*`&&Object.assign(t,e[r])}),bw.forEach(([n],r)=>{n!==`*`&&(t[n]=e[r])}),Object.assign(t,Pve),window.__stores=t,t})}var xw=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=e.length;if(t.length!==n)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0},Ive=()=>{let e=[],t={items:e,remember:(t,n)=>{for(let t=0;t<e.length;t++){let r=e[t];if(xw(n,r.keys)&&r.promise)return r.promise}let r=t();r.catch(()=>{for(let t=0;t<e.length;t++){let r=e[t];if(xw(n,r.keys)){e.splice(t,1);break}}});let i={promise:r,keys:n};return e.push(i),i.promise},clear:t=>{for(let n=0;n<e.length;n++){let r=e[n];if(xw(t,r.keys)){e.splice(n,1);return}}}};return He(`threlte-cache`,t),t},Sw=e=>{let t=Ue(e),n={set:e=>{n.current=e,t.set(e)},subscribe:t.subscribe,update:e=>{let r=e(n.current);n.current=r,t.set(r)},current:e};return n},Cw=(e,t)=>({subscribe:$e(e,t).subscribe,set:t,update:n=>t(n(K(e))),get current(){return K(e)}}),ww=e=>{let{subscribe:t}=$e(e);return{subscribe:t,get current(){return K(e)}}},Lve=e=>{let n=e.getBoundingClientRect(),r=t({width:n.width,height:n.height}),i=0,a=0,o=0,s=0,c=!0,l=!1,u,d=()=>{l=!0,u!==void 0&&clearTimeout(u),u=setTimeout(()=>{l=!1,u=void 0},250)},f=()=>{d()},p=new ResizeObserver(()=>{c=!0,d();let t=e.getBoundingClientRect();I(r,{width:t.width,height:t.height})});function m(){if(!c&&!l)return!1;let{clientWidth:t,clientHeight:n}=e;if(!c&&t===a&&n===i)return!1;a=t,i=n,c=!1;let u=e.getBoundingClientRect();return I(r,{width:u.width,height:u.height}),Q(r).width===o&&Q(r).height===s?!1:(o=Q(r).width,s=Q(r).height,!0)}return Qe(()=>(p.observe(e),window.addEventListener(`resize`,f,{passive:!0}),()=>{p.disconnect(),window.removeEventListener(`resize`,f),u!==void 0&&clearTimeout(u)})),{size:{get current(){return Q(r)}},shouldUpdateSize:m}},Rve=e=>{let{dom:t,canvas:n}=typeof e==`function`?e():e,{size:r,shouldUpdateSize:i}=Lve(t),a={dom:t,canvas:n,size:ww(()=>r.current),shouldUpdateSize:i};return He(`threlte-dom-context`,a),a},Tw=()=>{let e=De(`threlte-dom-context`);if(!e)throw Error(`useDOM can only be used in a child component to <Canvas>.`);return e},Ew=class{allVertices=new Map;isolatedVertices=new Map;connectedVertices=new Map;sortedConnectedValues=[];needsSort=!1;listeners=new Map;emit(e,t){let n=this.listeners.get(e);if(n)for(let e of n)e(t)}on(e,t){let n=this.listeners.get(e);n||(n=new Set,this.listeners.set(e,n)),n.add(t)}off(e,t){this.listeners.get(e)?.delete(t)}get sortedVertices(){return this.mapNodes(e=>e)}moveToIsolated(e){let t=this.connectedVertices.get(e);t&&(this.isolatedVertices.set(e,t),this.connectedVertices.delete(e))}moveToConnected(e){let t=this.isolatedVertices.get(e);t&&(this.connectedVertices.set(e,t),this.isolatedVertices.delete(e))}getKey=e=>typeof e==`object`?e.key:e;add(e,t,n){let r=this.allVertices.get(e);if(r&&r.value!==void 0)throw Error(`A node with the key ${e.toString()} already exists`);r?r.value===void 0&&(r.value=t):(r={value:t,previous:new Set,next:new Set},this.allVertices.set(e,r));let i=r.next.size>0||r.previous.size>0;if(!n?.after&&!n?.before&&!i){this.isolatedVertices.set(e,r),this.emit(`node:added`,{key:e,type:`isolated`,value:t});return}if(this.connectedVertices.set(e,r),n?.after){let t=Array.isArray(n.after)?n.after:[n.after];for(let e of t)r.previous.add(this.getKey(e));for(let n of t){let t=this.getKey(n),r=this.allVertices.get(t);if(r)r.next.add(e),this.moveToConnected(t);else{let n={value:void 0,previous:new Set,next:new Set([e])};this.allVertices.set(t,n),this.connectedVertices.set(t,n)}}}if(n?.before){let t=Array.isArray(n.before)?n.before:[n.before];for(let e of t)r.next.add(this.getKey(e));for(let n of t){let t=this.getKey(n),r=this.allVertices.get(t);if(r)r.previous.add(e),this.moveToConnected(t);else{let n={value:void 0,previous:new Set([e]),next:new Set};this.allVertices.set(t,n),this.connectedVertices.set(t,n)}}}this.emit(`node:added`,{key:e,type:`connected`,value:t}),this.needsSort=!0}remove(e){let t=this.getKey(e);if(this.isolatedVertices.get(t)){this.isolatedVertices.delete(t),this.allVertices.delete(t),this.emit(`node:removed`,{key:t,type:`isolated`});return}let n=this.connectedVertices.get(t);if(n&&n.value!==void 0){for(let e of n.next){let n=this.connectedVertices.get(e);n&&(n.previous.delete(t),n.previous.size===0&&n.next.size===0&&this.moveToIsolated(e))}for(let e of n.previous){let n=this.connectedVertices.get(e);n&&(n.next.delete(t),n.previous.size===0&&n.next.size===0&&this.moveToIsolated(e))}this.connectedVertices.delete(t),this.allVertices.delete(t),this.emit
2(`node:removed`,{key:t,type:`connected`}),this.needsSort=!0}}mapNodes(e){this.needsSort&&this.sort();let t=[];return this.forEachNode((n,r)=>{t.push(e(n,r))}),t}forEachNode(e){this.needsSort&&this.sort();let t=0;for(;t<this.sortedConnectedValues.length;t++)e(this.sortedConnectedValues[t],t);for(let n of this.isolatedVertices.values())n.value!==void 0&&e(n.value,t++)}getValueByKey(e){return this.allVertices.get(e)?.value}sort(){let e=new Map,t=[],n=[];for(let[t,n]of this.connectedVertices)n.value!==void 0&&e.set(t,0);for(let[t]of e){let n=this.connectedVertices.get(t);for(let t of n.next)e.has(t)&&e.set(t,e.get(t)+1)}for(let[n,r]of e)r===0&&t.push(n);let r=0;for(;r<t.length;){let i=t[r++];n.push(i);let a=this.connectedVertices.get(i)?.next;if(a)for(let n of a){let r=(e.get(n)||0)-1;e.set(n,r),r===0&&t.push(n)}}if(n.length!==e.size)throw Error(`The graph contains a cycle, and thus can not be sorted topologically.`);this.sortedConnectedValues.length=0;for(let e=0;e<n.length;e++){let t=this.connectedVertices.get(n[e]).value;t!==void 0&&this.sortedConnectedValues.push(t)}this.needsSort=!1}clear(){this.allVertices.clear(),this.isolatedVertices.clear(),this.connectedVertices.clear(),this.sortedConnectedValues=[],this.needsSort=!1}static isKey(e){return typeof e==`string`||typeof e==`symbol`}static isValue(e){return typeof e==`object`&&`key`in e}},zve=class{key;stage;callback;runTask=!0;stop(){this.runTask=!1}start(){this.runTask=!0}constructor(e,t,n){this.stage=e,this.key=t,this.callback=n}run(e){this.runTask&&this.callback(e)}},Bve=class extends Ew{key;scheduler;runTask=!0;stop(){this.runTask=!1}start(){this.runTask=!0}get tasks(){return this.sortedVertices}callback=(e,t)=>t();constructor(e,t,n){super(),this.scheduler=e,this.key=t,this.start=this.start.bind(this),this.stop=this.stop.bind(this),n&&(this.callback=n.bind(this))}createTask(e,t,n){let r=new zve(this,e,t);return this.add(e,r,n),r}getTask(e){return this.getValueByKey(e)}removeTask=this.remove.bind(this);run(e){this.runTask&&this.callback(e,t=>{this.forEachNode(n=>{n.run(t??e)})})}runWithTiming(e){if(!this.runTask)return{};let t={};return this.callback(e,n=>{this.forEachNode(r=>{let i=performance.now();r.run(n??e);let a=performance.now()-i;t[r.key]=a})}),t}getSchedule(){return this.mapNodes(e=>e.key.toString())}},Vve=class extends Ew{lastTime=0;clampDeltaTo=.1;get stages(){return this.sortedVertices}constructor(e){super(),e?.clampDeltaTo&&(this.clampDeltaTo=e.clampDeltaTo),this.run=this.run.bind(this)}createStage(e,t){let n=new Bve(this,e,t?.callback);return this.add(e,n,{after:t?.after,before:t?.before}),n}getStage(e){return this.getValueByKey(e)}removeStage=this.remove.bind(this);run(e){let t=e-this.lastTime;this.forEachNode(e=>{e.run(Math.min(t/1e3,this.clampDeltaTo))}),this.lastTime=e}runWithTiming(e){let t=e-this.lastTime,n={},r=performance.now();return this.forEachNode(e=>{let r=performance.now(),i=e.runWithTiming(Math.min(t/1e3,this.clampDeltaTo)),a=performance.now()-r;n[e.key.toString()]={duration:a,tasks:i}}),this.lastTime=e,{total:performance.now()-r,stages:n}}getSchedule(e={tasks:!0}){return{stages:this.mapNodes(t=>{if(t===void 0)throw Error(`Stage not found`);return{key:t.key.toString(),tasks:e.tasks?t.getSchedule():void 0}})}}dispose(){this.clear()}},Hve=e=>{let t=new Vve,n=t.createStage(Symbol(`threlte-main-stage`)),r=q(e),i=q(()=>Q(r).autoRender),a=q(()=>Q(r).renderMode),o=q(()=>Q(i)??!0),s=q(()=>Q(a)??`on-demand`),c=new Set,l=!0,u={scheduler:t,autoInvalidations:c,frameInvalidated:{get current(){return l},set current(e){l=e}},advance:()=>{l=!0},autoRender:Cw(()=>Q(o),e=>I(o,e)),renderMode:Cw(()=>Q(s),e=>I(s,e)),invalidate(){l=!0},mainStage:n,shouldRender:()=>Q(s)===`always`||Q(s)===`on-demand`&&(l||c.size>0)||Q(s)===`manual`&&l,renderStage:t.createStage(Symbol(`threlte-render-stage`),{after:n,callback(e,t){u.shouldRender()&&t()}}),resetFrameInvalidation(){l=!1}};return Qe(()=>()=>{t.dispose()}),He(`threlte-scheduler-context`,u),u},Dw=()=>{let e=De(`threlte-scheduler-context`);if(!e)throw Error(`useScheduler can only be used in a child component to <Canvas>.`);return e},Uve=()=>{let{size:e}=Tw(),n=et(e),{invalidate:r}=Dw(),a=new Nr,o=new WeakMap,s=new pt(75,1,.1,1e3);s.position.z=5,s.lookAt(0,0,0);let c=t(!1),l=t(s);i(()=>
2{if(Q(l)!==s||Q(c))return;let{width:e,height:t}=n.current;s.aspect=e/t,s.updateProjectionMatrix(),s.updateMatrixWorld(),r()}),i(()=>{if(Q(l)===void 0||a.size===0){let e=!1;Q(l)!==s&&(I(l,s),e=!0),Q(c)&&(I(c,!1),e=!0),e&&r()}});let u={makeDefaultCameras:a,makeDefaultCameraManual:o,camera:Cw(()=>Q(l),e=>I(l,e)),manual:{get current(){return Q(c)},set(e){I(c,e,!0)}}};return He(`threlte-camera-context`,u),u},Ow=()=>{let e=De(`threlte-camera-context`);if(!e)throw Error(`useCamera can only be used in a child component to <Canvas>.`);return e},Wve=()=>{let e=new Map,t={disposableObjects:e,removeObjectFromDisposal:t=>{e.delete(t)},disposableObjectMounted:t=>{let n=e.get(t);n?e.set(t,n+1):e.set(t,1)},disposableObjectUnmounted:t=>{let n=e.get(t);n&&n>0&&(e.set(t,n-1),n-1<=0&&(e.delete(t),t.dispose()))}};return Qe(()=>()=>{for(let[t]of e)t.dispose();e.clear()}),He(`threlte-disposal-context`,t),t},Gve=()=>{let e=De(`threlte-disposal-context`);if(!e)throw Error(`useDisposal can only be used in a child component to <Canvas>.`);return e},kw=Symbol(`threlte-parent-context`),Aw=e=>{let t={get current(){return e()}};return He(kw,t),t},jw=()=>De(kw),Mw=()=>{let e=jw();return ww(()=>e.current)},Nw=Symbol(`threlte-parent-object3d-context`),Pw=e=>{let t=De(Nw),n={get current(){return e()??t.current}};return He(Nw,n),n},Kve=()=>De(Nw),qve=e=>{let t={scene:e||new tr};return He(`threlte-scene-context`,t),t},Fw=()=>{let e=De(`threlte-scene-context`);if(!e)throw Error(`useScene can only be used in a child component to <Canvas>.`);return e};new Pr(()=>window.scrollX,e=>Xe(window,`scroll`,e)),new Pr(()=>window.scrollY,e=>Xe(window,`scroll`,e)),new Pr(()=>window.innerWidth,e=>Xe(window,`resize`,e)),new Pr(()=>window.innerHeight,e=>Xe(window,`resize`,e)),new Pr(()=>window.outerWidth,e=>Xe(window,`resize`,e)),new Pr(()=>window.outerHeight,e=>Xe(window,`resize`,e)),new Pr(()=>window.screenLeft,e=>{let t=window.screenLeft,n=requestAnimationFrame(function r(){n=requestAnimationFrame(r),t!==(t=window.screenLeft)&&e()});return()=>{cancelAnimationFrame(n)}}),new Pr(()=>window.screenTop,e=>{let t=window.screenTop,n=requestAnimationFrame(function r(){n=requestAnimationFrame(r),t!==(t=window.screenTop)&&e()});return()=>{cancelAnimationFrame(n)}}),new Pr(()=>navigator.onLine,e=>{let t=Xe(window,`online`,e),n=Xe(window,`offline`,e);return()=>{t(),n()}});var Jve=new class{#e=E(window.devicePixelRatio);#t(){let e=Xe(window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),`change`,()=>{I(this.#e,window.devicePixelRatio),e(),this.#t()})}constructor(){this.#t()}get current(){return Q(this.#e),window.devicePixelRatio}},Iw=(e,t)=>e?.[`is${t}`]===!0,Yve=new Set([`fov`,`aspect`,`near`,`far`,`left`,`right`,`top`,`bottom`,`zoom`,`filmGauge`,`filmOffset`]),Lw=(e,t,n)=>{Iw(e,`PerspectiveCamera`)?e.aspect=t/n:Iw(e,`OrthographicCamera`)&&(e.left=t/-2,e.right=t/2,e.top=n/2,e.bottom=n/-2),e.updateProjectionMatrix(),e.updateMatrixWorld()},Xve=(e,t,n,r)=>{let{camera:a,manual:o,makeDefaultCameras:s,makeDefaultCameraManual:c}=Ow(),{invalidate:l}=Dw(),{size:u}=Tw(),d=et(u);i(()=>{if(!n())return;let r=e(),i=t();return s.add(r),c.set(r,i),a.set(r),o.set(i),l(),()=>{s.delete(r),c.delete(r);let e=s.values().next().value;a.current===r&&(e?(a.set(e),o.set(c.get(e)??!1)):o.set(!1),l())}}),i(()=>{if(t())return;let n=e();for(let e in r())if(Yve.has(e)){n.updateProjectionMatrix(),l();break}}),i(()=>{t()||Lw(e(),d.current.width,d.current.height)})},Rw=e=>Number.isFinite(e.width)&&Number.isFinite(e.height)&&e.width>0&&e.height>0,Zve=e=>{let{camera:t,manual:n}=Ow(),{scene:r}=Fw(),{invalidate:a,mainStage:o,renderStage:s,autoRender:c,scheduler:l,frameInvalidated:u}=Dw(),{canvas:d,size:f,shouldUpdateSize:p}=Tw(),m=q(e),h=K(e),g=h.createRenderer?h.createRenderer(d):new Un({canvas:d,powerPreference:`high-performance`,antialias:!0,alpha:!0});l.createStage(Symbol(`threlte-resize-stage`),{before:o}).createTask(Symbol(`threlte-resize-task`),()=>{g.xr.isPresenting||p()&&Rw(f.current)&&(g.setSize(f.current.width,f.current.height),n.current||Lw(t.current,f.current.width,f.current.height),a())});let _=s.createTask(Symbol(`threlte-auto-render-task`),()=>{(g.xr.isPresenting||Rw(f.current))&&g.render(r,t.current)}),v=q(()=>Q(m).colorSpace),y=q(()=>Q(m).dpr),b=q(()=>Q(m).shadows),x=q(()=>Q(m).toneMapping),S=q(()=>Q(v)??`srgb`),C=q(()=>{let e=Jve.current??window.devicePixelRatio;return Array.isArray(Q(y))?Math.min(Math.max(Q(y)[0],e),Q(y)[1]):Q(y)??e}),w=q(()=>Q(b)??2),T=q(()=>Q(x)??6),E={renderer:g,colorManagementEnabled:ww(()=>Q(m).colorManagementEnabled??!0),colorSpace:Cw(()=>Q(S),e=>I(S,e)),dpr:Cw(()=>Q(C),e=>I(C,e)),shadows:Cw(()=>Q(w),e=>I(w,e)),toneMapping:Cw(()=>Q(T),e=>I(T,e)),autoRenderTask:_};He(`threlte-renderer-context`,E);let D=et(c);return Kn.enabled=h.colorManagementEnabled??!0,i(()=>
2{g.outputColorSpace=Q(S),a()}),i(()=>{g.setPixelRatio(Q(C)),a()}),i(()=>{g.shadowMap.enabled=Q(w)!==!1,Q(w)!==!1&&Q(w)!==!0?g.shadowMap.type=Q(w):Q(w)===!0&&(g.shadowMap.type=2),a()}),i(()=>{g.toneMapping=Q(T),a()}),i(()=>(D.current?E.autoRenderTask.start():E.autoRenderTask.stop(),a(),()=>{E.autoRenderTask.stop()})),g.setAnimationLoop(e=>{l.run(e),u.current=!1}),Qe(()=>()=>{g.setAnimationLoop(null);try{g.dispose()}catch{}}),E},Qve=()=>{let e=De(`threlte-renderer-context`);if(!e)throw Error(`useRenderer can only be used in a child component to <Canvas>.`);return e},$ve=()=>{let e=Sw({});return He(`threlte-user-context`,e),e},eye=()=>{let e=De(`threlte-user-context`);if(!e)throw Error(`useUserContext can only be used in a child component to <Canvas>.`);return e},tye=e=>{let{scene:t}=qve(),n=typeof e==`function`?e:()=>e;return{scene:t,...Rve(n),...Ive(),...Aw(()=>t),...Pw(()=>t),...Wve(),...Hve(n),...Uve(),...Zve(n),...$ve()}},nye=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]);function rye(e,t){Ce(t,!0);let n=Le(t,nye);tye(()=>n);var r=fe(),i=N(r);ae(i,()=>t.children),X(e,r),ue()}var iye=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),aye=V(`<div class="svelte-clyidt"><canvas class="svelte-clyidt"><!></canvas></div>`);function oye(e,n){let r=Le(n,iye),i=t(void 0),a=t(void 0);var o=aye(),s=j(o),c=j(s),l=e=>{rye(e,le({get dom(){return Q(a)},get canvas(){return Q(i)}},()=>r,{children:(e,t)=>{var r=fe(),i=N(r);ae(i,()=>n.children??qe),X(e,r)},$$slots:{default:!0}}))};G(c,e=>{Q(i)&&Q(a)&&e(l)}),H(s),We(s,e=>I(i,e),()=>Q(i)),H(o),We(o,e=>I(a,e),()=>Q(a)),X(e,o)}var sye=(e,t)=>{if(t.includes(`.`)){let n=t.split(`.`),r=n.pop();for(let r=0;r<n.length;r+=1)if(e=e[n[r]],e==null)return console.error(`Cannot resolve property path "${t}": "${n[r]}" is ${e}`),{target:{},key:``};return{target:e,key:r}}return{target:e,key:t}},cye=e=>typeof e==`object`&&!!e,lye=(e,t)=>{let{invalidate:n}=Dw(),r=jw(),a=Kve();i(()=>{n();let i=e(),o=t();if(o===void 0&&Iw(i,`Object3D`)){let e=a.current;return e?.add(i),()=>{n(),e?.remove(i)}}if(o===void 0&&cye(r.current)){let e=r.current;if(Iw(i,`Material`)){let t=e.material;return e.material=i,()=>{n(),e.material=t}}if(Iw(i,`BufferGeometry`)){let t=e.geometry;return e.geometry=i,()=>{n(),e.geometry=t}}}if(o===!1)return()=>{n()};if(typeof o==`function`){let e=o({ref:i,parent:r.current,parentObject3D:a.current});return()=>{n(),e?.()}}if(typeof o==`string`){let{target:e,key:t}=sye(r.current,o);if(t in e){let r=e[t];return e[t]=i,()=>{n(),e[t]=r}}return e[t]=i,()=>{n(),delete e[t]}}if(Iw(o,`Object3D`)&&Iw(i,`Object3D`))return o.add(i),()=>{n(),o.remove(i)}})},zw=Symbol(`threlte-disposable-object-context`),uye=e=>typeof e?.dispose==`function`,dye=(e,t)=>{let{disposableObjectMounted:n,disposableObjectUnmounted:r,removeObjectFromDisposal:i}=Gve(),a=De(zw),o=q(()=>{let e=t();return e===void 0?a?.()!==!1:e!==!1});He(zw,()=>Q(o));let s=new Set;Qe(()=>{let t=e();uye(t)&&(Q(o)?(n(t),s.add(t)):(i(t),s.delete(t)))}),Qe(()=>()=>{for(let e of s)r(e);s.clear()})},Bw,fye=e=>{Bw=e},pye=()=>{let e=Bw;return Bw=void 0,e},Vw=`threlte-plugin-context`,mye=e=>{let t=De(Vw);if(!t)return;let n=[],r=Object.values(t);if(r.length>0)for(let t=0;t<r.length;t++){let i=r[t],a=i(e);a&&a.pluginProps&&n.push(...a.pluginProps)}return{pluginsProps:n}},hye=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e==null,gye=(e,t,n)=>{let r=e[t],i=Array.isArray(n);!i&&typeof n==`number`&&typeof r==`object`&&r&&typeof r.setScalar==`function`&&!r.isColor?r.setScalar(n):typeof r==`object`&&r&&typeof r.set==`function`?i?r.set(...n):r.set(n):e[t]=n},_ye=(e,t,n)=>{let{invalidate:r}=Dw(),a=new Map,o=(e,t,n)=>{if(hye(n)){let r=a.get(t);if(r&&r.instance===e&&r.value===n)return;a.set(t,{instance:e,value:n})}else a.delete(t);let i=e,o=t,s=t.includes(`.`);if(s){let e=t.split(`.`);o=e.pop();for(let n=0;n<e.length;n++)if(i=i[e[n]],i==null){console.error(`Cannot resolve property path "${t}": "${e[n]}" is ${i}`);return}}if(typeof n==`function`&&o.startsWith(`on`)&&!s&&`addEventListener`in i){let e=i,t=o.slice(2);return e.addEventListener(t,n),()=>{e.removeEventListener?.(t,n)}}n==null?i[o]=n:gye(i,o,n),r()},s=[],c=q(()=>{let e=Reflect.ownKeys(t()).filter(e=>typeof e==`string`);return(e.length!==s.length||e.some((e,t)=>e!==s[t]))&&(s=e),s}),l;i(()=>{let r=e(),s=t(),u=n(),d=Q(c);if(r===l)for(let e of a.keys())d.includes(e)||a.delete(e);else a.clear(),l=r;K(()=>{for(let e of d)u?.includes(e)||i(()=>o(r,e,s[e]))})})},vye=e=>typeof e==`function`&&Function.prototype.toString.call(e).startsWith(`class `),yye=(e,t)=>vye(e)?Array.isArray(t)?new e(...t):new e:e,bye=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`manual`,`makeDefault`]);function xye(e,t){Ce(t,!0);let n=J(t,`manual`,3,!1),r=J(t,`makeDefault`,3,!1),i=Le(t,bye);Xve(()=>t.ref,()=>n(),()=>r(),()=>i),ue()}var Sye=new Set([`$$slots`,`$$events`,`$$legacy`,`is`,`args`,`attach`,`dispose`,`ref`,`oncreate`,`children`,`makeDefault`,`manual`]),Cye=V(`<!> <!>`,1);function Hw(e,t){Ce(t,!0);let n=J(t,`is`,19,pye),r=J(t,`ref`,15),i=Le(t,Sye),a=q(()=>yye(n(),t.args)),o=mye({get ref(){return Q(a)},get args(){return t.args},get attach(){return t.attach},get manual(){return t.manual},get makeDefault(){return t.makeDefault},get dispose(){return t.dispose},get props(){return i}});_ye(()=>Q(a),()=>i,()=>o?.pluginsProps),lye(()=>Q(a),()=>t.attach),dye(()=>Q(a),()=>t.dispose),Pw(()=>Iw(Q(a),`Object3D`)?Q(a):void 0),Aw(()=>
2Q(a)),Qe(()=>{if(Q(a))return K(()=>(r()!==Q(a)&&r(Q(a)),t.oncreate?.(Q(a))))});var s=Cye(),c=N(s),l=e=>{xye(e,le({get ref(){return Q(a)},get manual(){return t.manual},get makeDefault(){return t.makeDefault}},()=>i))},u=q(()=>Iw(Q(a),`PerspectiveCamera`)||Iw(Q(a),`OrthographicCamera`));G(c,e=>{Q(u)&&e(l)});var d=g(c,2);ae(d,()=>t.children??qe,()=>({ref:Q(a)})),X(e,s),ue()}var wye={},Uw=new Proxy(Hw,{get(e,t){if(typeof t!=`string`)return Reflect.get(e,t);let n=wye[t]||Dn[t];if(n===void 0)throw Error(`No Three.js module found for ${t}. Did you forget to extend the catalogue?`);return(...e)=>(fye(n),Hw(...e))}});function Tye(e,t){t&&He(Vw,{...De(Vw),[e]:t})}var Ww=()=>{let e=Dw(),t=Qve(),n=Ow(),r=Fw(),i=Tw();return{advance:e.advance,autoRender:e.autoRender,autoRenderTask:t.autoRenderTask,camera:n.camera,colorManagementEnabled:t.colorManagementEnabled,colorSpace:t.colorSpace,dpr:t.dpr,invalidate:e.invalidate,mainStage:e.mainStage,renderer:t.renderer,renderMode:e.renderMode,renderStage:e.renderStage,scheduler:e.scheduler,shadows:t.shadows,shouldRender:e.shouldRender,dom:i.dom,canvas:i.canvas,size:i.size,toneMapping:t.toneMapping,get scene(){return r.scene},set scene(e){r.scene=e}}};function Gw(e,t){let{scheduler:n}=Dw();return n.getStage(e)??n.createStage(e,t)}var Eye=typeof window<`u`;function Kw(e,t,n){if(!Eye)return{task:void 0,start:()=>void 0,stop:()=>void 0,started:he(!1)};let r,a,o;Ew.isKey(e)?(r=e,a=t,o=n):(r=Symbol(`useTask`),a=e,o=t);let s=Dw(),c=o?.autoInvalidate??!0,l=s.mainStage,u=q(()=>o?.running?.()??o?.autoStart??!0);if(o){if(o.stage){if(Ew.isValue(o.stage))l=o.stage;else{let e=s.scheduler.getStage(o.stage);if(!e)throw Error(`No stage found with key ${o.stage.toString()}`);l=e}}else if(o.after){if(Array.isArray(o.after))for(let e=0;e<o.after.length;e++){let t=o.after[e];if(Ew.isValue(t)){l=t.stage;break}}else Ew.isValue(o.after)&&(l=o.after.stage)}else if(o.before){if(Array.isArray(o.before))for(let e=0;e<o.before.length;e++){let t=o.before[e];if(Ew.isValue(t)){l=t.stage;break}}else Ew.isValue(o.before)&&(l=o.before.stage)}}let d=l.createTask(r,a,o);return i(()=>{Q(u)?(d.start(),c&&s.autoInvalidations.add(a)):(d.stop(),c&&s.autoInvalidations.delete(a))}),i(()=>()=>{l.removeTask(r),c&&s.autoInvalidations.delete(a)}),{task:d,start:()=>{I(u,!0)},stop:()=>{I(u,!1)},started:$e(()=>Q(u))}}function Dye(e,t,n){let r=eye();if(!r)throw Error(`No user context store found, did you invoke this function outside of your main <Canvas> component?`);return e?e&&!t?we(r,t=>t[e]):(r.update(r=>{if(e in r){if(!n||n.existing===`skip`)return r;if(n.existing===`merge`){let n=typeof t==`function`?t():t;return Object.assign(r[e],n),r}}return r[e]=typeof t==`function`?t():t,r}),r.current[e]):{subscribe:r.subscribe}}var qw=Symbol(),Oye=e=>typeof e?.subscribe==`function`,Jw=(e,t,n)=>{let r=e().map(e=>Oye(e)?et(e):qw),a=q(()=>e().map((e,t)=>r[t]===qw?e:r[t].current)),o=()=>{Q(a);let e;return K(()=>{e=t(Q(a))}),e};n?i(o):Qe(o)},Yw=Object.assign((e,t)=>Jw(e,t,!1),{pre:(e,t)=>Jw(e,t,!0)}),kye=class{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){let t=this.workerCreator();t.addEventListener(`message`,this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){let n=this.workersResolve[e];if(n&&n(t),this.queue.length){let{resolve:t,msg:n,transfer:r}=this.queue.shift();this.workersResolve[e]=t,this.workers[e].postMessage(n,r)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{let r=this._getIdleWorker();r===-1?this.queue.push({resolve:n,msg:e,transfer:t}):(this._initWorker(r),this.workerStatus|=1<<r,this.workersResolve[r]=n,this.workers[r].postMessage(e,t))})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}},Xw=1000054e3,Zw=1000054001,Qw=1000054004,$w=1000054005,eT=1000066e3,tT=1000066004,nT=class{constructor(e,t,n,r){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,this._offset=0}_nextUint8(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}
vendor: 4,251 bytes, line 2
2_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){let t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){let n=this._offset,r=0;for(;this._dataView.getUint8(this._offset)!==t&&r<e;)r++,this._offset++;return r<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}};new Uint8Array([0]);var rT=[171,75,84,88,32,50,48,187,13,10,26,10];function iT(e){return new TextDecoder().decode(e)}function Aye(e){let t=new Uint8Array(e.buffer,e.byteOffset,rT.length);if(t[0]!==rT[0]||t[1]!==rT[1]||t[2]!==rT[2]||t[3]!==rT[3]||t[4]!==rT[4]||t[5]!==rT[5]||t[6]!==rT[6]||t[7]!==rT[7]||t[8]!==rT[8]||t[9]!==rT[9]||t[10]!==rT[10]||t[11]!==rT[11])throw Error(`Missing KTX 2.0 identifier.`);let n={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},r=17*Uint32Array.BYTES_PER_ELEMENT,i=new nT(e,rT.length,r,!0);n.vkFormat=i._nextUint32(),n.typeSize=i._nextUint32(),n.pixelWidth=i._nextUint32(),n.pixelHeight=i._nextUint32(),n.pixelDepth=i._nextUint32(),n.layerCount=i._nextUint32(),n.faceCount=i._nextUint32(),n.levelCount=i._nextUint32(),n.supercompressionScheme=i._nextUint32();let a=i._nextUint32(),o=i._nextUint32(),s=i._nextUint32(),c=i._nextUint32(),l=i._nextUint64(),u=i._nextUint64(),d=3*Math.max(n.levelCount,1)*8,f=new nT(e,rT.length+r,d,!0);for(let t=0,r=Math.max(n.levelCount,1);t<r;t++)n.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+f._nextUint64(),f._nextUint64()),uncompressedByteLength:f._nextUint64()});let p=new nT(e,a,o,!0);p._skip(4);let m=p._nextUint16(),h=p._nextUint16(),g=p._nextUint16(),_=p._nextUint16(),v={vendorId:m,descriptorType:h,versionNumber:g,colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},y=(_/4-6)/4;for(let e=0;e<y;e++){let t={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&t.channelType?(t.sampleLower=p._nextInt32(),t.sampleUpper=p._nextInt32()):(t.sampleLower=p._nextUint32(),t.sampleUpper=p._nextUint32()),v.samples[e]=t}n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(v);let b=new nT(e,s,c,!0);for(;b._offset<c;){let e=b._nextUint32(),t=b._scan(e),r=iT(t);if(n.keyValue[r]=b._nextUint8Array(e-t.byteLength-1),r.match(/^ktx/i)){let e=iT(n.keyValue[r]);n.keyValue[r]=e.substring(0,e.lastIndexOf(`\0`))}b._skip(e%4?4-e%4:0)}if(u<=0)return n;let x=new nT(e,l,u,!0),S=x._nextUint16(),C=x._nextUint16(),w=x._nextUint32(),T=x._nextUint32(),E=x._nextUint32(),D=x._nextUint32(),O=[];for(let e=0,t=Math.max(n.levelCount,1);e<t;e++)O.push({imageFlags:x._nextUint32(),rgbSliceByteOffset:x._nextUint32(),rgbSliceByteLength:x._nextUint32(),alphaSliceByteOffset:x._nextUint32(),alphaSliceByteLength:x._nextUint32()});let k=l+x._offset,A=k+w,ee=A+T,j=ee+E;return n.globalData={endpointCount:S,selectorCount:C,imageDescs:O,endpointsData:new Uint8Array(e.buffer,e.byteOffset+k,w),selectorsData:new Uint8Array(e.buffer,e.byteOffset+A,T),tablesData:new Uint8Array(e.buffer,e.byteOffset+ee,E),extendedData:new Uint8Array(e.buffer,e.byteOffset+j,D)},n}var aT,oT,sT,cT={env:{emscripten_notify_memory_growth:function(e){sT=new Uint8Array(oT.exports.memory.buffer)}}},jye=class{init(){return aT||(aT=typeof fetch<`u`?fetch(`data:application/wasm;base64,`+lT).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,cT)).then(this._init):WebAssembly.instantiate(Buffer.from(lT,`base64`),cT).then(this._init),aT)}_init(e){oT=e.instance,cT.env.emscripten_notify_memory_growth(0)}
2decode(e,t=0){if(!oT)throw Error(`ZSTDDecoder: Await .init() before decoding.`);let n=e.byteLength,r=oT.exports.malloc(n);sT.set(e,r),t||=Number(oT.exports.ZSTD_findDecompressedSize(r,n));let i=oT.exports.malloc(t),a=oT.exports.ZSTD_decompress(i,t,r,n),o=sT.slice(i,i+a);return oT.exports.free(r),oT.exports.free(i),o}},lT=`
vendor: 38,976 bytes, line 2
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AIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQ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gASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaig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gC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAd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LIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEG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CwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUE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
2`,Mye=`display-p3`,Nye=`display-p3-linear`;({...Kn.spaces[sr]});var Pye=new URL(new URL(`../assets/basis_transcoder.VXdx5NbI.wasm`,import.meta.url).href,``+import.meta.url).toString(),Fye=new
2URL(new URL(`../assets/basis_transcoder.o4Hde_L7.js`,import.meta.url).href,``+import.meta.url).toString(),uT=new WeakMap,dT=0,fT,pT=class e extends Mr{constructor(e){super(e),this.transcoderPath=``,this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new kye,this.workerSourceURL=``,this.workerConfig=null,typeof MSC_TRANSCODER<`u`&&console.warn(`THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.`)}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return console.warn(`KTX2Loader: "detectSupportAsync()" has been deprecated. Use "detectSupport()" and "await renderer.init();" when creating the renderer.`),await e.init(),this.detectSupport(e)}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature(`texture-compression-astc`),astcHDRSupported:!1,etc1Supported:e.hasFeature(`texture-compression-etc1`),etc2Supported:e.hasFeature(`texture-compression-etc2`),dxtSupported:e.hasFeature(`texture-compression-s3tc`),bptcSupported:e.hasFeature(`texture-compression-bc`),pvrtcSupported:e.hasFeature(`texture-compression-pvrtc`)}:(this.workerConfig={astcSupported:e.extensions.has(`WEBGL_compressed_texture_astc`),astcHDRSupported:e.extensions.has(`WEBGL_compressed_texture_astc`)&&e.extensions.get(`WEBGL_compressed_texture_astc`).getSupportedProfiles().includes(`hdr`),etc1Supported:e.extensions.has(`WEBGL_compressed_texture_etc1`),etc2Supported:e.extensions.has(`WEBGL_compressed_texture_etc`),dxtSupported:e.extensions.has(`WEBGL_compressed_texture_s3tc`),bptcSupported:e.extensions.has(`EXT_texture_compression_bptc`),pvrtcSupported:e.extensions.has(`WEBGL_compressed_texture_pvrtc`)||e.extensions.has(`WEBKIT_WEBGL_compressed_texture_pvrtc`)},typeof navigator<`u`&&navigator.platform!==void 0&&navigator.userAgent!==void 0&&navigator.platform.indexOf(`Linux`)>=0&&navigator.userAgent.indexOf(`Android`)<0&&this.workerConfig.astcSupported&&this.workerConfig.etc2Supported&&this.workerConfig.bptcSupported&&this.workerConfig.dxtSupported&&(this.workerConfig.astcSupported=!1,this.workerConfig.etc1Supported=!1,this.workerConfig.etc2Supported=!1)),this}init(){if(!this.transcoderPending){let t=new ar(this.manager);t.setWithCredentials(this.withCredentials);let n=new ar(this.manager);n.setWithCredentials(this.withCredentials),n.setResponseType(`arraybuffer`);let r,i;this.transcoderPath===``?(r=t.loadAsync(Fye),i=n.loadAsync(Pye)):(t.setPath(this.transcoderPath),r=t.loadAsync(`basis_transcoder.js`),n.setPath(this.transcoderPath),i=n.loadAsync(`basis_transcoder.wasm`)),this.transcoderPending=Promise.all([r,i]).then(([t,n])=>{let r=e.BasisWorker.toString(),i=[`/* constants */`,`let _EngineFormat = `+JSON.stringify(e.EngineFormat),`let _EngineType = `+JSON.stringify(e.EngineType),`let _TranscoderFormat = `+JSON.stringify(e.TranscoderFormat),`let _BasisFormat = `+JSON.stringify(e.BasisFormat),`/* basis_transcoder.js */`,t,`/* worker */`,r.substring(r.indexOf(`{`)+1,r.lastIndexOf(`}`))].join(` 3`);this.workerSourceURL=URL.createObjectURL(new Blob([i])),this.transcoderBinary=n,this.workerPool.setWorkerCreator(()=>{let e=new Worker(this.workerSourceURL),t=this.transcoderBinary.slice(0);return e.postMessage({type:`init`,config:this.workerConfig,transcoderBinary:t},[t]),e})}),dT>0&&console.warn(`THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances.`),dT++}return this.transcoderPending}load(e,t,n,r){if(this.workerConfig===null)throw Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");let i=new ar(this.manager);i.setPath(this.path),i.setCrossOrigin(this.crossOrigin),i.setWithCredentials(this.withCredentials),i.setRequestHeader(this.requestHeader),i.setResponseType(`arraybuffer`),i.load(e,e=>{this.parse(e,t,r)},n,r)}parse(e,t,n){if(this.workerConfig===null)throw Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");
vendor: 5,817 bytes, line 3
3if(uT.has(e))return uT.get(e).promise.then(t).catch(n);this._createTexture(e).then(e=>t?t(e):null).catch(n)}_createTextureFrom(e,t){let{type:n,error:r,data:{faces:i,width:a,height:o,format:s,type:c,dfdFlags:l}}=e;if(n===`error`)return Promise.reject(r);let u;if(t.faceCount===6)u=new Bt(i,s,c);else{let e=i[0].mipmaps;u=t.layerCount>1?new Rt(e,a,o,t.layerCount,s,c):new Wt(e,a,o,s,c)}return u.minFilter=i[0].mipmaps.length===1?xt:At,u.magFilter=xt,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=gT(t),u.premultiplyAlpha=!!(l&1),u}async _createTexture(e,t={}){let n=Aye(new Uint8Array(e)),r=n.vkFormat===1000066e3&&n.dataFormatDescriptor[0].colorModel===167;if(!(n.vkFormat===0||r&&!this.workerConfig.astcHDRSupported))return Rye(n);let i=t,a=this.init().then(()=>this.workerPool.postMessage({type:`transcode`,buffer:e,taskConfig:i},[e])).then(e=>this._createTextureFrom(e.data,n));return uT.set(e,{promise:a}),a}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),dT--}};pT.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},pT.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25},pT.EngineFormat={RGBAFormat:dt,RGBA_ASTC_4x4_Format:ln,RGB_BPTC_UNSIGNED_Format:mn,RGBA_BPTC_Format:an,RGBA_ETC2_EAC_Format:dn,RGBA_PVRTC_4BPPV1_Format:Ft,RGBA_S3TC_DXT5_Format:jt,RGB_ETC1_Format:xn,RGB_ETC2_Format:Jt,RGB_PVRTC_4BPPV1_Format:it,RGBA_S3TC_DXT1_Format:ur},pT.EngineType={UnsignedByteType:on,HalfFloatType:zn,FloatType:Gn},pT.BasisWorker=function(){let e,t,n,r=_EngineFormat,i=_EngineType,a=_TranscoderFormat,o=_BasisFormat;self.addEventListener(`message`,function(n){let r=n.data;switch(r.type){case`init`:e=r.config,s(r.transcoderBinary);break;case`transcode`:t.then(()=>{try{let{faces:e,buffers:t,width:n,height:i,hasAlpha:a,format:o,type:s,dfdFlags:l}=c(r.buffer);self.postMessage({type:`transcode`,id:r.id,data:{faces:e,width:n,height:i,hasAlpha:a,format:o,type:s,dfdFlags:l}},t)}catch(e){console.error(e),self.postMessage({type:`error`,id:r.id,error:e.message})}})}});function s(e){t=new Promise(t=>{n={wasmBinary:e,onRuntimeInitialized:t},BASIS(n)}).then(()=>{n.initializeBasis(),n.KTX2File===void 0&&console.warn(`THREE.KTX2Loader: Please update Basis Universal transcoder.`)})}function c(e){let t=new n.KTX2File(new Uint8Array(e));function r(){t.close(),t.delete()}if(!t.isValid())throw r(),Error(`THREE.KTX2Loader: Invalid or unsupported .ktx2 file`);let a;if(t.isUASTC())a=o.UASTC;else if(t.isETC1S())a=o.ETC1S;else if(t.isHDR())a=o.UASTC_HDR;else throw Error(`THREE.KTX2Loader: Unknown Basis encoding`);let s=t.getWidth(),c=t.getHeight(),l=t.getLayers()||1,u=t.getLevels(),f=t.getFaces(),m=t.getHasAlpha(),h=t.getDFDFlags(),{transcoderFormat:g,engineFormat:_,engineType:v}=d(a,s,c,m);if(!s||!c||!u)throw r(),Error(`THREE.KTX2Loader: Invalid texture`);if(!t.startTranscoding())throw r(),Error(`THREE.KTX2Loader: .startTranscoding failed`);let y=[],b=[];for(let e=0;e<f;e++){let n=[];for(let a=0;a<u;a++){let o=[],s,c;for(let n=0;n<l;n++){let l=t.getImageLevelInfo(a,n,e);e===0&&a===0&&n===0&&(l.origWidth%4!=0||l.origHeight%4!=0)&&console.warn(`THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions.`),u>1?(s=l.origWidth,c=l.origHeight):(s=l.width,c=l.height);let d=new Uint8Array(t.getImageTranscodedSizeInBytes(a,n,0,g)),f=t.transcodeImage(d,a,n,e,g,0,-1,-1);if(v===i.HalfFloatType&&(d=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!f)throw r(),Error(`THREE.KTX2Loader: .transcodeImage failed.`);o.push(d)}let d=p(o);n.push({data:d,width:s,height:c}),b.push(d.buffer)}y.push({mipmaps:n,width:s,height:c,format:_,type:v})}return r(),{faces:y,buffers:b,width:s,height:c,hasAlpha:m,dfdFlags:h,format:_,type:v}}let l=[{if:`astcSupported`,basisFormat:[o.UASTC],transcoderFormat:[a.ASTC_4x4,a.ASTC_4x4],engineFormat:[r.RGBA_ASTC_4x4_Format,r.RGBA_ASTC_4x4_Format],engineType:[i.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:`bptcSupported`,basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.BC7_M5,a.BC7_M5],engineFormat:[r.RGBA_BPTC_Format,r.RGBA_BPTC_Format],engineType:[i.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:`dxtSupported`,basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.BC1,a.BC3],engineFormat:[r.RGBA_S3TC_DXT1_Format,r.RGBA_S3TC_DXT5_Format],engineType:[i.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:`etc2Supported`,basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.ETC1,a.ETC2],engineFormat:[r.RGB_ETC2_Format,r.RGBA_ETC2_EAC_Format],engineType:[i.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:`etc1Supported`,basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.ETC1],engineFormat:[r.RGB_ETC1_Format],engineType:[i.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:`pvrtcSupported`,basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.PVRTC1_4_RGB,a.PVRTC1_4_RGBA],engineFormat:[r.RGB_PVRTC_4BPPV1_Format,r.RGBA_PVRTC_4BPPV1_Format],engineType:[i.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:`bptcSupported`,basisFormat:[o.UASTC_HDR],transcoderFormat:[a.BC6H],engineFormat:[r.RGB_BPTC_UNSIGNED_Format],engineType:[i.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[a.RGBA32,a.RGBA32],engineFormat:[r.RGBAFormat,r.RGBAFormat],engineType:[i.UnsignedByteType,i.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[o.UASTC_HDR],transcoderFormat:[a.RGBA_HALF],engineFormat:[r.RGBAFormat],engineType:[i.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}
3],u={[o.ETC1S]:l.filter(e=>e.basisFormat.includes(o.ETC1S)).sort((e,t)=>e.priorityETC1S-t.priorityETC1S),[o.UASTC]:l.filter(e=>e.basisFormat.includes(o.UASTC)).sort((e,t)=>e.priorityUASTC-t.priorityUASTC),[o.UASTC_HDR]:l.filter(e=>e.basisFormat.includes(o.UASTC_HDR)).sort((e,t)=>e.priorityHDR-t.priorityHDR)};function d(t,n,r,i){let a=u[t];for(let o=0;o<a.length;o++){let s=a[o];if((!s.if||e[s.if])&&s.basisFormat.includes(t)&&!(i&&s.transcoderFormat.length<2)&&(!s.needsPowerOfTwo||f(n)&&f(r)))return{transcoderFormat:s.transcoderFormat[+!!i],engineFormat:s.engineFormat[+!!i],engineType:s.engineType[0]}}throw Error(`THREE.KTX2Loader: Failed to identify transcoding target.`)}function f(e){return e<=2||!(e&e-1)&&e!==0}function p(e){if(e.length===1)return e[0];let t=0;for(let n=0;n<e.length;n++){let r=e[n];t+=r.byteLength}let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.byteLength}return n}};var Iye=new Set([dt,vn,br,or]),Lye=new Set([91]),mT={109:dt,103:br,100:or,97:dt,83:br,76:or,91:dt,43:dt,37:dt,22:br,16:br,15:or,9:or,123:vn,122:vn,152:dn,148:Jt,153:Gt,154:er,155:Yt,156:Rn,[eT]:ln,158:ln,157:ln,[tT]:Tt,166:Tt,165:Tt,134:ur,133:ur,132:In,131:In,138:jt,137:jt,140:Nn,139:kt,142:xr,141:bt,146:an,145:an,[$w]:Ft,[Zw]:Ft,[Qw]:Ct,[Xw]:Ct},hT={109:Gn,103:Gn,100:Gn,97:zn,83:zn,76:zn,91:Mt,43:on,37:on,22:on,16:on,15:on,9:on,123:It,122:fn,152:on,148:on,153:on,154:on,155:on,156:on,[eT]:zn,158:on,157:on,[tT]:zn,166:on,165:on,134:on,133:on,132:on,131:on,138:on,137:on,140:on,139:on,142:on,141:on,146:on,145:on,[$w]:on,[Zw]:on,[Qw]:on,[Xw]:on};async function Rye(e){let{vkFormat:t}=e;if(mT[t]===void 0)throw Error(`THREE.KTX2Loader: Unsupported vkFormat: `+t);hT[t]===void 0&&console.warn(`THREE.KTX2Loader: Missing ".type" for vkFormat: `+t);let n;e.supercompressionScheme===2&&(fT||=new Promise(async e=>{let t=new jye;await t.init(),e(t)}),n=await fT);let r=[];for(let i=0;i<e.levels.length;i++){let a=Math.max(1,e.pixelWidth>>i),o=Math.max(1,e.pixelHeight>>i),s=e.pixelDepth?Math.max(1,e.pixelDepth>>i):0,c=e.levels[i],l;if(e.supercompressionScheme===0)l=c.levelData;else if(e.supercompressionScheme===2)l=n.decode(c.levelData,c.uncompressedByteLength);else throw Error(`THREE.KTX2Loader: Unsupported supercompressionScheme.`);let u;u=hT[t]===1015?new Float32Array(l.buffer,l.byteOffset,l.byteLength/Float32Array.BYTES_PER_ELEMENT):hT[t]===1016||hT[t]===1012?new Uint16Array(l.buffer,l.byteOffset,l.byteLength/Uint16Array.BYTES_PER_ELEMENT):hT[t]===35902||hT[t]===35899?new Uint32Array(l.buffer,l.byteOffset,l.byteLength/Uint32Array.BYTES_PER_ELEMENT):l,r.push({data:u,width:a,height:o,depth:s})}let i=e.levelCount===0||r.length>1,a;if(Iye.has(mT[t]))a=e.pixelDepth===0?new cn(r[0].data,e.pixelWidth,e.pixelHeight):new ut(r[0].data,e.pixelWidth,e.pixelHeight,e.pixelDepth),a.minFilter=i?gr:On,a.magFilter=On,a.generateMipmaps=e.levelCount===0,a.normalized=Lye.has(t);else{if(e.pixelDepth>0)throw Error(`THREE.KTX2Loader: Unsupported pixelDepth.`);a=new Wt(r,e.pixelWidth,e.pixelHeight),a.minFilter=i?At:xt,a.magFilter=xt}return a.mipmaps=r,a.type=hT[t],a.format=mT[t],a.colorSpace=gT(e),a.needsUpdate=!0,Promise.resolve(a)}function gT(e){let t=e.dataFormatDescriptor[0];return t.colorPrimaries===1?t.transferFunction===2?sr:Zt:t.colorPrimaries===10?t.transferFunction===2?Mye:Nye:(t.colorPrimaries===0||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${t.colorPrimaries}"`),``)}var _T=e=>({subscribe:e.subscribe,get current(){return e.current}}),vT=0,yT=Sw(!1),bT=Sw(!1),xT=Sw(void 0),ST=Sw(0),CT=Sw(0),wT=Sw([]),TT=Sw(0),{onStart:zye,onLoad:Bye,onError:Vye}=rn;rn.onStart=(e,t,n)=>{zye?.(e,t,n),bT.set(!0),xT.set(e),ST.set(t),CT.set(n);let r=(t-vT)/(n-vT);TT.set(r),r===1&&yT.set(!0)},rn.onLoad=()=>{Bye?.(),bT.set(!1)},rn.onError=e=>{Vye?.(e),wT.update(t=>[...t,e])},rn.onProgress=(e,t,n)=>{t===n&&(vT=n),bT.set(!0),xT.set(e),ST.set(t),CT.set(n);let r=(t-vT)/(n-vT)||1;TT.set(r),r===1&&yT.set(!0)},_T(bT),_T(xT),_T(ST),_T(CT),_T(wT),_T(TT),_T(yT),new hn,new hn,new hn;var ET=()=>Dye(`threlte-controls`,{orbitControls:Ue(void 0),trackballControls:Ue(void 0),cameraControls:Ue(void 0),transformControls:Ue(void 0)});new $t,new fr,new mr,new hn;var Hye=Symbol(`THRELTE_SUSPENSE_CONTEXT_IDENTIFIER`),Uye=()=>{let e=De(Hye),t=new Set,n=n=>(e&&(e.suspend(n),t.add(n)),n),r={suspended:we(e?.suspended??he(!1),e=>e)};return Pe(()=>{if(e){for(let n of t)e.onComponentDestroy(n);t.clear()}}),Object.assign(n,r)};new hn,new fr,new hn,new hn,new Vn,Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),/Mac/.test(globalThis?.navigator?.platform),new hn,new hn,new hn,new yn,[`Right`,`Top`,`Front`,`Left`,`Bottom`,`Back`].map(e=>e.toLocaleLowerCase()),new Or,new hn,pr.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new yn(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},rr.line={uniforms:Et.merge([pr.common,pr.fog,pr.line]),vertexShader:` 4 #include <common> 5 #include <color_pars_vertex> 6 #include <fog_pars_vertex> 7 #include <logdepthbuf_pars_vertex> 8 #include <clipping_planes_pars_vertex> 9 10 uniform float linewidth; 11 uniform vec2 resolution; 12 13 attribute vec3 instanceStart; 14 attribute vec3 instanceEnd; 15 16 attribute vec3 instanceColorStart; 17 attribute vec3 instanceColorEnd; 18
19 #ifdef WORLD_UNITS 20 21 varying vec4 worldPos; 22 varying vec3 worldStart; 23 varying vec3 worldEnd; 24 25 #ifdef USE_DASH 26 27 varying vec2 vUv; 28 29 #endif 30 31 #else 32 33 varying vec2 vUv; 34 35 #endif 36 37 #ifdef USE_DASH 38 39 uniform float dashScale; 40 attribute float instanceDistanceStart; 41 attribute float instanceDistanceEnd; 42 varying float vLineDistance; 43 44 #endif 45 46 void trimSegment( const in vec4 start, inout vec4 end ) { 47 48 // trim end segment so it terminates between the camera plane and the near plane 49 50 // conservative estimate of the near plane 51 float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column 52 float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column 53 float nearEstimate = - 0.5 * b / a; 54 55 float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); 56 57 end.xyz = mix( start.xyz, end.xyz, alpha ); 58 59 } 60 61 void main() { 62 63 #ifdef USE_COLOR 64 65 vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; 66 67 #endif 68 69 #ifdef USE_DASH 70 71 vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; 72 vUv = uv; 73 74 #endif 75 76 float aspect = resolution.x / resolution.y; 77 78 // camera space 79 vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); 80 vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); 81 82 #ifdef WORLD_UNITS 83 84 worldStart = start.xyz; 85 worldEnd = end.xyz; 86 87 #else 88 89 vUv = uv; 90 91 #endif 92 93 // special case for perspective projection, and segments that terminate either in, or behind, the camera plane 94 // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space 95 // but we need to perform ndc-space calculations in the shader, so we must address this issue directly 96 // perhaps there is a more elegant solution -- WestLangley 97 98 bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column 99 100 if ( perspective ) { 101 102 if ( start.z < 0.0 && end.z >= 0.0 ) { 103 104 trimSegment( start, end ); 105 106 } else if ( end.z < 0.0 && start.z >= 0.0 ) { 107 108 trimSegment( end, start ); 109 110 } 111 112 } 113 114 // clip space 115 vec4 clipStart = projectionMatrix * start; 116 vec4 clipEnd = projectionMatrix * end; 117 118 // ndc space 119 vec3 ndcStart = clipStart.xyz / clipStart.w; 120 vec3 ndcEnd = clipEnd.xyz / clipEnd.w; 121 122 // direction 123 vec2 dir = ndcEnd.xy - ndcStart.xy; 124 125 // account for clip-space aspect ratio 126 dir.x *= aspect; 127 dir = normalize( dir ); 128 129 #ifdef WORLD_UNITS 130 131 vec3 worldDir = normalize( end.xyz - start.xyz ); 132 vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) ); 133 vec3 worldUp = normalize( cross( worldDir, tmpFwd ) ); 134 vec3 worldFwd = cross( worldDir, worldUp ); 135 worldPos = position.y < 0.5 ? start: end; 136 137 // height offset 138 float hw = linewidth * 0.5; 139 worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp; 140 141 // don't extend the line if we're rendering dashes because we 142 // won't be rendering the endcaps 143 #ifndef USE_DASH 144 145 // cap extension 146 worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir; 147 148 // add width to the box 149 worldPos.xyz += worldFwd * hw; 150 151 // endcaps 152 if ( position.y > 1.0 || position.y < 0.0 ) { 153 154 worldPos.xyz -= worldFwd * 2.0 * hw; 155 156 } 157 158 #endif 159 160 // project the worldpos 161 vec4 clip = projectionMatrix * worldPos; 162 163 // shift the depth of the projected points so the line 164 // segments overlap neatly 165 vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; 166 clip.z = clipPose.z * clip.w; 167 168 #else 169 170 vec2 offset = vec2( dir.y, - dir.x ); 171 // undo aspect ratio adjustment 172 dir.x /= aspect; 173 offset.x /= aspect; 174 175 // sign flip 176 if ( position.x < 0.0 ) offset *= - 1.0; 177 178 // endcaps 179 if ( position.y < 0.0 ) { 180 181 offset += - dir; 182 183 } else if ( position.y > 1.0 ) { 184 185 offset += dir; 186 187 } 188 189 // adjust for linewidth 190 offset *= linewidth; 191 192 // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... 193 offset /= resolution.y; 194 195 // select end 196 vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; 197 198 // back to clip space 199 offset *= clip.w; 200 201 clip.xy += offset; 202 203 #endif 204 205 gl_Position = clip; 206 207 vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation 208 209 #include <logdepthbuf_vertex> 210 #include <clipping_planes_vertex> 211 #include <fog_vertex> 212 213 } 214 `,fragmentShader:` 215 uniform vec3 diffuse; 216 uniform float opacity; 217 uniform float linewidth; 218 219 #ifdef USE_DASH 220 221 uniform float dashOffset; 222 uniform float dashSize; 223 uniform float gapSize; 224 225 #endif 226 227 varying float vLineDistance; 228 229 #ifdef WORLD_UNITS 230 231 varying vec4 worldPos; 232 varying vec3 worldStart; 233 varying vec3 worldEnd; 234 235 #ifdef USE_DASH 236 237 varying vec2 vUv; 238 239 #endif 240 241 #else 242 243 varying vec2 vUv; 244 245 #endif 246 247 #include <common> 248 #include <color_pars_fragment> 249 #include <fog_pars_fragment> 250 #include <logdepthbuf_pars_fragment> 251 #include <clipping_planes_pars_fragment> 252 253 vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { 254 255 float mua; 256 float mub; 257 258 vec3 p13 = p1 - p3; 259 vec3 p43 = p4 - p3; 260 261 vec3 p21 = p2 - p1; 262 263 float d1343 = dot( p13, p43 );
264 float d4321 = dot( p43, p21 ); 265 float d1321 = dot( p13, p21 ); 266 float d4343 = dot( p43, p43 ); 267 float d2121 = dot( p21, p21 ); 268 269 float denom = d2121 * d4343 - d4321 * d4321; 270 271 float numer = d1343 * d4321 - d1321 * d4343; 272 273 mua = numer / denom; 274 mua = clamp( mua, 0.0, 1.0 ); 275 mub = ( d1343 + d4321 * ( mua ) ) / d4343; 276 mub = clamp( mub, 0.0, 1.0 ); 277 278 return vec2( mua, mub ); 279 280 } 281 282 void main() { 283 284 #include <clipping_planes_fragment> 285 286 #ifdef USE_DASH 287 288 if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps 289 290 if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX 291 292 #endif 293 294 float alpha = opacity; 295 296 #ifdef WORLD_UNITS 297 298 // Find the closest points on the view ray and the line segment 299 vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; 300 vec3 lineDir = worldEnd - worldStart; 301 vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); 302 303 vec3 p1 = worldStart + lineDir * params.x; 304 vec3 p2 = rayEnd * params.y; 305 vec3 delta = p1 - p2; 306 float len = length( delta ); 307 float norm = len / linewidth; 308 309 #ifndef USE_DASH 310 311 #ifdef USE_ALPHA_TO_COVERAGE 312 313 float dnorm = fwidth( norm ); 314 alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); 315 316 #else 317 318 if ( norm > 0.5 ) { 319 320 discard; 321 322 } 323 324 #endif 325 326 #endif 327 328 #else 329 330 #ifdef USE_ALPHA_TO_COVERAGE 331 332 // artifacts appear on some hardware if a derivative is taken within a conditional 333 float a = vUv.x; 334 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 335 float len2 = a * a + b * b; 336 float dlen = fwidth( len2 ); 337 338 if ( abs( vUv.y ) > 1.0 ) { 339 340 alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); 341 342 } 343 344 #else 345 346 if ( abs( vUv.y ) > 1.0 ) { 347 348 float a = vUv.x; 349 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 350 float len2 = a * a + b * b; 351 352 if ( len2 > 1.0 ) discard; 353 354 } 355 356 #endif 357 358 #endif 359 360 vec4 diffuseColor = vec4( diffuse, alpha ); 361 362 #include <logdepthbuf_fragment> 363 #include <color_fragment> 364 365 gl_FragColor = vec4( diffuseColor.rgb, alpha ); 366 367 #include <tonemapping_fragment> 368 #include <colorspace_fragment> 369 #include <fog_fragment> 370 #include <premultiplied_alpha_fragment> 371 372 } 373 `},new Sn,new hn,new hn,new Sn,new Sn,new Sn,new hn,new fr,new lt,new hn,new Or,new $t,new Sn;var DT={type:`change`},OT={type:`start`},kT={type:`end`},AT=new mr,jT=new Tr,Wye=Math.cos(70*wt.DEG2RAD),MT=new hn,NT=2*Math.PI,PT={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},FT=1e-6,Gye=class extends Ot{constructor(e,t=null){super(e,t),this.state=PT.NONE,this.target=new hn,this.cursor=new hn,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:sn.ROTATE,MIDDLE:sn.DOLLY,RIGHT:sn.PAN},this.touches={ONE:Qn.ROTATE,TWO:Qn.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle=`auto`,this._domElementKeyEvents=null,this._lastPosition=new hn,this._lastQuaternion=new zt,this._lastTargetPosition=new hn,this._quat=new zt().setFromUnitVectors(e.up,new hn(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Er,this._sphericalDelta=new Er,this._scale=1,this._panOffset=new hn,this._rotateStart=new yn,this._rotateEnd=new yn,this._rotateDelta=new yn,this._panStart=new yn,this._panEnd=new yn,this._panDelta=new yn,this._dollyStart=new yn,this._dollyEnd=new yn,this._dollyDelta=new yn,this._dollyDirection=new hn,this._mouse=new yn,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=qye.bind(this),this._onPointerDown=Kye.bind(this),this._onPointerUp=Jye.bind(this),this._onContextMenu=tbe.bind(this),this._onMouseWheel=Zye.bind(this),this._onKeyDown=Qye.bind(this),this._onTouchStart=$ye.bind(this),this._onTouchMove=ebe.bind(this),this._onMouseDown=Yye.bind(this),this._onMouseMove=Xye.bind(this),this._interceptControlDown=nbe.bind(this),this._interceptControlUp=rbe.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e===`grab`?this.domElement.style.cursor=`grab`:this.domElement.style.cursor=`auto`}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}
vendor: 17,583 bytes, lines 373-397
373),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.state=PT.NONE,this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents();let e=this.domElement.getRootNode();e.removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),e.removeEventListener(`keyup`,this._interceptControlUp,{capture:!0}),this._controlActive=!1,this._pointers.length=0,this._pointerPositions={},this.domElement.style.touchAction=``,this.domElement.style.cursor=`auto`}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(DT),this.update(),this.state=PT.NONE}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){let t=this.object.position;MT.copy(t).sub(this.target),MT.applyQuaternion(this._quat),this._spherical.setFromVector3(MT),this.autoRotate&&this.state===PT.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=NT:n>Math.PI&&(n-=NT),r<-Math.PI?r+=NT:r>Math.PI&&(r-=NT),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(MT.setFromSpherical(this._spherical),MT.applyQuaternion(this._quatInverse),t.copy(this.target).add(MT),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=MT.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new hn(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new hn(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=MT.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(AT.origin.copy(this.object.position),AT.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(AT.direction))<Wye?this.object.lookAt(this.target):(jT.setFromNormalAndCoplanarPoint(this.object.up,this.target),AT.intersectPlane(jT,this.target))))}else if(this.object.isOrthographicCamera){let e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,i||this._lastPosition.distanceToSquared(this.object.position)>FT||8*(1-this._lastQuaternion.dot(this.object.quaternion))>FT||this._lastTargetPosition.distanceToSquared(this.target)>FT?(this.dispatchEvent(DT),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?NT/60/60*this.autoRotateSpeed:NT/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){MT.setFromMatrixColumn(t,0),MT.multiplyScalar(-e),this._panOffset.add(MT)}_panUp(e,t){this.screenSpacePanning===!0?MT.setFromMatrixColumn(t,1):(MT.setFromMatrixColumn(t,0),MT.crossVectors(this.object.up,MT)),MT.multiplyScalar(e),this._panOffset.add(MT)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;MT.copy(r).sub(this.target);let i=MT.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(NT*this._rotateDelta.x/t.clientHeight),this._rotateUp(NT*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(NT*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-NT*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(NT*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-NT*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(NT*this._rotateDelta.x/t.clientHeight),this._rotateUp(NT*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new yn,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){let t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){let t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}};function Kye(e){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.ownerDocument.addEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.addEventListener(`pointerup`,this._onPointerUp)),!this._isTrackingPointer(e)&&(this._addPointer(e),e.pointerType===`touch`?this._onTouchStart(e):this._onMouseDown(e),this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grabbing`)))}function qye(e){this.enabled!==!1&&(e.pointerType===`touch`?this._onTouchMove(e):this._onMouseMove(e))}function Jye(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.dispatchEvent(kT),this.state=PT.NONE,this._cursorStyle===`grab`&&(this.domElement.style.cursor=`grab`);break;case 1:let t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y})}}function Yye(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case sn.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(e),this.state=PT.DOLLY;break;case sn.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=PT.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=PT.ROTATE}break;case sn.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(e),this.state=PT.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(e),this.state=PT.PAN}break;default:this.state=PT.NONE}this.state!==PT.NONE&&this.dispatchEvent(OT)}function Xye(e){switch(this.state){case PT.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(e);break;case PT.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(e);break;case PT.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(e)}}function Zye(e){this.enabled!==!1&&this.enableZoom!==!1&&this.state===PT.NONE&&(e.preventDefault(),this.dispatchEvent(OT),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(kT))}function Qye(e){this.enabled!==!1&&this._handleKeyDown(e)}function $ye(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case Qn.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(e),this.state=PT.TOUCH_ROTATE;break;case Qn.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(e),this.state=PT.TOUCH_PAN;break;default:this.state=PT.NONE}break;case 2:switch(this.touches.TWO){case Qn.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(e),this.state=PT.TOUCH_DOLLY_PAN;break;case Qn.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(e),this.state=PT.TOUCH_DOLLY_ROTATE;break;default:this.state=PT.NONE}break;default:this.state=PT.NONE}this.state!==PT.NONE&&this.dispatchEvent(OT)}function ebe(e){switch(this._trackPointer(e),this.state){case PT.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(e),this.update();break;case PT.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(e),this.update();break;case PT.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(e),this.update();break;case PT.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=PT.NONE}}function tbe(e){this.enabled!==!1&&e.preventDefault()}function nbe(e){e.key===`Control`&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}function rbe(e){e.key===`Control`&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener(`keyup`,this._interceptControlUp,{passive:!0,capture:!0}))}var ibe=` 374 varying vec3 localPosition; 375 varying vec4 worldPosition; 376 377 uniform vec3 worldCamProjPosition; 378 uniform vec3 worldPlanePosition; 379 uniform float fadeDistance; 380 uniform bool infiniteGrid; 381 uniform bool followCamera; 382 383 uniform int coord0; 384 uniform int coord1; 385 uniform int coord2; 386 387 void main() { 388 localPosition = vec3( 389 position[coord0], 390 position[coord1], 391 position[coord2] 392 ); 393 394 if (infiniteGrid) { 395 localPosition *= 1.0 + fadeDistance; 396 } 397
398 worldPosition = modelMatrix * vec4(localPosition, 1.0); 399 if (followCamera) { 400 worldPosition.xyz += (worldCamProjPosition - worldPlanePosition); 401 localPosition = (inverse(modelMatrix) * worldPosition).xyz; 402 } 403 404 gl_Position = projectionMatrix * viewMatrix * worldPosition; 405 } 406`,abe=` 407 #define PI 3.141592653589793 408 409 varying vec3 localPosition; 410 varying vec4 worldPosition; 411 412 uniform vec3 worldCamProjPosition; 413 uniform float cellSize; 414 uniform float sectionSize; 415 uniform vec3 cellColor; 416 uniform vec3 sectionColor; 417 uniform float fadeDistance; 418 uniform float fadeStrength; 419 uniform vec3 fadeOrigin; 420 uniform float cellThickness; 421 uniform float sectionThickness; 422 uniform vec3 backgroundColor; 423 uniform float backgroundOpacity; 424 425 uniform bool infiniteGrid; 426 427 uniform int coord0; 428 uniform int coord1; 429 uniform int coord2; 430 431 // 0 - default; 1 - lines; 2 - circles; 3 - polar 432 uniform int gridType; 433 434 // lineGrid coord for lines 435 uniform int lineGridCoord; 436 437 // circlegrid max radius 438 uniform float circleGridMaxRadius; 439 440 // polar grid dividers 441 uniform float polarCellDividers; 442 uniform float polarSectionDividers; 443 444 float getSquareGrid(float size, float thickness, vec3 localPos) { 445 vec2 coord = localPos.xy / size; 446 447 vec2 grid = abs(fract(coord - 0.5) - 0.5) / fwidth(coord); 448 float line = min(grid.x, grid.y) + 1.0 - thickness; 449 450 return 1.0 - min(line, 1.0); 451 } 452 453 float getLinesGrid(float size, float thickness, vec3 localPos) { 454 float coord = localPos[lineGridCoord] / size; 455 float line = abs(fract(coord - 0.5) - 0.5) / fwidth(coord) - thickness * 0.2; 456 457 return 1.0 - min(line, 1.0); 458 } 459 460 float getRadiusMask(float radius) { 461 if (infiniteGrid || circleGridMaxRadius <= 0.0) { 462 return 1.0; 463 } 464 465 float width = max(fwidth(radius), 0.0001); 466 return 1.0 - smoothstep(circleGridMaxRadius, circleGridMaxRadius + width, radius); 467 } 468 469 float getPolarDividerMask(float radius) { 470 if (infiniteGrid || circleGridMaxRadius <= 0.0) { 471 return 1.0; 472 } 473 474 float width = max(fwidth(radius), 0.0001); 475 return 1.0 - smoothstep(circleGridMaxRadius - width, circleGridMaxRadius, radius); 476 } 477 478 float getCirclesGrid(float size, float thickness, float radius) { 479 float coord = radius / size; 480 float line = abs(fract(coord - 0.5) - 0.5) / fwidth(coord) - thickness * 0.2; 481 482 return 1.0 - min(line, 1.0); 483 } 484 485 float getPolarGrid(float size, float thickness, float polarDividers, vec3 localPos, float radius) { 486 if (polarDividers <= 0.0) { 487 return getCirclesGrid(size, thickness, radius); 488 } 489 490 float rad = radius / size; 491 vec2 coord = vec2(rad, atan(localPos.x, localPos.y) * polarDividers / PI) ; 492 493 vec2 wrapped = vec2(coord.x, fract(coord.y / (2.0 * polarDividers)) * (2.0 * polarDividers)); 494 vec2 coordWidth = fwidth(coord); 495 vec2 wrappedWidth = fwidth(wrapped); 496 vec2 width = (coord.y < -polarDividers * 0.5 || coord.y > polarDividers * 0.5 ? wrappedWidth : coordWidth) * (1.+thickness*0.25); 497 498 // Compute anti-aliased world-space grid lines 499 vec2 grid = abs(fract(coord - 0.5) - 0.5) / width; 500 float circle = 1.0 - min(grid.x, 1.0); 501 float divider = 1.0 - min(grid.y, 1.0); 502 503 return max(circle, divider * getPolarDividerMask(radius)); 504 } 505 506 void main() { 507 float g1 = 0.0; 508 float g2 = 0.0; 509 510 vec3 localPos = vec3(localPosition[coord0], localPosition[coord1], localPosition[coord2]); 511 float radiusMask = 1.0; 512 513 if (gridType == 0) { 514 g1 = getSquareGrid(cellSize, cellThickness, localPos); 515 g2 = getSquareGrid(sectionSize, sectionThickness, localPos); 516 517 } else if (gridType == 1) { 518 g1 = getLinesGrid(cellSize, cellThickness, localPos); 519 g2 = getLinesGrid(sectionSize, sectionThickness, localPos); 520 521 } else if (gridType == 2) { 522 float radius = length(localPos.xy); 523 g1 = getCirclesGrid(cellSize, cellThickness, radius); 524 g2 = getCirclesGrid(sectionSize, sectionThickness, radius); 525 radiusMask = getRadiusMask(radius); 526 527 } else if (gridType == 3) { 528 float radius = length(localPos.xy); 529 g1 = getPolarGrid(cellSize, cellThickness, polarCellDividers, localPos, radius); 530 g2 = getPolarGrid(sectionSize, sectionThickness, polarSectionDividers, localPos, radius);
531 radiusMask = getRadiusMask(radius); 532 } 533 534 float dist = distance(fadeOrigin, worldPosition.xyz); 535 float d = 1.0 - min(dist / fadeDistance, 1.0); 536 float fadeFactor = pow(d, fadeStrength) * 0.95; 537 538 vec3 color = mix(cellColor, sectionColor, min(1.0, sectionThickness * g2)); 539 540 if (backgroundOpacity > 0.0) { 541 float linesAlpha = clamp((g1 + g2) * fadeFactor, 0.0,1.0); 542 vec3 finalColor = mix(backgroundColor, color, linesAlpha); 543 float blendedAlpha = max(linesAlpha, backgroundOpacity * fadeFactor); 544 gl_FragColor = vec4(finalColor, blendedAlpha); 545 546 } else { 547 gl_FragColor = vec4(color, (g1 + g2) * pow(d, fadeStrength)); 548 gl_FragColor.a = mix(0.75 * gl_FragColor.a, gl_FragColor.a, g2); 549 } 550 551 gl_FragColor.a *= radiusMask; 552 553 if (gl_FragColor.a <= 0.0) { 554 discard; 555 } 556 557 #include <tonemapping_fragment> 558 #include <colorspace_fragment> 559 } 560`,obe=new Set(`$$slots.$$events.$$legacy.cellSize.sectionSize.cellColor.sectionColor.backgroundColor.backgroundOpacity.fadeDistance.fadeStrength.cellThickness.sectionThickness.plane.gridSize.followCamera.infiniteGrid.fadeOrigin.side.type.axis.maxRadius.cellDividers.sectionDividers.ref.children`.split(`.`)),sbe=V(`<!> <!>`,1);function cbe(e,t){Ce(t,!0);let n=J(t,`cellSize`,3,1),r=J(t,`sectionSize`,3,10),i=J(t,`cellColor`,3,`#000000`),a=J(t,`sectionColor`,3,`#0000ee`),o=J(t,`backgroundColor`,3,`#dadada`),s=J(t,`backgroundOpacity`,3,0),c=J(t,`fadeDistance`,3,100),l=J(t,`fadeStrength`,3,1),u=J(t,`cellThickness`,3,1),d=J(t,`sectionThickness`,3,2),f=J(t,`plane`,3,`xz`),p=J(t,`gridSize`,19,()=>[20,20]),m=J(t,`followCamera`,3,!1),h=J(t,`infiniteGrid`,3,!1),_=J(t,`side`,3,2),v=J(t,`type`,3,`grid`),y=J(t,`axis`,3,`x`),b=J(t,`maxRadius`,3,0),x=J(t,`cellDividers`,3,6),S=J(t,`sectionDividers`,3,2),C=J(t,`ref`,15),w=Le(t,obe),T=new Nt,{invalidate:E,camera:D}=Ww(),O=new Tr,k=new hn(0,1,0),A=new hn(0,0,0),ee=new hn,j={x:0,y:1,z:2},M={xz:{axes:`xzy`,normal:[0,1,0]},xy:{axes:`xyz`,normal:[0,0,1]},zy:{axes:`zyx`,normal:[1,0,0]}},te={grid:0,lines:1,circular:2,polar:3},ne={cellSize:new un(1),sectionSize:new un(10),cellColor:new un(new ot(`#000000`)),sectionColor:new un(new ot(`#0000ee`)),backgroundColor:new un(new ot(`#dadada`)),backgroundOpacity:new un(0),fadeDistance:new un(100),fadeStrength:new un(1),fadeOrigin:new un(new hn),cellThickness:new un(1),sectionThickness:new un(2),infiniteGrid:new un(!1),followCamera:new un(!1),coord0:new un(0),coord1:new un(2),coord2:new un(1),gridType:new un(te.grid),lineGridCoord:new un(j.x),circleGridMaxRadius:new un(0),polarCellDividers:new un(6),polarSectionDividers:new un(2),worldCamProjPosition:new un(new hn),worldPlanePosition:new un(new hn)};Qe(()=>{let{axes:e,normal:t}=M[f()],n=e.charAt(0),r=e.charAt(1),i=e.charAt(2);ne.coord0.value=j[n],ne.coord1.value=j[r],ne.coord2.value=j[i],k.set(t[0],t[1],t[2]),E()}),Qe(()=>{ne.cellSize.value=n(),E()}),Qe(()=>{ne.sectionSize.value=r(),E()}),Qe(()=>{ne.cellColor.value.set(i()),E()}),Qe(()=>{ne.sectionColor.value.set(a()),E()}),Qe(()=>{ne.backgroundColor.value.set(o()),E()}),Qe(()=>{ne.backgroundOpacity.value=s(),E()}),Qe(()=>{ne.fadeDistance.value=c(),E()}),Qe(()=>{ne.fadeStrength.value=l(),E()}),Qe(()=>{t.fadeOrigin&&(Iw(t.fadeOrigin,`Vector3`)?ne.fadeOrigin.value.copy(t.fadeOrigin):ne.fadeOrigin.value.fromArray(t.fadeOrigin)),E()}),Qe(()=>{ne.cellThickness.value=u(),E()}),Qe(()=>{ne.sectionThickness.value=d(),E()}),Qe(()=>{ne.followCamera.value=m(),E()}),Qe(()=>{ne.infiniteGrid.value=h(),E()}),Qe(()=>{ne.gridType.value=te[v()],ne.lineGridCoord.value=j[y()],ne.circleGridMaxRadius.value=b(),ne.polarCellDividers.value=x(),ne.polarSectionDividers.value=S(),E()}),Kw(()=>{O.setFromNormalAndCoplanarPoint(k,A).applyMatrix4(T.matrixWorld);let e=T.material,n=e.uniforms.worldCamProjPosition,r=e.uniforms.worldPlanePosition,i=e.uniforms.fadeOrigin,a=O.projectPoint(D.current.getWorldPosition(ee),n.value);t.fadeOrigin||i.value.copy(a),m()&&r.value.set(0,0,0).applyMatrix4(T.matrixWorld)},{autoInvalidate:!1,running:()=>m()||!t.fadeOrigin}),Uw(e,le({get is(){return T},frustumCulled:!1},()=>w,{get ref(){return C()},set ref(e){C(e)},children:(e,n)=>{var r=sbe(),i=N(r);P(i,()=>Uw.ShaderMaterial,(e,t)=>{t(e,{get fragmentShader(){return abe},get vertexShader(){return ibe},get uniforms(){return ne},transparent:!0,get side(){return _()}})});var a=g(i,2),o=e=>{var n=fe(),r=N(n);ae(r,()=>t.children,()=>({ref:T})),X(e,n)},s=e=>{var t=fe(),n=N(t);{let e=q(()=>typeof p()==`number`?[p(),p()]:p());P(n,()=>Uw.PlaneGeometry,(t,n)=>{n(t,{get args(){return Q(e)}})})}X(e,t)};G(a,e=>{t.children?e(o):e(s,-1)}),X(e,r)},$$slots:{default:!0}}
560)),ue()}var IT=new Wn,LT=new hn,RT=new hn,zT=new zt,BT={X:new hn(1,0,0),Y:new hn(0,1,0),Z:new hn(0,0,1)},VT={type:`change`},HT={type:`mouseDown`,mode:null},UT={type:`mouseUp`,mode:null},WT={type:`objectChange`},lbe=class extends Ot{constructor(e,t=null){super(void 0,t);let n=new hbe(this);this._root=n;let r=new gbe;this._gizmo=r,n.add(r);let i=new _be;this._plane=i,n.add(i);let a=this;function o(e,t){let n=t;Object.defineProperty(a,e,{get:function(){return n===void 0?t:n},set:function(t){n!==t&&(n=t,i[e]=t,r[e]=t,a.dispatchEvent({type:e+`-changed`,value:t}),a.dispatchEvent(VT))}}),a[e]=t,i[e]=t,r[e]=t}o(`camera`,e),o(`object`,void 0),o(`enabled`,!0),o(`axis`,null),o(`mode`,`translate`),o(`translationSnap`,null),o(`rotationSnap`,null),o(`scaleSnap`,null),o(`space`,`world`),o(`size`,1),this.viewport=null,o(`dragging`,!1),o(`showX`,!0),o(`showY`,!0),o(`showZ`,!0),o(`showXY`,!0),o(`showYZ`,!0),o(`showXZ`,!0),o(`showXYZE`,!0),o(`showE`,!0),o(`minX`,-1/0),o(`maxX`,1/0),o(`minY`,-1/0),o(`maxY`,1/0),o(`minZ`,-1/0),o(`maxZ`,1/0);let s=new hn,c=new hn,l=new zt,u=new zt,d=new hn,f=new zt,p=new hn,m=new hn,h=new hn,g=new hn;o(`worldPosition`,s),o(`worldPositionStart`,c),o(`worldQuaternion`,l),o(`worldQuaternionStart`,u),o(`cameraPosition`,d),o(`cameraQuaternion`,f),o(`pointStart`,p),o(`pointEnd`,m),o(`rotationAxis`,h),o(`rotationAngle`,0),o(`eye`,g),this._offset=new hn,this._startNorm=new hn,this._endNorm=new hn,this._cameraScale=new hn,this._parentPosition=new hn,this._parentQuaternion=new zt,this._parentQuaternionInv=new zt,this._parentScale=new hn,this._worldScaleStart=new hn,this._worldQuaternionInv=new zt,this._worldScale=new hn,this._positionStart=new hn,this._quaternionStart=new zt,this._scaleStart=new hn,this._getPointer=ube.bind(this),this._onPointerDown=fbe.bind(this),this._onPointerHover=dbe.bind(this),this._onPointerMove=pbe.bind(this),this._onPointerUp=mbe.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointermove`,this._onPointerHover),this.domElement.addEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerHover),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=``}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&IT.setFromCamera(e,this.camera);let t=GT(this._gizmo.picker[this.mode],IT);this.axis=t?t.object.name:null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&IT.setFromCamera(e,this.camera);let t=GT(this._plane,IT,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,HT.mode=this.mode,this.dispatchEvent(HT)}}pointerMove(e){let t=this.axis,n=this.mode,r=this.object,i=this.space;if(n===`scale`?i=`local`:(t===`E`||t===`XYZE`||t===`XYZ`)&&(i=`world`),r===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&IT.setFromCamera(e,this.camera);let a=GT(this._plane,IT,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n===`translate`)this._offset.copy(this.pointEnd).sub(this.pointStart),i===`local`&&t!==`XYZ`&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf(`X`)===-1&&(this._offset.x=0),t.indexOf(`Y`)===-1&&(this._offset.y=0),t.indexOf(`Z`)===-1&&(this._offset.z=0),i===`local`&&t!==`XYZ`?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i===`local`&&(r.position.applyQuaternion(zT.copy(this._quaternionStart).invert()),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),i===`world`&&(r.getWorldPosition(LT),t.search(`X`)!==-1&&(LT.x=Math.round(LT.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(LT.y=Math.round(LT.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(LT.z=Math.round(LT.z/this.translationSnap)*this.translationSnap),r.position.copy(r.parent.worldToLocal(LT)))),r.position.x=Math.max(this.minX,Math.min(this.maxX,r.position.x)),r.position.y=Math.max(this.minY,Math.min(this.maxY,r.position.y)),r.position.z=Math.max(this.minZ,Math.min(this.maxZ,r.position.z));else if(n===`scale`){if(t.search(`XYZ`)!==-1){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),RT.set(e,e,e)}else LT.copy(this.pointStart),RT.copy(this.pointEnd),LT.applyQuaternion(this._worldQuaternionInv),RT.applyQuaternion(this._worldQuaternionInv),RT.divi
560de(LT),t.search(`X`)===-1&&(RT.x=1),t.search(`Y`)===-1&&(RT.y=1),t.search(`Z`)===-1&&(RT.z=1);r.scale.copy(this._scaleStart).multiply(RT),this.scaleSnap&&(t.search(`X`)!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Y`)!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Z`)!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n===`rotate`){this._offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(LT.setFromMatrixPosition(this.camera.matrixWorld)),n=!1;t===`XYZE`?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(LT.copy(this.rotationAxis).cross(this.eye))*e):(t===`X`||t===`Y`||t===`Z`)&&(this.rotationAxis.copy(BT[t]),LT.copy(BT[t]),i===`local`&<.applyQuaternion(this.worldQuaternion),LT.cross(this.eye),LT.length()===0?n=!0:this.rotationAngle=this._offset.dot(LT.normalize())*e),(t===`E`||n)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i===`local`&&t!==`E`&&t!==`XYZE`?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(zT.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(zT.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(VT),this.dispatchEvent(WT)}}pointerUp(e){(e===null||e.button===0)&&(this.dragging&&this.axis!==null&&(UT.mode=this.mode,this.dispatchEvent(UT)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(VT),this.dispatchEvent(WT),this.pointStart.copy(this.pointEnd))}getRaycaster(){return IT}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}setColors(e,t,n,r){let i=this._gizmo.materialLib;i.xAxis.color.set(e),i.yAxis.color.set(t),i.zAxis.color.set(n),i.active.color.set(r),i.xAxisTransparent.color.set(e),i.yAxisTransparent.color.set(t),i.zAxisTransparent.color.set(n),i.activeTransparent.color.set(r),i.xAxis._color&&i.xAxis._color.set(e),i.yAxis._color&&i.yAxis._color.set(t),i.zAxis._color&&i.zAxis._color.set(n),i.active._color&&i.active._color.set(r),i.xAxisTransparent._color&&i.xAxisTransparent._color.set(e),i.yAxisTransparent._color&&i.yAxisTransparent._color.set(t),i.zAxisTransparent._color&&i.zAxisTransparent._color.set(n),i.activeTransparent._color&&i.activeTransparent._color.set(r)}};function ube(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{let t=this.domElement.getBoundingClientRect(),n=this.viewport,r,i,a,o;return n===null?(r=0,i=0,a=t.width,o=t.height):(r=n.x,i=t.height-n.y-n.w,a=n.z,o=n.w),{x:(e.clientX-t.left-r)/a*2-1,y:-(e.clientY-t.top-i)/o*2+1,button:e.button}}}function dbe(e){if(this.enabled)switch(e.pointerType){case`mouse`:case`pen`:this.pointerHover(this._getPointer(e))}}function fbe(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener(`pointermove`,this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function pbe(e){this.enabled&&this.pointerMove(this._getPointer(e))}function mbe(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.pointerUp(this._getPointer(e)))}function GT(e,t,n){let r=t.intersectObject(e,!0);for(let e=0;e<r.length;e++)if(r[e].object.visible||n)return r[e];return!1}var KT=new rt,qT=new hn(0,1,0),JT=new hn(0,0,0),YT=new fr,XT=new zt,ZT=new zt,QT=new hn,$T=new fr,eE=new hn(1,0,0),tE=new hn(0,1,0),nE=new hn(0,0,1),rE=new hn,iE=new hn,aE=new hn,hbe=class extends Vn{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){let t=this.controls;
560t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error(`TransformControls: The attached 3D object must be a part of the scene graph.`):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),this.parent&&($T.copy(this.parent.matrixWorld).invert(),$T.decompose(this.position,this.quaternion,this.scale)),super.updateMatrixWorld(e)}dispose(){this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}},gbe=class extends Vn{constructor(){super(),this.isTransformControlsGizmo=!0,this.type=`TransformControlsGizmo`;let e=new bn({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new Yn({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=e.clone();n.opacity=.15;let r=t.clone();r.opacity=.5;let i=e.clone();i.color.setHex(16711680);let a=e.clone();a.color.setHex(65280);let o=e.clone();o.color.setHex(255);let s=e.clone();s.color.setHex(16711680),s.opacity=.5;let c=e.clone();c.color.setHex(65280),c.opacity=.5;let l=e.clone();l.color.setHex(255),l.opacity=.5;let u=e.clone();u.opacity=.25;let d=e.clone();d.color.setHex(16776960),d.opacity=.25;let f=e.clone();f.color.setHex(16776960);let p=e.clone();p.color.setHex(7895160),this.materialLib={xAxis:i,yAxis:a,zAxis:o,active:f,xAxisTransparent:s,yAxisTransparent:c,zAxisTransparent:l,activeTransparent:d};let m=new Ar(0,.04,.1,12);m.translate(0,.05,0);let h=new Dr(.08,.08,.08);h.translate(0,.04,0);let g=new ft;g.setAttribute(`position`,new hr([0,0,0,1,0,0],3));let _=new Ar(.0075,.0075,.5,3);_.translate(0,.25,0);function v(e,t){let n=new Vt(e,.0075,3,64,t*Math.PI*2);return n.rotateY(Math.PI/2),n.rotateX(Math.PI/2),n}function y(){let e=new ft;return e.setAttribute(`position`,new hr([0,0,0,1,1,1],3)),e}let b={X:[[new Nt(m,i),[.5,0,0],[0,0,-Math.PI/2]],[new Nt(m,i),[-.5,0,0],[0,0,Math.PI/2]],[new Nt(_,i),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new Nt(m,a),[0,.5,0]],[new Nt(m,a),[0,-.5,0],[Math.PI,0,0]],[new Nt(_,a)]],Z:[[new Nt(m,o),[0,0,.5],[Math.PI/2,0,0]],[new Nt(m,o),[0,0,-.5],[-Math.PI/2,0,0]],[new Nt(_,o),null,[Math.PI/2,0,0]]],XYZ:[[new Nt(new wn(.1,0),u),[0,0,0]]],XY:[[new Nt(new Dr(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new Nt(new Dr(.15,.15,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Nt(new Dr(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]]},x={X:[[new Nt(new Ar(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new Nt(new Ar(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new Nt(new Ar(.2,0,.6,4),n),[0,.3,0]],[new Nt(new Ar(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new Nt(new Ar(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new Nt(new Ar(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new Nt(new wn(.2,0),n)]],XY:[[new Nt(new Dr(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new Nt(new Dr(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Nt(new Dr(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]]},S={START:[[new Nt(new wn(.01,2),r),null,null,null,`helper`]],END:[[new Nt(new wn(.01,2),r),null,null,null,`helper`]],DELTA:[[new $n(y(),r),null,null,null,`helper`]],X:[[new $n(g,r),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new $n(g,r),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new $n(g,r),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},C={XYZE:[[new Nt(v(.5,1),p),null,[0,Math.PI/2,0]]],X:[[new Nt(v(.5,.5),i)]],Y:[[new Nt(v(.5,.5),a),null,[0,0,-Math.PI/2]]],Z:[[new Nt(v(.5,.5),o),null,[0,Math.PI/2,0]]],E:[[new Nt(v(.75,1),d),null,[0,Math.PI/2,0]]]},w={AXIS:[[new $n(g,r),[-1e3,0,0],null,[1e6,1,1],`helper`]]},T={XYZE:[[new Nt(new mt(.25,10,8),n)]],X:[[new Nt(new Vt(.5,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new Nt(new Vt(.5,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new Nt(new Vt(.5,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new Nt(new Vt(.75,.1,2,24),n)]]},E={X:[[new Nt(h,i),[.5,0,0],[0,0,-Math.PI/2]],[new Nt(_,i),[0,0,0],[0,0,-Math.PI/2]],[new Nt(h,i),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new
560Nt(h,a),[0,.5,0]],[new Nt(_,a)],[new Nt(h,a),[0,-.5,0],[0,0,Math.PI]]],Z:[[new Nt(h,o),[0,0,.5],[Math.PI/2,0,0]],[new Nt(_,o),[0,0,0],[Math.PI/2,0,0]],[new Nt(h,o),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new Nt(new Dr(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new Nt(new Dr(.15,.15,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Nt(new Dr(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new Nt(new Dr(.1,.1,.1),u)]]},D={X:[[new Nt(new Ar(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new Nt(new Ar(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new Nt(new Ar(.2,0,.6,4),n),[0,.3,0]],[new Nt(new Ar(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new Nt(new Ar(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new Nt(new Ar(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new Nt(new Dr(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new Nt(new Dr(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Nt(new Dr(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new Nt(new Dr(.2,.2,.2),n),[0,0,0]]]},O={X:[[new $n(g,r),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new $n(g,r),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new $n(g,r),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]};function k(e){let t=new Vn;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),a=e[n][r][1],o=e[n][r][2],s=e[n][r][3],c=e[n][r][4];i.name=n,i.tag=c,a&&i.position.set(a[0],a[1],a[2]),o&&i.rotation.set(o[0],o[1],o[2]),s&&i.scale.set(s[0],s[1],s[2]),i.updateMatrix();let l=i.geometry.clone();l.applyMatrix4(i.matrix),i.geometry=l,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=k(b)),this.add(this.gizmo.rotate=k(C)),this.add(this.gizmo.scale=k(E)),this.add(this.picker.translate=k(x)),this.add(this.picker.rotate=k(T)),this.add(this.picker.scale=k(D)),this.add(this.helper.translate=k(S)),this.add(this.helper.rotate=k(w)),this.add(this.helper.scale=k(O)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){let t=(this.mode===`scale`?`local`:this.space)===`local`?this.worldQuaternion:ZT;this.gizmo.translate.visible=this.mode===`translate`,this.gizmo.rotate.visible=this.mode===`rotate`,this.gizmo.scale.visible=this.mode===`scale`,this.helper.translate.visible=this.mode===`translate`,this.helper.rotate.visible=this.mode===`rotate`,this.helper.scale.visible=this.mode===`scale`;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){let r=n[e];r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition);let i;if(i=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(i*this.size/4),r.tag===`helper`){r.visible=!1,r.name===`AXIS`?(r.visible=!!this.axis,this.axis===`X`&&(zT.setFromEuler(KT.set(0,0,0)),r.quaternion.copy(t).multiply(zT),Math.abs(qT.copy(eE).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Y`&&(zT.setFromEuler(KT.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(zT),Math.abs(qT.copy(tE).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(zT.setFromEuler(KT.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(zT),Math.abs(qT.copy(nE).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(zT.setFromEuler(KT.set(0,Math.PI/2,0)),qT.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(YT.lookAt(JT,qT,tE)),r.quaternion.multiply(zT),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),LT.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),LT.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(LT),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}if(r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`){let e=.99,n=.2;r.name===`X`&&Math.abs(qT.copy(eE).applyQuaternion(t).dot(this.eye))>
560e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Y`&&Math.abs(qT.copy(tE).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Z`&&Math.abs(qT.copy(nE).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(qT.copy(nE).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`YZ`&&Math.abs(qT.copy(eE).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XZ`&&Math.abs(qT.copy(tE).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)}else this.mode===`rotate`&&(XT.copy(t),qT.copy(this.eye).applyQuaternion(zT.copy(t).invert()),r.name.search(`E`)!==-1&&r.quaternion.setFromRotationMatrix(YT.lookAt(this.eye,JT,tE)),r.name===`X`&&(zT.setFromAxisAngle(eE,Math.atan2(-qT.y,qT.z)),zT.multiplyQuaternions(XT,zT),r.quaternion.copy(zT)),r.name===`Y`&&(zT.setFromAxisAngle(tE,Math.atan2(qT.x,qT.z)),zT.multiplyQuaternions(XT,zT),r.quaternion.copy(zT)),r.name===`Z`&&(zT.setFromAxisAngle(nE,Math.atan2(qT.y,qT.x)),zT.multiplyQuaternions(XT,zT),r.quaternion.copy(zT)));r.visible=r.visible&&(r.name.indexOf(`X`)===-1||this.showX),r.visible=r.visible&&(r.name.indexOf(`Y`)===-1||this.showY),r.visible=r.visible&&(r.name.indexOf(`Z`)===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf(`E`)===-1||this.showX&&this.showY&&this.showZ),r.visible=r.visible&&(r.name.indexOf(`XY`)===-1||this.showXY),r.visible=r.visible&&(r.name.indexOf(`YZ`)===-1||this.showYZ),r.visible=r.visible&&(r.name.indexOf(`XZ`)===-1||this.showXZ),r.visible=r.visible&&(r.name!==`E`||this.showE),r.visible=r.visible&&(r.name!==`XYZE`||this.showXYZE),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split(``).some(function(e){return r.name===e}))&&(r.material.color.copy(this.materialLib.active.color),r.material.opacity=1)}super.updateMatrixWorld(e)}},_be=class extends Nt{constructor(){super(new nn(1e5,1e5,2,2),new bn({visible:!1,wireframe:!0,side:2,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type=`TransformControlsPlane`}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode===`scale`&&(t=`local`),rE.copy(eE).applyQuaternion(t===`local`?this.worldQuaternion:ZT),iE.copy(tE).applyQuaternion(t===`local`?this.worldQuaternion:ZT),aE.copy(nE).applyQuaternion(t===`local`?this.worldQuaternion:ZT),qT.copy(iE),this.mode){case`translate`:case`scale`:switch(this.axis){case`X`:qT.copy(this.eye).cross(rE),QT.copy(rE).cross(qT);break;case`Y`:qT.copy(this.eye).cross(iE),QT.copy(iE).cross(qT);break;case`Z`:qT.copy(this.eye).cross(aE),QT.copy(aE).cross(qT);break;case`XY`:QT.copy(aE);break;case`YZ`:QT.copy(rE);break;case`XZ`:qT.copy(aE),QT.copy(iE);break;case`XYZ`:case`E`:QT.set(0,0,0)}break;default:QT.set(0,0,0)}QT.length()===0?this.quaternion.copy(this.cameraQuaternion):($T.lookAt(LT.set(0,0,0),QT,qT),this.quaternion.setFromRotationMatrix($T)),super.updateMatrixWorld(e)}},vbe=new Set([`$$slots`,`$$events`,`$$legacy`,`autoPauseControls`,`autoPauseOrbitControls`,`autoPauseTrackballControls`,`cameraControls`,`object`,`controls`,`group`,`children`]),ybe=V(`<!> <!>`,1);function bbe(e,n){Ce(n,!0);let r=()=>z(d,`$camera`,a),[a,o]=Ve(),s=J(n,`autoPauseControls`,3,!0),c=J(n,`controls`,15),l=J(n,`group`,15),u=Le(n,vbe),{camera:d,dom:f,invalidate:p,scene:m}=Ww(),{orbitControls:h,trackballControls:_,cameraControls:v,transformControls:y}=ET(),b=t(!1),x=q(()=>n.autoPauseOrbitControls??s()),S=q(()=>n.autoPauseTrackballControls??s()),C=q(s);Yw(()=>[h,Q(b),Q(x)],([e,t,n])=>{if(!(!e||!e.enabled&&t))return e.enabled=!(t&&n),()=>{e.enabled=!0}}),Yw(()=>[_,Q(b),Q(S)],([e,t,n])=>{if(!(!e||!e.enabled&&t))return e.enabled=!(t&&n),()=>{e.enabled=!0}}),Yw(()=>[v,Q(b),Q(C)],([e,t,n])=>{if(!(!e||!e.enabled&&t))return e.enabled=!(t&&n),()=>{e.enabled=!0}}),Yw(()=>[n.cameraControls,Q(b),s()],([e,t,n])=>{if(!(!e||!e.enabled&&t))return e.enabled=!(t&&n),()=>{e.enabled=!0}});let w=new lbe(d.current,f),T=new Pn;Qe(()=>{w.camera=r()}),i(()=>(w?.attach(n.object??T),()=>w?.detach())),Qe(()=>(y.set(w),()=>{y.set(void 0)}));let E=[`enabled`,`axis`,`mode`,`translationSnap`,`rotationSnap`,`scaleSnap`,`space`,`size`,`showX`,`showY`,`showZ`,`visible`,`onmouseDown`,`onmouseUp`,`onobjectChange`],D=t(Ne({})),O=t(Ne({}));Qe(()=>{I(D,{},!0),I(O,{}
560,!0),Object.keys(u).forEach(e=>{Qe(()=>{E.includes(e)?Q(D)[e]=u[e]:Q(O)[e]=u[e]})})});let k=e=>{p(),w.dragging&&!Q(b)?I(b,!0):!w.dragging&&Q(b)&&I(b,!1),n.onchange?.(e)};var A=ybe(),ee=N(A);Uw(ee,le({get is(){return w},onchange:k},()=>Q(D),{attach:({ref:e})=>{let t=e.getHelper();return m.add(t),()=>{m.remove(t)}},dispose:!1,oncreate:e=>()=>e.dispose(),get ref(){return c()},set ref(e){c(e)}})),Uw(g(ee,2),le({get is(){return T}},()=>Q(O),{get ref(){return l()},set ref(e){l(e)},children:(e,t)=>{var r=fe(),i=N(r);ae(i,()=>n.children??qe,()=>({ref:T})),X(e,r)},$$slots:{default:!0}})),X(e,A),ue(),o()}var xbe=new Set([`$$slots`,`$$events`,`$$legacy`,`camera`,`ref`,`children`]);function oE(e,t){Ce(t,!0);let n=()=>z(d,`$parent`,i),r=()=>z(l,`$defaultCamera`,i),[i,a]=Ve(),o=J(t,`ref`,15),s=Le(t,xbe),{dom:c,camera:l,invalidate:u}=Ww(),d=Mw(),f=q(()=>t.camera?t.camera:Iw(n(),`Camera`)?n():r()),p=new Gye(K(()=>Q(f)),c);Qe(()=>{p.object=Q(f)});let{orbitControls:m}=ET();Kw(()=>{p.update()},{autoInvalidate:!1,running:()=>t.autoRotate||t.enableDamping||!1}),Qe(()=>(m.set(p),()=>{m.set(void 0)})),Uw(e,le({get is(){return p}},()=>s,{onchange:e=>{u(),t.onchange?.(e)},get ref(){return o()},set ref(e){o(e)},children:(e,n)=>{var r=fe(),i=N(r);ae(i,()=>t.children??qe,()=>({ref:p})),X(e,r)},$$slots:{default:!0}})),ue(),a()}
560new fr,new fr,new Nt,yr.shadowmap_pars_fragment.includes(`unpackRGBAToDepth`),`${yr.logdepthbuf_pars_vertex}${yr.fog_pars_vertex}${yr.logdepthbuf_vertex}${yr.fog_vertex}`,`${yr.tonemapping_fragment}${yr.colorspace_fragment}`,`${yr.tonemapping_fragment}${yr.colorspace_fragment}`,`${yr.tonemapping_fragment}${yr.colorspace_fragment}`;function Sbe(){var e=Object.create(null);function t(n,i){var a=n.id,o=n.name,s=n.dependencies;s===void 0&&(s=[]);var c=n.init;c===void 0&&(c=function(){});var l=n.getTransferables;if(l===void 0&&(l=null),!e[a])try{s=s.map(function(n){return n&&n.isWorkerModule&&(t(n,function(e){if(e instanceof Error)throw e}),n=e[n.id].value),n}),c=r(`<`+o+`>.init`,c),l&&=r(`<`+o+`>.getTransferables`,l);var u=null;typeof c==`function`?u=c.apply(void 0,s):console.error(`worker module init function failed to rehydrate`),e[a]={id:a,value:u,getTransferables:l},i(u)}catch(e){e&&e.noLog||console.error(e),i(e)}}function n(t,n){var r,i=t.id,a=t.args;(!e[i]||typeof e[i].value!=`function`)&&n(Error(`Worker module `+i+`: not found or its 'init' did not return a function`));try{var o=(r=e[i]).value.apply(r,a);o&&typeof o.then==`function`?o.then(s,function(e){return n(e instanceof Error?e:Error(``+e))}):s(o)}catch(e){n(e)}function s(t){try{var r=e[i].getTransferables&&e[i].getTransferables(t);(!r||!Array.isArray(r)||!r.length)&&(r=void 0),n(t,r)}catch(e){console.error(e),n(e)}}}function r(e,t){var n=void 0;self.troikaDefine=function(e){return n=e};var r=URL.createObjectURL(new Blob([`/** `+e.replace(/\*/g,``)+` **/ 561 562troikaDefine( 563`+t+` 564)`],{type:`application/javascript`}));try{importScripts(r)}catch(e){console.error(e)}return URL.revokeObjectURL(r),delete self.troikaDefine,n}self.addEventListener(`message`,function(e){var r=e.data,i=r.messageId,a=r.action,o=r.data;try{a===`registerModule`&&t(o,function(e){e instanceof Error?postMessage({messageId:i,success:!1,error:e.message}):postMessage({messageId:i,success:!0,result:{isCallable:typeof e==`function`}})}),a===`callModule`&&n(o,function(e,t){e instanceof Error?postMessage({messageId:i,success:!1,error:e.message}):postMessage({messageId:i,success:!0,result:e},t||void 0)})}catch(e){postMessage({messageId:i,success:!1,error:e.stack})}})}function Cbe(e){var t=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t._getInitResult().then(function(t){if(typeof t==`function`)return t.apply(void 0,e);throw Error("Worker module function was called but `init` did not return a callable function")})};return t._getInitResult=function(){var n=e.dependencies,r=e.init;n=Array.isArray(n)?n.map(function(e){return e&&(e=e.onMainThread||e,e._getInitResult&&(e=e._getInitResult())),e}):[];var i=Promise.all(n).then(function(e){return r.apply(null,e)});return t._getInitResult=function(){return i},i},t}var sE=function(){var e=!1;if(typeof window<`u`&&window.document!==void 0)try{new Worker(URL.createObjectURL(new Blob([``],{type:`application/javascript`}))).terminate(),e=!0}catch(e){console.log(`Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: [`+e.message+`]`)}return sE=function(){return e},e},wbe=0,Tbe=0,cE=!1,lE=Object.create(null),uE=Object.create(null),dE=Object.create(null);function fE(e){if((!e||typeof e.init!=`function`)&&!cE)throw Error("requires `options.init` function");var t=e.dependencies,n=e.init,r=e.getTransferables,i=e.workerId,a=Cbe(e);i??=`#default`;var o=`workerModule`+ ++wbe,s=e.name||o,c=null;t&&=t.map(function(e){return typeof e==`function`&&!e.workerModuleData&&(cE=!0,e=fE({workerId:i,name:`<`+s+`> function dependency: `+e.name,init:`function(){return ( 565`+pE(e)+` 566)}`}),cE=!1),e&&e.workerModuleData&&(e=e.workerModuleData),e});function l(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(!sE())return a.apply(void 0,e);if(!c){c=mE(i,`registerModule`,l.workerModuleData);var n=function(){c=null,uE[i].delete(n)};(uE[i]||(uE[i]=new Set)).add(n)}return c.then(function(t){if(t.isCallable)return mE(i,`callModule`,{id:o,args:e});throw Error("Worker module function was called but `init` did not return a callable function")})}return l.workerModuleData={isWorkerModule:!0,id:o,name:s,dependencies:t,init:pE(n),getTransferables:r&&pE(r)},l.onMainThread=a,l}function Ebe(e){uE[e]&&uE[e].forEach(function(e){e()}),lE[e]&&(lE[e].terminate(),delete lE[e])}function pE(e){var t=e.toString();return!/^function/.test(t)&&/^\w+\s*\(/.test(t)&&(t=`function `+t),t}function Dbe(e){var t=lE[e];if(!t){var n=pE(Sbe);t=lE[e]=new Worker(URL.createObjectURL(new Blob([`/** Worker Module Bootstrap: `+e.replace(/\*/g,``)+` **/ 567 568;(`+n+`)()`],{type:`application/javascript`}))),t.onmessage=function(e){var t=e.data,n=t.messageId,r=dE[n];if(!r)throw Error(`WorkerModule response with empty or unknown messageId`);delete dE[n],r(t)}}return t}
568function mE(e,t,n){return new Promise(function(r,i){var a=++Tbe;dE[a]=function(e){e.success?r(e.result):i(Error(`Error in worker `+t+` call: `+e.error))},Dbe(e).postMessage({messageId:a,action:t,data:n})})}function hE(){return function(e){function t(e,t,n,r,i,a,o,s){var c=1-o;s.x=c*c*e+2*c*o*n+o*o*i,s.y=c*c*t+2*c*o*r+o*o*a}function n(e,t,n,r,i,a,o,s,c,l){var u=1-c;l.x=u*u*u*e+3*u*u*c*n+3*u*c*c*i+c*c*c*o,l.y=u*u*u*t+3*u*u*c*r+3*u*c*c*a+c*c*c*s}function r(e,t){for(var n=/([MLQCZ])([^MLQCZ]*)/g,r,i,a,o,s;r=n.exec(e);){var c=r[2].replace(/^\s*|\s*$/g,``).split(/[,\s]+/).map(function(e){return parseFloat(e)});switch(r[1]){case`M`:o=i=c[0],s=a=c[1];break;case`L`:(c[0]!==o||c[1]!==s)&&t(`L`,o,s,o=c[0],s=c[1]);break;case`Q`:t(`Q`,o,s,o=c[2],s=c[3],c[0],c[1]);break;case`C`:t(`C`,o,s,o=c[4],s=c[5],c[0],c[1],c[2],c[3]);break;case`Z`:(o!==i||s!==a)&&t(`L`,o,s,i,a)}}}function i(e,i,a){a===void 0&&(a=16);var o={x:0,y:0};r(e,function(e,r,s,c,l,u,d,f,p){switch(e){case`L`:i(r,s,c,l);break;case`Q`:for(var m=r,h=s,g=1;g<a;g++)t(r,s,u,d,c,l,g/(a-1),o),i(m,h,o.x,o.y),m=o.x,h=o.y;break;case`C`:for(var _=r,v=s,y=1;y<a;y++)n(r,s,u,d,f,p,c,l,y/(a-1),o),i(_,v,o.x,o.y),_=o.x,v=o.y}})}var a=`precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}`,o=new WeakMap,s={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function c(e,t){var n=e.getContext?e.getContext(`webgl`,s):e,r=o.get(n);if(!r){var i=typeof WebGL2RenderingContext<`u`&&n instanceof WebGL2RenderingContext,a={},c={},l={},u=-1,d=[];n.canvas.addEventListener(`webglcontextlost`,function(e){m(),e.preventDefault()},!1);function e(e){var t=a[e];if(!t&&(t=a[e]=n.getExtension(e),!t))throw Error(e+` not supported`);return t}function t(e,t){var r=n.createShader(t);return n.shaderSource(r,e),n.compileShader(r),r}function s(r,a,o,s){if(!c[r]){var l={},u={},d=n.createProgram();n.attachShader(d,t(a,n.VERTEX_SHADER)),n.attachShader(d,t(o,n.FRAGMENT_SHADER)),n.linkProgram(d),c[r]={program:d,transaction:function(t){n.useProgram(d),t({setUniform:function(e,t){for(var r=[],i=arguments.length-2;i-->0;)r[i]=arguments[i+2];var a=u[t]||(u[t]=n.getUniformLocation(d,t));n[`uniform`+e].apply(n,[a].concat(r))},setAttribute:function(t,r,a,o,s){var c=l[t];c||=l[t]={buf:n.createBuffer(),loc:n.getAttribLocation(d,t),data:null},n.bindBuffer(n.ARRAY_BUFFER,c.buf),n.vertexAttribPointer(c.loc,r,n.FLOAT,!1,0,0),n.enableVertexAttribArray(c.loc),i?n.vertexAttribDivisor(c.loc,o):e(`ANGLE_instanced_arrays`).vertexAttribDivisorANGLE(c.loc,o),s!==c.data&&(n.bufferData(n.ARRAY_BUFFER,s,a),c.data=s)}})}}}c[r].transaction(s)}function f(e,t){u++;try{n.activeTexture(n.TEXTURE0+u);var r=l[e];r||(r=l[e]=n.createTexture(),n.bindTexture(n.TEXTURE_2D,r),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST)),n.bindTexture(n.TEXTURE_2D,r),t(r,u)}finally{u--}}function p(e,t,r){var i=n.createFramebuffer();d.push(i),n.bindFramebuffer(n.FRAMEBUFFER,i),n.activeTexture(n.TEXTURE0+t),n.bindTexture(n.TEXTURE_2D,e),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0);try{r(i)}finally{n.deleteFramebuffer(i),n.bindFramebuffer(n.FRAMEBUFFER,d[--d.length-1]||null)}}function m(){a={},c={},l={},u=-1,d.length=0}o.set(n,r={gl:n,isWebGL2:i,getExtension:e,withProgram:s,withTexture:f,withTextureFramebuffer:p,handleContextLoss:m})}t(r)}function l(e,t,n,r,i,o,s,l){s===void 0&&(s=15),l===void 0&&(l=null),c(e,function(e){var c=e.gl,u=e.withProgram,d=e.withTexture;d(`copy`,function(e,d){c.texImage2D(c.TEXTURE_2D,0,c.RGBA,i,o,0,c.RGBA,c.UNSIGNED_BYTE,t),u(`copy`,a,`precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}`,function(e){var t=e.setUniform,a=e.setAttribute;a(`aUV`,2,c.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),t(`1i`,`image`,d),c.bindFramebuffer(c.FRAMEBUFFER,l||null),c.disable(c.BLEND),c.colorMask(s&8,s&4,s&2,s&1),c.viewport(n,r,i,o),c.scissor(n,r,i,o),c.drawArrays(c.TRIANGLES,0,3)})})})}
568function u(e,t,n){var r=e.width,i=e.height;c(e,function(a){var o=a.gl,s=new Uint8Array(r*i*4);o.readPixels(0,0,r,i,o.RGBA,o.UNSIGNED_BYTE,s),e.width=t,e.height=n,l(o,s,0,0,r,i)})}var d=Object.freeze({__proto__:null,withWebGLContext:c,renderImageData:l,resizeWebGLCanvasWithoutClearing:u});function f(e,t,n,r,a,o){o===void 0&&(o=1);var s=new Uint8Array(e*t),c=r[2]-r[0],l=r[3]-r[1],u=[];i(n,function(e,t,n,r){u.push({x1:e,y1:t,x2:n,y2:r,minX:Math.min(e,n),minY:Math.min(t,r),maxX:Math.max(e,n),maxY:Math.max(t,r)})}),u.sort(function(e,t){return e.maxX-t.maxX});for(var d=0;d<e;d++)for(var f=0;f<t;f++){var p=g(r[0]+c*(d+.5)/e,r[1]+l*(f+.5)/t),m=(1-Math.abs(p)/a)**o/2;p<0&&(m=1-m),m=Math.max(0,Math.min(255,Math.round(m*255))),s[f*e+d]=m}return s;function g(e,t){for(var n=1/0,r=1/0,i=u.length;i--;){var a=u[i];if(a.maxX+r<=e)break;if(e+r>a.minX&&t-r<a.maxY&&t+r>a.minY){var o=h(e,t,a.x1,a.y1,a.x2,a.y2);o<n&&(n=o,r=Math.sqrt(n))}}return _(e,t)&&(r=-r),r}function _(e,t){for(var n=0,r=u.length;r--;){var i=u[r];if(i.maxX<=e)break;i.y1>t!=i.y2>t&&e<(i.x2-i.x1)*(t-i.y1)/(i.y2-i.y1)+i.x1&&(n+=i.y1<i.y2?1:-1)}return n!==0}}function p(e,t,n,r,i,a,o,s,c,l){a===void 0&&(a=1),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l=0),m(e,t,n,r,i,a,o,null,s,c,l)}function m(e,t,n,r,i,a,o,s,c,u,d){a===void 0&&(a=1),c===void 0&&(c=0),u===void 0&&(u=0),d===void 0&&(d=0);for(var p=f(e,t,n,r,i,a),m=new Uint8Array(p.length*4),h=0;h<p.length;h++)m[h*4+d]=p[h];l(o,m,c,u,e,t,1<<3-d,s)}function h(e,t,n,r,i,a){var o=i-n,s=a-r,c=o*o+s*s,l=c?Math.max(0,Math.min(1,((e-n)*o+(t-r)*s)/c)):0,u=e-(n+l*o),d=t-(r+l*s);return u*u+d*d}var g=Object.freeze({__proto__:null,generate:f,generateIntoCanvas:p,generateIntoFramebuffer:m}),_=`precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}`,v=`precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}`,y=`precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}`,b=new Float32Array([0,0,2,0,0,2]),x=null,S=!1,C={},w=new WeakMap;function T(e){if(!S&&!k(e))throw Error(`WebGL generation not supported`)}function E(e,t,n,r,i,a,o){if(a===void 0&&(a=1),o===void 0&&(o=null),!o&&(o=x,!o)){var s=typeof OffscreenCanvas==`function`?new OffscreenCanvas(1,1):typeof document<`u`?document.createElement(`canvas`):null;if(!s)throw Error(`OffscreenCanvas or DOM canvas not supported`);o=x=s.getContext(`webgl`,{depth:!1})}T(o);var l=new Uint8Array(e*t*4);c(o,function(o){var s=o.gl,c=o.withTexture,u=o.withTextureFramebuffer;c(`readable`,function(o,c){s.texImage2D(s.TEXTURE_2D,0,s.RGBA,e,t,0,s.RGBA,s.UNSIGNED_BYTE,null),u(o,c,function(o){O(e,t,n,r,i,a,s,o,0,0,0),s.readPixels(0,0,e,t,s.RGBA,s.UNSIGNED_BYTE,l)})})});for(var u=new Uint8Array(e*t),d=0,f=0;d<l.length;d+=4)u[f++]=l[d];return u}function D(e,t,n,r,i,a,o,s,c,l){a===void 0&&(a=1),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l=0),O(e,t,n,r,i,a,o,null,s,c,l)}function O(e,t,n,r,o,s,l,u,d,f,p){s===void 0&&(s=1),d===void 0&&(d=0),f===void 0&&(f=0),p===void 0&&(p=0),T(l);var m=[];i(n,function(e,t,n,r){m.push(e,t,n,r)}
568),m=new Float32Array(m),c(l,function(n){var i=n.gl,c=n.isWebGL2,l=n.getExtension,h=n.withProgram,g=n.withTexture,x=n.withTextureFramebuffer,S=n.handleContextLoss;if(g(`rawDistances`,function(n,g){(e!==n._lastWidth||t!==n._lastHeight)&&i.texImage2D(i.TEXTURE_2D,0,i.RGBA,n._lastWidth=e,n._lastHeight=t,0,i.RGBA,i.UNSIGNED_BYTE,null),h(`main`,_,v,function(a){var u=a.setAttribute,d=a.setUniform,f=!c&&l(`ANGLE_instanced_arrays`),p=!c&&l(`EXT_blend_minmax`);u(`aUV`,2,i.STATIC_DRAW,0,b),u(`aLineSegment`,4,i.DYNAMIC_DRAW,1,m),d.apply(void 0,[`4f`,`uGlyphBounds`].concat(r)),d(`1f`,`uMaxDistance`,o),d(`1f`,`uExponent`,s),x(n,g,function(n){i.enable(i.BLEND),i.colorMask(!0,!0,!0,!0),i.viewport(0,0,e,t),i.scissor(0,0,e,t),i.blendFunc(i.ONE,i.ONE),i.blendEquationSeparate(i.FUNC_ADD,c?i.MAX:p.MAX_EXT),i.clear(i.COLOR_BUFFER_BIT),c?i.drawArraysInstanced(i.TRIANGLES,0,3,m.length/4):f.drawArraysInstancedANGLE(i.TRIANGLES,0,3,m.length/4)})}),h(`post`,a,y,function(n){n.setAttribute(`aUV`,2,i.STATIC_DRAW,0,b),n.setUniform(`1i`,`tex`,g),i.bindFramebuffer(i.FRAMEBUFFER,u),i.disable(i.BLEND),i.colorMask(p===0,p===1,p===2,p===3),i.viewport(d,f,e,t),i.scissor(d,f,e,t),i.drawArrays(i.TRIANGLES,0,3)})}),i.isContextLost())throw S(),Error(`webgl context lost`)})}function k(e){var t=!e||e===x?C:e.canvas||e,n=w.get(t);if(n===void 0){S=!0;var r=null;try{var i=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],a=E(4,4,`M8,8L16,8L24,24L16,24Z`,[0,0,32,32],24,1,e);n=a&&i.length===a.length&&a.every(function(e,t){return e===i[t]}),n||(r=`bad trial run results`,console.info(i,a))}catch(e){n=!1,r=e.message}r&&console.warn(`WebGL SDF generation not supported:`,r),S=!1,w.set(t,n)}return n}var A=Object.freeze({__proto__:null,generate:E,generateIntoCanvas:D,generateIntoFramebuffer:O,isSupported:k});function ee(e,t,n,r,i,a){i===void 0&&(i=Math.max(r[2]-r[0],r[3]-r[1])/2),a===void 0&&(a=1);try{return E.apply(A,arguments)}catch(e){return console.info(`WebGL SDF generation failed, falling back to JS`,e),f.apply(g,arguments)}}function j(e,t,n,r,i,a,o,s,c,l){i===void 0&&(i=Math.max(r[2]-r[0],r[3]-r[1])/2),a===void 0&&(a=1),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l=0);try{return D.apply(A,arguments)}catch(e){return console.info(`WebGL SDF generation failed, falling back to JS`,e),p.apply(g,arguments)}}return e.forEachPathCommand=r,e.generate=ee,e.generateIntoCanvas=j,e.javascript=g,e.pathToLineSegments=i,e.webgl=A,e.webglUtils=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({})}function Obe(){return function(e){var t={R:`13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73`,EN:`1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9`,ES:`17,2,6dp+1,f+1,av,16vr,mx+1,4o,2`,ET:`z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj`,AN:`16o+5,2j+9,2+1,35,ed,1ff2+9,87+u`,CS:`18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b`,B:`a,3,f+2,2v,690`,S:`9,2,k`,WS:`c,k,4f4,1vk+a,u,1j,335`,ON:`x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i`,BN:`0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1`,NSM:`lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n`,AL:`16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d`,LRO:`6ct`,RLO:`6cu`,LRE:`6cq`,RLE:`6cr`,PDF:`6cs`,LRI:`6ee`,RLI:`6ef`,FSI:`6eg`,PDI:`6eh`},n={},r={};n.L=1,r[1]=`L`,Object.keys(t).forEach(function(e,t){n[e]=1<<t+1,r[n[e]]=e}),Object.freeze(n);var i=n.LRI|n.RLI|n.FSI,a=n.L|n.R|n.AL,o=n.B|n.S|n.WS|n.ON|n.FSI|n.LRI|n.RLI|n.PDI,s=n.BN|n.RLE|n.LRE|n.RLO|n.LRO|n.PDF,c=n.S|n.WS|n.B|i|n.PDI|s,l=null;function u(){if(!l){l=new Map;var e=function(e){if(t.hasOwnProperty(e)){var r=0;t[e].split(`,`).forEach(function(t){var i=t.split(`+`),a=i[0],o=i[1];a=parseInt(a,36),o=o?parseInt(o,36):0,l.set(r+=a,n[e]);for(var s=0;s<o;s++)l.set(++r,n[e])})}};for(var r in t)e(r)}}function d(e){return u(),l.get(e.codePointAt(0))||n.L}function f(e){return r[d(e)]}var p={pairs:`14>
5681,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1`,canonical:`6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye`};function m(e,t){var n=0,r=new Map,i=t&&new Map,a;return e.split(`,`).forEach(function e(o){if(o.indexOf(`+`)!==-1)for(var s=+o;s--;)e(a);else{a=o;var c=o.split(`>`),l=c[0],u=c[1];l=String.fromCodePoint(n+=parseInt(l,36)),u=String.fromCodePoint(n+=parseInt(u,36)),r.set(l,u),t&&i.set(u,l)}}),{map:r,reverseMap:i}}var h,g,_;function v(){if(!h){var e=m(p.pairs,!0),t=e.map,n=e.reverseMap;h=t,g=n,_=m(p.canonical,!1).map}}function y(e){return v(),h.get(e)||null}function b(e){return v(),g.get(e)||null}function x(e){return v(),_.get(e)||null}var S=n.L,C=n.R,w=n.EN,T=n.ES,E=n.ET,D=n.AN,O=n.CS,k=n.B,A=n.S,ee=n.ON,j=n.BN,M=n.NSM,te=n.AL,ne=n.LRO,N=n.RLO,P=n.LRE,re=n.RLE,ie=n.PDF,F=n.LRI,ae=n.RLI,I=n.FSI,L=n.PDI;function oe(e,t){for(var n=125,r=new Uint32Array(e.length),l=0;l<e.length;l++)r[l]=d(e[l]);var u=new Map;function f(e,t){var n=r[e];r[e]=t,u.set(n,u.get(n)-1),n&o&&u.set(o,u.get(o)-1),u.set(t,(u.get(t)||0)+1),t&o&&u.set(o,(u.get(o)||0)+1)}for(var p=new Uint8Array(e.length),m=new Map,h=[],g=null,_=0;_<e.length;_++)g||h.push(g={start:_,end:e.length-1,level:t===`rtl`?1:t===`ltr`?0:Vt(_,!1)}),r[_]&k&&(g.end=_,g=null);for(var v=re|P|N|ne|i|L|ie|k,oe=function(e){return e+(e&1?1:2)},R=function(e){return e+(e&1?2:1)},se=0;se<h.length;se++){g=h[se];var ce=[{_level:g.level,_override:0,_isolate:0}],le=void 0,ue=0,de=0,z=0;u.clear();for(var fe=g.start;fe<=g.end;fe++){var pe=r[fe];if(le=ce[ce.length-1],u.set(pe,(u.get(pe)||0)+1),pe&o&&u.set(o,(u.get(o)||0)+1),pe&v){if(pe&(re|P)){p[fe]=le._level;var B=(pe===re?R:oe)(le._level);B<=n&&!ue&&!de?ce.push({_level:B,_override:0,_isolate:0}):ue||de++}else if(pe&(N|ne)){p[fe]=le._level;var me=(pe===N?R:oe)(le._level);me<=n&&!ue&&!de?ce.push({_level:me,_override:pe&N?C:S,_isolate:0}):ue||de++}else if(pe&i){pe&I&&(pe=Vt(fe+1,!0)===1?ae:F),p[fe]=le._level,le._override&&f(fe,le._override);var V=(pe===ae?R:oe)(le._level);V<=n&&ue===0&&de===0?(z++,ce.push({_level:V,_override:0,_isolate:1,_isolInitIndex:fe})):ue++}else if(pe&L){if(ue>0)ue--;else if(z>0){for(de=0;!ce[ce.length-1]._isolate;)ce.pop();var he=ce[ce.length-1]._isolInitIndex;he!=null&&(m.set(he,fe),m.set(fe,he)),ce.pop(),z--}le=ce[ce.length-1],p[fe]=le._level,le._override&&f(fe,le._override)}else pe&ie?(ue===0&&(de>0?de--:!le._isolate&&ce.length>1&&(ce.pop(),le=ce[ce.length-1])),p[fe]=le._level):pe&k&&(p[fe]=g.level)}else p[fe]=le._level,le._override&&pe!==j&&f(fe,le._override)}for(var H=[],ge=null,U=g.start;U<=g.end;U++){var W=r[U];if(!(W&s)){var _e=p[U],ve=W&i,G=W===L;ge&&_e===ge._level?(ge._end=U,ge._endsWithIsolInit=ve):H.push(ge={_start:U,_end:U,_level:_e,_startsWithPDI:G,_endsWithIsolInit:ve})}}for(var ye=[],be=0;be<H.length;be++){var xe=H[be];if(!xe._startsWithPDI||xe._startsWithPDI&&!m.has(xe._start)){for(var K=[ge=xe],Se=void 0;ge&&ge._endsWithIsolInit&&(Se=m.get(ge._end))!=null;)for(var Ce=be+1;Ce<H.length;Ce++)if(H[Ce]._start===Se){K.push(ge=H[Ce]);break}for(var we=[],Te=0;Te<K.length;Te++)for(var q=K[Te],Ee=q._start;Ee<=q._end;Ee++)we.push(Ee);for(var J=p[we[0]],De=g.level,Oe=we[0]-1;Oe>=0;Oe--)if(!(r[Oe]&s)){De=p[Oe];break}var ke=we[we.length-1],Ae=p[ke],je=g.level;if(!(r[ke]&i)){for(var Me=ke+1;Me<=g.end;Me++)if(!(r[Me]&s)){je=p[Me];break}}ye.push({_seqIndices:we,_sosType:Math.max(De,J)%2?C:S,_eosType:Math.max(je,Ae)%2?C:S})}}for(var Ne=0;Ne<ye.length;Ne++){var Pe=ye[Ne],Fe=Pe._seqIndices,Ie=Pe._sosType,Le=Pe._eosType,Re=p[Fe[0]]&1?C:S;if(u.get(M))for(var Y=0;Y<Fe.length;Y++){var ze=Fe[Y];if(r[ze]&M){for(var Be=Ie,Ve=Y-1;Ve>=0;Ve--)if(!(r[Fe[Ve]]&s)){Be=r[Fe[Ve]];break}f(ze,Be&(i|L)?ee:Be)}}if(u.get(w))for(var He=0;He<Fe.length;He++){var X=Fe[He];if(r[X]&w)for(var Ue=He-1;Ue>=-1;Ue--){var Z=Ue===-1?Ie:r[Fe[Ue]];if(Z&a){Z===te&&f(X,D);break}}}if(u.get(te))for(var We=0;We<Fe.length;We++){var Ge=Fe[We];r[Ge]&te&&f(Ge,C)}if(u.get(T)||u.get(O))for(var Q=1;Q<Fe.length-1;Q++){var Ke=Fe[Q];if(r[Ke]&(T|O)){for(var qe=0,Je=0,Ye=Q-1;Ye>=0&&(qe=r[Fe[Ye]],qe&s);Ye--);for(var Xe=Q+1;Xe<Fe.length&&(Je=r[Fe[Xe]],Je&s);Xe++);qe===Je&&(r[Ke]===T?qe===w:qe&(w|D))&&f(Ke,qe)}}if(u.get(w)){for(var Ze=0;Ze<Fe.length;Ze++)if(r[Fe[Ze]]&w){for(var Qe=Ze-1;Qe>=0&&r[Fe[Qe]]&(E|s);Qe--)f(Fe[Qe],w);for(Ze++;Ze<Fe.length&&r[Fe[Ze]]&(E|s|w);Ze++)r[Fe[Ze]]!==w&&f(Fe[Ze],w)}}if(u.get(E)||u.get(T)||u.get(O))for(var $e=0;$e<Fe.length;$e++){var et=Fe[$e];
vendor: 2,061 bytes, line 568
568if(r[et]&(E|T|O)){f(et,ee);for(var $=$e-1;$>=0&&r[Fe[$]]&s;$--)f(Fe[$],ee);for(var tt=$e+1;tt<Fe.length&&r[Fe[tt]]&s;tt++)f(Fe[tt],ee)}}if(u.get(w))for(var nt=0,rt=Ie;nt<Fe.length;nt++){var it=Fe[nt],at=r[it];at&w?rt===S&&f(it,S):at&a&&(rt=at)}if(u.get(o)){for(var ot=C|w|D,st=ot|S,ct=[],lt=[],ut=0;ut<Fe.length;ut++)if(r[Fe[ut]]&o){var dt=e[Fe[ut]],ft=void 0;if(y(dt)!==null){if(lt.length<63)lt.push({char:dt,seqIndex:ut});else break}else if((ft=b(dt))!==null)for(var pt=lt.length-1;pt>=0;pt--){var mt=lt[pt].char;if(mt===ft||mt===b(x(dt))||y(x(mt))===dt){ct.push([lt[pt].seqIndex,ut]),lt.length=pt;break}}}ct.sort(function(e,t){return e[0]-t[0]});for(var ht=0;ht<ct.length;ht++){for(var gt=ct[ht],_t=gt[0],vt=gt[1],yt=!1,bt=0,xt=_t+1;xt<vt;xt++){var St=Fe[xt];if(r[St]&st){yt=!0;var Ct=r[St]&ot?C:S;if(Ct===Re){bt=Ct;break}}}if(yt&&!bt){bt=Ie;for(var wt=_t-1;wt>=0;wt--){var Tt=Fe[wt];if(r[Tt]&st){var Et=r[Tt]&ot?C:S;bt=Et===Re?Re:Et;break}}}if(bt){if(r[Fe[_t]]=r[Fe[vt]]=bt,bt!==Re){for(var Dt=_t+1;Dt<Fe.length;Dt++)if(!(r[Fe[Dt]]&s)){d(e[Fe[Dt]])&M&&(r[Fe[Dt]]=bt);break}}if(bt!==Re){for(var Ot=vt+1;Ot<Fe.length;Ot++)if(!(r[Fe[Ot]]&s)){d(e[Fe[Ot]])&M&&(r[Fe[Ot]]=bt);break}}}}for(var kt=0;kt<Fe.length;kt++)if(r[Fe[kt]]&o){for(var At=kt,jt=kt,Mt=Ie,Nt=kt-1;Nt>=0;Nt--)if(r[Fe[Nt]]&s)At=Nt;else{Mt=r[Fe[Nt]]&ot?C:S;break}for(var Pt=Le,Ft=kt+1;Ft<Fe.length;Ft++)if(r[Fe[Ft]]&(o|s))jt=Ft;else{Pt=r[Fe[Ft]]&ot?C:S;break}for(var It=At;It<=jt;It++)r[Fe[It]]=Mt===Pt?Mt:Re;kt=jt}}}for(var Lt=g.start;Lt<=g.end;Lt++){var Rt=p[Lt],zt=r[Lt];if(Rt&1?zt&(S|w|D)&&p[Lt]++:zt&C?p[Lt]++:zt&(D|w)&&(p[Lt]+=2),zt&s&&(p[Lt]=Lt===0?g.level:p[Lt-1]),Lt===g.end||d(e[Lt])&(A|k))for(var Bt=Lt;Bt>=0&&d(e[Bt])&c;Bt--)p[Bt]=g.level}}return{levels:p,paragraphs:h};function Vt(t,n){for(var a=t;a<e.length;a++){var o=r[a];if(o&(C|te))return 1;if(o&(k|S)||n&&o===L)return 0;if(o&i){var s=Ht(a);a=s===-1?e.length:s}}return 0}function Ht(t){for(var n=1,a=t+1;a<e.length;a++){var o=r[a];if(o&k)break;if(o&L){if(--n===0)return a}else o&i&&n++}return-1}}var R=`14>1,j>2,t>2,u>2,1a>g,2v3>
5681,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1`,se;function ce(){if(!se){var e=m(R,!0),t=e.map;e.reverseMap.forEach(function(e,n){t.set(n,e)}),se=t}}function le(e){return ce(),se.get(e)||null}function ue(e,t,n,r){var i=e.length;n=Math.max(0,n==null?0:+n),r=Math.min(i-1,r==null?i-1:+r);for(var a=new Map,o=n;o<=r;o++)if(t[o]&1){var s=le(e[o]);s!==null&&a.set(o,s)}return a}function de(e,t,n,r){var i=e.length;n=Math.max(0,n==null?0:+n),r=Math.min(i-1,r==null?i-1:+r);var a=[];return t.paragraphs.forEach(function(i){var o=Math.max(n,i.start),s=Math.min(r,i.end);if(o<s){for(var l=t.levels.slice(o,s+1),u=s;u>=o&&d(e[u])&c;u--)l[u]=i.level;for(var f=i.level,p=1/0,m=0;m<l.length;m++){var h=l[m];h>f&&(f=h),h<p&&(p=h|1)}for(var g=f;g>=p;g--)for(var _=0;_<l.length;_++)if(l[_]>=g){for(var v=_;_+1<l.length&&l[_+1]>=g;)_++;_>v&&a.push([v+o,_+o])}}}),a}function z(e,t,n,r){var i=fe(e,t,n,r),a=[].concat(e);return i.forEach(function(n,r){a[r]=(t.levels[n]&1?le(e[n]):null)||e[n]}),a.join(``)}function fe(e,t,n,r){for(var i=de(e,t,n,r),a=[],o=0;o<e.length;o++)a[o]=o;return i.forEach(function(e){for(var t=e[0],n=e[1],r=a.slice(t,n+1),i=r.length;i--;)a[n-i]=r[i]}),a}return e.closingToOpeningBracket=b,e.getBidiCharType=d,e.getBidiCharTypeName=f,e.getCanonicalBracket=x,e.getEmbeddingLevels=oe,e.getMirroredCharacter=le,e.getMirroredCharactersMap=ue,e.getReorderSegments=de,e.getReorderedIndices=fe,e.getReorderedString=z,e.openingToClosingBracket=y,Object.defineProperty(e,"__esModule",{value:!0}),e}({})}var gE=/\bvoid\s+main\s*\(\s*\)\s*{/g;function _E(e){let t=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(e,t){let n=yr[t];return n?_E(n):e}return e.replace(t,n)}var vE=[];for(let e=0;e<256;e++)vE[e]=(e<16?`0`:``)+e.toString(16);function kbe(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(vE[e&255]+vE[e>>8&255]+vE[e>>16&255]+vE[e>>24&255]+`-`+vE[t&255]+vE[t>>8&255]+`-`+vE[t>>16&15|64]+vE[t>>24&255]+`-`+vE[n&63|128]+vE[n>>8&255]+`-`+vE[n>>16&255]+vE[n>>24&255]+vE[r&255]+vE[r>>8&255]+vE[r>>16&255]+vE[r>>24&255]).toUpperCase()}var yE=Object.assign||function(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++){let n=arguments[t];if(n)for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},Abe=Date.now(),bE=new WeakMap,xE=new Map,jbe=1e10;function SE(e,t){let n=Fbe(t),r=bE.get(e);if(r||bE.set(e,r=Object.create(null)),r[n])return new r[n];let i=`_onBeforeCompile${n}`,a=function(r,a){e.onBeforeCompile.call(this,r,a);let o=this.customProgramCacheKey()+`|`+r.vertexShader+`|`+r.fragmentShader,s=xE[o];s||=xE[o]=Mbe(this,r,t,n),r.vertexShader=s.vertexShader,r.fragmentShader=s.fragmentShader,yE(r.uniforms,this.uniforms),t.timeUniform&&(r.uniforms[t.timeUniform]={get value(){return Date.now()-Abe}}),this[i]&&this[i](r)},o=function(){return s(t.chained?e:e.clone())},s=function(r){let i=Object.create(r,c);return Object.defineProperty(i,"baseMaterial",{value:e}),Object.defineProperty(i,"id",{value:jbe++}),i.uuid=kbe(),i.uniforms=yE({},r.uniforms,t.uniforms),i.defines=yE({},r.defines,t.defines),i.defines[`TROIKA_DERIVED_MATERIAL_${n}`]=``,i.extensions=yE({},r.extensions,t.extensions),i._listeners=void 0,i},c={constructor:{value:o},isDerivedMaterial:{value:!0},type:{get:()=>e.type,set:t=>{e.type=t}},isDerivedFrom:{writable:!0,configurable:!0,value:function(e){let t=this.baseMaterial;return e===t||t.isDerivedMaterial&&t.isDerivedFrom(e)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return e.customProgramCacheKey()+`|`+n}},onBeforeCompile:{get(){return a},set(e){this[i]=e}},copy:{writable:!0,configurable:!0,value:function(t){return e.copy.call(this,t),!e.isShaderMaterial&&!e.isDerivedMaterial&&(yE(this.extensions,t.extensions),yE(this.defines,t.defines),yE(this.uniforms,Et.clone(t.uniforms)
568)),this}},clone:{writable:!0,configurable:!0,value:function(){let t=new e.constructor;return s(t).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let n=this._depthMaterial;return n||(n=this._depthMaterial=SE(e.isDerivedMaterial?e.getDepthMaterial():new gn({depthPacking:jr}),t),n.defines.IS_DEPTH_MATERIAL=``,n.uniforms=this.uniforms),n}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let n=this._distanceMaterial;return n||(n=this._distanceMaterial=SE(e.isDerivedMaterial?e.getDistanceMaterial():new Cn,t),n.defines.IS_DISTANCE_MATERIAL=``,n.uniforms=this.uniforms),n}},dispose:{writable:!0,configurable:!0,value(){let{_depthMaterial:t,_distanceMaterial:n}=this;t&&t.dispose(),n&&n.dispose(),e.dispose.call(this)}}};return r[n]=o,new o}function Mbe(e,{vertexShader:t,fragmentShader:n},r,i){let{vertexDefs:a,vertexMainIntro:o,vertexMainOutro:s,vertexTransform:c,fragmentDefs:l,fragmentMainIntro:u,fragmentMainOutro:d,fragmentColorTransform:f,customRewriter:p,timeUniform:m}=r;if(a||=``,o||=``,s||=``,l||=``,u||=``,d||=``,(c||p)&&(t=_E(t)),(f||p)&&(n=n.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,` 569//!BEGIN_POST_CHUNK $1 570$& 571//!END_POST_CHUNK 572`),n=_E(n)),p){let e=p({vertexShader:t,fragmentShader:n});t=e.vertexShader,n=e.fragmentShader}if(f){let e=[];n=n.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,t=>(e.push(t),``)),d=`${f}\n${e.join(` 573`)}\n${d}`}if(m){let e=`\nuniform float ${m};\n`;a=e+a,l=e+l}return c&&(t=`vec3 troika_position_${i}; 574vec3 troika_normal_${i}; 575vec2 troika_uv_${i}; 576${t} 577`,a=`${a} 578void troikaVertexTransform${i}() { 579 vec3 position = troika_position_${i}; 580 vec3 normal = troika_normal_${i}; 581 vec2 uv = troika_uv_${i}; 582 ${c} 583 troika_position_${i} = position; 584 troika_normal_${i} = normal; 585 troika_uv_${i} = uv; 586} 587`,o=` 588troika_position_${i} = vec3(position); 589troika_normal_${i} = vec3(normal); 590troika_uv_${i} = vec2(uv); 591troikaVertexTransform${i}(); 592${o} 593`,t=t.replace(/\b(position|normal|uv)\b/g,(e,t,n,r)=>/\battribute\s+vec[23]\s+$/.test(r.substr(0,n))?t:`troika_${t}_${i}`),e.map&&e.map.channel>0||(t=t.replace(/\bMAP_UV\b/g,`troika_uv_${i}`))),t=CE(t,i,a,o,s),n=CE(n,i,l,u,d),{vertexShader:t,fragmentShader:n}}function CE(e,t,n,r,i){return(r||i||n)&&(e=e.replace(gE,` 594${n} 595void troikaOrigMain${t}() {`),e+=` 596void main() { 597 ${r} 598 troikaOrigMain${t}(); 599 ${i} 600}`),e}function Nbe(e,t){return e===`uniforms`?void 0:typeof t==`function`?t.toString():t}var Pbe=0,wE=new Map;function Fbe(e){let t=JSON.stringify(e,Nbe),n=wE.get(t);return n??wE.set(t,n=++Pbe),n}function Ibe(){return typeof window>`u`&&(self.window=self),function(e){var t={parse:function(e){var n=t._bin,r=new Uint8Array(e);if(n.readASCII(r,0,4)==`ttcf`){var i=4;n.readUshort(r,i),i+=2,n.readUshort(r,i),i+=2;var a=n.readUint(r,i);i+=4;for(var o=[],s=0;s<a;s++){var c=n.readUint(r,i);i+=4,o.push(t._readFont(r,c))}return o}return[t._readFont(r,0)]},_readFont:function(e,n){var r=t._bin,i=n;r.readFixed(e,n),n+=4;var a=r.readUshort(e,n);n+=2,r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2;for(var o=[`cmap`,`head`,`hhea`,`maxp`,`hmtx`,`name`,`OS/2`,`post`,`loca`,`glyf`,`kern`,`CFF `,`GDEF`,`GPOS`,`GSUB`,`SVG `],s={_data:e,_offset:i},c={},l=0;l<a;l++){var u=r.readASCII(e,n,4);n+=4,r.readUint(e,n),n+=4;var d=r.readUint(e,n);n+=4;var f=r.readUint(e,n);n+=4,c[u]={offset:d,length:f}}for(l=0;l<o.length;l++){var p=o[l];c[p]&&(s[p.trim()]=t[p.trim()].parse(e,c[p].offset,c[p].length,s))}return s},_tabOffset:function(e,n,r){for(var i=t._bin,a=i.readUshort(e,r+4),o=r+12,s=0;s<a;s++){var c=i.readASCII(e,o,4);o+=4,i.readUint(e,o),o+=4;var l=i.readUint(e,o);if(o+=4,i.readUint(e,o),o+=4,c==n)return l}return 0}};t._bin={readFixed:function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<8|e[t+3])/65540},readF2dot14:function(e,n){return t._bin.readShort(e,n)/16384},readInt:function(e,n){return t._bin._view(e).getInt32(n)},readInt8:function(e,n){return t._bin._view(e).getInt8(n)},readShort:function(e,n){return t._bin._view(e).getInt16(n)},readUshort:function(e,n){return t._bin._view(e).getUint16(n)},readUshorts:function(e,n,r){for(var i=[],a=0;a<r;a++)i.push(t._bin.readUshort(e,n+2*a));return i},readUint:function(e,n){return t._bin._view(e).getUint32(n)},readUint64:function(e,n){return 4294967296*t._bin.readUint(e,n)+t._bin.readUint(e,n+4)},readASCII:function(e,t,n){for(var r=``,i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},readUnicode:function(e,t,n){for(var r=``,i=0;i<n;i++){var a=e[t++]<<8|e[t++];r+=String.fromCharCode(a)}return r},_tdec:typeof window<`u`&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(e,n,r){var i=t._bin._tdec;
600return i&&n==0&&r==e.length?i.decode(e):t._bin.readASCII(e,n,r)},readBytes:function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(e[t+i]);return r},readASCIIArray:function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(String.fromCharCode(e[t+i]));return r},_view:function(e){return e._dataView||=e.buffer?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(new Uint8Array(e).buffer)}},t._lctf={},t._lctf.parse=function(e,n,r,i,a){var o=t._bin,s={},c=n;o.readFixed(e,n),n+=4;var l=o.readUshort(e,n);n+=2;var u=o.readUshort(e,n);n+=2;var d=o.readUshort(e,n);return n+=2,s.scriptList=t._lctf.readScriptList(e,c+l),s.featureList=t._lctf.readFeatureList(e,c+u),s.lookupList=t._lctf.readLookupList(e,c+d,a),s},t._lctf.readLookupList=function(e,n,r){var i=t._bin,a=n,o=[],s=i.readUshort(e,n);n+=2;for(var c=0;c<s;c++){var l=i.readUshort(e,n);n+=2;var u=t._lctf.readLookupTable(e,a+l,r);o.push(u)}return o},t._lctf.readLookupTable=function(e,n,r){var i=t._bin,a=n,o={tabs:[]};o.ltype=i.readUshort(e,n),n+=2,o.flag=i.readUshort(e,n),n+=2;var s=i.readUshort(e,n);n+=2;for(var c=o.ltype,l=0;l<s;l++){var u=i.readUshort(e,n);n+=2;var d=r(e,c,a+u,o);o.tabs.push(d)}return o},t._lctf.numOfOnes=function(e){for(var t=0,n=0;n<32;n++)e>>>n&1&&t++;return t},t._lctf.readClassDef=function(e,n){var r=t._bin,i=[],a=r.readUshort(e,n);if(n+=2,a==1){var o=r.readUshort(e,n);n+=2;var s=r.readUshort(e,n);n+=2;for(var c=0;c<s;c++)i.push(o+c),i.push(o+c),i.push(r.readUshort(e,n)),n+=2}if(a==2){var l=r.readUshort(e,n);for(n+=2,c=0;c<l;c++)i.push(r.readUshort(e,n)),n+=2,i.push(r.readUshort(e,n)),n+=2,i.push(r.readUshort(e,n)),n+=2}return i},t._lctf.getInterval=function(e,t){for(var n=0;n<e.length;n+=3){var r=e[n],i=e[n+1];if(e[n+2],r<=t&&t<=i)return n}return-1},t._lctf.readCoverage=function(e,n){var r=t._bin,i={};i.fmt=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);return n+=2,i.fmt==1&&(i.tab=r.readUshorts(e,n,a)),i.fmt==2&&(i.tab=r.readUshorts(e,n,3*a)),i},t._lctf.coverageIndex=function(e,n){var r=e.tab;if(e.fmt==1)return r.indexOf(n);if(e.fmt==2){var i=t._lctf.getInterval(r,n);if(i!=-1)return r[i+2]+(n-r[i])}return-1},t._lctf.readFeatureList=function(e,n){var r=t._bin,i=n,a=[],o=r.readUshort(e,n);n+=2;for(var s=0;s<o;s++){var c=r.readASCII(e,n,4);n+=4;var l=r.readUshort(e,n);n+=2;var u=t._lctf.readFeatureTable(e,i+l);u.tag=c.trim(),a.push(u)}return a},t._lctf.readFeatureTable=function(e,n){var r=t._bin,i=n,a={},o=r.readUshort(e,n);n+=2,o>0&&(a.featureParams=i+o);var s=r.readUshort(e,n);n+=2,a.tab=[];for(var c=0;c<s;c++)a.tab.push(r.readUshort(e,n+2*c));return a},t._lctf.readScriptList=function(e,n){var r=t._bin,i=n,a={},o=r.readUshort(e,n);n+=2;for(var s=0;s<o;s++){var c=r.readASCII(e,n,4);n+=4;var l=r.readUshort(e,n);n+=2,a[c.trim()]=t._lctf.readScriptTable(e,i+l)}return a},t._lctf.readScriptTable=function(e,n){var r=t._bin,i=n,a={},o=r.readUshort(e,n);n+=2,o>0&&(a.default=t._lctf.readLangSysTable(e,i+o));var s=r.readUshort(e,n);n+=2;for(var c=0;c<s;c++){var l=r.readASCII(e,n,4);n+=4;var u=r.readUshort(e,n);n+=2,a[l.trim()]=t._lctf.readLangSysTable(e,i+u)}return a},t._lctf.readLangSysTable=function(e,n){var r=t._bin,i={};r.readUshort(e,n),n+=2,i.reqFeature=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);return n+=2,i.features=r.readUshorts(e,n,a),i},t.CFF={},t.CFF.parse=function(e,n,r){var i=t._bin;(e=new Uint8Array(e.buffer,n,r))[n=0],e[++n],e[++n],e[++n],n++;var a=[];n=t.CFF.readIndex(e,n,a);for(var o=[],s=0;s<a.length-1;s++)o.push(i.readASCII(e,n+a[s],a[s+1]-a[s]));n+=a[a.length-1];var c=[];n=t.CFF.readIndex(e,n,c);var l=[];for(s=0;s<c.length-1;s++)l.push(t.CFF.readDict(e,n+c[s],n+c[s+1]));n+=c[c.length-1];var u=l[0],d=[];n=t.CFF.readIndex(e,n,d);var f=[];for(s=0;s<d.length-1;s++)f.push(i.readASCII(e,n+d[s],d[s+1]-d[s]));if(n+=d[d.length-1],t.CFF.readSubrs(e,n,u),u.CharStrings){n=u.CharStrings,d=[],n=t.CFF.readIndex(e,n,d);var p=[];for(s=0;s<d.length-1;s++)p.push(i.readBytes(e,n+d[s],d[s+1]-d[s]));u.CharStrings=p}if(u.ROS){n=u.FDArray;var m=[];for(n=t.CFF.readIndex(e,n,m),u.FDArray=[],s=0;s<m.length-1;s++){var h=t.CFF.readDict(e,n+m[s],n+m[s+1]);t.CFF._readFDict(e,h,f),u.FDArray.push(h)}n+=m[m.length-1],n=u.FDSelect,u.FDSelect=[];var g=e[n];if(n++,g!=3)throw g;var _=i.readUshort(e,n);for(n+=2,s=0;s<_+1;s++)u.FDSelect.push(i.readUshort(e,n),e[n+2]),n+=3}return u.Encoding&&=t.CFF.readEncoding(e,u.Encoding,u.CharStrings.length),u.charset&&=t.CFF.readCharset(e,u.charset,u.CharStrings.length),t.CFF._readFDict(e,u,f),u},t.CFF._readFDict=function(e,n,r){var i;for(var a in n.Private&&(i=n.Private[1],n.Private=t.CFF.readDict(e,i,i+n.Private[0]),n.Private.Subrs&&t.CFF.readSubrs(e,i+n.Private.Subrs,n.Private)),n)[`FamilyName`,`FontName`,`FullName`,`Notice`,`version`,`Copyright`].indexOf(a)!=-1&&(n[a]=r[n[a]-426+35])},t.CFF.readSubrs=function(e,n,r){var i=t._bin,a=[];n=t.CFF.readIndex(e,n,a);var o,s=a.length;o=s<1240?107:s<33900?1131:32768,r.Bias=o,r.Subrs=[];for(var c=0;c<a.length-1;c++)r.Subrs.push(i.readBytes(e,n+a[c],a[c+1]-a[c]))},t.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],t.CFF.glyphByUnicode=function(e,t){for(var n=0;n<e.charset.length;n++)if(e.charset[n]==t)return n;return-1},t.CFF.glyphBySE=function(e,n){return n<0||n>
600255?-1:t.CFF.glyphByUnicode(e,t.CFF.tableSE[n])},t.CFF.readEncoding=function(e,n,r){t._bin;var i=[`.notdef`],a=e[n];if(n++,a!=0)throw`error: unknown encoding format: `+a;var o=e[n];n++;for(var s=0;s<o;s++)i.push(e[n+s]);return i},t.CFF.readCharset=function(e,n,r){var i=t._bin,a=[`.notdef`],o=e[n];if(n++,o==0)for(var s=0;s<r;s++){var c=i.readUshort(e,n);n+=2,a.push(c)}else{if(o!=1&&o!=2)throw`error: format: `+o;for(;a.length<r;){c=i.readUshort(e,n),n+=2;var l=0;for(o==1?(l=e[n],n++):(l=i.readUshort(e,n),n+=2),s=0;s<=l;s++)a.push(c),c++}}return a},t.CFF.readIndex=function(e,n,r){var i=t._bin,a=i.readUshort(e,n)+1,o=e[n+=2];if(n++,o==1)for(var s=0;s<a;s++)r.push(e[n+s]);else if(o==2)for(s=0;s<a;s++)r.push(i.readUshort(e,n+2*s));else if(o==3)for(s=0;s<a;s++)r.push(16777215&i.readUint(e,n+3*s-1));else if(a!=1)throw`unsupported offset size: `+o+`, count: `+a;return(n+=a*o)-1},t.CFF.getCharString=function(e,n,r){var i=t._bin,a=e[n],o=e[n+1];e[n+2],e[n+3],e[n+4];var s=1,c=null,l=null;a<=20&&(c=a,s=1),a==12&&(c=100*a+o,s=2),21<=a&&a<=27&&(c=a,s=1),a==28&&(l=i.readShort(e,n+1),s=3),29<=a&&a<=31&&(c=a,s=1),32<=a&&a<=246&&(l=a-139,s=1),247<=a&&a<=250&&(l=256*(a-247)+o+108,s=2),251<=a&&a<=254&&(l=256*-(a-251)-o-108,s=2),a==255&&(l=i.readInt(e,n+1)/65535,s=5),r.val=l??`o`+c,r.size=s},t.CFF.readCharString=function(e,n,r){for(var i=n+r,a=t._bin,o=[];n<i;){var s=e[n],c=e[n+1];e[n+2],e[n+3],e[n+4];var l=1,u=null,d=null;s<=20&&(u=s,l=1),s==12&&(u=100*s+c,l=2),s!=19&&s!=20||(u=s,l=2),21<=s&&s<=27&&(u=s,l=1),s==28&&(d=a.readShort(e,n+1),l=3),29<=s&&s<=31&&(u=s,l=1),32<=s&&s<=246&&(d=s-139,l=1),247<=s&&s<=250&&(d=256*(s-247)+c+108,l=2),251<=s&&s<=254&&(d=256*-(s-251)-c-108,l=2),s==255&&(d=a.readInt(e,n+1)/65535,l=5),o.push(d??`o`+u),n+=l}return o},t.CFF.readDict=function(e,n,r){for(var i=t._bin,a={},o=[];n<r;){var s=e[n],c=e[n+1];e[n+2],e[n+3],e[n+4];var l=1,u=null,d=null;if(s==28&&(d=i.readShort(e,n+1),l=3),s==29&&(d=i.readInt(e,n+1),l=5),32<=s&&s<=246&&(d=s-139,l=1),247<=s&&s<=250&&(d=256*(s-247)+c+108,l=2),251<=s&&s<=254&&(d=256*-(s-251)-c-108,l=2),s==255)throw d=i.readInt(e,n+1)/65535,l=5,`unknown number`;if(s==30){var f=[];for(l=1;;){var p=e[n+l];l++;var m=p>>4,h=15&p;if(m!=15&&f.push(m),h!=15&&f.push(h),h==15)break}for(var g=``,_=[0,1,2,3,4,5,6,7,8,9,`.`,`e`,`e-`,`reserved`,`-`,`endOfNumber`],v=0;v<f.length;v++)g+=_[f[v]];d=parseFloat(g)}s<=21&&(u=[`version`,`Notice`,`FullName`,`FamilyName`,`Weight`,`FontBBox`,`BlueValues`,`OtherBlues`,`FamilyBlues`,`FamilyOtherBlues`,`StdHW`,`StdVW`,`escape`,`UniqueID`,`XUID`,`charset`,`Encoding`,`CharStrings`,`Private`,`Subrs`,`defaultWidthX`,`nominalWidthX`][s],l=1,s==12&&(u=[`Copyright`,`isFixedPitch`,`ItalicAngle`,`UnderlinePosition`,`UnderlineThickness`,`PaintType`,`CharstringType`,`FontMatrix`,`StrokeWidth`,`BlueScale`,`BlueShift`,`BlueFuzz`,`StemSnapH`,`StemSnapV`,`ForceBold`,0,0,`LanguageGroup`,`ExpansionFactor`,`initialRandomSeed`,`SyntheticBase`,`PostScript`,`BaseFontName`,`BaseFontBlend`,0,0,0,0,0,0,`ROS`,`CIDFontVersion`,`CIDFontRevision`,`CIDFontType`,`CIDCount`,`UIDBase`,`FDArray`,`FDSelect`,`FontName`][c],l=2)),u==null?o.push(d):(a[u]=o.length==1?o[0]:o,o=[]),n+=l}return a},t.cmap={},t.cmap.parse=function(e,n,r){e=new Uint8Array(e.buffer,n,r),n=0;var i=t._bin,a={};i.readUshort(e,n),n+=2;var o=i.readUshort(e,n);n+=2;var s=[];a.tables=[];for(var c=0;c<o;c++){var l=i.readUshort(e,n);n+=2;var u=i.readUshort(e,n);n+=2;var d=i.readUint(e,n);n+=4;var f=`p`+l+`e`+u,p=s.indexOf(d);if(p==-1){var m;p=a.tables.length,s.push(d);var h=i.readUshort(e,d);h==0?m=t.cmap.parse0(e,d):h==4?m=t.cmap.parse4(e,d):h==6?m=t.cmap.parse6(e,d):h==12?m=t.cmap.parse12(e,d):console.debug(`unknown format: `+h,l,u,d),a.tables.push(m)}if(a[f]!=null)throw`multiple tables for one platform+encoding`;a[f]=p}return a},t.cmap.parse0=function(e,n){var r=t._bin,i={};i.format=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);n+=2,r.readUshort(e,n),n+=2,i.map=[];for(var o=0;o<a-6;o++)i.map.push(e[n+o]);return i},t.cmap.parse4=function(e,n){var r=t._bin,i=n,a={};a.format=r.readUshort(e,n),n+=2;var o=r.readUshort(e,n);n+=2,r.readUshort(e,n),n+=2;var s=r.readUshort(e,n);n+=2;var c=s/2;a.searchRange=r.readUshort(e,n),n+=2,a.entrySelector=r.readUshort(e,n),n+=2,a.rangeShift=r.readUshort(e,n),n+=2,a.endCount=r.readUshorts(e,n,c),n+=2*c,n+=2,a.startCount=r.readUshorts(e,n,c),n+=2*c,a.idDelta=[];for(var l=0;l<c;l++)a.idDelta.push(r.readShort(e,n)),n+=2;for(a.idRangeOffset=r.readUshorts(e,n,c),n+=2*c,a.glyphIdArray=[];n<i+o;)a.glyphIdArray.push(r.readUshort(e,n)),n+=2;return a},t.cmap.parse6=function(e,n){var r=t._bin,i={};i.format=r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2,i.firstCode=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);n+=2,i.glyphIdArray=[];for(var o=0;o<a;o++)i.glyphIdArray.push(r.readUshort(e,n)),n+=2;return i},t.cmap.parse12=function(e,n){var r=t._bin,i={};i.format=r.readUshort(e,n),n+=2,n+=2,r.readUint(e,n),n+=4,r.readUint(e,n),n+=4;var a=r.readUint(e,n);n+=4,i.groups=[];for(var o=0;o<a;o++){var s=n+12*o,c=r.readUint(e,s+0),l=r.readUint(e,s+4),u=r.readUint(e,s+8);i.groups.push([c,l,u])}return i},t.glyf={},t.glyf.parse=function(e,t,n,r){for(var i=[],a=0;a<r.maxp.numGlyphs;a++)i.push(null);return i},t.glyf._parseGlyf=function(e,n){var r=t._bin,i=e._data,a=t._tabOffset(i,`glyf`,e._offset)+e.loca[n];if(e.loca[n]==e.loca[n+1])return null;var o={};if(o.noc=r.readShort(i,a),a+=2,o.xMin=r.readShort(i,a),a+=2,o.yMin=r.readShort(i,a),a+=2,o.xMax=r.readShort(i,a),a+=2,o.yMax=r.readShort(i,a),a+=2,o.xMin>=o.xMax||o.yMin>=o.yMax)return null;if(o.noc>0){o.endPts=[];for(var s=0;s<o.noc;s++)o.endPts.push(r.readUshort(i,a)),a+=2;var c=r.readUshort(i,a);if(a+=2,i.length-a<c)return null;o.instructions=r.readBytes(i,a,c),a+=c;var l=o.endPts[o.noc-1]+1;for(o.flags=[],s=0;s<l;s++){var u=i[a];if(a++,o.flags.push(u),8&u){var d=i[a];a++;for(var f=0;f<d;f++)o.flags.push(u),s++}}for(o.xs=[],s=0;s<l;s++){var p=!!(2&o.flags[s]),m=!!(16&o.flags[s]);p?(o.xs.push(m?i[a]:-i[a]),a++):m?o.xs.push(0):(o.xs.push(r.readShort(i,a)),a+=2)}for(o.ys=[],s=0;s<l;s++)p=!!(4&o.flags[s]),m=!!(32&o.flags[s]),p?(o.ys.push(m?i[a]:-i[a]),a++):m?o.ys.push(0):(o.ys.push(r.readShort(i,a)),a+=2);var h=0,g=0;for(s=0;s<l;s++)h+=o.xs[s],g+=o.ys[s],o.xs[s]=h,o.ys[s]=g}else{var _;o.parts=[];do{_=r.readUshort(i,a),a+=2;var v={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(o.parts.push(v),v.glyphIndex=r.readUshort(i,a),a+=2,1&_){var y=r.readShort(i,a);a+=2;var b=r.readShort(i,a);a+=2}else y=r.readInt8(i,a),a++,b=r.readInt8(i,a),a++;2&_?(v.m.tx=y,v.m.ty=b):(v.p1=y,v.p2=b),8&_?(v.m.a=v.m.d=r.readF2dot14(i,a),a+=2):64&_?(v.m.a=r.readF2dot14(i,a),a+=2,v.m.d=r.readF2dot14(i,a),a+=2):128&_&&(v.m.a=r.readF2dot14(i,a),a+=2,v.m.b=r.readF2dot14(i,a),a+=2,v.m.c=r.readF2dot14(i,a),a+=2,v.m.d=r.readF2dot14(i,a),a+=2)}while(32&_);if(256&_){var x=r.readUshort(i,a);for(a+=2,o.instr=[],s=0;s<x;s++)o.instr.push(i[a]),a++}}return o},t.GDEF={},t.GDEF.parse=function(e,n,r,i){var a=n;n+=4;var o=t._bin.readUshort(e,n);return{glyphClassDef:o===0?null:t._lctf.readClassDef(e,a+o)}},t.GPOS={},t.GPOS.parse=function(e,n,r,i){return t._lctf.parse(e,n,r,i,t.GPOS.subt)},t.GPOS.subt=function(e,n,r,i){var a=t._bin,o=r,s={};if(s.fmt=a.readUshort(e,r),r+=2,n==1||n==2||n==3||n==7||n==8&&s.fmt<=2){var c=a.readUshort(e,r);r+=2,s.coverage=t._lctf.readCoverage(e,c+o)}if(n==1&&s.fmt==1){var l=a.readUshort(e,r);r+=2,l!=0&&(s.pos=t.GPOS.readValueRecord(e,r,l))}else if(n==2&&s.fmt>=1&&s.fmt<=2){l=a.readUshort(e,r),r+=2;var u=a.readUshort(e,r);r+=2;var d=t._lctf.numOfOnes(l),f=t._lctf.numOfOnes(u);if(s.fmt==1){s.pairsets=[];var p=a.readUshort(e,r);r+=2;
600for(var m=0;m<p;m++){var h=o+a.readUshort(e,r);r+=2;var g=a.readUshort(e,h);h+=2;for(var _=[],v=0;v<g;v++){var y=a.readUshort(e,h);h+=2,l!=0&&(T=t.GPOS.readValueRecord(e,h,l),h+=2*d),u!=0&&(E=t.GPOS.readValueRecord(e,h,u),h+=2*f),_.push({gid2:y,val1:T,val2:E})}s.pairsets.push(_)}}if(s.fmt==2){var b=a.readUshort(e,r);r+=2;var x=a.readUshort(e,r);r+=2;var S=a.readUshort(e,r);r+=2;var C=a.readUshort(e,r);for(r+=2,s.classDef1=t._lctf.readClassDef(e,o+b),s.classDef2=t._lctf.readClassDef(e,o+x),s.matrix=[],m=0;m<S;m++){var w=[];for(v=0;v<C;v++){var T=null,E=null;l!=0&&(T=t.GPOS.readValueRecord(e,r,l),r+=2*d),u!=0&&(E=t.GPOS.readValueRecord(e,r,u),r+=2*f),w.push({val1:T,val2:E})}s.matrix.push(w)}}}else if(n==4&&s.fmt==1)s.markCoverage=t._lctf.readCoverage(e,a.readUshort(e,r)+o),s.baseCoverage=t._lctf.readCoverage(e,a.readUshort(e,r+2)+o),s.markClassCount=a.readUshort(e,r+4),s.markArray=t.GPOS.readMarkArray(e,a.readUshort(e,r+6)+o),s.baseArray=t.GPOS.readBaseArray(e,a.readUshort(e,r+8)+o,s.markClassCount);else if(n==6&&s.fmt==1)s.mark1Coverage=t._lctf.readCoverage(e,a.readUshort(e,r)+o),s.mark2Coverage=t._lctf.readCoverage(e,a.readUshort(e,r+2)+o),s.markClassCount=a.readUshort(e,r+4),s.mark1Array=t.GPOS.readMarkArray(e,a.readUshort(e,r+6)+o),s.mark2Array=t.GPOS.readBaseArray(e,a.readUshort(e,r+8)+o,s.markClassCount);else{if(n==9&&s.fmt==1){var D=a.readUshort(e,r);r+=2;var O=a.readUint(e,r);if(r+=4,i.ltype==9)i.ltype=D;else if(i.ltype!=D)throw`invalid extension substitution`;return t.GPOS.subt(e,i.ltype,o+O)}console.debug(`unsupported GPOS table LookupType`,n,`format`,s.fmt)}return s},t.GPOS.readValueRecord=function(e,n,r){var i=t._bin,a=[];return a.push(1&r?i.readShort(e,n):0),n+=1&r?2:0,a.push(2&r?i.readShort(e,n):0),n+=2&r?2:0,a.push(4&r?i.readShort(e,n):0),n+=4&r?2:0,a.push(8&r?i.readShort(e,n):0),n+=8&r?2:0,a},t.GPOS.readBaseArray=function(e,n,r){var i=t._bin,a=[],o=n,s=i.readUshort(e,n);n+=2;for(var c=0;c<s;c++){for(var l=[],u=0;u<r;u++)l.push(t.GPOS.readAnchorRecord(e,o+i.readUshort(e,n))),n+=2;a.push(l)}return a},t.GPOS.readMarkArray=function(e,n){var r=t._bin,i=[],a=n,o=r.readUshort(e,n);n+=2;for(var s=0;s<o;s++){var c=t.GPOS.readAnchorRecord(e,r.readUshort(e,n+2)+a);c.markClass=r.readUshort(e,n),i.push(c),n+=4}return i},t.GPOS.readAnchorRecord=function(e,n){var r=t._bin,i={};return i.fmt=r.readUshort(e,n),i.x=r.readShort(e,n+2),i.y=r.readShort(e,n+4),i},t.GSUB={},t.GSUB.parse=function(e,n,r,i){return t._lctf.parse(e,n,r,i,t.GSUB.subt)},t.GSUB.subt=function(e,n,r,i){var a=t._bin,o=r,s={};if(s.fmt=a.readUshort(e,r),r+=2,n!=1&&n!=2&&n!=4&&n!=5&&n!=6)return null;if(n==1||n==2||n==4||n==5&&s.fmt<=2||n==6&&s.fmt<=2){var c=a.readUshort(e,r);r+=2,s.coverage=t._lctf.readCoverage(e,o+c)}if(n==1&&s.fmt>=1&&s.fmt<=2){if(s.fmt==1)s.delta=a.readShort(e,r),r+=2;else if(s.fmt==2){var l=a.readUshort(e,r);r+=2,s.newg=a.readUshorts(e,r,l),r+=2*s.newg.length}}else if(n==2&&s.fmt==1){l=a.readUshort(e,r),r+=2,s.seqs=[];for(var u=0;u<l;u++){var d=a.readUshort(e,r)+o;r+=2;var f=a.readUshort(e,d);s.seqs.push(a.readUshorts(e,d+2,f))}}else if(n==4)for(s.vals=[],l=a.readUshort(e,r),r+=2,u=0;u<l;u++){var p=a.readUshort(e,r);r+=2,s.vals.push(t.GSUB.readLigatureSet(e,o+p))}else if(n==5&&s.fmt==2){if(s.fmt==2){var m=a.readUshort(e,r);r+=2,s.cDef=t._lctf.readClassDef(e,o+m),s.scset=[];var h=a.readUshort(e,r);for(r+=2,u=0;u<h;u++){var g=a.readUshort(e,r);r+=2,s.scset.push(g==0?null:t.GSUB.readSubClassSet(e,o+g))}}}else if(n==6&&s.fmt==3){if(s.fmt==3){for(u=0;u<3;u++){l=a.readUshort(e,r),r+=2;for(var _=[],v=0;v<l;v++)_.push(t._lctf.readCoverage(e,o+a.readUshort(e,r+2*v)));r+=2*l,u==0&&(s.backCvg=_),u==1&&(s.inptCvg=_),u==2&&(s.ahedCvg=_)}l=a.readUshort(e,r),r+=2,s.lookupRec=t.GSUB.readSubstLookupRecords(e,r,l)}}else{if(n==7&&s.fmt==1){var y=a.readUshort(e,r);r+=2;var b=a.readUint(e,r);if(r+=4,i.ltype==9)i.ltype=y;else if(i.ltype!=y)throw`invalid extension substitution`;return t.GSUB.subt(e,i.ltype,o+b)}console.debug(`unsupported GSUB table LookupType`,n,`format`,s.fmt)}return s},t.GSUB.readSubClassSet=function(e,n){var r=t._bin.readUshort,i=n,a=[],o=r(e,n);n+=2;for(var s=0;s<o;s++){var c=r(e,n);n+=2,a.push(t.GSUB.readSubClassRule(e,i+c))}return a},t.GSUB.readSubClassRule=function(e,n){var r=t._bin.readUshort,i={}
600,a=r(e,n),o=r(e,n+=2);n+=2,i.input=[];for(var s=0;s<a-1;s++)i.input.push(r(e,n)),n+=2;return i.substLookupRecords=t.GSUB.readSubstLookupRecords(e,n,o),i},t.GSUB.readSubstLookupRecords=function(e,n,r){for(var i=t._bin.readUshort,a=[],o=0;o<r;o++)a.push(i(e,n),i(e,n+2)),n+=4;return a},t.GSUB.readChainSubClassSet=function(e,n){var r=t._bin,i=n,a=[],o=r.readUshort(e,n);n+=2;for(var s=0;s<o;s++){var c=r.readUshort(e,n);n+=2,a.push(t.GSUB.readChainSubClassRule(e,i+c))}return a},t.GSUB.readChainSubClassRule=function(e,n){for(var r=t._bin,i={},a=[`backtrack`,`input`,`lookahead`],o=0;o<a.length;o++){var s=r.readUshort(e,n);n+=2,o==1&&s--,i[a[o]]=r.readUshorts(e,n,s),n+=2*i[a[o]].length}return s=r.readUshort(e,n),n+=2,i.subst=r.readUshorts(e,n,2*s),n+=2*i.subst.length,i},t.GSUB.readLigatureSet=function(e,n){var r=t._bin,i=n,a=[],o=r.readUshort(e,n);n+=2;for(var s=0;s<o;s++){var c=r.readUshort(e,n);n+=2,a.push(t.GSUB.readLigature(e,i+c))}return a},t.GSUB.readLigature=function(e,n){var r=t._bin,i={chain:[]};i.nglyph=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);n+=2;for(var o=0;o<a-1;o++)i.chain.push(r.readUshort(e,n)),n+=2;return i},t.head={},t.head.parse=function(e,n,r){var i=t._bin,a={};return i.readFixed(e,n),n+=4,a.fontRevision=i.readFixed(e,n),n+=4,i.readUint(e,n),n+=4,i.readUint(e,n),n+=4,a.flags=i.readUshort(e,n),n+=2,a.unitsPerEm=i.readUshort(e,n),n+=2,a.created=i.readUint64(e,n),n+=8,a.modified=i.readUint64(e,n),n+=8,a.xMin=i.readShort(e,n),n+=2,a.yMin=i.readShort(e,n),n+=2,a.xMax=i.readShort(e,n),n+=2,a.yMax=i.readShort(e,n),n+=2,a.macStyle=i.readUshort(e,n),n+=2,a.lowestRecPPEM=i.readUshort(e,n),n+=2,a.fontDirectionHint=i.readShort(e,n),n+=2,a.indexToLocFormat=i.readShort(e,n),n+=2,a.glyphDataFormat=i.readShort(e,n),n+=2,a},t.hhea={},t.hhea.parse=function(e,n,r){var i=t._bin,a={};return i.readFixed(e,n),n+=4,a.ascender=i.readShort(e,n),n+=2,a.descender=i.readShort(e,n),n+=2,a.lineGap=i.readShort(e,n),n+=2,a.advanceWidthMax=i.readUshort(e,n),n+=2,a.minLeftSideBearing=i.readShort(e,n),n+=2,a.minRightSideBearing=i.readShort(e,n),n+=2,a.xMaxExtent=i.readShort(e,n),n+=2,a.caretSlopeRise=i.readShort(e,n),n+=2,a.caretSlopeRun=i.readShort(e,n),n+=2,a.caretOffset=i.readShort(e,n),n+=2,n+=8,a.metricDataFormat=i.readShort(e,n),n+=2,a.numberOfHMetrics=i.readUshort(e,n),n+=2,a},t.hmtx={},t.hmtx.parse=function(e,n,r,i){for(var a=t._bin,o={aWidth:[],lsBearing:[]},s=0,c=0,l=0;l<i.maxp.numGlyphs;l++)l<i.hhea.numberOfHMetrics&&(s=a.readUshort(e,n),n+=2,c=a.readShort(e,n),n+=2),o.aWidth.push(s),o.lsBearing.push(c);return o},t.kern={},t.kern.parse=function(e,n,r,i){var a=t._bin,o=a.readUshort(e,n);if(n+=2,o==1)return t.kern.parseV1(e,n-2,r,i);var s=a.readUshort(e,n);n+=2;for(var c={glyph1:[],rval:[]},l=0;l<s;l++){n+=2,r=a.readUshort(e,n),n+=2;var u=a.readUshort(e,n);n+=2;var d=u>>>8;if((d&=15)!=0)throw`unknown kern table format: `+d;n=t.kern.readFormat0(e,n,c)}return c},t.kern.parseV1=function(e,n,r,i){var a=t._bin;a.readFixed(e,n),n+=4;var o=a.readUint(e,n);n+=4;for(var s={glyph1:[],rval:[]},c=0;c<o;c++){a.readUint(e,n),n+=4;var l=a.readUshort(e,n);n+=2,a.readUshort(e,n),n+=2;var u=l>>>8;if((u&=15)!=0)throw`unknown kern table format: `+u;n=t.kern.readFormat0(e,n,s)}return s},t.kern.readFormat0=function(e,n,r){var i=t._bin,a=-1,o=i.readUshort(e,n);n+=2,i.readUshort(e,n),n+=2,i.readUshort(e,n),n+=2,i.readUshort(e,n),n+=2;for(var s=0;s<o;s++){var c=i.readUshort(e,n);n+=2;var l=i.readUshort(e,n);n+=2;var u=i.readShort(e,n);n+=2,c!=a&&(r.glyph1.push(c),r.rval.push({glyph2:[],vals:[]}));var d=r.rval[r.rval.length-1];d.glyph2.push(l),d.vals.push(u),a=c}return n},t.loca={},t.loca.parse=function(e,n,r,i){var a=t._bin,o=[],s=i.head.indexToLocFormat,c=i.maxp.numGlyphs+1;if(s==0)for(var l=0;l<c;l++)o.push(a.readUshort(e,n+(l<<1))<<1);if(s==1)for(l=0;l<c;l++)o.push(a.readUint(e,n+(l<<2)));return o},t.maxp={},t.maxp.parse=function(e,n,r){var i=t._bin,a={},o=i.readUint(e,n);return n+=4,a.numGlyphs=i.readUshort(e,n),n+=2,o==65536&&(a.maxPoints=i.readUshort(e,n),n+=2,a.maxContours=i.readUshort(e,n),n+=2,a.maxCompositePoints=i.readUshort(e,n),n+=2,a.maxCompositeContours=i.readUshort(e,n),n+=2,a.maxZones=i.readUshort(e,n),n+=2,a.maxTwilightPoints=i.readUshort(e,n),n+=2,a.maxStorage=i.readUshort(e,n),n+=2,a.maxFunctionDefs=i.readUshort(e,n),n+=2,a.maxInstructionDefs=i.readUshort(e,n),n+=2,a.maxStackElements=i.readUshort(e,n),n+=2,a.maxSizeOfInstru
600ctions=i.readUshort(e,n),n+=2,a.maxComponentElements=i.readUshort(e,n),n+=2,a.maxComponentDepth=i.readUshort(e,n),n+=2),a},t.name={},t.name.parse=function(e,n,r){var i=t._bin,a={};i.readUshort(e,n),n+=2;var o=i.readUshort(e,n);n+=2,i.readUshort(e,n);for(var s,c=[`copyright`,`fontFamily`,`fontSubfamily`,`ID`,`fullName`,`version`,`postScriptName`,`trademark`,`manufacturer`,`designer`,`description`,`urlVendor`,`urlDesigner`,`licence`,`licenceURL`,`---`,`typoFamilyName`,`typoSubfamilyName`,`compatibleFull`,`sampleText`,`postScriptCID`,`wwsFamilyName`,`wwsSubfamilyName`,`lightPalette`,`darkPalette`],l=n+=2,u=0;u<o;u++){var d=i.readUshort(e,n);n+=2;var f=i.readUshort(e,n);n+=2;var p=i.readUshort(e,n);n+=2;var m=i.readUshort(e,n);n+=2;var h=i.readUshort(e,n);n+=2;var g=i.readUshort(e,n);n+=2;var _,v=c[m],y=l+12*o+g;if(d==0)_=i.readUnicode(e,y,h/2);else if(d==3&&f==0)_=i.readUnicode(e,y,h/2);else if(f==0)_=i.readASCII(e,y,h);else if(f==1)_=i.readUnicode(e,y,h/2);else if(f==3)_=i.readUnicode(e,y,h/2);else{if(d!=1)throw`unknown encoding `+f+`, platformID: `+d;_=i.readASCII(e,y,h),console.debug(`reading unknown MAC encoding `+f+` as ASCII`)}var b=`p`+d+`,`+p.toString(16);a[b]??(a[b]={}),a[b][v===void 0?m:v]=_,a[b]._lang=p}for(var x in a)if(a[x].postScriptName!=null&&a[x]._lang==1033)return a[x];for(var x in a)if(a[x].postScriptName!=null&&a[x]._lang==0)return a[x];for(var x in a)if(a[x].postScriptName!=null&&a[x]._lang==3084)return a[x];for(var x in a)if(a[x].postScriptName!=null)return a[x];for(var x in a){s=x;break}return console.debug(`returning name table with languageID `+a[s]._lang),a[s]},t[`OS/2`]={},t[`OS/2`].parse=function(e,n,r){var i=t._bin.readUshort(e,n);n+=2;var a={};if(i==0)t[`OS/2`].version0(e,n,a);else if(i==1)t[`OS/2`].version1(e,n,a);else if(i==2||i==3||i==4)t[`OS/2`].version2(e,n,a);else{if(i!=5)throw`unknown OS/2 table version: `+i;t[`OS/2`].version5(e,n,a)}return a},t[`OS/2`].version0=function(e,n,r){var i=t._bin;return r.xAvgCharWidth=i.readShort(e,n),n+=2,r.usWeightClass=i.readUshort(e,n),n+=2,r.usWidthClass=i.readUshort(e,n),n+=2,r.fsType=i.readUshort(e,n),n+=2,r.ySubscriptXSize=i.readShort(e,n),n+=2,r.ySubscriptYSize=i.readShort(e,n),n+=2,r.ySubscriptXOffset=i.readShort(e,n),n+=2,r.ySubscriptYOffset=i.readShort(e,n),n+=2,r.ySuperscriptXSize=i.readShort(e,n),n+=2,r.ySuperscriptYSize=i.readShort(e,n),n+=2,r.ySuperscriptXOffset=i.readShort(e,n),n+=2,r.ySuperscriptYOffset=i.readShort(e,n),n+=2,r.yStrikeoutSize=i.readShort(e,n),n+=2,r.yStrikeoutPosition=i.readShort(e,n),n+=2,r.sFamilyClass=i.readShort(e,n),n+=2,r.panose=i.readBytes(e,n,10),n+=10,r.ulUnicodeRange1=i.readUint(e,n),n+=4,r.ulUnicodeRange2=i.readUint(e,n),n+=4,r.ulUnicodeRange3=i.readUint(e,n),n+=4,r.ulUnicodeRange4=i.readUint(e,n),n+=4,r.achVendID=[i.readInt8(e,n),i.readInt8(e,n+1),i.readInt8(e,n+2),i.readInt8(e,n+3)],n+=4,r.fsSelection=i.readUshort(e,n),n+=2,r.usFirstCharIndex=i.readUshort(e,n),n+=2,r.usLastCharIndex=i.readUshort(e,n),n+=2,r.sTypoAscender=i.readShort(e,n),n+=2,r.sTypoDescender=i.readShort(e,n),n+=2,r.sTypoLineGap=i.readShort(e,n),n+=2,r.usWinAscent=i.readUshort(e,n),n+=2,r.usWinDescent=i.readUshort(e,n),n+=2},t[`OS/2`].version1=function(e,n,r){var i=t._bin;return n=t[`OS/2`].version0(e,n,r),r.ulCodePageRange1=i.readUint(e,n),n+=4,r.ulCodePageRange2=i.readUint(e,n),n+=4},t[`OS/2`].version2=function(e,n,r){var i=t._bin;return n=t[`OS/2`].version1(e,n,r),r.sxHeight=i.readShort(e,n),n+=2,r.sCapHeight=i.readShort(e,n),n+=2,r.usDefault=i.readUshort(e,n),n+=2,r.usBreak=i.readUshort(e,n),n+=2,r.usMaxContext=i.readUshort(e,n),n+=2},t[`OS/2`].version5=function(e,n,r){var i=t._bin;return n=t[`OS/2`].version2(e,n,r),r.usLowerOpticalPointSize=i.readUshort(e,n),n+=2,r.usUpperOpticalPointSize=i.readUshort(e,n),n+=2},t.post={},t.post.parse=function(e,n,r){var i=t._bin,a={};return a.version=i.readFixed(e,n),n+=4,a.italicAngle=i.readFixed(e,n),n+=4,a.underlinePosition=i.readShort(e,n),n+=2,a.underlineThickness=i.readShort(e,n),n+=2,a},t??={},t.U??(t.U={}),t.U.codeToGlyph=function(e,t){var n=e.cmap,r=-1;if(n.p0e4==null?n.p3e1==null?n.p1e0==null?n.p0e3!=null&&(r=n.p0e3):r=n.p1e0:r=n.p3e1:r=n.p0e4,r==-1)throw`
600no familiar platform and encoding!`;var i=n.tables[r];if(i.format==0)return t>=i.map.length?0:i.map[t];if(i.format==4){for(var a=-1,o=0;o<i.endCount.length;o++)if(t<=i.endCount[o]){a=o;break}return a==-1||i.startCount[a]>t?0:65535&(i.idRangeOffset[a]==0?t+i.idDelta[a]:i.glyphIdArray[t-i.startCount[a]+(i.idRangeOffset[a]>>1)-(i.idRangeOffset.length-a)])}if(i.format==12){if(t>i.groups[i.groups.length-1][1])return 0;for(o=0;o<i.groups.length;o++){var s=i.groups[o];if(s[0]<=t&&t<=s[1])return s[2]+(t-s[0])}return 0}throw`unknown cmap table format `+i.format},t.U.glyphToPath=function(e,n){var r={cmds:[],crds:[]};if(e.SVG&&e.SVG.entries[n]){var i=e.SVG.entries[n];return i==null?r:(typeof i==`string`&&(i=t.SVG.toPath(i),e.SVG.entries[n]=i),i)}if(e.CFF){var a={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:e.CFF.Private?e.CFF.Private.defaultWidthX:0,open:!1},o=e.CFF,s=e.CFF.Private;if(o.ROS){for(var c=0;o.FDSelect[c+2]<=n;)c+=2;s=o.FDArray[o.FDSelect[c+1]].Private}t.U._drawCFF(e.CFF.CharStrings[n],a,o,s,r)}else e.glyf&&t.U._drawGlyf(n,e,r);return r},t.U._drawGlyf=function(e,n,r){var i=n.glyf[e];i??=n.glyf[e]=t.glyf._parseGlyf(n,e),i!=null&&(i.noc>-1?t.U._simpleGlyph(i,r):t.U._compoGlyph(i,n,r))},t.U._simpleGlyph=function(e,n){for(var r=0;r<e.noc;r++){for(var i=r==0?0:e.endPts[r-1]+1,a=e.endPts[r],o=i;o<=a;o++){var s=o==i?a:o-1,c=o==a?i:o+1,l=1&e.flags[o],u=1&e.flags[s],d=1&e.flags[c],f=e.xs[o],p=e.ys[o];if(o==i){if(l){if(!u){t.U.P.moveTo(n,f,p);continue}t.U.P.moveTo(n,e.xs[s],e.ys[s])}else u?t.U.P.moveTo(n,e.xs[s],e.ys[s]):t.U.P.moveTo(n,(e.xs[s]+f)/2,(e.ys[s]+p)/2)}l?u&&t.U.P.lineTo(n,f,p):d?t.U.P.qcurveTo(n,f,p,e.xs[c],e.ys[c]):t.U.P.qcurveTo(n,f,p,(f+e.xs[c])/2,(p+e.ys[c])/2)}t.U.P.closePath(n)}},t.U._compoGlyph=function(e,n,r){for(var i=0;i<e.parts.length;i++){var a={cmds:[],crds:[]},o=e.parts[i];t.U._drawGlyf(o.glyphIndex,n,a);for(var s=o.m,c=0;c<a.crds.length;c+=2){var l=a.crds[c],u=a.crds[c+1];r.crds.push(l*s.a+u*s.b+s.tx),r.crds.push(l*s.c+u*s.d+s.ty)}for(c=0;c<a.cmds.length;c++)r.cmds.push(a.cmds[c])}},t.U._getGlyphClass=function(e,n){var r=t._lctf.getInterval(n,e);return r==-1?0:n[r+2]},t.U._applySubs=function(e,n,r,i){for(var a=e.length-n-1,o=0;o<r.tabs.length;o++)if(r.tabs[o]!=null){var s,c=r.tabs[o];if(!c.coverage||(s=t._lctf.coverageIndex(c.coverage,e[n]))!=-1){if(r.ltype==1)e[n],e[n]=c.fmt==1?e[n]+c.delta:c.newg[s];else if(r.ltype==4)for(var l=c.vals[s],u=0;u<l.length;u++){var d=l[u],f=d.chain.length;if(!(f>a)){for(var p=!0,m=0,h=0;h<f;h++){for(;e[n+m+(1+h)]==-1;)m++;d.chain[h]!=e[n+m+(1+h)]&&(p=!1)}if(p){for(e[n]=d.nglyph,h=0;h<f+m;h++)e[n+h+1]=-1;break}}}else if(r.ltype==5&&c.fmt==2)for(var g=t._lctf.getInterval(c.cDef,e[n]),_=c.cDef[g+2],v=c.scset[_],y=0;y<v.length;y++){var b=v[y],x=b.input;if(!(x.length>a)){for(p=!0,h=0;h<x.length;h++){var S=t._lctf.getInterval(c.cDef,e[n+1+h]);if(g==-1&&c.cDef[S+2]!=x[h]){p=!1;break}}if(p){var C=b.substLookupRecords;for(u=0;u<C.length;u+=2)C[u],C[u+1]}}}else if(r.ltype==6&&c.fmt==3){if(!t.U._glsCovered(e,c.backCvg,n-c.backCvg.length)||!t.U._glsCovered(e,c.inptCvg,n)||!t.U._glsCovered(e,c.ahedCvg,n+c.inptCvg.length))continue;var w=c.lookupRec;for(y=0;y<w.length;y+=2){g=w[y];var T=i[w[y+1]];t.U._applySubs(e,n+g,T,i)}}}}},t.U._glsCovered=function(e,n,r){for(var i=0;i<n.length;i++)if(t._lctf.coverageIndex(n[i],e[r+i])==-1)return!1;return!0},t.U.glyphsToPath=function(e,n,r){for(var i={cmds:[],crds:[]},a=0,o=0;o<n.length;o++){var s=n[o];if(s!=-1){for(var c=o<n.length-1&&n[o+1]!=-1?n[o+1]:0,l=t.U.glyphToPath(e,s),u=0;u<l.crds.length;u+=2)i.crds.push(l.crds[u]+a),i.crds.push(l.crds[u+1]);for(r&&i.cmds.push(r),u=0;u<l.cmds.length;u++)i.cmds.push(l.cmds[u]);r&&i.cmds.push(`X`),a+=e.hmtx.aWidth[s],o<n.length-1&&(a+=t.U.getPairAdjustment(e,s,c))}}return i},t.U.P={},t.U.P.moveTo=function(e,t,n){e.cmds.push(`M`),e.crds.push(t,n)},t.U.P.lineTo=function(e,t,n){e.cmds.push(`L`),e.crds.push(t,n)},t.U.P.curveTo=function(e,t,n,r,i,a,o){e.cmds.push(`C`),e.crds.push(t,n,r,i,a,o)},t.U.P.qcurveTo=function(e,t,n,r,i){e.cmds.push(`Q`),e.crds.push(t,n,r,i)},t.U.P.closePath=function(e){e.cmds.push(`Z`)},t.U._drawCFF=function(e,n,r,i,a){for(var o=n.stack,s=n.nStems,c=n.haveWidth,l=n.width,u=n.open,d=0,f=n.x,p=n.y,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w={val:0,size:0};d<e.length;){t.CFF.getCharString(e,d,w);var T=w.val;if(d+=w.size,T==`o1`||T==`o18`)o.length%2!=0&&!c&&(l=o.shift()+i.nominalWidthX),s+=o.length>>1,o.length=0,c=!0;else if(T==`o3`||T==`o23`)o.length%2!=0&&!c&&(l=o.shift()+i.nominalWidthX),s+=o.length>>1,o.length=0,c=!0;else if(T==`o4`)o.length>1&&!c&&(l=o.shift()+i.nominalWidthX,c=!0),u&&t.U.P.closePath(a),p+=o.pop(),t.U.P.moveTo(a,f,p),u=!0;else if(T==`o5`)for(;o.length>0;)f+=o.shift(),p+=o.shift(),t.U.P.lineTo(a,f,p);else if(T==`o6`||T==`o7`)for(var E=o.length,D=T==`o6`,O=0;O<E;O++){var k=o.shift();D?f+=k:p+=k,D=!D,t.U.P.lineTo(a,f,p)}else if(T==`o8`||T==`o24`){E=o.length;for(var A=0;A+6<=E;)m=f+o.shift(),h=p+o.shift(),g=m+o.shift(),_=h+o.shift(),f=g+o.shift(),p=_+o.shift(),t.U.P.curveTo(a,m,h,g,_,f,p),A+=6;T==`o24`&&(f+=o.shift(),p+=o.shift(),t.U.P.lineTo(a,f,p))}else{if(T==`o11`)break;if(T==`o1234`||T==`o1235`||T==`o1236`||T==`o1237`)T==`o1234`&&(h=p,g=(m=f+o.shift())+o.shift(),C=_=h+o.shift(),y=_,x=p,f=(b=(v=(S=g
600+o.shift())+o.shift())+o.shift())+o.shift(),t.U.P.curveTo(a,m,h,g,_,S,C),t.U.P.curveTo(a,v,y,b,x,f,p)),T==`o1235`&&(m=f+o.shift(),h=p+o.shift(),g=m+o.shift(),_=h+o.shift(),S=g+o.shift(),C=_+o.shift(),v=S+o.shift(),y=C+o.shift(),b=v+o.shift(),x=y+o.shift(),f=b+o.shift(),p=x+o.shift(),o.shift(),t.U.P.curveTo(a,m,h,g,_,S,C),t.U.P.curveTo(a,v,y,b,x,f,p)),T==`o1236`&&(m=f+o.shift(),h=p+o.shift(),g=m+o.shift(),C=_=h+o.shift(),y=_,b=(v=(S=g+o.shift())+o.shift())+o.shift(),x=y+o.shift(),f=b+o.shift(),t.U.P.curveTo(a,m,h,g,_,S,C),t.U.P.curveTo(a,v,y,b,x,f,p)),T==`o1237`&&(m=f+o.shift(),h=p+o.shift(),g=m+o.shift(),_=h+o.shift(),S=g+o.shift(),C=_+o.shift(),v=S+o.shift(),y=C+o.shift(),b=v+o.shift(),x=y+o.shift(),Math.abs(b-f)>Math.abs(x-p)?f=b+o.shift():p=x+o.shift(),t.U.P.curveTo(a,m,h,g,_,S,C),t.U.P.curveTo(a,v,y,b,x,f,p));else if(T==`o14`){if(o.length>0&&!c&&(l=o.shift()+r.nominalWidthX,c=!0),o.length==4){var ee=o.shift(),j=o.shift(),M=o.shift(),te=o.shift(),ne=t.CFF.glyphBySE(r,M),N=t.CFF.glyphBySE(r,te);t.U._drawCFF(r.CharStrings[ne],n,r,i,a),n.x=ee,n.y=j,t.U._drawCFF(r.CharStrings[N],n,r,i,a)}u&&=(t.U.P.closePath(a),!1)}else if(T==`o19`||T==`o20`)o.length%2!=0&&!c&&(l=o.shift()+i.nominalWidthX),s+=o.length>>1,o.length=0,c=!0,d+=s+7>>3;else if(T==`o21`)o.length>2&&!c&&(l=o.shift()+i.nominalWidthX,c=!0),p+=o.pop(),f+=o.pop(),u&&t.U.P.closePath(a),t.U.P.moveTo(a,f,p),u=!0;else if(T==`o22`)o.length>1&&!c&&(l=o.shift()+i.nominalWidthX,c=!0),f+=o.pop(),u&&t.U.P.closePath(a),t.U.P.moveTo(a,f,p),u=!0;else if(T==`o25`){for(;o.length>6;)f+=o.shift(),p+=o.shift(),t.U.P.lineTo(a,f,p);m=f+o.shift(),h=p+o.shift(),g=m+o.shift(),_=h+o.shift(),f=g+o.shift(),p=_+o.shift(),t.U.P.curveTo(a,m,h,g,_,f,p)}else if(T==`o26`)for(o.length%2&&(f+=o.shift());o.length>0;)m=f,h=p+o.shift(),f=g=m+o.shift(),p=(_=h+o.shift())+o.shift(),t.U.P.curveTo(a,m,h,g,_,f,p);else if(T==`o27`)for(o.length%2&&(p+=o.shift());o.length>0;)h=p,g=(m=f+o.shift())+o.shift(),_=h+o.shift(),f=g+o.shift(),p=_,t.U.P.curveTo(a,m,h,g,_,f,p);else if(T==`o10`||T==`o29`){var P=T==`o10`?i:r;if(o.length==0)console.debug(`error: empty stack`);else{var re=o.pop(),ie=P.Subrs[re+P.Bias];n.x=f,n.y=p,n.nStems=s,n.haveWidth=c,n.width=l,n.open=u,t.U._drawCFF(ie,n,r,i,a),f=n.x,p=n.y,s=n.nStems,c=n.haveWidth,l=n.width,u=n.open}}else if(T==`o30`||T==`o31`){var F=o.length,ae=(A=0,T==`o31`);for(A+=F-(E=-3&F);A<E;)ae?(h=p,g=(m=f+o.shift())+o.shift(),p=(_=h+o.shift())+o.shift(),E-A==5?(f=g+o.shift(),A++):f=g,ae=!1):(m=f,h=p+o.shift(),g=m+o.shift(),_=h+o.shift(),f=g+o.shift(),E-A==5?(p=_+o.shift(),A++):p=_,ae=!0),t.U.P.curveTo(a,m,h,g,_,f,p),A+=4}else{if((T+``).charAt(0)==`o`)throw console.debug(`Unknown operation: `+T,e),T;o.push(T)}}}n.x=f,n.y=p,n.nStems=s,n.haveWidth=c,n.width=l,n.open=u};var n=t,r={Typr:n};return e.Typr=n,e.default=r,Object.defineProperty(e,"__esModule",{value:!0}),e}({}).Typr}function Lbe(){return function(e){var t=Uint8Array,n=Uint16Array,r=Uint32Array,i=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(e,t){for(var i=new n(31),a=0;a<31;++a)i[a]=t+=1<<e[a-1];var o=new r(i[30]);for(a=1;a<30;++a)for(var s=i[a];s<i[a+1];++s)o[s]=s-i[a]<<5|a;return[i,o]},c=s(i,2),l=c[0],u=c[1];l[28]=258,u[258]=28;for(var d=s(a,0)[0],f=new n(32768),p=0;p<32768;++p){var m=(43690&p)>>>1|(21845&p)<<1;m=(61680&(m=(52428&m)>>>2|(13107&m)<<2))>>>4|(3855&m)<<4,f[p]=((65280&m)>>>8|(255&m)<<8)>>>1}var h=function(e,t,r){for(var i=e.length,a=0,o=new n(t);a<i;++a)++o[e[a]-1];var s,c=new n(t);for(a=0;a<t;++a)c[a]=c[a-1]+o[a-1]<<1;if(r){s=new n(1<<t);var l=15-t;for(a=0;a<i;++a)if(e[a])for(var u=a<<4|e[a],d=t-e[a],p=c[e[a]-1]++<<d,m=p|(1<<d)-1;p<=m;++p)s[f[p]>>>l]=u}else for(s=new n(i),a=0;a<i;++a)e[a]&&(s[a]=f[c[e[a]-1]++]>>>15-e[a]);return s},g=new t(288);for(p=0;p<144;++p)g[p]=8;for(p=144;p<256;++p)g[p]=9;for(p=256;p<280;++p)g[p]=7;for(p=280;p<288;++p)g[p]=8;var _=new t(32);for(p=0;p<32;++p)_[p]=5;var v=h(g,9,1),y=h(_,5,1),b=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},x=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},S=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},C=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],w=function(e,t,n){var r=Error(t||C[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,w),!n)throw r;return r},T=function(e,s,c){var u=e.length;if(!u||c&&!c.l&&u<5)return s||new t(0);var f=!s||c,p=!c||c.i;c||={}
600,s||=new t(3*u);var m,g=function(e){var n=s.length;if(e>n){var r=new t(Math.max(2*n,e));r.set(s),s=r}},_=c.f||0,C=c.p||0,T=c.b||0,E=c.l,D=c.d,O=c.m,k=c.n,A=8*u;do{if(!E){c.f=_=x(e,C,1);var ee=x(e,C+1,3);if(C+=3,!ee){var j=e[(L=((m=C)/8|0)+(7&m&&1)+4)-4]|e[L-3]<<8,M=L+j;if(M>u){p&&w(0);break}f&&g(T+j),s.set(e.subarray(L,M),T),c.b=T+=j,c.p=C=8*M;continue}if(ee==1)E=v,D=y,O=9,k=5;else if(ee==2){var te=x(e,C,31)+257,ne=x(e,C+10,15)+4,N=te+x(e,C+5,31)+1;C+=14;for(var P=new t(N),re=new t(19),ie=0;ie<ne;++ie)re[o[ie]]=x(e,C+3*ie,7);C+=3*ne;var F=b(re),ae=(1<<F)-1,I=h(re,F,1);for(ie=0;ie<N;){var L,oe=I[x(e,C,ae)];if(C+=15&oe,(L=oe>>>4)<16)P[ie++]=L;else{var R=0,se=0;for(L==16?(se=3+x(e,C,3),C+=2,R=P[ie-1]):L==17?(se=3+x(e,C,7),C+=3):L==18&&(se=11+x(e,C,127),C+=7);se--;)P[ie++]=R}}var ce=P.subarray(0,te),le=P.subarray(te);O=b(ce),k=b(le),E=h(ce,O,1),D=h(le,k,1)}else w(1);if(C>A){p&&w(0);break}}f&&g(T+131072);for(var ue=(1<<O)-1,de=(1<<k)-1,z=C;;z=C){var fe=(R=E[S(e,C)&ue])>>>4;if((C+=15&R)>A){p&&w(0);break}if(R||w(2),fe<256)s[T++]=fe;else{if(fe==256){z=C,E=null;break}var pe=fe-254;if(fe>264){var B=i[ie=fe-257];pe=x(e,C,(1<<B)-1)+l[ie],C+=B}var me=D[S(e,C)&de],V=me>>>4;if(me||w(3),C+=15&me,le=d[V],V>3&&(B=a[V],le+=S(e,C)&(1<<B)-1,C+=B),C>A){p&&w(0);break}f&&g(T+131072);for(var he=T+pe;T<he;T+=4)s[T]=s[T-le],s[T+1]=s[T+1-le],s[T+2]=s[T+2-le],s[T+3]=s[T+3-le];T=he}}c.l=E,c.p=z,c.b=T,E&&(_=1,c.m=O,c.d=D,c.n=k)}while(!_);return T==s.length?s:function(e,i,a){(i==null||i<0)&&(i=0),(a==null||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof r?r:t)(a-i);return o.set(e.subarray(i,a)),o}(s,0,T)},E=new t(0),D=typeof TextDecoder<`u`&&new TextDecoder;try{D.decode(E,{stream:!0})}catch{}return e.convert_streams=function(e){var t=new DataView(e),n=0;function r(){var e=t.getUint16(n);return n+=2,e}function i(){var e=t.getUint32(n);return n+=4,e}function a(e){_.setUint16(v,e),v+=2}function o(e){_.setUint32(v,e),v+=4}for(var s={signature:i(),flavor:i(),length:i(),numTables:r(),reserved:r(),totalSfntSize:i(),majorVersion:r(),minorVersion:r(),metaOffset:i(),metaLength:i(),metaOrigLength:i(),privOffset:i(),privLength:i()},c=0;2**c<=s.numTables;)c++;c--;for(var l=16*2**c,u=16*s.numTables-l,d=12,f=[],p=0;p<s.numTables;p++)f.push({tag:i(),offset:i(),compLength:i(),origLength:i(),origChecksum:i()}),d+=16;var m,h=new Uint8Array(12+16*f.length+f.reduce((function(e,t){return e+t.origLength+4}),0)),g=h.buffer,_=new DataView(g),v=0;return o(s.flavor),a(s.numTables),a(l),a(c),a(u),f.forEach((function(e){o(e.tag),o(e.origChecksum),o(d),o(e.origLength),e.outOffset=d,(d+=e.origLength)%4!=0&&(d+=4-d%4)})),f.forEach((function(t){var n,r=e.slice(t.offset,t.offset+t.compLength);if(t.compLength!=t.origLength){var i=new Uint8Array(t.origLength);n=new Uint8Array(r,2),T(n,i)}else i=new Uint8Array(r);h.set(i,t.outOffset);var a=0;(d=t.outOffset+t.origLength)%4!=0&&(a=4-d%4),h.set(new Uint8Array(a).buffer,t.outOffset+t.origLength),m=d+a})),g.slice(0,m)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}).convert_streams}function Rbe(e,t){let n={M:2,L:2,Q:4,C:6,Z:0},r={C:`18g,ca,368,1kz`,D:`17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v`,R:`17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6`,L:`x9u,jff,a,fd,jv`,T:`4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n`},i;function a(e){if(!i){let e={R:2,L:1,D:4,C:16,U:32,T:8};i=new Map;for(let t in r){let n=0;r[t].split(`,`).forEach(r=>{let[a,o]=r.split(`+`);a=parseInt(a,36),o=o?parseInt(o,36):0,i.set(n+=a,e[t]);for(let r=o;r--;)i.set(++n,e[t])})}}return i.get(e)||32}let o=[null,`isol`,`init`,`fina`,`medi`];function s(e){let t=new Uint8Array(e.length),n=32,r=1,i=-1;for(let o=0;o<e.length;o++){let s=e.codePointAt(o),c=a(s)|0,l=1;c&8||(n&21?c&22?(l=3,(r===1||r===3)&&t[i]++):c&33&&(r===2||r===4)&&t[i]--:n&34&&(r===2||r===4)&&t[i]--,r=t[o]=l,n=c,i=o,s>65535&&o++)}return t}function c(t,n){let r=[];for(let i=0;i<n.length;i++){let a=n.codePointAt(i);a>65535&&i++,r.push(e.U.codeToGlyph(t,a))}let i=t.GSUB;if(i){let{lookupList:t,featureList:a}=i,c,l=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,u=[];a.forEach(i=>
600{if(l.test(i.tag))for(let a=0;a<i.tab.length;a++){if(u[i.tab[a]])continue;u[i.tab[a]]=!0;let l=t[i.tab[a]],d=/^(isol|init|fina|medi)$/.test(i.tag);d&&!c&&(c=s(n));for(let n=0;n<r.length;n++)(!c||!d||o[c[n]]===i.tag)&&e.U._applySubs(r,n,l,t)}})}return r}function l(t,n){let r=new Int16Array(n.length*3),i=0;for(;i<n.length;i++){let c=n[i];if(c===-1)continue;r[i*3+2]=t.hmtx.aWidth[c];let l=t.GPOS;if(l){let d=l.lookupList;for(let l=0;l<d.length;l++){let f=d[l];for(let l=0;l<f.tabs.length;l++){let d=f.tabs[l];if(f.ltype===1){if(e._lctf.coverageIndex(d.coverage,c)!==-1&&d.pos){s(d.pos,i);break}}else if(f.ltype===2){let t=null,r=a();if(r!==-1){let a=e._lctf.coverageIndex(d.coverage,n[r]);if(a!==-1){if(d.fmt===1){let e=d.pairsets[a];for(let n=0;n<e.length;n++)e[n].gid2===c&&(t=e[n])}else if(d.fmt===2){let i=e.U._getGlyphClass(n[r],d.classDef1),a=e.U._getGlyphClass(c,d.classDef2);t=d.matrix[i][a]}if(t){t.val1&&s(t.val1,r),t.val2&&s(t.val2,i);break}}}}else if(f.ltype===4){let t=e._lctf.coverageIndex(d.markCoverage,c);if(t!==-1){let s=a(o),c=s===-1?-1:e._lctf.coverageIndex(d.baseCoverage,n[s]);if(c!==-1){let e=d.markArray[t],n=d.baseArray[c][e.markClass];r[i*3]=n.x-e.x+r[s*3]-r[s*3+2],r[i*3+1]=n.y-e.y+r[s*3+1];break}}}else if(f.ltype===6){let o=e._lctf.coverageIndex(d.mark1Coverage,c);if(o!==-1){let s=a();if(s!==-1){let a=n[s];if(u(t,a)===3){let t=e._lctf.coverageIndex(d.mark2Coverage,a);if(t!==-1){let e=d.mark1Array[o],n=d.mark2Array[t][e.markClass];r[i*3]=n.x-e.x+r[s*3]-r[s*3+2],r[i*3+1]=n.y-e.y+r[s*3+1];break}}}}}}}}else if(t.kern&&!t.cff){let e=a();if(e!==-1){let i=t.kern.glyph1.indexOf(n[e]);if(i!==-1){let n=t.kern.rval[i].glyph2.indexOf(c);n!==-1&&(r[e*3+2]+=t.kern.rval[i].vals[n])}}}}return r;function a(e){for(let t=i-1;t>=0;t--)if(n[t]!==-1&&(!e||e(n[t])))return t;return-1}function o(e){return u(t,e)===1}function s(e,t){for(let n=0;n<3;n++)r[t*3+n]+=e[n]||0}}function u(t,n){let r=t.GDEF&&t.GDEF.glyphClassDef;return r?e.U._getGlyphClass(n,r):0}function d(...e){for(let t=0;t<e.length;t++)if(typeof e[t]==`number`)return e[t]}function f(t){let r=Object.create(null),i=t[`OS/2`],a=t.hhea,o=t.head.unitsPerEm,s=d(i&&i.sTypoAscender,a&&a.ascender,o),u={unitsPerEm:o,ascender:s,descender:d(i&&i.sTypoDescender,a&&a.descender,0),capHeight:d(i&&i.sCapHeight,s),xHeight:d(i&&i.sxHeight,s),lineGap:d(i&&i.sTypoLineGap,a&&a.lineGap),supportsCodePoint(n){return e.U.codeToGlyph(t,n)>0},forEachGlyph(i,a,o,s){let d=0,f=1/u.unitsPerEm*a,p=c(t,i),m=0,h=l(t,p);return p.forEach((c,l)=>{if(c!==-1){let i=r[c];if(!i){let{cmds:a,crds:o}=e.U.glyphToPath(t,c),s=``,l=0;for(let e=0,t=a.length;e<t;e++){let t=n[a[e]];s+=a[e];for(let e=1;e<=t;e++)s+=(e>1?`,`:``)+o[l++]}let u,d,f,p;if(o.length){u=d=1/0,f=p=-1/0;for(let e=0,t=o.length;e<t;e+=2){let t=o[e],n=o[e+1];t<u&&(u=t),n<d&&(d=n),t>f&&(f=t),n>p&&(p=n)}}else u=f=d=p=0;i=r[c]={index:c,advanceWidth:t.hmtx.aWidth[c],xMin:u,yMin:d,xMax:f,yMax:p,path:s}}s.call(null,i,d+h[l*3]*f,h[l*3+1]*f,m),d+=h[l*3+2]*f,o&&(d+=o*a)}m+=i.codePointAt(m)>65535?2:1}),d}};return u}return function(n){let r=new Uint8Array(n,0,4),i=e._bin.readASCII(r,0,4);if(i===`wOFF`)n=t(n);else if(i===`wOF2`)throw Error(`woff2 fonts not supported`);return f(e.parse(n)[0])}}var zbe=fE({name:`Typr Font Parser`,dependencies:[Ibe,Lbe,Rbe],init(e,t,n){return n(e(),t())}});function Bbe(){return function(e){var t=function(){this.buckets=new Map};t.prototype.add=function(e){var t=e>>5;this.buckets.set(t,(this.buckets.get(t)||0)|1<<(31&e))},t.prototype.has=function(e){var t=this.buckets.get(e>>5);return t!==void 0&&!!(t&1<<(31&e))},t.prototype.serialize=function(){var e=[];return this.buckets.forEach((function(t,n){e.push((+n).toString(36)+`:`+t.toString(36))})),e.join(`,`)},t.prototype.deserialize=function(e){var t=this;this.buckets.clear(),e.split(`,`).forEach((function(e){var n=e.split(`:`);t.buckets.set(parseInt(n[0],36),parseInt(n[1],36))}))};var n=256,r=n-1,i=~r;function a(e){var t=function(e){return e&i}(e).toString(16),r=function(e){return(e&i)+n-1}(e).toString(16);return`codepoint-index/plane`+(e>>16)+`/`+t+`-`+r+`.json`}function o(e,t){var n=e&r,i=t.codePointAt(n/6|0);return!!((i=(i||48)-48)&1<<n%6)}function s(e,t){var n;(n=e,n.replace(/U\+/gi,``).replace(/^,+|,+$/g,``).split(/,+/).map((function(e){return e.split(`-`).map((function(e){return parseInt(e.trim(),16)}))}
600))).forEach((function(e){var n=e[0],r=e[1];r===void 0&&(r=n),t(n,r)}))}function c(e,t){s(e,(function(e,n){for(var r=e;r<=n;r++)t(r)}))}var l={},u={},d=new WeakMap,f=`https://cdn.jsdelivr.net/gh/lojjic/[email protected]/packages/data`;function p(e){var n=d.get(e);return n||(n=new t,c(e.ranges,(function(e){return n.add(e)})),d.set(e,n)),n}var m,h=new Map;function g(e,t,n){return e[t]?t:e[n]?n:function(e){for(var t in e)return t}(e)}function _(e,t){var n=t;if(!e.includes(n)){n=1/0;for(var r=0;r<e.length;r++)Math.abs(e[r]-t)<Math.abs(n-t)&&(n=e[r])}return n}function v(e){return m||(m=new Set,c(`9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000`,(function(e){m.add(e)}))),m.has(e)}return e.CodePointSet=t,e.clearCache=function(){l={},u={}},e.getFontsForString=function(e,t){t===void 0&&(t={});var n,r=t.lang;r===void 0&&(r=/\p{Script=Hangul}/u.test(n=e)?`ko`:/\p{Script=Hiragana}|\p{Script=Katakana}/u.test(n)?`ja`:`en`);var i=t.category;i===void 0&&(i=`sans-serif`);var s=t.style;s===void 0&&(s=`normal`);var c=t.weight;c===void 0&&(c=400);var d=(t.dataUrl||f).replace(/\/$/g,``),m=new Map,y=new Uint8Array(e.length),b={},x={},S=Array(e.length),C=new Map,w=!1;function T(e){var t=h.get(e);return t||(t=fetch(d+`/`+e).then((function(e){if(!e.ok)throw Error(e.statusText);return e.json().then((function(e){if(!Array.isArray(e)||e[0]!==1)throw Error(`Incorrect schema version; need 1, got `+e[0]);return e[1]}))})).catch((function(t){if(d!==f)return w||=(console.error(`unicode-font-resolver: Failed loading from dataUrl "`+d+`", trying default CDN. `+t.message),!0),d=f,h.delete(e),T(e);throw t})),h.set(e,t)),t}for(var E=function(t){var n=e.codePointAt(t),r=a(n);S[t]=r,l[r]||C.has(r)||C.set(r,T(r).then((function(e){l[r]=e}))),n>65535&&(t++,D=t)},D=0;D<e.length;D++)E(D);return Promise.all(C.values()).then((function(){C.clear();for(var t=function(t){var i=e.codePointAt(t),a=null,s=l[S[t]],c=void 0;for(var d in s){var f=x[d];if(f===void 0&&(f=x[d]=new RegExp(d).test(r||`en`)),f){for(var p in c=d,s[d])if(o(i,s[d][p])){a=p;break}break}}if(!a){t:for(var m in s)if(m!==c){for(var h in s[m])if(o(i,s[m][h])){a=h;break t}}}a||=(console.debug(`No font coverage for U+`+i.toString(16)),`latin`),S[t]=a,u[a]||C.has(a)||C.set(a,T(`font-meta/`+a+`.json`).then((function(e){u[a]=e}))),i>65535&&(t++,n=t)},n=0;n<e.length;n++)t(n);return Promise.all(C.values())})).then((function(){for(var t=null,n=0;n<e.length;n++){var r=e.codePointAt(n);if(t&&(v(r)||p(t).has(r)))y[n]=y[n-1];else{t=u[S[n]];var a=b[t.id];if(!a){var o=t.typeforms,l=g(o,i,`sans-serif`),f=g(o[l],s,`normal`),h=_(o[l]?.[f],c);a=b[t.id]=d+`/font-files/`+t.id+`/`+l+`.`+f+`.`+h+`.woff`}var x=m.get(a);x??(x=m.size,m.set(a,x)),y[n]=x}r>65535&&(n++,y[n]=y[n-1])}return{fontUrls:Array.from(m.keys()),chars:y}}))},Object.defineProperty(e,"__esModule",{value:!0}),e}({})}function Vbe(e,t){let n=Object.create(null),r=Object.create(null);function i(t,n){let r=e=>{console.error(`Failure loading font ${t}`,e)};try{let i=new XMLHttpRequest;i.open(`get`,t,!0),i.responseType=`arraybuffer`,i.onload=function(){if(i.status>=400)r(Error(i.statusText));else if(i.status>0)try{let r=e(i.response);r.src=t,n(r)}catch(e){r(e)}},i.onerror=r,i.send()}catch(e){r(e)}}function a(e,t){let a=n[e];a?t(a):r[e]?r[e].push(t):(r[e]=[t],i(e,t=>{t.src=e,n[e]=t,r[e].forEach(e=>e(t)),delete r[e]}))}return function(e,r,{lang:i,fonts:o=[],style:s=`normal`,weight:c=`normal`,unicodeFontsURL:l}={}){let u=new Uint8Array(e.length),d=[];e.length||h();let f=new Map,p=[];if(s!==`italic`&&(s=`normal`),typeof c!=`number`&&(c=c===`bold`?700:400),o&&!Array.isArray(o)&&(o=[o]),o=o.slice().filter(e=>!e.lang||e.lang.test(i)).reverse(),o.length){let t=0;(function r(i=0){for(let s=i,c=e.length;s<c;s++){let i=e.codePointAt(s);if(t===1&&d[u[s-1]].supportsCodePoint(i)||s>0&&/\s/.test(e[s]))u[s]=u[s-1],t===2&&(p[p.length-1][1]=s);else for(let e=u[s],c=o.length;e<=c;e++)if(e===c){let e=t===2?p[p.length-1]:p[p.length]=[s,s];e[1]=s,t=2}else{u[s]=e;let{src:c,unicodeRange:l}=o[e];if(!l||g(i,l)){let e=n[c];if(!e){a(c,()=>{r(s)});return}if(e.supportsCodePoint(i)){let n=f.get(e);typeof n!=`number`&&(n=d.length,d.push(e),f.set(e,n)),u[s]=n,t=1;break}}}i>65535&&s+1<c&&(u[s+1]=u[s],s++,t===2&&(p[p.length-1][1]=s))}m()})()}else p.push([0,e.length-1]),m();function m(){if(p.length){let n=p.map(t=>e.substring(t[0],t[1]+1)).join(` 601`);t.getFontsForString(n,{lang:i||void 0,style:s,weight:c,dataUrl:l}).then(({fontUrls:e,chars:t})=>{let n=d.length,r=0;
601p.forEach(e=>{for(let i=0,a=e[1]-e[0];i<=a;i++)u[e[0]+i]=t[r++]+n;r++});let i=0;e.forEach((t,r)=>{a(t,t=>{d[r+n]=t,++i===e.length&&h()})})})}else h()}function h(){r({chars:u,fonts:d})}function g(e,t){for(let n=0;n<t.length;n++){let[r,i=r]=t[n];if(r<=e&&e<=i)return!0}return!1}}}var Hbe=fE({name:`FontResolver`,dependencies:[Vbe,zbe,Bbe],init(e,t,n){return e(t,n())}});function Ube(e,t){let n=1/0,r=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,i=`[^\\S\\u00A0]`,a=RegExp(`${i}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function o({text:t,lang:n,fonts:r,style:i,weight:a,preResolvedFonts:o,unicodeFontsURL:s},c){let l=({chars:e,fonts:t})=>{let n,r,i=[];for(let a=0;a<e.length;a++)e[a]===r?n.end=a:(r=e[a],i.push(n={start:a,end:a,fontObj:t[e[a]]}));c(i)};o?l(o):e(t,l,{lang:n,fonts:r,style:i,weight:a,unicodeFontsURL:s})}function s({text:e=``,font:s,lang:c,sdfGlyphSize:p=64,fontSize:m=400,fontWeight:h=1,fontStyle:g=`normal`,letterSpacing:_=0,lineHeight:v=`normal`,maxWidth:y=n,direction:b,textAlign:x=`left`,textIndent:S=0,whiteSpace:C=`normal`,overflowWrap:w=`normal`,anchorX:T=0,anchorY:E=0,metricsOnly:D=!1,unicodeFontsURL:O,preResolvedFonts:k=null,includeCaretPositions:A=!1,chunkedBoundsSize:ee=8192,colorRanges:j=null},M){let te=d(),ne={fontLoad:0,typesetting:0};e.indexOf(`\r`)>-1&&(console.info(`Typesetter: got text with \\r chars; normalizing to \\n`),e=e.replace(/\r\n/g,` 602`).replace(/\r/g,` 603`)),m=+m,_=+_,y=+y,v||=`normal`,S=+S,o({text:e,lang:c,style:g,weight:h,fonts:typeof s==`string`?[{src:s}]:s,unicodeFontsURL:O,preResolvedFonts:k},o=>{ne.fontLoad=d()-te;let s=isFinite(y),c=null,p=null,h=null,g=null,O=null,k=null,N=null,P=null,re=0,ie=0,F=C!==`nowrap`,ae=new Map,I=d(),L=S,oe=0,R=new f,se=[R];o.forEach(t=>{let{fontObj:n}=t,{ascender:o,descender:c,unitsPerEm:l,lineGap:u,capHeight:d,xHeight:p}=n,h=ae.get(n);if(!h){let e=m/l,t=v===`normal`?(o-c+u)*e:v*m,r=(t-(o-c)*e)/2,i=Math.min(t,(o-c)*e),a=(o+c)/2*e+i/2;h={index:ae.size,src:n.src,fontObj:n,fontSizeMult:e,unitsPerEm:l,ascender:o*e,descender:c*e,capHeight:d*e,xHeight:p*e,lineHeight:t,baseline:-r-o*e,caretTop:a,caretBottom:a-i},ae.set(n,h)}let{fontSizeMult:g}=h,b=e.slice(t.start,t.end+1),x,C;n.forEachGlyph(b,m,_,(n,o,c,l)=>{o+=oe,l+=t.start,x=o,C=n;let u=e.charAt(l),d=n.advanceWidth*g,p=R.count,v;if(`isEmpty`in n||(n.isWhitespace=!!u&&RegExp(i).test(u),n.canBreakAfter=!!u&&a.test(u),n.isEmpty=n.xMin===n.xMax||n.yMin===n.yMax||r.test(u)),!n.isWhitespace&&!n.isEmpty&&ie++,F&&s&&!n.isWhitespace&&o+d+L>y&&p){if(R.glyphAt(p-1).glyphObj.canBreakAfter)v=new f,L=-o;else for(let e=p;e--;)if(e===0&&w===`break-word`){v=new f,L=-o;break}else if(R.glyphAt(e).glyphObj.canBreakAfter){v=R.splitAt(e+1);let t=v.glyphAt(0).x;L-=t;for(let e=v.count;e--;)v.glyphAt(e).x-=t;break}v&&(R.isSoftWrapped=!0,R=v,se.push(R),re=y)}let b=R.glyphAt(R.count);b.glyphObj=n,b.x=o+L,b.y=c,b.width=d,b.charIndex=l,b.fontData=h,u===` 604`&&(R=new f,se.push(R),L=-(o+d+_*m)+S)}),oe=x+C.advanceWidth*g+_*m});let ce=0;se.forEach(e=>{let t=!0;for(let n=e.count;n--;){let r=e.glyphAt(n);t&&!r.glyphObj.isWhitespace&&(e.width=r.x+r.width,e.width>re&&(re=e.width),t=!1);let{lineHeight:i,capHeight:a,xHeight:o,baseline:s}=r.fontData;i>e.lineHeight&&(e.lineHeight=i);let c=s-e.baseline;c<0&&(e.baseline+=c,e.cap+=c,e.ex+=c),e.cap=Math.max(e.cap,e.baseline+a),e.ex=Math.max(e.ex,e.baseline+o)}e.baseline-=ce,e.cap-=ce,e.ex-=ce,ce+=e.lineHeight});let le=0,ue=0;if(T&&(typeof T==`number`?le=-T:typeof T==`string`&&(le=-re*(T===`left`?0:T===`center`?.5:T===`right`?1:l(T)))),E&&(typeof E==`number`?ue=-E:typeof E==`string`&&(ue=E===`top`?0:E===`top-baseline`?-se[0].baseline:E===`top-cap`?-se[0].cap:E===`top-ex`?-se[0].ex:E===`middle`?ce/2:E===`bottom`?ce:E===`bottom-baseline`?-se[se.length-1].baseline:l(E)*ce)),!D){let r=t.getEmbeddingLevels(e,b);c=new Uint16Array(ie),p=new Uint8Array(ie),h=new Float32Array(ie*2),g={},N=[n,n,-1/0,-1/0],P=[],A&&(k=new Float32Array(e.length*4)),j&&(O=new Uint8Array(ie*3));let i=0,a=-1,o=-1,s,l;if(se.forEach((d,f)=>{let{count:m,width:_}=d;if(m>0){let f=0;for(let e=m;e--&&d.glyphAt(e).glyphObj.isWhitespace;)f++;let v=0,y=0;if(x===`center`)v=(re-_)/2;else if(x===`right`)v=re-_;else if(x===`justify`&&d.isSoftWrapped){let e=0;for(let t=m-f;t--;)d.glyphAt(t).glyphObj.isWhitespace&&e++;y=(re-_)/e}if(y||v){let e=0;for(let t=0;t<m;t++){let n=d.glyphAt(t),r=n.glyphObj;n.x+=v+e,y!==0&&r.isWhitespace&&t<m-f&&(e+=y,n.width+=y)}}let b=t.getReorderSegments(e,r,d.glyphAt(0).charIndex,d.glyphAt(d.count-1).charIndex);for(let e=0;e<b.length;e++){let[t,n]=b[e],r=1/0,i=-1/0;for(let e=0;e<m;e++)if(d.glyphAt(e).charIndex>=t){let t=e,a=e;for(;a<m;
604a++){let e=d.glyphAt(a);if(e.charIndex>n)break;a<m-f&&(r=Math.min(r,e.x),i=Math.max(i,e.x+e.width))}for(let e=t;e<a;e++){let t=d.glyphAt(e);t.x=i-(t.x+t.width-r)}break}}let S,C=e=>S=e;for(let f=0;f<m;f++){let m=d.glyphAt(f);S=m.glyphObj;let _=S.index,v=r.levels[m.charIndex]&1;if(v){let n=t.getMirroredCharacter(e[m.charIndex]);n&&m.fontData.fontObj.forEachGlyph(n,0,0,C)}if(A){let{charIndex:e,fontData:t}=m,n=m.x+le,r=m.x+m.width+le;k[e*4]=v?r:n,k[e*4+1]=v?n:r,k[e*4+2]=d.baseline+t.caretBottom+ue,k[e*4+3]=d.baseline+t.caretTop+ue;let i=e-a;i>1&&u(k,a,i),a=e}if(j){let{charIndex:e}=m;for(;e>o;)o++,j.hasOwnProperty(o)&&(l=j[o])}if(!S.isWhitespace&&!S.isEmpty){let e=i++,{fontSizeMult:t,src:r,index:a}=m.fontData,o=g[r]||(g[r]={});o[_]||(o[_]={path:S.path,pathBounds:[S.xMin,S.yMin,S.xMax,S.yMax]});let u=m.x+le,f=m.y+d.baseline+ue;h[e*2]=u,h[e*2+1]=f;let v=u+S.xMin*t,y=f+S.yMin*t,b=u+S.xMax*t,x=f+S.yMax*t;v<N[0]&&(N[0]=v),y<N[1]&&(N[1]=y),b>N[2]&&(N[2]=b),x>N[3]&&(N[3]=x),e%ee===0&&(s={start:e,end:e,rect:[n,n,-1/0,-1/0]},P.push(s)),s.end++;let C=s.rect;if(v<C[0]&&(C[0]=v),y<C[1]&&(C[1]=y),b>C[2]&&(C[2]=b),x>C[3]&&(C[3]=x),c[e]=_,p[e]=a,j){let t=e*3;O[t]=l>>16&255,O[t+1]=l>>8&255,O[t+2]=l&255}}}}}),k){let t=e.length-a;t>1&&u(k,a,t)}}let de=[];ae.forEach(({index:e,src:t,unitsPerEm:n,ascender:r,descender:i,lineHeight:a,capHeight:o,xHeight:s})=>{de[e]={src:t,unitsPerEm:n,ascender:r,descender:i,lineHeight:a,capHeight:o,xHeight:s}}),ne.typesetting=d()-I,M({glyphIds:c,glyphFontIndices:p,glyphPositions:h,glyphData:g,fontData:de,caretPositions:k,glyphColors:O,chunkedBounds:P,fontSize:m,topBaseline:ue+se[0].baseline,blockBounds:[le,ue-ce,le+re,ue],visibleBounds:N,timings:ne})})}function c(e,t){s({...e,metricsOnly:!0},e=>{let[n,r,i,a]=e.blockBounds;t({width:i-n,height:a-r})})}function l(e){let t=e.match(/^([\d.]+)%$/),n=t?parseFloat(t[1]):NaN;return isNaN(n)?0:n/100}function u(e,t,n){let r=e[t*4],i=e[t*4+1],a=e[t*4+2],o=e[t*4+3],s=(i-r)/n;for(let i=0;i<n;i++){let n=(t+i)*4;e[n]=r+s*i,e[n+1]=r+s*(i+1),e[n+2]=a,e[n+3]=o}}function d(){return(self.performance||Date).now()}function f(){this.data=[]}let p=[`glyphObj`,`x`,`y`,`width`,`charIndex`,`fontData`];return f.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/p.length)},glyphAt(e){let t=f.flyweight;return t.data=this.data,t.index=e,t},splitAt(e){let t=new f;return t.data=this.data.splice(e*p.length),t}},f.flyweight=p.reduce((e,t,n,r)=>(Object.defineProperty(e,t,{get(){return this.data[this.index*p.length+n]},set(e){this.data[this.index*p.length+n]=e}}),e),{data:null,index:0}),{typeset:s,measure:c}}var TE=()=>(self.performance||Date).now(),EE=hE(),Wbe;function Gbe(e,t,n,r,i,a,o,s,c,l,u=!0){return u?qbe(e,t,n,r,i,a,o,s,c,l).then(null,u=>(Wbe||=(console.warn(`WebGL SDF generation failed, falling back to JS`,u),!0),jE(e,t,n,r,i,a,o,s,c,l))):jE(e,t,n,r,i,a,o,s,c,l)}var DE=[],Kbe=5,OE=0;function kE(){let e=TE();for(;DE.length&&TE()-e<Kbe;)DE.shift()();OE=DE.length?setTimeout(kE,0):0}var qbe=(...e)=>new Promise((t,n)=>{DE.push(()=>{let r=TE();try{EE.webgl.generateIntoCanvas(...e),t({timing:TE()-r})}catch(e){n(e)}}),OE||=setTimeout(kE,0)}),Jbe=4,Ybe=2e3,AE={},Xbe=0;function jE(e,t,n,r,i,a,o,s,c,l){let u=`TroikaTextSDFGenerator_JS_`+Xbe++%Jbe,d=AE[u];return d||=AE[u]={workerModule:fE({name:u,workerId:u,dependencies:[hE,TE],init(e,t){let n=e().javascript.generate;return function(...e){let r=t();return{textureData:n(...e),timing:t()-r}}},getTransferables(e){return[e.textureData.buffer]}}),requests:0,idleTimer:null},d.requests++,clearTimeout(d.idleTimer),d.workerModule(e,t,n,r,i,a).then(({textureData:n,timing:r})=>{let i=TE(),a=new Uint8Array(n.length*4);for(let e=0;e<n.length;e++)a[e*4+l]=n[e];return EE.webglUtils.renderImageData(o,a,s,c,e,t,1<<3-l),r+=TE()-i,--d.requests===0&&(d.idleTimer=setTimeout(()=>{Ebe(u)},Ybe)),{timing:r}})}function Zbe(e){e._warm||=(EE.webgl.isSupported(e),!0)}var Qbe=EE.webglUtils.resizeWebGLCanvasWithoutClearing,ME={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},$be=new ot;function NE(){return(self.performance||Date).now()}var PE=Object.create(null);function FE(e,t){e=nxe({},e);let n=NE(),{defaultFontURL:r}=ME,i=[];if(r&&i.push({label:`default`,src:RE(r)}),e.font&&i.push({label:`user`,src:RE(e.font)}),e.font=i,e.text=``+e.text,e.sdfGlyphSize=e.sdfGlyphSize||ME.sdfGlyphSize,e.unicodeFontsURL=e.unicodeFontsURL||ME.unicodeFontsURL,e.colorRanges!=null){let t={};for(let n in e.colorRanges)if(e.colorRanges.hasOwnProperty(n)){let r=e.colorRanges[n];typeof r!=`number`&&(r=$be.set(r).getHex()),t[n]=r}e.colorRanges=t}Object.freeze(e);let{textureWidth:a,sdfExponent:o}=ME,{sdfGlyphSize:s}=e,c=a/s*4,l=PE[s];if(!l){let e=document.createElement(`canvas`);e.width=a,e.height=s*256/c,l=PE[s]={glyphCount:0,sdfGlyphSize:s,sdfCanvas:e,sdfTexture:new ct(e,void 0,void 0,void 0,xt,xt),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,exe(l)}let{sdfTexture:u,sdfCanvas:d}=l;(ME.useWorker?BE:rxe)(e).then(r=>{let{glyphIds:i,glyphFontIndices:f,fontData:p,glyphPositions:m,fontSize:h,timings:g}=r,_=[],v=new Float32Array(i.length*4),y=0,b=0,x=NE(),S=p.map(e=>{let t=l.glyphsByFont.get(e.src);return t||l.glyphsByFont.set(e.src,t=new Map),t});
604i.forEach((e,t)=>{let n=f[t],{src:a,unitsPerEm:o}=p[n],c=S[n].get(e);if(!c){let{path:t,pathBounds:i}=r.glyphData[a][e],o=Math.max(i[2]-i[0],i[3]-i[1])/s*(ME.sdfMargin*s+.5),u=l.glyphCount++,d=[i[0]-o,i[1]-o,i[2]+o,i[3]+o];S[n].set(e,c={path:t,atlasIndex:u,sdfViewBox:d}),_.push(c)}let{sdfViewBox:u}=c,d=m[b++],g=m[b++],x=h/o;v[y++]=d+u[0]*x,v[y++]=g+u[1]*x,v[y++]=d+u[2]*x,v[y++]=g+u[3]*x,i[t]=c.atlasIndex}),g.quads=(g.quads||0)+(NE()-x);let C=NE();g.sdf={};let w=d.height,T=Math.ceil(l.glyphCount/c),E=2**Math.ceil(Math.log2(T*s));E>w&&(console.info(`Increasing SDF texture size ${w}->${E}`),Qbe(d,a,E),u.dispose()),Promise.all(_.map(t=>IE(t,l,e.gpuAccelerateSDF).then(({timing:e})=>{g.sdf[t.atlasIndex]=e}))).then(()=>{_.length&&!l.contextLost&&(zE(l),u.needsUpdate=!0),g.sdfTotal=NE()-C,g.total=NE()-n,t(Object.freeze({parameters:e,sdfTexture:u,sdfGlyphSize:s,sdfExponent:o,glyphBounds:v,glyphAtlasIndices:i,glyphColors:r.glyphColors,caretPositions:r.caretPositions,chunkedBounds:r.chunkedBounds,ascender:r.ascender,descender:r.descender,lineHeight:r.lineHeight,capHeight:r.capHeight,xHeight:r.xHeight,topBaseline:r.topBaseline,blockBounds:r.blockBounds,visibleBounds:r.visibleBounds,timings:r.timings}))})}),Promise.resolve().then(()=>{l.contextLost||Zbe(d)})}function IE({path:e,atlasIndex:t,sdfViewBox:n},{sdfGlyphSize:r,sdfCanvas:i,contextLost:a},o){if(a)return Promise.resolve({timing:-1});let{textureWidth:s,sdfExponent:c}=ME,l=Math.max(n[2]-n[0],n[3]-n[1]),u=Math.floor(t/4);return Gbe(r,r,e,n,l,c,i,u%(s/r)*r,Math.floor(u/(s/r))*r,t%4,o)}function exe(e){let t=e.sdfCanvas;t.addEventListener(`webglcontextlost`,t=>{console.log(`Context Lost`,t),t.preventDefault(),e.contextLost=!0}),t.addEventListener(`webglcontextrestored`,t=>{console.log(`Context Restored`,t),e.contextLost=!1;let n=[];e.glyphsByFont.forEach(t=>{t.forEach(t=>{n.push(IE(t,e,!0))})}),Promise.all(n).then(()=>{zE(e),e.sdfTexture.needsUpdate=!0})})}function txe({font:e,characters:t,sdfGlyphSize:n},r){FE({font:e,sdfGlyphSize:n,text:Array.isArray(t)?t.join(` 605`):``+t},r)}function nxe(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var LE;function RE(e){return LE||=typeof document>`u`?{}:document.createElement(`a`),LE.href=e,LE.href}function zE(e){if(typeof createImageBitmap!=`function`){console.info(`Safari<15: applying SDF canvas workaround`);let{sdfCanvas:t,sdfTexture:n}=e,{width:r,height:i}=t,a=e.sdfCanvas.getContext(`webgl`),o=n.image.data;(!o||o.length!==r*i*4)&&(o=new Uint8Array(r*i*4),n.image={width:r,height:i,data:o},n.flipY=!1,n.isDataTexture=!0),a.readPixels(0,0,r,i,a.RGBA,a.UNSIGNED_BYTE,o)}}var BE=fE({name:`Typesetter`,dependencies:[fE({name:`Typesetter`,dependencies:[Ube,Hbe,Obe],init(e,t,n){return e(t,n())}})],init(e){return function(t){return new Promise(n=>{e.typeset(t,n)})}},getTransferables(e){let t=[];for(let n in e)e[n]&&e[n].buffer&&t.push(e[n].buffer);return t}}),rxe=BE.onMainThread,VE={};function ixe(e){let t=VE[e];return t||=VE[e]=new nn(1,1,e,e).translate(.5,.5,0),t}var axe=`aTroikaGlyphBounds`,HE=`aTroikaGlyphIndex`,oxe=`aTroikaGlyphColor`,sxe=class extends Cr{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new $t,this.boundingBox=new Or}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!=`number`||e<1)&&(e=1);let t=ixe(e);[`position`,`normal`,`uv`].forEach(e=>{this.attributes[e]=t.attributes[e].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,n,r,i){this.updateAttributeData(axe,e,4),this.updateAttributeData(HE,t,1),this.updateAttributeData(oxe,i,3),this._blockBounds=n,this._chunkedBounds=r,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){let e=this._blockBounds;if(e){let{curveRadius:t,boundingBox:n}=this;if(t){let{PI:r,floor:i,min:a,max:o,sin:s,cos:c}=Math,l=r/2,u=r*2,d=Math.abs(t),f=e[0]/d,p=e[2]/d,m=i((f+l)/u)===i((p+l)/u)?a(s(f)*d,s(p)*d):-d,h=i((f-l)/u)===i((p-l)/u)?o(s(f)*d,s(p)*d):d,g=i((f+r)/u)===i((p+r)/u)?o(d-c(f)*d,d-c(p)*d):d*2;n.min.set(m,e[1],t<0?-g:0),n.max.set(h,e[3],t<0?0:g)}else n.min.set(e[0],e[1],0),n.max.set(e[2],e[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(HE).count,n=this._chunkedBounds;if(n)for(let r=n.length;r--;){t=n[r].end;let i=n[r].rect;if(i[1]<e.w&&i[3]>
605e.y&&i[0]<e.z&&i[2]>e.x)break}this.instanceCount=t}updateAttributeData(e,t,n){let r=this.getAttribute(e);t?r&&r.array.length===t.length?(r.array.set(t),r.needsUpdate=!0):(this.setAttribute(e,new En(t,n)),delete this._maxInstanceCount,this.dispose()):r&&this.deleteAttribute(e)}},cxe=` 606uniform vec2 uTroikaSDFTextureSize; 607uniform float uTroikaSDFGlyphSize; 608uniform vec4 uTroikaTotalBounds; 609uniform vec4 uTroikaClipRect; 610uniform mat3 uTroikaOrient; 611uniform bool uTroikaUseGlyphColors; 612uniform float uTroikaEdgeOffset; 613uniform float uTroikaBlurRadius; 614uniform vec2 uTroikaPositionOffset; 615uniform float uTroikaCurveRadius; 616attribute vec4 aTroikaGlyphBounds; 617attribute float aTroikaGlyphIndex; 618attribute vec3 aTroikaGlyphColor; 619varying vec2 vTroikaGlyphUV; 620varying vec4 vTroikaTextureUVBounds; 621varying float vTroikaTextureChannel; 622varying vec3 vTroikaGlyphColor; 623varying vec2 vTroikaGlyphDimensions; 624`,lxe=` 625vec4 bounds = aTroikaGlyphBounds; 626bounds.xz += uTroikaPositionOffset.x; 627bounds.yw -= uTroikaPositionOffset.y; 628 629vec4 outlineBounds = vec4( 630 bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius, 631 bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius 632); 633vec4 clippedBounds = vec4( 634 clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw), 635 clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw) 636); 637 638vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy); 639 640position.xy = mix(bounds.xy, bounds.zw, clippedXY); 641 642uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy); 643 644float rad = uTroikaCurveRadius; 645if (rad != 0.0) { 646 float angle = position.x / rad; 647 position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad); 648 normal.xz = vec2(sin(angle), cos(angle)); 649} 650 651position = uTroikaOrient * position; 652normal = uTroikaOrient * normal; 653 654vTroikaGlyphUV = clippedXY.xy; 655vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]); 656 657 658float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize; 659vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize; 660vec2 txStartUV = txUvPerSquare * vec2( 661 mod(floor(aTroikaGlyphIndex / 4.0), txCols), 662 floor(floor(aTroikaGlyphIndex / 4.0) / txCols) 663); 664vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare); 665vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0); 666`,uxe=` 667uniform sampler2D uTroikaSDFTexture; 668uniform vec2 uTroikaSDFTextureSize; 669uniform float uTroikaSDFGlyphSize; 670uniform float uTroikaSDFExponent; 671uniform float uTroikaEdgeOffset; 672uniform float uTroikaFillOpacity; 673uniform float uTroikaBlurRadius; 674uniform vec3 uTroikaStrokeColor; 675uniform float uTroikaStrokeWidth; 676uniform float uTroikaStrokeOpacity; 677uniform bool uTroikaSDFDebug; 678varying vec2 vTroikaGlyphUV; 679varying vec4 vTroikaTextureUVBounds; 680varying float vTroikaTextureChannel; 681varying vec2 vTroikaGlyphDimensions; 682 683float troikaSdfValueToSignedDistance(float alpha) { 684 // Inverse of exponential encoding in webgl-sdf-generator 685 686 float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y); 687 float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension; 688 float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0); 689 return signedDist; 690} 691 692float troikaGlyphUvToSdfValue(vec2 glyphUV) { 693 vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV); 694 vec4 rgba = texture2D(uTroikaSDFTexture, textureUV); 695 float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1 696 return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a; 697} 698 699float troikaGlyphUvToDistance(vec2 uv) { 700 return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv)); 701} 702 703float troikaGetAADist() { 704 705 #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300 706 return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5; 707 #else 708 return vTroikaGlyphDimensions.x / 64.0; 709 #endif 710} 711 712float troikaGetFragDistValue() { 713 vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize); 714 float distance = troikaGlyphUvToDistance(clampedGlyphUV); 715 716 // Extrapolate distance when outside bounds: 717 distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : 718 length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions); 719 720 721 722 return distance; 723} 724 725float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) { 726 #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL) 727 float alpha = step(-distanceOffset, -distance); 728 #else 729 730 float alpha = smoothstep( 731 distanceOffset + aaDist, 732 distanceOffset - aaDist, 733 distance 734 ); 735 #endif 736 737 return alpha; 738} 739`,dxe=` 740float aaDist = troikaGetAADist(); 741float fragDistance = troikaGetFragDistValue(); 742float edgeAlpha = uTroikaSDFDebug ? 743 troikaGlyphUvToSdfValue(vTroikaGlyphUV) : 744 troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius)); 745 746#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL) 747vec4 fillRGBA = gl_FragColor; 748fillRGBA.a *= uTroikaFillOpacity; 749vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity); 750if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb; 751gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep( 752 -uTroikaStrokeWidth - aaDist, 753 -uTroikaStrokeWidth + aaDist, 754 fragDistance 755));
756gl_FragColor.a *= edgeAlpha; 757#endif 758 759if (edgeAlpha == 0.0) { 760 discard; 761} 762`;function fxe(e){let t=SE(e,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new yn},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Sn(0,0,0,0)},uTroikaClipRect:{value:new Sn(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new yn},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new ot},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Lt},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:cxe,vertexTransform:lxe,fragmentDefs:uxe,fragmentColorTransform:dxe,customRewriter({vertexShader:e,fragmentShader:t}){let n=/\buniform\s+vec3\s+diffuse\b/;return n.test(t)&&(t=t.replace(n,`varying vec3 vTroikaGlyphColor`).replace(/\bdiffuse\b/g,`vTroikaGlyphColor`),n.test(e)||(e=e.replace(gE,`uniform vec3 diffuse; 763$& 764vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; 765`))),{vertexShader:e,fragmentShader:t}}});return t.transparent=!0,t.forceSinglePass=!0,Object.defineProperties(t,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),t}var UE=new bn({color:16777215,side:2,transparent:!0}),WE=8421504,GE=new fr,KE=new hn,qE=new hn,JE=[],pxe=new hn,YE=`+x+y`;function XE(e){return Array.isArray(e)?e[0]:e}var ZE=()=>{let e=new Nt(new nn(1,1),UE);return ZE=()=>e,e},QE=()=>{let e=new Nt(new nn(1,1,32,1),UE);return QE=()=>e,e},mxe={type:`syncstart`},hxe={type:`synccomplete`},$E=[`font`,`fontSize`,`fontStyle`,`fontWeight`,`lang`,`letterSpacing`,`lineHeight`,`maxWidth`,`overflowWrap`,`text`,`direction`,`textAlign`,`textIndent`,`whiteSpace`,`anchorX`,`anchorY`,`colorRanges`,`sdfGlyphSize`],gxe=$E.concat(`material`,`color`,`depthOffset`,`clipRect`,`curveRadius`,`orientation`,`glyphGeometryDetail`),eD=class extends Nt{constructor(){let e=new sxe;super(e,null),this.text=``,this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction=`auto`,this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight=`normal`,this.fontStyle=`normal`,this.lang=null,this.letterSpacing=0,this.lineHeight=`normal`,this.maxWidth=1/0,this.overflowWrap=`normal`,this.textAlign=`left`,this.textIndent=0,this.whiteSpace=`normal`,this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=WE,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=YE,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||=[]).push(e):(this._isSyncing=!0,this.dispatchEvent(mxe),FE({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||`normal`,fontStyle:this.fontStyle||`normal`,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||`normal`,maxWidth:this.maxWidth,direction:this.direction||`auto`,textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);let n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{n.forEach(e=>e&&e())})),this.dispatchEvent(hxe),e&&e()})))}onBeforeRender(e,t,n,r,i,a){this.sync(),i.isTroikaTextMaterial&&this._prepareForRender(i)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return fxe(e)}get material(){let e=this._derivedMaterial,t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=UE.clone());if((!e||!e.isDerivedFrom(t))&&(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener(`dispose`,function n(){t.removeEventListener(`dispose`,n),e.dispose()})),this.hasOutline()){let t=e._outlineMtl;return t||(t=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),t.isTextOutlineMaterial=!0,t.depthWrite=!1,t.map=null,e.addEventListener(`dispose`,function n(){e.removeEventListener(`dispose`,n),t.dis
765pose()})),[t,e]}return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return XE(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return XE(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){let t=e.isTextOutlineMaterial,n=e.uniforms,r=this.textRenderInfo;if(r){let{sdfTexture:e,blockBounds:i}=r;n.uTroikaSDFTexture.value=e,n.uTroikaSDFTextureSize.value.set(e.image.width,e.image.height),n.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,n.uTroikaSDFExponent.value=r.sdfExponent,n.uTroikaTotalBounds.value.fromArray(i),n.uTroikaUseGlyphColors.value=!t&&!!r.glyphColors;let a=0,o=0,s=0,c,l,u,d=0,f=0;if(t){let{outlineWidth:e,outlineOffsetX:t,outlineOffsetY:n,outlineBlur:r,outlineOpacity:i}=this;a=this._parsePercent(e)||0,o=Math.max(0,this._parsePercent(r)||0),c=i,d=this._parsePercent(t)||0,f=this._parsePercent(n)||0}else s=Math.max(0,this._parsePercent(this.strokeWidth)||0),s&&(u=this.strokeColor,n.uTroikaStrokeColor.value.set(u??WE),l=this.strokeOpacity,l??=1),c=this.fillOpacity;n.uTroikaEdgeOffset.value=a,n.uTroikaPositionOffset.value.set(d,f),n.uTroikaBlurRadius.value=o,n.uTroikaStrokeWidth.value=s,n.uTroikaStrokeOpacity.value=l,n.uTroikaFillOpacity.value=c??1,n.uTroikaCurveRadius.value=this.curveRadius||0;let p=this.clipRect;if(p&&Array.isArray(p)&&p.length===4)n.uTroikaClipRect.value.fromArray(p);else{let e=(this.fontSize||.1)*100;n.uTroikaClipRect.value.set(i[0]-e,i[1]-e,i[2]+e,i[3]+e)}this.geometry.applyClipRect(n.uTroikaClipRect.value)}n.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;let i=t?this.outlineColor||0:this.color;if(i==null)delete e.color;else{let t=e.hasOwnProperty(`color`)?e.color:e.color=new ot;(i!==t._input||typeof i==`object`)&&t.set(t._input=i)}let a=this.orientation||YE;if(a!==e._orientation){let t=n.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,``);let r=a!==YE&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(r){let[,e,n,i,a]=r;KE.set(0,0,0)[n]=e===`-`?1:-1,qE.set(0,0,0)[a]=i===`-`?-1:1,GE.lookAt(pxe,KE.cross(qE),qE),t.setFromMatrix4(GE)}else t.identity();e._orientation=a}}_parsePercent(e){if(typeof e==`string`){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new yn){t.copy(e);let n=this.curveRadius;return n&&(t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n)),t}worldPositionToTextCoords(e,t=new yn){return KE.copy(e),this.localPositionToTextCoords(this.worldToLocal(KE),t)}raycast(e,t){let{textRenderInfo:n,curveRadius:r}=this;if(n){let i=n.blockBounds,a=r?QE():ZE(),o=a.geometry,{position:s,uv:c}=o.attributes;for(let e=0;e<c.count;e++){let t=i[0]+c.getX(e)*(i[2]-i[0]),n=i[1]+c.getY(e)*(i[3]-i[1]),a=0;r&&(a=r-Math.cos(t/r)*r,t=Math.sin(t/r)*r),s.setXYZ(e,t,n,a)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,JE.length=0,a.raycast(e,JE);for(let e=0;e<JE.length;e++)JE[e].object=this,t.push(JE[e])}}copy(e){let t=this.geometry;return super.copy(e),this.geometry=t,gxe.forEach(t=>{this[t]=e[t]}),this}clone(){return new this.constructor().copy(this)}};$E.forEach(e=>{let t=`_private_`+e;Object.defineProperty(eD.prototype,e,{get(){return this[t]},set(e){e!==this[t]&&(this[t]=e,this._needsSync=!0)}})}),new Or,new ot,new Or,typeof window<`u`&&document.createElement(`div`);var _xe=new Set([`$$slots`,`$$events`,`$$legacy`,`font`,`characters`,`sdfGlyphSize`,`ref`,`onsync`,`children`]);function tD(e,t){Ce(t,!0);let n=J(t,`font`,3,null),r=J(t,`characters`,3,null),i=J(t,`sdfGlyphSize`,3,null),a=J(t,`ref`,15),o=Le(t,_xe),s=new eD,{invalidate:c}=Ww(),l=async()=>{await C(),s.sync(()=>{c(),t.onsync?.()})},u=`text.anchorX.anchorY.curveRadius.direction.font.fontSize.letterSpacing.lineHeight.maxWidth.overflowWrap.textAlign.textIndent.whiteSpace.material.color.depthOffset.clipRect.glyphGeometryDetail.sdfGlyphSize.outlineWidth.outlineColor.outlineOpacity.outlineBlur.outlineOffsetX.outlineOffsetY.strokeWidth.strokeColor.strokeOpacity.fillOpacity.characters.colorRanges`.split(`.`);Yw(()=>u.map(e=>o[e]),()=>{l()});let d=Uye();Qe(()=>{d(new Promise(e=>txe({font:n(),characters:r(),sdfGlyphSize:i()},e)))}),Uw(e,le({get is(){return s}},()=>o,{get font(){return n()},get characters(){return r()},get sdfGlyphSize(){return i()},get ref(){return a()},set ref(e){a(e)},children:(e,n)=>{var r=fe(),i=N(r);ae(i,()=>t.children??qe,()=>({ref:s})),X(e,r)},$$slots:{default:!0}}
765)),ue()}new Fr;var vxe=e=>{let{camera:t}=Ww(),n=0,r=0,a=new ResizeObserver(([e])=>{n=e.contentRect.width,r=e.contentRect.height}),o=et(e);return i(()=>{let{current:e}=o;if(e)return a.observe(e),()=>a.unobserve(e)}),(e,i)=>{n!==0&&r!==0&&(i.pointer.update(t=>(t.set(e.offsetX/n*2-1,-(e.offsetY/r)*2+1),t)),i.raycaster.setFromCamera(i.pointer.current,t.current))}},nD=Symbol(`interactivity-context`),yxe=()=>De(nD),bxe=e=>{let t=Sw(e?.target??Tw().dom),n={enabled:Sw(e?.enabled??!0),pointer:Sw(new yn),pointerOverTarget:Sw(!1),lastEvent:void 0,raycaster:new Wn,initialClick:[0,0],initialClickTime:0,initialHits:[],hovered:new Map,interactiveObjects:[],target:t,handlers:new WeakMap,compute:e?.compute??vxe(t),filter:e?.filter,clickDistanceThreshold:e?.clickDistanceThreshold??8,clickTimeThreshold:e?.clickTimeThreshold??1/0,eventOptions:e?.eventOptions,addInteractiveObject:(e,t)=>{n.handlers.set(e,t),n.interactiveObjects.indexOf(e)===-1&&n.interactiveObjects.push(e)},removeInteractiveObject:e=>{let t=n.interactiveObjects.indexOf(e);t!==-1&&(n.interactiveObjects.splice(t,1),n.handlers.delete(e))}};return He(nD,n),n},rD=()=>{let e=yxe();if(!e)throw Error(`No interactivity context found. Did you forget to implement interactivity()?`);return e},iD=[`onclick`,`oncontextmenu`,`ondblclick`,`onwheel`,`onpointerup`,`onpointerdown`,`onpointerover`,`onpointerout`,`onpointerenter`,`onpointerleave`,`onpointermove`,`onpointermissed`],xxe=()=>{Tye(`interactivity`,e=>{if(!Iw(e.ref,`Object3D`))return;let{addInteractiveObject:t,removeInteractiveObject:n}=rD();return i(()=>{let r=e.ref,i=e.props;if(iD.some(e=>typeof i[e]==`function`))return t(r,i),()=>{n(r)}}),{pluginProps:iD}})};function aD(e){let t=e.eventObject??e.object,n=e.instanceId??e.batchId;return n===void 0?e.object.isPoints?`${t.uuid}|${e.index}`:t.uuid:`${t.uuid}|${n}`}var oD=[[`click`,!1],[`contextmenu`,!1],[`dblclick`,!1],[`wheel`,!1],[`pointerdown`,!0],[`pointerup`,!0],[`pointerleave`,!0],[`pointerenter`,!0],[`pointermove`,!0],[`pointercancel`,!0]],Sxe=e=>{let{handlers:t}=rD(),n=t=>{let n=t.offsetX-e.initialClick[0],r=t.offsetY-e.initialClick[1];return Math.round(Math.hypot(n,r))},r=n=>{if(e.hovered.size===0)return;let r=new Set;for(let e of n)r.add(aD(e));for(let[i,a]of e.hovered)if(!r.has(i)){let{eventObject:r}=a;e.hovered.delete(i);let o=t.get(r);if(o){let e={...a,intersections:n};o.onpointerout?.(e),o.onpointerleave?.(e)}}},i=()=>{if(!e.enabled.current)return[];let n=[],r=e.raycaster.intersectObjects(e.interactiveObjects,!0),i=new Set,a=r.filter(e=>{let t=e.instanceId??e.batchId,n=t===void 0?e.object.isPoints?`${e.object.uuid}|${e.index}`:e.object.uuid:`${e.object.uuid}|${t}`;return!i.has(n)&&(i.add(n),!0)}),o=e.filter===void 0?a:e.filter(a,e);for(let e of o){let r=e.object;for(;r;)t.has(r)&&n.push({...e,eventObject:r}),r=r.parent}return n},a=(e,n)=>{for(let r of n)t.get(r)?.onpointermissed?.(e)},o=()=>{e.pointerOverTarget.set(!1),r([])},s=()=>{e.pointerOverTarget.set(!0)},c=o=>{let s=o.type,c=s===`pointermove`,l=s===`click`||s===`contextmenu`||s===`dblclick`;e.compute(o,e);let u=i(),d=l?n(o):0;s===`pointerdown`&&(e.initialClick=[o.offsetX,o.offsetY],e.initialClickTime=performance.now(),e.initialHits=u.map(e=>e.eventObject));let f=l&&d<=e.clickDistanceThreshold&&performance.now()-e.initialClickTime<=e.clickTimeThreshold;f&&a(o,e.interactiveObjects.filter(t=>!e.initialHits.includes(t))),c&&r(u);let p=!1,m=-1;dispatchEvents:for(let n of u){let i=t.get(n.eventObject);if(!i)continue;let a={stopped:p,...n,intersections:u,stopPropagation(){if(p=!0,a.stopped=!0,e.hovered.size>0&&Array.from(e.hovered.values()).some(e=>e.eventObject===n.eventObject)){let e=u.slice(0,u.indexOf(n));r([...e,n])}},stopImmediatePropagation(){o.stopImmediatePropagation()},camera:e.raycaster.camera,delta:d,nativeEvent:o,pointer:e.pointer.current,ray:e.raycaster.ray};if(c){if(i.onpointerover||i.onpointerenter||i.onpointerout||i.onpointerleave){let t=aD(a),n=e.hovered.get(t);n?n.stopped&&a.stopPropagation():(e.hovered.set(t,a),i.onpointerover?.(a),i.onpointerenter?.(a))}if(i.onpointermove?.(a),a.stopped){let t=aD(a),n=e.hovered.get(t);n&&(n.stopped=!0)}}else i[`on${s}`]&&(!l||f&&e.initialHits.includes(n.eventObject))&&i[`on${s}`]?.(a);if(p){m=u.indexOf(n);break dispatchEvents}}c&&p&&r(u.slice(0,m+1))},l=0,u=null,d=-1/0,f=-1/0,p=.25,m=e=>{Math.abs(e.offsetX-d)<p&&Math.abs(e.offsetY-f)<p||(d=e.offsetX,f=e.offsetY,l?u=e:(c(e),l=requestAnimationFrame(()=>{l=0,u&&=(c(u),null)})))},h=e=>{for(let[t]of oD)t===`pointerleave`||t===`pointercancel`?e.removeEventListener(t,o):t===`pointermove`?e.removeEventListener(t,m):t===`pointerenter`?e.removeEventListener(t,s):e.removeEventListener(t,c)},g=t=>{for(let[n,r]of oD){let i=e.eventOptions?.[n]?.passive??r;n===`pointerleave`||n===`pointercancel`?t.addEventListener(n,o,{passive:i}):n===`pointermove`?t.addEventListener(n,m,{passive:i}):n===`pointerenter`?t.addEventListener(n,s,{passive:i}):t.addEventListener(n,c,{passive:i})}},_=et(e.target);Qe(()=>{let{current:e}=_;if(e)return g(e),()=>{h(e)}})},Cxe=e=>{let t=bxe(e);return xxe(),Sxe(t),t},wxe=[];for(let e=0;e<256;e++)wxe[e]=(e<16?`0`:``)+e.toString(16);new An(-1,1,1,-1,0,1),new class extends ft{constructor(){super(),this.setAttribute(`position`,new hr([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute(`uv`,new hr([
7650,2,0,0,2,0],2))}};var sD={exports:{}};sD.exports=cD,sD.exports.default=cD;function cD(e,t,n){n||=2;var r=t&&t.length,i=r?t[0]*n:e.length,a=lD(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;var s,c,l,u,d,f,p;if(r&&(a=kxe(e,t,a,n)),e.length>80*n){s=l=e[0],c=u=e[1];for(var m=n;m<i;m+=n)d=e[m],f=e[m+1],d<s&&(s=d),f<c&&(c=f),d>l&&(l=d),f>u&&(u=f);p=Math.max(l-s,u-c),p=p===0?0:32767/p}return dD(a,o,n,s,c,p,0),o}function lD(e,t,n,r,i){var a,o;if(i===wD(e,t,n,r)>0)for(a=t;a<n;a+=r)o=xD(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=xD(a,e[a],e[a+1],o);return o&&hD(o,o.next)&&(SD(o),o=o.next),o}function uD(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(hD(n,n.next)||mD(n.prev,n,n.next)===0)){if(SD(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function dD(e,t,n,r,i,a,o){if(e){!o&&a&&Pxe(e,r,i,a);for(var s=e,c,l;e.prev!==e.next;){if(c=e.prev,l=e.next,a?Exe(e,r,i,a):Txe(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),SD(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=Dxe(uD(e),t,n),dD(e,t,n,r,i,a,2)):o===2&&Oxe(e,t,n,r,i,a):dD(uD(e),t,n,r,i,a,1);break}}}}function Txe(e){var t=e.prev,n=e,r=e.next;if(mD(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=i<a?i<o?i:o:a<o?a:o,d=s<c?s<l?s:l:c<l?c:l,f=i>a?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&pD(i,s,a,c,o,l,m.x,m.y)&&mD(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Exe(e,t,n,r){var i=e.prev,a=e,o=e.next;if(mD(i,a,o)>=0)return!1;for(var s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=s<c?s<l?s:l:c<l?c:l,m=u<d?u<f?u:f:d<f?d:f,h=s>c?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,_=fD(p,m,t,n,r),v=fD(h,g,t,n,r),y=e.prevZ,b=e.nextZ;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&pD(s,u,c,d,l,f,y.x,y.y)&&mD(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&pD(s,u,c,d,l,f,b.x,b.y)&&mD(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&pD(s,u,c,d,l,f,y.x,y.y)&&mD(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&pD(s,u,c,d,l,f,b.x,b.y)&&mD(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Dxe(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!hD(i,a)&&gD(i,r,r.next,a)&&yD(i,a)&&yD(a,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(a.i/n|0),SD(r),SD(r.next),r=e=a),r=r.next}while(r!==e);return uD(r)}function Oxe(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Lxe(o,s)){var c=bD(o,s);o=uD(o,o.next),c=uD(c,c.next),dD(o,t,n,r,i,a,0),dD(c,t,n,r,i,a,0);return}s=s.next}o=o.next}while(o!==e)}function kxe(e,t,n,r){for(var i=[],a=0,o=t.length,s,c,l;a<o;a++)s=t[a]*r,c=a<o-1?t[a+1]*r:e.length,l=lD(e,s,c,r,!1),l===l.next&&(l.steiner=!0),i.push(Ixe(l));for(i.sort(Axe),a=0;a<i.length;a++)n=jxe(i[a],n);return n}function Axe(e,t){return e.x-t.x}function jxe(e,t){var n=Mxe(e,t);if(!n)return t;var r=bD(n,e);return uD(r,r.next),uD(n,n.next)}function Mxe(e,t){var n=t,r=e.x,i=e.y,a=-1/0,o;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a&&(a=s,o=n.x<n.next.x?n:n.next,s===r))return o}n=n.next}while(n!==t);if(!o)return null;var c=o,l=o.x,u=o.y,d=1/0,f;n=o;do r>=n.x&&n.x>=l&&r!==n.x&&pD(i<u?r:a,i,l,u,i<u?a:r,i,n.x,n.y)&&(f=Math.abs(i-n.y)/(r-n.x),yD(n,e)&&(f<d||f===d&&(n.x>o.x||n.x===o.x&&Nxe(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function Nxe(e,t){return mD(e.prev,e,t.prev)<0&&mD(t.next,e,e.next)<0}function Pxe(e,t,n,r){var i=e;do i.z===0&&(i.z=fD(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,Fxe(i)}function Fxe(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ,r);t++);for(c=l;s>0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function fD(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Ixe(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function pD(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function Lxe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Rxe(e,t)&&(yD(e,t)&&yD(t,e)&&zxe(e,t)&&(mD(e.prev,e,t.prev)||mD(e,t.prev,t))||hD(e,t)&&mD(e.prev,e,e.next)>0&&mD(t.prev,t,t.next)>0)}function mD(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function hD(e,t){return e.x===t.x&&e.y===t.y}function gD(e,t,n,r){var i=vD(mD(e,t,n)),a=vD(mD(e,t,r)),o=vD(mD(n,r,e)),s=vD(mD(n,r,t));return!!(i!==a&&o!==s||i===0&&_D(e,n,t)||a===0&&_D(e,r,t)||o===0&&_D(n,e,r)||s===0&&_D(n,t,r))}function _D(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function vD(e){return e>0?1:e<0?-1:0}function Rxe(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&gD(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function yD(e,t){return mD(e.prev,e,e.next)<0?mD(e,t,e.next)>=0&&mD(e,e.prev,t)>=0:mD(e,t,e.prev)<0||mD(e,e.next,t)<0}function zxe(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function bD(e,t){var n=new CD(e.i,e.x,e.y),r=new CD(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function xD(e,t,n,r){var i=new CD(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function SD(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function CD(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}cD.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(wD(e,0,a,n));if(i)for(var s=0,c=t.length;s<c;s++){var l=t[s]*n,u=s<c-1?t[s+1]*n:e.length;o-=Math.abs(wD(e,l,u,n))}var d=0;for(s=0;s<r.length;s+=3){var f=r[s]*n,p=r[s+1]*n,m=r[s+2]*n;d+=Math.abs((e[f]-e[m])*(e[p+1]-e[f+1])-(e[f]-e[p])*(e[m+1]-e[f+1]))}return o===0&&d===0?0:Math.abs((d-o)/o)};function wD(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}cD.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},sD.exports,new yn,new yn;var Bxe;(e=>{function t(t){let n=t.slice();return n.sort(e.POINT_COMPARATOR),e.makeHullPresorted(n)}e.makeHull=t;function n(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length==1&&n.length==1&&t[0].x==n[0].x&&t[0].y==n[0].y?t:t.concat(n)}e.makeHullPresorted=n;function r(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)}e.POINT_COMPARATOR=r})(Bxe||={}),new bn,new hn,new fr,new mr,new $t,new Or,new hn,new hn;var Vxe=async e=>{if(navigator?.xr===void 0)return`unsupported`;if(!window.isSecureContext)return`insecure`;try{return await navigator.xr.isSessionSupported(e)?`supported`:`unsupported`}catch(e){return e.name===`SecurityError`?`blocked`:`unsupported`}},TD=new class{#e=t([]);get current(){return Q(this.#e)}set current(e){I(this.#e,e)}},ED=new Set,DD=e=>(ED.add(e),()=>{ED.delete(e)}),Hxe=(e,t,n)=>{let r=`on${t}`;for(let t of ED){if(t.type!==e.type||t.handedness!==e.handedness)continue;let i=t.callbacks[r];i?.(n)}},Uxe=(e,t)=>{e.targetRay.dispatchEvent(t),e.type===`controller`&&e.grip.dispatchEvent(t),e.type===`hand`&&e.hand.dispatchEvent(t)},OD=(e,t,n={})=>({type:t,data:e.inputSource,inputSource:e.inputSource,target:e.type===`hand`?e.hand:e.targetRay,...n}),kD=(e,t,n,r={})=>
765{r.dispatchSpaces!==!1&&Uxe(e,n),Hxe(e,t,n)},AD=(e,t)=>t?.isPrimary===void 0?TD.current.find(t=>t.isPrimary&&e(t))??TD.current.find(e):TD.current.find(n=>n.isPrimary===t.isPrimary&&e(n)),Wxe=(e,t)=>t?.isPrimary===void 0?TD.current.find(t=>t.inputSource===e):TD.current.find(n=>n.inputSource===e&&n.isPrimary===t.isPrimary),jD=(e,t)=>AD(t=>t.type===`controller`&&t.handedness===e,t),MD=(e,t)=>AD(t=>t.type===`hand`&&t.handedness===e,t),Gxe=e=>{let t=Wxe(e.inputSource);t!==void 0&&kD(t,e.type,OD(t,e.type,{frame:e.frame}))},Kxe=class{#e=t(!1);get current(){return Q(this.#e)}set current(e){I(this.#e,e,!0)}},qxe=class{get current(){return TD.current.some(e=>e.type===`hand`)}},Jxe=class{#e=t();get current(){return Q(this.#e)}set current(e){I(this.#e,e)}},Yxe=class{#e=t();get current(){return Q(this.#e)}set current(e){I(this.#e,e)}},Xxe=class{#e=t();get current(){return Q(this.#e)}set current(e){I(this.#e,e)}},Zxe=class{#e=t();get mode(){return Q(this.#e)}set mode(e){I(this.#e,e)}#t=t();get sessionInit(){return Q(this.#t)}set sessionInit(e){I(this.#t,e)}},ND=class{#e=t(!1);get enabled(){return Q(this.#e)}set enabled(e){I(this.#e,e,!0)}#t=t(!1);get hovering(){return Q(this.#t)}set hovering(e){I(this.#t,e,!0)}},PD=class{#e=t();get left(){return Q(this.#e)}set left(e){I(this.#e,e)}#t=t();get right(){return Q(this.#t)}set right(e){I(this.#t,e)}},FD=new Kxe;new qxe;var ID=new Jxe,LD=new Yxe,RD=new Xxe,zD=new Zxe,BD={left:new ND,right:new ND},VD={left:new ND,right:new ND},HD=new PD,UD=new PD,WD=(e,t,n)=>{let r=t??n;if(e!==void 0||r!==void 0)return e&&r===void 0?{optionalFeatures:[e]}:e&&r?{...r,optionalFeatures:[...new Set([...r.optionalFeatures??[],e])]}:r},GD,KD=(e,t,n)=>(GD===void 0&&(GD=Qxe(e,t,n).finally(()=>{GD=void 0})),GD),Qxe=async(e,t,n)=>{let r=ID.current,i=r!==void 0;if(n===`enter`&&i)return r;if(n===`exit`&&!i)return;if(i){await r.end();return}let a=RD.current;if(a===void 0)throw Error(`An <XR> component was not created when attempting to toggle a session.`);let o=WD(LD.current,t),s=await navigator.xr?.requestSession(e,o);if(s===void 0)throw Error(`A session was not able to be created.`);return await a.setSession(s),zD.mode=e,zD.sessionInit=t,ID.current=s,s},$xe=new Set([`$$slots`,`$$events`,`$$legacy`,`mode`,`sessionInit`,`force`,`styled`,`onclick`,`onerror`,`children`]),eSe=V(`<button><!></button>`);function qD(e,t){Ce(t,!0);let n=J(t,`styled`,3,!0),r=Le(t,$xe),i=async(e,n)=>{if(!RD.current)throw Error(`The <XR> component was not created. This is required to start an XR session.`);if(t.onclick?.({state:n,nativeEvent:e}),n===`supported`)try{await KD(t.mode,t.sessionInit,t.force)}catch(e){t.onerror?.(e)}},a=q(()=>({"immersive-vr":`VR`,"immersive-ar":`AR`,inline:`inline`})[t.mode]),o=q(()=>n()?` 766 position: absolute; 767 bottom: 24px; 768 left: 50%; 769 transform: translateX(-50%); 770 padding: 10px 20px; 771 border: 1px solid white; 772 background: rgba(0, 0, 0, 0.1); 773 color: white; 774 outline: none; 775 z-index: 10; 776 ${t.style??``} 777 `:t.style);var s=fe(),c=N(s);oe(c,()=>Vxe(t.mode),null,(e,n)=>{var s=eSe(),c=e=>{i(e,Q(n))};ye(s,()=>({onclick:c,...r,style:Q(o)}));var l=j(s),u=e=>{var r=fe(),i=N(r);ae(i,()=>t.children,()=>({state:Q(n)})),X(e,r)},d=e=>{var t=Te();O(()=>Y(t,`${Q(a)??``} unsupported`)),X(e,t)},f=e=>{var t=Te(`HTTPS needed`);X(e,t)},p=e=>{var t=Te();O(()=>Y(t,`${Q(a)??``} blocked`)),X(e,t)},m=e=>{var t=Te();O(()=>Y(t,`${FD.current?`Exit`:`Enter`} ${Q(a)??``}`)),X(e,t)};G(l,e=>{t.children?e(u):Q(n)===`unsupported`?e(d,1):Q(n)===`insecure`?e(f,2):Q(n)===`blocked`?e(p,3):Q(n)===`supported`&&e(m,4)}),H(s),X(e,s)}),X(e,s),ue()}var JD={requiredFeatures:[],optionalFeatures:[`local-floor`,`bounded-floor`,`anchors`,`hand-tracking`,`plane-detection`,`layers`,`depth-sorted-layers`,`hit-test`,`mesh-detection`]},tSe=new Set([`$$slots`,`$$events`,`$$legacy`]);function nSe(e,t){let n=Le(t,tSe);{let t=q(()=>({...JD}));qD(e,le({get sessionInit(){return Q(t)}},()=>n,{mode:`immersive-vr`}))}}var YD=e=>{let{subscribe:t}=$e(e);return{subscribe:t,get current(){return K(e)}}},XD=new WeakMap,ZD=e=>{if(e===void 0)return;let t=XD.get(e);return t===void 0?(t={inputSource:e.inputSource,targetRay:e.targetRay,grip:e.grip,model:e.model},XD.set(e,t),t):t},QD=new class{get left(){return ZD(jD(`left`))}get right(){return ZD(jD(`right`))}get none(){return ZD(jD(`none`))}},rSe=e=>{switch(e){case`left`:return YD(()=>QD.left);case`right`:return YD(()=>QD.right);case`none`:return YD(()=>QD.none);default:throw Error(`useController handedness must be left, right, or none.`)}},iSe=new class{#e=t();get current(){return Q(this.#e)}set current(e){I(this.#e,e)}},$D=()=>iSe,aSe=V(`<!> <!>`,1);function eO(e,t){Ce(t,!0);let n=J(t,`color`,19,()=>new ot(`white`)),r=J(t,`size`,3,.03),a=J(t,`thickness`,3,.035),o={thickness:{value:a()},color:{value:n()}},s=new Hn({vertexShader:` 778 varying vec2 vUv; 779 void main() { 780 vUv = uv; 781 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
781); 782 } 783 `,fragmentShader:` 784 uniform float thickness; 785 uniform vec3 color; 786 varying vec2 vUv; 787 void main() { 788 float d = abs(distance(vUv, vec2(0.5)) - 0.25); 789 float edge = fwidth(d); 790 float alpha = 1.0 - smoothstep(thickness - edge, thickness + edge, d); 791 gl_FragColor = vec4(color, alpha); 792 } 793 `,uniforms:o,side:2,transparent:!0,depthTest:!1});i(()=>{o.thickness.value=a()}),i(()=>{o.color.value=n()});var c=fe(),l=N(c);P(l,()=>Uw.Mesh,(e,t)=>{t(e,{get scale(){return r()},children:(e,t)=>{var n=aSe(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{})}),Uw(g(r,2),{get is(){return s}}),X(e,n)},$$slots:{default:!0}})}),X(e,c),ue()}var oSe=new hn,tO=new Lt,nO=new hn;function sSe(e,t){Ce(t,!0);let{scene:n}=Ww(),r=q(()=>VD[t.handedness].hovering),a=q(()=>UD[t.handedness]),o=new Pn;Kw(()=>{if(Q(a)===void 0)return;let{point:e,face:t,object:n}=Q(a);o.position.lerp(e,.4),t!=null&&(tO.getNormalMatrix(n.matrixWorld),nO.copy(t.normal).applyMatrix3(tO).normalize(),o.position.addScaledVector(nO,.002),o.lookAt(oSe.addVectors(o.position,nO)))},{running:()=>Q(r)&&Q(a)!==void 0}),i(()=>{Q(r)&&K(()=>{Q(a)&&o.position.copy(Q(a).point)})}),Uw(e,{get is(){return o},get attach(){return n},get visible(){return Q(r)},children:(e,n)=>{var r=fe(),i=N(r),a=e=>{var n=fe(),r=N(n);ae(r,()=>t.children),X(e,n)},o=e=>{eO(e,{})};G(i,e=>{t.children?e(a):e(o,-1)}),X(e,r)},$$slots:{default:!0}}),ue()}var cSe=V(`<!> <!>`,1);function lSe(e,t){Ce(t,!0);let n=q(()=>BD[t.handedness].hovering),r=q(()=>HD[t.handedness]),i=q(()=>VD[t.handedness].enabled||Q(n)&&Q(r)===void 0);var a=fe(),o=N(a);P(o,()=>Uw.Group,(e,n)=>{n(e,{get visible(){return Q(i)},children:(e,n)=>{var r=fe(),i=N(r),a=e=>{var n=fe(),r=N(n);ae(r,()=>t.children),X(e,n)},o=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Mesh,(e,t)=>{t(e,{"rotation.x":-Math.PI/2,"position.z":-.1,children:(e,t)=>{var n=cSe(),r=N(n);P(r,()=>Uw.CylinderGeometry,(e,t)=>{t(e,{args:[.002,.002,.2,16,1,!1]})});var i=g(r,2);P(i,()=>Uw.RawShaderMaterial,(e,t)=>{t(e,{transparent:!0,vertexShader:` 794 uniform mat4 modelViewMatrix; 795 uniform mat4 projectionMatrix; 796 attribute vec2 uv; 797 attribute vec3 position; 798 varying vec2 vUv; 799 void main() { 800 vUv = uv; 801 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 802 }`,fragmentShader:` 803 precision mediump float; 804 varying vec2 vUv; 805 void main() { 806 gl_FragColor = vec4(1.0, 1.0, 1.0, pow(vUv.y - 1.0, 2.0)); 807 }`})}),X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(i,e=>{t.children?e(a):e(o,-1)}),X(e,r)},$$slots:{default:!0}})}),X(e,a),ue()}var uSe=new hn,rO=new Lt,iO=new hn;function dSe(e,t){Ce(t,!0);let{scene:n}=Ww(),r=q(()=>HD[t.handedness]),a=new Pn;Kw(()=>{if(Q(r)===void 0)return;let{point:e,face:t,object:n}=Q(r);a.position.lerp(e,.4),t&&(rO.getNormalMatrix(n.matrixWorld),iO.copy(t.normal).applyMatrix3(rO).normalize(),a.lookAt(uSe.addVectors(a.position,iO)))},{running:()=>Q(r)!==void 0});let o=new to(.1,{stiffness:.2});i(()=>{Q(r)===void 0?o.set(.1):(o.set(1),a.position.copy(Q(r).point))});{let i=q(()=>Q(r)!==void 0);Uw(e,{get is(){return a},get attach(){return n},get visible(){return Q(i)},children:(e,n)=>{var r=fe(),i=N(r),a=e=>{var n=fe(),r=N(n);ae(r,()=>t.children),X(e,n)},s=e=>{eO(e,{get size(){return o.current},thickness:.015})};G(i,e=>{t.children?e(a):e(s,-1)}),X(e,r)},$$slots:{default:!0}})}ue()}var aO=new Or,oO=new hn,sO=class extends Cr{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type=`LineSegmentsGeometry`,this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute(`position`,new hr([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute(`uv`,new hr([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){let t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let n=new kr(t,6,1);return this.setAttribute(`instanceStart`,new en(n,3,0)),this.setAttribute(`instanceEnd`,new en(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let n=new kr(t,6,1);return this.setAttribute(`instanceColorStart`,new en(n,3,0)),this.setAttribute(`instanceColorEnd`,new en(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new Fn(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Or);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),aO.setFromBufferAttribute(t),this.boundingBox.union(aO))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new $t),this.boundingBox===null&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,a=e.count;i<a;i++)oO.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(oO)),oO.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(oO));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error(`THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.`,this)}}toJSON(){}};pr.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new yn},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},rr.line={uniforms:Et.merge([pr.common,pr.fog,pr.line]),vertexShader:` 808 #include <common> 809 #include <color_pars_vertex> 810 #include <fog_pars_vertex> 811 #include <logdepthbuf_pars_vertex> 812 #include <clipping_planes_pars_vertex> 813 814 uniform float linewidth; 815 uniform vec2 resolution; 816 817 attribute vec3 instanceStart; 818 attribute vec3 instanceEnd; 819 820 attribute vec3 instanceColorStart; 821 attribute vec3 instanceColorEnd; 822
823 #ifdef WORLD_UNITS 824 825 varying vec4 worldPos; 826 varying vec3 worldStart; 827 varying vec3 worldEnd; 828 829 #ifdef USE_DASH 830 831 varying vec2 vUv; 832 833 #endif 834 835 #else 836 837 varying vec2 vUv; 838 839 #endif 840 841 #ifdef USE_DASH 842 843 uniform float dashScale; 844 attribute float instanceDistanceStart; 845 attribute float instanceDistanceEnd; 846 varying float vLineDistance; 847 848 #endif 849 850 float trimSegmentAlpha( const in vec4 start, const in vec4 end ) { 851 852 // compute the interpolation factor needed to trim the segment so it terminates 853 // between the camera plane and the near plane 854 855 // conservative estimate of the near plane 856 float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column 857 float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column 858 859 // we need different nearEstimate formula for reversed and default depth buffer 860 // a is positive with a reversed depth buffer so it can be used for controlling the code flow 861 float nearEstimate = ( a > 0.0 ) ? ( - b / ( a + 1.0 ) ) : ( - 0.5 * b / a ); 862 863 return ( nearEstimate - start.z ) / ( end.z - start.z ); 864 865 } 866 867 void main() { 868 869 #ifdef USE_COLOR 870 871 vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; 872 873 #endif 874 875 float aspect = resolution.x / resolution.y; 876 877 // camera space 878 vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); 879 vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); 880 881 #ifdef USE_DASH 882 883 float lineDistanceStart = dashScale * instanceDistanceStart; 884 float lineDistanceEnd = dashScale * instanceDistanceEnd; 885 886 #endif 887 888 #ifdef WORLD_UNITS 889 890 worldStart = start.xyz; 891 worldEnd = end.xyz; 892 893 #else 894 895 vUv = uv; 896 897 #endif 898 899 // special case for perspective projection, and segments that terminate either in, or behind, the camera plane 900 // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space 901 // but we need to perform ndc-space calculations in the shader, so we must address this issue directly 902 // perhaps there is a more elegant solution -- WestLangley 903 904 bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column 905 906 if ( perspective ) { 907 908 if ( start.z < 0.0 && end.z >= 0.0 ) { 909 910 float alpha = trimSegmentAlpha( start, end ); 911 end.xyz = mix( start.xyz, end.xyz, alpha ); 912 913 #ifdef USE_DASH 914 915 lineDistanceEnd = mix( lineDistanceStart, lineDistanceEnd, alpha ); 916 917 #endif 918 919 } else if ( end.z < 0.0 && start.z >= 0.0 ) { 920 921 float alpha = trimSegmentAlpha( end, start ); 922 start.xyz = mix( end.xyz, start.xyz, alpha ); 923 924 #ifdef USE_DASH 925 926 lineDistanceStart = mix( lineDistanceEnd, lineDistanceStart, alpha ); 927 928 #endif 929 930 } 931 932 } 933 934 #ifdef USE_DASH 935 936 vLineDistance = ( position.y < 0.5 ) ? lineDistanceStart : lineDistanceEnd; 937 vUv = uv; 938 939 #endif 940 941 // clip space 942 vec4 clipStart = projectionMatrix * start; 943 vec4 clipEnd = projectionMatrix * end; 944 945 // ndc space 946 vec3 ndcStart = clipStart.xyz / clipStart.w; 947 vec3 ndcEnd = clipEnd.xyz / clipEnd.w; 948 949 // direction 950 vec2 dir = ndcEnd.xy - ndcStart.xy; 951 952 // account for clip-space aspect ratio 953 dir.x *= aspect; 954 dir = normalize( dir ); 955 956 #ifdef WORLD_UNITS 957 958 vec3 worldDir = normalize( end.xyz - start.xyz ); 959 vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) ); 960 vec3 worldUp = normalize( cross( worldDir, tmpFwd ) ); 961 vec3 worldFwd = cross( worldDir, worldUp ); 962 worldPos = position.y < 0.5 ? start: end; 963 964 // height offset 965 float hw = linewidth * 0.5; 966 worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp; 967 968 // don't extend the line if we're rendering dashes because we 969 // won't be rendering the endcaps 970 #ifndef USE_DASH 971 972 // cap extension 973 worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir; 974 975 // add width to the box 976 worldPos.xyz += worldFwd * hw; 977 978 // endcaps 979 if ( position.y > 1.0 || position.y < 0.0 ) { 980 981 worldPos.xyz -= worldFwd * 2.0 * hw; 982 983 } 984 985 #endif 986 987 // project the worldpos 988 vec4 clip = projectionMatrix * worldPos; 989 990 // shift the depth of the projected points so the line 991 // segments overlap neatly 992 vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; 993 clip.z = clipPose.z * clip.w; 994 995 #else 996 997 vec2 offset = vec2( dir.y, - dir.x ); 998 // undo aspect ratio adjustment 999 dir.x /= aspect; 1000 offset.x /= aspect; 1001 1002 // sign flip 1003 if ( position.x < 0.0 ) offset *= - 1.0; 1004 1005 // endcaps 1006 if ( position.y < 0.0 ) { 1007 1008 offset += - dir; 1009 1010 } else if ( position.y > 1.0 ) { 1011 1012 offset += dir; 1013 1014 } 1015 1016 // adjust for linewidth 1017 offset *= linewidth; 1018 1019 // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... 1020 offset /= resolution.y; 1021 1022 // select end 1023 vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; 1024 1025 // back to clip space 1026 offset *= clip.w; 1027 1028 clip.xy += offset; 1029 1030 #endif 1031 1032 gl_Position = clip; 1033 1034 vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation 1035 1036 #include <logdepthbuf_vertex> 1037 #include <clipping_planes_vertex> 1038 #include <fog_vertex> 1039 1040 } 1041 `,fragmentShader:` 1042 uniform vec3 diffuse; 1043 uniform float opacity; 1044 uniform float linewidth; 1045 1046 #ifdef USE_DASH 1047 1048 uniform float dashOffset; 1049 uniform float dashSize; 1050 uniform float gapSize; 1051 1052 #endif 1053 1054 varying float vLineDistance; 1055 1056 #ifdef WORLD_UNITS 1057 1058 varying vec4 worldPos; 1059 varying vec3 worldStart; 1060 varying vec3 worldEnd; 1061 1062 #ifdef USE_DASH 1063 1064 varying vec2 vUv; 1065 1066 #endif 1067 1068 #else 1069 1070 varying vec2 vUv; 1071 1072 #endif 1073 1074 #include <common> 1075 #include <color_pars_fragment> 1076 #include <fog_pars_fragment> 1077 #include <logdepthbuf_pars_fragment> 1078 #include <clipping_planes_pars_fragment> 1079 1080 vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { 1081 1082 float mua; 1083 float mub; 1084 1085 vec3 p13 = p1 - p3; 1086 vec3 p43 = p4 - p3; 1087 1088 vec3 p21 = p2 - p1; 1089 1090 float d1343 = dot( p13, p43 );
1091 float d4321 = dot( p43, p21 ); 1092 float d1321 = dot( p13, p21 ); 1093 float d4343 = dot( p43, p43 ); 1094 float d2121 = dot( p21, p21 ); 1095 1096 float denom = d2121 * d4343 - d4321 * d4321; 1097 1098 float numer = d1343 * d4321 - d1321 * d4343; 1099 1100 mua = numer / denom; 1101 mua = clamp( mua, 0.0, 1.0 ); 1102 mub = ( d1343 + d4321 * ( mua ) ) / d4343; 1103 mub = clamp( mub, 0.0, 1.0 ); 1104 1105 return vec2( mua, mub ); 1106 1107 } 1108 1109 void main() { 1110 1111 float alpha = opacity; 1112 vec4 diffuseColor = vec4( diffuse, alpha ); 1113 1114 #include <clipping_planes_fragment> 1115 1116 #ifdef USE_DASH 1117 1118 if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps 1119 1120 if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX 1121 1122 #endif 1123 1124 #ifdef WORLD_UNITS 1125 1126 // Find the closest points on the view ray and the line segment 1127 vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; 1128 vec3 lineDir = worldEnd - worldStart; 1129 vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); 1130 1131 vec3 p1 = worldStart + lineDir * params.x; 1132 vec3 p2 = rayEnd * params.y; 1133 vec3 delta = p1 - p2; 1134 float len = length( delta ); 1135 float norm = len / linewidth; 1136 1137 #ifndef USE_DASH 1138 1139 #ifdef USE_ALPHA_TO_COVERAGE 1140 1141 float dnorm = fwidth( norm ); 1142 alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); 1143 1144 #else 1145 1146 if ( norm > 0.5 ) { 1147 1148 discard; 1149 1150 } 1151 1152 #endif 1153 1154 #endif 1155 1156 #else 1157 1158 #ifdef USE_ALPHA_TO_COVERAGE 1159 1160 // artifacts appear on some hardware if a derivative is taken within a conditional 1161 float a = vUv.x; 1162 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 1163 float len2 = a * a + b * b; 1164 float dlen = fwidth( len2 ); 1165 1166 if ( abs( vUv.y ) > 1.0 ) { 1167 1168 alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); 1169 1170 } 1171 1172 #else 1173 1174 if ( abs( vUv.y ) > 1.0 ) { 1175 1176 float a = vUv.x; 1177 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 1178 float len2 = a * a + b * b; 1179 1180 if ( len2 > 1.0 ) discard; 1181 1182 } 1183 1184 #endif 1185 1186 #endif 1187 1188 #include <logdepthbuf_fragment> 1189 #include <color_fragment> 1190 1191 gl_FragColor = vec4( diffuseColor.rgb, alpha ); 1192 1193 #include <tonemapping_fragment> 1194 #include <colorspace_fragment> 1195 #include <fog_fragment> 1196 #include <premultiplied_alpha_fragment> 1197 1198 } 1199 `};var cO=class extends Hn{constructor(e){super({type:`LineMaterial`,uniforms:Et.clone(rr.line.uniforms),vertexShader:rr.line.vertexShader,fragmentShader:rr.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return`WORLD_UNITS`in this.defines}set worldUnits(e){e===!0!==this.worldUnits&&(this.needsUpdate=!0),e===!0?this.defines.WORLD_UNITS=``:delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return`USE_DASH`in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH=``:delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return`USE_ALPHA_TO_COVERAGE`in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE=``:delete this.defines.USE_ALPHA_TO_COVERAGE)}},lO=new Sn,uO=new hn,dO=new hn,fO=new Sn,pO=new Sn,mO=new Sn,hO=new hn,gO=new fr,_O=new lt,vO=new hn,yO=new Or,bO=new $t,xO=new Sn,SO,CO;function wO(e,t,n){return xO.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),xO.multiplyScalar(1/xO.w),xO.x=CO/n.width,xO.y=CO/n.height,xO.applyMatrix4(e.projectionMatrixInverse),xO.multiplyScalar(1/xO.w),Math.abs(Math.max(xO.x,xO.y))}function fSe(e,t){let n=e.matrixWorld,r=e.geometry,i=r.attributes.instanceStart,a=r.attributes.instanceEnd,o=Math.min(r.instanceCount,i.count);for(let r=0,s=o;r<s;r++){_O.start.fromBufferAttribute(i,r),_O.end.fromBufferAttribute(a,r),_O.applyM
1199atrix4(n);let o=new hn,s=new hn;SO.distanceSqToSegment(_O.start,_O.end,s,o),s.distanceTo(o)<CO*.5&&t.push({point:s,pointOnLine:o,distance:SO.origin.distanceTo(s),object:e,face:null,faceIndex:r,uv:null,uv1:null})}}function pSe(e,t,n){let r=t.projectionMatrix,i=e.material.resolution,a=e.matrixWorld,o=e.geometry,s=o.attributes.instanceStart,c=o.attributes.instanceEnd,l=Math.min(o.instanceCount,s.count),u=-t.near;SO.at(1,mO),mO.w=1,mO.applyMatrix4(t.matrixWorldInverse),mO.applyMatrix4(r),mO.multiplyScalar(1/mO.w),mO.x*=i.x/2,mO.y*=i.y/2,mO.z=0,hO.copy(mO),gO.multiplyMatrices(t.matrixWorldInverse,a);for(let t=0,o=l;t<o;t++){if(fO.fromBufferAttribute(s,t),pO.fromBufferAttribute(c,t),fO.w=1,pO.w=1,fO.applyMatrix4(gO),pO.applyMatrix4(gO),fO.z>u&&pO.z>u)continue;if(fO.z>u){let e=fO.z-pO.z,t=(fO.z-u)/e;fO.lerp(pO,t)}else if(pO.z>u){let e=pO.z-fO.z,t=(pO.z-u)/e;pO.lerp(fO,t)}fO.applyMatrix4(r),pO.applyMatrix4(r),fO.multiplyScalar(1/fO.w),pO.multiplyScalar(1/pO.w),fO.x*=i.x/2,fO.y*=i.y/2,pO.x*=i.x/2,pO.y*=i.y/2,_O.start.copy(fO),_O.start.z=0,_O.end.copy(pO),_O.end.z=0;let o=_O.closestPointToPointParameter(hO,!0);_O.at(o,vO);let l=wt.lerp(fO.z,pO.z,o),d=l>=-1&&l<=1,f=hO.distanceTo(vO)<CO*.5;if(d&&f){_O.start.fromBufferAttribute(s,t),_O.end.fromBufferAttribute(c,t),_O.start.applyMatrix4(a),_O.end.applyMatrix4(a);let r=new hn,i=new hn;SO.distanceSqToSegment(_O.start,_O.end,i,r),n.push({point:i,pointOnLine:r,distance:SO.origin.distanceTo(i),object:e,face:null,faceIndex:t,uv:null,uv1:null})}}}var mSe=class extends Nt{constructor(e=new sO,t=new cO({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type=`LineSegments2`}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count);for(let e=0,i=0,a=t.count;e<a;e++,i+=2)uO.fromBufferAttribute(t,e),dO.fromBufferAttribute(n,e),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+uO.distanceTo(dO);let i=new kr(r,2,1);return e.setAttribute(`instanceDistanceStart`,new en(i,1,0)),e.setAttribute(`instanceDistanceEnd`,new en(i,1,1)),this}raycast(e,t){let n=this.material.worldUnits,r=e.camera;if(r===null&&!n&&console.error(`LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.`),n===!1&&(this.material.resolution.x===0||this.material.resolution.y===0))return;let i=e.params.Line2===void 0?0:e.params.Line2.threshold||0;SO=e.ray;let a=this.matrixWorld,o=this.geometry,s=this.material;CO=s.linewidth+i,o.boundingSphere===null&&o.computeBoundingSphere(),bO.copy(o.boundingSphere).applyMatrix4(a);let c;if(c=n?CO*.5:wO(r,Math.max(r.near,bO.distanceToPoint(SO.origin)),s.resolution),bO.radius+=c,SO.intersectsSphere(bO)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),yO.copy(o.boundingBox).applyMatrix4(a);let l;l=n?CO*.5:wO(r,Math.max(r.near,yO.distanceToPoint(SO.origin)),s.resolution),yO.expandByScalar(l),SO.intersectsBox(yO)!==!1&&(n?fSe(this,t):pSe(this,r,t))}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(lO),this.material.uniforms.resolution.value.set(lO.z,lO.w))}},TO=class extends sO{constructor(){super(),this.isLineGeometry=!0,this.type=`LineGeometry`}setPositions(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}setFromPoints(e){let t=e.length-1,n=new Float32Array(6*t);for(let r=0;r<t;r++)n[6*r]=e[r].x,n[6*r+1]=e[r].y,n[6*r+2]=e[r].z||0,n[6*r+3]=e[r+1].x,n[6*r+4]=e[r+1].y,n[6*r+5]=e[r+1].z||0;return super.setPositions(n),this}fromLine(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}},hSe=class extends mSe{constructor(e=new TO,t=new cO({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type=`Line2`}},EO=new hn,DO=new hn,OO=new qn,kO=new hn,gSe=new yn,_Se=new yn,vSe=V(`<!> <!>`,1);function ySe(e,t){Ce(t,!0);let{scene:n}=Ww(),r=new Float32Array(120),i=new TO,a=q(()=>HD[t.handedness]),o=!0,s=(e=.3)=>{if(Q(a)===void 0)return;let n=Q(a).point;t.targetRay.getWorldPosition(EO),DO.x=(EO.x+n.x)/2,DO.y=(EO.y+n.y)/2,DO.z=(EO.z+n.z)/2;let s=Math.log1p(gSe.set(EO.x,EO.z).distanceTo(_Se.set(n.x,n.z)));DO.y+=s,o?(OO.v0.copy(EO),OO.v1.copy(DO),OO.v2.copy(n),o=!1):(OO.v0.lerp(EO,e),OO.v1.lerp(DO,e),OO.v2.lerp(n,e));for(let e=0,t=0;e<40;e+=1,t+=3){let n=e/40;OO.getPoint(n,kO),r[t+0]=kO.x,r[t+1]=kO.y,r[t+2]=kO.z}i.setPositions(r)};Qe(()=>{Q(a)===void 0&&(o=!0)}),Kw(()=>{s()},{running:()=>Q(a)!==void 0});var c=fe(),l=N(c),u=e=>{var n=fe(),r=N(n);ae(r,()=>t.children),X(e,n)},d=e=>{{let t=q(()=>Q(a)!==void 0);Uw(e,{get is(){return hSe},get attach(){return n},get visible(){return Q(t)},"position.z":-.01,children:(e,t)=>{var n=vSe(),r=N(n);Uw(r,{get is(){return i}}),Uw(g(r,2),{get is(){return cO},linewidth:3}),X(e,n)},$$slots:{default:!0}})}};G(l,e=>{t.children?e(u):e(d,-1)}),X(e,c),ue()}var AO=V(`<!> <!>`,1),bSe=V(`<!> <!> <!> <!>`,1);function jO(e,t){Ce(t,!0);let n=()=>z(u,`$controller`,r),[r,a]=Ve(),{scene:o}=Ww(),s=$D(),c=q(()=>s.current??o),l=t.left?`left`:t.right?`right`:t.hand??`left`,u=rSe(l);i(()=>DD({type:`controller`,handedness:l,callbacks:{onconnected:t.onconnected,ondisconnected:t.ondisconnected,onselect:t.onselect,onselectend:t.onselectend,onselectstart:t.onselectstart,onsqueeze:t.onsqueeze,onsqueezeend:t.onsqueezeend,onsqueezestart:t.onsqueezestart}}));let d=q(()=>n()?.grip),f=q(()=>n()?.targetRay),p=q(()=>n()?.model),m=q(()=>l===`left`?VD.left.enabled:VD.right.enabled),h=q(()=>l===`left`?BD.left.enabled:BD.right.enabled);var _=bSe(),v=N(_),y=e=>{Uw(e,{get is(){return Q(d)},get attach(){return Q(c)},children:(e,n)=>{var r=AO(),i=N(r),a=e=>{var n=fe(),r=N(n);ae(r,()=>t.children??qe),X(e,n)},o=e=>{Uw(e,{get is(){return Q(p)}})};G(i,e=>{t.children?e(a):e(o,-1)});var s=g(i,2);ae(s,()=>t.grip??qe),X(e,r)},$$slots:{default:!0}})};G(v,e=>{Q(d)&&e(y)});var b=g(v,2),x=e=>{Uw(e,{get is(){return Q(f)},get attach(){return Q(c)},children:(e,n)=>{var r=AO(),i=N(r);ae(i,()=>t.targetRay??qe);var a=g(i,2),o=e=>{lSe(e,{get handedness(){return l},get children(){return t.pointerRay}})};G(a,e=>{(Q(m)||Q(h))&&e(o)}),X(e,r)},$$slots:{default:!0}})};G(b,e=>{Q(f)&&e(x)});var S=g(b,2),C=e=>{sSe(e,{get handedness(){return l},get children(){return t.pointerCursor}})};G(S,e=>{Q(m)&&e(C)});var w=g(S,2),T=e=>{var n=AO(),r=N(n);ySe(r,{get targetRay(){return Q(f)},get handedness(){return l},get children(){return t.teleportRay}}),dSe(g(r,2),{get handedness(){return l},get children(){return t.teleportCursor}}),X(e,n)};G(w,e=>{Q(h)&&Q(f)!==void 0&&e(T)}),X(e,_),ue(),a()}var MO=new WeakMap,NO=e=>{if(e===void 0)return;let t=MO.get(e);return t===void 0?(t={targetRay:e.targetRay,hand:e.hand,model:e.model,inputSource:e.inputSource.hand},MO.set(e,t),t):t},PO=new class{get left(){return NO(MD(`left`))}get right(){return NO(MD(`right`))}},FO=e=>{switch(e){case`left`:return YD(()=>PO.left);case`right`:return YD(()=>PO.right);default:throw Error(`useHand handedness must be left or right.`)}},xSe=V(`<!> <!>`,1),SSe=V(`<!> <!> <!>`,1);function IO(e,t){Ce(t,!0);let n=()=>z(f,`$handStore`,r),[r,a]=Ve(),{scene:o,renderer:s,renderStage:c}=Ww(),l=$D(),u=q(()=>l.current??o),d=t.left?`left`:t.right?`right`:t.hand??`left`,f=FO(d);i(()=>DD({type:`hand`,handedness:d,callbacks:{onconnected:t.onconnected,ondisconnected:t.ondisconnected,onpinchend:t.onpinchend,onpinchstart:t.onpinchstart}}));let p=q(n),m=q(()=>Q(p)?.inputSource),h=q(()=>Q(p)?.model),_=Gw(Symbol(`xr-hand-stage`),{before:c}),v=new Pn;Kw(()=>{let e=s.xr.getFrame(),t=s.xr.getReferenceSpace(),n=Q(m)?.get(`wrist`);if(n===void 0||t===null)return;let r=e.getJointPose?.(n,t);if(r==null)return;let{position:i,orientation:a}=r.transform;v.position.set(i.x,i.y,i.z),v.quaternion.set(a.x,a.y,a.z,a.w)},{stage:_,running:()=>Q(m)!==void 0&&(t.wrist!==void 0||t.children!==void 0)});var y=fe(),b=N(y),x=e=>{var n=SSe(),r=N(n);Uw(r,{get is(){return Q(p).hand},get attach(){return Q(u)},children:(e,n)=>{var r=fe(),i=N(r),a=e=>{Uw(e,{get is(){return Q(h)}})};G(i,e=>{t.children===void 0&&e(a)}),X(e,r)},$$slots:{default:!0}});var i=g(r,2),a=e=>{Uw(e,{get is(){return Q(p).targetRay},get attach(){return Q(u)},children:(e,n)=>{var r=fe(),i=N(r);ae(i,()=>t.targetRay),X(e,r)},$$slots:{default:!0}})};G(i,e=>{t.targetRay!==void 0&&e(a)}),Uw(g(i,2),{get is(){return v},get attach(){return Q(u)},children:(e,n)=>{var r=xSe(),i=N(r);ae(i,()=>t.wrist??qe);var a=g(i,2);ae(a,()=>t.children??qe),X(e,r)},$$slots:{default:!0}}),X(e,n)};G(b,e=>{Q(p)?.hand&&e(x)}),X(e,y),ue(),a()}var LO=new Pn,RO=new fr,CSe=new hn,wSe=()=>
1199{let{renderer:e,camera:t,renderStage:n}=Ww(),r=Gw(Symbol(`xr-headset-stage`),{before:n}),i=$D(),{xr:a}=e;Kw(()=>{let e=a.getReferenceSpace();if(e===null)return;let t=a.getFrame().getViewerPose(e);if(t==null)return;let n=i.current;if(n===void 0){let{position:e,orientation:n}=t.transform;LO.position.copy(e),LO.quaternion.copy(n)}else n.updateWorldMatrix(!0,!1),RO.fromArray(t.transform.matrix).premultiply(n.matrixWorld),RO.decompose(LO.position,LO.quaternion,CSe)},{autoInvalidate:!1,stage:r,running:()=>FD.current}),Kw(()=>{t.current.getWorldPosition(LO.position),t.current.getWorldQuaternion(LO.quaternion)},{autoInvalidate:!1,stage:r,running:()=>FD.current===!1})},TSe=()=>{typeof window<`u`&&i(()=>{let e=ID.current;if(e===void 0)return;let t=ie.tick;return ie.tick=t=>e.requestAnimationFrame(t),()=>{ie.tick=t}})},zO={Handedness:Object.freeze({NONE:`none`,LEFT:`left`,RIGHT:`right`}),ComponentState:Object.freeze({DEFAULT:`default`,TOUCHED:`touched`,PRESSED:`pressed`}),ComponentProperty:Object.freeze({BUTTON:`button`,X_AXIS:`xAxis`,Y_AXIS:`yAxis`,STATE:`state`}),ComponentType:Object.freeze({TRIGGER:`trigger`,SQUEEZE:`squeeze`,TOUCHPAD:`touchpad`,THUMBSTICK:`thumbstick`,BUTTON:`button`}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:`transform`,VISIBILITY:`visibility`})};async function BO(e){let t=await fetch(e);if(t.ok)return t.json();throw Error(t.statusText)}async function ESe(e){if(!e)throw Error(`No basePath supplied`);return await BO(`${e}/profilesList.json`)}async function DSe(e,t,n=null,r=!0){if(!e)throw Error(`No xrInputSource supplied`);if(!t)throw Error(`No basePath supplied`);let i=await ESe(t),a;if(e.profiles.some(e=>{let n=i[e];return n&&(a={profileId:e,profilePath:`${t}/${n.path}`,deprecated:!!n.deprecated}),!!a}),!a){if(!n)throw Error(`No matching profile name found`);let e=i[n];if(!e)throw Error(`No matching profile name found and default profile "${n}" missing.`);a={profileId:n,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}let o=await BO(a.profilePath),s;if(r){let t;if(t=e.handedness===`any`?o.layouts[Object.keys(o.layouts)[0]]:o.layouts[e.handedness],!t)throw Error(`No matching handedness, ${e.handedness}, in profile ${a.profileId}`);t.assetPath&&(s=a.profilePath.replace(`profile.json`,t.assetPath))}return{profile:o,assetPath:s}}var OSe={xAxis:0,yAxis:0,button:0,state:zO.ComponentState.DEFAULT};function kSe(e=0,t=0){let n=e,r=t;if(Math.sqrt(e*e+t*t)>1){let i=Math.atan2(t,e);n=Math.cos(i),r=Math.sin(i)}return{normalizedXAxis:n*.5+.5,normalizedYAxis:r*.5+.5}}var ASe=class{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===zO.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(OSe)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:r}){let{normalizedXAxis:i,normalizedYAxis:a}=kSe(e,t);switch(this.componentProperty){case zO.ComponentProperty.X_AXIS:this.value=this.states.includes(r)?i:.5;break;case zO.ComponentProperty.Y_AXIS:this.value=this.states.includes(r)?a:.5;break;case zO.ComponentProperty.BUTTON:this.value=this.states.includes(r)?n:0;break;case zO.ComponentProperty.STATE:this.value=this.valueNodeProperty===zO.VisualResponseProperty.VISIBILITY?this.states.includes(r):+!!this.states.includes(r);break;default:throw Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}},jSe=class{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw Error(`Invalid arguments supplied`);this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(e=>{let n=new ASe(t.visualResponses[e]);this.visualResponses[e]=n}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:zO.ComponentState.DEFAULT,button:this.gamepadIndices.button===void 0?void 0:0,xAxis:this.gamepadIndices.xAxis===void 0?void 0:0,yAxis:this.gamepadIndices.yAxis===void 0?void 0:0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=zO.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){let t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=zO.ComponentState.PRESSED:(t.touched||this.values.button>zO.ButtonTouchThreshold)&&(this.values.state=zO.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===zO.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>zO.AxisTouchThreshold&&(this.values.state=zO.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===zO.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>zO.AxisTouchThreshold&&(this.values.state=zO.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEac
1199h(e=>{e.updateFromComponent(this.values)})}},MSe=class{constructor(e,t,n){if(!e)throw Error(`No xrInputSource supplied`);if(!t)throw Error(`No profile supplied`);this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(e=>{let t=this.layoutDescription.components[e];this.components[e]=new jSe(e,t)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){let e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}},NSe=`https://cdn.jsdelivr.net/npm/@webxr-input-profiles/[email protected]/dist/profiles`,PSe=`generic-trigger`,FSe=class extends Vn{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e?this:(this.envMap=e,this.traverse(e=>{e.isMesh&&(e.material.envMap=this.envMap,e.material.needsUpdate=!0)}),this)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(e=>{Object.values(e.visualResponses).forEach(e=>{let{valueNode:t,minNode:n,maxNode:r,value:i,valueNodeProperty:a}=e;t&&(a===zO.VisualResponseProperty.VISIBILITY?t.visible=i:a===zO.VisualResponseProperty.TRANSFORM&&(t.quaternion.slerpQuaternions(n.quaternion,r.quaternion,i),t.position.lerpVectors(n.position,r.position,i)))})}))}};function ISe(e,t){Object.values(e.components).forEach(e=>{let{type:n,touchPointNodeName:r,visualResponses:i}=e;if(n===zO.ComponentType.TOUCHPAD){if(e.touchPointNode=t.getObjectByName(r),e.touchPointNode){let t=new mt(.001),n=new bn({color:255}),r=new Nt(t,n);e.touchPointNode.add(r)}else console.warn(`Could not find touch dot, ${e.touchPointNodeName}, in touchpad component ${e.id}`)}Object.values(i).forEach(e=>{let{valueNodeName:n,minNodeName:r,maxNodeName:i,valueNodeProperty:a}=e;if(a===zO.VisualResponseProperty.TRANSFORM){if(e.minNode=t.getObjectByName(r),e.maxNode=t.getObjectByName(i),!e.minNode){console.warn(`Could not find ${r} in the model`);return}if(!e.maxNode){console.warn(`Could not find ${i} in the model`);return}}e.valueNode=t.getObjectByName(n),e.valueNode||console.warn(`Could not find ${n} in the model`)})})}function VO(e,t){ISe(e.motionController,t),e.envMap&&t.traverse(t=>{t.isMesh&&(t.material.envMap=e.envMap,t.material.needsUpdate=!0)}),e.add(t)}var LSe=class{constructor(e=null,t=null){this.gltfLoader=e,this.path=NSe,this._assetCache={},this.onLoad=t,this.gltfLoader||=new Da}setPath(e){return this.path=e,this}createControllerModel(e){let t=new FSe,n=null,r=0;return e.addEventListener(`connected`,e=>{let i=e.data;if(i.targetRayMode!==`tracked-pointer`||!i.gamepad||i.hand)return;let a=++r;DSe(i,this.path,PSe).then(({profile:e,assetPath:o})=>{if(a!==r)return;t.motionController=new MSe(i,e,o);let s=t.motionController.assetUrl,c=this._assetCache[s];if(c)n=c.scene.clone(),VO(t,n),this.onLoad&&this.onLoad(n);else{if(!this.gltfLoader)throw Error(`THREE.XRControllerModelFactory: GLTFLoader not set.`);this.gltfLoader.setPath(``),this.gltfLoader.load(s,e=>{this._assetCache[s]=e,a===r&&(n=e.scene.clone(),VO(t,n),this.onLoad&&this.onLoad(n))},null,()=>{throw Error(`THREE.XRControllerModelFactory: Asset ${s} missing or malformed.`)})}}).catch(e=>{console.warn(e)})}),e.addEventListener(`disconnected`,()=>{r++,t.motionController=null,t.remove(n),n=null}),t}},HO=new fr,UO=new hn,WO=class{constructor(e,t,n,r,i){this.controller=t,this.handModel=e,this.envMap=null;let a;!i||!i.primitive||i.primitive===`sphere`?a=new mt(1,10,10):i.primitive===`box`&&(a=new Dr(1,1,1));let o=new ir;this.handMesh=new jn(a,o,30),this.handMesh.frustumCulled=!1,this.handMesh.instanceMatrix.setUsage(_n),this.handMesh.castShadow=!0,this.handMesh.receiveShadow=!0,this.handModel.add(this.handMesh),this.joints=[`wrist`,`thumb-metacarpal`,`thumb-phalanx-proximal`,`thumb-phalanx-distal`,`thumb-tip`,`index-finger-metacarpal`,`index-finger-phalanx-proximal`,`index-finger-phalanx-intermediate`,`index-finger-phalanx-distal`,`index-finger-tip`,`middle-finger-metacarpal`,`middle-finger-phalanx-proximal`,`middle-finger-phalanx-intermediate`,`middle-finger-phalanx-distal`,`middle-finger-tip`,`ring-finger-metacarpal`,`r
1199ing-finger-phalanx-proximal`,`ring-finger-phalanx-intermediate`,`ring-finger-phalanx-distal`,`ring-finger-tip`,`pinky-finger-metacarpal`,`pinky-finger-phalanx-proximal`,`pinky-finger-phalanx-intermediate`,`pinky-finger-phalanx-distal`,`pinky-finger-tip`]}updateMesh(){let e=this.controller.joints,t=0;for(let n=0;n<this.joints.length;n++){let r=e[this.joints[n]];r.visible&&(UO.setScalar(r.jointRadius||.008),HO.compose(r.position,r.quaternion,UO),this.handMesh.setMatrixAt(n,HO),t++)}this.handMesh.count=t,this.handMesh.instanceMatrix.needsUpdate=!0}},RSe=`https://cdn.jsdelivr.net/npm/@webxr-input-profiles/[email protected]/dist/profiles/generic-hand/`,zSe=class{constructor(e,t,n,r,i=null,a=null,o=null){this.controller=t,this.handModel=e,this.bones=[];let s=n||RSe,c=e=>{let t=Ua(e.scene.children[0]);this.handModel.add(t);let n=t.getObjectByProperty(`type`,`SkinnedMesh`);n.frustumCulled=!1,n.castShadow=!0,n.receiveShadow=!0,[`wrist`,`thumb-metacarpal`,`thumb-phalanx-proximal`,`thumb-phalanx-distal`,`thumb-tip`,`index-finger-metacarpal`,`index-finger-phalanx-proximal`,`index-finger-phalanx-intermediate`,`index-finger-phalanx-distal`,`index-finger-tip`,`middle-finger-metacarpal`,`middle-finger-phalanx-proximal`,`middle-finger-phalanx-intermediate`,`middle-finger-phalanx-distal`,`middle-finger-tip`,`ring-finger-metacarpal`,`ring-finger-phalanx-proximal`,`ring-finger-phalanx-intermediate`,`ring-finger-phalanx-distal`,`ring-finger-tip`,`pinky-finger-metacarpal`,`pinky-finger-phalanx-proximal`,`pinky-finger-phalanx-intermediate`,`pinky-finger-phalanx-distal`,`pinky-finger-tip`].forEach(e=>{let n=t.getObjectByName(e);n===void 0?console.warn(`Couldn't find ${e} in ${r} hand mesh`):n.jointName=e,this.bones.push(n)}),a&&a(t)},l=`${s}${r}.glb`;o&&o[l]?c(o[l]):(i===null&&(i=new Da,i.setPath(s)),i.load(`${r}.glb`,e=>{o&&(o[l]=e),c(e)}))}updateMesh(){let e=this.controller.joints;for(let t=0;t<this.bones.length;t++){let n=this.bones[t];if(n){let t=e[n.jointName];if(t.visible){let e=t.position;n.position.copy(e),n.quaternion.copy(t.quaternion)}}}}},BSe=class extends Vn{constructor(e){super(),this.controller=e,this.motionController=null,this.envMap=null,this.mesh=null}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&this.motionController.updateMesh()}},VSe=class{constructor(e=null,t=null){this.gltfLoader=e,this.path=null,this._assetCache={},this.onLoad=t}setPath(e){return this.path=e,this}createHandModel(e,t){let n=new BSe(e);return e.addEventListener(`connected`,r=>{let i=r.data;i.hand&&!n.motionController&&(n.xrInputSource=i,t===void 0||t===`spheres`?n.motionController=new WO(n,e,this.path,i.handedness,{primitive:`sphere`}):t===`boxes`?n.motionController=new WO(n,e,this.path,i.handedness,{primitive:`box`}):t===`mesh`&&(n.motionController=new zSe(n,e,this.path,i.handedness,this.gltfLoader,this.onLoad,this._assetCache)))}),e.addEventListener(`disconnected`,()=>{n.clear(),n.motionController=null}),n}},HSe=e=>`${e.handedness}-${e.hand?`hand`:`nohand`}-${e.targetRayMode}-${e.profiles.join(`,`)}`,GO=()=>{let e=new Pn;return e.matrixAutoUpdate=!1,e.visible=!1,e.hasLinearVelocity=!1,e.linearVelocity=new hn,e.hasAngularVelocity=!1,e.angularVelocity=new hn,e},USe=()=>GO(),WSe=()=>GO(),GSe=()=>{let e=new Pn;return e.matrixAutoUpdate=!1,e.visible=!1,e.joints={},e.inputState={pinching:!1},e},KO=e=>{if(e.targetRay.visible=!1,e.type===`controller`&&(e.grip.visible=!1),e.type===`hand`){e.hand.visible=!1;for(let t of Object.values(e.hand.joints??{}))t.visible=!1;e.hand.inputState.pinching=!1}},qO=(e,t)=>{let n=e.joints[t.jointName];if(n!==void 0)return n;let r=new Pn;return r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r),r},JO=e=>{let t=e.hand;for(let n of e.inputSource.hand.values())qO(t,n)},YO=(e,t)=>{if(t==null){e.visible=!1,e.hasLinearVelocity=!1,e.hasAngularVelocity=!1;return}e.matrix.fromArray(t.transform.matrix),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0,e.visible=!0,`linearVelocity`in t&&t.linearVelocity!==null&&t.linearVelocity!==void 0?(e.hasLinearVelocity=!0,e.linearVelocity.copy(t.linearVelocity)):e.hasLinearVelocity=!1,`angularVelocity`in t&&t.angularVelocity!==null&&t.angularVelocity!==void 0?(e.hasAngularVelocity=!0,e.angularVelocity.copy(t.angularVelocity)):e.hasAngularVelocity=!1},KSe=e=>{let t=e.hand,n=t.inputState,r=t.joints[`index-finger-tip`],i=t.joints[`thumb-tip`];if(r===void 0||i===void 0||!r.visible||!i.visible){n.pinching&&(n.pinching=!1,kD(e,`pinchend`,OD(e,`pinchend`,{handedness:e.handedness,target:t})));return}let a=r.position.distanceTo(i.position);n.pinching&&a>.025?(n.pinching=!1,kD(e,`pinchend`,OD(e,`pinchend`,{handedness:e.handedness,target:t}))):!n.pinching&&a<=.015&&(n.pinching=!0,kD(e,`pinchstart`,OD(e,`pinchstart`,{handedness:e.handedness,target:t})))},qSe=(e,t,n)=>{let r;e.inputSource.gripSpace!==void 0&&(r=t.getPose(e.inputSource.gripSpace,n),YO(e.grip,r));let i=t.getPose(e.inputSource.targetRaySpace,n);i===null&&r!=null&&(i=r),YO(e.targetRay,i),(e.inputSource.gripSpace===void 0||r==null)&&YO(e.grip,i)},JSe=(e,t,n)=>{YO(e.targetRay,t.getPose(e.inputSource.targetRaySpace,n));let r=e.hand;JO(e);let i=!1;for(let a of e.inputSource.hand.values()){let e=t.getJointPose?.(a,n),o=qO(r,a);e!=null&&(o.matrix.fromArray(e.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.matrixWorldNeedsUpdate=!0,o.jointRadius=e.radius,i=!0),o.visible=e!=null}r.visible=i,KSe(e)},YSe=(e,t,n)=>{if(t.session.visibilityState===`visible-blurred`||t.session.visibilityState===`hidden`){KO(e);return}switch(e.type){case`controller`:qSe(e,t,n);break;case`hand`:JSe(e,t,n);break;default:YO(e.targetRay,t.getPose(e.inputSource.targetRaySpace,n))}},XSe=0,ZSe=(e,t,n,r,i)=>{let a={id:e,inputSource:t,handedness:t.handedness,isPrimary:n,targetRay:USe()};if(t.hand!=null){if(t.handedness===`none`)return;let e=GSe(),n={...a,type:`hand`,inputSource:t,hand:e,model:i.createHandModel(e,`mesh`)};return JO(n),n}switch(t.targetRayMode){case`gaze`:return{...a,type:`gaze`};case`screen`:return{...a,type:`screenInput`};case`transient-pointer`:return{...a,type:`transientPointer`};default:{let e=WSe();return{...a,type:`controller`,grip:e,model:r.createControllerModel(e)}}}},QSe=(e,t)=>{let n=new Map;return(r,i,a)=>
1199{if(a===`remove-all`){for(let e of i)kD(e,`disconnected`,OD(e,`disconnected`)),KO(e);return[]}let o=[...i];for(let{added:r,isPrimary:i,removed:s}of a){if(s!=null)for(let e of s){let t=o.findIndex(t=>t.isPrimary===i&&t.inputSource===e);if(t===-1)continue;let[n]=o.splice(t,1);kD(n,`disconnected`,OD(n,`disconnected`)),KO(n)}if(r!=null)for(let a of r){if(o.some(e=>e.isPrimary===i&&e.inputSource===a))continue;let r=HSe(a),s=n.get(r);s??(s=`${XSe++}`,n.set(r,s));let c=ZSe(s,a,i,e,t);c!==void 0&&(o.push(c),kD(c,`connected`,OD(c,`connected`)))}}return o}},$Se=e=>{let t;return n=>{if(t?.(),t=void 0,n==null){TD.current=[];return}let r=[],i=()=>{TD.current=e(n,TD.current,r),r.length=0},a=e=>{r.push({isPrimary:!0,added:e.added,removed:e.removed}),i()};n.addEventListener(`inputsourceschange`,a),TD.current=e(n,[],[{isPrimary:!0,added:n.inputSources}]),t=()=>{TD.current=e(n,TD.current,`remove-all`),n.removeEventListener(`inputsourceschange`,a)}}},eCe=(e,t)=>{let{xr:n}=Ww().renderer,r=$Se(QSe(e??new LSe,t??new VSe));return Kw(()=>{let e=n.getFrame(),t=n.getReferenceSpace();if(e!==null&&t!==null)for(let n of TD.current)YSe(n,e,t)},{running:()=>TD.current.length>0}),r};function tCe(e,t){Ce(t,!0);let n=[`select`,`selectstart`,`selectend`,`squeeze`,`squeezestart`,`squeezeend`],r=J(t,`foveation`,3,1),a=J(t,`referenceSpace`,3,`local-floor`),o=J(t,`enterGrantedSession`,3,!0),s=J(t,`offerSession`,3,!0),{renderer:c,renderMode:l}=Ww();TSe(),wSe();let u=eCe(t.controllerFactory,t.handFactory),d=e=>{FD.current=!0,t.onsessionstart?.(e)},f=e=>{t.onsessionend?.(e),FD.current=!1,ID.current=void 0,UD.left=void 0,UD.right=void 0,HD.left=void 0,HD.right=void 0},p=e=>{t.onvisibilitychange?.(e)},m=e=>{t.oninputsourceschange?.(e)},h=e=>{t.onframeratechange?.(e)},g=e=>{Gxe(e)};Qe(()=>{let e=ID.current;if(e===void 0){u(void 0);return}u(e),e.addEventListener(`visibilitychange`,p),e.addEventListener(`inputsourceschange`,m),e.addEventListener(`frameratechange`,h),e.addEventListener(`end`,f);for(let t of n)e.addEventListener(t,g);return()=>{e.removeEventListener(`visibilitychange`,p),e.removeEventListener(`inputsourceschange`,m),e.removeEventListener(`frameratechange`,h),e.removeEventListener(`end`,f);for(let t of n)e.removeEventListener(t,g);u(void 0)}}),i(()=>{if(!FD.current)return;let e=K(()=>l.current);return l.set(`always`),()=>{l.set(e)}}),i(()=>(RD.current=c.xr,c.xr.enabled=!0,c.xr.addEventListener(`sessionstart`,d),()=>{RD.current=void 0,c.xr.enabled=!1,c.xr.removeEventListener(`sessionstart`,d),K(()=>ID.current)?.end().catch(()=>{})})),i(()=>{if(t.frameRate!==void 0)try{ID.current?.updateTargetFrameRate(t.frameRate)}catch{}}),i(()=>{c.xr.setFoveation(r())}),i(()=>{c.xr.setReferenceSpaceType(a()),LD.current=a()}),i(()=>{if(o()===!1)return;let e=Array.isArray(o())?o():[`immersive-ar`,`immersive-vr`],t=async()=>{if(zD.mode!==void 0&&e.includes(zD.mode)){KD(zD.mode,zD.sessionInit,`enter`).catch(()=>{});return}for(let t of e)if(await navigator.xr?.isSessionSupported(t).catch(()=>!1)){KD(t,{...JD},`enter`).catch(()=>{});return}};return navigator.xr?.addEventListener(`sessiongranted`,t),()=>{navigator.xr?.removeEventListener(`sessiongranted`,t)}}),i(()=>{if(navigator.xr===void 0||s()===!1||!(`offerSession`in navigator.xr)||ID.current!==void 0)return;let e=RD.current;if(e===void 0)return;let t=!1;return(async()=>{let n;n=s()===!0?await navigator.xr?.isSessionSupported(`immersive-ar`).catch(()=>!1)?`immersive-ar`:`immersive-vr`:s();let r=WD(LD.current,zD.sessionInit,JD);try{let i=await navigator.xr?.offerSession?.(n,r);if(!i||t||(await e.setSession(i),t))return;zD.mode=n,zD.sessionInit=r,ID.current=i}catch{}})(),()=>{t=!0}});var _=fe(),v=N(_),y=e=>{var n=fe(),r=N(n);ae(r,()=>t.children??qe),X(e,n)},b=e=>{var n=fe(),r=N(n);ae(r,()=>t.fallback??qe),X(e,n)};G(v,e=>{FD.current?e(y):e(b,-1)}),X(e,_),ue()}new hn,new hn,new zt,new hn,new hn,new hn,new hn,new zt,new zt,new zt,new fr,new fr,new fr,new hn,new hn,new $t,new fr,new hn,new hn,new hn,new mr;var XO=[{value:`properties`,label:`Open properties`,hint:`The panel for that object (default)`},{value:`meshedit`,label:`Edit mesh`,hint:`Jump straight into vertex/edge/face editing`},{value:`isolate`,label:`Focus and isolate`,hint:`Frame it and hide everything else until Esc`},{value:`sametype`,label:`Select same type`,hint:`Select every object of the same kind`}],ZO=`doubleClickAction`,nCe=typeof localStorage<`u`&&XO.some(e=>e.value===nt.getItem(ZO))?nt.getItem(ZO):`properties`,QO=Ue(nCe);typeof localStorage<`u`&&QO.subscribe(e=>nt.setItem(ZO,e));var $O=6,ek=2.5,tk=.8,nk=6,rCe=.25,iCe=14,aCe=4,oCe=20,sCe=400,cCe=20,lCe=1.7,rk=Ue({mode:`off`,distance:ek,uuid:null,blocked:null,reason:null}),ik=new Wn,ak=new yn(0,0),ok=new hn,sk=new hn,ck=new hn,lk=new zt,uk=new zt,dk=new rt(0,0,0,`YXZ`),fk=null,pk=new yn,mk=ek,hk=null,gk=!1,_k=null,vk=null,yk=`none`;function bk(){return!U(ki)||U(wi)||U(Jr)?`off`:yl(U(Pi)).interaction}function xk(){return!!U(lh)||!!U(th)}function Sk(){return yl(U(Pi)).reach}function Ck(){let e=Number(U(Df)?.eyeHeight);return Number.isFinite(e)&&e>0?e:lCe}function wk(e,t,n=null,r=!1){if(!e)return{ok:!0};let i=Sk(),a=t.getWorldPosition(new hn),o=a.y-Ck();return Dee({point:e,eye:a,feetY:o,reach:i,uuid:n?.uuid,name:n?.name,hand:`desktop`,silent:r})??{ok:i==null||Oee(e,a,o,i)}}var Tk=0;function Ek(){let e=new Set;for(let t of ch())t.mode===`dynamic`&&e.add(t.uuid);return e}function Dk(e){e.getWorldPosition(ok);let t=Cl();return ak.set(t.x,t.y),ik.setFromCamera(ak,e),sk.copy(ik.ray.direction),Ch(ik,{})}function uCe(){let e=U(Pi);if(!e||!_k)return!1;for(let t of al){let n=e.getObjectByName(t);if(!n)continue;let r=ik.intersectObject(n,!0);if(r.length>0&&_k(r[0].object))return!0}return!1}function Ok(){return U(vi)===`interact`&&U(ki)!==!0&&!U(wi)}function kk(e,t,n){if(!Ok()||fk||!n||!xk())return!1;let r=Ch(e,{})[0],i=r?wm(r.object):null;if(!i||!Ek().has(i.uuid)||!ld()||U(Ci).some(e=>e[1]===i.uuid))return!1;if(!gf(i))return hf(),!1;vk=n,pk.set(t.x,t.y),n.getWorldPosition(ok),Nk(i,n);let a=fk;return a&&(a.cursor=!0),!!a}function Ak(e){fk?.cursor&&pk.set(e.x,e.y)}function jk(){return fk?.cursor?(Pk(!0),!0):!1}function Mk(e){let t=U(Pi);for(let n of al){let r=t?.getObjectByName(n);if(!r)continue;let i=e.intersectObject(r,!0);if(i.length>0&&il(i[0].object,`interact`))return`module-group`}let n=Th(Ch(e,{tinyProxies:!0}),wm),r=n.length?n[wse(n)]:null,i=r?.hit??null;if(i&&il(i.object,`interact`))return`module-handler`;let a=r?.target??null;return a?(ud(a.uuid),`click`):(sl(),`miss`)}function dCe(e){let t=e?.userData?.physics?.mass;return typeof t==`number`&&t>0?t:1}function Nk(e,t){xc(`grab`,{source:`play`}),dk.setFromQuaternion(t.getWorldQuaternion(uk),`YXZ`),lk.setFromEuler(new rt(0,dk.y,0,`YXZ`)),fk={object:e,relQuat:lk.clone().invert().multiply(e.quaternion.clone()),mass:dCe(e),held:ih()?nh(e.uuid):!1,samples:[],lastSent:0},mk=Math.min(nk,Math.max(tk,ok.distanceTo(e.getWorldPosition(ck)))),cd(e.uuid),rk.set({mode:`carrying`,distance:mk,uuid:e.uuid,blocked:null}),Ane(e.uuid)}function Pk(e){if(!fk)return null;let{object:t,samples:n,held:r}=fk,i=e?$m(n):{linvel:[0,0,0],angvel:[0,0,0]};return fk=null,sd(t.uuid),r?dh(t.uuid,i):fCe(t,i,e),rk.update(e=>({...e,mode:`idle`,uuid:null})),{uuid:t.uuid,velocity:i}}function fCe(e,t,n){if(!n||!xk())return!1;let r=t.linvel?.toArray?.()??t.linvel??[0,0,0],i=t.angvel?.toArray?.()??t.angvel??[0,0,0];if(Math.hypot(r[0],r[1],r[2])<.05)return!1;let a=U(Es);return a?(a.send({type:`throw`,uuid:e.uuid,pos:e.position.toArray(),rot:[e.rotation.x,e.rotation.y,e.rotation.z],linvel:r,angvel:i}),!0):!1}function Fk(e){if(e.button!==0||Sl()&&!pCe(e))return;let t=bk();if(t===`off`||!vk)return;let n=Dk(vk).find(e=>e.distance<=$O),r=n?wm(n.object):null;
1199if(hk={t:performance.now(),uuid:r?.uuid??null,hit:n??null},t!==`grab`||!r||e.pointerType===`touch`||!xk()||!Ek().has(r.uuid)||!ld())return;if(!wk(n.point,vk,r).ok){Tk++,yk=`too-far`;return}let i=U(Ci).find(e=>e[1]===r.uuid);if(i){rk.update(e=>({...e,blocked:hh(i[0])}));return}if(!gf(r)){hf();return}Nk(r,vk)}function pCe(e){let t=e.target;return!!t&&t.tagName===`CANVAS`&&!!t.closest?.(`.viewport`)}function Ik(e){if(e.button!==0)return;let t=hk;if(hk=null,fk){Pk(!0);return}if(e.defaultPrevented){yk=`touch-gesture`;return}if(!t||bk()===`off`){yk=t?`mode-off`:`no-press`;return}if(bk()===`grab`&&performance.now()-t.t>sCe){yk=`too-long`;return}if(uCe()){yk=`module-group`;return}if(t.hit&&_k&&_k(t.hit.object)){yk=`module-handler`;return}sl(),yk=t.uuid?`click`:`no-target`,t.uuid&&ud(t.uuid)}function Lk(e){fk&&(e.preventDefault(),mk=Math.min(nk,Math.max(tk,mk+(e.deltaY>0?-.25:rCe))),rk.update(e=>({...e,distance:mk})))}function Rk(e,t){vk=t??vk;let n=!!fk?.cursor;if(n&&(!Ok()||!t)){Pk(!1);return}let r=n?`grab`:bk();if(r===`off`||!t){fk&&Pk(!1),U(rk).mode!==`off`&&rk.set({mode:`off`,distance:mk,uuid:null,blocked:null});return}if(fk){let n=U(Ui);if(!xk()||!n?.getObjectByProperty(`uuid`,fk.object.uuid)){Pk(!1);return}if(fk.cursor)ik.setFromCamera(pk,t),ok.copy(ik.ray.origin),sk.copy(ik.ray.direction);else{t.getWorldPosition(ok);let e=Cl();ak.set(e.x,e.y),ik.setFromCamera(ak,t),sk.copy(ik.ray.direction)}let r=fk.cursor?mk:kee(sk,Ck(),Sk(),mk);ck.copy(ok).addScaledVector(sk,Math.min(mk,r));let i=Math.min(oCe,Math.max(aCe,iCe/Math.sqrt(Math.max(fk.mass,1)))),a=1-Math.exp(-i*Math.max(e,.001));fk.object.position.lerp(ck,a),dk.setFromQuaternion(t.getWorldQuaternion(uk),`YXZ`),lk.setFromEuler(new rt(0,dk.y,0,`YXZ`)),uk.copy(lk).multiply(fk.relQuat),fk.object.quaternion.slerp(uk,a),fk.object.updateMatrixWorld();let o=performance.now();if(fk.samples.push({t:o,pos:fk.object.position.clone(),quat:fk.object.quaternion.clone()}),fk.samples.length>4&&fk.samples.shift(),o-fk.lastSent>1e3/cCe){fk.lastSent=o;let e=U(Es);e&&e.send({type:`move`,uuid:fk.object.uuid,pos:fk.object.position.toArray(),rot:[fk.object.rotation.x,fk.object.rotation.y,fk.object.rotation.z],scale:fk.object.scale.toArray()})}ci();return}let i=Dk(t).find(e=>e.distance<=$O),a=i?wm(i.object):null,o=r===`grab`&&!!a&&xk()&&Ek().has(a.uuid),s=U(rk),c=o?wk(i.point,t,a,!0):null,l=o?c?.ok?`aiming`:`toofar`:`idle`,u=c&&!c.ok?c.reason??null:null;(s.mode!==l||s.uuid!==(a?.uuid??null)||(s.reason??null)!==u)&&rk.set({mode:l,distance:mk,uuid:a?.uuid??null,blocked:null,reason:u})}function zk(e={}){return gk||typeof window>`u`?()=>{}:(gk=!0,_k=e.moduleHitTest??null,window.addEventListener(`pointerdown`,Fk),window.addEventListener(`pointerup`,Ik),window.addEventListener(`wheel`,Lk,{capture:!0,passive:!1}),Bk)}function Bk(){gk&&(gk=!1,fk&&Pk(!1),hk=null,_k=null,vk=null,rk.set({mode:`off`,distance:mk,uuid:null,blocked:null}),window.removeEventListener(`pointerdown`,Fk),window.removeEventListener(`pointerup`,Ik),window.removeEventListener(`wheel`,Lk,{capture:!0}))}function Vk(){return fk?.object?.uuid??null}function mCe(){return{started:gk,mode:bk(),carrying:fk?.object?.uuid??null,cursor:!!fk?.cursor,held:!!fk?.held,distance:mk,lastUp:yk,samples:fk?.samples.length??0,reach:Sk(),reachRefusals:Tk}}var Hk=.35,hCe=400;function Uk(e,t){return{id:e,radius:t,external:!1,lastAt:0,samples:[],contacts:new Map}}function Wk(e,t,n,r){for(e.samples.push({t:r,pos:t.clone(),quat:n?n.clone():null}),e.lastAt=r;e.samples.length>6;)e.samples.shift();for(;e.samples.length>2&&r-e.samples[0].t>100;)e.samples.shift()}function gCe(e){return $m(e.samples).linvel}function _Ce(e){let t=e.samples[e.samples.length-1];return t?t.pos:null}var Gk=new hn,Kk=new hn;function qk(e,t,n,r,i,a){Gk.subVectors(r,e);let o=Gk.length(),s=o<t+i,c=new hn;if(o>1e-6)c.copy(Gk).divideScalar(o);else if(n.lengthSq()>1e-12)c.copy(n).normalize();else return{overlap:s,distance:o,n:c.set(0,1,0),approach:0};return Kk.subVectors(n,a),{overlap:s,distance:o,n:c,approach:Kk.dot(c)}}function Jk(e){let{bodyVel:t,bodyAngvel:n,probeVel:r,n:i,approach:a,bodyRadius:o,gain:s,spin:c,maxSpeed:l}=e,u=t.clone().addScaledVector(i,a*s),d=n.clone();if(c>0&&o>
11991e-4){let e=r.clone().sub(t),n=e.addScaledVector(i,-e.dot(i)),a=i.clone().multiplyScalar(-o);d.add(a.cross(n).multiplyScalar(c/(o*o)))}let f=nse(u,d),p=Math.min(Number.isFinite(l)?l:20,20);return f.linvel.length()>p&&f.linvel.setLength(p),f}function Yk(e,t,n,r){let i=e.contacts.get(t);return i||(i={spent:!1,outSince:null},e.contacts.set(t,i)),n?i.spent?i.outSince!=null&&r-i.outSince>=60?(i.spent=!1,i.outSince=null,!0):(i.outSince=null,!1):(i.outSince=null,!0):(i.outSince??(i.outSince=r),!1)}function Xk(e,t){let n=e.contacts.get(t);n&&(n.spent=!0,n.outSince=null)}function vCe(e,t){for(let n of[...e.contacts.keys()])t.has(n)||e.contacts.delete(n)}var Zk=new Or,Qk=new Or,$k=new fr,eA=new fr,tA=new $t;function nA(e){let t=e?.geometry;if(t){t.boundingSphere||t.computeBoundingSphere();let e=t.boundingSphere;return{center:e.center.clone(),radius:e.radius}}return Zk.makeEmpty(),e.updateWorldMatrix(!0,!0),eA.copy(e.matrixWorld).invert(),e.traverse(e=>{e.geometry&&(e.geometry.boundingBox||e.geometry.computeBoundingBox(),$k.multiplyMatrices(eA,e.matrixWorld),Qk.copy(e.geometry.boundingBox).applyMatrix4($k),Zk.union(Qk))}),Zk.isEmpty()?{center:new hn,radius:.5}:(Zk.getBoundingSphere(tA),{center:tA.center.clone(),radius:tA.radius})}function yCe(e){let t=e?.scale;return t&&Math.max(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z))||1}var bCe=200,xCe=32,SCe=8,rA=new Map,iA=null,aA=null,oA=null,sA=!1,cA=new Map,lA={at:-1/0,uuids:new Set},uA=new Map,dA=new Map,fA=new Set,pA=new Map,mA=[],hA=0,gA=0,_A=Ue(0),vA=Ue(!1),yA=new hn,bA=new zt,xA=new zt,CCe=new hn,SA=new hn,CA=new hn;new hn;function wA(){return!U(hl)?.enabled||!U(lh)&&!U(th)?!1:U(ki)===!0||U(wi)===!0&&U(vi)===`interact`}function TA(e,t){if(e-lA.at<bCe&&lA.at<=e)return lA.uuids;let n=new Set;for(let e of ch())e.mode===`dynamic`&&n.add(e.uuid);lA={at:e,uuids:n};for(let e of[...cA.keys()])n.has(e)||cA.delete(e);for(let e of[...uA.keys()])n.has(e)||uA.delete(e);for(let e of[...pA.keys()])t?.getObjectByProperty(`uuid`,e)||pA.delete(e);for(let e of rA.values())vCe(e,n);return n}function wCe(e){let t=`${e.geometry?.uuid??e.children.length}|${e.scale.x}|${e.scale.y}|${e.scale.z}`,n=cA.get(e.uuid);if(!n||n.key!==t){let r=nA(e);n={key:t,center:r.center,radius:r.radius*yCe(e)},cA.set(e.uuid,n)}return e.updateMatrix(),{centre:CCe.copy(n.center).applyMatrix4(e.matrix),radius:n.radius}}function EA(e){let t=performance.now(),n=uA.get(e.uuid);for(n||(n=[],uA.set(e.uuid,n)),n.push({t,pos:e.position.clone()});n.length>SCe;)n.shift();for(;n.length>2&&t-n[0].t>200;)n.shift()}function TCe(e){let t=ih()?oh(e):null;if(t)return SA.fromArray(t.linvel),CA.fromArray(t.angvel),{linvel:SA,angvel:CA,held:t.held,hold:t.hold};let n=uA.get(e);return n&&n.length>=2?SA.copy($m(n).linvel):SA.set(0,0,0),CA.set(0,0,0),{linvel:SA,angvel:CA,held:!1,hold:null}}function DA(e,t){let n=rA.get(e);return n||(n=Uk(e,t),rA.set(e,n)),n.radius=t,n}function OA(e,t,n,r,i,a){yA.fromArray(r),n.worldToLocal(yA);let o=null;i&&(n.getWorldQuaternion(xA).invert(),o=bA.fromArray(i).premultiply(xA));let s=DA(e,t);return s.external=!1,Wk(s,yA,o,a),s}function kA(e,t,n,r){let i=U(hl),a=_Ce(e);if(!a)return{hits:0,overlaps:0};let o=gCe(e),s=new Set((aA?.()??[]).filter(Boolean)),c=0,l=0;for(let u of n.children){let n=u.uuid;if(!r.has(n)||s.has(n))continue;let d=wCe(u),f=TCe(n);if(f.held)continue;let p=qk(a,e.radius,o,d.centre,d.radius,f.linvel),m=Yk(e,n,p.overlap,t);if(!p.overlap||(l++,!m||p.approach<=i.minSpeed))continue;let h=Jk({bodyVel:f.linvel,bodyAngvel:f.angvel,probeVel:o,n:p.n,approach:p.approach,bodyRadius:d.radius,gain:i.gain,spin:i.spin,maxSpeed:i.maxSpeed}),g=d.centre.clone().addScaledVector(p.n,-d.radius);ECe(e,u,p.approach,g,h)&&(Xk(e,n),c++)}return{hits:c,overlaps:l}}function ECe(e,t,n,r,i){let a=U(Es),o=a?.peer?.id??``;hA=Math.max(yc(),hA+1);let s={uuid:t.uuid,linvel:i.linvel.toArray(),angvel:i.angvel.toArray(),point:r.toArray(),speed:n,at:hA,by:o,probe:e.id};if(ih()){if(!ah(s)&&oh(t.uuid)?.hold!==`external`)return!1}else U(hl).predict&&ACe(t,i.linvel);return a&&(gA++,a.send({type:`hit`,uuid:s.uuid,linvel:s.linvel,angvel:s.angvel,point:s.point,speed:s.speed,at:s.at,probe:s.probe})),oA&&(e.id===`left`||e.id===`right`)&&oA(Math.min(1,.2+n/10),30,e.id),AA(s,!0),!0}function AA(e,t){for(pA.set(e.uuid,e),mA.push(e);mA.length>xCe;)mA.shift();_A.update(e=>e+1);for(let n of fA)try{n(e,t)}catch(e){console.log(`knock: hit listener failed`,e)}}function jA(e){return Array.isArray(e)?[Number(e[0])||0,Number(e[1])||0,Number(e[2])||0]:[0,0,0]}function MA(e,t){return!e||typeof e.uuid!=`string`||!U(Ui)?.getObjectByProperty(`uuid`,e.uuid)?!1:(AA({uuid:e.uuid,linvel:jA(e.linvel),angvel:jA(e.angvel),point:jA(e.point),speed:Number.isFinite(Number(e.speed))?Number(e.speed):0,at:Number.isFinite(Number(e.at))?Number(e.at):yc(),by:t??``,probe:typeof e.probe==`string`?e.probe:``},!1),!0)}function DCe(e){return fA.add(e),()=>{fA.delete(e)}}function OCe(e){return pA.get(e)??null}function kCe(){let e=U(Ui),t={};for(let[n,r]of pA)e?.getObjectByProperty(`uuid`,n)&&(t[n]={...r});return{last:t,recent:mA.map(e=>({...e}))}}function ACe(e,t){let n=performance.now();dA.set(e.uuid,{vel:t.clone(),from:{pos:e.position.clone(),quat:e.quaternion.clone()},startedAt:n,lastTick:n})}function jCe(e,t){if(dA.size!==0){for(let[n,r]of[...dA.entries()]){let i=t.getObjectByProperty(`uuid`,n);if(!i){dA.delete(n);continue}if(e-r.startedAt>400){i.position.copy(r.from.pos),i.quaternion.copy(r.from.quat),dA.delete(n);continue}let a=Math.min(.1,Math.max(0,(e-r.lastTick)/1e3));r.lastTick=e,i.position.addScaledVector(r.vel,a)}Ui.update(e=>e)}}function NA(e){return dA.delete(e)}function MCe(){for(let e of rA.values())e.external||(e.samples=[],e.contacts.clear());dA.clear(),uA.clear()}function PA(e,t){if(!sA)return;let n=wA();if(U(vA)!==n&&vA.set(n),!n){(rA.size||dA.size)&&MCe();return}let r=U(Ui);if(!r)return;r.updateWorldMatrix(!0,!1);let i=U(hl);if(U(wi))for(let t of[`left`,`right`]){let n=iA?.(t);if(!n?.position||n.gripped){rA.get(t)?.samples.splice(0);continue}OA(t,i.radius,r,n.position,n.quaternion??null,e)}else t&&U(ki)===!0&&(t.getWorldPosition(yA),t.getWorldQuaternion(bA),OA(`head`,Hk,r,yA.toArray(),bA.toArray(),e));let a=TA(e,r);if(jCe(e,r),!ih())for(let e of r.children)a.has(e.uuid)&&EA(e);for(let t of rA.values())t.external||t.samples.length<2||kA(t,e,r,a)}function NCe(e,t,n,r={}
1199){let i=DA(e,r.radius??U(hl)?.radius??.12);if(i.external=!0,yA.fromArray(jA(t)),Wk(i,yA,r.quat?bA.fromArray(r.quat):null,n),!wA())return{hits:0,overlaps:0,armed:!1};let a=U(Ui);if(!a)return{hits:0,overlaps:0,armed:!0};a.updateWorldMatrix(!0,!1);let o=TA(n,a);if(!ih())for(let e of a.children)o.has(e.uuid)&&EA(e);return{...kA(i,n,a,o),armed:!0}}function PCe(e){return rA.delete(e)}function FA(e={}){return sA||typeof window>`u`?()=>{}:(sA=!0,iA=e.hands??null,aA=e.heldUuids??null,oA=e.haptic??null,IA)}function IA(){sA&&(sA=!1,iA=null,aA=null,oA=null,rA.clear(),dA.clear(),uA.clear(),cA.clear(),lA={at:-1/0,uuids:new Set},vA.set(!1))}function FCe(){return{started:sA,active:U(vA),sent:gA,probes:[...rA.values()].map(e=>({id:e.id,radius:e.radius,external:e.external,samples:e.samples.length,contacts:[...e.contacts.entries()].map(([e,t])=>({uuid:e,spent:t.spent,out:t.outSince!=null}))})),predictions:[...dA.keys()],dynamic:[...lA.uuids],hits:mA.length}}var LA=new Map,RA=new Map,zA=new Map,ICe=50,BA=250,LCe=3,RCe=400;function VA(e,t,n){if(!t||!t.userData?.physics)return!1;let r=performance.now(),i=RA.get(e),a=i?r-i.last:1/0,o=i?Math.min(BA,Math.max(ICe,i.interval*.7+a*.3)):BA/2;return RA.set(e,{last:r,interval:o}),a<RCe?n.pos.distanceTo(t.position)>LCe?(LA.delete(e),!1):(LA.set(e,{from:{pos:n.pos.clone(),quat:n.quat.clone()},to:{pos:t.position.clone(),quat:t.quaternion.clone()},t0:r,dur:o,object:t}),t.position.copy(n.pos),t.quaternion.copy(n.quat),clearTimeout(zA.get(e)),zA.set(e,setTimeout(()=>{zA.delete(e);let n=LA.get(e);n&&(t.position.copy(n.to.pos),t.quaternion.copy(n.to.quat),LA.delete(e),ci())},o+60)),!0):!1}var zCe=100,HA=0;function UA(){if(LA.size===0)return;let e=performance.now();for(let[t,n]of LA){let r=n.object;if(r?.parent||(r=U(Ui)?.getObjectByProperty(`uuid`,t),n.object=r),!r){LA.delete(t);continue}let i=n.dur>0?(e-n.t0)/n.dur:1;if(i>=1){r.position.copy(n.to.pos),r.quaternion.copy(n.to.quat),LA.delete(t);continue}r.position.lerpVectors(n.from.pos,n.to.pos,i),r.quaternion.slerpQuaternions(n.from.quat,n.to.quat,i)}(LA.size===0||e-HA>=zCe)&&(HA=e,ci())}function BCe(){let e=U(Ui);for(let[t,n]of LA){let r=e?.getObjectByProperty(`uuid`,t);r&&(r.position.copy(n.to.pos),r.quaternion.copy(n.to.quat))}for(let e of zA.values())clearTimeout(e);zA.clear(),LA.clear(),RA.clear()}function VCe(){return{active:LA.size,intervals:[...RA.values()].map(e=>Math.round(e.interval))}}var WA=new Map;function HCe(e){let t=e.userData?.physics;return!!t&&t.mode===`dynamic`&&!e.userData?.water}function UCe(e,t){if(!e||!rse())return WA.size&&WA.clear(),0;let n=0,r=new Set;for(let i of e.children){if(!HCe(i))continue;r.add(i.uuid);let e=WCe(i),a=i.position.x,o=i.position.y,s=i.position.z,c=ise(a,o-e,s),l=!!c&&o-e*.5<c.surfaceY,u=WA.get(i.uuid);if(u&&c&&l!==u.wet){let r=Math.max((t-u.t)/1e3,1/240),i=(o-u.y)/r,d=Math.abs(i);if(d>=.6){let t=Math.min(1,d/6)*(l?1:.4);ase(c.volume,[a,c.surfaceY,s],Math.max(.2,e*1.5),t),n++}}WA.set(i.uuid,{y:o,wet:l,t})}for(let e of WA.keys())r.has(e)||WA.delete(e);return n}function WCe(e){let t=e.geometry,n=.5;t&&(t.boundingSphere||t.computeBoundingSphere?.(),t.boundingSphere&&(n=t.boundingSphere.radius));let r=e.scale;return n*Math.max(Math.abs(r.x),Math.abs(r.y),Math.abs(r.z))}function GCe(e,t,n,r){Dne(e,r),cse(e),ese(),UCe(e,r),zce(e,t,n,r)}var GA=new Map,KA=new Map,qA=new Map,JA=new Map,YA=new Map,XA=new Map,ZA=new Map,QA=new Map,$A=ne
1199w Map,ej={triggers:0,received:0,stale:0,poses:0,sounds:0,knocks:0,colliderBuilds:0,clicks:0},tj=null;function nj(e,t){return tj={mesh:String(e?.name??e?.type??`?`),result:t},!1}var KCe=.4,qCe=800,JCe=500,rj=null,ij=null,aj=null,oj=!1;function sj(e){let t=KA.get(e);if(t&&t.parent)return t;let n=performance.now();if(n-(qA.get(e)??-1/0)<1e3)return null;let r=U(Ui)?.getObjectByProperty(`uuid`,e)??null;return r?(KA.set(e,r),qA.delete(e)):(KA.delete(e),qA.set(e,n)),r}function cj(e){for(let t=e;t;t=t.parent)if(t.uuid&&wg(t.uuid))return t;return null}function lj(e,t){let n=new Set;for(let r of t)for(let t of r?.tracks??[]){if(t.name.endsWith(`.morphTargetInfluences`))continue;let r=st.parseTrackName(t.name),i=r.nodeName?st.findNode(e,r.nodeName):null;i&&i!==e&&n.add(i)}return[...n]}function uj(e){let t=wg(e),n=Eg(e);return!t||!n?[]:(t.closeClip?[t.clip,t.closeClip]:[t.clip]).map(e=>n.actions[e]?.getClip?.()).filter(Boolean)}function dj(e,t,n){let r=Eg(e),i=r?.actions?.[t];if(!i)return;let a=i.getClip().duration,o=Math.min(a,Math.max(0,n)),s=t+`@`+o.toFixed(4);if(JA.get(e)===s)return;let c=YA.get(e);c&&c!==i&&c.stop(),(!i.isScheduled()||!i.enabled)&&(i.reset(),i.setLoop(Dt,1),i.clampWhenFinished=!0,i.play()),i.paused=!1,i.time=o,r.mixer.update(0),YA.set(e,i),JA.set(e,s),ej.poses++}function fj(e){let t=wg(e),n=t?.sound??(t?yoe(t):null);if(!n)return;let r=sj(e),i=r?r.getWorldPosition(new hn).toArray():null;vte(n,i)&&ej.sounds++}function pj(e){let t=GA.get(e);return t?{...t}:null}function mj(e,t){let n=wg(e),r=Eg(e);if(!n||!r)return!1;let i=Soe(n,GA.get(e)??km(),r.durations,yc(),t);return i?(GA.set(e,i),ej.triggers++,fj(e),U(Es)?.send?.({type:`behavior`,uuid:e,on:i.on,at:i.at,from:i.from,n:i.n}),!0):!1}function hj(e,t={}){let n=e?.uuid,r=_oe(e);return typeof n!=`string`||!r?!1:voe(GA.get(n)??null,r)?(GA.set(n,r),ej.received++,t.sound!==!1&&wg(n)&&Math.abs(yc()-r.at)<1500&&fj(n),!0):(ej.stale++,!1)}function gj(e){return hj(e)}function _j(e,t){let n=wg(e),r=Eg(e);if(!n||!r)return!1;let i=t&&r.actions[t]?t:n.clip;return XA.set(e,{clip:i,start:performance.now()}),!0}function YCe(e){XA.delete(e)}
1199function vj(e,t,n){t.updateWorldMatrix(!0,!0);let r=new fr().copy(t.matrixWorld).invert(),i=new Or,a=new fr,o=new Or;return e.traverse(e=>{e.isMesh&&e.geometry&&(!n||n(e))&&(e.geometry.boundingBox||e.geometry.computeBoundingBox(),o.copy(e.geometry.boundingBox).applyMatrix4(a.multiplyMatrices(r,e.matrixWorld)),i.union(o))}),i}var yj=e=>[e.min.x,e.min.y,e.min.z,e.max.x,e.max.y,e.max.z];function bj(e){let t=wg(e),n=sj(e);if(!t||t.collider!==`follow`||!n||n.userData.physics?.collider&&!n.userData.physics.__behaviorFrame)return;let r=lj(n,uj(e));if(!r.length)return;let i=new Set;for(let e of r)e.traverse(e=>i.add(e));let a=[];n.traverse(e=>{if(!e.isMesh||i.has(e))return;let t=vj(e,n);t.isEmpty()||a.push(yj(t))});let o=r.map(e=>yj(vj(e,n))).filter(e=>e[3]>e[0]),s=goe(a,o).slice(0,50);if(!s.length)return;let c=[],l=[];for(let e of s)l.push([c.length,24]),c.push(...Coe(e).map(e=>Math.round(e*1e5)/1e5));n.userData.physics={...n.userData.physics??{},collider:`custom`,colliderVerts:c,colliderPieces:l,__behaviorFrame:!0}}var xj=null;function XCe(){try{return ij?.physicsRuntime?.()??null}catch{return null}}function ZCe(e){let{world:t,RAPIER:n}=e;xj={world:t,parts:[]},ej.colliderBuilds++;let r=new hn,i=new zt,a=new hn;for(let e of Dg()){let o=wg(e),s=sj(e);if(o&&o.collider===`follow`&&s)for(let o of lj(s,uj(e))){let s=vj(o,o);if(s.isEmpty())continue;o.updateWorldMatrix(!0,!1),o.matrixWorld.decompose(r,i,a);let c=s.getSize(new hn).multiply(a).multiplyScalar(.5),l=s.getCenter(new hn).multiply(a);try{let a=t.createRigidBody(n.RigidBodyDesc.kinematicPositionBased().setTranslation(r.x,r.y,r.z).setRotation({x:i.x,y:i.y,z:i.z,w:i.w}));t.createCollider(n.ColliderDesc.cuboid(Math.max(.01,c.x),Math.max(.01,c.y),Math.max(.01,c.z)).setTranslation(l.x,l.y,l.z),a),xj.parts.push({uuid:e,node:o,body:a})}catch(e){console.log(`behavior collider failed`,e)}}}}var Sj=new hn,Cj=new zt,QCe=new hn,wj=!0;function $Ce(){let e=XCe();if(!e){xj=null;return}let t=!xj||xj.world!==e.world||wj;if(!t&&xj)for(let e of xj.parts)(!e.node.parent||!sj(e.uuid))&&(t=!0);let n=!1;if(t){if(wj=!1,xj&&xj.world===e.world)for(let t of xj.parts)try{e.world.removeRigidBody(t.body)}catch{}ZCe(e)}if(xj){for(let e of xj.parts)if(e.node.updateWorldMatrix(!0,!1),e.node.matrixWorld.decompose(Sj,Cj,QCe),!(e.last&&Sj.equals(e.last.pos)&&Cj.equals(e.last.quat))){e.last??={pos:new hn,quat:new zt},e.last.pos.copy(Sj),e.last.quat.copy(Cj);try{e.body.setNextKinematicTranslation(Sj),e.body.setNextKinematicRotation(Cj),e.body.setTranslation(Sj,!0),e.body.setRotation(Cj,!0),n=!0}catch{}}if(n)try{e.world.propagateModifiedBodyPositionsToColliders?.()}catch{}}}var Tj=new hn;function Ej(e,t){let n=performance.now(),r=$A.get(e);if(r&&n-r.at<JCe)return r.box;let i=new Or().setFromObject(t);return $A.set(e,{box:i,at:n}),i}var Dj={left:{now:{pos:new hn,t:0,ok:!1},prev:{pos:new hn,t:0,ok:!1}},right:{now:{pos:new hn,t:0,ok:!1},prev:{pos:new hn,t:0,ok:!1}}},Oj=new Or,ewe=[Dj.left,Dj.right],twe=[`left`,`right`];function nwe(e,t,n){if(t.trigger===`proximity`){let r=U(yi);if(!r)return;r.getWorldPosition(Tj);let i=Ej(e,n).distanceToPoint(Tj)<=xoe;i!==(ZA.get(e)??!1)&&(ZA.set(e,i),mj(e,t.type===`oneshot`?void 0:i));return}if(t.trigger===`knock`&&rj){let t=performance.now();if((QA.get(e)??0)>t)return;Oj.copy(Ej(e,n)).expandByScalar(.05);for(let n of ewe){let{now:r,prev:i}=n;if(!r.ok||!i.ok||r.t<=i.t)continue;let a=r.pos.distanceTo(i.pos)/(r.t-i.t)*1e3;if(Oj.containsPoint(r.pos)&&!Oj.containsPoint(i.pos)&&a>=.6){QA.set(e,t+qCe),ej.knocks++,mj(e);return}}}}function rwe(){if(!rj)return;let e=performance.now();for(let t of twe){let n=Dj[t];n.prev.pos.copy(n.now.pos),n.prev.t=n.now.t,n.prev.ok=n.now.ok;let r=rj(t);n.now.ok=!!r?.position,n.now.ok&&(n.now.pos.fromArray(r.position),n.now.t=e)}}function kj(){let e=Fce();if(!e.size){xj&&=null;return}let t=Yc(),n=yc();t&&rj&&rwe();for(let[r,i]of e){let e=Eg(r),a=sj(r);if(!i||!e||!a)continue;t&&i.trigger!==`click`&&nwe(r,i,a),t||ZA.delete(r);let o=XA.get(r);if(o){let t=e.durations[o.clip]??1,n=(performance.now()-o.start)/1e3;if(n<=t+KCe){dj(r,o.clip,n);continue}XA.delete(r)}let s=boe(i,GA.get(r)??km(),e.durations,n,t);dj(r,s.clip,s.time)}ij&&$Ce()}function iwe(e){if(ej.clicks++,!Yc())return nj(e,`edit`);let t=cj(e);if(!t)return nj(e,`not-functional`);let n=wg(t.uuid);if(!n||n.type===`loop`&&n.autoplay)return nj(e,`ambient`);if(!mj(t.uuid))return nj(e,`unchanged`);nj(e,`toggled`);try{aj?.fireObjectClick?.(t.uuid)}catch{}return!0}function Aj(e={}){if(e.hands&&(rj=e.hands),!oj){oj=!0,Lce({state:e=>pj(e),apply:(e,t)=>hj({...t,uuid:e},{sound:!1}),preview:(e,t)=>_j(e,t),registered:e=>{KA.delete(e),qA.delete(e),JA.delete(e),YA.delete(e);let t=Eg(e),n=wg(e);t&&n&&dj(e,n.clip,0),bj(e),wj=!0}});for(let e of Dg())bj(e);Fee.push(iwe),$(()=>import(`../chunks/B3B8hjh_.js`).then(e=>e.v).then(e=>ij=e),__vite__mapDeps([157,1,2,6,9,0,3,4,38,39,5,7,48,10,14,32,13,30,31,57,58,18,19,20,21,22,23,11,12,8,24,25,26,27,28,29,33,34,35,36,37,40,41,42,43,44,45,46,47,49,50,16,51,52,53,54,55,56,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,158,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url).catch(()=>{}),$(()=>import(`../chunks/jUHDc502.js`).then(e=>e.m).then(e=>aj=e),__vite__mapDeps([18,1,2,6,3,9,0,4,5,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86]),import.meta.url).catch(()=>{})}}function awe(){return{...ej,lastClick:tj,items:Dg().map(e=>({uuid:e,spec:wg(e),state:pj(e),pose:JA.get(e)??null,preview:XA.has(e),physics:sj(e)?.userData?.physics??null})),colliders:xj?xj.parts.map(e=>({uuid:e.uuid,node:e.node.name,handle:e.body.handle})):[]}}var jj=e=>U(Ui)?.getObjectByProperty(`uuid`,e)??null;function Mj(e,t,n={}){let r=jj(e),i=jj(t);if(!r?.userData?.spline?.points?.length)return es(`That object has no spline to follow`),!1;if(!i?.geometry?.attributes?.position)return es(`That terrain has no geometry to carve`),!1;let a=Mle(r,i);if(!a)return!1;let o=n.width??owe(r);if(i.geometry.index){let e=i.geometry.toNonIndexed();i.geometry.dispose(),i.geometry=e}let s=Array.from(i.geometry.attributes.position.array),c=jle(i,a,{...A_,...n,width:o});if(!c)return es(`Nothing to carve â a spline needs at least two control points`),!1;let l=0;for(let e=1;e<c.length;e+=3)Math.abs(c[e]-s[e])>1e-6&&l++;if(!l){let e=c.touched??0;return es(e?`${i.name||`That terrain`} is already flat along this spline â nothing to change`:`${i.name||`That terrain`} is not under this spline â nothing changed`),!1}let u=Aae(t,s,Array.from(c));return u&&es(`Carved ${l} vertices of ${i.name||`the terrain`} â Ctrl+Z to undo`),u}function owe(e){let t=(e?.userData?.spline?.points??[]).map(e=>
1199e.radius??0),n=t.length?Math.max(...t):0;return n>0?n*2:A_.width}function Nj(e,t,n={}){let r=x_(e),i=T_(r),a=jj(t);if(!i?.points?.length)return es(`That object has no spline to lay down`),!1;if(!a?.geometry?.attributes?.position)return es(`That target has no surface to lay it on`),!1;if(r===a)return es(`Pick something other than the spline itself`),!1;let o=h_(i),s=Number.isFinite(n.clearance)?Number(n.clearance):0;r.updateMatrixWorld(!0),a.updateMatrixWorld(!0);let c=new Or().setFromObject(a),l=new Wn,u=new hn(0,-1,0),d=new hn(0,1,0),f=new hn,p=new hn,m=0,h=i.points.map(e=>{f.set(e.pos[0],e.pos[1],e.pos[2]),r.localToWorld(f),p.set(f.x,c.max.y+1,f.z),l.set(p,u);let t=l.intersectObject(a,!0)[0];return t||=(p.set(f.x,c.min.y-1,f.z),l.set(p,d),l.intersectObject(a,!0)[0]),t?(m++,f.set(f.x,t.point.y+e.radius+s,f.z),r.worldToLocal(f),{pos:[f.x,f.y,f.z],radius:e.radius}):{pos:[e.pos[0],e.pos[1],e.pos[2]],radius:e.radius}});if(!m)return es(`${a.name||`That object`} is not under this spline â nothing moved`),!1;let g=E_(e,o,{...i,points:h});return g&&es(m===h.length?`Laid ${m} points onto ${a.name||`the surface`} â Ctrl+Z to undo`:`Laid ${m} of ${h.length} points onto ${a.name||`the surface`} â the rest had nothing under them`),g}var Pj=`flatten-pick`,Fj=Ue(null);function Ij(e){e.key===`Escape`&&U(Fj)&&(e.preventDefault(),e.stopPropagation(),Rj(),es(`Flatten cancelled`))}function swe(e,t){return T_(x_(t))?(Fj.set({kind:e,spline:t}),Po(Pj,e===`carve`?`Click the terrain to flatten under this spline (Esc cancels)`:`Click the surface to lay this spline onto (Esc cancels)`,[],()=>Lj()),typeof window<`u`&&window.addEventListener(`keydown`,Ij,!0),!0):(es(`That object has no spline`),!1)}function Lj(){oc(Pj),Fj.set(null),typeof window<`u`&&window.removeEventListener(`keydown`,Ij,!0)}function Rj(){return U(Fj)?(Lj(),!0):!1}function zj(e){let t=U(Fj);if(!t)return!1;let n=U(Ui),r=n?e.intersectObjects(n.children,!0):[],i=r.length?(e=>{let t=e;for(;t?.parent&&t.parent!==n;)t=t.parent;return t})(r[0].object):null;return i?i.uuid===t.spline?(es(`That is the spline itself â click the ground`),!0):t.kind===`carve`&&!i.userData?.terrain?(es(`${i.name||`That`} is not a terrain â click a Terrain, or use âLay this spline ontoâ¦â instead`),!0):i.geometry?.attributes?.position?(Lj(),t.kind===`carve`?Mj(t.spline,i.uuid):Nj(t.spline,i.uuid),!0):(es(`${i.name||`That`} has no surface to use`),!0):(Lj(),es(`Flatten cancelled`),!0)}var Bj=Ue(null),Vj=null,Hj=null,Uj=null,Wj=new fr,cwe=new fr,Gj=new hn,Kj=new zt,qj=new hn,Jj=new rt;function Yj(e){return U(Ui)?.getObjectByProperty(`uuid`,e)??null}function lwe(e){let t=e?.offset??{},n=t.rot??[0,0,0];return cwe.compose(Gj.fromArray(t.pos??[0,0,0]),Kj.setFromEuler(Jj.set(n[0],n[1],n[2],`XYZ`)),qj.fromArray(t.scale??[1,1,1]))}function Xj(e,t){let n=Yj(e),r=I_(e),i=U(zi),a=U(Pi);return!n||!r?.levels[t]||t<=0||!i||!a?!1:(Zj({reattach:!1}),Vj=new Vn,Vj.name=`lod-level-proxy`,Vj.userData={isLodLevelProxy:!0},n.updateWorldMatrix(!0,!1),Wj.multiplyMatrices(n.matrixWorld,lwe(r.levels[t])),Wj.decompose(Vj.position,Vj.quaternion,Vj.scale),a.add(Vj),Hj={uuid:e,level:t},i.attach(Vj),i.visible=!0,Bj.set(Hj),j_.set({uuid:e,level:t}),!0)}function Zj(e={}){let t=U(zi),n=Hj;if(Vj&&(t?.object===Vj&&t.detach(),Vj.removeFromParent()),Vj=null,Hj=null,Uj=null,n&&(Bj.set(null),e.reattach!==!1)){let e=Yj(n.uuid);e&&t&&U(Kr).includes(n.uuid)&&(t.attach(e),t.visible=!0)}}function Qj(){if(!Vj||!Hj)return null;let e=Yj(Hj.uuid);if(!e)return null;e.updateWorldMatrix(!0,!1),Vj.updateMatrixWorld(!0),Wj.copy(e.matrixWorld).invert().multiply(Vj.matrixWorld),Wj.decompose(Gj,Kj,qj),Jj.setFromQuaternion(Kj,`XYZ`);let t=e=>Math.round(e*1e6)/1e6;return{pos:[t(Gj.x),t(Gj.y),t(Gj.z)],rot:[t(Jj.x),t(Jj.y),t(Jj.z)],scale:[t(qj.x),t(qj.y),t(qj.z)]}}function $j(){let e=Qj();e&&Hj&&L_(Hj.uuid,Hj.level,{offset:e},{preview:!0})}function eM(e){if(!Hj)return;if(e){Uj=JSON.parse(JSON.stringify(I_(Hj.uuid)));return}let t=Qj();t&&L_(Hj.uuid,Hj.level,{offset:t},{before:Uj}),Uj=null}function tM(e,t){let n=L_(e,t,{offset:void 0});return Hj&&Hj.uuid===e&&Hj.level===t&&Xj(e,t),n}Kr.subscribe(e=>{Hj&&!e.includes(Hj.uuid)&&Zj({reattach:!1})});var nM=Ue(null),rM=Ue(-1),iM=Ue(0),aM=3113463,uwe=16728064,dwe=16752
1199640,fwe=16096779,pwe=10265519,mwe=1.8,oM=null,sM=null,cM=null,lM=null,uM=null,dM=null,fM=[],pM=-1,mM=-1,hM=null,gM=null,_M=null,vM=0,yM=!1,bM=new fr,xM=new fr,SM=new hn,CM=new hn,wM=new hn;function hwe(){let e=new Or().setFromObject(oM);return wt.clamp(e.getSize(SM).length()*.02,.02,.25)}function TM(e,t,n,r){let i=new jn(new mt(n,8,8),new bn({color:t,depthTest:!1,transparent:!0,opacity:.9}),Math.max(e,1));return i.count=e,i.renderOrder=999,i.name=r,i}function EM(e,t){let n=fM[e];return n?oM.localToWorld(t.set(n.pos[0],n.pos[1],n.pos[2])):t.set(0,0,0)}function gwe(e,t){let n=fM[e];return EM(e,t),n?(CM.set(0,1,0).transformDirection(oM.matrixWorld).normalize(),oM.getWorldScale(wM),t.addScaledVector(CM,n.radius*mwe*Math.abs(wM.y||1))):t}function DM(){return oM?.userData?.spline?.closed?fM.length:Math.max(fM.length-1,0)}function OM(){if(!oM||!sM)return;for(let e=0;e<fM.length;e++)EM(e,SM),cM.setMatrixAt(e,xM.makeTranslation(SM.x,SM.y,SM.z)),gwe(e,SM),lM.setMatrixAt(e,xM.makeTranslation(SM.x,SM.y,SM.z));let e=DM(),t=e>0?xle({points:fM,closed:!!oM.userData?.spline?.closed}):null;for(let n=0;n<e;n++)t?oM.localToWorld(t.getPoint((n+.5)/e,SM)):SM.set(0,0,0),uM.setMatrixAt(n,xM.makeTranslation(SM.x,SM.y,SM.z));[cM,lM,uM].forEach(e=>{e.instanceMatrix.needsUpdate=!0,e.boundingSphere=null,e.boundingBox=null})}function kM(){for(let e=0;e<fM.length;e++)cM.setColorAt(e,new ot(e===pM?uwe:e===mM?dwe:aM));cM.instanceColor&&(cM.instanceColor.needsUpdate=!0)}function AM(){let e=T_(oM);if(!e)return;fM=e.points,iM.set(fM.length);let t=U(Pi);if(!t)return;sM&&(t.remove(sM),jM());let n=hwe();sM=new Pn,sM.userData.vrOverlay=!1,sM.name=`spline-handles`,cM=TM(fM.length,aM,n,`spline-point-handles`),lM=TM(fM.length,fwe,n*.6,`spline-radius-handles`),uM=TM(DM(),pwe,n*.45,`spline-mid-handles`),sM.add(cM,lM,uM),t.add(sM),pM>=fM.length&&(pM=-1),rM.set(pM),OM(),kM(),pM>=0&&LM(pM)}function jM(){[cM,lM,uM].forEach(e=>{e?.geometry?.dispose?.(),e?.material?.dispose?.()}),cM=null,lM=null,uM=null,sM=null}function MM(e){U(nM)&&NM();let t=x_(e);if(!T_(t))return es(`Only spline objects can be spline-edited â use the Draw ⸠Spline tool to make one`),!1;if(U(Ci).find(t=>t[1]===e))return es(`This object is locked by another peer`),!1;if(!U(Pi))return!1;oM=t,oM.updateMatrixWorld(),bM.copy(oM.matrixWorld),pM=-1,mM=-1,AM(),dM=new Vn,dM.userData.isSplineProxy=!0,U(Pi).add(dM),U(zi)?.detach();let n=U(Es);return n&&n.send({type:`lock`,uuid:e,peerId:n.peer.id}),nM.set(e),typeof window<`u`&&window.addEventListener(`keydown`,PM),ywe(),!0}function NM(){if(!oM)return;let e=U(Pi),t=U(zi);sM&&(e?.remove(sM),jM()),dM&&(t&&t.object===dM&&t.detach(),e?.remove(dM));let n=U(Es);n&&oM&&n.send({type:`unlock`,uuid:oM.uuid,peerId:n.peer.id}),typeof window<`u`&&window.removeEventListener(`keydown`,PM),oM=null,dM=null,fM=[],pM=-1,mM=-1,hM=null,gM=null,_M=null,rM.set(-1),iM.set(0),nM.set(null)}function PM(e){e.key===`Escape`&&NM()}Tle(e=>{oM&&oM.uuid===e&&AM()});function FM(){oM&&sM&&(oM.updateMatrixWorld(),!bM.equals(oM.matrixWorld)&&(bM.copy(oM.matrixWorld),OM()))}function IM(e){if(!sM)return null;let t=null,n=[[`point`,cM],[`radius`,lM],[`mid`,uM]];for(let[r,i]of n){if(!i||!i.count)continue;let n=e.intersectObject(i);n.length&&(!t||n[0].distance<t.distance)&&(t={kind:r,index:n[0].instanceId,distance:n[0].distance})}return t}function LM(e){if(!dM)return;EM(e,SM),dM.position.copy(SM);let t=U(zi);t&&(t.setMode(`translate`),t.attach(dM))}function RM(e){let t=IM(e);return t?t.kind===`mid`?(BM(t.index),!0):t.kind===`radius`||(pM=t.index,rM.set(pM),kM(),LM(pM),!0):!1}function _we(e){return e!==mM&&(mM=e,cM&&kM(),!0)}function zM(){return T_(oM)}function BM(e){let t=zM();if(!t)return!1;let n=Sle(t,e);if(n.points.length===t.points.length)return!1;let r=E_(oM.uuid,t,n);return r&&(pM=e+1,rM.set(pM),AM()),r}function VM(e){let t=zM();if(!t)return!1;let n=Cle(t,e);if(!n)return es(`A spline needs at least two control points`),!1;pM===e?pM=-1:pM>e&&pM--;let r=E_(oM.uuid,t,n);return r&&AM(),r}function HM(e){let t=IM(e);return!t||t.kind===`mid`?!1:VM(t.index)}function UM(e,t){let n=h_(zM());return n.points[e]?(n.points[e].pos=[...t],n):null}function WM(e,t){let n=h_(zM());return n.points[e]?(n.points[e].radius=Math.min(Math.max(t,wle),50),n):null}
1199function GM(){if(!oM||pM<0||!dM)return;let e=oM.worldToLocal(SM.copy(dM.position)),t=fM[pM];if(t&&Math.abs(t.pos[0]-e.x)<1e-9&&Math.abs(t.pos[1]-e.y)<1e-9&&Math.abs(t.pos[2]-e.z)<1e-9)return;let n=UM(pM,[e.x,e.y,e.z]);n&&(k_(oM.uuid,n),fM=T_(oM)?.points??fM,OM())}function KM(e){if(!oM||pM<0)return;if(e){gM=h_(zM());return}if(!gM)return;let t=zM();E_(oM.uuid,gM,t),gM=null,AM()}function qM(e,t){let n=IM(e);if(!n||n.kind!==`radius`)return!1;let r=fM[n.index];return r?(pM=n.index,rM.set(pM),kM(),LM(pM),gM=h_(zM()),hM={index:n.index,startRadius:r.radius,startY:t},!0):!1}function JM(e){if(!hM||!oM)return;let t=g_(hM.startRadius,hM.startY-e,ble),n=WM(hM.index,t);n&&(k_(oM.uuid,n),fM=T_(oM)?.points??fM,OM())}function YM(){return hM?(hM=null,oM&&gM&&E_(oM.uuid,gM,zM()),gM=null,AM(),!0):!1}function XM(){return!!hM}function ZM(){return $_(U(ui)===`right`?`left`:`right`)}function QM(e){let t=U(xi);if(!t?.xr)return null;let n=t.xr.getController(e);if(!n)return null;let r=new fr().identity().extractRotation(n.matrixWorld),i=new Wn;return i.ray.origin.setFromMatrixPosition(n.matrixWorld),i.ray.direction.set(0,0,-1).applyMatrix4(r),i}function $M(e){let t=U(xi)?.xr?.getController?.(e);return t?t.getWorldPosition(new hn):null}function eN(e){if(!oM||!U(wi)||_M)return!1;let t=e>=0?e:ZM(),n=QM(t);if(!n)return!1;let r=IM(n);if(!r)return!1;if(vM=Date.now(),r.kind===`mid`)return BM(r.index),q_(.4,40),!0;let i=$M(t);return i?(pM=r.index,rM.set(pM),kM(),gM=h_(zM()),_M=r.kind===`radius`?{kind:`radius`,index:r.index,hand:t,startRadius:fM[r.index].radius,startY:i.y}:{kind:`point`,index:r.index,hand:t,offset:EM(r.index,new hn).sub(i)},q_(.3,30),!0):!1}function tN(){return _M?(_M=null,vM=Date.now(),oM&&gM&&E_(oM.uuid,gM,zM()),gM=null,AM(),q_(.3,30),!0):!1}function nN(){return Date.now()-vM<250}function vwe(){return!!_M}function rN(){if(!oM||!U(wi))return;if(_M){let e=$M(_M.hand);if(!e)return;if(_M.kind===`radius`){let t=WM(_M.index,g_(_M.startRadius,e.y-_M.startY,4));t&&k_(oM.uuid,t)}else{let t=e.add(_M.offset),n=oM.worldToLocal(t),r=U(gc)?U(_c).translate:0;r>0&&(n.x=Math.round(n.x/r)*r,n.y=Math.round(n.y/r)*r,n.z=Math.round(n.z/r)*r);let i=UM(_M.index,[n.x,n.y,n.z]);i&&k_(oM.uuid,i)}fM=T_(oM)?.points??fM,OM();return}let e=ZM(),t=e>=0?QM(e):null,n=t?IM(t):null;_we(n&&n.kind===`point`?n.index:-1)&&n&&q_(.1,12)}function ywe(){yM||(yM=!0,Wh(()=>!!_M),Use(()=>U(nM)?sM:null),Hh({start:e=>eN(e),end:()=>tN(),swallow:()=>nN()}),Uh(()=>rN()))}function bwe(){return{uuid:oM?.uuid??null,points:fM.length,spans:DM(),selected:pM,hovered:mM,radiusDrag:!!hM,vrCarry:_M?_M.kind:null,handles:sM?{point:cM?.count??0,radius:lM?.count??0,mid:uM?.count??0}:null}}var iN=Ue(null),xwe=new Tr(new hn(0,1,0),0),aN=new hn;function oN(e){iN.update(t=>{let n=t===e?null:e;return n&&es(`Click in the viewport to add waypoints â toggle Capture off when done`),n})}function sN(e){let t=U(iN);if(!t)return!1;let n=Ec(e=>e.id===t);if(!n)return iN.set(null),!1;let{node:r,graphId:i}=n,a=U(Ui),o=a?.parent?.getObjectByName(`path-waypoints`);if(o&&e.intersectObject(o,!0).some(e=>e.object.userData.wpIndex!=null))return!0;let s=(a?e.intersectObjects(a.children,!0):[])[0]?.point??(e.ray.intersectPlane(xwe,aN)?aN:null);return s&&nu(t,{points:[...r.data.points??[],[s.x,s.y,s.z]]},i),!0}var cN=Ue(null),lN=Ue({mode:`auto`,uuid:null,local:null}),uN=Ue(!1),dN=null,fN=0,pN=[],mN=null,hN=!1,gN=null,_N=null,vN=null,yN=null,bN=null,xN=null,SN=!1,CN=!1,Swe=33,Cwe=`snap-candidate-marker`,wwe=`snap-candidate-face`,wN=16752686,TN=new Wn,EN=new yn,DN=new hn,ON=new Or,kN=new hn,AN=new hn,jN=new hn,Twe=new hn,Ewe=new hn(0,1,0),MN=new hn,NN=new zt;function PN(e,t){dN=[e,t]}function Dwe(e){let t=U(Ui),n=e;for(;n?.parent&&n.parent!==t;)n=n.parent;return n?.parent===t?n.uuid:null}function Owe(e){let t=[{point:Vf(e,new hn),uuid:e.uuid}],n=new Or().setFromObject(e);if(n.isEmpty())return t;let r=n.getCenter(new hn);return t.push({point:r.clone(),uuid:e.uuid}),t.push({point:new hn(n.min.x,r.y,r.z),uuid:e.uuid}),t.push({point:new hn(n.max.x,r.y,r.z),uuid:e.uuid}),t.push({point:new hn(r.x,n.min.y,r.z),uuid:e.uuid}),t.push({point:new hn(r.x,n.max.y,r.z),uuid:e.uuid}),t.push({point:new hn(r.x,r.y,n.min.z),uuid:e.uuid}),t.push({point:new hn(r.x,r.y,n.max.z),uuid:e.uuid}),t}function FN(e){let t=hN;hN=!0,pN=e??[],mN=null,gN=null,fN=0;let n=U(Ui),r=U(zi);if(t||(xN=r?.object?.quaternion?r.object.quaternion.clone():null,SN=!1),r?.object?.userData?.isMultiPivot&&n){let e=pN[pN.length-1],t=e?n.getObjectByProperty(`uuid`,e):null;t&&(t.updateMatrixWorld(!0),gN={pivotPos:r.object.position.clone(),primaryBox:new Or().setFromObject(t),originOffset:Vf(t,new hn).sub(r.object.position)})}let i=U(hc);if(i.enabled&&i.object&&n){mN=[];for(let e of n.children)pN.some(t=>e.getObjectByProperty(`uuid`,t))||mN.push(...Owe(e))}}function IN(){hN=!1,pN=[],mN=null,gN=null,dN=null,xN=null,SN=!1,U(cN)&&cN.set(null)}function LN(e,t,n){return DN.copy(e).project(t),DN.z>1||DN.z<-1?null:[n.left+(DN.x+1)/2*n.width,n.top+(1-DN.y)/2*n.height]}function RN(e,t,n){let r=e.geometry,i=r?.attributes?.position;if(!i)return null;let a=t*3+n,o=r.index?r.index.getX(a):a;return o>=i.count?null:Twe.fromBufferAttribute(i,o).applyMatrix4(e.matrixWorld).clone()}var kwe=5e4,zN=new WeakMap;function BN(e,t){return e.getX(t).toFixed(5)+`,`+e.getY(t).toFixed(5)+`,`+e.getZ(t).toFixed(5)}function VN(e,t,n){let r=t*3+n;return e.index?e.index.getX(r):r}function Awe(e){let t=e?.attributes?.position;if(!t)return null;let n=(e.index?e.index.count:t.count)/3;if(n>kwe)return null;let r=zN.get(e);if(r&&r.attribute===t&&r.version===t.version)return r.map;let i=new Map;for(let r=0;r<n;r++){let n=[BN(t,VN(e,r,0)),BN(t,VN(e,r,1)),BN(t,VN(e,r,2))];for(let e=0;e<3;e++){let t=n[e],a=n[(e+1)%3],o=t<a?t+`|`+a:a+`|`+t,s=i.get(o);s?s.push(r):i.set(o,[r])}}
1199return zN.set(e,{attribute:t,version:t.version,map:i}),i}var HN=new hn,UN=new hn,WN=new hn,jwe=new hn,Mwe=new hn;function Nwe(e,t,n){let r=e.attributes.position,i=(t,n)=>(HN.fromBufferAttribute(r,VN(e,t,0)),UN.fromBufferAttribute(r,VN(e,t,1)),WN.fromBufferAttribute(r,VN(e,t,2)),n.copy(UN).sub(HN).cross(WN.sub(HN)).normalize());return i(t,jwe).dot(i(n,Mwe))>1-1e-6}function Pwe(e,t){let n=tp(e.geometry)?.find(e=>e.includes(t))??[t],r=new hn,i=0;for(let t of n)for(let n=0;n<3;n++){let a=RN(e,t,n);a&&(r.add(a),i++)}return i?{centroid:r.divideScalar(i),tris:n}:null}function GN(e,t,n){let r={vertex:-8,edge:-5,face:-3,object:-3,surface:0},i=null,a=1/0;for(let o of e){if(!o?.px)continue;let e=Math.hypot(o.px[0]-t[0],o.px[1]-t[1]);if(e>n)continue;let s=e+(r[o.type]??0)+(o.bonus??0);s<a&&(a=s,i=o)}return i}function KN(e,t,n){let r=U(hc),i=U(xi)?.domElement?.getBoundingClientRect?.();if(!e||!i)return cN.set(null),null;let a=[],o=null;if(t&&(EN.set(t[0],t[1]),TN.setFromCamera(EN,e),a=Ch(TN,{excludeUuids:n}),o=[i.left+(t[0]+1)/2*i.width,i.top+(1-t[1])/2*i.height]),!a.length){let t=U(Ui),r=n?.length?t?.getObjectByProperty(`uuid`,n[0]):null;if(r){let t=LN(Vf(r,AN),e,i);t&&(EN.set((t[0]-i.left)/i.width*2-1,-((t[1]-i.top)/i.height)*2+1),TN.setFromCamera(EN,e),a=Ch(TN,{excludeUuids:n}),o=t)}}let s=a[0];if(!s||!o)return cN.set(null),null;let c=Dwe(s.object),l=wh(s),u=[];if(r.surface&&u.push({type:`surface`,point:s.point.clone(),normal:l,uuid:c,faceIndex:s.faceIndex??null,px:LN(s.point,e,i)}),r.face&&s.faceIndex!=null&&s.object?.isMesh){let t=Pwe(s.object,s.faceIndex);t&&u.push({type:`face`,point:t.centroid,normal:l,uuid:c,faceIndex:s.faceIndex,__mesh:s.object,__tris:t.tris,px:LN(t.centroid,e,i)})}if(r.vertex&&s.faceIndex!=null&&s.object?.isMesh)for(let t=0;t<3;t++){let n=RN(s.object,s.faceIndex,t);n&&u.push({type:`vertex`,point:n,normal:l,uuid:c,faceIndex:s.faceIndex,px:LN(n,e,i)})}if(r.edge&&s.faceIndex!=null&&s.object?.isMesh){let t=s.object.geometry,n=t?.attributes?.position,r=n?Awe(t):null,a=tp(t),o=!!a,d=a?.find(e=>e.includes(s.faceIndex))??[s.faceIndex];for(let a=0;a<3;a++){let f=VN(t,s.faceIndex,a),p=VN(t,s.faceIndex,(a+1)%3);if(r){let e=BN(n,f),i=BN(n,p),a=r.get(e<i?e+`|`+i:i+`|`+e);if(a&&a.length===2){let e=a[0]===s.faceIndex?a[1]:a[0];if(d.includes(e)||!o&&Nwe(t,s.faceIndex,e))continue}}let m=new hn().fromBufferAttribute(n,f).applyMatrix4(s.object.matrixWorld),h=new hn().fromBufferAttribute(n,p).applyMatrix4(s.object.matrixWorld),g=new hn;TN.ray.distanceSqToSegment(m,h,void 0,g),u.push({type:`edge`,point:g,normal:l,uuid:c,faceIndex:s.faceIndex,px:LN(g,e,i)});let _=m.clone().add(h).multiplyScalar(.5);u.push({type:`edge`,bonus:-2,point:_,normal:l,uuid:c,faceIndex:s.faceIndex,px:LN(_,e,i)})}}if(r.object&&mN)for(let t of mN)u.push({type:`object`,point:t.point,normal:null,uuid:t.uuid,px:LN(t.point,e,i)});let d=GN(u,o,r.radiusPx);return cN.set(d??null),d}function qN(e,t){let n=U(lN);if(n.mode===`picked`&&n.uuid&&n.local){let t=e?.uuid===n.uuid?e:U(Ui)?.getObjectByProperty(`uuid`,n.uuid);if(t)return t.updateMatrixWorld(!0),kN.fromArray(n.local).applyMatrix4(t.matrixWorld)}return U(hc).anchorMode===`pivot`?Vf(e,kN.set(0,0,0)):(ON.setFromObject(e),ON.isEmpty()?e.getWorldPosition(kN):ON.clampPoint(t.point,kN))}function JN(e,t){if(!e)return;let n=U(hc).alignNormal?t?.normal:null;if(!n){SN&&xN&&(e.quaternion.copy(xN),e.updateMatrixWorld(!0)),SN=!1;return}xN&&(MN.copy(n),!(MN.lengthSq()<1e-12)&&(MN.normalize(),NN.setFromUnitVectors(Ewe,MN),e.quaternion.copy(NN).multiply(xN),e.updateMatrixWorld(!0),SN=!0))}function YN(e,t){let n=U(cN);if(!n||!e?.parent)return JN(e,null),!1;JN(e,n);let r=qN(t,n);return jN.copy(n.point).sub(r),jN.lengthSq()<1e-14||(e.getWorldPosition(AN).add(jN),e.parent.updateMatrixWorld(!0),e.position.copy(e.parent.worldToLocal(AN)),e.updateMatrixWorld(!0),!0)}function XN(){if(!hN)return!1;let e=U(hc);if(!e.enabled||!(e.vertex||e.edge||e.face||e.surface||e.object))return!1;let t=U(zi);return!(!t?.dragging||t.mode!==`translate`)}function ZN(){let e=U(yi);if(!e)return;let t=performance.now();if(t-fN<Swe)return;fN=t;let n=U(xi)?.domElement?.getBoundingClientRect?.(),r=null;dN&&n?.width&&n?.height&&(r=[(dN[0]-n.left)/n.width*2-1,-((dN[1]-n.top)/n.height)*2+1]),KN(e,r,pN)}function QN(e){return!e||!XN()?!1:(ZN(),YN(e,e))}var $N=new Or,eP=new hn;function Fwe(e,t){if(!e||!t||!XN())return;ZN();let n=U(cN);if(!n||!e.parent){JN(e,null);return}JN(e,n);let r=U(lN),i=U(hc);r.mode===`picked`&&r.uuid&&r.local?kN.copy(e.position):i.anchorMode===`pivot`&&gN?kN.copy(e.position).add(gN.originOffset):gN?(eP.copy(e.position).sub(gN.pivotPos),$N.copy(gN.primaryBox).translate(eP),$N.clampPoint(n.point,kN)):kN.copy(e.position),jN.copy(n.point).sub(kN),!(jN.lengthSq()<1e-14)&&(e.getWorldPosition(AN).add(jN),e.parent.updateMatrixWorld(!0),e.position.copy(e.parent.worldToLocal(A
1199N)),e.updateMatrixWorld(!0))}function Iwe(){if(_N)return _N;let e=U(Pi);if(!e)return null;_N=new Pn,_N.name=Cwe,vN=new Nt(new mt(1,12,8),new bn({color:wN,depthTest:!1,transparent:!0,opacity:.9})),vN.renderOrder=999;let t=new ft().setFromPoints([new hn(0,0,0),new hn(0,1,0)]);return yN=new $n(t,new Yn({color:wN,depthTest:!1,transparent:!0,opacity:.9})),yN.renderOrder=999,_N.add(vN),_N.add(yN),_N.visible=!1,e.add(_N),_N}function Lwe(){if(bN)return bN;let e=U(Pi);return e?(bN=new Nt(new ft,new bn({color:wN,transparent:!0,opacity:.35,depthTest:!1,depthWrite:!1,side:2})),bN.name=wwe,bN.renderOrder=998,bN.frustumCulled=!1,bN.visible=!1,e.add(bN),bN):null}function Rwe(e){if(!e||e.type!==`face`||!e.__mesh||!e.__tris?.length){bN&&(bN.visible=!1);return}let t=[];for(let n of e.__tris){let r=[];for(let t=0;t<3;t++){let i=RN(e.__mesh,n,t);if(!i)break;r.push(i.x,i.y,i.z)}r.length===9&&t.push(...r)}let n=Lwe();if(!n)return;if(t.length<9){n.visible=!1;return}let r=new ft;r.setAttribute(`position`,new hr(t,3));let i=n.geometry;n.geometry=r,i?.dispose?.(),n.visible=!0}var tP=new zt,zwe=new hn(0,1,0);function Bwe(e){if(Rwe(e),!e){_N&&(_N.visible=!1);return}let t=Iwe();if(!t)return;t.visible=!0,t.position.copy(e.point);let n=U(yi),r=n?n.getWorldPosition(AN).distanceTo(e.point):10;vN.scale.setScalar(Math.max(r*.006,.01)),e.normal&&(e.type===`face`||e.type===`surface`)?(yN.visible=!0,tP.setFromUnitVectors(zwe,e.normal),yN.quaternion.copy(tP),yN.scale.setScalar(Math.max(r*.03,.05))):yN.visible=!1}var nP=`snap-anchor-pick`;function rP(){return U(Kr).length===1?(uN.set(!0),Po(nP,`Click a point on the selected object â a nearby vertex wins (Esc cancels)`,[],()=>uN.set(!1)),!0):(es(`Select exactly one object to pick its snap origin`),!1)}function iP(){return oc(nP),U(uN)?(uN.set(!1),!0):!1}function aP(e,t){uN.set(!1),oc(nP);let n=U(Kr),r=n[n.length-1],i=r?U(Ui)?.getObjectByProperty(`uuid`,r):null;if(!i)return es(`Snap origin: no selected object (pick cancelled)`),!1;Za(i,[]);let a=e.intersectObject(i,!0)[0];if(!a)return es(`Snap origin: click landed off the object (pick cancelled)`),!1;let o=a.point.clone(),s=`face point`,c=U(yi),l=U(xi)?.domElement?.getBoundingClientRect?.();if(a.faceIndex!=null&&a.object?.isMesh&&c&&l&&t){let e=null,n=14;for(let r=0;r<3;r++){let i=RN(a.object,a.faceIndex,r);if(!i)continue;let o=LN(i,c,l);if(!o)continue;let s=Math.hypot(o[0]-t[0],o[1]-t[1]);s<n&&(n=s,e=i)}e&&(o=e,s=`vertex`)}i.updateMatrixWorld(!0);let u=o.clone().applyMatrix4(i.matrixWorld.clone().invert());return lN.set({mode:`picked`,uuid:i.uuid,local:u.toArray()}),Xf(o),es(`Snap origin picked (${s}) â drags snap this point; â in Snapping clears it`),!0}function oP(){iP(),U(lN).mode===`picked`&&(lN.set({mode:`auto`,uuid:null,local:null}),Xf(null))}function sP(){let e=U(lN);if(e.mode!==`picked`||!e.uuid||!e.local)return es(`Pick a point on the object first`),!1;let t=U(Ui)?.getObjectByProperty(`uuid`,e.uuid);if(!t)return!1;t.updateMatrixWorld(!0);let n=new hn().fromArray(e.local).applyMatrix4(t.matrixWorld);return Bf(e.uuid,n),hc.update(e=>({...e,anchorMode:`pivot`})),lN.set({mode:`auto`,uuid:null,local:null}),Xf(null),es(`Saved as the object's origin â shared with peers, undoable, and it survives reselecting`),!0}var cP=null,lP=null,uP=5884159;function Vwe(){if(cP)return cP;let e=U(Pi);if(!e)return null;cP=new Pn,cP.name=`snap-anchor-marker`,lP=new Nt(new mt(1,12,8),new bn({color:uP,depthTest:!1,transparent:!0,opacity:.9})),lP.renderOrder=999;let t=new ft().setFromPoints([new hn(-2.4,0,0),new hn(2.4,0,0),new hn(0,-2.4,0),new hn(0,2.4,0),new hn(0,0,-2.4),new hn(0,0,2.4)]),n=new qt(t,new Yn({color:uP,depthTest:!1,transparent:!0,opacity:.9}));return n.renderOrder=999,lP.add(n),cP.add(lP),cP.visible=!1,e.add(cP),cP}var Hwe=new hn;function dP(){let e=U(lN);if(e.mode!==`picked`||!e.uuid||!e.local){cP&&(cP.visible=!1);return}let t=U(Ui)?.getObjectByProperty(`uuid`,e.uuid);if(!t){cP&&(cP.visible=!1);return}let n=Vwe();if(!n)return;n.visible=!0,n.position.fromArray(e.local).applyMatrix4(t.matrixWorld);let r=U(yi),i=r?r.getWorldPosition(Hwe).distanceTo(n.position):10;lP.scale.setScalar(Math.max(i*.005,.01))}var fP=null;function Uwe(e){e.key===`Escape`&&U(uN)&&(e.preventDefault(),e.stopPropagation(),iP(),es(`Snap origin pick cancelled`))}function pP(){CN||typeof window>`u`||(CN=!0,cN.subscribe(Bwe),yie(Fwe),window.addEventListener(`ke
1199ydown`,Uwe,!0),Kr.subscribe(e=>{let t=e?.length?e[e.length-1]:null;t!==fP&&(fP=t,U(lN).mode===`picked`&&lN.set({mode:`auto`,uuid:null,local:null}),iP())}))}var mP=Ue(!1),hP=Ue(null),Wwe=new Tr(new hn(0,1,0),0),gP=new hn;function _P(){let e=!U(mP);mP.set(e),hP.set(null),e?(es(`Measure: click two points (Esc to stop)`),window.addEventListener(`keydown`,vP)):window.removeEventListener(`keydown`,vP)}function vP(e){e.key===`Escape`&&_P()}function Gwe(e,t){let n=null,r=t?e.intersectObjects(t.children,!0):[];r.length>0?n=r[0].point:e.ray.intersectPlane(Wwe,gP)&&(n=gP),n&&hP.update(e=>!e||e.b?{a:n.toArray()}:{a:e.a,b:n.toArray()})}function Kwe(e,t){Ce(t,!1);let{scene:n,renderer:r}=Ww();Kw(e=>yhe(e)),Pe(vhe),R(),Uw.Group(e,{name:`water-root`,oncreate:e=>bhe(e,n,r)}),ue()}var qwe=class extends $n{constructor(e,t){let n=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new ft;r.setAttribute(`position`,new hr(n,3)),r.computeBoundingSphere();let i=new Yn({fog:!1});super(r,i),this.light=e,this.color=t,this.type=`RectAreaLightHelper`;let a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],o=new ft;o.setAttribute(`position`,new hr(a,3)),o.computeBoundingSphere(),this.add(new Nt(o,new bn({side:1,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);let e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},yP=Ue(typeof localStorage>`u`||nt.getItem(`showLightHelpers`)!==`false`),bP=Ue(typeof localStorage>`u`?2:Math.max(.2,Number(nt.getItem(`lightHelperLength`))||2));bP.subscribe(e=>{typeof localStorage<`u`&&nt.setItem(`lightHelperLength`,String(e))});var xP=new hn,SP=new zt;function CP(e){if(!e?.isSpotLight||!Array.isArray(e.userData?.spotTarget))return!1;let t=new hn().fromArray(e.userData.spotTarget.map(Number));return delete e.userData.spotTarget,e.updateMatrixWorld?.(!0),e.lookAt(t),e.updateMatrixWorld?.(!0),!0}var wP=Ue(null),TP=new Map,EP=null,DP=!0,OP=!1,kP=new hn;function Jwe(e){return e.isPointLight?new gt(e,.4):e.isDirectionalLight?new lr(e,.6):e.isSpotLight?new vt(e):e.isHemisphereLight?new nr(e,.4):e.isRectAreaLight?new qwe(e):null}function AP(){TP.forEach(e=>{e.helper&&(e.helper.visible=DP),e.proxy.visible=DP})}function Ywe(){let e=U(Pi),t=U(Ui);if(!e||!t)return;EP||(EP=new Pn,EP.name=`light-proxies`,e.add(EP),wP.set(EP));let n=[];t.traverse(e=>{e.isLight&&n.push(e)}),n.forEach(t=>{if(CP(t),TP.has(t.uuid))return;let n=Jwe(t);n&&e.add(fl(n));let r=new Nt(new mt(.18,10,8),new bn({color:16766282,wireframe:!0}));fl(r),r.name=`light-proxy`,r.userData.lightUuid=t.uuid,EP.add(r),TP.set(t.uuid,{light:t,helper:n,proxy:r})}),[...TP.entries()].forEach(([t,r])=>{n.some(e=>e.uuid===t)||(r.helper&&(e.remove(r.helper),r.helper.dispose?.()),EP.remove(r.proxy),r.proxy.geometry.dispose(),r.proxy.material.dispose(),TP.delete(t))}),AP()}function Xwe(){if(TP.size===0)return;let e=U(Pi),t=U(bP);TP.forEach(n=>{let r=n.light;(r.isDirectionalLight||r.isSpotLight)&&(r.userData.spotTarget&&CP(r),!r.target.parent&&e&&e.add(r.target),r.getWorldPosition(kP),r.getWorldQuaternion(SP),xP.set(0,0,-1).applyQuaternion(SP).multiplyScalar(t),r.target.position.copy(kP).add(xP),r.target.updateMatrixWorld(!0)),DP&&(r.getWorldPosition(kP),n.proxy.position.copy(kP),n.helper?.update?.())})}var jP=null;function Zwe(){OP||typeof window>`u`||(OP=!0,Ui.subscribe(()=>{clearTimeout(jP),jP=setTimeout(Ywe,100)}),yP.subscribe(e=>{DP=e,nt.setItem(`showLightHelpers`,String(e)),AP()}))}var MP=0,Qwe=1,$we=new hn,NP=new lt,PP=new Tr,FP=new hn,IP=new Kt,eTe=class{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new zP,this.unassigned=new zP,this.vertices=[]}setFromPoints(e){if(e.length>=4){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.vertices.push(new tTe(e[t]));this._compute()}return this}setFromObject(e){let t=[];return e.updateMatrixWorld(!0),e.traverse(function(e){let n=e.geometry;if(n!==void 0){let r=n.attributes.position;if(r!==void 0)for(let n=0,i=r.count;n<i;n++){let i=new hn;i.fromBufferAttribute(r,n).applyMatrix4(e.matrixWorld),t.push(i)}}}),this.setFromPoints(t)}containsPoint(e){let t=this.faces;for(let n=0,r=t.length;n<r;n++)if(t[n].distanceToPoint(e)>this.tolerance)return!1;return!0}intersectRay(e,t){let n=this.faces,r=-1/0,i=1/0;for(let t=0,a=n.length;t<a;t++){let a=n[t],o=a.distanceToPoint(e.origin),s=a.normal.dot(e.direction);if(o>0&&s>=0)return null;
1199let c=s===0?0:-o/s;if(!(c<=0)&&(s>0?i=Math.min(c,i):r=Math.max(c,r),r>i))return null}return r===-1/0?e.at(i,t):e.at(r,t),t}intersectsRay(e){return this.intersectRay(e,$we)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}_addVertexToFace(e,t){return e.face=t,t.outside===null?this.assigned.append(e):this.assigned.insertBefore(t.outside,e),t.outside=e,this}_removeVertexFromFace(e,t){return e===t.outside&&(t.outside=e.next!==null&&e.next.face===t?e.next:null),this.assigned.remove(e),this}_removeAllVerticesFromFace(e){if(e.outside!==null){let t=e.outside,n=e.outside;for(;n.next!==null&&n.next.face===e;)n=n.next;return this.assigned.removeSubList(t,n),t.prev=n.next=null,e.outside=null,t}}_deleteFaceVertices(e,t){let n=this._removeAllVerticesFromFace(e);if(n!==void 0){if(t===void 0)this.unassigned.appendChain(n);else{let e=n;do{let n=e.next;t.distanceToPoint(e.point)>this.tolerance?this._addVertexToFace(e,t):this.unassigned.append(e),e=n}while(e!==null)}}return this}_resolveUnassignedPoints(e){if(this.unassigned.isEmpty()===!1){let t=this.unassigned.first();do{let n=t.next,r=this.tolerance,i=null;for(let n=0;n<e.length;n++){let a=e[n];if(a.mark===MP){let e=a.distanceToPoint(t.point);if(e>r&&(r=e,i=a),r>1e3*this.tolerance)break}}i!==null&&this._addVertexToFace(t,i),t=n}while(t!==null)}return this}_computeExtremes(){let e=new hn,t=new hn,n=[],r=[];for(let e=0;e<3;e++)n[e]=r[e]=this.vertices[0];e.copy(this.vertices[0].point),t.copy(this.vertices[0].point);for(let i=0,a=this.vertices.length;i<a;i++){let a=this.vertices[i],o=a.point;for(let t=0;t<3;t++)o.getComponent(t)<e.getComponent(t)&&(e.setComponent(t,o.getComponent(t)),n[t]=a);for(let e=0;e<3;e++)o.getComponent(e)>t.getComponent(e)&&(t.setComponent(e,o.getComponent(e)),r[e]=a)}return this.tolerance=3*2**-52*(Math.max(Math.abs(e.x),Math.abs(t.x))+Math.max(Math.abs(e.y),Math.abs(t.y))+Math.max(Math.abs(e.z),Math.abs(t.z))),{min:n,max:r}}_computeInitialHull(){let e=this.vertices,t=this._computeExtremes(),n=t.min,r=t.max,i=0,a=0;for(let e=0;e<3;e++){let t=r[e].point.getComponent(e)-n[e].point.getComponent(e);t>i&&(i=t,a=e)}let o=n[a],s=r[a],c,l;i=0,NP.set(o.point,s.point);for(let t=0,n=this.vertices.length;t<n;t++){let n=e[t];if(n!==o&&n!==s){NP.closestPointToPoint(n.point,!0,FP);let e=FP.distanceToSquared(n.point);e>i&&(i=e,c=n)}}i=-1,PP.setFromCoplanarPoints(o.point,s.point,c.point);for(let t=0,n=this.vertices.length;t<n;t++){let n=e[t];if(n!==o&&n!==s&&n!==c){let e=Math.abs(PP.distanceToPoint(n.point));e>i&&(i=e,l=n)}}let u=[];if(PP.distanceToPoint(l.point)<0){u.push(LP.create(o,s,c),LP.create(l,s,o),LP.create(l,c,s),LP.create(l,o,c));for(let e=0;e<3;e++){let t=(e+1)%3;u[e+1].getEdge(2).setTwin(u[0].getEdge(t)),u[e+1].getEdge(1).setTwin(u[t+1].getEdge(0))}}else{u.push(LP.create(o,c,s),LP.create(l,o,s),LP.create(l,s,c),LP.create(l,c,o));for(let e=0;e<3;e++){let t=(e+1)%3;u[e+1].getEdge(2).setTwin(u[0].getEdge((3-e)%3)),u[e+1].getEdge(0).setTwin(u[t+1].getEdge(1))}}for(let e=0;e<4;e++)this.faces.push(u[e]);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n!==o&&n!==s&&n!==c&&n!==l){i=this.tolerance;let e=null;for(let t=0;t<4;t++){let r=this.faces[t].distanceToPoint(n.point);r>i&&(i=r,e=this.faces[t])}e!==null&&this._addVertexToFace(n,e)}}return this}_reindexFaces(){let e=[];for(let t=0;t<this.faces.length;t++){let n=this.faces[t];n.mark===MP&&e.push(n)}return this.faces=e,this}_nextVertexToAdd(){if(this.assigned.isEmpty()===!1){let e,t=0,n=this.assigned.first().face,r=n.outside;do{let i=n.distanceToPoint(r.point);i>t&&(t=i,e=r),r=r.next}while(r!==null&&r.face===n);return e}}_computeHorizon(e,t,n,r){this._deleteFaceVertices(n),n.mark=Qwe;let i;i=t===null?t=n.getEdge(0):t.next;do{let t=i.twin,n=t.face;n.mark===MP&&(n.distanceToPoint(e)>this.tolerance?this._computeHorizon(e,t,n,r):r.push(i)),i=i.next}while(i!==t);return this}_addAdjoiningFace(e,t){let n=LP.create(e,t.tail(),t.head());return this.faces.push(n),n.getEdge(-1).setTwin(t.twin),n.getEdge(0)}_addNewFaces(e,t){this.newFaces=[];let n=null,r=null;for(let i=0;i<t.length;i++){let a=t[i],o=this._addAdjoiningFace(e,a);n===null?n=o:o.next.setTwin(r),this.newFaces.push(o.face),r=o}return n.next.setTwin(r),this}_addVertexToHull(e){let t=[];return this.unassigned.clear(),this._removeVertexFromFace(e,e.face),this._computeHorizon(e.point,null,e.face,t),this._addNewFace
1199s(e,t),this._resolveUnassignedPoints(this.newFaces),this}_cleanup(){return this.assigned.clear(),this.unassigned.clear(),this.newFaces=[],this}_compute(){let e;for(this._computeInitialHull();(e=this._nextVertexToAdd())!==void 0;)this._addVertexToHull(e);return this._reindexFaces(),this._cleanup(),this}},LP=class e{constructor(){this.normal=new hn,this.midpoint=new hn,this.area=0,this.constant=0,this.outside=null,this.mark=MP,this.edge=null}static create(t,n,r){let i=new e,a=new RP(t,i),o=new RP(n,i),s=new RP(r,i);return a.next=s.prev=o,o.next=a.prev=s,s.next=o.prev=a,i.edge=a,i.compute()}getEdge(e){let t=this.edge;for(;e>0;)t=t.next,e--;for(;e<0;)t=t.prev,e++;return t}compute(){let e=this.edge.tail(),t=this.edge.head(),n=this.edge.next.head();return IP.set(e.point,t.point,n.point),IP.getNormal(this.normal),IP.getMidpoint(this.midpoint),this.area=IP.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(e){return this.normal.dot(e)-this.constant}},RP=class{constructor(e,t){this.vertex=e,this.prev=null,this.next=null,this.twin=null,this.face=t}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){let e=this.head(),t=this.tail();return t===null?-1:t.point.distanceTo(e.point)}lengthSquared(){let e=this.head(),t=this.tail();return t===null?-1:t.point.distanceToSquared(e.point)}setTwin(e){return this.twin=e,e.twin=this,this}},tTe=class{constructor(e){this.point=e,this.prev=null,this.next=null,this.face=null}},zP=class{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(e,t){return t.prev=e.prev,t.next=e,t.prev===null?this.head=t:t.prev.next=t,e.prev=t,this}insertAfter(e,t){return t.prev=e,t.next=e.next,t.next===null?this.tail=t:t.next.prev=t,e.next=t,this}append(e){return this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e,this}appendChain(e){for(this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail;e.next!==null;)e=e.next;return this.tail=e,this}remove(e){return e.prev===null?this.head=e.next:e.prev.next=e.next,e.next===null?this.tail=e.prev:e.next.prev=e.prev,this}removeSubList(e,t){return e.prev===null?this.head=t.next:e.prev.next=t.next,t.next===null?this.tail=e.prev:t.next.prev=e.prev,this}isEmpty(){return this.head===null}},nTe=class extends ft{constructor(e=[]){super();let t=[],n=[],r=new eTe().setFromPoints(e).faces;for(let e=0;e<r.length;e++){let i=r[e],a=i.edge;do{let e=a.head().point;t.push(e.x,e.y,e.z),n.push(i.normal.x,i.normal.y,i.normal.z),a=a.next}while(a!==i.edge)}this.setAttribute(`position`,new hr(t,3)),this.setAttribute(`normal`,new hr(n,3))}},BP=Ue(typeof localStorage<`u`&&nt.getItem(`showColliders`)===`true`),VP=Ue(new Set),HP=new Map,UP=null,WP=null,GP=!1,KP=2278750,rTe=16096779;function qP(e){return new Yn({color:e,transparent:!0,opacity:.9})}function iTe(e,t){let n=new Pn;n.name=`collider-proxy`;let r=qP(t?rTe:KP),i=e.halfExtents,a=[];if(e.pieces)for(let t of e.pieces){if(t.indices){let e=new ft;e.setAttribute(`position`,new Qt(t.verts,3)),e.setIndex(new Qt(t.indices,1)),a.push(new pn(e,20)),e.dispose();continue}let e=[];for(let n=0;n<t.verts.length;n+=3)e.push(new hn(t.verts[n],t.verts[n+1],t.verts[n+2]));try{a.push(new pn(new nTe(e)))}catch{}}else if(e.kind===`sphere`){let e=Math.max(i.x,i.y,i.z);a.push(new Fn(new mt(e,12,8)))}else if(e.kind===`capsule`){let e=Math.max(i.x,i.z,.02),t=Math.max(i.y-e,.01);a.push(new Fn(new tn(e,t*2,4,8)))}else if(e.kind===`cylinder`){let e=Math.max(i.x,i.z,.02);a.push(new pn(new Ar(e,e,i.y*2,16)))}else if(e.kind===`cone`){let e=Math.max(i.x,i.z,.02);a.push(new pn(new yt(e,i.y*2,16)))}else a.push(new pn(new Dr(i.x*2,i.y*2,i.z*2)));return a.forEach(e=>{let t=new qt(e,r);t.raycast=()=>{},n.add(t)}),n}function aTe(e,t,n){let r=e=>Math.round(e*1e3);return[t.kind,r(t.halfExtents.x),r(t.halfExtents.y),r(t.halfExtents.z),t.pieces?t.pieces.map(e=>e.verts.length+`:`+e.verts.reduce((e,t)=>e+t,0).toFixed(2)).join(`,`):``,Array.isArray(e.userData?.physics?.colliderVerts)?e.userData.physics.colliderVerts.length:0,n?`s`:``].join(`|`)}function oTe(){let e=U(Ui);if(!e)return new Set;let t=new Set(U(VP));
1199return U(BP)&&e.children.forEach(e=>{e.userData?.physics&&t.add(e.uuid)}),t}function JP(e,t){UP?.remove(t.group),t.group.children.forEach(e=>{e.geometry.dispose(),e.material.dispose()}),HP.delete(e)}function YP(){if(!UP)return;let e=U(gl),t=U(BP)&&e.enabled;if(WP&&(!t||WP.userData.groundHeight!==e.height)&&(UP.remove(WP),WP.children.forEach(e=>{e.geometry.dispose(),e.material.dispose()}),WP=null),!t||WP)return;let n=new Pn;n.name=`collider-ground`;let r=new Nt(new nn(40,40),new bn({color:KP,transparent:!0,opacity:.08,side:2,depthWrite:!0}));r.rotation.x=-Math.PI/2;let i=new qt(new pn(new nn(40,40)),qP(KP));i.rotation.x=-Math.PI/2,n.add(r,i),n.position.y=e.height??0,n.userData.groundHeight=e.height,UP.add(n),WP=n}function XP(){let e=U(Pi),t=U(Ui);if(!e||!t)return;UP||(UP=new Pn,UP.name=`collider-proxies`,e.add(UP));let n=oTe();n.forEach(e=>{let n=t.getObjectByProperty(`uuid`,e);if(!n)return;let r=n.userData?.physics,i=Cf(n,r?.collider,{dynamic:r?.mode===`dynamic`});if(!i)return;let a=!!r?.sensor,o=aTe(n,i,a),s=HP.get(e);if(s&&s.key===o)return;s&&JP(e,s);let c=iTe(i,a);UP.add(c),HP.set(e,{object:n,group:c,key:o,localCenter:i.pieces?new hn:n.worldToLocal(i.center.clone())})}),[...HP.entries()].forEach(([e,r])=>{(!n.has(e)||!t.getObjectByProperty(`uuid`,e))&&JP(e,r)}),YP()}var ZP=new hn,QP=new zt;function $P(){UP&&(UP.visible=(HP.size>0||!!WP)&&!wf()&&!ul(),UP.visible&&HP.forEach(e=>{e.object.updateMatrixWorld(),e.object.localToWorld(ZP.copy(e.localCenter)),e.object.getWorldQuaternion(QP),e.group.position.copy(ZP),e.group.quaternion.copy(QP)}))}function eF(e,t){VP.update(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}var tF=null;function nF(){GP||typeof window>`u`||(GP=!0,Ui.subscribe(()=>{clearTimeout(tF),tF=setTimeout(XP,100)}),BP.subscribe(e=>{try{nt.setItem(`showColliders`,String(e))}catch{}XP()}),VP.subscribe(()=>XP()),gl.subscribe(()=>YP()))}function sTe(){return[...HP.entries()].map(([e,t])=>({uuid:e,key:t.key,pieces:t.group.children.length,visible:!!UP?.visible}))}function cTe(){return WP?{y:WP.position.y,visible:!!UP?.visible}:null}var rF=Ue(typeof localStorage<`u`&&nt.getItem(`showOnionSkin`)===`true`);function iF(e){rF.set(e);try{nt.setItem(`showOnionSkin`,e?`true`:`false`)}catch{}}var aF=6333946,oF=16498468,sF=.28,cF=null,lF=null;function lTe(e,t,n=0){let r=new bn({color:t,transparent:!0,opacity:sF,depthWrite:!0,side:0,polygonOffset:!0,polygonOffsetFactor:1+n,polygonOffsetUnits:1+n}),i=e.clone(!0);return i.traverse(e=>{e.material&&=r;let t=e.userData?.origin;e.userData=t?{origin:t}:{},e.castShadow=!1,e.receiveShadow=!1}),i.name=`onion-ghost`,{mesh:i,material:r}}function uTe(e,t,n){return[e,t?.name??``,t?.tracks?.length??0,n.join(`,`)].join(`|`)}function dTe(e,t){let n=[],r=null,i=null;for(let n of e)if(n<t-1e-6)r=n;else if(n>t+1e-6){i=n;break}return r!==null&&n.push(r),i!==null&&n.push(i),n}function uF(){if(lF){for(let e of lF.ghosts)cF?.remove(e.mesh),e.material.dispose();lF=null}}function dF(){let e=U(Pi);if(!e)return;let t=U(rF)&&!wf(),n=U(Di),r=n?.uuid;if(!t||!r){lF&&uF(),cF&&(cF.visible=!1);return}let i=Hg(r),a=i?s_(r):[],o=i?e_(r):0,s=i?dTe(a,o):[];if(!s.length){lF&&uF(),cF&&(cF.visible=!1);return}cF||(cF=new Pn,cF.name=`onion-skin`,e.add(cF)),cF.visible=!0;let c=uTe(r,i,s);if(!lF||lF.key!==c||lF.object!==n){uF();let e=[];s.forEach((t,r)=>{let i=lTe(n,t<o?aF:oF,r);cF.add(i.mesh),e.push({...i,when:t})}),lF={object:n,uuid:r,ghosts:e,key:c}}let l=Gce(r,n),u=n.parent;u&&u.updateMatrixWorld(),n.updateMatrixWorld(),n.matrixWorld.decompose(fF,pF,mF);for(let e of lF.ghosts){if(!i)break;Qce(e.mesh,i,e.when,l),u&&(e.mesh.updateMatrix(),vF.multiplyMatrices(u.matrixWorld,e.mesh.matrix),vF.decompose(e.mesh.position,e.mesh.quaternion,e.mesh.scale)),e.material.opacity=sF,e.material.transparent||(e.material.transparent=!0,e.material.needsUpdate=!0),e.material.color.setHex(e.when<o?aF:oF),e.mesh.visible=!fTe(e.mesh)}}var fF=new hn,pF=new zt,mF=new hn,hF=new hn,gF=new zt,_F=new hn;function fTe(e){return e.updateMatrixWorld(),e.matrixWorld.decompose(hF,gF,_F),hF.distanceToSquared(fF)<1e-8&&Math.abs(gF.dot(pF))>1-1e-6&&_F.distanceToSquared(mF)<1e-8}var vF=new fr;function pTe(){return{on:U(rF),ghosts:lF?lF.ghosts.map(e=>({when:e.when,colour:e.material.color.getHex()})):[],root:!!cF&&cF.visible}}var mTe=8,hTe=`tiny-object-markers`,yF=null,bF=null,xF=new Or,SF=new hn,CF=new hn;function gTe(e){return yF?.parent===e?yF:(bF=new ft,bF.setAttribute(`position`,new Qt(new Float32Array(3),3)),yF=new Ht(bF,new Zn({size:14,sizeAttenuation:!1,vertexColors:!0,depthTest:!1,transparent:!0,opacity:.9})),yF.name=hTe,yF.renderOrder=998,yF.frustumCulled=!1,e.add(yF),yF)}function _Te(){let e=U(Pi),t=U(Ui),n=U(yi),r=U(xi)?.domElement?.clientHeight??0;if(!e||!t||!n?.isPerspectiveCamera||!r)return;if(ul()){yF&&(yF.visible=!1);return}let i=[],a=[];for(let e of t.children){if(e.visible===!1||(e.updateWorldMatrix(!0,!1),xF.setFromObject(e),xF.isEmpty()))continue;xF.getCenter(CF);let t=CF.distanceTo(n.position);if(!(t>0))continue;let o=2*Math.tan(wt.degToRad(n.fov)/2)*t/r;o>0&&(xF.getSize(SF),!(Math.max(SF.x,SF.y,SF.z)/o>mTe)&&(i.push(CF.x,CF.y,CF.z),a.push(e.uuid)))}if(!i.length){yF&&(yF.visible=!1);return}let o=gTe(e);o.visible=!0;let s=bF.getAttribute(`position`);s.count===i.length/3?(s.array.set(i),s.needsUpdate=!0):bF.setAttribute(`position`,new Qt(new Float32Array(i),3));let c=new Set(U(Kr)??[]),l=[];for(let e of a){let t=c.has(e);l.push(1,t?1:.77,t?1:.42)}let u=bF.getAttribute(`color`);!u||u.count!==a.length?bF.setAttribute(`color`,new Qt(new Float32Array(l),3)):(u.array.set(l),u.needsUpdate=!0),bF.computeBoundingSphere()}function vTe(e,n){Ce(n,!0);let r=()=>z(px,`$cameraPreview`,s),i=()=>z(Ui,`$objectsGroup`,s),a=()=>z(l,`$size`,s),o=()=>z(zi,`$TControls`,s),[s,c]=Ve(),{size:l,camera:u}=Ww(),d=q(()=>r()?i()?.getObjectByProperty(`uuid`,r().uuid)??null:null),f=q(()=>Q(d)?ix(Q(d)):null),p=q(()=>a().width&&a().height?a().width/a().height:16/9),m=q(()=>Q(f)&&ax(Q(f).aspect)||Q(p)),h=q(()=>Q(f)?Math.max(.01,Q(f).orthoSize):5),g=t(null),_=t(null);Qe(()=>{typeof window<`u`&&nt.getItem(`debugStores`)&&(window.__cameraPreviewDebug=()=>({preview:r(),hasObject:!!Q(d),hasSpec:!!Q(f),cameraMounted:!!Q(g),controlsMounted:!!Q(_),cameraParent:Q(g)?.parent?.name||Q(g)?.parent?.type||null,defaultCamera:u?.current?.type??null,defaultIsMine:u?.current===Q(g)}))});let v=new hn,y=new zt,b=new hn;Kw(()=>
1199{if(Q(g)&&Q(d)){if(r()?.controlling){che(Q(g),Q(d));return}Q(d).updateWorldMatrix(!0,!1),Q(d).matrixWorld.decompose(v,y,b),Q(g).position.copy(v),Q(g).quaternion.copy(y)}}),Qe(()=>{r()&&o()?.detach?.()}),Qe(()=>{let e=r()?.controlling?Q(_):null;uhe.set(e),e&&Q(g)&&(Q(d)&&the(Q(g),Q(d)),mhe(e,Q(g)))});var x=fe(),S=N(x),C=e=>{var t=fe(),n=N(t),i=e=>{var t=fe(),n=N(t);{let e=q(()=>-Q(h)*Q(m)),t=q(()=>Q(h)*Q(m)),i=q(()=>-Q(h));P(n,()=>Uw.OrthographicCamera,(n,a)=>{a(n,{makeDefault:!0,get left(){return Q(e)},get right(){return Q(t)},get top(){return Q(h)},get bottom(){return Q(i)},get near(){return Q(f).near},get far(){return Q(f).far},get ref(){return Q(g)},set ref(e){I(g,e,!0)},children:(e,t)=>{var n=fe(),i=N(n),a=e=>{oE(e,{enableZoom:!0,enableDamping:!0,get ref(){return Q(_)},set ref(e){I(_,e,!0)}})};G(i,e=>{r().controlling&&e(a)}),X(e,n)},$$slots:{default:!0}})})}X(e,t)},a=e=>{var t=fe(),n=N(t);P(n,()=>Uw.PerspectiveCamera,(e,t)=>{t(e,{makeDefault:!0,get fov(){return Q(f).fov},get aspect(){return Q(m)},get near(){return Q(f).near},get far(){return Q(f).far},get ref(){return Q(g)},set ref(e){I(g,e,!0)},children:(e,t)=>{var n=fe(),i=N(n),a=e=>{oE(e,{enableZoom:!0,enableDamping:!0,get ref(){return Q(_)},set ref(e){I(_,e,!0)}})};G(i,e=>{r().controlling&&e(a)}),X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(n,e=>{Q(f).kind===`orthographic`?e(i):e(a,-1)}),X(e,t)};G(S,e=>{r()&&Q(f)&&e(C)}),X(e,x),ue(),c()}var yTe=5,bTe=[`w`,`a`,`s`,`d`,`q`,`e`],wF=new Set,TF=!1;function xTe(e){let t=`shift+`+e;return cg.some(e=>e.action&&String(e.keys).toLowerCase()===t)}function STe(e){let t=e.target;return t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable)}function CTe(){TF||typeof window>`u`||(TF=!0,window.addEventListener(`keydown`,e=>{if(e.key===`Shift`)return wF.add(`shift`);if(STe(e)||e.ctrlKey||e.metaKey||e.altKey||U(Cs))return;let t=Ol(e);e.shiftKey&&xTe(t)||bTe.includes(t)&&wF.add(t)}),window.addEventListener(`keyup`,e=>{if(e.key===`Shift`)return wF.delete(`shift`);wF.delete(Ol(e))}),window.addEventListener(`blur`,()=>wF.clear()))}var EF=new hn,DF=new hn,OF=new hn,wTe=new hn(0,1,0);function TTe(e,t,n){if(wF.size!==0&&t&&n&&!(U(ki)||U(wi)||U(zs))&&!Ype(`keys`)&&!((U(mm)||U(Up))&&U(Xp))){if(U(Cs))return wF.clear();OF.set(0,0,0),t.getWorldDirection(EF),EF.y=0,EF.lengthSq()<1e-6&&EF.set(0,0,-1),EF.normalize(),DF.crossVectors(EF,wTe).normalize(),wF.has(`w`)&&OF.add(EF),wF.has(`s`)&&OF.sub(EF),wF.has(`d`)&&OF.add(DF),wF.has(`a`)&&OF.sub(DF),wF.has(`e`)&&(OF.y+=1),wF.has(`q`)&&--OF.y,OF.lengthSq()!==0&&(OF.normalize().multiplyScalar(e*yTe*(wF.has(`shift`)?3:1)),t.position.add(OF),n.target.add(OF),n.update?.())}}var kF={list:[[`path`,{d:`M3 5h.01`}],[`path`,{d:`M3 12h.01`}],[`path`,{d:`M3 19h.01`}],[`path`,{d:`M8 5h13`}],[`path`,{d:`M8 12h13`}],[`path`,{d:`M8 19h13`}]],plus:[[`path`,{d:`M5 12h14`}],[`path`,{d:`M12 5v14`}]],"sliders-horizontal":[[`path`,{d:`M10 5H3`}],[`path`,{d:`M12 19H3`}],[`path`,{d:`M14 3v4`}],[`path`,{d:`M16 17v4`}],[`path`,{d:`M21 12h-9`}],[`path`,{d:`M21 19h-5`}],[`path`,{d:`M21 5h-7`}],[`path`,{d:`M8 10v4`}],[`path`,{d:`M8 12H3`}]],wrench:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`}]],"undo-2":[[`path`,{d:`M9 14 4 9l5-5`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`}]],"redo-2":[[`path`,{d:`m15 14 5-5-5-5`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`}]],"message-square":[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}]],settings:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]],box:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`}],[`path`,{d:`M12 22V12`}]],"triangle-right":[[`path`,{d:`M22 18a2 2 0 0 1-2 2H3c-1.1 0-1.3-.6-.4-1.3L20.4 4.3c.9-.7 1.6-.4 1.6.7Z`}]],"door-stairwell":[[`path`,{d:`M12 17v-3a1 1 0 011-1h6`}],[`path`,{d:`M19 17h-9a1 1 0 00-1 1v3`}],[`path`,{d:`M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16`}],[`path`,{d:`M19 9h-3a1 1 0 00-1 1v3`}],[`path`,{d:`M22 21H2`}]],circle:[[`circle`,{cx:`12`,cy:`12`,r:`10`}]],cylinder:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`}],[`path`,{d:`M3 5v14a9 3 0 0 0 18 0V5`}]],torus:[[`ellipse`,{cx:`12`,cy:`11`,rx:`3`,ry:`2`}],[`ellipse`,{cx:`12`,cy:`12.5`,rx:`10`,ry:`8.5`}]],package:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`}],[`path`,{d:`M12 22V12`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`}],[`path`,{d:`m7.5 4.27 9 5.15`}]],"mouse-pointer-2":[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.5
119979 6.126a.5.5 0 0 1-.947.063z`}]],"square-dashed":[[`path`,{d:`M5 3a2 2 0 0 0-2 2`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`}],[`path`,{d:`M9 3h1`}],[`path`,{d:`M9 21h1`}],[`path`,{d:`M14 3h1`}],[`path`,{d:`M14 21h1`}],[`path`,{d:`M3 9v1`}],[`path`,{d:`M21 9v1`}],[`path`,{d:`M3 14v1`}],[`path`,{d:`M21 14v1`}]],"pen-tool":[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`}],[`path`,{d:`m2.3 2.3 7.286 7.286`}],[`circle`,{cx:`11`,cy:`11`,r:`2`}]],radar:[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`}],[`path`,{d:`M4 6h.01`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`}],[`path`,{d:`M12 18h.01`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`}],[`circle`,{cx:`12`,cy:`12`,r:`2`}],[`path`,{d:`m13.41 10.59 5.66-5.66`}]],activity:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`}]],sun:[[`circle`,{cx:`12`,cy:`12`,r:`4`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M12 20v2`}],[`path`,{d:`m4.93 4.93 1.41 1.41`}],[`path`,{d:`m17.66 17.66 1.41 1.41`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`M20 12h2`}],[`path`,{d:`m6.34 17.66-1.41 1.41`}],[`path`,{d:`m19.07 4.93-1.41 1.41`}]],atom:[[`circle`,{cx:`12`,cy:`12`,r:`1`}],[`path`,{d:`M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z`}],[`path`,{d:`M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z`}]],users:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`}],[`circle`,{cx:`9`,cy:`7`,r:`4`}]],"grid-3x3":[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M3 9h18`}],[`path`,{d:`M3 15h18`}],[`path`,{d:`M9 3v18`}],[`path`,{d:`M15 3v18`}]],maximize:[[`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`}]],"log-out":[[`path`,{d:`m16 17 5-5-5-5`}],[`path`,{d:`M21 12H9`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`}]],"heart-pulse":[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`}]],armchair:[[`path`,{d:`M19 9V6a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v3`}],[`path`,{d:`M3 16a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5a2 2 0 0 0-4 0v1.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V11a2 2 0 0 0-4 0z`}],[`path`,{d:`M5 18v2`}],[`path`,{d:`M19 18v2`}]],"person-standing":[[`circle`,{cx:`12`,cy:`5`,r:`1`}],[`path`,{d:`m9 20 3-6 3 6`}],[`path`,{d:`m6 8 6 2 6-2`}],[`path`,{d:`M12 10v4`}]],"gamepad-2":[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`}]],hand:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`}]],monitor:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`}]],mic:[[`path`,{d:`M12 19v3`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`}]],"mic-off":[[`path`,{d:`M12 19v3`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`}],[`path`,{d:`m2 2 20 20`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`}]],pencil:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}],[`path`,{d:`m15 5 4 4`}]],copy:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]],"trash-2":[[`path`,{d:`M10 11v6`}],[`path`,{d:`M14 11v6`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}],[`path`,{d:`M3 6h18`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]],palette:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]],spline:[[`circle`,{cx:`19`,cy:`5`,r:`2`}],[`circle`,{cx:`5`,cy:`19`,r:`2`}],[`path`,{d:`M5 17A12 12 0 0 1 17 5`}]],group:[[`path`,{d:`M3 7V5c0-1.1.9-2 2-2h2`}
1199],[`path`,{d:`M17 3h2c1.1 0 2 .9 2 2v2`}],[`path`,{d:`M21 17v2c0 1.1-.9 2-2 2h-2`}],[`path`,{d:`M7 21H5c-1.1 0-2-.9-2-2v-2`}],[`rect`,{width:`7`,height:`5`,x:`7`,y:`7`,rx:`1`}],[`rect`,{width:`7`,height:`5`,x:`10`,y:`12`,rx:`1`}]],ungroup:[[`rect`,{x:`11`,y:`14`,width:`10`,height:`7`,rx:`2`}],[`rect`,{x:`3`,y:`3`,width:`10`,height:`7`,rx:`2`}]],magnet:[[`path`,{d:`m12 15 4 4`}],[`path`,{d:`M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z`}],[`path`,{d:`m5 8 4 4`}]],eye:[[`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`}]],ruler:[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`}],[`path`,{d:`m14.5 12.5 2-2`}],[`path`,{d:`m11.5 9.5 2-2`}],[`path`,{d:`m8.5 6.5 2-2`}],[`path`,{d:`m17.5 15.5 2-2`}]],"arrow-up":[[`path`,{d:`m5 12 7-7 7 7`}],[`path`,{d:`M12 19V5`}]],"arrow-down":[[`path`,{d:`M12 5v14`}],[`path`,{d:`m19 12-7 7-7-7`}]],"rotate-ccw":[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{d:`M3 3v5h5`}]],keyboard:[[`path`,{d:`M10 8h.01`}],[`path`,{d:`M12 12h.01`}],[`path`,{d:`M14 8h.01`}],[`path`,{d:`M16 12h.01`}],[`path`,{d:`M18 8h.01`}],[`path`,{d:`M6 8h.01`}],[`path`,{d:`M7 16h10`}],[`path`,{d:`M8 12h.01`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`}]],"refresh-cw":[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}],[`path`,{d:`M8 16H3v5`}]],"circle-dot":[[`circle`,{cx:`12`,cy:`12`,r:`1`}],[`circle`,{cx:`12`,cy:`12`,r:`10`}]],compass:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`}]],square:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}]],flag:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`}]],"chart-bar":[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`}],[`path`,{d:`M7 16h8`}],[`path`,{d:`M7 11h12`}],[`path`,{d:`M7 6h3`}]],move:[[`path`,{d:`M12 2v20`}],[`path`,{d:`m15 19-3 3-3-3`}],[`path`,{d:`m19 9 3 3-3 3`}],[`path`,{d:`M2 12h20`}],[`path`,{d:`m5 9-3 3 3 3`}],[`path`,{d:`m9 5 3-3 3 3`}]],"rotate-cw":[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}]],footprints:[[`path`,{d:`M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z`}],[`path`,{d:`M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z`}],[`path`,{d:`M16 17h4`}],[`path`,{d:`M4 13h4`}]],layers:[[`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`}]],zap:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`}]],"arrow-left":[[`path`,{d:`m12 19-7-7 7-7`}],[`path`,{d:`M19 12H5`}]],x:[[`path`,{d:`M18 6 6 18`}],[`path`,{d:`m6 6 12 12`}]],play:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`}]],gauge:[[`path`,{d:`m12 14 4-4`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`}]],"scan-eye":[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`}],[`circle`,{cx:`12`,cy:`12`,r:`1`}],[`path`,{d:`M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0`}]],"arrow-left-right":[[`path`,{d:`M8 3 4 7l4 4`}],[`path`,{d:`M4 7h16`}],[`path`,{d:`m16 21 4-4-4-4`}],[`path`,{d:`M20 17H4`}
1199]],"volume-2":[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`}]],shapes:[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`}]],"chevron-left":[[`path`,{d:`m15 18-6-6 6-6`}]],"x-circle":[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m15 9-6 6`}],[`path`,{d:`m9 9 6 6`}]],power:[[`path`,{d:`M12 2v10`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`}]],house:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}]],"scan-line":[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`}],[`path`,{d:`M7 12h10`}]]},AF=128,jF=new Map;function ETe(e){return!!e&&Object.prototype.hasOwnProperty.call(kF,e)}function DTe(e,t){let n=kF[t];if(!n)return!1;for(let[t,r]of n){let n=e=>Number(r[e]??0);if(t===`path`){e.stroke(new Path2D(r.d));continue}if(e.beginPath(),t===`circle`)e.arc(n(`cx`),n(`cy`),n(`r`),0,Math.PI*2);else if(t===`ellipse`)e.ellipse(n(`cx`),n(`cy`),n(`rx`),n(`ry`),0,0,Math.PI*2);else if(t===`line`)e.moveTo(n(`x1`),n(`y1`)),e.lineTo(n(`x2`),n(`y2`));else if(t===`polyline`||t===`polygon`){let n=String(r.points??``).trim().split(/[\s,]+/).map(Number);for(let t=0;t+1<n.length;t+=2)(t?e.lineTo:e.moveTo).call(e,n[t],n[t+1]);t===`polygon`&&e.closePath()}else if(t===`rect`){let t=Math.min(n(`rx`)||n(`ry`),n(`width`)/2,n(`height`)/2);t>0&&e.roundRect?e.roundRect(n(`x`),n(`y`),n(`width`),n(`height`),t):e.rect(n(`x`),n(`y`),n(`width`),n(`height`))}e.stroke()}return!0}function MF(e){if(!ETe(e)||typeof document>`u`)return null;let t=e,n=jF.get(t);if(n)return n;let r=document.createElement(`canvas`);r.width=r.height=AF;let i=r.getContext(`2d`);if(!i)return null;i.scale(AF/24,AF/24),i.strokeStyle=`#ffffff`,i.lineWidth=2,i.lineCap=`round`,i.lineJoin=`round`,DTe(i,t);let a=new wr(r);return a.colorSpace=sr,a.anisotropy=4,jF.set(t,a),a}var NF=V(`<!> <!>`,1),OTe=V(`<!> <!> <!> <!> <!>`,1),kTe=V(`<!> <!> <!> <!> <!> <!>`,1);function ATe(e,t){Ce(t,!1);let n=()=>z(li,`$vrMenuOpen`,E),r=()=>z(cfe,`$activeRing`,E),i=()=>z(tfe,`$ringVersion`,E),a=()=>z(Hi,`$vrTransformMode`,E),o=()=>z(gc,`$snapEnabled`,E),c=()=>z(ni,`$showGrid`,E),l=()=>z(c_,`$drawMode`,E),u=()=>z(Pce,`$vrMicMode`,E),f=()=>z(xg,`$micActive`,E),p=()=>z(ui,`$vrMenuHand`,E),m=()=>z($r,`$vrPassthrough`,E),_=()=>z(bi,`$vrSnapAngle`,E),v=()=>z(cv,`$environment`,E),y=()=>z(lh,`$simulating`,E),b=()=>z(th,`$remoteSimulating`,E),x=()=>z(Di,`$selectedObject`,E),S=()=>z(Kr,`$selectedObjects`,E),C=()=>z(W_,`$vrSettingsVersion`,E),w=()=>z(H_,`$vrHovered`,E),T=()=>z(Due,`$vrChatUnread`,E),[E,D]=Ve(),O=F(),k=F(),A=F(),{renderer:ee,camera:j}=Ww(),M=F();function te(e,...t){let n=sfe(e),r=n.length,i=2*((Iv+Lv)/2)*Math.sin(Math.PI/Math.max(r,2))*.88;return n.map((e,t)=>{let n=lfe(e),a=r>8?.0078:.0088,o=Math.min(i,.07),s=(n.length+(e.ring?2:0))*.55*a>o,c=e.value?e.value():``,l=pfe(t,r),u=s?.005:0;return{entry:e,label:n,icon:nfe(e),value:c,nav:!!e.ring,maxWidth:o,fontSize:a,iconY:l.labelY+(c?.016:.012)+u,textY:l.labelY+(c?.006:.002)+u,valueY:l.labelY-.012-(s?.007:0),...l}})}let ne=F(``),P=null,re=efe.subscribe(e=>{e?.id&&(I(ne,e.id),clearTimeout(P),P=setTimeout(()=>I(ne,``),180))});Pe(()=>{re(),clearTimeout(P)});function ie(e){return t=>{t&&(t.userData.tour=afe(e))}}function ae(e,t,n){return e.disabled?.()?`#1b1f26`:n===e.id?`#ffd2bf`:t===e.id?`#ff4000`:e.color?e.color:e.active?.()?`#2f81f7`:`#2a2f38`}function L(e,t){return e.disabled?.()?`#6b7280`:t===e.id?`#ffffff`:`#e8ecf2`}let oe=new hn,se=new zt,ce=F(0);Kw(()=>{if(!Q(M)||!n()||!ee.xr.isPresenting||!ee.xr.getSession())return;let e=$_(p());if(e<0)return;let t=ee.xr.getController(e);t.getWorldPosition(oe),t.getWorldQuaternion(se);let r=Fv(Dn,oe,se);Q(ce)||I(ce,performance.now());let i=Math.min(1,(performance.now()-Q(ce))/120),a=.05+.95*(1-(1-i)*(1-i));ob(Q(M),`menu`,r,a)}),d(()=>(n(),Q(M)),()=>{Qle.set(n()?Q(M):null)}),d(()=>(r(),i(),a(),o(),c(),l(),u(),f(),p(),m(),_(),v(),y(),b(),x(),S(),C()),()=>{I(O,te(r(),i(),a(),o(),c(),l(),u(),f(),p(),m(),_(),v(),y(),b(),x(),S(),C()))}),d(()=>r(),()=>{I(k,ofe(r()))}),d(()=>(r(),x()),()=>{I(A,ife(r(),!!x()?.uuid))}),d(()=>n(),()=>{n()||I(ce,0)}),h(),R();var le=fe(),de=N(le),pe=e=>{Uw.Group(e,{name:`vr-quick-menu`,get ref(){return Q(M)},set ref(e){I(M,e)},children:(e,t)=>{var n=kTe(),r=N(n);Uw.Mesh(r,{position:[0,0,-.004],children:(e,t)=>{var n=NF(),r=N(n);{let e=ze(()=>[Lv+.012,64]);Uw.CircleGeometry(r,{get args(){return Q(e)}})}var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#11151c`,transparent:!0,opacity:.86,get side(){return s(Dn),K(()=>2)}}),X(e,n)},$$slots:{default:!0}});var i=g(r,2),a=e=>{{let t=ze(()=>[0,Lv+.016,.003]);tD(e,{get text(){return Q(k)},color:`#c9d1dc`,outlineColor:`#000000`,outlineWidth:8e-4,fontSize:.0085,anchorX:`center`,anchorY:`bottom`,get position(){return Q(t)}})}};G(i,e=>{Q(k)&&e(a)});var o=g(i,2);B(o,1,()=>Q(O),e=>e.entry.id,(e,t)=>{var n=OTe(),r=N(n);{let e=ze(()=>(Q(t),K(()=>`vrmenu-${Q(t).entry.id}`))),n=ze(()=>(w(),Q(t),K(()=>[0,0,w()===Q(t).entry.id?.002:0]))),i=ze(()=>(Q(t),K(()=>ie(Q(t).entry.id))));Uw.Mesh(r,{get name(){return Q(e)},get position(){return Q(n)},get oncreate(){return Q(i)},children:(e,n)=>{var r=NF(),i=N(r);{let e=ze(()=>(s(Iv),s(Lv),Q(t),K(()=>[Iv,Lv,24,1,Q(t).thetaStart,Q(t).thetaLength])));Uw.RingGeometry(i,{get args(){return Q(e)}})}var a=g(i,2);{let e=ze(()=>(Q(t),w(),Q(ne),K(()=>ae(Q(t).entry,w(),Q(ne)))));Uw.MeshBasicMaterial(a,{get color(){return Q(e)},transparent:!0,opacity:.94,get side(){return s(Dn),K(()=>2)}})}X(e,r)},$$slots:{default:!0}})}var i=g(r,2),a=e=>{{let n=ze(()=>(Q(t),K(()=>`vricon-${Q(t).entry.id}`))),r=ze(()=>(Q(t),K(()=>[Q(t).labelX,Q(t).iconY,.0035])));Uw.Mesh(e,{get name(){return Q(n)},get position(){return Q(r)}
1199,children:(e,n)=>{var r=NF(),i=N(r);Uw.PlaneGeometry(i,{args:[.014,.014]});var a=g(i,2);{let e=ze(()=>(s(MF),Q(t),K(()=>MF(Q(t).icon)))),n=ze(()=>(Q(t),w(),K(()=>L(Q(t).entry,w()))));Uw.MeshBasicMaterial(a,{get map(){return Q(e)},get color(){return Q(n)},transparent:!0,depthWrite:!1,get side(){return s(Dn),K(()=>2)}})}X(e,r)},$$slots:{default:!0}})}},o=q(()=>(Q(t),s(MF),K(()=>Q(t).icon&&MF(Q(t).icon))));G(i,e=>{Q(o)&&e(a)});var c=g(i,2),l=e=>{{let n=ze(()=>(Q(t),K(()=>Q(t).nav?Q(t).label+` âº`:Q(t).label))),r=ze(()=>(Q(t),w(),K(()=>L(Q(t).entry,w())))),i=ze(()=>(Q(t),K(()=>Q(t).icon?`top`:`middle`))),a=ze(()=>(Q(t),K(()=>[Q(t).labelX,Q(t).icon?Q(t).textY:Q(t).labelY,.003])));tD(e,{get text(){return Q(n)},get color(){return Q(r)},outlineColor:`#000000`,outlineWidth:9e-4,get fontSize(){return Q(t),K(()=>Q(t).fontSize)},get maxWidth(){return Q(t),K(()=>Q(t).maxWidth)},textAlign:`center`,lineHeight:1.05,anchorX:`center`,get anchorY(){return Q(i)},get position(){return Q(a)}})}};G(c,e=>{Q(t),K(()=>Q(t).label)&&e(l)});var u=g(c,2),d=e=>{{let n=ze(()=>(w(),Q(t),K(()=>w()===Q(t).entry.id||Q(t).entry.active?.()?`#ffffff`:`#b4c4d6`))),r=ze(()=>(Q(t),K(()=>[Q(t).labelX,Q(t).valueY,.003])));tD(e,{get text(){return Q(t),K(()=>Q(t).value)},get color(){return Q(n)},fontSize:.0072,get maxWidth(){return Q(t),K(()=>Q(t).maxWidth)},textAlign:`center`,anchorX:`center`,anchorY:`top`,get position(){return Q(r)}})}};G(u,e=>{Q(t),K(()=>Q(t).value)&&e(d)});var f=g(u,2),p=e=>{var n=NF(),r=N(n);{let e=ze(()=>(Q(t),K(()=>[Q(t).labelX+.016,Q(t).labelY+.02,.004])));Uw.Mesh(r,{name:`vrmenu-chat-badge`,get position(){return Q(e)},children:(e,t)=>{var n=NF(),r=N(n);Uw.CircleGeometry(r,{args:[.008,20]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#e5484d`,get side(){return s(Dn),K(()=>2)}}),X(e,n)},$$slots:{default:!0}})}var i=g(r,2);{let e=ze(()=>(T(),K(()=>T()>9?`9+`:String(T())))),n=ze(()=>(Q(t),K(()=>[Q(t).labelX+.016,Q(t).labelY+.02,.005])));tD(i,{get text(){return Q(e)},color:`#ffffff`,fontSize:.008,anchorX:`center`,anchorY:`middle`,get position(){return Q(n)}})}X(e,n)};G(f,e=>{Q(t),T(),K(()=>Q(t).entry.id===`chat`&&T()>0)&&e(p)}),X(e,n)});var c=g(o,2);{let e=ze(()=>(Q(A),K(()=>`vrmenu-${Q(A).id}`))),t=ze(()=>(w(),Q(A),K(()=>[0,0,w()===Q(A).id?.002:0])));Uw.Mesh(c,{get name(){return Q(e)},get position(){return Q(t)},oncreate:e=>e&&(e.userData.tour=`radial:hub`),children:(e,t)=>{var n=NF(),r=N(n);{let e=ze(()=>[dfe,40]);Uw.CircleGeometry(r,{get args(){return Q(e)}})}var i=g(r,2);{let e=ze(()=>(Q(ne),Q(A),w(),K(()=>Q(ne)===Q(A).id?`#ffd2bf`:w()===Q(A).id?`#ff4000`:`#39404d`)));Uw.MeshBasicMaterial(i,{get color(){return Q(e)},transparent:!0,opacity:.96,get side(){return s(Dn),K(()=>2)}})}X(e,n)},$$slots:{default:!0}})}var l=g(c,2),u=e=>{Uw.Mesh(e,{name:`vricon-hub`,position:[0,.006,.0035],children:(e,t)=>{var n=NF(),r=N(n);Uw.PlaneGeometry(r,{args:[.013,.013]});var i=g(r,2);{let e=ze(()=>(s(MF),Q(A),K(()=>MF(Q(A).icon))));Uw.MeshBasicMaterial(i,{get map(){return Q(e)},color:`#ffffff`,transparent:!0,depthWrite:!1,get side(){return s(Dn),K(()=>2)}})}X(e,n)},$$slots:{default:!0}})},d=q(()=>(s(MF),Q(A),K(()=>MF(Q(A).icon))));G(l,e=>{Q(d)&&e(u)}),tD(g(l,2),{get text(){return Q(A),K(()=>Q(A).label)},color:`#ffffff`,outlineColor:`#000000`,outlineWidth:7e-4,fontSize:.0062,anchorX:`center`,anchorY:`middle`,position:[0,-.009,.003]}),X(e,n)},$$slots:{default:!0},$$legacy:!0})};G(de,e=>{n()&&e(pe)}),X(e,le),ue(),D()}var PF=V(`<!> <!>`,1);function jTe(e,n){Ce(n,!0);let r=()=>z(Li,`$vrStatsOpen`,c),i=()=>z(Ui,`$objectsGroup`,c),a=()=>z(as,`$userdata`,c),o=()=>z(Xv,`$peerQuality`,c),s=()=>z(ui,`$vrMenuHand`,c),[c,l]=Ve(),{renderer:u}=Ww(),d=t(null),f=t(``),p=q(()=>Math.max(.06,Q(f).split(` 1200`).length*.0125+.012));Qe(()=>{nue.set(r()?Q(d):null)});let m=0,h=typeof performance<`u`?performance.now():0,_=0,v=new hn,y=new zt,b=new hn(0,.045,-.015),x=new zt().setFromAxisAngle(new hn(1,0,0),-Math.PI*.3);Kw(()=>{if(!r()||!Q(d))return;m++;let e=performance.now();if(_+=e-h,h=e,_>=250){let e=Math.round(m/_*1e3),t=(_/m).toFixed(1),n=u.info.render,r=i()?.children.length??0,s=0;i()?.traverse(e=>{e.isMesh&&s++});let c=(a()??[]).slice(1).map(e=>
1200{let t=o()[e[0]],n=String(e[1]||hh(e[0])||`peer`).slice(0,10);return!t||t.rtt==null?` ${n} â¦`:` ${n} ${Math.round(t.rtt)}ms${t.relayed?` â`:``}`});I(f,`FPS ${e} · ${t} ms\ndraw ${n.calls} · tris ${n.triangles}\nobjects ${r} (${s} meshes)\npeers ${Math.max(0,(a()?.length??1)-1)}`+(c.length?` 1201`+c.join(` 1202`):``)),m=0,_=0}let t=u.xr.getSession();if(Q(d).visible=!!t,!t)return;let n=$_(rfe(s()));if(n<0)return;let c=u.xr.getController(n);c.getWorldPosition(v),c.getWorldQuaternion(y),ob(Q(d),`stats`,{position:b.clone().applyQuaternion(y).add(v),quaternion:y.clone().multiply(x)})});var S=fe(),C=N(S),w=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-stats-card`,get ref(){return Q(d)},set ref(e){I(d,e,!0)},children:(e,t)=>{var n=PF(),r=N(n);P(r,()=>Uw.Mesh,(e,t)=>{t(e,{children:(e,t)=>{var n=PF(),r=N(n);{let e=q(()=>[.115,Q(p)]);P(r,()=>Uw.PlaneGeometry,(t,n)=>{n(t,{get args(){return Q(e)}})})}var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#11151c`,transparent:!0,opacity:.88,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})}),tD(g(r,2),{get text(){return Q(f)},color:`#9fe8a9`,outlineColor:`#000000`,outlineWidth:6e-4,fontSize:.0075,lineHeight:1.45,anchorX:`center`,anchorY:`middle`,position:[0,0,.002]}),X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(C,e=>{r()&&e(w)}),X(e,S),ue(),l()}var FF=V(`<!> <!>`,1),MTe=V(`<!> <!> <!> <!>`,1),NTe=V(`<!> <!> <!> <!> <!> <!>`,1);function PTe(e,t){Ce(t,!1);let n=()=>z(Zr,`$vrObjectsPanelOpen`,f),r=()=>z(Ui,`$objectsGroup`,f),i=()=>z(Kle,`$vrPanelExpanded`,f),a=()=>z(z_,`$vrPanelCursor`,f),o=()=>z(Ci,`$lockedObjects`,f),c=()=>z(ui,`$vrMenuHand`,f),l=()=>z(H_,`$vrHovered`,f),u=()=>z(Di,`$selectedObject`,f),[f,p]=Ve(),m=F(),_=F(),v=F(),y=F(),b=F(),x=F(),S=F(),C=F(),w=F(),{renderer:T}=Ww(),E=.03,D=.26,O=.016,k=F(null),A={Mesh:`â£`,Group:`â§`,Line:`â`};function ee(e){return e.type?.endsWith(`Light`)?`â`:A[e.type]??`âª`}function j(e){return[{act:`focus`,glyph:`â`,base:`#39404d`},{act:`visible`,glyph:e.visible===!1?`â`:`â`,base:`#39404d`},{act:`rename`,glyph:`â`,base:`#39404d`},{act:`props`,glyph:`â`,base:`#39404d`},{act:`delete`,glyph:`â`,base:`#5a2a2a`}]}let M=new hn,te=new zt,ne=new hn(0,.16,0);Kw(()=>{if(!Q(k)||!n()||!T.xr.isPresenting||!T.xr.getSession())return;let e=$_(c());if(e<0)return;let t=T.xr.getController(e);t.getWorldPosition(M),t.getWorldQuaternion(te);let r=Fv(Dn,M,te);r.position.add(ne.clone().applyQuaternion(te)),ob(Q(k),`objects`,r)}),d(()=>(n(),Q(k)),()=>{cue.set(n()?Q(k):null)}),d(()=>(n(),z_),()=>{n()||z_.set(0)}),d(()=>r(),()=>{I(m,r()?.children??[])}),d(()=>(n(),Q(m),i()),()=>{I(_,n()?kue(Q(m),i()):[])}),d(()=>Q(_),()=>{I(v,Math.max(0,Q(_).length-8))}),d(()=>(a(),Q(_)),()=>{I(y,Math.min(Math.max(0,a()),Math.max(0,Q(_).length-1)))}),d(()=>(a(),Q(y),z_),()=>{a()!==Q(y)&&z_.set(Q(y))}),d(()=>(Q(y),Q(v)),()=>{I(b,Math.min(Math.max(0,Q(y)-8+1),Q(v)))}),d(()=>(Q(_),Q(b),i(),o()),()=>{I(x,Q(_).slice(Q(b),Q(b)+8).map((e,t)=>({child:e.object,uuid:e.uuid,depth:e.depth,isGroup:e.isGroup,expanded:i().has(e.uuid),index:Q(b)+t,y:(4-t-.5)*E,lock:o().find(t=>t[1]===e.uuid)?.[0]??null})))}),d(()=>{},()=>{I(S,.29)}),d(()=>(n(),Q(_),Q(y)),()=>{uue.set(n()&&Q(_)[Q(y)]?`panel:select:`+Q(_)[Q(y)].uuid:null)}),d(()=>(Q(_),Q(S)),()=>{I(C,Q(_).length?Math.max(Q(S)*(8/Q(_).length),.02):Q(S))}),d(()=>(Q(_),Q(S),Q(b)),()=>{I(w,Q(_).length?Q(S)/2-(Q(b)+4)/Q(_).length*Q(S):0)}),h(),R();var P=fe(),re=N(P),ie=e=>{Uw.Group(e,{name:`vr-objects-panel`,get ref(){return Q(k)},set ref(e){I(k,e)},children:(e,t)=>{var n=NTe(),r=N(n);Uw.Mesh(r,{position:[0,0,-.004],children:(e,t)=>{var n=FF(),r=N(n);{let e=ze(()=>[.28,Q(S)+.045]);Uw.PlaneGeometry(r,{get args(){return Q(e)}})}var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#11151c`,transparent:!0,opacity:.88,get side(){return s(Dn),K(()=>2)}}),X(e,n)},$$slots:{default:!0}});var i=g(r,2);{let e=ze(()=>(Q(m),Q(v),Q(b),Q(_),K(()=>`Objects (${Q(m).length})${Q(v)?` · stick â ${Q(b)+1}-${Math.min(Q(_).length,Q(b)+8)}`:``}`))),t=ze(()=>[0,Q(S)/2+.002,.002]);tD(i,{get text(){return Q(e)},color:`#ffffff`,fontSize:.011,anchorX:`center`,anchorY:`middle`,get position(){return Q(t)}})}var a=g(i,2);B(a,1,()=>Q(x),e=>e.uuid,(e,t)=>{var n=MTe(),r=N(n);{let e=ze(()=>(Q(t),K(()=>`vrpanel-select:${Q(t).uuid}`))),n=ze(()=>(Q(t),K(()=>[0,Q(t).y,0])));Uw.Mesh(r,{get name(){return Q(e)},get position(){return Q(n)},children:(e,n)=>{var r=FF(),i=N(r);Uw.PlaneGeometry(i,{args:[D,.026]});var a=g(i,2);{let e=ze(()=>(l(),Q(t),Q(y),u(),K(()=>l()===`panel:select:${Q(t).uuid}`?`#ff4000`:Q(t).index===Q(y)?`#5a3a12`:u()?.uuid===Q(t).uuid?`#2f81f7`:`#242a34`)));Uw.MeshBasicMaterial(a,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return s(Dn),K(()=>2)}})}X(e,r)},$$slots:{default:!0}})}var i=g(r,2),a=e=>{var n=FF(),r=N(n);{let e=ze(()=>(Q(t),K(()=>`vrpanel-expand:${Q(t).uuid}`))),n=ze(()=>(Q(t),K(()=>[-.116+Q(t).depth*O,Q(t).y,.001])));Uw.Mesh(r,{get name(){return Q(e)},get position(){return Q(n)},children:(e,n)=>{var r=FF(),i=N(r);Uw.CircleGeometry(i,{args:[.008,4]});var a=g(i,2);{let e=ze(()=>(l(),Q(t),K(()=>l()===`panel:expand:${Q(t).uuid}`?`#ff4000`:`#39404d`)));Uw.MeshBasicMaterial(a,{get color(){return Q(e)},get side(){return s(Dn),K(()=>2)}})}X(e,r)},$$slots:{default:!0}})}var i=g(r,2);{let e=ze(()=>(Q(t),K(()=>Q(t).expanded?`â¾`:`â¸`))),n=ze(()=>(Q(t),K(()=>[-.116+Q(t).depth*O,Q(t).y,.003])));tD(i,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.0095,anchorX:`center`,anchorY:`middle`,get position(){return Q(n)}})}X(e,n)};G(i,e=>{Q(t),K(()=>Q(t).isGroup)&&e(a)});var o=g(i,2);{let e=ze(()=>(Q(t),K(()=>`${ee(Q(t).child)} ${Q(t).child.name||Q(t).child.type}`))),n=ze(()=>(Q(t),K(()=>Q(t).lock?`#ffb3b3`:`#e8ecf2`))),r=ze(()=>(Q(t),K(()=>[-.26/2+.028+Q(t).depth*O,Q(t).y,.002]))),i=ze(()=>(Q(t),Q(y),K(()=>(Q(t).index===Q(y)?.11000000000000001:.195)-Q(t).depth*O))),a=ze(()=>(Q(t),Q(y),K(()=>[-.01,-.03,(Q(t).index===Q(y)?.11000000000000001:.195)-Q(t).depth*O,E])));tD(o,{get text(){return Q(e)},get color(){return Q(n)},fontSize:.0105,anchorX:`left`,anchorY:`middle`,get position(){return Q(r)}
1202,get maxWidth(){return Q(i)},get clipRect(){return Q(a)}})}var c=g(o,2),d=e=>{{let n=ze(()=>(Q(t),K(()=>[D/2-.016,Q(t).y,.002])));Uw.Mesh(e,{get position(){return Q(n)},children:(e,n)=>{var r=FF(),i=N(r);Uw.CircleGeometry(i,{args:[.006,16]});var a=g(i,2);{let e=ze(()=>(s(gh),Q(t),K(()=>gh(Q(t).lock))));Uw.MeshBasicMaterial(a,{get color(){return Q(e)}})}X(e,r)},$$slots:{default:!0}})}},f=e=>{var n=fe(),r=N(n);B(r,3,()=>(Q(t),K(()=>j(Q(t).child))),e=>e.act,(e,n,r)=>{var i=FF(),a=N(i);{let e=ze(()=>(Q(n),Q(t),K(()=>`vrpanel-${Q(n).act}:${Q(t).child.uuid}`))),i=ze(()=>(s(Q(r)),Q(t),K(()=>[D/2-.09+Q(r)*.02,Q(t).y,.001])));Uw.Mesh(a,{get name(){return Q(e)},get position(){return Q(i)},children:(e,r)=>{var i=FF(),a=N(i);Uw.CircleGeometry(a,{args:[.008,18]});var o=g(a,2);{let e=ze(()=>(l(),Q(n),Q(t),K(()=>l()===`panel:${Q(n).act}:${Q(t).child.uuid}`?`#ff4000`:Q(n).base)));Uw.MeshBasicMaterial(o,{get color(){return Q(e)},get side(){return s(Dn),K(()=>2)}})}X(e,i)},$$slots:{default:!0}})}var o=g(a,2);{let e=ze(()=>(Q(n),K(()=>Q(n).act===`delete`?`#e8a0a0`:`#e8ecf2`))),i=ze(()=>(s(Q(r)),Q(t),K(()=>[D/2-.09+Q(r)*.02,Q(t).y,.003])));tD(o,{get text(){return Q(n),K(()=>Q(n).glyph)},get color(){return Q(e)},fontSize:.009,anchorX:`center`,anchorY:`middle`,get position(){return Q(i)}})}X(e,i)}),X(e,n)};G(c,e=>{Q(t),K(()=>Q(t).lock)?e(d):(Q(t),Q(y),K(()=>Q(t).index===Q(y))&&e(f,1))}),X(e,n)});var o=g(a,2),c=e=>{var t=FF(),n=N(t);Uw.Mesh(n,{position:[.136,0,.001],children:(e,t)=>{var n=FF(),r=N(n);{let e=ze(()=>[.004,Q(S)]);Uw.PlaneGeometry(r,{get args(){return Q(e)}})}var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#2a2f38`,transparent:!0,opacity:.7,get side(){return s(Dn),K(()=>2)}}),X(e,n)},$$slots:{default:!0}});var r=g(n,2);{let e=ze(()=>[.136,Q(w),.002]);Uw.Mesh(r,{get position(){return Q(e)},children:(e,t)=>{var n=FF(),r=N(n);{let e=ze(()=>[.004,Q(C)]);Uw.PlaneGeometry(r,{get args(){return Q(e)}})}var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#6b7482`,get side(){return s(Dn),K(()=>2)}}),X(e,n)},$$slots:{default:!0}})}X(e,t)};G(o,e=>{Q(v)>0&&e(c)});var d=g(o,2);{let e=ze(()=>[0,-Q(S)/2-.018,0]);Uw.Mesh(d,{name:`vrpanel-close`,get position(){return Q(e)},children:(e,t)=>{var n=FF(),r=N(n);Uw.CircleGeometry(r,{args:[.014,24]});var i=g(r,2);{let e=ze(()=>l()===`panel:close`?`#ff4000`:`#39404d`);Uw.MeshBasicMaterial(i,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return s(Dn),K(()=>2)}})}X(e,n)},$$slots:{default:!0}})}var f=g(d,2);{let e=ze(()=>[0,-Q(S)/2-.018,.002]);tD(f,{text:`â`,color:`#ffffff`,fontSize:.011,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}X(e,n)},$$slots:{default:!0},$$legacy:!0})};G(re,e=>{n()&&e(ie)}),X(e,P),ue(),p()}var IF=V(`<!> <!>`,1),FTe=V(`<!> <!> <!> <!> <!> <!> <!> <!>`,1);function ITe(e,n){Ce(n,!0);let r=()=>z(Ii,`$vrPaletteOpen`,s),i=()=>z(ui,`$vrMenuHand`,s),a=()=>z(Di,`$selectedObject`,s),o=()=>z(Jue,`$vrPaletteLightness`,s),[s,c]=Ve(),{renderer:l}=Ww(),u=.085,d=t(null),f=t(null);Qe(()=>{iue.set(r()?Q(d):null)}),Qe(()=>{r()&&!Q(f)&&I(f,mfe(256),!0)});let p=new hn,m=new zt,h=new hn(0,.16,0),_=t(`#ffffff`);Kw(()=>{if(!Q(d)||!r()||!l.xr.isPresenting||!l.xr.getSession())return;let e=$_(i());if(e<0)return;let t=l.xr.getController(e);t.getWorldPosition(p),t.getWorldQuaternion(m);let n=Fv(Dn,p,m);n.position.add(h.clone().applyQuaternion(m)),ob(Q(d),`palette`,n);let o=a()?.material;o?.color&&I(_,`#`+o.color.getHexString())});
1202var v=fe(),y=N(v),b=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-color-palette`,get ref(){return Q(d)},set ref(e){I(d,e,!0)},children:(e,t)=>{var n=FTe(),r=N(n);P(r,()=>Uw.Mesh,(e,t)=>{t(e,{position:[0,-.012,-.004],children:(e,t)=>{var n=IF(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.2,.255]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#11151c`,transparent:!0,opacity:.88,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var i=g(r,2);P(i,()=>Uw.Mesh,(e,t)=>{t(e,{name:`vrpalette-disc`,children:(e,t)=>{var n=IF(),r=N(n);P(r,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[u,48]})});var i=g(r,2),a=e=>{var t=fe(),n=N(t);P(n,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{get map(){return Q(f)},get side(){return 2}})}),X(e,t)};G(i,e=>{Q(f)&&e(a)}),X(e,n)},$$slots:{default:!0}})});var a=g(i,2);P(a,()=>Uw.Mesh,(e,t)=>{t(e,{name:`vrpalette-bar`,position:[0,-.085-.02,0],children:(e,t)=>{var n=IF(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[u*2,.016]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#888888`,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var s=g(a,2);{let e=q(()=>[-.085+o()*u*2,-.085-.02,.002]);P(s,()=>Uw.Mesh,(t,n)=>{n(t,{get position(){return Q(e)},children:(e,t)=>{var n=IF(),r=N(n);P(r,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.006,16]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#ffffff`})}),X(e,n)},$$slots:{default:!0}})})}var c=g(s,2);P(c,()=>Uw.Mesh,(e,t)=>{t(e,{position:[-.085+.012,.099,0],children:(e,t)=>{var n=IF(),r=N(n);P(r,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.011,20]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{get color(){return Q(_)},get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var l=g(c,2);P(l,()=>Uw.Mesh,(e,t)=>{t(e,{name:`vrpalette-close`,position:[.07300000000000001,.099,0],children:(e,t)=>{var n=IF(),r=N(n);P(r,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.011,20]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#39404d`,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var d=g(l,2);tD(d,{text:`â`,color:`#ffffff`,fontSize:.009,anchorX:`center`,anchorY:`middle`,position:[.07300000000000001,.099,.002]}),tD(g(d,2),{text:`hold trigger to paint`,color:`#9aa4b2`,fontSize:.0065,anchorX:`center`,anchorY:`middle`,position:[0,-.127,.002]}),X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(y,e=>{r()&&e(b)}),X(e,v),ue(),c()}var LF=[`water:preset`,`water:level`,`water:waves`,`water:clarity`,`water:refraction`,`water:foam`,`water:caustics`,`water:bubbles`,`water:remove`],RF=`water:make`;function zF(e){return e?.userData?.water?LF:[RF]}var LTe={"water:preset":`Water`,"water:level":`Level`,"water:waves":`Waves`,"water:clarity":`Clarity`,"water:refraction":`Refraction`,"water:foam":`Foam`,"water:caustics":`Caustics`,"water:bubbles":`Bubbles`,"water:remove":`Remove water`,"water:make":`Make it water`};function BF(e){return LTe[e]??e}function VF(e){return e===`water:remove`||e===`water:make`}function HF(e,t){let n=e?.userData?.water;if(!n)return``;let r=Hu(n),i=Uu(r);switch(t){case`water:preset`:return Wu.find(e=>e.key===r.preset)?.name??(r.preset?.startsWith(`user:`)?r.preset.slice(5):`custom`);case`water:level`:return r.level==null?`top`:r.level.toFixed(2);case`water:waves`:return Vu(r.waves).amplitude.toFixed(2)+` m`;case`water:clarity`:return Number(i.clarity).toFixed(1)+` m`;case`water:refraction`:return Number(i.refraction).toFixed(2);case`water:foam`:return Number(i.foam).toFixed(2);case`water:caustics`:return Number(i.caustics).toFixed(2);case`water:bubbles`:return Gu(r.bubbles).enabled?`on`:`off`}return``}var UF=(e,t,n)=>Math.max(t,Math.min(n,e));function RTe(e,t,n){let r=e?.uuid;if(!r)return!1;if(t===`water:make`)return!!xhe(e,`pool`);let i=e.userData.water;if(!i)return!1;let a=Hu(i),o=Uu(a),s=n<0?-1:1;switch(t){case`water:preset`:{let e=Math.max(0,Wu.findIndex(e=>e.key===a.preset)),t=Wu[(e+s+Wu.length)%Wu.length];return bx(r,t.key)}case`water:level`:{let e=a.level??.5;return Sx(r,{level:Math.round((e+s*.05)*100)/100},{immediate:!0})}case`water:waves`:{let e=Vu(a.waves).amplitude,t=UF(Math.round((e+s*(e<.1?.01:.05))*1e3)/1e3,0,2),n=Vu(a.waves).count||3;return Sx(r,{waves:{amplitude:t,count:n}},{immediate:!0})}case`water:clarity`:return Sx(r,{look:{clarity:UF(Number(o.clarity)*(s>0?1.25:.8),.05,40)}},{immediate:!0});case`water:refraction`:return Sx(r,{look:{refraction:UF(Number(o.refraction)+s*.1,0,1.5)}},{immediate:!0});case`water:foam`:return Sx(r,{look:{foam:UF(Number(o.foam)+s*.1,0,1)}},{immediate:!0});case`water:caustics`:return Sx(r,{look:{caustics:UF(Number(o.caustics)+s*.1,0,2)}},{immediate:!0});case`water:bubbles`:return Sx(r,{bubbles:{enabled:!Gu(a.bubbles).enabled}},{immediate:!0});case`water:remove`:return xx(r)}return!1}var WF=V(`<!> <!>`,1),GF=V(`<!> <!> <!> <!> <!> <!>`,1);function zTe(e,n){Ce(n,!0);let r=()=>z(pi,`$vrPropsPanelOpen`,l),i=()=>z(G_,`$vrPropsRows`,l),a=()=>z(Di,`$selectedObject`,l),o=()=>z(ev,`$vrPropsCursor`,l),s=()=>z(ui,`$vrMenuHand`,l),c=()=>z(H_,`$vrHovered`,l),[l,u]=Ve(),{renderer:d}=Ww(),f=.24,p=.022,m=t(null),h=t(Ne({})),_=t(`Properties`),v=t(!0),y=t(`#ffffff`),b=0;Qe(()=>{Yle.set(r()?Q(m):null)}),Qe(()=>{r()||ev.set(0)});let x=X_.filter(e=>e.includes(`:`)&&e!==`opacity`),S=[`opacity`,`lod`],C={pos:`Pos`,rot:`Rot`,scale:`Scale`};function w(e){if(e===`opacity`)return`Opacity`;if(e===`lod`)return`LOD`;let[t,n]=e.split(`:`);return`${C[t]} ${n.toUpperCase()}`}function T(e){return Q(D)/2-p*1.6-e*p}let E=q(i),D=q(()=>(Q(E).length+2.2)*p);function O(e){return e?.uuid?[...X_,...zF(e)]:[...X_]}function k(e){let t={};for(let n of x){let[r,i]=n.split(`:`);t[n]=r===`pos`?e.position[i].toFixed(2):r===`rot`?(e.rotation[i]*180/Math.PI).toFixed(0)+`°`:e.scale[i].toFixed(2)}t.opacity=(e.material?.opacity??1).toFixed(1),t.lod=Bue(e.uuid);
1202for(let n of zF(e))t[n]=HF(e,n);return t}let A=new hn,ee=new zt,j=new hn(0,.2,0);Kw(()=>{if(!Q(m)||!r())return;let e=performance.now();if(e-b>150){b=e;let t=a();if(t?.uuid){I(_,t.name||t.type||`Properties`,!0),I(h,k(t),!0);let e=O(t);e.join()!==i().join()&&(G_.set(e),o()>=e.length&&ev.set(e.length-1)),I(v,t.visible!==!1),t.material?.color&&I(y,`#`+t.material.color.getHexString())}else I(_,`No selection`)}if(!d.xr.isPresenting||!d.xr.getSession())return;let t=$_(s());if(t<0)return;let n=d.xr.getController(t);n.getWorldPosition(A),n.getWorldQuaternion(ee);let c=Fv(Dn,A,ee);c.position.add(j.clone().applyQuaternion(ee)),ob(Q(m),`props`,c)});function M(e){return c()===`props:`+e?`#ff4000`:`#39404d`}function te(e){return o()===e?`#5a3a12`:`#1d232d`}var ne=fe(),re=N(ne),ie=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-props-panel`,get ref(){return Q(m)},set ref(e){I(m,e,!0)},children:(e,t)=>{var n=GF(),r=N(n);P(r,()=>Uw.Mesh,(e,t)=>{t(e,{position:[0,0,-.004],children:(e,t)=>{var n=WF(),r=N(n);{let e=q(()=>[.26,Q(D)+.02]);P(r,()=>Uw.PlaneGeometry,(t,n)=>{n(t,{get args(){return Q(e)}})})}var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#11151c`,transparent:!0,opacity:.9,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var i=g(r,2);{let e=q(()=>Q(_).length>22?Q(_).slice(0,21)+`â¦`:Q(_)),t=q(()=>[-.24/2+.008,Q(D)/2-p*.7,.002]);tD(i,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.011,anchorX:`left`,anchorY:`middle`,get position(){return Q(t)}})}var a=g(i,2);{let e=q(()=>[f/2-.012,Q(D)/2-p*.7,0]);P(a,()=>Uw.Mesh,(t,n)=>{n(t,{name:`vrprops-close`,get position(){return Q(e)},children:(e,t)=>{var n=WF(),r=N(n);P(r,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.009,20]})});var i=g(r,2);{let e=q(()=>M(`close`));P(i,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})})}var o=g(a,2);{let e=q(()=>[f/2-.012,Q(D)/2-p*.7,.002]);tD(o,{text:`â`,color:`#ffffff`,fontSize:.008,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}var s=g(o,2);B(s,18,()=>Q(E),e=>e,(e,t,n)=>{var r=WF(),i=N(r);{let e=q(()=>t===`color`?`vrprops-color`:t===`visible`?`vrprops-visible`:t===`duplicate`?`vrprops-duplicate`:t===`delete`?`vrprops-delete`:void 0),r=q(()=>[0,T(Q(n)),-.001]);P(i,()=>Uw.Mesh,(i,a)=>{a(i,{get name(){return Q(e)},get position(){return Q(r)},children:(e,r)=>{var i=WF(),a=N(i);P(a,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[f,.019]})});var o=g(a,2);{let e=q(()=>[`color`,`visible`,`duplicate`,`delete`].includes(t)&&c()===`props:`+t?`#5a2a12`:te(Q(n)));P(o,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.92,get side(){return 2}})})}X(e,i)},$$slots:{default:!0}})})}var a=g(i,2),o=e=>{var t=WF(),r=N(t);{let e=q(()=>[-.24/2+.008,T(Q(n)),.002]);tD(r,{text:`Color`,color:`#c8d0da`,fontSize:.009,anchorX:`left`,anchorY:`middle`,get position(){return Q(e)}})}var i=g(r,2);{let e=q(()=>[f/2-.02,T(Q(n)),.001]);P(i,()=>Uw.Mesh,(t,n)=>{n(t,{get position(){return Q(e)},children:(e,t)=>{var n=WF(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.024,.013]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{get color(){return Q(y)},get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})})}X(e,t)},s=e=>{var t=WF(),r=N(t);{let e=q(()=>[-.24/2+.008,T(Q(n)),.002]);tD(r,{text:`Visible`,color:`#c8d0da`,fontSize:.009,anchorX:`left`,anchorY:`middle`,get position(){return Q(e)}})}var i=g(r,2);{let e=q(()=>Q(v)?`â`:`â`),t=q(()=>Q(v)?`#9fe8a9`:`#e8a0a0`),r=q(()=>[f/2-.02,T(Q(n)),.002]);tD(i,{get text(){return Q(e)},get color(){return Q(t)},fontSize:.01,anchorX:`center`,anchorY:`middle`,get position(){return Q(r)}})}X(e,t)},l=e=>{var r=WF(),i=N(r);{let e=q(()=>`vrprops-${t}:1`),r=q(()=>[0,T(Q(n)),5e-4]);P(i,()=>Uw.Mesh,(i,a)=>{a(i,{get name(){return Q(e)},get position(){return Q(r)},children:(e,r)=>{var i=WF(),a=N(i);P(a,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.22999999999999998,.016]})});var o=g(a,2);{let e=q(()=>c()===`props:${t}:1`?`#5a2a12`:te(Q(n)));P(o,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.92,get side(){return 2}})})}X(e,i)},$$slots:{default:!0}})})}var a=g(i,2);{let e=q(()=>BF(t)),r=q(()=>t===`water:remove`?`#e8a0a0`:`#9fd8ff`),i=q(()=>[-.24/2+.008,T(Q(n)),.002]);tD(a,{get text(){return Q(e)},get color(){return Q(r)}
1202,fontSize:.009,anchorX:`left`,anchorY:`middle`,get position(){return Q(i)}})}X(e,r)},u=q(()=>t.startsWith(`water:`)&&VF(t)),d=e=>{var r=GF(),i=N(r);{let e=q(()=>BF(t)),r=q(()=>[-.24/2+.008,T(Q(n)),.002]);tD(i,{get text(){return Q(e)},color:`#9fd8ff`,fontSize:.009,anchorX:`left`,anchorY:`middle`,get position(){return Q(r)}})}var a=g(i,2);{let e=q(()=>Q(h)[t]??``),r=q(()=>[f/2-.062,T(Q(n)),.002]);tD(a,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.009,anchorX:`right`,anchorY:`middle`,get position(){return Q(r)}})}var o=g(a,2);{let e=q(()=>`vrprops-${t}:-1`),r=q(()=>[f/2-.042,T(Q(n)),0]);P(o,()=>Uw.Mesh,(n,i)=>{i(n,{get name(){return Q(e)},get position(){return Q(r)},children:(e,n)=>{var r=WF(),i=N(r);P(i,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.0075,18]})});var a=g(i,2);{let e=q(()=>M(`${t}:-1`));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var s=g(o,2);{let e=q(()=>[f/2-.042,T(Q(n)),.002]);tD(s,{text:`â`,color:`#ffffff`,fontSize:.009,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}var c=g(s,2);{let e=q(()=>`vrprops-${t}:1`),r=q(()=>[f/2-.016,T(Q(n)),0]);P(c,()=>Uw.Mesh,(n,i)=>{i(n,{get name(){return Q(e)},get position(){return Q(r)},children:(e,n)=>{var r=WF(),i=N(r);P(i,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.0075,18]})});var a=g(i,2);{let e=q(()=>M(`${t}:1`));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var l=g(c,2);{let e=q(()=>[f/2-.016,T(Q(n)),.002]);tD(l,{text:`+`,color:`#ffffff`,fontSize:.009,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}X(e,r)},p=q(()=>t.startsWith(`water:`)),m=e=>{{let r=q(()=>t===`duplicate`?`â§ Duplicate`:`Delete`),i=q(()=>t===`delete`?`#e8a0a0`:`#c8d0da`),a=q(()=>[-.24/2+.008,T(Q(n)),.002]);tD(e,{get text(){return Q(r)},get color(){return Q(i)},fontSize:.009,anchorX:`left`,anchorY:`middle`,get position(){return Q(a)}})}},_=e=>{var r=GF(),i=N(r);{let e=q(()=>w(t)),r=q(()=>[-.24/2+.008,T(Q(n)),.002]);tD(i,{get text(){return Q(e)},color:`#c8d0da`,fontSize:.009,anchorX:`left`,anchorY:`middle`,get position(){return Q(r)}})}var a=g(i,2);{let e=q(()=>Q(h)[t]??``),r=q(()=>[f/2-.062,T(Q(n)),.002]);tD(a,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.009,anchorX:`right`,anchorY:`middle`,get position(){return Q(r)}})}var o=g(a,2);{let e=q(()=>S.includes(t)?`vrprops-${t}:-1`:`vrprops-nudge:${t}:-1`),r=q(()=>[f/2-.042,T(Q(n)),0]);P(o,()=>Uw.Mesh,(n,i)=>{i(n,{get name(){return Q(e)},get position(){return Q(r)},children:(e,n)=>{var r=WF(),i=N(r);P(i,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.0075,18]})});var a=g(i,2);{let e=q(()=>M(S.includes(t)?`${t}:-1`:`nudge:${t}:-1`));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var s=g(o,2);{let e=q(()=>[f/2-.042,T(Q(n)),.002]);tD(s,{text:`â`,color:`#ffffff`,fontSize:.009,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}var c=g(s,2);{let e=q(()=>S.includes(t)?`vrprops-${t}:1`:`vrprops-nudge:${t}:1`),r=q(()=>[f/2-.016,T(Q(n)),0]);P(c,()=>Uw.Mesh,(n,i)=>{i(n,{get name(){return Q(e)},get position(){return Q(r)},children:(e,n)=>{var r=WF(),i=N(r);P(i,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.0075,18]})});var a=g(i,2);{let e=q(()=>M(S.includes(t)?`${t}:1`:`nudge:${t}:1`));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var l=g(c,2);{let e=q(()=>[f/2-.016,T(Q(n)),.002]);tD(l,{text:`+`,color:`#ffffff`,fontSize:.009,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}X(e,r)};G(a,e=>{t===`color`?e(o):t===`visible`?e(s,1):Q(u)?e(l,2):Q(p)?e(d,3):t===`duplicate`||t===`delete`?e(m,4):e(_,-1)}),X(e,r)});var l=g(s,2);{let e=q(()=>[0,-Q(D)/2+p*.5,.002]);tD(l,{text:`stick â row · â adjust · press = apply`,color:`#9aa4b2`,fontSize:.0065,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(re,e=>{r()&&e(ie)}),X(e,ne),ue(),u()}var KF=V(`<!> <!>`,1),BTe=V(`<!> <!> <!> <!>`,1),VTe=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!>`,1);function HTe(e,n){Ce(n,!0);let r=()=>z(fi,`$vrPrefabsPanelOpen`,l),i=()=>z(U_,`$vrPrefabsCursor`,l),a=()=>z(Av,`$prefabs`,l),o=()=>z(di,`$vrPrefabsPinned`,l),s=()=>z(H_,`$vrHovered`,l),c=()=>z(due,`$vrPrefabGhost`,l),[l,u]=Ve(),{renderer:d}=Ww(),f=.075,p=.186,m=t(null);Qe(()=>{Zle.set(r()?Q(m):null)}),Qe(()=>{r()?kv():U_.set(0)});let h=new Map;function _(e){if(!e.thumbnail)return null;let t=h.get(e.id);
1202return t||(t=new Jn().load(e.thumbnail),t.colorSpace=sr,h.set(e.id,t)),t}let v=.306+.03,y=q(()=>Math.min(Math.max(0,i()),Math.max(0,a().length-1))),b=q(()=>Math.min(Math.floor(Q(y)/2)*2-4<0?0:Math.floor(Q(y)/2)*2-4,Math.max(0,Math.ceil(a().length/2)*2-6))),x=q(()=>a().slice(Q(b),Q(b)+6).map((e,t)=>({prefab:e,index:Q(b)+t,x:-.043500000000000004+t%2*.087,y:v/2-.045-f/2-Math.floor(t/2)*.087}))),S=new hn,C=new hn,w=new hn,T=new zt,E=new fr,D=new hn,O=new zt,k=!1;Kw(e=>{if(!Q(m)||!r()){k=!1;return}if(!d.xr.isPresenting)return;let t=d.xr.getCamera();if(t.getWorldPosition(S),t.getWorldDirection(C),C.y=0,C.lengthSq()<1e-6&&C.set(0,0,-1),C.normalize(),w.copy(S).addScaledVector(C,.55),w.y=S.y-.06,E.lookAt(S,w,new hn(0,1,0)),T.setFromRotationMatrix(E),!o()){if(!k)k=!0,D.copy(w),O.copy(T);else{let t=1-Math.exp(-4*e);D.lerp(w,t),O.slerp(T,t)}}ob(Q(m),`prefabs`,{position:D,quaternion:O})});function A(e){return s()===`prefabs:cell:`+e.id?`#ff4000`:c()?.id===e.id?`#2f81f7`:`#2a2f38`}var ee=fe(),j=N(ee),M=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-prefabs-panel`,get ref(){return Q(m)},set ref(e){I(m,e,!0)},children:(e,t)=>{var n=VTe(),r=N(n);P(r,()=>Uw.Mesh,(e,t)=>{t(e,{position:[0,0,-.004],children:(e,t)=>{var n=KF(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.206,.356]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#11151c`,transparent:!0,opacity:.9,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var i=g(r,2);{let e=q(()=>c()?`Placing: ${c().name}`:`Prefabs (${a().length})`);tD(i,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.01,anchorX:`left`,anchorY:`middle`,position:[-.087,v/2-.016,.002]})}var l=g(i,2);P(l,()=>Uw.Mesh,(e,t)=>{t(e,{name:`vrprefabs-pin`,position:[p/2-.036,v/2-.016,0],children:(e,t)=>{var n=KF(),r=N(n);P(r,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.009,20]})});var i=g(r,2);{let e=q(()=>
1202o()?`#2f81f7`:s()===`prefabs:pin`?`#ff4000`:`#39404d`);P(i,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})});var u=g(l,2);tD(u,{text:`pin`,color:`#ffffff`,fontSize:.0065,anchorX:`center`,anchorY:`middle`,position:[p/2-.036,v/2-.016,.002]});var d=g(u,2);P(d,()=>Uw.Mesh,(e,t)=>{t(e,{name:`vrprefabs-close`,position:[p/2-.014,v/2-.016,0],children:(e,t)=>{var n=KF(),r=N(n);P(r,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.009,20]})});var i=g(r,2);{let e=q(()=>s()===`prefabs:close`?`#ff4000`:`#39404d`);P(i,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})});var m=g(d,2);tD(m,{text:`â`,color:`#ffffff`,fontSize:.008,anchorX:`center`,anchorY:`middle`,position:[p/2-.014,v/2-.016,.002]});var h=g(m,2),b=e=>{tD(e,{text:`No prefabs yet. 1203Edit ⸠Save prefab adds the selection.`,color:`#9aa4b2`,fontSize:.008,lineHeight:1.5,anchorX:`center`,anchorY:`middle`,position:[0,0,.002]})};G(h,e=>{a().length===0&&e(b)});var S=g(h,2);B(S,17,()=>Q(x),e=>e.prefab.id,(e,t)=>{var n=BTe(),r=N(n),i=e=>{var n=fe(),r=N(n);{let e=q(()=>[Q(t).x,Q(t).y,-.002]);P(r,()=>Uw.Mesh,(t,n)=>{n(t,{get position(){return Q(e)},children:(e,t)=>{var n=KF(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.08299999999999999,.08299999999999999]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#5a3a12`,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})})}X(e,n)};G(r,e=>{Q(y)===Q(t).index&&e(i)});var a=g(r,2);{let e=q(()=>`vrprefabs-cell:${Q(t).prefab.id}`),n=q(()=>[Q(t).x,Q(t).y,-.001]);P(a,()=>Uw.Mesh,(r,i)=>{i(r,{get name(){return Q(e)},get position(){return Q(n)},children:(e,n)=>{var r=KF(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[f,f]})});var a=g(i,2);{let e=q(()=>A(Q(t).prefab));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var o=g(a,2),s=e=>{var n=fe(),r=N(n);{let e=q(()=>[Q(t).x,Q(t).y+.006,.001]);P(r,()=>Uw.Mesh,(n,r)=>{r(n,{get position(){return Q(e)},children:(e,n)=>{var r=KF(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.061,.051]})});var a=g(i,2);{let e=q(()=>_(Q(t).prefab));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get map(){return Q(e)},transparent:!0,get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}X(e,n)};G(o,e=>{Q(t).prefab.thumbnail&&e(s)});var c=g(o,2);{let e=q(()=>Q(t).prefab.name.length>12?Q(t).prefab.name.slice(0,11)+`â¦`:Q(t).prefab.name),n=q(()=>[Q(t).x,Q(t).y-f/2+.008,.002]);tD(c,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.0065,anchorX:`center`,anchorY:`middle`,get position(){return Q(n)}})}X(e,n)});var C=g(S,2);{let e=q(()=>c()?`trigger = place · grip = cancel`:`trigger a tile to start placing`);tD(C,{get text(){return Q(e)},color:`#9aa4b2`,fontSize:.0065,anchorX:`center`,anchorY:`middle`,position:[0,-.15599999999999997,.002]})}X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(j,e=>{r()&&e(M)}),X(e,ee),ue(),u()}var qF=V(`<!> <!>`,1),UTe=V(`<!> <!> <!> <!> <!>`,1);function WTe(e,n){Ce(n,!0);let r=()=>z(Jv,`$vrKeyboardTarget`,o),i=()=>z(ui,`$vrMenuHand`,o),a=()=>z(H_,`$vrHovered`,o),[o,s]=Ve(),{renderer:c}=Ww(),l=.006,u=t(null);Qe(()=>{Jle.set(r()?Q(u):null)});let d={space:4,enter:2,backspace:1.6,shift:1.6,esc:1.4},f=q(()=>Yv.map((e,t)=>{let n=e.map(e=>(d[e]??1)*.03+((d[e]??1)-1)*l),i=-(n.reduce((e,t)=>e+t,0)+(e.length-1)*l)/2,a=(Yv.length/2-t-.5)*.036;return e.map((e,t)=>{let o=n[t],s={id:e,glyph:Tfe(e,r()?.shift),x:i+o/2,y:a,w:o};return i+=o+l,s})}).flat()),p=Yv.length*.036+.06,m=new hn,h=new zt,_=new hn(0,-.12,0);Kw(()=>{if(!Q(u)||!r()||!c.xr.isPresenting||!c.xr.getSession())return;let e=$_(i());if(e<0)return;let t=c.xr.getController(e);t.getWorldPosition(m),t.getWorldQuaternion(h);let n=Fv(Dn,m,h);n.position.add(_.clone().applyQuaternion(h)),ob(Q(u),`keyboard`,n)});function v(e){return a()===`kbd:`+e?`#ff4000`:e===`enter`?`#1f6f43`:e===`esc`?`#6f2f2f`:e===`shift`&&r()?.shift?`#2f81f7`:`#2a2f38`}var y=fe(),b=N(y),x=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-keyboard`,get ref(){return Q(u)},set ref(e){I(u,e,!0)},children:(e,t)=>{var n=UTe(),i=N(n);P(i,()=>Uw.Mesh,(e,t)=>{t(e,{position:[0,0,-.004],children:(e,t)=>{var n=qF(),r=N(n);{let e=q(()=>[.396,p+.02]);P(r,()=>Uw.PlaneGeometry,(t,n)=>{n(t,{get args(){return Q(e)}})})}var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#11151c`,transparent:!0,opacity:.92,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var a=g(i,2);{let e=q(()=>[-.366/2,p/2-.012,.002]);tD(a,{get text(){return r().title},color:`#9aa4b2`,fontSize:.008,anchorX:`left`,anchorY:`middle`,get position(){return Q(e)}})}var o=g(a,2);{let e=q(()=>[0,p/2-.033,-.001]);P(o,()=>Uw.Mesh,(t,n)=>{n(t,{get position(){return Q(e)},children:(e,t)=>{var n=qF(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.366,.026]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#05070b`,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})})}var s=g(o,2);{let e=q(()=>(r().buffer||``)+`â`),t=q(()=>[-.175,p/2-.033,.002]);tD(s,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.013,anchorX:`left`,anchorY:`middle`,get position(){return Q(t)},maxWidth:.35})}var c=g(s,2);B(c,17,()=>Q(f),e=>e.id,(e,t)=>{var n=qF(),r=N(n);{let e=q(()=>`vrkey-${Q(t).id}`),n=q(()=>[Q(t).x,Q(t).y-.02,0]);P(r,()=>Uw.Mesh,(r,i)=>{i(r,{get name(){return Q(e)},get position(){return Q(n)},children:(e,n)=>{var r=qF(),i=N(r);{let e=q(()=>[Q(t).w,.027]);P(i,()=>Uw.PlaneGeometry,(t,n)=>{n(t,{get args(){return Q(e)}})})}var a=g(i,2);{let e=q(()=>v(Q(t).id));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var i=g(r,2);{let e=q(()=>Q(t).id.length>1?.009:.013),n=q(()=>[Q(t).x,Q(t).y-.02,.002]);tD(i,{get text(){return Q(t).glyph},color:`#e8ecf2`,get fontSize(){return Q(e)},anchorX:`center`,anchorY:`middle`,get position(){return Q(n)}})}X(e,n)}),X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(b,e=>{r()&&e(x)}),X(e,y),ue(),s()}var JF=V(`<!> <!>`,1),GTe=V(`<!> <!> <!> <!> <!> <!> <!> <!>`,1);function KTe(e,n){Ce(n,!0);let r=()=>z(Qr,`$vrChatPanelOpen`,l),i=()=>z(_s,`$messages`,l),a=()=>z(Es,`$peers`,l),o=()=>z(pc,`$username`,l),s=()=>z(ui,`$vrMenuHand`,l),c=()=>z(H_,`$vrHovered`,l),[l,u]=Ve(),{renderer:d}=Ww(),f=.3,p=.026,m=t(null);Qe(()=>{Hle.set(r()?Q(m):null)});let h=q(()=>i().slice(-8)),_=.298,v=e=>e.type===`info`||e.type===`system`||e.type===``,y=e=>e.type===`sent`||e.sender===a()?.peer?.id?o()||`You`:hh(e.sender),b=new hn,x=new zt,S=new hn(0,.18,0);Kw(()=>
1203{if(!Q(m)||!r()||!d.xr.isPresenting||!d.xr.getSession())return;let e=$_(s());if(e<0)return;let t=d.xr.getController(e);t.getWorldPosition(b),t.getWorldQuaternion(x);let n=Fv(Dn,b,x);n.position.add(S.clone().applyQuaternion(x)),ob(Q(m),`chat`,n)});var C=fe(),w=N(C),T=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-chat-panel`,get ref(){return Q(m)},set ref(e){I(m,e,!0)},children:(e,t)=>{var n=GTe(),r=N(n);P(r,()=>Uw.Mesh,(e,t)=>{t(e,{position:[0,0,-.004],children:(e,t)=>{var n=JF(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.32,.318]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#11151c`,transparent:!0,opacity:.9,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var i=g(r,2);tD(i,{text:`Chat`,color:`#e8ecf2`,fontSize:.011,anchorX:`left`,anchorY:`middle`,position:[-.142,_/2-.016,.002]});var a=g(i,2);P(a,()=>Uw.Mesh,(e,t)=>{t(e,{name:`vrchat-close`,position:[f/2-.014,_/2-.016,0],children:(e,t)=>{var n=JF(),r=N(n);P(r,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.009,20]})});var i=g(r,2);{let e=q(()=>c()===`chat:close`?`#ff4000`:`#39404d`);P(i,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})});var o=g(a,2);tD(o,{text:`â`,color:`#ffffff`,fontSize:.008,anchorX:`center`,anchorY:`middle`,position:[f/2-.014,_/2-.016,.002]});var s=g(o,2),l=e=>{tD(e,{text:`No messages yet.`,color:`#9aa4b2`,fontSize:.008,anchorX:`center`,anchorY:`middle`,position:[0,.02,.002]})};G(s,e=>{Q(h).length===0&&e(l)});var u=g(s,2);B(u,19,()=>Q(h),(e,t)=>e.id??t,(e,t,n)=>{let r=q(()=>_/2-.04-Q(n)*p);var i=fe(),a=N(i),o=e=>{{let n=q(()=>`${Q(t).text}`),i=q(()=>[0,Q(r),.002]);tD(e,{get text(){return Q(n)},color:`#8b93a1`,fontSize:.0075,anchorX:`center`,anchorY:`middle`,get position(){return Q(i)},maxWidth:.27999999999999997})}},s=q(()=>v(Q(t))),c=e=>{var n=JF(),i=N(n);{let e=q(()=>[-.3/2+.012,Q(r),.002]);P(i,()=>Uw.Mesh,(n,r)=>{r(n,{get position(){return Q(e)},children:(e,n)=>{var r=JF(),i=N(r);P(i,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.004,14]})});var a=g(i,2);{let e=q(()=>gh(Q(t).sender));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var a=g(i,2);{let e=q(()=>`${y(Q(t))}: ${Q(t).text}`),n=q(()=>[-.128,Q(r),.002]);tD(a,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.008,anchorX:`left`,anchorY:`middle`,get position(){return Q(n)},maxWidth:.268,clipRect:[-.005,-.026,.268,p*.5]})}X(e,n)};G(a,e=>{Q(s)?e(o):e(c,-1)}),X(e,i)});var d=g(u,2);P(d,()=>Uw.Mesh,(e,t)=>{t(e,{name:`vrchat-input`,position:[0,-.129,0],children:(e,t)=>{var n=JF(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.27999999999999997,.024]})});var i=g(r,2);{let e=q(()=>c()===`chat:input`?`#2f5fa0`:`#2a2f38`);P(i,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})}),tD(g(d,2),{text:`ï¼ Type a messageâ¦`,color:`#c8d0da`,fontSize:.0085,anchorX:`center`,anchorY:`middle`,position:[0,-.129,.002]}),X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(w,e=>{r()&&e(T)}),X(e,C),ue(),u()}var YF=Ue(null),XF=null,ZF=null,QF=[];function qTe(){let e=()=>{setTimeout(()=>{XF&&U(Up)!==XF.uuid&&U(mm)!==XF.uuid&&iI(!0)},0)};QF=[Up.subscribe(e),mm.subscribe(e)]}function $F(e){return U(Ui)?.getObjectByProperty(`uuid`,e)??null}function JTe(e){let t=Cf(e,e.userData?.physics?.collider),n=e.scale,r=Math.max(Math.abs(n.x),1e-6),i=Math.max(Math.abs(n.y),1e-6),a=Math.max(Math.abs(n.z),1e-6);if(t?.pieces){let e=[];for(let n of t.pieces){let t=n.indices??Array.from({length:n.verts.length/3},(e,t)=>t);for(let o of t)e.push(n.verts[o*3]/r,n.verts[o*3+1]/i,n.verts[o*3+2]/a)}let n=new ft;return n.setAttribute(`position`,new Qt(new Float32Array(e),3)),n.computeVertexNormals(),n.computeBoundingSphere(),n}let o=t?.halfExtents??new hn(.5,.5,.5),s=new hn(o.x/r,o.y/i,o.z/a),c,l=t?.kind??`box`;if(l===`sphere`)c=new mt(Math.max(s.x,s.y,s.z),8,6);else if(l===`capsule`){let e=Math.max(s.x,s.z,.02);c=new tn(e,Math.max((s.y-e)*2,.02),3,8)}else c=l===`cylinder`?new Ar(Math.max(s.x,s.z,.02),Math.max(s.x,s.z,.02),s.y*2,12):new Dr(s.x*2,s.y*2,s.z*2);let u=t?e.worldToLocal(t.center.clone()):new hn;c.translate(u.x,u.y,u.z);let d=c.toNonIndexed();return c.dispose(),d.computeVertexNormals(),d}function eI(e){let t=$F(e),n=U(Pi);return!t||!n?!1:(U(YF)&&iI(!1),XF=new Nt(JTe(t),new ir({color:2278750,transparent:!0,opacity:.35,depthWrite:!1,side:2})),XF.name=`collider-edit-proxy`,XF.position.copy(t.position),XF.quaternion.copy(t.quaternion),XF.scale.copy(t.scale),n.add(XF),jp(XF),ZF=e,YF.set(e),zp(XF.uuid),U(Up)===XF.uuid?(qTe(),Sie(),es(`Editing the collider â each disconnected shell becomes one convex piece`),!0):(iI(!1),!1))}function tI(e){if(!XF)return!1;let t=e===`sphere`?.35:.3,n=e===`sphere`?new mt(.35,6,4):new Dr(.6,.6,.6);XF.geometry.computeBoundingBox();let r=XF.geometry.boundingBox;r&&isFinite(r.max.x)&&n.translate(r.max.x+t+.1,(r.min.y+r.max.y)/2,(r.min.z+r.max.z)/2);let i=n.toNonIndexed();n.dispose();let a=i.attributes.position.array,o=XF.geometry.attributes.position.array,s=new Float32Array(o.length+a.length);return s.set(o,0),s.set(a,o.length),i.dispose(),om(XF.uuid,Array.from(s)),U(mm)===XF.uuid&&(fm(),gm(XF.uuid)),es(`Added a `+e+` piece â `+nI()+` shells now`),!0}function nI(){return XF?Lp(kp(XF.geometry)).length:0}function rI(){let e=ZF,t=e?$F(e):null;if(!XF||!e||!t)return iI(!1),!1;let n=kp(XF.geometry),r=Lp(n),i=[],a=[];
1203if(r.forEach(e=>{let t=i.length;e.forEach(e=>{for(let t of n[e])i.push(Math.round(t.x*1e3)/1e3,Math.round(t.y*1e3)/1e3,Math.round(t.z*1e3)/1e3)}),a.push([t,i.length-t])}),i.length>1200)return es(`Collider too detailed to store (`+i.length/3+` of `+Fre/3+` verts) â delete some faces first`),!1;let o=t.userData.physics?{...t.userData.physics}:null,s={mode:`auto`,...t.userData.physics??{},collider:`custom`,colliderVerts:i,colliderPieces:a};iI(!1),ep(),t.userData.physics=s,Af({kind:`props`,uuid:e,before:{physics:o},after:{physics:s}});let c=U(Es);return c&&c.send({type:`objectParameters`,parameter:`physics`,uuid:e,physics:s}),ci(),Di.update(e=>e),$(()=>import(`../chunks/B3B8hjh_.js`).then(e=>e.v).then(t=>t.physicsShapeChanged(e)),__vite__mapDeps([157,1,2,6,9,0,3,4,38,39,5,7,48,10,14,32,13,30,31,57,58,18,19,20,21,22,23,11,12,8,24,25,26,27,28,29,33,34,35,36,37,40,41,42,43,44,45,46,47,49,50,16,51,52,53,54,55,56,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,158,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url),es(`Custom collider saved â `+a.length+` convex piece`+(a.length===1?``:`s`)),!0}function iI(e=!0){QF.forEach(e=>e()),QF=[],U(mm)===XF?.uuid&&fm(),U(Up)===XF?.uuid&&Fp(),XF&&(XF.parent?.remove(XF),XF.geometry?.dispose?.(),XF.material?.dispose?.()),XF=null,ZF=null,jp(null),U(YF)&&YF.set(null),e&&es(`Collider edit cancelled`)}function YTe(){return XF?.uuid??null}function XTe(){return ZF}function ZTe(){return{target:ZF,proxyUuid:XF?.uuid??null,shells:XF?nI():0}}var aI=V(`<!> <!>`,1),QTe=V(`<!> <!> <!>`,1),$Te=V(`<!> <!> <!> <!> <!> <!> <!>`,1);function eEe(e,n){Ce(n,!0);let r=()=>z(ti,`$vrEditMenuOpen`,v),i=()=>z(Up,`$faceEditObject`,v),a=()=>z(mm,`$editingObject`,v),o=()=>z(Ni,`$vrStretchObject`,v),s=()=>z(YF,`$colliderEditObject`,v),c=()=>z(Mp,`$faceEditOp`,v),l=()=>z(Ip,`$faceEditSelectedTris`,v),u=()=>z(Op,`$faceEditGranularity`,v),d=()=>z(Vp,`$faceEditMulti`,v),f=()=>z(um,`$vertexSelectionSize`,v),p=()=>z(tue,`$vrFaceCreateMode`,v),m=()=>z(ui,`$vrMenuHand`,v),h=()=>z(H_,`$vrHovered`,v),_=()=>z(gi,`$vrStretchFactors`,v),[v,y]=Ve(),b={quad:`Quad`,face:`Face`,triangle:`Triangle`,shell:`Shell`,object:`Object`},{renderer:x}=Ww(),S=.22,C=.026,w=.03,T=t(null);Qe(()=>{eue.set(r()?Q(T):null)});let E=q(()=>i()?`faces`:a()?`vertices`:o()?`stretch`:`none`),D=q(()=>!!s()),O=q(()=>[{action:`edit:mode:vertices`,label:`Vertices`,active:Q(E)===`vertices`},{action:`edit:mode:faces`,label:`Faces`,active:Q(E)===`faces`},...Q(D)?[]:[{action:`edit:mode:stretch`,label:`Stretch`,active:Q(E)===`stretch`}]]),k=q(()=>{let e=[];
1203if(Q(E)===`faces`){let t=c(),n=l().length;e.push({action:`edit:granularity`,label:`Select: ${b[u()]??`Quad`}`,active:u()!==`quad`},{action:`edit:multi`,label:`Multi: ${d()?`On`:`Off`}${d()&&n?` (${n})`:``}`,active:d()},{action:`face:extrude`,label:`Extrude`,active:t===`extrude`},{action:`face:inset`,label:`Inset`,active:t===`inset`},{action:`face:move`,label:`Move`,active:t===`move`},{action:`face:delete`,label:`Delete`,active:t===`delete`,danger:!0})}else if(Q(E)===`vertices`){let t=f(),n=p(),r=n?t>=3&&t<=4?`Build face (${t})`:`Select verts (${t})`:`Create face`;e.push({action:`edit:createface`,label:r,active:n})}return Q(D)&&e.push({action:`collider:add:box`,label:`+ Box piece`},{action:`collider:add:sphere`,label:`+ Sphere piece`},{action:`collider:decompose`,label:`Decompose (auto)`},{action:`collider:done`,label:`Done â save collider`,active:!0},{action:`collider:cancel`,label:`Cancel`,danger:!0}),e}),A=q(()=>Q(E)===`stretch`?3:Q(k).length),ee=q(()=>.062+Q(A)*C+.02),j=[`W`,`H`,`D`],M=new hn,te=new zt,ne=new hn(0,.14,0);Kw(()=>{if(!Q(T)||!r()||!x.xr.isPresenting||!x.xr.getSession())return;let e=$_(m());if(e<0)return;let t=x.xr.getController(e);t.getWorldPosition(M),t.getWorldQuaternion(te);let n=Fv(Dn,M,te);n.position.add(ne.clone().applyQuaternion(te)),ob(Q(T),`editmenu`,n)});function re(e){return h()===e.action?`#ff4000`:e.active?`#2f81f7`:e.danger?`#5a2a2a`:`#2a2f38`}let ie=.004,F=q(()=>(S-ie*(Q(O).length-1))/Q(O).length);function ae(e){return(e-(Q(O).length-1)/2)*(Q(F)+ie)}let L=q(()=>Q(ee)/2-.011),oe=q(()=>Q(ee)/2-.026-w/2);function R(e){return Q(oe)-w/2-.008-C/2-e*C}var se=fe(),ce=N(se),le=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-edit-menu`,get ref(){return Q(T)},set ref(e){I(T,e,!0)},children:(e,t)=>{var n=$Te(),r=N(n);P(r,()=>Uw.Mesh,(e,t)=>{t(e,{position:[0,0,-.004],children:(e,t)=>{var n=aI(),r=N(n);{let e=q(()=>[.24,Q(ee)+.02]);P(r,()=>Uw.PlaneGeometry,(t,n)=>{n(t,{get args(){return Q(e)}})})}var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#11151c`,transparent:!0,opacity:.9,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var i=g(r,2);{let e=q(()=>Q(D)?`Edit Collider`:`Edit Mesh`),t=q(()=>[-.22/2,Q(L),.002]);tD(i,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.01,anchorX:`left`,anchorY:`middle`,get position(){return Q(t)}})}var a=g(i,2);{let e=q(()=>[S/2-.011,Q(L),0]);P(a,()=>Uw.Mesh,(t,n)=>{n(t,{name:`vredit-edit:close`,get position(){return Q(e)},children:(e,t)=>{var n=aI(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.022,.022]})});var i=g(r,2);{let e=q(()=>re({action:`edit:close`,label:``,danger:!0}));P(i,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})})}var o=g(a,2);{let e=q(()=>[S/2-.011,Q(L),.002]);tD(o,{text:`â`,color:`#e8a0a0`,fontSize:.011,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}var s=g(o,2);B(s,19,()=>Q(O),e=>e.action,(e,t,n)=>{var r=aI(),i=N(r);{let e=q(()=>`vredit-${Q(t).action}`),r=q(()=>[ae(Q(n)),Q(oe),0]);P(i,()=>Uw.Mesh,(n,i)=>{i(n,{get name(){return Q(e)},get position(){return Q(r)},children:(e,n)=>{var r=aI(),i=N(r);{let e=q(()=>[Q(F),.026]);P(i,()=>Uw.PlaneGeometry,(t,n)=>{n(t,{get args(){return Q(e)}})})}var a=g(i,2);{let e=q(()=>re(Q(t)));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var a=g(i,2);{let e=q(()=>[ae(Q(n)),Q(oe),.002]);tD(a,{get text(){return Q(t).label},color:`#e8ecf2`,fontSize:.0085,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}X(e,r)});var c=g(s,2);B(c,19,()=>Q(k),e=>e.action,(e,t,n)=>{var r=aI(),i=N(r);{let e=q(()=>`vredit-${Q(t).action}`),r=q(()=>[0,R(Q(n)),0]);P(i,()=>Uw.Mesh,(n,i)=>{i(n,{get name(){return Q(e)},get position(){return Q(r)},children:(e,n)=>{var r=aI(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[S,.022]})});var a=g(i,2);{let e=q(()=>re(Q(t)));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var a=g(i,2);{let e=q(()=>(Q(t).active?`â `:``)+Q(t).label),r=q(()=>Q(t).danger?`#e8a0a0`:`#e8ecf2`),i=q(()=>[0,R(Q(n)),.002]);tD(a,{get text(){return Q(e)},get color(){return Q(r)}
1203,fontSize:.009,anchorX:`center`,anchorY:`middle`,get position(){return Q(i)}})}X(e,r)});var l=g(c,2),u=e=>{var t=fe(),n=N(t);B(n,18,()=>j,e=>e,(e,t,n)=>{var r=QTe(),i=N(r);{let e=q(()=>[.03,R(Q(n)),-.001]);P(i,()=>Uw.Mesh,(t,n)=>{n(t,{get position(){return Q(e)},children:(e,t)=>{var n=aI(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.16,.004]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#2a2f38`,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})})}var a=g(i,2);{let e=q(()=>`vrstretch-${Q(n)}`),t=q(()=>[.03,R(Q(n)),0]);P(a,()=>Uw.Mesh,(n,r)=>{r(n,{get name(){return Q(e)},get position(){return Q(t)},children:(e,t)=>{var n=aI(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.05,.019999999999999997]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#2f81f7`,transparent:!0,opacity:.95,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})})}var o=g(a,2);{let e=q(()=>t+` `+_()[Q(n)].toFixed(2)+`x`),r=q(()=>[-.22/2,R(Q(n)),.002]);tD(o,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.0075,anchorX:`left`,anchorY:`middle`,get position(){return Q(r)}})}X(e,r)}),X(e,t)};G(l,e=>{Q(E)===`stretch`&&e(u)}),X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(ce,e=>{r()&&e(le)}),X(e,se),ue(),y()}var oI=V(`<!> <!>`,1),tEe=V(`<!> <!> <!> <!> <!> <!>`,1);function nEe(e,n){Ce(n,!0);let r=()=>z(Bi,`$vrSnapMenuOpen`,c),i=()=>z(ji,`$vrSnapMode`,c),a=()=>z(_c,`$snapSettings`,c),o=()=>z(ui,`$vrMenuHand`,c),s=()=>z(H_,`$vrHovered`,c),[c,l]=Ve(),{renderer:u}=Ww(),d=.22,f=.026,p=.03,m=t(null);Qe(()=>{hue.set(r()?Q(m):null)});let h=q(()=>[{action:`snap:mode:off`,label:`Off`,active:i()===`off`},{action:`snap:mode:grid`,label:`Grid`,active:i()===`grid`},{action:`snap:mode:surface`,label:`Surface`,active:i()===`surface`},{action:`snap:mode:rotation`,label:`Rotation`,active:i()===`rotation`}]),_=q(()=>{let e=i(),t=a().translate,n=a().rotateDeg,r=[];if(e===`grid`)for(let e of[.1,.5,1])r.push({action:`snap:grid:${e}`,label:`${e}`,sub:!0,active:Math.abs(t-e)<1e-6});else if(e===`rotation`){for(let e of[15,30,45])r.push({action:`snap:rot:${e}`,label:`${e}°`,sub:!0,active:n===e});r.push({action:`snap:rot:reset`,label:`⺠Reset`,sub:!0})}return r}),v=q(()=>.062+Q(_).length*f+.02),y=new hn,b=new zt,x=new hn(0,.14,0);Kw(()=>{if(!Q(m)||!r()||!u.xr.isPresenting||!u.xr.getSession())return;let e=$_(o());if(e<0)return;let t=u.xr.getController(e);t.getWorldPosition(y),t.getWorldQuaternion(b);let n=Fv(Dn,y,b);n.position.add(x.clone().applyQuaternion(b)),ob(Q(m),`snapmenu`,n)});function S(e){return s()===e.action?`#ff4000`:e.active?`#2f81f7`:e.danger?`#5a2a2a`:e.sub?`#1f2530`:`#2a2f38`}let C=.004,w=q(()=>(d-C*3)/4);function T(e){return-.22/2+Q(w)/2+e*(Q(w)+C)}let E=q(()=>Q(v)/2-.011),D=q(()=>Q(v)/2-.026-p/2);function O(e){return Q(D)-p/2-.008-f/2-e*f}var k=fe(),A=N(k),ee=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-snap-menu`,get ref(){return Q(m)},set ref(e){I(m,e,!0)},children:(e,t)=>{var n=tEe(),r=N(n);P(r,()=>Uw.Mesh,(e,t)=>{t(e,{position:[0,0,-.004],children:(e,t)=>{var n=oI(),r=N(n);{let e=q(()=>[.24,Q(v)+.02]);P(r,()=>Uw.PlaneGeometry,(t,n)=>{n(t,{get args(){return Q(e)}})})}var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#11151c`,transparent:!0,opacity:.9,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var i=g(r,2);{let e=q(()=>[-.22/2,Q(E),.002]);tD(i,{text:`Snap`,color:`#e8ecf2`,fontSize:.01,anchorX:`left`,anchorY:`middle`,get position(){return Q(e)}})}var a=g(i,2);{let e=q(()=>[d/2-.011,Q(E),0]);P(a,()=>Uw.Mesh,(t,n)=>{n(t,{name:`vrsnap-snap:close`,get position(){return Q(e)},children:(e,t)=>{var n=oI(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.022,.022]})});var i=g(r,2);{let e=q(()=>S({action:`snap:close`,label:``,danger:!0}));P(i,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})})}var o=g(a,2);{let e=q(()=>[d/2-.011,Q(E),.002]);tD(o,{text:`â`,color:`#e8a0a0`,fontSize:.011,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}var s=g(o,2);B(s,19,()=>Q(h),e=>e.action,(e,t,n)=>{var r=oI(),i=N(r);{let e=q(()=>`vrsnap-${Q(t).action}`),r=q(()=>[T(Q(n)),Q(D),0]);P(i,()=>Uw.Mesh,(n,i)=>{i(n,{get name(){return Q(e)},get position(){return Q(r)}
1203,children:(e,n)=>{var r=oI(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[Q(w),.026]})});var a=g(i,2);{let e=q(()=>S(Q(t)));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var a=g(i,2);{let e=q(()=>[T(Q(n)),Q(D),.002]);tD(a,{get text(){return Q(t).label},color:`#e8ecf2`,fontSize:.0075,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}X(e,r)});var c=g(s,2);B(c,19,()=>Q(_),e=>e.action,(e,t,n)=>{var r=oI(),i=N(r);{let e=q(()=>`vrsnap-${Q(t).action}`),r=q(()=>[0,O(Q(n)),0]);P(i,()=>Uw.Mesh,(n,i)=>{i(n,{get name(){return Q(e)},get position(){return Q(r)},children:(e,n)=>{var r=oI(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.19,.022]})});var a=g(i,2);{let e=q(()=>S(Q(t)));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var a=g(i,2);{let e=q(()=>(Q(t).active?`â `:``)+Q(t).label),r=q(()=>[0,O(Q(n)),.002]);tD(a,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.008,anchorX:`center`,anchorY:`middle`,get position(){return Q(r)}})}X(e,r)}),X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(A,e=>{r()&&e(ee)}),X(e,k),ue(),l()}var sI=V(`<!> <!>`,1),cI=V(`<!> <!> <!>`,1),rEe=V(`<!> <!> <!> <!> <!>`,1),iEe=V(`<!> <!> <!> <!>`,1),aEe=V(`<!> <!> <!> <!> <!> <!> <!>`,1);function oEe(e,n){Ce(n,!0);let r=()=>z(ai,`$vrSettingsPanelOpen`,d),i=()=>z(Gle,`$vrSettingsPage`,d),a=()=>z(W_,`$vrSettingsVersion`,d),o=()=>z(Ule,`$vrSettingsCursor`,d),s=()=>z(rue,`$vrRemapPending`,d),c=()=>z(H_,`$vrHovered`,d),l=()=>z(ui,`$vrMenuHand`,d),u=()=>z($r,`$vrPassthrough`,d),[d,f]=Ve(),{renderer:p}=Ww(),m=.3,h=.027,_=.03,v=.008,y=t(null);Qe(()=>{fue.set(r()?Q(y):null)});function b(e){e&&(e.userData.tour=`vr-panel:settings`)}function x(e,t){return qle(e)}let S=q(()=>x(i(),a())),C=q(()=>Q(S).filter(e=>e.kind!==`tabs`&&e.kind!==`nav`)),w=q(()=>.064+Q(C).length*h+.044+.022),T=q(()=>Q(S)[Math.min(o(),Q(S).length-1)]?.action??``),E=q(()=>Q_.find(e=>e.id===i())?.label??``);function D(e,t,n){if(e.kind===`binding`||e.kind===`locked`){let t=s();if(t&&t.action===e.rowId)return`Taken by `+$le(t.other)+` â press to swap`;let n=$pe(e.rowId??``);return lb(n.hand,n.control)}let r=e.rowId?iv(e.rowId):null;return r&&r.kind!==`action`?V_(r):``}function O(e){return e.kind===`binding`||e.kind===`locked`?null:e.rowId&&iv(e.rowId)?.icon||null}function k(e,t){let n=Q(S).find(t=>t.action===e);return n?.rowId?n.kind===`binding`||n.kind===`locked`?cb(n.rowId)?.doc??``:iv(n.rowId)?.note??``:``}function ee(e,t){let n=e.rowId?iv(e.rowId):null;return n?.kind===`toggle`&&!!n.get?.()}function j(e,t,n,r){let i=e.action;return i?t&&(t===i||t.startsWith(i+`:`))?`#ff4000`:s()&&s().action===e.rowId?`#7a5410`:n===i?`#3b4452`:`#2a2f38`:`#1d2129`}function M(e){return Q(w)/2-.034-_-h*(e+.5)}let te=q(()=>k(c()&&Q(S).some(e=>e.action===c())?c():Q(T),a())),ne=new hn,re=new zt,ie=new hn(0,.2,0);Kw(()=>{if(!Q(y)||!r()||!p.xr.isPresenting||!p.xr.getSession())return;let e=$_(l());if(e<0)return;let t=p.xr.getController(e);t.getWorldPosition(ne),t.getWorldQuaternion(re);let n=Fv(Dn,ne,re);n.position.add(ie.clone().applyQuaternion(re)),ob(Q(y),`settingspanel`,n)});var F=fe(),ae=N(F),L=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-settings-panel`,oncreate:b,get ref(){return Q(y)},set ref(e){I(y,e,!0)},children:(e,t)=>{var n=aEe(),r=N(n);P(r,()=>Uw.Mesh,(e,t)=>{t(e,{position:[0,0,-.004],children:(e,t)=>{var n=sI(),r=N(n);{let e=q(()=>[.32,Q(w)+.02]);P(r,()=>Uw.PlaneGeometry,(t,n)=>{n(t,{get args(){return Q(e)}})})}var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#11151c`,transparent:!0,opacity:.94,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var o=g(r,2);{let e=q(()=>`Settings · `+Q(E)),t=q(()=>[-.3/2,Q(w)/2-.017,.002]);tD(o,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.012,anchorX:`left`,anchorY:`middle`,get position(){return Q(t)}})}var l=g(o,2);B(l,19,()=>Q_,e=>e.id,(e,t,n)=>{let r=q(()=>m/Q_.length),a=q(()=>-.3/2+Q(r)*(Q(n)+.5)),o=q(()=>Q(w)/2-.034-_/2),s=q(()=>`vrset:page:`+Q(t).id);var l=cI(),u=N(l);{let e=q(()=>`vrsettings-${Q(s)}`),n=q(()=>[Q(a),Q(o),0]);P(u,()=>Uw.Mesh,(a,o)=>{o(a,{get name(){return Q(e)},get position(){return Q(n)},children:(e,n)=>{var a=sI(),o=N(a);{let e=q(()=>[Q(r)-.003,.026]);P(o,()=>Uw.PlaneGeometry,(t,n)=>{n(t,{get args(){return Q(e)}})})}var l=g(o,2);{let e=q(()=>c()===Q(s)?`#ff4000`:Q(t).id===i()?`#2f81f7`:Q(T)===`tabs`?`#3b4452`:`#232831`);P(l,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return 2}})})}X(e,a)},$$slots:{default:!0}})})}var d=g(u,2),f=e=>{var n=fe(),r=N(n);{let e=q(()=>[Q(a),Q(o)+.005,.002]);P(r,()=>Uw.Mesh,(n,r)=>{r(n,{get position(){return Q(e)},children:(e,n)=>{var r=sI(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.012,.012]})});var a=g(i,2);{let e=q(()=>MF(Q(t).icon));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get map(){return Q(e)},transparent:!0,depthWrite:!1,get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}X(e,n)},p=q(()=>MF(Q(t).icon));G(d,e=>{Q(p)&&e(f)});var h=g(d,2);{let e=q(()=>[Q(a),Q(o)-.008,.002]);tD(h,{get text(){return Q(t).label}
1203,color:`#e8ecf2`,fontSize:.0056,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}X(e,l)});var d=g(l,2);B(d,19,()=>Q(C),e=>e.action+e.label,(e,t,n)=>{let r=q(()=>M(Q(n))),i=q(()=>Q(t).rowId?iv(Q(t).rowId):null);var o=iEe(),l=N(o);{let e=q(()=>Q(t).action?`vrsettings-${Q(t).action}${Q(i)?.kind===`range`?`:+`:``}`:`vrsettings-locked`),n=q(()=>[0,Q(r),0]);P(l,()=>Uw.Mesh,(r,i)=>{i(r,{get name(){return Q(e)},get position(){return Q(n)},children:(e,n)=>{var r=sI(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[m,.023]})});var a=g(i,2);{let e=q(()=>j(Q(t),c(),Q(T),s()));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var u=g(l,2),d=e=>{var n=fe(),i=N(n);{let e=q(()=>[-.142+.006,Q(r),.002]);P(i,()=>Uw.Mesh,(n,r)=>{r(n,{get position(){return Q(e)},children:(e,n)=>{var r=sI(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.012,.012]})});var a=g(i,2);{let e=q(()=>MF(O(Q(t))));P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get map(){return Q(e)},color:`#cfd6df`,transparent:!0,depthWrite:!1,get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}X(e,n)},f=q(()=>O(Q(t))&&MF(O(Q(t))));G(u,e=>{Q(f)&&e(d)});var p=g(u,2);{let e=q(()=>Q(t).action?`#e8ecf2`:`#8a93a0`),n=q(()=>[-.126,Q(r),.002]);tD(p,{get text(){return Q(t).label},get color(){return Q(e)},fontSize:.0088,anchorX:`left`,anchorY:`middle`,get position(){return Q(n)}})}var h=g(p,2),_=e=>{var n=sI(),i=N(n);{let e=q(()=>[m/2-v-.012,Q(r),.002]);P(i,()=>Uw.Mesh,(n,r)=>{r(n,{get position(){return Q(e)},children:(e,n)=>{var r=sI(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.024,.012]})});var o=g(i,2);{let e=q(()=>ee(Q(t),a())?`#2f81f7`:`#4a5260`);P(o,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var o=g(i,2);{let e=q(()=>[m/2-v-.012+(ee(Q(t),a())?.006:-.006),Q(r),.003]);P(o,()=>Uw.Mesh,(t,n)=>{n(t,{get position(){return Q(e)},children:(e,t)=>{var n=sI(),r=N(n);P(r,()=>Uw.CircleGeometry,(e,t)=>{t(e,{args:[.0048,20]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#ffffff`,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})})}X(e,n)},y=e=>{var n=rEe(),i=N(n);{let e=q(()=>`vrsettings-${Q(t).action}:-`),n=q(()=>[m/2-v-.058,Q(r),.001]);P(i,()=>Uw.Mesh,(r,i)=>{i(r,{get name(){return Q(e)},get position(){return Q(n)},children:(e,n)=>{var r=sI(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.018,.019]})});var a=g(i,2);{let e=q(()=>c()===Q(t).action+`:-`?`#ff4000`:`#4a5260`);P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var o=g(i,2);{let e=q(()=>[m/2-v-.058,Q(r),.003]);tD(o,{text:`â`,color:`#ffffff`,fontSize:.011,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}var l=g(o,2);{let e=q(()=>D(Q(t),a(),s())),n=q(()=>[m/2-v-.032,Q(r),.002]);tD(l,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.0082,anchorX:`center`,anchorY:`middle`,get position(){return Q(n)}})}var u=g(l,2);{let e=q(()=>[m/2-v-.007,Q(r),.001]);P(u,()=>Uw.Mesh,(n,r)=>{r(n,{get position(){return Q(e)},children:(e,n)=>{var r=sI(),i=N(r);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.018,.019]})});var a=g(i,2);{let e=q(()=>c()===Q(t).action+`:+`?`#ff4000`:`#4a5260`);P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,r)},$$slots:{default:!0}})})}var d=g(u,2);{let e=q(()=>[m/2-v-.007,Q(r),.003]);tD(d,{text:`+`,color:`#ffffff`,fontSize:.011,anchorX:`center`,anchorY:`middle`,get position(){return Q(e)}})}X(e,n)},b=e=>{{let n=q(()=>D(Q(t),a(),s())),i=q(()=>s()&&s().action===Q(t).rowId?`#ffd27a`:`#9fb3c8`),o=q(()=>[m/2-v,Q(r),.002]);tD(e,{get text(){return Q(n)},get color(){return Q(i)},fontSize:.0082,maxWidth:m*.55,textAlign:`right`,anchorX:`right`,anchorY:`middle`,get position(){return Q(o)}})}};G(h,e=>{Q(i)?.kind===`toggle`?e(_):Q(i)?.kind===`range`?e(y,1):e(b,-1)}),X(e,o)});var f=g(d,2);{let e=q(()=>[-.3/2,-Q(w)/2+.044,.002]);tD(f,{get text(){return Q(te)},color:`#aab4c0`,fontSize:.0068,maxWidth:m,anchorX:`left`,anchorY:`middle`,get position(){return Q(e)}})}var p=g(f,2),h=e=>{{let t=q(()=>[m/2,-Q(w)/2+.044,.002]);tD(e,{text:`(restart VR to apply passthrough)`,color:`#8a93a0`,fontSize:.006,anchorX:`right`,anchorY:`middle`,get position(){return Q(t)}})}};G(p,e=>{u()&&i()===`display`&&e(h)});var y=g(p,2);B(y,17,()=>[[`vrset:back`,`Back to menu`,-.3/4,`arrow-left`],[`vrset:close`,`Close`,m/4,`x`]],([e,t,n,r])=>e,(e,t)=>{var n=q(()=>A(Q(t),4));let r=()=>Q(n)[0],i=()=>Q(n)[1],a=()=>Q(n)[2],o=()=>Q(n)[3];var s=cI(),l=N(s);{let e=q(()=>`vrsettings-${r()}`),t=q(()=>[Number(a()),-Q(w)/2+.017,0]);P(l,()=>Uw.Mesh,(n,i)=>{i(n,{get name(){return Q(e)},get position(){return Q(t)},children:(e,t)=>{var n=sI(),i=N(n);P(i,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[m/2-.006,.024]})});var a=g(i,2);{let e=q(()=>c()===r()?`#ff4000`:Q(T)===r()?`#3b4452`:r()===`vrset:close`?`#5a2a2a`:`#2a2f38`);P(a,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},transparent:!0,opacity:.95,get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})})}var u=g(l,2),d=e=>{var t=fe(),n=N(t);{let e=q(()=>[Number(a())-.03,-Q(w)/2+.017,.002]);P(n,()=>Uw.Mesh,(t,n)=>{n(t,{get position(){return Q(e)},children:(e,t)=>{var n=sI(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.011,.011]})});var i=g(r,2);{let e=q(()=>MF(String(o())));P(i,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get map(){return Q(e)},transparent:!0,depthWrite:!1,get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})})}X(e,t)},f=q(()=>MF(String(o())));G(u,e=>{Q(f)&&e(d)});var p=g(u,2);{let e=q(()=>String(i())),t=q(()=>[Number(a())+.006,-Q(w)/2+.017,.002]);tD(p,{get text(){return Q(e)},color:`#e8ecf2`,fontSize:.0085,anchorX:`center`,anchorY:`middle`,get position(){return Q(t)}})}X(e,s)}),X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(ae,e=>{r()&&e(L)}),X(e,F),ue(),f()}var lI=V(`<!> <!>`,1),sEe=V(`<!> <!> <!> <!> <!> <!> <!> <!>`,1);function cEe(e,n){Ce(n,!0);let r=()=>z(ks,`$pendingApprovals`,s),i=()=>z(wi,`$isVRMode`,s),a=()=>z(ui,`$vrMenuHand`,s),o=()=>z(H_,`$vrHovered`,s),[s,c]=Ve(),{renderer:l}=Ww(),u=.34,d=.14,f=t(null),p=q(()=>r()[0]),m=q(()=>r().length),h=q(()=>i()&&!!Q(p));Qe(()=>{Xr.set(Q(h)),Oue.set(Q(h)?Q(f):null)});let _=e=>e&&e.length>18?e.slice(0,17)+`â¦`:e||``,v=new hn,y=new zt,b=new hn(0,.2,0);Kw(()=>
1203{if(!Q(f)||!Q(h)||!l.xr.isPresenting||!l.xr.getSession())return;let e=$_(a());if(e<0)return;let t=l.xr.getController(e);t.getWorldPosition(v),t.getWorldQuaternion(y);let n=Fv(Dn,v,y);n.position.add(b.clone().applyQuaternion(y)),ob(Q(f),`approve`,n)});var x=fe(),S=N(x),C=e=>{var t=fe(),n=N(t);P(n,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-approve-panel`,get ref(){return Q(f)},set ref(e){I(f,e,!0)},children:(e,t)=>{var n=sEe(),r=N(n);P(r,()=>Uw.Mesh,(e,t)=>{t(e,{position:[0,0,-.004],children:(e,t)=>{var n=lI(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[.36000000000000004,.16]})});var i=g(r,2);P(i,()=>Uw.MeshBasicMaterial,(e,t)=>{t(e,{color:`#11151c`,transparent:!0,opacity:.92,get side(){return 2}})}),X(e,n)},$$slots:{default:!0}})});var i=g(r,2);tD(i,{text:`Connection request`,color:`#e8ecf2`,fontSize:.012,anchorX:`center`,anchorY:`middle`,position:[0,d/2-.02,.002]});var a=g(i,2);{let e=q(()=>_(Q(p)?.peerId));tD(a,{get text(){return Q(e)},color:`#9aa4b2`,fontSize:.0095,anchorX:`center`,anchorY:`middle`,maxWidth:.31000000000000005,position:[0,d/2-.045,.002]})}var s=g(a,2),c=e=>{{let t=q(()=>`+${Q(m)-1} more waiting`);tD(e,{get text(){return Q(t)},color:`#6b7280`,fontSize:.007,anchorX:`center`,anchorY:`middle`,position:[0,d/2-.064,.002]})}};G(s,e=>{Q(m)>1&&e(c)});var l=g(s,2);P(l,()=>Uw.Mesh,(e,t)=>{t(e,{name:`vrapprove-yes`,position:[-.34/4,-.14/2+.03,0],children:(e,t)=>{var n=lI(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[u/2-.03,.036]})});var i=g(r,2);{let e=q(()=>
1203o()===`approve:yes`?`#2f9e57`:`#227a43`);P(i,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})});var f=g(l,2);tD(f,{text:`â Approve`,color:`#ffffff`,fontSize:.0095,anchorX:`center`,anchorY:`middle`,position:[-.34/4,-.14/2+.03,.002]});var h=g(f,2);P(h,()=>Uw.Mesh,(e,t)=>{t(e,{name:`vrapprove-no`,position:[u/4,-.14/2+.03,0],children:(e,t)=>{var n=lI(),r=N(n);P(r,()=>Uw.PlaneGeometry,(e,t)=>{t(e,{args:[u/2-.03,.036]})});var i=g(r,2);{let e=q(()=>o()===`approve:no`?`#c8443a`:`#963029`);P(i,()=>Uw.MeshBasicMaterial,(t,n)=>{n(t,{get color(){return Q(e)},get side(){return 2}})})}X(e,n)},$$slots:{default:!0}})}),tD(g(h,2),{text:`â Deny`,color:`#ffffff`,fontSize:.0095,anchorX:`center`,anchorY:`middle`,position:[u/4,-.14/2+.03,.002]}),X(e,n)},$$slots:{default:!0}})}),X(e,t)};G(S,e=>{Q(h)&&e(C)}),X(e,x),ue(),c()}function lEe(e,n){Ce(n,!0);let r=()=>z(Di,`$selectedObject`,u),i=()=>z(mm,`$editingObject`,u),a=()=>z(Up,`$faceEditObject`,u),o=()=>z(wi,`$isVRMode`,u),s=()=>z(dl,`$editorHelpersShown`,u),c=()=>z(Ui,`$objectsGroup`,u),l=()=>z(Si,`$vrWireframeSelection`,u),[u,d]=Ve(),f=t(null),p=null,m=``,h=``,g=!1,_=[],v=new hn(1,1,1),y=new hn,b=new bn({color:`#ff7a1a`,side:1,transparent:!0,opacity:.55,depthWrite:!1}),x=new Yn({color:`#10131a`,transparent:!0,opacity:.9,depthWrite:!1}),S=new Yn({color:`#ff7a1a`,transparent:!0,opacity:.95,depthWrite:!1}),C=new hn,w=new zt,T=new hn;function E(){for(let e of _)e.dispose();_=[]}function D(e){if(e.isMesh&&e.geometry)return{geometry:e.geometry,box:!1,owned:!1};let t=new Or().setFromObject(e);return isFinite(t.min.x)?(t.getSize(v),{geometry:new Dr(Math.max(v.x,.05),Math.max(v.y,.05),Math.max(v.z,.05)),box:!0,owned:!0}):null}function O(e,t){if(p&&Q(f)?.remove(p),E(),p=null,g=!1,!e?.uuid)return;let n=D(e);if(n){if(g=n.box,n.owned&&_.push(n.geometry),t===`wire`){let e=new pn(n.geometry,8);_.push(e),p=new Pn;let t=new qt(e,x);t.scale.setScalar(1.015),t.renderOrder=998;let r=new qt(e,S);r.scale.setScalar(1.005),r.renderOrder=999,p.add(t,r)}else p=new Nt(n.geometry,b);p.name=`vr-selection-shell-mesh`,Q(f)?.add(p)}}Kw(()=>{if(!Q(f))return;let e=r(),t=!!i()||!!a(),n=o()&&s()&&!t&&!!e?.uuid&&!!c()?.getObjectByProperty(`uuid`,e.uuid);if(Q(f).visible=n,!n)return;let u=l()?`wire`:`shell`;(e.uuid!==m||u!==h)&&(m=e.uuid,h=u,O(e,u)),p&&(e.updateMatrixWorld(!0),e.matrixWorld.decompose(C,w,T),g?(new Or().setFromObject(e).getCenter(y),p.position.copy(y),p.quaternion.identity(),p.scale.set(1.04,1.04,1.04)):(p.position.copy(C),p.quaternion.copy(w),p.scale.copy(T).multiplyScalar(h===`wire`?1:1.05)))});var k=fe(),A=N(k);P(A,()=>Uw.Group,(e,t)=>{t(e,{name:`vr-selection-shell`,visible:!1,get ref(){return Q(f)},set ref(e){I(f,e,!0)}})}),X(e,k),ue(),d()}function uEe(e){let t=Array.isArray(e)?e:[];for(let e of t){let t=String(e).toLowerCase();if(t===`meta-quest-touch-plus`||t===`meta-quest-touch-pro`)return`quest3`;if(t===`oculus-touch-v3`||t===`oculus-touch-v2`||t===`oculus-touch`)return`quest2`}return`generic`}function uI(e){return e===`quest2`?`Quest 2 controllers`:e===`quest3`?`Quest 3 / 3S controllers`:`Controllers`}function dEe(e){if(!e?.inputSources)return`generic`;for(let t of e.inputSources){let e=uEe(t?.profiles);if(e!==`generic`)return e}return`generic`}function fEe(e,t){return t===`face-lower`?e===`left`?`x`:`a`:t===`face-upper`?e===`left`?`y`:`b`:t===`system`?e===`left`?`menu`:`meta`:t}var pEe={left:[`stick`,`trigger`,`grip`,`x`,`y`,`menu`],right:[`stick`,`trigger`,`grip`,`a`,`b`,`meta`]},dI=e=>String(e).replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`),mEe={line:`#8b95a5`,fill:`#1b2029`,accent:`#4f9bff`,accentFill:`#4f9bff`,text:`#dfe5ee`,label:`#ffffff`};function hEe(e,t,n,r,i){let a=e===`left`?1:-1,o=e=>i+100+a*(e-100),s=e=>n.has(e),c=e=>s(e)?r.accent:r.line,l=e=>s(e)?r.accentFill:r.fill,u=e=>s(e)?` filter="url(#tour-glow)"`:``,d=[],f=`M ${o(52)} 92 C ${o(48)} 46, ${o(152)} 40, ${o(158)} 82 C ${o(162)} 112, ${o(140)} 136, ${o(128)} 150 L ${o(122)} 236 C ${o(121)} 246, ${o(95)} 248, ${o(93)} 236 L ${o(86)} 150 C ${o(66)} 136, ${o(54)} 118, ${o(52)} 92 Z`;
1203d.push(`<path data-part="trigger" d="M ${o(78)} 52 C ${o(86)} 26, ${o(120)} 22, ${o(132)} 44 L ${o(124)} 50 C ${o(114)} 36, ${o(92)} 38, ${o(86)} 56 Z" fill="${l(`trigger`)}" stroke="${c(`trigger`)}" stroke-width="3" stroke-linejoin="round"${u(`trigger`)}/>`),d.push(`<path data-part="grip" d="M ${o(128)} 150 C ${o(146)} 162, ${o(148)} 196, ${o(130)} 214 L ${o(124)} 206 C ${o(134)} 192, ${o(134)} 168, ${o(126)} 160 Z" fill="${l(`grip`)}" stroke="${c(`grip`)}" stroke-width="3" stroke-linejoin="round"${u(`grip`)}/>`),d.push(`<path d="${f}" fill="${r.fill}" stroke="${r.line}" stroke-width="3.5" stroke-linejoin="round"/>`),t===`quest2`&&(d.push(`<path d="M ${o(40)} 112 C ${o(4)} 60, ${o(60)} -6, ${o(130)} 10 C ${o(186)} 22, ${o(196)} 70, ${o(170)} 106" fill="none" stroke="${r.line}" stroke-width="9" stroke-linecap="round" opacity="0.85"/>`),d.push(`<path d="M ${o(40)} 112 C ${o(4)} 60, ${o(60)} -6, ${o(130)} 10 C ${o(186)} 22, ${o(196)} 70, ${o(170)} 106" fill="none" stroke="${r.fill}" stroke-width="4" stroke-linecap="round"/>`)),d.push(`<circle cx="${o(80)}" cy="86" r="19" fill="none" stroke="${r.line}" stroke-width="2" opacity="0.7"/>`),d.push(`<circle data-part="stick" cx="${o(80)}" cy="86" r="13" fill="${l(`stick`)}" stroke="${c(`stick`)}" stroke-width="3"${u(`stick`)}/>`);let p=e===`left`?`x`:`a`,m=e===`left`?`y`:`b`;for(let[e,t,n]of[[p,128,100],[m,132,70]])d.push(`<circle data-part="${e}" cx="${o(t)}" cy="${n}" r="11" fill="${l(e)}" stroke="${c(e)}" stroke-width="3"${u(e)}/>`),d.push(`<text x="${o(t)}" y="${n+4.5}" text-anchor="middle" font-family="system-ui, sans-serif" font-size="13" font-weight="700" fill="${s(e)?r.label:r.text}">${e.toUpperCase()}</text>`);let h=e===`left`?`menu`:`meta`;return d.push(`<circle data-part="${h}" cx="${o(98)}" cy="122" r="7" fill="${l(h)}" stroke="${c(h)}" stroke-width="2.5"${u(h)}/>`),h===`menu`?d.push(`<path d="M ${o(95)} 119.5 h ${6*a} M ${o(95)} 122 h ${6*a} M ${o(95)} 124.5 h ${6*a}" stroke="${s(h)?r.label:r.text}" stroke-width="1.2"/>`):d.push(`<ellipse cx="${o(98)}" cy="122" rx="3.6" ry="2.4" fill="none" stroke="${s(h)?r.label:r.text}" stroke-width="1.3"/>`),d.join(``)}var gEe={trigger:{x:105,y:30,label:`Trigger`},grip:{x:140,y:182,label:`Grip`},stick:{x:80,y:86,label:`Stick`},x:{x:128,y:100,label:`X`},y:{x:132,y:70,label:`Y`},a:{x:128,y:100,label:`A`},b:{x:132,y:70,label:`B`},menu:{x:98,y:122,label:`Menu`},meta:{x:98,y:122,label:`Meta`}};function fI({family:e=`quest3`,hands:t=`both`,lit:n={},colors:r={},title:i}={}){let a={...mEe,...r},o=t===`both`?[`left`,`right`]:[t],s=200*o.length+(o.length-1)*20,c=[];return o.forEach((t,r)=>{let i=r*220,o=new Set((n[t]??[]).map(e=>fEe(t,e)).filter(e=>pEe[t].includes(e)));c.push(`<g data-hand="${t}">${hEe(t,e,o,a,i)}`);let s=[...o].map(e=>gEe[e]?.label).filter(Boolean);c.push(`<text x="${i+100}" y="272" text-anchor="middle" font-family="system-ui, sans-serif" font-size="16" font-weight="600" fill="${a.text}">${t===`left`?`Left`:`Right`}</text>`),s.length&&c.push(`<text x="${i+100}" y="294" text-anchor="middle" font-family="system-ui, sans-serif" font-size="16" font-weight="700" fill="${a.accent}">${dI(s.join(` · `))}</text>`),c.push(`</g>`)}),`<svg xmlns="http://www.w3.org/2000/svg" viewBox="-6 -6 ${s+12} 308" width="${s+12}" height="308" role="img" aria-label="${dI(i??uI(e))}"><defs><filter id="tour-glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="3" result="b"/><feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs>`+c.join(``)+`</svg>`}function pI(e){let t={left:[],right:[]};if(!e)return t;if(`left`in e||`right`in e){let t=e;return{left:(t.left??[]).slice(),right:(t.right??[]).slice()}}let n=e;return(n.hand===`left`||n.hand===`both`)&&(t.left=n.parts.slice()),(n.hand===`right`||n.hand===`both`)&&(t.right=n.parts.slice()),t}var mI={w:1024,h:640},hI={bg:`rgba(17, 21, 28, 0.95)`,border:`#2f3846`,dim:`#8b95a5`,title:`#f1f4f8`,body:`#cfd6e0`,accent:`#4f9bff`,button:`#2a2f38`,buttonHover:`#3a4250`,primary:`#2563eb`,primaryHover:`#3b82f6`,done:`#3fb950`};function gI(e,t,n,r,i,a){e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+r,
1203n,t+r,n+i,a),e.arcTo(t+r,n+i,t,n+i,a),e.arcTo(t,n+i,t,n,a),e.arcTo(t,n,t+r,n,a),e.closePath()}function _I(e,t,n){let r=[];for(let i of String(t).split(` 1204`)){let t=``;for(let a of i.split(/\s+/).filter(Boolean)){let i=t?t+` `+a:a;t&&e.measureText(i).width>n?(r.push(t),t=a):t=i}r.push(t)}return r}function _Ee(e,t,n={}){let{w:r,h:i}=mI;e.clearRect(0,0,r,i),gI(e,4,4,r-8,i-8,28),e.fillStyle=hI.bg,e.fill(),e.lineWidth=3,e.strokeStyle=hI.border,e.stroke(),e.textBaseline=`alphabetic`,e.font=`600 22px system-ui, sans-serif`,e.fillStyle=hI.dim,e.textAlign=`left`,e.fillText(t.title.toUpperCase(),40,50),e.textAlign=`right`,e.fillText(`${t.index+1} / ${t.total}`,r-40,50);let a=(r-80-(t.total-1)*6)/t.total;for(let n=0;n<t.total;n++)e.fillStyle=n<=t.index?hI.accent:hI.border,e.fillRect(40+n*(a+6),62,a,5);let o=!!n.art,s=o?470:r-80;e.textAlign=`left`,e.fillStyle=hI.title,e.font=`700 40px system-ui, sans-serif`;let c=118;for(let n of _I(e,t.step.title,r-80).slice(0,2))e.fillText(n,40,c),c+=46;e.fillStyle=hI.body,e.font=`400 27px system-ui, sans-serif`,c+=6;let l=_I(e,t.step.body,s),u=Math.floor((470-c)/36);for(let t of l.slice(0,u))e.fillText(t,40,c),c+=36;if(o&&n.art){let t=r-40-440,i=n.artW||432,a=n.artH||308,o=Math.min(440/i,330/a);e.drawImage(n.art,t+(440-i*o)/2,96,i*o,a*o)}t.step.hint&&(e.font=`700 30px system-ui, sans-serif`,e.fillStyle=hI.accent,e.fillText(`â `+t.step.hint,40,508),e.font=`400 22px system-ui, sans-serif`,e.fillStyle=hI.dim,e.textAlign=`right`,e.fillText(t.last?`or press Done`:`or press Next`,r-40,508),e.textAlign=`left`);let d=[{id:`skip`,x:40,y:548,w:130,h:60,label:`Skip`},{id:`never`,x:184,y:548,w:268,h:60,label:`Don't show again`}];t.first||d.push({id:`back`,x:r-40-190-14-160,y:548,w:160,h:60,label:`Back`}),d.push({id:`next`,x:r-40-190,y:548,w:190,h:60,label:t.last?`Done`:`Next`});for(let t of d){let r=n.hover===t.id,i=t.id===`next`;gI(e,t.x,t.y,t.w,t.h,14),e.fillStyle=i?r?hI.primaryHover:hI.primary:r?hI.buttonHover:hI.button,e.fill(),r&&(e.lineWidth=3,e.strokeStyle=hI.accent,e.stroke()),e.font=`${i?700:500} 26px system-ui, sans-serif`,e.fillStyle=i?`#ffffff`:hI.body,e.textAlign=`center`,e.fillText(t.label,t.x+t.w/2,t.y+39)}return e.textAlign=`left`,d}function vEe(e,t){let n=t.x*mI.w,r=(1-t.y)*mI.h;return e.find(e=>n>=e.x&&n<=e.x+e.w&&r>=e.y&&r<=e.y+e.h)??null}var vI={id:`tour:vr`,group:`settings`,order:25},yI={w:.6,h:.375},bI=.9,xI=.12,SI=.6,CI=null,wI=null,TI=null,EI=[],DI=[null,null],OI={left:{trigger:!1,grip:!1,stick:!1},right:{trigger:!1,grip:!1,stick:!1}},kI=!1,AI=``,jI=NaN,yEe={following:!1},MI=0,NI={presses:0,lastPress:null,draws:0,signals:[],drawn:null},PI=new Map;function bEe(e){let t=PI.get(e);return t||(t=new Image,t.onload=()=>{AI=``},t.src=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(e),PI.set(e,t),PI.size>24&&PI.delete(PI.keys().next().value)),t.complete&&t.naturalWidth>0?t:null}var xEe=()=>{try{return!!window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}};function SEe(){return CI||typeof document>`u`?CI:(wI=document.createElement(`canvas`),wI.width=mI.w,wI.height=mI.h,TI=new wr(wI),TI.colorSpace=sr,TI.anisotropy=4,CI=new Nt(new nn(yI.w,yI.h),new bn({map:TI,transparent:!0,side:2,depthWrite:!1})),CI.name=`vr-tour-panel`,CI.visible=!1,CI)}function CEe(){let e=U(xi);if(!e?.xr?.isPresenting)return null;let t=e.xr.getCamera();return t.updateMatrixWorld?.(!0),{position:t.getWorldPosition(new hn),quaternion:t.getWorldQuaternion(new zt)}}var FI=null,II=new rt;function wEe(e,t){II.setFromQuaternion(e.quaternion,`YXZ`);let n=II.y;if(xEe()){let e=Number.isFinite(jI)?Math.atan2(Math.sin(n-jI),Math.cos(n-jI)):1/0;Math.abs(e)>35*Math.PI/180&&(jI=n)}else jI=_he(jI,n,t,yEe);CI.position.set(e.position.x-Math.sin(jI)*bI,e.position.y-xI,e.position.z-Math.cos(jI)*bI),CI.rotation.set(0,jI,0),CI.updateMatrixWorld(!0)}function LI(e){let t=U(xi)?.xr?.getController(e);if(!t)return null;let n=new Wn,r=new fr().extractRotation(t.matrixWorld);return n.ray.origin.setFromMatrixPosition(t.matrixWorld),n.ray.direction.set(0,0,-1).applyMatrix4(r),n}function TEe(e){if(!CI?.visible||e<0)return null;let t=LI(e)?.intersectObject(CI,!1)[0];return t?.uv?vEe(EI,t.uv):null}function RI(e){return!CI?.visible||e<0?!1:!!LI(e)?.intersectObject(CI,!1).length}function zI(e){NI.presses++,NI.lastPress=e,e===`skip`?Cx.skip():e===`never`?Cx.dontShowAgain():e===`back`?Cx.back():Cx.next()}function BI(e,t){NI.signals.push(e),Cx.signal(e)&&q_(.4,40,t,!0)}function EEe(e,t){let n=e.step.controls,r=n?fI({family:t,lit:pI(n)}):null,i=r?bEe(r):null,a=[e.id,e.index,e.total,e.step.title,e.step.body,t,DI[0],DI[1],!!i].join(`|`);if(a===AI)return;AI=a;let o=wI?.getContext(`2d`);o&&(EI=_Ee(o,e,{art:i,artW:432,artH:308,hover:DI[0]??DI[1],family:t}
1204),TI.needsUpdate=!0,NI.draws++,NI.drawn={hint:e.step.hint,body:e.step.body,lit:n?pI(n):null})}function DEe(){let e=U(wx),t=U(xi)?.xr?.getSession?.(),n=!!e&&e.surface===`vr`&&!e.preview&&!!t&&U(wi);if(!CI)return;if(!n){CI.visible=!1,jI=NaN;return}let r=U(Pi);r&&CI.parent!==r&&r.add(CI);let i=performance.now(),a=MI?Math.min(.1,(i-MI)/1e3):1/72;MI=i;let o=FI??CEe();o&&wEe(o,a),CI.visible=!!o;let s=dEe(t);s!==`generic`&&nt.getItem(`tourControllerFamily`)!==s&&nt.setItem(Fhe,s);let c=s===`generic`?nt.getItem(`tourControllerFamily`)||`quest3`:s;for(let e of[...t.inputSources??[]]){let t=e?.handedness;if(t!==`left`&&t!==`right`||!e.gamepad)continue;let n=$_(t);if(n<0||n>1)continue;let r=TEe(n);DI[n]=r?.id??null;let i=e.gamepad,a=sb(`select`,e),o=sb(`grab`,e),s=Math.hypot(i.axes?.[2]??0,i.axes?.[3]??0)>SI,c=OI[t];a&&!c.trigger&&(r?zI(r.id):RI(n)||BI(`vr-trigger`,t)),o&&!c.grip&&BI(`vr-grip`,t),s&&!c.stick&&BI(`vr-move`,t),c.trigger=a,c.grip=o,c.stick=s}let l=U(wx);l&&l.surface===`vr`?EEe(l,c):CI.visible=!1}function VI(){let e=SEe();if(!e)return()=>{};let t=[Mue(e),Uh(DEe),Hh({start:e=>RI(e)?(kI=!0,!0):!1,swallow:()=>kI?(kI=!1,!0):!1}),wx.subscribe(()=>{AI=``})];return ufe({...vI,label:`Welcome tour`,icon:`compass`,closes:!0,action:()=>Cx.start(Mx,{from:`start`})}),t.push(()=>ffe(vI.id,vI.group)),()=>{for(let e of t)e();e.parent?.remove(e),e.visible=!1;for(let e of[`left`,`right`])OI[e]={trigger:!1,grip:!1,stick:!1}}}function OEe(e){FI=e?{position:new hn(...e.position),quaternion:new zt().setFromEuler(new rt(0,e.yaw??0,0,`YXZ`))}:null,jI=NaN}function kEe(){let e=e=>{let t=EI.find(t=>t.id===e);if(!t||!CI)return null;let n=(t.x+t.w/2)/mI.w,r=(t.y+t.h/2)/mI.h;return CI.localToWorld(new hn((n-.5)*yI.w,(.5-r)*yI.h,0)).toArray()};return{visible:!!CI?.visible,position:CI?CI.position.toArray():null,yaw:jI,hover:DI.slice(),buttons:EI.map(e=>e.id),points:Object.fromEntries([`skip`,`never`,`back`,`next`].map(t=>[t,e(t)])),canvas:wI,...NI,signals:NI.signals.slice()}}var HI=`xrOfferSession`,UI=`xrOfferDeclined`,WI=Ue(!1),GI=Ue(nt.getItem(HI)!==`false`),KI=nt.getItem(HI)===`false`;GI.subscribe(e=>{nt.setItem(HI,e?`true`:`false`),e&&KI&&nt.removeItem(UI),KI=!e,e||WI.set(!1)});function qI(e){return!e.hasOffer||!e.supported||!e.enabled||e.declined||e.settled?!1:e.passthrough?`immersive-ar`:`immersive-vr`}var JI={installed:!1,settled:!1,outcome:null,offers:0,mode:null};function YI({passthrough:e,vrMode:t}){let n=(typeof navigator<`u`?navigator:null)?.xr;if(JI.installed||!n||typeof n.offerSession!=`function`)return()=>{};JI.installed=!0;let r=n.offerSession;n.offerSession=function(...e){JI.offers++,JI.mode=e[0];let t=r.apply(n,e);return Promise.resolve(t).then(()=>i(`accepted`),e=>{e?.name===`NotAllowedError`&&nt.setItem(UI,String(Date.now())),i(e?.name===`NotAllowedError`?`declined`:`cancelled`)}),t};function i(e){JI.settled=!0,JI.outcome=JI.outcome??e,WI.set(!1)}let a=!0,o={},s=async()=>{let t=U(e)?`immersive-ar`:`immersive-vr`;if(!(t in o))try{o[t]=!!await n.isSessionSupported(t)}catch{o[t]=!1}if(!a)return;let r=qI({hasOffer:!0,supported:o[t],enabled:U(GI),declined:!!nt.getItem(UI),settled:JI.settled,passthrough:U(e)});U(WI)&&r||WI.set(r)},c=[e.subscribe(()=>void s()),GI.subscribe(()=>void s()),t.subscribe(e=>{e&&i(`session`)})];return()=>{a=!1;for(let e of c)e();n.offerSession=r,JI.installed=!1,WI.set(!1)}}function AEe(){return{...JI,mode:U(WI),lastOffered:JI.mode}}function jEe(e,t){Ce(t,!1),_e(()=>{let e=VI(),t=YI({passthrough:$r,vrMode:wi});return()=>{e(),t()}}),R(),ue()}var XI=V(`<!> <!>`,1),MEe=V(`<!> <!> <!>`,1);function NEe(e,t){Ce(t,!1);let n=()=>z(hP,`$measurement`,r),[r,i]=Ve(),a=F(),o=F(),s=F(),c=F(),l=F(),{camera:u}=Ww(),f=F(),p=new hn;Kw(()=>{Q(f)&&(u.current.getWorldPosition(p),Q(f).lookAt(p))}),d(()=>n(),()=>{I(a,n()?.a??null)}),d(()=>n(),()=>{I(o,n()?.b??null)}),d(()=>(Q(a),Q(o),Dn),()=>{I(s,Q(a)&&Q(o)?new hn().fromArray(Q(a)).distanceTo(new hn().fromArray(Q(o))):0)}),d(()=>(Q(a),Q(o)),()=>{I(c,Q(a)&&Q(o)?[(Q(a)[0]+Q(o)[0])/2,(Q(a)[1]+Q(o)[1])/2+.25,(Q(a)[2]+Q(o)[2])/2]:[0,0,0])}),d(()=>(Q(a),Q(o)),()=>{I(l,(()=>{let e=new ft;return Q(a)&&Q(o)&&e.setFromPoints([new hn().fromArray(Q(a)),new hn().fromArray(Q(o))]),e})())}),h(),R();var m=XI(),_=N(m),v=e=>{Uw.Mesh(e,{get position(){return Q(a)},children:(e,t)=>{var n=XI(),r=N(n);Uw.SphereGeometry(r,{args:[.06,10,10]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#ff4000`,depthTest:!1}),X(e,n)},$$slots:{default:!0}})};G(_,e=>{Q(a)&&e(v)}
1204);var y=g(_,2),b=e=>{var t=MEe(),n=N(t);Uw.Mesh(n,{get position(){return Q(o)},children:(e,t)=>{var n=XI(),r=N(n);Uw.SphereGeometry(r,{args:[.06,10,10]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#ff4000`,depthTest:!1}),X(e,n)},$$slots:{default:!0}});var r=g(n,2);Uw.Line(r,{get geometry(){return Q(l)},children:(e,t)=>{Uw.LineBasicMaterial(e,{color:`#ff4000`,depthTest:!1})},$$slots:{default:!0}});var i=g(r,2);Uw.Group(i,{get position(){return Q(c)},get ref(){return Q(f)},set ref(e){I(f,e)},children:(e,t)=>{{let t=ze(()=>(Q(s),K(()=>`${Q(s).toFixed(2)} m`)));tD(e,{color:`#ffffff`,outlineColor:`#000000`,outlineWidth:.008,fontSize:.22,anchorX:`center`,anchorY:`middle`,get text(){return Q(t)}})}},$$slots:{default:!0},$$legacy:!0}),X(e,t)};G(y,e=>{Q(a)&&Q(o)&&e(b)}),X(e,m),ue(),i()}var PEe=V(`<!> <!> <!> <!> <!>`,1);function FEe(e,t){Ce(t,!1);let n=()=>z(Ry,`$followingNote`,u),r=()=>z(My,`$showNotePins`,u),i=()=>z(Uy,`$annotations`,u),a=()=>z(Ui,`$objectsGroup`,u),o=()=>z(Pi,`$globalScene`,u),c=()=>z(wi,`$isVRMode`,u),l=()=>z(Fy,`$noteMarkers`,u),[u,f]=Ve(),{camera:p,renderer:m}=Ww(),_=F(),v=F({}),y=new hn,b=new hn,x=.16,S=1.2,C=.95,w=.3;function T(e,t){let n=new Tn,r=e-t;return n.moveTo(-r,-e),n.lineTo(r,-e),n.absarc(r,-r,t,-Math.PI/2,0,!1),n.lineTo(e,r),n.absarc(r,r,t,0,Math.PI/2,!1),n.lineTo(-r,e),n.absarc(-r,r,t,Math.PI/2,Math.PI,!1),n.lineTo(-e,-r),n.absarc(-r,-r,t,Math.PI,Math.PI*1.5,!1),new Sr(n,6)}function E(e,t,n){let r=new Tn;for(let i=0;i<n*2;i++){let a=i%2==0?e:t,o=-Math.PI/2+i*Math.PI/n,s=Math.cos(o)*a,c=Math.sin(o)*a;i===0?r.moveTo(s,c):r.lineTo(s,c)}return r.closePath(),new Sr(r,6)}let D={round:new ht(x,28),square:T(x*.94,x*.3),star:E(x*1.32,x*.66,5)},O=e=>D[e]??D.round,k=new bn({depthTest:!1,transparent:!0}),A=e=>e.color||Wy;Kw(()=>{n()&&bpe()}),Kw(()=>{r()&&(p.current.getWorldPosition(b),i().forEach(e=>{let t=Q(v)[e.id];if(!t)return;let n=a()?.getObjectByProperty(`uuid`,e.objectUuid)??o()?.getObjectByProperty(`uuid`,e.objectUuid);if(!n){t.visible=!1;return}t.visible=!0,n.localToWorld(y.fromArray(e.offset)),t.position.copy(y),t.lookAt(b)}))});let{renderStage:ee}=Dw(),j=.08,M=new hn,te=new hn,ne=new hn,P=new Wn,ie=new Map,ae=0;function L(e,t){let n=a();if(!n)return!1;ne.subVectors(t,e);let r=ne.length();return r<=j?!1:(P.set(e,ne.normalize()),P.near=0,P.far=r-j,P.intersectObject(n,!0).some(e=>{for(let t=e.object;t&&t!==n;t=t.parent)if(!t.visible)return!1;return!0}))}Kw(()=>{if(!r()||c()){l().length&&Fy.set([]);return}let e=p.current,t=m?.domElement;if(!e||!t||!i().length){l().length&&Fy.set([]);return}let n=performance.now(),a=n-ae>120;a&&(ae=n);let o=t.getBoundingClientRect();e.getWorldPosition(b);let s=[];i().forEach((t,n)=>{let r=Q(v)[t.id];if(!r||!r.visible||(r.getWorldPosition(M),te.copy(M).project(e),te.z>=1))return;let i=o.left+(te.x+1)/2*o.width,c=o.top+(1-te.y)/2*o.height;if(i<-80||c<-80||i>window.innerWidth+80||c>window.innerHeight+80)return;a&&ie.set(t.id,L(b,M));let l=b.distanceTo(M);if(l<.35)return;let u=A(t);s.push({id:t.id,number:n+1,color:u,ink:Iy(u),title:Vy(t),author:Hy(t),ts:t.ts,text:t.text||``,px:i,py:c,occluded:ie.get(t.id)??!1,fade:l<.9?.35:1})}),Fy.set(s)},{stage:ee}),d(()=>Q(_),()=>{Ay.set(Q(_)??null)}),h(),R(),Uw.Group(e,{name:`annotation-pins`,get visible(){return r()},get ref(){return Q(_)},set ref(e){I(_,e)},children:(e,t)=>{var n=fe(),r=N(n);B(r,3,i,e=>e.id,(e,t,n)=>{{let r=ze(()=>(Q(t),K(()=>`pin-${Q(t).id}`)));Uw.Group(e,{oncreate:e=>re(v,Q(v)[Q(t).id]=e),get name(){return Q(r)},children:(e,r)=>{var i=fe(),a=N(i),o=e=>{Uw.Group(e,{position:[0,0,.06],children:(e,r)=>{var i=PEe(),a=N(i);{let e=ze(()=>(Q(t),K(()=>O(Q(t).shape))));Uw.Mesh(a,{get geometry(){return Q(e)},scale:S,position:[0,0,-.002],renderOrder:870,children:(e,n)=>{{let n=ze(()=>(s(jy),Q(t),K(()=>jy(A(Q(t))))));Uw.MeshBasicMaterial(e,{get color(){return Q(n)},transparent:!0,opacity:w,depthTest:!1,depthWrite:!1,get side(){return s(Dn),K(()=>2)}})}},$$slots:{default:!0}})}var o=g(a,2);{let e=ze(()=>(Q(t),K(()=>O(Q(t).shape))));Uw.Mesh(o,{get geometry(){return Q(e)},renderOrder:871,children:(e,n)=>{{let n=ze(()=>(Q(t),K(()=>A(Q(t)))));Uw.MeshBasicMaterial(e,{get color(){return Q(n)},transparent:!0,opacity:w,depthTest:!1,depthWrite:!1,get side(){return s(Dn),K(()=>2)}})}},$$slots:{default:!0}})}var c=g(o,2);{let e=ze(()=>(Q(t),K(()=>O(Q(t).shape))));Uw.Mesh(c,{get geometry(){return Q(e)},scale:S,position:[0,0,-.002],renderOrder:880,children:(e,n)=>{{let n=ze(()=>(s(jy),Q(t),K(()=>jy(A(Q(t))))));Uw.MeshBasicMaterial(e,{get color(){return Q(n)},transparent:!0,opacity:C,get side(){return s(Dn),K(()=>2)}})}},$$slots:{default:!0}})}var l=g(c,2);{let e=ze(()=>(Q(t),K(()=>O(Q(t).shape))));Uw.Mesh(l,{get geometry(){return Q(e)},renderOrder:881,children:(e,n)=>{{let n=ze(()=>(Q(t),K(()=>A(Q(t)))));Uw.MeshBasicMaterial(e,{get color(){return Q(n)},transparent:!0,opacity:C,get side(){return s(Dn),K(()=>2)}})}},$$slots:{default:!0}})}var u=g(l,2);{let e=ze(()=>(s(Iy),Q(t),K(()=>Iy(A(Q(t)))))),r=ze(()=>(s(Iy),Q(t),K(()=>Iy(A(Q(t)))===`#1c1917`?`#ffffff`:`#000000`))),i=ze(()=>(s(Q(n)),K(()=>String(Q(n)+1))));tD(u,{get color(){return Q(e)},get outlineColor(){return Q(r)}
1204,outlineWidth:.006,outlineOpacity:.6,get material(){return k},renderOrder:910,fontSize:.16,anchorX:`center`,anchorY:`middle`,position:[0,0,.004],get text(){return Q(i)}})}X(e,i)},$$slots:{default:!0}})};G(a,e=>{c()&&e(o)}),X(e,i)},$$slots:{default:!0}})}}),X(e,n)},$$slots:{default:!0},$$legacy:!0}),ue(),f()}var ZI=V(`<!> <!>`,1),IEe=V(`<!> <!> <!> <!> <!> <!> <!>`,1);function LEe(e,t){Ce(t,!1);let n=()=>z(Xy,`$pings`,r),[r,i]=Ve(),a=e=>e.color??gh(e.peerId),o={},s=(e,t)=>n=>{(o[e]??={})[t]=n};Kw(()=>{let e=Date.now();n().forEach(t=>{let n=o[t.id];if(!n)return;let r=e-t.ts,i=1-r/eb,a=r%900/900,s=(r+450)%900/900;if(n.ringA){let e=.3+a*2.4;n.ringA.scale.set(e,e,e),n.ringA.material&&(n.ringA.material.opacity=.9*(1-a)*i)}if(n.ringB){let e=.3+s*2.4;n.ringB.scale.set(e,e,e),n.ringB.material&&(n.ringB.material.opacity=.5*(1-s)*i)}if(n.glow?.material&&(n.glow.material.opacity=(.25+.15*Math.sin(r/120))*i),n.beam?.material&&(n.beam.material.opacity=.55*i),n.beamOuter?.material&&(n.beamOuter.material.opacity=.18*i),n.spark){let e=.12+.1*(1-Math.min(r/600,1));n.spark.scale.set(e,e,e),n.spark.rotation.y=r/300,n.spark.material&&(n.spark.material.opacity=i)}})}),R();var c=fe(),l=N(c);B(l,1,n,e=>e.id,(e,t)=>{Uw.Group(e,{get position(){return Q(t).pos},children:(e,n)=>{var r=IEe(),i=N(r);{let e=ze(()=>s(Q(t).id,`ringA`));Uw.Mesh(i,{"rotation.x":-Math.PI/2,get oncreate(){return Q(e)},children:(e,n)=>{var r=ZI(),i=N(r);Uw.RingGeometry(i,{args:[.42,.5,40]});var o=g(i,2);{let e=ze(()=>a(Q(t)));Uw.MeshBasicMaterial(o,{get color(){return Q(e)},transparent:!0,get side(){return 2},depthTest:!1})}X(e,r)},$$slots:{default:!0}})}var o=g(i,2);{let e=ze(()=>s(Q(t).id,`ringB`));Uw.Mesh(o,{"rotation.x":-Math.PI/2,get oncreate(){return Q(e)},children:(e,n)=>{var r=ZI(),i=N(r);Uw.RingGeometry(i,{args:[.46,.5,40]});var o=g(i,2);{let e=ze(()=>a(Q(t)));Uw.MeshBasicMaterial(o,{get color(){return Q(e)},transparent:!0,get side(){return 2},depthTest:!1})}X(e,r)},$$slots:{default:!0}})}var c=g(o,2);{let e=ze(()=>s(Q(t).id,`glow`));Uw.Mesh(c,{"rotation.x":-Math.PI/2,"position.y":.01,get oncreate(){return Q(e)},children:(e,n)=>{var r=ZI(),i=N(r);Uw.CircleGeometry(i,{args:[.55,40]});var o=g(i,2);{let e=ze(()=>a(Q(t)));Uw.MeshBasicMaterial(o,{get color(){return Q(e)},transparent:!0,get blending(){return 2},get side(){return 2},depthWrite:!1,depthTest:!1})}X(e,r)},$$slots:{default:!0}})}var l=g(c,2);{let e=ze(()=>s(Q(t).id,`beam`));Uw.Mesh(l,{"position.y":1,get oncreate(){return Q(e)},children:(e,n)=>{var r=ZI(),i=N(r);Uw.CylinderGeometry(i,{args:[.015,.03,2,8,1,!0]});var o=g(i,2);{let e=ze(()=>a(Q(t)));Uw.MeshBasicMaterial(o,{get color(){return Q(e)},transparent:!0,depthTest:!1})}X(e,r)},$$slots:{default:!0}})}var u=g(l,2);{let e=ze(()=>s(Q(t).id,`beamOuter`));Uw.Mesh(u,{"position.y":1,get oncreate(){return Q(e)},children:(e,n)=>{var r=ZI(),i=N(r);Uw.CylinderGeometry(i,{args:[.06,.14,2,10,1,!0]});var o=g(i,2);{let e=ze(()=>a(Q(t)));Uw.MeshBasicMaterial(o,{get color(){return Q(e)},transparent:!0,get blending(){return 2},get side(){return 2},depthWrite:!1,depthTest:!1})}X(e,r)},$$slots:{default:!0}})}var d=g(u,2);{let e=ze(()=>s(Q(t).id,`spark`));Uw.Mesh(d,{"position.y":.12,get oncreate(){return Q(e)},children:(e,t)=>{var n=ZI(),r=N(n);Uw.OctahedronGeometry(r,{args:[1,0]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#ffffff`,transparent:!0,depthTest:!1}),X(e,n)},$$slots:{default:!0}})}tD(g(d,2),{color:`white`,outlineColor:`#000000`,outlineWidth:.01,fontSize:.25,anchorX:`center`,position:[0,2.2,0],get text(){return Q(t).name}}),X(e,r)},$$slots:{default:!0}})}),X(e,c),ue(),i()}function REe(e,t){Ce(t,!1);let n=()=>z(Ui,`$objectsGroup`,i),r=()=>z(Xy,`$pings`,i),[i,a]=Ve(),o=F(new Pn);re(o,Q(o).name=`ping-highlights`);let s=new Map;Kw(()=>{let e=n(),t=Date.now(),i=new Map;if(e)for(let t of r()){if(!t.uuid)continue;let n=e.getObjectByProperty(`uuid`,t.uuid);n&&i.set(t.id,{ping:t,target:n})}for(let[e,t]of s)i.has(e)||(Q(o).remove(t),t.dispose?.(),s.delete(e));for(let[e,{ping:n,target:r}]of i){let i=s.get(e);i||(i=new kn(new Or,new ot(n.color||`#4f83cc`)),i.material.transparent=!0,i.material.depthTest=!1,i.renderOrder=9998,s.set(e,i),Q(o).add(i)),i.box.setFromObject(r);let a=(t-n.ts)/eb;i.material.opacity=.85*Math.max(0,1-a)*(.6+.4*Math.cos(a*Math.PI*6))}}),R(),Uw(e,{get is(){return Q(o)}}),ue(),a()}var QI=V(`<!> <!>`,1);function zEe(e,t){Ce(t,!1);let n=()=>z(Oc,`$flowNodes`,o),r=()=>z(iN,`$pathCaptureNode`,o),i=()=>z(Ki,`$orbitControls`,o),a=()=>z(Ui,`$objectsGroup`,o),[o,s]=Ve(),c=F(),l=F(),u=F(),f=F(),{camera:m,renderer:_}=Ww(),v=F(),y=F(),b=new Wn,x=new Tr(new hn(0,1,0),0),S=-1,C=0;function w(e){let t=_.domElement.getBoundingClientRect();b.setFromCamera(new yn((e.clientX-t.left)/t.width*2-1,-((e.clientY-t.top)/t.height)*2+1),m.current)}function T(e){return Q(y)?(w(e),b.intersectObject(Q(y),!0).find(e=>e.object.userData.wpIndex!=null)??null):null}function E(e){if(!Q(c)||e.button!==0)return;let t=T(e);t&&(S=t.object.userData.wpIndex,i()&&me(Ki,K(i).enabled=!1,K(i)))}function D(e){if(S<0||!Q(c))return;let t=performance.now();if(t-C<60)return;C=t,w(e);let n=a(),r=n?b.intersectObjects(n.children,!0):[],i=new hn,o=r[0]?.point??(b.ray.intersectPlane(x,i)?i:null);o&&nu(Q(c).id,{points:Q(l).map((e,t)=>t===S?[o.x,o.y,o.z]:e)})}function O(){S<0||(S=-1,i()&&me(Ki,K(i).enabled=!0,K(i)))}function k(e){if(!Q(c))return;let t=T(e);
1204t&&(e.preventDefault(),nu(Q(c).id,{points:Q(l).filter((e,n)=>n!==t.object.userData.wpIndex)}))}d(()=>(n(),r()),()=>{I(c,n().find(e=>e.type===`pathpatrol`&&(e.id===r()||e.selected))??null)}),d(()=>Q(c),()=>{I(l,Q(c)?.data.points??[])}),d(()=>Q(c),()=>{I(u,(Q(c)?.data.mode??`loop`)===`loop`)}),d(()=>(Q(l),Q(u),Dn),()=>{I(f,Q(l).length>=2?[...Q(l),...Q(u)?[Q(l)[0]]:[]].map(e=>new hn(e[0],e[1],e[2])):[])}),d(()=>(Q(v),Q(f)),()=>{Q(v)&&(Q(v).geometry.dispose(),re(v,Q(v).geometry=new ft().setFromPoints(Q(f))))}),h(),R();var A=fe();Z(`pointerdown`,p,E),Z(`pointermove`,p,D),Z(`pointerup`,p,O),Z(`contextmenu`,p,k);var ee=N(A),j=e=>{var t=QI(),n=N(t);Uw.Group(n,{name:`path-waypoints`,get ref(){return Q(y)},set ref(e){I(y,e)},children:(e,t)=>{var n=fe(),r=N(n);B(r,1,()=>Q(l),Be,(e,t,n)=>{var r=QI(),i=N(r);{let e=ze(()=>(Q(t),K(()=>[Q(t)[0],Q(t)[1],Q(t)[2]])));Uw.Mesh(i,{get position(){return Q(e)},userData:{wpIndex:n},renderOrder:5,children:(e,t)=>{var n=QI(),r=N(n);Uw.SphereGeometry(r,{args:[.09,12,10]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#ff8800`,depthTest:!1,transparent:!0,opacity:.9}),X(e,n)},$$slots:{default:!0}})}var a=g(i,2);{let e=ze(()=>(Q(t),K(()=>[Q(t)[0],Q(t)[1]+.28,Q(t)[2]]))),r=ze(()=>K(()=>String(n+1)));tD(a,{get position(){return Q(e)},get text(){return Q(r)},fontSize:.2,anchorX:`center`,color:`#ffbb66`})}X(e,r)}),X(e,n)},$$slots:{default:!0},$$legacy:!0});var r=g(n,2),i=e=>{Uw.Line(e,{renderOrder:4,get ref(){return Q(v)},set ref(e){I(v,e)},children:(e,t)=>{Uw.LineBasicMaterial(e,{color:`#ff8800`,transparent:!0,opacity:.8,depthTest:!1})},$$slots:{default:!0},$$legacy:!0})};G(r,e=>{Q(f),K(()=>Q(f).length>=2)&&e(i)}),X(e,t)};G(ee,e=>{Q(c),Q(l),K(()=>Q(c)&&Q(l).length>0)&&e(j)}),X(e,A),ue(),s()}function BEe(e,t){Ce(t,!1);let n=()=>z(dl,`$editorHelpersShown`,o),r=()=>z(Es,`$peers`,o),i=()=>z(Ui,`$objectsGroup`,o),a=()=>z(Ci,`$lockedObjects`,o),[o,s]=Ve(),c=F(new Pn);re(c,Q(c).name=`lock-highlights`);let l=new Map;Kw(()=>{re(c,Q(c).visible=n());let e=r(),t=i(),o=new Map;if(t&&e)for(let[n,r]of a()){if(n===e.peer?.id)continue;let i=t.getObjectByProperty(`uuid`,r);i&&o.set(n+`:`+r,{holder:n,target:i})}for(let[e,t]of l)o.has(e)||(Q(c).remove(t),t.dispose?.(),l.delete(e));for(let[e,{holder:t,target:n}]of o){let r=l.get(e);r||(r=new kn(new Or,new ot(gh(t))),l.set(e,r),Q(c).add(r)),r.box.setFromObject(n)}}),R(),Uw(e,{get is(){return Q(c)}}),ue(),s()}var $I=`gridSettings`,eL={cellSize:1,matchSnapStep:!1,sectionEvery:10,cellColor:`#484d55`,sectionColor:`#77808d`,fadeMode:`auto`,fadeDistance:400,fadeStrength:1.5,infinite:!0,size:100,follow:`off`,showAxes:!1};function VEe(){try{let e=typeof localStorage<`u`?nt.getItem($I):null,t=e?JSON.parse(e):{},n={...eL,...t};return t.followCamera!==void 0&&t.follow===void 0&&(n.follow=t.followCamera?`lookat`:`off`),delete n.followCamera,n}catch{return{...eL}}}var tL=Ue(VEe());tL.subscribe(e=>{typeof localStorage<`u`&&nt.setItem($I,JSON.stringify(e))});function nL(e){tL.update(t=>({...t,...e}))}function rL(){tL.set({...eL})}function iL(e,t){let n=t??U(_c).translate,r=e.matchSnapStep?n:e.cellSize;return r>0?r:1}var aL=V(`<!> <!>`,1);function oL(e,n){Ce(n,!0);let r=()=>z(Ki,`$orbitControls`,s),i=()=>z(tL,`$gridSettings`,s),a=()=>z(_c,`$snapSettings`,s),o=()=>z(dl,`$editorHelpersShown`,s),[s,c]=Ve(),{camera:l}=Ww(),u=t(100),d=t(0),f=t(0);Kw(()=>{let e=l.current;if(!e)return;let t=r();if(i().fadeMode===`auto`){let n=t?.target?e.position.distanceTo(t.target):e.position.length();I(u,Math.min(Math.max(100,n*1.6),5e3),!0)}if(i().follow!==`lookat`||!t?.target){I(d,0),I(f,0);return}let n=Math.max(.001,Q(m));I(d,Math.round(t.target.x/n)*n),I(f,Math.round(t.target.z/n)*n)});let p=q(()=>iL(i(),a().translate)),m=q(()=>Q(p)*Math.max(1,i().sectionEvery)),h=q(()=>i().fadeMode===`auto`?Q(u):i().fadeDistance);var _=aL(),v=N(_),y=e=>{{let t=q(()=>i().infinite?void 0:[i().size,i().size]),n=q(()=>i().follow===`camera`),r=q(()=>[Q(d),0,Q(f)+.03]);cbe(e,{name:`editor-grid`,get infiniteGrid(){return i().infinite},get gridSize(){return Q(t)},get followCamera(){return Q(n)},renderOrder:9999,get position(){return Q(r)}
1204,get cellSize(){return Q(p)},get sectionSize(){return Q(m)},get cellColor(){return i().cellColor},get sectionColor(){return i().sectionColor},sectionThickness:1.2,get fadeDistance(){return Q(h)},get fadeStrength(){return i().fadeStrength}})}};G(v,e=>{n.showGrid&&o()&&e(y)});var b=g(v,2),x=e=>{var t=fe(),n=N(t);{let e=q(()=>[Math.max(2,Q(m))]);P(n,()=>Uw.AxesHelper,(t,n)=>{n(t,{get args(){return Q(e)}})})}X(e,t)};G(b,e=>{i().showAxes&&e(x)}),X(e,_),ue(),c()}var sL=Ue({}),cL=``;function lL(e){let t=e&&typeof e==`object`?e:{},n=t.overrides&&typeof t.overrides==`object`?t.overrides:{},r=t.look&&typeof t.look==`object`?t.look:{};return{...t,camera:typeof t.camera==`string`&&t.camera?t.camera:null,mode:typeof t.mode==`string`&&t.mode?t.mode:`shaded`,overrides:{...n},look:{...r}}}function uL(){let e=U(mc);return lL({camera:U(px)?.uuid??null,mode:U(ii),overrides:{post:e.post!==!1,shaders:e.shaders!==!1},look:{...U(by)}})}function dL(e){let t=U(Es);t?.peer?.id&&t.send({type:`lookstate`,peerId:t.peer.id,...e})}function fL(e=!1){let t=uL(),n=JSON.stringify(t);return!e&&n===cL?!1:(cL=n,dL(t),!0)}function pL(){dL(uL())}function mL(e){if(!e?.peerId)return;let t=lL(e);sL.update(n=>({...n,[e.peerId]:t}))}function hL(e){sL.update(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})}function gL(e){return U(sL)[e]??null}function _L(e){let t=gL(e);return t?t.overrides.post===!1?`they have the scene look switched off`:``:`showing your own look â they have not shared theirs`}typeof window<`u`&&(ii.subscribe(()=>fL()),mc.subscribe(()=>fL()),by.subscribe(()=>fL()),px.subscribe(()=>fL()));function HEe(){return{mine:uL(),peers:{...U(sL)}}}function vL(e){return e&&e.__esModule?e.default:e}var UEe=new class extends ft{boundingSphere=new $t;constructor(){super(),this.setAttribute(`position`,new Qt(new Float32Array([-1,-1,3,-1,-1,3]),2)),this.setAttribute(`uv`,new Qt(new Float32Array([0,0,2,0,0,2]),2))}computeBoundingSphere(){}},WEe=new An,yL=class{constructor(e){this._mesh=new Nt(UEe,e),this._mesh.frustumCulled=!1}render(e){e.render(this._mesh,WEe)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}dispose(){this._mesh.material.dispose(),this._mesh.geometry.dispose()}},GEe={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},sceneNormal:{value:null},projMat:{value:new fr},viewMat:{value:new fr},projViewMat:{value:new fr},projectionMatrixInv:{value:new fr},viewMatrixInv:{value:new fr},cameraPos:{value:new hn},resolution:{value:new yn},biasAdjustment:{value:new yn},time:{value:0},samples:{value:[]},bluenoise:{value:null},distanceFalloff:{value:1},radius:{value:5},near:{value:.1},far:{value:1e3},ortho:{value:!1},screenSpaceRadius:{value:!1},frame:{value:0}},depthWrite:!1,depthTest:!1,vertexShader:` 1205varying vec2 vUv; 1206void main() { 1207 vUv = uv; 1208 gl_Position = vec4(position, 1); 1209}`,fragmentShader:` 1210 #define SAMPLES 16 1211 #define FSAMPLES 16.0
1212uniform sampler2D sceneDiffuse; 1213uniform highp sampler2D sceneNormal; 1214uniform highp sampler2D sceneDepth; 1215uniform mat4 projectionMatrixInv; 1216uniform mat4 viewMatrixInv; 1217uniform mat4 projMat; 1218uniform mat4 viewMat; 1219uniform mat4 projViewMat; 1220uniform vec3 cameraPos; 1221uniform vec2 resolution; 1222uniform vec2 biasAdjustment; 1223uniform float time; 1224uniform vec3[SAMPLES] samples; 1225uniform float radius; 1226uniform float distanceFalloff; 1227uniform float near; 1228uniform float far; 1229uniform float frame; 1230uniform bool ortho; 1231uniform bool screenSpaceRadius; 1232uniform sampler2D bluenoise; 1233 varying vec2 vUv; 1234 highp float linearize_depth(highp float d, highp float zNear,highp float zFar) 1235 { 1236 return (zFar * zNear) / (zFar - d * (zFar - zNear)); 1237 } 1238 highp float linearize_depth_ortho(highp float d, highp float nearZ, highp float farZ) { 1239 return nearZ + (farZ - nearZ) * d; 1240 } 1241 highp float linearize_depth_log(highp float d, highp float nearZ,highp float farZ) { 1242 float depth = pow(2.0, d * log2(farZ + 1.0)) - 1.0; 1243 float a = farZ / (farZ - nearZ); 1244 float b = farZ * nearZ / (nearZ - farZ); 1245 float linDepth = a + b / depth; 1246 /*return ortho ? linearize_depth_ortho( 1247 linDepth, 1248 nearZ, 1249 farZ 1250 ) :linearize_depth(linDepth, nearZ, farZ);*/ 1251 #ifdef ORTHO 1252 1253 return linearize_depth_ortho(d, nearZ, farZ); 1254 1255 #else 1256 return linearize_depth(linDepth, nearZ, farZ); 1257 #endif 1258 } 1259 1260 vec3 getWorldPosLog(vec3 posS) { 1261 vec2 uv = posS.xy; 1262 float z = posS.z; 1263 float nearZ =near; 1264 float farZ = far; 1265 float depth = pow(2.0, z * log2(farZ + 1.0)) - 1.0; 1266 float a = farZ / (farZ - nearZ); 1267 float b = farZ * nearZ / (nearZ - farZ); 1268 float linDepth = a + b / depth; 1269 vec4 clipVec = vec4(uv, linDepth, 1.0) * 2.0 - 1.0; 1270 vec4 wpos = projectionMatrixInv * clipVec; 1271 return wpos.xyz / wpos.w; 1272 } 1273 float depthToClipZ(float depth) { 1274 #ifdef REVERSEDEPTH 1275 return depth; 1276 #else 1277 return depth * 2.0 - 1.0; 1278 #endif 1279 } 1280 bool isBackgroundDepth(float depth) { 1281 #ifdef REVERSEDEPTH 1282 return depth == 0.0; 1283 #else 1284 return depth == 1.0; 1285 #endif 1286 } 1287 vec3 getWorldPos(float depth, vec2 coord) { 1288 #ifdef LOGDEPTH 1289 #ifndef ORTHO 1290 return getWorldPosLog(vec3(coord, depth)); 1291 #endif 1292 #endif 1293 #ifdef ORTHO 1294 float z = depthToClipZ(depth); 1295 vec4 clipSpacePosition = vec4(coord * 2. - 1., z, 1.); 1296 vec4 viewSpacePosition = projectionMatrixInv * clipSpacePosition; 1297 viewSpacePosition.xyz /= viewSpacePosition.w; 1298 return viewSpacePosition.xyz; 1299 #else 1300 vec2 ndc = coord * 2. - 1.; 1301 float ndcZ = depthToClipZ(depth); 1302 mat4 Q = projectionMatrixInv; 1303 vec3 view = vec3(Q[0][0] * ndc.x + Q[3][0], Q[1][1] * ndc.y + Q[3][1], Q[3][2]); 1304 float invW = 1. / (Q[2][3] * ndcZ + Q[3][3]); 1305 return view * invW; 1306 #endif 1307 } 1308 1309 vec3 computeNormal(vec3 worldPos, vec2 vUv) { 1310 ivec2 p = ivec2(vUv * resolution); 1311 float c0 = texelFetch(sceneDepth, p, 0).x; 1312 float l2 = texelFetch(sceneDepth, p - ivec2(2, 0), 0).x; 1313 float l1 = texelFetch(sceneDepth, p - ivec2(1, 0), 0).x; 1314 float r1 = texelFetch(sceneDepth, p + ivec2(1, 0), 0).x; 1315 float r2 = texelFetch(sceneDepth, p + ivec2(2, 0), 0).x; 1316 float b2 = texelFetch(sceneDepth, p - ivec2(0, 2), 0).x; 1317 float b1 = texelFetch(sceneDepth, p - ivec2(0, 1), 0).x; 1318 float t1 = texelFetch(sceneDepth, p + ivec2(0, 1), 0).x; 1319 float t2 = texelFetch(sceneDepth, p + ivec2(0, 2), 0).x; 1320 1321 float dl = abs((2.0 * l1 - l2) - c0); 1322 float dr = abs((2.0 * r1 - r2) - c0); 1323 float db = abs((2.0 * b1 - b2) - c0); 1324 float dt = abs((2.0 * t1 - t2) - c0); 1325 1326 vec3 ce = getWorldPos(c0, vUv).xyz; 1327 1328 vec3 dpdx = (dl < dr) ? ce - getWorldPos(l1, (vUv - vec2(1.0 / resolution.x, 0.0))).xyz 1329 : -ce + getWorldPos(r1, (vUv + vec2(1.0 / resolution.x, 0.0))).xyz; 1330 vec3 dpdy = (db < dt) ? ce - getWorldPos(b1, (vUv - vec2(0.0, 1.0 / resolution.y))).xyz 1331 : -ce + getWorldPos(t1, (vUv + vec2(0.0, 1.0 / resolution.y))).xyz; 1332 1333 return normalize(cross(dpdx, dpdy)); 1334} 1335 1336mat3 makeRotationZ(float theta) { 1337 float c = cos(theta); 1338 float s = sin(theta); 1339 return mat3(c, - s, 0, 1340 s, c, 0, 1341 0, 0, 1); 1342 } 1343 1344void main() { 1345 vec4 diffuse = texture2D(sceneDiffuse, vUv); 1346 float depth = texture2D(sceneDepth, vUv).x;
1347 if (isBackgroundDepth(depth)) { 1348 gl_FragColor = vec4(vec3(1.0), 1.0); 1349 return; 1350 } 1351 vec3 worldPos = getWorldPos(depth, vUv); 1352 #ifdef HALFRES 1353 vec3 normal = texture2D(sceneNormal, vUv).rgb; 1354 #else 1355 vec3 normal = computeNormal(worldPos, vUv); 1356 #endif 1357 vec4 noise = texture2D(bluenoise, gl_FragCoord.xy / 128.0); 1358 vec2 harmoniousNumbers = vec2( 1359 1.618033988749895, 1360 1.324717957244746 1361 ); 1362 noise.rg += harmoniousNumbers * frame; 1363 noise.rg = fract(noise.rg); 1364 vec3 helperVec = vec3(0.0, 1.0, 0.0); 1365 if (dot(helperVec, normal) > 0.99) { 1366 helperVec = vec3(1.0, 0.0, 0.0); 1367 } 1368 vec3 tangent = normalize(cross(helperVec, normal)); 1369 vec3 bitangent = cross(normal, tangent); 1370 mediump mat3 tbn = mat3(tangent, bitangent, normal) * makeRotationZ( noise.r * 3.1415962 * 2.0) ; 1371 1372 mediump float occluded = 0.0; 1373 mediump float totalWeight = 0.0; 1374 float radiusToUse = screenSpaceRadius ? distance( 1375 worldPos, 1376 getWorldPos(depth, vUv + 1377 vec2(radius, 0.0) / resolution) 1378 ) : radius; 1379 float distanceFalloffToUse =screenSpaceRadius ? 1380 radiusToUse * distanceFalloff 1381 : radiusToUse * distanceFalloff * 0.2; 1382 float bias = (min( 1383 0.1, 1384 distanceFalloffToUse * 0.1 1385 ) / near) * fwidth(distance(worldPos, cameraPos)) / radiusToUse; 1386 bias = biasAdjustment.x + biasAdjustment.y * bias; 1387 mediump float offsetMove = noise.g; 1388 mediump float offsetMoveInv = 1.0 / FSAMPLES; 1389 float farTimesNear = far * near; 1390 float farMinusNear = far - near; 1391 1392 for(int i = 0; i < SAMPLES; i++) { 1393 mediump vec3 sampleDirection = tbn * samples[i]; 1394 1395 float moveAmt = fract(offsetMove); 1396 offsetMove += offsetMoveInv; 1397 vec3 samplePos = worldPos + radiusToUse * moveAmt * sampleDirection; 1398 vec4 offset = projMat * vec4(samplePos, 1.0); 1399 offset.xyz /= offset.w; 1400 offset.xy = offset.xy * 0.5 + 0.5; 1401 #ifndef REVERSEDEPTH 1402 offset.z = offset.z * 0.5 + 0.5; 1403 #endif 1404 1405 if (all(greaterThan(offset.xyz * (1.0 - offset.xyz), vec3(0.0)))) { 1406 float sampleDepth = textureLod(sceneDepth, offset.xy, 0.0).x; 1407 1408 /*#ifdef LOGDEPTH 1409 float distSample = linearize_depth_log(sampleDepth, near, far); 1410 #else 1411 #ifdef ORTHO 1412 float distSample = near + farMinusNear * sampleDepth; 1413 #else 1414 float distSample = (farTimesNear) / (far - sampleDepth * farMinusNear); 1415 #endif 1416 #endif*/ 1417 #ifdef REVERSEDEPTH 1418 float distSample = -getWorldPos(sampleDepth, offset.xy).z; 1419 #else 1420 #ifdef ORTHO 1421 float distSample = near + sampleDepth * farMinusNear; 1422 #else 1423 #ifdef LOGDEPTH 1424 float distSample = linearize_depth_log(sampleDepth, near, far); 1425 #else 1426 float distSample = (farTimesNear) / (far - sampleDepth * farMinusNear); 1427 #endif 1428 #endif 1429 #endif 1430 1431 #ifdef REVERSEDEPTH 1432 float distWorld = -samplePos.z; 1433 #else 1434 #ifdef ORTHO 1435 float distWorld = near + offset.z * farMinusNear; 1436 #else 1437 float distWorld = (farTimesNear) / (far - offset.z * farMinusNear); 1438 #endif 1439 #endif 1440 1441 mediump float rangeCheck = smoothstep(0.0, 1.0, distanceFalloffToUse / (abs(distSample - distWorld))); 1442 vec2 diff = gl_FragCoord.xy - floor(offset.xy * resolution); 1443 occluded += rangeCheck * float(distSample != distWorld) * float(sampleDepth != depth) * step(distSample + bias, distWorld) * step( 1444 1.0, 1445 dot(diff, diff) 1446 ); 1447 1448 totalWeight ++; 1449 } 1450 } 1451 float occ = clamp(1.0 - occluded / (totalWeight == 0.0 ? 1.0 : totalWeight), 0.0, 1.0); 1452 gl_FragColor = vec4(occ, 0.5 + 0.5 * normal); 1453}`},KEe={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},tDiffuse:{value:null},transparencyDWFalse:{value:null},transparencyDWTrue:{value:null},transparencyDWTrueDepth:{value:null},transparencyAware:{value:!1},projMat:{value:new fr},viewMat:{value:new fr},projectionMatrixInv:{value:new fr},resolution:{value:new yn},color:{value:new hn(0,0,0)},blueNoise:{value:null},downsampledDepth:{value:null},time:{value:0},intensity:{value:10},renderMode:{value:0},gammaCorrection:{value:!1},ortho:{value:!1},near:{value:.1},far:{value:1e3},screenSpaceRadius:{value:!1},radius:{value:0},distanceFalloff:{value:1},fog:{value:!1},fogExp:{value:!1},fogDensity:{value:0},fogNear:{value:1/0},fogFar:{value:1/0},colorMultiply:{value:!0},aoTones:{value:0}},depthWrite:!1,depthTest:!1,vertexShader:` 1454 varying vec2 vUv; 1455 void main() { 1456 vUv = uv; 1457 gl_Position = vec4(position, 1); 1458 }`,fragmentShader:`
1459 uniform sampler2D sceneDiffuse; 1460 uniform highp sampler2D sceneDepth; 1461 uniform highp sampler2D downsampledDepth; 1462 uniform highp sampler2D transparencyDWFalse; 1463 uniform highp sampler2D transparencyDWTrue; 1464 uniform highp sampler2D transparencyDWTrueDepth; 1465 uniform sampler2D tDiffuse; 1466 uniform sampler2D blueNoise; 1467 uniform vec2 resolution; 1468 uniform vec3 color; 1469 uniform mat4 projectionMatrixInv; 1470 uniform float intensity; 1471 uniform float renderMode; 1472 uniform float near; 1473 uniform float far; 1474 uniform float aoTones; 1475 uniform bool gammaCorrection; 1476 uniform bool ortho; 1477 uniform bool screenSpaceRadius; 1478 uniform bool fog; 1479 uniform bool fogExp; 1480 uniform bool colorMultiply; 1481 uniform bool transparencyAware; 1482 uniform float fogDensity; 1483 uniform float fogNear; 1484 uniform float fogFar; 1485 uniform float radius; 1486 uniform float distanceFalloff; 1487 varying vec2 vUv; 1488 highp float linearize_depth(highp float d, highp float zNear,highp float zFar) 1489 { 1490 return (zFar * zNear) / (zFar - d * (zFar - zNear)); 1491 } 1492 highp float linearize_depth_ortho(highp float d, highp float nearZ, highp float farZ) { 1493 return nearZ + (farZ - nearZ) * d; 1494 } 1495 highp float linearize_depth_log(highp float d, highp float nearZ,highp float farZ) { 1496 float depth = pow(2.0, d * log2(farZ + 1.0)) - 1.0; 1497 float a = farZ / (farZ - nearZ); 1498 float b = farZ * nearZ / (nearZ - farZ); 1499 float linDepth = a + b / depth; 1500 return ortho ? linearize_depth_ortho( 1501 linDepth, 1502 nearZ, 1503 farZ 1504 ) :linearize_depth(linDepth, nearZ, farZ); 1505 } 1506 vec3 getWorldPosLog(vec3 posS) { 1507 vec2 uv = posS.xy; 1508 float z = posS.z; 1509 float nearZ =near; 1510 float farZ = far; 1511 float depth = pow(2.0, z * log2(farZ + 1.0)) - 1.0; 1512 float a = farZ / (farZ - nearZ); 1513 float b = farZ * nearZ / (nearZ - farZ); 1514 float linDepth = a + b / depth; 1515 vec4 clipVec = vec4(uv, linDepth, 1.0) * 2.0 - 1.0; 1516 vec4 wpos = projectionMatrixInv * clipVec; 1517 return wpos.xyz / wpos.w; 1518 } 1519 float depthToClipZ(float depth) { 1520 #ifdef REVERSEDEPTH 1521 return depth; 1522 #else 1523 return depth * 2.0 - 1.0; 1524 #endif 1525 } 1526 bool isBackgroundDepth(float depth) { 1527 #ifdef REVERSEDEPTH 1528 return depth == 0.0; 1529 #else 1530 return depth == 1.0; 1531 #endif 1532 } 1533 vec3 getWorldPos(float depth, vec2 coord) { 1534 #ifdef LOGDEPTH 1535 #ifndef ORTHO 1536 return getWorldPosLog(vec3(coord, depth)); 1537 #endif 1538 #endif 1539 // } 1540 #ifdef ORTHO 1541 float z = depthToClipZ(depth); 1542 vec4 clipSpacePosition = vec4(coord * 2. - 1., z, 1.); 1543 vec4 viewSpacePosition = projectionMatrixInv * clipSpacePosition; 1544 viewSpacePosition.xyz /= viewSpacePosition.w; 1545 return viewSpacePosition.xyz; 1546 #else 1547 vec2 ndc = coord * 2. - 1.; 1548 float ndcZ = depthToClipZ(depth); 1549 mat4 Q = projectionMatrixInv; 1550 vec3 view = vec3(Q[0][0] * ndc.x + Q[3][0], Q[1][1] * ndc.y + Q[3][1], Q[3][2]); 1551 float invW = 1. / (Q[2][3] * ndcZ + Q[3][3]); 1552 return view * invW; 1553 #endif 1554 } 1555 1556 vec3 computeNormal(vec3 worldPos, vec2 vUv) { 1557 ivec2 p = ivec2(vUv * resolution); 1558 float c0 = texelFetch(sceneDepth, p, 0).x; 1559 float l2 = texelFetch(sceneDepth, p - ivec2(2, 0), 0).x; 1560 float l1 = texelFetch(sceneDepth, p - ivec2(1, 0), 0).x; 1561 float r1 = texelFetch(sceneDepth, p + ivec2(1, 0), 0).x; 1562 float r2 = texelFetch(sceneDepth, p + ivec2(2, 0), 0).x; 1563 float b2 = texelFetch(sceneDepth, p - ivec2(0, 2), 0).x; 1564 float b1 = texelFetch(sceneDepth, p - ivec2(0, 1), 0).x; 1565 float t1 = texelFetch(sceneDepth, p + ivec2(0, 1), 0).x; 1566 float t2 = texelFetch(sceneDepth, p + ivec2(0, 2), 0).x; 1567 1568 float dl = abs((2.0 * l1 - l2) - c0); 1569 float dr = abs((2.0 * r1 - r2) - c0); 1570 float db = abs((2.0 * b1 - b2) - c0); 1571 float dt = abs((2.0 * t1 - t2) - c0); 1572 1573 vec3 ce = getWorldPos(c0, vUv).xyz; 1574 1575 vec3 dpdx = (dl < dr) ? ce - getWorldPos(l1, (vUv - vec2(1.0 / resolution.x, 0.0))).xyz 1576 : -ce + getWorldPos(r1, (vUv + vec2(1.0 / resolution.x, 0.0))).xyz; 1577 vec3 dpdy = (db < dt) ? ce - getWorldPos(b1, (vUv - vec2(0.0, 1.0 / resolution.y))).xyz 1578 : -ce + getWorldPos(t1, (vUv + vec2(0.0, 1.0 / resolution.y))).xyz; 1579 1580 return normalize(cross(dpdx, dpdy)); 1581 } 1582 1583 #include <common> 1584 #include <dithering_pars_fragment> 1585 void main() { 1586 //vec4 texel = texture2D(tDiffuse, vUv);//vec3(0.0); 1587 vec4 sceneTexel = texture2D(sceneDiffuse, vUv); 1588 float depth = texture2D(sceneDepth, vUv).x; 1589 #ifdef HALFRES 1590 vec4 texel = vec4(0.0);
1591 if (isBackgroundDepth(depth)) { 1592 texel = vec4(1.0, 0.0, 0.0, 1.0); 1593 } else { 1594 vec3 worldPos = getWorldPos(depth, vUv); 1595 vec3 normal = computeNormal(getWorldPos(depth, vUv), vUv); 1596 // vec4 texel = texture2D(tDiffuse, vUv); 1597 // Find closest depth; 1598 float totalWeight = 0.0; 1599 float radiusToUse = screenSpaceRadius ? distance( 1600 worldPos, 1601 getWorldPos(depth, vUv + 1602 vec2(radius, 0.0) / resolution) 1603 ) : radius; 1604 float distanceFalloffToUse =screenSpaceRadius ? 1605 radiusToUse * distanceFalloff 1606 : distanceFalloff; 1607 for(float x = -1.0; x <= 1.0; x++) { 1608 for(float y = -1.0; y <= 1.0; y++) { 1609 vec2 offset = vec2(x, y); 1610 ivec2 p = ivec2( 1611 (vUv * resolution * 0.5) + offset 1612 ); 1613 vec2 pUv = vec2(p) / (resolution * 0.5); 1614 float sampleDepth = texelFetch(downsampledDepth,p, 0).x; 1615 vec4 sampleInfo = texelFetch(tDiffuse, p, 0); 1616 vec3 normalSample = sampleInfo.gba * 2.0 - 1.0; 1617 vec3 worldPosSample = getWorldPos(sampleDepth, pUv); 1618 float tangentPlaneDist = abs(dot(worldPosSample - worldPos, normal)); 1619 float rangeCheck = exp(-1.0 * tangentPlaneDist * (1.0 / distanceFalloffToUse)) * max(dot(normal, normalSample), 0.0); 1620 float weight = rangeCheck; 1621 totalWeight += weight; 1622 texel += sampleInfo * weight; 1623 } 1624 } 1625 if (totalWeight == 0.0) { 1626 texel = texture2D(tDiffuse, vUv); 1627 } else { 1628 texel /= totalWeight; 1629 } 1630 } 1631 #else 1632 vec4 texel = texture2D(tDiffuse, vUv); 1633 #endif 1634 1635 #ifdef LOGDEPTH 1636 texel.r = clamp(texel.r, 0.0, 1.0); 1637 if (texel.r == 0.0) { 1638 texel.r = 1.0; 1639 } 1640 #endif 1641 1642 float finalAo = pow(texel.r, intensity); 1643 if (aoTones > 0.0) { 1644 finalAo = ceil(finalAo * aoTones) / aoTones; 1645 } 1646 float fogFactor = 0.0; 1647 if (fog) { 1648 float fogDepth = -getWorldPos(depth, vUv).z; 1649 if (fogExp) { 1650 fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); 1651 } else { 1652 fogFactor = smoothstep( fogNear, fogFar, fogDepth ); 1653 } 1654 } 1655 if (transparencyAware) { 1656 float transparencyDWOff = texture2D(transparencyDWFalse, vUv).a; 1657 float transparencyDWOn = texture2D(transparencyDWTrue, vUv).a; 1658 float adjustmentFactorOff = transparencyDWOff; 1659 float depthSample = texture2D(sceneDepth, vUv).r; 1660 float trueDepthSample = texture2D(transparencyDWTrueDepth, vUv).r; 1661 float adjustmentFactorOn = (1.0 - transparencyDWOn) * ( 1662 trueDepthSample == depthSample ? 1.0 : 0.0 1663 ); 1664 float adjustmentFactor = max(adjustmentFactorOff, adjustmentFactorOn); 1665 finalAo = mix(finalAo, 1.0, adjustmentFactor); 1666 } 1667 finalAo = mix(finalAo, 1.0, fogFactor); 1668 vec3 aoApplied = color * mix(vec3(1.0), sceneTexel.rgb, float(colorMultiply)); 1669 if (renderMode == 0.0) { 1670 gl_FragColor = vec4( mix(sceneTexel.rgb, aoApplied, 1.0 - finalAo), sceneTexel.a); 1671 } else if (renderMode == 1.0) { 1672 gl_FragColor = vec4( mix(vec3(1.0), aoApplied, 1.0 - finalAo), sceneTexel.a); 1673 } else if (renderMode == 2.0) { 1674 gl_FragColor = vec4( sceneTexel.rgb, sceneTexel.a); 1675 } else if (renderMode == 3.0) { 1676 if (vUv.x < 0.5) { 1677 gl_FragColor = vec4( sceneTexel.rgb, sceneTexel.a); 1678 } else if (abs(vUv.x - 0.5) < 1.0 / resolution.x) { 1679 gl_FragColor = vec4(1.0); 1680 } else { 1681 gl_FragColor = vec4( mix(sceneTexel.rgb, aoApplied, 1.0 - finalAo), sceneTexel.a); 1682 } 1683 } else if (renderMode == 4.0) { 1684 if (vUv.x < 0.5) { 1685 gl_FragColor = vec4( sceneTexel.rgb, sceneTexel.a); 1686 } else if (abs(vUv.x - 0.5) < 1.0 / resolution.x) { 1687 gl_FragColor = vec4(1.0); 1688 } else { 1689 gl_FragColor = vec4( mix(vec3(1.0), aoApplied, 1.0 - finalAo), sceneTexel.a); 1690 } 1691 } 1692 #include <dithering_fragment> 1693 if (gammaCorrection) { 1694 gl_FragColor = sRGBTransferOETF(gl_FragColor); 1695 } 1696 } 1697 `},bL={};bL=JSON.parse(`{"architecture":"attention-v3-int8","formatVersion":3,"globalBias":[-0.32877659797668457,0.4370867609977722,-0.05251404270529747,1.3072023391723633,0.047
16977047860622406,0.24477416276931763,0.009111796505749226,-0.17459993064403534],"globalFeatureInverseStandardDeviation":[10.771836280822754,1.9548665285110474,1.612365484237671],"globalFeatureMean":[0.9198138117790222,-0.49808526039123535,0.03374629095196724],"globalWeights":[101,-4,7,-127,6,-11,3,1,0,-16,-7,8,-8,-1,7,-4,0,0,-12,-3,-13,1,0,2],"headBias":[-0.15895532071590424,0.007501596584916115,-0.47742825746536255,0.01632097363471985,-0.48355796933174133,-0.1052703931927681,-0.8414919376373291,-0.21046382188796997],"headWeights":[-45,-7,-45,-20,7,-13,120,-24,-15,-26,-19,1,27,-48,-4,-10,1,-5,-24,64,91,-1,-68,39,54,39,101,-40,-127,64,-41,-17,-23,-19,3,35,-2,33,3,9,-64,-32,30,42,-112,12,28,-11,15,2,-4,-7,7,-3,-5,1,76,48,-34,-67,103,-40,-26,1,58,-11,46,-41,5,-6,-17,-8,13,17,-35,45,27,-17,-28,7,-53,12,-51,6,-32,-5,58,-9,-28,-21,37,-12,1,20,2,2,11,7,-4,-9,2,-15,-1,-8,16,12,-27,-1,61,-5,-1,4,-7,-2,7,4,1,4,-2,4,-18,-16,28,6,-65,16,3,-3,-5,-2,0,-40,-21,-22,14,30,-21,49,15,-64,43,19,23,18,5,-15,21,21,30,17,-11,-6,22,-38,-20,97,-46,-5,-13,-59,26,-13,11,-2,-10,-8,2,-15,-17,-27,-9,26,7,-7,6,9,-32,5,-9,12,49,17,-1,24,20,35,14,-33,-50,-1,-4,-26,11,11,9,-80,30,9,36,6,-12,-4,-7,39,-10,-30,-49,1,-43,-20,-34,76,-36,-10,15,-8,43,31,38,-42,39,37,-7,7,8,16,28,-83,32,9,23,-13,39,119,23,-127,-24,8,-48,-29,-7,-33,-12,58,-24,-29,-19,12,-55,-90,0,126,26,42,54,22],"keyProjectionWeights":[0,-1,-1,1,1,1,1,1,-64,32,49,23,-25,4,27,-22,0,1,-1,-1,-1,1,1,0,-34,38,64,88,13,-53,-41,58,-7,-4,79,-41,27,26,14,2,-2,1,1,1,-1,-1,1,1,1,-1,-1,-1,-1,-1,1,1,4,-3,126,42,-40,-116,35,20],"name":"residual-attention-v3-50m-qat-int8-epoch-25-zo-278w","outputBias":-0.0005526235327124596,"outputWeights":[11,11,14,-27,9,-22,127,6],"quantization":{"scales":{"globalWeight":0.021090541950849095,"headWeight":0.04935851140909355,"keyWeight":0.1733924937791441,"outputWeight":0.0030087142047955295,"tapInputWeight":0.1096231754049479,"tapOutputWeight":0.017949438644286102,"valueWeight":0.013986751242596301},"scheme":"symmetric-int8-per-tensor","zeroPoint":0},"summaryQueries":[0.0038647791370749474,0.09565000981092453,0.002756686182692647,-0.08183622360229492,-0.15209506452083588,-0.0006105066277086735,0.0010439646430313587,-0.03020688332617283,0.005065929610282183,0.14488759636878967,0.003160916268825531,-0.0855727270245552,-0.3123375475406647,0.00039022407145239413,0.0037786494940519333,0.1451321840286255,-0.002009483054280281,0.0597594790160656,0.0045239729806780815,-0.08765853196382523,-0.13884992897510529,-0.0021647117100656033,0.003985927440226078,0.09727758169174194,0.007170629221946001,0.0786278173327446,0.004103775601834059,-0.1198369711637497,-0.2925199568271637,-0.002055276418104768,0.0030450925696641207,0.14401987195014954],"supportedDenoiseSamples":[4,8,16],"tapFeatureInverseStandardDeviation":[2.283243417739868,0.8810898065567017,0.8210930228233337,3.752316474914551,3.6375720500946045,2.670454978942871,10.249449729919434,0.12639354169368744,100],"tapFeatureMean":[0.010318092070519924,0.01364430133253336,0.13411010801792145,-0.004725644364953041,0.10053129494190216,0.8384788632392883,0.9203217625617981,1.7139031887054443,1],"tapInputBias":[0.4780646860599518,-0.45214661955833435,0.289407879114151,0.34804567694664,-0.1320028454065323,0.17722633481025696,0.011480014771223068,-0.26692497730255127],"tapInputWeights":[0,1,7,0,-1,-7,0,31,-2,-1,14,-126,0,0,-1,2,26,-2,0,66,-73,0,0,0,-12,22,-3,0,-76,-90,0,-1,-7,-3,58,-1,0,2,6,0,0,3,4,-40,0,0,3,-13,0,0,1,-7,-13,0,0,-7,10,0,-2,-7,0,-39,-2,0,-13,-19,0,-2,20,-1,3,-1],"tapOutputBias":[-0.3867710530757904,0.1349504142999649,0.35706064105033875,-0.5938405394554138,-0.031154220923781395,1.4079623222351074,-1.9221038818359375,0.6029739379882812],"tapOutputWeights":[18,-4,47,19,74,-94,-21,-9,73,-59,88,-10,-3,71,-7,24,20,74,24,-31,-12,-10,-15,-45,-126,2,-4,27,-5,24,35,-11,-4,9,-8,26,-10,27,26,-20,17,-50,5,-35,0,-5,12,-71,89,-58,22,-83,-115,7,-16,-89,89,22,1,-20,-22,-25,-26,44],"valueProjectionWeights":[-16,-6,40,-17,84,-76,59,51,-10,-2,-10,-1,-23,74,-70,23,-5,4,4,-7,-77,127,20,-48,-36,4,-17,-12,-4,10,29,-27,-2,11,-47,-50,-54,-3,14,11,-23,-1,109,31,4,-100,-33,-36,-19,0,-8,20,-35,-24,79,2,44,2,5,7,22,-70,-67,-35]}`);var xL=[[`tapInputWeight`,`tapInputWeights`,8,9],[`tapOutputWeight`,`tapOutputWeights`,8,8],[`globalWeight`,`globalWeights`,8,3],[`keyWeight`,`keyProjectionWeights`,8,8],[`valueWeight`,`valueProjectionWeights`,8,8],[`headWeight`,`headWeights`,8,32],[`outputWeight`,`outputWeights`,1,8]],SL=e=>{let t=vL(bL).quantization?.scales?.[e];if(!(t>0)||!Number.isFinite(t))throw Error(`The bundled N8AO neural model has no valid ${e} scale.`);return t};if(vL(bL).architecture!==`attention-v3-int8`||vL(bL).formatVersion!==3||vL(bL).quantization?.scheme!==`symmetric-int8-per-tensor`||vL(bL).quantization?.zeroPoint!==0||vL(bL).supportedDen
1697oiseSamples?.join(`,`)!==`4,8,16`||xL.some(([,e,t,n])=>vL(bL)[e]?.length!==t*n||vL(bL)[e].some(e=>!Number.isInteger(e)||e<-127||e>127)))throw Error(`The bundled N8AO neural denoise model has an unsupported layout.`);var CL=e=>{if(!Number.isFinite(e))throw Error(`The bundled N8AO neural model contains a non-finite value.`);if(Object.is(e,-0))return`0.0`;let t=Number(e).toString();return/[.eE]/.test(t)?t:`${t}.0`},wL=[`x`,`y`,`z`,`w`],TL=e=>[...wL.map(t=>`${e}.lo.${t}`),...wL.map(t=>`${e}.hi.${t}`)],qEe=(e,t)=>e===0?null:e===1?t:e===-1?`(-${t})`:e<0?`(-${CL(-e)} * ${t})`:`${CL(e)} * ${t}`,JEe=(e,t)=>e===0?null:`${CL(e)} * ${t}`,EL=e=>e.filter(Boolean).join(` + `)||`0.0`,DL=(e,t,n,r,i,a)=>{let o=r.map((r,i)=>qEe(e[t*n+i],r));return`${CL(i)} * (${EL(o)}) + ${CL(a[t])}`},OL=(e,t=` `)=>`vec4(\n${e.map(e=>`${t} ${e}`).join(`, 1698`)}\n${t})`,kL=({functionName:e,scaleName:t,weights:n,bias:r,width:i=8,relu:a=!1})=>{let o=TL(`inputToken`),s=SL(t),c=Array.from({length:8},(e,t)=>DL(n,t,i,o,s,r)),l=OL(c.slice(0,4)),u=OL(c.slice(4)),d=e=>a?`max(${e}, vec4(0.0))`:e;return` 1699 NeuralToken neural${e[0].toUpperCase()}${e.slice(1)}(NeuralToken inputToken) { 1700 return NeuralToken( 1701 ${d(l)}, 1702 ${d(u)} 1703 ); 1704 } 1705`},AL=(e,t,n,r,i,a,o,s={})=>Array.from({length:i},(i,c)=>{let l=t[c];for(let t=0;t<a;t++){let i=e[c*a+t]*o;l-=i*r[t]*n[t],Object.hasOwn(s,t)&&(l+=i*r[t]*s[t])}return l}),jL=SL(`tapInputWeight`),YEe=AL(vL(bL).tapInputWeights,vL(bL).tapInputBias,vL(bL).tapFeatureMean,vL(bL).tapFeatureInverseStandardDeviation,8,9,jL,{8:1}),XEe=TL(`scaledInput`),ML=Array.from({length:8},(e,t)=>DL(vL(bL).tapInputWeights,t,9,XEe,jL,YEe)),ZEe=` 1706 NeuralToken neuralTapInput(NeuralToken raw) { 1707 NeuralToken scaledInput = NeuralToken( 1708 raw.lo * ${OL(vL(bL).tapFeatureInverseStandardDeviation.slice(0,4),` `)}, 1709 raw.hi * ${OL(vL(bL).tapFeatureInverseStandardDeviation.slice(4,8),` `)} 1710 ); 1711 return NeuralToken( 1712 max(${OL(ML.slice(0,4))}, vec4(0.0)), 1713 max(${OL(ML.slice(4))}, vec4(0.0)) 1714 ); 1715 } 1716`,NL=SL(`globalWeight`),QEe=AL(vL(bL).globalWeights,vL(bL).globalBias,vL(bL).globalFeatureMean,vL(bL).globalFeatureInverseStandardDeviation,8,3,NL),$Ee=wL.slice(0,3).map(e=>`scaledInput.${e}`),PL=Array.from({length:8},(e,t)=>DL(vL(bL).globalWeights,t,3,$Ee,NL,QEe)),eDe=` 1717 NeuralToken neuralEncodeGlobal(vec4 raw) { 1718 vec3 scaledInput = raw.xyz * vec3( 1719 ${vL(bL).globalFeatureInverseStandardDeviation.map(CL).join(`, `)} 1720 ); 1721 return NeuralToken( 1722 max(${OL(PL.slice(0,4))}, vec4(0.0)), 1723 max(${OL(PL.slice(4))}, vec4(0.0)) 1724 ); 1725 } 1726`,tDe=TL(`key`),nDe=` 1727 vec4 neuralQueryScores(NeuralToken key) { 1728 return ${OL(Array.from({length:4},(e,t)=>EL(tDe.map((e,n)=>JEe(vL(bL).summaryQueries[t*8+n],e)))))}; 1729 } 1730`,FL=[];for(let e=0;e<4;e++)FL.push(...wL.map(t=>`runningSummaryLo[${e}].${t}`),...wL.map(t=>`runningSummaryHi[${e}].${t}`));var rDe=SL(`headWeight`),IL=Array.from({length:8},(e,t)=>DL(vL(bL).headWeights,t,32,FL,rDe,vL(bL).headBias)),iDe=` 1731 NeuralToken neuralHead( 1732 vec4 runningSummaryLo[4], 1733 vec4 runningSummaryHi[4] 1734 ) { 1735 return NeuralToken( 1736 max(${OL(IL.slice(0,4))}, vec4(0.0)), 1737 max(${OL(IL.slice(4))}, vec4(0.0)) 1738 ); 1739 } 1740`,aDe=` 1741 float neuralOutput(NeuralToken head) { 1742 return ${DL(vL(bL).outputWeights,0,8,TL(`head`),SL(`outputWeight`),[vL(bL).outputBias])}; 1743 } 1744`,oDe=[ZEe,kL({functionName:`tapOutput`,scaleName:`tapOutputWeight`,weights:vL(bL).tapOutputWeights,bias:vL(bL).tapOutputBias,relu:!0}),eDe,kL({functionName:`keyProject`,scaleName:`keyWeight`,weights:vL(bL).keyProjectionWeights,bias:Array(8).fill(0)}),kL({functionName:`valueProject`,scaleName:`valueWeight`,weights:vL(bL).valueProjectionWeights,bias:Array(8).fill(0)}),nDe,iDe,aDe].join(` 1745`);xL.reduce((e,[,t])=>e+vL(bL)[t].length,0),xL.reduce((e,[,t])=>e+vL(bL)[t].filter(e=>e!==0).length,0);var sDe={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},tDiffuse:{value:null},projMat:{value:new fr},viewMat:{value:new fr},projectionMatrixInv:{value:new fr},viewMatrixInv:{value:new fr},cameraPos:{value:new hn},resolution:{value:new yn},time:{value:0},r:{value:5},blueNoise:{value:null},radius:{value:12},worldRadius:{value:5},index:{value:0},poissonDisk:{value:[]},distanceFalloff:{value:1},near:{value:.1},far:{value:1e3},screenSpaceRadius:{value:!1}},depthWrite:!1,depthTest:!1,vertexShader:` 1746 varying vec2 vUv; 1747 void main() { 1748 vUv = uv;
1749 gl_Position = vec4(position, 1.0); 1750 }`,fragmentShader:` 1751 uniform sampler2D sceneDiffuse; 1752 uniform highp sampler2D sceneDepth; 1753 uniform sampler2D tDiffuse; 1754 uniform sampler2D blueNoise; 1755 uniform mat4 projectionMatrixInv; 1756 uniform mat4 viewMatrixInv; 1757 uniform vec2 resolution; 1758 uniform float r; 1759 uniform float radius; 1760 uniform float worldRadius; 1761 uniform float index; 1762 uniform float near; 1763 uniform float far; 1764 uniform float distanceFalloff; 1765 uniform bool screenSpaceRadius; 1766 varying vec2 vUv; 1767 1768 highp float linearize_depth(highp float d, highp float zNear,highp float zFar) 1769 { 1770 highp float z_n = 2.0 * d - 1.0; 1771 return 2.0 * zNear * zFar / (zFar + zNear - z_n * (zFar - zNear)); 1772 } 1773 highp float linearize_depth_log(highp float d, highp float nearZ,highp float farZ) { 1774 float depth = pow(2.0, d * log2(farZ + 1.0)) - 1.0; 1775 float a = farZ / (farZ - nearZ); 1776 float b = farZ * nearZ / (nearZ - farZ); 1777 float linDepth = a + b / depth; 1778 return linearize_depth(linDepth, nearZ, farZ); 1779 } 1780 highp float linearize_depth_ortho(highp float d, highp float nearZ, highp float farZ) { 1781 return nearZ + (farZ - nearZ) * d; 1782 } 1783 float depthToClipZ(float depth) { 1784 #ifdef REVERSEDEPTH 1785 return depth; 1786 #else 1787 return depth * 2.0 - 1.0; 1788 #endif 1789 } 1790 bool isBackgroundDepth(float depth) { 1791 #ifdef REVERSEDEPTH 1792 return depth == 0.0; 1793 #else 1794 return depth == 1.0; 1795 #endif 1796 } 1797 vec3 getWorldPosLog(vec3 posS) { 1798 vec2 uv = posS.xy; 1799 float z = posS.z; 1800 float nearZ =near; 1801 float farZ = far; 1802 float depth = pow(2.0, z * log2(farZ + 1.0)) - 1.0; 1803 float a = farZ / (farZ - nearZ); 1804 float b = farZ * nearZ / (nearZ - farZ); 1805 float linDepth = a + b / depth; 1806 vec4 clipVec = vec4(uv, linDepth, 1.0) * 2.0 - 1.0; 1807 vec4 wpos = projectionMatrixInv * clipVec; 1808 return wpos.xyz / wpos.w; 1809 } 1810 vec3 getWorldPos(float depth, vec2 coord) { 1811 #ifdef LOGDEPTH 1812 #ifndef ORTHO 1813 return getWorldPosLog(vec3(coord, depth)); 1814 #endif 1815 #endif 1816 1817 #ifdef ORTHO 1818 float z = depthToClipZ(depth); 1819 vec4 clipSpacePosition = vec4(coord * 2. - 1., z, 1.); 1820 vec4 viewSpacePosition = projectionMatrixInv * clipSpacePosition; 1821 viewSpacePosition.xyz /= viewSpacePosition.w; 1822 return viewSpacePosition.xyz; 1823 #else 1824 vec2 ndc = coord * 2. - 1.; 1825 float ndcZ = depthToClipZ(depth); 1826 mat4 Q = projectionMatrixInv; 1827 vec3 view = vec3(Q[0][0] * ndc.x + Q[3][0], Q[1][1] * ndc.y + Q[3][1], Q[3][2]); 1828 float invW = 1.0 / (Q[2][3] * ndcZ + Q[3][3]); 1829 return view * invW; 1830 #endif 1831 } 1832 1833#ifdef NEURAL_DENOISE 1834 struct NeuralToken { 1835 highp vec4 lo; 1836 highp vec4 hi; 1837 }; 1838 1839 ${oDe} 1840 1841 vec3 neuralSafeNormalize(vec3 value, vec3 fallback) { 1842 float lengthSquared = dot(value, value); 1843 return lengthSquared > 1e-12 ? value * inversesqrt(lengthSquared) : fallback; 1844 } 1845 1846 mat3 neuralLocalFrame(vec3 inputNormal) { 1847 vec3 frameNormal = neuralSafeNormalize(inputNormal, vec3(0.0, 0.0, 1.0)); 1848 vec3 helper = abs(frameNormal.z) < 0.999 1849 ? vec3(0.0, 0.0, 1.0) 1850 : vec3(0.0, 1.0, 0.0); 1851 vec3 tangent = neuralSafeNormalize( 1852 cross(helper, frameNormal), 1853 vec3(1.0, 0.0, 0.0) 1854 ); 1855 vec3 bitangent = cross(frameNormal, tangent); 1856 return transpose(mat3(tangent, bitangent, frameNormal)); 1857 } 1858 1859 void neuralConsumeToken( 1860 NeuralToken token, 1861 inout vec4 runningMaximum, 1862 inout vec4 runningDenominator, 1863 inout vec4 runningSummaryLo[4], 1864 inout vec4 runningSummaryHi[4] 1865 ) { 1866 NeuralToken key = neuralKeyProject(token); 1867 NeuralToken value = neuralValueProject(token); 1868 vec4 score = neuralQueryScores(key) * 0.3535533905932738; 1869 vec4 newMaximum = max(runningMaximum, score); 1870 vec4 oldScale = exp(runningMaximum - newMaximum); 1871 vec4 newScale = exp(score - newMaximum); 1872 1873 runningSummaryLo[0] = runningSummaryLo[0] * oldScale.x + value.lo * newScale.x; 1874 runningSummaryHi[0] = runningSummaryHi[0] * oldScale.x + value.hi * newScale.x; 1875 runningSummaryLo[1] = runningSummaryLo[1] * oldScale.y + value.lo * newScale.y; 1876 runningSummaryHi[1] = runningSummaryHi[1] * oldScale.y + value.hi * newScale.y; 1877 runningSummaryLo[2] = runningSummaryLo[2] * oldScale.z + value.lo * newScale.z; 1878 runningSummaryHi[2] = runningSummaryHi[2] * oldScale.z + value.hi * newScale.z; 1879 runningSummaryLo[3] = runningSummaryLo[3] * oldScale.w + value.lo * newScale.w; 1880 runningSummaryHi[3] = runningSummaryHi[3] * oldScale.w + value.hi * newScale.w; 1881 runningDenominator = runningDenominator * oldScale + newScale; 1882 runningMaximum = newMaximum; 1883 } 1884 1885 void neuralEncodeTap( 1886 NeuralToken raw, 1887 inout vec4 runningMaximum, 1888 inout vec4 runningDenominator, 1889 inout vec4 runningSummaryLo[4], 1890 inout vec4 runningSummaryHi[4] 1891 ) { 1892 NeuralToken first = neuralTapInput(raw); 1893 NeuralToken token = neuralTapOutput(first); 1894 neuralConsumeToken( 1895 token, 1896 runningMaximum, 1897 runningDenominator, 1898 runningSummaryLo, 1899 runningSummaryHi 1900 ); 1901 } 1902 1903 float neuralFinish( 1904 float baselineAO, 1905 inout vec4 runningMaximum, 1906 inout vec4 runningDenominator, 1907 inout vec4 runningSummaryLo[4], 1908 inout vec4 runningSummaryHi[4] 1909 ) { 1910 vec4 raw = vec4( 1911 baselineAO,
1912 log(max(worldRadius, 1e-6)), 1913 log(max(distanceFalloff, 1e-6)), 1914 0.0 1915 ); 1916 NeuralToken token = neuralEncodeGlobal(raw); 1917 neuralConsumeToken( 1918 token, 1919 runningMaximum, 1920 runningDenominator, 1921 runningSummaryLo, 1922 runningSummaryHi 1923 ); 1924 1925 vec4 inverseDenominator = 1.0 / max(runningDenominator, vec4(1e-12)); 1926 runningSummaryLo[0] *= inverseDenominator.x; 1927 runningSummaryHi[0] *= inverseDenominator.x; 1928 runningSummaryLo[1] *= inverseDenominator.y; 1929 runningSummaryHi[1] *= inverseDenominator.y; 1930 runningSummaryLo[2] *= inverseDenominator.z; 1931 runningSummaryHi[2] *= inverseDenominator.z; 1932 runningSummaryLo[3] *= inverseDenominator.w; 1933 runningSummaryHi[3] *= inverseDenominator.w; 1934 1935 NeuralToken head = neuralHead(runningSummaryLo, runningSummaryHi); 1936 return neuralOutput(head); 1937 } 1938#endif 1939 1940 #include <common> 1941 #define NUM_SAMPLES __N8AO_DENOISE_SAMPLES__ 1942 uniform vec2 poissonDisk[NUM_SAMPLES]; 1943 void main() { 1944 const float pi = 3.14159; 1945 vec2 texelSize = vec2(1.0 / resolution.x, 1.0 / resolution.y); 1946 vec2 uv = vUv; 1947 vec4 data = texture2D(tDiffuse, vUv); 1948 float occlusion = data.r; 1949 float baseOcc = data.r; 1950 vec3 normal = data.gba * 2.0 - 1.0; 1951 float count = 1.0; 1952 float d = texture2D(sceneDepth, vUv).x; 1953 if (isBackgroundDepth(d)) { 1954 gl_FragColor = data; 1955 return; 1956 } 1957 vec3 worldPos = getWorldPos(d, vUv); 1958 float size = radius; 1959 float angle; 1960#ifdef NEURAL_DENOISE 1961 // The neural material is only bound for denoise iteration two. 1962 angle = texture2D(blueNoise, gl_FragCoord.xy / 128.0).z * PI2; 1963#else 1964 if (index == 0.0) { 1965 angle = texture2D(blueNoise, gl_FragCoord.xy / 128.0).w * PI2; 1966 } else if (index == 1.0) { 1967 angle = texture2D(blueNoise, gl_FragCoord.xy / 128.0).z * PI2; 1968 } else if (index == 2.0) { 1969 angle = texture2D(blueNoise, gl_FragCoord.xy / 128.0).y * PI2; 1970 } else { 1971 angle = texture2D(blueNoise, gl_FragCoord.xy / 128.0).x * PI2; 1972 } 1973#endif 1974 1975 mat2 rotationMatrix = mat2(cos(angle), -sin(angle), sin(angle), cos(angle)); 1976 float radiusToUse = screenSpaceRadius ? distance( 1977 worldPos, 1978 getWorldPos(d, vUv + 1979 vec2(worldRadius, 0.0) / resolution) 1980 ) : worldRadius; 1981 float distanceFalloffToUse =screenSpaceRadius ? 1982 radiusToUse * distanceFalloff 1983 : radiusToUse * distanceFalloff * 0.2; 1984 1985 float invDistance = (1.0 / distanceFalloffToUse); 1986#ifdef NEURAL_DENOISE 1987 mat3 neuralWorldToLocal = neuralLocalFrame(normal); 1988 float neuralInverseRadius = 1.0 / max(radiusToUse, 1e-6); 1989 float neuralInverseDistance = 1.0 / max(distanceFalloffToUse, 1e-6); 1990 vec4 neuralMaximum = vec4(-1e30); 1991 vec4 neuralDenominator = vec4(0.0); 1992 vec4 neuralSummaryLo[4]; 1993 vec4 neuralSummaryHi[4]; 1994 for (int query = 0; query < 4; query++) { 1995 neuralSummaryLo[query] = vec4(0.0); 1996 neuralSummaryHi[query] = vec4(0.0); 1997 } 1998#endif 1999 for(int i = 0; i < NUM_SAMPLES; i++) { 2000 vec2 offset = (rotationMatrix * poissonDisk[i]) * texelSize * size; 2001 vec4 dataSample = texture2D(tDiffuse, uv + offset); 2002 float occSample = dataSample.r; 2003 vec3 normalSample = dataSample.gba * 2.0 - 1.0; 2004 float dSample = texture2D(sceneDepth, uv + offset).x; 2005 vec3 worldPosSample = getWorldPos(dSample, uv + offset); 2006 float tangentPlaneDist = abs(dot(worldPosSample - worldPos, normal)); 2007 float rangeCheck = float(!isBackgroundDepth(dSample)) * exp(-1.0 * tangentPlaneDist * invDistance ) * max(dot(normal, normalSample), 0.0); 2008 occlusion += occSample * rangeCheck; 2009 count += rangeCheck; 2010#ifdef NEURAL_DENOISE 2011 if (!isBackgroundDepth(dSample)) { 2012 vec3 localDelta = (neuralWorldToLocal * (worldPosSample - worldPos)) 2013 * neuralInverseRadius; 2014 vec3 localNormal = neuralWorldToLocal 2015 * neuralSafeNormalize(normalSample, vec3(0.0, 0.0, 1.0)); 2016 NeuralToken rawTap = NeuralToken( 2017 vec4(localDelta, localNormal.x), 2018 vec4( 2019 localNormal.y, 2020 localNormal.z, 2021 occSample, 2022 tangentPlaneDist * neuralInverseDistance 2023 ) 2024 ); 2025 neuralEncodeTap(
2026 rawTap, 2027 neuralMaximum, 2028 neuralDenominator, 2029 neuralSummaryLo, 2030 neuralSummaryHi 2031 ); 2032 } 2033#endif 2034 } 2035 if (count > 0.0) { 2036 occlusion /= count; 2037 } 2038 occlusion = clamp(occlusion, 0.0, 1.0); 2039 if (occlusion == 0.0) { 2040 occlusion = 1.0; 2041 } 2042#ifdef NEURAL_DENOISE 2043 occlusion = clamp( 2044 occlusion + neuralFinish( 2045 occlusion, 2046 neuralMaximum, 2047 neuralDenominator, 2048 neuralSummaryLo, 2049 neuralSummaryHi 2050 ), 2051 0.0, 2052 1.0 2053 ); 2054#endif 2055 gl_FragColor = vec4(occlusion, 0.5 + 0.5 * normal); 2056 } 2057 `},cDe={uniforms:{sceneDepth:{value:null},resolution:{value:new yn},near:{value:.1},far:{value:1e3},viewMatrixInv:{value:new fr},projectionMatrixInv:{value:new fr},logDepth:{value:!1},ortho:{value:!1}},depthWrite:!1,depthTest:!1,vertexShader:` 2058 varying vec2 vUv; 2059 void main() { 2060 vUv = uv; 2061 gl_Position = vec4(position, 1); 2062 }`,fragmentShader:`
2063 uniform highp sampler2D sceneDepth; 2064 uniform vec2 resolution; 2065 uniform float near; 2066 uniform float far; 2067 uniform bool logDepth; 2068 uniform bool ortho; 2069 uniform mat4 viewMatrixInv; 2070 uniform mat4 projectionMatrixInv; 2071 varying vec2 vUv; 2072 layout(location = 1) out vec4 gNormal; 2073 vec3 getWorldPosLog(vec3 posS) { 2074 vec2 uv = posS.xy; 2075 float z = posS.z; 2076 float nearZ =near; 2077 float farZ = far; 2078 float depth = pow(2.0, z * log2(farZ + 1.0)) - 1.0; 2079 float a = farZ / (farZ - nearZ); 2080 float b = farZ * nearZ / (nearZ - farZ); 2081 float linDepth = a + b / depth; 2082 vec4 clipVec = vec4(uv, linDepth, 1.0) * 2.0 - 1.0; 2083 vec4 wpos = projectionMatrixInv * clipVec; 2084 return wpos.xyz / wpos.w; 2085 } 2086 vec3 getWorldPos(float depth, vec2 coord) { 2087 if (logDepth && !ortho) { 2088 return getWorldPosLog(vec3(coord, depth)); 2089 } 2090 if (ortho) { 2091 #ifdef REVERSEDEPTH 2092 float z = depth; 2093 #else 2094 float z = depth * 2. - 1.; 2095 #endif 2096 vec4 clipSpacePosition = vec4(coord * 2. - 1., z, 1.); 2097 vec4 viewSpacePosition = projectionMatrixInv * clipSpacePosition; 2098 viewSpacePosition.xyz /= viewSpacePosition.w; 2099 return viewSpacePosition.xyz; 2100 } 2101 vec2 ndc = coord * 2. - 1.; 2102 #ifdef REVERSEDEPTH 2103 float ndcZ = depth; 2104 #else 2105 float ndcZ = depth * 2. - 1.; 2106 #endif 2107 mat4 Q = projectionMatrixInv; 2108 vec3 view = vec3(Q[0][0] * ndc.x + Q[3][0], Q[1][1] * ndc.y + Q[3][1], Q[3][2]); 2109 float invW = 1. / (Q[2][3] * ndcZ + Q[3][3]); 2110 return view * invW; 2111 } 2112 2113 vec3 computeNormal(vec3 worldPos, vec2 vUv) { 2114 ivec2 p = ivec2(vUv * resolution); 2115 float c0 = texelFetch(sceneDepth, p, 0).x; 2116 float l2 = texelFetch(sceneDepth, p - ivec2(2, 0), 0).x; 2117 float l1 = texelFetch(sceneDepth, p - ivec2(1, 0), 0).x; 2118 float r1 = texelFetch(sceneDepth, p + ivec2(1, 0), 0).x; 2119 float r2 = texelFetch(sceneDepth, p + ivec2(2, 0), 0).x; 2120 float b2 = texelFetch(sceneDepth, p - ivec2(0, 2), 0).x; 2121 float b1 = texelFetch(sceneDepth, p - ivec2(0, 1), 0).x; 2122 float t1 = texelFetch(sceneDepth, p + ivec2(0, 1), 0).x; 2123 float t2 = texelFetch(sceneDepth, p + ivec2(0, 2), 0).x; 2124 2125 float dl = abs((2.0 * l1 - l2) - c0); 2126 float dr = abs((2.0 * r1 - r2) - c0); 2127 float db = abs((2.0 * b1 - b2) - c0); 2128 float dt = abs((2.0 * t1 - t2) - c0); 2129 2130 vec3 ce = getWorldPos(c0, vUv).xyz; 2131 2132 vec3 dpdx = (dl < dr) ? ce - getWorldPos(l1, (vUv - vec2(1.0 / resolution.x, 0.0))).xyz 2133 : -ce + getWorldPos(r1, (vUv + vec2(1.0 / resolution.x, 0.0))).xyz; 2134 vec3 dpdy = (db < dt) ? ce - getWorldPos(b1, (vUv - vec2(0.0, 1.0 / resolution.y))).xyz 2135 : -ce + getWorldPos(t1, (vUv + vec2(0.0, 1.0 / resolution.y))).xyz; 2136 2137 return normalize(cross(dpdx, dpdy)); 2138 } 2139 void main() { 2140 vec2 uv = vUv - vec2(0.5) / resolution; 2141 vec2 pixelSize = vec2(1.0) / resolution; 2142 highp vec2[4] uvSamples; 2143 uvSamples[0] = uv; 2144 uvSamples[1] = uv + vec2(pixelSize.x, 0.0); 2145 uvSamples[2] = uv + vec2(0.0, pixelSize.y); 2146 uvSamples[3] = uv + pixelSize; 2147 float depth00 = texture2D(sceneDepth, uvSamples[0]).r; 2148 float depth10 = texture2D(sceneDepth, uvSamples[1]).r; 2149 float depth01 = texture2D(sceneDepth, uvSamples[2]).r; 2150 float depth11 = texture2D(sceneDepth, uvSamples[3]).r; 2151 float minDepth = min(min(depth00, depth10), min(depth01, depth11)); 2152 float maxDepth = max(max(depth00, depth10), max(depth01, depth11)); 2153 float targetDepth = minDepth; 2154 // Checkerboard pattern to avoid artifacts 2155 if (mod(gl_FragCoord.x + gl_FragCoord.y, 2.0) > 0.5) { 2156 targetDepth = maxDepth; 2157 } 2158 int chosenIndex = 0; 2159 float[4] samples; 2160 samples[0] = depth00; 2161 samples[1] = depth10; 2162 samples[2] = depth01; 2163 samples[3] = depth11; 2164 for(int i = 0; i < 4; ++i) { 2165 if (samples[i] == targetDepth) { 2166 chosenIndex = i; 2167 break; 2168 } 2169 } 2170 gl_FragColor = vec4(samples[chosenIndex], 0.0, 0.0, 1.0); 2171 gNormal = vec4(computeNormal( 2172 getWorldPos(samples[chosenIndex], uvSamples[chosenIndex]), uvSamples[chosenIndex] 2173 ), 0.0); 2174 }`},lDe=Uint8Array.from(atob(`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`),e=>e.charCodeAt(0)),uDe=parseInt(`186`.replace(/\D+/g,``))>=162?class extends at{constructor(e=1,t=1,n=1,r={}){super(e,t,{...r,count:n}
2174),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}}:class extends at{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGLMultipleRenderTargets=!0;let i=this.texture;this.texture=[];for(let e=0;e<n;e++)this.texture[e]=i.clone(),this.texture[e].isRenderTargetTexture=!0}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.texture.length;r<i;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}copy(e){this.dispose(),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.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}};function LL(e,t,n){if(t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE)){let r=t.getQueryParameter(e,t.QUERY_RESULT)/1e6;n.lastTime=n.lastTime===0?r:n.timeRollingAverage*n.lastTime+(1-n.timeRollingAverage)*r}else setTimeout(()=>{LL(e,t,n)},1)}var dDe=class extends $he{constructor(e,t,n=512,r=512){super(),this.width=Math.floor(n),this.height=Math.floor(r),this.clear=!0,this._neuralDenoiseWarningKey=null,this.camera=t,this.scene=e,this.autosetGamma=!0,this.configuration=new Proxy({aoSamples:16,aoRadius:5,aoTones:0,denoiseSamples:8,denoiseRadius:12,distanceFalloff:1,intensity:5,denoiseIterations:2,renderMode:0,biasOffset:0,biasMultiplier:0,color:new ot(0,0,0),gammaCorrection:!0,depthBufferType:RL.Default,screenSpaceRadius:!1,halfRes:!1,depthAwareUpsampling:!0,colorMultiply:!0,transparencyAware:!1,accumulate:!1,neuralDenoise:!1},{set:(e,t,n)=>{let r=e[t];if(e[t]=n,n.equals?n.equals(r)||this.firstFrame():r!==n&&this.firstFrame(),t===`aoSamples`&&r!==n&&this.configureAOPass(this.configuration.depthBufferType,this.camera.isOrthographicCamera),t===`denoiseSamples`&&r!==n&&this.configureDenoisePass(this.configuration.depthBufferType,this.camera.isOrthographicCamera),t===`neuralDenoise`&&r!==n){let t=n&&(e.aoSamples!==16||e.halfRes),r=n&&e.halfRes;n&&(e.aoSamples=16,[4,8,16].includes(e.denoiseSamples)||(e.denoiseSamples=8),e.denoiseRadius=12,e.denoiseIterations=2,e.halfRes=!1),t&&this.configureAOPass(this.configuration.depthBufferType,this.camera.isOrthographicCamera),r&&(this.configureHalfResTargets(),this.configureEffectCompositer(this.configuration.depthBufferType,this.camera.isOrthographicCamera),this.setSize(this.width,this.height)),this.configureDenoisePass(this.configuration.depthBufferType,this.camera.isOrthographicCamera)}return t===`halfRes`&&r!==n&&(this.configureAOPass(this.configuration.depthBufferType,this.camera.isOrthographicCamera),this.configureHalfResTargets(),this.configureEffectCompositer(this.configuration.depthBufferType,this.camera.isOrthographicCamera),this.setSize(this.width,this.height)),t===`depthAwareUpsampling`&&r!==n&&this.configureEffectCompositer(this.configuration.depthBufferType,this.camera.isOrthographicCamera),t===`gammaCorrection`&&(this.autosetGamma=!1),t===`transparencyAware`&&r!==n&&(this.autoDetectTransparency=!1,this.configureTransparencyTarget()),!0}}),this.samples=[],this.samplesDenoise=[],this.autoDetectTransparency=!0,this.frames=0,this.lastViewMatrix=new fr,this.lastProjectionMatrix=new fr,this.configureEffectCompositer(this.configuration.depthBufferType),this.configureSampleDependentPasses(),this.configureHalfResTargets(),this.detectTransparency(),this.configureTransparencyTarget(),this.copyQuad=new yL(new Hn({uniforms:{tDiffuse:{value:null}},depthWrite:!1,vertexShader:` 2175 varying vec2 vUv; 2176 void main() { 2177 vUv = uv; 2178 gl_Position = vec4(position, 1); 2179 } 2180 `,fragmentShader:` 2181 uniform sampler2D tDiffuse; 2182 varying vec2 vUv; 2183 void main() { 2184 gl_FragColor = texture2D(tDiffuse, vUv); 2185 } 2186 `})),this.writeTargetInternal=new at(this.width,this.height,{minFilter:xt,magFilter:xt,depthBuffer:!1,format:dt}),this.readTargetInternal=new at(this.width,this.height,{minFilter:xt,magFilter:xt,depthBuffer:!1,format:dt}),this.outputTargetInternal=new at(this.width,this.height,{minFilter:xt,magFilter:xt,depthBuffer:!1}),this.accumulationRenderTarget=new at(this.width,this.height,{minFilter:xt,magFilter:xt,depthBuffer:!1,format:dt,type:zn,stencilBuffer:!1,depthBuffer:!1,alpha:!0}),this.accumulationQuad=new yL(new Hn({uniforms:{frame:{value:0},tDiffuse:{value:null}},transparent:!0,opacity:1,vertexShader:` 2187 varying vec2 vUv; 2188 void main() { 2189 vUv = uv; 2190 gl_Position = vec4(position, 1); 2191 }`,fragmentShader:` 2192 uniform sampler2D tDiffuse; 2193 uniform float frame; 2194 varying vec2 vUv; 2195 void main() { 2196 vec4 color = texture2D(tDiffuse, vUv); 2197 gl_FragColor = vec4(color.rgb, 1.0 / (frame + 1.0)); 2198 } 2199 `}
2199)),this.bluenoise=new cn(lDe,128,128),this.bluenoise.colorSpace=``,this.bluenoise.wrapS=_r,this.bluenoise.wrapT=_r,this.bluenoise.minFilter=On,this.bluenoise.magFilter=On,this.bluenoise.needsUpdate=!0,this.lastTime=0,this.timeRollingAverage=.99,this.needsDepthTexture=!0,this.needsSwap=!0,this._r=new yn,this._c=new ot}configureHalfResTargets(){this.firstFrame(),this.configuration.halfRes?(this.depthDownsampleTarget=new uDe(Math.floor(this.width/2),Math.floor(this.height/2),2),this.depthDownsampleTarget.textures[0].format=or,this.depthDownsampleTarget.textures[0].type=Gn,this.depthDownsampleTarget.textures[0].minFilter=On,this.depthDownsampleTarget.textures[0].magFilter=On,this.depthDownsampleTarget.textures[0].depthBuffer=!1,this.depthDownsampleTarget.textures[1].format=dt,this.depthDownsampleTarget.textures[1].type=zn,this.depthDownsampleTarget.textures[1].minFilter=On,this.depthDownsampleTarget.textures[1].magFilter=On,this.depthDownsampleTarget.textures[1].depthBuffer=!1,this.depthDownsampleQuad=new yL(new Hn(cDe))):(this.depthDownsampleTarget&&=(this.depthDownsampleTarget.dispose(),null),this.depthDownsampleQuad&&=(this.depthDownsampleQuad.dispose(),null))}detectTransparency(){if(this.autoDetectTransparency){let e=!1;this.scene.traverse(t=>{t.material&&t.material.transparent&&(e=!0)}),e&&(this.configuration.transparencyAware=!0)}}configureTransparencyTarget(){this.configuration.transparencyAware?(this.transparencyRenderTargetDWFalse=new at(this.width,this.height,{minFilter:xt,magFilter:On,type:zn,format:dt}),this.transparencyRenderTargetDWTrue=new at(this.width,this.height,{minFilter:xt,magFilter:On,type:zn,format:dt}),this.transparencyRenderTargetDWTrue.depthTexture=new St(this.width,this.height,dr),this.depthCopyPass=new yL(new Hn({uniforms:{depthTexture:{value:this.depthTexture},reverseDepthBuffer:{value:this.configuration.depthBufferType===RL.Reverse}},vertexShader:` 2200 varying vec2 vUv; 2201 void main() { 2202 vUv = uv; 2203 gl_Position = vec4(position, 1); 2204 }`,fragmentShader:` 2205 uniform sampler2D depthTexture; 2206 uniform bool reverseDepthBuffer; 2207 varying vec2 vUv; 2208 void main() { 2209 if (reverseDepthBuffer) { 2210 float d = 1.0 - texture2D(depthTexture, vUv).r; 2211 2212 d += 0.00001; 2213 gl_FragDepth = 1.0 - d; 2214 } else { 2215 float d = texture2D(depthTexture, vUv).r; 2216 d += 0.00001; 2217 gl_FragDepth = d; 2218 } 2219 gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); 2220 } 2221 `}))):(this.transparencyRenderTargetDWFalse&&=(this.transparencyRenderTargetDWFalse.dispose(),null),this.transparencyRenderTargetDWTrue&&=(this.transparencyRenderTargetDWTrue.dispose(),null),this.depthCopyPass&&=(this.depthCopyPass.dispose(),null))}renderTransparency(e){let t=this.scene.background,n=e.getClearColor(new ot),r=e.getClearAlpha(),i=new Map,a=e.autoClearDepth;this.scene.traverse(e=>{i.set(e,e.visible)}),this.scene.background=null,e.autoClearDepth=!1,e.setClearColor(new ot(0,0,0),0),this.depthCopyPass.material.uniforms.depthTexture.value=this.depthTexture,this.depthCopyPass.material.uniforms.reverseDepthBuffer.value=this.configuration.depthBufferType===RL.Reverse,e.setRenderTarget(this.transparencyRenderTargetDWFalse),this.scene.traverse(e=>{e.material&&(e.visible=i.get(e)&&(e.material.transparent&&!e.material.depthWrite&&!e.userData.treatAsOpaque||!!e.userData.cannotReceiveAO))}),e.clear(!0,!0,!0),this.depthCopyPass.render(e),e.render(this.scene,this.camera),e.setRenderTarget(this.transparencyRenderTargetDWTrue),this.scene.traverse(e=>{e.material&&(e.visible=i.get(e)&&e.material.transparent&&e.material.depthWrite&&!e.userData.treatAsOpaque)}),e.clear(!0,!0,!0),this.depthCopyPass.render(e),e.render(this.scene,this.camera),this.scene.traverse(e=>{e.visible=i.get(e)}),e.setClearColor(n,r),this.scene.background=t,e.autoClearDepth=a}configureSampleDependentPasses(){this.configureAOPass(this.configuration.depthBufferType,this.camera.isOrthographicCamera),this.configureDenoisePass(this.configuration.depthBufferType,this.camera.isOrthographicCamera)}configureAOPass(e=RL.Default,t=!1){this.firstFrame(),this.samples=this.generateHemisphereSamples(this.configuration.aoSamples);let n={...GEe};n.fragmentShader=n.fragmentShader.replace(`16`,this.configuration.aoSamples).replace(`16.0`,this.configuration.aoSamples+`.0`),e===RL.Log?n.fragmentShader=`#define LOGDEPTH 2222`+n.fragmentShader:e===RL.Reverse&&(n.fragmentShader=`#define REVERSEDEPTH 2223`+n.fragmentShader),t&&(n.fragmentShader=`#define ORTHO 2224`+n.fragmentShader),this.configuration.halfRes&&(n.fragmentShader=`#define HALFRES 2225`+n.fragmentShader),this.effectShaderQuad?(this.effectShaderQuad.material.dispose(),this.effectShaderQuad.material=new Hn(n)):this.effectShaderQuad=new yL(new Hn(n))}configureDenoisePass(e=RL.Default,t=!1){this.firstFrame(),this.samplesDenoise=this.generateDenoiseSamples(this.configuration.denoiseSamples,11);let n={...sDe};n.fragmentShader=n.fragmentShader.replace(`__N8AO_DENOISE_SAMPLES__`,this.configuration.denoiseSamples),e===RL.Log?n.fragmentShader=`#define LOGDEPTH 2226`+n.fragmentShader:e===RL.Reverse&&(n.fragmentShader=`#define REVERSEDEPTH 2227`+n.fragmentShader),t&&(n.fragmentShader=`#define ORTHO 2228`+n.fragmentShader),this.standardDenoiseMaterial&&this.standardDenoiseMaterial.dispose(),this.neuralDenoiseMaterial&&this.neuralDenoiseMaterial.dispose(),this.standardDenoiseMaterial=new Hn(n),this.neuralDenoiseMaterial=this.configuration.neuralDenoise&&[4,8,16].includes(this.configuration.denoiseSamples)?new Hn({...n,glslVersion:Mn,fragmentShader:`#define NEURAL_DENOISE 2229layout(location = 0) out highp vec4 neuralFragColor; 2230#define gl_FragColor neuralFragColor 2231`+n.fragmentShader}):null,this.poissonBlurQuad?this.poissonBlurQuad.material=this.standardDenoiseMaterial:this.poissonBlurQuad=new yL(this.standardDenoiseMaterial)}shouldUseNeuralDenoise(){if(!this.configuration.neuralDenoise)return this._neuralDenoiseWarningKey=null,!1;let e=[];
2231if(this.configuration.aoSamples!==16&&e.push(`aoSamples is ${this.configuration.aoSamples} (expected 16)`),[4,8,16].includes(this.configuration.denoiseSamples)||e.push(`denoiseSamples is ${this.configuration.denoiseSamples} (expected 4, 8, or 16)`),this.configuration.denoiseRadius!==12&&e.push(`denoiseRadius is ${this.configuration.denoiseRadius} (expected 12)`),this.configuration.denoiseIterations!==2&&e.push(`denoiseIterations is ${this.configuration.denoiseIterations} (expected 2)`),this.configuration.halfRes&&e.push(`halfRes is enabled (expected full resolution)`),e.length>0){let t=e.join(`; `);return t!==this._neuralDenoiseWarningKey&&(console.warn(`[N8AO] neuralDenoise is enabled but cannot run: ${t}. Neural denoising has been disabled; standard denoising will be used.`),this._neuralDenoiseWarningKey=t),!1}return this._neuralDenoiseWarningKey=null,this.neuralDenoiseMaterial!==null}configureEffectCompositer(e=RL.Default,t=!1){this.firstFrame();let n={...KEe};e===RL.Log?n.fragmentShader=`#define LOGDEPTH 2232`+n.fragmentShader:e===RL.Reverse&&(n.fragmentShader=`#define REVERSEDEPTH 2233`+n.fragmentShader),t&&(n.fragmentShader=`#define ORTHO 2234`+n.fragmentShader),this.configuration.halfRes&&this.configuration.depthAwareUpsampling&&(n.fragmentShader=`#define HALFRES 2235`+n.fragmentShader),this.effectCompositerQuad?(this.effectCompositerQuad.material.dispose(),this.effectCompositerQuad.material=new Hn(n)):this.effectCompositerQuad=new yL(new Hn(n))}generateHemisphereSamples(e){let t=[];for(let n=0;n<e;n++){let r=2.399963*n,i=Math.sqrt(n+.5)/Math.sqrt(e),a=i*Math.cos(r),o=i*Math.sin(r),s=Math.sqrt(1-(a*a+o*o));t.push(new hn(a,o,s))}return t}generateDenoiseSamples(e,t){let n=2*Math.PI*t/e,r=1/e,i=r,a=[],o=r,s=0;for(let t=0;t<e;t++)a.push(new yn(Math.cos(s),Math.sin(s)).multiplyScalar(o**.75)),o+=i,s+=n;return a}setSize(e,t){this.firstFrame(),this.width=Math.floor(e),this.height=Math.floor(t);let n=this.configuration.halfRes?Math.floor(this.width/2):this.width,r=this.configuration.halfRes?Math.floor(this.height/2):this.height;this.writeTargetInternal.setSize(n,r),this.readTargetInternal.setSize(n,r),this.accumulationRenderTarget.setSize(n,r),this.configuration.halfRes&&this.depthDownsampleTarget.setSize(n,r),this.configuration.transparencyAware&&(this.transparencyRenderTargetDWFalse.setSize(this.width,this.height),this.transparencyRenderTargetDWTrue.setSize(this.width,this.height)),this.outputTargetInternal.setSize(this.width,this.height)}setDepthTexture(e){this.depthTexture=e}firstFrame(){this.needsFrame=!0}render(e,t,n){let r=e.xr.enabled;e.xr.enabled=!1;let i=e.capabilities.reversedDepthBuffer===!0||e.capabilities.reverseDepthBuffer===!0?RL.Reverse:e.capabilities.logarithmicDepthBuffer?RL.Log:RL.Default;this.configuration.depthBufferType!==i&&(this.configuration.depthBufferType=i,this.configureAOPass(this.configuration.depthBufferType,this.camera.isOrthographicCamera),this.configureDenoisePass(this.configuration.depthBufferType,this.camera.isOrthographicCamera),this.configureEffectCompositer(this.configuration.depthBufferType,this.camera.isOrthographicCamera)),this.detectTransparency(),(t.texture.type!==this.outputTargetInternal.texture.type||t.texture.format!==this.outputTargetInternal.texture.format)&&(this.outputTargetInternal.texture.type=t.texture.type,this.outputTargetInternal.texture.format=t.texture.format,this.outputTargetInternal.texture.needsUpdate=!0),this.camera.updateMatrixWorld(),this.lastViewMatrix.equals(this.camera.matrixWorldInverse)&&this.lastProjectionMatrix.equals(this.camera.projectionMatrix)&&this.configuration.accumulate&&!this.needsFrame?this.frame++:(this.configuration.accumulate&&(e.setRenderTarget(this.accumulationRenderTarget),e.clear(!0,!0,!0)),this.frame=0,this.needsFrame=!1),this.lastViewMatrix.copy(this.camera.matrixWorldInverse),this.lastProjectionMatrix.copy(this.camera.projectionMatrix);let a,o,s;this.debugMode&&(a=e.getContext(),o=a.getExtension(`EXT_disjoint_timer_query_webgl2`),o===null&&(console.error(`EXT_disjoint_timer_query_webgl2 not available, disabling debug mode.`),this.debugMode=!1)),this.debugMode&&(s=a.createQuery(),a.beginQuery(o.TIME_ELAPSED_EXT,s)),this.configuration.transparencyAware&&this.renderTransparency(e),this._r.set(this.width,this.height);let c=this.configuration.aoRadius;if(this.configuration.halfRes&&this.configuration.screenSpaceRadius&&(c*=.5),this.frame<1024/this.configuration.aoSamples){this.configuration.halfRes&&(e.setRenderTarget(this.depthDownsampleTarget),this.depthDownsampleQuad.material.uniforms.sceneDepth.value=this.depthTexture,this.depthDownsampleQuad.material.uniforms.resolution.value=this._r,this.depthDownsampleQuad.material.uniforms.near.value=this.camera.near,this.depthDownsampleQuad.material.uniforms.far.value=this.camera.far,this.depthDownsampleQuad.material.uniforms.projectionMatrixInv.value=this.camera.projectionMatrixInverse,this.depthDownsampleQuad.material.uniforms.viewMatrixInv.value=this.camera.matrixWorld,this.depthDownsampleQuad.material.uniforms.logDepth.value=this.configuration.depthBufferType===RL.Log,this.depthDownsampleQuad.material.uniforms.ortho.value=this.camera.isOrthographicCamera,this.depthDownsampleQuad.render(e)),this.effectShaderQuad.material.uniforms.sceneDiffuse.value=t.texture,this.effectShaderQuad.material.uniforms.sceneDepth.value=this.configuration.halfRes?this.depthDownsampleTarget.textures[0]:this.depthTexture,this.effectShaderQuad.material.uniforms.sceneNormal.value=this.configuration.halfRes?this.depthDownsampleTarget.textures[1]:null,this.effectShaderQuad.material.uniforms.projMat.value=this.camera.projectionMatrix,this.effectShaderQuad.material.uniforms.viewMat.value=this.camera.matrixWorldInverse,this.effectShaderQuad.material.uniforms.projViewMat.value=this.camera.projectionMatrix.clone().multiply(this.camera.matrixWorldInverse.clone()),this.effectShaderQuad.material.uniforms.projectionMatrixInv.value=this.camera.projectionMatrixInverse,this.effectShaderQuad.material.uniforms.viewMatrixInv.value=this.camera.matrixWorld,this.effectShaderQuad.material.uniforms.cameraPos.value=this.camera.getWorldPosition(new hn),this.effectShaderQuad.material.uniforms.bi
2235asAdjustment.value=new yn(this.configuration.biasOffset,this.configuration.biasMultiplier),this.effectShaderQuad.material.uniforms.resolution.value=this.configuration.halfRes?this._r.clone().multiplyScalar(.5).floor():this._r,this.effectShaderQuad.material.uniforms.time.value=performance.now()/1e3,this.effectShaderQuad.material.uniforms.samples.value=this.samples,this.effectShaderQuad.material.uniforms.bluenoise.value=this.bluenoise,this.effectShaderQuad.material.uniforms.radius.value=c,this.effectShaderQuad.material.uniforms.distanceFalloff.value=this.configuration.distanceFalloff,this.effectShaderQuad.material.uniforms.near.value=this.camera.near,this.effectShaderQuad.material.uniforms.far.value=this.camera.far,this.effectShaderQuad.material.uniforms.ortho.value=this.camera.isOrthographicCamera,this.effectShaderQuad.material.uniforms.screenSpaceRadius.value=this.configuration.screenSpaceRadius,this.effectShaderQuad.material.uniforms.frame.value=this.frame,e.setRenderTarget(this.writeTargetInternal),this.effectShaderQuad.render(e);let n=this.shouldUseNeuralDenoise();for(let t=0;t<this.configuration.denoiseIterations;t++)[this.writeTargetInternal,this.readTargetInternal]=[this.readTargetInternal,this.writeTargetInternal],this.poissonBlurQuad.material=n&&t===1?this.neuralDenoiseMaterial:this.standardDenoiseMaterial,this.poissonBlurQuad.material.uniforms.tDiffuse.value=this.readTargetInternal.texture,this.poissonBlurQuad.material.uniforms.sceneDepth.value=this.configuration.halfRes?this.depthDownsampleTarget.textures[0]:this.depthTexture,this.poissonBlurQuad.material.uniforms.projMat.value=this.camera.projectionMatrix,this.poissonBlurQuad.material.uniforms.viewMat.value=this.camera.matrixWorldInverse,this.poissonBlurQuad.material.uniforms.projectionMatrixInv.value=this.camera.projectionMatrixInverse,this.poissonBlurQuad.material.uniforms.viewMatrixInv.value=this.camera.matrixWorld,this.poissonBlurQuad.material.uniforms.cameraPos.value=this.camera.getWorldPosition(new hn),this.poissonBlurQuad.material.uniforms.resolution.value=this.configuration.halfRes?this._r.clone().multiplyScalar(.5).floor():this._r,this.poissonBlurQuad.material.uniforms.time.value=performance.now()/1e3,this.poissonBlurQuad.material.uniforms.blueNoise.value=this.bluenoise,this.poissonBlurQuad.material.uniforms.radius.value=this.configuration.denoiseRadius*(this.configuration.halfRes?.5:1),this.poissonBlurQuad.material.uniforms.worldRadius.value=c,this.poissonBlurQuad.material.uniforms.distanceFalloff.value=this.configuration.distanceFalloff,this.poissonBlurQuad.material.uniforms.index.value=t,this.poissonBlurQuad.material.uniforms.poissonDisk.value=this.samplesDenoise,this.poissonBlurQuad.material.uniforms.near.value=this.camera.near,this.poissonBlurQuad.material.uniforms.far.value=this.camera.far,this.poissonBlurQuad.material.uniforms.screenSpaceRadius.value=this.configuration.screenSpaceRadius,e.setRenderTarget(this.writeTargetInternal),this.poissonBlurQuad.render(e);e.setRenderTarget(this.accumulationRenderTarget);let r=e.autoClear;e.autoClear=!1,this.accumulationQuad.material.uniforms.tDiffuse.value=this.writeTargetInternal.texture,this.accumulationQuad.material.uniforms.frame.value=this.frame,this.accumulationQuad.render(e),e.autoClear=r}this.configuration.transparencyAware&&(this.effectCompositerQuad.material.uniforms.transparencyDWFalse.value=this.transparencyRenderTargetDWFalse.texture,this.effectCompositerQuad.material.uniforms.transparencyDWTrue.value=this.transparencyRenderTargetDWTrue.texture,this.effectCompositerQuad.material.uniforms.transparencyDWTrueDepth.value=this.transparencyRenderTargetDWTrue.depthTexture,this.effectCompositerQuad.material.uniforms.transparencyAware.value=!0),this.effectCompositerQuad.material.uniforms.sceneDiffuse.value=t.texture,this.effectCompositerQuad.material.uniforms.sceneDepth.value=this.depthTexture,this.effectCompositerQuad.material.uniforms.aoTones.value=this.configuration.aoTones,this.effectCompositerQuad.material.uniforms.near.value=this.camera.near,this.effectCompositerQuad.material.uniforms.far.value=this.camera.far,this.effectCompositerQuad.material.uniforms.projectionMatrixInv.value=this.camera.projectionMatrixInverse,this.effectCompositerQuad.material.uniforms.ortho.value=this.camera.isOrthographicCamera,this.effectCompositerQuad.material.uniforms.downsampledDepth.value=this.configuration.halfRes?this.depthDownsampleTarget.textures[0]:this.depthTexture,this.effectCompositerQuad.material.uniforms.resolution.value=this._r,this.effectCompositerQuad.material.uniforms.blueNoise.value=this.bluenoise,this.effectCompositerQuad.material.uniforms.intensity.value=this.configuration.intensity,this.effectCompositerQuad.material.uniforms.renderMode.value=this.configuration.renderMode,this.effectCompositerQuad.material.uniforms.screenSpaceRadius.value=this.configuration.screenSpaceRadius,this.effectCompositerQuad.material.uniforms.radius.value=c,this.effectCompositerQuad.material.uniforms.distanceFalloff.value=this.configuration.distanceFalloff,this.effectCompositerQuad.material.uniforms.gammaCorrection.value=this.autosetGamma?this.renderToScreen:this.configuration.gammaCorrection,this.effectCompositerQuad.material.uniforms.tDiffuse.value=this.accumulationRenderTarget.texture,this.effectCompositerQuad.material.uniforms.color.value=this._c.copy(this.configuration.color).convertSRGBToLinear(),this.effectCompositerQuad.material.uniforms.colorMultiply.value=this.configuration.colorMultiply,this.effectCompositerQuad.material.uniforms.fog.value=!!this.scene.fog,this.scene.fog&&(this.scene.fog.isFog?(this.effectCompositerQuad.material.uniforms.fogExp.value=!1,this.effectCompositerQuad.material.uniforms.fogNear.value=this.scene.fog.near,this.effectCompositerQuad.material.uniforms.fogFar.value=this.scene.fog.far):this.scene.fog.isFogExp2?(this.effectCompositerQuad.material.uniforms.fogExp.value=!0,this.effectCompositerQuad.material.uniforms.fogDensity.value=this.scene.fog.density):console.error(`Unsupported fog type ${this.scene.fog.constructor.name} in SSAOPass.`)),e.setRenderTarget(this.outputTargetInternal),this.effectCompositerQuad.render(e),e.setRenderTarget(this.renderToScreen?null:n),this.copyQuad.material.uniforms.tDiffuse.value=this.outputTargetInternal.texture,this.copyQuad.render(e),this.debugMode&&(a.endQuery(o.TIME_ELAPSED_EXT),LL(s,a,this)),e.xr.enabled=r}enableDebugMode(){this.debugMode=!0}disableDebugMode(){this.debugMode=!1}setDisplayMode(e){this.configuration.renderMode=[`Combined`,`AO`,`No AO`,`Split`,`Split AO`].indexOf(e)}setQualityMode(e){e===`Performance`?(this.configuration.neuralDenoise=!1,this.configuration.aoSamples=8,this.configuration.denoiseSamples=4,this.configuration.denoiseRadius=12):e===`Low`?(this.configuration.neuralDenoise=!1,this.configuration.aoSamples=16,this.configuration.denoiseSamples=4,this.configuration.denoiseRadius=12):e===`Medium`?(this.configuration.neuralDenoise=!1,this.configuration.aoSamples=16,this.configuration.denoiseSamples=8,this.configuration.denoiseRadius=12):e===`High`?(this.configuration.neuralDenoise=!1,this.configuration.aoSamples=64,this.configuration.denoiseSamples=8,this.configuration.denoiseRadius=6):e===`Ultra`?(this.configuration.neuralDenoise=!1,this.configuration.aoSamples=64,this.configuration.denoiseSamples=16,this.configuration.denoiseRadius=6):[`Neural-Low`,`Neural-Medium`,`Neural-High`].includes(e)&&(this.configuration.aoSamples=16,this.configuration.denoiseSamples={"Neural-Low":4,"Neural-Medium":8,"Neural-High":16}[e],this.configuration.denoiseRadius=12,this.configuration.denoiseIterations=2,this.configuration.halfRes=!1,this.configuration.neuralDenoise=!0)}},RL={Default:1,Log:2,Reverse:3};function zL(e,t){let{groups:n,skipped:r}=ape(e),i=[],a=[],o=[];for(let e of n){let n=[];for(let r of e.entries){let e=Sy(r.kind);if(!e)continue;let i=null;try{i=e.make(r.params??{},t)}catch(e){console.warn(`post effect failed to build: `+r.kind,e);continue}i&&(n.push(i),a.push({kind:r.kind,id:r.id,object:i,def:e,params:r.params??{},isPass:!!e.isPass}))}if(n.length){if(e.type===`pass`)i.push(n[0]),o.push({type:`pass`,kinds:e.entries.map(e=>e.kind)});
2235else try{i.push(new Lx(t.camera,...n)),o.push({type:`effects`,kinds:e.entries.map(e=>e.kind)})}catch(t){console.warn(`post effect group failed to build a pass: `+e.entries.map(e=>e.kind).join(`, `),t);for(let e of n){let t=a.findIndex(t=>t.object===e);t>=0&&a.splice(t,1)}for(let t of e.entries)r.push(t)}}}return{passes:i,instances:a,skipped:r,plan:o}}function BL(e,t){for(let e of t??[])try{e.def?.dispose?e.def.dispose(e.object):e.object?.dispose?.()}catch{}for(let t of e??[])try{t?.dispose?.()}catch{}}_y(`ao`,{label:`Ambient occlusion`,group:`ao`,isPass:!0,params:[{key:`aoRadius`,label:`Radius`,min:.05,max:10,step:.05,decimals:2,default:1.5,hint:`How far a surface looks for occluders, in world units.`},{key:`intensity`,label:`Intensity`,min:0,max:10,step:.1,decimals:2,default:2.5},{key:`distanceFalloff`,label:`Falloff`,min:0,max:5,step:.05,decimals:2,default:1},{key:`quality`,label:`Quality`,type:`select`,default:`auto`,hint:`Auto follows this deviceâs shadow-quality setting.`,options:[{value:`auto`,label:`Auto (follow device)`},{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}]},{key:`halfRes`,label:`Half resolution`,type:`select`,default:`auto`,hint:`Renders AO at half size â much cheaper, slightly softer.`,options:[{value:`auto`,label:`Auto (follow device)`},{value:`on`,label:`On`},{value:`off`,label:`Off`}]}],make:(e,t)=>{let n=new dDe(t.scene,t.camera,t.width,t.height);return n.configuration.aoRadius=HL(e.aoRadius,1.5),n.configuration.intensity=HL(e.intensity,2.5),n.configuration.distanceFalloff=HL(e.distanceFalloff,1),n.setSize(Math.round(t.width*t.dpr),Math.round(t.height*t.dpr)),VL(n,e,t.prefs??{}),n},retarget:(e,t)=>{e.camera=t},resize:(e,t,n,r)=>{e.setSize(Math.round(t*r),Math.round(n*r))},applyLocal:(e,t,n)=>VL(e,n??{},t??{})});function VL(e,t,n){let r=n?.shadowQuality,i=t?.quality&&t.quality!==`auto`?t.quality:r,a=t?.halfRes;e.configuration.halfRes=a===`on`?!0:a===`off`?!1:r===`low`||r===`medium`||r===`off`,e.setQualityMode&&e.setQualityMode(i===`high`?`High`:i===`medium`?`Medium`:`Low`)}_y(`tonemapping`,{label:`Tone mapping`,group:`grading`,ownsToneMapping:!0,params:[{key:`mode`,label:`Curve`,type:`select`,default:`AGX`,hint:`Replaces the rendererâs own ACES Filmic mapping while this effect is in the stack.`,options:[{value:`AGX`,label:`AgX`},{value:`ACES_FILMIC`,label:`ACES Filmic`},{value:`NEUTRAL`,label:`Neutral`},{value:`REINHARD`,label:`Reinhard`},{value:`REINHARD2`,label:`Reinhard 2`},{value:`CINEON`,label:`Cineon`},{value:`UNCHARTED2`,label:`Uncharted 2`},{value:`LINEAR`,label:`Linear (none)`}]},{key:`whitePoint`,label:`White point`,min:.1,max:32,step:.1,decimals:2,default:4},{key:`middleGrey`,label:`Middle grey`,min:.01,max:2,step:.01,decimals:2,default:.6}],make:e=>new ege({mode:Fx[e.mode]??Fx.AGX,whitePoint:HL(e.whitePoint,4),middleGrey:HL(e.middleGrey,.6)})});function HL(e,t){let n=Number(e);return Number.isFinite(n)?n:t}_y(`huesaturation`,{label:`Hue / saturation`,group:`grading`,params:[{key:`hue`,label:`Hue`,min:-Math.PI,max:Math.PI,step:.01,decimals:3,default:0,hint:`Rotates every colour around the wheel, in radians.`},{key:`saturation`,label:`Saturation`,min:-1,max:1,step:.01,decimals:2,default:0}],make:e=>new Qhe({hue:HL(e.hue,0),saturation:HL(e.saturation,0)})}),_y(`brightnesscontrast`,{label:`Brightness / contrast`,group:`grading`,params:[{key:`brightness`,label:`Brightness`,min:-1,max:1,step:.01,decimals:2,default:0},{key:`contrast`,label:`Contrast`,min:-1,max:1,step:.01,decimals:2,default:0}],make:e=>new Zhe({brightness:HL(e.brightness,0),contrast:HL(e.contrast,0)})}),_y(`lut`,{label:`LUT (colour grade)`,group:`grading`,params:[{key:`lut`,label:`LUT file`,type:`asset`,default:``,hint:`A .cube LUT or a strip image from the Explorer. Shared with peers automatically.`},{key:`tetrahedral`,label:`Smooth interpolation`,type:`bool`,default:!1,hint:`Tetrahedral sampling â slower, avoids banding on small LUTs.`}],make:e=>{let t=new Ghe(Rx.createNeutral(16),{tetrahedralInterpolation:!!e.tetrahedral});return UL(t,String(e.lut??``)),t},dispose:e=>{try{e.__lutWatch?.(),e.lut?.dispose?.()}catch{}e.dispose?.()}});async function UL(e,t){if(!t)return;let n=ka(t);if(!n){xf(t),e.__lutWatch?.(),e.__lutWatch=Fa.subscribe(()=>{ka(t)&&(e.__lutWatch?.(),e.__lutWatch=null,UL(e,t))});return}try{let t=await Ja(n.id);if(!t)return;let r=String(n.name??``).toLowerCase(),i=null;if(r.endsWith(`.cube`))i=new Xhe().parse(await t.text());else{let e=URL.createObjectURL(t);try{let t=new Image;await new Promise((n,r)=>{t.onload=n,t.onerror=r,t.src=e}),i=Rx.from({image:t})}finally{URL.revokeObjectURL(e)}}if(!i)return;let a=e.lut;e.lut=i,a?.dispose?.()}catch(e){console.warn(`LUT failed to load: `+t,e)}}
2235_y(`bloom`,{label:`Bloom`,group:`camera`,params:[{key:`intensity`,label:`Intensity`,min:0,max:10,step:.05,decimals:2,default:1},{key:`luminanceThreshold`,label:`Threshold`,min:0,max:1,step:.01,decimals:2,default:.9,hint:`Only pixels brighter than this bloom.`},{key:`luminanceSmoothing`,label:`Smoothing`,min:0,max:1,step:.01,decimals:2,default:.025},{key:`radius`,label:`Radius`,min:0,max:1,step:.01,decimals:2,default:.85}],make:e=>new Yhe({intensity:HL(e.intensity,1),luminanceThreshold:HL(e.luminanceThreshold,.9),luminanceSmoothing:HL(e.luminanceSmoothing,.025),radius:HL(e.radius,.85),mipmapBlur:!0,kernelSize:Whe.LARGE})}),_y(`vignette`,{label:`Vignette`,group:`camera`,params:[{key:`offset`,label:`Offset`,min:0,max:1,step:.01,decimals:2,default:.5},{key:`darkness`,label:`Darkness`,min:0,max:1,step:.01,decimals:2,default:.5},{key:`technique`,label:`Falloff`,type:`select`,default:`DEFAULT`,options:[{value:`DEFAULT`,label:`Default`},{value:`ESKIL`,label:`Eskil`}]}],make:e=>new Bhe({offset:HL(e.offset,.5),darkness:HL(e.darkness,.5),technique:Nx[e.technique]??Nx.DEFAULT})}),_y(`grain`,{label:`Film grain`,group:`camera`,params:[{key:`opacity`,label:`Amount`,min:0,max:1,step:.01,decimals:2,default:.25},{key:`premultiply`,label:`Multiply with the image`,type:`bool`,default:!1,hint:`On, grain follows the picture; off, it sits evenly over everything.`}],make:e=>{let t=new qhe({blendFunction:zx.SCREEN,premultiply:!!e.premultiply});return t.blendMode.opacity.value=HL(e.opacity,.25),t}}),_y(`chromaticaberration`,{label:`Chromatic aberration`,group:`camera`,params:[{key:`offsetX`,label:`Offset X`,min:0,max:.02,step:2e-4,decimals:4,default:.001},{key:`offsetY`,label:`Offset Y`,min:0,max:.02,step:2e-4,decimals:4,default:5e-4},{key:`radialModulation`,label:`Stronger at the edges`,type:`bool`,default:!1}],make:(e,t)=>{let n=new Jhe({radialModulation:!!e.radialModulation,modulationOffset:.15});return n.offset.set(HL(e.offsetX,.001),HL(e.offsetY,5e-4)),n}}),_y(`pixelation`,{label:`Pixelation`,group:`camera`,params:[{key:`granularity`,label:`Pixel size`,min:1,max:60,step:1,decimals:0,default:12}],make:e=>new nge(HL(e.granularity,12))}),_y(`scanlines`,{label:`Scanlines`,group:`camera`,params:[{key:`density`,label:`Density`,min:.1,max:4,step:.05,decimals:2,default:1.25},{key:`opacity`,label:`Amount`,min:0,max:1,step:.01,decimals:2,default:.5},{key:`scrollSpeed`,label:`Scroll speed`,min:0,max:2,step:.01,decimals:2,default:0}],make:e=>{let t=new zhe({density:HL(e.density,1.25)});return t.scrollSpeed=HL(e.scrollSpeed,0),t.blendMode.opacity.value=HL(e.opacity,.5),t}}),_y(`dotscreen`,{label:`Dot screen`,group:`stylize`,params:[{key:`scale`,label:`Scale`,min:.1,max:8,step:.05,decimals:2,default:1},{key:`angle`,label:`Angle`,min:0,max:Math.PI,step:.01,decimals:3,default:Math.PI*.5},{key:`opacity`,label:`Amount`,min:0,max:1,step:.01,decimals:2,default:1}],make:e=>{let t=new Vhe({scale:HL(e.scale,1),angle:HL(e.angle,Math.PI*.5)});return t.blendMode.opacity.value=HL(e.opacity,1),t}}),_y(`smaa`,{label:`Anti-aliasing (SMAA)`,group:`aa`,params:[{key:`preset`,label:`Quality`,type:`select`,default:`MEDIUM`,options:[{value:`LOW`,label:`Low`},{value:`MEDIUM`,label:`Medium`},{value:`HIGH`,label:`High`},{value:`ULTRA`,label:`Ultra`}]}],make:e=>new tge({preset:Px[e.preset]??Px.MEDIUM})});var WL=`post:`;function GL(e){return typeof e==`string`&&e.startsWith(`post:`)}function KL(){return Object.keys(U(ry)).filter(GL).map(e=>({key:e,name:qL(e)}))}function qL(e){return ay(e)?.name||e.slice(5)}var JL=typeof localStorage<`u`?localStorage:null,YL=Ue(JL?.getItem(`shaderDomain`)===`post`?`post`:`surface`);YL.subscribe(e=>{try{JL?.setItem(`shaderDomain`,e)}catch{}});var XL=Ue(null);async function ZL(e){XL.set(e),YL.set(`post`),await cy()}var fDe=0;function pDe(){return WL+Date.now().toString(36)+(fDe++).toString(36)}function QL(e={}){let t=e.preset?ige(e.preset):null,n=t?t.doc():age(),r=pDe();return dy(r,{...n,name:e.name||t?.label||`Post effect`}),r}function $L(e){return GL(e)?(dy(e,null),!0):!1}function eR(e={}){let t=QL(e),n=yy(`graph`,void 0,e.docKey||`scene`);return tR(n,t,e.docKey||`scene`),{key:t,id:n}}function tR(e,t,n=xy){fy(e,{graph:t},n)}function nR(e,t){sy.update(n=>{let r=n[e]??[];return r.length===t.length&&r.every((e,n)=>e===t[n])?n:{...n,[e]:t}})}var rR=new Map,iR=new Map,aR=new Map;function mDe(e){let t=e?.graph;if(!GL(t))return``;let n=ay(t);
2235if(!n)return`missing`;let r=ny(n);return r.ok?r.ir.fragment:`error`}function hDe(e,t){Bx();let n=e?.graph;if(!GL(n))return null;let r=ay(n);if(!r)return null;let i=ny(r);if(!i.ok)return nR(n,i.errors??[`This post graph does not compile.`]),null;nR(n,[]);let a=i.ir,o={};for(let e of a.uniforms)o[e.name]={value:e.value};a.readsNormals&&(o.normalBuffer={value:null});let s={name:`PostGraph_`+n.replace(/[^A-Za-z0-9_]/g,`_`),fragment:a.fragment,uniforms:o,readsDepth:a.readsDepth,blend:`SET`},c=r.backend&&Vx(r.backend)?r.backend:rge,l=iR.get(n);if(l&&aR.get(n)===a.fragment)return iR.delete(n),oR(n,l,a);let u=null;try{u=Vx(c)?.compile(s,t)??null}catch(e){return nR(n,[String(e?.message??e)]),null}return u&&typeof u.then==`function`?(aR.set(n,a.fragment),u.then(e=>{iR.set(n,e),vy.update(e=>({...e}))}).catch(()=>{}),null):oR(n,u,a)}function oR(e,t,n){return t?(t.tpGraphKey=e,t.tpNeedsNormals=!!n.readsNormals,t.tpUsesClock=!!n.usesClock,rR.set(e,t),aR.set(e,n.fragment),t):null}function gDe(e){if(!e?.tpUsesClock)return;let t=e.uniforms?.get?.(`uShaderTime`);t&&(t.value=Vfe())}function _De(e){e?.tpGraphKey&&rR.get(e.tpGraphKey)===e&&(rR.delete(e.tpGraphKey),aR.delete(e.tpGraphKey)),e?.dispose?.()}function sR(){return[...rR.values()].filter(e=>e.tpNeedsNormals)}function vDe(e){let t=rR.get(e);if(!t)return!1;let n=ay(e);if(!n)return!1;let r=ny(n);if(!r.ok)return!1;let i=r.ir;if(i.fragment!==aR.get(e))return!1;for(let e of i.uniforms){let n=t.uniforms?.get?.(e.name);n&&e.value!==void 0&&!e.clock&&(n.value=e.value)}return!0}var cR=!1;function lR(){cR||(cR=!0,Bx(),_y(`graph`,{label:`Shader graph`,group:`graph`,params:[{key:`graph`,label:`Graph`,type:`graph`,default:``,hint:`Which post graph this entry runs.`}],make:hDe,signature:mDe,tick:gDe,dispose:_De}),Wfe(e=>{let t=ay(e);if(!t)return nR(e,[]),rR.delete(e),aR.delete(e),vy.update(e=>({...e})),{ok:!0};let n=ny(t);return nR(e,n.ok?[]:n.errors??[]),vDe(e)||vy.update(e=>({...e})),{ok:n.ok,errors:n.errors}}))}lR();function uR(){return oge.map(e=>({key:e.key,label:e.label,hint:e.hint}))}function yDe(){return{graphs:KL(),live:[...rR.keys()],needsNormals:sR().length,errors:U(sy)}}var bDe=170,dR=16,xDe=64,fR=Ue(null),pR=Ue(null),mR=we([Kr,Ui,px,wi],([e,t,n,r])=>{if(r||!e?.length)return null;let i=e[e.length-1],a=t?.getObjectByProperty(`uuid`,i);return!rx(a)||ix(a).pip===!1||n?.uuid===i?null:i});function hR(e){let t=ax(ix(e).aspect)||16/9;return{w:Math.round(170*t),h:170}}function gR(e,t,n=0){let r=n?dR:xDe;return{x:Math.max(dR,t.width-e.w-r-n),y:Math.max(dR,t.height-e.h-dR)}}function _R(e,t,n){return{x:Math.min(Math.max(0,e.x),Math.max(0,n.width-t.w)),y:Math.min(Math.max(0,e.y),Math.max(0,n.height-t.h))}}function vR(e,t){return{x:e.x,y:t-(e.y+e.h),w:e.w,h:e.h}}function SDe(){fR.set(null)}function CDe(){return{target:U(mR),rect:U(pR),position:U(fR)}}function wDe(e,n){Ce(n,!0);let r=()=>z(Td,`$viewPrefs`,O),i=()=>z(te,`$camera`,O),a=()=>z(re,`$dpr`,O),o=()=>z(ne,`$size`,O),s=()=>z(sL,`$peerLooks`,O),c=()=>z(zs,`$specatorMode`,O),l=()=>z(px,`$cameraPreview`,O),u=()=>z(vy,`$postStacks`,O),d=()=>z(by,`$lookOverride`,O),f=()=>z(Hr,`$qualityOverrides`,O),p=()=>z(ii,`$viewMode`,O),m=()=>z(gy,`$postEnabledLocal`,O),h=()=>z(hv,`$shadowQuality`,O),g=()=>z(pR,`$pipRect`,O),_=()=>z(mR,`$pipTarget`,O),v=()=>z(Ui,`$objectsGroup`,O),y=()=>z(zi,`$TControls`,O),b=()=>z(mm,`$editingObject`,O),x=()=>z(Up,`$faceEditObject`,O),S=()=>z(im,`$meshEditOutline`,O),w=()=>z(ki,`$isLocked`,O),T=()=>z(vi,`$editorMode`,O),E=()=>z(Kr,`$selectedObjects`,O),D=()=>z(Ci,`$lockedObjects`,O),[O,k]=Ve(),A=null,ee=null,{scene:j,renderer:M,camera:te,size:ne,autoRender:N,renderStage:P,dpr:re}=Ww(),ie=new Uhe(M);ie.removeAllPasses();let F=new Hhe(j,te.current);ie.addPass(F),A=new Ix(j,te.current,{blendFunction:zx.ALPHA,edgeStrength:100,pulseSpeed:0,visibleEdgeColor:3487029,hiddenEdgeColor:3487029,xRay:!0,blur:!0}),Qe(()=>{let e=r().outlineColor;A?.visibleEdgeColor.set(e),A?.hiddenEdgeColor.set(e)}),ee=new Ix(j,te.current,{blendFunction:zx.ALPHA,edgeStrength:100,pulseSpeed:0,visibleEdgeColor:655360,hiddenEdgeColor:655360,xRay:!0,blur:!0});let ae=new Lx(te.current,ee),L=new Lx(te.current,A);ie.addPass(ae),ie.addPass(L),A&&df(A.selection.layer),ee&&df(ee.selection.layer);let oe=[],R=[],se=[],ce=[],le=!1,de=null,fe=``;ede(()=>le&&!M.xr.isPresenting);function pe(){let e={shadowQuality:U(hv)};for(let t of R)t.def?.applyLocal?.(t.object,e,t.params)}function B(e){for(let e of oe)ie.removePass(e);BL(oe,R),de&&=(ie.removePass(de),de.dispose?.(),null);let t=M.getPixelRatio?M.getPixelRatio():1,n=zL(e,{scene:j,camera:te.current,width:ne.current.width,height:ne.current.height,dpr:t,prefs:{shadowQuality:U(hv)}});oe=n.passes,R=n.instances,se=n.plan,ce=n.skipped;let r=R.filter(e=>e.object?.tpNeedsNormals),i=1;if(r.length){de=new Khe(j,te.current),ie.addPass(de,1),i=2;
2235for(let e of r){let t=e.object.uniforms?.get?.(`normalBuffer`);t&&(t.value=de.texture)}}oe.forEach((e,t)=>ie.addPass(e,i+t)),pe();let a=rpe(e);a!==le&&(le=a,tde())}Qe(()=>{let e=i();if(e){ie.setMainCamera?.(e);for(let t of R)t.def?.retarget?.(t.object,e);de&&(de.mainCamera=e)}}),Qe(()=>{a();let e=M.getPixelRatio?M.getPixelRatio():1;ie.setSize(o().width,o().height);for(let t of R)t.def?.resize?.(t.object,o().width,o().height,e)});let me=Rre(),V=Ire(),he=Wr(),H=!1,ge=U(ii),W=t(!1),ve=``,G=0,ye=!1;Qe(()=>{s();let e=typeof c()==`string`?c():``,t=e?gL(e):null;ve=t?e:``;let n=t?t.camera:l()?.uuid??null;u(),d();let r=f(),i=t?t.look:void 0,a=t?t.mode:p(),o=my({stack:Cy(xy,i),cameraStack:n?Cy(n,i):null,mode:r.aoOff&&a===`shaded-ao`?`shaded`:a,localEnabled:(t?t.overrides.post!==!1:m())&&!r.postOff,postOk:V,postWarm:Q(W)}).filter(e=>!(r.aoOff&&e.kind===`ao`)),h=ope(o);h!==fe&&(fe=h,K(()=>B(o)))}),Qe(()=>{h(),K(()=>pe())}),Qe(()=>{let e=p(),t=e!==ge;ge=e,t&&K(()=>{let t=U(px)?.uuid??null,n=my({stack:U(Ty),cameraStack:t?U(vy)[t]??null:null,mode:e,localEnabled:U(gy),postOk:!0,postWarm:!0});if(!n.length)return;let r=n.every(e=>e.kind===`ao`)?`Ambient occlusion`:`The scene look (post-processing)`;!V&&!ye&&(ye=!0,es(r+` stays off â this browser build (Chromium `+me+`) has a rendering bug with fullscreen effects. It returns after a browser update.`)),V&&he&&!H&&(H=!0,es(r+` is heavy on mobile GPUs, and some drivers render it wrong â if the viewport stops updating as you move, switch the view mode back to Shaded.`))})}),_e(()=>{let e=N.current;return N.set(!1),()=>{N.set(e)}});let be=!1,xe=la.subscribe(e=>be=!!e),Se=null;async function we(){await C(),Se||=new at(1,1);let e=[],t=new Set,n=r=>{if(r&&typeof r==`object`&&!t.has(r)){t.add(r),r.fullscreenMaterial&&r.scene&&r.camera&&e.push(r);for(let e of r.effects??[])for(let t of Object.values(e))t?.fullscreenMaterial&&n(t)}};for(let e of ie.passes??[])n(e);for(let t of e)await ma(()=>{let e=M.getRenderTarget();M.setRenderTarget(t.renderToScreen?null:Se);try{M.compile(t.scene,t.camera)}finally{M.setRenderTarget(e)}});for(let e of[...M.info?.programs??[]])await ma(()=>e.getUniforms?.())}da(we),Pe(()=>{da(null),Se?.dispose?.()}),Pe(xe);let Te=0,q=0,Ee=Vr.subscribe(e=>Te=e);Pe(Ee),Kw(e=>{if(be&&!M.xr.isPresenting||pa()&&!M.xr.isPresenting)return;if(Te>0&&!M.xr.isPresenting){let e=performance.now();if(e-q<Te)return;q=e}let t=oe.length===0&&A?.selection.size===0&&ee?.selection.size===0;!Q(W)&&++G>10&&I(W,!0);for(let t of R)t.def?.tick?.(t.object,e);M.xr.isPresenting||t?M.render(j,te.current):(ie.render(e),De())},{stage:P,autoInvalidate:!1});let J=null;function De(){let e=g(),t=_();if(!e||!t)return;let n=v()?.getObjectByProperty(`uuid`,t);if(!n)return;J=$me(n,e.w/e.h,J);let r=n.visible,i=j.getObjectByName(`camera-frustums`),a=i?.visible??!1,s=y()?.getHelper?.()??y(),c=s?.visible??!1;n.visible=!1,i&&(i.visible=!1),s&&(s.visible=!1);let l=vR(e,M.domElement.clientHeight||o().height);M.setScissorTest(!0),M.setScissor(l.x,l.y,l.w,l.h),M.setViewport(l.x,l.y,l.w,l.h),M.render(j,J),M.setScissorTest(!1),M.setViewport(0,0,o().width,o().height),n.visible=r,i&&(i.visible=a),s&&(s.visible=c)}function Oe(e,t){(v()?.getObjectByProperty(`uuid`,t))?.traverse(t=>{t.isMesh&&e.add(t)})}Qe(()=>{A.selection.clear();let e=!!(b()||x())&&!S(),t=w()||T()===`interact`;if(v()&&!e&&!t)for(let e of E())Oe(A.selection,e);if(ee.selection.clear(),D()&&v()&&!t)for(let e=0;e<D().length;e++)Oe(ee.selection,D()[e][1])}),_e(()=>{typeof localStorage<`u`&&nt.getItem(`debugStores`)&&(window.__outlineDebug=()=>({selected:A?.selection.size??-1,locked:ee?.selection.size??-1,selectedColor:A?.visibleEdgeColor.getHexString()??``,lockedColor:ee?.visibleEdgeColor.getHexString()??``})),typeof localStorage<`u`&&nt.getItem(`debugStores`)&&(window.__postDebug=()=>({chain:(ie.passes??[]).map(e=>{if(e===F)return`render`;if(e===ae)return`outline-locked`;if(e===L)return`outline-selected`;let t=oe.indexOf(e);return t>=0?`stack:`+(se[t]?.kinds??[]).join(`+`):`other`}),composerPasses:(ie.passes??[]).length,composerBufferWidth:ie.inputBuffer?.width??null,outlinedSelected:A?.selection.size??0,outlinedLocked:ee?.selection.size??0,stackPasses:oe.length,normals:!!de,graphs:R.filter(e=>e.object?.tpGraphKey).map(e=>({key:e.object.tpGraphKey,normals:!!e.object.tpNeedsNormals,clock:!!e.object.tpUsesClock,depth:!!(e.object.getAttributes?.()&1)})),plan:se,skipped:ce.map(e=>e.kind),kinds:R.map(e=>e.kind),outlinesLast:(ie.passes??[]).at(-2)===ae&&(ie.passes??[]).at(-1)===L,postWarm:Q(W),postOk:V,adoptedFrom:ve,stackTonemaps:le,rendererToneMapping:M.toneMapping,ao:(()=>{let e=R.find(e=>e.kind===`ao`)?.object?.configuration;return e?{aoRadius:e.aoRadius,intensity:e.intensity,distanceFalloff:e.distanceFalloff,halfRes:e.halfRes}:null})()}))}),ue(),k()}function TDe(e,t){Ce(t,!1);let n=()=>z(li,`$vrMenuOpen`,c),r=()=>z(Zr,`$vrObjectsPanelOpen`,c),i=()=>z(ai,`$vrSettingsPanelOpen`,c),a=()=>z(tb,`$inputClaims`,c),o=()=>z(qr,`$vrGrabbedHand`,c),s=()=>z(oi,`$vrFlying`,c),[c,l]=Ve(),{renderer:u,camera:d,scene:f}=Ww(),{xr:p}=u,m=new Pn;m.position.set(0,0,0),m.name=`dolly`,f.add(m),m.add(d.current);let h=new hn,g=new hn;Kw(e=>{let t=p.getController(0),c=p.getController(1);m.add(t),m.add(c),m.add(p.getControllerGrip(0)),m.add(p.getControllerGrip(1));let l=u.xr.getSession();if(!l||n()||r()||i()||a().includes(`locomotion`)||a().includes(`sticks`)||Eue(e,l))return;let f=tme(`move`);if(o()===f||o()===`both`||sue()||yfe())return;let _=p.getReferenceSpace();if(_){p.getCamera(d.current).getWorldDirection(h);for(let e of l.inputSources){if(!e.gamepad||e.handedness!==f)continue;let t=e.gamepad.axes,n=!!e.gamepad.buttons[1]?.pressed;g.set(0,0,-1).applyQuaternion(p.getController($_(f)).getWorldQuaternion(new zt));let r=Xle({x:t[2]??0,y:t[3]??0,grip:n,flying:s(),aimDir:{x:g.x,y:g.y,z:g.z},cameraDir:{x:h.x,y:h.y,z:h.z},speed:.05*Iue()});(r.x||r.y||r.z)&&p.setReferenceSpace(_.getOffsetReferenceSpace(new XRRigidTransform(r)))}}}),R(),ue(),l()}var EDe=64,DDe=8,yR=.004,bR=`touchLookSpeed`,xR={min:.25,max:3};function SR(e,t,n){return Math.min(n,Math.max(t,e))}function ODe(){if(typeof localStorage>`u`)return 1;let e=Number(nt.getItem(bR));return!Number.isFinite(e)||e<=0?1:SR(e,xR.min,xR.max)}var CR=Ue(ODe());function wR(e){let t=SR(Number(e)||1,xR.min,xR.max);CR.set(t);
2235try{typeof localStorage<`u`&&nt.setItem(bR,String(t))}catch{}}var TR=Ue({x:0,y:0}),ER=Ue({move:null,look:null}),DR=0,OR=0;function kR(e,t){DR+=e,OR+=t}function AR(){let e={dx:DR,dy:OR};return DR=0,OR=0,e}function kDe(){return DR!==0||OR!==0}function jR(){DR=0,OR=0;let e=U(TR);(e.x!==0||e.y!==0)&&TR.set({x:0,y:0});let t=U(ER);(t.move||t.look)&&ER.set({move:null,look:null})}function MR(e,t,n=64){let r=Math.hypot(e,t);if(r<1)return{x:0,y:0};let i=Math.min(1,r/Math.max(8,n))/r;return{x:e*i,y:t*i}}function ADe(){return{move:U(TR),sticks:U(ER),lookDx:DR,lookDy:OR}}function jDe(e,t){Ce(t,!0);let n=()=>z(S,`$cameraParent`,g),r=()=>z(Jr,`$playPointerFree`,g),i=()=>z(ki,`$isLocked`,g),a=()=>z(Pi,`$globalScene`,g),o=()=>z(Es,`$peers`,g),s=()=>z(as,`$userdata`,g),c=()=>z(tb,`$inputClaims`,g),l=()=>z(CR,`$touchLookSpeed`,g),u=()=>z(Df,`$charControl`,g),d=()=>z(Yre,`$playMoveSpeed`,g),f=()=>z(Zu,`$gamepadPrefs`,g),p=()=>z(TR,`$touchMove`,g),m=()=>z(Wi,`$playerCam`,g),h=()=>z(Ri,`$editorCam`,g),[g,_]=Ve(),{renderer:v,camera:y,invalidate:b}=Ww(),x=v.domElement,S=Mw(),C=J(t,`minPolarAngle`,7),w=J(t,`maxPolarAngle`,7),T=J(t,`pointerSpeed`,7),E=J(t,`moveSpeed`,7);C(0),w(Math.PI),T(1),E(.1);let D=1.12,O={forward:0,backward:0,left:0,right:0,up:0,down:0},k=new rt(0,0,0,`YXZ`),A=Math.PI/2,ee=2.5;if(!v)throw Error(`Threlte Context missing: Is <PointerLockControls> a child of <Canvas>?`);if(!(e=>e.isCamera)(n()))throw Error(`Parent missing: <PointerLockControls> need to be a child of a <Camera>`);let j=()=>{b()},M=Wr(),te=(e,t,n)=>{k.setFromQuaternion(e.quaternion),k.y-=t,k.x-=n,k.x=Math.max(A-w(),Math.min(A-C(),k.x)),e.quaternion.setFromEuler(k)},ne=!1;Qe(()=>{let e=r();K(()=>{e&&!ne?(ne=!0,O={forward:0,backward:0,left:0,right:0,up:0,down:0},document.pointerLockElement===x&&document.exitPointerLock()):!e&&ne&&(ne=!1,!M&&!Sl()&&i()===!0&&document.pointerLockElement!==x&&F(!0))})});let N=null,P=0;function re(){N&&clearTimeout(N),N=null,P=0}function ie(){N||Date.now()>=P||(N=setTimeout(()=>{N=null,F(!1)},275))}function F(e){if(M||Sl()||U(ki)!==!0||U(Jr)||document.pointerLockElement===x||document.visibilityState===`hidden`)return re();e&&(P=Date.now()+2500);let t=x.requestPointerLock({unadjustedMovement:!0});t?.catch&&t.catch(()=>ie())}Qe(()=>{i()?(F(!0),K(()=>{if(nte())return;let e=Tf(a()),t=n();if(e&&t){let n=o()?.peer?.id??`me`,r=Vre(e,(s()??[]).map(e=>e[0]),n);r&&(t.position.x=r.x,t.position.y=.8,t.position.z=r.z)}})):re()}),Kw(e=>{if(c().includes(`keys`)||r())return;let t=n();if(t&&i()===!0){let e=AR();if(e.dx||e.dy){let n=yR*T()*l();te(t,e.dx*n,e.dy*n),j()}}let o=u(),s=d()??o?.speed??E();if(o?.mode===`walk`){let t=n();if(t&&i()){let n=f(),r=n.enabled?ib():{lx:0,ly:0,rx:0,ry:0},i=p(),a=(n.swapSticks?r.rx:r.lx)||i.x,c=(n.swapSticks?r.ry:r.ly)||i.y,l={forward:O.forward||+(c<-.01),backward:O.backward||+(c>.01),left:O.left||+(a<-.01),right:O.right||+(a>.01)};Wre(t,o,e,Gre(t,l,s,e));let u=n.swapSticks?r.lx:r.rx,d=n.swapSticks?r.ly:r.ry;if(u||d){let r=ee*T()*n.lookSensitivity*e;te(t,u*r,(n.invertY?-d:d)*r),j()}}return}let m=n()?.position.x??0,h=n()?.position.z??0,g=i()===!0&&n()?n().getWorldPosition(new hn):null;O.forward===1&&n().translateZ(-s),O.backward===1&&n().translateZ(s),O.left===1&&n().translateX(-s),O.right===1&&n().translateX(s);let _=f();if(i()===!0&&n()){let t=_.enabled?ib():{lx:0,ly:0,rx:0,ry:0},r=p(),i=(_.swapSticks?t.rx:t.lx)||r.x,a=(_.swapSticks?t.ry:t.ly)||r.y,o=_.swapSticks?t.lx:t.rx,s=_.swapSticks?t.ly:t.ry;if((i||a)&&(n().translateX(i*E()),n().translateZ(a*E())),o||s){let t=ee*T()*_.lookSensitivity*e;te(n(),o*t,(_.invertY?-s:s)*t)}(i||a||o||s)&&j()}let v=yl(a());if(!v.grounded&&O.up===1&&n().translateY(-s),!v.grounded&&O.down===1&&n().translateY(s),v.grounded&&i()&&n()){let e=n();e.position.y=v.eyeHeight}let y=n();if(i()&&y){let e=Tf(a());if(e){let t=Hre(e,m,h,y.position.x-m,y.position.z-h,.3);y.position.x=t.x,y.position.z=t.z}}i()===!0&&y&&g&&qre(y,g)},{autoInvalidate:!1});let ae=()=>document.exitPointerLock();x.addEventListener(`pointermove`,R),x.addEventListener(`pointerdown`,le),x.ownerDocument.addEventListener(`pointerlockchange`,ce),x.ownerDocument.addEventListener(`pointerlockerror`,de),x.ownerDocument.addEventListener(`ke
2235ydown`,L),x.ownerDocument.addEventListener(`keyup`,oe),window.addEventListener(`wheel`,I),Pe(()=>{x.removeEventListener(`pointermove`,R),x.removeEventListener(`pointerdown`,le),x.ownerDocument.removeEventListener(`pointerlockchange`,ce),x.ownerDocument.removeEventListener(`pointerlockerror`,de),x.ownerDocument.removeEventListener(`keydown`,L),x.ownerDocument.removeEventListener(`keyup`,oe),window.removeEventListener(`wheel`,I),re()});function I(e){if(!i()||r()||!n()||e.defaultPrevented)return;let t=Ure(E()),a=e.deltaY>0?1/D:D;Xre(t*a)}function L(e){if(!(r()&&e.code!==`Escape`))switch(e.code){case`KeyW`:O.forward=1;break;case`KeyS`:O.backward=1;break;case`KeyA`:O.left=1;break;case`KeyD`:O.right=1;break;case`KeyQ`:O.up=1;break;case`KeyE`:O.down=1;break;case`Space`:u()?.mode===`walk`&&Ef(!0);break;case`Escape`:if(i()){if(!document.pointerLockElement&&U(Lu).open){Iu();break}if(!document.pointerLockElement&&zu()){Pu();break}document.pointerLockElement?document.exitPointerLock():ke(ki,!1)}}}function oe(e){switch(e.code){case`KeyW`:O.forward=0;break;case`KeyS`:O.backward=0;break;case`KeyA`:O.left=0;break;case`KeyD`:O.right=0;break;case`KeyQ`:O.up=0;break;case`KeyE`:O.down=0;break;case`Space`:Ef(!1)}}function R(e){if(!i()||document.pointerLockElement!==x||!n())return;let{movementX:t,movementY:r}=e;te(n(),t*.002*T(),r*.002*T()),j()}let se=!1;Qe(()=>{y.set(i()===!0?m():h())});function ce(){if(document.pointerLockElement===x)se=!0,re(),ke(ki,!0),r()&&document.exitPointerLock();else if(se){if(se=!1,r()||Pu())return;ke(ki,!1)}}function le(){M||Sl()||i()===!0&&!r()&&document.pointerLockElement!==x&&x.requestPointerLock({unadjustedMovement:!0})?.catch?.(()=>{})}function de(){if(Date.now()<P){ie();return}console.error(`PointerLockControls: Unable to use Pointer Lock API`)}var fe=ue({unlock:ae});return _(),fe}var NR={body:`#4f83cc`,hat:`none`,face:`label`,shape:`sphere`,showLabel:!0},PR=[{value:`sphere`,name:`Sphere`},{value:`box`,name:`Box`},{value:`capsule`,name:`Capsule`},{value:`cone`,name:`Cone`}];function FR(e){return{...NR,...e??{}}}function IR(e){return{sphere:0,box:.02,capsule:.2,cone:.28}[e]??0}function LR(e,t){return e.face===`image`&&!!t}var RR=V(`<!> <!>`,1),MDe=V(`<!> <!> <!> <!>`,1);function NDe(e,t){Ce(t,!1);let n=()=>z(Ece,`$speakingPeers`,r),[r,i]=Ve(),a=F(),o=F(),c=J(t,`user`,8),{camera:l}=Ww(),u=F(null),f=F(null),p=F(null);Kw(()=>{let e=l.current;e&&(Q(f)&&Q(f).lookAt(e.getWorldPosition(new hn)),Q(p)&&Q(p).lookAt(e.getWorldPosition(new hn)))}),d(()=>s(c()),()=>{I(a,FR(c()[5]))}),d(()=>(Q(a),s(c())),()=>{I(o,LR(Q(a),c()[2]))}),d(()=>(Q(a),s(c()),Dn),()=>{Q(a).face===`image`&&c()[2]?new Jn().load(c()[2],e=>{e.colorSpace=sr,I(u,e)}):I(u,null)}),h(),R(),Uw.Group(e,{position:[0,1e3,0],get name(){return s(c()),K(()=>c()[0])},children:(e,t)=>{var r=MDe(),i=N(r),l=e=>{{let t=ze(()=>(s(c()),K(()=>`${c()[0]}-label`)));Uw.Group(e,{position:[0,1.05,0],get name(){return Q(t)},get ref(){return Q(p)},set ref(e){I(p,e)},children:(e,t)=>{{let t=ze(()=>(s(c()),K(()=>c()[1]||c()[0])));tD(e,{color:`#ffffff`,outlineColor:`#0b0e14`,outlineWidth:.02,fontSize:.26,anchorX:`center`,anchorY:`middle`,get text(){return Q(t)}})}},$$slots:{default:!0},$$legacy:!0})}};G(i,e=>{Q(a),K(()=>Q(a).showLabel)&&e(l)});var d=g(i,2),m=e=>{{let t=ze(()=>(s(c()),K(()=>`${c()[0]}-face-card`)));Uw.Mesh(e,{get name(){return Q(t)},get ref(){return Q(f)},set ref(e){I(f,e)},children:(e,t)=>{var n=RR(),r=N(n);Uw.PlaneGeometry(r,{args:[1.1,1.1]});var i=g(r,2);Uw.MeshBasicMaterial(i,{get map(){return Q(u)},transparent:!0,get side(){return s(Dn),K(()=>2)}}),X(e,n)},$$slots:{default:!0},$$legacy:!0})}},h=e=>{{let t=ze(()=>(s(c()),K(()=>`${c()[0]}-body`)));Uw.Mesh(e,{castShadow:!0,get name(){return Q(t)},children:(e,t)=>{var n=RR(),r=N(n),i=e=>{Uw.BoxGeometry(e,{args:[1,1,1]})},o=e=>{Uw.CapsuleGeometry(e,{args:[.45,.7,6,12]})},s=e=>{Uw.ConeGeometry(e,{args:[.62,1.2,20]})},c=e=>{Uw.SphereGeometry(e,{args:[.59,16,12]})};G(r,e=>{Q(a),K(()=>Q(a).shape===`box`)?e(i):(Q(a),K(()=>Q(a).shape===`capsule`)?e(o,1):(Q(a),K(()=>Q(a).shape===`cone`)?e(s,2):e(c,-1)))});var l=g(r,2);Uw.MeshBasicMaterial(l,{get color(){return Q(a),K(()=>Q(a).body)}}),X(e,n)},$$slots:{default:!0}})}};G(d,e=>{Q(o)&&Q(u)?e(m):e(h,-1)});var _=g(d,2),v=e=>{{let t=ze(()=>(s(c()),K(()=>`${c()[0]}-speaking`)));Uw.Mesh(e,{"rotation.x":K(()=>-Math.PI/2),"position.y":-.55,get name(){return Q(t)},children:(e,t)=>{var n=RR(),r=N(n);Uw.RingGeometry(r,{args:[.62,.78,24]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#22c55e`,get side(){return s(Dn),K(()=>2)}}),X(e,n)},$$slots:{default:!0}})}},y=q(()=>(n(),s(c()),K(()=>n().includes(c()[0]))));G(_,e=>{Q(y)&&e(v)}
2235);var b=g(_,2),x=e=>{{let t=ze(()=>(s(IR),Q(a),K(()=>[0,IR(Q(a).shape),0]))),n=ze(()=>(s(c()),K(()=>`${c()[0]}-hat`)));Uw.Group(e,{get position(){return Q(t)},get name(){return Q(n)},children:(e,t)=>{var n=fe(),r=N(n),i=e=>{var t=RR(),n=N(t);Uw.Mesh(n,{position:[0,.45,0],children:(e,t)=>{var n=RR(),r=N(n);Uw.SphereGeometry(r,{args:K(()=>[.36,12,8,0,Math.PI*2,0,Math.PI/2])});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#2d5c9e`}),X(e,n)},$$slots:{default:!0}});var r=g(n,2);Uw.Mesh(r,{position:[0,.47,-.35],rotation:[-.15,0,0],children:(e,t)=>{var n=RR(),r=N(n);Uw.BoxGeometry(r,{args:[.42,.04,.35]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#2d5c9e`}),X(e,n)},$$slots:{default:!0}}),X(e,t)},o=e=>{var t=RR(),n=N(t);Uw.Mesh(n,{position:[0,.78,0],children:(e,t)=>{var n=RR(),r=N(n);Uw.CylinderGeometry(r,{args:[.26,.26,.45]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#1c1c1c`}),X(e,n)},$$slots:{default:!0}});var r=g(n,2);Uw.Mesh(r,{position:[0,.56,0],children:(e,t)=>{var n=RR(),r=N(n);Uw.CylinderGeometry(r,{args:[.45,.45,.05]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#1c1c1c`}),X(e,n)},$$slots:{default:!0}}),X(e,t)},c=e=>{var t=RR(),n=N(t);Uw.Mesh(n,{position:[0,.6,0],children:(e,t)=>{var n=RR(),r=N(n);Uw.CylinderGeometry(r,{args:[.3,.34,.22,8,1,!0]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#d4af37`,get side(){return s(Dn),K(()=>2)}}),X(e,n)},$$slots:{default:!0}});var r=g(n,2);B(r,0,()=>[0,1,2,3,4,5],Be,(e,t)=>{{let n=ze(()=>K(()=>[Math.cos(t*Math.PI/3)*.29,.76,Math.sin(t*Math.PI/3)*.29]));Uw.Mesh(e,{get position(){return Q(n)},children:(e,t)=>{var n=RR(),r=N(n);Uw.ConeGeometry(r,{args:[.05,.14,4]});var i=g(r,2);Uw.MeshBasicMaterial(i,{color:`#d4af37`}),X(e,n)},$$slots:{default:!0}})}}),X(e,t)};G(r,e=>{Q(a),K(()=>Q(a).hat===`cap`)?e(i):(Q(a),K(()=>Q(a).hat===`tophat`)?e(o,1):(Q(a),K(()=>Q(a).hat===`crown`)&&e(c,2)))}),X(e,n)},$$slots:{default:!0}})}};G(b,e=>{Q(a),K(()=>Q(a).hat!==`none`)&&e(x)}),X(e,r)},$$slots:{default:!0}}),ue(),i()}var zR=Ue(typeof localStorage<`u`?nt.getItem(`myHandModel`)??``:``),BR=Ue({}),VR=Ue({}),HR=new Set;function UR(e){zR.set(e??``),e&&Sf(e);let t=U(Es);t&&t.send({type:`handmodel`,peerId:t.peer.id,hash:e??``})}function WR(){return{type:`handmodel`,peerId:U(Es)?.peer?.id,hash:U(zR)}}function GR(e){e?.peerId&&(BR.update(t=>{let n={...t};return e.hash?n[e.peerId]=e.hash:delete n[e.peerId],n}),e.hash&&qR(e.hash))}function KR(e){BR.update(t=>{let n={...t};return delete n[e],n})}async function qR(e){if(!e||HR.has(e)||U(VR)[e])return;let t=ka(e);if(!t){xf(e);return}HR.add(e);try{let n=await Ja(t.id);if(!n)throw Error(`no bytes`);let r=await n.arrayBuffer(),i=await new Promise((e,t)=>new Da().parse(r,``,e,t));VR.update(t=>({...t,[e]:i.scene}))}catch(t){console.log(`hand model parse failed`,t),HR.delete(e)}}var JR=!1;function YR(){JR||typeof window>`u`||(JR=!0,zR.subscribe(e=>{try{nt.setItem(`myHandModel`,e??``)}catch{}}),setInterval(()=>{Object.values(U(BR)).forEach(e=>qR(e))},2e3))}var XR=V(`<!> <!>`,1),PDe=V(`<!> <!> <!>`,1);function FDe(e,t){Ce(t,!1);let n=()=>z(BR,`$peerHandModels`,_),r=()=>z(VR,`$handModelCache`,_),i=()=>z(Fi,`$worldRig`,_),a=()=>z(Wi,`$playerCam`,_),o=()=>z(as,`$userdata`,_),c=()=>z(Es,`$peers`,_),l=()=>z(Bb,`$currentLevel`,_),u=()=>z(Xb,`$peerScenes`,_),d=()=>z(Vd,`$sessionHost`,_),f=()=>z(xce,`$colocatedPeers`,_),p=()=>z(si,`$peerHands`,_),m=()=>z(_g,`$colocatedGhostHands`,_),h=()=>z(Gi,`$peerHandStyle`,_),[_,v]=Ve(),y=(e,t,i=!1)=>{let a=n()[e],o=a?r()[a]:null;if(!o)return null;let s=o.clone(!0);return t===`left`&&(s.scale.x*=-1),i&&s.traverse(e=>{if(!e.material)return;let t=e=>{let t=e.clone();return t.transparent=!0,t.opacity=vg,t};e.material=Array.isArray(e.material)?e.material.map(t):t(e.material)}),s},b=J(t,`position`,24,()=>[0,0,0]),x={left:5211084,right:13400143},S=e=>{let t=[];for(let n=0;n+2<e.length;n+=3)t.push([e[n],e[n+1],e[n+2]]);return t},C=F(null);Kw(()=>{Q(C)&&i()&&(Q(C).position.copy(i().position),Q(C).quaternion.copy(i().quaternion),Q(C).scale.copy(i().scale))}),R();var w=PDe(),T=N(w);TDe(T,{});var E=g(T,2);Uw.Group(E,{"position.y":.9,children:(e,t)=>{Uw.PerspectiveCamera(e,{fov:90,far:5e3,get"position.x"(){return s(b()),K(()=>b()[0])},get"position.y"(){return s(b()),K(()=>b()[1])},get"position.z"(){return s(b()),K(()=>b()[2])},get ref(){return Se(),a()},set ref(e){ke(Wi,e)},$$events:{create:({ref:e})=>{e.lookAt(new hn(0,2,0))}},children:(e,t)=>{jDe(e,{})},$$slots:{default:!0},$$legacy:!0})},$$slots:{default:!0}});var D=g(E,2);Uw.Group(D,{get ref(){return Q(C)},set ref(e){I(C,e)},children:(e,t)=>{var n=fe(),r=N(n);B(r,1,o,Be,(e,t)=>{var n=fe(),r=N(n),i=e=>{let n=ze(()=>(f(),Q(t),K(()=>f().has(Q(t)[0]))));Uw.Group(e,{children:(e,r)=>{var i=XR(),a=N(i),o=e=>{NDe(e,{get user(){return Q(t)}})};G(a,e=>{Q(n)||e(o)});var c=g(a,2),l=e=>{var r=fe(),i=N(r);B(i,0,()=>[`left`,`right`],Be,(e,r)=>{var i=fe(),a=N(i),o=e=>{let i=ze(()=>(Q(t),s(Q(n)),K(()=>y(Q(t)[0],r,Q(n)))));{let a=ze(()=>(Q(t),K(()=>`${Q(t)[0]}-hand-${r}`)));Uw.Group(e,{get name(){return Q(a)},get position(){return p(),Q(t),K(()=>p()[Q(t)[0]][r].pos)},get rotation(){return p(),Q(t),K(()=>p()[Q(t)[0]][r].rot)},children:(e,a)=>{var o=fe(),c=N(o),l=e=>{Uw(e,{get is(){return Q(i)}})},u=e=>{var i=fe(),a=N(i),o=e=>{var i=fe(),a=N(i);B(a,1,()=>(s(J_),p(),Q(t),K(()=>J_(p()[Q(t)[0]][r].joints))),Be,(e,t)=>{Uw.Mesh(e,{get position(){return Q(t),K(()=>Q(t).pos)},get rotation(){return Q(t),K(()=>Q(t).rot)},children:(e,i)=>{var a=XR(),o=N(a);{let e=ze(()=>(Q(t),K(()=>[Q(t).r,Math.max(Q(t).len-Q(t).r,.004),3,8])));Uw.CapsuleGeometry(o,{get args(){return Q(e)}})}var s=g(o,2);{let e=ze(()=>Q(n)?vg:1);Uw.MeshStandardMaterial(s,{get color(){return K(()=>x[r])}
2235,roughness:.7,get transparent(){return Q(n)},get opacity(){return Q(e)}})}X(e,a)},$$slots:{default:!0}})}),X(e,i)},c=e=>{var i=fe(),a=N(i);B(a,1,()=>(s(Y_),p(),Q(t),K(()=>Y_(p()[Q(t)[0]][r].joints))),Be,(e,t)=>{Uw.Mesh(e,{get position(){return Q(t),K(()=>Q(t).pos)},get rotation(){return Q(t),K(()=>Q(t).rot)},children:(e,i)=>{var a=XR(),o=N(a);{let e=ze(()=>(Q(t),K(()=>[.009,Q(t).len,.009])));Uw.BoxGeometry(o,{get args(){return Q(e)}})}var s=g(o,2);{let e=ze(()=>Q(n)?vg:1);Uw.MeshStandardMaterial(s,{get color(){return K(()=>x[r])},get transparent(){return Q(n)},get opacity(){return Q(e)}})}X(e,a)},$$slots:{default:!0}})}),X(e,i)},l=e=>{var i=fe(),a=N(i);B(a,1,()=>(p(),Q(t),K(()=>S(p()[Q(t)[0]][r].joints))),Be,(e,t)=>{Uw.Mesh(e,{get position(){return Q(t)},children:(e,t)=>{var i=XR(),a=N(i);Uw.SphereGeometry(a,{args:[.008,8,8]});var o=g(a,2);{let e=ze(()=>Q(n)?vg:1);Uw.MeshStandardMaterial(o,{get color(){return K(()=>x[r])},get transparent(){return Q(n)},get opacity(){return Q(e)}})}X(e,i)},$$slots:{default:!0}})}),X(e,i)};G(a,e=>{h()===`model`?e(o):h()===`hands`?e(c,1):e(l,-1)}),X(e,i)},d=e=>{var t=XR(),i=N(t);Uw.Mesh(i,{children:(e,t)=>{var i=XR(),a=N(i);Uw.BoxGeometry(a,{args:[.06,.06,.14]});var o=g(a,2);{let e=ze(()=>Q(n)?vg:1);Uw.MeshStandardMaterial(o,{get color(){return K(()=>x[r])},get transparent(){return Q(n)},get opacity(){return Q(e)}})}X(e,i)},$$slots:{default:!0}});var a=g(i,2);Uw.Mesh(a,{position:[0,0,-.12],rotation:K(()=>[Math.PI/2,0,0]),children:(e,t)=>{var r=XR(),i=N(r);Uw.CylinderGeometry(i,{args:[.006,.006,.1]});var a=g(i,2);{let e=ze(()=>Q(n)?vg:1);Uw.MeshStandardMaterial(a,{color:16777215,get transparent(){return Q(n)},get opacity(){return Q(e)}})}X(e,r)},$$slots:{default:!0}}),X(e,t)};G(c,e=>{Q(i)?e(l):(p(),Q(t),K(()=>p()[Q(t)[0]][r].joints?.length)?e(u,1):e(d,-1))}),X(e,o)},$$slots:{default:!0}})}};G(a,e=>{p(),Q(t),K(()=>p()[Q(t)[0]][r])&&e(o)}),X(e,i)}),X(e,r)};G(c,e=>{p(),Q(t),s(Q(n)),m(),K(()=>p()[Q(t)[0]]?.active&&(!Q(n)||m()))&&e(l)}),X(e,i)},$$slots:{default:!0}})},a=q(()=>(Q(t),c(),l(),s(Gb),u(),d(),K(()=>Q(t)[0]!=c().peer.id&&!l()?.private&&!Gb(u(),l()?.name??``,Q(t)[0],d()))));G(r,e=>{Q(a)&&e(i)}),X(e,n)}),X(e,n)},$$slots:{default:!0},$$legacy:!0}),X(e,w),ue(),v()}var IDe=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),LDe=V(`<!> <!> <!> <!>`,1),RDe=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1);function zDe(e,t){Ce(t,!1);let n=()=>z(phe,`$activeOrbit`,Te),r=()=>z(ki,`$isLocked`,Te),i=()=>z(Pi,`$globalScene`,Te),a=()=>z(as,`$userdata`,Te),o=()=>z(Es,`$peers`,Te),s=()=>z(ni,`$showGrid`,Te),c=()=>z(Fi,`$worldRig`,Te),l=()=>z(zs,`$specatorMode`,Te),u=()=>z(wi,`$isVRMode`,Te),f=()=>z(Ui,`$objectsGroup`,Te),p=()=>z(zi,`$TControls`,Te),m=()=>z(Kr,`$selectedObjects`,Te),_=()=>z(mm,`$editingObject`,Te),v=()=>z(Up,`$faceEditObject`,Te),y=()=>z(nM,`$splineEditObject`,Te),b=()=>z(Di,`$selectedObject`,Te),x=()=>z(QO,`$doubleClickAction`,Te),S=()=>z(c_,`$drawMode`,Te),C=()=>z(xh,`$sculptObject`,Te),w=()=>z(l_,`$drawTool`,Te),T=()=>z(Ds,`$multiSelectMode`,Te),E=()=>z(mi,`$marqueeRect`,Te),D=()=>z(am,`$faceEditSubmode`,Te),O=()=>z(Mp,`$faceEditOp`,Te),k=()=>z(Fj,`$flattenPicking`,Te),A=()=>z(uN,`$snapAnchorPicking`,Te),ee=()=>z(Dp,`$meshPivotPicking`,Te),j=()=>z(mP,`$measureMode`,Te),M=()=>z(Vp,`$faceEditMulti`,Te),te=()=>z(wP,`$lightProxiesGroup`,Te),ne=()=>z(Ay,`$pinsGroup`,Te),P=()=>z(My,`$showNotePins`,Te),re=()=>z(Ci,`$lockedObjects`,Te),ie=()=>z(Jv,`$vrKeyboardTarget`,Te),ae=()=>z(li,`$vrMenuOpen`,Te),L=()=>z(Zr,`$vrObjectsPanelOpen`,Te),oe=()=>z(Ii,`$vrPaletteOpen`,Te),se=()=>z(pi,`$vrPropsPanelOpen`,Te),ce=()=>z(fi,`$vrPrefabsPanelOpen`,Te),le=()=>z(Qr,`$vrChatPanelOpen`,Te),de=()=>z(ai,`$vrSettingsPanelOpen`,Te),pe=()=>z(Xr,`$vrApprovePanelOpen`,Te),B=()=>z(ti,`$vrEditMenuOpen`,Te),V=()=>z(Bi,`$vrSnapMenuOpen`,Te),he=()=>z(Oi,`$vrToolMode`,Te),H=()=>z(vc,`$surfaceSnap`,Te),ge=()=>z(Ri,`$editorCam`,Te),W=()=>z(px,`$cameraPreview`,Te),ve=()=>z(Ki,`$orbitControls`,Te),ye=()=>z(ii,`$viewMode`,Te),be=()=>z(_i,`$passthroughActive`,Te),xe=()=>z(aee,`$vrPostEnabled`,Te),we=()=>z(WI,`$xrOfferMode`,Te),[Te,q]=Ve(),Ee=null,{scene:J,camera:De,renderer:Oe,dpr:Ae,dom:je}=Ww();Pe((e=>!e||typeof e.setPointerCapture!=`function`||e.__captureGuarded?()=>{}:(e.__captureGuarded=!0,e.setPointerCapture=function(e){if(!this.ownerDocument?.pointerLockElement)return Element.prototype.setPointerCapture.call(this,e)},()=>{delete e.setPointerCapture,delete e.__captureGuarded}))(je));let Me=new Set;function Ne(){let e=n();if(r()===!0)e&&e.enabled!==!1&&(e.enabled=!1,Me.add(e));else if(Me.size){for(let e of Me)e.enabled=!0;Me.clear()}}let Fe=!1,Ie=1,Le=Hr.subscribe(e=>{Fe=e.presenceSlow,e.dprScale!==Ie&&(Ie=e.dprScale,Ae.set((typeof window<`u`&&window.devicePixelRatio||1)*e.dprScale))});Pe(Le),ke(Pi,J),ke(xi,Oe),me(Pi,K(i).background=new ot(1052688),K(i)),ke(pc,nt.getItem(`username`)),a().push([o().peer.id,nt.getItem(`username`),nt.getItem(`avatar`),null,
2235null,U(Os)]),ke(as,a()),ke(ni,nt.getItem(`showGrid`)!==`false`),ke(ei,nt.getItem(`vrOverride`)),De.current.position.set(10.5,7.57,11.4);let Re=De.current.fov;setTimeout(()=>{nt.getItem(`camx`)&&(De.current.position.x=nt.getItem(`camx`)),nt.getItem(`camy`)&&(De.current.position.y=nt.getItem(`camy`)),nt.getItem(`camz`)&&(De.current.position.z=nt.getItem(`camz`))},1e3),Cxe(),mo(.5);let Y=0,Be=0,He=new hn;Xb.subscribe(()=>He.set(1e9,1e9,1e9));let Ue=new zt,Z=new hn,We=new zt,Ge=new rt,Ke=[new hn(1e9,0,0),new hn(1e9,0,0)],qe=0,Je=[-1,-1],Ye=new hn,Xe=new zt,Ze=new rt;function Qe(e){let t=Oe.xr.getController(e);return t.getWorldPosition(Z),t.getWorldQuaternion(We),B_(c(),Z,We),Ge.setFromQuaternion(We),{pos:Z.toArray(),rot:[Ge.x,Ge.y,Ge.z],joints:[]}}let $e=[`wrist`,`thumb-metacarpal`,`thumb-phalanx-proximal`,`thumb-phalanx-distal`,`thumb-tip`,`index-finger-metacarpal`,`index-finger-phalanx-proximal`,`index-finger-phalanx-intermediate`,`index-finger-phalanx-distal`,`index-finger-tip`,`middle-finger-metacarpal`,`middle-finger-phalanx-proximal`,`middle-finger-phalanx-intermediate`,`middle-finger-phalanx-distal`,`middle-finger-tip`,`ring-finger-metacarpal`,`ring-finger-phalanx-proximal`,`ring-finger-phalanx-intermediate`,`ring-finger-phalanx-distal`,`ring-finger-tip`,`pinky-finger-metacarpal`,`pinky-finger-phalanx-proximal`,`pinky-finger-phalanx-intermediate`,`pinky-finger-phalanx-distal`,`pinky-finger-tip`],et=new hn;function $(e=0){let t=Oe.xr.getSession();if(!t)return null;let n=[...t.inputSources],r=Oe.xr.getController(e)?.userData?.handedness;return r&&n.find(e=>e.handedness===r)||n[e]||null}function tt(e=0){return Oe.xr.getController(e)?.userData?.handedness||$(e)?.handedness||null}let it=FO(`left`),at=FO(`right`);function st(e=`left`){let t=(e===`left`?it:at).current?.hand,n=t?.joints?.wrist;if(!n||!n.visible)return null;n.getWorldPosition(Z),n.getWorldQuaternion(We),B_(c(),Z,We),Ge.setFromQuaternion(We);let r=[];for(let e of $e){let i=t.joints[e];if(!i){r.push(0,0,0);continue}i.getWorldPosition(et),n.worldToLocal(et),r.push(et.x,et.y,et.z)}return{pos:Z.toArray(),rot:[Ge.x,Ge.y,Ge.z],joints:r}}function ct(){if(!Oe.xr.getSession())return;let e=st(`left`),t=st(`right`);for(let n=0;n<2;n++){let r=tt(n);r===`left`&&!e?e=Qe(n):r===`right`&&!t&&(t=Qe(n))}let n=[e,t],r=!!(e?.joints?.length||t?.joints?.length),i=Date.now();if(r&&i-qe<33)return;let a=!1;for(let e=0;e<2;e++){let t=n[e];t&&new hn().fromArray(t.pos).distanceTo(Ke[e])>.005&&(a=!0)}let s=[e?.joints?.length??0,t?.joints?.length??0];if(aue({moved:a,hasJoints:r,prevLens:Je,lens:s})){Je=s,qe=i;for(let e=0;e<2;e++){let t=n[e];t&&Ke[e].fromArray(t.pos)}o().send({type:`vrhands`,peerId:o().peer.id,left:e,right:t,active:!0})}}Kw(e=>{if(Y+=.25*e,Ne(),Rk(e,De.current),PA(performance.now(),De.current),pce(performance.now()),UA(),Oe?.xr?.isPresenting&&One(performance.now()),De.current.fov!==Re&&(Re=De.current.fov,o().send({type:`cameraSettings`,peerId:o().peer.id,fov:Re})),!l()){ke(yi,De.current),Ye.copy(De.current.position),Xe.copy(De.current.quaternion),B_(c(),Ye,Xe);let e=(u()?33:50)*(Fe?2:1),t=performance.now();(Ye.distanceTo(He)>(u()?1e-4:.01)||Xe.angleTo(Ue)>wt.degToRad(1))&&t-Be>=e&&(Be=t,Ze.setFromQuaternion(Xe),o().send({type:`camera`,peerId:o().peer.id,position:Ye.toArray(),rotation:[Ze.x,Ze.y,Ze.z]}),He.copy(Ye),Ue.copy(Xe))}Oe.xr.isPresenting&&ct(),vfe(),Dce(De.current,J),Rce(),kj(),GCe(f(),De.current,Oe,performance.now()),ele(),Kae(),zie(),kie(),FM(),Xwe(),$P(),dP(),ihe(),Rde(),dF(),_Te(),Uee(),Oe.xr.isPresenting||TTe(e,De.current,n()),Hse()});let lt=F(null),ut=F(null),dt=new Wn;dt.layers.enable(30);function ft(){return Ch(dt,{tinyProxies:!0})}function pt(e,t=null){return il(e,t)}let mt={uuid:null,t:0},ht=null,gt=nt.getItem(`hint:selectBehind`)===`true`;function _t(e=!1,t=null,n=null){let r=null;for(let e of al){let n=J.getObjectByName(e);if(!n)continue;let i=dt.intersectObject(n,!0);if(i.length>0&&pt(i[0].object,t))return!0;i.length>0&&(!r||i[0].distance<r.distance)&&(r={name:e,distance:i[0].distance})}let i=ft(),a=Th(i,wm),o=Tse(a,n??{x:-1e6,y:-1e6,t:0},!e&&n?ht:null),s=o.index>=0?a[o.index]:null;if(t===`edit`&&!e&&r&&Gee(r.name)&&(!s||r.distance<s.hit.distance))return bm(),pl(r.name),!0;if(s){if(pt(s.hit.object,t))return!0;let r=s.target;if(n&&!e&&(ht={...n,uuid:r.uuid},a.length>
22351&&!gt&&(gt=!0,nt.setItem(`hint:selectBehind`,`true`),es(`Click again to select behind`))),r){let n=Date.now(),i=!e&&mt.uuid===r.uuid&&n-mt.t<400;if(mt={uuid:r.uuid,t:n},i&&Boe(r))return Em(r.uuid,!1,e),!0;let a=x();return Em(r.uuid,i&&a===`properties`,e),i&&a===`meshedit`?zp(r.uuid):i&&a===`sametype`?eoe(r.uuid):i&&a===`isolate`&&(Sm(r.uuid),roe([r.uuid])),t!==`edit`&&ud(r.uuid),!0}}return sl(),!1}_e(()=>{Zwe(),nF(),ahe(),zde(),CTe(),pP();let e=upe({selection:()=>U(Kr)??[],exists:e=>!!U(Ui)?.getObjectByProperty?.(`uuid`,e),faceSession:()=>{let e=U(Up);return e?{uuid:e,submode:U(am)??`faces`,tris:(U(Ip)??[]).slice()}:null},vertexSession:()=>{let e=U(mm);return e?{uuid:e}:null},sculptSession:()=>{let e=U(xh);return e?{uuid:e}:null},applySelection:e=>Tm(e),enterFace:(e,t,n)=>(zp(e),U(Up)?(t===`edges`?Pp(`edges`):n.length&&Ip.set(n),t):null),enterVertex:e=>(gm(e),!!U(mm)),enterSculpt:e=>(Sse(e),!!U(xh))}),t=()=>{fm(),Fp(),NM(),ke(wi,!1),que(),o()?.send({type:`vrhands`,peerId:o().peer.id,left:null,right:null,active:!1})};Oe.xr.addEventListener(`sessionend`,t);let n=()=>vue(),a=()=>{Oe.xr.getSession()?.addEventListener(`inputsourceschange`,n),Xoe(),ke(wi,!0)};Oe.xr.addEventListener(`sessionstart`,a);let s=Oe.domElement,c=e=>{e.preventDefault(),ke(Mi,!0)},d=()=>{i()?.traverse(e=>{let t=Array.isArray(e.material)?e.material:e.material?[e.material]:[];for(let e of t)e&&(e.needsUpdate=!0)}),ke(Mi,!1)};s.addEventListener(`webglcontextlost`,c),s.addEventListener(`webglcontextrestored`,d);let h=null,g=0,b=!1,x=!1,N=!1,F=0,I=null,R=null,ue=0,z=null,fe=e=>{let t=s.getBoundingClientRect();return new yn((e.clientX-t.left)/t.width*2-1,-((e.clientY-t.top)/t.height)*2+1)},me=e=>{dt.setFromCamera(fe(e),De.current)},H=!1,ge=()=>Ok()&&!l()&&!_()&&!v()&&!y()&&!S()&&!C(),W=e=>{if(e.button===2){R=[e.clientX,e.clientY,Date.now()];return}if(e.button===0){if(y()&&!r()&&!u()&&(me(e),qM(dt,e.clientY))){lx(!1);return}if(S()&&w()!==`spline`&&!r()&&!u()){b=!0,lx(!1),me(e),u_(dt);return}if(C()&&!r()&&!u()){let t=f()?.getObjectByProperty(`uuid`,C());me(e);let n=t?dt.intersectObject(t,!1)[0]:null;if(n){N=!0,F=performance.now(),lx(!1),Cse(C());let e=t.worldToLocal(n.point.clone());bh(C(),e.x,e.z,.016,e.y)}return}if(ge()){if(me(e),kk(dt,fe(e),De.current)){H=!0,lx(!1);return}h=[e.clientX,e.clientY],g=Date.now();return}if((e.shiftKey||e.ctrlKey||e.metaKey||T())&&!r()&&!u()&&!l()&&(_()||v())&&!p()?.dragging){I=[e.clientX,e.clientY],x=!0,lx(!1),h=[e.clientX,e.clientY],g=Date.now();return}(e.shiftKey||T())&&!r()&&!u()&&!l()&&!_()&&!v()&&!y()&&(I=[e.clientX,e.clientY],lx(!1)),h=[e.clientX,e.clientY],g=Date.now()}},_e=e=>{if(H&&Ak(fe(e)),XM()){JM(e.clientY);return}if(z=[e.clientX,e.clientY],p()?.dragging&&PN(e.clientX,e.clientY),Ee&&ke(Yp,{from:Ee,to:[e.clientX,e.clientY]}),I&&ke(mi,{x0:Math.min(I[0],e.clientX),y0:Math.min(I[1],e.clientY),x1:Math.max(I[0],e.clientX),y1:Math.max(I[1],e.clientY)}),C()){let t=f()?.getObjectByProperty(`uuid`,C());me(e);let n=t?dt.intersectObject(t,!1)[0]:null;if(n){let e=n.face?n.face.normal.clone().transformDirection(t.matrixWorld):null;if(yse(n.point,e),N){let e=performance.now(),r=Math.min((e-F)/1e3,.1);F=e;let i=t.worldToLocal(n.point.clone());bh(C(),i.x,i.z,r,i.y)}}else _se();if(N)return}b&&(me(e),u_(dt))},ve=()=>{let e=s.getBoundingClientRect(),t=E(),n=[],r=new hn;for(let i of f()?.children??[]){let a=new Or().setFromObject(i);if(!isFinite(a.min.x))continue;a.getCenter(r).project(De.current);let o=e.left+(r.x+1)/2*e.width,s=e.top+(1-r.y)/2*e.height;r.z<1&&o>=t.x0&&o<=t.x1&&s>=t.y0&&s<=t.y1&&n.push(i.uuid)}return n},G=e=>{if(H&&e.button===0){H=!1,jk(),lx(!0),h=null;return}if(XM()&&e.button===0){YM(),lx(!0),h=null;return}if(I&&x&&e.button===0){let t=I;I=null,x=!1,lx(!0);let n=Math.hypot(e.clientX-t[0],e.clientY-t[1]);if(ke(mi,null),n>8){let n=s.getBoundingClientRect(),r={x1:t[0]-n.left,y1:t[1]-n.top,x2:e.clientX-n.left,y2:e.clientY-n.top},i={width:n.width,height:n.height};_()?Gae(r,De.current,i,!0):(Gie(r,De.current,i,!0),D()!==`edges`&&(O()===`move`?em():Ap())),h=null;return}}if(I&&e.button===0){let t=I;I=null,lx(!0);let n=Math.hypot(e.clientX-t[0],e.clientY-t[1]);if(E()&&n>8){let e=ve();ke(mi,null),h=null,e.length&&Tm([...new Set([...m(),...e])]);return}ke(mi,null)}if(N&&e.button===0){N=!1,lx(!0),bse();return}if(b&&e.button===0){b=!1,lx(!0),_le();return}if(e.button!==0||!h)return;let t=Math.hypot(e.clientX-h[0],e.clientY-h[1]);if(h=null,t>5||Date.now()-g>400||r()||u()||l()||k()&&(me(e),zj(dt)))return;if(A()){me(e),aP(dt,[e.clientX,e.clientY]);return}if(ee()){me(e),jie(tm(_()??v()??``),dt,[e.clientX,e.clientY]);return}
2235if(p()&&(p().dragging||p().axis)||!f())return;let n=s.getBoundingClientRect(),i=new yn((e.clientX-n.left)/n.width*2-1,-((e.clientY-n.top)/n.height)*2+1);if(dt.setFromCamera(i,De.current),e.altKey){let e=ft(),t=new hn,n=e[0]?.point??(dt.ray.intersectPlane(new Tr(new hn(0,1,0),0),t)?t:null);n&&Zy(n);return}if(__()){let e=Date.now();e-ue<400?S_():b_(dt),ue=e;return}if(y()&&RM(dt)||sN(dt))return;if(j()){Gwe(dt,f());return}if(_()){zae(dt,e.ctrlKey||e.shiftKey||e.metaKey||T())||hm();return}if(v()){if(O()===`knife`){if(!Ee)Ee=[e.clientX,e.clientY],ke(Yp,{from:Ee,to:[e.clientX,e.clientY]}),es(`Knife: click the far end of the cut (Esc cancels)`);else{let t=Ee;Ee=null,Sae(),Tae(t,[e.clientX,e.clientY]),Hp(`move`)}return}let t=tm(v()),n=t?dt.intersectObject(t,!1)[0]:null,r=n&&n.faceIndex!=null?n.faceIndex:-1;if(D()===`edges`){if(r<0||!n||!t){e.ctrlKey||e.shiftKey||e.metaKey||T()||Qp();return}let i=t.worldToLocal(n.point.clone());dae(jae(r,i),e.ctrlKey||e.shiftKey||e.metaKey||T());return}let i=e.ctrlKey||e.shiftKey||e.metaKey||T()||M();bae(r,!i),r>=0?i?(yae(r),O()===`move`?em():Ap()):(tae(r),lae()||(O()===`move`?em():Ap())):(hae(),em(
2235));return}if(ge()){Mk(dt);return}if(te()){let e=dt.intersectObject(te(),!0).find(e=>e.object.userData.lightUuid&&e.object.visible);if(e){Em(e.object.userData.lightUuid,!0);return}}if(ne()&&P()){let e=dt.intersectObject(ne(),!0)[0]?.object;for(;e&&!e.name?.startsWith(`pin-`);)e=e.parent;if(e){Ny(e.name.slice(4),`view`);return}}let a=e.shiftKey||T();!_t(a,`edit`,{x:e.clientX,y:e.clientY,t:Date.now()})&&!a&&(ooe()&&ioe(),bm())};s.addEventListener(`pointerdown`,W),window.addEventListener(`pointermove`,_e),window.addEventListener(`pointerup`,G);let ye=(e=0,t=0,n=!1,i=e,a=t)=>{if(r()||u()||l()||S()||_()||v()||j())return;if(y()){me({clientX:e,clientY:t}),HM(dt);return}me({clientX:e,clientY:t});let o=ft(),s=!n&&o.length?wm(o[0].object):null;if(s){ke(qs,{x:i,y:a,uuid:s.uuid,point:o[0].point.toArray(),locked:!!re().find(e=>e[1]===s.uuid)});return}let c=new hn,d=o[0]?.point??(dt.ray.intersectPlane(new Tr(new hn(0,1,0),0),c)?c:new hn);ps.set({x:i,y:a,point:d.toArray()})};Uo.set(ye);let be=(e,t)=>{me({clientX:e,clientY:t});let n=ft();if(n[0]?.point)return n[0].point.toArray();let r=new hn;return dt.ray.intersectPlane(new Tr(new hn(0,1,0),0),r)?r.toArray():[0,0,0]};Ws.set(()=>{if(r()||u()||l()||!z)return!1;let[e,t]=z;return tc.set({x:e,y:t,point:be(e,t)}),!0});let xe=e=>{e.preventDefault();let t=R;R=null,t&&(Math.hypot(e.clientX-t[0],e.clientY-t[1])>5||Date.now()-t[2]>400||ye(e.clientX,e.clientY))};s.addEventListener(`contextmenu`,xe);let K=0,Se=0,Ce=0,we=()=>{K&&clearTimeout(K),K=0};s.addEventListener(`touchstart`,e=>{if(e.touches.length!==1)return we();Se=e.touches[0].clientX,Ce=e.touches[0].clientY,K=setTimeout(()=>{ye(Se,Ce),K=0},500)},{passive:!0}),s.addEventListener(`touchmove`,e=>{if(!K)return;let t=e.touches[0];Math.hypot(t.clientX-Se,t.clientY-Ce)>10&&we()},{passive:!0}),s.addEventListener(`touchend`,we),s.addEventListener(`touchcancel`,we),gle(J),Gue(Oe);let Te=new fr,q=[Oe.xr.getController(0),Oe.xr.getController(1)],Ae=e=>{let t=e.target;if(!(Date.now()-Uue<250)&&!Vse()){if(ie()){let e=Vue(q.indexOf(t));e&&tv(e);return}if(ae()){let e=Lue(q.indexOf(t))??Nue();if(e){tv(e);return}}if(L()){let e=yue(q.indexOf(t));if(e){tv(e);return}}if(!(oe()&&Kue(q.indexOf(t)))){if(se()){let e=oue(q.indexOf(t));if(e){tv(e);return}}if(ce()){let e=Wue(q.indexOf(t));if(e){tv(e);return}}if(le()){let e=Cue(q.indexOf(t));if(e){tv(e);return}}if(de()){let e=Wle(q.indexOf(t));if(e){tv(e);return}}if(pe()){let e=Tue(q.indexOf(t));if(e){tv(e);return}}if(B()){let e=_ue(q.indexOf(t));if(e){tv(e);return}}if(V()){let e=Hue(q.indexOf(t));if(e){tv(e);return}}if(!jue(q.indexOf(t))&&!Fue()){if(v()){pue();return}if(_()){Rue(q.indexOf(t));return}if(__()){Te.identity().extractRotation(t.matrixWorld),dt.ray.origin.setFromMatrixPosition(t.matrixWorld),dt.ray.direction.set(0,0,-1).applyMatrix4(Te),b_(dt);return}if(!S()&&!(he()===`box`||Sue())&&f()){if(Te.identity().extractRotation(t.matrixWorld),dt.ray.origin.setFromMatrixPosition(t.matrixWorld),dt.ray.direction.set(0,0,-1).applyMatrix4(Te),Yc()){Mk(dt);return}_t()}}}}},je=e=>{let t=q.indexOf(e.target);Bse(t)||(bue(t),zue(t),Aue(t))},Me=e=>{qse(q.indexOf(e?.target))||(Vle(),gue(),Pue())},Ne=e=>{e.target.userData.handedness=e.data?.handedness??null},Pe=e=>{e.target.userData.handedness=null};zk({moduleHitTest:e=>pt(e,`play`)});let Fe=sce(()=>!!U(xh)||!!U(nM)||!!U(c_)||__());return FA({hands:K_,heldUuids:()=>[Vk(),...mue()],haptic:wue}),cce({hands:K_}),Aj({hands:K_}),fce(),q.forEach(e=>{e.addEventListener(`select`,Ae),e.addEventListener(`selectstart`,je),e.addEventListener(`selectend`,Me),e.addEventListener(`connected`,Ne),e.addEventListener(`disconnected`,Pe)}),()=>{e(),Fe(),Bk(),IA(),uce(),lce(),s.removeEventListener(`pointerdown`,W),s.removeEventListener(`contextmenu`,xe),s.removeEventListener(`webglcontextlost`,c),s.removeEventListener(`webglcontextrestored`,d),window.removeEventListener(`pointerup`,G),q.forEach(e=>{e.removeEventListener(`select`,Ae),e.removeEventListener(`selectstart`,je),e.removeEventListener(`selectend`,Me),e.removeEventListener(`connected`,Ne),e.removeEventListener(`disconnected`,Pe)}),Oe.xr.removeEventListener(`sessionend`,t),Oe.xr.removeEventListener(`sessionstart`,a),Oe.xr.getSession()?.removeEventListener(`inputsourceschange`,n)}});function vt(){me(zi,K(p).visible=!1,K(p))}function yt(){if(p().object?.userData?.isVertexProxy){me(zi,K(p).visible=!0,K(p)),Vae();return}if(p().object?.userData?.isFaceProxy){me(zi,K(p).visible=!0,K(p)),Dae();return}if(p().object?.userData?.isSplineProxy){me(zi,K(p).visible=!0,K(p)),GM();return}if(p().object?.userData?.isLodLevelProxy){me(zi,K(p).visible=!0,K(p)),$j();return}if(p().object?.userData?.isMultiPivot){me(zi,K(p).visible=!0,K(p)),ke(Di,b());return}ke(Di,b()),p().object!==void 0&&p().object.parent!==void 0&&p().object.uuid!==void 0&&(!QN(p().object)&&H()&&p().dragging&&p().mode===`translate`&&[`X`,`Z`,`XZ`,`XYZ`].includes(p().axis)&&f()&&lee(p().object,f()),me(zi,K(p).visible=!0,K(p)),o().send({type:`move`,uuid:p().object.uuid,pos:p().object.position.toArray(),rot:p().object.rotation.toArray(),scale:p().object.scale.toArray()}))}let bt=F(),xt=!1,St=mo(0),Ct=mo(0),Tt=new hn;Kw(()=>{Q(bt)&&(Q(bt).getWorldPosition(Tt),St.set(Tt.x,{hard:!xt}),Ct.set(Tt.z,{hard:!xt}),xt||=!0)}),d(()=>(p(),Q(ut),m(),Q(lt),e_),()=>{p()&&p()!==Q(ut)&&(I(ut,p()),p().addEventListener(`dragging-changed`,e=>{lx(!e.value);let t=Q(ut).object;if(t){if(e.value?t.userData?.isMultiPivot?FN([...m()]):!t.userData?.isVertexProxy&&!t.userData?.isFaceProxy&&!t.userData?.isLodLevelProxy&&FN([t.uuid]):IN(),t.userData?.isVertexProxy){Uae(e.value);return}if(t.userData?.isFaceProxy){cae(e.value);return}if(t.userData?.isSplineProxy){KM(e.value);return}if(t.userData?.isLodLevelProxy){eM(e.value);return}if(!t.userData?.isMultiPivot){if(e.value)cd(t.uuid),nh(t.uuid),I(lt,{uuid:t.uuid,pos:t.position.toArray(),rot:t.rotation.toArray(),scale:t.scale.toArray()});else if(Q(lt)&&Q(lt).uuid===t.uuid){sd(t.uuid),dh(t.uuid);let e={pos:t.position.toArray(),rot:t.rotation.toArray(),scale:t.scale.toArray()},n={pos:Q(lt).pos,rot:Q(lt).rot,scale:Q(lt).scale};JSON.stringify(n)!==JSON.stringify(e)&&Rf({uuid:t.uuid,before:n,after:e}),o_(t.uuid,e_(t.uuid)),I(lt,null)}}}}))}),d(()=>
2235(p(),_(),v(),y(),b()),()=>{p()&&!_()&&!v()&&!y()&&!b()?.uuid&&(me(zi,K(p).visible=!1,K(p)),p().object&&!p().object.userData?.isMultiPivot&&p().detach())}),h(),R();var Et=RDe(),Dt=N(Et);Uw.PerspectiveCamera(Dt,{makeDefault:!0,position:[-10,10,10],fov:40,far:5e3,get ref(){return Se(),ge()},set ref(e){ke(Ri,e)},children:(e,t)=>{var n=fe(),i=N(n),a=e=>{{let t=ze(()=>r()!==!0);oE(e,{get enableZoom(){return Q(t)},enableDamping:!0,autoRotateSpeed:.5,"target.y":1.5,get ref(){return Se(),ve()},set ref(e){ke(Ki,e)},$$legacy:!0})}};G(i,e=>{!l()&&!W()&&e(a)}),X(e,n)},$$slots:{default:!0},$$legacy:!0});var Ot=g(Dt,2);Uw.Group(Ot,{name:`world-grab-rig`,get ref(){return Se(),c()},set ref(e){ke(Fi,e)},children:(e,t)=>{var n=IDe(),r=N(n);Uw.Group(r,{name:`sceneObjects`,get ref(){return Se(),f()},set ref(e){ke(Ui,e)},$$legacy:!0});var i=g(r,2);vTe(i,{});var a=g(i,2);{let e=ze(()=>s()&&ye()!==`wireframe`&&!be());oL(a,{get showGrid(){return Q(e)}})}var o=g(a,2);NEe(o,{});var c=g(o,2);FEe(c,{});var l=g(c,2);LEe(l,{});var u=g(l,2);REe(u,{});var d=g(u,2);zEe(d,{});var p=g(d,2);BEe(p,{});var m=g(p,2);Uw.Group(m,{name:`particle-root`,oncreate:e=>zre(e)});var h=g(m,2);Kwe(h,{});var _=g(h,2);Uw.Group(_,{name:`module-world-root`,oncreate:e=>tte(e)}),X(e,n)},$$slots:{default:!0},$$legacy:!0});var kt=g(Ot,2),At=e=>{bbe(e,{onchange:yt,oncreate:vt,get controls(){return Se(),p()},set controls(e){ke(zi,e)},$$legacy:!0})};G(kt,e=>{!r()&&!u()&&e(At)});var jt=g(kt,2),Mt=e=>{wDe(e,{})};G(jt,e=>{(!u()||xe())&&e(Mt)});var Nt=g(jt,2);FDe(Nt,{position:[0,2,3],get playerMesh(){return Q(bt)},set playerMesh(e){I(bt,e)},$$legacy:!0});var Pt=g(Nt,2);ATe(Pt,{});var Ft=g(Pt,2);jTe(Ft,{});var It=g(Ft,2);PTe(It,{});var Lt=g(It,2);ITe(Lt,{});var Rt=g(Lt,2);zTe(Rt,{});var Bt=g(Rt,2);HTe(Bt,{});var Vt=g(Bt,2);KTe(Vt,{});var Ht=g(Vt,2);eEe(Ht,{});var Ut=g(Ht,2);nEe(Ut,{});var Wt=g(Ut,2);oEe(Wt,{});var Gt=g(Wt,2);cEe(Gt,{});var Kt=g(Gt,2);WTe(Kt,{});var qt=g(Kt,2);lEe(qt,{});var Jt=g(qt,2);jEe(Jt,{}),tCe(g(Jt,2),{get offerSession(){return we()},onsessionstart:()=>{let e=Oe.xr.getSession();_i.set(Ei(e)),xue(),_fe()},onsessionend:()=>_i.set(!1),children:(e,t)=>{var n=LDe(),r=N(n);jO(r,{left:!0});var i=g(r,2);jO(i,{right:!0});var a=g(i,2);IO(a,{left:!0,onpinchstart:()=>rv(`left`),onpinchend:()=>nv(`left`)}),IO(g(a,2),{right:!0,onpinchstart:()=>rv(`right`),onpinchend:()=>nv(`right`)}),X(e,n)},$$slots:{default:!0}}),X(e,Et),ue(),q()}var BDe=new Set([`$$slots`,`$$events`,`$$legacy`]);function VDe(e,t){let n=Le(t,BDe),r={name:`align-center-horizontal`,size:24,node:[[`path`,{d:`M2 12h20`}],[`path`,{d:`M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4`}],[`path`,{d:`M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4`}],[`path`,{d:`M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1`}],[`path`,{d:`M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var HDe=new Set([`$$slots`,`$$events`,`$$legacy`]);function UDe(e,t){let n=Le(t,HDe),r={name:`align-center-vertical`,size:24,node:[[`path`,{d:`M12 2v20`}],[`path`,{d:`M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4`}],[`path`,{d:`M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4`}],[`path`,{d:`M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1`}],[`path`,{d:`M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var WDe=new Set([`$$slots`,`$$events`,`$$legacy`]);function GDe(e,t){let n=Le(t,WDe),r={name:`align-end-horizontal`,size:24,node:[[`rect`,{width:`6`,height:`16`,x:`4`,y:`2`,rx:`2`}],[`rect`,{width:`6`,height:`9`,x:`14`,y:`9`,rx:`2`}],[`path`,{d:`M22 22H2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var KDe=new Set([`$$slots`,`$$events`,`$$legacy`]);function qDe(e,t){let n=Le(t,KDe),r={name:`align-end-vertical`,size:24,node:[[`rect`,{width:`16`,height:`6`,x:`2`,y:`4`,rx:`2`}],[`rect`,{width:`9`,height:`6`,x:`9`,y:`14`,rx:`2`}],[`path`,{d:`M22 22V2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var JDe=new Set([`$$slots`,`$$events`,`$$legacy`]);function YDe(e,t){let n=Le(t,JDe),r={name:`align-horizontal-space-around`,size:24,node:[[`rect`,{width:`6`,height:`10`,x:`9`,y:`7`,rx:`2`}],[`path`,{d:`M4 22V2`}],[`path`,{d:`M20 22V2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var XDe=new Set([`$$slots`,`$$events`,`$$legacy`]);function ZDe(e,t){let n=Le(t,XDe),r={name:`align-start-horizontal`,size:24,node:[[`rect`,{width:`6`,he
2235ight:`16`,x:`4`,y:`6`,rx:`2`}],[`rect`,{width:`6`,height:`9`,x:`14`,y:`6`,rx:`2`}],[`path`,{d:`M22 2H2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var QDe=new Set([`$$slots`,`$$events`,`$$legacy`]);function $De(e,t){let n=Le(t,QDe),r={name:`align-start-vertical`,size:24,node:[[`rect`,{width:`9`,height:`6`,x:`6`,y:`14`,rx:`2`}],[`rect`,{width:`16`,height:`6`,x:`6`,y:`4`,rx:`2`}],[`path`,{d:`M2 2v20`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var eOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function tOe(e,t){let n=Le(t,eOe),r={name:`align-vertical-space-around`,size:24,node:[[`rect`,{width:`10`,height:`6`,x:`7`,y:`9`,rx:`2`}],[`path`,{d:`M22 20H2`}],[`path`,{d:`M22 4H2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var nOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function ZR(e,t){let n=Le(t,nOe),r={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`}],[`path`,{d:`m12 5 7 7-7 7`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var rOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function QR(e,t){let n=Le(t,rOe),r={name:`audio-lines`,size:24,node:[[`path`,{d:`M2 10v3`}],[`path`,{d:`M6 6v11`}],[`path`,{d:`M10 3v18`}],[`path`,{d:`M14 8v7`}],[`path`,{d:`M18 5v13`}],[`path`,{d:`M22 10v3`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var iOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function aOe(e,t){let n=Le(t,iOe),r={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var oOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function sOe(e,t){let n=Le(t,oOe),r={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var cOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function $R(e,t){let n=Le(t,cOe),r={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var lOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function ez(e,t){let n=Le(t,lOe),r={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var uOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function tz(e,t){let n=Le(t,uOe),r={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var dOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function fOe(e,t){let n=Le(t,dOe),r={name:`circle-question-mark`,size:24,node:[[`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`}]],aliases:[`help-circle`,`circle-help`]};mS(e,le(()=>n,{get icon(){return r}}))}var pOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function mOe(e,t){let n=Le(t,pOe),r={name:`clapperboard`,size:24,node:[[`path`,{d:`m12.296 3.464 3.02 3.956`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}],[`path`,{d:`m6.18 5.276 3.1 3.899`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var hOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function gOe(e,t){let n=Le(t,hOe),r={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`}],[`path`,{d:`m8 6-6 6 6 6`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var _Oe=new Set([`$$slots`,`$$events`,`$$legacy`]);function vOe(e,t){let n=Le(t,_Oe),r={name:`cog`,size:24,node:[[`path`,{d:`M11 10.27 7 3.34`}],[`path`,{d:`m11 13.73-4 6.93`}],[`path`,{d:`M12 22v-2`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M14 12h8`}],[`path`,{d:`m17 20.66-1-1.73`}],[`path`,{d:`m17 3.34-1 1.73`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`m20.66 17-1.73-1`}],[`path`,{d:`m20.66 7-1.73 1`}],[`path`,{d:`m3.34 17 1.73-1`}],[`path`,{d:`m3.34 7 1.73 1`}],[`circle`,{cx:`12`,cy:`12`,r:`2`}],[`circle`,{cx:`12`,cy:`12`,r:`8`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var yOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function bOe(e,t){let n=Le(t,yOe),r={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var xOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function SOe(e,t){let n=Le(t,xOe),r={name:`corner-left-up`,size:24,node:[[`path`,{d:`M14 9 9 4 4 9`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var COe=new Set([`$$slots`,`$$events`,`$$legacy`]);function wOe(e,t){let n=Le(t,COe),r={name:`crosshair`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var TOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function EOe(e,t){let n=Le(t,TOe),r={name:`droplets`,size:24,node:[[`path`,{d:`M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z`}],[`path`,{d:`M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var DOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function OOe(e,t){let n=Le(t,DOe),r={name:`file-input`,size:24,node:[[`path`,{d:`M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-1`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M2 15h10`}],[`path`,{d:`m9 18 3-3-3-3`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var kOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function AOe(e,t){let n=Le(t,kOe),r={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-
22355-2-8-2a6 6 0 0 0-4 1.528`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var jOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function MOe(e,t){let n=Le(t,jOe),r={name:`folder-down`,size:24,node:[[`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`}],[`path`,{d:`M12 10v6`}],[`path`,{d:`m15 13-3 3-3-3`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var NOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function nz(e,t){let n=Le(t,NOe),r={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var POe=new Set([`$$slots`,`$$events`,`$$legacy`]);function rz(e,t){let n=Le(t,POe),r={name:`folder-tree`,size:24,node:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var FOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function IOe(e,t){let n=Le(t,FOe),r={name:`funnel`,size:24,node:[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`}]],aliases:[`filter`]};mS(e,le(()=>n,{get icon(){return r}}))}var LOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function iz(e,t){let n=Le(t,LOe),r={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var ROe=new Set([`$$slots`,`$$events`,`$$legacy`]);function zOe(e,t){let n=Le(t,ROe),r={name:`ghost`,size:24,node:[[`path`,{d:`M15 10v1`}],[`path`,{d:`M7.528 20.472a1.6 1.6 0 012.277 0l1.057 1.056a1.6 1.6 0 002.276 0l1.057-1.056a1.6 1.6 0 012.277 0l1.114 1.114a1.4 1.4 0 002.414-1V10a8 8 0 00-16 0v10.586a1.4 1.4 0 002.414 1z`}],[`path`,{d:`M9 10v1`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var BOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function VOe(e,t){let n=Le(t,BOe),r={name:`gift`,size:24,node:[[`path`,{d:`M12 7v14`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var HOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function UOe(e,t){let n=Le(t,HOe),r={name:`glasses`,size:24,node:[[`circle`,{cx:`6`,cy:`15`,r:`4`}],[`circle`,{cx:`18`,cy:`15`,r:`4`}],[`path`,{d:`M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2`}],[`path`,{d:`M2.5 13 5 7c.7-1.3 1.4-2 3-2`}],[`path`,{d:`M21.5 13 19 7c-.7-1.3-1.5-2-3-2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var WOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function GOe(e,t){let n=Le(t,WOe),r={name:`grid-2x2`,size:24,node:[[`path`,{d:`M12 3v18`}],[`path`,{d:`M3 12h18`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}]],aliases:[`grid-2-x-2`]};mS(e,le(()=>n,{get icon(){return r}}))}var KOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function qOe(e,t){let n=Le(t,KOe),r={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`}],[`circle`,{cx:`9`,cy:`5`,r:`1`}],[`circle`,{cx:`9`,cy:`19`,r:`1`}],[`circle`,{cx:`15`,cy:`12`,r:`1`}],[`circle`,{cx:`15`,cy:`5`,r:`1`}],[`circle`,{cx:`15`,cy:`19`,r:`1`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var JOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function YOe(e,t){let n=Le(t,JOe),r={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}]],aliases:[`home`]};mS(e,le(()=>n,{get icon(){return r}}))}var XOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function ZOe(e,t){let n=Le(t,XOe),r={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`}],[`path`,{d:`M19 2v6`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`}],[`circle`,{cx:`9`,cy:`9`,r:`2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var QOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function az(e,t){let n=Le(t,QOe),r={name:`import`,size:24,node:[[`path`,{d:`M12 3v12`}],[`path`,{d:`m8 11 4 4 4-4`}],[`path`,{d:`M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var $Oe=new Set([`$$slots`,`$$events`,`$$legacy`]);function oz(e,t){let n=Le(t,$Oe),r={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`}],[`path`,{d:`M12 12h.01`}],[`path`,{d:`M14 8h.01`}],[`path`,{d:`M16 12h.01`}],[`path`,{d:`M18 8h.01`}],[`path`,{d:`M6 8h.01`}],[`path`,{d:`M7 16h10`}],[`path`,{d:`M8 12h.01`}
2235],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var eke=new Set([`$$slots`,`$$events`,`$$legacy`]);function sz(e,t){let n=Le(t,eke),r={name:`lasso`,size:24,node:[[`path`,{d:`M3.704 14.467a10 8 0 1 1 3.115 2.375`}],[`path`,{d:`M7 22a5 5 0 0 1-2-3.994`}],[`circle`,{cx:`5`,cy:`16`,r:`2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var tke=new Set([`$$slots`,`$$events`,`$$legacy`]);function cz(e,t){let n=Le(t,tke),r={name:`layers`,size:24,node:[[`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`}]],aliases:[`layers-3`]};mS(e,le(()=>n,{get icon(){return r}}))}var nke=new Set([`$$slots`,`$$events`,`$$legacy`]);function lz(e,t){let n=Le(t,nke),r={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var rke=new Set([`$$slots`,`$$events`,`$$legacy`]);function ike(e,t){let n=Le(t,rke),r={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var ake=new Set([`$$slots`,`$$events`,`$$legacy`]);function oke(e,t){let n=Le(t,ake),r={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var ske=new Set([`$$slots`,`$$events`,`$$legacy`]);function uz(e,t){let n=Le(t,ske),r={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`}],[`path`,{d:`M3 12h.01`}],[`path`,{d:`M3 19h.01`}],[`path`,{d:`M8 5h13`}],[`path`,{d:`M8 12h13`}],[`path`,{d:`M8 19h13`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var cke=new Set([`$$slots`,`$$events`,`$$legacy`]);function dz(e,t){let n=Le(t,cke),r={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]],aliases:[`loader-2`]};mS(e,le(()=>n,{get icon(){return r}}))}var lke=new Set([`$$slots`,`$$events`,`$$legacy`]);function uke(e,t){let n=Le(t,lke),r={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`}],[`circle`,{cx:`12`,cy:`12`,r:`7`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var dke=new Set([`$$slots`,`$$events`,`$$legacy`]);function fz(e,t){let n=Le(t,dke),r={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`m21 3-7 7`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M9 21H3v-6`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var fke=new Set([`$$slots`,`$$events`,`$$legacy`]);function pke(e,t){let n=Le(t,fke),r={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`}],[`path`,{d:`M4 12h16`}],[`path`,{d:`M4 19h16`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var mke=new Set([`$$slots`,`$$events`,`$$legacy`]);function pz(e,t){let n=Le(t,mke),r={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var hke=new Set([`$$slots`,`$$events`,`$$legacy`]);function gke(e,t){let n=Le(t,hke),r={name:`mic-off`,size:24,node:[[`path`,{d:`M12 19v3`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`}],[`path`,{d:`m2 2 20 20`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var _ke=new Set([`$$slots`,`$$events`,`$$legacy`]);function vke(e,t){let n=Le(t,_ke),r={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}
2235],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var yke=new Set([`$$slots`,`$$events`,`$$legacy`]);function bke(e,t){let n=Le(t,yke),r={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var xke=new Set([`$$slots`,`$$events`,`$$legacy`]);function mz(e,t){let n=Le(t,xke),r={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Ske=new Set([`$$slots`,`$$events`,`$$legacy`]);function Cke(e,t){let n=Le(t,Ske),r={name:`move-3d`,size:24,node:[[`path`,{d:`M5 3v16h16`}],[`path`,{d:`m5 19 6-6`}],[`path`,{d:`m2 6 3-3 3 3`}],[`path`,{d:`m18 16 3 3-3 3`}]],aliases:[`move-3-d`]};mS(e,le(()=>n,{get icon(){return r}}))}var wke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Tke(e,t){let n=Le(t,wke),r={name:`move`,size:24,node:[[`path`,{d:`M12 2v20`}],[`path`,{d:`m15 19-3 3-3-3`}],[`path`,{d:`m19 9 3 3-3 3`}],[`path`,{d:`M2 12h20`}],[`path`,{d:`m5 9-3 3 3 3`}],[`path`,{d:`m9 5 3-3 3 3`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Eke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Dke(e,t){let n=Le(t,Eke),r={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Oke=new Set([`$$slots`,`$$events`,`$$legacy`]);function hz(e,t){let n=Le(t,Oke),r={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var kke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ake(e,t){let n=Le(t,kke),r={name:`person-standing`,size:24,node:[[`circle`,{cx:`12`,cy:`5`,r:`1`}],[`path`,{d:`m9 20 3-6 3 6`}],[`path`,{d:`m6 8 6 2 6-2`}],[`path`,{d:`M12 10v4`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var jke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Mke(e,t){let n=Le(t,jke),r={name:`pipette`,size:24,node:[[`path`,{d:`m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12`}],[`path`,{d:`m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z`}],[`path`,{d:`m2 22 .414-.414`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Nke=new Set([`$$slots`,`$$events`,`$$legacy`]);function gz(e,t){let n=Le(t,Nke),r={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Pke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Fke(e,t){let n=Le(t,Pke),r={name:`proportions`,size:24,node:[[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`}],[`path`,{d:`M12 9v11`}],[`path`,{d:`M2 9h13a2 2 0 0 1 2 2v9`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Ike=new Set([`$$slots`,`$$events`,`$$legacy`]);function _z(e,t){let n=Le(t,Ike),r={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Lke=new Set([`$$slots`,`$$events`,`$$legacy`]);function vz(e,t){let n=Le(t,Lke),r={name:`rectangle-goggles`,size:24,node:[[`path`,{d:`M20 6a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-4a2 2 0 0 1-1.6-.8l-1.6-2.13a1 1 0 0 0-1.6 0L9.6 17.2A2 2 0 0 1 8 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Rke=new Set([`$$slots`,`$$events`,`$$legacy`]);function zke(e,t){let n=Le(t,Rke),r={name:`repeat`,size:24,node:[[`path`,{d:`m17 2 4 4-4 4`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`}],[`path`,{d:`m7 22-4-4 4-4`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Bke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vke(e,t){let n=Le(t,Bke),r={name:`rewind`,size:24,node:[[`path`,{d:`M12 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2
22350 0 0 12 18z`}],[`path`,{d:`M22 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 22 18z`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Hke=new Set([`$$slots`,`$$events`,`$$legacy`]);function yz(e,t){let n=Le(t,Hke),r={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Uke=new Set([`$$slots`,`$$events`,`$$legacy`]);function bz(e,t){let n=Le(t,Uke),r={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Wke=new Set([`$$slots`,`$$events`,`$$legacy`]);function xz(e,t){let n=Le(t,Wke),r={name:`skip-back`,size:24,node:[[`path`,{d:`M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`}],[`path`,{d:`M3 20V4`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Gke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Sz(e,t){let n=Le(t,Gke),r={name:`skip-forward`,size:24,node:[[`path`,{d:`M21 4v16`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var Kke=new Set([`$$slots`,`$$events`,`$$legacy`]);function qke(e,t){let n=Le(t,Kke),r={name:`square-centerline-dashed-horizontal`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3`}],[`path`,{d:`M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3`}],[`path`,{d:`M12 20v2`}],[`path`,{d:`M12 14v2`}],[`path`,{d:`M12 8v2`}],[`path`,{d:`M12 2v2`}]],aliases:[`flip-horizontal`]};mS(e,le(()=>n,{get icon(){return r}}))}var Jke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Yke(e,t){let n=Le(t,Jke),r={name:`square-centerline-dashed-vertical`,size:24,node:[[`path`,{d:`M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3`}],[`path`,{d:`M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}]],aliases:[`flip-vertical`]};mS(e,le(()=>n,{get icon(){return r}}))}var Xke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Cz(e,t){let n=Le(t,Xke),r={name:`square-dashed`,size:24,node:[[`path`,{d:`M5 3a2 2 0 0 0-2 2`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`}],[`path`,{d:`M9 3h1`}],[`path`,{d:`M9 21h1`}],[`path`,{d:`M14 3h1`}],[`path`,{d:`M14 21h1`}],[`path`,{d:`M3 9v1`}],[`path`,{d:`M21 9v1`}],[`path`,{d:`M3 14v1`}],[`path`,{d:`M21 14v1`}]],aliases:[`box-select`]};mS(e,le(()=>n,{get icon(){return r}}))}var Zke=new Set([`$$slots`,`$$events`,`$$legacy`]);function wz(e,t){let n=Le(t,Zke),r={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`}]],aliases:[`pen-box`,`edit`,`pen-square`]};mS(e,le(()=>n,{get icon(){return r}}))}var Qke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Tz(e,t){let n=Le(t,Qke),r={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var $ke=new Set([`$$slots`,`$$events`,`$$legacy`]);function eAe(e,t){let n=Le(t,$ke),r={name:`step-back`,size:24,node:[[`path`,{d:`M13.971 4.285A2 2 0 0 1 17 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`}],[`path`,{d:`M21 20V4`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var tAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function nAe(e,t){let n=Le(t,tAe),r={name:`step-forward`,size:24,node:[[`path`,{d:`M10.029 4.285A2 2 0 0 0 7 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`}],[`path`,{d:`M3 4v16`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var rAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ez(e,t){let n=Le(t,rAe),r={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M12 20v2`}],[`path`,{d:`m4.93 4.93 1.41 1.41`}],[`path`,{d:`m17.66 17.66 1.41 1.41`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`M20 12h2`}],[`path`,{d:`m6.34 17.66-1.41 1.41`}],[`path`,{d:`m19.07 4.93-1.41 1.41`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var iAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function aAe(e,t){let n=Le(t,iAe),r={name:`target`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`circle`,{cx:`12`,cy:`12`,r:`6`}],[`circle`,{cx:`12`,cy:`12`,r:`2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var oAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Dz(e,t){let n=Le(t,oAe),r={name:`user-lock`,size:24,node:[[`path`,{d:`M19 16v-2a2 2 0 0 0-4 0v2`}],[`path`,{d:`M9.5 15H7a4 4 0 0 0-4 4v2`}],[`circle`,{cx:`10`,cy:`7`,r:`4`}],[`rect`,{x:`13`,y:`16`,width:`8`,height:`5`,rx:`.899`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var sAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function cAe(e,t){let n=Le(t,sAe),r={name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`}],[`circle`,{cx:`9`,cy:`7`,r:`4`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var lAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function uAe(e,t){let n=Le(t,lAe),r={name:`video-off`,size:24,node:[[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`}],[`path`,{d:`m2 2 20 20`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var dAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function fAe(e,t){let n=Le(t,dAe),r={name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var pAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function mAe(e,t){let n=Le(t,pAe),r={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var hAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Oz(e,t){let n=Le(t,hAe),r={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`}],[`path`,{d:`m16.5 14.5 5-5`}],[`path`,{d:`m16.5 9.5 5 5`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var gAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function _Ae(e,t){let n=Le(t,gAe),r={name:`waypoints`,size:24,node:[[`path`,{d:`m10.586 5.414-5.172 5.172`}],[`path`,{d:`m18.586 13.414-5.172 5.172`}],[`path`,{d:`M6 12h12`}],[`circle`,{cx:`12`,cy:`20`,r:`2`}],[`circle`,{cx:`12`,cy:`4`,r:`2`}],[`circle`,{cx:`20`,cy:`12`,r:`2`}],[`circle`,{cx:`4`,cy:`12`,r:`2`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var vAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function yAe(e,t){let n=Le(t,vAe),r={name:`zoom-in`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var bAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function xAe(e,t){let n=Le(t,bAe),r={name:`zoom-out`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`}]]};mS(e,le(()=>n,{get icon(){return r}}))}var SAe=V(`<li> </li>`),CAe=V(`<li><span class="flex items-baseline gap-1.5"><span class="h-2 w-2 shrink-0 self-center rounded-full"></span> <span class="text-[11px] font-semibold opacity-90"> </span> <span class="text-[9px] text-gray-400"> </span></span> <span class="wrap-break-word"> </span></li>`),wAe=V(`<button class="absolute bottom-2 left-1/2 -translate-x-1/2 roun
2235ded-full bg-primary-700 px-3 py-0.5 text-xs text-white shadow-lg hover:bg-primary-600"> </button>`),TAe=V(`<button class="flex items-baseline gap-2 rounded-sm px-1.5 py-0.5 text-left hover:bg-gray-700"><span class="font-mono font-semibold text-primary-300"> </span> <span class="text-gray-400"> </span></button>`),EAe=V(`<div class="mb-1 flex flex-col gap-0.5 rounded-md border border-gray-700/60 bg-gray-800/95 p-1 text-xs"></div>`),DAe=V(`<div id="chat-input" class="shrink-0 border-t border-gray-700/60 p-2"><!> <div class="flex items-center gap-1.5"><input type="text" id="message" class="ui-input min-w-0 flex-1" placeholder="Message â / for commands"/> <button id="send" class="shrink-0 rounded-lg bg-primary-700 px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-600">Send</button></div></div>`),OAe=V(`<div id="chat"><div id="chat-window" class="ui-panel flex h-[420px] w-[min(500px,90vw)] flex-col overflow-hidden bg-gray-900/85 backdrop-blur-sm" style="z-index: var(--z-window)"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span><!>Chat</span> <span class="flex-1"></span> <button class="ui-button-quiet" title="Close (C)">â</button></div> <div class="relative min-h-0 flex-1"><div id="chat-messages" class="h-full overflow-y-auto px-2 py-1"><ul id="messages" class="flex flex-col gap-1"></ul></div> <!></div> <!></div></div>`);function kAe(e,n){Ce(n,!0);let i=()=>z(Es,`$peers`,l),a=()=>z(_s,`$messages`,l),o=()=>z(pc,`$username`,l),s=()=>z(Hs,`$chatHidden`,l),c=()=>z(ki,`$isLocked`,l),[l,u]=Ve(),d=t(``),p=t(null),m=t(!0),h=t(0),_=[{cmd:`/create`,help:`add a primitive â /create box | sphere | cylinder â¦`},{cmd:`/light`,help:`add a light â /light ambient | directional | hemisphere | point`},{cmd:`/group`,help:`create a group â /group <name>`},{cmd:`/clear`,help:`remove an object or everything â /clear <uuid> | all`},{cmd:`/select`,help:`select an object â /select <uuid>`},{cmd:`/transform`,help:`gizmo mode â /transform translate | rotate | scale`},{cmd:`/grid`,help:`toggle the ground grid`},{cmd:`/list`,help:`list scene objects here`}],y=q(()=>Q(d).startsWith(`/`)?_.filter(e=>e.cmd.startsWith(Q(d).split(` `)[0].toLowerCase())):[]);function b(){let e=Q(d).trim();e&&(i().sendMessage(e),I(d,``))}function x(){Q(p)&&(I(m,Q(p).scrollHeight-Q(p).scrollTop-Q(p).clientHeight<24),Q(m)&&I(h,0))}function C(){Q(p)&&(Q(p).scrollTop=Q(p).scrollHeight,I(m,!0),I(h,0))}let w=0;Qe(()=>{let e=a().length;if(e===w)return;let t=e>w;w=e,t&&(Q(m)?requestAnimationFrame(C):pe(h))});let T=e=>e.type===`sent`||e.sender===i()?.peer?.id,E=e=>e.type===`info`||e.type===`system`||e.type===``,D=e=>e.sender===i()?.peer?.id?o()||`You`:hh(e.sender),k=e=>e.ts?new Date(e.ts).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):``;var A=OAe(),ee=j(A),te=j(ee),P=j(te);pz(j(P),{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),H(P);var re=g(P,4);H(te);var ie=g(te,2),F=j(ie),ae=j(F);B(ae,5,a,e=>e,(e,t)=>{var n=fe(),i=N(n),a=e=>{var n=SAe(),i=f(n);O(e=>{r(n,1,`chat-message ${Q(t).type??``} self-center text-center text-[11px] italic text-gray-400`),Y(i,`${e??``}${Q(t).text??``}`)},[()=>Q(t).sender===`SYSTEM`?``:D(Q(t))+` `]),X(e,n)},o=q(()=>E(Q(t))),s=e=>{var n=CAe(),i=j(n),a=j(i),o=g(a,2),s=f(o,!0),c=g(o,2),l=f(c,!0);H(i);var u=g(i,2),d=f(u,!0);H(n),O((e,i,o,c)=>{r(n,1,e),Ze(a,i),Y(s,o),Y(l,c),Y(d,Q(t).text)},[()=>`chat-message `+Q(t).type+` max-w-[85%] rounded-lg px-2 py-1 text-sm `+(T(Q(t))?`self-end rounded-br-sm bg-primary-800/80 text-primary-50`:`self-start rounded-bl-sm bg-gray-700/80 text-gray-100`),()=>`background:`+gh(Q(t).sender),()=>D(Q(t)),()=>k(Q(t))]),X(e,n)};G(i,e=>{Q(o)?e(a):e(s,-1)}),X(e,n)}),H(ae),H(F),We(F,e=>I(p,e),()=>Q(p));var oe=g(F,2),R=e=>{var t=wAe(),n=f(t);O(()=>Y(n,`${Q(h)??``} new message${Q(h)===1?``:`s`} â`)),L(`click`,t,C),X(e,t)};G(oe,e=>{Q(h)>0&&!Q(m)&&e(R)}),H(ie);var se=g(ie,2),ce=e=>{var t=DAe(),n=j(t),r=e=>{var t=EAe();B(t,21,()=>Q(y),Be,(e,t)=>{var n=TAe(),r=j(n),i=f(r,!0),a=g(r,2),o=f(a,!0);H(n),O(()=>{Y(i,Q(t).cmd),Y(o,Q(t).help)}),L(`click`,n,()=>{I(d,Q(t).cmd+` `),document.getElementById(`message`)?.focus()}),X(e,n)}),H(t),X(e,t)};G(n,e=>{Q(y).length&&e(r)});var i=g(n,2),a=j(i);v(a);var o=g(a,2);H(i),H(t),L(`keydown`,a,e=>{e.key===`Enter`&&b()}),S(a,()=>Q(d),e=>I(d,e)),L(`click`,o,b),X(e,t)};G(se,e=>{c()||e(ce)}),H(ee),ne(ee,(e,t)=>Zh?.(e,t),()=>({key:`chat`,defaultRect:{right:15,bottom:15}})),ne(ee,e=>Kh?.(e)),ne(ee,(e,t)=>$h?.(e,t),()=>({key:`chat`,title:`Chat`,openStore:Hs,isOpen:e=>e===``,close:()=>Hs.set(`hidden`)})),H(A),O(()=>r(A,1,M(s()))),L(`click`,re,()=>Hs.set(`hidden`)),Z(`scroll`,F,x),X(e,A),ue(),u()}ge([`click`,`keydown`]);var kz=[`<tool_call>`,`<function=`,`<tool_calls>`];function AAe(e,t){let n=e.length;for(let t of kz){let r=e.indexOf(t);r>=0&&r<n&&(n=r)}if(t||n<e.length)return n;let r=kz.reduce((e,t)=>
2235Math.max(e,t.length),0);for(let t=Math.min(r-1,e.length);t>0;t--){let n=e.slice(e.length-t);if(kz.some(e=>e.startsWith(n)))return e.length-t}return n}function jAe(e){let t=e.trim();if(!t)return``;let n=t[0];if(n===`{`||n===`[`||n===`"`)try{return JSON.parse(t)}catch{return t}return t===`true`?!0:t===`false`?!1:t===`null`?null:/^-?\d+(\.\d+)?([eE][-+]?\d+)?$/.test(t)?Number(t):t}function Az(e){let t=e.match(/<function\s*=\s*([^>\s]+)\s*>/);if(!t)return null;let n={},r=/<parameter\s*=\s*([^>\s]+)\s*>([\s\S]*?)<\/parameter\s*>/g,i;for(;i=r.exec(e);)n[i[1]]=jAe(i[2]);return{id:``,name:t[1].trim(),arguments:JSON.stringify(n)}}function jz(e){let t=e.indexOf(`{`);if(t<0)return null;let n=0,r=!1,i=!1,a=-1;for(let o=t;o<e.length;o++){let t=e[o];if(r){i?i=!1:t===`\\`?i=!0:t===`"`&&(r=!1);continue}if(t===`"`)r=!0;else if(t===`{`)n++;else if(t===`}`&&--n===0){a=o+1;break}}if(a<0)return null;let o;try{o=JSON.parse(e.slice(t,a))}catch{return null}let s=o&&(o.name||o.function||o.tool||o.tool_name);if(!s||typeof s!=`string`)return null;let c=o.arguments??o.parameters??o.args??o.input??{};return{id:``,name:s.trim(),arguments:typeof c==`string`?c:JSON.stringify(c??{})}}function MAe(e,t=[]){let n=e||``,r=[],i=n,a=(e,t)=>{t&&t.name&&(r.push(t),i=i.replace(e,``))},o=/<tool_call\s*>([\s\S]*?)(?:<\/tool_call\s*>|$)/g,s;for(;s=o.exec(n);){let e=s[1];a(s[0],e.includes(`<function`)?Az(e):jz(e))}if(!r.length){let e=/<function\s*=\s*[^>\s]+\s*>[\s\S]*?(?:<\/function\s*>|$)/g;for(;s=e.exec(n);)a(s[0],Az(s[0]))}if(!r.length&&t.length&&n.includes(`"name"`)){let e=/```(?:json|tool_code)?\s*([\s\S]*?)```/g,a=[];for(;s=e.exec(n);)a.push(s[1]);a.length||a.push(n);for(let e of a){let n=jz(e);n&&t.includes(n.name)&&(r.push(n),i=i.replace(e,``))}}return{calls:r,text:i.trim()}}var Mz=class extends Error{constructor(e,t){super(`AI request failed (`+e+`)`),this.name=`AiHttpError`,this.status=e,this.body=t}};function Nz(e,t){return e.baseUrl.replace(/\/+$/,``)+t}var Pz=new Set;function Fz(e){return e.id||e.baseUrl+`|`+e.model}function NAe(e){return e.stream===!1||Pz.has(Fz(e))}function Iz(e){let t={"Content-Type":`application/json`};return e.apiKey&&(t.Authorization=`Bearer `+e.apiKey),t}async function Lz({config:e,messages:t,tools:n,onDelta:r,onReasoning:i,signal:a,stream:o=!0}){let s={model:e.model,messages:t,stream:o};typeof e.temperature==`number`&&(s.temperature=e.temperature),n&&n.length&&(s.tools=n,s.tool_choice=`auto`);let c=await fetch(Nz(e,`/chat/completions`),{method:`POST`,headers:Iz(e),body:JSON.stringify(s),signal:a});if(!c.ok){let e=await c.text().catch(()=>``);throw new Mz(c.status,e)}if(!o){let e=await c.json(),t=e.choices&&e.choices[0]&&e.choices[0].message||{},a=t.reasoning_content??t.reasoning;typeof a==`string`&&a&&i&&i(a);let o=Array.isArray(t.tool_calls)?t.tool_calls.map(e=>({id:e.id||``,name:e.function&&e.function.name||``,arguments:e.function&&e.function.arguments||``,extra:e.extra_content})):[],s=zz(String(t.content||``),o,n);r&&s.content&&r(s.content);let l=e.choices&&e.choices[0]&&e.choices[0].finish_reason||null;return{...s,finishReason:l}}let l=c.body;if(!l)throw new Mz(c.status,`empty response body`);let u=l.getReader(),d=new TextDecoder,f=``,p=``,m=null,h=new Map,g=0,_=e=>{if(!r)return;let t=AAe(p,e);t>g&&(r(p.slice(g,t)),g=t)},v=e=>{if(e===`[DONE]`)return;let t;try{t=JSON.parse(e)}catch{return}let n=t.choices&&t.choices[0];if(!n)return;let r=n.delta||{},a=r.reasoning_content??r.reasoning;if(typeof a==`string`&&a&&i&&i(a),typeof r.content==`string`&&r.content&&(p+=r.content,_(!1)),Array.isArray(r.tool_calls))for(let e of r.tool_calls){let t=typeof e.index==`number`?e.index:h.size,n=h.get(t)||{id:``,name:``,arguments:``};e.id&&(n.id=e.id),e.extra_content&&(n.extra=e.extra_content),e.function&&(e.function.name&&(n.name=e.function.name),typeof e.function.arguments==`string`&&(n.arguments+=e.function.arguments)),h.set(t,n)}n.finish_reason&&(m=n.finish_reason)};try{for(;;){let{done:e,value:t}=await u.read();if(e)break;f+=d.decode(t,{stream:!0});let n;for(;(n=f.indexOf(` 2236`))>=0;){let e=f.slice(0,n).trim();f=f.slice(n+1),e.startsWith(`data:`)&&v(e.slice(5).trim())}}let e=f.trim();e.startsWith(`data:`)&&v(e.slice(5).trim()),_(!0)}finally{try{u.cancel()}catch{}}let y=[...h.entries()].sort((e,t)=>
2236e[0]-t[0]).map(([,e])=>e);return{...zz(p,y,n),finishReason:m}}function Rz(e){return(e||[]).map(e=>e?.function?.name).filter(Boolean)}function zz(e,t,n){if(!t.length&&e){let t=MAe(e,Rz(n));if(t.calls.length)return{content:t.text,toolCalls:t.calls,fromText:!0}}return{content:e,toolCalls:t,fromText:!1}}function PAe(e,t,n){if(!e.trim()&&!t.length)return!0;let r=Rz(n);return t.some(e=>{let t=(e.arguments||``).trim();return!r.includes(e.name)&&(!t||t===`{}`)})}async function FAe({config:e,messages:t,tools:n,executeTool:r,onDelta:i,onReasoning:a,onTurnText:o,onToolStart:s,onToolResult:c,onNotice:l,signal:u,maxIterations:d=12}){let f=0,p=``,m=!NAe(e),h=0;for(;h<d;h++){let d=await Lz({config:e,messages:t,tools:n,onDelta:i,onReasoning:a,signal:u,stream:m});m&&PAe(d.content,d.toolCalls,n)&&(m=!1,Pz.add(Fz(e)),o&&o(``),l&&l(`Streamed tool calls came back empty â retrying without streaming`),d=await Lz({config:e,messages:t,tools:n,onDelta:i,onReasoning:a,signal:u,stream:m}));let{content:g,toolCalls:_,fromText:v}=d;if(p=g,v&&o&&o(g),!_.length)break;t.push({role:`assistant`,content:g||null,tool_calls:_.map(e=>({id:e.id||`call_`+h+`_`+e.name,type:`function`,function:{name:e.name,arguments:e.arguments||`{}`},...e.extra?{extra_content:e.extra}:{}}))});for(let e of _){let n={};try{n=e.arguments?JSON.parse(e.arguments):{}}catch{let n={error:`invalid JSON arguments: `+e.arguments};t.push({role:`tool`,tool_call_id:e.id||`call_`+h+`_`+e.name,name:e.name,content:JSON.stringify(n)}),c&&c(e.name,n);continue}s&&s(e.name,n);let i;try{i=await r(e.name,n)}catch(e){i={error:e instanceof Error?e.message:String(e)}}f++,t.push({role:`tool`,tool_call_id:e.id||`call_`+h+`_`+e.name,name:e.name,content:JSON.stringify(i??{ok:!0})}),c&&c(e.name,i)}}return{content:p,iterations:h,toolRuns:f}}async function Bz(e,t){try{let n=await fetch(Nz(e,`/models`),{headers:Iz(e),signal:t});if(!n.ok)return null;let r=await n.json().catch(()=>({}));return Array.isArray(r.data)?r.data.map(e=>String(e.id||``)).map(e=>e.replace(/^models\//,``)).filter(Boolean).slice(0,500):null}catch{return null}}async function Vz(e,t){try{let n=await fetch(Nz(e,`/chat/completions`),{method:`POST`,headers:Iz(e),body:JSON.stringify({model:e.model,messages:[{role:`user`,content:`ping`}],max_tokens:1,stream:!1}),signal:t});return n.ok?{ok:!0,detail:`Connected`}:{ok:!1,detail:Hz(new Mz(n.status,await n.text().catch(()=>``)))}}catch(e){return e instanceof Error&&e.name===`AbortError`?{ok:!1,detail:`Cancelled`}:{ok:!1,detail:Hz(e)}}}async function IAe(e,t){if(!e.baseUrl)return{ok:!1,detail:`No base URL set`,models:null,modelOk:null};let n=await Bz(e,t),r=(e.model||``).trim();if(n){if(!r)return{ok:!0,detail:`Connected â `+n.length+` models`,models:n,modelOk:null};if(n.includes(r))return{ok:!0,detail:`Connected â `+n.length+` models`,models:n,modelOk:!0};let i=await Vz(e,t);return{ok:!0,detail:`Connected â `+n.length+` models`,models:n,modelOk:i.ok}}if(!r)return{ok:!1,detail:`This endpoint lists no models â enter a model id, then test again`,models:null,modelOk:null};let i=await Vz(e,t);return{...i,models:null,modelOk:i.ok}}function Hz(e){if(e instanceof Mz){if(e.status===401||e.status===403)return`Invalid API key or unauthorized`;if(e.status===429)return`Rate limited â slow down or check your quota`;if(e.status===404)return`Endpoint not found â check the base URL`;if(e.status>=500)return`Provider server error (`+e.status+`)`;let t=(e.body||``).slice(0,200);return`Request failed (`+e.status+`)`+(t?`: `+t:``)}return e instanceof Error?e.name===`AbortError`?`Cancelled`:e.name===`TypeError`?`Network or CORS error â a self-hosted vLLM must run with --allowed-origins`:e.message:String(e)}var Uz=Ue([]),Wz=Ue(!1),Gz=Ue(``),Kz=null,qz=[],LAe=40;function Jz(){Kz&&Kz.abort()}function RAe(){Jz(),qz=[],Uz.set([])}function Yz(e){Uz.update(t=>[...t,e])}function zAe(e){Uz.update(t=>{let n=t[t.length-1];if(n&&n.role===`assistant`&&n.streaming)return[...t.slice(0,-1),{...n,content:n.content+e}];let r=e.replace(/^\s+/,``);return r?[...t,{role:`assistant`,content:r,streaming:!0}]:t})}function Xz(){Uz.update(e=>{let t=e[e.length-1];return t&&t.role===`assistant`&&t.streaming?[...e.slice(0,-1),{...t,streaming:!1}]:e})}function BAe(e){let t=(e||``).trim();Uz.update(e=>{let n=e[e.length-1];return!n||n.role!==`assistant`||!n.streaming?e:t?[...e.slice(0,-1),{...n,c
2236ontent:t}]:e.slice(0,-1)})}function VAe(e,t){if(e===`create_objects`)return`Creating `+(t?.objects?.length??0)+` object(s)`;if(e===`update_objects`)return`Updating `+(t?.updates?.length??0)+` object(s)`;if(e===`delete_objects`)return`Deleting `+(t?.uuids?.length??0)+` object(s)`;if(e===`group_objects`)return`Grouping objects`;if(e===`clear_scene`)return`Clearing the scene`;if(e===`list_scene`)return`Reading the scene`;if(e===`create_flow_nodes`){let e=typeof t?.text==`string`?(t.text.match(/^\s*[^\s/]+\s*=/gm)??[]).length:0;return`Adding `+((t?.nodes?.length??0)+e)+` behavior node(s)`}if(e===`create_behaviour`)return`Writing behaviour `+(t?.name??``);if(e===`edit_behaviour`)return`Editing behaviour `+(t?.name??``);if(e===`update_flow_nodes`){let e=t?.remove?.length??0,n=t?.updates?.length??0;return e&&!n?`Removing `+e+` behavior node(s)`:`Updating `+n+` behavior node(s)`}return e===`set_physics`?`Setting physics on `+(t?.updates?.length??0)+` object(s)`:e===`create_joints`?`Attaching `+(t?.joints?.length??0)+` joint(s)`:e===`control_simulation`?`Simulation: `+(t?.action??`â¦`):e}function HAe(e,t,n){if(e===`list_scene`||!t||typeof t!=`object`||e===`control_simulation`)return;let r=e=>{for(let t of e)t&&!t.error&&(typeof t.uuid==`string`?n.uuids.add(t.uuid):n.other+=1)};if(Array.isArray(t.created))return r(t.created);if(Array.isArray(t.updated)){r(t.updated),typeof t.removed==`number`&&(n.other+=t.removed);return}if(Array.isArray(t.joints))return r(t.joints);if(typeof t.deleted==`number`){n.other+=t.deleted;return}if(typeof t.cleared==`number`){n.other+=t.cleared;return}n.other+=1}async function Zz(e){let t=(e||``).trim();if(!t||U(Wz))return;if(!Fh()){es(`Configure an AI provider in Settings to use the assistant`),Ss.set(`ai`),dc.set(!0);return}let n=Dse();if(!n)return;Yz({role:`user`,content:t}),qz.length||qz.push({role:`system`,content:kge()}),qz.push({role:`user`,content:`Current scene: 2237`+JSON.stringify(Ege())+` 2238 2239Request: `+t}),qz.length>LAe&&(qz=[qz[0],...qz.slice(-39)]),Kz=new AbortController,Wz.set(!0),Gz.set(``),Lf();let r={uuids:new Set,other:0},i=()=>r.uuids.size+r.other,a=0;try{let e=await FAe({config:n,messages:qz,tools:Oge(),executeTool:Dge,onDelta:e=>{Gz.set(``),zAe(e)},onReasoning:()=>Gz.set(`Thinkingâ¦`),onNotice:e=>Yz({role:`tool-status`,content:e}),onTurnText:e=>BAe(e),onToolStart:(e,t)=>{Gz.set(``);let n=RS(e,t);Yz({role:`tool-status`,content:VAe(n.name,n.args)})},onToolResult:(e,t)=>{let n=t&&typeof t==`object`?t.error:null;n?(a++,Yz({role:`error`,content:String(n).slice(0,300)})):HAe(RS(e,{}).name,t,r)},signal:Kz.signal});Xz(),!e.content&&!i()&&!a&&Yz({role:`assistant`,content:`(no response)`})}catch(e){Xz(),Yz({role:`error`,content:Hz(e)})}finally{kf(`AI: `+t.slice(0,40));let e=i();e&&Yz({role:`summary`,content:`Applied `+e+` action(s) â undo (Ctrl+Z) reverts them together`}),Gz.set(``),Wz.set(!1),Kz=null}}var UAe=V(`<div class="ai-pill ui-panel flex items-center gap-1.5 bg-gray-900/90 px-2 py-1.5 backdrop-blur-sm svelte-1num3fi" style="position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-inset, 0px) + 72px); z-index: var(--z-hud); width: min(560px, 92vw);"><span class="pl-1 text-sm svelte-1num3fi">â¨</span> <input type="text" class="ui-input min-w-0 flex-1 svelte-1num3fi" placeholder="Ask the assistant to build or change the sceneâ¦"/> <button class="shrink-0 rounded-lg bg-primary-700 px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-600 svelte-1num3fi">Send</button></div>`),WAe=V(`<p class="px-2 py-6 text-center text-sm text-gray-400 svelte-1num3fi">Describe a scene and I'll build it â e.g. "make a small campfire ring with 6 rocks and a 2240 cone flame".</p>`),GAe=V(`<li class="max-w-[85%] self-end rounded-lg rounded-br-sm bg-primary-800/80 px-2.5 py-1.5 text-sm text-primary-50 svelte-1num3fi"> </li>`),KAe=V(`<span class="ai-caret svelte-1num3fi">â</span>`),qAe=V(`<li class="max-w-[90%] self-start rounded-lg rounded-bl-sm bg-gray-700/80 px-2.5 py-1.5 text-sm text-gray-100 whitespace-pre-wrap svelte-1num3fi"> <!></li>
2240`),Qz=V(`<li class="self-center text-center text-[11px] italic text-gray-400 svelte-1num3fi"> </li>`),JAe=V(`<li class="self-center text-center text-[11px] text-emerald-400/90 svelte-1num3fi"> </li>`),YAe=V(`<li class="max-w-[90%] self-start rounded-lg bg-red-900/50 px-2.5 py-1.5 text-sm text-red-200 svelte-1num3fi"> </li>`),XAe=V(`<option class="svelte-1num3fi"> </option>`),ZAe=V(`<select class="ui-input flex-1 text-xs svelte-1num3fi"></select>`),QAe=V(`<span class="flex-1 text-xs text-gray-400 svelte-1num3fi">No provider configured â see Settings â AI</span>`),$Ae=V(`<button class="shrink-0 rounded-lg bg-red-700 px-3 py-1.5 text-sm font-medium text-white hover:bg-red-600 svelte-1num3fi">Stop</button>`),eje=V(`<button class="shrink-0 rounded-lg bg-primary-700 px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-600 svelte-1num3fi">Send</button>`),tje=V(`<!> <div id="ai-assistant"><div id="ai-assistant-window" class="ui-panel flex h-[440px] w-[min(500px,90vw)] flex-col overflow-hidden bg-gray-900/85 backdrop-blur-sm svelte-1num3fi" style="z-index: var(--z-window)"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5 svelte-1num3fi"><span class="svelte-1num3fi">⨠AI Assistant</span> <span class="flex-1 svelte-1num3fi"></span> <button class="ui-button-quiet svelte-1num3fi" title="Close">â</button></div> <div class="min-h-0 flex-1 overflow-y-auto px-2 py-2 svelte-1num3fi"><!> <ul class="flex flex-col gap-1.5 svelte-1num3fi"><!> <!></ul></div> <div class="shrink-0 border-t border-gray-700/60 p-2 svelte-1num3fi"><div class="mb-1.5 flex items-center gap-1.5 svelte-1num3fi"><!></div> <div class="flex items-center gap-1.5 svelte-1num3fi"><input type="text" class="ui-input min-w-0 flex-1 svelte-1num3fi" placeholder="Ask the assistantâ¦"/> <!></div></div></div></div>`,1);function nje(e,n){Ce(n,!0);let i=()=>z(Mh,`$aiProviders`,p),a=()=>z(Ah,`$aiActiveProvider`,p),o=()=>z(Ks,`$aiPromptBarOpen`,p),s=()=>z(Eh,`$aiEnabled`,p),c=()=>z(ys,`$aiAssistantHidden`,p),l=()=>z(Wz,`$aiBusy`,p),u=()=>z(Uz,`$aiMessages`,p),d=()=>z(Gz,`$aiStatus`,p),[p,m]=Ve(),h=t(``),y=t(``),b=t(null),x=t(null),C=q(()=>i().length>0&&!!a()),w=q(()=>o()&&s()&&Q(C)&&c()!==``);function T(){let e=Q(h).trim();e&&!l()&&(I(h,``),Zz(e))}function E(){let e=Q(y).trim();e&&(I(y,``),Ks.set(!1),ys.set(``),Zz(e))}Qe(()=>{Q(w)&&Q(x)&&requestAnimationFrame(()=>Q(x)?.focus())});let k=0;Qe(()=>{let e=u().length,t=l();Q(b)&&(e!==k||t)&&(k=e,requestAnimationFrame(()=>{Q(b)&&(Q(b).scrollTop=Q(b).scrollHeight)}))});function A(e){let t=e.currentTarget.value;kh(t||null)}var ee=tje(),te=N(ee),P=e=>{var t=UAe(),n=g(j(t),2);v(n),We(n,e=>I(x,e),()=>Q(x));var r=g(n,2);H(t),L(`keydown`,n,e=>{e.key===`Enter`?E():e.key===`Escape`&&Ks.set(!1)}),S(n,()=>Q(y),e=>I(y,e)),L(`click`,r,E),X(e,t)};G(te,e=>{Q(w)&&e(P)});var re=g(te,2),ie=j(re),F=j(ie),ae=g(j(F),4);H(F);var oe=g(F,2),R=j(oe),se=e=>{var t=WAe();X(e,t)};G(R,e=>{u().length||e(se)});var ce=g(R,2),le=j(ce);B(le,1,u,Be,(e,t)=>{var n=fe(),r=N(n),i=e=>{var n=GAe(),r=f(n,!0);O(()=>Y(r,Q(t).content)),X(e,n)},a=e=>{var n=qAe(),r=j(n,!0),i=g(r),a=e=>{var t=KAe();X(e,t)};G(i,e=>{Q(t).streaming&&e(a)}),H(n),O(()=>Y(r,Q(t).content)),X(e,n)},o=e=>{var n=Qz(),r=f(n);O(()=>Y(r,`â ${Q(t).content??``}`)),X(e,n)},s=e=>{var n=JAe(),r=f(n,!0);O(()=>Y(r,Q(t).content)),X(e,n)},c=e=>{var n=YAe(),r=f(n);O(()=>Y(r,`â ${Q(t).content??``}`)),X(e,n)};G(r,e=>{Q(t).role===`user`?e(i):Q(t).role===`assistant`?e(a,1):Q(t).role===`tool-status`?e(o,2):Q(t).role===`summary`?e(s,3):Q(t).role===`error`&&e(c,4)}),X(e,n)});var de=g(le,2),pe=e=>{var t=Qz(),n=f(t,!0);O(()=>Y(n,d())),X(e,t)};G(de,e=>{l()&&d()&&e(pe)}),H(ce),H(oe),We(oe,e=>I(b,e),()=>Q(b));var me=g(oe,2),V=j(me),he=j(V),ge=e=>{var t=ZAe();B(t,5,i,e=>e.id,(e,t)=>{var n=XAe(),r=f(n),i={};O(()=>{Y(r,`${Q(t).label??``} · ${Q(t).model??``}`),i!==(i=Q(t).id)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(t);var n;_(t),O(()=>{n!==(n=a()??``)&&(t.value=(t.__value=n)??``,D(t,n))}),L(`change`,t,A),X(e,t)},U=e=>{var t=QAe();X(e,t)};G(he,e=>
2240{i().length?e(ge):e(U,-1)}),H(V);var W=g(V,2),_e=j(W);v(_e);var ve=g(_e,2),ye=e=>{var t=$Ae();L(`click`,t,function(...e){Jz?.apply(this,e)}),X(e,t)},be=e=>{var t=eje();L(`click`,t,T),X(e,t)};G(ve,e=>{l()?e(ye):e(be,-1)}),H(W),H(me),H(ie),ne(ie,(e,t)=>Zh?.(e,t),()=>({key:`aiAssistant`,defaultRect:{right:15,bottom:460}})),ne(ie,e=>Kh?.(e)),ne(ie,(e,t)=>$h?.(e,t),()=>({key:`aiAssistant`,title:`⨠AI Assistant`,openStore:ys,isOpen:e=>e===``,close:()=>ys.set(`hidden`)})),H(re),O(()=>{r(re,1,M(c()),`svelte-1num3fi`),_e.disabled=l()}),L(`click`,ae,()=>ys.set(`hidden`)),L(`keydown`,_e,e=>{e.key===`Enter`&&T()}),S(_e,()=>Q(h),e=>I(h,e)),X(e,ee),ue(),m()}ge([`keydown`,`click`,`change`]);var rje=Ge({fetchResult:()=>sje,poll:()=>aje,submit:()=>ije});function $z(e,t){let n={};return t&&(n[`Content-Type`]=`application/json`),e.apiKey&&(n.Authorization=`Bearer `+e.apiKey),n}function eB(e,t,n){if(Array.isArray(e))return e.map(e=>eB(e,t,n));if(e&&typeof e==`object`){let r={};for(let i of Object.keys(e))r[i]=eB(e[i],t,n);return r}return typeof e==`string`?e===`{{SEED}}`?n:e.replace(/\{\{PROMPT\}\}/g,t).replace(/\{\{SEED\}\}/g,String(n)):e}async function ije(e,t){if(!e.workflowJson||!e.workflowJson.trim())throw Error(`This ComfyUI provider has no workflow JSON â paste an API-format workflow in Settings.`);let n;try{n=JSON.parse(e.workflowJson)}catch{throw Error(`The saved ComfyUI workflow is not valid JSON â re-export it in API format.`)}let r=typeof t.seed==`number`?t.seed:Math.floor(Math.random()*1e9);n=eB(n,t.prompt,r);let i=`tpp-`+Math.random().toString(36).slice(2),a=await fetch(e.baseUrl.replace(/\/+$/,``)+`/prompt`,{method:`POST`,headers:$z(e,!0),body:JSON.stringify({prompt:n,client_id:i})});if(!a.ok){let e=await a.text().catch(()=>``);throw Error(tB(a.status,e))}let o=await a.json().catch(()=>({}));if(o.node_errors&&Object.keys(o.node_errors).length)throw Error(`ComfyUI rejected the workflow: `+JSON.stringify(o.node_errors).slice(0,300));if(!o.prompt_id)throw Error(`ComfyUI did not return a prompt_id`);return{promptId:o.prompt_id,clientId:i}}async function aje(e,t){let n=await fetch(e.baseUrl.replace(/\/+$/,``)+`/history/`+encodeURIComponent(t.promptId),{headers:$z(e,!1)});if(!n.ok)return{status:`running`};let r=(await n.json().catch(()=>({})))[t.promptId];if(!r)return{status:`running`};if((r.status&&r.status.status_str)===`error`)return{status:`error`,error:cje(r)};let i=oje(r.outputs,e.outputNodeId);return i?{status:`done`,resultRef:i}:r.status&&r.status.completed?{status:`error`,error:`The workflow finished but produced no .glb output â check the SaveGLB node (or set the output node id in Settings).`}:{status:`running`}}function oje(e,t){if(!e||typeof e!=`object`)return null;let n=t&&e[t]?[t]:Object.keys(e);for(let t of n){let n=e[t];if(n&&typeof n==`object`)for(let e of Object.keys(n)){let t=n[e];if(Array.isArray(t))for(let e of t){let t=e&&(e.filename||e.name);if(typeof t==`string`&&/\.(glb|gltf)$/i.test(t))return{filename:t,subfolder:e.subfolder||``,type:e.type||`output`}}}}return null}async function sje(e,t){let n=new URLSearchParams({filename:t.filename,subfolder:t.subfolder||``,type:t.type||`output`}),r=await fetch(e.baseUrl.replace(/\/+$/,``)+`/view?`+n.toString(),{headers:$z(e,!1)});if(!r.ok)throw Error(tB(r.status,`downloading the generated GLB`));return await r.arrayBuffer()}function cje(e){try{let t=e.status&&e.status.messages;if(Array.isArray(t)){let e=t.find(e=>e[0]===`execution_error`);if(e&&e[1])return String(e[1].exception_message||e[1].node_type||`execution error`).slice(0,300)}}catch{}return`ComfyUI execution error`}function tB(e,t){return e===0?`Cannot reach ComfyUI â check the URL and that it runs with --enable-cors-header`:e===401||e===403?`ComfyUI proxy rejected the token (Authorization)`:e===404?`ComfyUI endpoint not found â check the base URL`:`ComfyUI error `+e+(t?`: `+String(t).slice(0,200):``)}var lje=Ge({fetchResult:()=>pje,poll:()=>fje,submit:()=>dje}),uje=`/openapi/v2/text-to-3d`;function nB(e,t){let n={Authorization:`Bearer `+(e.apiKey||``)};return t&&(n[`Content-Type`]=`application/json`),n}async function rB(e,t){let n=await fetch(e.baseUrl.replace(/\/+$/,``)+uje,{method:`POST`,headers:nB(e,!0),body:JSON.stringify(t)});if(!n.ok){let e=await n.text().catch(()=>``);throw Error(aB(n.status,e))}let r=await n.json().catch(()=>({})),i=r.result||r.id;if(!i)throw Error(`Meshy did not return a task id`);return i}async function dje(e,t){if(!e.apiKey)throw Error(`Meshy needs an API key (set it in Settings)`);let n=e.mode===`refine`?`refine`:`preview`;return{taskId:await rB(e,{mode:`preview`,prompt:t.prompt,art_style:e.artStyle||`realistic`,should_remesh:!0}),phase:`preview`,mode:n}}async function fje(e,t){let n=await fetch(e.baseUrl.replace(/\/+$/,``)+`/openapi/v2/text-to-3d/`+encodeURIComponent(t.taskId),{headers:nB(e,!1)});if(!n.ok){if(n.status===404)return{status:`running`};let e=await n.text().catch(()=>``);return{status:`error`,error:aB(n.status,e)}}let r=await n.json().catch(()=>({})),i=String(r.status||``).toUpperCase(),a=typeof r.progress==`number`?Math.max(0,Math.min(1,r.progress/100)):void 0;if(i===`FAILED`||i===`CANCELED`)return{status:`error`,error:r.task_error&&r.task_error.message||`Meshy task `+i.toLowerCase()};if(i===`SUCCEEDED`){if(t.phase===`preview`&&t.mode===`refine`)return{status:`running`,progress:.5,ref:{taskId:await rB(e,{mode:`refine`,preview_task_id:t.taskId}),phase:`refine`,mode:`refine`}};let n=r.model_urls&&(r.model_urls.glb||r.model_urls.gltf);
2240return n?{status:`done`,resultRef:{url:n}}:{status:`error`,error:`Meshy task succeeded but returned no GLB url`}}return{status:`running`,progress:a}}async function pje(e,t){let n=hje(e),r=async()=>{let e=null;for(let r of n)try{let n=await fetch(r+`?url=`+encodeURIComponent(t.url)),i=n.headers.get(`content-type`)||``;if(n.ok&&!i.includes(`text/html`))return await n.arrayBuffer();e=new iB(n.status,!0)}catch(t){e=t}throw e??Error(`no asset proxy configured`)},i=``;try{i=new URL(t.url).hostname}catch{}let a=mje.includes(i);if(n.length&&a)try{return await r()}catch{}try{let e=await fetch(t.url);if(!e.ok)throw new iB(e.status,!1);return await e.arrayBuffer()}catch(e){if(e instanceof iB)throw Error(`Downloading the Meshy GLB failed (`+e.status+`)`);if(!n.length)throw Error(`Meshy's CDN blocks browser downloads (no CORS headers). Set an asset proxy on the Meshy provider (Settings â AI â Mesh providers).`);if(a)throw Error(`All asset proxies failed and the CDN blocks direct downloads â is the proxy up?`);try{return await r()}catch(e){let t=e instanceof iB?` (`+e.status+`)`:``;throw Error(`Asset-proxy download failed`+t)}}}var mje=[`assets.meshy.ai`];function hje(e){let t={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_ASSET_PROXY:`https://proxy.theprototype.app`,VITE_CLOUD_PLUGIN:`/cloud-plugin.js`,VITE_PB_URL:`https://pb.theprototype.app`,VITE_PEER_HOST:`peerjs.theprototype.app`,VITE_PEER_PATH:`/peerjs`,VITE_PEER_PORT:`443`,VITE_PEER_SECURE:`true`,VITE_PERF_REPORTS_URL:`https://pb.theprototype.app/api/collections/perf_reports/records?fields=id`,VITE_STUN_URLS:`stun:peerjs.theprototype.app:3478`},n=String(t.VITE_PEER_HOST||``).trim(),r=[String(e.assetProxy||``).trim(),`/proxy`,String(t.VITE_ASSET_PROXY||``).trim(),n?`https://`+n+`/proxy`:``];return[...new Set(r.filter(Boolean).map(e=>e.replace(/\/+$/,``)))]}var iB=class extends Error{constructor(e,t=!1){super(`asset http `+e),this.status=e,this.viaProxy=t}};function aB(e,t){if(e===401||e===403)return`Meshy rejected the API key`;if(e===402)return`Meshy: out of credits`;if(e===429)return`Meshy rate limit â try again shortly`;let n=``;try{let e=JSON.parse(t);n=e.message||e.error||``}catch{n=String(t||``).slice(0,150)}return`Meshy error `+e+(n?`: `+n:``)}function gje(e){if(e===`comfyui`)return rje;if(e===`meshy`)return lje;throw Error(`no mesh adapter for kind "`+e+`"`)}var oB=Ue([]),_je=3e3,vje=6e5,yje=41943040,sB=new Set;function cB(e,t){oB.update(n=>n.map(n=>n.id===e?{...n,...t}:n))}function bje(e){oB.update(t=>[...t,e])}function lB(e){oB.update(t=>t.filter(t=>t.id!==e))}function uB(e){sB.add(e),cB(e,{status:`cancelled`})}var xje=e=>new Promise(t=>setTimeout(t,e));function dB(e){let t=(e||`Generated`).trim().replace(/\s+/g,` `);return t.length>40?t.slice(0,40):t}function Sje(){try{if(typeof crypto<`u`&&crypto.randomUUID)return crypto.randomUUID()}catch{}return`mj-`+Math.random().toString(36).slice(2)}async function fB(e){let t=(e.prompt||``).trim();if(!t)throw Error(`Empty prompt`);let n=e.providerId?U(AS).find(t=>t.id===e.providerId):bge();if(!n)throw es(`Configure a mesh-generation provider in Settings`),Error(`no mesh provider`);if(!e.providerId&&!PS())throw es(`The active mesh provider is not fully configured (Settings -> AI)`),Error(`mesh provider not ready`);let r=Sje(),i=typeof e.seed==`number`?e.seed:Math.floor(Math.random()*1e9);bje({id:r,prompt:t,provider:n.label,status:`submitting`,progress:null});let a=gje(n.kind),o=Date.now();try{let s=await a.submit(n,{prompt:t,seed:i});cB(r,{status:`running`,progress:null});let c=null;for(;;){if(sB.has(r)||(await xje(_je),sB.has(r)))throw new pB;if(Date.now()-o>vje)throw Error(`Generation timed out after 10 minutes`);let e;try{e=await a.poll(n,s)}catch{continue}if(e.ref&&(s=e.ref),typeof e.progress==`number`&&cB(r,{progress:e.progress}),e.status===`done`){c=e.resultRef;break}if(e.status===`error`)throw Error(e.error||`generation failed`)}cB(r,{status:`importing`,progress:1});let l=await a.fetchResult(n,c);if(l.byteLength>yje)throw Error(`Generated mesh is too large (`+Math.round(l.byteLength/1e6)+` MB, cap 40 MB)`);let u={prompt:t,provider:n.kind,label:n.label,seed:i,at:Date.now()},d=await Age(l,{name:e.name||dB(t),position:e.position,provenance:u});return Cje(l,e.name||dB(t)).catch(()=>{}),cB(r,{status:`done`,progress:1,uuid:d}),{uuid:d}}catch(e){if(sB.delete(r),e instanceof pB)throw cB(r,{status:`cancelled`}),e;let t=e instanceof Error?e.message:String(e);throw cB(r,{status:`error`,error:t}),es(`Mesh generation failed: `+t),e}finally{sB.delete(r)}}
2240var pB=class extends Error{constructor(){super(`cancelled`),this.name=`CancelledError`}};async function Cje(e,t){try{let n=await $(()=>import(`../chunks/DkMAWo2j.js`).then(e=>e.f),__vite__mapDeps([69,1,2,9,44,5,6,3,70,20,21]),import.meta.url),r=U(n.explorerFolders).find(e=>e.name===`Generated`&&!e.parentId);r||=n.createFolder(`Generated`,null);let i=new File([e],(t||`generated`)+`.glb`,{type:`model/gltf-binary`});await n.importFiles([i],r?r.id:null)}catch{}}var wje=V(`<option> </option>`),Tje=V(`<label class="flex flex-col gap-1 text-xs text-gray-300">Provider <select class="ui-input"></select></label>`),Eje=V(`<p class="text-xs text-amber-300">No mesh provider configured â add one in Settings â AI â Mesh generation.</p>`),Dje=V(`<p class="text-[11px] text-amber-300/90"> </p>`),Oje=V(`<div class="mesh-gen-backdrop svelte-1gwrjfa" role="presentation"><div class="ui-panel mesh-gen-modal flex w-[min(460px,92vw)] flex-col gap-3 bg-gray-900/95 p-4 backdrop-blur-sm" role="dialog" aria-modal="true" aria-label="Generate 3D model"><div class="flex items-center"><span class="text-sm font-semibold">⨠Generate 3D model</span> <span class="flex-1"></span> <button class="ui-button-quiet" title="Close">â</button></div> <!> <label class="flex flex-col gap-1 text-xs text-gray-300">Prompt <textarea class="ui-input min-h-[64px] resize-y" placeholder="a weathered wooden treasure chest with iron bands"></textarea></label> <label class="flex flex-col gap-1 text-xs text-gray-300">Name (optional) <input class="ui-input" placeholder="Treasure chest"/></label> <!> <div class="flex items-center gap-2"><button class="rounded-lg bg-primary-700 px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-600 disabled:opacity-50">Generate</button> <span class="text-[11px] text-gray-400">Takes ~1â3 min; it appears in the scene when ready.</span></div></div></div>`);function kje(e,n){Ce(n,!0);let r=()=>z(AS,`$meshProviders`,o),i=()=>z(NS,`$meshActiveProvider`,o),a=()=>z(hs,`$meshGenModalOpen`,o),[o,s]=Ve(),c=t(``),l=t(``),u=q(()=>r().find(e=>e.id===i())??null),d=q(()=>Q(u)?.kind===`meshy`);function p(){hs.set(null),I(c,``),I(l,``)}function m(e){e.target===e.currentTarget&&p()}function h(){let e=Q(c).trim();if(!e)return;let t=a()?.position??void 0;fB({prompt:e,name:Q(l).trim()||void 0,position:t}).catch(()=>{}),p()}function y(e){jS(e.currentTarget.value||null)}var b=fe(),x=N(b),C=e=>{var t=Oje(),n=j(t),a=j(n),o=g(j(a),4);H(a);var s=g(a,2),b=e=>{var t=Tje(),n=g(j(t));B(n,5,r,e=>e.id,(e,t)=>{var n=wje(),r=f(n,!0),i={};O(()=>{Y(r,Q(t).label),i!==(i=Q(t).id)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(n);var a;_(n),H(t),O(()=>{a!==(a=i()??``)&&(n.value=(n.__value=a)??``,D(n,a))}),L(`change`,n,y),X(e,t)},x=e=>{var t=Eje();X(e,t)};G(s,e=>{r().length?e(b):e(x,-1)});var C=g(s,2),w=g(j(C));ve(w),H(C);var T=g(C,2),E=g(j(T));v(E),H(T);var k=g(T,2),A=e=>{var t=Dje(),n=f(t);O(()=>Y(n,`Uses your ${Q(u)?.label??``} account credits.`)),X(e,t)};G(k,e=>{Q(d)&&e(A)});var ee=g(k,2),M=j(ee);W(2),H(ee),H(n),H(t),O(e=>M.disabled=e,[()=>!Q(c).trim()||!r().length]),L(`click`,t,m),L(`click`,o,p),L(`keydown`,w,e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&h()}),S(w,()=>Q(c),e=>I(c,e)),S(E,()=>Q(l),e=>I(l,e)),L(`click`,M,h),X(e,t)};G(x,e=>{a()&&e(C)}),X(e,b),ue(),s()}ge([`click`,`change`,`keydown`]);var Aje=V(`<button class="ui-button-quiet text-[11px] svelte-7glrp7">Cancel</button>`),jje=V(`<button class="ui-button-quiet text-[11px] svelte-7glrp7">â</button>`),Mje=V(`<span class="min-w-0 flex-1 truncate text-[11px] text-red-300/80 svelte-7glrp7"> </span>`),Nje=V(`<div class="mesh-job-plugin-line text-[11px] text-gray-400 svelte-7glrp7"> </div>`),Pje=V(`<div class="h-full bg-primary-500 svelte-7glrp7"></div>
2240`),Fje=V(`<div class="mesh-indeterminate h-full bg-primary-500 svelte-7glrp7"></div>`),Ije=V(`<div class="mt-1 h-1 w-full overflow-hidden rounded-sm bg-gray-700 svelte-7glrp7"><!></div>`),Lje=V(`<div class="ui-panel mesh-job bg-gray-900/90 backdrop-blur-sm svelte-7glrp7"><div class="flex items-center gap-2 svelte-7glrp7"><span class="text-sm svelte-7glrp7">â¨</span> <span class="min-w-0 flex-1 truncate text-xs text-gray-200 svelte-7glrp7"> </span> <!></div> <div class="mt-1 flex items-center gap-2 svelte-7glrp7"><span> </span> <!></div> <!> <!></div>`),Rje=V(`<div class="mesh-jobs svelte-7glrp7"></div>`);function zje(e,t){Ce(t,!1);let n=()=>z(oB,`$meshJobs`,a),i=()=>z(lf,`$meshJobStatus`,a),[a,o]=Ve();function s(e,t){try{return e&&e()||``}catch{return``}}let c=new Set([`submitting`,`running`,`importing`]);function l(e){return e===`submitting`?`Submittingâ¦`:e===`running`?`Generatingâ¦`:e===`importing`?`Importingâ¦`:e===`done`?`Done`:e===`error`?`Failed`:e===`cancelled`?`Cancelled`:e}R();var u=fe(),d=N(u),p=e=>{var t=Rje();B(t,5,n,e=>e.id,(e,t)=>{var a=Lje(),o=j(a),u=g(j(o),2),d=f(u,!0),p=g(u,2),m=e=>{var n=Aje();L(`click`,n,()=>uB(Q(t).id)),X(e,n)},h=q(()=>c.has(Q(t).status)),_=e=>{var n=jje();L(`click`,n,()=>lB(Q(t).id)),X(e,n)};G(p,e=>{Q(h)?e(m):e(_,-1)}),H(o);var v=g(o,2),y=j(v),x=f(y,!0),S=g(y,2),C=e=>{var n=Mje(),r=f(n,!0);O(()=>{b(n,`title`,Q(t).error),Y(r,Q(t).error)}),X(e,n)};G(S,e=>{Q(t).status===`error`&&Q(t).error&&e(C)}),H(v);var w=g(v,2),T=e=>{let t=ze(()=>s(i(),n()));var r=fe(),a=N(r),o=e=>{var n=Nje(),r=f(n,!0);O(()=>Y(r,Q(t))),X(e,n)};G(a,e=>{Q(t)&&e(o)}),X(e,r)},E=q(()=>c.has(Q(t).status));G(w,e=>{Q(E)&&e(T)});var D=g(w,2),k=e=>{var n=Ije(),r=j(n),i=e=>{var n=Pje();O(e=>Ze(n,e),[()=>`width:${Math.round(Q(t).progress*100)}%`]),X(e,n)},a=e=>{var t=Fje();X(e,t)};G(r,e=>{Q(t).progress==null?e(a,-1):e(i)}),H(n),X(e,n)},A=q(()=>c.has(Q(t).status));G(D,e=>{Q(A)&&e(k)}),H(a),O(e=>{b(u,`title`,Q(t).prompt),Y(d,Q(t).prompt),r(y,1,`text-[11px] ${Q(t).status===`error`?`text-red-300`:Q(t).status===`done`?`text-emerald-300`:`text-gray-400`}`,`svelte-7glrp7`),Y(x,e)},[()=>l(Q(t).status)]),X(e,a)}),H(t),X(e,t)};G(d,e=>{n().length&&e(p)}),X(e,u),ue(),o()}ge([`click`]);var Bje=V(`<button id="scene-load-cancel" class="scene-load-cancel svelte-1qhy0td">Cancel</button>`),Vje=V(`<div class="scene-load svelte-1qhy0td"><div id="scene-load-bar" class="scene-load-card svelte-1qhy0td" role="status" aria-live="polite"><div class="scene-load-row svelte-1qhy0td"><p class="scene-load-text svelte-1qhy0td"> <strong class="svelte-1qhy0td"> </strong> <span class="scene-load-count svelte-1qhy0td"> </span></p> <!></div> <div role="progressbar" aria-valuemin="0"><div class="scene-load-fill svelte-1qhy0td"></div></div></div></div>`);function Hje(e,n){Ce(n,!0);let i=()=>z(ua,`$sceneLoad`,a),[a,o]=Ve(),s=t(!1),c=null,l=0;Qe(()=>{let e=i();if(!e){clearTimeout(c),c=null,I(s,!1),l=0;return}Q(s)&&l===e.id||l!==e.id&&(I(s,!1),l=e.id,clearTimeout(c),c=setTimeout(()=>I(s,!0),250))});let u=q(()=>i()&&i().total>0?Math.round(100*i().done/i().total):0),d=q(()=>i()?.verb??`Loading`),p=q(()=>i()?.phase===`reading`||i()?.phase===`preparing`?`getting readyâ¦`:(i()?.done??0)+` / `+(i()?.total??0)+` objects`);var m=fe(),h=N(m),_=e=>{var t=Vje(),n=j(t),a=j(n),o=j(a),s=j(o),c=g(s),l=f(c,!0),m=g(c,2),h=f(m);H(o);var _=g(o,2),v=e=>{var t=Bje();L(`click`,t,()=>fa()),X(e,t)};G(_,e=>{i().cancellable&&e(v)}),H(a);var y=g(a,2);let x;var S=j(y);let C;H(y),H(n),H(t),O(()=>{b(n,`data-done`,i().done),b(n,`data-total`,i().total),b(n,`data-phase`,i().phase),Y(s,`${Q(d)??``} `),Y(l,i().name),Y(h,`â ${Q(p)??``}`),x=r(y,1,`scene-load-track svelte-1qhy0td`,null,x,{indeterminate:i().phase===`reading`||i().phase===`preparing`||i().total===0}),b(y,`aria-label`,Q(d)+` `+i().name),b(y,`aria-valuemax`,i().total),b(y,`aria-valuenow`,i().done),C=Ze(S,``,C,{width:Q(u)+`%`})}),X(e,t)};G(h,e=>{Q(s)&&i()&&e(_)}),X(e,m),ue(),o()}ge([`click`]);var Uje=V(`<button id="start-view-take-control" class="sv-btn svelte-lteduo" data-tour="start-view-take-control" title="Move the camera now (Esc)">Take control</button>`),Wje=V(`<div class="sv-wrap svelte-lteduo"><div id="start-view-hint" class="sv-card svelte-lteduo" role="status" aria-l
2240ive="polite" data-tour="start-view-held"><span class="sv-text svelte-lteduo">Loading⦠camera is held</span> <!></div></div>`),Gje=V(`<div class="sv-wrap svelte-lteduo"><button id="start-view-back" class="sv-card sv-back svelte-lteduo" data-tour="start-view-back" title="Fly back to where this scene opened (Home)">Back to start view</button></div>`);function Kje(e,t){Ce(t,!1);let n=()=>z(Wse,`$startViewHint`,r),[r,i]=Ve();R();var a=fe(),o=N(a),s=e=>{var t=Wje(),r=j(t),i=g(j(r),2),a=e=>{var t=Uje();L(`click`,t,()=>Gse(`user`)),X(e,t)};G(i,e=>{n().takeControl&&e(a)}),H(r),H(t),X(e,t)},c=e=>{var t=Gje(),n=f(t);L(`click`,n,()=>Kse()),X(e,t)};G(o,e=>{n()?.kind===`held`?e(s):n()?.kind===`back`&&e(c,1)}),X(e,a),ue(),i()}ge([`click`]);var qje=V(`<span class="spectator-note svelte-1n80898" title="What you see is rendered with their look settings while you watch"> </span>`),Jje=V(`<div class="spectator-banner svelte-1n80898"><div class="spectator-inner svelte-1n80898"><span class="spectator-dot svelte-1n80898" aria-hidden="true"></span> <div class="inline-flex items-center svelte-1n80898"><p class="spectator-text svelte-1n80898">Watching <strong class="svelte-1n80898"> </strong><!></p> <button class="spectator-exit svelte-1n80898" title="Stop watching and return to your own camera">Exit</button></div></div></div>`),Yje=V(`<div class="spectator-banner preview-banner svelte-1n80898"><div class="spectator-inner svelte-1n80898"><span class="spectator-dot svelte-1n80898" aria-hidden="true"></span> <div class="inline-flex items-center svelte-1n80898"><p class="spectator-text svelte-1n80898">Previewing <strong class="svelte-1n80898"> </strong></p> <button> </button> <button class="spectator-exit svelte-1n80898" title="Leave the preview and return to your own view">Exit</button></div></div></div>`),Xje=V(`<div class="cxreq-label svelte-1n80898"> </div>`),Zje=V(`<button class="cxreq-btn cxreq-editor svelte-1n80898">Editor access</button>`),Qje=V(`<button class="cxreq-btn cxreq-view svelte-1n80898">View only</button> <!>`,1),$je=V(`<button class="cxreq-btn cxreq-editor svelte-1n80898">Approve</button>`),eMe=V(`<button class="cxreq-btn cxreq-full svelte-1n80898">Tell them it's full</button>`),tMe=V(`<div class="my-1 tp-toast tp-toast--req svelte-1n80898"><div class="tp-toast-body svelte-1n80898"><!> <div class="tp-toast-main svelte-1n80898"><div class="tp-toast-text svelte-1n80898">Connection request <span class="cxreq-id svelte-1n80898"> </span></div> <!> <div><!> <!></div> <div class="tp-toast-actions svelte-1n80898"><!> <!> <button class="cxreq-btn cxreq-reject svelte-1n80898">Reject</button></div></div></div></div>`),nMe=V(`<div class="my-1 text-center svelte-1n80898"><button id="request-overflow-more" class="tp-toast-more svelte-1n80898" title="Show all connection requests in the Connect drawer"> </button></div>`),rMe=V(`<div class="my-1 tp-toast tp-toast--progress svelte-1n80898"><div class="tp-toast-body svelte-1n80898"><!> <div class="tp-toast-main svelte-1n80898"><div class="tp-toast-text svelte-1n80898"> </div> <!></div></div></div>`),iMe=V(`<div style="position: relative; left: 50%; transform: translate(-25%, -50%);" class="svelte-1n80898"></div> <div class="mb-1 text-base font-medium text-gray-300 dark:text-brack-500 inline-flex items-center svelte-1n80898"><p class="text-sm font-medium text-gray-200 dark:text-gray-200 pr-4 overflow-hidden max-w-80 svelte-1n80898">There is no light in the scene<br class="svelte-1n80898"/> Click FIX to add hemisphere.</p> <!></div>`,1),aMe=V(`<div class="my-1 svelte-1n80898"><!></div>`),oMe=V(`<div class="my-1 text-center svelte-1n80898"><button id="toast-overflow-more" class="tp-toast-more svelte-1n80898" title="Show all toasts in the Connect drawer"> </button></div>`),sMe=V(`<button class="tp-toast-x svelte-1n80898" title="Dismiss" aria-label="Dismiss">â</button>`),cMe=V(`<button class="tp-toast-action svelte-1n80898"> </button>`),lMe=V(`<div class="tp-toast-actions svelte-1n80898"></div>`),uMe=V(`<div><!> <div class="tp-toast-body svelte-1n80898"><!> <div class="tp-toast-main svelte-1n80898"><div class="tp-toast-text svelte-1n80898"> </div> <!></div></div></div>`),dMe=V(`<div class="toasts-stack svelte-1n80898"><!> <!> <!> <!> <div style="z-index: var(--z-toast); pointer-events: none;"><!> <!></div> <div style="z-index: var(--z-toast-low); pointer-events: none;"><!> <!> <!> <!></div></div>`);function fMe(e,n){Ce(n,!0);let i=()=>z(zs,`$specatorMode`,R),a=()=>z(sL,`$peerLooks`,R),o=()=>z(Pi,`$globalScene`,R),s=()=>z(yi,`$globalCamera`,R),c=()=>z(Ti,`$camSave`,R),l=()=>z(Es,`$peers`,R),u=()=>z(Xb,`$peerScenes`,R),d=()=>z(Bb,`$currentLevel`,R),p=()=>z(Vd,`$sessionHost`,R),m=()=>z(cc,`$connectDrawerOpen`,R),h=()=>z(ns,`$toastsInDrawerOnly`,R),_=()=>z(ks,`$pendingApprovals`,R),v=()=>z(Yd,`$approvalStartedAt`,R),y=()=>z(Qo,`$toastStore`,R),x=()=>z(Ui,`$objectsGroup`,R),S=()=>z(Xs,`$loading`,R),C=()=>z(Hd,`$softPeerCap`,R),w=()=>z(as,`$userdata`,R),T=()=>z(cf,`$rolesInfo`,R),E=()=>z(Gc,`$lastUncaught`,R),D=()=>z(Ppe,`$ingestGate`,R),k=()=>z(fpe,`$restoreAvailable`,R),A=()=>z(Fa,`$explorerItems`,R),ee=()=>z(wd,`$projectManifest`,R),M=()=>z(vC,`$sceneDirty`,R),te=()=>z(pC,`$autoDownload`,R),P=()=>z(aC,`$pendingShareAsk`,R),re=()=>z(Is,`$explorerClose`,R),ie=()=>z(Bs,`$appNotice`,R),F=()=>z(px,`$cameraPreview`,R),ae=()=>z(gs,`$loadingcount`,R),oe=()=>z(ts,`$fixLight`,R),[R,se]=Ve(),ce=q(()=>typeof i()==`string`?le(i(),a()):``);function le(e,t){return _L(e)}function de(){if(!i())return;let e=o()?.getObjectByName(`dolly`);e&&e.attach(s());let t=o()?.getObjectByName(i());t&&(t.visible=!0),ke(zs,!1),c()&&(s().position.copy(c().position),s().rotation.copy(c().rotation),me(yi,K(s).fov=c().fov,K(s)),s().updateProjectionMatrix()),l().send({type:`camera`,peerId:l().peer.id,position:s().position.toArray(),rotation:s().rotation.toArray()}),l().send({type:`specator`,peerId:l().peer.id,watching:`false`}),js()}Qe(()=>{let e=u(),t=typeof i()==`string`?i():``,n=d()?.name??``;if(!t||!(d()?.private||Gb(e,n,t,p())))return;let r=e?.[t]?.scene??``;K(()=>{de(),es(r?`Stopped watching â they opened "`+r+`"`:`Stopped watching â they left this scene`)})});let fe=q(()=>m()||h()),pe=q(()=>m()||h()),V=t(Ne(Date.now()));Qe(()=>{if(!_().length)return;let e=setInterval(()=>I(V,Date.now(),!0),1e3);return()=>clearInterval(e)});function he(e){Q(V);let t=v()[e];return t?Date.now()-t:0}let ge=e=>he(e?.peerId),U=q(()=>Ud(l())),_e=q(()=>y().filter(e=>e?.sticky)),ve=q(()=>y().filter(e=>!e?.sticky)),ye=q(()=>Math.max(0,Q(ve).length-4)),be=q(()=>[...Q(ve).slice(-4),...Q(_e)]);Qe(()=>{let e=x(),t=S();if(!e||!t.length)return;let n=new Set;e.traverse(e=>n.add(e.uuid));let r=t.filter(e=>!n.has(e));r.length!==t.length&&Xs.set(r)});let xe=t(!1),Se;Qe(()=>{S().length>0?(clearTimeout(Se),I(xe,!0)):Q(xe)&&(clearTimeout(Se),Se=setTimeout(()=>I(xe,!1),2500))});function we(e,t){if(Ud(l())){es(`This session is full (16 people). Ask someone to leave first.`);return}if($d(l())>=C()&&es(`That is `+($d(l())+1)+` people â voice and live gestures may lag on slower devices.`),ke(ks,_().filter(t=>t.peerId!==e.peerId)),e.status===`retry`)try{l().connections[e.peerId]?.close()}catch{}else w().push([e.peerId,``,``]);l().send({type:`userdata`,userdata:w()}),e.status!==`retry`&&typeof l().approveDialBack==`function`?l().approveDialBack(e.peerId):l().connectToPeer(e.peerId,!0),t&&T()?.setRole&&T().setRole(e.peerId,t)}let Ee=e=>!!e?.hearsNo;function J(e,t=`denied`){wfe(e.peerId,t)}function De(e){try{e?.onDismiss?.()}catch{}ke(Qo,y().filter(t=>t!==e))}function Oe(e,t){if(t?.sticky)return{};let n=setTimeout(()=>De(t),typeof t==`string`?5e3:15e3);return{destroy(){clearTimeout(n)}}}let Ae=!1,je=``;Qe(()=>{let e=E();e?Po(`diagnostics-error`,`Something went wrong: ${e.message}`,[{label:`Copy diagnostics`,keepOpen:!0,action:async()=>{let e=await Kc();es(e?`Diagnostics copied to the clipboard`:`Could not copy the diagnostics`)}}],()=>Gc.set(null)):oc(`diagnostics-error`)});function Pe(){return Xi(0,1,ea(null)).limit}function Fe(e){return Xi(0,Number(e)||0,ea(null)).gate}Qe(()=>{let e=D();e?Po(`ingest-gate`,`This scene has ${e.count} objects â that would take this device to ${e.total}, above the ${e.limit} recommended here.`,[{label:`Load all`,action:()=>Ky(`all`)},{label:`Load the first ${e.allowed}`,action:()=>Ky(`some`)},{label:`Cancel`,action:()=>Ky(`cancel`)}],void 0,!0):oc(`ingest-gate`)}),Qe(()=>{let e=k();e?Po(`restore-session`,`Restore previous session? ${e.objects} objects, saved ${new Date(e.ts).toLocaleTimeString()}`+(Fe(e.objects)?` â above the ${Pe()} recommended for this device.`:``)+(e.risky?` Warning: the last attempt to restore this scene never finished a frame, so it may be what stopped the app.`:``),[{label:`Restore`,action:()=>mpe()},{label:`Dismiss`,action:()=>Dy()}],()=>Dy()):oc(`restore-session`)}),Qe(()=>{let e=(l()?.openedPeers?.size??0)>0&&!!p();A(),ee();
2240let t=e?Kge():{local:0,missing:0};d();let n=!((x()?.children?.length??0)>0),r=e&&!n&&!Ae&&(!d()?.name||M()||yC()),i=[];r&&i.push(d()?.name?`â${d().name}â has unsaved changes`:`this scene has never been saved`),t.missing&&!te()&&i.push(`${t.missing} shared file${t.missing===1?``:`s`} not downloaded`),e&&i.length&&!Ae?Po(`shared-library-offer`,i.join(` · `)+`.`,[...r?[{label:`Save the sceneâ¦`,action:()=>{Ae=!0,Is.set(!1),Ts(null),oc(`shared-library-offer`)}}]:[],...t.missing&&!te()?[{label:`Download theirs`,action:()=>{Ae=!0;let e=qge();es(`Fetching ${e} file${e===1?``:`s`} from peers`),oc(`shared-library-offer`)}}]:[],...r||t.missing&&!te()?[{label:`Not now`,action:()=>{Ae=!0,oc(`shared-library-offer`)}}]:[]],()=>{Ae=!0}):oc(`shared-library-offer`)}),Qe(()=>{let e=P();if(!e){je=``;return}if(!re())return;let t=e.items.map(e=>e.id).join(`|`);if(t===je)return;je=t;let n=e.items.length;K(()=>es(`${n} file${n===1?``:`s`} added â open the Explorer to share ${n===1?`it`:`them`} with the session`,[{label:`Open Explorer`,action:()=>Is.set(!1)}]))}),Qe(()=>{let e=ie(),t=typeof localStorage<`u`&&!!nt.getItem(`hasSeenDisclaimer`),n=()=>{try{nt.setItem(`hasSeenDisclaimer`,`true`)}catch{}};e&&!t?Po(`app-notice`,e.text,e.ctaUrl?[{label:e.ctaLabel||`Learn more`,action:()=>{n(),window.open(e.ctaUrl,`_blank`)}}]:[],n):oc(`app-notice`)});var Ie=dMe(),Le=j(Ie);Hje(Le,{});var Re=g(Le,2);Kje(Re,{});var ze=g(Re,2),He=e=>{var t=Jje(),n=j(t),r=g(j(n),2),a=j(r),o=g(j(a)),s=f(o,!0),c=g(o),l=e=>{var t=qje(),n=f(t);O(()=>Y(n,`· ${Q(ce)??``}`)),X(e,t)};G(c,e=>{Q(ce)&&e(l)}),H(a);var u=g(a,2);H(r),H(n),H(t),O(()=>Y(s,i())),L(`click`,u,de),Me(3,t,()=>To,()=>({y:-8,duration:180})),X(e,t)};G(ze,e=>{i()&&e(He)});var Ue=g(ze,2),Z=e=>{var t=Yje(),n=j(t),i=g(j(n),2),a=j(i),o=g(j(a)),s=f(o,!0);H(a);var c=g(a,2);let l;var u=f(c,!0),d=g(c,2);H(i),H(n),H(t),O(e=>{Y(s,e),l=r(c,1,`preview-control svelte-1n80898`,null,l,{on:F().controlling}),b(c,`title`,F().controlling?`Stop flying the camera (its new pose is kept, as one undo step)`:`Fly this camera with WASD + mouse, like the viewport camera`),Y(u,F().controlling?`Stop control`:`Control`)},[()=>cx(F().uuid)]),L(`click`,c,()=>lhe()),L(`click`,d,()=>ux()),Me(3,t,()=>To,()=>({y:-8,duration:180})),X(e,t)};G(Ue,e=>{F()&&e(Z)});var We=g(Ue,2);let Ge;var Ke=j(We);B(Ke,1,()=>_().slice(0,3),Be,(e,t)=>{var n=tMe(),i=j(n),a=j(i);cAe(a,{size:16,class:`tp-toast-icon`,"aria-hidden":`true`});var o=g(a,2),s=j(o),c=g(j(s)),l=f(c,!0);H(s);var u=g(s,2),d=e=>{var n=Xje(),r=f(n,!0);O(()=>Y(r,Q(t).label)),X(e,n)};G(u,e=>{Q(t).label&&e(d)});var p=g(u,2);let m;var h=j(p),_=e=>{var n=Te();O(e=>Y(n,`asked ${e??``}s ago â they may have given up`),[()=>Math.round(ge(Q(t))/1e3)]),X(e,n)},v=q(()=>ge(Q(t))>Zd),y=e=>{var n=Te();O(e=>Y(n,`asked ${e??``}s ago`),[()=>Math.max(1,Math.round(ge(Q(t))/1e3))]),X(e,n)};G(h,e=>{Q(v)?e(_):e(y,-1)});var x=g(h,2),S=e=>{var t=Te();O(()=>Y(t,`· this session is full (16)`)),X(e,t)};G(x,e=>{Q(U)&&e(S)}),H(p);var C=g(p,2),w=j(C),E=e=>{var n=Qje(),r=N(n),i=g(r,2),a=e=>{var n=Zje();O(()=>{n.disabled=Q(U),b(n,`title`,Q(U)?`This session is full (16)`:`Approve and grant edit access`)}),L(`click`,n,()=>we(Q(t),`editor`)),X(e,n)};G(i,e=>{Q(t).status!==`retry`&&e(a)}),O(()=>{r.disabled=Q(U),b(r,`title`,Q(U)?`This session is full (16)`:`Approve as a view-only viewer`)}),L(`click`,r,()=>we(Q(t),null)),X(e,n)},D=e=>{var n=$je();O(()=>{n.disabled=Q(U),b(n,`title`,Q(U)?`This session is full (16)`:`Approve this request`)}),L(`click`,n,()=>we(Q(t),null)),X(e,n)};G(w,e=>{T()?e(E):e(D,-1)});var k=g(w,2),A=e=>{var n=eMe();O(()=>b(n,`title`,`Tell them this session is full (16)`)),L(`click`,n,()=>J(Q(t),`full`)),X(e,n)},ee=q(()=>Q(U)&&Ee(Q(t)));G(k,e=>{Q(ee)&&e(A)});var M=g(k,2);H(C),H(o),H(i),H(n),O((e,t,n)=>{Y(l,e),m=r(p,1,`cxreq-age svelte-1n80898`,null,m,{expired:t}),b(M,`title`,n)},[()=>String(Q(t).peerId).slice(0,6).toUpperCase(),()=>ge(Q(t))>Zd,()=>Ee(Q(t))?`Decline â they are told`:`Decline`]),L(`click`,M,()=>J(Q(t))),Me(3,n,()=>To,()=>({y:-8,duration:180})),X(e,n)});var qe=g(Ke,2),Je=e=>{var t=nMe(),n=j(t),r=f(n);H(t),O(()=>Y(r,`+${_().length-3} more request${_().length-3==1?``:`s`}â¦`)),L(`click`,n,()=>{No.set(`toasts`),cc.set(!0)}),X(e,t)};G(qe,e=>{_().length>3&&e(Je)}),H(We);var Ye=g(We,2);let Xe;var Ze=j(Ye),$e=e=>{var t=rMe(),n=j(t),r=j(n);iS(r,{size:16,class:`tp-toast-icon`,"aria-hidden":`true`});var i=g(r,2),a=j(i),o=f(a),s=g(a,2);{let e=q(()=>100*(ae()-S().length-0)/(ae()-0));Co(s,{get progress(){return Q(e)},color:`green`,size:`h-1.5`,class:`mt-1.5`})}H(i),H(n),H(t),O(()=>Y(o,`Receiving objects: ${ae()-S().length}/${ae()??``}`)),Me(3,t,()=>To,()=>({y:-8,duration:180})),X(e,t)};G(Ze,e=>{Q(xe)&&ae()>0&&e($e)});var et=g(Ze,2),$=e=>{var t=aMe(),n=j(t);so(n,{get transition(){return To},class:`flex items-center gap-3 p-2 rounded-lg dark:bg-gray-700 dark:border-dark-700 border-2 border-red-500`,onclose:()=>{nt.setItem(`hasSeenDisclaimer`,`true`)},children:(e,t)=>
2240{var n=iMe(),r=g(N(n),2),i=g(j(r),2);Do(i,{color:`primary`,class:`nob rounded-sm bg-blue-500 text-white dark:bg-green-600 dark:text-gray-200 dark:hover:bg-green-700`,onclick:()=>{Ro(`lightProperties`),Gy(`/light hemisphere`),ke(ts,!1)},children:(e,t)=>{W();var n=Te(`Fix`);X(e,n)},$$slots:{default:!0}}),H(r),X(e,n)},$$slots:{default:!0}}),H(t),X(e,t)};G(et,e=>{oe()&&e($)});var tt=g(et,2),rt=e=>{var t=oMe(),n=j(t),r=f(n);H(t),O(()=>Y(r,`+${Q(ye)??``} moreâ¦`)),L(`click`,n,()=>{No.set(`toasts`),cc.set(!0)}),X(e,t)};G(tt,e=>{Q(ye)>0&&e(rt)});var it=g(tt,2);B(it,16,()=>Q(be),e=>e,(e,t)=>{var n=uMe();let i;var a=j(n),o=e=>{var n=sMe();L(`click`,n,()=>De(t)),X(e,n)};G(a,e=>{t?.noClose||e(o)});var s=g(a,2),c=j(s);yS(c,{size:16,class:`tp-toast-icon`,"aria-hidden":`true`});var l=g(c,2),u=j(l),d=f(u,!0),p=g(u,2),m=e=>{var n=lMe();B(n,21,()=>t.actions,Be,(e,n)=>{var r=cMe(),i=f(r,!0);O(()=>Y(i,Q(n).label)),L(`click`,r,()=>{Q(n).action(),Q(n).keepOpen||De(t)}),X(e,r)}),H(n),X(e,n)};G(p,e=>{typeof t!=`string`&&t.actions?.length&&e(m)}),H(l),H(s),H(n),ne(n,(e,t)=>Oe?.(e,t),()=>t),O(()=>{i=r(n,1,`my-1 tp-toast svelte-1n80898`,null,i,{"tp-toast--info":t?.kind===`info`}),Y(d,typeof t==`string`?t:t.text)}),Me(3,n,()=>To,()=>({y:-8,duration:180})),X(e,n)}),H(Ye),H(Ie),O(()=>{Ge=r(We,1,`my-4 toasts-container toasts-critical svelte-1n80898`,null,Ge,{"cxd-hidden":Q(fe)}),Xe=r(Ye,1,`my-4 toasts-container toasts-regular svelte-1n80898`,null,Xe,{"cxd-hidden":Q(pe)})}),X(e,Ie),ue(),se()}ge([`click`]);var mB=V(`<div class="bar svelte-zte3lq"></div> <div class="bar svelte-zte3lq"></div>`,1),pMe=V(`<div class="guide svelte-zte3lq" aria-hidden="true"><!></div>`);function mMe(e,n){Ce(n,!0);let r=()=>z(px,`$cameraPreview`,s),i=()=>z(Ui,`$objectsGroup`,s),o=()=>z(Id,`$viewportInset`,s),[s,c]=Ve(),l=q(()=>r()?i()?.getObjectByProperty(`uuid`,r().uuid)??null:null),u=q(()=>Q(l)?ix(Q(l)):null),d=q(()=>Q(u)&&Q(u).guide?ax(Q(u).aspect):0),f=t(0),p=t(0),m=q(()=>Math.max(0,Q(p)-o())),h=q(()=>{if(!Q(d)||!Q(f)||!Q(m))return null;let e=Q(f)/Q(m);if(Math.abs(e-Q(d))<.01)return null;if(e>Q(d)){let e=Q(m)*Q(d);return{side:`x`,size:Math.max(0,(Q(f)-e)/2)}}let t=Q(f)/Q(d);return{side:`y`,size:Math.max(0,(Q(m)-t)/2)}});var _=fe(),v=N(_),y=e=>{var t=pMe(),n=j(t),r=e=>{var t=mB(),n=N(t),r=g(n,2);O(()=>{Ze(n,`left: 0; top: 0; bottom: 0; width: ${Q(h).size??``}px`),Ze(r,`right: 0; top: 0; bottom: 0; width: ${Q(h).size??``}px`)}),X(e,t)},i=e=>{var t=mB(),n=N(t),r=g(n,2);O(()=>{Ze(n,`top: 0; left: 0; right: 0; height: ${Q(h).size??``}px`),Ze(r,`bottom: 0; left: 0; right: 0; height: ${Q(h).size??``}px`)}),X(e,t)};G(n,e=>{Q(h).side===`x`?e(r):e(i,-1)}),H(t),O(()=>Ze(t,`bottom: ${o()??``}px`)),X(e,t)};G(v,e=>{Q(h)&&e(y)}),a(`innerWidth`,e=>I(f,e,!0)),a(`innerHeight`,e=>I(p,e,!0)),X(e,_),ue(),c()}var hMe=V(`<div><div class="pip-bar svelte-27k3t0"><span class="pip-title svelte-27k3t0"> </span> <button class="pip-btn svelte-27k3t0" title="Look through this camera (full screen)">⤢</button> <button class="pip-btn svelte-27k3t0" title="Hide this camera's preview window (Camera properties can bring it back)">â</button></div> <p class="pip-hint svelte-27k3t0">right-drag to move</p></div>`);function gMe(e,n){Ce(n,!0);let i=()=>z(mR,`$pipTarget`,u),o=()=>z(Ui,`$objectsGroup`,u),s=()=>z(Ho,`$inspectorClose`,u),c=()=>z(Id,`$viewportInset`,u),l=()=>z(fR,`$pipPosition`,u),[u,d]=Ve(),p=q(()=>i()?o()?.getObjectByProperty(`uuid`,i())??null:null),m=q(()=>Q(p)?hR(Q(p)):{w:0,h:0}),h=t(0),_=t(0),v=t(0);Qe(()=>{s(),Q(h);let e=(document.querySelector(`#drawer-label`)?.closest(`div[class*="fixed"], aside, dialog`))?.getBoundingClientRect();I(v,!s()&&e&&e.width<Q(h)*.6?e.width:0,!0)});let y=q(()=>Math.max(0,Q(_)-c())),x=q(()=>l()?_R(l(),Q(m),{width:Q(h),height:Q(y)}):gR(Q(m),{width:Q(h),height:Q(y)},Q(v)));Qe(()=>{pR.set(Q(p)&&Q(h)&&Q(_)?{x:Q(x).x,y:Q(x).y,w:Q(m).w,h:Q(m).h}:null)});let S=t(!1),C=null,w=0,T=0,E={x:0,y:0};function D(e){let t=e.pointerType!==`mouse`,n=!!e.target?.closest?.(`.pip-bar`),r=e.button===0&&n&&!e.target?.closest?.(`.pip-btn`);(t||e.button===2||r)&&(w=e.clientX,T=e.clientY,E={...Q(x)},t?C=setTimeout(()=>I(S,!0),350):(I(S,!0),e.preventDefault()),e.currentTarget.setPointerCapture?.(e.pointerId))}function k(e){Q(S)&&(fR.set(_R({x:E.x+(e.clientX-w),y:E.y+(e.clientY-T)},Q(m),{width:Q(h),height:Q(y)})),e.preventDefault())}function A(e){clearTimeout(C),I(S,!1),e.currentTarget.releasePointerCapture?.(e.pointerId)}var ee=fe(),M=N(ee),te=e=>{var t=hMe();let n;var i=j(t),a=j(i),o=f(a,!0),s=g(a,2),c=g(s,2);H(i),W(2),H(t),O(()=>{n=r(t,1,`pip svelte-27k3t0`,null,n,{"pip-drag":Q(S)}),Ze(t,`left: ${Q(x).x??``}px; top: ${Q(x).y??``}px; width: ${Q(m).w??``}px; height: ${Q(m).h??``}px;`),b(a,`title`,Q(p).name||`Camera`),Y(o,Q(p).name||`Camera`)}),L(`pointerdown`,t,D),L(`pointermove`,t,k),L(`pointerup`,t,A),L(`contextmenu`,t,e=>e.preventDefault()),L(`click`,s,()=>
2240fx(Q(p).uuid)),L(`click`,c,()=>nx(Q(p).uuid,{pip:!1})),X(e,t)};G(M,e=>{Q(p)&&e(te)}),a(`innerWidth`,e=>I(h,e,!0)),a(`innerHeight`,e=>I(_,e,!0)),X(e,ee),ue(),d()}ge([`pointerdown`,`pointermove`,`pointerup`,`contextmenu`,`click`]);var _Me=class{constructor(){this.encoder=new TextEncoder,this._pieces=[],this._parts=[]}append_buffer(e){this.flush(),this._parts.push(e)}append(e){this._pieces.push(e)}flush(){if(this._pieces.length>0){let e=new Uint8Array(this._pieces);this._parts.push(e),this._pieces=[]}}toArrayBuffer(){let e=[];for(let t of this._parts)e.push(t);return vMe(e).buffer}};function vMe(e){let t=0;for(let n of e)t+=n.byteLength;let n=new Uint8Array(t),r=0;for(let t of e){let e=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);n.set(e,r),r+=t.byteLength}return n}function hB(e){return new yMe(e).unpack()}function gB(e){let t=new bMe,n=t.pack(e);return n instanceof Promise?n.then(()=>t.getBuffer()):t.getBuffer()}var yMe=class{constructor(e){this.index=0,this.dataBuffer=e,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}unpack(){let e=this.unpack_uint8();if(e<128)return e;if((e^224)<32)return(e^224)-32;let t;if((t=e^160)<=15)return this.unpack_raw(t);if((t=e^176)<=15)return this.unpack_string(t);if((t=e^144)<=15)return this.unpack_array(t);if((t=e^128)<=15)return this.unpack_map(t);switch(e){case 192:return null;case 193:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 212:return;case 213:return;case 214:return;case 215:return;case 216:return t=this.unpack_uint16(),this.unpack_string(t);case 217:return t=this.unpack_uint32(),this.unpack_string(t);case 218:return t=this.unpack_uint16(),this.unpack_raw(t);case 219:return t=this.unpack_uint32(),this.unpack_raw(t);case 220:return t=this.unpack_uint16(),this.unpack_array(t);case 221:return t=this.unpack_uint32(),this.unpack_array(t);case 222:return t=this.unpack_uint16(),this.unpack_map(t);case 223:return t=this.unpack_uint32(),this.unpack_map(t)}}unpack_uint8(){let e=this.dataView[this.index]&255;return this.index++,e}unpack_uint16(){let e=this.read(2),t=(e[0]&255)*256+(e[1]&255);return this.index+=2,t}unpack_uint32(){let e=this.read(4),t=((e[0]*256+e[1])*256+e[2])*256+e[3];return this.index+=4,t}unpack_uint64(){let e=this.read(8),t=((((((e[0]*256+e[1])*256+e[2])*256+e[3])*256+e[4])*256+e[5])*256+e[6])*256+e[7];return this.index+=8,t}unpack_int8(){let e=this.unpack_uint8();return e<128?e:e-256}unpack_int16(){let e=this.unpack_uint16();return e<32768?e:e-65536}unpack_int32(){let e=this.unpack_uint32();return e<2**31?e:e-2**32}unpack_int64(){let e=this.unpack_uint64();return e<2**63?e:e-2**64}unpack_raw(e){if(this.length<this.index+e)throw Error(`BinaryPackFailure: index is out of range ${this.index} ${e} ${this.length}`);let t=this.dataBuffer.slice(this.index,this.index+e);return this.index+=e,t}unpack_string(e){let t=this.read(e),n=0,r=``,i,a;for(;n<e;)i=t[n],i<160?(a=i,n++):(i^192)<32?(a=(i&31)<<6|t[n+1]&63,n+=2):(i^224)<16?(a=(i&15)<<12|(t[n+1]&63)<<6|t[n+2]&63,n+=3):(a=(i&7)<<18|(t[n+1]&63)<<12|(t[n+2]&63)<<6|t[n+3]&63,n+=4),r+=String.fromCodePoint(a);return this.index+=e,r}unpack_array(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=this.unpack();return t}unpack_map(e){let t={};for(let n=0;n<e;n++){let e=this.unpack();t[e]=this.unpack()}return t}unpack_float(){let e=this.unpack_uint32(),t=e>>31,n=(e>>23&255)-127,r=e&8388607|8388608;return(t===0?1:-1)*r*2**(n-23)}unpack_double(){let e=this.unpack_uint32(),t=this.unpack_uint32(),n=e>>31,r=(e>>20&2047)-1023,i=(e&1048575|1048576)*2**(r-20)+t*2**(r-52);return(n===0?1:-1)*i}read(e){let t=this.index;if(t+e<=this.length)return this.dataView.subarray(t,t+e);throw Error(`BinaryPackFailure: read index out of range`)}},bMe=class{getBuffer(){return this._bufferBuilder.toArrayBuffer()}pack(e){if(typeof e==`string`)this.pack_string(e);else if(typeof e==`number`)Math.floor(e)===e?this.pack_integer(e):this.pack_double(e);else if(typeof e==`boolean`)e===!0?this._bufferBuilder.append(195):e===!1&&this._bufferBuilder.append(194);else if(e===void 0)this._bufferBuilder.append(192);else if(typeof e==`object`){if(e===null)this._bufferBuilder.append(192);else{let t=e.constructor;if(e instanceof Array){let t=this.pack_array(e);if(t instanceof Promise)return t.then(()=>this._bufferBuilder.flush())}else if(e instanceof ArrayBuffer)this.pack_bin(new Uint8Array(e));else if(`BYTES_PER_ELEMENT`in e){let t=e;this.pack_bin(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}else if(e instanceof Date)this.pack_string(e.toString());else if(e instanceof Blob)return e.arrayBuffer().then(e=>{this.pack_bin(new Uint8Array(e)),this._bufferBuilder.flush()});else if(t==Object||t.toString().startsWith(`class`)){let t=this.pack_object(e);
2240if(t instanceof Promise)return t.then(()=>this._bufferBuilder.flush())}else throw Error(`Type "${t.toString()}" not yet supported`)}}else throw Error(`Type "${typeof e}" not yet supported`);this._bufferBuilder.flush()}pack_bin(e){let t=e.length;if(t<=15)this.pack_uint8(160+t);else if(t<=65535)this._bufferBuilder.append(218),this.pack_uint16(t);else if(t<=4294967295)this._bufferBuilder.append(219),this.pack_uint32(t);else throw Error(`Invalid length`);this._bufferBuilder.append_buffer(e)}pack_string(e){let t=this._textEncoder.encode(e),n=t.length;if(n<=15)this.pack_uint8(176+n);else if(n<=65535)this._bufferBuilder.append(216),this.pack_uint16(n);else if(n<=4294967295)this._bufferBuilder.append(217),this.pack_uint32(n);else throw Error(`Invalid length`);this._bufferBuilder.append_buffer(t)}pack_array(e){let t=e.length;if(t<=15)this.pack_uint8(144+t);else if(t<=65535)this._bufferBuilder.append(220),this.pack_uint16(t);else if(t<=4294967295)this._bufferBuilder.append(221),this.pack_uint32(t);else throw Error(`Invalid length`);let n=r=>{if(r<t){let t=this.pack(e[r]);return t instanceof Promise?t.then(()=>n(r+1)):n(r+1)}};return n(0)}pack_integer(e){if(e>=-32&&e<=127)this._bufferBuilder.append(e&255);else if(e>=0&&e<=255)this._bufferBuilder.append(204),this.pack_uint8(e);else if(e>=-128&&e<=127)this._bufferBuilder.append(208),this.pack_int8(e);else if(e>=0&&e<=65535)this._bufferBuilder.append(205),this.pack_uint16(e);else if(e>=-32768&&e<=32767)this._bufferBuilder.append(209),this.pack_int16(e);else if(e>=0&&e<=4294967295)this._bufferBuilder.append(206),this.pack_uint32(e);else if(e>=-2147483648&&e<=2147483647)this._bufferBuilder.append(210),this.pack_int32(e);else if(e>=-0x8000000000000000&&e<=0x8000000000000000)this._bufferBuilder.append(211),this.pack_int64(e);else if(e>=0&&e<=0x10000000000000000)this._bufferBuilder.append(207),this.pack_uint64(e);else throw Error(`Invalid integer`)}pack_double(e){let t=0;e<0&&(t=1,e=-e);let n=Math.floor(Math.log(e)/Math.LN2),r=e/2**n-1,i=Math.floor(r*2**52),a=2**32,o=t<<31|n+1023<<20|i/a&1048575,s=i%a;this._bufferBuilder.append(203),this.pack_int32(o),this.pack_int32(s)}pack_object(e){let t=Object.keys(e),n=t.length;if(n<=15)this.pack_uint8(128+n);else if(n<=65535)this._bufferBuilder.append(222),this.pack_uint16(n);else if(n<=4294967295)this._bufferBuilder.append(223),this.pack_uint32(n);else throw Error(`Invalid length`);let r=n=>{if(n<t.length){let i=t[n];if(e.hasOwnProperty(i)){this.pack(i);let t=this.pack(e[i]);if(t instanceof Promise)return t.then(()=>r(n+1))}return r(n+1)}};return r(0)}pack_uint8(e){this._bufferBuilder.append(e)}pack_uint16(e){this._bufferBuilder.append(e>>8),this._bufferBuilder.append(e&255)}pack_uint32(e){let t=e&4294967295;this._bufferBuilder.append((t&4278190080)>>>24),this._bufferBuilder.append((t&16711680)>>>16),this._bufferBuilder.append((t&65280)>>>8),this._bufferBuilder.append(t&255)}pack_uint64(e){let t=e/2**32,n=e%2**32;this._bufferBuilder.append((t&4278190080)>>>24),this._bufferBuilder.append((t&16711680)>>>16),this._bufferBuilder.append((t&65280)>>>8),this._bufferBuilder.append(t&255),this._bufferBuilder.append((n&4278190080)>>>24),this._bufferBuilder.append((n&16711680)>>>16),this._bufferBuilder.append((n&65280)>>>8),this._bufferBuilder.append(n&255)}pack_int8(e){this._bufferBuilder.append(e&255)}pack_int16(e){this._bufferBuilder.append((e&65280)>>8),this._bufferBuilder.append(e&255)}pack_int32(e){this._bufferBuilder.append(e>>>24&255),this._bufferBuilder.append((e&16711680)>>>16),this._bufferBuilder.append((e&65280)>>>8),this._bufferBuilder.append(e&255)}pack_int64(e){let t=Math.floor(e/2**32),n=e%2**32;this._bufferBuilder.append((t&4278190080)>>>24),this._bufferBuilder.append((t&16711680)>>>16),this._bufferBuilder.append((t&65280)>>>8),this._bufferBuilder.append(t&255),this._bufferBuilder.append((n&4278190080)>>>24),this._bufferBuilder.append((n&16711680)>>>16),this._bufferBuilder.append((n&65280)>>>8),this._bufferBuilder.append(n&255)}constructor(){this._bufferBuilder=new _Me,this._textEncoder=new TextEncoder}},_B=!0,vB=!0;function yB(e,t,n){let r=e.match(t);return r&&r.length>=n&&parseFloat(r[n],10)}function bB(e,t,n){if(!e.RTCPeerConnection)return;if(!Object.getOwnPropertyDescriptor(EventTarget.prototype,`addEventListener`).writable){xB(`Unable to polyfill events`);return}let r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);let a=e=>{let t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,a),i.apply(this,[e,a])};let a=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t]||!this._eventMap[t].has(n))return a.apply(this,arguments);let r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,a.apply(this,[e,r])},Object.defineProperty(r,`on`+t,{get(){return this[`_on`+t]},set(e){this[`_on`+t]&&(this.removeEventListener(t,this[`_on`+t]),delete this[`_on`+t]),e&&this.addEventListener(t,this[`_on`+t]=e)},enumerable:!0,configurable:!0})}function xMe(e){return typeof e==`boolean`?(_B=e,e?`adapter.js logging disabled`:`adapter.js logging enabled`):Error(`Argument type: `+typeof e+`. Please use a boolean.`)}function SMe(e){return typeof e==`boolean`?(vB=!e,`adapter.js deprecation warnings `+(e?`disabled`:`enabled`)):Error(`Argument type: `+typeof e+`. Please use a boolean.`)}function xB(){if(typeof window==`object`){if(_B)return;typeof console<`u`&&typeof console.log==`function`&&console.log.apply(console,arguments)}}function SB(e,t){vB&&console.warn(e+` is deprecated, please use `+t+` instead.`)}function CMe(e){let t={browser:null,version:null};if(e===void 0||!e.navigator||!e.navigator.userAgent)return t.browser=`Not a browser.`,t;let{navigator:n}=e;if(n.userAgentData&&n.userAgentData.brands){let e=n.userAgentData.brands.find(e=>e.brand===`Chromium`);if(e){let t=parseInt(e.version,10);if(t>=90)return{browser:`chrome`,version:t}}}if(n.mozGetUserMedia)t.browser=`firefox`,t.version=parseInt(yB(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||e.isSecureContext===!1&&e.webkitRTCPeerConnection)t.browser=`chrome`,t.version=parseInt(yB(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2))||null;
vendor: 8,501 bytes, line 2240
2240else if(e.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))t.browser=`safari`,t.version=parseInt(yB(n.userAgent,/AppleWebKit\/(\d+)\./,1)),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&`currentDirection`in e.RTCRtpTransceiver.prototype,t._safariVersion=yB(n.userAgent,/Version\/(\d+(\.?\d+))/,1);else return t.browser=`Not a supported browser.`,t;return t}function CB(e){return Object.prototype.toString.call(e)===`[object Object]`}function wB(e){return CB(e)?Object.keys(e).reduce(function(t,n){let r=CB(e[n]),i=r?wB(e[n]):e[n],a=r&&!Object.keys(i).length;return i===void 0||a?t:Object.assign(t,{[n]:i})},{}):e}function TB(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach(r=>{r.endsWith(`Id`)?TB(e,e.get(t[r]),n):r.endsWith(`Ids`)&&t[r].forEach(t=>{TB(e,e.get(t),n)})}))}function EB(e,t,n){let r=n?`outbound-rtp`:`inbound-rtp`,i=new Map;if(t===null)return i;let a=[];return e.forEach(e=>{e.type===`track`&&e.trackIdentifier===t.id&&a.push(e)}),a.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&TB(e,n,i)})}),i}var DB=xB;function OB(e,t){if(t.version>=64)return;let n=e&&e.navigator;if(!n.mediaDevices)return;let r=function(e){if(typeof e!=`object`||e.mandatory||e.optional)return e;let t={};return Object.keys(e).forEach(n=>{if(n===`require`||n===`advanced`||n===`mediaSource`)return;let r=typeof e[n]==`object`?e[n]:{ideal:e[n]};r.exact!==void 0&&typeof r.exact==`number`&&(r.min=r.max=r.exact);let i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):t===`deviceId`?`sourceId`:t};if(r.ideal!==void 0){t.optional=t.optional||[];let e={};typeof r.ideal==`number`?(e[i(`min`,n)]=r.ideal,t.optional.push(e),e={},e[i(`max`,n)]=r.ideal,t.optional.push(e)):(e[i(``,n)]=r.ideal,t.optional.push(e))}r.exact!==void 0&&typeof r.exact!=`number`?(t.mandatory=t.mandatory||{},t.mandatory[i(``,n)]=r.exact):[`min`,`max`].forEach(e=>{r[e]!==void 0&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if(e=JSON.parse(JSON.stringify(e)),e&&typeof e.audio==`object`){let t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};e=JSON.parse(JSON.stringify(e)),t(e.audio,`autoGainControl`,`googAutoGainControl`),t(e.audio,`noiseSuppression`,`googNoiseSuppression`),e.audio=r(e.audio)}if(e&&typeof e.video==`object`){let a=e.video.facingMode;a&&=typeof a==`object`?a:{ideal:a};let o=t.version<66;if(a&&(a.exact===`user`||a.exact===`environment`||a.ideal===`user`||a.ideal===`environment`)&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!o)){delete e.video.facingMode;let t;if(a.exact===`environment`||a.ideal===`environment`?t=[`back`,`rear`]:(a.exact===`user`||a.ideal===`user`)&&(t=[`front`]),t)return n.mediaDevices.enumerateDevices().then(n=>{n=n.filter(e=>e.kind===`videoinput`);let o=n.find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!o&&n.length&&t.includes(`back`)&&(o=n[n.length-1]),o&&(e.video.deviceId=a.exact?{exact:o.deviceId}:{ideal:o.deviceId}),e.video=r(e.video),DB(`chrome: `+JSON.stringify(e)),i(e)})}e.video=r(e.video)}return DB(`chrome: `+JSON.stringify(e)),i(e)},a=function(e){return t.version>=64?e:{name:{PermissionDeniedError:`NotAllowedError`,PermissionDismissedError:`NotAllowedError`,InvalidStateError:`NotAllowedError`,DevicesNotFoundError:`NotFoundError`,ConstraintNotSatisfiedError:`OverconstrainedError`,TrackStartError:`NotReadableError`,MediaDeviceFailedDueToShutdown:`NotAllowedError`,MediaDeviceKillSwitchOn:`NotAllowedError`,TabCaptureError:`AbortError`,ScreenCaptureError:`AbortError`,DeviceCaptureError:`AbortError`}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&`: `)+this.message}}};if(n.getUserMedia=function(e,t,r){i(e,e=>{n.webkitGetUserMedia(e,t,e=>{r&&r(a(e))})})}.bind(n),n.mediaDevices.getUserMedia){let e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return i(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach(e=>{e.stop()}),new DOMException(``,`NotFoundError`);return e},e=>Promise.reject(a(e))))}}}var kB=Ge({fixNegotiationNeeded:()=>LB,shimAddTrackRemoveTrack:()=>FB,shimAddTrackRemoveTrackWithNative:()=>PB,shimGetSendersWithDtmf:()=>MB,shimGetUserMedia:()=>OB,shimMediaStream:()=>AB,shimOnTrack:()=>jB,shimPeerConnection:()=>IB,shimSenderReceiverGetStats:()=>NB});function AB(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function jB(e,t){if(!(t.version>102)){if(typeof e==`object`&&e.RTCPeerConnection&&!(`ontrack`in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener(`track`,this._ontrack),this.addEventListener(`track`,this._ontrack=e)},enumerable:!0,configurable:!0});let t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener(`addtrack`,n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};let i=new Event(`track`);i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};let i=new Event(`track`);i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})},this.addEventListener(`addstream`,this._ontrackpoly)),t.apply(this,arguments)}}else bB(e,`track`,e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}}function MB(e){if(typeof e==`object`&&e.RTCPeerConnection&&!(`getSenders`in e.RTCPeerConnection.prototype)&&`createDTMFSender`in e.RTCPeerConnection.prototype){let t=function(e,t){return{track:t,get dtmf(){return this._dtmf===void 0&&(this._dtmf=t.kind===`audio`?e.createDTMFSender(t):null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};let n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};let r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);let t=this._senders.indexOf(e);t!==-1&&this._senders.splice(t,1)}}let n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};let r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach(e=>{let t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),1)})}}else if(typeof e==`object`&&e.RTCPeerConnection&&`getSenders`in e.RTCPeerConnection.prototype&&`createDTMFSender`in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!(`dtmf`in e.RTCRtpSender.prototype)){let t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this._dtmf=this.track.kind===`audio`?this._pc.createDTMFSender(this.track):null),this._dtmf}})}}function NB(e,t){if(t.version>=67||!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!(`getStats`in e.RTCRtpSender.prototype)){let t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});let n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){let e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){let e=this;return this._pc.getStats().then(t=>EB(t,e.track,!0))}}if(!(`getStats`in e.RTCRtpReceiver.prototype)){let t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){let e=t.apply(this,[]);
vendor: 4,561 bytes, line 2240
2240return e.forEach(e=>e._pc=this),e}),bB(e,`track`,e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){let e=this;return this._pc.getStats().then(t=>EB(t,e.track,!1))}}if(!(`getStats`in e.RTCRtpSender.prototype&&`getStats`in e.RTCRtpReceiver.prototype))return;let n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){let e=arguments[0],t,n,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),r||t&&n?Promise.reject(new DOMException(`There are more than one sender or receiver for the track.`,`InvalidAccessError`)):t?t.getStats():n?n.getStats():Promise.reject(new DOMException(`There is no sender or receiver for the track.`,`InvalidAccessError`))}return n.apply(this,arguments)}}function PB(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};let t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};let r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?this._shimmedLocalStreams[n.id].indexOf(r)===-1&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};let n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException(`Track already exists.`,`InvalidAccessError`)});let t=this.getSenders();n.apply(this,arguments);let r=this.getSenders().filter(e=>t.indexOf(e)===-1);this._shimmedLocalStreams[e.id]=[e].concat(r)};let r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};let i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{let n=this._shimmedLocalStreams[t].indexOf(e);n!==-1&&this._shimmedLocalStreams[t].splice(n,1),this._shimmedLocalStreams[t].length===1&&delete this._shimmedLocalStreams[t]}),i.apply(this,arguments)}}function FB(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return PB(e);let n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){let e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};let r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException(`Track already exists.`,`InvalidAccessError`)}),!this._reverseStreams[t.id]){let n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};let i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if(this.signalingState===`closed`)throw new DOMException(`The RTCPeerConnection's signalingState is 'closed'.`,`InvalidStateError`);let r=[].slice.call(arguments,1);if(r.length!==1||!r[0].getTracks().find(e=>e===t))throw new DOMException(`The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.`,`NotSupportedError`);if(this.getSenders().find(e=>e.track===t))throw new DOMException(`Track already exists.`,`InvalidAccessError`);this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};let i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event(`negotiationneeded`))});else{let r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}
vendor: 14,520 bytes, line 2240
2240return this.getSenders().find(e=>e.track===t)};function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{let r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,`g`),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{let r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,`g`),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}[`createOffer`,`createAnswer`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){let e=arguments;return arguments.length&&typeof arguments[0]==`function`?n.apply(this,[t=>{let n=a(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>a(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]});let s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type||(arguments[0]=o(this,arguments[0])),s.apply(this,arguments)};let c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,`localDescription`);Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){let e=c.get.apply(this);return e.type===``?e:a(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if(this.signalingState===`closed`)throw new DOMException(`The RTCPeerConnection's signalingState is 'closed'.`,`InvalidStateError`);if(!e._pc)throw new DOMException(`Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.`,`TypeError`);if(e._pc!==this)throw new DOMException(`Sender was not created by this connection.`,`InvalidAccessError`);this._streams=this._streams||{};let t;Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(t.getTracks().length===1?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event(`negotiationneeded`)))}}function IB(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&[`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new(t===`addIceCandidate`?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]})}function LB(e,t){t.version>102||bB(e,`negotiationneeded`,e=>{let n=e.target;if(!((t.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics===`plan-b`)&&n.signalingState!==`stable`))return e})}function RB(e,t){let n=e&&e.navigator;if(!n.mediaDevices)return;let r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){SB(`navigator.getUserMedia`,`navigator.mediaDevices.getUserMedia`),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&`autoGainControl`in n.mediaDevices.getSupportedConstraints())){let e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return typeof n==`object`&&typeof n.audio==`object`&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,`autoGainControl`,`mozAutoGainControl`),e(n.audio,`noiseSuppression`,`mozNoiseSuppression`)),t(n)},r&&r.prototype.getSettings){let t=r.prototype.getSettings;r.prototype.getSettings=function(){let n=t.apply(this,arguments);return e(n,`mozAutoGainControl`,`autoGainControl`),e(n,`mozNoiseSuppression`,`noiseSuppression`),n}}if(r&&r.prototype.applyConstraints){let t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return this.kind===`audio`&&typeof n==`object`&&(n=JSON.parse(JSON.stringify(n)),e(n,`autoGainControl`,`mozAutoGainControl`),e(n,`noiseSuppression`,`mozNoiseSuppression`)),t.apply(this,[n])}}}}function wMe(e,t){e.navigator.mediaDevices&&(e.navigator.mediaDevices&&`getDisplayMedia`in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){let e=new DOMException(`getDisplayMedia without video constraints is undefined`);return e.name=`NotFoundError`,e.code=8,Promise.reject(e)}return n.video===!0?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)}))}var zB=Ge({shimAddTransceiver:()=>qB,shimCreateAnswer:()=>XB,shimCreateOffer:()=>YB,shimGetDisplayMedia:()=>wMe,shimGetParameters:()=>JB,shimGetStats:()=>HB,shimGetUserMedia:()=>RB,shimOnTrack:()=>BB,shimPeerConnection:()=>VB,shimRTCDataChannel:()=>KB,shimReceiverGetStats:()=>WB,shimRemoveStream:()=>GB,shimSenderGetStats:()=>UB});function BB(e){typeof e==`object`&&e.RTCTrackEvent&&`receiver`in e.RTCTrackEvent.prototype&&!(`transceiver`in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function VB(e,t){typeof e==`object`&&(e.RTCPeerConnection||e.mozRTCPeerConnection)&&(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&[`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new(t===`addIceCandidate`?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function HB(e,t){if(typeof e!=`object`||!(e.RTCPeerConnection||e.mozRTCPeerConnection)||t.version>=151)return;let n={inboundrtp:`inbound-rtp`,outboundrtp:`outbound-rtp`,candidatepair:`candidate-pair`,localcandidate:`local-candidate`,remotecandidate:`remote-candidate`},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){let[e,i,a]=arguments;return this.signalingState===`closed`?Promise.resolve(new Map):r.apply(this,[e||null]).then(e=>{if(t.version<53&&!i)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if(t.name!==`TypeError`)throw t;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(i,a)}}function UB(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&`getStats`in e.RTCRtpSender.prototype)return;let t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});let n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){let e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function WB(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&`getStats`in e.RTCRtpReceiver.prototype)return;let t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),bB(e,`track`,e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function GB(e){!e.RTCPeerConnection||`removeStream`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){SB(`removeStream`,`removeTrack`),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function KB(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function qB(e,t){if(!(typeof e==`object`&&e.RTCPeerConnection)||t.version>=110)return;let n=e.RTCPeerConnection.prototype.addTransceiver;n&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;e===void 0&&(e=[]),e=[...e];let t=e.length>0;t&&e.forEach(e=>{if(`rid`in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw TypeError(`Invalid RID value provided.`);if(`scaleResolutionDownBy`in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw RangeError(`scale_resolution_down_by must be >= 1.0`);if(`maxFramerate`in e&&!(parseFloat(e.maxFramerate)>=0))throw RangeError(`max_framerate must be >= 0.0`)});let r=n.apply(this,arguments);if(t){let{sender:t}=r,n=t.getParameters();(!(`encodings`in n)||n.encodings.length===1&&Object.keys(n.encodings[0]).length===0)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then(()=>{delete t.sendEncodings}).catch(()=>{delete t.sendEncodings})))}return r})}function JB(e,t){if(!(typeof e==`object`&&e.RTCRtpSender)||t.version>=110)return;let n=e.RTCRtpSender.prototype.getParameters;n&&(e.RTCRtpSender.prototype.getParameters=function(){let e=n.apply(this,arguments);return`encodings`in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function YB(e,t){if(!(typeof e==`object`&&e.RTCPeerConnection)||t.version>=110)return;let n=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>n.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):n.apply(this,arguments)}}function XB(e,t){if(!(typeof e==`object`&&e.RTCPeerConnection)||t.version>=110)return;let n=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>n.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):n.apply(this,arguments)}}var ZB=Ge({shimAudioContext:()=>oV,shimCallbacksAPI:()=>eV,shimConstraints:()=>nV,shimCreateOfferLegacy:()=>aV,shimGetUserMedia:()=>tV,shimLocalStreamsAPI:()=>QB,shimRTCIceServerUrls:()=>rV,shimRemoteStreamsAPI:()=>$B,shimTrackEventTransceiver:()=>iV});function QB(e){if(typeof e==`object`&&e.RTCPeerConnection){if(`getLocalStreams`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||=[],this._localStreams}),!(`addStream`in e.RTCPeerConnection.prototype)){let t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||=[],this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}`removeStream`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||=[];let t=this._localStreams.indexOf(e);if(t===-1)return;this._localStreams.splice(t,1);let n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function $B(e){if(typeof e==`object`&&e.RTCPeerConnection&&(`getRemoteStreams`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!(`onaddstream`in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener(`addstream`,this._onaddstream),this.removeEventListener(`track`,this._onaddstreampoly)),this.addEventListener(`addstream`,this._onaddstream=e),this.addEventListener(`track`,this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||=[],this._remoteStreams.includes(e))return;this._remoteStreams.push(e);let t=new Event(`addstream`);t.stream=e,this.dispatchEvent(t)})})}});let t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){let e=this;return this._onaddstreampoly||this.addEventListener(`track`,this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||=[],e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);let n=new Event(`addstream`);n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function eV(e){if(typeof e!=`object`||!e.RTCPeerConnection)return;let t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,a=t.setRemoteDescription,o=t.addIceCandidate;t.createOffer=function(e,t){let r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){let n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,n){let r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){let r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){let r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}function tV(e){let t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){let e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(nV(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function nV(e){return e&&e.video!==void 0?Object.assign({},e,{video:wB(e.video)}):e}function rV(e){if(!e.RTCPeerConnection)return;let t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){let t=[];for(let n=0;n<e.iceServers.length;n++){let r=e.iceServers[n];r.urls===void 0&&r.url?(SB(`RTCIceServer.url`,`RTCIceServer.urls`),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,`generateCertificate`in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get(){return t.generateCertificate}})}function iV(e){typeof e==`object`&&e.RTCTrackEvent&&`receiver`in e.RTCTrackEvent.prototype&&!(`transceiver`in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function aV(e){let t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){e.offerToReceiveAudio!==void 0&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);let t=this.getTransceivers().find(e=>e.receiver.track.kind===`audio`);e.offerToReceiveAudio===!1&&t?t.direction===`sendrecv`?t.setDirection?t.setDirection(`sendonly`):t.direction=`sendonly`:t.direction===`recvonly`&&(t.setDirection?t.setDirection(`
2240inactive`):t.direction=`inactive`):e.offerToReceiveAudio===!0&&!t&&this.addTransceiver(`audio`,{direction:`recvonly`}),e.offerToReceiveVideo!==void 0&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);let n=this.getTransceivers().find(e=>e.receiver.track.kind===`video`);e.offerToReceiveVideo===!1&&n?n.direction===`sendrecv`?n.setDirection?n.setDirection(`sendonly`):n.direction=`sendonly`:n.direction===`recvonly`&&(n.setDirection?n.setDirection(`inactive`):n.direction=`inactive`):e.offerToReceiveVideo===!0&&!n&&this.addTransceiver(`video`,{direction:`recvonly`})}return t.apply(this,arguments)}}function oV(e){typeof e!=`object`||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var TMe=o(((e,t)=>{var n={};n.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split(` 2241`).map(e=>e.trim())},n.splitSections=function(e){return e.split(` 2242m=`).map((e,t)=>(t>0?`m=`+e:e).trim()+`\r 2243`)},n.getDescription=function(e){let t=n.splitSections(e);return t&&t[0]},n.getMediaSections=function(e){let t=n.splitSections(e);return t.shift(),t},n.matchPrefix=function(e,t){return n.splitLines(e).filter(e=>e.indexOf(t)===0)},n.parseCandidate=function(e){let t;t=e.indexOf(`a=candidate:`)===0?e.substring(12).split(` `):e.substring(10).split(` `);let n={foundation:t[0],component:{1:`rtp`,2:`rtcp`}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case`raddr`:n.relatedAddress=t[e+1];break;case`rport`:n.relatedPort=parseInt(t[e+1],10);break;case`tcptype`:n.tcpType=t[e+1];break;case`ufrag`:n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:n[t[e]]===void 0&&(n[t[e]]=t[e+1])}return n},n.writeCandidate=function(e){let t=[];t.push(e.foundation);let n=e.component;n===`rtp`?t.push(1):n===`rtcp`?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);let r=e.type;return t.push(`typ`),t.push(r),r!==`host`&&e.relatedAddress&&e.relatedPort!==void 0&&(t.push(`raddr`),t.push(e.relatedAddress),t.push(`rport`),t.push(e.relatedPort)),e.tcpType&&e.protocol.toLowerCase()===`tcp`&&(t.push(`tcptype`),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push(`ufrag`),t.push(e.usernameFragment||e.ufrag)),`candidate:`+t.join(` `)},n.parseIceOptions=function(e){return e.substring(14).split(` `)},n.parseRtpMap=function(e){let t=e.substring(9).split(` `),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split(`/`),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=t.length===3?parseInt(t[2],10):1,n.numChannels=n.channels,n},n.writeRtpMap=function(e){let t=e.payloadType;e.preferredPayloadType!==void 0&&(t=e.preferredPayloadType);let n=e.channels||e.numChannels||1;return`a=rtpmap:`+t+` `+e.name+`/`+e.clockRate+(n===1?``:`/`+n)+`\r 2244`},n.parseExtmap=function(e){let t=e.substring(9).split(` `);return{id:parseInt(t[0],10),direction:t[0].indexOf(`/`)>0?t[0].split(`/`)[1]:`sendrecv`,uri:t[1],attributes:t.slice(2).join(` `)}},n.writeExtmap=function(e){return`a=extmap:`+(e.id||e.preferredId)+(e.direction&&e.direction!==`sendrecv`?`/`+e.direction:``)+` `+e.uri+(e.attributes?` `+e.attributes:``)+`\r 2245`},n.parseFmtp=function(e){let t={},n,r=e.substring(e.indexOf(` `)+1).split(`;`);for(let e=0;e<r.length;e++)n=r[e].trim().split(`=`),t[n[0].trim()]=n[1];return t},n.writeFmtp=function(e){let t=``,n=e.payloadType;if(e.preferredPayloadType!==void 0&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){let r=[];Object.keys(e.parameters).forEach(t=>{e.parameters[t]===void 0?r.push(t):r.push(t+`=`+e.parameters[t])}),t+=`a=fmtp:`+n+` `+r.join(`;`)+`\r 2246`}return t},n.parseRtcpFb=function(e){let t=e.substring(e.indexOf(` `)+1).split(` `);return{type:t.shift(),parameter:t.join(` `)}},n.writeRtcpFb=function(e){let t=``,n=e.payloadType;return e.preferredPayloadType!==void 0&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(e=>{t+=`a=rtcp-fb:`+n+` `+e.type+(e.parameter&&e.parameter.length?` `+e.parameter:``)+`\r 2247`}),t},n.parseSsrcMedia=function(e){let t=e.indexOf(` `),n={ssrc:parseInt(e.substring(7,t),10)},r=e.indexOf(`:`,t);return r>-1?(n.attribute=e.substring(t+1,r),n.value=e.substring(r+1)):n.attribute=e.substring(t+1),n},n.parseSsrcGroup=function(e){let t=e.substring(13).split(` `);return{semantics:t.shift(),ssrcs:t.map(e=>parseInt(e,10))}},n.getMid=function(e){let t=n.matchPrefix(e,`a=mid:`)[0];if(t)return t.substring(6)},n.parseFingerprint=function(e){let t=e.substring(14).split(` `);return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},n.getDtlsParameters=function(e,t){return{role:`auto`,fingerprints:n.matchPrefix(e+t,`a=fingerprint:`).map(n.parseFingerprint)}},n.writeDtlsParameters=function(e,t){let n=`a=setup:`+t+`\r 2248`;
vendor: 10,038 bytes, lines 2248-2271
2248return e.fingerprints.forEach(e=>{n+=`a=fingerprint:`+e.algorithm+` `+e.value+`\r 2249`}),n},n.parseCryptoLine=function(e){let t=e.substring(9).split(` `);return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},n.writeCryptoLine=function(e){return`a=crypto:`+e.tag+` `+e.cryptoSuite+` `+(typeof e.keyParams==`object`?n.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?` `+e.sessionParams.join(` `):``)+`\r 2250`},n.parseCryptoKeyParams=function(e){if(e.indexOf(`inline:`)!==0)return null;let t=e.substring(7).split(`|`);return{keyMethod:`inline`,keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(`:`)[0]:void 0,mkiLength:t[2]?t[2].split(`:`)[1]:void 0}},n.writeCryptoKeyParams=function(e){return e.keyMethod+`:`+e.keySalt+(e.lifeTime?`|`+e.lifeTime:``)+(e.mkiValue&&e.mkiLength?`|`+e.mkiValue+`:`+e.mkiLength:``)},n.getCryptoParameters=function(e,t){return n.matchPrefix(e+t,`a=crypto:`).map(n.parseCryptoLine)},n.getIceParameters=function(e,t){let r=n.matchPrefix(e+t,`a=ice-ufrag:`)[0],i=n.matchPrefix(e+t,`a=ice-pwd:`)[0];return r&&i?{usernameFragment:r.substring(12),password:i.substring(10)}:null},n.writeIceParameters=function(e){let t=`a=ice-ufrag:`+e.usernameFragment+`\r 2251a=ice-pwd:`+e.password+`\r 2252`;return e.iceLite&&(t+=`a=ice-lite\r 2253`),t},n.parseRtpParameters=function(e){let t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=n.splitLines(e)[0].split(` `);t.profile=r[2];for(let i=3;i<r.length;i++){let a=r[i],o=n.matchPrefix(e,`a=rtpmap:`+a+` `)[0];if(o){let r=n.parseRtpMap(o),i=n.matchPrefix(e,`a=fmtp:`+a+` `);switch(r.parameters=i.length?n.parseFmtp(i[0]):{},r.rtcpFeedback=n.matchPrefix(e,`a=rtcp-fb:`+a+` `).map(n.parseRtcpFb),t.codecs.push(r),r.name.toUpperCase()){case`RED`:case`ULPFEC`:t.fecMechanisms.push(r.name.toUpperCase())}}}n.matchPrefix(e,`a=extmap:`).forEach(e=>{t.headerExtensions.push(n.parseExtmap(e))});let i=n.matchPrefix(e,`a=rtcp-fb:* `).map(n.parseRtcpFb);return t.codecs.forEach(e=>{i.forEach(t=>{e.rtcpFeedback.find(e=>e.type===t.type&&e.parameter===t.parameter)||e.rtcpFeedback.push(t)})}),t},n.writeRtpDescription=function(e,t){let r=``;r+=`m=`+e+` `,r+=t.codecs.length>0?`9`:`0`,r+=` `+(t.profile||`UDP/TLS/RTP/SAVPF`)+` `,r+=t.codecs.map(e=>e.preferredPayloadType===void 0?e.payloadType:e.preferredPayloadType).join(` `)+`\r 2254`,r+=`c=IN IP4 0.0.0.0\r 2255`,r+=`a=rtcp:9 IN IP4 0.0.0.0\r 2256`,t.codecs.forEach(e=>{r+=n.writeRtpMap(e),r+=n.writeFmtp(e),r+=n.writeRtcpFb(e)});let i=0;return t.codecs.forEach(e=>{e.maxptime>i&&(i=e.maxptime)}),i>0&&(r+=`a=maxptime:`+i+`\r 2257`),t.headerExtensions&&t.headerExtensions.forEach(e=>{r+=n.writeExtmap(e)}),r},n.parseRtpEncodingParameters=function(e){let t=[],r=n.parseRtpParameters(e),i=r.fecMechanisms.indexOf(`RED`)!==-1,a=r.fecMechanisms.indexOf(`ULPFEC`)!==-1,o=n.matchPrefix(e,`a=ssrc:`).map(e=>n.parseSsrcMedia(e)).filter(e=>e.attribute===`cname`),s=o.length>0&&o[0].ssrc,c,l=n.matchPrefix(e,`a=ssrc-group:FID`).map(e=>e.substring(17).split(` `).map(e=>parseInt(e,10)));l.length>0&&l[0].length>1&&l[0][0]===s&&(c=l[0][1]),r.codecs.forEach(e=>{if(e.name.toUpperCase()===`RTX`&&e.parameters.apt){let n={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(n.rtx={ssrc:c}),t.push(n),i&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:s,mechanism:a?`red+ulpfec`:`red`},t.push(n))}}),t.length===0&&s&&t.push({ssrc:s});let u=n.matchPrefix(e,`b=`);return u.length&&(u=u[0].indexOf(`b=TIAS:`)===0?parseInt(u[0].substring(7),10):u[0].indexOf(`b=AS:`)===0?parseInt(u[0].substring(5),10)*1e3*.95-16e3:void 0,t.forEach(e=>{e.maxBitrate=u})),t},n.parseRtcpParameters=function(e){let t={},r=n.matchPrefix(e,`a=ssrc:`).map(e=>n.parseSsrcMedia(e)).filter(e=>e.attribute===`cname`)[0];r&&(t.cname=r.value,t.ssrc=r.ssrc);let i=n.matchPrefix(e,`a=rtcp-rsize`);return t.reducedSize=i.length>0,t.compound=i.length===0,t.mux=n.matchPrefix(e,`a=rtcp-mux`).length>0,t},n.writeRtcpParameters=function(e){let t=``;return e.reducedSize&&(t+=`a=rtcp-rsize\r 2258`),e.mux&&(t+=`a=rtcp-mux\r 2259`),e.ssrc!==void 0&&e.cname&&(t+=`a=ssrc:`+e.ssrc+` cname:`+e.cname+`\r 2260`),t},n.parseMsid=function(e){let t,r=n.matchPrefix(e,`a=msid:`);if(r.length===1)return t=r[0].substring(7).split(` `),{stream:t[0],track:t[1]};let i=n.matchPrefix(e,`a=ssrc:`).map(e=>n.parseSsrcMedia(e)).filter(e=>e.attribute===`msid`);if(i.length>0)return t=i[0].value.split(` `),{stream:t[0],track:t[1]}},n.parseSctpDescription=function(e){let t=n.parseMLine(e),r=n.matchPrefix(e,`a=max-message-size:`),i;r.length>0&&(i=parseInt(r[0].substring(19),10)),isNaN(i)&&(i=65536);let a=n.matchPrefix(e,`a=sctp-port:`);if(a.length>0)return{port:parseInt(a[0].substring(12),10),protocol:t.fmt,maxMessageSize:i};let o=n.matchPrefix(e,`a=sctpmap:`);if(o.length>0){let e=o[0].substring(10).split(` `);return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},n.writeSctpDescription=function(e,t){let n=[];return n=e.protocol===`DTLS/SCTP`?[`m=`+e.kind+` 9 `+e.protocol+` `+t.port+`\r 2261`,`c=IN IP4 0.0.0.0\r 2262`,`a=sctpmap:`+t.port+` `+t.protocol+` 65535\r 2263`]:[`m=`+e.kind+` 9 `+e.protocol+` `+t.protocol+`\r 2264`,`c=IN IP4 0.0.0.0\r 2265`,`a=sctp-port:`+t.port+`\r 2266`],t.maxMessageSize!==void 0&&n.push(`a=max-message-size:`+t.maxMessageSize+`\r 2267`),n.join(``)},n.generateSessionId=function(){return Math.random().toString().substr(2,22)},n.writeSessionBoilerplate=function(e,t,r){let i,a=t===void 0?2:t;return i=e||n.generateSessionId(),`v=0\r 2268o=`+(r||`thisisadapterortc`)+` `+i+` `+a+` IN IP4 127.0.0.1\r 2269s=-\r 2270t=0 0\r 2271`},n.getDirection=function(e,t){let r=n.splitLines(e);for(let e=0;e<r.length;e++)switch(r[e]){case`a=sendrecv`:case`a=sendonly`:case`a=recvonly`:case`a=inactive`:return r[e].substring(2)}return t?n.getDirection(t):`sendrecv`},n.getKind=function(e){return n.splitLines(e)[0].split(` `)[0].substring(2)},n.isRejected=function(e){return e.split(` `,2)[1]===`0`},n.parseMLine=function(e){let t=n.splitLines(e)[0].substring(2).split(` `);return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(` `)}},n.parseOLine=function(e){let t=n.matchPrefix(e,`o=`)[0].substring(2).split(` `);return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},n.isValidSDP=function(e){if(typeof e!=`string`||e.length===0)return!1;let t=n.splitLines(e);for(let e=0;e<t.length;e++)if(t[e].length<2||t[e].charAt(1)!==`=`)return!1;return!0},typeof t==`object`&&(t.exports=n)})),EMe=Ge({removeExtmapAllowMixed:()=>pV,shimAddIceCandidateNullOrEmpty:()=>mV,shimConnectionState:()=>fV,shimMaxMessageSize:()=>uV,shimParameterlessSetLocalDescription:()=>hV,shimRTCIceCandidate:()=>cV,shimRTCIceCandidateRelayProtocol:()=>lV,shimSendThrowTypeError:()=>dV}),sV=l(TMe());function cV(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&`foundation`in e.RTCIceCandidate.prototype)return;let t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if(typeof e==`object`&&e.candidate&&e.candidate.indexOf(`a=`)===0&&(e=JSON.parse(JSON.stringify(e)),e.candidate=e.candidate.substring(2)),e.candidate&&e.candidate.length){let n=new t(e),r=sV.default.parseCandidate(e.candidate);for(let e in r)e in n||Object.defineProperty(n,e,{value:r[e]});return n.toJSON=function(){return{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex,usernameFragment:n.usernameFragment}},n}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,bB(e,`icecandidate`,t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:`false`}),t))}function lV(e){!e.RTCIceCandidate||e.RTCIceCandidate&&`relayProtocol`in e.RTCIceCandidate.prototype||bB(e,`icecandidate`,e=>{if(e.candidate){let t=sV.default.parseCandidate(e.candidate.candidate);t.type===`relay`&&(e.candidate.relayProtocol={0:`tls`,1:`tcp`,2:`udp`}[t.priority>>24])}return e})}function uV(e,t){if(!e.RTCPeerConnection||t.browser===`chrome`&&t.version>102||t.browser===`firefox`&&t.version>=113)return;`sctp`in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return this._sctp===void 0?null:this._sctp}});let n=function(e){if(!e||!e.sdp)return!1;let t=sV.default.splitSections(e.sdp);return t.shift(),t.some(e=>{let t=sV.default.parseMLine(e);return t&&t.kind===`application`&&t.protocol.indexOf(`SCTP`)!==-1})},r=function(e){let t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(t===null||t.length<2)return-1;let n=parseInt(t[1],10);return n===n?n:-1},i=function(e){let n=65536;return t.browser===`firefox`&&(n=t.version<57?e===-1?16384:2147483637:t.version<60?t.version===57?65535:65536:2147483637),n},a=function(e,n){let r=65536;t.browser===`firefox`&&t.version===57&&(r=65535);let i=sV.default.matchPrefix(e.sdp,`a=max-message-size:`);return i.length>0?r=parseInt(i[0].substring(19),10):t.browser===`firefox`&&n!==-1&&(r=2147483637),r},o=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,t.browser===`chrome`&&t.version>=76){let{sdpSemantics:e}=this.getConfiguration();e===`plan-b`&&Object.defineProperty(this,"sctp",{get(){return this._sctp===void 0?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){let e=r(arguments[0]),t=i(e),n=a(arguments[0],e),o;o=t===0&&n===0?1/0:t===0||n===0?Math.max(t,n):Math.min(t,n);let s={};Object.defineProperty(s,"maxMessageSize",{get(){return o}}),this._sctp=s}return o.apply(this,arguments)}}function dV(e,t){if(!(e.RTCPeerConnection&&`createDataChannel`in e.RTCPeerConnection.prototype)||t.browser===`chrome`&&t.version>=149||t.browser===`firefox`&&t.version>60)return;function n(e,t){let n=e.send;e.send=function(){let r=arguments[0],i=r.length||r.size||r.byteLength;if(e.readyState===`open`&&t.sctp&&i>t.sctp.maxMessageSize)throw TypeError(`Message too large (can send a maximum of `+t.sctp.maxMessageSize+` bytes)`);return n.apply(e,arguments)}}let r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){let e=r.apply(this,arguments);return n(e,this),e},bB(e,`datachannel`,e=>(n(e.channel,e.target),e))}
2271function fV(e){if(!e.RTCPeerConnection||`connectionState`in e.RTCPeerConnection.prototype)return;let t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:`connected`,checking:`connecting`}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener(`connectionstatechange`,this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener(`connectionstatechange`,this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),[`setLocalDescription`,`setRemoteDescription`].forEach(e=>{let n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{let t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;let n=new Event(`connectionstatechange`,e);t.dispatchEvent(n)}return e},this.addEventListener(`iceconnectionstatechange`,this._connectionstatechangepoly)),n.apply(this,arguments)}})}function pV(e,t){if(!e.RTCPeerConnection||t.browser===`chrome`&&t.version>=71||t.browser===`safari`&&t._safariVersion>=13.1)return;let n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&t.sdp.indexOf(` 2272a=extmap-allow-mixed`)!==-1){let n=t.sdp.split(` 2273`).filter(e=>e.trim()!==`a=extmap-allow-mixed`).join(` 2274`);e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function mV(e,t){if(!(e.RTCPeerConnection&&e.RTCPeerConnection.prototype))return;let n=e.RTCPeerConnection.prototype.addIceCandidate;n&&n.length!==0&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(t.browser===`chrome`&&t.version<78||t.browser===`firefox`&&t.version<68||t.browser===`safari`)&&arguments[0]&&arguments[0].candidate===``?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function hV(e,t){if(!(e.RTCPeerConnection&&e.RTCPeerConnection.prototype))return;let n=e.RTCPeerConnection.prototype.setLocalDescription;n&&n.length!==0&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if(typeof e!=`object`||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case`stable`:case`have-local-offer`:case`have-remote-pranswer`:e.type=`offer`;break;default:e.type=`answer`}return e.sdp||e.type!==`offer`&&e.type!==`answer`?n.apply(this,[e]):(e.type===`offer`?this.createOffer:this.createAnswer).apply(this).then(e=>n.apply(this,[e]))})}function DMe({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){let n=xB,r=CMe(e),i={browserDetails:r,commonShim:EMe,extractVersion:yB,disableLog:xMe,disableWarnings:SMe,sdp:sV};switch(r.browser){case`chrome`:if(!kB||!IB||!t.shimChrome)return n(`Chrome shim is not included in this adapter release.`),i;if(r.version===null)return n(`Chrome shim can not determine version, not shimming.`),i;n(`adapter.js shimming chrome.`),i.browserShim=kB,mV(e,r),hV(e,r),OB(e,r),AB(e,r),IB(e,r),jB(e,r),FB(e,r),MB(e,r),NB(e,r),LB(e,r),cV(e,r),lV(e,r),fV(e,r),uV(e,r),dV(e,r),pV(e,r);break;case`firefox`:if(!zB||!VB||!t.shimFirefox)return n(`Firefox shim is not included in this adapter release.`),i;n(`adapter.js shimming firefox.`),i.browserShim=zB,mV(e,r),hV(e,r),RB(e,r),VB(e,r),HB(e,r),BB(e,r),GB(e,r),UB(e,r),WB(e,r),KB(e,r),qB(e,r),JB(e,r),YB(e,r),XB(e,r),cV(e,r),fV(e,r),uV(e,r),dV(e,r);break;case`safari`:if(!ZB||!t.shimSafari)return n(`Safari shim is not included in this adapter release.`),i;n(`adapter.js shimming safari.`),i.browserShim=ZB,mV(e,r),hV(e,r),rV(e,r),aV(e,r),eV(e,r),QB(e,r),$B(e,r),iV(e,r),tV(e,r),oV(e,r),cV(e,r),lV(e,r),uV(e,r),dV(e,r),pV(e,r);break;default:n(`Unsupported browser!`)}return i}var gV=DMe({window:typeof window>`u`?void 0:window});function _V(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var vV=class{constructor(){this.chunkedMTU=16300,this._dataCount=1,this.chunk=e=>{let t=[],n=e.byteLength,r=Math.ceil(n/this.chunkedMTU),i=0,a=0;for(;a<n;){let o=Math.min(n,a+this.chunkedMTU),s=e.slice(a,o),c={__peerData:this._dataCount,n:i,data:s,total:r};t.push(c),a=o,i++}return this._dataCount++,t}}};function OMe(e){let t=0;for(let n of e)t+=n.byteLength;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n}var yV=gV.default||gV,bV=new class{isWebRTCSupported(){return typeof RTCPeerConnection<`u`}isBrowserSupported(){let e=this.getBrowser(),t=this.getVersion();return this.supportedBrowsers.includes(e)?e===`chrome`?t>
2274=this.minChromeVersion:e===`firefox`?t>=this.minFirefoxVersion:e===`safari`&&!this.isIOS&&t>=this.minSafariVersion:!1}getBrowser(){return yV.browserDetails.browser}getVersion(){return yV.browserDetails.version||0}isUnifiedPlanSupported(){let e=this.getBrowser(),t=yV.browserDetails.version||0;if(e===`chrome`&&t<this.minChromeVersion)return!1;if(e===`firefox`&&t>=this.minFirefoxVersion)return!0;if(!window.RTCRtpTransceiver||!(`currentDirection`in RTCRtpTransceiver.prototype))return!1;let n,r=!1;try{n=new RTCPeerConnection,n.addTransceiver(`audio`),r=!0}catch{}finally{n&&n.close()}return r}toString(){return`Supports: 2275 browser:${this.getBrowser()} 2276 version:${this.getVersion()} 2277 isIOS:${this.isIOS} 2278 isWebRTCSupported:${this.isWebRTCSupported()} 2279 isBrowserSupported:${this.isBrowserSupported()} 2280 isUnifiedPlanSupported:${this.isUnifiedPlanSupported()}`}constructor(){this.isIOS=typeof navigator<`u`&&[`iPad`,`iPhone`,`iPod`].includes(navigator.platform),this.supportedBrowsers=[`firefox`,`chrome`,`safari`],this.minFirefoxVersion=59,this.minChromeVersion=72,this.minSafariVersion=605}},kMe=e=>!e||/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(e),xV=()=>Math.random().toString(36).slice(2),SV={iceServers:[{urls:`stun:stun.l.google.com:19302`},{urls:[`turn:eu-0.turn.peerjs.com:3478`,`turn:us-0.turn.peerjs.com:3478`],username:`peerjs`,credential:`peerjsp`}],sdpSemantics:`unified-plan`},CV=new class extends vV{noop(){}blobToArrayBuffer(e,t){let n=new FileReader;return n.onload=function(e){e.target&&t(e.target.result)},n.readAsArrayBuffer(e),n}binaryStringToArrayBuffer(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t.buffer}isSecure(){return location.protocol===`https:`}constructor(...e){super(...e),this.CLOUD_HOST=`0.peerjs.com`,this.CLOUD_PORT=443,this.chunkedBrowsers={Chrome:1,chrome:1},this.defaultConfig=SV,this.browser=bV.getBrowser(),this.browserVersion=bV.getVersion(),this.pack=gB,this.unpack=hB,this.supports=function(){let e={browser:bV.isBrowserSupported(),webRTC:bV.isWebRTCSupported(),audioVideo:!1,data:!1,binaryBlob:!1,reliable:!1};if(!e.webRTC)return e;let t;try{t=new RTCPeerConnection(SV),e.audioVideo=!0;let n;try{n=t.createDataChannel(`_PEERJSTEST`,{ordered:!0}),e.data=!0,e.reliable=!!n.ordered;try{n.binaryType=`blob`,e.binaryBlob=!bV.isIOS}catch{}}catch{}finally{n&&n.close()}}catch{}finally{t&&t.close()}return e}(),this.validateId=kMe,this.randomToken=xV}},AMe=`PeerJS: `,wV=new class{get logLevel(){return this._logLevel}set logLevel(e){this._logLevel=e}log(...e){this._logLevel>=3&&this._print(3,...e)}warn(...e){this._logLevel>=2&&this._print(2,...e)}error(...e){this._logLevel>=1&&this._print(1,...e)}setLogFunction(e){this._print=e}_print(e,...t){let n=[AMe,...t];for(let e in n)n[e]instanceof Error&&(n[e]=`(`+n[e].name+`) `+n[e].message);e>=3?console.log(...n):e>=2?console.warn(`WARNING`,...n):e>=1&&console.error(`ERROR`,...n)}constructor(){this._logLevel=0}},TV={},jMe=Object.prototype.hasOwnProperty,EV=`~`;function DV(){}Object.create&&(DV.prototype=Object.create(null),new DV().__proto__||(EV=!1));function MMe(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function OV(e,t,n,r,i){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var a=new MMe(n,r||e,i),o=EV?EV+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],a]:e._events[o].push(a):(e._events[o]=a,e._eventsCount++),e}function kV(e,t){--e._eventsCount===0?e._events=new DV:delete e._events[t]}function AV(){this._events=new DV,this._eventsCount=0}AV.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)jMe.call(t,n)&&e.push(EV?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},AV.prototype.listeners=function(e){var t=EV?EV+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,a=Array(i);r<i;r++)a[r]=n[r].fn;return a},AV.prototype.listenerCount=function(e){var t=EV?EV+e:e,n=this._events[t];return n?n.fn?1:n.length:0},AV.prototype.emit=function(e,t,n,r,i,a){var o=EV?EV+e:e;if(!this._events[o])return!1;var s=this._events[o],c=arguments.length,l,u;if(s.fn){switch(s.once&&this.removeListener(e,s.fn,void 0,!0),c){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,t),!0;case 3:return s.fn.call(s.context,t,n),!0;case 4:return s.fn.call(s.context,t,n,r),!0;case 5:return s.fn.call(s.context,t,n,r,i),!0;case 6:return s.fn.call(s.context,t,n,r,i,a),!0}for(u=1,l=Array(c-1);u<c;u++)l[u-1]=arguments[u];
2280s.fn.apply(s.context,l)}else{var d=s.length,f;for(u=0;u<d;u++)switch(s[u].once&&this.removeListener(e,s[u].fn,void 0,!0),c){case 1:s[u].fn.call(s[u].context);break;case 2:s[u].fn.call(s[u].context,t);break;case 3:s[u].fn.call(s[u].context,t,n);break;case 4:s[u].fn.call(s[u].context,t,n,r);break;default:if(!l)for(f=1,l=Array(c-1);f<c;f++)l[f-1]=arguments[f];s[u].fn.apply(s[u].context,l)}}return!0},AV.prototype.on=function(e,t,n){return OV(this,e,t,n,!1)},AV.prototype.once=function(e,t,n){return OV(this,e,t,n,!0)},AV.prototype.removeListener=function(e,t,n,r){var i=EV?EV+e:e;if(!this._events[i])return this;if(!t)return kV(this,i),this;var a=this._events[i];if(a.fn)a.fn===t&&(!r||a.once)&&(!n||a.context===n)&&kV(this,i);else{for(var o=0,s=[],c=a.length;o<c;o++)(a[o].fn!==t||r&&!a[o].once||n&&a[o].context!==n)&&s.push(a[o]);s.length?this._events[i]=s.length===1?s[0]:s:kV(this,i)}return this},AV.prototype.removeAllListeners=function(e){var t;return e?(t=EV?EV+e:e,this._events[t]&&kV(this,t)):(this._events=new DV,this._eventsCount=0),this},AV.prototype.off=AV.prototype.removeListener,AV.prototype.addListener=AV.prototype.on,AV.prefixed=EV,AV.EventEmitter=AV,TV=AV;var jV={};_V(jV,`ConnectionType`,()=>MV),_V(jV,`PeerErrorType`,()=>NV),_V(jV,`BaseConnectionErrorType`,()=>PV),_V(jV,`DataConnectionErrorType`,()=>FV),_V(jV,`SerializationType`,()=>IV),_V(jV,`SocketEventType`,()=>LV),_V(jV,`ServerMessageType`,()=>RV);var MV=function(e){return e.Data=`data`,e.Media=`media`,e}({}),NV=function(e){return e.BrowserIncompatible=`browser-incompatible`,e.Disconnected=`disconnected`,e.InvalidID=`invalid-id`,e.InvalidKey=`invalid-key`,e.Network=`network`,e.PeerUnavailable=`peer-unavailable`,e.SslUnavailable=`ssl-unavailable`,e.ServerError=`server-error`,e.SocketError=`socket-error`,e.SocketClosed=`socket-closed`,e.UnavailableID=`unavailable-id`,e.WebRTC=`webrtc`,e}({}),PV=function(e){return e.NegotiationFailed=`negotiation-failed`,e.ConnectionClosed=`connection-closed`,e}({}),FV=function(e){return e.NotOpenYet=`not-open-yet`,e.MessageToBig=`message-too-big`,e}({}),IV=function(e){return e.Binary=`binary`,e.BinaryUTF8=`binary-utf8`,e.JSON=`json`,e.None=`raw`,e}({}),LV=function(e){return e.Message=`message`,e.Disconnected=`disconnected`,e.Error=`error`,e.Close=`close`,e}({}),RV=function(e){return e.Heartbeat=`HEARTBEAT`,e.Candidate=`CANDIDATE`,e.Offer=`OFFER`,e.Answer=`ANSWER`,e.Open=`OPEN`,e.Error=`ERROR`,e.IdTaken=`ID-TAKEN`,e.InvalidKey=`INVALID-KEY`,e.Leave=`LEAVE`,e.Expire=`EXPIRE`,e}({}),NMe=`1.5.5`,PMe=class extends TV.EventEmitter{constructor(e,t,n,r,i,a=5e3){super(),this.pingInterval=a,this._disconnected=!0,this._messagesQueue=[];let o=e?`wss://`:`ws://`;this._baseUrl=o+t+`:`+n+r+`peerjs?key=`+i}start(e,t){this._id=e;let n=`${this._baseUrl}&id=${e}&token=${t}`;!this._socket&&this._disconnected&&(this._socket=new WebSocket(n+`&version=1.5.5`),this._disconnected=!1,this._socket.onmessage=e=>{let t;try{t=JSON.parse(e.data),wV.log(`Server message received:`,t)}catch{wV.log(`Invalid server message`,e.data);return}this.emit(LV.Message,t)},this._socket.onclose=e=>{this._disconnected||(wV.log(`Socket closed.`,e),this._cleanup(),this._disconnected=!0,this.emit(LV.Disconnected))},this._socket.onopen=()=>{this._disconnected||(this._sendQueuedMessages(),wV.log(`Socket open`),this._scheduleHeartbeat())})}_scheduleHeartbeat(){this._wsPingTimer=setTimeout(()=>{this._sendHeartbeat()},this.pingInterval)}_sendHeartbeat(){if(!this._wsOpen()){wV.log(`Cannot send heartbeat, because socket closed`);return}let e=JSON.stringify({type:RV.Heartbeat});this._socket.send(e),this._scheduleHeartbeat()}_wsOpen(){return!!this._socket&&this._socket.readyState===1}_sendQueuedMessages(){let e=[...this._messagesQueue];this._messagesQueue=[];for(let t of e)this.send(t)}send(e){if(this._disconnected)return;if(!this._id){this._messagesQueue.push(e);return}if(!e.type){this.emit(LV.Error,`Invalid message`);return}if(!this._wsOpen())return;let t=JSON.stringify(e);this._socket.send(t)}close(){this._disconnected||=(this._cleanup(),!0)}_cleanup(){this._socket&&=(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(),void 0),clearTimeout(this._wsPingTimer)}},zV=class{constructor(e){this.connection=e}startConnection(e){let t=this._startPeerConnection();if(this.connection.peerConnection=t,this.connection.type===MV.Media&&e._stream&&this._addTracksToConnection(e._stream,t),e.originator){let n=this.connection,r={ordered:!!e.reliable}
2280,i=t.createDataChannel(n.label,r);n._initializeDataChannel(i),this._makeOffer()}else this.handleSDP(`OFFER`,e.sdp)}_startPeerConnection(){wV.log(`Creating RTCPeerConnection.`);let e=new RTCPeerConnection(this.connection.provider.options.config);return this._setupListeners(e),e}_setupListeners(e){let t=this.connection.peer,n=this.connection.connectionId,r=this.connection.type,i=this.connection.provider;wV.log(`Listening for ICE candidates.`),e.onicecandidate=e=>{e.candidate&&e.candidate.candidate&&(wV.log(`Received ICE candidates for ${t}:`,e.candidate),i.socket.send({type:RV.Candidate,payload:{candidate:e.candidate,type:r,connectionId:n},dst:t}))},e.oniceconnectionstatechange=()=>{switch(e.iceConnectionState){case`failed`:wV.log(`iceConnectionState is failed, closing connections to `+t),this.connection.emitError(PV.NegotiationFailed,`Negotiation of connection to `+t+` failed.`),this.connection.close();break;case`closed`:wV.log(`iceConnectionState is closed, closing connections to `+t),this.connection.emitError(PV.ConnectionClosed,`Connection to `+t+` closed.`),this.connection.close();break;case`disconnected`:wV.log(`iceConnectionState changed to disconnected on the connection with `+t);break;case`completed`:e.onicecandidate=()=>{}}this.connection.emit(`iceStateChanged`,e.iceConnectionState)},wV.log(`Listening for data channel`),e.ondatachannel=e=>{wV.log(`Received data channel`);let r=e.channel;i.getConnection(t,n)._initializeDataChannel(r)},wV.log(`Listening for remote stream`),e.ontrack=e=>{wV.log(`Received remote stream`);let r=e.streams[0],a=i.getConnection(t,n);if(a.type===MV.Media){let e=a;this._addStreamToMediaConnection(r,e)}}}cleanup(){wV.log(`Cleaning up PeerConnection to `+this.connection.peer);let e=this.connection.peerConnection;if(!e)return;this.connection.peerConnection=null,e.onicecandidate=e.oniceconnectionstatechange=e.ondatachannel=e.ontrack=()=>{};let t=e.signalingState!==`closed`,n=!1,r=this.connection.dataChannel;r&&(n=!!r.readyState&&r.readyState!==`closed`),(t||n)&&e.close()}async _makeOffer(){let e=this.connection.peerConnection,t=this.connection.provider;try{let n=await e.createOffer(this.connection.options.constraints);wV.log(`Created offer.`),this.connection.options.sdpTransform&&typeof this.connection.options.sdpTransform==`function`&&(n.sdp=this.connection.options.sdpTransform(n.sdp)||n.sdp);try{await e.setLocalDescription(n),wV.log(`Set localDescription:`,n,`for:${this.connection.peer}`);let r={sdp:n,type:this.connection.type,connectionId:this.connection.connectionId,metadata:this.connection.metadata};if(this.connection.type===MV.Data){let e=this.connection;r={...r,label:e.label,reliable:e.reliable,serialization:e.serialization}}t.socket.send({type:RV.Offer,payload:r,dst:this.connection.peer})}catch(e){e!=`OperationError: Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer`&&(t.emitError(NV.WebRTC,e),wV.log(`Failed to setLocalDescription, `,e))}}catch(e){t.emitError(NV.WebRTC,e),wV.log(`Failed to createOffer, `,e)}}async _makeAnswer(){let e=this.connection.peerConnection,t=this.connection.provider;try{let n=await e.createAnswer();wV.log(`Created answer.`),this.connection.options.sdpTransform&&typeof this.connection.options.sdpTransform==`function`&&(n.sdp=this.connection.options.sdpTransform(n.sdp)||n.sdp);try{await e.setLocalDescription(n),wV.log(`Set localDescription:`,n,`for:${this.connection.peer}`),t.socket.send({type:RV.Answer,payload:{sdp:n,type:this.connection.type,connectionId:this.connection.connectionId},dst:this.connection.peer})}catch(e){t.emitError(NV.WebRTC,e),wV.log(`Failed to setLocalDescription, `,e)}}catch(e){t.emitError(NV.WebRTC,e),wV.log(`Failed to create answer, `,e)}}async handleSDP(e,t){t=new RTCSessionDescription(t);let n=this.connection.peerConnection,r=this.connection.provider;wV.log(`Setting remote description`,t);let i=this;try{await n.setRemoteDescription(t),wV.log(`Set remoteDescription:${e} for:${this.connection.peer}`),e===`OFFER`&&await i._makeAnswer()}catch(e){r.emitError(NV.WebRTC,e),wV.log(`Failed to setRemoteDescription, `,e)}}async handleCandidate(e){wV.log(`handleCandidate:`,e);try{await this.connection.peerConnection.addIceCandidate(e),wV.log(`Added ICE candidate for:${this.connection.peer}`)}catch(e){this.connection.provider.emitError(NV.WebRTC,e),wV.log(`Failed to handleCandidate, `,e)}}_addTracksToConnection(e,t){if(wV.log(`add tracks from stream ${e.id} to peer connection`),!t.addTrack)return wV.error(`Your browser does't support RTCPeerConnection#addTrack. Ignored.`);
2280e.getTracks().forEach(n=>{t.addTrack(n,e)})}_addStreamToMediaConnection(e,t){wV.log(`add stream ${e.id} to media connection ${t.connectionId}`),t.addStream(e)}},BV=class extends TV.EventEmitter{emitError(e,t){wV.error(`Error:`,t),this.emit(`error`,new FMe(`${e}`,t))}},FMe=class extends Error{constructor(e,t){typeof t==`string`?super(t):(super(),Object.assign(this,t)),this.type=e}},VV=class extends BV{get open(){return this._open}constructor(e,t,n){super(),this.peer=e,this.provider=t,this.options=n,this._open=!1,this.metadata=n.metadata}},HV=class e extends VV{static#e=this.ID_PREFIX=`mc_`;get type(){return MV.Media}get localStream(){return this._localStream}get remoteStream(){return this._remoteStream}constructor(t,n,r){super(t,n,r),this._localStream=this.options._stream,this.connectionId=this.options.connectionId||e.ID_PREFIX+CV.randomToken(),this._negotiator=new zV(this),this._localStream&&this._negotiator.startConnection({_stream:this._localStream,originator:!0})}_initializeDataChannel(e){this.dataChannel=e,this.dataChannel.onopen=()=>{wV.log(`DC#${this.connectionId} dc connection success`),this.emit(`willCloseOnRemote`)},this.dataChannel.onclose=()=>{wV.log(`DC#${this.connectionId} dc closed for:`,this.peer),this.close()}}addStream(e){wV.log(`Receiving stream`,e),this._remoteStream=e,super.emit(`stream`,e)}handleMessage(e){let t=e.type,n=e.payload;switch(e.type){case RV.Answer:this._negotiator.handleSDP(t,n.sdp),this._open=!0;break;case RV.Candidate:this._negotiator.handleCandidate(n.candidate);break;default:wV.warn(`Unrecognized message type:${t} from peer:${this.peer}`)}}answer(e,t={}){if(this._localStream){wV.warn(`Local stream already exists on this MediaConnection. Are you answering a call twice?`);return}this._localStream=e,t&&t.sdpTransform&&(this.options.sdpTransform=t.sdpTransform),this._negotiator.startConnection({...this.options._payload,_stream:e});let n=this.provider._getMessages(this.connectionId);for(let e of n)this.handleMessage(e);this._open=!0}close(){this._negotiator&&=(this._negotiator.cleanup(),null),this._localStream=null,this._remoteStream=null,this.provider&&=(this.provider._removeConnection(this),null),this.options&&this.options._stream&&(this.options._stream=null),this.open&&(this._open=!1,super.emit(`close`))}},IMe=class{constructor(e){this._options=e}_buildRequest(e){let t=this._options.secure?`https`:`http`,{host:n,port:r,path:i,key:a}=this._options,o=new URL(`${t}://${n}:${r}${i}${a}/${e}`);return o.searchParams.set(`ts`,`${Date.now()}${Math.random()}`),o.searchParams.set(`version`,NMe),fetch(o.href,{referrerPolicy:this._options.referrerPolicy})}async retrieveId(){try{let e=await this._buildRequest(`id`);if(e.status!==200)throw Error(`Error. Status:${e.status}`);return e.text()}catch(e){wV.error(`Error retrieving ID`,e);let t=``;throw this._options.path===`/`&&this._options.host!==CV.CLOUD_HOST&&(t=" If you passed in a `path` to your self-hosted PeerServer, you'll also need to pass in that same path when creating a new Peer."),Error(`Could not get an ID from the server.`+t)}}async listAllPeers(){try{let e=await this._buildRequest(`peers`);if(e.status!==200){if(e.status===401){let e=``;throw e=this._options.host===CV.CLOUD_HOST?`It looks like you're using the cloud server. You can email [email protected] to enable peer listing for your API key.`:"You need to enable `allow_discovery` on your self-hosted PeerServer to use this feature.",Error(`It doesn't look like you have permission to list peers IDs. `+e)}throw Error(`Error. Status:${e.status}`)}return e.json()}catch(e){throw wV.error(`Error retrieving list peers`,e),Error(`Could not get list peers from the server.`+e)}}},UV=class e extends VV{static#e=this.ID_PREFIX=`dc_`;static#t=this.MAX_BUFFERED_AMOUNT=8388608;get type(){return MV.Data}constructor(t,n,r){super(t,n,r),this.connectionId=this.options.connectionId||e.ID_PREFIX+xV(),this.label=this.options.label||this.connectionId,this.reliable=!!this.options.reliable,this._negotiator=new zV(this),this._negotiator.startConnection(this.options._payload||{originator:!0,reliable:this.reliable})}
2280_initializeDataChannel(e){this.dataChannel=e,this.dataChannel.onopen=()=>{wV.log(`DC#${this.connectionId} dc connection success`),this._open=!0,this.emit(`open`)},this.dataChannel.onmessage=e=>{wV.log(`DC#${this.connectionId} dc onmessage:`,e.data)},this.dataChannel.onclose=()=>{wV.log(`DC#${this.connectionId} dc closed for:`,this.peer),this.close()}}close(e){if(e?.flush){this.send({__peerData:{type:`close`}});return}this._negotiator&&=(this._negotiator.cleanup(),null),this.provider&&=(this.provider._removeConnection(this),null),this.dataChannel&&=(this.dataChannel.onopen=null,this.dataChannel.onmessage=null,this.dataChannel.onclose=null,null),this.open&&(this._open=!1,super.emit(`close`))}send(e,t=!1){if(!this.open){this.emitError(FV.NotOpenYet,"Connection is not open. You should listen for the `open` event before sending messages.");return}return this._send(e,t)}async handleMessage(e){let t=e.payload;switch(e.type){case RV.Answer:await this._negotiator.handleSDP(e.type,t.sdp);break;case RV.Candidate:await this._negotiator.handleCandidate(t.candidate);break;default:wV.warn(`Unrecognized message type:`,e.type,`from peer:`,this.peer)}}},WV=class extends UV{get bufferSize(){return this._bufferSize}_initializeDataChannel(e){super._initializeDataChannel(e),this.dataChannel.binaryType=`arraybuffer`,this.dataChannel.addEventListener(`message`,e=>this._handleDataMessage(e))}_bufferedSend(e){(this._buffering||!this._trySend(e))&&(this._buffer.push(e),this._bufferSize=this._buffer.length)}_trySend(e){if(!this.open)return!1;if(this.dataChannel.bufferedAmount>UV.MAX_BUFFERED_AMOUNT)return this._buffering=!0,setTimeout(()=>{this._buffering=!1,this._tryBuffer()},50),!1;try{this.dataChannel.send(e)}catch(e){return wV.error(`DC#:${this.connectionId} Error when sending:`,e),this._buffering=!0,this.close(),!1}return!0}_tryBuffer(){if(!this.open||this._buffer.length===0)return;let e=this._buffer[0];this._trySend(e)&&(this._buffer.shift(),this._bufferSize=this._buffer.length,this._tryBuffer())}close(e){if(e?.flush){this.send({__peerData:{type:`close`}});return}this._buffer=[],this._bufferSize=0,super.close()}constructor(...e){super(...e),this._buffer=[],this._bufferSize=0,this._buffering=!1}},GV=class extends WV{close(e){super.close(e),this._chunkedData={}}constructor(e,t,n){super(e,t,n),this.chunker=new vV,this.serialization=IV.Binary,this._chunkedData={}}_handleDataMessage({data:e}){let t=hB(e),n=t.__peerData;if(n){if(n.type===`close`){this.close();return}this._handleChunk(t);return}this.emit(`data`,t)}_handleChunk(e){let t=e.__peerData,n=this._chunkedData[t]||{data:[],count:0,total:e.total};if(n.data[e.n]=new Uint8Array(e.data),n.count++,this._chunkedData[t]=n,n.total===n.count){delete this._chunkedData[t];let e=OMe(n.data);this._handleDataMessage({data:e})}}_send(e,t){let n=gB(e);if(n instanceof Promise)return this._send_blob(n);if(!t&&n.byteLength>this.chunker.chunkedMTU){this._sendChunks(n);return}this._bufferedSend(n)}async _send_blob(e){let t=await e;if(t.byteLength>this.chunker.chunkedMTU){this._sendChunks(t);return}this._bufferedSend(t)}_sendChunks(e){let t=this.chunker.chunk(e);wV.log(`DC#${this.connectionId} Try to send ${t.length} chunks...`);for(let e of t)this.send(e,!0)}},LMe=class extends WV{_handleDataMessage({data:e}){super.emit(`data`,e)}_send(e,t){this._bufferedSend(e)}constructor(...e){super(...e),this.serialization=IV.None}},RMe=class extends WV{_handleDataMessage({data:e}){let t=this.parse(this.decoder.decode(e)),n=t.__peerData;if(n&&n.type===`close`){this.close();return}this.emit(`data`,t)}_send(e,t){let n=this.encoder.encode(this.stringify(e));if(n.byteLength>=CV.chunkedMTU){this.emitError(FV.MessageToBig,`Message too big for JSON channel`);return}this._bufferedSend(n)}constructor(...e){super(...e),this.serialization=IV.JSON,this.encoder=new TextEncoder,this.decoder=new TextDecoder,this.stringify=JSON.stringify,this.parse=JSON.parse}},zMe=class e extends BV{static#e=this.DEFAULT_KEY=`peerjs`;get id(){return this._id}get options(){return this._options}get open(){return this._open}get socket(){return this._socket}get connections(){let e=Object.create(null);for(let[t,n]of this._connections)e[t]=n;return e}get destroyed(){return this._destroyed}get disconnected(){return this._disconnected}constructor(t,n){super(),this._serializers={raw:LMe,json:RMe,binary:GV,"b
2280inary-utf8":GV,default:GV},this._id=null,this._lastServerId=null,this._destroyed=!1,this._disconnected=!1,this._open=!1,this._connections=new Map,this._lostMessages=new Map;let r;if(t&&t.constructor==Object?n=t:t&&(r=t.toString()),n={debug:0,host:CV.CLOUD_HOST,port:CV.CLOUD_PORT,path:`/`,key:e.DEFAULT_KEY,token:CV.randomToken(),config:CV.defaultConfig,referrerPolicy:`strict-origin-when-cross-origin`,serializers:{},...n},this._options=n,this._serializers={...this._serializers,...this.options.serializers},this._options.host===`/`&&(this._options.host=window.location.hostname),this._options.path&&(this._options.path[0]!==`/`&&(this._options.path=`/`+this._options.path),this._options.path[this._options.path.length-1]!==`/`&&(this._options.path+=`/`)),this._options.secure===void 0&&this._options.host!==CV.CLOUD_HOST?this._options.secure=CV.isSecure():this._options.host==CV.CLOUD_HOST&&(this._options.secure=!0),this._options.logFunction&&wV.setLogFunction(this._options.logFunction),wV.logLevel=this._options.debug||0,this._api=new IMe(n),this._socket=this._createServerConnection(),!CV.supports.audioVideo&&!CV.supports.data){this._delayedAbort(NV.BrowserIncompatible,`The current browser does not support WebRTC`);return}if(r&&!CV.validateId(r)){this._delayedAbort(NV.InvalidID,`ID "${r}" is invalid`);return}r?this._initialize(r):this._api.retrieveId().then(e=>this._initialize(e)).catch(e=>this._abort(NV.ServerError,e))}_createServerConnection(){let e=new PMe(this._options.secure,this._options.host,this._options.port,this._options.path,this._options.key,this._options.pingInterval);return e.on(LV.Message,e=>{this._handleMessage(e)}),e.on(LV.Error,e=>{this._abort(NV.SocketError,e)}),e.on(LV.Disconnected,()=>{this.disconnected||(this.emitError(NV.Network,`Lost connection to server.`),this.disconnect())}),e.on(LV.Close,()=>{this.disconnected||this._abort(NV.SocketClosed,`Underlying socket is already closed.`)}),e}_initialize(e){this._id=e,this.socket.start(e,this._options.token)}_handleMessage(e){let t=e.type,n=e.payload,r=e.src;switch(t){case RV.Open:this._lastServerId=this.id,this._open=!0,this.emit(`open`,this.id);break;case RV.Error:this._abort(NV.ServerError,n.msg);break;case RV.IdTaken:this._abort(NV.UnavailableID,`ID "${this.id}" is taken`);break;case RV.InvalidKey:this._abort(NV.InvalidKey,`API KEY "${this._options.key}" is invalid`);break;case RV.Leave:wV.log(`Received leave message from ${r}`),this._cleanupPeer(r),this._connections.delete(r);break;case RV.Expire:this.emitError(NV.PeerUnavailable,`Could not connect to peer ${r}`);break;case RV.Offer:{let e=n.connectionId,t=this.getConnection(r,e);if(t&&(t.close(),wV.warn(`Offer received for existing Connection ID:${e}`)),n.type===MV.Media){let i=new HV(r,this,{connectionId:e,_payload:n,metadata:n.metadata});t=i,this._addConnection(r,t),this.emit(`call`,i)}else if(n.type===MV.Data){let i=new this._serializers[n.serialization](r,this,{connectionId:e,_payload:n,metadata:n.metadata,label:n.label,serialization:n.serialization,reliable:n.reliable});t=i,this._addConnection(r,t),this.emit(`connection`,i)}else{wV.warn(`Received malformed connection type:${n.type}`);return}let i=this._getMessages(e);for(let e of i)t.handleMessage(e);break}default:{if(!n){wV.warn(`You received a malformed message from ${r} of type ${t}`);return}let i=n.connectionId,a=this.getConnection(r,i);a&&a.peerConnection?a.handleMessage(e):i?this._storeMessage(i,e):wV.warn(`You received an unrecognized message:`,e);break}}}_storeMessage(e,t){this._lostMessages.has(e)||this._lostMessages.set(e,[]),this._lostMessages.get(e).push(t)}_getMessages(e){let t=this._lostMessages.get(e);return t?(this._lostMessages.delete(e),t):[]}
2280connect(e,t={}){if(t={serialization:`default`,...t},this.disconnected){wV.warn(`You cannot connect to a new Peer because you called .disconnect() on this Peer and ended your connection with the server. You can create a new Peer to reconnect, or call reconnect on this peer if you believe its ID to still be available.`),this.emitError(NV.Disconnected,`Cannot connect to new Peer after disconnecting from server.`);return}let n=new this._serializers[t.serialization](e,this,t);return this._addConnection(e,n),n}call(e,t,n={}){if(this.disconnected){wV.warn(`You cannot connect to a new Peer because you called .disconnect() on this Peer and ended your connection with the server. You can create a new Peer to reconnect.`),this.emitError(NV.Disconnected,`Cannot connect to new Peer after disconnecting from server.`);return}if(!t){wV.error("To call a peer, you must provide a stream from your browser's `getUserMedia`.");return}let r=new HV(e,this,{...n,_stream:t});return this._addConnection(e,r),r}_addConnection(e,t){wV.log(`add connection ${t.type}:${t.connectionId} to peerId:${e}`),this._connections.has(e)||this._connections.set(e,[]),this._connections.get(e).push(t)}_removeConnection(e){let t=this._connections.get(e.peer);if(t){let n=t.indexOf(e);n!==-1&&t.splice(n,1)}this._lostMessages.delete(e.connectionId)}getConnection(e,t){let n=this._connections.get(e);if(!n)return null;for(let e of n)if(e.connectionId===t)return e;return null}_delayedAbort(e,t){setTimeout(()=>{this._abort(e,t)},0)}_abort(e,t){wV.error(`Aborting!`),this.emitError(e,t),this._lastServerId?this.disconnect():this.destroy()}destroy(){this.destroyed||(wV.log(`Destroy peer with ID:${this.id}`),this.disconnect(),this._cleanup(),this._destroyed=!0,this.emit(`close`))}_cleanup(){for(let e of this._connections.keys())this._cleanupPeer(e),this._connections.delete(e);this.socket.removeAllListeners()}_cleanupPeer(e){let t=this._connections.get(e);if(t)for(let e of t)e.close()}disconnect(){if(this.disconnected)return;let e=this.id;wV.log(`Disconnect peer with ID:${e}`),this._disconnected=!0,this._open=!1,this.socket.close(),this._lastServerId=e,this._id=null,this.emit(`disconnected`,e)}reconnect(){if(this.disconnected&&!this.destroyed)wV.log(`Attempting reconnection to server with ID ${this._lastServerId}`),this._disconnected=!1,this._initialize(this._lastServerId);else if(this.destroyed)throw Error(`This peer cannot reconnect to the server. It has already been destroyed.`);else if(!this.disconnected&&!this.open)wV.error(`In a hurry? We're still trying to make the initial connection!`);else throw Error(`Peer ${this.id} cannot reconnect because it is not disconnected from the server!`)}listAllPeers(e=e=>{}){this._api.listAllPeers().then(t=>e(t)).catch(e=>this._abort(NV.ServerError,e))}};function KV(e,t={}){let{base:n=500,factor:r=2,cap:i=8e3,max:a=4,jitter:o=0,rng:s=Math.random}=t;if(!Number.isFinite(e)||e<1||e>a)return null;let c=Math.min(i,Math.round(n*r**(e-1)));if(!o)return c;let l=c*o;return Math.max(0,Math.round(c+(s()*2-1)*l))}var qV=1e-5,JV=Ue(0),YV=Ue(`select`),XV=Ue(`#ff3b30`),ZV=Ue(24),QV=Ue(typeof localStorage<`u`&&[`size`,`opacity`,`off`].includes(nt.getItem(`uvPenPressure`)||``)?nt.getItem(`uvPenPressure`):`size`);QV.subscribe(e=>{typeof localStorage<`u`&&nt.setItem(`uvPenPressure`,String(e))});var $V=.15,BMe=e=>$V+.85*Math.max(0,Math.min(1,e)),eH=Ue(typeof localStorage<`u`?nt.getItem(`uvFaceFilter`)??`all`:`all`);typeof localStorage<`u`&&eH.subscribe(e=>{try{nt.setItem(`uvFaceFilter`,e)}catch{}});function tH(e){if(!e||U(eH)!==`selection`||U(Up)!==e)return null;let t=U(Ip);return t?.length?new Set(t):null}function nH(e){let t=e?.material;return t?Array.isArray(t)?t:[t]:[]}function rH(e,t,n){let r=U(Ui);if(n){let e=r?.getObjectByProperty(`uuid`,n);if(e)return iH(e)}if(!t?.length)return null;let i=e&&e.uuid&&t.includes(e.uuid)?e:r?.getObjectByProperty(`uuid`,t[0]);return i?iH(i):null}function iH(e){if(!e)return null;if(e.geometry?.attributes?.position)return e;let t=null,n=null;return e.traverse?.(e=>{e.geometry?.attributes?.position&&(t||=e,!n&&e.geometry.attributes.uv&&(n=e))}),n??t??null}function aH(e,t=0){let n=nH(e)[t]?.map?.image;return n&&(n.width||n.videoWidth)?n:null}function oH(e){return e?.geometry?.attributes?.position?e.geometry.attributes.uv?{ok:!0,reason:``}:{ok:!1,reason:`This mesh has no texture coordinates to edit.`}:{ok:!1,reason:`Select a mesh to edit its UVs.`}}function sH(e){let t=oH(e);return t.ok?sm(e)*9>15e5?{ok:!1,reason:`This mesh is too large to move UVs on (an edit could not sync), but you can still paint it.`}:{ok:!0,reason:``}:t}var cH=2e4;function lH(e,t,n=null){let r=e?.geometry,i=r?.attributes?.uv;if(!i)return[];let a=r.index,o=a?a.count:i.count,s=Array.isArray(e.material)&&e.material.length>=2?VMe(r.groups,o):()=>0,c=[];for(let e=0;e<o;e+=3){if(s(e)!==t)continue;let r=e/3;if(n&&!n.has(r))continue;let o=[0,1,2].map(t=>a?a.getX(e+t):e+t);c.push({corners:o.map(e=>[i.getX(e),i.getY(e)]),indices:o,tri:r})}return c}function uH(e){let t=e.length,n=[...Array(t).keys()],r=e=>{for(;n[e]!==e;)n[e]=n[n[e]],e=n[e];return e},i=(e,t)=>{n[r(e)]=r(t)},a=new Map;e.forEach((e,t)=>{for(let n of e.corners){let e=dH(n[0],n[1]),r=a.get(e);r===void 0?a.set(e,t):i(r,t)}});let o=new Map;for(let e=0;e<t;e++){let t=r(e),n=o.get(t);n||o.set(t,n=[]),n.push(e)}return[...o.values()]}function dH(e,t){let n=1/qV;return Math.round(e*n)+`,`+Math.round(t*n)}function fH(e,t,n,r=null){let i=lH(e,t,r);if(!i.length||!n.length)return n;let a=new Set(n),o=new Set(n);for(let e of uH(i))if(e.some(e=>i[e].indices.some(e=>a.has(e))))for(let t of e)for(let e of i[t].indices)o.add(e);
2280return[...o]}function pH(e,t){let n=e?.geometry?.attributes?.uv;if(!n)return null;let r=1/0,i=1/0,a=-1/0,o=-1/0,s=0;for(let e of t){if(e<0||e>=n.count)continue;let t=n.getX(e),c=n.getY(e);r=Math.min(r,t),a=Math.max(a,t),i=Math.min(i,c),o=Math.max(o,c),s++}return s?{uMin:r,vMin:i,uMax:a,vMax:o,cu:(r+a)/2,cv:(i+o)/2}:null}function mH(e,t,n={}){let r=e?.geometry?.attributes?.uv;if(!r||!t?.length)return!1;if(jH&&jH.uv!==r)return jH=null,!1;let i=n.pivot??pH(e,t);if(!i)return!1;let a=n.rotate??0,o=Math.cos(a),s=Math.sin(a),c=(n.scaleU??1)*(n.flipU?-1:1),l=(n.scaleV??1)*(n.flipV?-1:1);for(let e of t){let t=(r.getX(e)-i.cu)*c,n=(r.getY(e)-i.cv)*l;r.setXY(e,i.cu+t*o-n*s,i.cv+t*s+n*o)}return r.needsUpdate=!0,ci(),!0}function hH(e,t){let n=e?.geometry?.attributes?.uv;if(!n)return[];let r=[];for(let e of t)e<0||e>=n.count||r.push({i:e,u:n.getX(e),v:n.getY(e)});return r}function gH(e,t,n={}){let r=e?.geometry?.attributes?.uv;if(!r||!t?.length)return!1;if(jH&&jH.uv!==r)return jH=null,!1;let i=n.du??0,a=n.dv??0,o=n.rotate??0,s=n.scaleU??1,c=n.scaleV??1,l=Math.cos(o),u=Math.sin(o),d=n.pivot??null;if(!d&&(o||s!==1||c!==1)){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of t)e=Math.min(e,a.u),n=Math.max(n,a.u),r=Math.min(r,a.v),i=Math.max(i,a.v);d={cu:(e+n)/2,cv:(r+i)/2}}for(let e of t){let t=e.u,n=e.v;if(d){let e=(t-d.cu)*s,r=(n-d.cv)*c;t=d.cu+e*l-r*u,n=d.cv+e*u+r*l}r.setXY(e.i,t+i,n+a)}return r.needsUpdate=!0,ci(),!0}function _H(e,t,n=null){let r=e?.geometry?.attributes?.uv;if(!r||!t?.length)return[];let i=new Set(t.map(e=>dH(e.u,e.v))),a=[];for(let e=0;e<r.count;e++)(!n||n.has(e))&&i.has(dH(r.getX(e),r.getY(e)))&&a.push(e);return a}function vH(e,t,n,r){let i=e?.geometry?.attributes?.uv;if(!i||!t?.length||!(n>0)||!(r>0))return!1;for(let e of t)e<0||e>=i.count||i.setXY(e,Math.round(i.getX(e)*n)/n,Math.round(i.getY(e)*r)/r);return i.needsUpdate=!0,ci(),!0}function yH(e,t,n,r,i,a=null){let o=e?.geometry?.attributes?.uv;if(!o||!n?.length)return-1;let s=Math.hypot(r,i)||1,c=r/s,l=i/s,u=new Set(n),d=-1/0,f=null;for(let e of u){if(e<0||e>=o.count)continue;let t=o.getX(e)*c+o.getY(e)*l;t>d&&(d=t,f={u:o.getX(e),v:o.getY(e)})}if(!f)return-1;let p=-1,m=1/0;for(let n of lH(e,t,a))n.corners.forEach((e,t)=>{let r=n.indices[t];if(u.has(r))return;let i=e[0]-f.u,a=e[1]-f.v,o=i*c+a*l;if(o<=qV)return;let s=o+Math.abs(i*-l+a*c)*3;(s<m-qV||Math.abs(s-m)<=qV&&r<p)&&(m=s,p=r)});return p}function bH(e,t,n=.02){let r=pH(e,t);if(!r)return!1;let i=r.uMax-r.uMin,a=r.vMax-r.vMin,o=Math.max(i,a);if(!o)return!1;let s=(1-n*2)/o,c=e.geometry.attributes.uv;for(let e of t){let t=n+(c.getX(e)-r.uMin)*s,i=n+(c.getY(e)-r.vMin)*s;c.setXY(e,t,i)}return c.needsUpdate=!0,ci(),!0}function xH(e){let t=new Set;for(let n of e)for(let e of n.indices)t.add(e);return t}function VMe(e,t){if(!e?.length)return()=>0;let n=new Int32Array(t);for(let r of e){let e=Math.max(r.start|0,0),i=Math.min(e+(r.count|0),t);for(let t=e;t<i;t++)n[t]=r.materialIndex||0}return e=>n[e]||0}function SH(e){let t=nH(e);return Math.max(t.length,1)}function CH(e,t,n=null){let r=e?.attributes?.uv;if(!r||t<0||t>=r.count)return[];let i=r.getX(t),a=r.getY(t),o=[];for(let e=0;e<r.count;e++)(!n||n.has(e))&&Math.abs(r.getX(e)-i)<=qV&&Math.abs(r.getY(e)-a)<=qV&&o.push(e);return o}function wH(e,t,n,r,i,a=null){let o=-1,s=i*i;for(let i of lH(e,t,a))i.corners.forEach((e,t)=>{let a=e[0]-n,c=e[1]-r,l=a*a+c*c;l<=s&&(s=l,o=i.indices[t])});return o}function TH(e,t,n=null){let r=new Set;for(let i of t)if(!r.has(i))for(let t of CH(e,i,n))r.add(t);return[...r]}function EH(e,t,n,r=null){let i=Math.min(n.u0,n.u1),a=Math.max(n.u0,n.u1),o=Math.min(n.v0,n.v1),s=Math.max(n.v0,n.v1),c=new Set;for(let n of lH(e,t,r))n.corners.forEach((e,t)=>{e[0]>=i&&e[0]<=a&&e[1]>=o&&e[1]<=s&&c.add(n.indices[t])});return[...c]}function DH(e,t,n,r=null){if(!n||n.length<3)return[];let i=new Set;for(let a of lH(e,t,r))a.corners.forEach((e,t)=>{HMe(e[0],e[1],n)&&i.add(a.indices[t])});return[...i]}function HMe(e,t,n){let r=!1;for(let i=0,a=n.length-1;i<n.length;a=i++){let[o,s]=n[i],[c,l]=n[a];s>t!=l>t&&e<(c-o)*(t-s)/(l-s)+o&&(r=!r)}return r}async function OH(e,t,n={},r=null){let i=U(Ui)?.getObjectByProperty(`uuid`,e);if(!i)return!1;let a=sH(i);if(!a.ok)return es(a.reason),!1;let o=kp(i.geometry),s=[],c=[];
2280if(o.forEach((e,t)=>{(!r||r.has(t))&&(s.push(t),c.push({corners:[e[0],e[1],e[2]],tri:t}))}),!c.length)return!1;let l=await Zge(t,c,n);if(!l?.uvs?.length)return es(`That unwrap produced nothing`),!1;let u=AH(i);u.groups=u.groups??null,s.forEach((e,t)=>{let n=l.uvs[t];n&&(o[e].uv=n.map(e=>[e[0],e[1]]))});let d=rm(o);if(d.length>15e5)return es(`That edit is too large to sync`),!1;let f={positions:d,groups:Gp(o),uvs:Jp(o)};return om(e,f.positions,f.groups,f.uvs),uU(e,f),Af({kind:`meshgeo`,uuid:e,before:u,after:f}),!0}function kH(e,t,n){let r=U(Ui)?.getObjectByProperty(`uuid`,e);if(!r)return!1;let i=nH(r);if(n<0||n>=i.length)return es(`That object has no material slot `+n),!1;let a=new Set(t);if(!a.size)return!1;let o=AH(r);o.groups=o.groups??[{start:0,count:o.positions.length/3,materialIndex:0}];let s=kp(r.geometry),c=0;if(s.forEach((e,t)=>{a.has(t)&&(e.mi||0)!==n&&(e.mi=n,c++)}),!c)return!1;let l=rm(s);if(l.length>15e5)return es(`That edit is too large to sync`),!1;let u={positions:l,groups:Gp(s),uvs:Jp(s)};return om(e,u.positions,u.groups,u.uvs),uU(e,u),Af({kind:`meshgeo`,uuid:e,before:o,after:u}),!0}function AH(e){let t=kp(e.geometry);return{positions:rm(t),groups:Gp(t),uvs:Jp(t)}}var jH=null;function MH(e){let t=U(Ui)?.getObjectByProperty(`uuid`,e);return!t||!sH(t).ok?!1:(jH={uuid:e,before:AH(t),uv:t.geometry.attributes.uv},!0)}function UMe(){return!!jH}function WMe(e,t,n,r){let i=e?.geometry?.attributes?.uv;if(!i||!t?.length)return!1;if(jH&&jH.uv!==i)return jH=null,!1;for(let e of t)i.setXY(e,i.getX(e)+n,i.getY(e)+r);return i.needsUpdate=!0,ci(),!0}function NH(e){let t=jH;if(jH=null,!t||t.uuid!==e)return!1;let n=U(Ui)?.getObjectByProperty(`uuid`,e);if(!n)return!1;let r=AH(n);return!r.uvs||GMe(t.before.uvs,r.uvs)?!1:r.positions.length>15e5?(es(`That edit is too large to sync`),!1):(om(e,r.positions,r.groups,r.uvs),uU(e,r),Af({kind:`meshgeo`,uuid:e,before:t.before,after:r}),!0)}function PH(){jH=null}function GMe(e,t){if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(Math.abs(e[n]-t[n])>1e-7)return!1;return!0}var FH=1024,KMe=66,IH=5e3,LH=new Map,RH=new Map,zH=null,BH=0,VH=(e,t)=>e+`#`+t;async function HH(e,t){let n=U(Ui)?.getObjectByProperty(`uuid`,e),r=Uv(n,t);if(!r)return null;let i=r.userData?.mapDataUrl??null,a=i?null:aH(n,t),o=i??(a?qMe(r):null),s=VH(e,t),c=LH.get(s);if(c&&(c.seededFrom===o||r.map===c.texture))return c.previousMap=UH(r,c),WH(r,c),c;let l=c?.canvas??document.createElement(`canvas`),u=i?await YMe(i):a,d=JMe(u);l.width=d.w,l.height=d.h;let f=l.getContext(`2d`);if(!f)return null;f.fillStyle=`#ffffff`,f.fillRect(0,0,l.width,l.height),u&&f.drawImage(u,0,0,l.width,l.height);let p=r.map??null,m=c?.texture??new wr(l);m.colorSpace=sr,Sfe(p,m),m.needsUpdate=!0;let h={canvas:l,texture:m,uuid:e,slot:t,seededFrom:o,flipY:!p||p.flipY!==!1,previousMap:UH(r,c)};return LH.set(s,h),WH(r,h),h}function UH(e,t){let n=e.map??null;return n&&n===t?.texture?t?.previousMap??null:n}function WH(e,t){e.map!==t.texture&&(e.map=t.texture,e.needsUpdate=!0),t.texture.needsUpdate=!0,ci()}function qMe(e){return`tex:`+e.map.uuid+`:`+e.map.version}function JMe(e){let t=e?.width??0,n=e?.height??0;if(!t||!n)return{w:FH,h:FH};let r=e=>Math.min(Math.max(Math.round(e),8),4096),i=Math.max(t,n),a=i>2048?2048/i:i<256?Math.min(256/i,8):1;return{w:r(t*a),h:r(n*a)}}function YMe(e){return new Promise(t=>{let n=new Image;n.onload=()=>t(n),n.onerror=()=>t(null),n.src=e})}function GH(e,t){return(e.flipY===!1?t:1-t)*e.canvas.height}function KH(e,t,n,r,i,a=`size`){let o=e.canvas.getContext(`2d`);if(!o)return;let s=BMe(a===`off`?1:Number.isFinite(n[2])?n[2]:1);o.strokeStyle=r,o.lineWidth=a===`opacity`?i:i*s,o.globalAlpha=a===`opacity`?s:1,o.lineCap=`round`,o.lineJoin=`round`,o.beginPath(),o.moveTo(t[0]*e.canvas.width,GH(e,t[1])),o.lineTo(n[0]*e.canvas.width,GH(e,n[1])),o.stroke(),o.globalAlpha=1,e.texture.needsUpdate=!0,rU.update(e=>e+1)}async function qH(e,t=0){let n=U(Ui)?.getObjectByProperty(`uuid`,e),r=Uv(n,t);return!r||!(`map`in r)||!await HH(e,t)?!1:(BH++,zH={id:(U(Es)?.peer?.id??`local`)+`:`+
2280BH,uuid:e,slot:t,before:r.userData?.mapDataUrl??null,sent:0,points:[],pmode:U(QV)},!0)}function XMe(){return!!zH}var JH=0;function YH(e,t,n,r,i){if(!zH)return!1;let a=LH.get(VH(zH.uuid,zH.slot));if(!a)return!1;let o=zH.points[zH.points.length-1],s=zH.pmode!==`off`&&typeof i==`number`&&Number.isFinite(i)&&i<1&&typeof i==`number`?[e,t,Math.max(0,Math.min(1,Math.round(i*1e3)/1e3))]:[e,t];zH.points.push(s),o&&KH(a,o,s,n,r,zH.pmode),ci();let c=performance.now();return c-JH<KMe||(JH=c,XH(n,r),!0)}function XH(e,t){if(!zH)return;let n=Math.max(zH.sent-1,0),r=zH.points.slice(n);r.length<2||(zH.sent=zH.points.length,U(Es)?.send({type:`uvpaint`,id:zH.id,uuid:zH.uuid,...zH.slot?{slot:zH.slot}:{},seg:r,color:e,size:t,...zH.pmode===`opacity`?{pmode:`opacity`}:{}}))}function ZH(e,t){let n=zH;if(!n)return!1;XH(e,t);let r=U(Es);if(r?.send({type:`uvpaintend`,id:n.id}),zH=null,n.points.length<1)return!1;let i=LH.get(VH(n.uuid,n.slot)),a=U(Ui)?.getObjectByProperty(`uuid`,n.uuid);if(!i||!a)return!1;let o=$H(i.canvas);return Bv(n.uuid,`map`,null,n.before,o,n.slot),Hv(a,o,n.slot),r?.send({type:`objectParameters`,parameter:`map`,uuid:n.uuid,map:o,...n.slot?{slot:n.slot}:{}}),i.seededFrom=o,!0}function QH(){let e=zH;if(zH=null,!e)return;let t=LH.get(VH(e.uuid,e.slot)),n=U(Ui)?.getObjectByProperty(`uuid`,e.uuid),r=Uv(n,e.slot);t&&r&&(r.map===t.texture&&(r.map=t.previousMap??null,r.needsUpdate=!0,ci()),LH.delete(VH(e.uuid,e.slot)))}function $H(e){let t=e.toDataURL(`image/webp`,.85);return t.startsWith(`data:image/webp`)?t:e.toDataURL(`image/jpeg`,.9)}async function eU(e){let t=e?.slot??0,n=await HH(e?.uuid,t);if(!n)return;let r=e.seg??[],i=e.pmode===`opacity`?`opacity`:`size`;
2280for(let t=1;t<r.length;t++)KH(n,r[t-1],r[t],e.color??`#000000`,e.size??16,i);RH.set(e.id,{ts:Date.now()}),ci()}function tU(e){RH.delete(e?.id)}function ZMe(){return RH.size}function nU(e,t=0){if(!e)return null;let n=LH.get(VH(e,t));if(!n)return null;if(zH&&zH.uuid===e&&zH.slot===t)return n.canvas;let r=Uv(U(Ui)?.getObjectByProperty(`uuid`,e),t)?.userData?.mapDataUrl??null;return n.seededFrom===r?n.canvas:null}var rU=Ue(0);function iU(e,t=0){let n=aH(e,t);if(!n)return null;let r=n.width??0,i=n.height??0;return!r||!i?null:{w:r,h:i,bytes:Math.round(r*i*4*1.33)}}async function aU(e,t,n){let r=U(Ui)?.getObjectByProperty(`uuid`,e),i=Uv(r,t),a=aH(r,t);if(!i||!a)return es(`That slot has no texture to resize`),!1;let o=n/Math.max(a.width,a.height),s=Math.max(Math.round(a.width*o),1),c=Math.max(Math.round(a.height*o),1);if(s===a.width&&c===a.height)return!1;let l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)return!1;u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(a,0,0,s,c);let d=i.userData?.mapDataUrl??null,f=$H(l);return LH.delete(VH(e,t)),Bv(e,`map`,null,d,f,t),Hv(r,f,t),U(Es)?.send({type:`objectParameters`,parameter:`map`,uuid:e,map:f,...t?{slot:t}:{}}),es(`Texture resized to `+s+`x`+c),!0}var oU=Ue(!1),sU=null;function QMe(e=512,t=8){let n=document.createElement(`canvas`);n.width=n.height=e;let r=n.getContext(`2d`);if(!r)return null;let i=e/t;for(let e=0;e<t;e++)for(let n=0;n<t;n++)r.fillStyle=(n+e)%2==0?`#3d4653`:`#d7dde6`,r.fillRect(n*i,e*i,i,i);r.strokeStyle=`rgba(255,120,26,0.9)`,r.lineWidth=Math.max(e/256,1);for(let n=0;n<=t;n++)r.beginPath(),r.moveTo(n*i,0),r.lineTo(n*i,e),r.moveTo(0,n*i),r.lineTo(e,n*i),r.stroke();let a=new wr(n);return a.colorSpace=sr,a.wrapS=_r,a.wrapT=_r,a}function cU(e,t){if(e){if(t){if(!sU){let e=QMe();sU=new bn({map:e})}e.overrideMaterial=sU}else e.overrideMaterial===sU&&(e.overrideMaterial=null)}}function lU(e,t=0){return nH(e)[t]?.map?.flipY===!1}typeof window<`u`&&setInterval(()=>{let e=Date.now();for(let[t,n]of RH)e-n.ts>IH&&RH.delete(t)},IH);function uU(e,t){let n=U(Es);n&&n.send({type:`meshgeo`,uuid:e,positions:new Float32Array(t.positions).buffer,...t.groups?.length?{groups:t.groups}:{},...t.uvs?.length?{uvs:new Float32Array(t.uvs).buffer}:{}})}function dU(e){return e?iy(e):null}function $Me(e,t){let n=U(Es);n&&(t?n.send({type:`shadergraph`,key:e,doc:dU(t)}):n.send({type:`shadergraphdelete`,key:e,changedAt:yc()}))}function fU(e,t=0){let n=U(Es),r=n?.peer?.connections?.[e]?.[0]??n?.connections?.[e];if(!r)return;if(!r.open){t<40&&setTimeout(()=>fU(e,t+1),250);return}let i=U(ry),a={};for(let[e,t]of Object.entries(i))a[e]=dU(t);r.send({type:`shadergraphs`,graphs:a})}function pU(e){let t=e?.key;if(!t||!e?.doc)return;let n=iy(e.doc),r=ay(t);r&&(r.changedAt??0)>(n.changedAt??0)||dy(t,n,{silent:!0,stamp:n.changedAt})}function mU(e){let t=e?.key;if(!t)return;let n=ay(t);n&&(n.changedAt??0)>(e?.changedAt??0)||dy(t,null,{silent:!0})}function hU(e){let t=e?.graphs;if(t&&typeof t==`object`)for(let[e,n]of Object.entries(t))pU({key:e,doc:n})}var gU=new Map;function _U(e){gU.has(e)||gU.set(e,ay(e))}function vU(e){if(!gU.has(e))return;let t=gU.get(e);gU.delete(e);let n=ay(e);JSON.stringify(t)!==JSON.stringify(n)&&Af({kind:`shadergraph`,key:e,before:t,after:n})}function eNe(e){return gU.has(e)}Ff(`shadergraph`,(e,t)=>{let n=t===e.before?e.before:e.after;return dy(e.key,n??null),!0});var yU=[];function bU(){yU.length||(yU.push(zfe($Me)),yU.push(Hfe((e,t,n)=>{gU.has(e)||JSON.stringify(t)!==JSON.stringify(n)&&Af({kind:`shadergraph`,key:e,before:t,after:n})})))}function tNe(){for(let e of yU)e();yU=[],gU.clear()}function nNe(){return{wired:yU.length>0,gestures:[...gU.keys()]}}function rNe(e){let t=U(Es);t&&t.send({type:`game`,...Zc(e)})}function xU(){return{type:`game`,...Zc(U(Xc))}}function SU(e,t=0){let n=U(Es),r=n?.peer?.connections?.[e]?.[0]??n?.connections?.[e];if(r){if(!r.open){t<40&&setTimeout(()=>SU(e,t+1),250);return}r.send(xU())}}function CU(e){if(!e)return!1;let t=Zc(e);return t.changedAt<(U(Xc).changedAt??0)?!1:(Qc(t,{silent:!0,stamp:t.changedAt}),!0)}Ff(`game`,(e,t)=>{let n=t===e.before?e.before:e.after;return Qc(Zc(n),{stamp:yc()}),!0});var wU=[];function TU(){wU.length||(wU.push(xee(rNe)),wU.push(yee((e,t)=>{JSON.stringify(e)!==JSON.stringify(t)&&Af({kind:`game`,before:e,after:t})})))}function iNe(){for(let e of wU)e();wU=[]}function aNe(){return{wired:wU.length>0}}var EU=`kit-entities`,oNe=.6,sNe=.15,cNe=1.6,DU=null,OU=null,kU=new Map,AU={obstacles:[]},jU=-1/0,MU=!0,NU=!1,PU=new Or;new hn;var FU=new fr,lNe=[0,0,0],IU={drawn:0,created:0,removed:0,fallback:0,obstacles:0,pulses:0},LU=()=>Cee(rl),uNe=()=>yc()/1e3,dNe=()=>U(Es)?.peer?.id??null;function RU(e){let t=U(Ui);return t&&(t.updateWorldMatrix(!0,!1),t.worldToLocal(e)),e}function zU(){let e=[],t=U(yi);t?.getWorldPosition&&e.push({id:dNe()??`me`,pos:RU(t.getWorldPosition(new hn)).toArray()});let n=U(Pi);for(let t of U(Es)?.openedPeers??[]){let r=n?.getObjectByName(String(t));r?.getWorldPosition&&e.push({id:String(t),pos:RU(r.getWorldPosition(new hn)).toArray()})}return e}function fNe(e,t){if(typeof e!=`string`||!e)return null;if(e===`player`||e===`nearestPlayer`){let e=zU();if(!e.length)return null;if(!t)return e[0].pos;let n=e[0].pos,r=1/0;for(let i of e){let e=Math.hypot(i.pos[0]-t[0],i.pos[2]-t[2]);e<r&&(r=e,n=i.pos)}return n}if(e.startsWith(`player:`))return zU().find(t=>
2280t.id===e.slice(7))?.pos??null;let n=U(Ui)?.getObjectByProperty(`uuid`,e);return n?RU(n.getWorldPosition(new hn)).toArray():null}function pNe(){let e=performance.now();if(!MU&&e-jU<1e3||MU&&e-jU<250)return AU;jU=e,MU=!1;let t=U(Ui),n=LU();if(!t||!n)return AU={obstacles:[]};let r=[...n.store.ents.values()].filter(e=>!e.dead),i=r.length?r.map(e=>e.pos[1]).sort((e,t)=>e-t)[r.length>>1]:0,a=new Set(r.map(e=>e.tpl));t.updateWorldMatrix(!0,!1),FU.copy(t.matrixWorld).invert();let o=[];for(let e of t.children){let t=e.userData??{};if(!e.visible||t.kitWalkable||t.transient||a.has(e.uuid)||t.physics?.mode===`dynamic`||(PU.setFromObject(e).applyMatrix4(FU),PU.isEmpty()||!Number.isFinite(PU.min.x))||PU.max.y<i+sNe||PU.min.y>i+cNe)continue;let n={minX:PU.min.x,maxX:PU.max.x,minZ:PU.min.z,maxZ:PU.max.z};r.some(e=>e.pos[0]>n.minX&&e.pos[0]<n.maxX&&e.pos[2]>n.minZ&&e.pos[2]<n.maxZ)||o.push(n)}IU.obstacles=o.length;let s={obstacles:o},c=yl(U(Pi));return c?.bounds&&!c.boundsOwner&&(s.bounds={minX:c.bounds.min[0],maxX:c.bounds.max[0],minZ:c.bounds.min[2],maxZ:c.bounds.max[2]}),AU=s}function mNe(e,t){IU.pulses++;let n=wee(e,t);DU?DU.fireModuleTrigger(n):$(()=>import(`../chunks/jUHDc502.js`).then(e=>e.m).then(e=>e.fireModuleTrigger(n)),__vite__mapDeps([18,1,2,6,3,9,0,4,5,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86]),import.meta.url).catch(()=>{})}function hNe(){let e=U(Pi);return e?(OU||(OU=new Pn,OU.name=EU,OU.matrixAutoUpdate=!1),OU.parent!==e&&e.add(OU),OU):null}var BU=null,VU=null;function gNe(){BU??=new tn(.35,.9,4,12),VU??=new ir({color:13783612,roughness:.6});let e=new Nt(BU,VU);e.position.y=.8;let t=new Pn;return t.add(e),IU.fallback++,t}function _Ne(e){let t=U(Ui),n=e.tpl?t?.getObjectByProperty(`uuid`,e.tpl):null,r;return n?(r=n.clone(!0),r.traverse(e=>{e.userData={}}),r.visible=!0,r.userData.baseRotY=n.rotation.y,r.userData.baseScale=n.scale.clone()):(r=gNe(),r.userData.baseRotY=0,r.userData.baseScale=new hn(1,1,1)),r.userData.kitEntity=e.id,r.name=`kit-entity-`+e.id,IU.created++,r}function HU(){let e=LU(),t=hNe();if(!e||!t)return;let n=U(Ui);n&&(n.updateWorldMatrix(!0,!1),t.matrix.copy(n.matrixWorld),t.matrixWorldNeedsUpdate=!0);let r=!!e.debug().authority,i=uNe();for(let n of e.store.ents.values()){let e=kU.get(n.id);e||(e=_Ne(n),kU.set(n.id,e),t.add(e));let a=r?n.pos:Tee(n,i,lNe);e.position.set(a[0],a[1],a[2]),e.rotation.y=(e.userData.baseRotY??0)+n.yaw;let o=e.userData.baseScale;if(n.dead){let t=Math.max(.02,1-(i-(n.health.diedAt??i))/oNe);e.scale.set(o.x*t,o.y*t,o.z*t),e.position.y-=(1-t)*.5}else e.scale.copy(o)}for(let[t,n]of kU)e.store.ents.has(t)||(n.parent?.remove(n),kU.delete(t),IU.removed++);IU.drawn=kU.size}function vNe(){for(let e of kU.values())e.parent?.remove(e);kU.clear(),LU()?.reset()}function UU(e){for(let t=e;t;t=t.parent)if(t.userData?.kitEntity)return String(t.userData.kitEntity);return null}function WU(){return rl.snapshots().filter(e=>e?.type===`kitentity`)}function yNe(){NU||(NU=!0,$(()=>import(`../chunks/jUHDc502.js`).then(e=>e.m).then(e=>DU=e),__vite__mapDeps([18,1,2,6,3,9,0,4,5,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86]),import.meta.url).catch(()=>{}),Eee(rl,{resolveTarget:fNe,world:pNe,pulse:mNe,entityOf:UU}),al.includes(`kit-entities`)||al.push(EU),jee(EU),ol.includes(HU)||ol.push(HU),Mee.push(vNe),Ui.subscribe(()=>MU=!0))}function bNe(){let e=LU();return{...IU,runtime:e?.debug()??null,entities:e?[...e.store.ents.values()].map(e=>({id:e.id,kind:e.kind,tpl:e.tpl,pos:[...e.pos],hp:e.health.hp,dead:e.dead})):[],world:{obstacles:AU.obstacles?.length??0,bounds:!!AU.bounds},drawnIds:[...kU.keys()]}}function xNe(){return rl.api({onDispose:()=>{}})}var GU=[`name`,`doc`,`params`,`state`,`on`],KU=[`params`,`state`,`kit`,`after`,`cancel`,`rand`,`randInt`,`pick`,`now`,`time`,`log`,`isAuthority`,`me`,`object`,`emit`,`id`,`find`,`findAll`],SNe=`__tpBehaviour`;function qU(e){let t=typeof e==`object`&&e&&!Array.isArray(e)?e:{value:e},n=t.value,r={...typeof t.unit==`string`?{unit:t.unit}:{},...typeof t.label==`string`?{label:t.label}:{}};
2280if(typeof n==`number`&&Number.isFinite(n)){let e=Math.max(1,Math.abs(n)),i=Number.isFinite(t.min)?t.min:Math.min(0,n),a=Number.isFinite(t.max)?t.max:n+e*4,o=Number.isFinite(t.step)&&t.step>0?t.step:Number.isInteger(n)&&Number.isInteger(i)?1:.1;return{value:n,type:`number`,min:i,max:Math.max(i,a),step:o,...r}}if(typeof n==`boolean`)return{value:n,type:`boolean`,...r};if(typeof n==`string`){let e=Array.isArray(t.options)?t.options.map(String):void 0;return{value:n,type:`string`,...e?{options:e}:{},...r}}return null}function CNe(e){let t={};for(let[n,r]of Object.entries(e?.params??{})){let e=qU(r);e&&(t[n]=e)}return t}function JU(e){try{return JSON.parse(JSON.stringify(e?.state??{}))??{}}catch{return{}}}function wNe(e){return Object.keys(e??{}).filter(t=>!GU.includes(t)&&typeof e[t]==`function`)}function YU(e){let t=[];if(!e||typeof e!=`object`)return[`a behaviour must be an object: behaviour({params, state, on})`];for(let n of Object.keys(e))GU.includes(n)||(typeof e[n]==`function`?KU.includes(n)&&t.push(`method "`+n+`" hides this.`+n):t.push(`"`+n+`" is neither params/state/on nor a method`));e.params!==void 0&&(typeof e.params!=`object`||e.params===null)&&t.push(`params must be an object`);for(let[n,r]of Object.entries(e.params??{}))qU(r)||t.push(`param "`+n+`" must be a number, boolean or string (or {value, min, max})`);if(e.state!==void 0){if(typeof e.state!=`object`||e.state===null||Array.isArray(e.state))t.push(`state must be an object`);else{try{JSON.stringify(e.state)}catch{t.push(`state must be plain JSON`)}for(let[n,r]of Object.entries(e.state))typeof r==`function`&&t.push(`state "`+n+`" is a function`)}}e.on!==void 0&&(typeof e.on!=`object`||e.on===null)&&t.push(`on must be an object of handlers`);for(let[n,r]of Object.entries(e.on??{}))typeof r!=`function`&&t.push(`on.`+n+` is not a function`);return t}function TNe(e){let t=YU(e);if(t.length)throw Error(`behaviour: `+t.join(`; `));return Object.defineProperty(e,SNe,{value:!0,enumerable:!1}),e}var XU={roundStart:[`round`,`started`],go:[`round`,`go`],won:[`round`,`won`],lost:[`round`,`lost`],paused:[`round`,`paused`],resumed:[`round`,`resumed`],menu:[`round`,`menu`],levelSelected:[`levels`,`selected`],scored:[`score`,`scored`],collected:[`pickups`,`collected`],allCollected:[`pickups`,`allCollected`],spawned:[`spawner`,`spawned`],despawned:[`spawner`,`despawned`],emptied:[`spawner`,`emptied`],damaged:[`health`,`damaged`],healed:[`health`,`healed`],died:[`health`,`died`],revived:[`health`,`revived`],stuck:[`mover`,`stuck`],grabRefused:[`rules`,`refused`]},ZU={start:{},grabRequest:{piece:`piece`,hand:`string`,distance:`number`,reach:`number`,point:`vector3`,refuse:`action`},"spawner.spawned":{entity:`entity`},"spawner.despawned":{entity:`entity`},"spawner.emptied":{},"health.damaged":{entity:`entity`,amount:`number`,by:`string`},"health.healed":{entity:`entity`,amount:`number`},"health.died":{entity:`entity`,by:`string`},"health.revived":{entity:`entity`},"mover.stuck":{entity:`entity`},"rules.refused":{uuid:`string`,reason:`string`,distance:`number`,hand:`string`}},ENe={start:{label:`On behaviour start`,local:!1},grabRequest:{label:`On grab request`,local:!0}};function QU(e,t){let n=ENe[e];if(n)return{name:e,key:e,piece:null,event:null,local:n.local,label:n.label,payload:{...ZU[e]??{}}};let r=null,i=XU[e];if(i)r=i;else if(e.includes(`.`)){let[t,n]=e.split(`.`);r=[t,n]}else for(let n of t??[]){if(!e.startsWith(n.piece)||e.length<=n.piece.length)continue;let t=e.slice(n.piece.length),i=t.charAt(0).toLowerCase()+t.slice(1);if(n.calls.some(e=>e.kind===`event`&&e.name===i)){r=[n.piece,i];break}}if(!r)return null;let a=(t??[]).find(e=>e.piece===r[0])?.calls.find(e=>e.kind===`event`&&e.name===r[1]);if(!a)return null;let o=r[0]+`.`+r[1];return{name:e,key:o,piece:r[0],event:r[1],local:!!a.local,label:a.label,payload:{...ZU[o]??{}}}}function $U(e,t){let n=String(e??``);return n.includes(`*`)?RegExp(`^`+n.split(`*`).map(e=>e.replace(/[.+?^${}()|[\]\\]/g,`\\$&`)).join(`.*`)+`$`).test(String(t??``)):n===String(t??``)}function DNe(e){if(!e||typeof e!=`object`)return e;let t=Array.isArray(e.tags)?e.tags:[];return{...e,is:n=>$U(n,e.kind)||t.some(e=>$U(n,e)),hasTag:e=>t.includes(e)}}function ONe(e,t){let n=e?.uuid&&t?.(e.uuid)||[],r=String(e?.name??``);
2280return{piece:{uuid:e?.uuid??null,name:r,point:e?.point??null,tags:n,hasTag:e=>n.includes(e),is:e=>$U(e,r)||n.some(t=>$U(e,t))},hand:e?.hand??`desktop`,distance:Number(e?.distance)||0,reach:e?.reach??null,point:e?.point??null,refuse:e?.refuse}}function kNe(e){return!e||typeof e!=`object`?e??{}:e.entity?{...e,entity:DNe(e.entity)}:{...e}}var ANe=64;function eW(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function tW(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function jNe(e,t){return t?(e.at??0)===(t.at??0)?(e.rev??0)===(t.rev??0)?String(e.by??``)>String(t.by??``):(e.rev??0)>(t.rev??0):(e.at??0)>(t.at??0):!0}var nW=e=>e===void 0?void 0:JSON.parse(JSON.stringify(e));function MNe(e){let t=new Map,n=new Map,r=new Set,i={dispatched:0,refusedWrites:0,sent:0,received:0,stale:0,errors:0,skippedNotAuthority:0},a=(t,n=void 0)=>e.warn?e.warn(t,n):console.warn(`behaviour: `+t,n??``),o=()=>{for(let e of[...r])try{e()}catch{}},s=t=>{if(!e.isAuthority())return!1;if(t.synced)return!0;let n=e.now()-(e.lastPeerChange?.()??t.bornAt);return(e.peerCount?.()??0)===0||n>=2e3?(t.synced=!0,!0):!1},c=(t,n=!1)=>{let r=JSON.stringify({s:t.state,t:t.doc.timers,st:t.doc.started,q:t.doc.seq,f:t.doc.fired});if(!n&&r===t.lastSent)return!1;t.lastSent=r;let a=t.doc;
2280return t.doc={...a,rev:a.rev+1,at:Math.max(e.now(),(a.at??0)+1),by:e.me()??``},t.synced=!0,i.sent++,e.send(l(t)),!0},l=e=>({type:`bhv`,id:e.id,rev:e.doc.rev,at:e.doc.at,by:e.doc.by,state:nW(e.state),started:!!e.doc.started,seq:e.doc.seq,timers:nW(e.doc.timers),fired:nW(e.doc.fired)}),u=(e,t)=>{let n=t.state&&typeof t.state==`object`&&!Array.isArray(t.state)?nW(t.state):{},r=JU(e.def);for(let e of Object.keys(r))e in n||(n[e]=r[e]);for(let t of Object.keys(e.state))delete e.state[t];Object.assign(e.state,n),e.doc={rev:Number(t.rev)||0,at:Number(t.at)||0,by:String(t.by??``),started:!!t.started,seq:Number(t.seq)||0,timers:Array.isArray(t.timers)?t.timers.slice(0,64):[],fired:t.fired&&typeof t.fired==`object`?t.fired:{}},e.lastSent=JSON.stringify({s:e.state,t:e.doc.timers,st:e.doc.started,q:e.doc.seq,f:e.doc.fired}),e.synced=!0;for(let[t,n]of Object.entries(e.doc.fired)){let r=e.trace.fired[t];(!r||r.at<n[0])&&(e.trace.fired[t]={at:n[0],n:n[1],err:r?.err??null})}},d=(t,n,r,l,u={})=>{if(!t.alive)return;let d=!!u.local;if(!d&&!s(t)){i.skippedNotAuthority++;return}let p=t.depth===0,m=p?JSON.stringify(t.state):null;if(p){let r=d?++t.localSeq:++t.doc.seq;t.rng=tW(eW(t.id+`|`+n+`|`+r+(d?`|`+(e.me()??``):``))),t.resetGuard?.()}t.depth++,i.dispatched++;let h=e.now(),g,_=null;try{g=r.apply(t.ctx,l)}catch(e){_=e,i.errors++,t.errors.push({at:h,where:n,message:String(e?.message??e),stack:String(e?.stack??``)}),t.errors.length>20&&t.errors.shift(),a(t.name+`: `+n+` failed`,e)}finally{t.depth--}let v=t.trace.fired[n]??{at:0,n:0,err:null};if(t.trace.fired[n]={at:h,n:v.n+1,err:_?String(_?.message??_):null},p){if(JSON.stringify(t.state)!==m){if(d||!e.isAuthority())i.refusedWrites++,f(t,m),a(t.name+`: `+n+` wrote state on a peer that does not own it (ignored)`);else for(let[e,n]of Object.entries(t.state))JSON.stringify(n)!==JSON.stringify(t.prevState?.[e])&&(t.trace.writes[e]={at:h,n:(t.trace.writes[e]?.n??0)+1})}if(t.prevState=JSON.parse(JSON.stringify(t.state)),!d&&e.isAuthority()){if(n.startsWith(`on.`)||n.startsWith(`after:`)){t.doc.fired={...t.doc.fired,[n]:[h,t.trace.fired[n].n]};let e=Object.keys(t.doc.fired);e.length>ANe&&delete t.doc.fired[e[0]]}c(t)}o()}return g},f=(e,t)=>{let n=JSON.parse(t);for(let t of Object.keys(e.state))delete e.state[t];Object.assign(e.state,n)},p=(t,n)=>{if(!n)return null;let r={};for(let[i,a]of Object.entries(n)){if(!a||typeof a!=`object`){r[i]=a;continue}let n={};for(let[r,o]of Object.entries(a)){if(typeof o!=`function`){n[r]=o;continue}n[r]=(...n)=>{let a=i+`.`+r;return t.trace.calls[a]={at:e.now(),n:(t.trace.calls[a]?.n??0)+1},o(...n)}}r[i]=n}return r},m=(t,n)=>{let r={id:t.id,get params(){return t.values},get state(){return t.state},kit:p(t,n.kit),object:n.object??null,after(n,r,...i){if(!e.isAuthority())return a(t.name+`: after() is for the authority (a local handler cannot schedule)`),null;let o=e.now()+Math.max(0,Number(n)||0)*1e3,s=`t`+(++t.timerSeq).toString(36)+`-`+(e.me()??`local`);if(typeof r==`string`){if(typeof t.def[r]!=`function`)throw Error(`after: no method "`+r+`"`);if(t.doc.timers.length>=64)throw Error(`after: more than 64 timers pending`);t.doc.timers=[...t.doc.timers,{k:s,at:o,m:r,a:nW(i)??[]}]}else if(typeof r==`function`)t.closures.push({k:s,at:o,fn:r,args:i});else throw Error(`after: give a method name or a function`);return s},cancel(e){if(!e)return!1;let n=t.doc.timers.length+t.closures.length;return t.doc.timers=t.doc.timers.filter(t=>t.k!==e),t.closures=t.closures.filter(t=>t.k!==e),t.doc.timers.length+t.closures.length<n},rand:()=>(t.rng??=tW(eW(t.id)))(),randInt:(e,t)=>
2280Math.floor(r.rand()*(Math.floor(t)-Math.ceil(e)+1))+Math.ceil(e),pick:e=>Array.isArray(e)&&e.length?e[Math.floor(r.rand()*e.length)]:void 0,now:()=>e.now()/1e3,log:(...e)=>console.log(`[behaviour `+t.name+`]`,...e),isAuthority:()=>e.isAuthority(),me:()=>e.me(),findAll:t=>e.findObjects?.(String(t??``))??[],find:e=>r.findAll(e)[0]??null};for(let n of wNe(t.def))r[n]=(...i)=>(t.trace.methods[n]={at:e.now(),n:(t.trace.methods[n]?.n??0)+1},t.depth>0?t.def[n].apply(r,i):d(t,n,t.def[n],i));return r},h=(r,i,a={})=>{let s=YU(i);if(s.length)throw Error(s.join(`; `));let c=t.get(r);c&&g(r);let f={id:r,def:i,name:a.name??r,alive:!0,bornAt:e.now(),synced:!1,params:CNe(i),values:{},state:JU(i),prevState:null,doc:{rev:0,at:0,by:``,started:!1,seq:0,timers:[],fired:{}},lastSent:``,depth:0,localSeq:0,timerSeq:0,rng:null,closures:[],offs:[],errors:[],problems:[],trace:{fired:{},calls:{},writes:{},methods:{}},resetGuard:a.resetGuard??null,ctx:null};for(let[e,t]of Object.entries(f.params))f.values[e]=t.value;f.ctx=m(f,a);let p=c?l(c):n.get(r);n.delete(r),p&&(p.rev>0||p.started)&&u(f,p),f.prevState=nW(f.state),t.set(r,f);let h=e.specs?.()??[];for(let[t,n]of Object.entries(i.on??{})){let r=QU(t,h);if(!r){f.problems.push(`on.`+t+`: no such event`);continue}if(r.name===`start`)continue;let i=`on.`+t;if(r.name===`grabRequest`){let t=a.kit?.rules?.onGrabRequest;if(typeof t!=`function`){f.problems.push(i+`: kit.rules is not available`);continue}f.offs.push(t(t=>d(f,i,n,[ONe(t,e.tagsOf)],{local:!0})));continue}let o=`on`+String(r.event).charAt(0).toUpperCase()+String(r.event).slice(1),s=r.piece?a.kit?.[r.piece]?.[o]:null;if(typeof s!=`function`){f.problems.push(i+`: kit.`+r.piece+` is not available`);continue}f.offs.push(s(t=>{!r.local&&(t&&typeof t.authority==`boolean`?!t.authority:!e.isAuthority())||d(f,i,n,[kNe(t)],{local:r.local})}))}return o(),f},g=e=>{let r=t.get(e);if(!r)return!1;r.alive=!1;for(let e of r.offs)try{e?.()}catch{}return r.offs=[],r.closures=[],(r.doc.rev>0||r.doc.started)&&n.set(e,l(r)),t.delete(e),o(),!0};return{start:h,stop:g,forget:e=>{g(e),n.delete(e)},tick:()=>{let n=e.now();for(let e of[...t.values()])if(e.alive&&s(e)){if(!e.doc.started){e.doc.started=!0;let t=e.def.on?.start;typeof t==`function`?d(e,`on.start`,t,[{}]):c(e)}for(let t=0;t<64;t++){let t=e.doc.timers.filter(e=>e.at<=n).sort((e,t)=>e.at-t.at)[0];if(!t)break;e.doc.timers=e.doc.timers.filter(e=>e!==t);let r=e.def[t.m];typeof r==`function`?d(e,`after:`+t.m,r,t.a??[]):c(e)}for(let t=0;t<64;t++){let t=e.closures.filter(e=>e.at<=n).sort((e,t)=>e.at-t.at)[0];if(!t)break;e.closures=e.closures.filter(e=>e!==t),d(e,`after`,t.fn,t.args??[])}}},receive:e=>{if(!e||e.type!==`bhv`)return!1;i.received++;let r=t.get(String(e.id));return jNe(e,r?r.doc:n.get(String(e.id)))?(r?(u(r,e),r.prevState=nW(r.state)):n.set(String(e.id),nW(e)),o(),!0):(i.stale++,!1)},snapshot:()=>{let e=[];for(let n of t.values())n.doc.rev>0&&e.push(l(n));for(let[r,i]of n)t.has(r)||e.push(nW(i));return e},setParam:(e,n,r)=>{let i=t.get(e);if(!i||!(n in i.params))return!1;let a=i.params[n];if(a.type===`number`){let e=Number(r);if(!Number.isFinite(e))return!1;i.values[n]=e}else a.type===`boolean`?i.values[n]=!!r:i.values[n]=String(r);return o(),!0},live:n=>{let r=t.get(n);return r?{id:n,name:r.name,params:{...r.values},state:nW(r.state),started:r.doc.started,rev:r.doc.rev,timers:r.doc.timers.map(e=>({method:e.m,at:e.at})),closures:r.closures.length,fired:nW(r.trace.fired),calls:nW(r.trace.calls),writes:nW(r.trace.writes),methods:nW(r.trace.methods),errors:r.errors.map(e=>({...e})),problems:[...r.problems],authority:e.isAuthority(),synced:r.synced}:null},stats:i,instances:t,onChange(e){return r.add(e),()=>r.delete(e)},call(e,n,...r){let i=t.get(e);if(i&&typeof i.def[n]==`function`)return d(i,n,i.def[n],r)}}}var rW=`__tpBehaviourScope`;function iW(e){return e?Array.isArray(e)?e.length>=3?[Number(e[0]),Number(e[1]),Number(e[2])]:null:typeof e==`object`?Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)?[e.x,e.y,e.z]:iW(e.pos??e.point??e.position??null):null:null}function NNe(e,t){let n=iW(e),r=iW(t);return!n||!r?NaN:Math.hypot(n[0]-r[0],n[1]-r[1],n[2]-r[2])}var PNe=(e,t,n)=>Math.min(n,Math.max(t,e)),FNe=(e,t,n)=>e+(t-e)*n,INe=0;function LNe(){let e=`b`+ ++INe,t=null,n={behaviour:TNe,kit:new Proxy({},{get(e,n){if(!t)throw Error(`kit is available inside handlers and methods (not at the top of the file)`);return t[n]},has:(e,n)=>!!t&&n in t,ownKeys:()=>t?Reflect.ownKeys(t):[],getOwnPropertyDescriptor:(e,n)=>t&&n in t?{enumerable:!0,configurable:!0,value:t[n]}:void 0}),dist:NNe,clamp:PNe,lerp:FNe,resetGuard:null},r=globalThis;return(r[rW]??={})[e]=n,{token:e,scope:n,bind:e=>{t=e},dispose:()=>{delete r[rW]?.[e]}}}function RNe(e,t,n=``){let r=Cne(String(e??``));if(`error`in r)return{error:`loop guard: `+r.error};let i=`let `+td+`=0; 2281`,a=r.code.startsWith(i)?r.code.slice(i.length):r.code;return{code:n+`const __S=globalThis[`+JSON.stringify(rW)+`][`+JSON.stringify(t)+`];const {behaviour,kit,dist,clamp,lerp}
2281=__S;let `+td+`=0;`+a+` 2282;__S.resetGuard=()=>{`+td+`=0}; 2283`}}async function zNe(e,t,n={}){let r=LNe();try{let i=RNe(e,r.token,n.extraPrologue??``);if(`error`in i)throw Error(i.error);let a=(await t(i.code))?.default;if(!a||typeof a!=`object`)throw Error("the file must `export default behaviour({...})`");return{def:a,scope:r}}catch(e){throw r.dispose(),e}}var BNe=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],aW=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],VNe=`ââ·Ì-ͯÎÒ-ÒÖ-Ö½Ö¿×××× ×Ø-ØÙ-٩ٰÛ-ÛÛ-Û¤Û§Û¨Ûª-ÛÛ°-Û¹Üܰ-ÝÞ¦-Þ°ß-ßß«-߽߳à -à à -à £à ¥-à §à ©-à à¡-à¡à¢-à¢à£-ࣣ࣡-à¤à¤º-़ा-à¥à¥-à¥à¥¢à¥£à¥¦-९à¦-à¦à¦¼à¦¾-à§à§à§à§-à§à§à§¢à§£à§¦-৯৾à¨-à¨à¨¼à¨¾-à©à©à©à©-à©à©à©¦-ੱੵàª-àªàª¼àª¾-à« à«-à«à«-à«à«¢à«£à«¦-૯ૺ-à«¿à¬-à¬à¬¼à¬¾-àààà-àà-àà¢à£à¦-à¯à®à®¾-à¯à¯-à¯à¯-à¯à¯à¯¦-௯à°-à°à°¼à°¾-à±à±-à±à±-à±à±à±à±¢à±£à±¦-౯à²-à²à²¼à²¾-à³à³-à³à³-à³à³à³à³¢à³£à³¦-೯ೳà´-à´à´»à´¼à´¾-àµàµ-àµàµ-àµàµàµ¢àµ£àµ¦-൯à¶-à¶à·à·-à·à·à·-à·à·¦-෯ෲෳัิ-ฺà¹-à¹à¹-à¹àº±àº´-ຼà»-à»à»-à»à¼à¼à¼ -༩༹༵༷༾༿ཱ-à¾à¾à¾à¾-à¾à¾-ྼà¿á«-á¾á-áá-áá-á á¢-á¤á§-áá±-á´á-áá-áá-áá©-á±á-áá²-á´ááá²á³á´-ááá -á©á -á á -á ᢩᤠ-ᤫᤰ-᤻á¥-á¥á§-á§á¨-á¨á©-á©á© -᩿᩼-áªáª-áªáª°-᪽ᪿ-á«á« -á««á¬-á¬á¬´-áá-áá«-á³á®-á®á®¡-á®á®°-᮹᯦-᯳ᰤ-á°·á±-á±á±-á±á³-á³á³-᳨á³á³´á³·-á³¹á·-á·¿âââ¿âââ-ââ¡â¥-â°â³¯-⵿⳱ⷠ-â·¿ãª-ã¯ããã»ê -ê©ê¯ê´-ê½êêê°ê±ê ê ê ê £-ê §ê ¬ê¢ê¢ê¢´-ê£ ê£-ê£ê£ -꣱ꣿ-ê¤ê¤¦-ê¤ê¥-ê¥ê¦-ê¦ê¦³-ê§ê§-ê§ê§¥ê§°-꧹ꨩ-ꨶê©ê©ê©ê©-ê©ê©»-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿ê«ê««-ꫯꫵ꫶ꯣ-ꯪ꯬ê¯ê¯°-꯹ï¬ï¸-ï¸ï¸ -︯︳︴ï¹-ï¹ï¼-ï¼ï¼¿ï½¥`,oW=`ªµºÃ-ÃÃ-öø-ËË-ËË -ˤˬˮͰ-ʹͶͷͺ-ͽͿÎÎ-ÎÎÎ-ΡΣ-ϵϷ-ÒÒ-Ô¯Ô±-ÕÕÕ -Ö×-תׯ-×²Ø -Ùٮٯٱ-ÛÛÛ¥Û¦Û®Û¯Ûº-Û¼Û¿ÜÜ-ܯÝ-Þ¥Þ±ß-ߪߴߵߺà -à à à ¤à ¨à¡-à¡à¡ -ࡪࡰ-à¢à¢-à¢à¢ -à£à¤-हऽà¥à¥-ॡॱ-à¦à¦ -à¦à¦à¦à¦-নপ-রলশ-হঽà§à§à§à§-ৡৰৱৼਠ-à¨à¨à¨à¨-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹà©-à©à©à©²-ੴઠ-àªàª-àªàª-નપ-રલળવ-હઽà«à« ૡૹଠ-à¬à¬à¬à¬-ନପ-ରଲଳଵ-ହଽààà-à¡à±à®à® -à®à®-à®à®-à®à®à®à®à®à®à®£à®¤à®¨-பம-ஹà¯à° -à°à°-à°à°-నప-హఽà±-à±à±à±à± ౡà²à² -à²à²-à²à²-ನಪ-ಳವ-ಹಽà³-à³à³ ೡೱೲà´-à´à´-à´à´-ഺഽàµàµ-àµàµ-ൡൺ-ൿච-à¶à¶-නඳ-රලà·-à·à¸-ะาำà¹-à¹àºàºàºàº-àºàº-ຣລວ-ະາຳຽà»-à»à»à»-à»à¼à½-à½à½-ཬà¾-à¾á-áªá¿á-áá-áá¡á¥á¦á®-á°áµ-ááá -á ááá-áºá¼-áá-áá-ááá-áá -áá-áá-á°á²-áµá¸-á¾áá-á á-áá-áá-áá-áá-áá -áµá¸-á½á-á¬á¯-á¿á-áá -áªá®-á¸á-áá-á±á-áá -á¬á®-á°á-á³ááá -ᡸá¢-ᢨᢪᢰ-ᣵá¤-á¤á¥-á¥á¥°-ᥴá¦-ᦫᦰ-á§á¨-á¨á¨ -á©áª§á¬ -ᬳá -áá®-ᮠᮮᮯᮺ-ᯥá°-á°£á±-á±á±-á±½á²-á²á²-ᲺᲽ-Ჿᳩ-ᳬá
2283³®-ᳳᳵᳶᳺá´-á¶¿á¸-á¼á¼-á¼á¼ -á½
á½-á½á½-á½á½á½á½á½-á½½á¾-á¾´á¾¶-ᾼιá¿-á¿á¿-á¿á¿-á¿á¿-á¿á¿ -Ῥῲ-á¿´á¿¶-ῼâ±â¿â-ââââ-âââ-ââ¤â¦â¨âª-â¹â¼-â¿â
-â
â
â
-ââ°-ⳤⳫ-ⳮⳲⳳâ´-ⴥⴧâ´â´°-ⵧⵯâ¶-â¶â¶ -ⶦⶨ-ⶮⶰ-ⶶⶸ-â¶¾â·-â·â·-â·â·-â·â·-â·ã
-ãã¡-ã©ã±-ãµã¸-ã¼ã-ãã-ãã¡-ãºã¼-ã¿ã
-ã¯ã±-ãã -ã¿ã°-ã¿ã-ä¶¿ä¸-êê-ê½ê-êê-êêªê«ê-ê®ê¿-êê -ê¯ê-êê¢-êê-êê±-ê ê -ê
ê -ê ê -ê ¢ê¡-ꡳê¢-ꢳꣲ-ꣷꣻꣽꣾê¤-ꤥꤰ-ê¥ê¥ -ꥼê¦-ꦲê§ê§ -ꧤꧦ-ꧯꧺ-ê§¾ê¨-ꨨê©-ê©ê©-ê©ê© -ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽê«ê«ê«-ê«ê« -ꫪꫲ-ê«´ê¬-ê¬ê¬-ê¬ê¬-ê¬ê¬ -ꬦꬨ-ꬮꬰ-êê-ê©ê°-ꯢê°-í£í°-íí-í»ï¤-ï©ï©°-ï«ï¬-ï¬ï¬-ï¬ï¬ï¬-ﬨשׁ-זּטּ-לּמּïïïïï-ï®±ï¯-ï´½ïµ-ï¶ï¶-ï·ï·°-ﷻﹰ-ï¹´ï¹¶-ﻼA-Zï½-ï½ï½¦-ï¾¾ï¿-ï¿ï¿-ï¿ï¿-ï¿ï¿-ï¿`,sW={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},cW=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,HNe={5:cW,"5module":cW+` export import`,6:cW+` const class extends export import super`},lW=/^in(stanceof)?$/,UNe=RegExp(`[`+oW+`]`),WNe=RegExp(`[`+oW+VNe+`]`);function uW(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function dW(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&UNe.test(String.fromCharCode(e)):t!==!1&&uW(e,aW)}function fW(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&WNe.test(String.fromCharCode(e)):t===!1?!1:uW(e,aW)||uW(e,BNe)}var pW=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.
2283isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function mW(e,t){return new pW(e,{beforeExpr:!0,binop:t})}var hW={beforeExpr:!0},gW={startsExpr:!0},_W={};function vW(e,t){return t===void 0&&(t={}),t.keyword=e,_W[e]=new pW(e,t)}var yW={num:new pW(`num`,gW),regexp:new pW(`regexp`,gW),string:new pW(`string`,gW),name:new pW(`name`,gW),privateId:new pW(`privateId`,gW),eof:new pW(`eof`),bracketL:new pW(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new pW(`]`),braceL:new pW(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new pW(`}`),parenL:new pW(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new pW(`)`),comma:new pW(`,`,hW),semi:new pW(`;`,hW),colon:new pW(`:`,hW),dot:new pW(`.`),question:new pW(`?`,hW),questionDot:new pW(`?.`),arrow:new pW(`=>`,hW),template:new pW(`template`),invalidTemplate:new pW(`invalidTemplate`),ellipsis:new pW(`...`,hW),backQuote:new pW("`",gW),dollarBraceL:new pW("${",{beforeExpr:!0,startsExpr:!0}),eq:new pW(`=`,{beforeExpr:!0,isAssign:!0}),assign:new pW(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new pW(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new pW(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:mW(`||`,1),logicalAND:mW(`&&`,2),bitwiseOR:mW(`|`,3),bitwiseXOR:mW(`^`,4),bitwiseAND:mW(`&`,5),equality:mW(`==/!=/===/!==`,6),relational:mW(`</>/<=/>=`,7),bitShift:mW(`<</>>/>>>`,8),plusMin:new pW(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:mW(`%`,10),star:mW(`*`,10),slash:mW(`/`,10),starstar:new pW(`**`,{beforeExpr:!0}),coalesce:mW(`??`,1),_break:vW(`break`),_case:vW(`case`,hW),_catch:vW(`catch`),_continue:vW(`continue`),_debugger:vW(`debugger`),_default:vW(`default`,hW),_do:vW(`do`,{isLoop:!0,beforeExpr:!0}),_else:vW(`else`,hW),_finally:vW(`finally`),_for:vW(`for`,{isLoop:!0}),_function:vW(`function`,gW),_if:vW(`if`),_return:vW(`return`,hW),_switch:vW(`switch`),_throw:vW(`throw`,hW),_try:vW(`try`),_var:vW(`var`),_const:vW(`const`),_while:vW(`while`,{isLoop:!0}),_with:vW(`with`),_new:vW(`new`,{beforeExpr:!0,startsExpr:!0}),_this:vW(`this`,gW),_super:vW(`super`,gW),_class:vW(`class`,gW),_extends:vW(`extends`,hW),_export:vW(`export`),_import:vW(`import`,gW),_null:vW(`null`,gW),_true:vW(`true`,gW),_false:vW(`false`,gW),_in:vW(`in`,{beforeExpr:!0,binop:7}),_instanceof:vW(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:vW(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:vW(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:vW(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},bW=/\r\n?|\n|\u2028|\u2029/,GNe=new RegExp(bW.source,`g`);function xW(e){return e===10||e===13||e===8232||e===8233}function SW(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(xW(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var CW=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,wW=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,TW=Object.prototype,KNe=TW.hasOwnProperty,qNe=TW.toString,EW=Object.hasOwn||(function(e,t){return KNe.call(e,t)}),DW=Array.isArray||(function(e){return qNe.call(e)===`[object Array]`}),OW=Object.create(null);function kW(e){return OW[e]||(OW[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function AW(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var JNe=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,jW=function(e,t){this.line=e,this.column=t};jW.prototype.offset=function(e){return new jW(this.line,this.column+e)};var MW=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function NW(e,t){for(var n=1,r=0;;){var i=SW(e,r,t);if(i<0)return new jW(n,t-r);++n,r=i}}var PW={ecmaVersion:null,sourceType:`script`,strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},FW=!1;function YNe(e){var t={};for(var n in PW)t[n]=e&&EW(e,n)?e[n]:PW[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!FW&&typeof console==`object`&&console.warn&&(FW=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. 2284Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),DW(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(DW(t.onComment)&&(t.onComment=XNe(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowA
2284waitOutsideFunction with sourceType: commonjs`);return t}function XNe(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new MW(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var IW=1,LW=2,RW=4,zW=8,BW=16,VW=32,HW=64,UW=128,WW=256,GW=512,KW=1024,qW=IW|LW|WW;function JW(e,t){return LW|(e?RW:0)|(t?zW:0)}var YW=0,XW=1,ZW=2,QW=3,$W=4,eG=5,tG=function(e,t,n){this.options=e=YNe(e),this.sourceFile=e.sourceFile,this.keywords=kW(HNe[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=sW[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=kW(r);var i=(r?r+` `:``)+sW.strict;this.reservedWordsStrict=kW(i),this.reservedWordsStrictBind=kW(i+` `+sW.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=n||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):n?(this.lineStart=this.input.lastIndexOf(` 2285`,n-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(bW).length)):this.lineStart=0,this.type=yW.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?LW:IW),this.regexpState=null,this.privateNameStack=[]},nG={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};tG.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(t)})},nG.inFunction.get=function(){return(this.currentVarScope().flags&LW)>0},nG.inGenerator.get=function(){return(this.currentVarScope().flags&zW)>0},nG.inAsync.get=function(){return(this.currentVarScope().flags&RW)>0},nG.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(WW|GW))return!1;if(t&LW)return(t&RW)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},nG.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&IW)},nG.allowSuper.get=function(){return(this.currentThisScope().flags&HW)>0||this.options.allowSuperOutsideMethod},nG.allowDirectSuper.get=function(){return(this.currentThisScope().flags&UW)>0},nG.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},nG.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(WW|GW)||t&LW&&!(t&BW))return!0}return!1},nG.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&KW||!this.inModule&&e&IW)},nG.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&WW)>0},tG.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},tG.parse=function(e,t){return new this(t,e).parse()},tG.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},tG.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(tG.prototype,nG);var rG=tG.prototype,ZNe=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;rG.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){wW.lastIndex=e,e+=wW.exec(this.input)[0].length;var t=ZNe.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){wW.lastIndex=e+t[0].length;var n=wW.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||bW.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,wW.lastIndex=e,e+=wW.exec(this.input)[0].length,this.input[e]===`;`&&e++}},rG.eat=function(e){return this.type===e&&(this.next(),!0)},rG.isContextual=function(e){return this.type===yW.name&&this.value===e&&!this.containsEsc},rG.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},rG.catchStackOverflow=function(e){try{return e()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,`Not enough stack space to parse input`);else throw e}}
2285,rG.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},rG.canInsertSemicolon=function(){return this.type===yW.eof||this.type===yW.braceR||bW.test(this.input.slice(this.lastTokEnd,this.start))},rG.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},rG.semicolon=function(){!this.eat(yW.semi)&&!this.insertSemicolon()&&this.unexpected()},rG.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},rG.expect=function(e){this.eat(e)||this.unexpected()},rG.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var iG=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};rG.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},rG.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},rG.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},rG.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var aG=tG.prototype;aG.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==yW.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var oG={kind:`loop`},QNe={kind:`switch`};aG.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;wW.lastIndex=this.pos;var t=wW.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(dW(r)){var i=n;do n+=r<=65535?1:2;while(fW(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!lW.test(a))return!0}return!1},aG.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;wW.lastIndex=this.pos;var e=wW.exec(this.input),t=this.pos+e[0].length,n;return!bW.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(fW(n=this.fullCharCodeAt(t+8))||n===92))},aG.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;wW.lastIndex=this.pos;var n=wW.exec(this.input),r=this.pos+n[0].length;if(bW.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||fW(a=this.fullCharCodeAt(i))||a===92)return!1;wW.lastIndex=i;var o=wW.exec(this.input);if(r=i+o[0].length,o&&bW.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!dW(s)&&s!==92)return!1;var c=r;do r+=s<=65535?1:2;while(fW(s=this.fullCharCodeAt(r)));if(s===92)return!0;var l=this.input.slice(c,r);if(lW.test(l))return!1;if(t&&!e&&l===`of`){wW.lastIndex=r;var u=wW.exec(this.input);if(r+=u[0].length,this.input.charCodeAt(r)!==61||(s=this.input.charCodeAt(r+1))===61||s===62)return!1}return!0},aG.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},aG.isUsing=function(e){return this.isUsingKeyword(!1,e)}
2285,aG.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=yW._var,a=`let`),r){case yW._break:case yW._continue:return this.parseBreakContinueStatement(i,r.keyword);case yW._debugger:return this.parseDebuggerStatement(i);case yW._do:return this.parseDoStatement(i);case yW._for:return this.parseForStatement(i);case yW._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case yW._class:return e&&this.unexpected(),this.parseClass(i,!0);case yW._if:return this.parseIfStatement(i);case yW._return:return this.parseReturnStatement(i);case yW._switch:return this.parseSwitchStatement(i);case yW._throw:return this.parseThrowStatement(i);case yW._try:return this.parseTryStatement(i);case yW._const:case yW._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case yW._while:return this.parseWhileStatement(i);case yW._with:return this.parseWithStatement(i);case yW.braceL:return this.parseBlock(!0,i);case yW.semi:return this.parseEmptyStatement(i);case yW._export:case yW._import:if(this.options.ecmaVersion>10&&r===yW._import){wW.lastIndex=this.pos;var o=wW.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===yW._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,`Using declaration is not allowed in single-statement positions`),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===yW.name&&d.type===`Identifier`&&this.eat(yW.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},aG.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(yW.semi)||this.insertSemicolon()?e.label=null:this.type===yW.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},aG.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},aG.parseDoStatement=function(e){return this.next(),this.labels.push(oG),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(yW._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(yW.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},aG.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(oG),this.enterScope(0),this.expect(yW.parenL),this.type===yW.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===yW._var||this.type===yW._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`V
2285ariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new iG,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===yW._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===yW._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},aG.parseForAfterInit=function(e,t,n){return(this.type===yW._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.type===yW._in?((t.kind===`using`||t.kind===`await using`)&&!t.declarations[0].init&&this.raise(this.start,`Using declaration is not allowed in for-in loops`),this.options.ecmaVersion>=9&&n>-1&&this.unexpected(n)):this.options.ecmaVersion>=9&&(e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},aG.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,sG|(n?0:cG),!1,t)},aG.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(yW._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},aG.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(yW.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},aG.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(yW.braceL),this.labels.push(QNe),this.enterScope(KW);for(var t,n=!1;this.type!==yW.braceR;)if(this.type===yW._case||this.type===yW._default){var r=this.type===yW._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(yW.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},aG.parseThrowStatement=function(e){return this.next(),bW.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var $Ne=[];aG.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?VW:0),this.checkLValPattern(e,t?$W:ZW),this.expect(yW.parenR),e},aG.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===yW._catch){var t=this.startNode();this.next(),this.eat(yW.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(yW._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},aG.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},aG.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(oG),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},aG.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},aG.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},aG.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);
vendor: 7,067 bytes, line 2285
2285for(var o=this.type.isLoop?`loop`:this.type===yW._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},aG.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},aG.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(yW.braceL),e&&this.enterScope(0);this.type!==yW.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},aG.parseFor=function(e,t){return e.init=t,this.expect(yW.semi),e.test=this.type===yW.semi?null:this.parseExpression(),this.expect(yW.semi),e.update=this.type===yW.parenR?null:this.parseExpression(),this.expect(yW.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},aG.parseForIn=function(e,t){var n=this.type===yW._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(yW.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},aG.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(yW.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===yW._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==yW._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&(!t||this.type!==yW._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(yW.comma))break}return e},aG.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?XW:ZW,!1)};var sG=1,cG=2,lG=4;aG.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===yW.star&&t&cG&&this.unexpected(),e.generator=this.eat(yW.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&sG&&(e.id=t&lG&&this.type!==yW.name?null:this.parseIdent(),e.id&&!(t&cG)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?XW:ZW:QW));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(JW(e.async,e.generator)),t&sG||(e.id=this.type===yW.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&sG?`FunctionDeclaration`:`FunctionExpression`)},aG.parseFunctionParams=function(e){this.expect(yW.parenL),e.params=this.parseBindingList(yW.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},aG.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(yW.braceL);this.type!==yW.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&ePe(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},aG.parseClassElement=function(e){if(this.eat(yW.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(yW.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===yW.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===yW.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(yW.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===yW.parenL||o!==`method`||i||a){var l=!n.static&&uG(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},aG.isClassElementNameStart=function(){return this.type===yW.name||this.type===yW.privateId||this.type===yW.num||this.type===yW.string||this.type===yW.bracketL||this.type.keyword},aG.parseClassElementName=function(e){this.type===yW.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},aG.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&uG(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},aG.parseClassField=function(e){return uG(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&uG(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(yW.eq)?(this.enterScope(GW|HW),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},aG.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(WW|HW);this.type!==yW.braceR;
2285){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},aG.parseClassId=function(e,t){this.type===yW.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ZW,!1)):(t===!0&&this.unexpected(),e.id=null)},aG.parseClassSuper=function(e){e.superClass=this.eat(yW._extends)?this.parseExprSubscripts(null,!1):null},aG.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},aG.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];EW(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function ePe(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function uG(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}aG.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==yW.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},aG.parseExport=function(e,t){if(this.next(),this.eat(yW.star))return this.parseExportAllDeclaration(e,t);if(this.eat(yW._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==yW.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},aG.parseExportDeclaration=function(e){return this.parseStatement(null)},aG.parseExportDefaultDeclaration=function(){var e;if(this.type===yW._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,sG|lG,!1,e)}if(this.type===yW._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}var r=this.parseMaybeAssign();return this.semicolon(),r},aG.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),EW(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},aG.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},aG.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},aG.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},aG.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exp
2285orted.start),this.finishNode(t,`ExportSpecifier`)},aG.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(yW.braceL);!this.eat(yW.braceR);){if(n)n=!1;else if(this.expect(yW.comma),this.afterTrailingComma(yW.braceR))break;t.push(this.parseExportSpecifier(e))}return t},aG.parseImport=function(e){return this.next(),this.type===yW.string?(e.specifiers=$Ne,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===yW.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},aG.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ZW),this.finishNode(e,`ImportSpecifier`)},aG.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ZW),this.finishNode(e,`ImportDefaultSpecifier`)},aG.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,ZW),this.finishNode(e,`ImportNamespaceSpecifier`)},aG.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===yW.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(yW.comma)))return e;if(this.type===yW.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(yW.braceL);!this.eat(yW.braceR);){if(t)t=!1;else if(this.expect(yW.comma),this.afterTrailingComma(yW.braceR))break;e.push(this.parseImportSpecifier())}return e},aG.parseWithClause=function(){var e=[];if(!this.eat(yW._with))return e;this.expect(yW.braceL);for(var t={},n=!0;!this.eat(yW.braceR);){if(n)n=!1;else if(this.expect(yW.comma),this.afterTrailingComma(yW.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;EW(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},aG.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===yW.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(yW.colon),this.type!==yW.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},aG.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===yW.string){var e=this.parseLiteral(this.value);return JNe.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},aG.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},aG.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var dG=tG.prototype;dG.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},dG.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},dG.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},dG.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==yW.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},dG.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case yW.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(yW.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case yW.braceL:return this.parseObj(!0)}return this.parseIdent()},dG.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(yW.comma),t&&this.type===yW.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;
2285else if(this.type===yW.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===yW.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},dG.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},dG.parseBindingListItem=function(e){return e},dG.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(yW.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},dG.checkLValSimple=function(e,t,n){t===void 0&&(t=YW);var r=t!==YW;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===ZW&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(EW(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==eG&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},dG.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=YW),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},dG.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=YW),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var fG=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},pG={b_stat:new fG(`{`,!1),b_expr:new fG(`{`,!0),b_tmpl:new fG("${",!1),p_stat:new fG(`(`,!1),p_expr:new fG(`(`,!0),q_tmpl:new fG("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new fG(`function`,!1),f_expr:new fG(`function`,!0),f_expr_gen:new fG(`function`,!0,!1,null,!0),f_gen:new fG(`function`,!1,!1,null,!0)},mG=tG.prototype;mG.initialContext=function(){return[pG.b_stat]},mG.curContext=function(){return this.context[this.context.length-1]},mG.braceIsBlock=function(e){var t=this.curContext();return t===pG.f_expr||t===pG.f_stat?!0:e===yW.colon&&(t===pG.b_stat||t===pG.b_expr)?!t.isExpr:e===yW._return||e===yW.name&&this.exprAllowed?bW.test(this.input.slice(this.lastTokEnd,this.start)):e===yW._else||e===yW.semi||e===yW.eof||e===yW.parenR||e===yW.arrow?!0:e===yW.braceL?t===pG.b_stat:e===yW._var||e===yW._const||e===yW.name?!1:!this.exprAllowed},mG.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},mG.updateContext=function(e){var t,n=this.type;n.keyword&&e===yW.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},mG.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},yW.parenR.updateContext=yW.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===pG.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},yW.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?pG.b_stat:pG.b_expr),this.exprAllowed=!0},yW.dollarBraceL.updateContext=function(){this.context.push(pG.b_tmpl),this.exprAllowed=!0},yW.parenL.updateContext=function(e){var t=e===yW._if||e===yW._for||e===yW._with||e===yW._while;this.context.push(t?pG.p_stat:pG.p_expr),this.exprAllowed=!0},yW.incDec.updateContext=function(){},yW._function.updateContext=yW._class.updateContext=function(e){e.beforeExpr&&e!==yW._else&&(e!==yW.semi||this.curContext()===pG.p_stat)&&!(e===yW._return&&bW.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==yW.colon&&e!==yW.braceL||this.curContext()!==pG.b_stat)?this.context.push(pG.f_expr):this.context.push(pG.f_stat),this.exprAllowed=!1},yW.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},yW.backQuote.updateContext=function(){this.curContext()===pG.q_tmpl?this.context.pop():this.context.push(pG.q_tmpl),this.exprAllowed=!1},yW.star.updateContext=function(e){if(e===yW._function){var t=this.context.length-1;this.context[t]===pG.f_expr?this.context[t]=pG.f_expr_gen:this.context[t]=pG.f_gen}this.exprAllowed=!0},yW.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==yW.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var hG=tG.prototype;hG.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},hG.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var r=n.start,i=n.startLoc,a=n.parseMaybeAssign(e,t);if(n.type===yW.comma){var o=n.startNodeAt(r,i);for(o.expressions=[a];n.eat(yW.comma);)o.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(o,`SequenceExpression`)}return a})},hG.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new iG,r=!0);var s=this.start,c=this.startLoc;(this.type===yW.parenL||this.type===yW.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===yW.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===yW.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},hG.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if((i.type!==`ArrowFunctionExpression`||i.start!==n)&&this.eat(yW.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(yW.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},hG.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},hG.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==yW._in)&&a>r){var o=this.type===yW.logicalOR||this.type===yW.logicalAND,s=this.type===yW.coalesce;s&&(a=yW.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);
2285return(o&&this.type===yW.coalesce||s&&(this.type===yW.logicalOR||this.type===yW.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},hG.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},hG.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===yW.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&gG(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&_G(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===yW.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==yW._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&(o.type!==`ArrowFunctionExpression`||o.start!==i)&&this.eat(yW.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function gG(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&gG(e.expression)}function _G(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&_G(e.expression)||e.type===`ParenthesizedExpression`&&_G(e.expression)}hG.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},hG.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},hG.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(yW.arrow)},hG.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},hG.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(yW.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(yW.bracketL);if(l||c&&this.type!==yW.parenL&&this.type!==yW.backQuote||this.eat(yW.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(yW.bracketR)):u.property=this.type===yW.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(yW.parenL)){var d=new iG,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(yW.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}
vendor: 5,119 bytes, line 2285
2285else if(this.type===yW.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},hG.parseExprAtom=function(e,t,n){this.type===yW.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case yW._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===yW.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==yW.dot&&this.type!==yW.bracketL&&this.type!==yW.parenL&&this.unexpected(),this.finishNode(r,`Super`);case yW._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case yW.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(yW._function))return this.overrideContext(pG.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(yW.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===yW.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(yW.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case yW.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case yW.num:case yW.string:return this.parseLiteral(this.value);case yW._null:case yW._true:case yW._false:return r=this.startNode(),r.value=this.type===yW._null?null:this.type===yW._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case yW.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case yW.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(yW.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case yW.braceL:return this.overrideContext(pG.b_expr),this.parseObj(!1,e);case yW._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case yW._class:return this.parseClass(this.startNode(),!1);case yW._new:return this.parseNew();case yW.backQuote:return this.parseTemplate();case yW._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},hG.parseExprAtomDefault=function(){this.unexpected()},hG.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===yW.parenL&&!e)return this.parseDynamicImport(t);if(this.type===yW.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}this.unexpected()},hG.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(yW.parenR)?e.options=null:(this.expect(yW.comma),this.afterTrailingComma(yW.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(yW.parenR)||(this.expect(yW.comma),this.afterTrailingComma(yW.parenR)||this.unexpected())));else if(!this.eat(yW.parenR)){var t=this.start;this.eat(yW.comma)&&this.eat(yW.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},hG.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},hG.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},hG.parseParenExpression=function(){this.expect(yW.parenL);var e=this.parseExpression();return this.expect(yW.parenR),e},hG.shouldParseArrow=function(e){return!this.canInsertSemicolon()},hG.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new iG,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==yW.parenR;){if(l?l=!1:this.expect(yW.comma),a&&this.afterTrailingComma(yW.parenR,!0)){u=!0;break}
vendor: 8,271 bytes, lines 2285-2287
2285if(this.type===yW.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===yW.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(yW.parenR),e&&this.shouldParseArrow(c)&&this.eat(yW.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},hG.parseParenItem=function(e){return e},hG.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var tPe=[];hG.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===yW.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.callee.type===`Super`&&this.raiseRecoverable(r,`Invalid use of 'super'`),e.arguments=this.eat(yW.parenL)?this.parseExprList(yW.parenR,this.options.ecmaVersion>=8,!1):tPe,this.finishNode(e,`NewExpression`)},hG.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===yW.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,` 2286`),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` 2287`),cooked:this.value},this.next(),n.tail=this.type===yW.backQuote,this.finishNode(n,`TemplateElement`)},hG.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===yW.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(yW.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(yW.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},hG.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===yW.name||this.type===yW.num||this.type===yW.string||this.type===yW.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===yW.star)&&!bW.test(this.input.slice(this.lastTokEnd,this.start))},hG.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(yW.braceR);){if(r)r=!1;else if(this.expect(yW.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(yW.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},hG.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(yW.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===yW.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===yW.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(yW.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(yW.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},hG.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},hG.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===yW.colon&&this.unexpected(),this.eat(yW.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===yW.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==yW.comma&&this.type!==yW.braceR&&this.type!==yW.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===yW.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},hG.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(yW.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(yW.bracketR),e.key;e.computed=!1}return e.key=this.type===yW.num||this.type===yW.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},hG.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},hG.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(JW(t,r.generator)|HW|(n?UW:0)),this.expect(yW.parenL),r.params=this.parseBindingList(yW.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},hG.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(JW(n,!1)|BW),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},hG.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==yW.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,eG),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}
2287this.exitScope()},hG.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},hG.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,XW,t?null:n)}},hG.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(yW.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===yW.comma?o=null:this.type===yW.ellipsis?(o=this.parseSpread(r),r&&this.type===yW.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},hG.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&qW)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},hG.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},hG.parseIdentNode=function(){var e=this.startNode();return this.type===yW.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name===`class`||e.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=yW.name):this.unexpected(),e},hG.parsePrivateIdent=function(){var e=this.startNode();return this.type===yW.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},hG.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===yW.semi||this.canInsertSemicolon()||this.type!==yW.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(yW.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},hG.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var vG=tG.prototype;vG.raise=function(e,t){var n=NW(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},vG.raiseRecoverable=vG.raise,vG.curPosition=function(){if(this.options.locations)return new jW(this.curLine,this.pos-this.lineStart)};var yG=tG.prototype,nPe=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};yG.enterScope=function(e){this.scopeStack.push(new nPe(e))},yG.exitScope=function(){this.scopeStack.pop()},yG.treatFunctionsAsVarInScope=function(e){return e.flags&LW||!this.inModule&&e.flags&IW},yG.declareName=function(e,t,n){var r=!1;if(t===ZW){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&IW&&delete this.undefinedExports[e]}else if(t===$W)this.currentScope().lexical.push(e);else if(t===QW){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&VW&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&IW&&delete this.undefinedExports[e],s.flags&qW)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},yG.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},yG.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},yG.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(qW|GW|WW))return t}},yG.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(qW|GW|WW)&&!(t.flags&BW))return t}};var bG=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new MW(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},xG=tG.prototype;xG.startNode=function(){return new bG(this,this.start,this.startLoc)},xG.startNodeAt=function(e,t){return new bG(this,e,t)};function SG(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}xG.finishNode=function(e,t){return SG.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},xG.finishNodeAt=function(e,t,n,r){return SG.call(this,e,t,n,r)},xG.copyNode=function(e){var t=new bG(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var rPe=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,CG=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE L
2287owercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,wG=CG+` Extended_Pictographic`,TG=wG,EG=TG+` EBase EComp EMod EPres ExtPict`,DG=EG,iPe={9:CG,10:wG,11:TG,12:EG,13:DG,14:DG},aPe={9:``,10:``,11:``,12:``,13:``,14:`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`},OG=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,kG=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,AG=kG+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,jG=AG+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,MG=jG+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,NG=MG+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,oPe={9:kG,10:AG,11:jG,12:MG,13:NG,14:NG+` `+rPe},PG={};function sPe(e){var t=PG[e]={binary:kW(iPe[e]+` `+OG),binaryOfStrings:kW(aPe[e]),nonBinary:{General_Category:kW(OG),Script:kW(oPe[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var FG=0,IG=[9,10,11,12,13,14];FG<IG.length;FG+=1){var cPe=IG[FG];
2287sPe(cPe)}var LG=tG.prototype,RG=function(e,t){this.parent=e,this.base=t||this};RG.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},RG.prototype.sibling=function(){return new RG(this.parent,this.base)};var zG=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=PG[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};zG.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},zG.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},zG.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},zG.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},zG.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},zG.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},zG.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},zG.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},zG.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},LG.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function lPe(e){for(var t in e)return!0;return!1}LG.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&lPe(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},LG.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},LG.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new RG(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},LG.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},LG.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},LG.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;
2287if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},LG.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},LG.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},LG.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},LG.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},LG.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},LG.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},LG.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},LG.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&uPe(n);)t+=AW(n),e.advance();return t};function uPe(e){return e===105||e===109||e===115}LG.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},LG.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},LG.regexp_eatSyntaxCharacter=function(e){var t=e.current();return BG(t)?(e.lastIntValue=t,e.advance(),!0):!1};function BG(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}LG.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!BG(n);)e.advance();return e.pos!==t},LG.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},LG.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n){if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`)}t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},LG.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},LG.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=AW(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=AW(e.lastIntValue);return!0}return!1},LG.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),dPe(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function dPe(e){return dW(e,!0)||e===36||e===95}LG.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),fPe(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function fPe(e){return fW(e,!0)||e===36||e===95||e===8204||e===8205}
2287LG.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},LG.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},LG.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},LG.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},LG.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},LG.regexp_eatZero=function(e){return e.current()===48&&!KG(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},LG.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},LG.regexp_eatControlLetter=function(e){var t=e.current();return VG(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function VG(e){return e>=65&&e<=90||e>=97&&e<=122}LG.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&pPe(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function pPe(e){return e>=0&&e<=1114111}LG.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},LG.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var HG=0,UG=1,WG=2;LG.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(mPe(t))return e.lastIntValue=-1,e.advance(),UG;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===WG&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return HG};function mPe(e){return e===100||e===68||e===115||e===83||e===119||e===87}LG.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),UG}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return HG},LG.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){EW(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},LG.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return UG;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return WG;e.raise(`Invalid property name`)},LG.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;GG(t=e.current());)e.lastStringValue+=AW(t),e.advance();return e.lastStringValue!==``};function GG(e){return VG(e)||e===95}LG.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;hPe(t=e.current());)e.lastStringValue+=AW(t),e.advance();return e.lastStringValue!==``};function hPe(e){return GG(e)||KG(e)}LG.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)}
2287,LG.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===WG&&e.raise(`Negated character class may contain strings`),!0}return!1},LG.regexp_classContents=function(e){return e.current()===93?UG:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),UG)},LG.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},LG.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||YG(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},LG.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},LG.regexp_classSetExpression=function(e){var t=UG,n;if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e)){n===WG&&(t=WG);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==WG&&(t=UG);continue}e.raise(`Invalid character in character class`)}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`)}for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===WG&&(t=WG)}},LG.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},LG.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?UG:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},LG.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===WG&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},LG.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},LG.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===WG&&(t=WG);return t},LG.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?UG:WG},LG.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&gPe(n)||_Pe(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function gPe(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function _Pe(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}LG.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return vPe(t)?(e.lastIntValue=t,e.advance(),!0):!1};function vPe(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}LG.regexp_eatClassControlLetter=function(e){var t=e.current();return KG(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},LG.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},LG.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;KG(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function KG(e){return e>=48&&e<=57}LG.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;qG(n=e.current());)e.lastIntValue=16*e.lastIntValue+JG(n),e.advance();return e.pos!==t};function qG(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function JG(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}LG.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},LG.regexp_eatOctalDigit=function(e){var t=e.current();return YG(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function YG(e){return e>=48&&e<=55}LG.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!qG(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+JG(i),e.advance()}return!0};var XG=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new MW(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},ZG=tG.prototype;ZG.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.t
2287ype.keyword),this.options.onToken&&this.options.onToken(new XG(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},ZG.getToken=function(){return this.next(),new XG(this)},typeof Symbol<`u`&&(ZG[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===yW.eof,value:t}}}}),ZG.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(yW.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},ZG.readToken=function(e){return dW(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},ZG.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},ZG.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},ZG.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=SW(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},ZG.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!xW(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},ZG.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&CW.test(String.fromCharCode(e)))++this.pos;else break loop}}},ZG.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},ZG.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(yW.ellipsis)):(++this.pos,this.finishToken(yW.dot))},ZG.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(yW.assign,2):this.finishOp(yW.slash,1)},ZG.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?yW.star:yW.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=yW.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(yW.assign,n+1):this.finishOp(r,n)},ZG.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(yW.assign,3):this.finishOp(e===124?yW.logicalOR:yW.logicalAND,2):t===61?this.finishOp(yW.assign,2):this.finishOp(e===124?yW.bitwiseOR:yW.bitwiseAND,1)},ZG.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(yW.assign,2):this.finishOp(yW.bitwiseXOR,1)},ZG.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||bW.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(yW.incDec,2):t===61?this.finishOp(yW.assign,2):this.finishOp(yW.plusMin,1)},ZG.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(yW.assign,n+1):this.finishOp(yW.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(yW.relational,n))},ZG.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(yW.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(yW.arrow)):this.finishOp(e===61?yW.eq:yW.prefix,1)},ZG.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);
2287if(n<48||n>57)return this.finishOp(yW.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(yW.assign,3):this.finishOp(yW.coalesce,2)}return this.finishOp(yW.question,1)},ZG.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),dW(t,!0)||t===92))return this.finishToken(yW.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+AW(t)+`'`)},ZG.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(yW.parenL);case 41:return++this.pos,this.finishToken(yW.parenR);case 59:return++this.pos,this.finishToken(yW.semi);case 44:return++this.pos,this.finishToken(yW.comma);case 91:return++this.pos,this.finishToken(yW.bracketL);case 93:return++this.pos,this.finishToken(yW.bracketR);case 123:return++this.pos,this.finishToken(yW.braceL);case 125:return++this.pos,this.finishToken(yW.braceR);case 58:return++this.pos,this.finishToken(yW.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(yW.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(yW.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+AW(e)+`'`)},ZG.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},ZG.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(bW.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new zG(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(yW.regexp,{pattern:i,flags:o,value:c})},ZG.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95){i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;continue}if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function yPe(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function QG(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}ZG.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=QG(this.input.slice(t,this.pos)),++this.pos):dW(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(yW.num,n)},ZG.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=QG(this.input.slice(t,this.pos));return++this.pos,dW(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(yW.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),dW(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=yPe(this.input.slice(t,this.pos),n);return this.finishToken(yW.num,a)},ZG.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},ZG.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(xW(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(yW.string,t)};var $G={};ZG.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}
2287catch(e){if(e===$G)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},ZG.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw $G;this.raise(e,t)},ZG.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===yW.template||this.type===yW.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(yW.dollarBraceL)):(++this.pos,this.finishToken(yW.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(yW.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(xW(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=` 2288`;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},ZG.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(yW.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===` 2289`&&++this.pos;case` 2290`:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},ZG.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return` 2291`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return AW(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return xW(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},ZG.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},ZG.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(fW(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?dW:fW)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=AW(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},ZG.readWord=function(){var e=this.readWord1(),t=yW.name;return this.keywords.test(e)&&(t=_W[e]),this.finishToken(t,e)},tG.acorn={Parser:tG,version:`8.18.0`,defaultOptions:PW,Position:jW,SourceLocation:MW,getLineInfo:NW,Node:bG,TokenType:pW,tokTypes:yW,keywordTypes:_W,TokContext:fG,tokContexts:pG,isIdentifierChar:fW,isIdentifierStart:dW,Token:XG,isNewLine:xW,lineBreak:bW,lineBreakG:GNe,nonASCIIwhitespace:CW};function bPe(e,t){return tG.parse(e,t)}var eK={"Math.random":`use this.rand() (seeded, the same on every replay)`,"Date.now":`use this.now() (the session clock)`,"performance.now":`use this.now() (the session clock)`,Date:`use this.now() (the session clock)`,localStorage:`behaviour state replicates through this.state; device data is api.storage in a module`,sessionStorage:`use this.state`,indexedDB:`use this.state`,document:`a behaviour has no DOM (use the kit or a module)`,window:`a behaviour has no DOM (use the kit or a module)`,globalThis:`a behaviour reaches only its own scope`,fetch:`a behaviour does not use the network`,XMLHttpRequest:`a behaviour does not use the network`,WebSocket:`a behaviour does not use the network`,eval:`no eval`,Function:`no Function constructor`,setTimeout:`use this.after(seconds, "method")`,setInterval:`use this.after(seconds, "method") again from the method`,requestAnimationFrame:`use this.after`},tK=e=>e&&typeof e==`object`&&typeof e.type==`string`;function nK(e,t,n=null,r=``){if(tK(e)&&t(e,n,r)!==!1)for(let n of Object.keys(e)){if(n===`loc`||n===`start`||n===`end`||n===`range`)continue;let r=e[n];if(Array.isArray(r))for(let i of r)tK(i)&&nK(i,t,e,n);else tK(r)&&nK(r,t,e,n)}}function rK(e){return!e||e.computed?null:e.key?.type===`Identifier`?e.key.name:e.key?.type===`Literal`?String(e.key.value):null}function iK(e){if(e){if(e.type===`Literal`&&(typeof e.value==`number`||typeof e.value==`boolean`||typeof e.value==`string`))return e.value;if(e.type===`UnaryExpression`&&e.operator===`-`&&e.argument?.type===`Literal`&&typeof e.argument.value==`number`)return-e.argument.value;if(e.type===`TemplateLiteral`&&e.expressions.length===0)return e.quasis[0]?.value?.cooked??``}}function aK(e){let t=[],n=e;for(;n?.type===`MemberExpression`;){if(n.computed){if(n.property?.type===`Literal`&&typeof n.property.value==`string`)t.unshift(n.property.value);else return null}else t.unshift(n.property.name);n=n.object}if(n?.type===`ThisExpression`)t.unshift(`this`);else if(n?.type===`Identifier`)t.unshift(n.name);else return null;return t}function xPe(e){let t={};for(let n of e.body)if(n.type===`VariableDeclaration`)for(let e of n.declarations)e.id?.type===`Identifier`&&e.init&&(t[e.id.name]=e.init);let n=e=>(e?.type===`Identifier`&&t[e.name]&&(e=t[e.name]),e?.type===`CallExpression`&&e.callee?.type===`Identifier`&&e.callee.name===`behaviour`&&e.arguments[0]?.type===`ObjectExpression`?e.arguments[0]:null);for(let t of e.body)if(t.type===`ExportDefaultDeclaration`)return n(t.declaration);return null}function oK(e){let t=e?.value;return t&&(t.type===`FunctionExpression`||t.type===`ArrowFunctionExpression`)?t:null}function sK(e,t,n){let r={params:new Set,state:new Set},i=new Set,a=new Set,o=[],s=new Map,c=new Set,l=new Set,u=!1,d=e.params?.[0],f=new Set;if(d?.type===`ObjectPattern`)for(let e of d.properties){let t=rK(e);t&&(l.add(t),f.add(e.value?.type===`Identifier`?e.value.name:t))}let p=new Set;nK(e.body,e=>{if(e.type===`VariableDeclarator`&&e.init){let t=aK(e.init);if(t&&t[0]===`this`&&t[1]===`params`&&t.length===2){if(e.id.type===`ObjectPattern`)for(let t of e.id.properties)rK(t)&&r.params.add(rK(t));else e.id.type===`Identifier`&&p.add(e.id.name)}if(t&&t[0]===`this`&&t[1]===`state`&&t.length===2&&e.id.type===`ObjectPattern`)for(let t of e.id.properties)rK(t)&&r.state.add(rK(t))}});let m=(e,n)=>{let r=e[0]===`this`?2:1,i=e[r],a=e[r+1];if(!i||!a)return;let o=t.find(e=>e.piece===i)?.calls.find(e=>e.name===a||`on`+e.name.charAt(0).toUpperCase()+e.name.slice(1)===a),c=i+`.`+a;s.has(c)||s.set(c,{piece:i,call:a,type:o?`kit-`+i+`-`+o.name:null,label:o?o.label:`kit.`+c,kind:o?o.kind:`code`,line:n.loc?.start.line??0})};return nK(e.body,(e,t,s)=>{if(e.type===`MemberExpression`){let n=aK(e);if(!n)return;n[0]===`this`&&n[1]===`params`&&n[2]&&r.params.add(n[2]),p.has(n[0])&&n[1]&&r.params.add(n[1]),n[0]===`this`&&n[1]===`state`&&n[2]&&n.length===3&&(t?.type===`AssignmentExpression`&&s===`left`||t?.type===`UpdateExpression`&&s===`argument`||t?.type===`UnaryExpression`&&t.operator===`delete`?(i.add(n[2]),(t.type===`UpdateExpression`||t.type===`AssignmentExpression`&&t.operator!==`=`)&&r.state.add(n[2])):r.state.add(n[2])),n[0]===`this`&&n[1]===`state`&&n[2]&&n.length>=4&&t?.type===`CallExpression`&&s===`callee`&&i.add(n[2]);return}if(e.type===`CallExpression`){let t=aK(e.callee);if(!t){e.callee?.type===`Identifier`&&f.has(e.callee.name)&&c.add(e.callee.name);return}if(t.length===1&&f.has(t[0])&&c.add(t[0]),t[0]===`this`&&t.length===2){if(t[1]===`after`){let t=e.arguments[1],r=e.arguments[0],i=[];nK(r,e=>{let t=e.type===`MemberExpression`?aK(e):null;t&&t[0]===`this`&&t[1]===`params`&&t[2]&&i.push(t[2]),t&&p.has(t[0])&&t[1]&&i.push(t[1])});let s=null;t?.type===`Literal`&&typeof t.value==`string`?s=t.value:(t?.type===`ArrowFunctionExpression`||t?.type===`FunctionExpression`)&&nK(t.body,e=>{if(e.type===`CallExpression`){let t=aK(e.callee);t&&t[0]===`this`&&t.length===2&&n.includes(t[1])&&(s??=t[1])}}),o.push({method:s,params:i,line:e.loc?.start.line??0}),s&&a.add(s)}else t[1]===`rand`||t[1]===`randInt`||t[1]===`pick`?u=!0:n.includes(t[1])&&a.add(t[1])}(t[0]===`this`&&t[1]===`kit`&&t.length>=4||t[0]===`kit`&&t.length>=3)&&m(t,e)}}),{reads:{params:[...r.params],state:[...r.state]},writes:[...i],calls:[...a],timers:o,kit:[...s.values()],actions:[...c],payload:[...l],random:u}}function SPe(e,t){let n=new Set;nK(e,e=>{e.type===`VariableDeclarator`&&e.id?.type===`Identifier`&&n.add(e.id.name),(e.type===`FunctionDeclaration`||e.type===`FunctionExpression`)&&e.id&&n.add(e.id.name);for(let t of e.params??[])t.type===`Identifier`&&n.add(t.name)});let r=(e,n,r=`error`)=>t.push({message:n,line:e.loc?.start.line??0,col:(e.loc?.start.column??0)+1,level:r});nK(e,(e,t,i)=>{if((e.type===`ImportDeclaration`||e.type===`ImportExpression`)&&r(e,`a behaviour is one self-contained file: no import`),e.type===`MemberExpression`){let t=aK(e);if(t&&t.length===2){let i=t.join(`.`),a=eK[i];a&&!n.has(t[0])&&r(e,i+` â `+a)}}if(e.type===`Identifier`){let a=t?.type===`MemberExpression`&&i===`property`&&!t.computed,o=(t?.type===`Property`||t?.type===`MethodDefinition`)&&i===`key`&&!t.computed,s=t?.type===`MemberExpression`&&i===`object`;if(a||o||n.has(e.name))return;let c=eK[e.name];if(!c||s&&(e.name===`Date`||e.name===`performance`))return;r(e,e.name+` â `+c)}if(e.type===`WhileStatement`&&iK(e.test)===!0){let t=!1;nK(e.body,e=>{(e.type===`BreakStatement`||e.type===`ReturnStatement`||e.type===`ThrowStatement`)&&(t=!0)}),t||r(e,`while (true) with no break never ends (the loop guard will stop it)`,`warning`)}})}function cK(e,t=[]){let n=[],r=[],i;try{i=bPe(String(e??``),{ecmaVersion:`latest`,sourceType:`module`,locations:!0})}catch(e){let t=e;return{ok:!1,errors:[{message:String(t.message??t),line:t.loc?.line??0,col:(t.loc?.column??0)+1,level:`error`}],lint:[],params:[],state:[],handlers:[],methods:[]}}SPe(i,r);let a=xPe(i);a||n.push({message:"no `export default behaviour({...})` found",line:1,col:1,level:`error`});let o=[],s=[],c=[],l=[],u=``;if(a){let i=[];for(let e of a.properties){let t=rK(e);t&&!GU.includes(t)&&oK(e)&&i.push(t)}for(let d of a.properties){let a=rK(d);if(!a)continue;let f=d.loc?.start.line??0;if(a===`name`)u=String(iK(d.value)??``);else if(a===`params`&&d.value?.type===`ObjectExpression`)for(let e of d.value.properties){let t=rK(e);if(!t)continue;let n=e.value,r={};if(e.value?.type===`ObjectExpression`){n=null;for(let t of e.value.properties){let e=rK(t);e===`value`?n=t.value:e&&(r[e]=iK(t.value))}}let i=iK(n);o.push({key:t,value:i,type:typeof i==`number`?`number`:typeof i==`boolean`?`boolean`:typeof i==`string`?`string`:`opaque`,range:n&&i!==void 0?[n.start,n.end]:null,...r,line:e.loc?.start.line??f})}else if(a===`state`&&d.value?.type===`ObjectExpression`)for(let t of d.value.properties){let n=rK(t);n&&s.push({key:n,init:iK(t.value)??String(e).slice(t.value.start,t.value.end),line:t.loc?.start.line??f})}else if(a===`on`&&d.value?.type===`ObjectExpression`)for(let e of d.value.properties){let n=rK(e),a=oK(e);if(!n||!a)continue;let o=QU(n,t);o||r.push({message:`on.`+n+`: no such event (it will never fire)`,line:e.loc?.start.line??0,col:(e.loc?.start.column??0)+1,level:`warning`}),c.push({name:n,event:o,line:e.loc?.start.line??0,...sK(a,t,i)})}else oK(d)&&(KU.includes(a)&&n.push({message:`method "`+a+`" hides this.`+a,line:f,col:1,level:`error`}),l.push({name:a,line:f,...sK(oK(d),t,i)}))}}for(let e of r)e.level===`error`&&n.push(e);return{ok:n.length===0,name:u,errors:n,lint:r,params:o,state:s,handlers:c,methods:l}}function CPe(e,t){let n=t&&t<1?Math.min(6,Math.max(0,Math.ceil(-Math.log10(t)-1e-9))):0,r=Number(e).toFixed(Math.max(n,Number.isInteger(e)?0:n||3));return String(Number(r))}function wPe(e,t,n){let r=cK(e).params.find(e=>e.key===t);
2291if(!r)return{source:e,changed:!1,error:`no param "`+t+`"`};if(!r.range)return{source:e,changed:!1,error:`param "`+t+`" is not a literal`};let i;if(r.type===`number`){let t=Number(n);if(!Number.isFinite(t))return{source:e,changed:!1,error:`not a number`};i=CPe(t,r.step)}else if(r.type===`boolean`)i=n?`true`:`false`;else if(r.type===`string`){let t=e[r.range[0]]===`"`?`"`:`'`;i=t+String(n).replace(/\\/g,`\\\\`).replace(new RegExp(t,`g`),`\\`+t).replace(/\n/g,`\\n`)+t}else return{source:e,changed:!1,error:`param "`+t+`" cannot be edited here`};let a=e.slice(0,r.range[0])+i+e.slice(r.range[1]);return{source:a,changed:a!==e}}var lK=()=>See.map(e=>e.piece.spec);function TPe(){return["BEHAVIOURS (create_behaviour / edit_behaviour): game logic as ONE JavaScript module, run on ONE peer (the session authority); `state` replicates to everyone.",`export default behaviour({ name, params: {k: literal | {value, min, max, step, unit}}, state: {plain JSON}, on: {event(payload) {...}}, ...methods });`,'this: params, state, kit (also bare `kit`), after(seconds, "method", ...args) (survives the host leaving), cancel(key), rand(), randInt(a,b), pick(list), now(), find(glob) / findAll(glob) -> {uuid, name, pos, tags}, object, log(). Helpers: dist(a,b), clamp, lerp.',`events: start; grabRequest({piece, distance, hand, refuse}) (runs on the grabbing peer, read-only: call refuse(reason)); any kit event as "piece.event" or `+Object.keys(XU).join(`, `)+`. Entity payloads have entity.is(glob), entity.hasTag(t).`,`kit calls: kit.round.start/win(reason)/lose(reason), kit.score.add(n), kit.spawner.spawn({kind, template: uuid, at, count, hp, mover: {speed}}), kit.health.damage(id, n), kit.mover.chase(kind, "nearestPlayer"), kit.rules.set({reach, jump}).`,`Forbidden (the load is refused): Math.random, Date / Date.now, performance.now, localStorage, document/window/globalThis, fetch, eval, setTimeout/setInterval, import.`].join(` 2292`)}function uK(){return jc().filter(e=>e.type===`behaviour`)}function dK(e){return uK().find(t=>String(t.data?.name??``)===e)??null}function EPe(e){let t=cK(e,lK());return[...t.errors,...t.lint.filter(e=>e.level===`warning`)].map(e=>({line:e.line,message:e.message}))}function DPe(e){return{format:`behaviour/1`,reference:TPe,list(){let t=e();return uK().map(e=>{let n=t[e.id],r=(n?.model?.handlers??[]).map(e=>e.name);return{name:String(e.data?.name??`Behaviour`),target:e.__graph??`scene`,summary:(n?.status??`loading`)+(r.length?` · on `+r.join(`, `):``)+(e.data?.enabled===!1?` · stopped`:``)}})},read(e){let t=dK(e);return t?String(t.data?.code??``):null},async create(e,t,n={}){if(dK(e))return{error:`a behaviour named "`+e+`" exists â use edit_behaviour`};let r=cK(t,lK());if(!r.ok)return{error:r.errors.map(e=>`line `+e.line+`: `+e.message).join(`; `)};let i=n.target&&n.target!==`scene`?n.target:`scene`,[{createFlowNode:a,serializeNode:o},{recordFlowNodesEntry:s},{peers:c}]=await Promise.all([$(()=>import(`../chunks/y5Xg-5h5.js`).then(e=>e.u),__vite__mapDeps([55,1,2,6,5,3,7]),import.meta.url),$(()=>import(`../chunks/CzZ9Zc-O.js`).then(e=>e.a),__vite__mapDeps([144,1,2,5,6,3,7,55,83,17,9,0,4,18,10,19,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87]),import.meta.url),$(()=>import(`../chunks/C20P4rQ5.js`).then(e=>e.u),__vite__mapDeps([5,1,2,6,3]),import.meta.url)]),l=uK().length,u={id:crypto.randomUUID(),type:`behaviour`,position:{x:40,y:40+l*140},data:{label:`Behaviour`,type:`behaviour`,enabled:!0,name:e,code:t},class:`w-[150px]`};a(u,i);let d=U(c);return d&&d.send({type:`nodecreate`,node:o(u),graphId:i}),s({op:`create`,graphId:i,nodes:[o(u)],edges:[]}),{ok:!0,name:e}},async edit(e,t){let n=dK(e);if(!n)return{error:`no behaviour named "`+e+`"`};let r=cK(t,lK());if(!r.ok)return{error:r.errors.map(e=>`line `+e.line+`: `+e.message).join(`; `)};let i=String(n.data?.code??``);if(i===t)return{ok:!0};let[{setNodeData:a},{recordFlowNodesEntry:o}]=await Promise.all([$(()=>import(`../chunks/y5Xg-5h5.js`).then(e=>e.u),__vite__mapDeps([55,1,2,6,5,3,7]),import.meta.url),$(()=>import(`../chunks/CzZ9Zc-O.js`).then(e=>e.a),__vite__mapDeps([144,1,2,5,6,3,7,55,83,17,9,0,4,18,10,19,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87]),import.meta.url)]),s=n.__graph??`scene`;return a(n.id,{code:t},s),o({op:`data`,graphId:s,items:[{id:n.id,before:{code:i},after:{code:t}}]}),{ok:!0}},lint:EPe}}var OPe=`behaviour`,fK=e=>`behaviour:`+e,pK=()=>U(Es)?.peer?.id??null,mK=()=>[...U(Es)?.openedPeers??[]].map(String),hK=``,gK=0;function _K(){let e=mK().sort().join(`,`);e!==hK&&(hK=e,gK=yc())}var vK=new hn,yK=e=>Array.isArray(e?.userData?.tags)?e.userData.tags.map(String):[],bK=MNe({me:pK,now:yc,isAuthority:()=>{let e=pK();return!e||tl()===e},send(e){let t=U(Es);t&&t.send(e)},specs:()=>rl.specs(),peerCount:()=>mK().length,lastPeerChange:()=>(_K(),gK),tagsOf:e=>yK(U(Ui)?.getObjectByProperty?.(`uuid`,e)),findObjects:e=>{let t=U(Ui),n=[];return t?.traverse?.(r=>{if(r===t||r.userData?.kitEntity||r.userData?.transient)return;let i=yK(r);($U(e,r.name)||i.some(t=>
2292$U(e,t)))&&(r.getWorldPosition(vK),n.push({uuid:r.uuid,name:r.name,pos:[vK.x,vK.y,vK.z],tags:i}))}),n},warn:(e,t)=>Uc(`warn`,`behaviour`,e,t?String(t?.message??t):void 0)}),xK=Ue({}),SK=new Map;function CK(e,t){xK.update(n=>({...n,[e]:{...n[e]??{},...t}}))}async function kPe(e){return(await $(()=>import(`../chunks/Cxv3VV5O.js`).then(e=>e._),__vite__mapDeps([168,1,2,6,5,3,21,34,19,20,35,24,0,4,23,8,9,10,11,12,13,14,25,36,37,38,39,40,41,7,42,22,43,44,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59,70,75,128,98]),import.meta.url)).importModuleText(e)}function APe(e){if(!e||e===`scene`)return null;let t=U(Ui)?.getObjectByProperty?.(`uuid`,e);return t?{uuid:t.uuid,name:t.name,tags:yK(t)}:{uuid:e,name:``,tags:[]}}async function jPe(e){let t=String(e.id),n=String(e.data?.code??``),r=SK.get(t);if(!r){let e=new Map,i=fK(t);r={code:n,enabled:!0,seq:0,releases:e,scope:null,face:rl.api({onDispose:t=>{e.set(t,gee(i,`kit`,t))},moduleId:i})},SK.set(t,r)}r.code=n,r.enabled=!0;let i=++r.seq,a=cK(n,rl.specs());if(!a.ok){bK.stop(t),CK(t,{status:`error`,name:e.data?.name||a.name||`Behaviour`,errors:a.errors,lint:a.lint,model:a});return}CK(t,{status:`loading`,name:e.data?.name||a.name||`Behaviour`,errors:[],lint:a.lint,model:a});let o;try{o=await zNe(n,kPe)}catch(e){if(i!==r.seq)return;bK.stop(t),CK(t,{status:`error`,errors:[{message:String(e?.message??e),line:0,col:0,level:`error`}]});return}if(i!==r.seq||SK.get(t)!==r){o.scope.dispose();return}let s=bK.instances.get(t),c=s?[...s.offs]:[];try{let n=bK.start(t,o.def,{name:e.data?.name||o.def.name||a.name||t,kit:r.face,object:APe(e.__graph),resetGuard:()=>o.scope.scope.resetGuard?.()});o.scope.bind(n.ctx.kit);for(let e of c)r.releases.get(e)?.();for(let e of c)r.releases.delete(e);r.scope?.dispose(),r.scope=o.scope,CK(t,{status:`running`,errors:[],problems:n.problems})}catch(e){o.scope.dispose(),CK(t,{status:`error`,errors:[{message:String(e?.message??e),line:0,col:0,level:`error`}]})}}function wK(e,t=!1){let n=SK.get(e);t?bK.stop(e):bK.forget(e),hee(fK(e)),MPe(fK(e)),n?.scope?.dispose(),SK.delete(e),xK.update(n=>{let{[e]:r,...i}=n;return t&&r?{...i,[e]:{...r,status:`off`}}:i})}function MPe(e){try{rl.impls.spawner?.disown?.(e)}catch(t){Uc(`warn`,`behaviour`,`disown failed for `+e,String(t))}}function NPe(){let e=new Map;for(let t of jc())t.type===`behaviour`&&e.set(String(t.id),t);for(let t of[...SK.keys()]){let n=e.get(t);n?n.data?.enabled===!1&&wK(t,!0):wK(t)}for(let[t,n]of e){if(n.data?.enabled===!1){U(xK)[t]||CK(t,{status:`off`,name:n.data?.name||`Behaviour`});continue}let e=SK.get(t);(!e||e.code!==String(n.data?.code??``))&&jPe(n)}}var TK=!1,EK=!1;function PPe(){TK||(TK=!0,Tge(DPe(()=>U(xK))),Dc.subscribe(()=>{EK||(EK=!0,queueMicrotask(()=>{EK=!1,NPe()}))}))}function FPe(){bK.tick()}function DK(e){return _K(),e?.type===`bhv`&&bK.receive(e)}function OK(){return bK.snapshot()}function IPe(){return{status:U(xK),loaded:[...SK.keys()],stats:{...bK.stats},authority:tl(),me:pK(),live:e=>bK.live(e),registrations:e=>mee(fK(e)),call:(e,t,...n)=>bK.call(e,t,...n)}}function kK(){let e=new Set(jc().map(e=>e.id)),t={};for(let[n,r]of Object.entries(U(Ac)??{}))e.has(n)&&typeof r?.lastT==`number`&&(t[n]={count:Number(r.count)||0,lastT:r.lastT});return{type:`triggers`,triggers:t}}function AK(e,t=0){let n=U(Es),r=n?.peer?.connections?.[e]?.[0]??n?.connections?.[e];if(r){if(!r.open){t<40&&setTimeout(()=>AK(e,t+1),250);return}r.send(kK())}}function jK(e){let t=e?.triggers;if(!t||typeof t!=`object`)return 0;let n=0;return Ac.update(e=>{let r={...e};for(let[e,i]of Object.entries(t)){let t=i?.lastT;if(typeof t!=`number`)continue;let a=r[e];a&&typeof a.lastT==`number`&&a.lastT>=t||(r[e]={count:Number(i.count)||0,lastT:t},n++)}return r}),kne(),n}function LPe(){let e=kK();return{entries:Object.keys(e.triggers).length,bytes:JSON.stringify(e).length}}function RPe(e){let t={id:e,open:!1,disconnected:!0,destroyed:!1,connections:{},on(){return t},off(){return t},once(){return t},removeAllListeners(){return t},connect(){},call(){},reconnect(){},disconnect(){},destroy(){t.destroyed=!0},listAllPeers(e){typeof e==`function`&&e([])}};return t}function MK(){return`xxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)})}var NK=1e4,PK={base:800,cap:8e3,max:1/0,jitter:.25},zPe=4e3,FK=t(void 0);Ci.subscribe(e=>{I(FK,e,!0)});var IK=t(void 0);Di.subscribe(e=>{I(IK,e,!0)});var LK=t(void 0);as.subscribe(e=>{I(LK,e,!0)});var BPe=new Set([`camera`,`vrhands`]);function RK(e,t){let n=e?{jr:1,joinresult:e}:{jr:1};return t!==void 0&&!e&&(n.cloud=t),{metadata:n}}var VPe=15e3;function HPe(e){if(e.length<=12)return e;let t=U(Yd),n=e=>Date.now()-(t[e.peerId]??0),r=e.filter(e=>n(e)>
2292Zd).sort((e,t)=>n(t)-n(e)),i=e.filter(e=>n(e)<=Zd).sort((e,t)=>n(t)-n(e)),a=new Set;for(let t of[...r,...i]){if(e.length-a.size<=12)break;a.add(t.peerId)}for(let e of a)Xd(e);return e.filter(e=>!a.has(e.peerId))}var UPe=class{constructor(e,t){if(this.updateIdFn=t,this.myId=e,this.reconnectAttempts=0,this.hasOpened=!1,this.didFallback=!1,this.idRetries=0,this.serverErrorAt=0,this.connections={},this.openedPeers=new Set,this.reconnecting=new Map,this.gracefulLeft=new Set,this.wantsStateFrom=new Set,this.approvedDialBacks=new Set,this.dialCloud=new Map,this.refusalDials=new Set,typeof location<`u`&&location.hash.includes(`~`)){let{peerId:e,srv:t}=bC(location.hash);if(t){let e=SC(t);e&&(wC(e),console.log(`invite link pinned the signaling server:`,t))}location.hash=e?`#`+e:``}let n=!/(\.io|\.app)$/i.test(location.hostname),r=e=>{let{options:t,canFallback:r}=t_e({isLocalDev:n,forcePublic:e});this.canFallback=r,xC.set({...Qge({isLocalDev:n,forcePublic:e}),didFallback:this.didFallback}),this.peer=Om?RPe(this.myId):new zMe(this.myId,t)},i=e=>{try{this.peer.destroy()}catch{}r(!!e),Nce(this),o()},a=()=>{this.didFallback=!0,this.canFallback=!1,es(`Your peer server is unreachable - switching to the public PeerJS server.`),i(!0)};this.switchServer=e=>{let t=e||null,n=t?.forcePublic?`the public PeerJS cloud`:t?.custom?.host?t.custom.host+(t.custom.port&&Number(t.custom.port)!==443?`:`+t.custom.port:``):`the configured peer server`;(Object.keys(this.connections).length||this.openedPeers.size)&&this.leaveSession();let r=r_e(),a=e=>{wC(e),this.didFallback=!1,this.hasOpened=!1,this.idRetries=0,this.reconnectAttempts=0,this.serverErrorAt=0,i(!!e?.forcePublic)};a(t);let o=!!(t&&(t.forcePublic||t.custom?.host));return new Promise(e=>{let t=Date.now(),i=()=>{if(this.peer?.open){Es.update(e=>e),e(!0);return}if(!(this.serverErrorAt>t&&!this.canFallback||Date.now()-t>8e3)){setTimeout(i,200);return}o?(a(r),es(`Could not reach `+n+` â back on your previous peer server.`)):es(`Could not reach `+n+` â check Settings ⸠Connection, or reload.`),Es.update(e=>e),e(!1)};setTimeout(i,200)})};let o=()=>{this.peer.on(`open`,e=>{if(console.log(e),this.hasOpened=!0,U(Wd).retrying&&es(`Reconnected to the peer server.`),cre(),this.reconnectAttempts=0,this.updateIdFn&&this.updateIdFn(e),!window.location.hash.slice(1))return;let t=window.location.hash.slice(1).toLocaleLowerCase(),n=[t,``,``];Q(LK).push(n),as.set(Q(LK)),as.update(e=>e);let r=U(ds);r.push([t,`pending`]),ds.set(r),ds.update(e=>e),this.connectToPeer(t,!0),window.location.hash=``}),this.peer.on(`close`,()=>{Uc(`error`,`net`,`signaling server closed`),this.reconnectAttempts++;let e=KV(this.reconnectAttempts,PK)??8e3;this.reconnectAttempts===1&&es(`The peer server closed the link - reconnecting...`),Qd(this.reconnectAttempts),setTimeout(()=>{this.peer?.open||i(this.didFallback)},e)}),this.reconnectAttempts=0,this.peer.on(`disconnected`,()=>{if(Uc(`warn`,`net`,`signaling server disconnected`),this.peer.destroyed)return;this.reconnectAttempts++;let e=KV(this.reconnectAttempts,PK)??8e3;this.reconnectAttempts===1&&es(`Lost the peer server - reconnecting...`),Qd(this.reconnectAttempts),setTimeout(()=>{!this.peer.destroyed&&this.peer.disconnected&&this.peer.reconnect()},e)}),this.peer.on(`error`,e=>{if(Uc(`error`,`net`,`peer error`,{type:e?.type,error:String(e)}),!this.hasOpened&&this.canFallback&&!this.didFallback&&[`network`,`server-error`,`socket-error`,`socket-closed`].includes(e.type)){a();return}if([`network`,`server-error`,`socket-error`,`socket-closed`].includes(e.type)&&(this.serverErrorAt=Date.now()),e.type===`unavailable-id`&&this.hasOpened&&this.idRetries<3){this.idRetries++;let e=KV(this.idRetries,PK)??8e3;Uc(`warn`,`net`,`id still held by the old registration â rebuilding`,{wait:e}),Qd(this.idRetries),setTimeout(()=>{this.peer?.open||i(this.didFallback)},e);return}if(e.type===`unavailable-id`&&!this.hasOpened&&this.idRetries<3){this.idRetries++,this.myId=MK(),Uc(`warn`,`net`,`session id collided â retrying`,{id:this.myId}),i(this.didFallback);return}if(e.type===`peer-unavailable`){let t=String(e.message??``).match(/[0-9a-z]{3,}/i)?.[0]??``;if(t&&this.refusalDials.has(t))return;t&&$(()=>import(`../chunks/DLxKOJr3.js`).then(e=>e.o).then(e=>e.abandonOutboundRequest(t)),__vite__mapDeps([142,1,2,5,6,3,76,10]),import.meta.url).catch(()=>{}),es(`Peer is unreachable. Check the ID and ask them to stay online.`)}else e.type===`unavailable-id`?es(`Your session ID is already in use. Please reload the page.`):[`network`,`server-error`,`socket-error`,`socket-closed`].includes(e.type)?es(`Cannot reach the peer server. Retrying...`):es(`Connection error: `+e.type)}),this.peer.on(`connection`,s.bind(this))};if(r(!1),jce(this),o(),typeof window<`u`){window.addEventListener(`pagehide`,()=>{try{this.broadcast({type:`disconnected`,peerId:this.peer.id})}catch{}});let e=()=>{this.peer&&!this.peer.open&&(this.reconnectAttempts=0,this.peer.destroyed?i(this.didFallback):this.peer.disconnected&&this.peer.reconnect())};window.addEventListener(`online`,e),document.addEventListener(`visibilitychange`,()=>{document.hidden||e()})}this.wireData=c.bind(this);function s(e){if(Kd(e?.metadata?.joinresult)){let t=qv(e.peer,e.metadata.joinresult);Uc(`info`,`net`,`join refused`,{peer:e.peer,result:e.metadata.joinresult,ended:t});try{e.close()}catch{}return}
2292U(ds).forEach(t=>{t[0]===e.peer&&(Xd(e.peer),ds.set(U(ds).filter(t=>t[0]!==e.peer)),t[1]=`approved`,U(Vd)||Vd.set(e.peer),U(cf)?es(String(t[0]).slice(0,6).toUpperCase()+` approved your request. You joined with view-only access â an admin can grant edit access.`,[{label:`Read more`,action:()=>{try{window.open(`https://docs.theprototype.app`,`_blank`)}catch{}}}]):es(String(t[0]).slice(0,6).toUpperCase()+` has approved your connection request.`))}),ds.update(e=>e);let t=U(as).some(t=>t[0]===e.peer),n=``;if(!t){let r=af();try{let i=e?.metadata?.cloud??null,a=r&&typeof r.decide==`function`?r.decide(e.peer,i):void 0;if(a===`deny`){e?.metadata?.jr&&this.sendJoinResult(e.peer,`denied`),e.close();return}a&&typeof a==`object`&&a.label&&(n=String(a.label).slice(0,120));let o=a===void 0?!!r&&typeof r.authorize==`function`&&r.authorize(e.peer):a===`admit`;if(o&&Ud(this)&&e?.metadata?.jr){this.sendJoinResult(e.peer,`full`),e.close();return}if(o){t=!0;let n=U(as);n.some(t=>t[0]===e.peer)||(n.push([e.peer,``,``]),as.set(n)),U(Es).send({type:`userdata`,userdata:U(as)}),this.approveDialBack(e.peer)}}catch(e){console.error(`cloud auth provider threw:`,e)}}if(!t){var r=U(ks);let t=!!e?.metadata?.jr,i=r.find(t=>t.peerId===e.peer);i&&(i.hearsNo!==t||n&&i.label!==n)&&ks.set(r.map(r=>r.peerId===e.peer?{...r,hearsNo:t,...n?{label:n}:{}}:r)),i||(r.push(n?{peerId:e.peer,hearsNo:t,label:n}:{peerId:e.peer,hearsNo:t}),sre(e.peer),ks.set(HPe(r))),e.close()}e.on(`open`,()=>{let t=this.connections[e.peer];if(t?.open)return;if(Uc(`warn`,`net`,`adopting inbound connection as the send channel`,{peer:e.peer}),t)try{t.close()}catch{}this.connections[e.peer]=e,e.on(`close`,()=>this.onConnClose(e.peer,e)),this.openedPeers.add(e.peer),Jd(e.peer),Es.update(e=>e);let n=this.wantsStateFrom.has(e.peer)||this.reconnecting.has(e.peer);this.sendHandshake(e,e.peer,n,this.peer.id)}),this.wireData(e)}function c(e){e.on(`error`,t=>qf(e.peer,`conn-error`,t?.type??t)),e.on(`iceStateChanged`,t=>{(t===`failed`||t===`closed`)&&qf(e.peer,`ice-`+t)});let t=t=>{if((!t||gre(e.peer,t.type))&&(!t||Zme(e.peer,t.type))&&!(t&&Yb.has(t.type)&&Db(e.peer))){if(t.type==`cloud`)_re(e.peer,t.payload);else if(t.type==`hosts`)console.log(`Connecting to received hosts`),t.hosts.forEach(e=>{Ud(this)||this.connectToPeer(e,!1)});else if(t.type==`sent`)Zs({message:t.message,type:`received`,sender:t.sender});else if(t.type==`info`)Zs({message:t.message,type:t.type,sender:t.sender});else if(t.type==`create`)sie(t.command,t.uuid);else if(t.type==`light`)oie(t.command,t.uuid);else if(t.type==`group`){if(lie(t.command,t.uuid,t.group,t.name,t.groupparent,t.pos,t.rot,t.scale,t.override),t.userData&&typeof t.userData==`object`&&t.uuid){let e=U(Ui)?.getObjectByProperty(`uuid`,t.uuid);e&&(e.userData={...e.userData,...t.userData},ci())}}else if(t.type==`name`)die(t.uuid,t.name);else if(t.type==`move`){NA(t.uuid);let n=U(Ui)?.getObjectByProperty(`uuid`,t.uuid),r=n?{pos:n.position.clone(),quat:n.quaternion.clone()}:null;uie(t.uuid,t.pos,t.rot,t.scale),r&&VA(t.uuid,n,r),lse(t.uuid,e.peer)}else if(t.type==`throw`)ose(t);else if(t.type==`hit`)ah(t),MA(t,e.peer);else if(t.type==`simulate`)sse(t);else if(t.type==`jointcreate`)iie(t);else if(t.type==`jointdelete`)tie(t);else if(t.type==`joints`)rie(t.joints);else if(t.type==`getjoints`)ex(e.peer)&&eie(t.sender);else if(t.type==`animdata`)ule(t);else if(t.type==`animplay`)sle(t);else if(t.type==`animations`)rle(t);else if(t.type==`getanim`)ex(e.peer)&&$ce(t.sender);else if(t.type==`handmodel`)GR(t);else if(t.type==`environment`)lde(t);else if(t.type==`music`)Ede(t);else if(t.type==`scenephysics`)Zee(t);else if(t.type==`roomanchor`)vce(t);else if(t.type==`getroomanchor`)gce(t.sender);else if(t.type==`manifest`)Yne(t);else if(t.type==`getproject`)Gne(t.sender);else if(t.type==`scenepost`)lpe(t);else if(t.type==`getscenepost`)ex(e.peer)&&$fe(t.sender);else if(t.type==`transport`)Mfe(t);else if(t.type==`gettransport`)ex(e.peer)&&Afe(t.sender);else if(t.type==`joinresult`)Kd(t.result)&&qv(e.peer,t.result);else if(t.type==`clockping`)Ofe(t,e);else if(t.type==`clockpong`)kfe(t);else if(t.type==`patch`)Bde(t);else if(t.type==`getpatch`)ex(e.peer)&&Lde(t.sender);else if(t.type==`devicenote`)Pde(t);else if(t.type==`shadergraph`)pU(t);else if(t.type==`shadergraphdelete`)mU(t);else if(t.type==`shadergraphs`)hU(t);else if(t.type==`getshadergraphs`)ex(e.peer)&&fU(t.sender);else if(t.type==`hud`)b_e(t);else if(t.type==`huddelete`)v_e(t);else if(t.type==`huds`)m_e(t);else if(t.type==`gethuds`)ex(e.peer)&&x_e(t.sender);else if(t.type==`hudvalue`)y_e(t);else if(t.type==`hudvalues`)g_e(t);else if(t.type==`gethudvalues`)ex(e.peer)&&__e(t.sender);else if(t.type==`game`)CU(t);else if(t.type==`getgame`)ex(e.peer)&&SU(t.sender);else if(t.type==`kit`||t.type==`kitreq`)nl(t,e.peer);else if(t.type==`bhv`)DK(t);else if(t.type==`kitentity`||t.type==`getkitentities`)nl(t,e.peer);else if(t.type==`envpresets`)cde(t);else if(t.type==`geometry`)fie(t);else if(t.type==`lighttarget`)pde(t);else if(t.type==`sessionproposal`)Dme(t);else if(t.type==`sessionanswer`)Tme(t);else if(t.type==`drawlive`)yle(t);else if(t.type==`drawend`)vle(t);else if(t.type==`lockrequest`)pse(t);else if(t.type==`unlock`)mse(t);else if(t.type==`lockdenied`)gse(t);else if(t.type==`lock`)aie(t.uuid,t.peerId,t.uuids);else if(t.type==`locked`)Fpe(t.lockeditems);else if(t.type==`userdata`)Vpe(t.userdata);else if(t.type==`specator`)jpe(t,t.watching);else if(t.type==`cameraSettings`)Lpe(t,t.vrmode);else if(t.type==`camera`)cie(t);else if(t.type==`sceneaccess`)$(()=>import(`../chunks/CMcOMWsT.js`).then(n=>n.applySceneAccess(e.peer,t)),[],import.meta.url).catch(()=>{});else if(t.type==`getobjects`){if(qb(e.peer))return;Ab(`objects`,t.sender,{otherCount:t.count??0,theirScene:$b(e.peer),theirName:Wb(e.peer),theirHash:U(Xb)[e.peer]?.hash??``,fromHost:U(Vd)===e.peer,mineScene:Qb(),mineName:Kb()?.scene??``,arriving:!!t.arriving})}else if(t.type==`objectfile`)Ice(t);else if(t.type==`behavior`)gj(t);else if(t.type==`object`)Npe(t,t.uuids,t.override,t.groupuuid,t.pos,t.rot,t.scale);else if(t.type==`objectParameters`)Rpe(t);else if(t.type==`duplicate`)soe(t.sourceUuid,t.uuids,t.name,t.pos,t.transient,t.shareMaterial);else if(t.type==`clearscene`)Bpe(t.peerId);else if(t.type==`delete`)Ipe(t.uuid);else if(t.type==`color`)Mpe(t.uuid,t.color,t.near,t.far);else if(t.type==`loading`)zpe(t.count,t.uuids,e.peer);else if(t.type==`disconnected`)t.peerId===e.peer?(this.gracefulLeft.add(t.peerId),this.openedPeers.has(t.peerId)&&this.finalizeDisconnect(t.peerId,!1)):this.connections[t.peerId]||this.reconnecting.has(t.peerId)||(Jy(t.peerId),MC(t.peerId),Zb(t.peerId),Bu(t.peerId),gg(t.peerId),ov(t.peerId),KR(t.peerId));else if(t.type==`getnodes`){if(qb(e.peer))return;Ab(`nodes`,t.sender,{theirScene:$b(e.peer),theirName:Wb(e.peer),theirHash:U(Xb)[e.peer]?.hash??``,fromHost:U(Vd)===e.peer,mineScene:Qb(),mineName:Kb()?.scene??``})}else t.type==`nodes`?Cte(t.nodes,t.edges,t.graphs):t.type==`nodesync`?Ste(t):t.type==`graphcreate`?Ife(t.uuid):t.type==`graphdelete`?Pfe(t.uuid):t.type==`nodedef`?zne(t.def):t.type==`nodedefdelete`?Ine(t.i
2292d):t.type==`nodedefs`?Rne(t.defs):t.type==`getnodedefs`?Fne(t.sender):t.type==`nodecreate`?$l(t.node,t.graphId):t.type==`nodemove`?xte(t.id,t.position,t.graphId):t.type==`nodedata`?yte(t.id,t.data,t.graphId):t.type==`nodedelete`?au(t.ids,t.graphId):t.type==`edgecreate`?tu(t.edge,t.graphId):t.type==`edgedelete`?ru(t.ids,t.graphId):t.type==`nodetrigger`?jne(t.id,t.t,!1,null,t.at??null,t.other):t.type==`gettriggers`?ex(e.peer)&&AK(t.sender):t.type==`triggers`?jK(t):t.type==`particleburst`?Bre(t.uuid,t.t):t.type==`flowcursor`?wte(t):t.type==`ping`?Gpe(t):t.type==`assetfile`?yf(t):t.type==`assetmissing`?jre(e.peer,t):t.type==`assetstart`?Nre(t):t.type==`assetchunk`?Ore(t):t.type==`assetthumb`?Ere(t):t.type==`getasset`?t.thumb?Mre(e.peer,t):Are(e.peer,t):t.type==`module`?gne(t):t.type==`modules`?(mne(t.versions),lne(t.appVersion)):t.type==`getmodulestate`?(pne(t.sender),she(),pL(),l_e(),Wme(),nne(),bce()):t.type==`peervars`?ine(t):t.type==`colocated`?Cce(t):t.type==`playmode`?p_e(t):t.type==`atscene`?Kme(t):t.type==`sceneadopt`?$(()=>import(`../chunks/qxGgLbp0.js`).then(e=>e.o).then(e=>e.applyRemoteSceneAdopt(t)),__vite__mapDeps([111,1,2,6,0,3,4,69,9,44,5,70,20,21,10,19,7,13,55,72,73,74,75,76,77,78,67,71,79,112,113,114,45,46,50,47,8,11,12,14,27,48,49,18,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,68,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,124,125,126,100,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98,169]),import.meta.url).catch(()=>{}):t.type==`modulestate`?fne(t.states):t.type==`campreview`?dhe(t):t.type==`lookstate`?mL(t):t.type==`annotation`?Spe(t):t.type==`annotations`?Epe(t.annotations):t.type==`getannotations`?ex(e.peer)&&vpe(t.sender):t.type==`verts`?Wae(t.uuid,t.indices,t.position):t.type==`meshgeo`?om(t.uuid,t.positions,t.groups,t.uvs,t.faceCounts,t.faceTris):t.type==`uvpaint`?eU(t):t.type==`uvpaintend`?tU(t):t.type==`splineedit`?Ale(t.uuid,t.spline):t.type==`perflive`?o_e(e.peer,t):t.type==`vrhands`?si.update(e=>({...e,[t.peerId]:{left:t.left,right:t.right,active:t.active!==!1,ts:Date.now()}})):qf(e.peer,`unknown:`+t.type)}};e.on(`data`,n=>{if(!n||typeof n!=`object`){qf(e.peer,`shape`,typeof n);return}if(Zi(`in`,n),!mie(n)){qf(e.peer,`invalid:`+n.type);return}try{t(n)}catch(t){qf(e.peer,n.type,t)}})}}sendMyScene(e){e.send({type:`atscene`,peerId:this.peer.id,...Jme(),at:yc()})}requestFullState(e,t={}){this.sendMyScene(e),e.send({type:`getobjects`,sender:this.peer.id,count:Ome(),...t.arriving?{arriving:!0}:{}}),e.send({type:`gettriggers`,sender:this.peer.id}),e.send({type:`getnodes`,sender:this.peer.id}),e.send({type:`getannotations`,sender:this.peer.id}),e.send({type:`getjoints`,sender:this.peer.id}),e.send({type:`getanim`,sender:this.peer.id}),e.send({type:`getscenepost`,sender:this.peer.id}),e.send({type:`getroomanchor`,sender:this.peer.id}),e.send({type:`getshadergraphs`,sender:this.peer.id}),e.send({type:`gethuds`,sender:this.peer.id}),e.send({type:`gethudvalues`,sender:this.peer.id})}sendHandshake(e,t,n,r){this.approvedDialBacks.delete(t)&&e.send({type:`joinresult`,result:`approved`}),this.gracefulLeft.delete(t);let i=[r];Object.keys(this.connections).forEach(e=>{e!=t&&i.push(e)}),console.log(`sending to `+t+` remote `+i);let a=[...Q(FK)];Q(IK).uuid!==void 0&&Q(IK).uuid&&a.push([r,Q(IK).uuid]),this.sendMyScene(e),Nfe(t);let o=Jb();o||e.send({type:`locked`,lockeditems:a}),e.send({type:`hosts`,hosts:i}),e.send({type:`userdata`,userdata:Q(LK)}),e.send({type:`modules`,versions:cne(),appVersion:Vc,sha:pee});let s=o,c=s||n&&yme(U(Vd)===t,Kb()?.scene??``);if(c&&!s&&jme(t),!c){e.send(mv()),e.send(_v()),e.send(_l()),e.send(jfe()),e.send(Wde());for(let t of py())e.send(t)}if(e.send(WR()),e.send(rde()),n&&!c&&this.requestFullState(e),c||e.send(xU()),c||e.send(el()),!c)for(let t of WU())e.send(t);if(!c)for(let t of OK())e.send(t);!c&&U(lh)&&e.send({type:`simulate`,running:!0,paused:U(Xm),peerId:this.peer.id}),e.send({type:`getmodulestate`,sender:this.peer.id}),e.send({type:`getproject`,sender:this.peer.id}),n&&!c&&e.send({type:`getnodedefs`,sender:this.peer.id}),wce(t)}approveDialBack(e){this.approvedDialBacks.add(e),this.connectToPeer(e,!0)}sendJoinResult(e,t){if(!Kd(t)||!this.peer?.open)return!1;let n=this.peer.connect(e,RK(t));if(!n)return!1;this.refusalDials.add(e);let r=!1,i=()=>
2292{if(!r){r=!0;try{n.close()}catch{}setTimeout(()=>this.refusalDials.delete(e),5e3)}};return n.on?.(`close`,i),n.on?.(`error`,i),n.on?.(`open`,()=>setTimeout(i,1e3)),setTimeout(i,VPe),Uc(`info`,`net`,`join result sent`,{peer:e,result:t}),!0}connectToPeer(e,t=!0,n=this.peer.id){if(t&&this.wantsStateFrom.add(e),this.connections[e])this.connections[e].peer==e&&(console.log(`Peer ${e} is already connected or has a pending request. Connection status: ${this.connections[e].open}`),this.connections[e].open||this.restoreWhenStale(e,t,n));else{console.log(`Connecting to `+e);let r=this.peer.connect(e,RK(this.approvedDialBacks.has(e)?`approved`:void 0,this.dialCloud?.get(e)));if(!r){Uc(`error`,`net`,`connect failed: signaling link is down`,{peer:e}),es(`Cannot reach the signaling server - the connection request was not sent.`);return}r.__dialedAt=Date.now(),this.connections[e]=r,r.on(`close`,()=>this.onConnClose(e,r)),r.on(`open`,()=>{console.log(`Connection to `+e+` established`),this.openedPeers.add(e),Jd(e),Es.update(e=>e),this.sendHandshake(r,e,t,n)}),this.wireData(r)}}restoreWhenStale(e,t,n){let r=this.connections[e];if(!r||r.open)return;let i=Date.now()-(r.__dialedAt??0);if(i>=NK){this.restoreConnection(e,t,n,0);return}r.__staleCheck||(r.__staleCheck=!0,setTimeout(()=>{this.connections[e]!==r||r.open||this.restoreConnection(e,t,n,0)},NK-i))}restoreConnection(e,t,n,r){if(this.connections[e]?.open)return;let i=this.connections[e];if(i&&Date.now()-(i.__dialedAt??0)<zPe&&r===0)return;Uc(`warn`,`net`,`restoring connection`,{peer:e,attempt:(r||0)+1});let a=this.connections[e];if(a&&!a.open){try{a.close()}catch{}delete this.connections[e]}let o=this.peer.connect(e,RK(void 0,this.dialCloud?.get(e)));if(!o){Uc(`error`,`net`,`restore failed: signaling link is down`,{peer:e});return}o.__dialedAt=Date.now(),this.connections[e]=o,o.on(`close`,()=>this.onConnClose(e,o)),o.on(`open`,()=>{Uc(`info`,`net`,`connection restored`,{peer:e}),this.openedPeers.add(e),Jd(e),Es.update(e=>e),this.sendHandshake(o,e,t,n)}),this.wireData(o),setTimeout(()=>{if(!(this.connections[e]!==o||o.open)){if(r>=4){Uc(`error`,`net`,`restore gave up`,{peer:e,attempts:r+1});return}try{o.close()}catch{}delete this.connections[e],this.restoreConnection(e,t,n,r+1)}},4e3)}onConnClose(e,t){if(this.connections[e]===t){if(console.log(`connection to `+e+` closed`),delete this.connections[e],Es.update(e=>e),!this.openedPeers.has(e)){qy();return}if(this.gracefulLeft.delete(e)){this.finalizeDisconnect(e,!1);return}Uc(`warn`,`net`,`connection dropped without a goodbye â trying to get them back`,{peer:e}),this.scheduleReconnect(e,1)}}scheduleReconnect(e,t){let n=KV(t,{base:500,max:5});if(n===null){this.reconnecting.delete(e),this.finalizeDisconnect(e,!0);return}this.reconnecting.set(e,t),setTimeout(()=>{if(this.reconnecting.get(e)!==t)return;if(!this.openedPeers.has(e)){this.reconnecting.delete(e);return}let n=this.connections[e];if(n?.open){this.reconnecting.delete(e);return}if(n&&Date.now()-(n.__dialedAt??0)>=NK){try{n.close()}catch{}delete this.connections[e]}let r=KV(t+1,{base:500,max:5})===null;if(!this.connections[e]&&!r&&this.peer.id<e){let t=this.peer.connect(e,RK());t&&(t.__dialedAt=Date.now(),this.connections[e]=t,t.on(`close`,()=>this.onConnClose(e,t)),t.on(`open`,()=>{Uc(`info`,`net`,`reconnected`,{peer:e}),this.reconnecting.delete(e),Es.update(e=>e),this.sendHandshake(t,e,!0,this.peer.id)}),this.wireData(t))}this.scheduleReconnect(e,t+1)},n)}finalizeDisconnect(e,t){this.reconnecting.delete(e);let n=this.connections[e];if(n){delete this.connections[e];try{n.close()}catch{}}this.openedPeers.delete(e),Jy(e),dx(e),OC(e),hL(e),MC(e),Zb(e),Bu(e),gg(e),ov(e),KR(e),t&&this.broadcast({type:`disconnected`,peerId:e}),qy(),Es.update(e=>e)}leaveSession(){this.broadcast({type:`disconnected`,peerId:this.peer.id}),this.reconnecting.clear(),this.gracefulLeft.clear(),this.wantsStateFrom.clear();for(let e of Object.keys(this.connections)){let t=this.connections[e];delete this.connections[e];try{t.close()}catch{}this.openedPeers.has(e)&&(this.openedPeers.delete(e),Jy(e),dx(e),OC(e),hL(e),MC(e),Zb(e),Bu(e),gg(e),ov(e),KR(e))}as.set(U(as).filter(e=>e[0]===this.peer.id)),ds.set([]),ks.set([]),Mce(),ure(),qy(),Es.update(e=>e)}broadcast(e){Zi(`out`,e);let t=Yb.has(e?.type),n=BPe.has(e?.type)||t,r=n?Kb()?.scene??``:``,i=n?U(Xb):{},a=n?U(Vd):null,o=t&&Jb();
2292Object.keys(this.connections).forEach(s=>{let c=this.connections[s];if(c&&c.open&&!o&&!(n&&Gb(i,r,s,a))&&!(t&&Db(s)))try{c.send(e)}catch(e){Uc(`error`,`net`,`send failed`,{peer:s,error:String(e)})}})}sendMessage(e,t){e.startsWith(`/`)?Gy(e):(t===void 0&&(t=`sent`),Zs({message:e,type:t,sender:this.peer.id}),this.broadcast({message:e,type:t,sender:this.peer.id}))}send(e){yre(e)||(e.type==`create`&&this.sendMessage(`created a `+e.command.split(` `)[1],`info`),this.broadcast(e))}};function WPe(e){let t=U(Es)?.connections?.[e];if(t?.open){t.send(mv()),t.send(_v()),t.send(_l());for(let e of py())t.send(e);t.send(xU()),t.send(el());for(let e of WU())t.send(e);for(let e of OK())t.send(e)}}Ame(WPe);var GPe=V(`<button role="tab">Rooms</button>`),KPe=V(`<span> </span>`),qPe=V(`<span class="cxd-req-badge svelte-18ci53x" title="Pending connection request(s)"> </span>`),JPe=V(`<div class="cxd-body cxd-rooms svelte-18ci53x"><!></div>`),YPe=V(`<p class="cxd-empty svelte-18ci53x">No active toasts. New requests and messages appear here while the drawer is open.</p>`),XPe=V(`<span class="cxd-knock svelte-18ci53x"> </span>`),ZPe=V(`<button class="cxd-approve svelte-18ci53x" title="Approve as viewer">View only</button> <button class="cxd-approve cxd-approve-edit svelte-18ci53x" title="Approve with edit access">Editor access</button>`,1),QPe=V(`<button class="cxd-approve svelte-18ci53x">Approve</button>`),$Pe=V(`<li class="cxd-toast cxd-live svelte-18ci53x" data-kind="request"><div class="cxd-toast-text svelte-18ci53x">Connection request from <span class="cxd-mono svelte-18ci53x"> </span><!></div> <div class="cxd-live-actions svelte-18ci53x"><!> <button class="cxd-reject svelte-18ci53x">Reject</button></div></li>`),eFe=V(`<li class="cxd-toast cxd-live svelte-18ci53x" data-kind="waiting"><div class="cxd-toast-text svelte-18ci53x">Waiting for <span class="cxd-mono svelte-18ci53x"> </span> to acceptâ¦</div> <div class="cxd-live-actions svelte-18ci53x"><button class="cxd-reject svelte-18ci53x">Cancel</button></div></li>`),tFe=V(`<button class="cxd-approve svelte-18ci53x"> </button>`),nFe=V(`<button class="cxd-reject svelte-18ci53x">Dismiss</button>`),rFe=V(`<li class="cxd-toast cxd-live svelte-18ci53x"><div class="cxd-toast-text svelte-18ci53x"> </div> <div class="cxd-live-actions svelte-18ci53x"><!> <!></div></li>`),iFe=V(`<ul class="cxd-toast-list svelte-18ci53x"><!> <!> <!></ul>`),aFe=V(`<div class="cxd-body svelte-18ci53x"><!></div>`),oFe=V(`<span class="cxd-badge cxd-badge-live svelte-18ci53x">connected</span>`),sFe=V(`<span class="cxd-badge cxd-badge-wait svelte-18ci53x">waiting for approval</span>`),cFe=V(`<span class="cxd-badge svelte-18ci53x">not connected</span>`),lFe=V(`<span class="cxd-relay svelte-18ci53x" title="Relayed through a TURN server">relay</span>`),uFe=V(`<span class="svelte-18ci53x"> </span> <!>`,1),dFe=V(`<span class="cxd-ago svelte-18ci53x"> </span>`),fFe=V(`<div class="cxd-peer svelte-18ci53x"><span class="cxd-mono cxd-peer-id svelte-18ci53x"> </span> <span class="cxd-peer-name svelte-18ci53x"> </span> <!> <!></div>`),pFe=V(`<div class="cxd-row svelte-18ci53x" data-testid="drawer
2292-host-row"><span class="cxd-key svelte-18ci53x">Host</span> <span class="cxd-val cxd-mono svelte-18ci53x"><!></span></div> <!>`,1),mFe=V(`<div class="cxd-peer svelte-18ci53x"><span class="cxd-mono cxd-peer-id svelte-18ci53x"> </span> <span class="cxd-peer-name cxd-wait-label svelte-18ci53x">pendingâ¦</span> <button class="cxd-cancel svelte-18ci53x">Cancel</button></div>`),hFe=V(`<div class="cxd-warn svelte-18ci53x" data-testid="drawer-fallback-warn">â Self-hosted server unreachable â using the public PeerJS cloud. Peers must be 2293 on the same server to connect (your copied invite links carry it).</div>`),gFe=V(`<span class="cxd-bad svelte-18ci53x">unreachable</span>`),_Fe=V(`<div class="cxd-row svelte-18ci53x" data-testid="drawer-server-row"><span class="cxd-key svelte-18ci53x">Server</span> <span class="cxd-val svelte-18ci53x" data-testid="drawer-server-label"> </span></div> <div class="cxd-row svelte-18ci53x"><span class="cxd-key svelte-18ci53x">Host</span> <span class="cxd-val cxd-mono svelte-18ci53x"> </span></div> <!> <div class="cxd-row svelte-18ci53x"><span class="cxd-key svelte-18ci53x">Ping</span> <span class="cxd-val svelte-18ci53x"><!> <button class="cxd-refresh svelte-18ci53x" title="Re-measure" aria-label="Re-measure server ping">â»</button></span></div> <div class="cxd-row svelte-18ci53x"><span class="cxd-key svelte-18ci53x">Discovery</span> <span class="cxd-val svelte-18ci53x"> </span></div>`,1),vFe=V(`<div class="cxd-row svelte-18ci53x"><span class="cxd-val cxd-muted svelte-18ci53x">Not connected to a signaling server yet.</span></div>`),yFe=V(`<div class="cxd-body svelte-18ci53x"><p class="ui-section-label svelte-18ci53x">Session</p> <div class="cxd-row svelte-18ci53x"><span class="cxd-key svelte-18ci53x">State</span> <span class="cxd-val svelte-18ci53x"><!></span></div> <div class="cxd-row svelte-18ci53x"><span class="cxd-key svelte-18ci53x">Your ID</span> <span class="cxd-val cxd-mono svelte-18ci53x"> </span></div> <!> <!> <p class="ui-section-label svelte-18ci53x">Signaling server</p> <!></div>`),bFe=V(`<div class="ui-panel cxd-panel svelte-18ci53x" data-testid="connect-info-drawer"><div class="cxd-tabs svelte-18ci53x" role="tablist"><button role="tab">Info</button> <!> <button role="tab">Toasts<!></button> <span class="flex-1 svelte-18ci53x"></span> <span class="cxd-status svelte-18ci53x"><span class="cxd-sdot svelte-18ci53x"></span> <span class="cxd-slabel svelte-18ci53x"> </span> <!></span> <button aria-label="Pin drawer"><!></button></div> <!></div>`);function xFe(e,n){Ce(n,!0);let i=()=>z(ks,`$pendingApprovals`,S),a=()=>z(as,`$userdata`,S),o=()=>z(Es,`$peers`,S),s=()=>z(cf,`$rolesInfo`,S),c=()=>z(Qo,`$toastStore`,S),l=()=>z(tf,`$drawerSlot`,S),u=()=>z(No,`$connectDrawerTab`,S),d=()=>z(cc,`$connectDrawerOpen`,S),m=()=>z(xC,`$peerServerStatus`,S),h=()=>z(ds,`$waitingForApproval`,S),_=()=>z(Vd,`$sessionHost`,S),v=()=>z(os,`$connectDrawerPinned`,S),y=()=>z(Xv,`$peerQuality`,S),x=()=>z(dre,`$peerJoinedAt`,S),[S,C]=Ve(),w=J(n,`onClose`,3,()=>{}),T=()=>os.update(e=>!e);function E(e,t){ks.set(i().filter(t=>t.peerId!==e.peerId)),a().push([e.peerId,``,``]),o()?.send?.({type:`userdata`,userdata:a()}),o()?.connectToPeer?.(e.peerId,!0),t&&s()?.setRole&&s().setRole(e.peerId,t)}function D(e){ks.set(i().filter(t=>t.peerId!==e.peerId));try{o()?.connections?.[e.peerId]?.close?.()}catch{}}let k=e=>Qo.set(c().filter(t=>t!==e)),A=t(null),ee=q(()=>l()!=null);Qe(()=>{u()===`rooms`&&!Q(ee)&&No.set(`info`)});function M(e){d()&&u()===e?cc.set(!1):(No.set(e),cc.set(!0))}function te(e){let t=e.target;Q(A)&&!Q(A).contains(t)&&!t.closest?.(`#connect-info-button`)&&!t.closest?.(`#connect-rooms-button`)&&w()()}let ne=q(m),P=q(()=>o()?[...o().openedPeers]:[]),re=q(()=>h().filter(e=>e[1]===`pending`)),ie=q(()=>Q(P).length>0?`connected`:Q(re).length>0?`pending`:`idle`),F=q(()=>Q(ie)===`connected`?`Connected`+(Q(P).length>1?` +`+(Q(P).length-1):``):Q(ie)===`pending`?`Waitingâ¦`:`Offline`),ae=q(()=>Q(ie)===`connected`?(_()?`In `+String(_()).toUpperCase()+`'s session`:`You are hosting`)+` · `+Q(P).length+` peer`+(Q(P).length>1?`s`:``):Q(ie)===`pending`?`Waiting for a peer to accept your request`:`Not connected`),oe=q(()=>o()?.peer?.id?String(o().peer.id).toUpperCase():`â¦`),R=e=>a().find(t=>t[0]===e)?.[1]||``;function se(e){if(!e)return``;let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<60?t+`s`:t<3600?Math.round(t/60)+`m`:Math.round(t/3600)+`h`}let ce=q(()=>Q(ne)?Q(ne).host+(Q(ne).port&&Q(ne).port!==443?`:`+Q(ne).port:``)+(Q(ne).path&&Q(ne).path!==`/`?Q(ne).path:``):``),le=t(`â¦`),de=t(`unknown`);async function pe(){I(le,`â¦`),I(de,`unknown`);let e=$ge(Q(ne));if(!e){I(le,null);return}try{let t=performance.now(),n=await fetch(e+(e.includes(`?`)?`&`:`?`)+`ts=`+Date.now(),{cache:`no-store`});I(le,n.ok?Math.round(performance.now()-t):null,!0)}catch{I(le,null)}try{let e=a_e(Q(ne));if(e){let t=await fetch(e,{cache:`no-store`});I(de,t.status===200?`on`:t.status===401?`off`:`unknown`,!0)}}catch{I(de,`unknown`)}}_e(pe);var me=bFe();Z(`pointerdown`,p,te);var V=j(me),he=j(V);let ge;var U=g(he,2),ve=e=>{var t=GPe();let n;O(()=>{n=r(t,1,`cxd-tab svelte-18ci53x`,null,n,{active:d()&&u()===`rooms`}),b(t,`aria-selected`,d()&&u()===`rooms`)}),L(`click`,t,()=>M(`rooms`)),X(e,t)};G(U,e=>{Q(ee)&&e(ve)});var ye=g(U,2);let be;var xe=g(j(ye)),K=e=>{var t=KPe();let n;var a=f(t);O(e=>{n=r(t,1,`cxd-tab-badge svelte-18ci53x`,null,n,{req:i().length>0}),Y(a,`${e??``}${i().length+c().length>9?`+`:``}`)},[()=>Math.min(i().length+c().length,9)]),X(e,t)};G(xe,e=>{i().length+c().length>0&&e(K)}),H(ye);var Se=g(ye,4),we=g(j(Se),2),Ee=f(we,!0),De=g(we,2),Oe=e=>{var t=qPe(),n=f(t);O(()=>Y(n,`${i().length??``} new request${i().length>1?`s`:``}`)),X(e,t)};G(De,e=>{i().length&&e(Oe)}),H(Se);var ke=g(Se,2);let Ae;var je=j(ke);Kx(je,{size:16,"aria-hidden":`true`}),H(ke),H(V);var Ne=g(V,2),Pe=e=>{var t=fe(),n=N(t),r=e=>{var t=JPe(),n=j(t);bo(n,{get mount(){return l()}}),H(t),X(e,t)},a=e=>{var t=aFe(),n=j(t),r=e=>{var t=YPe();X(e,t)},a=e=>{var t=iFe(),n=j(t);B(n,1,i,e=>e.peerId,(e,t)=>{var n=$Pe(),r=j(n),i=g(j(r)),a=f(i,!0),o=g(i),c=e=>{var n=XPe(),r=f(n);O(()=>Y(r,`â ${Q(t).label??``}`)),X(e,n)};G(o,e=>{Q(t).label&&e(c)}),H(r);var l=g(r,2),u=j(l),d=e=>{var n=ZPe(),r=N(n),i=g(r,2);L(`click`,r,()=>E(Q(t),null)),L(`click`,i,()=>E(Q(t),`editor`)),X(e,n)},p=e=>{var n=QPe();L(`click`,n,()=>E(Q(t),null)),X(e,n)};G(u,e=>{s()?e(d):e(p,-1)});var m=g(u,2);H(l),H(n),O(e=>Y(a,e),[()=>String(Q(t).peerId).toUpperCase()]),L(`click`,m,()=>D(Q(t))),X(e,n)});var r=g(n,2);B(r,17,()=>Q(re),e=>e[0],(e,t)=>{var n=eFe(),r=j(n),i=g(j(r)),a=f(i,!0);W(),H(r);var o=g(r,2),s=f(o);H(n),O(e=>Y(a,e),[()=>String(Q(t)[0]).toUpperCase()]),L(`click`,s,()=>Gv(Q(t)[0])),X(e,n)});var a=g(r,2);B(a,1,c,e=>e,(e,t)=>{var n=rFe(),r=j(n),i=f(r,!0),a=g(r,2),o=j(a),s=e=>{var n=fe(),r=N(n);B(r,17,()=>Q(t).actions,Be,(e,n)=>{var r=tFe(),i=f(r,!0);O(()=>Y(i,Q(n).label)),L(`click`,r,()=>{Q(n).action(),k(Q(t))}),X(e,r)}),X(e,n)};G(o,e=>{typeof Q(t)!=`string`&&e(s)});var c=g(o,2),l=e=>{var n=nFe();L(`click`,n,()=>k(Q(t))),X(e,n)};G(c,e=>{(typeof Q(t)==`string`||!Q(t).noClose)&&e(l)}),H(a),H(n),O(()=>{b(n,`data-kind`,Q(t)?.kind===`info`?`info`:`msg`),Y(i,typeof Q(t)==`string`?Q(t):Q(t).text)}),X(e,n)}),H(t),X(e,t)};G(n,e=>{!i().length&&!c().length&&!Q(re).length?e(r):e(a,-1)}),H(t),X(e,t)},o=e=>{var t=yFe(),n=g(j(t),2),r=g(j(n),2),i=j(r),a=e=>{var t=oFe();X(e,t)},o=e=>{var t=sFe();X(e,t)},s=e=>{var t=cFe();X(e,t)};G(i,e=>{Q(ie)===`connected`?e(a):Q(ie)===`pending`?e(o,1):e(s,-1)}),H(r),H(n);var c=g(n,2),l=g(j(c),2),u=f(l,!0);H(c);var d=g(c,2),p=e=>{var t=pFe(),n=N(t),r=g(j(n),2),i=j(r),a=e=>{var t=Te();O((e,n)=>Y(t,`${e??``}${n??``}`),[()=>String(_()).toUpperCase(),()=>R(_())?` (`+R(_())+`)`:``]),X(e,t)},o=e=>{var t=Te(`You are hosting`);X(e,t)};G(i,e=>{_()?e(a):e(o,-1)}),H(r),H(n);var s=g(n,2);B(s,16,()=>Q(P),e=>e,(e,t)=>{let n=q(()=>y()[t]);var r=fFe(),i=j(r),a=f(i,!0),o=g(i,2),s=f(o,!0),c=g(o,2),l=e=>{var t=uFe(),r=N(t),i=f(r),a=g(r,2),o=e=>{var t=lFe();X(e,t)};G(a,e=>{Q(n).relayed&&e(o)}
2293),O((e,t,n)=>{Ze(r,`color: ${e??``}`),b(r,`title`,t),Y(i,`â${n??``}`)},[()=>Dfe(Q(n).level),()=>Q(n).rtt==null?`measuringâ¦`:Math.round(Q(n).rtt)+` ms round-trip`,()=>Q(n).rtt==null?``:` `+Math.round(Q(n).rtt)+`ms`]),X(e,t)};G(c,e=>{Q(n)&&e(l)});var u=g(c,2),d=e=>{var n=dFe(),r=f(n,!0);O(e=>Y(r,e),[()=>se(x()[t])]),X(e,n)};G(u,e=>{x()[t]&&e(d)}),H(r),O((e,t)=>{Y(a,e),Y(s,t)},[()=>String(t).toUpperCase(),()=>R(t)]),X(e,r)}),X(e,t)};G(d,e=>{Q(ie)===`connected`&&e(p)});var m=g(d,2);B(m,17,()=>Q(re),e=>e[0],(e,t)=>{var n=mFe(),r=j(n),i=f(r,!0),a=g(r,4);H(n),O(e=>Y(i,e),[()=>String(Q(t)[0]).toUpperCase()]),L(`click`,a,()=>Gv(Q(t)[0])),X(e,n)});var h=g(m,4),v=e=>{var t=_Fe(),n=N(t),r=g(j(n),2),i=f(r,!0);H(n);var a=g(n,2),o=g(j(a),2),s=f(o,!0);H(a);var c=g(a,2),l=e=>{var t=hFe();X(e,t)};G(c,e=>{Q(ne).didFallback&&e(l)});var u=g(c,2),d=g(j(u),2),p=j(d),m=e=>{var t=Te(`measuringâ¦`);X(e,t)},h=e=>{var t=gFe();X(e,t)},_=e=>{var t=Te();O(()=>Y(t,`~${Q(le)??``} ms`)),X(e,t)};G(p,e=>{Q(le)===`â¦`?e(m):Q(le)===null?e(h,1):e(_,-1)});var v=g(p,2);H(d),H(u);var y=g(u,2),x=g(j(y),2),S=f(x,!0);H(y),O(()=>{b(n,`data-kind`,Q(ne).didFallback?`fallback`:Q(ne).kind),Y(i,Q(ne).didFallback?`public (fallback)`:Q(ne).label),b(o,`title`,Q(ce)),Y(s,Q(ce)),Y(S,Q(de)===`on`?`on (rooms listable)`:Q(de)===`off`?`off`:`â`)}),L(`click`,v,pe),X(e,t)},S=e=>{var t=vFe();X(e,t)};G(h,e=>{Q(ne)?e(v):e(S,-1)}),H(t),O(()=>Y(u,Q(oe))),X(e,t)};G(n,e=>{u()===`rooms`&&Q(ee)?e(r):u()===`toasts`?e(a,1):e(o,-1)}),X(e,t)};G(Ne,e=>{d()&&e(Pe)}),H(me),We(me,e=>I(A,e),()=>Q(A)),O(()=>{ge=r(he,1,`cxd-tab svelte-18ci53x`,null,ge,{active:d()&&u()===`info`}),b(he,`aria-selected`,d()&&u()===`info`),be=r(ye,1,`cxd-tab svelte-18ci53x`,null,be,{active:d()&&u()===`toasts`}),b(ye,`aria-selected`,d()&&u()===`toasts`),b(Se,`data-state`,Q(ie)),b(Se,`title`,Q(ae)),Y(Ee,Q(F)),Ae=r(ke,1,`cxd-pin svelte-18ci53x`,null,Ae,{pinned:v()}),b(ke,`title`,v()?`Unpin (hide tabs when closed)`:`Pin â keep the tabs visible when closed`),b(ke,`aria-pressed`,v())}),L(`click`,he,()=>M(`info`)),L(`click`,ye,()=>M(`toasts`)),L(`click`,ke,T),Me(3,me,()=>ro,()=>({duration:200,easing:eo})),X(e,me),ue(),C()}ge([`click`]);var SFe=V(`<span class="inline-flex items-center gap-1.5" style="white-space: nowrap;"><!> </span>`),zK=V(`<div class="cx-connect inline-flex rounded-md shadow-xs svelte-1b9hig2"><!> <!></div>`),CFe=V(`<span id="connect-retry-chip" class="cx-retry svelte-1b9hig2" data-testid="connect-retry-chip" title="Reconnecting to the signaling server â peers you are already connected to are unaffected"> </span>`),wFe=V(`<button id="connect-refusal-chip" class="cx-refused svelte-1b9hig2" data-testid="connect-refusal-chip" title="Dismiss"> </button>`),TFe=V(`<span data-testid="connect-toast-badge"> </span>`),EFe=V(`<span class="cx-info-warn svelte-1b9hig2" data-testid="connect-info-warn" title="Self-hosted server unreachable â on the public cloud"></span>`),DFe=V(`<button id="connect-rooms-button" data-testid="connect-rooms-button" title="Browse public rooms" aria-label="Browse public rooms"><!>Rooms</button>`),OFe=V(`<span class="connect-divider svelte-1b9hig2"></span> <!>`,1),kFe=V(`<div><div role="group"><!> <span class="connect-divider svelte-1b9hig2"></span> <!> <!> <!> <button id="connect-info-button" data-testid="connect-info-button"><!> <!> <!></button> <!> <!></div> <!></div>`);function AFe(e,n){Ce(n,!0);let i=()=>z(xC,`$peerServerStatus`,T),a=()=>z(Es,`$peers`,T),o=()=>z(ds,`$waitingForApproval`,T),s=()=>z(lre,`$joinRefusal`,T),c=()=>z(Yd,`$approvalStartedAt`,T),l=()=>z(cc,`$connectDrawerOpen`,T),u=()=>z(os,`$connectDrawerPinned`,T),d=()=>z(ns,`$toastsInDrawerOnly`,T),p=()=>z(ks,`$pendingApprovals`,T),m=()=>z(Qo,`$toastStore`,T),h=()=>z(ls,`$showRoomsButton`,T),_=()=>z(Vd,`$sessionHost`,T),v=()=>z(as,`$userdata`,T),y=()=>z(Wd,`$signalingRetry`,T),x=()=>z(tf,`$drawerSlot`,T),S=()=>z(No,`$connectDrawerTab`,T),w=()=>z(sf,`$connectSlot`,T),[T,E]=Ve(),D=t(``),k=t(`Generating...`),A=t(void 0);function ee(){cc.update(e=>!e)}function M(){No.set(`rooms`),cc.set(!0)}Qe(()=>{I(A,Q(k)===`Generating...`?Q(k):Q(k).toUpperCase(),!0)});let te=q(i),ne=q(()=>a()?[...a().openedPeers]:[]),P=q(()=>o().filter(e=>
2293e[1]===`pending`)),re=q(()=>s()?String(s().peerId).slice(0,6).toUpperCase()+(s().result===`full`?`'s session is full (16)`:` declined`):``);Qe(()=>{let e=s()?.at;if(!e)return;let t=setTimeout(()=>{s()?.at===e&&Gd()},2e4);return()=>clearTimeout(t)});let ie=t(Ne(Date.now()));Qe(()=>{if(!Q(P).length)return;let e=setInterval(()=>I(ie,Date.now(),!0),1e3);return()=>clearInterval(e)});let F=q(()=>{Q(ie);let e=Q(P)[0]?.[0];if(!e)return 0;let t=c()[e];return t?Math.ceil(ore(t)/1e3):0}),ae=q(()=>Q(ne).length>0?`connected`:Q(P).length>0?`pending`:`idle`),oe=q(()=>l()||u()),R=q(()=>!l()&&d()?p().length+m().length:0),se=t(null),ce=t(!1),le=0;function de(){if(typeof window>`u`||!Q(se))return;let e=window.innerWidth,t=document.getElementById(`logo-menu`),n=document.getElementById(`notes-toggle`)||document.getElementById(`avatar-menu`),r=t?t.getBoundingClientRect().right:56,i=n?n.getBoundingClientRect().left:e-240;Q(ce)||(le=Math.max(Q(se).scrollWidth,Q(se).offsetWidth));let a=e/2,o=2*Math.min(a-(r+12),i-12-a);I(ce,e<=640||le>o,!0)}Qe(()=>{xs.set(Q(ce))}),Qe(()=>{let e=Q(oe),t=0;Q(ce)&&(t=(Q(se)?.offsetHeight||46)+(e?32:0)),uc.set(t),typeof document<`u`&&(document.documentElement.style.setProperty(`--connect-bottom`,t+`px`),document.documentElement.classList.toggle(`connect-docked`,Q(ce)))}),Qe(()=>{Q(ae),Q(oe),h(),C().then(de)}),_e(()=>{de();let e=typeof ResizeObserver<`u`?new ResizeObserver(()=>de()):null;return e?.observe(document.body),window.addEventListener(`resize`,de),()=>{e?.disconnect(),window.removeEventListener(`resize`,de)}});let fe=q(()=>_()??Q(ne)[0]??null),pe=q(()=>v().find(e=>e[0]===Q(fe))?.[1]||``),B=q(()=>Q(pe)||(Q(fe)?String(Q(fe)).toUpperCase():``)),me=q(()=>_()?`Connected to `+Q(B):`Hosting · `+Q(ne).length+` peer`+(Q(ne).length===1?``:`s`));function V(e){I(k,e,!0)}_e(async()=>{let e=MK();ke(Es,new UPe(e,V));try{let e=!/(\.io|\.app)$/i.test(location.hostname),t=!nt.getItem(`peerServerConfig`),n=nt.getItem(`localPeerNoticeSeen`);e&&t&&!n&&(nt.setItem(`localPeerNoticeSeen`,`1`),es(`It looks like you are running a local build of theprototype. Configure a peer signaling server in Settings for reliable connections â the public PeerJS cloud is not recommended for real use.`,[{label:`Open Settings`,action:()=>{Ss.set(`connection`),dc.set(!0)}}]))}catch{}});let he=e=>{e&&Kv(e)};function ge(){let e=Q(P)[0]?.[0];e&&Gv(e)}function U(e){e.key===`Enter`&&(e.preventDefault(),String(Q(D)??``).trim()&&he(Q(D)))}function ve(){a()?.leaveSession?.(),es(`Left the session â your local scene is kept.`)}let ye=()=>{if(Q(k)===`Generating...`){es(`Still connecting to the signaling server â try again in a moment.`);return}navigator.clipboard&&navigator.clipboard.writeText(window.location.origin+`#`+Q(A)+i_e(Q(te))).then(function(){}).catch(function(){})};var be=kFe();let xe;var K=j(be);let Se;var we=j(K);Do(we,{color:`primary`,class:`nob shrink-0 rounded-lg bg-gray-600 text-gray-900 ring-0 dark:bg-gray-600 dark:text-gray-200`,onclick:ye,title:`Copy your invite link`,children:(e,t)=>{var n=SFe(),r=j(n);oS(r,{size:14,"aria-hidden":`true`});var i=g(r,1,!0);H(n),O(()=>Y(i,Q(A))),X(e,n)},$$slots:{default:!0}});var Ee=g(we,4),J=e=>{var t=zK(),n=j(t);vo(n,{type:`text`,disabled:!0,get title(){return Q(me)},class:`nob cx-input rounded-r-none border-0 opacity-70`,get value(){return Q(me)}});var r=g(n,2);Do(r,{color:`red`,id:`disconnect-button`,class:`nob shrink-0 rounded-l-none rounded-r-lg bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:text-gray-100 dark:hover:bg-red-800`,onclick:ve,title:`Leave the session (your local scene is kept)`,children:(e,t)=>{W();var n=Te(`Disconnect`);X(e,n)},$$slots:{default:!0}}),H(t),X(e,t)},De=e=>{var t=zK(),n=j(t);{let e=q(()=>`Requesting `+String(Q(P)[0]?.[0]??Q(D)??``).toUpperCase()+(Q(F)>0?` · `+Math.floor(Q(F)/60)+`:`+String(Q(F)%60).padStart(2,`0`):``));vo(n,{type:`text`,disabled:!0,title:`Waiting for approval â the request ends by itself if they do not answer`,class:`nob cx-input rounded-r-none border-0 opacity-70`,get value(){return Q(e)}})}var r=g(n,2);Do(r,{color:`yellow`,id:`cancel-request-button`,class:`nob shrink-0 rounded-l-none rounded-r-lg bg-amber-500 text-white hover:bg-amber-600 dar
2293k:bg-amber-600 dark:text-gray-900 dark:hover:bg-amber-500`,onclick:ge,title:`Cancel the connection request`,children:(e,t)=>{W();var n=Te(`Cancel`);X(e,n)},$$slots:{default:!0}}),H(t),X(e,t)},Oe=e=>{var t=zK(),n=j(t);vo(n,{type:`text`,name:`peer-id`,autocomplete:`off`,placeholder:`Enter peer ID to connect`,class:`nob cx-input rounded-r-none border-0`,onkeydown:U,get value(){return Q(D)},set value(e){I(D,e,!0)}});var r=g(n,2);Do(r,{color:`primary`,class:`nob shrink-0 rounded-l-none rounded-r-lg bg-blue-500 text-white dark:bg-blue-700 dark:text-gray-200`,onclick:()=>{he(Q(D))},children:(e,t)=>{W();var n=Te(`Connect`);X(e,n)},$$slots:{default:!0}}),H(t),X(e,t)};G(Ee,e=>{Q(ae)===`connected`?e(J):Q(ae)===`pending`?e(De,1):e(Oe,-1)});var Ae=g(Ee,2),je=e=>{var t=CFe(),n=f(t);O(()=>Y(n,`Reconnecting⦠${y().attempt??``}`)),X(e,t)};G(Ae,e=>{y().retrying&&e(je)});var Me=g(Ae,2),Pe=e=>{var t=wFe(),n=f(t);O(()=>{b(t,`data-result`,s().result),Y(n,`${Q(re)??``} â`)}),L(`click`,t,function(...e){Gd?.apply(this,e)}),X(e,t)};G(Me,e=>{s()&&Q(ae)===`idle`&&e(Pe)});var Fe=g(Me,2);let Ie;var Le=j(Fe);Xx(Le,{size:16,class:`cx-chevron`,"aria-hidden":`true`});var Re=g(Le,2),ze=e=>{var t=TFe();let n;var i=f(t,!0);O(()=>{n=r(t,1,`cx-toast-badge svelte-1b9hig2`,null,n,{req:p().length>0}),Y(i,Q(R)>9?`9+`:Q(R))}),X(e,t)};G(Re,e=>{Q(R)>0&&e(ze)});var Be=g(Re,2),He=e=>{var t=EFe();X(e,t)};G(Be,e=>{Q(te)?.didFallback&&e(He)}),H(Fe);var Ue=g(Fe,2),Z=e=>{var t=DFe();let n;var i=j(t);Yx(i,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),H(t),O(()=>n=r(t,1,`cx-rooms svelte-1b9hig2`,null,n,{active:l()&&S()===`rooms`})),L(`click`,t,M),X(e,t)};G(Ue,e=>{x()&&h()&&e(Z)});var Ge=g(Ue,2),Ke=e=>{var t=OFe(),n=g(N(t),2);bo(n,{get mount(){return w()}}),X(e,t)};G(Ge,e=>{w()&&e(Ke)}),H(K),We(K,e=>I(se,e),()=>Q(se));var qe=g(K,2),Je=e=>{xFe(e,{onClose:()=>cc.set(!1)})};G(qe,e=>{Q(oe)&&e(Je)}),H(be),O(()=>{xe=r(be,1,`connect-wrap svelte-1b9hig2`,null,xe,{docked:Q(ce),"body-open":l()}),Se=r(K,1,`connect-pill svelte-1b9hig2`,null,Se,{"drawer-open":Q(oe),docked:Q(ce)}),b(K,`data-state`,Q(ae)),Ie=r(Fe,1,`cx-toggle svelte-1b9hig2`,null,Ie,{open:l()}),b(Fe,`title`,l()?`Close drawer`:`Open drawer`),b(Fe,`aria-label`,l()?`Close connection drawer`:`Open connection drawer`),b(Fe,`aria-expanded`,l())}),L(`click`,Fe,ee),X(e,be),ue(),E()}ge([`click`]);function BK(e,t,n){let r=[],i=(e,a,o)=>{if(!e||e.userData?.__localOnly||n&&!n.has(e.uuid))return;let s=e.children??[];if(r.push({uuid:e.uuid,depth:a,hasKids:s.length>0,parent:o,name:e.name||e.type||``,object:e}),s.length&&t?.has(e.uuid))for(let t of s)i(t,a+1,e.uuid)};for(let t of e?.children??[])i(t,0,null);return r}function VK(e,t,n){let r=new Set(e??[]);return n?r.add(t):r.delete(t),r}function HK(e,t,n){let r=String(t||``).toLowerCase();if(!r||!e.length)return-1;let i=e.length,a=t.length>1?n:n+1;for(let t=0;t<i;t++){let n=((a+t)%i+i)%i;if(e[n].name.toLowerCase().startsWith(r))return n}return-1}function UK(e,t={}){let n=t.point??null,r=U(Ci),i=t.locked??!!r.find(t=>t[1]===e),a=U(Ui),o=a?.getObjectByProperty(`uuid`,e),s=U(Tc).includes(e),c=r.find(t=>t[1]===e)?.[0],l=i?`Locked by `+hh(c):``,u=t.selection??Zae(),d=u.length>1&&u.includes(e),f=d?u:[e],p=d?` (${f.length})`:``,m=!!(o?.userData?.packStub&&o?.userData?.packRef&&!o.children?.length),h=o?.type===`Group`&&!m,g=e=>()=>f.forEach(e);return[{header:{title:d?f.length+` objects selected`:o?.name||o?.type||`Object`,badge:d?`set`:o?.type,locked:i?hh(c):null}},...i?[{label:`Request control`,icon:`hand`,tooltip:`Ask `+hh(c)+` to hand the object over`,action:()=>hse(e)}]:[],{label:`Focus camera`+p,icon:`focus`,hint:`F`,action:()=>Sm(d?void 0:e)},{label:`Duplicate`+p,icon:`copy`,hint:`Ctrl+D`,action:()=>d?doe():aoe(e)},...d?[{label:`Group selection`+p,icon:`group`,tooltip:`Move the selected objects into one new group`,action:()=>loe()}]:[],...h&&!d?[{label:`Ungroup`,icon:`ungroup`,disabled:i,tooltip:i?l:`Move the children out, then remove the empty group`,action:()=>Xae(e)}]:[],...h&&!d?[{label:`Origin`,icon:`crosshair`,children:[{label:`Centre of children`,tooltip:`Put the group's origin at the centre of what it contains`,disabled:i,action:()=>{zf(e,`children`)!==null&&Yf()}},{label:`World zero`,tooltip:`Put the group's origin at the world origin`,disabled:i,action:()=>{zf(e,`world`),Yf()}},{label:`Reset origin`,disabled:i,action:()=>{Hf(e),Yf()}}]}]:[],...d?[{label:`Pivot point`,icon:`crosshair`,children:[{label:`Median point`,checked:U(Jf)===`median`,action:()=>Jf.set(`median`)},{label:`Active object`,checked:U(Jf)===`active`,action:()=>Jf.set(`active`)},{label:`Parent origin`,checked:U(Jf)===`parent`,disabled:!Qf(),tooltip:Qf()?`Rotate and scale about the common parent's origin`:`The selected objects do not share a parent`,action:()=>Jf.set(`parent`)},{label:`Individual origins`,checked:U(Jf)===`individual`,action:()=>Jf.set(`individual`)}]}]:[],...d||h?[{label:`Convert to mesh`+p,icon:`combine`,disabled:i,tooltip:i?l:`Merge into a single mesh â every material is kept as a slot`,action:()=>noe(f)}]:[],...!d&&o?.userData?.reduced?[{label:`Restore original model`,icon:`history`,disabled:i||!KS(e),tooltip:i?l:KS(e)?`Put back the full `+Number(o.userData.reduced.trianglesBefore).toLocaleStr
2293ing(`en-US`)+`-triangle model it was reduced from (undoable)`:`The original file is held only by whoever imported it, and only until they reload`,action:()=>$(()=>import(`../chunks/WtwIK9_h.js`).then(e=>e.n).then(t=>t.restoreOriginalImport(e)),__vite__mapDeps([196,1,2,6,3,9,0,4,69,44,5,70,20,21,126,100,18,10,19,7,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,116,125,127,128,129,130,131,133,134,135,117,118,119,120,121,136,137,154,123,155,145,146,147,148,149,150,156,157,115,158,112,113,114,122,93,88,94,89,90,91,92,15,159,160,161,162,140,141,138,163,143,164,153,132,139,144,151,152,197,198,199,200]),import.meta.url)}]:[],{label:`Align to ground`+p,icon:`arrow-down-to-line`,disabled:i,tooltip:i?l:`Drop onto the surface below (undoable)`,action:g(e=>uoe(e))},...!d&&o?.userData?.camera?[{label:`Preview camera`,icon:`camera`,tooltip:`Render the scene through this camera (exit from the banner)`,action:()=>$(()=>import(`../chunks/Dl8xgxdz.js`).then(e=>e.i).then(t=>t.startCameraPreview(e)),__vite__mapDeps([216,1,2,9,0,3,4,5,6,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,214,113,114,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,215]),import.meta.url)},{label:`Set from current view`,icon:`focus`,disabled:i,tooltip:i?l:`Move this camera to where you are looking from`,action:()=>$(()=>import(`../chunks/BQtImTAG.js`).then(e=>e.a).then(t=>t.setCameraFromView(e)),__vite__mapDeps([214,1,2,9,0,3,4,5,6,46,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,113,114,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url)}]:[],...m&&!d?[{section:`Loading`},{label:`Retry loading`,icon:`refresh-cw`,tooltip:`Fetch this piece's file again â every copy of the same piece comes back with it`,action:()=>$(()=>import(`../chunks/JVCTHOxB.js`).then(e=>e.l).then(e=>e.retryPlaceholder(o)),__vite__mapDeps([125,1,2,6,9,0,3,4,40,69,44,5,70,20,21,126,100,127,128,129,130,131]),import.meta.url)},{label:`Replace modelâ¦`,icon:`folder-input`,tooltip:`Put a different pack item or library model here, keeping the position, rotation and scale`,action:()=>$(()=>import(`../chunks/BhWU6GAR.js`).then(t=>t.openReplaceModel(e)),[],import.meta.url)}]:[],{section:`Edit`},{label:`Properties`,icon:`sliders-horizontal`,tooltip:`Open the properties panel (double-click does this too)`,action:()=>d?Tm(f,!0):Em(e,!0)},...d?[]:[{label:`Rename`,icon:`pencil`,disabled:i,tooltip:l,action:()=>Ns.set(e)}],...d?[]:[{label:`Edit shader`,icon:`sparkles`,disabled:i||!o?.material||Array.isArray(o?.material),tooltip:i?l:Array.isArray(o?.material)?`Shader graphs support single-material objects for now`:`Author this material as a node graph`,action:()=>{Em(e,!1),$(()=>import(`../chunks/B9ryHuDY.js`).then(e=>e.g).then(e=>e.openShaderEditor()),__vite__mapDeps([145,1,2,6,0,3,4,146,10,147,148,149,9,69,44,5,70,20,21,71,72,73,74,75,76,77,78,67,79]),import.meta.url)}}],...d?[]:[{label:`Edit mesh`,icon:`pen-tool`,disabled:i||!o?.geometry?.attributes?.position,tooltip:i?l:`Drag vertex handles; Esc to finish`,action:()=>gm(e)}],...d||!o?.userData?.spline?.points?.length?[]:[{label:`Edit spline`,icon:`spline`,disabled:i,tooltip:i?l:`Move control points, set thickness, insert or delete points`,action:()=>$(()=>import(`../chunks/veptfTmH.js`).then(t=>t.enterSplineEdit(e)),[],import.meta.url)},{label:`Flatten`,icon:`mountain`,children:[{label:`Terrain to this splineâ¦`,icon:`mountain`,disabled:i,tooltip:i?l:`Then click a terrain: levels a strip under this spline, blended into the slope either side`,action:()=>$(()=>import(`../chunks/CKkrQfIm.js`).then(t=>t.startFlattenPick(`carve`,e)),[],import.meta.url)},{label:`This spline onto a surfaceâ¦`,icon:`spline`,disabled:i,tooltip:i?l:`Then click an object: drops every control point onto it, so the spline comes to rest on the surface and the surface is untouched`,action:()=>$(()=>import(`../chunks/CKkrQfIm.js`).then(t=>t.startFlattenPick(`drape`,e)),[],import.meta.url)}]}],...d?[]:o?.userData?.terrain?[{label:`Sculpt terrain`,icon:`brush`,disabled:i,tooltip:i?l:`Brush raise/lower/smooth/flatten â drag on the terrain`,action:()=>$(()=>import(`../chunks/Clg5P5KY.js`).then(e=>e.m).then(t=>t.enterSculpt(e)),__vite__mapDeps([195,1,2,9,0,3,4,5,6,87,93,16,74,67,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,73,75,76,77,78,79,80,81,82,83,84,85,86,88,94,89,90,91,92,113,114,115,116,117,118,119,120,121,122,15,123,112]),import.meta.url)}]:o?.geometry?.attributes?.position?[{label:`Sculpt mesh`,icon:`brush`,disabled:i,tooltip:i?l:`Brush raise/lower/smooth/flatten along the surface normals`,action:()=>$(()=>import(`../chunks/Clg5P5KY.js`).then(e=>e.m).then(t=>t.enterSculpt(e)),__vite__mapDeps([195,1,2,9,0,3,4,5,6,87,93,16,74,67,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,69,70,71,72,73,75,76,77,78,79,80,81,82,83,84,85,86,88,94,89,90,91,92,113,114,115,116,117,118,119,120,121,122,15,123,112]),import.meta.url)}]:[],{section:`Physics & effects`},...f.length===2||Wf(f).length?[{label:`Physics`,icon:`magnet`,children:[...f.length===2?[{label:`Weld together`,tooltip:`Fixed joint â they move as one during simulations`,action:()=>Uf(`fixed`,f[0],f[1])},...[`x`,`y`,`z`].map(e=>({label:`Hinge (${e.toUpperCase()} axis)`,tooltip:`Revolute joint about the first objectâs local `+e.toUpperCase()+` axis, anchored at the second object`,action:()=>Uf(`revolute`,f[0],f[1],e)}))]:[],...Wf(f).length?[{label:`Detach joints (${Wf(f).length})`,danger:!0,action:()=>nie(f)}]:[]]}]:[],{label:`Effects`,icon:`sparkles`,children:[...Ju.map(e=>({label:e.name+p,tooltip:`Attach a `+e.name+` particle emitter (tweak it in Properties)`,action:g(t=>mh(t,e.key))}
2293)),...f.some(e=>a?.getObjectByProperty(`uuid`,e)?.userData?.particles?.mode===`burst`)?[{label:`Burst now`+p,tooltip:`Fire the burst emitters â every peer sees it`,action:g(e=>ph(e))}]:[],...f.some(e=>a?.getObjectByProperty(`uuid`,e)?.userData?.particles)?[{label:`Remove particles`+p,danger:!0,action:g(e=>fh(e))}]:[]]},{label:(s?`Enable flow effects`:`Disable flow effects`)+p,icon:`workflow`,action:g(e=>Tc.update(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]))},...d?[]:[{label:`Add flow to Scene graph`,icon:`git-branch-plus`,tooltip:`Embed this objectâs flow as a node with its declared inputs/outputs`,action:()=>Promise.all([$(()=>import(`../chunks/aUqMHmzX.js`).then(e=>e.t),__vite__mapDeps([83,1,2,5,6,3,7]),import.meta.url),$(()=>import(`../chunks/BsYsIQqH.js`).then(e=>e.m),__vite__mapDeps([7,1,2,3]),import.meta.url),$(()=>import(`../chunks/C20P4rQ5.js`).then(e=>e.u),__vite__mapDeps([5,1,2,6,3]),import.meta.url)]).then(([t,n,r])=>{if(!n.graphExists(e)){r.showToast(`This object has no flow yet â select it in the Flow editor and click Create flow.`);return}let i=t.addObjectFlowToScene(e,o?.name||o?.type);r.showToast(i?`Object Flow node added to the Scene graph`:`This flow is already embedded in the Scene graph`)})}],{section:`Share`},{label:d?`Ping selection`+p:`Ping this object`,icon:`radar`,tooltip:`Everyone sees a pulse here (Alt+click pings anywhere)`,action:()=>d?Upe(f):Wpe(e)},...d?[]:[{label:`Add note`,icon:`sticky-note`,tooltip:`Pin a synced note exactly where you pointed`,action:()=>Py(e,n)}],{label:`Save asâ¦`+p,icon:`package`,tooltip:`Store this in your Library, or write it straight out as a file`,children:w_e.map(e=>({label:e.label,tooltip:e.tooltip,icon:e.kind===`download`?`arrow-down-to-line`:`package`,action:()=>void C_e(e.id,f,d?void 0:o?.name||o?.type||void 0)}))},{section:` `},{label:`Delete`+p,icon:`trash-2`,hint:`Del`,danger:!0,disabled:i,tooltip:i?l:`A group asks first`,action:()=>{d||Em(e),poe()}}]}function WK(e){let t=null;function n(){t&&!t.keyboard&&(window.addEventListener(`pointermove`,i),t.modal?(window.addEventListener(`pointerdown`,o,!0),window.addEventListener(`keydown`,s,!0)):window.addEventListener(`pointerup`,a))}function r(){window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointerdown`,o,!0),window.removeEventListener(`keydown`,s,!0)}function i(e){l(e)}function a(){d(!0)}function o(e){t?.modal&&(e.preventDefault(),e.stopPropagation(),d(!0))}function s(e){t?.modal&&(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),d(!1)):e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),d(!0)))}function c(r,i={}){if(t)return!1;let a=e.snapshot();if(!a||Array.isArray(a)&&!a.length)return!1;let o={origin:{x:r?.clientX??0,y:r?.clientY??0},snapshot:a,pivot:i.pivot??null,modal:!!i.modal,keyboard:!!i.keyboard||!r,data:i.data??null,dx:0,dy:0,event:r??null};return t=o,e.start?.(o)===!1?(t=null,!1):(n(),e.onActive?.(!0,o.modal),!0)}function l(n){t&&(t.dx=n.clientX-t.origin.x,t.dy=n.clientY-t.origin.y,t.event=n,e.apply(t))}function u(){t&&e.apply(t)}function d(n){let i=t;return i?(t=null,r(),n||e.revert?.(i),e.end?.(i,!!n),e.onActive?.(!1,i.modal),!0):!1}return{begin:c,move:l,refresh:u,finish:d,cancel:()=>d(!1),active:()=>!!t,isModal:()=>!!t?.modal,ctx:()=>t}}var jFe=V(`<button class="w-4 shrink-0 text-center text-[10px] text-gray-400 hover:text-gray-100"><!></button>`),MFe=V(`<span class="w-4 shrink-0"></span>`),NFe=V(`<input class="row-rename ui-input min-w-0 flex-1 px-1 py-0 text-sm"/>`),PFe=V(`<p title="Double-click to rename"> </p>`),FFe=V(`<span class="flex shrink-0 items-center gap-1 pr-1"><span class="h-2 w-2 rounded-full"></span> <!></span> <!>`,1),IFe=V(`<button class="share-local hover:brightness-200" title="Share with peers" aria-label="Share with peers"><!></button>`),LFe=V(`<span class="row-actions hidden shrink-0 items-center gap-1.5 pr-1 group-hover/row:flex svelte-17mw53w"><button class="text-gray-400 hover:text-gray-100"><!></button> <button class="configure hover:brightness-200" title="Properties"><!></button> <!> <button class="delete hover:brightness-200" title="Delete">âï¸</button></span>
2293`),RFe=V(`<div class="ml-3 border-l border-gray-600/40 pl-1" role="group"></div>`),zFe=V(`<div role="treeitem" tabindex="-1"><div role="presentation"><!> <!> <!> <!> <!> <!></div></div> <!>`,1);function GK(e,n){Ce(n,!0);let i=()=>z(ko,`$expandedObjects`,h),a=()=>z(E,`$objectFilter`,h),o=()=>z(Ui,`$objectsGroup`,h),s=()=>z(Bo,`$toggleExpand`,h),c=()=>z(Di,`$selectedObject`,h),l=()=>z(Kr,`$selectedObjects`,h),d=()=>z(Ci,`$lockedObjects`,h),p=()=>z(Ns,`$renamingObject`,h),m=()=>z(zi,`$TControls`,h),[h,_]=Ve(),y=J(n,`flat`,3,!1),x=J(n,`depth`,3,0),S=q(()=>i().has(n.element.uuid));function C(e){i().has(n.element.uuid)!==e&&ko.update(t=>VK(t,n.element.uuid,e))}let w,T=t(null),E=De(`objectFilter`),D=q(()=>!E||!a()||a().has(n.element.uuid)),k=q(()=>(o(),[...n.element?.children??[]])),A=q(()=>(o(),!!n.element?.userData?.__localOnly));Qe(()=>{a()&&n.element.children.length>0&&a().has(n.element.uuid)&&C(!0)});function ee(e){if(mf()){es(`You need edit access to share â ask an admin.`);return}pf(e)&&es(`Shared "`+(e.name||`object`)+`".`)}Qe(()=>{s()===n.element.uuid&&(C(!0),ke(Bo,null))});let M=q(()=>c()?.uuid===n.element.uuid||l().includes(n.element.uuid));Qe(()=>{if(!Q(M)||!Q(T))return;let e=Q(T).closest?.(`[role="tree"]`);e&&e.contains(document.activeElement)&&Q(T).scrollIntoView?.({block:`nearest`})});let te=q(()=>d().find(e=>e[1]===n.element.uuid));function P(e,t=!1){w=c(),Em(e,!1,t)}function re(e,t){t||(w=c()),Em(e.uuid,!0)}function ie(e){e.preventDefault(),ke(qs,{x:e.clientX,y:e.clientY,uuid:n.element.uuid,locked:!!d().find(e=>e[1]===n.element.uuid)})}let F=null,ae={x:0,y:0};function oe(e){e.pointerType!==`mouse`&&(ae={x:e.clientX,y:e.clientY},clearTimeout(F),F=setTimeout(()=>{F=null,ie(e)},450))}function R(e){F&&Math.hypot(e.clientX-ae.x,e.clientY-ae.y)>10&&se()}function se(){clearTimeout(F),F=null}function ce(e){e.focus({preventScroll:!0})}function le(e){let t=e.target.value.trim();t&&t!==n.element.name&&foe(n.element.uuid,t),ke(Ns,null)}let de=t(!1),pe=null;function me(e){e.dataTransfer.setData(`application/x-object-uuid`,n.element.uuid),e.dataTransfer.effectAllowed=`move`,e.stopPropagation()}function V(e){n.element.type===`Group`&&e.dataTransfer.types.includes(`application/x-object-uuid`)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,I(de,!0),!Q(S)&&n.element.children.length>0&&!pe&&(pe=setTimeout(()=>{C(!0),pe=null},600)))}function he(){I(de,!1),clearTimeout(pe),pe=null}function ge(e){if(he(),n.element.type!==`Group`)return;let t=e.dataTransfer.getData(`application/x-object-uuid`);if(!t||t===n.element.uuid)return;e.preventDefault(),e.stopPropagation();let r=o().getObjectByProperty(`uuid`,t);r?.userData?.__localOnly&&!n.element.userData?.__localOnly?pf(r,n.element.uuid):Cm(t,n.element.uuid),C(!0)}function U(e){w&&w.uuid!==e.uuid&&o().getObjectByProperty(`uuid`,w.uuid)?(Di.set(w),m().attach(w),w=null):(As(),m().detach());var t=o().getObjectByProperty(`uuid`,e.uuid);t.parent.parent.parent===null?Gy(`/clear `+t.uuid):(Gy(`/clear `+t.uuid),C(!1),document.getElementById(t.uuid)?.classList.toggle(`hidden`))}var _e=fe(),ve=N(_e),ye=e=>{var t=zFe(),i=N(t),a=j(i),o=j(a),s=e=>{var t=jFe(),n=j(t),r=e=>{Xx(e,{size:14,"aria-hidden":`true`})},i=e=>{tz(e,{size:14,"aria-hidden":`true`})};G(n,e=>{Q(S)?e(r):e(i,-1)}),H(t),O(()=>b(t,`title`,Q(S)?`Collapse group`:`Expand group`)),L(`click`,t,e=>{e.stopPropagation(),C(!Q(S))}),X(e,t)},c=e=>{var t=MFe();X(e,t)};G(o,e=>{n.element.children.length>0?e(s):e(c,-1)});var l=g(o,2),d=e=>{Ake(e,{size:16,class:`w-4 shrink-0 text-center text-purple-300`,"aria-hidden":`true`,title:`Animated model`})},m=e=>{cz(e,{size:16,class:`w-4 shrink-0 text-center text-sky-300`,"aria-hidden":`true`,title:`Group`})},h=q(()=>n.element.type.endsWith(`Group`)),_=e=>{Ez(e,{size:16,class:`w-4 shrink-0 text-center text-yellow-300`,"aria-hidden":`true`,title:`Light`})},w=q(()=>n.element.type.endsWith(`Light`)),E=e=>{sS(e,{size:16,class:`w-4 shrink-0 text-center text-gray-400`,"aria-hidden":`true`,title:`Object`})};G(l,e=>{n.element.userData?.animatedClips?e(d):Q(h)?e(m,1):Q(w)?e(_,2):e(E,-1)});var D=g(l,2),F=e=>{Dz(e,{size:16,class:`w-3 shrink-0 text-center text-[10px] text-amber-400`,"aria-hidden":`true`,title:`Local only (not shared with peers)`})};G(D,e=>{Q(A)&&e(F)});var ae=g(D,2),ue=e=>{aS(e,{size:16,class:`hidden-marker w-3 shrink-0 text-center text-[10px] text-gray-500`,"aria-hidden":`true`,title:`Hidden`})};G(ae,e=>{n.element.visible===!1&&e(ue)});var z=g(ae,2),fe=e=>{var t=NFe();v(t),Fe(t,!0),ne(t,e=>ce?.(e)),O(()=>u(t,n.element.name)),L(`keydown`,t,e=>{e.key===`Enter`&&le(e),e.key===`Escape`&&ke(Ns,null)}),Z(`blur`,t,le),L(`click`,t,e=>e.stopPropagation()),X(e,t)},pe=e=>{var t=PFe(),i=f(t,!0);O(()=>{r(t,1,`row-name min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left `+(n.element.visible===!1?`italic opacity-50`:``),`svelte-17mw53w`),Y(i,n.element.name)}),L(`dblclick`,t,()=>{Q(te)||ke(Ns,n.element.uuid)}),X(e,t)};G(z,e=>{p()===n.element.uuid?e(fe):e(pe,-1)});var _e=g(z,2),ve=e=>{var t=FFe(),n=N(t),r=j(n),i=g(r,2);Ux(i,{size:16,class:`text-gray-400`,"aria-hidden":`true`}),H(n);var a=g(n,2);ho(a,{placement:`left`,arrow:!1,children:(e,t)=>{W();var n=Te();O(e=>Y(n,`Locked by ${e??``} â right-click to request control`),[()=>hh(Q(te)[0])]),X(e,n)},$$slots:{default:!0}}),O(e=>Ze(r,e),[()=>`background:`+gh(Q(te)[0])]),X(e,t)},ye=e=>{var t=LFe(),r=j(t),i=j(r),a=e=>{aS(e,{size:14,"aria-hidden":`true`})},o=e=>{Wx(e,{size:14,"aria-hidden":`true`})};G(i,e=>{n.element.visible===!1?e(a):e(o,-1)}),H(r);var s=g(r,2);bz(j(s),{size:14,"aria-hidden":`true`}),H(s);var c=g(s,2),l=e=>{var t=IFe(),r=j(t);ES(r,{size:16,class:`text-primary-300`,"aria-hidden":`true`}),H(t),L(`click`,t,e=>{e.stopPropagation(),ee(n.element)}),X(e,t)},u=q(()=>Q(A)&&!mf());G(c,e=>{Q(u)&&e(l)});var d=g(c,2);H(t),O(()=>b(r,`title`,n.element.visible===!1?`Show`:`Hide`)),L(`click`,r,e=>{e.stopPropagation(),$ae(n.element.uuid)}),L(`click`,s,e=>
2293{e.stopPropagation(),re(n.element)}),L(`click`,d,e=>{e.stopPropagation(),U(n.element)}),X(e,t)};G(_e,e=>{Q(te)?e(ve):e(ye,-1)}),H(a),H(i),We(i,e=>I(T,e),()=>Q(T));var be=g(i,2),xe=e=>{var t=RFe();B(t,21,()=>Q(k),e=>e.uuid,(e,t)=>{GK(e,{get element(){return Q(t)}})}),H(t),X(e,t)};G(be,e=>{Q(S)&&!y()&&e(xe)}),O(()=>{b(i,`id`,n.element.uuid),r(i,1,`group/row select-none `+(Q(de)?`rounded-sm outline-solid outline-2 outline-primary-400 bg-primary-900/20 `:``)+(Q(te)?``:`cursor-grab active:cursor-grabbing`),`svelte-17mw53w`),b(i,`aria-selected`,Q(M)),b(i,`aria-expanded`,n.element.children.length>0?Q(S):void 0),b(i,`draggable`,!Q(te)),r(a,1,`flex w-full items-center gap-1 rounded-sm px-1 py-0.5 text-sm `+(Q(M)?`bg-primary-900/50 text-primary-100`:`text-gray-800 hover:bg-gray-200 dark:text-gray-200 dark:hover:bg-gray-600/50`),`svelte-17mw53w`),Ze(a,x()?`padding-left:`+(x()*12+4)+`px`:``)}),L(`contextmenu`,i,ie),Z(`dragstart`,i,me),Z(`dragover`,i,V),Z(`dragleave`,i,he),Z(`drop`,i,ge),L(`pointerdown`,i,oe),L(`pointermove`,i,R),L(`pointerup`,i,se),Z(`pointercancel`,i,se),Z(`pointerleave`,i,se),L(`click`,a,e=>{P(n.element.uuid,e.shiftKey)}),X(e,t)};G(ve,e=>{Q(D)&&e(ye)}),X(e,_e),ue(),_()}ge([`contextmenu`,`pointerdown`,`pointermove`,`pointerup`,`click`,`keydown`,`dblclick`]);var BFe=V(`<button class="rounded-sm bg-primary-700 px-1.5 py-0.5 text-[10px] text-white hover:bg-primary-600" title="Share all with peers">Share all</button>`),VFe=V(`<p class="px-2 pb-1.5 text-[10px] italic text-gray-400"> </p>`),HFe=V(`<div class="pb-1"></div>`),UFe=V(`<div role="group"><div class="flex items-center gap-1.5 px-1.5 py-1"><!> <span class="min-w-0 flex-1 text-xs font-medium text-amber-200">Local objects <span class="rounded-full bg-amber-500/30 px-1.5 text-[10px]"> </span></span> <!></div> <!></div>`);function WFe(e,n){Ce(n,!0);let i=()=>z(Ui,`$objectsGroup`,s),a=()=>z(cf,`$rolesInfo`,s),o=()=>z(sc,`$showLocalObjects`,s),[s,c]=Ve(),l=t(!1),u=q(()=>(i()?.children||[]).filter(e=>e?.userData?.__localOnly)),d=q(()=>a()?.myRole===`viewer`);function p(){let e=U(Ui);e&&Ui.set(e)}let m=()=>{try{return crypto.randomUUID()}catch{return Date.now()+`-`+Math.random().toString(16).slice(2)}};function h(){if(Q(d))return es(`You need edit access to share â ask an admin.`);for(let e of[...Q(u)])pf(e);es(`Shared all local objects with peers.`),p()}function _(e){let t=e.clone();t.traverse?.(e=>e.uuid=m()),t.uuid=m(),t.name=(e.name||`Object`)+` (local)`,ff(t),U(Ui)?.add(t),es(`Local copy created.`),p()}function v(e){e.preventDefault(),e.stopPropagation(),I(l,!1);let t=e.dataTransfer?.getData(`application/x-object-uuid`),n=t&&U(Ui)?.getObjectByProperty(`uuid`,t);if(n){if(n.userData?.__localOnly){n.parent&&n.parent!==U(Ui)&&(Cm(t,`root`),p());return}if(Q(d))es(`Create a local copy of "`+(n.name||`object`)+`"? The original stays shared.`,[{label:`Create copy`,action:()=>_(n)}]);else{try{U(Es)?.send({type:`delete`,uuid:n.uuid,peerId:U(Es)?.peer?.id})}catch(e){console.warn(e)}ff(n),es(`"`+(n.name||`object`)+`" moved to local objects (removed for peers).`),p()}}}function y(e){e.dataTransfer?.types?.includes(`application/x-object-uuid`)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,I(l,!0))}var b=fe(),x=N(b),S=e=>{var t=UFe(),n=j(t),i=j(n);Dz(i,{size:16,class:`text-amber-300`,"aria-hidden":`true`,style:`font-size:10px`});var a=g(i,2),o=g(j(a)),s=f(o,!0);H(a);var c=g(a,2),p=e=>{var t=BFe();L(`click`,t,h),X(e,t)};G(c,e=>{Q(u).length>0&&!Q(d)&&e(p)}),H(n);var m=g(n,2),_=e=>{var t=VFe(),n=f(t,!0);O(()=>Y(n,Q(d)?`Objects you create stay here (view-only). Drag a shared object here to make a local copy.`:`Drag an object here to keep it on your machine only (removes it for peers).`)),X(e,t)},b=e=>{var t=HFe();B(t,21,()=>Q(u),e=>e.uuid,(e,t)=>{GK(e,{get element(){return Q(t)}})}),H(t),X(e,t)};G(m,e=>{Q(u).length===0?e(_):e(b,-1)}),H(t),O(()=>{r(t,1,`local-objs mb-1 rounded-sm border `+(Q(l)?`border-primary-400 bg-primary-900/20`:`border-amber-500/30 bg-amber-500/5`)),Y(s,Q(u).length)}),Z(`dragover`,t,y),Z(`dragleave`,t,()=>I(l,!1)),Z(`drop`,t,v),X(e,t)};G(x,e=>{o()&&e(S)}),X(e,b),ue(),c()}ge([`click`]);var GFe=V(`<p class="module-content-child truncate text-xs text-gray-400"> </p>`),KFe=V(`<p class="module-content-more pl-8 text-xs italic text-gray-400"> </p>`),qFe=V(`<p class="pl-8 text-xs italic text-gray-400">No named parts</p>`),JFe=V(`<!> <!> <!>`,1),YFe=V(`<div class="module-content-row"><div><button type="button" class="w-4 shrink-0 text-gray-400"><!></button> <!> <button type="button"> </button> <span class="module-content-badge shrink-0 rounded-sm bg-gray-200 px-1 text-[10px] text-gray-600 dark:bg-gray-600 dark:text-gray-200"> </span> <button type="button" class="shrink-0 text-gray-400"><!></button></div> <!></div>
2293`),XFe=V(`<div id="module-content" class="mt-1 border-t border-gray-300 pt-1 dark:border-gray-600"><button id="module-content-head" type="button" class="flex w-full items-center gap-1 px-1 py-0.5 text-left text-[11px] font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400" title="Content built by modules â listed read-only; the module owns it"><!> Module content <span class="ml-auto font-normal normal-case text-gray-400"> </span></button> <!></div>`),ZFe=V(`<!> <!>`,1);function QFe(e,n){Ce(n,!0);let i=()=>z(Hee,`$moduleGroupsRevision`,c),a=()=>z(Yr,`$sceneRevision`,c),o=()=>z(wl,`$moduleToolboxes`,c),s=()=>z(ml,`$moduleSelection`,c),[c,l]=Ve(),u=t([]),d=t(nt.getItem(`objects:moduleContent`)!==`closed`),p=t(Ne({})),m=t(null);function h(){I(u,Wee(U(Pi)))}Qe(()=>{i(),a(),h()}),Qe(()=>{let e=setInterval(()=>{let e=document.getElementById(`module-content`);Q(u).length&&e&&e.offsetParent===null||h()},1e3);return()=>clearInterval(e)});function _(){I(d,!Q(d)),nt.setItem(`objects:moduleContent`,Q(d)?`open`:`closed`)}function v(e){if(!e||e.isEmpty?.())return;let t=e.getCenter(new hn),n=Math.max(e.getSize(new hn).length(),2);xm([t.x+n*.6,t.y+n*.45,t.z+n*.6],t.toArray())}
2293function y(e){bm(),v(pl(e.name)),Ro(`properties`)}function x(e){return o().find(t=>t.moduleId===e.moduleId)??null}function S(e){e.object.visible=!e.object.visible,h()}function C(e){let t=x(e);return[{label:`Frame it`,action:()=>y(e)},...t?[{label:`Open `+t.title,action:()=>Tl(t.id)}]:[],{label:e.visible?`Hide in viewport (this device)`:`Show in viewport`,action:()=>S(e)}]}function w(e,t){let n=t,r=e=>{e.preventDefault(),e.stopPropagation(),I(m,{x:e.clientX,y:e.clientY,row:n})};return e.addEventListener(`contextmenu`,r),{update(e){n=e},destroy(){e.removeEventListener(`contextmenu`,r)}}}var T=ZFe(),E=N(T),D=e=>{var t=XFe(),n=j(t),i=j(n),a=e=>{Xx(e,{size:14,"aria-hidden":`true`})},o=e=>{tz(e,{size:14,"aria-hidden":`true`})};G(i,e=>{Q(d)?e(a):e(o,-1)});var c=g(i,2),l=f(c,!0);H(n);var m=g(n,2),h=e=>{var t=fe(),n=N(t);B(n,17,()=>Q(u),e=>e.name,(e,t)=>{var n=YFe(),i=j(n),a=j(i),o=j(a),c=e=>{Xx(e,{size:14,"aria-hidden":`true`})},l=e=>{tz(e,{size:14,"aria-hidden":`true`})};G(o,e=>{Q(p)[Q(t).name]?e(c):e(l,-1)}),H(a);var u=g(a,2);cS(u,{size:14,class:`shrink-0 text-gray-400`,"aria-hidden":`true`});var d=g(u,2);let m;var h=f(d,!0),_=g(d,2),v=f(_,!0),x=g(_,2),C=j(x),T=e=>{Wx(e,{size:14,"aria-hidden":`true`})},E=e=>{aS(e,{size:14,"aria-hidden":`true`})};G(C,e=>{Q(t).visible?e(T):e(E,-1)}),H(x),H(i);var D=g(i,2),k=e=>{var n=JFe(),r=N(n);B(r,17,()=>Q(t).children,e=>e.uuid,(e,t)=>{var n=GFe(),r=f(n,!0);O(()=>{Ze(n,`padding-left:`+(Q(t).depth*12+20)+`px`),Y(r,Q(t).name)}),X(e,n)});var i=g(r,2),a=e=>{var n=KFe(),r=f(n);O(()=>Y(r,`+${Q(t).more??``} more`)),X(e,n)};G(i,e=>{Q(t).more&&e(a)});var o=g(i,2),s=e=>{var t=qFe();X(e,t)};G(o,e=>{!Q(t).children.length&&!Q(t).more&&e(s)}),X(e,n)};G(D,e=>{Q(p)[Q(t).name]&&e(k)}),H(n),ne(n,(e,t)=>w?.(e,t),()=>Q(t)),O(()=>{b(n,`data-group`,Q(t).name),b(n,`data-module`,Q(t).moduleId),r(i,1,`flex items-center gap-1 rounded-sm px-1 py-0.5 text-sm text-gray-800 dark:text-gray-200 `+(s()?.name===Q(t).name?`bg-primary-600/30`:`hover:bg-gray-200 dark:hover:bg-gray-600`)),b(a,`aria-label`,Q(p)[Q(t).name]?`Hide children`:`Show children`),m=r(d,1,`module-content-name min-w-0 flex-1 truncate text-left`,null,m,{"opacity-50":!Q(t).visible}),b(d,`title`,`Made by the `+Q(t).moduleName+` module â click to select and frame it`),Y(h,Q(t).label),Y(v,Q(t).moduleName),b(x,`title`,Q(t).visible?`Hide in the viewport (this device only)`:`Show in the viewport`),b(x,`aria-label`,Q(t).visible?`Hide in the viewport`:`Show in the viewport`)}),L(`click`,a,()=>I(p,{...Q(p),[Q(t).name]:!Q(p)[Q(t).name]},!0)),L(`click`,d,()=>y(Q(t))),L(`click`,x,()=>S(Q(t))),X(e,n)}),X(e,t)};G(m,e=>{Q(d)&&e(h)}),H(t),O(()=>{b(n,`aria-expanded`,Q(d)),Y(l,Q(u).length)}),L(`click`,n,_),X(e,t)};G(E,e=>{Q(u).length&&e(D)});var k=g(E,2),A=e=>{{let t=q(()=>C(Q(m).row));xS(e,{get x(){return Q(m).x},get y(){return Q(m).y},get items(){return Q(t)},sizeKey:`object`,onclose:()=>I(m,null)})}};G(k,e=>{Q(m)&&e(A)}),X(e,T),ue(),l()}ge([`click`]);var $Fe=V(`<button id="mobile-add-button" class="mobile-hud-btn fixed bottom-16 left-4 z-30 flex h-11 w-11 items-center justify-center rounded-full bg-gray-700 text-white shadow-lg transition-colors hover:bg-gray-600" title="Add / context menu" aria-label="Add object or open the context menu"><!></button>`);function eIe(e,t){Ce(t,!1);let n=()=>z(Uo,`$viewportMenuOpener`,r),[r,i]=Ve();function a(){let e=document.getElementById(`mobile-add-button`)?.getBoundingClientRect(),t=rte();n()?.(t.x,t.y,!0,e?.left??16,e?.top??window.innerHeight-60)}R();var o=$Fe(),s=j(o);rS(s,{size:16,"aria-hidden":`true`}),H(o),L(`click`,o,a),X(e,o),ue(),i()}ge([`click`]);var tIe=V(`<button id="ai-hud-button" class="mobile-hud-btn fixed bottom-4 left-4 z-30 flex h-11 w-11 items-center justify-center rounded-full bg-gray-700 text-white shadow-lg transition-colors hover:bg-gray-600" title="AI assistant" aria-label="Open the AI assistant chat"><!></button>`);function nIe(e,t){Ce(t,!1);let n=()=>z(ys,`$aiAssistantHidden`,r),[r,i]=Ve();function a(){if(!Fh()){es(`Enable an AI provider in Settings to use the assistant`),Ss.set(`ai`),dc.set(!0);return}ys.set(n()===``?`hidden`:``)}R();var o=tIe(),s=j(o);gS(s,{size:18,class:`text-primary-500`,"aria-hidden":`true`}),H(o),L(`click`,o,a),X(e,o),ue(),i()}ge([`click`]);var rIe=V(`<button id="sim-reset" aria-label="Reset simulation" title="Reset â restore the initial layout"><!></button> <button id="sim-pause"><!></button> <button id="sim-stop" aria-label="Stop simulation" title="Stop â Ctrl+Z restores the layout"><!></button>`,1),iIe=V(`<button id="sim-play" aria-label="Simulate physics"><!></button>
2293`),aIe=V(`<div id="sim-controls" class="fixed bottom-[112px] right-4 z-30 flex flex-col gap-1.5"><!></div>`);function oIe(e,t){Ce(t,!1);let n=()=>z(Io,`$showSimControls`,s),i=()=>z(lh,`$simulating`,s),a=()=>z(Xm,`$simPaused`,s),o=()=>z(th,`$remoteSimulating`,s),[s,c]=Ve(),l=`flex h-9 w-9 items-center justify-center rounded-full bg-gray-700 text-white shadow-lg transition-colors hover:bg-gray-600`;R();var u=fe(),d=N(u),f=e=>{var t=aIe(),n=j(t),s=e=>{var t=rIe(),n=N(t);r(n,1,M(l));var i=j(n);OS(i,{size:16,class:`text-xs`,"aria-hidden":`true`}),H(n);var o=g(n,2);r(o,1,M(l));var s=j(o),c=e=>{gz(e,{size:16,"aria-hidden":`true`})},u=e=>{hz(e,{size:16,"aria-hidden":`true`})};G(s,e=>{a()?e(c):e(u,-1)}),H(o);var d=g(o,2);r(d,1,l+` bg-red-700 hover:bg-red-600`);var f=j(d);_S(f,{size:16,class:`text-xs`,"aria-hidden":`true`}),H(d),O(()=>{b(o,`aria-label`,a()?`Resume simulation`:`Pause simulation`),b(o,`title`,a()?`Resume`:`Pause`)}),L(`click`,n,()=>uh()),L(`click`,o,()=>rh()),L(`click`,d,()=>Zm()),X(e,t)},c=e=>{var t=iIe();r(t,1,M(l)),gz(j(t),{size:16,class:`text-xs`,"aria-hidden":`true`}),H(t),O(e=>{t.disabled=!!o(),b(t,`title`,e)},[()=>o()?hh(o())+` is simulating`:`Simulate physics (P) â dynamic objects fall and collide`]),L(`click`,t,()=>Zm()),X(e,t)};G(n,e=>{i()?e(s):e(c,-1)}),H(t),X(e,t)};G(d,e=>{n()&&e(f)}),X(e,u),ue(),c()}ge([`click`]);var KK=44,qK=64,sIe=320,JK=2,YK=3,XK=.15,ZK={left:[],right:[]},QK=new Map;function $K(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).slice(0,JK):typeof e==`string`&&e?[e]:[]}try{let e=JSON.parse(nt.getItem(`dockedWindows`)??`null`);e&&(ZK={left:$K(e.left),right:$K(e.right)})}catch{}function eq(){nt.setItem(`dockedWindows`,JSON.stringify(ZK))}function cIe(e){let t=parseInt(nt.getItem(`dockWidth:`+e)??`300`);return Math.min(Math.max(Number.isNaN(t)?300:t,250),Math.round(window.innerWidth*.4))}function lIe(e){let t=parseFloat(nt.getItem(`dockSplit:`+e)??`0.5`);return Math.min(Math.max(Number.isNaN(t)?.5:t,XK),.85)}function uIe(){return U(Ho)===!1}function dIe(){if(U(Ms)!==!1)return 0;let e=typeof document<`u`?document.querySelector(`.app-sidebar`):null;return e?Math.round(e.getBoundingClientRect().right)+8:228}function tq(e){return ZK.left.includes(e)?`left`:ZK.right.includes(e)?`right`:null}function nq(){for(let[e]of QK)aq(e)}function rq(e){for(let t of ZK[e])aq(t)}var iq=`(100vh - ${qK}px - var(--bottom-inset, 0px))`;function aq(e){let t=QK.get(e);if(!t)return;let n=tq(e),{node:r}=t;if(!n){delete r.dataset.docked,delete r.dataset.dockSlot,t.handle?.remove(),t.handle=null,t.divider?.remove(),t.divider=null;return}let i=cIe(ZK[n][0]??e),a=ZK[n],o=a.indexOf(e),s=a.length>1,c=lIe(n);r.dataset.docked=n,r.style.position=`fixed`,r.style.maxWidth=`none`,r.style.maxHeight=`none`,r.style.width=i+`px`,r.style.zIndex=`30`,s?o===0?(r.dataset.dockSlot=`top`,r.style.top=`64px`,r.style.height=`calc(${iq} * ${c} - ${YK}px)`):(r.dataset.dockSlot=`bottom`,r.style.top=`calc(${qK}px + ${iq} * ${c} + ${YK}px)`,r.style.height=`calc(${iq} * ${1-c} - ${YK}px)`):(delete r.dataset.dockSlot,r.style.top=`64px`,r.style.height=`calc(100vh - ${qK}px - var(--bottom-inset, 0px))`);let l=n===`right`&&uIe()?sIe:0;if(r.style.left=n===`left`?dIe()+`px`:window.innerWidth-i-l+`px`,r.style.right=`auto`,!t.handle){let n=document.createElement(`div`);n.className=`dock-resize resize-cue`,n.style.cssText=`position:absolute;top:0;bottom:0;width:6px;cursor:ew-resize;touch-action:none;z-index:5;`,n.addEventListener(`pointerdown`,t=>{t.preventDefault(),t.stopPropagation(),n.setPointerCapture(t.pointerId);let i=t.clientX,a=r.offsetWidth,o=tq(e),s=t=>{let n=o===`left`?t.clientX-i:i-t.clientX,r=Math.min(Math.max(250,a+n),Math.round(window.innerWidth*.4));for(let t of o?ZK[o]:[e])nt.setItem(`dockWidth:`+t,String(r));o?rq(o):aq(e)},c=()=>{n.removeEventListener(`pointermove`,s),n.removeEventListener(`pointerup`,c)};n.addEventListener(`pointermove`,s),n.addEventListener(`pointerup`,c)}),r.appendChild(n),t.handle=n}if(t.handle.style.left=n===`left`?`auto`:`-3px`,t.handle.style.right=n===`left`?`-3px`:`auto`,s&&o===0){if(!t.divider){let n=document.createElement(`div`);n.className=`dock-split-divider resize-cue`,n.style.cssText=`position:absolute;
2293left:0;right:0;bottom:0;height:7px;cursor:ns-resize;touch-action:none;z-index:5;`,n.addEventListener(`pointerdown`,t=>{t.preventDefault(),t.stopPropagation(),n.setPointerCapture(t.pointerId);let r=tq(e);if(!r)return;let i=parseFloat(getComputedStyle(document.documentElement).getPropertyValue(`--bottom-inset`))||0,a=Math.max(1,window.innerHeight-qK-i),o=e=>{let t=Math.min(Math.max((e.clientY-qK)/a,XK),.85);nt.setItem(`dockSplit:`+r,String(Math.round(t*1e3)/1e3)),rq(r)},s=()=>{n.removeEventListener(`pointermove`,o),n.removeEventListener(`pointerup`,s)};n.addEventListener(`pointermove`,o),n.addEventListener(`pointerup`,s)}),r.appendChild(n),t.divider=n}}else t.divider&&=(t.divider.remove(),null)}function fIe(e){(QK.get(e)?.node)?.animate([{transform:`translateX(0)`},{transform:`translateX(-8px)`},{transform:`translateX(8px)`},{transform:`translateX(0)`}],{duration:220})}function pIe(e,t,n=`bottom`){let r=QK.get(e);if(!r)return!1;let i=ZK[t].filter(t=>t!==e);if(i.length>=JK)return fIe(i[i.length-1]),!1;let a=tq(e);return a&&(ZK[a]=ZK[a].filter(t=>t!==e)),(!a||a!==t||r.prevRect==null)&&(r.prevRect={left:r.node.style.left,top:r.node.style.top,width:r.node.style.width,height:r.node.style.height,zIndex:r.node.style.zIndex}),ZK[t]=n===`top`?[e,...i]:[...i,e],eq(),a&&a!==t&&rq(a),rq(t),!0}function mIe(e,t,n){let r=tq(e);
2293if(!r)return;ZK[r]=ZK[r].filter(t=>t!==e),eq();let i=QK.get(e);if(i){let{node:e,prevRect:r}=i;delete e.dataset.docked,delete e.dataset.dockSlot,i.handle?.remove(),i.handle=null,i.divider?.remove(),i.divider=null,e.style.height=r?.height||``,e.style.width=r?.width||``,e.style.maxWidth=``,e.style.maxHeight=``,e.style.zIndex=r?.zIndex||`40`,e.style.left=(t==null?parseFloat(r?.left)||200:Math.max(0,t-120))+`px`,e.style.top=(n==null?parseFloat(r?.top)||120:Math.max(0,n-12))+`px`}rq(r)}var oq=null;function sq(e){if(!e){oq?.remove(),oq=null;return}oq||(oq=document.createElement(`div`),oq.id=`dock-zone`,oq.style.cssText=`position:fixed;z-index:29;pointer-events:none;background:rgb(37 99 235 / .25);border:2px dashed rgb(96 165 250 / .8);`,document.body.appendChild(oq));let{side:t,split:n}=e;if(n){let e=n.node.getBoundingClientRect();oq.dataset.split=n.slot,oq.style.top=(n.slot===`top`?e.top:e.top+e.height/2)+`px`,oq.style.height=e.height/2+`px`,oq.style.bottom=`auto`,oq.style.left=e.left+`px`,oq.style.right=`auto`,oq.style.width=e.width+`px`,oq.textContent=`â Split panel`,oq.style.cssText+=`display:flex;align-items:center;justify-content:center;color:white;font-size:11px;font-weight:600;`}else delete oq.dataset.split,oq.textContent=``,oq.style.top=`64px`,oq.style.bottom=`0`,oq.style.height=`auto`,oq.style.width=`80px`,oq.style.left=t===`left`?`0`:`auto`,oq.style.right=t===`right`?`0`:`auto`}var cq=!1,hIe=()=>typeof window<`u`&&!!window.matchMedia&&window.matchMedia(`(pointer: coarse)`).matches;function lq(e,{key:t}){if(QK.set(t,{node:e,prevRect:null,handle:null,divider:null}),hIe())return{destroy(){QK.delete(t)}};cq||(cq=!0,Ho.subscribe(()=>nq()),Ms.subscribe(()=>{nq(),requestAnimationFrame(nq)}),window.addEventListener(`resize`,nq));let n=tq(t);n&&rq(n);let r=!1,i=e=>{if(e.target.closest(`.move-handle`)&&e.button===0){if(tq(t)){e.stopImmediatePropagation();let n=e.clientX,r=e.clientY,i=e=>{Math.hypot(e.clientX-n,e.clientY-r)>40&&(mIe(t,e.clientX,e.clientY),a())},a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a)};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a);return}r=!0}},a=e=>vS(t,e.clientY)?null:e.clientX<KK?`left`:e.clientX>window.innerWidth-KK?`right`:null,o=e=>{if(vS(t,e.clientY))return null;for(let n of[`left`,`right`]){let r=ZK[n].filter(e=>e!==t);if(r.length!==1)continue;let i=QK.get(r[0])?.node;if(!i?.isConnected)continue;let o=i.getBoundingClientRect();if(o.width===0)continue;let s=e.clientX>=o.left&&e.clientX<=o.right&&e.clientY>=o.top&&e.clientY<=o.bottom,c=a(e)===n;if(s||c)return{side:n,node:i,slot:s&&e.clientY<o.top+o.height/2?`top`:`bottom`}}return null},s=e=>{let t=o(e);if(t)return{side:t.side,split:{node:t.node,slot:t.slot}};let n=a(e);return n?{side:n}:null},c=e=>{r&&sq(s(e))},l=e=>{if(!r)return;r=!1,sq(null);let n=s(e);n&&pIe(t,n.side,n.split?.slot??`bottom`)};return e.addEventListener(`pointerdown`,i,!0),window.addEventListener(`pointermove`,c),window.addEventListener(`pointerup`,l),{destroy(){e.removeEventListener(`pointerdown`,i,!0),window.removeEventListener(`pointermove`,c),window.removeEventListener(`pointerup`,l),QK.delete(t);let n=tq(t);n&&rq(n)}}}var gIe=V(`<span class="pointer-events-none relative inline-flex select-none items-center justify-center"><!> <span class="absolute text-[10px] font-bold leading-none text-white" style="left: 29%; top: 50%; transform: translate(-50%, -50%)">A</span> <span class="absolute text-[10px] font-bold leading-none text-white" style="left: 71%; top: 50%; transform: translate(-50%, -50%)">R</span></span>`),_Ie=V(`<div class="relative flex h-full w-10 items-stretch justify-center"><div></div> <div></div> <p id="play-button" style="position: absolute; height: 50px; width: 50px; top: -5px; left: 50%; z-index: var(--z-hud); 2294 display: flex; transition: transform 100ms"><!></p></div>`),vIe=V(`<button type="button"><!></button>`),yIe=V(`<p><!></p>`),bIe=V(`<input id="object-search" class="ui-input w-36 py-0.5 font-normal normal-case tracking-normal" placeholder="Search objectsâ¦"/>`),uq=V(`<button> </button>`),xIe=V(`<span class="shrink-0 text-gray-500 dark:text-gray-300"> </span>`),SIe=V(`<label class="flex cursor-pointer items-center gap-2 text-gray-700 dark:text-gray-200"><input type="checkbox"/> </label>`),CIe=V(`<div id="chip-popup" class="absolute right-0 top-6 z-10 flex w-44 flex-col gap-1 rounded-lg border border-gray-300 bg-white p-2 shadow-xl dark:border-gray-600 dark:bg-gray-800"><!> <button id="reset-filters" class="mt-1 rounded-sm bg-gray-200 px-2 py-1 text-gray-700 hover:bg-gray-300 dark:bg-gray-600 dark:text-gray-200 dark:hover:bg-gray-500">Reset all filters</button> <label class="mt-1 flex cursor-pointer items-center gap-2 border-t border-gray-300 pt-1.5 text-gray-700 dark:border-gray-600 dark:text-gray-200"><input type="checkbox"/> Show local objects</label></div>`),wIe=V(`<div class="flex items-start gap-1 bg-yellow-900/40 p-2 text-[11px] text-yellow-200"><span class="flex-1">System objects are managed by modules and the environment â they regenerate 2295 from their state and are not editable here.</span> <button class="rounded-sm bg-gray-600 px-1 text-white">â</button></div>`),TIe=V(`<p class="pl-8 text-xs text-gray-400"> </p>`),EIe=V(`<div class="border-b border-gray-600/40 px-2 py-1 text-sm text-gray-800 dark:text-gray-200"><div class="flex items-center gap-2"><button class="w-4 text-gray-400" title="Show children"> </button> <!> <span class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap" title="Managed by a module / the environment"> </span> <span class="text-[10px] text-gray-400"> </span> <button class="rounded-sm bg-gray-600 px-1.5 text-xs text-white" title="Ping it for everyone"><!></button> <button class="rounded-sm bg-gray-600 px-1.5 text-xs text-white" title="Pin a synced note to it"><!></button> <button class="rounded-sm bg-gray-600 px-1.5 text-xs text-white" title="Focus the camera on it"><!></button></div> <!></div>`),DIe=V(`<p class="p-2 text-xs italic text-gray-400">No system objects right now â spawn a module (pong, dungeon) to see its content here.</p>`),dq=V(`<!> <!> <!>`,1),OIe=V(`<div class="flex items-start gap-1 bg-yellow-900/40 p-2 text-[11px] text-yellow-200"><span class="flex-1">Environment objects are managed from Scene settings â switching presets 2296 replaces them. Edit them there, not here.</span> <button class="rounded-sm bg-gray-600 px-1 text-white">â</button></div>`),kIe=V(`<div class="border-b border-gray-600/40 px-2 py-1 text-sm text-gray-800 dark:text-gray-200"><div class="flex items-center gap-2"><!> <span class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap" title="Managed from Scene settings"> </span> <span class="text-[10px] text-gray-400"> </span> <button class="rounded-sm bg-gray-600 px-1.5 text-xs text-white" title="Ping it for everyone"><!></button> <button class="rounded-sm bg-gray-600 px-1.5 text-xs text-white" title="Focus the camera on it"><!></button></div></div>`),AIe=V(`<p class="p-2 text-xs italic text-gray-400">The environment group is empty â pick a preset or add environment lights in Scene settings.</p>`),jIe=V(`<div aria-hidden="true"></div> <!> <div aria-hidden="true"></div>`,1),MIe=V(`<!> <div class="min-h-8 rounded-sm transition-colors"><!></div> <!>`,1),NIe=V(`<div id="object-tree" class="container outline-none focus-visible:ring-1 focus-visible:ring-primary-500" role="tree" tabindex="0" aria-label="Objects"><!></div>`),PIe=V(`<button id="quality-chip" class="shrink-0 bg-amber-100 px-2 py-0.5 text-left text-[10px] text-amber-800 dark:bg-amber-900/60 dark:text-amber-200"> </button>`),FIe=V(`<nav id="controls-pill"><div class="mx-auto flex h-full max-w-lg"></div></nav> <button id="chat-button" class="fixed bottom-4 right-4 z-30 flex h-11 w-11 items-center justify-center rounded-full bg-gray-700 shadow-lg transition-colors hover:bg-gray-600" title="Chat (C)"><!></button> <!> <!> <!> <div class="hidden" id="vrButton"><div id="vrButtonVr"><!></div> <div id="vrButtonAr"><!></div></div> <!> <!> <!> <div id="object-list" style="z-index: var(--z-window)"><div role="list" class="ui-panel-header move-handle shrink-0 cursor-move select-none rounded-tl-lg rounded-tr-lg py-1.5"><span class="flex shrink-0 items-center" title="Objects"><!> </span> <!> <span class="flex-1"></span> <button class="ui-button-quiet" title="Close (O)">â</button></div>
2296 <div class="flex flex-col gap-1 bg-gray-100 p-1 text-xs dark:bg-gray-700"><div class="relative flex items-center gap-1"><div id="filter-chips" class="flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap scrollbar-none"><button title="Show everything â click again to restore the previous chips">All</button> <!> <!> <!></div> <button id="chip-config" class="shrink-0 rounded-sm bg-gray-200 px-1.5 py-0.5 text-gray-600 dark:bg-gray-600 dark:text-gray-200" title="Choose which filters show here">â</button> <!></div></div> <!> <!> <button id="object-count" class="shrink-0 rounded-bl rounded-br bg-gray-100 px-2 py-0.5 text-left text-[10px] text-gray-500 dark:bg-gray-700 dark:text-gray-300"><span id="object-budget-dot" class="budget-dot mr-1"></span> </button> <div class="resize-handle resize-cue" title="Drag to resize · double-click to reset size" style="position: absolute; bottom: 0; right: 0; width: 16px; height: 16px; cursor: se-resize; border-bottom-right-radius: 0.5rem; z-index: 5;"></div></div> <!>`,1);function IIe(e,n){Ce(n,!0);let i=()=>z(Ld,`$visibleDockKey`,ve),a=()=>z(is,`$flowGraphClose`,ve),o=()=>z(tre,`$dockOccupants`,ve),s=()=>z(Wo,`$flowCodeClose`,ve),l=()=>z($s,`$animationClose`,ve),d=()=>z(Mo,`$uvEditorClose`,ve),p=()=>z(lc,`$shaderEditorClose`,ve),m=()=>z(fs,`$hudEditorClose`,ve),h=()=>z(Is,`$explorerClose`,ve),_=()=>z(Us,`$profilerClose`,ve),x=()=>z(Kr,`$selectedObjects`,ve),S=()=>z(Ui,`$objectsGroup`,ve),T=()=>z(ko,`$expandedObjects`,ve),E=()=>z(Oe,`$objectFilter`,ve),D=()=>z(Yi,`$sceneMetrics`,ve),k=()=>z(Rr,`$qualityState`,ve),ee=()=>z(Pi,`$globalScene`,ve),M=()=>z(Joe,`$willEnterXR`,ve),te=()=>z($r,`$vrPassthrough`,ve),re=()=>z(Jm,`$vrSupported`,ve),ie=()=>z($oe,`$willEnterAR`,ve),F=()=>z(Qoe,`$arSupported`,ve),ae=()=>z(Tu,`$hudIsGame`,ve),L=()=>z(vi,`$editorMode`,ve),oe=()=>z(ri,`$transformMode`,ve),R=()=>z(ec,`$objectListClose`,ve),se=()=>z(Go,`$toolbarAlwaysOnTop`,ve),ce=()=>z(Io,`$showSimControls`,ve),le=()=>z(zo,`$floatingToolbar`,ve),de=()=>z(kd,`$bottomInset`,ve),pe=()=>z(Hs,`$chatHidden`,ve),me=()=>z(ss,`$showEnvInList`,ve),V=()=>z(Ps,`$advancedMode`,ve),he=()=>z(sc,`$showLocalObjects`,ve),ge=()=>z(qs,`$objectContextMenu`,ve),[ve,ye]=Ve(),be=q(()=>rre.includes(i()??``)),xe=q(()=>!a()&&!o().flow?.present),Se=q(()=>Q(be)||Q(xe)),we=q(()=>{let e=i()??``,t=o(),n={flowcode:s(),animation:l(),uv:d(),shader:p(),hud:m(),explorer:h(),profiler:_()},r={};for(let i of Object.keys(n))r[i]=!n[i]&&(e===i||!t[i]?.present);return r}),Te=t(!1),Ee=q(()=>x().length>0),J=`text-primary-500`,De=`text-black dark:text-slate-200`,Oe=Ue(null);He(`objectFilter`,Oe);let Ae=t(``),je=t(Ne(new Set)),Me=t(Ne(new Set)),Pe=t(``),Fe=t(0),Ie={mesh:e=>e.isMesh&&e.name!==`Stroke`,light:e=>e.type.endsWith(`Light`),group:e=>e.type===`Group`,stroke:e=>e.name===`Stroke`};function Le(e){I(Pe,``);let t=new Set(Q(je));t.has(e)?t.delete(e):t.add(e),I(je,t,!0)}function Re(){I(Pe,``),Q(je).size?(I(Me,new Set(Q(je)),!0),I(je,new Set,!0)):Q(Me).size&&I(je,new Set(Q(Me)),!0)}function ze(){if(Q(Pe)){I(Fe,0),Oe.set(null);return}let e=S(),t=Q(Ae).trim().toLowerCase();if(!e||!t&&!Q(je).size){I(Fe,0),Oe.set(null);return}let n=new Set,r=0,i=(e,a)=>{let o=(e.name||e.type).toLowerCase(),s=!Q(je).size||[...Q(je)].some(t=>Ie[t]?.(e));if((!t||o.includes(t))&&s){r++,n.add(e.uuid);for(let e of a)n.add(e)}e.children.forEach(t=>i(t,[...a,e.uuid]))};e.children.forEach(e=>i(e,[])),I(Fe,r,!0),Oe.set(n)}Qe(()=>{Q(Ae),Q(Pe),Q(je),ze()}),Ui.subscribe(()=>ze());let Ge=t(null),Ke=``,qe=``,Je=0;function Ye(e){let t=x().length?x()[x().length-1]:null;return t?e.findIndex(e=>e.uuid===t):-1}function Xe(e){if(Q(Pe))return;let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable))return;let n=BK(S(),T(),E());if(!n.length)return;let r=Ye(n),i=()=>{e.preventDefault(),e.stopPropagation()},a=(e,t=!1)=>{let r=n[Math.max(0,Math.min(n.length-1,e))];r&&Em(r.uuid,!1,t)};switch(e.key){case`ArrowDown`:i(),a(r<0?0:r+1,e.shiftKey);return;case`ArrowUp`:i(),a(r<0?n.length-1:r-1,e.shiftKey);return;case`Home`:i(),a(0);return;case`End`:i(),a(n.length-1);return;case`ArrowRight`:{i();let e=n[r];if(!e||!e.hasKids)return;T().has(e.uuid)?a(r+1):ko.update(t=>VK(t,e.uuid,!0));return}case`ArrowLeft`:{i();let e=n[r];if(!e)return;e.hasKids&&T().has(e.uuid)?ko.update(t=>VK(t,e.uuid,!1)):e.parent&&Em(e.parent);return}case`Enter`:if(r<0)return;i(),Em(n[r].uuid,!0);return;case`F2`:if(r<0)return;i(),Ns.set(n[r].uuid);return;case`Escape`:{i();let e=document.activeElement;e&&Q(Ge)?.contains(e)?e.blur():Q(Ge)?.blur();return}}if(e.ctrlKey||e.metaKey||e.altKey)return;let o=kl(e),s=e.key&&e.key.length===1?e.key:``;if(!s||o.length!==1)return;i();let c=Date.now();c-Je>500&&(Ke=``,qe=``),Je=c,Ke+=s,qe+=o.toLowerCase();let l=HK(n,Ke,r);l<0&&qe!==Ke.toLowerCase()&&(l=HK(n,qe,r)),l>=0&&a(l)}function $e(e){if(e.key===`Escape`){I(Ae,``),e.currentTarget.blur();return}if(e.key===`ArrowDown`&&Q(Ge)){e.preventDefault(),Q(Ge).focus();let t=BK(S(),T(),E());t.length&&!x().length&&Em(t[0].uuid)}}function et(e){let t=e.target;(!t||t.tagName!==`INPUT`&&t.tagName!==`TEXTAREA`&&t.tagName!==`SELECT`&&!t.isContentEditable)&&(Q(Ge)?.contains(document.activeElement)||Q(Ge)?.focus({preventScroll:!0}))}
2296function $(e){return e.addEventListener(`keydown`,Xe),e.addEventListener(`pointerdown`,et),{destroy(){e.removeEventListener(`keydown`,Xe),e.removeEventListener(`pointerdown`,et)}}}let tt=t(!1),rt=t(Ne(new Set(typeof localStorage<`u`?JSON.parse(nt.getItem(`hiddenListChips`)??`[]`):[])));function it(e){let t=new Set(Q(rt));t.has(e)?t.delete(e):(t.add(e),Q(je).has(e)&&Le(e),Q(Pe)===e&&I(Pe,``)),I(rt,t,!0),nt.setItem(`hiddenListChips`,JSON.stringify([...t]))}function at(){I(Ae,``),I(je,new Set,!0),I(Me,new Set,!0),I(Pe,``),I(rt,new Set,!0),nt.setItem(`hiddenListChips`,`[]`),I(tt,!1)}function ot(e){let t=t=>{t.deltaY&&(e.scrollLeft+=t.deltaY,t.preventDefault())},n=!1,r=0,i=0,a=t=>{n=!0,r=t.clientX,i=e.scrollLeft},o=t=>{n&&(e.scrollLeft=i-(t.clientX-r))},s=()=>n=!1;return e.addEventListener(`wheel`,t,{passive:!1}),e.addEventListener(`pointerdown`,a),window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s),{destroy(){e.removeEventListener(`wheel`,t),e.removeEventListener(`pointerdown`,a),window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s)}}}function st(e){let t=t=>{e.style.boxShadow=t?`inset 0 0 0 2px rgb(59 130 246 / 0.7)`:``,e.style.background=t?`rgb(59 130 246 / 0.08)`:``},n=e=>{e.dataTransfer?.types.includes(`application/x-object-uuid`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,t(!0))},r=()=>t(!1),i=e=>{t(!1);let n=e.dataTransfer?.getData(`application/x-object-uuid`);if(!n)return;e.preventDefault(),e.stopPropagation();let r=S()?.getObjectByProperty(`uuid`,n);r?.userData?.__localOnly?pf(r):Cm(n,`root`)};return e.addEventListener(`dragover`,n),e.addEventListener(`dragleave`,r),e.addEventListener(`drop`,i),{destroy(){e.removeEventListener(`dragover`,n),e.removeEventListener(`dragleave`,r),e.removeEventListener(`drop`,i)}}}let ct=t(24),lt=t(0),ut=t(0),dt=null,ft=q(()=>Q(Pe)?[]:BK(S(),T(),E())),pt=q(()=>Q(ft).length>500),mt=q(()=>Q(pt)?Math.max(0,Math.floor(Q(lt)/Q(ct))-12):0),ht=q(()=>Q(pt)?Math.min(Q(ft).length,Math.ceil((Q(lt)+(Q(ut)||400))/Q(ct))+12):0),gt=q(()=>Q(pt)?Q(ft).slice(Q(mt),Q(ht)):[]),_t=t(40),vt=q(()=>S()?S().children.filter(e=>!e.userData?.__localOnly):[]),yt=0;Qe(()=>{let e=Q(vt).length;if(e<=Q(_t)){Q(_t)>Math.max(40,e)&&I(_t,Math.max(40,e),!0);return}if(yt)return;let t=()=>{yt=0,I(_t,Math.min(Q(vt).length,Q(_t)+16),!0),Q(_t)<Q(vt).length&&(yt=requestAnimationFrame(t))};yt=requestAnimationFrame(t)});function bt(e){let t=null,n=()=>{if(!dt)return;I(lt,dt.scrollTop,!0),I(ut,dt.clientHeight,!0);let t=e.querySelector(`[role="treeitem"] > div`)?.offsetHeight??0;t>8&&Math.abs(t-Q(ct))>.5&&I(ct,t,!0)},r=e.parentElement;for(;r;){let e=getComputedStyle(r);if(/(auto|scroll)/.test(e.overflowY))break;r=r.parentElement}return dt=r,dt&&(dt.addEventListener(`scroll`,n,{passive:!0}),t=new ResizeObserver(n),t.observe(dt),t.observe(e)),n(),{destroy(){dt?.removeEventListener(`scroll`,n),t?.disconnect(),dt=null}}}let xt=``;Qe(()=>{let e=x().length?x()[x().length-1]:``;if(!Q(pt)||!e||e===xt){xt=e;return}xt=e;let t=Q(ft).findIndex(t=>t.uuid===e);if(t<0||!dt)return;let n=t*Q(ct),r=dt.clientHeight;n<dt.scrollTop?dt.scrollTop=n:n+Q(ct)>dt.scrollTop+r&&(dt.scrollTop=n+Q(ct)-r)});let St=q(()=>D().profile===`vr`?`vr`:`desktop`),Ct=q(()=>qi(D(),Q(St)));function wt(e){let t=()=>ia.set(!0);return e.addEventListener(`click`,t),{destroy(){e.removeEventListener(`click`,t)}}}let Tt=q(()=>{let e=na(D(),Q(St)).filter(e=>e.tier===`amber`||e.tier===`red`);return e.length?`Scene budget: over on `+e.map(e=>e.label.toLowerCase()).join(`, `)+`. Click for statistics.`:`Scene budget â within the `+(Q(St)===`vr`?`VR / mobile`:`desktop`)+` budget. Click for statistics.`}),Et=q(()=>{let e=k(),t=e.labels.join(`, `).toLowerCase();return e.pinned?`Held at reduced quality (`+t+`). Click to restore full quality.`:`This scene is heavy for this device, so drawing was reduced: `+t+`. It comes back on its own when frames recover. Click to keep it this way.`});function Dt(e){let t=()=>U(Rr).pinned?zr():Lr();return e.addEventListener(`click`,t),{destroy(){e.removeEventListener(`click`,t)}}}let Ot=!1;Qe(()=>{let e=k();e.level>0&&!Ot&&(Ot=!0,K(()=>es(`Quality reduced â this scene is heavy for this device (`+e.labels.join(`, `).toLowerCase()+`). It comes back on its own.`,[{label:`Use full quality`,action:()=>zr()},{label:`Keep it`,action:()=>Lr()}])))});let kt=t(0),At=t(0);Ui.subscribe(e=>{let t=0,n=0,r=e=>
2296{t++,e.visible===!1&&n++,e.children.forEach(r)};e?.children.forEach(r),I(kt,t,!0),I(At,n,!0)});let jt=t(Ne([])),Mt=t(Ne(typeof localStorage<`u`&&nt.getItem(`systemNoticeDismissed`)===`true`)),Nt=t(Ne({}));function Pt(){let e=ee();if(!e){I(jt,[],!0);return}I(jt,Aee.map(t=>e.getObjectByName(t)).filter(Boolean).map(e=>({name:e.name,type:e.type,children:e.children.map(e=>e.name||e.type),object:e})),!0)}Qe(()=>{if(Q(Pe)!==`system`)return;Pt();let e=setInterval(Pt,1e3);return()=>clearInterval(e)});function Ft(e){let t=new Or().setFromObject(e);if(!isFinite(t.min.x))return;let n=t.getCenter(new hn),r=Math.max(t.getSize(new hn).length(),2);xm([n.x+r*.6,n.y+r*.45,n.z+r*.6],n.toArray())}function It(e){let t=new Or().setFromObject(e);if(!isFinite(t.min.x)){Zy(e.getWorldPosition(new hn));return}let n=t.getCenter(new hn);n.y=t.max.y,Zy(n)}let Lt=t(Ne([])),Rt=t(Ne(typeof localStorage<`u`&&nt.getItem(`envNoticeDismissed`)===`true`));function zt(){let e=ee()?.getObjectByName(sde);I(Lt,(e?.children??[]).map(e=>({name:e.name,type:e.type,visible:e.visible,object:e})),!0)}Qe(()=>{if(Q(Pe)!==`environment`)return;zt();let e=setInterval(zt,1e3);return()=>clearInterval(e)});let Bt=`group inline-flex items-center justify-center hover:bg-primary-700 focus:outline-hidden focus:ring-4 focus:ring-primary-300`,Vt={minW:250,minH:200},Ht={w:300,h:250},Ut=t(1e3);function Wt(e){let t=()=>{let t=e.clientWidth;t>0&&I(Ut,t,!0)},n=new ResizeObserver(t);return n.observe(e),t(),{destroy:()=>n.disconnect()}}let Gt=q(()=>Q(Ut)<260),Kt=q(()=>Q(Ut)<190);function qt(e){let t=null;try{t=JSON.parse(nt.getItem(`objectListRect`)??`null`)}catch{}let n=!1,r=t?.left??350,i=t?.top??100,a=t?.width??300,o=t?.height??250,s=0,c=0,l=0,u=0,d=()=>!!Qse(`objects`),f=()=>{d()||e.dataset.docked||({w:a,h:o}=Xh(a,o,Vt),r=Math.max(0,Math.min(r,window.innerWidth-a)),i=Math.max(0,Math.min(i,window.innerHeight-o)),e.style.width=`${a}px`,e.style.height=`${o}px`,e.style.left=`${r}px`,e.style.top=`${i}px`)};e.style.position=`fixed`,e.style.userSelect=`none`,f(),window.addEventListener(`resize`,f);let p=!1;typeof IntersectionObserver<`u`&&new IntersectionObserver(e=>{let t=e.some(e=>e.isIntersecting);t&&!p&&f(),p=t}).observe(e);let m=()=>nt.setItem(`objectListRect`,JSON.stringify({left:r,top:i,width:e.offsetWidth,height:e.offsetHeight}));e.addEventListener(`pointerdown`,t=>{t.target.classList.contains(`resize-handle`)&&(I(Te,!0),s=t.clientX,c=t.clientY,l=e.offsetWidth,u=e.offsetHeight);let r=t.target;r?.closest?.(`.move-handle`)&&!r.closest(`input, button`)&&(n=!0)}),window.addEventListener(`pointermove`,t=>{if(n){if(d())$se(`objects`,t.movementX,t.movementY);else{r+=t.movementX,i+=t.movementY;let n=e.offsetWidth;r<52-n&&(r=52-n),r>window.innerWidth-52&&(r=window.innerWidth-52);let a=0,o=document.querySelector(`.connect-pill`);if(o){let e=o.getBoundingClientRect();r<e.right&&r+n>e.left&&(a=Math.round(e.bottom)+4)}i<a&&(i=a),i>window.innerHeight-52&&(i=window.innerHeight-52),e.style.top=`${i}px`,e.style.left=`${r}px`}}if(Q(Te)){let n=Gh(e),r=Yh(l+(t.clientX-s),u+(t.clientY-c),n.left,n.top,Vt);a=r.w,o=r.h,d()?ag(`objects`,a,o):(e.style.width=`${a}px`,e.style.height=`${o}px`)}}),window.addEventListener(`pointerup`,()=>{(n||Q(Te))&&!d()&&m(),n=!1,I(Te,!1)}),e.addEventListener(`dblclick`,t=>{t.target?.classList?.contains(`resize-handle`)&&!d()&&({w:a,h:o}=Xh(Ht.w,Ht.h,Vt),e.style.width=`${a}px`,e.style.height=`${o}px`,m())}),Jh(()=>{r=350,i=100,e.style.left=`${r}px`,e.style.top=`${i}px`})}function Jt(e){return UK(e.uuid,{point:e.point??null,locked:e.locked})}let Yt=t(null);function Xt(e){let t=e=>{e.preventDefault(),e.stopPropagation(),I(wn,null),I(Tn,null),zn={x:e.clientX,y:e.clientY},I(Yt,{x:e.clientX,y:e.clientY},!0)};return e.addEventListener(`contextmenu`,t),{destroy:()=>e.removeEventListener(`contextmenu`,t)}}function Zt(){return[{section:`Play as`},{label:`Play (desktop)`,checked:!M(),action:()=>{ei.set(!0),nt.setItem(`vrOverride`,`true`),Km()}},{label:`Enter VR`,checked:M()&&!te(),disabled:!re(),tooltip:re()?`Immersive VR â the scene replaces your view`:`No immersive-vr support detected`,action:()=>{ei.set(!1),nt.removeItem(`vrOverride`),$r.set(!1),nt.setItem(`vrPassthrough`,`false`),Km()}},{label:`Enter AR passthrough`,checked:ie(),disabled:!F(),tooltip:F()?`Mixed reality â the scene composites over your room`:`No immersive-ar (passthrough) support detected`,action:()=>{ei.set(!1),nt.removeItem(`vrOverride`),$r.set(!0),nt.setItem(`vrPassthrough`,`true`),Km()}},...ae()?[{section:`Game`},{label:`Test play (start from the menu)`,tooltip:`Reset the game to its menu, enter Play, and start from the Start screen`,action:()=>NC()}]:[],...An(null)]}let Qt=`__spacer`,$t=[`move`,`rotate`,`scale`,`mode`,`objects`,`flow`,`explorer`,`animation`],en=[`move,rotate,scale,__spacer,objects,flow,explorer`,`move,rotate,scale,__spacer,objects,flow,explorer,mode`],tn=[`animation`],nn=hge.filter(e=>e.key!==`explorer`).map(e=>e.key),rn=nn.filter(e=>!$t.includes(e)),an={flowcode:gOe,animation:mOe,uv:GOe,shader:Dke,hud:bke,profiler:Hx},on={mode:{title:`Interact mode (I)`,slot:`editor-mode-toggle`,icon:uge,tint:()=>L()===`interact`?J:De,pressed:()=>L()===`interact`,run:()=>Qae()},move:{title:`Move (1)`,icon:Tke,tint:()=>Q(Ee)&&oe()===`translate`?J:De,run:()=>ym(`translate`)},rotate:{title:`Rotate (2)`,icon:OS,tint:()=>Q(Ee)&&oe()===`rotate`?J:De,run:()=>ym(`rotate`)},scale:{title:`Scale (3)`,icon:fz,tint:()=>Q(Ee)&&oe()===`scale`?J:De,run:()=>ym(`scale`)},objects:{title:`Object list (O)`,icon:uz,tint:()=>R()?De:J,run:()=>og(`objects`)},flow:{title:`Node editor (N)`,icon:_ge,tint:()=>Q(Se)?J:De,run:()=>og(`flow`)},explorer:{title:`Explorer`,slot:`explorer-slot`,icon:nz,tint:()=>Q(we).explorer?J:De,run:()=>og(`explorer`)},...Object.fromEntries(nn.map(e=>[e,{title:nre[e]??e,icon:an[e],tint:()=>Q(we)[e]?J:De,run:()=>og(e)}]))};function sn(e,t){let n=t,r=()=>yn(n);return e.addEventListener(`click`,r),{update(e){n=e},destroy(){e.removeEventListener(`click`,r)}}}function cn(e,t){if((Array.isArray(t.hidden)?t.hidden:[]).some(t=>e.includes(t)))return!1;let n=[...e],r=Number.isFinite(t.spacerIndex)?Math.max(0,Math.min(t.spacerIndex,n.length)):3;return n.splice(r,0,Qt),en.includes(n.join(`,`))}function ln(){return{order:[...$t],hidden:[],spacerIndex:4,collapsed:!1,posX:null}}function un(){if(typeof localStorage>`u`)return ln();try{let e=nt.getItem(`controlsLayout`);if(!e)return ln();let t=JSON.parse(e)??{}
2296,n=Array.isArray(t.order)?t.order.filter((e,n)=>on[e]&&t.order.indexOf(e)===n):[],r=typeof t.posX==`number`&&Number.isFinite(t.posX)?Math.max(0,Math.min(1,t.posX)):null;if(cn(n,t))return{...ln(),collapsed:t.collapsed===!0,posX:r};for(let e of $t)!n.includes(e)&&!tn.includes(e)&&n.push(e);let i=Array.isArray(t.hidden)?t.hidden.filter(e=>n.includes(e)):[],a=n.filter(e=>!i.includes(e)).length,o=Number.isFinite(t.spacerIndex)?Math.max(0,Math.min(t.spacerIndex,a)):Math.min(4,a),s=typeof t.posX==`number`&&Number.isFinite(t.posX)?Math.max(0,Math.min(1,t.posX)):null;return{order:n,hidden:i,spacerIndex:o,collapsed:t.collapsed===!0,posX:s}}catch{return ln()}}let dn=t(Ne(un()));function fn(){try{nt.setItem(`controlsLayout`,JSON.stringify(Q(dn)))}catch{}}function pn(e){I(dn,{...Q(dn),...e},!0),fn()}function mn(){I(dn,ln(),!0);try{nt.removeItem(`controlsLayout`)}catch{}}_e(()=>Jh(()=>mn()));function gn(){return Q(dn).order.filter(e=>on[e]&&!Q(dn).hidden.includes(e))}function _n(){let e=gn(),t=[...e];return t.splice(Math.max(0,Math.min(Q(dn).spacerIndex,e.length)),0,Qt),t}let vn=q(()=>Q(dn).collapsed?[{id:Qt}]:_n().map(e=>({id:e})));function yn(e){on[e]?.run()}function bn(e,t){let n=_n(),r=n.indexOf(e),i=r+t;if(r<0||i<0||i>=n.length)return;n[r]=n[i],n[i]=e;let a=n.filter(e=>e!==Qt),o=[...Q(dn).order],s=0;for(let e=0;e<o.length;e++)on[o[e]]&&!Q(dn).hidden.includes(o[e])&&(o[e]=a[s++]);pn({order:o,spacerIndex:n.indexOf(Qt)})}function xn(e){let t=gn().indexOf(e),n=t>-1&&t<Q(dn).spacerIndex?Q(dn).spacerIndex-1:Q(dn).spacerIndex;pn({hidden:[...Q(dn).hidden,e],spacerIndex:n})}function Sn(e){if(!on[e])return;let t=Q(dn).hidden.filter(t=>t!==e),n=Q(dn).order.includes(e)?Q(dn).order:[...Q(dn).order,e],r=n.filter(e=>on[e]&&!t.includes(e)).indexOf(e);pn({order:n,hidden:t,spacerIndex:r>-1&&r<Q(dn).spacerIndex?Q(dn).spacerIndex+1:Q(dn).spacerIndex})}function Cn(e,t){if(!on[t]||e===t)return;let n=Q(dn).order.filter(e=>e!==t),r=n.indexOf(e);r<0||(n[r]=t,pn({order:n,hidden:Q(dn).hidden.filter(n=>n!==t&&n!==e)}))}let wn=t(null),Tn=t(null);function En(e,t){let n=e=>{e.preventDefault(),e.stopPropagation(),I(Yt,null),I(Tn,null),zn={x:e.clientX,y:e.clientY},I(wn,{x:e.clientX,y:e.clientY,id:t},!0)};return e.addEventListener(`contextmenu`,n),{destroy:()=>e.removeEventListener(`contextmenu`,n)}}function Dn(){return typeof localStorage>`u`||nt.getItem(`explorerDocked`)!==`false`}function On(e){ere(`explorer`,e)}function kn(){let e=document.getElementById(`controls-pill`)?.getBoundingClientRect();I(Tn,{x:Math.round(e?.left??8),y:Math.round(e?.top??8)},!0),zn={x:Q(Tn).x,y:Q(Tn).y}}function An(e){let t=e??``,n=t||Qt,r=_n(),i=r.indexOf(n),a=Q(dn).collapsed;return[{section:`Toolbar`},{label:`Move left`,tooltip:t?`One place left â past the play button when it is next`:`Move the play button one place left`,disabled:a||i<=0,action:()=>bn(n,-1)},{label:`Move right`,tooltip:t?`One place right â past the play button when it is next`:`Move the play button one place right`,disabled:a||i<0||i>=r.length-1,action:()=>bn(n,1)},...t?[{label:`Hide button`,tooltip:`Take it off the bar â Customize toolbar brings it back`,action:()=>xn(t)}]:[],{label:`Move toolbar`,tooltip:Q(In).ok?`Slide the bar along the bottom â click to place it, arrows nudge, Escape puts it back`:`The screen has no room to move the bar â it stays centred`,disabled:!Q(In).ok,action:()=>Yn()},{label:`Reset toolbar position`,tooltip:`Put the bar back in the middle`,disabled:Q(dn).posX==null,action:()=>pn({posX:null})},{label:`Always on top`,tooltip:se()?`The bar paints over the dock and floating windows â click to let them cover it`:`Floating windows and the dock cover the bar (the default) â click to keep it on top`,checked:se(),action:()=>Go.update(e=>!e)},a?{label:`Expand toolbar`,tooltip:`Bring the whole bar back`,action:()=>pn({collapsed:!1})}:{label:`Collapse toolbar`,tooltip:`Shrink the bar down to the play button`,action:()=>pn({collapsed:!0})},{label:`Customize toolbarâ¦`,tooltip:`Choose which buttons the bar shows`,action:()=>kn()}]}function jn(e){let t=[];return e===`flow`&&t.push({section:`Node editor`},{label:`Open Node editor`,tooltip:`Show or hide the graph editor (N)`,action:()=>
2296og(`flow`)}),e===`explorer`&&t.push({section:`Explorer`},{label:`Open as dock tab`,checked:Dn(),tooltip:`Show the library along the bottom, beside the other dock tabs`,action:()=>On(!0)},{label:`Open as floating window`,checked:!Dn(),tooltip:`Show the library in a window you can move and resize`,action:()=>On(!1)}),t.push({section:`This button`},{label:`Swap with`,children:Mn(e)}),[...t,...An(e)]}function Mn(e){let t=_n(),n=[...$t,...rn].filter(e=>on[e]&&!t.includes(e));return n.length?n.map(t=>({label:on[t].title,tooltip:`Put ${on[t].title} in this slot and take ${on[e].title} off the bar`,action:()=>Cn(e,t)})):[{label:`Every button is on the bar`,tooltip:`There is nothing left to swap in â hide one first`,disabled:!0}]}function Nn(){let e=_n(),t=[...$t,...rn].filter(t=>on[t]&&!e.includes(t)),n=(t,n,r)=>[{icon:`chevron-up`,label:`Move ${r} up`,disabled:n<=0,run:()=>bn(t,-1)},{icon:`chevron-down`,label:`Move ${r} down`,disabled:n<0||n>=e.length-1,run:()=>bn(t,1)}];return[{section:`On the bar`},...e.map((e,t)=>e===Qt?{key:Qt,label:`Play`,checked:!0,keepOpen:!0,tooltip:`The play button is always on the bar â it can be moved, never removed`,rowActions:n(Qt,t,`Play`)}:{key:e,label:on[e].title,checked:!0,keepOpen:!0,tooltip:`Take it off the bar`,action:()=>xn(e),rowActions:n(e,t,on[e].title)}),...t.length?[{section:`Not on the bar`},...t.map(e=>({key:e,label:on[e].title,checked:!1,keepOpen:!0,tooltip:`Put it on the bar`,action:()=>Sn(e),rowActions:[{icon:`chevron-up`,label:`Move ${on[e].title} up`,tooltip:`Not on the bar â there is nowhere to move it`,disabled:!0},{icon:`chevron-down`,label:`Move ${on[e].title} down`,tooltip:`Not on the bar â there is nowhere to move it`,disabled:!0}]}))]:[],{section:``},{key:`__reset`,label:`Reset toolbar`,danger:!0,keepOpen:!0,tooltip:`Back to the six default buttons in their default order`,action:mn}]}let Pn=q(Nn),Fn=[`#ai-hud-button`,`#mobile-add-button`,`#chat-button`,`#mic-button`,`#sim-controls`],In=t(Ne({min:0,max:0,mid:0,ok:!1})),Ln=t(null),Rn=t(!1),zn={x:0,y:0},Bn=0,Vn=null,Hn=``;function Un(){if(typeof window>`u`)return;let e=document.getElementById(`controls-pill`);if(!e)return;let t=e.getBoundingClientRect();if(!t.width)return;let n=window.innerWidth,r=8,i=n-8,a=[];for(let e of Fn){let o=document.querySelector(e);if(!o)continue;a.push(o);let s=o.getBoundingClientRect();s.width&&s.height&&(s.bottom<=t.top||s.top>=t.bottom||((s.left+s.right)/2<n/2?r=Math.max(r,s.right+8):i=Math.min(i,s.left-8)))}let o=t.width/2,s=r+o,c=i-o,l=c-s>=1,u={min:s,max:c,mid:l?Math.max(s,Math.min(c,n/2)):n/2,ok:l};(u.min!==Q(In).min||u.max!==Q(In).max||u.mid!==Q(In).mid||u.ok!==Q(In).ok)&&I(In,u,!0),typeof window<`u`&&(window.__toolbarTrack={...Q(In),centre:Q(Wn),posX:Q(dn).posX});let d=a.map(e=>e.id).join(`,`);if(Vn&&d!==Hn){Hn=d,Vn.disconnect(),Vn.observe(e);for(let e of a)Vn.observe(e)}}_e(()=>(typeof ResizeObserver<`u`&&(Vn=new ResizeObserver(()=>Un())),Un(),window.addEventListener(`resize`,Un),window.addEventListener(`keydown`,Xn,!0),()=>{window.removeEventListener(`resize`,Un),window.removeEventListener(`keydown`,Xn,!0),Vn?.disconnect(),Vn=null})),Qe(()=>{ce(),Q(vn),le(),de(),C().then(Un)});let Wn=q(()=>Q(Ln)==null?!Q(In).ok||Q(dn).posX==null?Q(In).mid:Q(In).min+Q(dn).posX*(Q(In).max-Q(In).min):Q(Ln));function Gn(){if(typeof window>`u`)return;let e=0,t=n=>{n.stopPropagation(),n.preventDefault(),window.removeEventListener(`click`,t,!0),clearTimeout(e)};window.addEventListener(`click`,t,!0),e=window.setTimeout(()=>window.removeEventListener(`click`,t,!0),700)}function Kn(e,t){let n=Math.max(t.min,Math.min(t.max,e));return Math.abs(n-t.mid)<=24?t.mid:n}let qn=WK({snapshot:()=>(Un(),Q(In).ok?{centre:Q(Wn),track:{...Q(In)}}:null),start:()=>{Bn=0},apply:e=>{I(Ln,Kn(e.snapshot.centre+e.dx+Bn,e.snapshot.track),!0)},revert:()=>{I(Ln,null)},end:(e,t)=>{let n=Q(Ln);if(I(Ln,null),Bn=0,t&&Gn(),!t||n==null)return;let r=e.snapshot.track,i=r.max-r.min,a=i>0?Math.max(0,Math.min(1,(n-r.min)/i)):null;pn({posX:n===r.mid?null:a})},onActive:e=>{I(Rn,e,!0)}});function Jn(e){let t=null,n=null,r=()=>{t=null,n=null,window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,r),window.removeEventListener(`pointercancel`,r)},i=e=>{if(!t||!n||Math.abs(e.clientX-t.x)+Math.abs(e.clientY-t.y)<6)return;e.preventDefault();let i=qn.begin(n);r(),i&&qn.move(e)},a=e=>{e.button!==0||e.target?.closest?.(`#play-button`)||qn.active()||(t={x:e.clientX,y:e.clientY},n=e,window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,r),window.addEventListener(`pointercancel`,r))};return e.addEventListener(`pointerdown`,a),{destroy(){r(),e.removeEventListener(`pointerdown`,a)}}}function Yn(){qn.begin({clientX:zn.x,clientY:zn.y},{modal:!0})}function Xn(e){if(!qn.active()||!qn.isModal())return;let t=e.key===`ArrowLeft`?-1:+(e.key===`ArrowRight`);t&&(e.preventDefault(),e.stopPropagation(),Bn+=t*(e.shiftKey?10:1),qn.refresh())}let Zn=q(()=>se()?`z-45`:`z-30`),Qn=q(()=>(le()?`bottom: calc(var(--bottom-inset, 0px) + 16px);`:`bottom: 16px;`)+(Q(In).mid>0?` left: ${Math.round(Q(Wn))}px;`:``)+` touch-action: none;`+(Q(Rn)?` cursor: grabbing;`:``));var $n=FIe(),er=N($n),tr=j(er);B(tr,23,()=>Q(vn),e=>e.id,(e,t,n)=>{var i=fe(),a=N(i),o=e=>{var t=_Ie(),i=j(t),a=g(i,2),o=g(a,2);
2296r(o,1,Bt+` -translate-x-1/2 rounded-full bg-primary-600 font-medium hover:scale-110 dark:focus:ring-primary-800`);var s=j(o),c=e=>{var t=gIe();vz(j(t),{size:30,class:`text-white`,"aria-hidden":`true`}),W(4),H(t),X(e,t)},l=e=>{vz(e,{size:26,class:`text-white`,"aria-hidden":`true`})},u=e=>{gz(e,{size:24,class:`ml-0.5 text-white`,fill:`currentColor`,"aria-hidden":`true`})};G(s,e=>{ie()?e(c):M()?e(l,1):e(u,-1)}),H(o),y(()=>Z(`click`,o,()=>{Km()})),ne(o,e=>Xt?.(e)),H(t),O(()=>{r(i,1,`h-full w-5 [*:hover+div>&:first-child]:bg-primary-700`+(Q(n)===0?` rounded-l-full`:``)),r(a,1,`h-full w-5 [div:has(+*:hover)>&:nth-child(2)]:bg-primary-700`+(Q(n)===Q(vn).length-1?` rounded-r-full`:``)),b(o,`title`,ie()?`Enter AR â the scene composites over your room`:M()?`Enter VR`:`Play`)}),X(e,t)},s=e=>{let i=q(()=>on[Q(t).id]),a=q(()=>Q(i).icon);var o=fe(),s=N(o),c=e=>{var o=vIe(),s=j(o);{let e=q(()=>Q(i).tint());P(s,()=>Q(a),(t,n)=>{n(t,{size:18,get class(){return Q(e)},"aria-hidden":`true`})})}H(o),ne(o,(e,t)=>sn?.(e,t),()=>Q(t).id),ne(o,(e,t)=>En?.(e,t),()=>Q(t).id),O(e=>{b(o,`id`,Q(i).slot),r(o,1,`group inline-flex items-center justify-center hover:bg-primary-700 focus:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-300 w-10`+(Q(n)===0?` roun
2296ded-l-full`:``)+(Q(n)===Q(vn).length-1?` rounded-r-full`:``)),b(o,`title`,Q(i).title),b(o,`aria-label`,Q(i).title),b(o,`aria-pressed`,e)},[()=>Q(i).pressed()]),X(e,o)},l=e=>{var o=yIe(),s=j(o);{let e=q(()=>Q(i).tint());P(s,()=>Q(a),(t,n)=>{n(t,{size:18,get class(){return Q(e)},"aria-hidden":`true`})})}H(o),y(()=>Z(`click`,o,()=>yn(Q(t).id))),ne(o,(e,t)=>En?.(e,t),()=>Q(t).id),O(()=>{b(o,`id`,Q(i).slot),r(o,1,Bt+` w-10`+(Q(n)===0?` rounded-l-full`:``)+(Q(n)===Q(vn).length-1?` rounded-r-full`:``)),b(o,`title`,Q(i).title)}),X(e,o)};G(s,e=>{Q(i).pressed?e(c):e(l,-1)}),X(e,o)};G(a,e=>{Q(t).id===Qt?e(o):e(s,-1)}),X(e,i)}),H(tr),H(er),ne(er,e=>Jn?.(e));var nr=g(er,2);pz(j(nr),{size:16,class:`text-white`,"aria-hidden":`true`}),H(nr);var rr=g(nr,2);eIe(rr,{});var ir=g(rr,2);nIe(ir,{});var ar=g(ir,2);oIe(ar,{});var or=g(ar,2),sr=j(or);nSe(j(sr),{onerror:()=>qm()}),H(sr);var cr=g(sr,2);qD(j(cr),{mode:`immersive-ar`,onerror:()=>qm(),sessionInit:{requiredFeatures:[],optionalFeatures:[`local-floor`,`bounded-floor`,`anchors`,`hand-tracking`,`plane-detection`,`layers`,`depth-sorted-layers`,`hit-test`,`mesh-detection`]}}),H(cr),H(or);var lr=g(or,2),ur=e=>{{let t=q(Zt);xS(e,{get x(){return Q(Yt).x},get y(){return Q(Yt).y},get items(){return Q(t)},sizeKey:`playmode`,$$events:{close:()=>I(Yt,null)}})}};G(lr,e=>{Q(Yt)&&e(ur)});var dr=g(lr,2),fr=e=>{{let t=q(()=>jn(Q(wn).id));xS(e,{get x(){return Q(wn).x},get y(){return Q(wn).y},get items(){return Q(t)},sizeKey:`toolbarcell`,$$events:{close:()=>I(wn,null)}})}};G(dr,e=>{Q(wn)&&e(fr)});var pr=g(dr,2),mr=e=>{xS(e,{get x(){return Q(Tn).x},get y(){return Q(Tn).y},get items(){return Q(Pn)},sizeKey:`toolbarcustomize`,$$events:{close:()=>I(Tn,null)}})};G(pr,e=>{Q(Tn)&&e(mr)});var hr=g(pr,2),gr=j(hr),_r=j(gr),vr=j(_r);{let e=q(()=>Q(Kt)?``:`mr-1`);uz(vr,{size:16,get class(){return Q(e)},"aria-hidden":`true`})}var yr=g(vr,1,!0);H(_r);var br=g(_r,2),xr=e=>{var t=bIe();v(t),O(()=>u(t,Q(Ae))),Z(`pointerdown`,t,e=>e.stopPropagation()),Z(`input`,t,e=>I(Ae,e.currentTarget.value,!0)),Z(`keydown`,t,$e),X(e,t)};G(br,e=>{Q(Gt)||e(xr)});var Sr=g(br,4);H(gr),ne(gr,e=>Wt?.(e)),y(()=>Z(`dragover`,gr,e=>{e.dataTransfer?.types.includes(`application/x-object-uuid`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`)})),y(()=>Z(`drop`,gr,e=>{let t=e.dataTransfer?.getData(`application/x-object-uuid`);if(!t)return;e.preventDefault();let n=S()?.getObjectByProperty(`uuid`,t);n?.userData?.__localOnly?pf(n):Cm(t,`root`)}));var Cr=g(gr,2),wr=j(Cr),Tr=j(wr),Er=j(Tr),Dr=g(Er,2);B(Dr,16,()=>[[`mesh`,`Meshes`],[`light`,`Lights`],[`group`,`Groups`],[`stroke`,`Strokes`]],Be,(e,t)=>{var n=q(()=>A(t,2));let i=()=>Q(n)[0],a=()=>Q(n)[1];var o=fe(),s=N(o),c=e=>{var t=uq(),n=f(t,!0);O(e=>{r(t,1,e),Y(n,a())},[()=>`shrink-0 rounded-full px-2 py-0.5 `+(Q(je).has(i())?`bg-primary-600 text-white`:`bg-gray-200 text-gray-700 dark:bg-gray-600 dark:text-gray-200`)]),Z(`click`,t,()=>Le(i())),X(e,t)},l=q(()=>!Q(rt).has(i()));G(s,e=>{Q(l)&&e(c)}),X(e,o)});var kr=g(Dr,2);B(kr,1,()=>[...me()?[[`environment`,`Environment`]]:[],...V()?[[`system`,`System`]]:[]],Be,(e,t)=>{var n=q(()=>A(Q(t),2));let i=()=>Q(n)[0],a=()=>Q(n)[1];var o=fe(),s=N(o),c=e=>{var t=uq(),n=f(t,!0);O(()=>{r(t,1,`shrink-0 rounded-full px-2 py-0.5 `+(Q(Pe)===i()?`bg-primary-600 text-white`:`bg-gray-200 text-gray-700 dark:bg-gray-600 dark:text-gray-200`)),Y(n,a())}),Z(`click`,t,()=>{I(Pe,Q(Pe)===i()?``:i(),!0),I(je,new Set,!0)}),X(e,t)},l=q(()=>!Q(rt).has(i()));G(s,e=>{Q(l)&&e(c)}),X(e,o)});var Ar=g(kr,2),jr=e=>{var t=xIe(),n=f(t);O(()=>Y(n,`${Q(Fe)??``} match${Q(Fe)===1?``:`es`}`)),X(e,t)};G(Ar,e=>{E()&&e(jr)}),H(Tr),ne(Tr,e=>ot?.(e));var Mr=g(Tr,2),Nr=g(Mr,2),Pr=e=>{var t=CIe(),n=j(t);B(n,1,()=>[[`mesh`,`Meshes`],[`light`,`Lights`],[`group`,`Groups`],[`stroke`,`Strokes`],...me()?[[`environment`,`Environment`]]:[],...V()?[[`system`,`System`]]:[]],Be,(e,t)=>{var n=q(()=>A(Q(t),2));let r=()=>Q(n)[0],i=()=>Q(n)[1];var a=SIe(),o=j(a);v(o);var s=g(o);H(a),O(e=>{w(o,e),Y(s,` ${i()??``}`)},[()=>!Q(rt).has(r())]),Z(`change`,o,()=>it(r())),X(e,a)});var r=g(n,2),i=g(r,2),a=j(i);v(a),W(),H(i),H(t),Z(`click`,r,at),c(a,he,e=>ke(sc,e)),X(e,t)};G(Nr,e=>{Q(tt)&&e(Pr)}),H(wr),H(Cr);var Fr=g(Cr,2);
2296lo(Fr,{active:!0,class:`min-h-0 flex-1 overflow-y-auto -rounded rounded-br rounded-bl`,children:(e,t)=>{var n=NIe(),r=j(n),i=e=>{var t=dq(),n=N(t),r=e=>{var t=wIe(),n=g(j(t),2);H(t),Z(`click`,n,()=>{I(Mt,!0),nt.setItem(`systemNoticeDismissed`,`true`)}),X(e,t)};G(n,e=>{Q(Mt)||e(r)});var i=g(n,2);B(i,17,()=>Q(jt),e=>e.name,(e,t)=>{var n=EIe(),r=j(n),i=j(r),a=f(i,!0),o=g(i,2);vOe(o,{size:16,class:`text-gray-400`,"aria-hidden":`true`,title:`System object`});var s=g(o,2),c=f(s,!0),l=g(s,2),u=f(l,!0),d=g(l,2),p=j(d);Kx(p,{size:16,"aria-hidden":`true`}),H(d);var m=g(d,2);wz(j(m),{size:16,"aria-hidden":`true`}),H(m);var h=g(m,2),_=j(h);Wx(_,{size:16,"aria-hidden":`true`}),H(h),H(r);var v=g(r,2),y=e=>{var n=fe(),r=N(n);B(r,17,()=>Q(t).children,Be,(e,t)=>{var n=TIe(),r=f(n,!0);O(()=>Y(r,Q(t))),X(e,n)}),X(e,n)};G(v,e=>{Q(Nt)[Q(t).name]&&e(y)}),H(n),O(()=>{Y(a,Q(Nt)[Q(t).name]?`â`:`+`),Y(c,Q(t).name),Y(u,Q(t).children.length)}),Z(`click`,i,()=>I(Nt,{...Q(Nt),[Q(t).name]:!Q(Nt)[Q(t).name]},!0)),Z(`click`,d,()=>It(Q(t).object)),Z(`click`,m,()=>Py(Q(t).object.uuid)),Z(`click`,h,()=>Ft(Q(t).object)),X(e,n)});var a=g(i,2),o=e=>{var t=DIe();X(e,t)};G(a,e=>{Q(jt).length===0&&e(o)}),X(e,t)},a=e=>{var t=dq(),n=N(t),r=e=>{var t=OIe(),n=g(j(t),2);H(t),Z(`click`,n,()=>{I(Rt,!0),nt.setItem(`envNoticeDismissed`,`true`)}),X(e,t)};G(n,e=>{Q(Rt)||e(r)});var i=g(n,2);B(i,17,()=>Q(Lt),e=>e.name,(e,t)=>{var n=kIe(),r=j(n),i=j(r);Ez(i,{size:16,class:`w-4 text-center text-yellow-300/80`,"aria-hidden":`true`,title:`Environment light`});var a=g(i,2),o=f(a,!0),s=g(a,2),c=f(s,!0),l=g(s,2),u=j(l);Kx(u,{size:16,"aria-hidden":`true`}),H(l);var d=g(l,2),p=j(d);Wx(p,{size:16,"aria-hidden":`true`}),H(d),H(r),H(n),O(()=>{Y(o,Q(t).name),Y(c,Q(t).type)}),Z(`click`,l,()=>It(Q(t).object)),Z(`click`,d,()=>Ft(Q(t).object)),X(e,n)});var a=g(i,2),o=e=>{var t=AIe();X(e,t)};G(a,e=>{Q(Lt).length===0&&e(o)}),X(e,t)},o=e=>{var t=fe(),n=N(t),r=e=>{var t=MIe(),n=N(t);WFe(n,{});var r=g(n,2),i=j(r),a=e=>{var t=jIe(),n=N(t),r=g(n,2);B(r,17,()=>Q(gt),e=>e.uuid,(e,t)=>{GK(e,{get element(){return Q(t).object},flat:!0,get depth(){return Q(t).depth}})});var i=g(r,2);O(()=>{Ze(n,`height:`+Q(mt)*Q(ct)+`px`),Ze(i,`height:`+(Q(ft).length-Q(ht))*Q(ct)+`px`)}),X(e,t)},o=e=>{var t=fe(),n=N(t);B(n,17,()=>Q(vt).slice(0,Q(_t)),Be,(e,t)=>{GK(e,{get element(){return Q(t)}})}),X(e,t)};G(i,e=>{Q(pt)?e(a):S().children.length>0&&e(o,1)}),H(r),ne(r,e=>st?.(e)),ne(r,e=>bt?.(e)),QFe(g(r,2),{}),O(()=>b(r,`data-object-rows`,Q(pt)?`window`:`tree`)),X(e,t)};G(n,e=>{S()&&e(r)}),X(e,t)};G(r,e=>{Q(Pe)===`system`?e(i):Q(Pe)===`environment`?e(a,1):e(o,-1)}),H(n),We(n,e=>I(Ge,e),()=>Q(Ge)),ne(n,e=>$?.(e)),X(e,n)},$$slots:{default:!0}});var Ir=g(Fr,2),Br=e=>{var t=PIe(),n=f(t);ne(t,e=>Dt?.(e)),O(()=>{b(t,`data-level`,k().level),b(t,`data-pinned`,k().pinned?`true`:`false`),b(t,`title`,Q(Et)),Y(n,`Reduced quality${k().pinned?` · held`:` (scene is heavy)`}`)}),X(e,t)};G(Ir,e=>{(k().level>0||k().pinned)&&e(Br)});var Vr=g(Ir,2),Hr=j(Vr),Ur=g(Hr);H(Vr),ne(Vr,e=>wt?.(e)),W(2),H(hr),ne(hr,e=>qt?.(e)),ne(hr,(e,t)=>Kh?.(e,t),()=>`objects`),ne(hr,(e,t)=>$h?.(e,t),()=>({key:`objects`,title:`â° Objects`,openStore:ec,isOpen:e=>!e,close:()=>ec.set(!0)})),ne(hr,(e,t)=>lq?.(e,t),()=>({key:`objects`}));var Wr=g(hr,2),Gr=e=>{{let t=q(()=>Jt(ge()));xS(e,{get x(){return ge().x},get y(){return ge().y},get items(){return Q(t)},sizeKey:`object`,$$events:{close:()=>ke(qs,null)}})}};G(Wr,e=>{ge()&&e(Gr)}),O(()=>{r(er,1,`border-gray-200 dark:border-gray-600 absolute max-w-lg -translate-x-1/2 rtl:translate-x-1/2 border bottom-4 start-1/2 h-10 w-max min-w-max shrink-0 bg-white rounded-full dark:bg-gray-700 ${Q(Zn)??``}`),Ze(er,Q(Qn)),b(or,`data-aim`,te()?`ar`:`vr`),r(hr,1,(R()?`hidden`:`flex`)+` flex-col ui-panel overflow-hidden`),Y(yr,Q(Kt)?``:`Objects`),r(Er,1,`shrink-0 rounded-full px-2 py-0.5 `+(!Q(je).size&&!Q(Pe)?`bg-primary-600 text-white`:`bg-gray-200 text-gray-700 dark:bg-gray-600 dark:text-gray-200`)),b(Vr,`title`,Q(Tt)),b(Hr,`data-tier`,Q(Ct)),Y(Ur,`${Q(kt)??``} object${Q(kt)===1?``:`s`}${Q(At)?` · `+Q(At)+` hidden`:``}`)}),Z(`click`,nr,()=>Hs.set(pe()===`hidden`?``:`hidden`)),Z(`click`,Sr,()=>ec.set(!0)),Z(`click`,Er,Re),Z(`click`,Mr,()=>I(tt,!Q(tt))),X(e,$n),ue(),ye()}var LIe=V(`<li role="option"> </li>`),RIe=V(`<ul class="ts-list svelte-v19q6k" role="listbox" tabindex="-1"></ul>`),zIe=V(`<div><button type="button" class="ts-btn ui-input svelte-v19q6k" aria-haspopup="listbox"><span> </span> <span class="ts-caret svelte-v19q6k" aria-hidden="true">â¾</span></button></div> <!>`,1);function fq(e,n){Ce(n,!0);let i=J(n,`items`,19,()=>[]),a=J(n,`value`,15,void 0),o=J(n,`onchange`,3,e=>{}),s=J(n,`placeholder`,3,`Select`),c=J(n,`id`,3,void 0),l=J(n,`disabled`,3,!1),u=J(n,`title`,3,void 0),d=J(n,`class`,3,``),m=t(!1),h=t(null),_=t(null),v=t(-1),y=t(Ne({left:0,top:0,width:0})),x=(e,t)=>String(e)===String(t),S=q(()=>i().find(e=>x(e.value,a()))),w=q(()=>Q(S)?Q(S).name:s());async function T(){if(await C(),!Q(h))return;let e=Q(h).getBoundingClientRect(),t=Math.min(240,i().length*30+10),n=e.bottom+t+6>window.innerHeight&&e.top>t;I(y,{left:e.left,top:n?Math.max(4,e.top-t-4):e.bottom+4,width:e.width},!0),await C();let r=Q(_)?.getBoundingClientRect().width??e.width,a=window.innerWidth-r-8;Q(y).left>a&&I(y,{...Q(y),left:Math.max(8,a)},!0)}function E(){l()||(I(m,!0),I(v,i().findIndex(e=>x(e.value,a())),!0),T())}function D(){Q(m)?I(m,!1):E()}function k(e){I(m,!1),x(e.value,a())||(a(e.value),o()(e.value))}function A(){Q(_)?.children?.[Q(v)]?.scrollIntoView({block:`nearest`})}function ee(e){if(!l()){if(!Q(m)){(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`)&&(e.preventDefault(),E());return}e.key===`Escape`?(I(m,!1),Q(h)?.focus(),e.preventDefault()):e.key===`ArrowDown`?
2296(I(v,Math.min(i().length-1,Q(v)+1),!0),A(),e.preventDefault()):e.key===`ArrowUp`?(I(v,Math.max(0,Q(v)-1),!0),A(),e.preventDefault()):(e.key===`Enter`||e.key===` `)&&(i()[Q(v)]&&k(i()[Q(v)]),e.preventDefault())}}function M(e){if(!Q(m))return;let t=e.target;Q(h)?.contains(t)||Q(_)?.contains(t)||I(m,!1)}function te(e){return document.body.appendChild(e),{destroy(){e.remove()}}}Qe(()=>{if(!Q(m))return;let e=()=>T();return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}});var P=zIe();Z(`pointerdown`,p,M);var re=N(P),ie=j(re),F=j(ie);let ae;var oe=f(F,!0);W(2),H(ie),We(ie,e=>I(h,e),()=>Q(h)),H(re);var R=g(re,2),se=e=>{var t=RIe();B(t,23,i,e=>e.value,(e,t,n)=>{var i=LIe();let o;var s=f(i,!0);O((e,a)=>{b(i,`aria-selected`,e),o=r(i,1,`ts-opt svelte-v19q6k`,null,o,{"ts-active":Q(n)===Q(v),"ts-selected":a}),Y(s,Q(t).name)},[()=>x(Q(t).value,a()),()=>x(Q(t).value,a())]),Z(`mouseenter`,i,()=>I(v,Q(n),!0)),L(`click`,i,()=>k(Q(t))),X(e,i)}),H(t),ne(t,e=>te?.(e)),We(t,e=>I(_,e),()=>Q(_)),O(()=>Ze(t,`left:${Q(y).left??``}px; top:${Q(y).top??``}px; min-width:${Q(y).width??``}px;`)),X(e,t)};G(R,e=>{Q(m)&&e(se)}),O(()=>{r(re,1,`ts-wrap `+d(),`svelte-v19q6k`),b(ie,`id`,c()),b(ie,`title`,u()),ie.disabled=l(),b(ie,`aria-expanded`,Q(m)),ae=r(F,1,`ts-label svelte-v19q6k`,null,ae,{"ts-placeholder":!Q(S)}),Y(oe,Q(w))}),L(`click`,ie,D),L(`keydown`,ie,ee),X(e,P),ue()}ge([`click`,`keydown`]);var BIe=V(`<span class="ui-badge-type"> </span>`),VIe=V(`<button id="inspector-pin"><!></button>`),HIe=V(`<button class="ui-button-quiet" title="Close">â</button>`),UIe=V(`<div class="ui-panel-header"><!> <span class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap"> </span> <!> <!> <!></div>`);function pq(e,t){let n=J(t,`title`,3,``),i=J(t,`badge`,3,``),a=J(t,`onclose`,3,null),o=J(t,`onpin`,3,null),s=J(t,`pinned`,3,!1),c=J(t,`children`,3,null);var l=UIe(),u=j(l),d=e=>{var t=BIe(),n=f(t,!0);O(()=>Y(n,i())),X(e,t)};G(u,e=>{i()&&e(d)});var p=g(u,2),m=f(p,!0),h=g(p,2);ae(h,()=>c()??qe);var _=g(h,2),v=e=>{var t=VIe(),n=j(t),i=e=>{Kx(e,{size:14,"aria-hidden":`true`})},a=e=>{sge(e,{size:14,"aria-hidden":`true`})};G(n,e=>{s()?e(i):e(a,-1)}),H(t),O(()=>{r(t,1,`ui-button-quiet ${s()?`pin-on`:``}`,`svelte-tmsd76`),b(t,`title`,s()?`Unpin â properties then open on double-click or via the context menu`:`Pin â keep this panel open and follow the selection`),b(t,`aria-label`,s()?`Unpin the properties panel`:`Pin the properties panel`),b(t,`aria-pressed`,s())}),L(`click`,t,function(...e){o()?.apply(this,e)}),X(e,t)};G(_,e=>{o()&&e(v)});var y=g(_,2),x=e=>{var t=HIe();L(`click`,t,function(...e){a()?.apply(this,e)}),X(e,t)};G(y,e=>{a()&&e(x)}),H(l),O(()=>Y(m,n())),X(e,l)}ge([`click`]);var WIe=V(`<button class="ui-section-label flex w-full items-center justify-between hover:text-gray-200"><span> </span> <span class="text-gray-500"> </span></button>`),GIe=V(`<p class="ui-section-label"> </p>`),KIe=V(`<div class="flex flex-col gap-1 px-1"><!></div>`),qIe=V(`<div><!> <!></div>`);function mq(e,n){Ce(n,!0);let i=()=>z(us,`$inspectorFilter`,o),a=()=>z(Ko,`$inspectorScrollTo`,o),[o,s]=Ve(),c=J(n,`label`,3,``),l=J(n,`aliases`,19,()=>[]),u=J(n,`collapsible`,3,!0),d=J(n,`open`,11,!0),p=J(n,`children`,3,null),m=typeof localStorage<`u`?localStorage:null,h=t(m?.getItem(`inspector:sec:`+c())===`closed`);function _(){I(h,!Q(h));try{m?.setItem(`inspector:sec:`+c(),Q(h)?`closed`:`open`)}catch{}}let v=t(null),y=t(!0);Qe(()=>{let e=i().trim().toLowerCase();if(!e){I(y,!0);return}I(y,(c()+` `+(Q(v)?.textContent??``)).toLowerCase().includes(e),!0)});let b=q(()=>i().trim().length>0),x=q(()=>Q(b)?!0:!u()||d()&&!Q(h));Qe(()=>{let e=a(),[t,n]=String(e??``).split(`:`);if(!e||t!==c()&&!l().includes(t))return;I(h,!1);try{m?.setItem(`inspector:sec:`+c(),`open`)}catch{}let r=Q(v),i=()=>{let e=r?.parentElement;for(;e;){let t=getComputedStyle(e).overflowY;if((t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight+1)return e;e=e.parentElement}return null},o=()=>(n?r?.querySelector(`[data-anchor="${n}"]`):null)??r,s=0,u=()=>{let e=i(),t=o();if(!e||!t){s++<12?requestAnimationFrame(u):t?.scrollIntoView({block:`start`});return}let n=(e.querySelector(`#drawer-label`)?.getBoundingClientRect().height??0)+8,r=t.getBoundingClientRect().top-e.getBoundingClientRect().top-n;Math.abs(r)>2&&(e.scrollTop=Math.max(0,e.scrollTop+r)),s++<6&&requestAnimationFrame(u)};requestAnimationFrame(u),Ko.set(null)});var S=qIe();let C;var w=j(S),T=e=>{var t=WIe(),n=j(t),r=f(n,!0),i=g(n,2),a=f(i,!0);H(t),O(()=>
2296{Y(r,c()),Y(a,Q(x)?`â`:`+`)}),L(`click`,t,_),X(e,t)},E=e=>{var t=GIe(),n=f(t,!0);O(()=>Y(n,c())),X(e,t)};G(w,e=>{u()&&!Q(b)?e(T):e(E,-1)});var D=g(w,2),k=e=>{var t=KIe(),n=j(t);ae(n,()=>p()??qe),H(t),X(e,t)};G(D,e=>{Q(x)&&e(k)}),H(S),We(S,e=>I(v,e),()=>Q(v)),O(()=>C=r(S,1,`border-b border-gray-700/40 pb-2`,null,C,{hidden:Q(b)&&!Q(y)})),X(e,S),ue(),s()}ge([`click`]);var JIe=V(`<p class="ui-section-label" data-anchor="Start view">Start view</p> <!> <p class="text-[10px] italic text-gray-400"> </p>`,1);function YIe(e,t){Ce(t,!1);let n=()=>z(qee,`$scenePhysicsState_`,i),r=()=>z(Lm,`$placeholderStuckSeconds`,i),[i,a]=Ve();R();var o=JIe(),s=g(N(o),2);{let e=ze(()=>n().holdCamera===!0);xo(s,{id:`hold-camera-until-loaded`,"data-tour":`hold-camera-until-loaded`,get checked(){return Q(e)},onchange:e=>vl({holdCamera:e.currentTarget.checked}),children:(e,t)=>{W();var n=Te(`Hold camera until loaded`);X(e,n)},$$slots:{default:!0}})}var c=g(s,2),l=f(c);O(()=>Y(l,`Saved with the scene. While it loads, the camera stays on the view it was saved with and ignores 2297 input â until everything is in, only stuck or failed pieces are left, ${r()??``} s 2298 pass, or you press Esc / Take control. Off: the scene opens on that view and your first move wins.`)),X(e,o),ue(),a()}var XIe=V(`<span> </span>`),ZIe=V(`<span class="dn-unit svelte-1nebhy1" aria-hidden="true"> </span>`),QIe=V(`<div><!> <input type="text" inputmode="decimal" autocomplete="off" spellcheck="false" class="dn-input tabular-nums svelte-1nebhy1"/> <!></div>`);function hq(e,n){Ce(n,!0);let i=()=>z(zC,`$lengthUnit`,o),a=()=>z(RC,`$angleUnit`,o),[o,s]=Ve(),c=J(n,`label`,3,``),l=J(n,`value`,3,0),d=J(n,`step`,3,.01),p=J(n,`snap`,3,.5),m=J(n,`decimals`,3,2),h=J(n,`min`,19,()=>-1/0),_=J(n,`max`,3,1/0),y=J(n,`accent`,3,``),x=J(n,`id`,3,void 0),S=J(n,`title`,3,``),C=J(n,`ariaLabel`,3,``),w=J(n,`mixed`,3,!1),T=J(n,`disabled`,3,!1),E=J(n,`nodrag`,3,!1),D=J(n,`unit`,3,``),k=J(n,`onchange`,3,()=>{}),A=J(n,`onscrubstart`,3,()=>{}),ee=J(n,`onscrubend`,3,()=>{}),M=e=>Math.min(_(),Math.max(h(),e)),te=q(()=>D()===`length`||D()===`angle`||D()===`angleDeg`?D():null),N=q(()=>Q(te)===`length`?i():Q(te)?a():``),P=q(()=>Q(te)?E_e(Q(te),Q(N)):1),re=q(()=>Q(te)?D_e(m(),Q(te),Q(N)):m()),ie=q(()=>Q(te)?T_e(Q(te),Q(N)):``),F=e=>(Number(e??0)/Q(P)).toFixed(Q(re)),ae=e=>Number(Number((e??0)/Q(P)).toFixed(Q(re)))*Q(P),oe=q(()=>(Q(re)>0?Number((10**-Q(re)).toFixed(Q(re))):1)*Q(P)),R=t(!1),se=t(``),ce=t(!1),le=t(null),de=0,fe=0,pe=0,B=q(()=>Q(R)?Q(se):w()?`â`:F(l()));function me(e){Number.isFinite(e)&&k()(M(e))}function V(e){I(se,e.currentTarget.value,!0);let t=Q(te)?BC(Q(se),Q(te),Q(N)):parseFloat(Q(se));Number.isFinite(t)&&me(t)}function he(e){return e.addEventListener(`keydown`,U),{destroy:()=>e.removeEventListener(`keydown`,U)}}function ge(e){return e.addEventListener(`pointerdown`,ve),e.addEventListener(`pointermove`,ye),e.addEventListener(`pointerup`,be),{destroy:()=>{e.removeEventListener(`pointerdown`,ve),e.removeEventListener(`pointermove`,ye),e.removeEventListener(`pointerup`,be)}}}function U(e){let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`;if(t||n){let n=e.shiftKey?100:e.ctrlKey||e.metaKey?10:1,r=Q(oe)*n*(t?1:-1),i=M(Number((Number(l())+r).toFixed(6)));I(se,F(i),!0),me(i),e.preventDefault();return}e.key===`Escape`?(me(de),I(se,F(de),!0),Q(le)?.blur(),e.preventDefault(),e.stopPropagation()):e.key===`Enter`&&Q(le)?.blur()}function W(e){I(R,!0),de=Number(l())||0,I(se,F(l()),!0);let t=e.currentTarget;requestAnimationFrame(()=>t?.select?.())}function _e(){I(R,!1),I(ce,!1)}function ve(e){T()||e.button===0&&(fe=Number(l())||0,pe=e.clientX,I(ce,!1),Q(R)||e.preventDefault())}function ye(e){if(T()||e.buttons!==1)return;let t=e.clientX-pe;if(!Q(ce)){if(Math.abs(t)<3)return;I(ce,!0),e.currentTarget.setPointerCapture?.(e.pointerId),A()()}document.getSelection?.()?.removeAllRanges?.();let n=fe+t*d()*(e.shiftKey?.1:1);(e.ctrlKey||e.metaKey)&&(n=Math.round(n/p())*p()),n=ae(M(n)),I(se,F(n),!0),me(n)}function be(e){if(T())return;let t=Q(ce);if(I(ce,!1),t){e.currentTarget.releasePointerCapture?.(e.pointerId),ee()();return}Q(le)?.focus()}var xe=QIe();let K;var Se=j(xe),we=e=>{var t=XIe(),n=f(t,!0);O(()=>{r(t,1,`dn-label `+y(),`svelte-1nebhy1`),Y(n,c())}),X(e,t)};G(Se,e=>{c()&&e(we)});var Te=g(Se,2);v(Te),We(Te,e=>I(le,e),()=>Q(le)),ne(Te,e=>he?.(e));var Ee=g(Te,2),De=e=>{var t=ZIe(),n=f(t,!0);O(()=>Y(n,Q(ie))),X(e,t)};G(Ee,e=>{Q(ie)&&e(De)}),H(xe),ne(xe,e=>ge?.(e)),O(()=>{K=r(xe,1,`dn-wrap svelte-1nebhy1`,null,K,{nodrag:E(),"dn-scrub":Q(ce),"dn-focus":Q(R),"dn-disabled":T()}),b(Te,`id`,x()),b(Te,`aria-label`,C()||c()||`value`),b(Te,`title`,S()||(Q(te)?`Drag to scrub · type to set (a suffix wins: 12cm, 4in, 90deg) · ââ steps (Ctrl Ã10, Shift Ã100) · Esc reverts`:`Drag to scrub · type to set · ââ steps (Ctrl Ã10, Shift Ã100) · Esc reverts`)),u(Te,Q(B)),Te.disabled=T()}),L(`input`,Te,V),L(`change`,Te,V),Z(`focus`,Te,W),Z(`blur`,Te,_e),X(e,xe),ue(),s()}ge([`input`,`change`]);var $Ie=V(`<span class="block text-amber-400">"Simplify distant models" is off in Settings.</span>`),eLe=V(`<p id="lod-none" class="text-[11px] text-gray-400"><!> <!></p> <div class="flex flex-wrap gap-1"><button id="lod-generate" type="button" class="ui-button">Generate levels</button></div> <p class="text-[10px] text-gray-500">Builds simplified copies (50% / 25% / 10% of the triangles) that draw when the object is small on screen.</p>`,1),tLe=V(`<p id="lod-implicit" class="text-[10px] italic text-gray-400">From the pack â saved with the scene once you change it.</p>`),nLe=V(`<button type="button"><span class="font-semibold text-white svelte-c9clfw"> </span> <span class="text-[9px] text-gray-100 svelte-c9clfw"> </span></button>`),rLe=V(`<div class="lod-seg-culled absolute top-0 flex h-full items-center justify-center bg-gray-700 text-[9px] text-gray-300">Culled</div>`),iLe=V(`<div class="lod-edge absolute top-0 z-10 h-full w-[7px] -translate-x-1/2 cursor-ew-resize"><div class="mx-auto h-full w-[2px] bg-white/80"></div></div>`),aLe=V(`<span> </span>`),oLe=V(`<p class="text-[10px] text-amber-400"> </p>`),sLe=V(`<p class="text-[10px] text-gray-500">LOD0 is the object itself â edit it with the rest of this panel.</p>`),cLe=V(`<!> <button id="lod-level-apply-ratio" type="button" class="ui-button-quiet self-start"> </button>`,1),lLe=V(`<button id="lod-level-move" type="button" class="ui-button tbx-on" aria-pressed="true">
2298Done moving</button>`),uLe=V(`<button id="lod-level-move" type="button" class="ui-button" aria-pressed="false">Move level</button>`),dLe=V(`<button id="lod-level-reset" type="button" class="ui-button-quiet">Reset offset</button>`),fLe=V(`<div class="ui-row items-center gap-2"><span class="w-24 shrink-0 text-xs text-gray-400">Colour</span> <input id="lod-level-color" type="color"/></div> <!> <!>`,1),pLe=V(`<!> <div class="ui-row items-center gap-2"><span class="w-24 shrink-0 text-xs text-gray-400">Replace with</span> <!></div> <p class="text-[10px] text-gray-500">â¦or drop a model from the Explorer on the bar.</p> <div class="flex flex-wrap gap-1"><!> <!> <button id="lod-level-remove" type="button" class="ui-button-quiet">Remove level</button></div> <label class="flex items-center gap-2"><input id="lod-level-override" type="checkbox" class="tp-check"/> Own material for this level</label> <!>`,1),mLe=V(`<div id="lod-level-detail" class="flex flex-col gap-1.5 rounded-sm border border-gray-600/60 p-2"><div class="flex items-center justify-between"><span class="font-semibold text-gray-100"> </span> <span class="text-[10px] text-gray-400">previewing on this screen</span></div> <p id="lod-level-source" class="text-[11px]"> </p> <!> <!></div>`),hLe=V(`<p class="text-[10px] text-gray-500">Click a level on the bar to select it: the viewport shows that level while it is selected.</p>`),gLe=V(`<button id="lod-remove-group" type="button" class="ui-button-quiet">Remove group</button>`),_Le=V(`<!> <div class="flex items-center justify-between text-[10px] text-gray-500"><span>100%</span><span>screen height</span><span>0%</span></div> <div id="lod-bar" class="relative h-9 w-full select-none overflow-hidden rounded-sm border border-gray-600"><!> <!> <!> <div id="lod-marker" class="pointer-events-none absolute bottom-0 h-1.5 w-0.5 bg-white"></div></div> <div class="flex flex-wrap gap-x-3 text-[10px] text-gray-400"><!> <span id="lod-now"> </span></div> <div class="ui-row items-center gap-2"><span class="w-24 shrink-0 text-xs text-gray-400">Force LOD</span> <!></div> <label class="flex items-center gap-2"><input id="lod-cull" type="checkbox" class="tp-check"/> Cull when smaller than the last level's size</label> <label class="flex items-center gap-2"><input id="lod-overlay" type="checkbox" class="tp-check"/> Show LOD level in the viewport (colours, this screen only)</label> <!> <div class="flex flex-wrap gap-1"><button id="lod-add-level" type="button" class="ui-button-quiet">+ Level</button> <button id="lod-generate" type="button" class="ui-button-quiet">Generate levels</button> <button id="lod-build-all" type="button" class="ui-button-quiet">Build all now</button> <!></div>`,1),vLe=V(`<div id="lod-group" class="flex flex-col gap-2 text-xs text-gray-300"><!></div>`);function yLe(e,n){Ce(n,!0);let i=()=>z(Ple,`$lodGroupTick`,l),a=()=>z(Ui,`$objectsGroup`,l),o=()=>z(Bj,`$lodLevelGizmo`,l),s=()=>z(ya,`$lodEnabled`,l),c=()=>z(va,`$lodShowLevels`,l),[l,d]=Ve(),p=t(null);function m(e,t,n){return Fle(e)}let h=q(()=>m(n.uuid,i(),a()));function _(e,t,n){let r=null;if(a()?.traverse?.(t=>{t.uuid===e&&(r=t)}),!r)return{meshes:0,levels:[]};let i=new Set;r.traverse(e=>e.isMesh&&i.add(e.uuid));let o=ha().meshes.filter(e=>i.has(e.uuid));return{meshes:o.length,levels:o.map(e=>e.levels?[e.triangles,...e.levels]:[e.triangles])}}let y=q(()=>Q(h)?null:_(n.uuid,i(),a()));Qe(()=>{let e=Q(p),t=Q(h)?.levels.length??0;e!==null&&e<t?j_.set({uuid:n.uuid,level:e}):j_.set(null)});let x=``;Qe(()=>{n.uuid!==x&&(x=n.uuid,I(p,null))}),Pe(()=>{j_.set(null),Zj()});let S=e=>(1-Math.sqrt(Math.max(0,Math.min(1,e))))*100,C=e=>(1-Math.max(0,Math.min(1,e)))**2,T=e=>e>=.1?Math.round(e*100)+`%`:(e*100).toFixed(1)+`%`,E=q(()=>{if(!Q(h))return[];let e=Q(h).levels;return e.map((t,n)=>({level:n,from:n===0?0:S(e[n-1].screenSize),to:n===e.length-1&&!Q(h).block.cull?100:S(t.screenSize),tris:t.tris,status:t.status}))}),D=t(null),k=null;function A(e,t){let r=t,i=e=>{e.button===0&&(e.preventDefault(),e.stopPropagation(),k={edge:r,before:JSON.parse(JSON.stringify(I_(n.uuid)))},window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s))},a=e=>{let t=Q(D)?.getBoundingClientRect();return t&&t.width>0?C((e.clientX-t.left)/t.width):null},o=e=>{if(!k)return;let t=a(e);t!==null&&F_(n.uuid,k.edge,t)},s=e=>{if(window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),!k)return;let t=a(e);F_(n.uuid,k.edge,t??I_(n.uuid)?.levels[k.edge].screenSize??0,{commit:!0,before:k.before}),k=null};return e.addEventListener(`pointerdown`,i),{update(e){r=e},destroy(){e.removeEventListener(`pointerdown`,i),window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s)}}}let ee=q(()=>[{value:`auto`,name:`Auto`},...(Q(h)?.levels??[]).map((e,t)=>({value:String(t),name:`LOD`+t}))]),M=q(()=>Q(h)?.block.mode===`forced`?String(Q(h).block.forced):`auto`),te=q(()=>Q(p)!==null&&Q(h)?Q(h).levels[Q(p)]??null:null);function P(e){return e?e.source===`self`?`The object itself`:e.source===`pack`?`Pack file · `+String(e.ref).split(`/`).pop():e.source===`generated`?`Generated · `+Math.round((e.ratio??0)*100)+`% of LOD0`:e.source===`explorer`?`Explorer · `+(e.name||String(e.ref).slice(0,10)):e.source===`object`?`Ob
2298ject · `+(re(e.ref)||`missing`):e.source:``}function re(e){let t=``;return a()?.traverse?.(n=>{n.uuid===e&&(t=n.name||n.type)}),t}let ie=q(()=>(a()?.children??[]).filter(e=>e.uuid!==n.uuid&&!e.userData?.isEditOverlay).slice(0,200).map(e=>({value:e.uuid,name:e.name||e.type})));function F(e){I(p,Q(p)===e?null:e,!0),o()&&Zj()}let ae=t(.5);Qe(()=>{Q(te)?.source===`generated`&&I(ae,Q(te).ratio??.5,!0)});function oe(e){e.preventDefault();let t=e.dataTransfer?.getData(`application/x-explorer-item`);if(t&&Q(p)!==null&&Q(p)!==0)try{R(JSON.parse(t))}catch{}}async function R(e){if(Q(p)===null)return;let{explorerItems:t}=await $(async()=>{let{explorerItems:e}=await import(`../chunks/DkMAWo2j.js`).then(e=>e.f);return{explorerItems:e}},__vite__mapDeps([69,1,2,9,44,5,6,3,70,20,21]),import.meta.url),r=[];t.subscribe(e=>r=e)();let i=r.find(t=>t.id===e.id);if(i?.kind===`object`&&i.hash){N_(n.uuid,Q(p),{source:`explorer`,ref:i.hash,name:i.name});return}if(e.url){let t=(await $(async()=>{let{PACKS_BASE:e}=await import(`../chunks/hFv0pVtC.js`).then(e=>e.m);return{PACKS_BASE:e}},__vite__mapDeps([127,1,2,6,3,69,9,44,5,70,20,21,100,128,129]),import.meta.url)).PACKS_BASE.replace(/\/+$/,``)+`/`,r=String(e.url).startsWith(t)?String(e.url).slice(t.length):String(e.url);N_(n.uuid,Q(p),{source:`pack`,ref:r,name:e.name})}}var se=vLe(),ce=j(se),le=e=>{var t=eLe(),r=N(t),i=j(r),a=e=>{var t=Te();O(e=>Y(t,`Automatic: ${Q(y).meshes??``} mesh${Q(y).meshes===1?``:`es`} simplified at a distance 2299 (${e??``} tris).`),[()=>Q(y).levels.map(e=>e.join(` â `)).join(`; `)]),X(e,t)},o=e=>{var t=Te(`No LOD group â the object always draws in full detail.`);X(e,t)};G(i,e=>{Q(y)&&Q(y).meshes?e(a):e(o,-1)});var c=g(i,2),l=e=>{var t=$Ie();X(e,t)};G(c,e=>{s()||e(l)}),H(r);var u=g(r,2),d=f(u);W(2),L(`click`,d,()=>M_(n.uuid)),X(e,t)},de=e=>{var t=_Le(),i=N(t),a=e=>{var t=tLe();X(e,t)};G(i,e=>{Q(h).implicit&&e(a)});var s=g(i,4),l=j(s);B(l,17,()=>Q(E),e=>e.level,(e,t)=>{var n=nLe();let i,a;var o=j(n),s=f(o),c=g(o,2),l=f(c,!0);H(n),O((e,o)=>{i=r(n,1,`lod-seg absolute top-0 flex h-full flex-col items-start justify-center overflow-hidden px-1 text-left leading-tight svelte-c9clfw`,null,i,{"lod-seg-sel":Q(p)===Q(t).level,"lod-seg-active":Q(h).current===Q(t).level}),b(n,`data-level`,Q(t).level),b(n,`title`,`LOD`+Q(t).level+(Q(t).tris==null?``:` · `+Q(t).tris+` tris`)+` â click to select and preview`),a=Ze(n,``,a,{left:Q(t).from+`%`,width:e,background:o}),Y(s,`LOD${Q(t).level??``}`),Y(l,Q(t).tris==null?Q(t).status===`loading`?`â¦`:Q(t).status===`failed`?`failed`:`not built`:Q(t).tris+` tris`)},[()=>Math.max(0,Q(t).to-Q(t).from)+`%`,()=>Nle(Q(t).level)+(Q(p)===Q(t).level?`cc`:`66`)]),L(`click`,n,()=>F(Q(t).level)),X(e,n)});var d=g(l,2),m=e=>{var t=rLe();let n;O(e=>n=Ze(t,``,n,{left:e,right:`0`}),[()=>S(Q(h).levels[Q(h).levels.length-1].screenSize)+`%`]),X(e,t)};G(d,e=>{Q(h).block.cull&&e(m)});var _=g(d,2);B(_,17,()=>Q(h).levels,Be,(e,t,n)=>{var r=fe(),i=N(r),a=e=>{var r=iLe();b(r,`data-edge`,n);let i;ne(r,(e,t)=>A?.(e,t),()=>n),O((e,t)=>{b(r,`title`,e),i=Ze(r,``,i,{left:t})},[()=>`LOD`+n+` â `+(n<Q(h).levels.length-1?`LOD`+(n+1):`culled`)+` at `+T(Q(t).screenSize)+` â drag`,()=>S(Q(t).screenSize)+`%`]),X(e,r)};G(i,e=>{(n<Q(h).levels.length-1||Q(h).block.cull)&&e(a)}),X(e,r)});var y=g(_,2);let x;H(s),We(s,e=>I(D,e),()=>Q(D));var C=g(s,2),k=j(C);B(k,17,()=>Q(h).levels,Be,(e,t,n)=>{var r=aLe(),i=f(r);O(e=>Y(i,`LOD${n} < ${e??``}`),[()=>T(Q(t).screenSize)]),X(e,r)});var re=g(k,2),R=f(re);H(C);var se=g(C,2);fq(g(j(se),2),{id:`lod-force`,get items(){return Q(ee)},get value(){return Q(M)},onchange:e=>Rle(n.uuid,e===`auto`?`auto`:Number(e))}),H(se);var ce=g(se,2),le=j(ce);v(le),W(),H(ce);var ue=g(ce,2),de=j(ue);v(de),W(),H(ue);var z=g(ue,2),pe=e=>{var t=mLe(),r=j(t),i=j(r),a=f(i);W(2),H(r);var s=g(r,2),c=f(s),l=g(s,2),d=e=>{var t=oLe(),n=f(t,!0);O(()=>Y(n,Q(te).error)),X(e,t)};G(l,e=>{Q(te).error&&e(d)});var m=g(l,2),h=e=>{var t=sLe();X(e,t)},_=e=>{var t=pLe(),r=N(t),i=e=>{var t=cLe(),r=N(t);{let e=q(()=>Math.round(Q(ae)*100));hq(r,{id:`lod-level-ratio`,label:`Triangles %`,get value(){return Q(e)},min:1,max:99,step:.5,decimals:0,onchange:e=>I(ae,e/100),onscrubend:()=>L_(n.uuid,Q(p),{ratio:Q(ae)})})}var i=g(r,2),a=f(i);O(e=>Y(a,`Rebuild at ${e??``}%`),[()=>Math.round(Q(ae)*100)]),L(`click`,i,()=>L_(n.uuid,Q(p),{ratio:Q(ae)})),X(e,t)};G(r,e=>{Q(te).source===`generated`&&e(i)});var a=g(r,2),s=g(j(a),2);{let e=q(()=>[{value:``,name:`Choose an objectâ¦`},{value:`__generated`,name:`Generated (meshopt)`},...Q(ie)]);fq(s,{id:`lod-level-replace`,get items(){return Q(e)},value:``,onchange:e=>{e&&Q(p)!==null&&(e===`__generated`?N_(n.uuid,Q(p),{source:`generated`,ratio:Q(te).ratio??.5}):N_(n.uuid,Q(p),{source:`object`,ref:e}))}})}H(a);var c=g(a,4),l=j(c),d=e=>{var t=lLe();L(`click`,t,()=>Zj()),X(e,t)},m=e=>{var t=uLe();L(`click`,t,()=>Xj(n.uuid,Q(p))),X(e,t)};G(l,e=>{o()?.uuid===n.uuid&&o()?.level===Q(p)?e(d):e(m,-1)});var h=g(l,2),_=e=>{var t=dLe();L(`click`,t,()=>tM(n.uuid,Q(p))),X(e,t)};G(h,e=>{Q(te).offset&&e(_)}
2299);var y=g(h,2);H(c);var b=g(c,2),x=j(b);v(x),W(),H(b);var S=g(b,2),C=e=>{var t=fLe(),r=N(t),i=g(j(r),2);v(i),H(r);var a=g(r,2);{let e=q(()=>Q(te).material.roughness??.5);hq(a,{id:`lod-level-roughness`,label:`Roughness`,get value(){return Q(e)},min:0,max:1,step:.005,decimals:2,onchange:e=>L_(n.uuid,Q(p),{material:{...Q(te).material,roughness:e}})})}var o=g(a,2);{let e=q(()=>Q(te).material.metalness??0);hq(o,{id:`lod-level-metalness`,label:`Metalness`,get value(){return Q(e)},min:0,max:1,step:.005,decimals:2,onchange:e=>L_(n.uuid,Q(p),{material:{...Q(te).material,metalness:e}})})}O(()=>u(i,Q(te).material.color??`#ffffff`)),L(`change`,i,e=>L_(n.uuid,Q(p),{material:{...Q(te).material,color:e.currentTarget.value}})),X(e,t)};G(S,e=>{Q(te).material&&e(C)}),O(()=>w(x,!!Q(te).material)),L(`click`,y,()=>{let e=Q(p);I(p,null),e!==null&&zle(n.uuid,e)}),L(`change`,x,e=>L_(n.uuid,Q(p),{material:e.currentTarget.checked?{color:`#ffffff`}:void 0})),X(e,t)};G(m,e=>{Q(p)===0?e(h):e(_,-1)}),H(t),O(e=>{b(t,`data-level`,Q(p)),Y(a,`LOD${Q(p)??``}`),Y(c,`${e??``} · ${(Q(te).tris==null?Q(te).status:Q(te).tris+` tris`)??``}`)},[()=>P(Q(te))]),X(e,t)},me=e=>{var t=hLe();X(e,t)};G(z,e=>{Q(te)&&Q(p)!==null?e(pe):e(me,-1)});var V=g(z,2),he=j(V),ge=g(he,2),U=g(ge,2),_e=g(U,2),ve=e=>{var t=gLe();L(`click`,t,()=>{I(p,null),P_(n.uuid,null)}),X(e,t)};G(_e,e=>{Q(h).implicit||e(ve)}),H(V),O((e,t)=>{x=Ze(y,``,x,{left:e}),Y(R,`now: LOD${(Q(h).current<0?` culled`:Q(h).current)??``} at ${t??``}`),w(le,!!Q(h).block.cull),w(de,c())},[()=>S(Math.min(1,Q(h).size))+`%`,()=>T(Math.min(1,Q(h).size))]),Z(`dragover`,s,e=>e.preventDefault()),Z(`drop`,s,oe),L(`change`,le,e=>P_(n.uuid,{...Q(h).block,cull:e.currentTarget.checked})),L(`change`,de,e=>va.set(e.currentTarget.checked)),L(`click`,he,()=>Ble(n.uuid)),L(`click`,ge,()=>M_(n.uuid)),L(`click`,U,()=>Ile(n.uuid)),X(e,t)};G(ce,e=>{Q(h)?e(de,-1):e(le)}),H(se),X(e,se),ue(),d()}ge([`click`,`change`]);var gq=Ue(null);function _q(e){gq.set(e)}function vq(e){return U(Ui)?.getObjectByProperty(`uuid`,e)??null}function yq(e,t){let n=vq(e),r=U(Ui);if(!n||!r||!t?.glbUrl)return!1;let i=Gm(t.glbUrl,{pack:t.packName,item:t.name});if(!i)return es(`That item cannot be referenced (it is not a pack file)`),!1;let a=Goe(n),o=n.parent??r,s=new Pn;s.uuid=n.uuid,s.name=!n.name||n.name===a?.item?t.label||t.name:n.name,s.position.copy(n.position),s.quaternion.copy(n.quaternion),s.scale.copy(n.scale),s.visible=n.visible;let{packRef:c,packStub:l,lod:u,...d}=n.userData??{};s.userData=JSON.parse(JSON.stringify({...d,packRef:{...i,box:Roe(n)},packStub:!0})),s.updateMatrix();let f=U(Es);Lf();try{Pf(`delete`,n),o.remove(n),f&&f.send({type:`delete`,uuid:n.uuid,peerId:f.peer.id}),o.add(s),Pf(`create`,s),f&&f.send({type:`object`,element:s.toJSON(),groupuuid:o===r?void 0:o.uuid})}finally{kf(`Replace model`)}return ci(),!0}async function bq(e,t){let n=vq(e);if(!n)return null;let[{itemBlob:r},{importFile:i},{deleteObjectsByUuid:a}]=await Promise.all([$(()=>import(`../chunks/DkMAWo2j.js`).then(e=>e.f),__vite__mapDeps([69,1,2,9,44,5,6,3,70,20,21]),import.meta.url),$(()=>import(`../chunks/WtwIK9_h.js`).then(e=>e.n),__vite__mapDeps([196,1,2,6,3,9,0,4,69,44,5,70,20,21,126,100,18,10,19,7,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,116,125,127,128,129,130,131,133,134,135,117,118,119,120,121,136,137,154,123,155,145,146,147,148,149,150,156,157,115,158,112,113,114,122,93,88,94,89,90,91,92,15,159,160,161,162,140,141,138,163,143,164,153,132,139,144,151,152,197,198,199,200]),import.meta.url),$(()=>import(`../chunks/BFaBkNqh.js`).then(e=>e._),__vite__mapDeps([113,1,2,6,9,0,3,4,5,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url)]),o=await r(t.id);if(!o)return es(`That library file is not on this device`),null;n.updateWorldMatrix(!0,!1);let s=new hn,c=new zt,l=new hn;n.matrixWorld.decompose(s,c,l);let u=await i(new File([o],t.name),t.name.replace(/\.\w+$/,``),void 0,s.toArray());if(!u)return null;let d=vq(u);if(d){d.quaternion.copy(c),d.scale.copy(l),d.position.copy(s),d.updateMatrix();let e=U(Es);e&&e.send({type:`move`,uuid:d.uuid,pos:d.position.toArray(),rot:d.rotation.toArray(),scale:d.scale.toArray()})}return vq(e)&&Uoe(vq(e))&&a([e]),es(`Replaced with "`+t.name+`" (a library model is a new object)`),u}var bLe=V(`<div class="load-track svelte-1263swp" aria-hidden="true"><div></div></div>`),xLe=V(`<div id="load-state-panel" class="flex flex-col gap-1.5 px-1 text-xs svelte-1263swp"><div class="flex items-center gap-1.5 svelte-1263swp"><span class="load-dot svelte-1263swp"></span> <span id="load-state-label" class="min-w-0 flex-1 svelte-1263swp"> </span></div> <!> <div class="truncate opacity-80 svelte-1263swp"> </div> <div id="load-state-url" class="load-url truncate svelte-1263swp"> </div> <div class="mt-1 flex flex-wrap gap-1 svelte-1263swp"><button id="load-retry" class="ui-chip inline-flex items-center gap-1 bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1263swp" title="Fetch the file again now (every copy of this piece comes back with it)"><!>Retry</button> <button id="load-replace" class="ui-chip inline-flex items-center gap-1 bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1263swp" title="Put a different pack item or library model here, keeping the position, rotation and scale"><!>Replace modelâ¦</button> <button id="load-remove" class="ui-chip inline-flex items-center gap-1 bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1263swp" title="Delete this piece (undoable)"><!>Remove</button></div> <p class="text-[10px] italic opacity-70 svelte-1263swp">You can move, rotate and scale it now â the model arrives where the box is.</p></div>`);function SLe(e,n){Ce(n,!0);let i=()=>z(Foe,`$loadRevision`,s),a=()=>z(Ui,`$objectsGroup`,s),o=()=>z(Lm,`$placeholderStuckSeconds`,s),[s,c]=Ve(),l=t(0);Qe(()=>{let e=setInterval(()=>pe(l),500);return()=>clearInterval(e)});function u(e,t,n,r,i){let a=Wm(e);if(!a)return null;let o=a.load,s=Vm(),c=Bm(o,s,i*1e3),l=Noe(o),u=`Waiting for its fileâ¦`;o?.phase===`failed`?u=`Failed â `+(o.error?.reason??`unknown error`)+(o.error?.status?` (HTTP `+o.error.status+`)`:``):o?.phase===`waiting`?u=`Retrying in `+Math.max(0,Math.ceil((o.retryAt-s)/1e3))+` s â `+(o.error?.reason??``)+` (attempt `+(o.attempt+2)+` of `+(Ioe.length+1)+`)`:o?.phase===`parsing`?u=`Preparing the modelâ¦`:o&&c===1?u=`Stuck â no data for `+Math.round((s-o.lastByteAt)/1e3)+` s`:o&&(u=`Loading `+(l>=0?Math.round(l*100)+`% · `:``)+zm(o.loaded)+(o.total?` of `+zm(
2299o.total):``));let d=c===2?`var(--icon-danger)`:c===1?`var(--icon-warning, var(--icon-danger))`:`var(--accent)`;return{...a,state:c,progress:l,label:u,tone:d,tip:Um(o)}}let d=q(()=>u(n.object,Q(l),i(),a(),o()));var p=fe(),m=N(p),h=e=>{var t=xLe(),i=j(t),a=j(i);let o;var s=g(a,2),c=f(s,!0);H(i);var l=g(i,2),u=e=>{var t=bLe(),n=j(t);let i,a;H(t),O(e=>{i=r(n,1,`load-fill svelte-1263swp`,null,i,{indeterminate:Q(d).progress<0}),a=Ze(n,``,a,{width:e,background:Q(d).tone})},[()=>(Q(d).progress<0?35:Math.round(Q(d).progress*100))+`%`]),X(e,t)};G(l,e=>{Q(d).load&&Q(d).load.phase!==`failed`&&e(u)});var p=g(l,2),m=f(p),h=g(p,2),_=f(h,!0),v=g(h,2),y=j(v),x=j(y);wS(x,{name:`refresh-cw`,size:13}),W(),H(y);var S=g(y,2),C=j(S);wS(C,{name:`folder-input`,size:13}),W(),H(S);var w=g(S,2),T=j(w);wS(T,{name:`trash-2`,size:13}),W(),H(w),H(v),W(2),H(t),O(()=>{b(t,`data-state`,Q(d).load?.phase??`waiting`),o=Ze(a,``,o,{background:Q(d).tone}),b(s,`title`,Q(d).tip),Y(c,Q(d).label),b(p,`title`,Q(d).url),Y(m,`${Q(d).item??``}${Q(d).pack?` · `+Q(d).pack:``}`),b(h,`title`,Q(d).url),Y(_,Q(d).url)}),L(`click`,y,()=>Woe(n.object)),L(`click`,S,()=>_q(n.object.uuid)),L(`click`,w,()=>coe([n.object.uuid])),X(e,t)};G(m,e=>{Q(d)&&e(h)}),X(e,p),ue(),c()}ge([`click`]);var CLe=V(`<div class="ui-row"><span class="w-20 shrink-0 overflow-hidden text-ellipsis whitespace-nowrap text-xs text-gray-400"> </span> <input type="range" class="min-w-0 flex-1 accent-primary-600"/> <div class="w-16 shrink-0"><!></div></div>`);function xq(e,t){Ce(t,!0);let n=J(t,`label`,3,``),r=J(t,`value`,3,0),i=J(t,`min`,3,0),a=J(t,`max`,3,1),o=J(t,`step`,3,.01),s=J(t,`decimals`,3,2),c=J(t,`id`,3,void 0),l=J(t,`mixed`,3,!1),d=J(t,`onchange`,3,()=>{});function p(e){let t=parseFloat(e);Number.isNaN(t)||d()(t)}var m=CLe(),h=j(m),_=f(h,!0),y=g(h,2);v(y);var x=g(y,2),S=j(x);{let e=q(()=>
2299o()*10);hq(S,{get id(){return c()},get value(){return r()},get decimals(){return s()},get min(){return i()},get max(){return a()},get mixed(){return l()},get step(){return o()},get snap(){return Q(e)},get ariaLabel(){return n()},onchange:e=>d()(e)})}H(x),H(m),O(()=>{b(h,`title`,n()),Y(_,n()),b(y,`aria-label`,n()),b(y,`min`,i()),b(y,`max`,a()),b(y,`step`,o()),u(y,r())}),L(`input`,y,e=>p(e.currentTarget.value)),X(e,m),ue()}ge([`input`]);var wLe=V(`<p class="text-xs text-gray-400">No object.</p>`),TLe=V(`<!>Add bubble emitter`,1),Sq=V(`<div class="ui-row items-center gap-2"><!></div>`),ELe=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Water</span> <!></div> <p class="text-[10px] text-gray-500">The object's shape becomes a water volume (its box is the tank). Buoyancy and splashes come from 2300 the physics simulation.</p> <!>`,1),DLe=V(`<input id="water-preset-name" class="ui-input min-w-0 flex-1" placeholder="Preset name" aria-label="Preset name"/> <!>`,1),OLe=V(`<!>Save as presetâ¦`,1),kLe=V(`<!> <!>`,1),ALe=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Preset</span> <!></div> <div class="ui-row items-center gap-2"><!></div> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Shape</span> <!></div> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Level</span> <div class="w-24 shrink-0"><!></div> <!></div> <h4 class="mt-2 text-[11px] font-semibold text-gray-300">Waves</h4> <!> <!> <!> <!> <!> <!> <h4 class="mt-2 text-[11px] font-semibold text-gray-300">Look</h4> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Colour</span> <input type="color" aria-label="Shallow colour" title="Shallow colour" class="water-swatch svelte-1w9iydx"/> <span class="text-xs text-gray-400">â</span> <input type="color" aria-label="Deep colour" title="Deep colour" class="water-swatch svelte-1w9iydx"/> <span class="text-[10px] text-gray-500">shallow â deep</span></div> <!> <!> <!> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Reflection</span> <!></div> <!> <!> <!> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Foam colour</span> <input type="color" aria-label="Foam colour" class="water-swatch svelte-1w9iydx"/></div> <!> <!> <!> <!> <!> <!> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Glow</span> <input type="color" aria-label="Glow colour" class="water-swatch svelte-1w9iydx"/></div> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Underwater</span> <input type="color" aria-label="Underwater fog colour" class="water-swatch svelte-1w9iydx"/> <span class="text-[10px] text-gray-500">fog when the camera is inside</span></div> <!> <label class="ui-row items-center gap-2 text-xs text-gray-300"><input id="water-frozen" type="checkbox" class="tp-check"/> Frozen (still, frosted)</label> <h4 class="mt-2 text-[11px] font-semibold text-gray-300">Flow & physics</h4> <!> <!> <!> <!> <!>`,1),jLe=V(`<!>Burst now`,1),MLe=V(`<div class="ui-row items-center gap-2"><!> <span class="text-xs text-gray-400">for every peer</span></div>`),NLe=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Emission</span> <!></div> <!> <!> <!> <!> <!> <!> <!> <!> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Colour</span> <input type="color" aria-label="Bubble colour" class="water-swatch svelte-1w9iydx"/></div> <!> <label class="ui-row items-center gap-2 text-xs text-gray-300"><input type="checkbox" class="tp-check"/> Pop at the surface</label>`,1),PLe=V(`<!>Remove bubble emitter`,1),FLe=V(`<h4 class="mt-2 text-[11px] font-semibold text-gray-300">Bubbles</h4> <label class="ui-row items-center gap-2 text-xs text-gray-300"><input id="water-bubbles-on" type="checkbox" class="tp-check"/> Bubbles rise to the surface</label> <!> <!>`,1),ILe=V(`<!>Remove water`,1),LLe=V(`<div class="ui-row mt-2 items-center gap-2"><!></div>`),RLe=V(`<!> <!> <!>`,1);function zLe(e,n){Ce(n,!0);let r=()=>z(Ui,`$objectsGroup`,i),[i,a]=Ve();function o(e,t){return r()?.getObjectByProperty?.(`uuid`,e)??null}let s=q(()=>o(n.uuid,r())),c=q(()=>Q(s)?.userData?.water?Hu(Q(s).userData.water):null),l=q(()=>Uu(Q(c)??{})),d=q(()=>Vu(Q(c)?.waves)),f=q(()=>Q(c)?Gu(Q(c).bubbles):Q(s)?.userData?.bubbles?Gu({enabled:!0,...Q(s).userData.bubbles}):null),p=q(()=>!Q(c)&&!!Q(s)?.userData?.bubbles),m=t(Ne(yx())),h=t(!1),_=t(``),y=q(()=>[...Wu.map(e=>({value:e.key,name:e.name})),...Q(m).map(e=>({value:`user:`+e.name,name:`â `+e.name}))]);function b(e){e&&e!==`none`&&(e.startsWith(`user:`)?Ehe(n.uuid,e.slice(5)):bx(n.uuid,e))}let x=e=>Sx(n.uuid,{look:e}),C=e=>Sx(n.uuid,{waves:e}),T=e=>Q(p)?Che(n.uuid,e):Sx(n.uuid,{bubbles:e});function E(){The(n.uuid,Q(_))&&(I(m,yx(),!0),I(h,!1),I(_,``))}let D=q(()=>{if(!Q(s))return{min:-1,max:1,top:0};let e=one(Q(s));return{min:e[1],max:e[4],top:e[4]}}),k=e=>e.currentTarget.value;var A=RLe(),ee=N(A),M=e=>{var t=wLe();X(e,t)},te=e=>{var t=ELe(),r=N(t),i=g(j(r),2);{let e=q(()=>[{value:`none`,name:`Make it waterâ¦`},...Q(y)]);fq(i,{id:`water-add`,get items(){return Q(e)},value:`none`,onchange:e=>b(e)})}H(r);var a=g(r,4),o=e=>{var t=Sq(),r=j(t);Do(r,{id:`bubbles-add`,size:`xs`,color:`alternative`,onclick:()=>vx(n.uuid,{spread:.3}),children:(e,t)=>{var n=TLe(),r=N(n);gS(r,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}}),H(t),X(e,t)};G(a,e=>{Q(p)||e(o)}),X(e,t)},ne=e=>{var t=ALe(),r=N(t),i=g(j(r),2);{let e=q(()=>Q(c).preset||`pool`);fq(i,{id:`water-preset`,get items(){return Q(y)},get value(){return Q(e)},onchange:e=>b(e)})}H(r);var a=g(r,2),o=j(a),s=e=>{var t=DLe(),n=N(t);v(n);var r=g(n,2);{let e=q(()=>!Q(_).trim());Do(r,{size:`xs`,color:`alternative`,onclick:E,get disabled(){return Q(e)},children:(e,t)=>{W();var n=Te(`Save`);X(e,n)},$$slots:{default:!0}})}L(`keydown`,n,e=>{e.key===`Enter`&&E(),e.key===`Escape`&&I(h,!1)}),S(n,()=>Q(_),e=>I(_,e)),X(e,t)},f=e=>{var t=kLe(),n=N(t);
2300Do(n,{id:`water-save-preset`,size:`xs`,color:`alternative`,onclick:()=>I(h,!0),children:(e,t)=>{var n=OLe(),r=N(n);dS(r,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}});var r=g(n,2),i=e=>{Do(e,{size:`xs`,color:`alternative`,onclick:()=>{She(Q(c).preset.slice(5)),I(m,yx(),!0)},children:(e,t)=>{W();var n=Te(`Delete preset`);X(e,n)},$$slots:{default:!0}})},a=q(()=>Q(c).preset?.startsWith(`user:`));G(r,e=>{Q(a)&&e(i)}),X(e,t)};G(o,e=>{Q(h)?e(s):e(f,-1)}),H(a);var p=g(a,2);fq(g(j(p),2),{id:`water-shape`,items:[{value:`box`,name:`Box tank`},{value:`cylinder`,name:`Cylinder`},{value:`plane`,name:`Ocean (no floor)`}],get value(){return Q(c).shape},onchange:e=>Sx(n.uuid,{shape:e},{immediate:!0})}),H(p);var T=g(p,2),A=g(j(T),2),ee=j(A);{let e=q(()=>Q(c).level??Q(D).top);hq(ee,{id:`water-level`,get value(){return Q(e)},get min(){return Q(D).min},get max(){return Q(D).max},step:.005,decimals:3,ariaLabel:`Water level (local Y)`,onchange:e=>Sx(n.uuid,{level:e})})}H(A);var M=g(A,2);Do(M,{size:`xs`,color:`alternative`,onclick:()=>Sx(n.uuid,{level:null},{immediate:!0}),children:(e,t)=>{W();var n=Te(`Top`);X(e,n)},$$slots:{default:!0}}),H(T);var te=g(T,4);xq(te,{label:`Count`,min:0,max:8,step:1,decimals:0,get value(){return Q(d).count},onchange:e=>C({count:e})});var ne=g(te,2);xq(ne,{label:`Amplitude`,min:0,max:2,step:.005,decimals:3,get value(){return Q(d).amplitude},onchange:e=>C({amplitude:e})});var P=g(ne,2);xq(P,{label:`Wavelength`,min:.1,max:60,step:.1,decimals:1,get value(){return Q(d).wavelength},onchange:e=>C({wavelength:e})});var re=g(P,2);xq(re,{label:`Speed`,min:0,max:4,step:.05,get value(){return Q(d).speed},onchange:e=>C({speed:e})});var ie=g(re,2);xq(ie,{label:`Direction`,min:0,max:360,step:1,decimals:0,get value(){return Q(d).direction},onchange:e=>C({direction:e})});var F=g(ie,2);xq(F,{label:`Choppiness`,min:0,max:1,step:.01,get value(){return Q(d).choppiness},onchange:e=>C({choppiness:e})});var ae=g(F,4),oe=g(j(ae),2);v(oe);var R=g(oe,4);v(R),W(2),H(ae);var se=g(ae,2);xq(se,{label:`Clarity (m)`,min:.05,max:20,step:.05,get value(){return Q(l).clarity},onchange:e=>x({clarity:e})});var ce=g(se,2);xq(ce,{label:`Opacity`,min:0,max:1,step:.01,get value(){return Q(l).opacity},onchange:e=>x({opacity:e})});var le=g(ce,2);xq(le,{label:`Refraction`,min:0,max:1.5,step:.01,get value(){return Q(l).refraction},onchange:e=>x({refraction:e})});var ue=g(le,2);xq(ue,{label:`Chromatic`,min:0,max:1,step:.01,get value(){return Q(l).chromatic},onchange:e=>x({chromatic:e})});var de=g(ue,2);fq(g(j(de),2),{id:`water-reflection`,items:[{value:`env`,name:`Sky`},{value:`planar`,name:`Planar (mirror)`},{value:`none`,name:`None`}],get value(){return Q(l).reflection},onchange:e=>Sx(n.uuid,{look:{reflection:e}},{immediate:!0})}),H(de);var z=g(de,2);xq(z,{label:`Reflectivity`,min:0,max:1,step:.01,get value(){return Q(l).reflectivity},onchange:e=>x({reflectivity:e})});var fe=g(z,2);xq(fe,{label:`Fresnel`,min:.5,max:8,step:.1,decimals:1,get value(){return Q(l).fresnel},onchange:e=>x({fresnel:e})});var pe=g(fe,2);xq(pe,{label:`Roughness`,min:.01,max:1,step:.01,get value(){return Q(l).roughness},onchange:e=>x({roughness:e})});var B=g(pe,2);xq(B,{label:`Foam`,min:0,max:1,step:.01,get value(){return Q(l).foam},onchange:e=>x({foam:e})});var me=g(B,2),V=g(j(me),2);v(V),H(me);var he=g(me,2);xq(he,{label:`Shore foam (m)`,min:.01,max:2,step:.01,get value(){return Q(l).foamWidth},onchange:e=>x({foamWidth:e})});var ge=g(he,2);xq(ge,{label:`Caustics`,min:0,max:2,step:.01,get value(){return Q(l).caustics},onchange:e=>x({caustics:e})});var U=g(ge,2);xq(U,{label:`Caustic size`,min:.1,max:8,step:.05,get value(){return Q(l).causticScale},onchange:e=>x({causticScale:e})});var _e=g(U,2);xq(_e,{label:`Caustic speed`,min:0,max:3,step:.05,get value(){return Q(l).causticSpeed},onchange:e=>x({causticSpeed:e})});var ve=g(_e,2);xq(ve,{label:`Ripples`,min:0,max:1.5,step:.01,get value(){return Q(l).detail},onchange:e=>x({detail:e})});var ye=g(ve,2);xq(ye,{label:`Ripple size`,min:.1,max:12,step:.05,get value(){return Q(l).detailScale},onchange:e=>x({detailScale:e})});var be=g(ye,2);xq(be,{label:`Ripple speed`,min:0,max:3,step:.05,get value(){return Q(l).detailSpeed},onchange:e=>x({detailSpeed:e})});var xe=g(be,2),K=g(j(xe),2);v(K),H(xe);var Se=g(xe,2);xq(Se,{label:`Glow strength`,min:0,max:4,step:.05,get value(){return Q(l).emissiveStrength},onchange:e=>x({emissiveStrength:e})});var Ce=g(Se,2),we=g(j(Ce),2);v(we),W(2),H(Ce);var Ee=g(Ce,2);xq(Ee,{label:`Visibility (m)`,min:.2,max:60,step:.1,decimals:1,get value(){return Q(l).fogDistance},onchange:e=>x({fogDistance:e})});var J=g(Ee,2),De=j(J);v(De),W(),H(J);var Oe=g(J,4);xq(Oe,{label:`Flow X (m/s)`,min:-5,max:5,step:.05,get value(){return Q(c).flow[0]},onchange:e=>Sx(n.uuid,{flow:[e,Q(c).flow[1],Q(c).flow[2]]})});var ke=g(Oe,2);xq(ke,{label:`Flow Z (m/s)`,min:-5,max:5,step:.05,get value(){return Q(c).flow[2]},onchange:e=>Sx(n.uuid,{flow:[Q(c).flow[0],Q(c).flow[1],e]})});var Ae=g(ke,2);xq(Ae,{label:`Density`,min:50,max:5e3,step:5,decimals:0,get value(){return Q(c).density},onchange:e=>Sx(n.uuid,{density:e})});var je=g(Ae,2);
2300xq(je,{label:`Drag`,min:0,max:10,step:.05,get value(){return Q(c).linearDrag},onchange:e=>Sx(n.uuid,{linearDrag:e})}),xq(g(je,2),{label:`Spin drag`,min:0,max:10,step:.05,get value(){return Q(c).angularDrag},onchange:e=>Sx(n.uuid,{angularDrag:e})}),O(()=>{u(oe,Q(l).shallowColor),u(R,Q(l).deepColor),u(V,Q(l).foamColor),u(K,Q(l).emissive),u(we,Q(l).fogColor),w(De,!!Q(l).frozen)}),L(`input`,oe,e=>x({shallowColor:k(e)})),L(`input`,R,e=>x({deepColor:k(e)})),L(`input`,V,e=>x({foamColor:k(e)})),L(`input`,K,e=>x({emissive:k(e)})),L(`input`,we,e=>x({fogColor:k(e)})),L(`change`,De,e=>Sx(n.uuid,{look:{frozen:e.currentTarget.checked}},{immediate:!0})),X(e,t)};G(ee,e=>{Q(s)?Q(c)?e(ne,-1):e(te,1):e(M)});var P=g(ee,2),re=e=>{var t=FLe(),r=g(N(t),2),i=j(r);v(i),W(),H(r);var a=g(r,2),o=e=>{var t=NLe(),r=N(t);fq(g(j(r),2),{id:`water-bubbles-mode`,items:[{value:`continuous`,name:`Continuous`},{value:`burst`,name:`Burst (triggered)`}],get value(){return Q(f).mode},onchange:e=>T({mode:e})}),H(r);var i=g(r,2),a=e=>{var t=MLe(),r=j(t);Do(r,{id:`water-bubbles-burst`,size:`xs`,color:`alternative`,onclick:()=>whe(n.uuid),children:(e,t)=>{var n=jLe();EOe(N(n),{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}}),W(2),H(t),X(e,t)};G(i,e=>{Q(f).mode===`burst`&&e(a)});var o=g(i,2);xq(o,{label:`Count`,min:1,max:400,step:1,decimals:0,get value(){return Q(f).count},onchange:e=>T({count:e})});var s=g(o,2);xq(s,{label:`Rate (/s)`,min:.1,max:60,step:.1,decimals:1,get value(){return Q(f).rate},onchange:e=>T({rate:e})});var c=g(s,2);xq(c,{label:`Size min (m)`,min:.002,max:.5,step:.001,decimals:3,get value(){return Q(f).sizeMin},onchange:e=>T({sizeMin:e})});var l=g(c,2);xq(l,{label:`Size max (m)`,min:.002,max:.5,step:.001,decimals:3,get value(){return Q(f).sizeMax},onchange:e=>T({sizeMax:e})});var d=g(l,2);xq(d,{label:`Rise (m/s)`,min:.02,max:3,step:.01,get value(){return Q(f).riseSpeed},onchange:e=>T({riseSpeed:e})});var m=g(d,2);xq(m,{label:`Wobble`,min:0,max:1,step:.01,get value(){return Q(f).wobble},onchange:e=>T({wobble:e})});var h=g(m,2);{let e=q(()=>Q(p)?`Spread (m)`:`Spread`),t=q(()=>Q(p)?4:1);xq(h,{get label(){return Q(e)},min:0,get max(){return Q(t)},step:.01,get value(){return Q(f).spread},onchange:e=>T({spread:e})})}var _=g(h,2),y=e=>{xq(e,{label:`Height (m)`,min:.1,max:10,step:.05,get value(){return Q(f).height},onchange:e=>T({height:e})})};G(_,e=>{Q(p)&&e(y)});var b=g(_,2),x=g(j(b),2);v(x),H(b);var S=g(b,2);xq(S,{label:`Opacity`,min:0,max:1,step:.01,get value(){return Q(f).opacity},onchange:e=>T({opacity:e})});var C=g(S,2),E=j(C);v(E),W(),H(C),O(()=>{u(x,Q(f).color),w(E,Q(f).pop)}),L(`input`,x,e=>T({color:k(e)})),L(`change`,E,e=>T({pop:e.currentTarget.checked})),X(e,t)};G(a,e=>{Q(f).enabled&&e(o)});var s=g(a,2),c=e=>{var t=Sq(),r=j(t);Do(r,{size:`xs`,color:`alternative`,onclick:()=>vx(n.uuid,null),children:(e,t)=>{var n=PLe(),r=N(n);SS(r,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}}),H(t),X(e,t)};G(s,e=>{Q(p)&&e(c)}),O(()=>w(i,Q(f).enabled)),L(`change`,i,e=>T({enabled:e.currentTarget.checked})),X(e,t)};G(P,e=>{Q(f)&&(Q(c)||Q(p))&&e(re)});var ie=g(P,2),F=e=>{var t=LLe(),r=j(t);Do(r,{id:`water-remove`,size:`xs`,color:`alternative`,onclick:()=>xx(n.uuid),children:(e,t)=>{var n=ILe(),r=N(n);SS(r,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}}),H(t),X(e,t)};G(ie,e=>{Q(c)&&e(F)}),X(e,A),ue(),a()}ge([`keydown`,`input`,`change`]);var BLe=V(`<!> <!> <p class="text-[10px] text-gray-400" id="physics-floats-hint"><!></p>`,1),VLe=V(`<div class="ui-row items-center gap-2" data-tour="physics-floats"><span class="w-20 shrink-0 text-xs text-gray-400" title="How this body behaves in water volumes">Floats</span> <!></div> <!>`,1);function HLe(e,t){Ce(t,!0);let n=q(()=>t.object?.userData?.physics?.floats),r=q(()=>tse(Q(n))),i=q(()=>{if(Q(r).off)return`off`;if(Q(r).density===`mass`)return`mass`;let e=Object.entries(Qm).find(([,e])=>e===Q(r).density);return e?e[0]:`custom`}),a=q(()=>typeof Q(r).density==`number`?Q(r).density/(1e3*Math.max(Q(r).multiplier,1e-6)):null);function o(e){let r={...Q(n)??{},...e};for(let e of Object.keys(r))r[e]??delete r[e];t.setPhysics({floats:Object.keys(r).length?r:null})}function s(e){e===`off`?o({off:!0}):e===`mass`?o({off:null,density:`mass`}):e===`auto`?o({off:null,density:null}):e in Qm&&o({off:null,density:Qm[e]})}var c=VLe(),l=N(c),u=g(j(l),2);{let e=q(()=>[{value:`auto`,name:`Auto (half under)`},{value:`foam`,name:`Foam`},{value:`cork`,name:`Cork`},{value:`wood`,name:`Wood`},{value:`ice`,name:`Ice`},{value:`rubber`,name:`Rubber (sinks slowly)`},{value:`stone`,name:`Stone (sinks)`},{value:`metal`,name:`Metal (sinks)`},{value:`mass`,name:`From mass ÷ volume`},...Q(i)===`custom`?[{value:`custom`,name:`Custom`}]:[],{value:`off`,name:`Off (ignores water)`}]);fq(u,{id:`physics-floats`,get items(){return Q(e)},get value(){return Q(i)},onchange:e=>s(e)})}H(l);var d=g(l,2),f=e=>{var t=BLe(),n=N(t),i=e=>{xq(e,{id:`physics-floats-density`,label:`Density`,min:10,max:8e3,
2300step:10,decimals:0,get value(){return Q(r).density},onchange:e=>o({density:e})})};G(n,e=>{Q(r).density!==`mass`&&e(i)});var s=g(n,2);xq(s,{id:`physics-floats-multiplier`,label:`Buoyancy Ã`,min:0,max:4,step:.05,get value(){return Q(r).multiplier},onchange:e=>o({multiplier:e===1?null:e})});var c=g(s,2),l=j(c),u=e=>{var t=Te(`Density = mass ÷ collider volume (water is 1000 kg/m³).`);X(e,t)},d=e=>{var t=Te(`Sinks in water (denser than 1000 kg/m³).`);X(e,t)},f=e=>{var t=Te();O(e=>Y(t,`Floats about ${e??``}% under the surface (kg/m³; water is 1000).`),[()=>Math.round(Q(a)*100)]),X(e,t)};G(l,e=>{Q(a)==null?e(u):Q(a)>=1?e(d,1):e(f,-1)}),H(c),X(e,t)};G(d,e=>{Q(r).off||e(f)}),X(e,c),ue()}var ULe=V(`<!> <!>`,1),WLe=V(`<div data-tour="fluid-tank" class="contents"><!> <!> <!> <!> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Colour</span> <input id="fluid-color" type="color" class="h-6 w-8 cursor-pointer rounded-sm border border-gray-600 bg-transparent" aria-label="Fluid colour"/></div> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Look</span> <!></div> <!> <!> <!> <!> <button id="fluid-refill" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500">Refill</button> <p class="mt-1 text-[10px] text-gray-400">Each player simulates their own splash; these settings are shared. Pauses when off-screen. Quest shows drops (max 1500).</p></div>`);function GLe(e,t){Ce(t,!0);let n=q(()=>Bee(t.object?.userData?.fluid));function r(e){Bce(t.object.uuid,e)}mq(e,{label:`Fluid tank`,children:(e,t)=>{var i=WLe(),a=j(i);xq(a,{id:`fluid-count`,label:`Particles`,min:200,get max(){return zee},step:100,decimals:0,get value(){return Q(n).count},onchange:e=>r({count:e})});var o=g(a,2);xq(o,{id:`fluid-fill`,label:`Fill`,min:0,max:.95,step:.05,get value(){return Q(n).fill},onchange:e=>r({fill:e})});var s=g(o,2);xq(s,{id:`fluid-viscosity`,label:`Viscosity`,min:0,max:1,step:.01,get value(){return Q(n).viscosity},onchange:e=>r({viscosity:e})});var c=g(s,2);xq(c,{id:`fluid-tension`,label:`Surface tension`,min:0,max:2,step:.05,get value(){return Q(n).surfaceTension},onchange:e=>r({surfaceTension:e})});var l=g(c,2);xq(l,{id:`fluid-gravity`,label:`Gravity Ã`,min:-2,max:4,step:.05,get value(){return Q(n).gravityScale},onchange:e=>r({gravityScale:e})});var d=g(l,2),f=g(j(d),2);v(f),H(d);var p=g(d,2);xq(p,{id:`fluid-clarity`,label:`Clarity`,min:0,max:1,step:.05,get value(){return Q(n).clarity},onchange:e=>r({clarity:e})});var m=g(p,2);fq(g(j(m),2),{id:`fluid-quality`,items:[{value:`auto`,name:`Auto (surface on desktop, drops on Quest)`},{value:`high`,name:`Smooth surface`},{value:`points`,name:`Drops (cheapest)`}],get value(){return Q(n).quality},onchange:e=>r({quality:e})}),H(m);var h=g(m,2);xo(h,{id:`fluid-emitter-on`,get checked(){return Q(n).emitter.on},onchange:e=>r({emitter:{on:e.currentTarget.checked}}),children:(e,t)=>{W();var n=Te(`Pour (emitter)`);X(e,n)},$$slots:{default:!0}});var _=g(h,2),y=e=>{var t=ULe(),i=N(t);xq(i,{id:`fluid-emitter-rate`,label:`Pour rate`,min:0,max:4e3,step:50,decimals:0,get value(){return Q(n).emitter.rate},onchange:e=>r({emitter:{rate:e}})}),xq(g(i,2),{id:`fluid-emitter-speed`,label:`Pour speed`,min:0,max:10,step:.1,get value(){return Q(n).emitter.speed},onchange:e=>r({emitter:{speed:e}})}),X(e,t)};G(_,e=>{Q(n).emitter.on&&e(y)});var b=g(_,2);xo(b,{id:`fluid-drain-on`,get checked(){return Q(n).drain.on},onchange:e=>r({drain:{on:e.currentTarget.checked}}),children:(e,t)=>{W();var n=Te(`Drain`);X(e,n)},$$slots:{default:!0}});var x=g(b,2),S=e=>{xq(e,{id:`fluid-drain-rate`,label:`Drain rate`,min:0,max:4e3,step:50,decimals:0,get value(){return Q(n).drain.rate},onchange:e=>r({drain:{rate:e}})})};G(x,e=>{Q(n).drain.on&&e(S)});var C=g(x,2);W(2),H(i),O(()=>u(f,Q(n).color)),L(`change`,f,e=>r({color:e.currentTarget.value})),L(`click`,C,()=>r({generation:Q(n).generation+1})),X(e,i)},$$slots:{default:!0}}),ue()}ge([`change`,`click`]);var Cq={label:{h:`hue channel`,s:`saturation channel`,v:`brightness channel`,r:`red channel`,g:`green channel`,b:`blue channel`,a:`alpha channel`,hex:`hex color`,withoutColor:`without color`},color:{rgb:`rgb`,hsv:`hsv`,hex:`hex`},changeTo:`change to `,swatch:{ariaTitle:`saved colors`,ariaLabel:e=>`select color: ${e}`}}
2300,wq=`a[href], area[href], input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]`;function KLe(e){return function(t){if(t.target===window)return;let n=t.target;if(!e.contains(n))return;let r=e.querySelectorAll(wq),i=r[0],a=r[r.length-1];function o(e){return e.code===`Tab`&&!e.shiftKey}function s(e){return e.code===`Tab`&&e.shiftKey}o(t)&&t.target===a?(t.preventDefault(),i.focus()):s(t)&&t.target===i&&(t.preventDefault(),a.focus())}}var qLe=e=>{let t=e.querySelector(wq);t&&t.focus();let n=KLe(e);return document.addEventListener(`keydown`,n),{destroy(){document.removeEventListener(`keydown`,n)}}},JLe={grad:.9,turn:360,rad:360/(2*Math.PI)},Tq=function(e){return typeof e==`string`?e.length>0:typeof e==`number`},Eq=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n+0},Dq=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},Oq=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},kq=function(e){return{r:Dq(e.r,0,255),g:Dq(e.g,0,255),b:Dq(e.b,0,255),a:Dq(e.a)}},Aq=function(e){return{r:Eq(e.r),g:Eq(e.g),b:Eq(e.b),a:Eq(e.a,3)}},YLe=/^#([0-9a-f]{3,8})$/i,jq=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},Mq=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:60*(s<0?s+6:s),s:a?o/a*100:0,v:a/255*100,a:i}},Nq=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:255*[r,s,o,o,c,r][l],g:255*[c,r,r,s,o,o][l],b:255*[o,o,c,r,r,s][l],a:i}},Pq=function(e){return{h:Oq(e.h),s:Dq(e.s,0,100),l:Dq(e.l,0,100),a:Dq(e.a)}},Fq=function(e){return{h:Eq(e.h),s:Eq(e.s),l:Eq(e.l),a:Eq(e.a,3)}},Iq=function(e){return Nq((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},Lq=function(e){return{h:(t=Mq(e)).h,s:(i=(200-(n=t.s))*(r=t.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,r,i},XLe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ZLe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,QLe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$Le=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Rq={string:[[function(e){var t=YLe.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Eq(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Eq(parseInt(e.substr(6,2),16)/255,2):1}:null:null},`hex`],[function(e){var t=QLe.exec(e)||$Le.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:kq({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},`rgb`],[function(e){var t=XLe.exec(e)||ZLe.exec(e);if(!t)return null;var n,r;return Iq(Pq({h:(n=t[1],r=t[2],r===void 0&&(r=`deg`),Number(n)*(JLe[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}))},`hsl`]],object:[[function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i===void 0?1:i;return Tq(t)&&Tq(n)&&Tq(r)?kq({r:Number(t),g:Number(n),b:Number(r),a:Number(a)}):null},`rgb`],[function(e){var t=e.h,n=e.s,r=e.l,i=e.a,a=i===void 0?1:i;return!Tq(t)||!Tq(n)||!Tq(r)?null:Iq(Pq({h:Number(t),s:Number(n),l:Number(r),a:Number(a)}))},`hsl`],[function(e){var t=e.h,n=e.s,r=e.v,i=e.a,a=i===void 0?1:i;return!Tq(t)||!Tq(n)||!Tq(r)?null:Nq(function(e){return{h:Oq(e.h),s:Dq(e.s,0,100),v:Dq(e.v,0,100),a:Dq(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(a)}))},`hsv`]]},zq=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},eRe=function(e){return typeof e==`string`?zq(e.trim(),Rq.string):typeof e==`object`&&e?zq(e,Rq.object):[null,void 0]},Bq=function(e,t){var n=Lq(e);return{h:n.h,s:Dq(n.s+100*t,0,100),l:n.l,a:n.a}},Vq=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Hq=function(e,t){var n=Lq(e);return{h:n.h,s:n.s,l:Dq(n.l+100*t,0,100),a:n.a}
2300},Uq=function(){function e(e){this.parsed=eRe(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return Eq(Vq(this.rgba),2)},e.prototype.isDark=function(){return Vq(this.rgba)<.5},e.prototype.isLight=function(){return Vq(this.rgba)>=.5},e.prototype.toHex=function(){return e=Aq(this.rgba),t=e.r,n=e.g,r=e.b,a=(i=e.a)<1?jq(Eq(255*i)):``,`#`+jq(t)+jq(n)+jq(r)+a;var e,t,n,r,i,a},e.prototype.toRgb=function(){return Aq(this.rgba)},e.prototype.toRgbString=function(){return e=Aq(this.rgba),t=e.r,n=e.g,r=e.b,(i=e.a)<1?`rgba(`+t+`, `+n+`, `+r+`, `+i+`)`:`rgb(`+t+`, `+n+`, `+r+`)`;var e,t,n,r,i},e.prototype.toHsl=function(){return Fq(Lq(this.rgba))},e.prototype.toHslString=function(){return e=Fq(Lq(this.rgba)),t=e.h,n=e.s,r=e.l,(i=e.a)<1?`hsla(`+t+`, `+n+`%, `+r+`%, `+i+`)`:`hsl(`+t+`, `+n+`%, `+r+`%)`;var e,t,n,r,i},e.prototype.toHsv=function(){return e=Mq(this.rgba),{h:Eq(e.h),s:Eq(e.s),v:Eq(e.v),a:Eq(e.a,3)};var e},e.prototype.invert=function(){return Wq({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return e===void 0&&(e=.1),Wq(Bq(this.rgba,e))},e.prototype.desaturate=function(e){return e===void 0&&(e=.1),Wq(Bq(this.rgba,-e))},e.prototype.grayscale=function(){return Wq(Bq(this.rgba,-1))},e.prototype.lighten=function(e){return e===void 0&&(e=.1),Wq(Hq(this.rgba,e))},e.prototype.darken=function(e){return e===void 0&&(e=.1),Wq(Hq(this.rgba,-e))},e.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return typeof e==`number`?Wq({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Eq(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Lq(this.rgba);return typeof e==`number`?Wq({h:e,s:t.s,l:t.l,a:t.a}):Eq(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Wq(e).toHex()},e}(),Wq=function(e){return e instanceof Uq?e:new Uq(e)},tRe=V(`<input type="hidden"/>`),nRe=V(`<div role="slider" tabindex="0"><div class="track svelte-1fbosnr"></div> <div class="thumb svelte-1fbosnr"></div></div> <!>`,1);function Gq(e,t){Ce(t,!0);let n=J(t,`min`,3,0),i=J(t,`max`,3,100),a=J(t,`step`,3,1),o=J(t,`value`,15,50),s=J(t,`ariaValueText`,3,e=>e.toString()),c=J(t,`direction`,3,`horizontal`),l=J(t,`reverse`,3,!1),d=J(t,`keyboardOnly`,3,!1),f=J(t,`slider`,7),m=J(t,`isDragging`,7,!1),h=q(()=>typeof n()==`string`?parseFloat(n()):n()),_=q(()=>typeof i()==`string`?parseFloat(i()):i()),y=q(()=>typeof a()==`string`?parseFloat(a()):a());function x(e){let t=1/Q(y),n=Math.round(e*t)/t;return Math.max(Q(h),Math.min(Q(_),n))}function S(e){let n=e.shiftKey?Q(y)*10:Q(y);e.key===`ArrowUp`||e.key===`ArrowRight`?(o(o()+n),e.preventDefault()):e.key===`ArrowDown`||e.key===`ArrowLeft`?(o(o()-n),e.preventDefault()):e.key===`Home`?(o(Q(h)),e.preventDefault()):e.key===`End`?(o(Q(_)),e.preventDefault()):e.key===`PageUp`?(o(o()+Q(y)*10),e.preventDefault()):e.key===`PageDown`&&(o(o()-Q(y)*10),e.preventDefault()),o(x(o())),t.onInput?.(o())}let C={horizontal:{clientSize:`clientWidth`,offset:`left`,client:`clientX`},vertical:{clientSize:`clientHeight`,offset:`top`,client:`clientY`}};function w(e){let n=f()?.[C[c()].clientSize]||120,r=f()?.getBoundingClientRect()[C[c()].offset]||0,i=e[C[c()].client]-r;c()===`vertical`&&(i=-1*i+n),l()?o(Q(_)-i/n*(Q(_)-Q(h))):o(i/n*(Q(_)-Q(h))+Q(h)),o(x(o())),t.onInput?.(o())}function T(e){w(e),m(!0)}function E(e){m()&&w(e)}function D(){m(!1)}function k(e){e.preventDefault(),w({clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY})}let A=q(()=>((o()-Q(h))/(Q(_)-Q(h))*1).toFixed(4));var ee=nRe();Z(`mousemove`,p,E),Z(`mouseup`,p,D);var j=N(ee);let M,te;We(j,e=>f(e),()=>f());var ne=g(j,2),P=e=>{var n=tRe();v(n),O(()=>{b(n,`name`,t.name),u(n,o())}),X(e,n)};G(ne,e=>{t.name&&e(P)}),O(e=>{M=r(j,1,`slider svelte-1fbosnr`,null,M,{reverse:l()}),b(j,`aria-orientation`,c()),b(j,`aria-valuemax`,Q(_)),b(j,`aria-valuemin`,Q(h)),b(j,`aria-valuenow`,o()),b(j,`aria-valuetext`,e),b(j,`aria-label`,t.ariaLabel),b(j,`aria-labelledby`,t.ariaLabelledBy),b(j,`aria-controls`,t.ariaControl
2300s),te=Ze(j,``,te,{"--position":Q(A)})},[()=>s()(o())]),L(`keydown`,j,S),L(`mousedown`,j,function(...e){(d()?void 0:T)?.apply(this,e)}),L(`touchstart`,j,function(...e){(d()?void 0:k)?.apply(this,e)},void 0,!0),L(`touchmove`,j,function(...e){(d()?void 0:k)?.apply(this,e)},void 0,!0),L(`touchend`,j,function(...e){(d()?void 0:k)?.apply(this,e)}),X(e,ee),ue()}ge([`keydown`,`mousedown`,`touchstart`,`touchmove`,`touchend`]);var rRe=V(`<div class="picker svelte-a4gc6u"><!> <div class="s svelte-a4gc6u"><!></div> <div class="v svelte-a4gc6u"><!></div></div>`);function iRe(e,n){Ce(n,!0);let r=J(n,`s`,15),i=J(n,`v`,15),a=t(void 0),o=!1,s=t(Ne({x:100,y:0})),c=q(()=>Wq({h:n.h,s:100,v:100,a:1}).toHex());function l(e,t,n){return Math.min(Math.max(t,e),n)}function u(e){if(!Q(a))return;let{width:t,left:n,height:o,top:s}=Q(a).getBoundingClientRect(),c={x:l(e.clientX-n,0,t),y:l(e.clientY-s,0,o)};r(l(c.x/t,0,1)*100),i(l((o-c.y)/o,0,1)*100),_()}function d(e){e.preventDefault(),e.button===0&&(o=!0,u(e))}function f(){o=!1}function m(e){o&&u(e)}function h(e){e.preventDefault(),u(e.changedTouches[0])}Qe(()=>{typeof r()==`number`&&typeof i()==`number`&&Q(a)&&I(s,{x:r(),y:100-i()},!0)});function _(e={}){n.onInput({s:r(),v:i(),...e})}var v=rRe();Z(`mouseup`,p,f),Z(`mousemove`,p,m);let y;var b=j(v);P(b,()=>n.components.pickerIndicator,(e,t)=>{t(e,{get pos(){return Q(s)},get isDark(){return n.isDark}})});var x=g(b,2);let S;Gq(j(x),{get value(){return r()},onInput:e=>_({s:e}),keyboardOnly:!0,ariaValueText:e=>`${e}%`,get ariaLabel(){return n.texts.label.s}}),H(x);var C=g(x,2);let w;Gq(j(C),{get value(){return i()},onInput:e=>_({v:e}),keyboardOnly:!0,ariaValueText:e=>`${e}%`,direction:`vertical`,get ariaLabel(){return n.texts.label.v}}),H(C),H(v),We(v,e=>I(a,e),()=>Q(a)),O(()=>{y=Ze(v,``,y,{"--picker-color-bg":Q(c)}),S=Ze(x,``,S,{"--pos-y":Q(s).y}),w=Ze(C,``,w,{"--pos-x":Q(s).x})}),L(`mousedown`,v,d),L(`touchstart`,v,h,void 0,!0),L(`touchmove`,v,h,void 0,!0),L(`touchend`,v,h),X(e,v),ue()}ge([`mousedown`,`touchstart`,`touchmove`,`touchend`]);var aRe=V(`<label class="svelte-1o9p1lc"><div class="container svelte-1o9p1lc"><input type="color" aria-haspopup="dialog" class="svelte-1o9p1lc"/> <div class="alpha svelte-1o9p1lc"></div> <div class="color svelte-1o9p1lc"></div></div> </label>`);function oRe(e,t){Ce(t,!0);let n=J(t,`labelElement`,15),r=J(t,`name`,3,void 0);function i(e){e.preventDefault()}var a=aRe(),o=j(a),s=j(o);v(s);var c=g(s,4);let l;H(o);var d=g(o);H(a),We(a,e=>n(e),()=>n()),O(()=>{b(a,`dir`,t.dir),b(s,`name`,r()),u(s,t.hex),l=Ze(c,``,l,{background:t.hex}),Y(d,` ${t.label??``}`),a.dir=a.dir}),L(`click`,a,i),L(`mousedown`,a,i),L(`click`,s,i),L(`mousedown`,s,i),X(e,a),ue()}ge([`click`,`mousedown`]);var sRe=V(`<label class="nullability-checkbox svelte-y0a4ew"><div class="svelte-y0a4ew"><input type="checkbox" class="svelte-y0a4ew"/> <span class="svelte-y0a4ew"></span></div> </label>`);function cRe(e,t){Ce(t,!0);let n=J(t,`isUndefined`,15);var r=sRe(),i=j(r),a=j(i);v(a),W(2),H(i);var o=g(i);H(r),O(()=>Y(o,` ${t.texts.label.withoutColor??``}`)),c(a,n),X(e,r),ue()}var lRe=V(`<div class="picker-indicator svelte-1ph6e4z"></div>`);function uRe(e,t){Ce(t,!0);var n=lRe();let r;O(()=>r=Ze(n,``,r,{"--pos-x":t.pos.x,"--pos-y":t.pos.y})),X(e,n),ue()}var dRe=V(`<button type="button" class="swatch svelte-1q3i30g"></button>`),fRe=V(`<div class="swatches svelte-1q3i30g"></div>`);function pRe(e,t){Ce(t,!0);var n=fe(),r=N(n),i=e=>{var n=fRe();B(n,20,()=>t.swatches,e=>e,(e,n)=>{var r=dRe();O(e=>{Ze(r,`background: ${n??``}`),b(r,`aria-label`,e)},[()=>t.texts.swatch.ariaLabel(n)]),L(`click`,r,()=>t.selectSwatch(n)),X(e,r)}),H(n),O(()=>b(n,`aria-label`,t.texts.swatch.ariaTitle)),X(e,n)};G(r,e=>{t.swatches&&e(i)}),X(e,n),ue()}ge([`click`]);var mRe=V(`<input class="svelte-1xmlgu5"/>`),hRe=V(`<input type="number" min="0" max="255" class="svelte-1xmlgu5"/> <input type="number" min="0" max="255" class="svelte-1xmlgu5"/> <input type="number" min="0" max="255" class="svelte-1xmlgu5"/>`,1),gRe=V(`<input type="number" min="0" max="360" class="svelte-1xmlgu5"/> <input type="number" min="0" max="100" class="svelte-1xmlgu5"/> <input type="number" min="0" max="100" class="svelte-1xmlgu5"/>`,1),_Re=V(`<input type="number" min="0" max="1" step="0.01" class="svelte-1xmlgu5"/>`),vRe=V(`<button type="button" class="svelte-1xmlgu5"><span class="disappear svelte-1xmlgu5" aria-hidden="true"> </span> <span class="appear svelte-1xmlgu5"> </span></button>`),yRe=V(`<div class="button-like svelte-1xmlgu5"> </div>`),bRe=V(`<div class="text-input svelte-1xmlgu5"><div class="input-container svelte-1xmlgu5"><!> <!></div> <!></div>`);function xRe(e,t){Ce(t,!0);let n=J(t,`rgb`,15),r=J(t,`hsv`,15),i=J(t,`hex`,15),a=/^#?([A-F0-9]{6}|[A-F0-9]{8})$/i,o=q(()=>t.textInputModes[0]||`hex`),s=q(()=>t.textInputModes[(t.textInputModes.indexOf(Q(o))+1)%t.textInputModes.length]),c=q(()=>Math.round(r().h)),l=q(()=>Math.round(r().s)),d=q(()=>Math.round(r().v)),p=q(()=>r().a===void 0?1:Math.round(r().a*100)/100);function m(e){let n=e.target;a.test(n.value)&&(i(n.value),t.onInput({hex:i()}))}function h(e){return function(r){let i=parseFloat(r.target.value);n({...n(),[e]:isNaN(i)?0:i}),t.onInput({rgb:n()})}}function _(e){return function(n){let i=parseFloat(n.target.value);r({...r(),[e]:isNaN(i)?0:i}),t.onInput({hsv:r()})}}var y=bRe(),x=j(y),S=j(x),C=e=>{var n=mRe();v(n),Ze(n,``,{},{flex:3}),O(()=>{b(n,`aria-label`,t.texts.label.hex),u(n,i())}),L(`input`,n,m),X(e,n)},w=e=>{var r=hRe(),i=N(r);v(i);var a=q(()=>h(`r`)),o=g(i,2);v(o);var s=q(()=>h(`g`)),c=g(o,2);v(c);var l=q(()=>h(`b`));O(()=>{b(i,`aria-label`,t.texts.label.r),u(i,n().r),b(o,`aria-label`,t.texts.label.g),u(o,n().g),b(c,`aria-label`,t.texts.label.b),u(c,n().b)}),L(`input`,i,function(...e){Q(a)?.apply(this,e)}),L(`input`,o,function(...e){Q(s)?.apply(this,e)}),L(`input`,c,function(...e){Q(l)?.apply(this,e)}),X(e,r)},T=e=>{var n=gRe(),r=N(n);v(r);var i=q(()=>_(`h`)),a=g(r,2);v(a);var o=q(()=>_(`s`)),s=g(a,2);v(s);var f=q(()=>_(`v`));O(()=>{b(r,`aria-label`,t.texts.label.h),u(r,Q(c)),b(a,`aria-label`,t.texts.label.s),u(
2300a,Q(l)),b(s,`aria-label`,t.texts.label.v),u(s,Q(d))}),L(`input`,r,function(...e){Q(i)?.apply(this,e)}),L(`input`,a,function(...e){Q(o)?.apply(this,e)}),L(`input`,s,function(...e){Q(f)?.apply(this,e)}),X(e,n)};G(S,e=>{Q(o)===`hex`?e(C):Q(o)===`rgb`?e(w,1):e(T,-1)});var E=g(S,2),D=e=>{var n=_Re();v(n);var r=q(()=>Q(o)===`hsv`?_(`a`):h(`a`));O(()=>{b(n,`aria-label`,t.texts.label.a),u(n,Q(p))}),L(`input`,n,function(...e){Q(r)?.apply(this,e)}),X(e,n)};G(E,e=>{t.isAlpha&&e(D)}),H(x);var k=g(x,2),A=e=>{var n=vRe(),r=j(n),i=f(r,!0),a=g(r,2),c=f(a);H(n),O(()=>{Y(i,t.texts.color[Q(o)]),Y(c,`${t.texts.changeTo??``} ${t.texts.color[Q(s)]??``}`)}),L(`click`,n,()=>I(o,Q(s))),X(e,n)},ee=e=>{var n=yRe(),r=f(n,!0);O(()=>Y(r,t.texts.color[Q(o)])),X(e,n)};G(k,e=>{t.textInputModes.length>1?e(A):e(ee,-1)}),H(y),X(e,y),ue()}ge([`input`,`click`]);var SRe=V(`<div aria-label="color picker"><!></div>`);function CRe(e,t){Ce(t,!0);let n=J(t,`wrapper`,15);var i=SRe();let a;var o=j(i);ae(o,()=>t.children),H(i),We(i,e=>n(e),()=>n()),O(()=>{a=r(i,1,`wrapper svelte-2y1dab`,null,a,{"is-open":t.isOpen}),b(i,`role`,t.isDialog?`dialog`:void 0)}),X(e,i),ue()}var wRe=V(`<input type="hidden"/>`),TRe=V(`<div class="a svelte-rmjmwh"><!></div>`),ERe=V(`<!> <!> <div class="h svelte-rmjmwh"><!></div> <!> <!> <!> <!>`,1),DRe=V(`<span><!> <!></span>`);function ORe(e,n){Ce(n,!0);let i=J(n,`components`,19,()=>({})),o=J(n,`label`,3,`Choose a color`),s=J(n,`name`,3,void 0),c=J(n,`nullable`,3,!1),l=J(n,`rgb`,31,()=>Ne(c()?null:{r:255,g:0,b:0,a:1})),d=J(n,`hsv`,31,()=>Ne(c()?null:{h:0,s:100,v:100,a:1})),f=J(n,`hex`,31,()=>Ne(c()?null:`#ff0000`)),m=J(n,`color`,15,null),h=J(n,`isDark`,15,!1),_=J(n,`isAlpha`,3,!0),y=J(n,`isDialog`,3,!0),x=J(n,`isOpen`,31,()=>!y()),S=J(n,`position`,3,`responsive`),w=J(n,`dir`,3,`ltr`),T=J(n,`isTextInput`,3,!0),E=J(n,`textInputModes`,19,()=>[`hex`,`rgb`,`hsv`]),D=J(n,`sliderDirection`,3,`vertical`),k=J(n,`disableCloseClickOutside`,3,!1),A=J(n,`a11yColors`,19,()=>[{bgHex:`#ffffff`}]),ee=J(n,`a11yLevel`,3,`AA`),M=J(n,`texts`,3,void 0),te=J(n,`a11yTexts`,3,void 0),ne=t(Ne({r:255,g:0,b:0,a:1})),re=t(Ne({h:0,s:100,v:100,a:1})),ie=t(`#ff0000`),F=t(!1),ae=t(Ne(Q(F))),L=t(void 0),oe=t(void 0),R=t(void 0),se,ce=t(1080),le=t(720),de={pickerIndicator:uRe,textInput:xRe,input:oRe,nullabilityCheckbox:cRe,wrapper:CRe};function z(){return{...de,...i()}}function pe(){return{label:{...Cq.label,...M()?.label},color:{...Cq.color,...M()?.color},changeTo:M()?.changeTo??Cq.changeTo,swatch:{...M()?.swatch,...Cq.swatch}}}function B({target:e}){y()&&(Q(oe)?.contains(e)||Q(oe)?.isSameNode(e)?x(!x()):x()&&!Q(R)?.contains(e)&&!k()&&x(!1))}function me({key:e,target:t}){y()&&Q(oe)&&Q(L)&&(e===`Enter`&&Q(oe).contains(t)?(x(!x()),setTimeout(()=>{Q(R)&&(se=qLe(Q(R)))})):e===`Escape`&&x()&&(x(!1),Q(L).contains(t)&&(Q(oe)?.focus(),se?.destroy())))}function V(e){f(e),d(Wq(e).toHsv()),l(Wq(e).toRgb()),I(ae,!1),I(F,!1),ge()}function he(){return!(d()&&l()&&d().h===Q(re).h&&d().s===Q(re).s&&d().v===Q(re).v&&d().a===Q(re).a&&l().r===Q(ne).r&&l().g===Q(ne).g&&l().b===Q(ne).b&&l().a===Q(ne).a&&f()===Q(ie))}function ge(){if(Q(F)&&!Q(ae)){I(ae,!0),d(null),l(null),f(null),n.onInput?.({color:m(),hsv:d(),rgb:l(),hex:f()});return}if(Q(ae)&&!Q(F)){I(ae,!1),d(Ae(Q(re))),l(Ae(Q(ne))),f(Ae(Q(ie))),n.onInput?.({color:m(),hsv:d(),rgb:l(),hex:f()});return}if(!d()&&!l()&&!f()){I(F,I(ae,!0),!0),n.onInput?.({color:null,hsv:d(),rgb:l(),hex:f()});return}he()&&(I(F,!1),d()&&d().a===void 0&&d({...d(),a:1}),Q(re).a===void 0&&I(re,{...Q(re),a:1},!0),l()&&l().a===void 0&&l({...l(),a:1}),Q(ne).a===void 0&&I(ne,{...Q(ne),a:1},!0),f()?.substring(7)===`ff`&&f(f().substring(0,7)),Q(ie)?.substring(7)===`ff`&&I(ie,Q(ie).substring(0,7),!0),d()&&(d().h!==Q(re).h||d().s!==Q(re).s||d().v!==Q(re).v||d().a!==Q(re).a||!l()&&!f())?(m(Wq(d())),l(m().toRgb()),f(m().toHex())):l()&&(l().r!==Q(ne).r||l().g!==Q(ne).g||l().b!==Q(ne).b||l().a!==Q(ne).a||!d()&&!f())?(m(Wq(l())),f(m().toHex()),d(m().toHsv())):f()&&(f()!==Q(ie)||!d()&&!l())&&(m(Wq(f())),l(m().toRgb()),d(m().toHsv())),m()&&h(m().isDark()),f()&&d()&&l()&&(I(re,Ae(d()),!0),I(ne,Ae(l()),!0),I(ie,f(),!0),I(ae,Q(F),!0),n.onInput?.({color:m(),hsv:d(),rgb:l(),hex:f()})))}Qe(()=>{(d()||l()||f())&&ge()}),Qe(()=>{Q(F),ge()});function U(e){return t=>{d()||(I(F,!1),I(ae,!1),d(Ae(Q(re)))),d({...d(),[e]:t})}}function W(e){return t=>{d()||(I(F,!1),I(ae,!1),d(Ae(Q(re)))),d({...d(),...Object.fromEntries(e.map(e=>
2300[e,t[e]]))})}}async function _e(){if(await C(),S()===`fixed`||!x()||!y()||!Q(oe)||!Q(R))return;let e=Q(R).getBoundingClientRect(),t=Q(oe).getBoundingClientRect();if((S()===`responsive`||S()===`responsive-y`)&&(t.top+e.height+12>Q(le)?Q(R).style.top=`-${e.height+12}px`:Q(R).style.top=`${t.height+12}px`),S()===`responsive`||S()===`responsive-x`){if(w()===`rtl`){let n=t.left+t.width-e.width<0;console.log(n,t.left-e.width,t.left,e.width),n?Q(R).style.left=`0px`:Q(R).style.left=`${t.width-e.width}px`}else t.left+e.width>Q(ce)?Q(R).style.left=`${t.width-e.width}px`:Q(R).style.left=`0px`}}Qe(()=>{Q(ce)&&Q(le)&&x()&&_e()});let ve=q(z);var ye=DRe();Z(`mousedown`,p,B),Z(`keyup`,p,me),Z(`scroll`,p,_e);var be=j(ye),xe=e=>{var t=fe(),n=N(t);P(n,()=>Q(ve).input,(e,t)=>{t(e,{get hex(){return f()},get label(){return o()},get name(){return s()},get dir(){return w()},get labelElement(){return Q(oe)},set labelElement(e){I(oe,e,!0)}})}),X(e,t)},K=e=>{var t=wRe();v(t),O(()=>{u(t,f()),b(t,`name`,s())}),X(e,t)};G(be,e=>{y()?e(xe):s()&&e(K,1)});var Se=g(be,2);P(Se,()=>Q(ve).wrapper,(e,t)=>{t(e,{get isOpen(){return x()},get isDialog(){return y()},get wrapper(){return Q(R)},set wrapper(e){I(R,e,!0)},children:(e,t)=>{var r=ERe(),i=N(r),a=e=>{var t=fe(),n=N(t);{let e=q(pe);P(n,()=>Q(ve).nullabilityCheckbox,(t,n)=>{n(t,{get texts(){return Q(e)},get isUndefined(){return Q(F)},set isUndefined(e){I(F,e,!0)}})})}X(e,t)};G(i,e=>{c()&&e(a)});var o=g(i,2);{let e=q(z),t=q(()=>d()?.h??Q(re).h),n=q(()=>d()?.s??Q(re).s),r=q(()=>d()?.v??Q(re).v),i=q(()=>W([`s`,`v`])),a=q(pe);iRe(o,{get components(){return Q(e)},get h(){return Q(t)},get s(){return Q(n)},get v(){return Q(r)},get onInput(){return Q(i)},get isDark(){return h()},get texts(){return Q(a)}})}var s=g(o,2),u=j(s);{let e=q(()=>d()?.h??Q(re).h),t=q(()=>U(`h`)),n=q(()=>D()===`vertical`),r=q(()=>pe().label.h);Gq(u,{min:0,max:360,step:1,get value(){return Q(e)},get onInput(){return Q(t)},get direction(){return D()},get reverse(){return Q(n)},get ariaLabel(){return Q(r)}})}H(s);var p=g(s,2),m=e=>{var t=TRe();let n;var r=j(t);{let e=q(()=>d()?.a??Q(re).a),t=q(()=>U(`a`)),n=q(()=>D()===`vertical`),i=q(()=>pe().label.a);Gq(r,{min:0,max:1,step:.01,get value(){return Q(e)},get onInput(){return Q(t)},get direction(){return D()},get reverse(){return Q(n)},get ariaLabel(){return Q(i)}})}H(t),O(e=>n=Ze(t,``,n,{"--alphaless-color":e}),[()=>(f()?f():Q(ie)).substring(0,7)]),X(e,t)};G(p,e=>{_()&&e(m)});var v=g(p,2),y=e=>{{let t=q(pe);pRe(e,{get swatches(){return n.swatches},selectSwatch:V,get texts(){return Q(t)}})}};G(v,e=>{n.swatches&&n.swatches.length>0&&e(y)});var b=g(v,2),x=e=>{var t=fe(),n=N(t);{let e=q(()=>f()??Q(ie)),t=q(()=>l()??Q(ne)),r=q(()=>d()??Q(re)),i=q(pe);P(n,()=>Q(ve).textInput,(n,a)=>{a(n,{get hex(){return Q(e)},get rgb(){return Q(t)},get hsv(){return Q(r)},onInput:e=>{e.hsv?d(e.hsv):e.rgb?l(e.rgb):e.hex&&f(e.hex)},get isAlpha(){return _()},get textInputModes(){return E()},get texts(){return Q(i)}})})}X(e,t)};G(b,e=>{T()&&e(x)});var S=g(b,2),C=e=>{var t=fe(),n=N(t);{let e=q(z),t=q(()=>f()||`#00000000`);P(n,()=>Q(ve).a11yNotice,(n,r)=>{r(n,{get components(){return Q(e)},get a11yColors(){return A()},get hex(){return Q(t)},get a11yTexts(){return te()},get a11yLevel(){return ee()}})})}X(e,t)},w=q(()=>z().a11yNotice);G(S,e=>{Q(w)&&e(C)}),X(e,r)},$$slots:{default:!0}})}),H(ye),We(ye,e=>I(L,e),()=>Q(L)),O(()=>r(ye,1,`color-picker ${D()??``}`,`svelte-rmjmwh`)),a(`innerWidth`,e=>I(ce,e,!0)),a(`innerHeight`,e=>I(le,e,!0)),X(e,ye),ue()}var kRe=V(`<div aria-label="color picker"><!></div>`);function ARe(e,t){Ce(t,!0);let n=J(t,`wrapper`,15);var i=kRe();let a;var o=j(i);ae(o,()=>t.children),H(i),We(i,e=>n(e),()=>n()),O(()=>{a=r(i,1,`wrapper svelte-tahgbx`,null,a,{"is-open":t.isOpen}),b(i,`role`,t.isDialog?`dialog`:void 0)}),X(e,i),ue()}var Kq=ORe,qq={wrapper:ARe},jRe=V(`<div aria-label="color picker"><!></div>`);function Jq(e,t){let n=J(t,`wrapper`,12),i=J(t,`isOpen`,8),a=J(t,`isDialog`,8);var o=jRe();let s;var c=j(o);T(c,t,`default`,{},null),H(o),We(o,e=>n(e),()=>n()),O(()=>{s=r(o,1,`wrapper svelte-qc09xp`,null,s,{"is-open":i()}),b(o,`role`,a()?`dialog`:void 0)}),X(e,o)}var Yq=new Wn,Xq=null;$(()=>import(`../chunks/DaA5bz6U.js`).then(e=>e.u).then(e=>Xq=e),__vite__mapDeps([34,1,2,3,5,6,19,21,20,35,24,0,4,23,8,9,10,11,12,13,14,25,36,37,38,39,40,41,7,42,22,43,44,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59]),import.meta.url);function Zq(e,t){let n=U(yi);if(!n)return{point:null,object:null,normal:null,hit:null};let r=xl(e,t);Yq.setFromCamera(new yn(r.x,r.y),n);let i=Ch(Yq);if(i[0])return{point:i[0].point.toArray(),object:wm(i[0].object),normal:wh(i[0])?.toArray()??null,hit:i[0].object};let a=new hn;return Yq.ray.intersectPlane(new Tr(new hn(0,1,0),0),a)?{point:a.toArray(),object:null,normal:[0,1,0],hit:null}:{point:null,object:null,normal:null,hit:null}}var Qq=new hn(0,1,0),$q=new hn,eJ=new zt;function MRe(e,t,n=null){e.position.set(t[0],t[1],t[2]),n&&U(hc).alignNormal&&($q.fromArray(n),$q.lengthSq()>1e-12&&($q.normalize(),$q.distanceTo(Qq)>1e-6&&(eJ.setFromUnitVectors(Qq,$q),e.quaternion.premultiply(eJ),e.updateMatrixWorld(!0))));let r=U(Es);r&&r.send({type:`move`,uuid:e.uuid,pos:e.position.toArray(),rot:e.rotation.toArray(),scale:e.scale.toArray()})}async function tJ(e,t,n=0){let r=U(Fa).find(e=>e.id===t.id);if(!r||r.kind!==`image`)return!1;let i=await Ja(r.id);return i?(await Vv(e,new File([i],r.name,{type:i.type||`image/png`}),n),!0):!1}function nJ(e){let t={text:`Loading "${e}"â¦`,actions:[]};return Qo.update(e=>[...e,t]),()=>Qo.update(e=>e.filter(e=>e!==t))}var rJ=1.5;function NRe(e,t,n){let r=Math.max(1,Math.ceil(Math.sqrt(n))),i=Math.max(1,Math.ceil(n/r)),a=t%r,o=Math.floor(t/r);return[e[0]+(a-(r-1)/2)*rJ,e[1],e[2]+(o-(i-1)/2)*rJ]}async function PRe(e,t,n){let r=Zq(t,n),i=Array.isArray(e?.items)&&e.items.length>1?e.items:null;if(!i)return iJ(e,r);let a=U(Ao);for(let e=0;e<i.length;e++){let t=a||!r.point?r.point:NRe(r.point,e,i.length);await iJ(i[e],{...r,point:t})}}async function iJ(e,t){if(e.prefabId){let n=U(Av).find(t=>
2300t.id===e.prefabId);if(!n)return;let r=jv(n);r&&t.point&&MRe(r,t.point,t.normal);return}if(e.url){let n=String(e.name||`model`).replace(/\.\w+$/,``),r=nJ(n);try{let i=await fetch(e.url);if(!i.ok)return r(),es(`Could not fetch the pack item`);let{placementGroupFor:a}=await $(async()=>{let{placementGroupFor:e}=await import(`../chunks/BgTLrJqP.js`).then(e=>e.o);return{placementGroupFor:e}},__vite__mapDeps([204,1,2,6,9,0,3,4,41,69,44,5,70,20,21,126,100,128,127,129,125,40,130,131,162]),import.meta.url);zS(new File([await i.blob()],n+`.glb`),n,void 0,t.point??void 0,void 0,{packRef:Gm(e.url,{item:n}),lod:a(e.url,e.lods),behavior:e.behavior??null}),r()}catch{r(),es(`Could not load the pack item (network / CORS)`)}return}let n=U(Fa).find(t=>t.id===e.id);if(n){if(n.kind===`object`){let e=await Ja(n.id);if(!e)return;zS(new File([e],n.name),n.name.replace(/\.\w+$/,``),void 0,t.point??void 0)}else if(n.kind===`image`){if(!t.object){es(`Drop the image ON an object to texture it`);return}await tJ(t.object.uuid,{id:n.id})}else{let e=Xq?.moduleDropHandlers??[],r=t.hit??t.object,i={id:n.id,name:n.name,kind:n.kind,hash:n.hash};for(let n of e)try{if(r&&n(r,i,t))return}catch(e){console.log(`module drop handler failed`,e)}es(`Audio/text items are used where they plug in (sound nodes, scripts)`)}}}var aJ=Ue(null);function oJ(e){aJ.set(e)}var sJ=Ue([]),cJ=Ue(null),lJ=0,uJ={subscribe:we(sJ,e=>e[e.length-1]??null).subscribe,set(e){sJ.update(t=>{if(!e)return t.slice(0,-1);if(!t.length)return[{id:++lJ,...e}];let n=t[t.length-1].id;return[...t.slice(0,-1),{...e,id:n}]})},update(e){let t=null;this.subscribe(e=>t=e)(),this.set(e(t))}};function dJ(e){sJ.update(t=>t.filter(t=>t.id!==e))}function fJ(e,t){sJ.update(n=>n.map(n=>n.id===e?{...t,id:e}:n))}var FRe=(e,t)=>(e?.itemId??``)===(t?.itemId??``)&&(e?.prefabId??``)===(t?.prefabId??``)&&(e?.folderId??``)===(t?.folderId??``)&&(e?.itemId||e?.prefabId||e?.folderId?!0:(e?.url??``)===(t?.url??``));function pJ(e){mJ(e)}function mJ(e){let t={url:``,...e};if(!U(XC)){uJ.set(t);return}let n=U(sJ),r=n.find(e=>FRe(t,e));if(r){hJ.update(e=>e+1),sJ.set([...n.filter(e=>e.id!==r.id),r]);return}sJ.set([...n,{...t,id:++lJ}])}var hJ=Ue(0),gJ=Ue(null),_J=Ue(0);function vJ(e){let t=U(gJ);t&&(e.itemId??``)===(t.itemId??``)&&(e.prefabId??``)===(t.prefabId??``)?_J.update(e=>e+1):gJ.set(e)}var yJ=we([gJ,sJ],([e,t])=>!!e||t.some(e=>e.kind===`object`)),IRe=V(`<span class="tbx-label">Devices</span> <div class="tbx-row music-empty svelte-12bomqi">No devices in the scene. Add one from the viewport menu ⸠Add ⸠Devices.</div>`,1),bJ=V(`<option> </option>`),LRe=V(`<div class="tbx-row music-empty svelte-12bomqi"> </div>`),RRe=V(`<div class="tbx-row music-empty svelte-12bomqi">This device has no settings.</div>`),zRe=V(`<div class="tbx-row music-field svelte-12bomqi"><span class="music-field-label svelte-12bomqi"> </span> <select class="music-select svelte-12bomqi"></select></div>`),BRe=V(`<label class="tbx-check music-field svelte-12bomqi"><input type="checkbox"/> <span> </span></label>`),VRe=V(`<div class="music-param"><!></div>`),HRe=V(`<!> <!> <span class="tbx-label">Presets</span> <div class="tbx-row music-presets svelte-12bomqi"><select id="music-preset-pick" class="music-select svelte-12bomqi"><option>â</option><!></select> <button id="music-preset-apply" class="tbx-primary">Apply</button> <button id="music-preset-delete" class="tbx-btn tbx-danger" title="Delete preset">â</button></div> <div class="tbx-row music-presets svelte-12bomqi"><input id="music-preset-name" class="music-input svelte-12bomqi" placeholder="Save asâ¦"/> <button id="music-preset-save" class="tbx-primary">Save</button></div>`,1),URe=V(`<div class="music-fader"><!></div> <button class="tbx-btn music-mute svelte-12bomqi" title="Mute">M</button> <button class="tbx-btn music-solo svelte-12bomqi" title="Solo">S</button>`,1),WRe=V(`<span class="music-nofader svelte-12bomqi" title="No level to drive: no level param and no outgoing cable">â</span>`),GRe=V(`<div><button class="music-mix-name svelte-12bomqi" title="Show this device's settings"> </button> <div class="music-meter-track svelte-12bomqi"><div class="music-meter svelte-12bomqi"></div></div> <!></div>`),KRe=V(`<span class="tbx-label">Device</span> <div class="tbx-row"><select id="music-device-pick" class="music-select svelte-12bomqi"></select></div> <!> <span class="tbx-label">Mixer</span> <!>`,1),qRe=V(`<div class="music-tbx svelte-12bomqi" id="music-tbx"><!></div>`);function JRe(e,n){Ce(n,!0);let i=()=>z(SJ,`$musicToolboxPick`,u),a=()=>z(Ui,`$objectsGroup`,u),o=()=>z(yv,`$deviceCatalogVersion`,u),s=()=>z(Di,`$selectedObject`,u),c=()=>z(DJ,`$musicPresets`,u),l=()=>z(Hde,`$patch`,u),[u,d]=Ve(),p=t(0),h=t(``);Qe(()=>{let e=i();e&&(I(h,e,!0),SJ.set(``))});let y=q(()=>(Q(p),a(),o(),Ade().map(e=>({uuid:e.uuid,name:e.name||e.userData.device.kind,doc:bv(e)??{kind:String(e.userData.device.kind),params:{}},spec:Sv(e.userData.device.kind)})))),x=q(()=>{let e=s()?.uuid,t=Q(h)&&Q(y).some(e=>e.uuid===Q(h))?Q(h):e;return Q(y).find(e=>e.uuid===t)??Q(y)[0]??null}),C=q(()=>Q(x)?.spec?.params??[]),T=null;function E(e){let t=Ide(e);t&&(T={uuid:e,before:structuredClone(t.userData.device),lastSent:0,last:null})}
2300function k(e,t,n){let r=typeof e?.step==`number`&&e.step>0?e.step:0;if(!r)return n;let i=n;i!==t&&Math.abs(i-t)<r&&(i=t+Math.sign(i-t)*r);let a=typeof e.min==`number`?e.min:0;return i=a+Math.round((i-a)/r)*r,typeof e.min==`number`&&(i=Math.max(e.min,i)),typeof e.max==`number`&&(i=Math.min(e.max,i)),+i.toFixed(6)}function A(e,t,n){let r=Q(C).find(e=>e.key===t);if(r&&(r.kind===`range`||r.kind===void 0)&&typeof n==`number`){let i=Number(Q(x)?.doc.params[t]??r.default??0);if(n=k(r,i,n),n===i&&!(T&&T.uuid===e))return}if(T&&T.uuid===e){let r=Date.now(),i=r-T.lastSent>=66;i&&(T.lastSent=r),wv(e,{[t]:n},{broadcast:i}),T.last={key:t,value:n}}else Mde(e,t,n);pe(p)}function ee(e){if(!T||T.uuid!==e)return;let t=T;T=null,t.last&&Cv(e,{params:{[t.last.key]:t.last.value}},{before:t.before}),pe(p)}let M=t(``),te=t(``),ne=q(()=>(c(),Q(x)?kJ(Q(x).doc.kind):[]));function P(){Q(x)&&AJ(Q(x).doc.kind,Q(M),Q(x).doc.params)&&(I(te,Q(M).trim(),!0),I(M,``))}function re(){if(!Q(x))return;let e=Q(ne).find(e=>e.name===Q(te));e&&MJ(Q(x).uuid,e),pe(p)}function ie(){Q(x)&&Q(te)&&(jJ(Q(x).doc.kind,Q(te)),I(te,``))}let F=t(Ne({}));_e(()=>{let e=setInterval(()=>{let e={};for(let t of Q(y))e[t.uuid]=Fde(t.uuid);I(F,e,!0)},100);return()=>clearInterval(e)});function ae(e){l();let t=e.spec?.params?.find(e=>e.key===`level`||e.key===`gain`)?.key;if(t)return{kind:`param`,key:t,cables:null,value:Number(e.doc.params[t]??0),max:1};let n=Ov(e.uuid).filter(t=>t.from.uuid===e.uuid);
2300return n.length?{kind:`cables`,key:null,cables:n,value:n[0].gain,max:2}:null}function oe(e,t){let n=ae(e);if(n){if(n.key)A(e.uuid,n.key,t);else{let e=n.cables??[];e.length>1&&Lf();for(let n of e)Vde(n.id,t);e.length>1&&kf(`Channel level`)}pe(p)}}let R=t(Ne({})),se=t(``);function ce(e){return e.uuid in Q(R)}function le(e){let t=ae(e);if(t){if(ce(e)){let t=Q(R)[e.uuid],n={...Q(R)};delete n[e.uuid],I(R,n,!0),oe(e,t)}else I(R,{...Q(R),[e.uuid]:t.value},!0),oe(e,0)}}function de(e){if(Q(se)===e.uuid){I(se,``);for(let t of Q(y))ce(t)&&t.uuid!==e.uuid&&le(t);return}I(se,e.uuid,!0);for(let t of Q(y))t.uuid!==e.uuid&&!ce(t)&&ae(t)&&le(t);ce(e)&&le(e)}var fe=qRe(),me=j(fe),V=e=>{var t=IRe();W(2),X(e,t)},he=e=>{var t=KRe(),n=g(N(t),2),i=j(n);B(i,21,()=>Q(y),e=>e.uuid,(e,t)=>{var n=bJ(),r=f(n,!0),i={};O(()=>{Y(r,Q(t).name),i!==(i=Q(t).uuid)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(i);var a;_(i),H(n);var o=g(n,2),s=e=>{var t=HRe(),n=N(t),r=e=>{var t=LRe(),n=f(t);O(()=>Y(n,`"${Q(x).doc.kind??``}" is not installed here â its settings are kept, not editable.`)),X(e,t)},i=e=>{var t=RRe();X(e,t)};G(n,e=>{Q(x).spec?Q(C).length||e(i,1):e(r)});var a=g(n,2);B(a,17,()=>Q(C),e=>e.key,(e,t)=>{var n=VRe(),r=j(n),i=e=>{var n=zRe(),r=j(n),i=f(r,!0),a=g(r,2);B(a,21,()=>Q(t).options??[],Be,(e,t)=>{var n=bJ(),r=f(n,!0),i={};O(()=>{Y(r,Q(t).label??Q(t).value),i!==(i=Q(t).value)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(a);var o;_(a),H(n),O(()=>{Y(i,Q(t).label??Q(t).key),o!==(o=Q(x).doc.params[Q(t).key])&&(a.value=(a.__value=o)??``,D(a,o))}),L(`change`,a,e=>A(Q(x).uuid,Q(t).key,e.currentTarget.value)),X(e,n)},a=e=>{var n=BRe(),r=j(n);v(r);var i=g(r,2),a=f(i,!0);H(n),O(()=>{w(r,!!Q(x).doc.params[Q(t).key]),Y(a,Q(t).label??Q(t).key)}),L(`change`,r,e=>A(Q(x).uuid,Q(t).key,e.currentTarget.checked)),X(e,n)},o=e=>{{let n=q(()=>Q(t).label??Q(t).key),r=q(()=>Number(Q(x).doc.params[Q(t).key]??Q(t).default??0)),i=q(()=>(Number(Q(t).max??1)-Number(Q(t).min??0))/240),a=q(()=>Q(t).step??.01),o=q(()=>Q(t).step&&Q(t).step>=1?0:2);hq(e,{get label(){return Q(n)},get value(){return Q(r)},get min(){return Q(t).min},get max(){return Q(t).max},get step(){return Q(i)},get snap(){return Q(a)},get decimals(){return Q(o)},onchange:e=>A(Q(x).uuid,Q(t).key,e),onscrubstart:()=>E(Q(x).uuid),onscrubend:()=>ee(Q(x).uuid)})}};G(r,e=>{Q(t).kind===`select`?e(i):Q(t).kind===`toggle`?e(a,1):e(o,-1)}),H(n),O(()=>b(n,`data-key`,Q(t).key)),X(e,n)});var o=g(a,4),s=j(o),c=j(s);c.value=c.__value=``;var l=g(c);B(l,17,()=>Q(ne),e=>e.name,(e,t)=>{var n=bJ(),r=f(n,!0),i={};O(()=>{Y(r,Q(t).name),i!==(i=Q(t).name)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(s),_(s);var u=g(s,2),d=g(u,2);H(o);var p=g(o,2),h=j(p);v(h);var y=g(h,2);H(p),O(e=>{u.disabled=!Q(te),d.disabled=!Q(te),y.disabled=e},[()=>!Q(M).trim()]),m(s,()=>Q(te),e=>I(te,e)),L(`click`,u,re),L(`click`,d,ie),L(`keydown`,h,e=>{e.key===`Enter`&&P()}),S(h,()=>Q(M),e=>I(M,e)),L(`click`,y,P),X(e,t)};G(o,e=>{Q(x)&&e(s)});var c=g(o,4);B(c,17,()=>Q(y),e=>e.uuid,(e,t)=>{let n=q(()=>ae(Q(t)));var i=GRe();let a;var o=j(i),s=f(o,!0),c=g(o,2),l=j(c);let u;H(c);var d=g(c,2),p=e=>{var r=URe(),i=N(r);hq(j(i),{get value(){return Q(n).value},min:0,get max(){return Q(n).max},step:.01,decimals:2,onchange:e=>oe(Q(t),e)}),H(i);var a=g(i,2),o=g(a,2);O(e=>{b(a,`aria-pressed`,e),b(o,`aria-pressed`,Q(se)===Q(t).uuid)},[()=>ce(Q(t))]),L(`click`,a,()=>le(Q(t))),L(`click`,o,()=>de(Q(t))),X(e,r)},m=e=>{var t=WRe();X(e,t)};G(d,e=>{Q(n)?e(p):e(m,-1)}),H(i),O(e=>{a=r(i,1,`music-mix-row svelte-12bomqi`,null,a,{"music-current":Q(x)?.uuid===Q(t).uuid}),b(i,`data-uuid`,Q(t).uuid),Y(s,Q(t).name),u=Ze(l,``,u,{width:e})},[()=>`${Math.min(100,Math.round((Q(F)[Q(t).uuid]??0)*300))}%`]),L(`click`,o,()=>I(h,Q(t).uuid,!0)),X(e,i)}),O(()=>{a!==(a=Q(x)?.uuid??``)&&(i.value=(i.__value=a)??``,D(i,a))}),L(`change`,i,e=>I(h,e.currentTarget.value,!0)),X(e,t)};G(me,e=>{Q(y).length?e(he,-1):e(V)}),H(fe),X(e,fe),ue(),d()}ge([`change`,`click`,`keydown`]);var xJ=`mod-core-music`,SJ=Ue(``),CJ=!1,wJ=null;function TJ(){wJ||typeof window>`u`||(wJ=yv.subscribe(()=>{let e=Nde().length>0;e&&!CJ?(CJ=!0,ite({moduleId:`core`,id:`music`,title:`Music`,width:300,minW:240,defaultRect:{right:12,top:76},playMode:!0,mount(e){let t=Oe(JRe,{target:e});return()=>de(t)}})):!e&&CJ&&(CJ=!1,ote(xJ))}))}function YRe(){return CJ}var EJ=`musicPresets`;function XRe(){try{let e=typeof localStorage<`u`?nt.getItem(EJ):null,t=e?JSON.parse(e):{};return t&&typeof t==`object`?t:{}}catch{return{}}}var DJ=Ue(XRe());function OJ(){try{nt.setItem(EJ,JSON.stringify(U(DJ)))}catch{}}function kJ(e){return U(DJ)[e]??[]}function AJ(e,t,n){let r=String(t??``).trim();return!e||!r?!1:(DJ.update(t=>{let i=(t[e]??[]).filter(e=>e.name!==r);return{...t,[e]:[...i,{name:r,params:structuredClone(n??{})}]}}),OJ(),!0)}function jJ(e,t){DJ.update(n=>({...n,[e]:(n[e]??[]).filter(e=>e.name!==t)})),OJ()}function MJ(e,t){return t?Cv(e,{params:structuredClone(t.params??{})}):null}var ZRe=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-300">Combine</span> <!></div> <p class="text-[10px] italic text-gray-400">This look applies while anyone is looking through that camera â switch camera (a Set 2301 Active Camera node, or Control on the camera) and the grade switches with it.</p>`,1),QRe=V(`<p class="text-xs text-gray-400">No look yet. Add ambient occlusion, colour grading or a camera effect below â the stack runs top 2302 to bottom over the finished frame, and everyone in the session sees it.</p>`),$Re=V(`<span class="ml-1 text-[10px] text-amber-400">unsupported</span>`),NJ=V(`<p class="text-[10px] italic text-amber-400"> </p>`),eze=V(`<p class="text-[10px] italic text-gray-400">No parameters.</p>`),PJ=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-300"> </span> <!></div>`),tze=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-300"> </span> <!> <button class="ui-chip shrink-0 bg-gray-600 text-gray-200 hover:bg-gray-500" title="Open this graph in the shader editor">Edit</button></div> <!>`,1),nze=V(`<p class="text-[10px] italic text-gray-500"> </p>`),rze=V(`<!> <!>`,1),ize=V(`<div class="flex flex-col gap-1 px-2 pb-1 pt-1"><!></div>`),aze=V(`<div data-post-row=""><div><span class="cursor-grab select-none px-1 text-gray-400 hover:text-gray-200" title="Drag to reorder â the stack runs top to bottom">â ¿</span> <input type="checkbox" class="h-3 w-3 shrink-0 accent-primary-600" title="Render this effect"/> <button class="flex-1 truncate text-left text-xs text-gray-200 hover:text-white"> <!></button> <button class="px-1 text-[10px] text-gray-400 hover:text-gray-100 disabled:opacity-30" title="Move earlier in the stack" aria-label="Move up">â</button> <button class="px-1 text-[10px] text-gray-400 hover:text-gray-100 disabled:opacity-30" title="Move later in the stack" aria-label="Move down">â</button> <button class="px-1 text-[10px] text-gray-400 hover:text-red-400" title="Remove from the stack">â</button></div> <!></div>`),oze=V(`<div id="post-stack" class="flex flex-col gap-0.5"></div>`),sze=V(`<p class="text-[10px] text-amber-400">Your viewport is in Wireframe, which skips post-processing â the look is still there for 2303 everyone else.</p>`),cze=V(`<p class="text-[10px] text-amber-400">You have switched the scene look off on this device (View ⸠Overrides). Peers still see it.</p>`),lze=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-300">Look for</span> <!></div> <!> <!> <p id="post-counts" class="text-[10px] text-gray-400"> </p> <!> <button id="post-add" class="ui-chip w-full justify-center bg-gray-600 text-gray-200 hover:bg-gray-500" title="Add a post-processing effect to the scene's look">+ Add effect</button> <!> <p class="text-[10px] italic text-gray-400">The stack is part of the scene: everyone in the session sees it as soon as you change it, and it 2304 is saved with the file. Nobody has to switch anything on.</p> <!> <p class="text-[10px] italic text-gray-400">Post-processing does not run in VR â the effects are skipped in a headset, and objects still look 2305 the same.</p>`,1);function uze(e,n){Ce(n,!0);let i=()=>z(Ui,`$objectsGroup`,p),a=()=>z(vy,`$postStacks`,p),o=()=>z(ry,`$shaderGraphs`,p),s=()=>z(sy,`$shaderErrors`,p),c=()=>z(Fa,`$explorerItems`,p),l=()=>z(Ty,`$scenePost`,p),u=()=>z(ii,`$viewMode`,p),d=()=>z(gy,`$postEnabledLocal`,p),[p,m]=Ve(),h=t(Ne(xy)),_=e=>ox(),y=q(()=>_(i())),x=(e,t)=>cpe(t),S=q(()=>
2305x(a(),Q(h))),C=q(()=>Q(h)!==xy);Qe(()=>{Q(h)!==`scene`&&!Q(y).some(e=>e.uuid===Q(h))&&I(h,xy,!0)});let T=t(``),E=t(null),D=t(null),k=t(null),A=q(()=>Xfe(Q(S))),ee=[`ao`,`grading`,`stylize`,`graph`,`camera`,`aa`,`test`,`other`],M={ao:`Ambient occlusion`,grading:`Colour grading`,stylize:`Stylize`,graph:`Shader graph`,camera:`Camera FX`,aa:`Anti-aliasing`,test:`Test`,other:`Other`},te=q(()=>{let e={};for(let t of tpe())(e[t.group]??=[]).push(t);let t=Object.keys(e).filter(e=>!ee.includes(e)).sort();return[...ee,...t].filter(t=>e[t]?.length).map(t=>({label:M[t]??t,children:t===`graph`?[...uR().map(e=>({label:`New: `+e.label,title:e.hint,action:()=>ie({preset:e.key})})),{label:`New: empty graph`,action:()=>ie({})},...Q(re).map(e=>({label:e.name,action:()=>F(e.key)}))]:e[t].slice().sort((e,t)=>e.label.localeCompare(t.label)).map(e=>({label:e.label,action:()=>se(e.kind)}))}))}),P=e=>KL(),re=q(()=>P(o()));function ie(e){I(E,null);let t=eR({...e,docKey:Q(h)});I(T,t.id,!0)}function F(e){I(E,null);let t=yy(`graph`,void 0,Q(h));tR(t,e,Q(h)),I(T,t,!0)}function ae(e){return e.kind===`graph`?e.params?.graph?qL(e.params.graph):`Shader graph (none picked)`:Sy(e.kind)?.label??e.kind}let oe=(e,t)=>e.kind===`graph`&&e.params?.graph?s()[e.params.graph]??[]:[];function R(e){return!Sy(e.kind)}function se(e){I(E,null),I(T,yy(e,void 0,Q(h)),!0)}function ce(e){let t=e.currentTarget.getBoundingClientRect();I(E,{x:Math.round(t.left),y:Math.round(t.bottom+4)},!0)}_e(()=>{wa()});let le=q(()=>[{value:``,name:`â none â`},...c().filter(e=>/\.cube$/i.test(e.name??``)||Aa(e.name??``)===`image`).map(e=>({value:e.hash,name:e.name}))]);function de(e,t,n){fy(e,{[t]:n},Q(h)),n&&Sf(n)}function pe(e,t){let n=e=>{e.button===0&&(e.preventDefault(),I(D,{id:t.id,from:t.index,to:t.index},!0),window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i))},r=e=>{if(!Q(D)||!Q(k))return;let t=[...Q(k).querySelectorAll(`[data-post-row]`)],n=t.length-1;for(let r=0;r<t.length;r++){let i=t[r].getBoundingClientRect();if(e.clientY<i.top+i.height/2){n=r;break}}I(D,{...Q(D),to:n},!0)},i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i);let e=Q(D);I(D,null),e&&e.to!==e.from&&hy(e.id,e.to,Q(h))};return e.addEventListener(`pointerdown`,n),{update(e){t=e},destroy(){e.removeEventListener(`pointerdown`,n),window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i)}}}var me=lze(),V=N(me),he=g(j(V),2);{let e=q(()=>[{value:xy,name:`The scene (everyone)`},...Q(y).map(e=>({value:e.uuid,name:(e.name||`Camera`)+` â camera`}))]);fq(he,{id:`post-doc-key`,class:`min-w-0 flex-1`,get items(){return Q(e)},get value(){return Q(h)},onchange:e=>{I(h,String(e),!0),I(T,``)}})}H(V);var ge=g(V,2),U=e=>{var t=ZRe(),n=N(t),r=g(j(n),2);{let e=q(()=>Q(S).mode===`replace`?`replace`:`append`);fq(r,{id:`post-doc-mode`,class:`min-w-0 flex-1`,items:[{value:`append`,name:`Add to the scene look`},{value:`replace`,name:`Replace the scene look`}],get value(){return Q(e)},onchange:e=>Qfe(Q(h),String(e))})}H(n),W(2),X(e,t)};G(ge,e=>{Q(C)&&e(U)});var ve=g(ge,2);xo(ve,{id:`post-enabled`,get checked(){return Q(S).enabled},onchange:e=>ipe(e.currentTarget.checked,Q(h)),children:(e,t)=>{W();var n=Te();O(()=>Y(n,`${Q(C)?`This cameraâs look enabled`:`Scene look enabled`} (shared)`)),X(e,n)},$$slots:{default:!0}});var ye=g(ve,2),be=f(ye),xe=g(ye,2),K=e=>{var t=QRe();X(e,t)},Se=e=>{var t=oze();B(t,23,()=>Q(S).effects,e=>e.id,(e,t,n)=>{var i=aze();let a;var o=j(i);let c;var l=j(o);ne(l,(e,t)=>pe?.(e,t),()=>({id:Q(t).id,index:Q(n)}));var u=g(l,2);v(u);var d=g(u,2),p=j(d,!0),m=g(p),_=e=>{var t=$Re();X(e,t)},y=q(()=>R(Q(t)));G(m,e=>{Q(y)&&e(_)}),H(d);var x=g(d,2),C=g(x,2),E=g(C,2);H(o);var k=g(o,2),A=e=>{var n=ize(),r=j(n),i=e=>{var n=NJ(),r=f(n);O(()=>
2305Y(r,`Saved and shared as-is. Open this scene in a build that has "${Q(t).kind??``}" to edit it.`)),X(e,n)},a=q(()=>R(Q(t))),o=e=>{var t=eze();X(e,t)},c=q(()=>(Sy(Q(t).kind)?.params??[]).length===0),l=e=>{var n=fe(),r=N(n);B(r,17,()=>Sy(Q(t).kind).params,e=>e.key,(e,n)=>{var r=rze(),i=N(r),a=e=>{var r=PJ(),i=j(r),a=f(i,!0),o=g(i,2);{let e=q(()=>`post-param-`+Q(t).id+`-`+Q(n).key),r=q(()=>(Q(n).options??[]).map(e=>({value:e.value,name:e.label})));fq(o,{get id(){return Q(e)},class:`min-w-0 flex-1`,get items(){return Q(r)},get value(){return Q(t).params[Q(n).key]},onchange:e=>fy(Q(t).id,{[Q(n).key]:e},Q(h))})}H(r),O(()=>Y(a,Q(n).label)),X(e,r)},o=e=>{var r=tze(),i=N(r),a=j(i),o=f(a,!0),c=g(a,2);{let e=q(()=>`post-param-`+Q(t).id+`-`+Q(n).key),r=q(()=>Q(re).map(e=>({value:e.key,name:e.name}))),i=q(()=>Q(t).params[Q(n).key]??``);fq(c,{get id(){return Q(e)},class:`min-w-0 flex-1`,get items(){return Q(r)},get value(){return Q(i)},placeholder:`Pick a graphâ¦`,onchange:e=>fy(Q(t).id,{[Q(n).key]:String(e??``)},Q(h))})}var l=g(c,2);H(i);var u=g(i,2);B(u,1,()=>oe(Q(t),s()),Be,(e,t)=>{var n=NJ(),r=f(n,!0);O(()=>Y(r,Q(t))),X(e,n)}),O(()=>{Y(o,Q(n).label),b(l,`id`,`post-edit-`+Q(t).id),l.disabled=!Q(t).params[Q(n).key]}),L(`click`,l,()=>ZL(Q(t).params[Q(n).key])),X(e,r)},c=e=>{var r=PJ(),i=j(r),a=f(i,!0),o=g(i,2);{let e=q(()=>`post-param-`+Q(t).id+`-`+Q(n).key),r=q(()=>Q(t).params[Q(n).key]??``);fq(o,{get id(){return Q(e)},class:`min-w-0 flex-1`,get items(){return Q(le)},get value(){return Q(r)},placeholder:`Pick a fileâ¦`,onchange:e=>de(Q(t).id,Q(n).key,String(e??``))})}H(r),O(()=>Y(a,Q(n).label)),X(e,r)},l=e=>{{let r=q(()=>`post-param-`+Q(t).id+`-`+Q(n).key),i=q(()=>!!Q(t).params[Q(n).key]);xo(e,{get id(){return Q(r)},get checked(){return Q(i)},onchange:e=>fy(Q(t).id,{[Q(n).key]:e.currentTarget.checked},Q(h)),children:(e,t)=>{W();var r=Te();O(()=>Y(r,Q(n).label)),X(e,r)},$$slots:{default:!0}})}},u=e=>{{let r=q(()=>`post-param-`+Q(t).id+`-`+Q(n).key),i=q(()=>Number(Q(t).params[Q(n).key]??Q(n).default??0)),a=q(()=>Q(n).min??-1/0),o=q(()=>Q(n).max??1/0),s=q(()=>Q(n).step??.01),c=q(()=>Q(n).decimals??2),l=q(()=>Q(n).hint??``);hq(e,{get id(){return Q(r)},get label(){return Q(n).label},get value(){return Q(i)},get min(){return Q(a)},get max(){return Q(o)},get step(){return Q(s)},get decimals(){return Q(c)},get title(){return Q(l)},onchange:e=>fy(Q(t).id,{[Q(n).key]:e},Q(h)),onscrubstart:()=>npe(Q(h)),get onscrubend(){return spe}})}};G(i,e=>{Q(n).type===`select`?e(a):Q(n).type===`graph`?e(o,1):Q(n).type===`asset`?e(c,2):Q(n).type===`bool`?e(l,3):e(u,-1)});var d=g(i,2),p=e=>{var t=nze(),r=f(t,!0);O(()=>Y(r,Q(n).hint)),X(e,t)};G(d,e=>{Q(n).hint&&e(p)}),X(e,r)}),X(e,n)};G(r,e=>{Q(a)?e(i):Q(c)?e(o,1):e(l,-1)}),H(n),O(()=>b(n,`id`,`post-params-`+Q(t).id)),X(e,n)};G(k,e=>{Q(T)===Q(t).id&&e(A)}),H(i),O((e,s,f,m)=>{a=r(i,1,`svelte-1l8am5a`,null,a,{"post-drop":Q(D)&&Q(D).to===Q(n)&&Q(D).from!==Q(n)}),b(o,`id`,`post-row-`+Q(t).id),c=r(o,1,`flex items-center gap-1 rounded-sm bg-gray-700/60 px-1 py-0.5`,null,c,{"opacity-50":Q(D)&&Q(D).id===Q(t).id}),b(l,`id`,`post-grip-`+Q(t).id),b(u,`id`,`post-toggle-`+Q(t).id),w(u,Q(t).enabled),b(u,`aria-label`,e),b(d,`id`,`post-open-`+Q(t).id),b(d,`title`,s),Y(p,f),b(x,`id`,`post-up-`+Q(t).id),x.disabled=Q(n)===0,b(C,`id`,`post-down-`+Q(t).id),C.disabled=Q(n)===Q(S).effects.length-1,b(E,`id`,`post-remove-`+Q(t).id),b(E,`aria-label`,m)},[()=>`Enable `+ae(Q(t)),()=>R(Q(t))?`This effect comes from a newer version â it is kept and shared, but this build cannot render it`:`Show parameters`,()=>
2305ae(Q(t)),()=>`Remove `+ae(Q(t))]),L(`change`,u,e=>Zfe(Q(t).id,e.currentTarget.checked,Q(h))),L(`click`,d,()=>I(T,Q(T)===Q(t).id?``:Q(t).id,!0)),L(`click`,x,()=>hy(Q(t).id,Q(n)-1,Q(h))),L(`click`,C,()=>hy(Q(t).id,Q(n)+1,Q(h))),L(`click`,E,()=>epe(Q(t).id,Q(h))),X(e,i)}),H(t),We(t,e=>I(k,e),()=>Q(k)),X(e,t)};G(xe,e=>{Q(S).effects.length===0?e(K):e(Se,-1)});var we=g(xe,2),Ee=g(we,2),J=e=>{xS(e,{get x(){return Q(E).x},get y(){return Q(E).y},get items(){return Q(te)},sizeKey:`post-add`,onclose:()=>I(E,null)})};G(Ee,e=>{Q(E)&&e(J)});var De=g(Ee,4),Oe=e=>{var t=sze();X(e,t)},ke=e=>{var t=cze();X(e,t)};G(De,e=>{l().effects.length&&u()===`wireframe`?e(Oe):l().effects.length&&!d()&&e(ke,1)}),W(2),O(()=>Y(be,`Effects: ${Q(A).enabled??``}${Q(A).effects===Q(A).enabled?``:` of `+Q(A).effects}, passes: ${Q(A).passes??``}${Q(A).merged>0?` (`+Q(A).merged+` merged into a shared pass)`:``}`)),L(`click`,we,ce),X(e,me),ue(),m()}ge([`change`,`click`]);var FJ=V(`<button type="button" class="tp-seg-btn"> </button>`),dze=V(`<div id="physics-group-row" class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Group</span> <div class="tp-seg flex-wrap" role="group" aria-label="Collision group"></div></div> <div id="physics-collides-row" class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Collides with</span> <div class="tp-seg flex-wrap" role="group" aria-label="Collides with"></div></div>`,1);function fze(e,t){Ce(t,!0);let n=J(t,`water`,3,null),r=q(()=>Kre(t.physics,n())),i=q(()=>Array.isArray(t.physics?.collidesWith)?t.physics.collidesWith:Of.map(e=>e.id));function a(e){let n=Q(i).includes(e)?Q(i).filter(t=>t!==e):[...Q(i),e];t.onchange({collidesWith:Zre(n)})}var o=dze(),s=N(o),c=g(j(s),2);B(c,21,()=>Jre,e=>e.id,(e,n)=>{var i=FJ(),a=f(i,!0);O(()=>{b(i,`data-group`,Q(n).id),b(i,`aria-pressed`,Q(r)===Q(n).id),b(i,`title`,Q(n).id===`water`?`Water/trigger: pass-through, fires On Enter / On Exit`:`Collision group `+Q(n).label),Y(a,Q(n).id===`water`?`Water`:Q(n).label)}),L(`click`,i,()=>t.onchange({group:Q(n).id==="default"?null:Q(n).id})),X(e,i)}),H(c),H(s);var l=g(s,2),u=g(j(l),2);B(u,21,()=>Of,e=>e.id,(e,t)=>{var n=FJ(),r=f(n,!0);O(e=>{b(n,`data-collides`,Q(t).id),b(n,`aria-pressed`,e),b(n,`title`,Q(t).id===`player`?`The player walking in Play â leave it out for a ghost wall`:`Collide with group `+Q(t).label),Y(r,Q(t).id===`water`?`Water`:Q(t).label)},[()=>Q(i).includes(Q(t).id)]),L(`click`,n,()=>a(Q(t).id)),X(e,n)}),H(u),H(l),X(e,o),ue()}ge([`click`]);var pze=1200,mze=1e5;function hze(e){let t=IJ(e);return Math.max(8,Math.min(32,Math.floor(pze/3/t)))}function IJ(e){let t=Math.round(Number(e));return Number.isFinite(t)?Math.min(16,Math.max(2,t)):8}function gze(e,t){let n=e.length/3,r=t??Array.from({length:n},(e,t)=>t),i=new Map,a=[],o=new Int32Array(n).fill(-1);for(let t=0;t<n;t++){let n=e[t*3],r=e[t*3+1],s=e[t*3+2],c=Math.round(n*1e5)+`,`+Math.round(r*1e5)+`,`+Math.round(s*1e5),l=i.get(c);l===void 0&&(l=a.length/3,i.set(c,l),a.push(n,r,s)),o[t]=l}let s=[];for(let e=0;e+2<r.length;e+=3){let t=o[r[e]],n=o[r[e+1]],i=o[r[e+2]];t!==n&&n!==i&&t!==i&&s.push(t,n,i)}return{positions:Float64Array.from(a),indices:Uint32Array.from(s)}}function _ze(e){return{maxHulls:IJ(e),maxVerticesPerHull:hze(e),voxelResolution:mze,messages:`none`}}function vze(e,t,n){return t.positions.length<12||t.indices.length<12?[]:e.computeConvexHulls(t,_ze(n)).map(e=>e.positions)}function yze(e){let t=[],n=[],r=0;for(let i of e){if(i.length<12||i.length%3!=0){r++;continue}if(t.length+i.length>1200){r++;continue}n.push([t.length,i.length]);for(let e=0;e<i.length;e++)t.push(Math.round(i[e]*1e4)/1e4)}return{colliderVerts:t,colliderPieces:n,dropped:r}}var LJ=Ue(null),RJ=()=>new Worker(new URL(new URL(`../workers/vhacdWorker-CN4ew7MG.js`,import.meta.url).href,``+import.meta.url),{type:`module`});function bze(e){RJ=e}async function xze(e,t){let n=null;try{n=typeof Worker>`u`?null:RJ()}catch{n=null}if(!n){let{ConvexMeshDecomposition:n}=await $(async()=>{let{ConvexMeshDecomposition:e}=await import(`../chunks/CCcbJWDp.js`);return{ConvexMeshDecomposition:e}},__vite__mapDeps([249,1]),import.meta.url),r=performance.now();return{pieces:vze(await n.create(),e,t),ms:performance.now()-r,where:`main`}}let r=n;return new Promise((n,i)=>{let a=()=>{try{r.terminate()}catch{}};r.onmessage=e=>{a(),e.data?.error?i(Error(e.data.error)):n({pieces:e.data.pieces??[],ms:e.data.ms??0,where:`worker`})},r.onerror=e=>{a(),i(Error(e.message||`decomposition worker failed`))},r.postMessage({id:1,positions:e.positions,indices:e.indices,maxPieces:t},[e.positions.buffer,e.indices.buffer])})}async function zJ(e,t=8){let n=U(Ui)?.getObjectByProperty(`uuid`,e);if(!n||U(LJ))return null;let r=Cf(n,`trimesh`),i=r?.kind===`trimesh`?r.pieces?.[0]:null;if(!i?.indices)return es(`Nothing to decompose on "`+(n.name||n.type)+`"`+(r?.reason?` (`+r.reason+`)`:``)),null;let a=n.scale,o=Math.abs(a.x)>1e-9?a.x:1,s=Math.abs(a.y)>1e-9?a.y:1,c=Math.abs(a.z)>1e-9?a.z:1,l=new Float64Array(i.verts.length);for(let e=0;e<l.length;e+=3)l[e]=i.verts[e]/o,l[e+1]=i.verts[e+1]/s,l[e+2]=i.verts[e+2]/c;let u=IJ(t);LJ.set(e);try{let{pieces:t,ms:r,where:a}=await xze(gze(l,i.indices),u),o=yze(t);if(!o.colliderPieces.length)return es(`Decompose found no convex pieces for "`+(n.name||n.type)+`"`),null;eh(e,{collider:`custom`,colliderVerts:o.colliderVerts,colliderPieces:o.colliderPieces});let s=o.colliderPieces.length;return es(`Collider decomposed into `+s+` convex piece`+(s===1?``:`s`)+(o.dropped?` (`+o.dropped+` dropped to fit)`:``)),{pieces:s,dropped:o.dropped,ms:Math.round(r),where:a}}catch(e){return es(`Decompose failed: `+e?.message),null}finally{LJ.set(null)}}var Sze=V(`<div id="physics-decompose-row" class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Decompose</span> <input id="physics-decompose-pieces" type="range" class="min-w-0 flex-1" aria-label="Maximum convex pieces" step="1"/> <span class="w-5 text-right font-mono text-xs text-gray-300"> </span> <button id="physics-decompose" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500" title="Split the mesh into convex pieces (keeps openings; works on dynamic bodies)"> </button></div>`);function Cze(e,n){Ce(n,!0);let r=()=>z(LJ,`$decomposing`,i),[i,a]=Ve(),o=t(Ne(IJ(Number(nt.getItem(`colliderDecomposePieces`)??8)))),s=q(()=>r()===n.uuid);function c(e){I(o,IJ(e.currentTarget.value),!0);try{nt.setItem(`colliderDecomposePieces`,String(Q(o)))}catch{}}var l=Sze(),d=g(j(l),2);v(d);var p=g(d,2),m=f(p,!0),h=g(p,2),_=f(h,!0);H(l),O(()=>{b(d,`min`,2),b(d,`max`,16),u(d,Q(o)),Y(m,Q(o)),h.disabled=Q(s),Y(_,Q(s)?`Workingâ¦`:`Run`)}),L(`input`,d,c),L(`click`,h,()=>zJ(n.uuid,Q(o))),X(e,l),ue(),a()}ge([`input`,`click`]);var BJ=Ue(null),VJ=null,HJ=new Wn,UJ=new yn;function WJ(){VJ?.(),VJ=null,BJ.set(null)}function wze(e,t){WJ();let n=U(xi)?.domElement;if(!n)return!1;BJ.set(e),es(`Click a surface in the viewport to aim the light at it (Esc cancels)`);let r=r=>{if(r.button!==0||r.target!==n)return;let i=U(yi);if(!i)return;let a=n.getBoundingClientRect();UJ.set((r.clientX-a.left)/a.width*2-1,-((r.clientY-a.top)/a.height)*2+1),HJ.setFromCamera(UJ,i);let o=Ch(HJ,{excludeUuids:[e]})[0];if(r.preventDefault(),r.stopPropagation(),!o){es(`Nothing under the cursor â click an object to aim at it`);return}WJ(),t(o.point.clone())},i=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),WJ())};return window.addEventListener(`pointerdown`,r,!0),window.addEventListener(`ke
2305ydown`,i,!0),VJ=()=>{window.removeEventListener(`pointerdown`,r,!0),window.removeEventListener(`keydown`,i,!0)},!0}var Tze=V(`<img class="h-24 w-24 rounded-sm border border-gray-600 object-cover"/>`),Eze=V(`<span class="flex h-24 w-24 items-center justify-center rounded-sm border border-gray-600 bg-gray-700 text-4xl text-gray-400"><!></span>`),Dze=V(`<div class="ui-row"><span class="w-16 text-gray-400">Details</span><span> </span></div>`),Oze=V(`<div class="ui-row"><span class="w-16 text-gray-400">Name</span> <input id="file-name" class="ui-input flex-1"/></div> <div class="ui-row"><span class="w-16 text-gray-400">Kind</span><span class="ui-badge-type"> </span></div> <div class="ui-row"><span class="w-16 text-gray-400">Size</span><span> </span></div> <div class="ui-row"><span class="w-16 text-gray-400">Folder</span><span class="truncate"> </span></div> <div class="ui-row"><span class="w-16 text-gray-400">Added</span><span> </span></div> <div class="ui-row"><span class="w-16 text-gray-400">Hash</span> <span class="truncate font-mono text-[10px]"> </span> <button class="ui-button-quiet svelte-1kmyk3f" title="Copy the full hash">â§</button></div> <!>`,1),kze=V(`<!> `,1),Aze=V(`<!>Delete`,1),jze=V(`<div class="flex flex-wrap gap-2"><!> <!></div>`),Mze=V(`<div id="file-properties" class="flex flex-col gap-3"><div class="flex justify-center"><!></div> <!> <!></div>`),Nze=V(`<p class="p-3 text-sm italic text-gray-400">The file was removed.</p>
2305`),Pze=V(`<div id="drawer-label" class="sticky top-0 z-10 -mx-4 rounded-tl-lg bg-gray-800 px-4"><!></div> <!>`,1),GJ=V(`<button> </button>`),Fze=V(`<span class="inline-flex items-center overflow-hidden rounded-full bg-gray-600"><button class="px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-gray-200 hover:bg-gray-500 svelte-1kmyk3f" title="Apply this preset (replicates to peers)"> </button> <button class="px-1 text-[10px] text-gray-300 hover:bg-red-700 hover:text-white svelte-1kmyk3f" title="Delete saved preset">â</button></span>`),Ize=V(`<p class="ui-section-label">Saved presets</p> <div class="flex flex-wrap gap-1"></div>`,1),Lze=V(`<button class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f" title="Apply this peer preset (replicates to everyone)"> </button>`),Rze=V(`<p class="ui-section-label"> </p> <div class="flex flex-wrap gap-1"></div>`,1),zze=V(`<!> <div class="ui-row"><span class="w-20 shrink-0 text-xs text-gray-400">Sky / ground</span> <input type="color" class="h-6 w-8 cursor-pointer rounded-sm border border-gray-600 bg-transparent"/> <input type="color" class="h-6 w-8 cursor-pointer rounded-sm border border-gray-600 bg-transparent"/></div>`,1),Bze=V(`<!> <div class="ui-row"><span class="w-20 shrink-0 text-xs text-gray-400">Sun color</span> <input type="color" class="h-6 w-8 cursor-pointer rounded-sm border border-gray-600 bg-transparent"/></div>`,1),Vze=V(`<input type="color" class="h-5 w-7 cursor-pointer rounded-sm border border-gray-600 bg-transparent"/>`),Hze=V(`<div class="env-light rounded-lg border border-gray-700/60 p-1.5"><div class="flex items-center gap-1.5"><span class="text-[10px] font-semibold uppercase tracking-wider text-gray-400"> </span> <input type="color" class="h-5 w-7 cursor-pointer rounded-sm border border-gray-600 bg-transparent"/> <!> <span class="flex-1"></span> <button class="ui-button-quiet svelte-1kmyk3f" title="Convert back into a normal scene object">â± object</button> <button class="ui-button-quiet hover:bg-red-700 svelte-1kmyk3f" title="Remove">â</button></div> <!></div>`),Uze=V(`<div id="environment-presets" class="flex flex-wrap gap-1"><!> <!></div> <!> <!> <!> <div class="flex flex-wrap gap-1"><button id="env-save-preset" class="ui-button-quiet svelte-1kmyk3f" title="Save the current environment as a named preset"><!>Save preset</button> <button class="ui-button-quiet svelte-1kmyk3f" title="Download the current environment as JSON"><!>Export</button> <button class="ui-button-quiet svelte-1kmyk3f" title="Import a .envpreset.json file"><!>Import</button> <input type="file" id="env-import-file" style="display: none" accept=".json"/></div> <p class="ui-section-label">Components</p> <!> <!> <!> <div class="flex flex-wrap gap-1"><button id="env-add-hemisphere" class="ui-button-quiet svelte-1kmyk3f">+ Hemisphere</button> <button id="env-add-directional" class="ui-button-quiet svelte-1kmyk3f">+ Directional</button> <button id="env-add-point" class="ui-button-quiet svelte-1kmyk3f">+ Point</button></div> <button id="env-adopt" class="ui-button-quiet disabled:cursor-not-allowed disabled:opacity-40 svelte-1kmyk3f">â² Adopt selected light into environment</button> <p class="text-[10px] italic text-gray-400">Everything here replicates to peers; your own lights automatically dim the default rig.</p>`,1),KJ=V(`<option> </option>`),Wze=V(`<span class="text-xs text-amber-400">click anywhere to enable audio</span>`),Gze=V(`<p class="ui-section-label">Scene track (shared)</p> <select class="ui-input w-full"><option>â no music â</option><!><!></select> <div class="mt-1 flex items-center gap-2"><button> </button> <!></div> <!> <p class="ui-section-label">This device</p> <!> <!> <p class="mt-1 text-xs text-gray-400">One background track for everyone, synced to the same moment. Volume is shared; the local trim + mute affect only you.</p>`,1),Kze=V(`<p class="mb-1 text-[10px] text-gray-400">This scene sets its own ambient occlusion, so it is used instead of your personal 2306 setting.</p>`),qze=V(`<!> <p class="mb-1 text-[10px] italic text-gray-400"> </p>`,1),Jze=V(`<p class="ui-section-label">Viewport â this device</p> <div id="view-mode-switch" class="flex flex-wrap gap-1"></div> <p class="mb-1 text-xs text-gray-400">How YOUR viewport shades the scene â not shown to peers. The scene's own look 2307 (post-processing) renders for everyone regardless; switch it off below if you need to.</p> <!> <p class="ui-section-label" data-anchor="Overrides">Overrides â this device</p> <!> <!> <!>`,1),Yze=V(`<p class="mb-1 text-[10px] text-gray-400">Three layers, all of them scene data that everyone sees: effects over the 2308 finished frame (below), a default material every object without its own 2309 inherits, and a material on one object. Only the right to switch a layer off 2310 is local â that is View ⸠Overrides, above.</p> <!> <p class="ui-section-label" data-anchor="Materials">Shader materials</p> <p id="scene-look-shaders" class="text-[10px] text-gray-400"> </p> <button id="scene-look-open-shader" class="ui-chip w-full justify-center bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f" title="Open the shader editor â the scene default with nothing selected, an object's own when one is">Open the shader editor</button>`,1),Xze=V(`<p class="text-xs text-gray-400">No saved views yet. Frame something you like, then Save current view.</p>`),Zze=V(`<div class="bookmark-row flex items-center gap-1"><span class="w-8 shrink-0 text-[10px] text-gray-500"> </span> <input class="ui-input min-w-0 flex-1 px-1 py-0.5 text-xs" aria-label="View name"/> <button title="Recall this view"><!></button> <button title="Overwrite with the current view"><!></button> <button title="Move up">â</button> <button title="Move down">â</button> <button title="Delete this view"><!></button></div>`),Qze=V(`<div id="bookmark-list" class="flex flex-col gap-1"></div> <p class="text-[10px] italic text-gray-400">
2310Each view stores its lens (FOV + clip planes) and restores it on recall.</p>`,1),$ze=V(`<div id="lens-presets" class="flex flex-wrap gap-1"></div> <!> <!> <div class="ui-row"><span class="w-20 shrink-0 text-xs text-gray-400">Far clip</span> <div class="w-24 shrink-0"><!></div> <span class="text-[10px] text-gray-500">grows to fit the scene</span></div> <p class="text-[10px] italic text-gray-400">Clip planes are per-device (not shared).</p> <p class="ui-section-label">Orbit feel</p> <!> <!> <!> <!> <!> <div class="ui-row items-center gap-2"><button id="camera-frame-scene" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f">Frame scene</button> <button id="camera-reset-view" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f">Reset view</button> <button id="orbit-reset" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f">Reset feel</button></div> <!> <p class="ui-section-label" data-anchor="Saved views">Saved views</p> <div class="ui-row items-center gap-2"><button id="bookmark-save" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f">Save current view</button> <span class="text-[10px] text-gray-500"> </span></div> <!>`,1),eBe=V(`<!> <!> <!> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Colours</span> <input id="grid-cell-color" type="color" class="h-6 w-10 rounded-sm bg-transparent" aria-label="Grid cell colour"/> <input id="grid-section-color" type="color" class="h-6 w-10 rounded-sm bg-transparent" aria-label="Grid major-line colour"/> <span class="text-[10px] text-gray-500">cell · major</span></div> <div class="ui-row items-center gap-1"><span class="w-20 shrink-0 text-xs text-gray-400">Fade</span> <!></div> <!> <!> <!> <!> <div id="grid-follow" class="ui-row items-center gap-1"><span class="w-20 shrink-0 text-xs text-gray-400">Follow</span> <!></div> <!> <div class="ui-row items-center gap-2"><button id="grid-reset" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f">Reset grid</button> <span class="text-[10px] italic text-gray-400">Per-device (not shared).</span></div>`,1),tBe=V(`<div class="snap-status snap-status-armed svelte-1kmyk3f"><span class="snap-status-text svelte-1kmyk3f">Selectingâ¦</span> <span class="snap-status-hint svelte-1kmyk3f">Esc cancels</span> <button id="snap-anchor-cancel" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f" aria-label="cancel picking the snap origin" title="Cancel (Esc)">â</button></div>`),nBe=V(`<div class="snap-status snap-status-picked svelte-1kmyk3f"><span class="snap-status-text svelte-1kmyk3f">Picked â</span> <button id="snap-anchor-save-origin" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f" title="Keep this point for good: it becomes the object's own origin â shared with peers, undoable, and it survives selecting something else">Save as object origin</button> <button id="snap-anchor-clear" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f" aria-label="clear the picked snap origin" title="Forget this point">â</button></div>`),rBe=V(`<!> <div class="snap-row svelte-1kmyk3f"><span class="text-xs text-gray-400">Position</span> <div class="snap-chips svelte-1kmyk3f"></div> <div class="snap-field svelte-1kmyk3f"><!></div></div> <div class="snap-row svelte-1kmyk3f"><span class="text-xs text-gray-400">Rotation</span> <div class="snap-chips svelte-1kmyk3f"></div> <div class="snap-field svelte-1kmyk3f"><!></div></div> <div class="snap-row svelte-1kmyk3f"><span class="text-xs text-gray-400">Scale</span> <div class="snap-chips svelte-1kmyk3f"></div> <div class="snap-field svelte-1kmyk3f"><!></div></div> <!> <div class="snap-group svelte-1kmyk3f"><span class="ui-section-label">Snap to elements</span> <span class="snap-group-hint svelte-1kmyk3f">beats the grid steps</span></div> <div class="snap-sub svelte-1kmyk3f"><span class="text-xs text-gray-400">Targets</span> <span class="snap-sub-hint svelte-1kmyk3f"> </span></div> <div class="snap-cloud svelte-1kmyk3f"></div> <div class="snap-row svelte-1kmyk3f"><span class="text-xs text-gray-400">Radius</span> <div class="snap-chips svelte-1kmyk3f"></div> <div class="snap-field svelte-1kmyk3f"><!></div></div> <!> <div class="snap-row svelte-1kmyk3f"><span class="text-xs text-gray-400">Snap origin</span> <div class="snap-chips svelte-1kmyk3f"><button id="snap-anchor-auto" title="Snap from the nearest point on the object's bounding box">Auto</button> <button id="snap-anchor-pivot" title="Snap from the object's own origin">Pivot</button></div></div> <button id="snap-anchor-pick" title="Click a point on the selected object to snap from"><span aria-hidden="true">â</span> </button> <!> <p class="text-[10px] italic text-gray-400">A picked origin is local and lasts until you select something else â save it to keep it.</p> <p class="text-[10px] italic text-gray-400">Snapping is per-device; the same steps drive the viewport menu.</p>`,1),iBe=V(`<p class="text-[10px] italic text-amber-400">Above 1.5x bodies travel further per step â turn Continuous collision on 2311 below, or fast objects can pass through thin walls.</p>`),qJ=V(`<!> <!> <!>`,1),aBe=V(`<p class="text-[10px] italic text-gray-400">No floor â objects fall until they hit something you placed, then the 2312 out-of-bounds rule below.</p>`),oBe=V(`<p class="text-xs text-gray-400">No objects have physics yet. Select an object and set its Physics mode to 2313 Dynamic (or wire a Mass node to an Object Selector in the node editor), 2314 then press â¶ / P to simulate.</p>`),sBe=V(`<button title="Click to select"><span class="truncate"> </span> <span> </span></button>`),cBe=V(`<div id="physics-objects" class="flex max-h-48 flex-col gap-0.5 overflow-y-auto"></div>`),JJ=V(`<!> <!> <!> <!>`,1),lBe=V(`<button id="physics-spawn-clear" class="ui-button-quiet text-xs svelte-1kmyk3f">Clear</button>`),uBe=V(`<p class="text-[10px] uppercase tracking-wide text-gray-500">World</p> <!> <!> <!> <div class="ui-row items-center gap-2"><button id="physics-gravity-reset" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f"> </button></div> <p class="text-[10px] italic text-gray-400">
2314Shared with everyone and applies to running simulations live.</p> <p class="mt-2 text-[10px] uppercase tracking-wide text-gray-500">Ground & bounds</p> <!> <!> <!> <div class="ui-row items-center gap-2"><span class="w-24 shrink-0 text-xs text-gray-300">Then</span> <!></div> <p class="mt-2 text-[10px] uppercase tracking-wide text-gray-500">Defaults (advanced)</p> <div class="ui-row items-center gap-2"><span class="w-24 shrink-0 text-xs text-gray-300">Material</span> <!></div> <p class="text-[10px] italic text-gray-400">Fills in friction and bounce for every object that does not set its own.</p> <!> <!> <!> <p class="text-[10px] italic text-gray-400">Costs a little speed; thrown objects turn it on for themselves either way.</p> <!> <button id="physics-enable-selection" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f">Enable physics on selection</button> <p class="text-[10px] italic text-gray-400">Dynamic objects fall and collide while a simulation runs (â¶ or P).</p> <p class="mt-2 text-[10px] uppercase tracking-wide text-gray-500" data-anchor="Knock">Knock</p> <!> <!> <p class="text-[10px] italic text-gray-400">An open VR hand, or walking into an object on desktop, sends it off at the speed it 2315 was hit. Grip still grabs. Shared, and it needs a running simulation.</p> <p class="mt-2 text-[10px] uppercase tracking-wide text-gray-500">Play mode</p> <div class="ui-row items-center gap-2"><span class="w-24 shrink-0 text-xs text-gray-300">Pointer</span> <!></div> <!> <!> <!> <!> <div class="ui-row items-center gap-2"><span class="w-24 shrink-0 text-xs text-gray-300">Spawn point</span> <span id="physics-spawn-readout" class="flex-1 text-xs text-gray-400"> </span></div> <div class="ui-row gap-2"><button id="physics-spawn-set" class="ui-button-quiet text-xs svelte-1kmyk3f" title="Play starts at the point the view orbits around, facing the way the camera looks at it">Set to the view's focus</button> <!></div> <p class="text-[10px] italic text-gray-400">Shared: everyone entering play mode in this scene gets these.</p>`,1),YJ=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),dBe=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper> <!> <!> <!>
2315`,1),fBe=V(`<div id="drawer-label" class="sticky top-0 z-10 -mx-4 rounded-tl-lg bg-gray-800 px-4"><!> <input id="inspector-search" type="search" class="ui-input mb-2 w-full" placeholder="Filter propertiesâ¦"/></div> <div class="flex flex-col gap-3"><!> <!> <!> <!> <!> <!> <!> <!> <!> <!></div>`,1),pBe=V(`<button type="button" class="ui-button self-start svelte-1kmyk3f"> </button>`),mBe=V(`<div id="drawer-label" class="sticky top-0 z-10 -mx-4 rounded-tl-lg bg-gray-800 px-4"><!></div> <div id="module-content-card" class="mt-2 flex flex-col gap-2 rounded-sm border border-gray-600/60 p-2 text-xs text-gray-300"><p class="text-sm font-semibold text-gray-100"> </p> <p>Made by the <strong> </strong> module â edit it with its toolbox or nodes.</p> <!></div>`,1),hBe=V(`<div id="selection-multi-banner" class="rounded-sm border border-primary-500/40 bg-primary-500/10 px-2 py-1.5"><p class="text-xs font-semibold text-primary-200"> </p> <p class="text-[10px] text-gray-400">Every value below applies to all of them.</p></div>`),gBe=V(`<div class="flex flex-col gap-1"><input id="name" type="text" class="ui-input w-full"/> <!> <p id="uuid" class="truncate px-1 text-[10px] text-gray-500"> </p> <div role="presentation"><!></div></div>`),_Be=V(`<div id="animation-controls"><!> <div class="flex items-center gap-2"><button class="rounded-sm bg-primary-700 px-2 py-0.5 text-sm text-white svelte-1kmyk3f"> </button> <span class="text-xs text-gray-400"> </span> <input type="range" class="flex-1 accent-primary-600" min="0.1" max="3" step="0.1"/></div> <p class="pt-1 text-[10px] italic text-gray-400">Clips run on the synced clock â peers see the same pose.</p></div>`),vBe=V(`<div class="ui-row items-center gap-1"><span class="w-20 shrink-0 text-xs text-gray-400">Kind</span> <!></div> <!> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Far</span> <div class="w-24 shrink-0"><!></div></div> <div class="ui-row items-center gap-1"><span class="w-20 shrink-0 text-xs text-gray-400">Framing</span> <!></div> <!> <div class="ui-row flex-wrap items-center gap-2"><button id="camera-preview" title="Render the scene through this camera (exit from the banner)"> </button> <button id="camera-from-view" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f" title="Move this camera to your current viewpoint (and take its FOV)">Set from view</button> <button id="camera-align-view" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f" title="Fly YOUR view to look through this camera (stays your camera)">Align view</button></div> <div class="ui-row items-center gap-2"><button id="camera-capture" class="ui-chip inline-flex items-center gap-1 bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f" title="Render one frame through this camera and download it as a PNG"><!>Capture</button> <span class="text-[10px] text-gray-500">saves a PNG at the framing aspect</span></div> <!> <!> <p class="text-[10px] italic text-gray-400">The camera itself is shared; previewing and the frustum lines are yours alone.</p>`,1),yBe=V(`<div class="mb-1 flex items-center justify-between gap-2"><span class="text-[10px] text-gray-400"> </span> <div class="flex items-center gap-1"><!> <!></div></div> <div class="mb-1 grid grid-cols-[3.2rem_1fr] items-center gap-1"><span class="text-[11px] text-gray-400">Pivot</span> <!></div>`,1),bBe=V(`<span class="text-[11px] text-gray-400">Rotation</span> <div id="inspector-rotation" class="grid grid-cols-3 gap-1"><!> <!> <!></div> <span class="text-[11px] text-gray-400">Scale</span> <div id="inspector-scale" class="grid grid-cols-3 gap-1"><!> <!> <!></div>
2315`,1),xBe=V(`<span class="self-center text-[10px] text-gray-500">A light with an origin orbits it under Rotate.</span>`),SBe=V(`<p class="mt-1 text-[10px] text-primary-200">Click a vertex â ctrl-click both ends of an edge to hinge on it â then press Set 2316 origin here.</p>`),CBe=V(`<div id="object-origin" class="mt-1 rounded-sm border border-gray-700/60 p-1.5"><div class="mb-1 flex items-center justify-between gap-2"><span class="text-[11px] text-gray-300"> </span> <div class="flex items-center gap-1"><!> <!></div></div> <div class="grid grid-cols-[3.2rem_1fr] items-center gap-1"><span class="text-[11px] text-gray-400">World</span> <div id="inspector-origin" class="grid grid-cols-3 gap-1"><!> <!> <!></div></div> <div class="mt-1 flex flex-wrap gap-1"><!> <!> <!> <!></div> <!> <p class="mt-1 text-[10px] text-gray-500"><!></p></div>`),wBe=V(`<!> <div class="grid grid-cols-[3.2rem_1fr] items-center gap-1"><span class="text-[11px] text-gray-400"> </span> <div id="inspector-position" class="grid grid-cols-3 gap-1"><!> <!> <!></div> <!></div> <!> <p class="text-[10px] text-gray-500"><!></p>`,1),TBe=V(`<div class="ui-row items-center gap-2"><span class="w-24 shrink-0 text-xs text-gray-400">Render order</span> <div class="w-20 shrink-0"><!></div></div> <!> <p class="text-[10px] text-gray-500">Higher render order draws later (over other objects). Disable culling for objects that vanish at screen edges.</p> <!>`,1),EBe=V(`<p id="device-multi-note" class="text-[10px] italic text-gray-400"> </p>`),DBe=V(`<p class="text-[10px] italic text-gray-400">This device has no settings.</p>`),OBe=V(`<div class="ui-row items-center gap-2"><span class="w-24 shrink-0 text-xs text-gray-400"> </span> <!></div>`),kBe=V(`<!> <p class="text-[10px] uppercase tracking-wide text-gray-500"> </p> <!> <!> <div class="ui-row items-center gap-2"><button id="device-open-toolbox" class="ui-button-quiet svelte-1kmyk3f">Open in Music toolbox</button></div> <p class="text-[10px] text-gray-500">Presets and the mixer live in the Music toolbox.</p>`,1),ABe=V(`<p id="geometry-mixed-note" class="rounded-sm bg-gray-700/50 px-2 py-1 text-[10px] text-gray-300"> </p>`),jBe=V(`<p id="geometry-locked" class="rounded-sm bg-yellow-900/40 px-2 py-1 text-[10px] text-yellow-200">Mesh edited â geometry parameters are locked (changing them would rebuild the shape and discard your edits).</p> <!>`,1),MBe=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400"> </span> <div class="flex flex-wrap gap-1"></div></div>`),NBe=V(`<div id="inspector-geometry" class="flex flex-col gap-1"></div>`),PBe=V(`<p class="px-1 text-[10px] uppercase tracking-wider text-gray-500"> </p> <!> <!>`,1),FBe=V(`<p class="px-1 text-xs text-gray-400"> </p>`),IBe=V(`<p class="ui-section-label">Ground color</p> <svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),LBe=V(`<div class="flex items-center justify-between gap-2"><p class="ui-section-label">Aim at</p> <!></div> <div id="inspector-light-aim" class="grid grid-cols-3 gap-1"></div> <p class="text-[10px] text-gray-500">Rotating the light (gizmo or the rotation rows) aims it too. Shadows follow. <!></p>`,1),RBe=V(`<p class="text-[10px] italic text-gray-400">Capped by Settings ⸠Shadow quality on this machine.</p>`),zBe=V(`<p class="ui-section-label">Shadow</p> <!> <div class="ui-row"><span class="w-20 shrink-0 text-xs text-gray-400">Map size</span> <!></div> <!> <!> <!>`,1),BBe=V(`<p class="text-[10px] italic text-gray-400">Rect area lights only affect Standard/Physical materials and cast no shadows.</p>`),VBe=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper> <!> <div class="grid grid-cols-[3.2rem_1fr] items-center gap-1"><span class="text-[11px] text-gray-400">Intensity</span> <div id="inspector-intensity"><!></div></div> <!> <!> <!> <!> <!>`,1),HBe=V(`<p id="material-multi-note" class="text-[10px] italic text-gray-400"> </p>`),UBe=V(`<button id="material-detach-shader" class="ui-button-quiet svelte-1kmyk3f" title="Remove the graph and put these objects back on their own material">Detach</button>
2316`),WBe=V(`<span class="shader-driven-text svelte-1kmyk3f">Inherited from the scene shader.</span>`),GBe=V(`<div id="material-shader-note" class="shader-driven svelte-1kmyk3f"><p class="shader-driven-text svelte-1kmyk3f"> </p> <div class="shader-driven-actions svelte-1kmyk3f"><button id="material-open-shader" class="ui-button-quiet svelte-1kmyk3f">Open in Shader editor</button> <!></div></div>`),KBe=V(`<div id="material-shared-note" class="shader-driven svelte-1kmyk3f"><p class="shader-driven-text svelte-1kmyk3f"> </p> <div class="shader-driven-actions svelte-1kmyk3f"><button id="material-unlink" class="ui-button-quiet svelte-1kmyk3f" title="Give this object its own copy of the material and stop sharing">Unlink</button></div></div>`),qBe=V(`<img alt="texture" class="h-10 w-10 cursor-pointer rounded-sm border border-gray-500 object-cover" role="presentation"/> <!>`,1),JBe=V(`<!> <span class="text-[10px] text-gray-500">or drop an Explorer image</span>`,1),YBe=V(`<p class="ui-section-label"> </p> <div id="texture-drop"><input type="file" id="texture-file" accept="image/png, image/jpeg, image/webp" style="display: none"/> <div class="flex items-center gap-3"><!></div></div>`,1),XBe=V(`<!> <!>`,1),ZBe=V(`<p class="text-[11px] italic text-gray-400">This material type derives its look from geometry â no color or surface parameters.</p>`),QBe=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Side</span> <!></div>`),$Be=V(`<p class="ui-section-label">Emission</p> <!> <div id="inspector-emissive" class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Color</span> <input type="color" id="emissive-color" aria-label="Emission colour" class="h-6 w-8 cursor-pointer rounded-sm border border-gray-500 bg-transparent"/> <span class="text-[10px] italic text-gray-400">black = no glow</span></div>`,1),eVe=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),tVe=V(`<!> <!> <!> <!> <!> <p class="ui-section-label">Shadow</p> <div class="flex gap-4 px-1"><!> <!></div>`,1),nVe=V(`<p id="physics-multi-note" class="text-[10px] italic text-gray-400"> </p>`),rVe=V(`<button id="physics-edit-collider" class="ui-chip bg-gray-600 text-gray-200 hover:bg-gray-500 svelte-1kmyk3f">Edit colliderâ¦</button>`),iVe=V(`<div id="physics-freeze-rot" class="ui-row items-center gap-2 text-xs text-gray-300"><span class="w-20 shrink-0 text-gray-400">Lock rotation</span> <!></div> <div id="physics-freeze-pos" class="ui-row items-center gap-2 text-xs text-gray-300"><span class="w-20 shrink-0 text-gray-400">Lock position</span> <!></div> <!>`,1),aVe=V(`<!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Body</span> <!></div> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Material</span> <!></div> <!> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Collider</span> <!></div> <!> <!> <!> <!> <!> <!> <p class="mt-1 text-xs text-gray-400">Dynamic bodies fall and collide when a simulation runs; flow Mass/Bounciness/Friction nodes override these.</p>`,1),oVe=V(`<div class="ui-row items-center gap-2"><span class="flex-1 text-[10px] text-yellow-200/80">Points have different radii â Thickness flattens them.</span> <!> <!></div>`),sVe=V(`<p class="px-1 text-[10px] uppercase tracking-wider text-gray-500"> </p> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Color</span> <input id="spline-color" type="color" class="h-6 w-8 cursor-pointer rounded-sm border border-gray-600 bg-transparent" aria-label="Spline color"/></div> <!> <!> <!> <!> <!> <!> <p class="text-[10px] text-gray-500">Per-point thickness lives on the handles â open the editor and drag the amber dot above a point.</p> <span class="px-1 text-[10px] uppercase tracking-wider text-gray-500">Flatten</span> <div class="flex flex-wrap gap-1"><!> <!></div> <p class="text-[10px] text-gray-500"><!></p>`,1),cVe=V(`<p id="particles-multi-note" class="text-[10px] text-gray-400"> </p>`),lVe=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Emitter</span> <!></div>`),uVe=V(`<p class="text-xs text-gray-400">Fires when a physics simulation lands this object on the ground or another object (needs a Dynamic body + a running sim).</p>`),dVe=V(`<!>Burst now`,1),fVe=V(`<div class="ui-row items-center gap-2"><!> <span class="text-xs text-gray-400">fires for every peer</span></div>`),pVe=V(`<!> <!> <!> <!> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">On landing</span> <!></div>`,1),mVe=V(`<div class="w-14 shrink-0"><!></div>`),hVe=V(`<div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Preset</span> <!></div> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Emission</span> <!></div> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400" title="Where particles spawn, relative to the object center (local axes)">Emit from</span> <!></div> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Color</span> <input type="color" aria-label="Particle start color" class="h-6 w-8 cursor-pointer rounded-sm border border-gray-500 bg-transparent"/> <span class="text-xs text-gray-400">â</span> <input type="color" aria-label="Particle end color" class="h-6 w-8 cursor-pointer rounded-sm border border-gray-500 bg-transparent"/></div> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Sprite</span> <!></div> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Blending</span> <!></div> <div class="ui-row items-center gap-2"><span class="w-20 shrink-0 text-xs text-gray-400">Space</span> <!></div> <div class="ui-row items-center gap-2"><!></div>
2316`,1),gVe=V(`<div id="drawer-label" class="sticky top-0 z-10 -mx-4 rounded-tl-lg bg-gray-800 px-4"><!> <input id="inspector-search" type="search" class="ui-input mb-2 w-full" placeholder="Filter propertiesâ¦"/></div> <div class="flex flex-col gap-3"><!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!></div>`,1),_Ve=V(`<div id="inspector"><div class="ins-resize" title="Drag to resize"><span class="ins-grabber"></span></div> <!></div>`);function vVe(e,n){Ce(n,!0);let i=()=>z(hc,`$snapTargets`,et),a=()=>z(kd,`$bottomInset`,et),o=()=>z(Ho,`$inspectorClose`,et),s=()=>z(Ui,`$objectsGroup`,et),c=()=>z(Dc,`$flowGraphs`,et),l=()=>z(Di,`$selectedObject`,et),d=()=>z(ete,`$scenePhysicsDefaults`,et),p=()=>z(Kr,`$selectedObjects`,et),m=()=>z(ml,`$moduleSelection`,et),h=()=>z(wl,`$moduleToolboxes`,et),y=()=>z(gie,`$pivotPose`,et),x=()=>z(bP,`$lightHelperLength`,et),S=()=>z(BJ,`$lightAimPicking`,et),C=()=>z(mm,`$editingObject`,et),w=()=>z(ms,`$inspectorKind`,et),T=()=>z(Fa,`$explorerItems`,et),E=()=>z(Ya,`$inspectedFile`,et),k=()=>z(Ka,`$explorerFolders`,et),ee=()=>z(Es,`$peers`,et),te=()=>z(Zf,`$pivotOnly`,et),ne=()=>z(cv,`$environment`,et),P=()=>z(Ai,`$backgroundColor`,et),re=()=>z(yi,`$globalCamera`,et),ie=()=>z(Ki,`$orbitControls`,et),F=()=>z(Vo,`$inspectorPinned`,et),ae=()=>z(us,`$inspectorFilter`,et),oe=()=>z(ode,`$envPresets`,et),R=()=>z(Xue,`$peerEnvPresets`,et),se=()=>z(Cde,`$music`,et),ce=()=>z(Tde,`$musicBlocked`,et),le=()=>z(vv,`$musicLocalVolume`,et),de=()=>z(gv,`$musicMuted`,et),V=()=>z(Ty,`$scenePost`,et),he=()=>z(ii,`$viewMode`,et),ge=()=>z(mc,`$viewportOverrides`,et),U=()=>z(yP,`$showLightHelpers`,et),_e=()=>z(BP,`$showColliders`,et),ve=()=>z(ry,`$shaderGraphs`,et),ye=()=>z(Fse,`$cameraNear`,et),be=()=>z(Nse,`$cameraFar`,et),xe=()=>z(Mse,`$orbitPrefs`,et),we=()=>z(zh,`$bookmarks`,et),J=()=>z(ni,`$showGrid`,et),De=()=>z(tL,`$gridSettings`,et),Oe=()=>z(_c,`$snapSettings`,et),Ae=()=>z(gc,`$snapEnabled`,et),je=()=>z(vc,`$surfaceSnap`,et),Pe=()=>z(lN,`$snapAnchor`,et),Fe=()=>z(uN,`$snapAnchorPicking`,et),Le=()=>z(Yee,`$sceneGravity`,et),Re=()=>z(gl,`$scenePhysicsGround`,et),ze=()=>z(Qee,`$scenePhysicsBounds`,et),He=()=>z(hl,`$sceneKnock`,et),Ue=()=>z(Xee,`$scenePlay`,et),We=()=>z(Cg,`$animatedObjects`,et),Ge=()=>z(px,`$cameraPreview`,et),Ke=()=>z(sx,`$showCameraFrustums`,et),qe=()=>z(Jf,`$pivotMode`,et),Je=()=>z(um,`$vertexSelectionSize`,et),Ye=()=>z(VP,`$colliderVizObjects`,et),Xe=()=>z(nM,`$splineEditObject`,et),$e=()=>z(Fj,`$flattenPicking`,et),[et,tt]=Ve(),rt=[[`vertex`,`Vertex`],[`edge`,`Edge`],[`face`,`Face`],[`surface`,`Surface`],[`object`,`Object`]],it=(e,t)=>!!e[t],at=q(()=>rt.filter(e=>it(i(),e[0])).length),ot=e=>hc.update(t=>({...t,[e]:!it(t,e)})),st=(e,t)=>{let n=Object.keys(e??{}).filter(e=>!e.startsWith(`post:`)),r=n.includes(uy),i=n.filter(e=>e!==uy).length,a=Ufe();return n.length?(r?`A scene default`:`No scene default`)+(i?` and `+i+` object`+(i===1?``:`s`)+` with their own`:``)+` â driving `+a+` object`+(a===1?``:`s`)+`, `+n.length+` program`+(n.length===1?``:`s`)+`.`:`No shader materials. The scene uses each objectâs own material.`},ct=Math.PI/12,lt=[{label:`Wide`,mm:24,fov:53},{label:`Classic`,mm:35,fov:38},{label:`Natural`,mm:50,fov:27},{label:`Portrait`,mm:85,fov:16}],ut={x:320,duration:200,easing:$a},dt=t(!1);Qe(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(pointer: coarse), (max-width: 820px)`);I(dt,e.matches,!0);let t=()=>I(dt,e.matches,!0);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)});let ft=q(()=>a()>0||Q(dt)),pt=t(!1);Qe(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: 640px)`);I(pt,e.matches,!0);let t=()=>I(pt,e.matches,!0);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}),Qe(()=>{!o()&&Q(pt)&&Gs.set(!1)});let mt=q(()=>Q(pt)?{y:500,duration:240,easing:$a}:ut),ht=t(0);Qe(()=>{if(Q(ht)||typeof window>`u`)return;let e=parseInt(nt.getItem(`inspectorSheetH`)||``);I(ht,!e||Number.isNaN(e)?Math.round(window.innerHeight*.45):e,!0)});let gt=t(!1);function _t(e){I(gt,!0),e.currentTarget.setPointerCapture?.(e.pointerId),e.preventDefault()}function vt(e){if(!Q(gt))return;let t=parseFloat(getComputedStyle(document.documentElement).getPropertyValue(`--connect-bottom`))||54,n=Math.max(200,window.innerHeight-t-56);I(ht,Math.min(Math.max(160,window.innerHeight-e.clientY),n),!0)}function yt(e){if(Q(gt)){I(gt,!1),e.currentTarget.releasePointerCapture?.(e.pointerId);try{nt.setItem(`inspectorSheetH`,String(Q(ht)))}catch{}}}let bt=q(()=>(s(),c(),l(),ch())),xt=sh,St=q(()=>{let e=d().material;return e.friction==null&&e.restitution==null?``:Object.keys(xt).find(t=>xt[t].friction===e.friction&&xt[t].restitution===e.restitution)??`custom`}),Ct=q(()=>{s();let e=p()??[],t=s();return(e.length>1&&t?e.map(e=>
2316t.getObjectByProperty(`uuid`,e)).filter(Boolean):l()?.uuid?[l()]:[]).filter(e=>gf(e))}),wt=q(()=>Q(Ct).length>1?Q(Ct).length:0),Tt=q(()=>Q(Ct).filter(e=>e?.material&&!Array.isArray(e.material))),Et=q(()=>Q(Tt).length>1?Q(Tt).length:0),Dt=t(0),Ot=q(()=>Q(Ct).filter(e=>xv(e))),kt=q(()=>Q(Ot).find(e=>e?.uuid===l()?.uuid)??Q(Ot)[0]??null),At=q(()=>Q(kt)?Sv(Q(kt).userData.device.kind)?.params??[]:[]);function jt(e){return Q(Ot).filter(t=>(Sv(t.userData?.device?.kind)?.params??[]).some(t=>t?.key===e))}function Mt(e){return s(),Q(Dt),Q(kt)?bv(Q(kt))?.params?.[e]:void 0}function Nt(e){s(),Q(Dt);let t=jt(e);if(t.length<2)return!1;let n=bv(t[0])?.params?.[e];return t.some(t=>bv(t)?.params?.[e]!==n)}function Pt(e,t,n){let r=Number(e?.step)||0;if(!(r>0))return n;let i=Math.round(n/r)*r;return i===t&&n!==t&&(i=t+Math.sign(n-t)*r),Number.isFinite(e.min)&&(i=Math.max(e.min,i)),Number.isFinite(e.max)&&(i=Math.min(e.max,i)),Number(i.toFixed(6))}function Ft(e,t,n=null){Xt(jt(e),`Device`,r=>Cv(r.uuid,{params:{[e]:t}},n?{before:n[r.uuid]}:void 0)),pe(Dt)}let It=null;function Lt(e){let t={};for(let n of jt(e))t[n.uuid]=bv(n);It={key:e,befores:t,last:void 0,lastSent:0}}function Rt(e,t){let n=e.key,r=Pt(e,Number(Mt(n)??e.default??0),t),i=It;if(i&&i.key===n){i.last=r;let e=performance.now(),t=e-i.lastSent>=66;t&&(i.lastSent=e);for(let e of jt(n))wv(e.uuid,{[n]:r},{broadcast:t});pe(Dt);return}
2316(r!==Number(Mt(n)??e.default??0)||Nt(n))&&Ft(n,r)}function Bt(e){let t=It;It=null,t&&t.key===e&&t.last!==void 0&&Ft(e,t.last,t.befores)}function Vt(){Q(kt)&&SJ.set(Q(kt).uuid),Tl(xJ)}let Ht=(e,t)=>e?Yae(e):[],Ut=q(()=>Q(Tt).length===1?Ht(l()?.uuid,s()):[]);function Wt(){let e=l()?.uuid;if(!e)return;let t=Q(Ut).length;Jae(e)&&es(`This object has its own material now â the other `+t+(t===1?` object keeps`:` objects keep`)+` the shared one`)}let Gt=q(()=>(s(),Q(Tt).filter(e=>oy(e.uuid)))),Kt=q(()=>(s(),Q(Tt).filter(e=>!oy(e.uuid)))),qt=q(()=>Q(Tt).length>0&&Q(Kt).length===0),Jt=q(()=>(s(),Q(Gt).filter(e=>!!ay(e.uuid))));function Yt(){let e=Q(Jt);if(e.length){for(let t of e)dy(t.uuid,null),ly(t);ci(),es(e.length===1?`Shader removed from this object`:`Shader removed from `+e.length+` objects`)}}function Xt(e,t,n){if(e.length){if(e.length===1){n(e[0]),Zt(e);return}Lf();try{for(let t of e)n(t)}finally{kf(`${t} (${e.length})`)}Zt(e)}}function Zt(e){for(let t of e??[])t?.uuid&&o_(t.uuid,e_(t.uuid))}let Qt=q(()=>m()?h().find(e=>e.moduleId===m().moduleId)??null:null),$t=q(()=>(l(),s(),Q(Ct).length>0&&Q(Ct).every(e=>e?.userData?.pick===`through`)));function en(e,t){Xt(Q(Ct),e,t)}function tn(e,t){let n=Q(Tt).length-Q(Kt).length;Xt(Q(Kt),e,t),n&&es(n+(n===1?` object was`:` objects were`)+` skipped â a shader graph drives its material. Detach it, or edit the graph.`)}function nn(e,t){let n=t??Q(Ct);if(n.length<2)return!1;let r=e(n[0]);return n.some(t=>e(t)!==r)}let rn=e=>nn(e,Q(Tt)),an=q(()=>!Q(wt)&&l()?.uuid?l():null),on=q(()=>(s(),l(),y(),Q(an)?Vf(Q(an)).toArray():[0,0,0])),sn=q(()=>(s(),!!(Q(an)&&$re(Q(an)))));function cn(e,t){if(!Q(an))return;let n=Q(on).slice();n[`xyz`.indexOf(e)]=t,Bf(Q(an).uuid,new hn().fromArray(n)),Yf(),Di.update(e=>e)}function ln(e){if(Q(an)){if(zf(Q(an).uuid,e)===null){es(`Nothing to measure for that preset â use World 0 or type the origin`);return}Yf(),Di.update(e=>e)}}let un=q(()=>!!(l()?.isDirectionalLight||l()?.isSpotLight)),dn=q(()=>{s();let e=l();if(!e?.isDirectionalLight&&!e?.isSpotLight)return[0,0,0];e.updateMatrixWorld?.(!0);let t=new hn;e.getWorldPosition(t);let n=new zt;e.getWorldQuaternion(n);let r=new hn(0,0,-1).applyQuaternion(n).multiplyScalar(x());return t.add(r).toArray().map(e=>Math.round(e*1e3)/1e3)});function fn(e){let t=l();t&&(Xn(),gde(t,e)&&(Kn(t),Di.update(e=>e),Zt([t])))}function pn(e,t){let n=Q(dn).slice();n[e]=t,fn(n)}function mn(){let e=l();if(e){if(S()===e.uuid){WJ();return}wze(e.uuid,e=>fn(e.toArray()))}}Qe(()=>{let e=S();e&&e!==l()?.uuid&&WJ()});function gn(){Q(an)&&(Hf(Q(an).uuid),Zf.set(!1),Yf(),Di.update(e=>e))}let _n=q(()=>!!Q(an)&&C()===Q(an).uuid);function vn(){Q(an)&&(gm(Q(an).uuid),es(`Click a vertex (ctrl-click for several, e.g. both ends of a hinge edge), then press Set origin here`))}function yn(){if(!Q(an))return;let e=Pae();if(!e){es(`Click a vertex first â ctrl-click both ends of an edge to hinge on it`);return}Bf(Q(an).uuid,e),Yf(),Di.update(e=>e),es(`Origin set from the mesh â Spin and hinges now turn about it`)}let bn=q(()=>l()?.type?.endsWith?.(`Light`)??!1),xn=q(()=>(s(),l()?T_(l()):null));Qe(()=>{Q(xn)&&$(()=>import(`../chunks/CKkrQfIm.js`),[],import.meta.url).catch(()=>{})});let Sn=q(()=>{if(!Q(xn)?.points.length)return null;let e=Q(xn).points[0].radius;return Q(xn).points.every(t=>Math.abs(t.radius-e)<1e-6)?e:null}),Cn=q(()=>l()?.type===`Group`),wn=t(0),Tn=q(()=>(Q(wn),!Q(bn)&&!Q(Cn)&&l()?Gf(l()):null)),En=q(()=>Q(Tn)?pie(Q(Tn).gtype):null),Dn=q(()=>(s(),Q(wn),!!(l()?.userData?.vertexEdited||l()?.userData?.faceEdited))),On=q(()=>(s(),Q(wn),Q(Tn)?Q(Ct).filter(e=>e.userData?.vertexEdited||e.userData?.faceEdited?!1:Gf(e)?.gtype===Q(Tn).gtype):[])),kn=q(()=>{if(s(),!Q(Tn)||Q(Ct).length<2)return[];let e=Q(Ct).filter(e=>!Q(On).includes(e)).map(e=>Gf(e)?.gtype??e.type);return[...new Set(e)]});function An(e,t){if(Q(On).length<2)return!1;let n=n=>Gf(n)?.params?.[e]??t,r=n(Q(On)[0]);return Q(On).some(e=>n(e)!==r)}function jn(e,t){let n=()=>{Xt(Q(On).length?Q(On):[l()],`Geometry`,n=>Kf(n.uuid,{[e]:t})),pe(wn)};if(l().userData?.vertexEdited){es(`This mesh has vertex edits â rebuilding the geometry discards them.`,[{label:`Rebuild`,action:n},{label:`Keep edits`,action:()=>pe(wn)}]);return}n()}function Mn(){let e=l()?.uuid,t=Q(Tn)?.params;e&&t&&es(`Rebuild this terrain from its parameters? The sculpted shape is discarded.`,[{label:`Rebuild`,action:()=>{Kf(e,{...t}),pe(wn)}},{label:`Keep sculpt`,action:()=>{}}])}let Nn=q(()=>{s();let e=!Q(bn)&&!Q(Cn)&&l()?.material&&!Array.isArray(l().material)?l().material:null;return e?{ref:e,type:e.type,color:e.color,map:e.map,userData:e.userData,roughness:e.roughness,metalness:e.metalness,clearcoat:e.clearcoat,clearcoatRoughness:e.clearcoatRoughness,transmission:e.transmission,ior:e.ior,shininess:e.shininess,opacity:e.opacity,wireframe:e.wireframe,flatShading:e.flatShading,side:e.side,emissive:e.emissive,emissiveIntensity:e.emissiveIntensity}:null}
2316),Pn=[{value:`MeshBasicMaterial`,name:`Basic`},{value:`MeshStandardMaterial`,name:`Standard`},{value:`MeshPhysicalMaterial`,name:`Physical`},{value:`MeshPhongMaterial`,name:`Phong`},{value:`MeshLambertMaterial`,name:`Lambert`},{value:`MeshToonMaterial`,name:`Toon`},{value:`MeshMatcapMaterial`,name:`Matcap`},{value:`MeshNormalMaterial`,name:`Normal`},{value:`MeshDepthMaterial`,name:`Depth`},{value:`ShadowMaterial`,name:`Shadow`}],Fn=t(!1),In=q(()=>w()===`file`?T().find(e=>e.id===E())??null:null),Ln=q(()=>{if(!Q(In))return``;let e=[],t=Q(In).folderId??null;for(;t;){let n=k().find(e=>e.id===t);if(!n)break;e.unshift(n.name),t=n.parentId??null}return`Library`+(e.length?` / `+e.join(` / `):``)}),Rn=t(``);Qe(()=>{let e=Q(In);I(Rn,``),e&&Ja(e.id).then(async t=>{if(t&&Q(In)?.id===e.id)try{if(e.kind===`image`){let e=await createImageBitmap(t);I(Rn,e.width+` à `+e.height+` px`)}else if(e.kind===`text`)I(Rn,(await t.text()).split(` 2317`).length+` lines`);else if(e.kind===`audio`){let e=await ql(t);I(Rn,e.duration.toFixed(2)+` s · `+e.channels+` ch`)}}catch{}})});async function zn(){let e=Q(In);if(!e)return;let t=await Ja(e.id);t&&(e.kind===`text`?oJ({title:e.name,code:await t.text(),onSave:t=>Ta(e.id,t)}):e.kind===`image`&&pJ({title:e.name,url:URL.createObjectURL(t)}))}let Bn=t(`#ffffff`),Vn=t(`#ffffff`);Qe(()=>{let e=l();e&&(e.material?.color&&!Array.isArray(e.material)?I(Bn,`#`+e.material.color.getHexString()):e.color?.getHexString&&I(Bn,`#`+e.color.getHexString()),e.groundColor?.getHexString&&I(Vn,`#`+e.groundColor.getHexString()))});function Hn(e,t){let n=e=>typeof e==`string`?e.trim().toLowerCase().replace(/^#/,``).slice(0,6):``,r=n(e);return!!r&&r===n(t)}let Un=null,Wn;function Gn(e){if(Un==null){Un=new Map;for(let e of Q(Tt))Un.set(e.uuid,`#`+e.material.color.getHexString())}clearTimeout(Wn),Wn=setTimeout(()=>{let t=Un;if(Un=null,t?.size){if(t.size===1){let[n,r]=[...t][0];Bv(n,`color`,null,r,e);return}Lf();try{for(let[n,r]of t)Bv(n,`color`,null,r,e)}finally{kf(`Colour (${t.size})`)}}},600)}function Kn(e){e?.uuid&&ee().send({type:`move`,uuid:e.uuid,pos:e.position.toArray(),rot:e.rotation.toArray(),scale:e.scale.toArray()})}let qn=e=>({pos:e.position.toArray(),rot:[e.rotation.x,e.rotation.y,e.rotation.z],scale:e.scale.toArray()}),Jn=null,Yn;function Xn(){if(Jn==null){Jn=new Map;for(let e of Q(Ct))Jn.set(e.uuid,qn(e))}clearTimeout(Yn),Yn=setTimeout(()=>{let e=Jn;if(Jn=null,!e?.size)return;let t=[];for(let[n,r]of e){let e=s()?.getObjectByProperty(`uuid`,n);if(!e)continue;let i=qn(e),a=(e,t)=>e.every((e,n)=>e===t[n]);a(r.pos,i.pos)&&a(r.rot,i.rot)&&a(r.scale,i.scale)||t.push({uuid:n,before:r,after:i})}Qre(t),t.length>1?bie(t.map(e=>e.uuid),!0):t.length===1&&Q(an)&&Q(sn)&&Yf()},500)}function Zn(e,t,n){if(Q(wt)){if(te()){if(e!==`position`)return;let r=(y()?.pos??[0,0,0]).slice();r[`xyz`.indexOf(t)]=n,xie(r);return}Xn(),$f(r=>{r[e][t]=n}),Di.update(e=>e);return}if(e!==`position`&&Q(an)&&Q(sn)){Xn();let r=Number(l()[e][t])||0;if($f(i=>{e===`rotation`?i.rotation[t]+=n-r:i.scale[t]*=r?n/r:1})){Di.update(e=>e),Zt([l()]);return}}Xn(),me(Di,K(l)[e][t]=n,K(l)),Kn(l()),Di.update(e=>e),Zt([l()])}function Qn(){ee().send({type:`object`,element:l().toJSON(),override:!0})}function $n(e){let t=l()[e];en(e,n=>{n!==l()&&(n[e]=t),ee().send({type:`objectParameters`,parameter:e,uuid:n.uuid,[e]:n[e]})})}function er(){let e=l().castShadow;en(`Cast shadow`,t=>{t.castShadow=e,t.userData.shadow=e?void 0:!1}),$n(`castShadow`)}function tr(e){en(`Particles`,t=>dse(t.uuid,e))}function nr(e){en(`Physics`,t=>eh(t.uuid,e)),Di.update(e=>e)}function rr(e,t){tn(e,n=>zv(n.uuid,e,t))}async function ir(e,t){let n=Q(Tt);if(n.length){if(n.length===1)await e(n[0].uuid);else{Lf();try{for(let t of n)await e(t.uuid)}finally{kf(`${t} (${n.length})`)}}Di.update(e=>e),ci()}}async function ar(e){let t=Q(Tt).map(e=>e.uuid);if(t.length){t.length>1&&Lf();try{await xfe(t,e)}finally{t.length>1&&kf(`Texture (${t.length})`)}Di.update(e=>e),ci()}}function or(e){let t=e?.restitution??.3,n=e?.friction??.5,r=Object.entries(sh).find(([,e])=>Math.abs(e.restitution-t)<.001&&Math.abs(e.friction-n)<.001);return r?r[0]:`custom`}function sr(e,t){let n={...l().userData.physics?.freeze??{}};t?n[e]=!0:delete n[e],nr({freeze:Object.keys(n).length?n:null})}function cr(){ci(),ee().send({type:`name`,name:l().name,uuid:l().uuid})}function lr(e,t){me(Di,K(l)[e]=t,K(l)),Di.update(e=>e),$n(e)}let ur=t(Ne([{value:`none`,name:`None`}])),dr=t(!1);function fr(){I(ur,l().parent.children.map(e=>e.type===`Group`?{name:e.name,value:e.uuid}
2317:null).filter(Boolean),!0),l().parent.parent.parent!==null&&Q(ur).push({name:`Level Up`,value:l().parent.parent.uuid}),I(ur,Q(ur).filter(e=>e.value!==l().uuid),!0)}function pr(e){return e.children.reduce((e,t)=>e+1+pr(t),0)}let mr=q(()=>dde(ne())),hr=q(()=>Q(mr)?.fog??null),gr=q(()=>!!l()?.isLight&&!!s()?.getObjectByProperty?.(`uuid`,l().uuid));function _r(){let e=prompt(`Preset name`,ne().customPreset?.label??`My preset`);e&&Zue(e)}function vr(){let e=ide(ne().customPreset?.label??Q(mr).label??`environment`),t=new Blob([fde(e)],{type:`application/json`}),n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=String(e.label).replace(/[^\w-]+/g,`_`)+`.envpreset.json`,n.click(),URL.revokeObjectURL(n.href)}async function yr(e){let t=e.target.files?.[0];if(t){try{await $ue(await t.text())}catch{es(`That file is not an environment preset`)}e.target.value=``}}function br(e){Hn(e,P())||(Ai.set(e),sv({background:e}))}function xr(){let e=Math.max(kse(),2),t=re(),n=(t?.fov??40)*Math.PI/180,r=e/Math.sin(n/2)*1.1,i=t?new hn().subVectors(t.position,new hn(0,0,0)).normalize():new hn(-1,1,1).normalize();i.lengthSq()||i.set(-1,1,1).normalize(),xm(i.multiplyScalar(r).toArray(),[0,0,0])}function Sr(){let e=re(),t=ie()?.target;if(!e||!t)return;let n=Math.atan2(-(t.x-e.position.x),-(t.z-e.position.z)),r=e=>Math.round(e*100)/100;vl({play:{spawn:{position:[r(t.x),r(t.y),r(t.z)],yaw:Math.round(n*1e3)/1e3}}})}function Cr(e){if(!e)return`Default â (0, 2, 3), facing âZ`;let t=Math.round((e.yaw*180/Math.PI%360+360)%360);return`(`+e.position.map(e=>e.toFixed(1)).join(`, `)+`), facing `+t+`°`}let wr=`shrink-0 rounded-sm bg-gray-700 px-1.5 py-0.5 text-xs text-gray-300 hover:bg-gray-600 disabled:opacity-40`;function Tr(){xm([-10,10,10],[0,1.5,0])}function Er(e,t){return!!(e?.uuid&&e.userData?.packStub&&e.userData?.packRef&&!e.children?.length)}var Dr=fe(),Or=N(Dr),kr=e=>{var t=_Ve(),n=j(t),a=g(n,2),o=e=>{var t=Pze(),n=N(t),r=j(n);{let e=q(()=>Q(In)?.name??`File`);pq(r,{get title(){return Q(e)},badge:`File`,onclose:()=>Ho.set(!0)})}H(n);var i=g(n,2),a=e=>{var t=Mze(),n=j(t),r=j(n),i=e=>{var t=Tze();O(()=>{b(t,`src`,Q(In).thumbnail),b(t,`alt`,Q(In).name)}),X(e,t)},a=e=>{var t=Eze(),n=j(t);{let e=q(()=>Q(In).kind===`audio`?`music`:Q(In).kind===`text`?`file-text`:`package`),t=q(()=>Q(In).kind===`audio`?`ico-audio`:Q(In).kind===`text`?`ico-doc`:``);wS(n,{get name(){return Q(e)},size:36,get class(){return Q(t)}})}H(t),X(e,t)};G(r,e=>{Q(In).thumbnail?e(i):e(a,-1)}),H(n);var o=g(n,2);mq(o,{label:`File`,children:(e,t)=>{var n=Oze(),r=N(n),i=g(j(r),2);v(i),H(r);var a=g(r,2),o=g(j(a)),s=f(o,!0);H(a);var c=g(a,2),l=g(j(c)),d=f(l);H(c);var p=g(c,2),m=g(j(p)),h=f(m,!0);H(p);var _=g(p,2),y=g(j(_)),x=f(y,!0);H(_);var S=g(_,2),C=g(j(S),2),w=f(C),T=g(C,2);H(S);var E=g(S,2),D=e=>{var t=Dze(),n=g(j(t)),r=f(n,!0);H(t),O(()=>Y(r,Q(Rn))),X(e,t)};G(E,e=>{Q(Rn)&&e(D)}),O((e,t,n)=>{u(i,Q(In).name),Y(s,Q(In).kind),Y(d,`${e??``} KB`),Y(h,Q(Ln)),Y(x,t),b(C,`title`,Q(In).hash),Y(w,`${n??``}â¦`)},[()=>(Q(In).size/1024).toFixed(1),()=>new Date(Q(In).createdAt).toLocaleString(),()=>Q(In).hash.slice(0,16)]),L(`change`,i,e=>Ea(Q(In).id,e.currentTarget.value)),L(`click`,T,()=>navigator.clipboard?.writeText(Q(In).hash)),X(e,n)},$$slots:{default:!0}}),mq(g(o,2),{label:`Actions`,children:(e,t)=>{var n=jze(),r=j(n),i=e=>{Do(e,{size:`xs`,color:`alternative`,onclick:()=>zn(),children:(e,t)=>{var n=kze(),r=N(n),i=e=>{wz(e,{size:14,class:`mr-1`,"aria-hidden":`true`})},a=e=>{vge(e,{size:14,class:`mr-1`,"aria-hidden":`true`})};G(r,e=>{Q(In).kind===`text`?e(i):e(a,-1)});var o=g(r,1,!0);O(()=>Y(o,Q(In).kind===`text`?`Edit`:`Preview`)),X(e,n)},$$slots:{default:!0}})};G(r,e=>{(Q(In).kind===`text`||Q(In).kind===`image`)&&e(i)});var a=g(r,2);Do(a,{size:`xs`,color:`alternative`,onclick:()=>{Ga(Q(In).id),Ho.set(!0)},children:(e,t)=>{var n=Aze(),r=N(n);SS(r,{size:16,class:`ico-danger mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}}),H(n),X(e,n)},$$slots:{default:!0}}),H(t),X(e,t)},o=e=>{var t=Nze();X(e,t)};G(i,e=>{Q(In)?e(a):e(o,-1)}),X(e,t)},c=e=>{var t=fBe(),n=N(t),a=j(n);
2317pq(a,{title:`Scene`,badge:`Scene`,get pinned(){return F()},onpin:()=>Vo.update(e=>!e),onclose:()=>Ho.set(!0)});var o=g(a,2);v(o),H(n);var c=g(n,2),p=j(c);mq(p,{label:`Environment`,children:(e,t)=>{var n=Uze(),i=N(n),a=j(i);B(a,17,()=>Object.entries(ude),Be,(e,t)=>{var n=q(()=>A(Q(t),2));let i=()=>Q(n)[0],a=()=>Q(n)[1];var o=GJ(),s=f(o,!0);O(()=>{r(o,1,`ui-chip `+(ne().preset===i()?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),Y(s,a().label)}),L(`click`,o,()=>av(i())),X(e,o)});var o=g(a,2),s=e=>{var t=GJ(),n=f(t,!0);O(()=>{r(t,1,`ui-chip `+(ne().preset===`custom`?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),Y(n,ne().customPreset.label??`Custom`)}),L(`click`,t,()=>lv(ne().customPreset)),X(e,t)};G(o,e=>{ne().customPreset&&e(s)}),H(i);var c=g(i,2);xq(c,{label:`Exposure`,min:.4,max:2,step:.05,get value(){return ne().exposure},onchange:e=>av(ne().preset,e)});var d=g(c,2),p=e=>{var t=Ize(),n=g(N(t),2);B(n,5,oe,e=>e.name,(e,t)=>{var n=Fze(),r=j(n),i=f(r,!0),a=g(r,2);H(n),O(()=>Y(i,Q(t).name)),L(`click`,r,()=>lv(Q(t).payload)),L(`click`,a,()=>pv(Q(t).name)),X(e,n)}),H(n),X(e,t)};G(d,e=>{oe().length&&e(p)});var m=g(d,2);B(m,1,()=>Object.entries(R()).filter(([,e])=>e.length),([e,t])=>e,(e,t)=>{var n=q(()=>A(Q(t),2));let r=()=>Q(n)[0],i=()=>Q(n)[1];var a=Rze(),o=N(a),s=f(o),c=g(o,2);B(c,21,i,e=>e.name,(e,t)=>{var n=Lze(),r=f(n,!0);O(()=>Y(r,Q(t).name)),L(`click`,n,()=>lv(Q(t).payload)),X(e,n)}),H(c),O(e=>Y(s,`${e??``}'s presets`),[()=>hh(r())]),X(e,a)});var h=g(m,2),_=j(h),y=j(_);dS(y,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),H(_);var x=g(_,2),S=j(x);iS(S,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),H(x);var C=g(x,2),w=j(C);pS(w,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),H(C);var T=g(C,2);H(h);var E=g(h,4),D=e=>{var t=zze(),n=N(t);xq(n,{label:`Sky light`,min:0,max:4,step:.05,get value(){return Q(mr).hemi.intensity},onchange:e=>dv(`hemi`,{intensity:e})});var r=g(n,2),i=g(j(r),2);v(i);var a=g(i,2);v(a),H(r),O(()=>{u(i,Q(mr).hemi.sky),u(a,Q(mr).hemi.ground)}),L(`change`,i,e=>dv(`hemi`,{sky:e.currentTarget.value})),L(`change`,a,e=>dv(`hemi`,{ground:e.currentTarget.value})),X(e,t)};G(E,e=>{Q(mr).hemi&&e(D)});var k=g(E,2),ee=e=>{var t=Bze(),n=N(t);xq(n,{label:`Sun`,min:0,max:4,step:.05,get value(){return Q(mr).sun.intensity},onchange:e=>dv(`sun`,{intensity:e})});var r=g(n,2),i=g(j(r),2);v(i),H(r),O(()=>u(i,Q(mr).sun.color)),L(`change`,i,e=>dv(`sun`,{color:e.currentTarget.value})),X(e,t)};G(k,e=>{Q(mr).sun&&e(ee)});var M=g(k,2);B(M,1,()=>ne().lights??[],e=>e.id,(e,t)=>{var n=Hze(),r=j(n),i=j(r),a=f(i,!0),o=g(i,2);v(o);var s=g(o,2),c=e=>{var n=Vze();v(n),O(()=>u(n,Q(t).groundColor)),L(`change`,n,e=>uv(Q(t).id,{groundColor:e.currentTarget.value})),X(e,n)};G(s,e=>{Q(t).kind===`hemisphere`&&e(c)});var l=g(s,4),d=g(l,2);H(r),xq(g(r,2),{label:`Intensity`,min:0,max:4,step:.05,get value(){return Q(t).intensity},onchange:e=>uv(Q(t).id,{intensity:e})}),H(n),O(()=>{Y(a,Q(t).kind),u(o,Q(t).color)}),L(`change`,o,e=>uv(Q(t).id,{color:e.currentTarget.value})),L(`click`,l,()=>nde(Q(t).id)),L(`click`,d,()=>Que(Q(t).id)),X(e,n)});var te=g(M,2),P=j(te),re=g(P,2),ie=g(re,2);H(te);var F=g(te,2);W(2),O(()=>{F.disabled=!Q(gr),b(F,`title`,Q(gr)?`Move the selected light out of the scene objects into the environment`:`Select a scene light first`)}),L(`click`,_,_r),L(`click`,x,vr),L(`click`,C,()=>document.getElementById(`env-import-file`)?.click()),L(`change`,T,yr),L(`click`,P,()=>fv(`hemisphere`)),L(`click`,re,()=>fv(`directional`)),L(`click`,ie,()=>fv(`point`)),L(`click`,F,()=>ade(l().uuid)),X(e,n)},$$slots:{default:!0}});var m=g(p,2);mq(m,{label:`Music`,children:(e,t)=>{var n=Gze(),i=g(N(n),2),a=j(i);a.value=a.__value=``;var o=g(a);B(o,1,()=>T().filter(e=>e.kind===`audio`),e=>e.id,(e,t)=>{var n=KJ(),r=f(n,!0),i={};O(()=>{Y(r,Q(t).name),i!==(i=Q(t).hash)&&(n.value=(n.__value=i)??``)}),X(e,n)});var s=g(o),c=e=>{var t=KJ(),n=f(t),r={};O(()=>{Y(n,`${(se().name||`shared track`)??``} (fetchingâ¦)`),r!==(r=se().hash)&&(t.value=(t.__value=r)??``)}),X(e,t)},l=q(()=>se().hash&&!T().some(e=>e.hash===se().hash));G(s,e=>{Q(l)&&e(c)}),H(i);var u;_(i);var d=g(i,2),p=j(d),m=f(p,!0),h=g(p,2),v=e=>{var t=Wze();X(e,t)};G(h,e=>{ce()&&se().playing&&e(v)}),H(d);var y=g(d,2);
2317xq(y,{label:`Shared volume`,min:0,max:1,step:.05,get value(){return se().volume},onchange:e=>Sde(e)});var b=g(y,4);xq(b,{label:`Local volume`,min:0,max:1,step:.05,get value(){return le()},onchange:e=>vv.set(e)});var x=g(b,2);xo(x,{get checked(){return Se(),de()},set checked(e){ke(gv,e)},children:(e,t)=>{W();var n=Te(`Mute music on this device`);X(e,n)},$$slots:{default:!0}}),W(2),O(()=>{u!==(u=se().hash??``)&&(i.value=(i.__value=u)??``,D(i,u)),r(p,1,`ui-chip ${se().playing?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`}`,`svelte-1kmyk3f`),p.disabled=!se().hash,Y(m,se().playing?`â Stop`:`â¶ Play`)}),L(`change`,i,e=>{let t=e.currentTarget.value||null,n=T().find(e=>e.hash===t);xde(t,n?.name??``)}),L(`click`,p,()=>Dde(!se().playing)),X(e,n)},$$slots:{default:!0}});var h=g(m,2);mq(h,{label:`View`,children:(e,t)=>{var n=Jze(),i=g(N(n),2);B(i,20,()=>[[`shaded`,`Shaded`],[`shaded-ao`,`Shaded + AO`],[`wireframe`,`Wireframe`]],([e,t])=>e,(e,t)=>{var n=q(()=>A(t,2));let i=()=>Q(n)[0],a=()=>Q(n)[1],o=q(()=>i()===`shaded-ao`&&wy(V()));var s=GJ(),c=f(s,!0);O(()=>{b(s,`id`,`view-mode-`+i()),r(s,1,`ui-chip `+(he()===i()?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`)+(Q(o)?` cursor-not-allowed opacity-40`:``),`svelte-1kmyk3f`),s.disabled=Q(o),b(s,`title`,Q(o)?`This scene sets its own ambient occlusion, so your personal setting does not apply`:``),Y(c,a())}),L(`click`,s,()=>ii.set(i())),X(e,s)}),H(i);var a=g(i,4),o=e=>{var t=Kze();X(e,t)},s=q(()=>wy(V()));G(a,e=>{Q(s)&&e(o)});var c=g(a,4);B(c,17,()=>see,e=>e.key,(e,t)=>{var n=qze(),r=N(n);{let e=q(()=>`override-`+Q(t).key),n=q(()=>ge()[Q(t).key]!==!1);xo(r,{get id(){return Q(e)},get checked(){return Q(n)},onchange:e=>oee(Q(t).key,e.currentTarget.checked),children:(e,n)=>{W();var r=Te();O(()=>Y(r,Q(t).label)),X(e,r)},$$slots:{default:!0}})}var i=g(r,2),a=f(i,!0);O(()=>Y(a,Q(t).hint)),X(e,n)});var l=g(c,2);xo(l,{get checked(){return Se(),U()},set checked(e){ke(yP,e)},children:(e,t)=>{W();var n=Te(`Show light helpers`);X(e,n)},$$slots:{default:!0}});var u=g(l,2);xo(u,{get checked(){return Se(),_e()},set checked(e){ke(BP,e)},children:(e,t)=>{W();var n=Te(`Show colliders â this device`);X(e,n)},$$slots:{default:!0}}),X(e,n)},$$slots:{default:!0}});var y=g(h,2);mq(y,{label:`Scene look`,aliases:[`Post-processing`],children:(e,t)=>{var n=Yze(),r=g(N(n),2);uze(r,{});var i=g(r,4),a=f(i,!0),o=g(i,2);O(e=>Y(a,e),[()=>st(ve(),s())]),L(`click`,o,()=>cy()),X(e,n)},$$slots:{default:!0}});var x=g(y,2);mq(x,{label:`Camera`,children:(e,t)=>{var n=$ze(),i=N(n);B(i,21,()=>lt,e=>e.label,(e,t)=>{var n=GJ(),i=f(n,!0);O(e=>{r(n,1,e,`svelte-1kmyk3f`),b(n,`title`,Q(t).mm+`mm equivalent · `+Q(t).fov+`° vertical FOV`),Y(i,Q(t).label)},[()=>`ui-chip `+(Math.round(re()?.fov??0)===Q(t).fov?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`)]),L(`click`,n,()=>{re()&&(me(yi,K(re).fov=Q(t).fov,K(re)),re().updateProjectionMatrix())}),X(e,n)}),H(i);var a=g(i,2);{let e=q(()=>re()?.fov??60);xq(a,{label:`Camera FOV`,min:15,max:120,step:1,decimals:0,get value(){return Q(e)},onchange:e=>{me(yi,K(re).fov=e,K(re)),re().updateProjectionMatrix()}})}var o=g(a,2);xq(o,{label:`Near clip`,min:.01,max:2,step:.01,decimals:2,get value(){return ye()},onchange:e=>Ise(e)});var s=g(o,2),c=g(j(s),2);hq(j(c),{id:`camera-far`,get value(){return be()},decimals:0,min:10,step:5,snap:100,ariaLabel:`Far clip`,onchange:e=>Pse(e)}),H(c),W(2),H(s);var l=g(s,6);xq(l,{label:`Rotate speed`,min:.1,max:3,step:.05,decimals:2,get value(){return xe().rotateSpeed},onchange:e=>Ih({rotateSpeed:e})});var d=g(l,2);xq(d,{label:`Zoom speed`,min:.1,max:3,step:.05,decimals:2,get value(){return xe().zoomSpeed},onchange:e=>Ih({zoomSpeed:e})});var p=g(d,2);xq(p,{label:`Pan speed`,min:.1,max:3,step:.05,decimals:2,get value(){return xe().panSpeed},onchange:e=>Ih({panSpeed:e})});var m=g(p,2);xo(m,{id:`orbit-damping`,get checked(){return xe().damping},onchange:e=>Ih({damping:e.currentTarget.checked}),children:(e,t)=>{W();var n=Te(`Smooth (damped) orbiting`);X(e,n)},$$slots:{default:!0}});var h=g(m,2);xo(h,{id:`orbit-invert`,get checked(){return xe().invertY},onchange:e=>Ih({invertY:e.currentTarget.checked}),children:(e,t)=>{W();var n=Te(`Invert vertical orbit`);X(e,n)},$$slots:{default:!0}});var _=g(h,2),y=j(_),x=g(y,2),S=g(x,2);H(_);var C=g(_,2);YIe(C,{});var w=g(C,4),T=j(w),E=g(T,2),D=f(E);H(w);var k=g(w,2),A=e=>{var t=Xze();X(e,t)},ee=e=>{var t=Qze(),n=N(t);B(n,7,we,e=>e.id,(e,t,n)=>{var i=Zze(),a=j(i),o=f(a,!0),s=g(a,2);v(s);var c=g(s,2);r(c,1,M(wr),`svelte-1kmyk3f`);var l=j(c);wS(l,{name:`eye`,size:13}),H(c);var d=g(c,2);r(d,1,M(wr),`svelte-1kmyk3f`);var p=j(d);wS(p,{name:`camera`,size:13}),H(d);var m=g(d,2);r(m,1,M(wr),`svelte-1kmyk3f`);var h=g(m,2);r(h,1,M(wr),`svelte-1kmyk3f`);var _=g(h,2);r(_,1,`shrink-0 rounded-sm bg-gray-700 px-1.5 py-0.5 text-xs text-gray-300 hover:bg-gray-600 disabled:opacity-40 text-red-400 svelte-1kmyk3f`);var y=j(_);wS(y,{name:`trash-2`,size:13}),H(_),H(i),O(()=>{Y(o,Q(n)<5?`â§`+(Q(n)+1):``),u(s,Q(t).name),m.disabled=Q(n)===0,h.disabled=Q(n)===we().length-1}),L(`change`,s,e=>Rse(Q(t).id,e.currentTarget.value)),L(`click`,c,()=>Lh(Q(n))),L(`click`,d,()=>zse(Q(t).id)),L(`click`,m,()=>Bh(Q(t).id,-1)),L(`click`,h,()=>Bh(Q(t).id,1)),L(`click`,_,()=>Lse(Q(t).id)),X(e,i)}),H(n),W(2),X(e,t)};G(k,e=>
2317{we().length===0?e(A):e(ee,-1)}),O(()=>Y(D,`Shift+1..5 recall the first 5`)),L(`click`,y,()=>xr()),L(`click`,x,()=>Tr()),L(`click`,S,()=>jse()),L(`click`,T,()=>Vh()),X(e,n)},$$slots:{default:!0}});var S=g(x,2);mq(S,{label:`Grid`,children:(e,t)=>{var n=eBe(),i=N(n);{let e=q(()=>!!J());xo(i,{id:`grid-show`,get checked(){return Q(e)},onchange:()=>{ni.update(e=>!e),nt.getItem(`showGrid`)?nt.removeItem(`showGrid`):nt.setItem(`showGrid`,`false`)},children:(e,t)=>{W();var n=Te(`Show grid`);X(e,n)},$$slots:{default:!0}})}var a=g(i,2);xo(a,{id:`grid-match-snap`,get checked(){return De().matchSnapStep},onchange:e=>nL({matchSnapStep:e.currentTarget.checked}),children:(e,t)=>{W();var n=Te();O(()=>Y(n,`Match snapping step (${Oe().translate??``})`)),X(e,n)},$$slots:{default:!0}});var o=g(a,2);{let e=q(()=>iL(De(),Oe().translate));xq(o,{label:`Cell size`,min:.05,max:10,step:.05,decimals:2,get value(){return Q(e)},onchange:e=>nL({cellSize:e,matchSnapStep:!1})})}var s=g(o,2);xq(s,{label:`Major every`,min:2,max:20,step:1,decimals:0,get value(){return De().sectionEvery},onchange:e=>nL({sectionEvery:Math.round(e)})});var c=g(s,2),l=g(j(c),2);v(l);var d=g(l,2);v(d),W(2),H(c);var p=g(c,2),m=g(j(p),2);B(m,16,()=>[[`auto`,`Auto`],[`fixed`,`Fixed`]],Be,(e,t)=>{var n=q(()=>A(t,2));let i=()=>Q(n)[0],a=()=>Q(n)[1];var o=GJ(),s=f(o,!0);O(()=>{r(o,1,`ui-chip `+(De().fadeMode===i()?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),b(o,`title`,i()===`auto`?`Fade scales with the camera distance`:`A fixed fade radius`),Y(s,a())}),L(`click`,o,()=>nL({fadeMode:i()})),X(e,o)}),H(p);var h=g(p,2),_=e=>{xq(e,{label:`Fade radius`,min:20,max:5e3,step:10,decimals:0,get value(){return De().fadeDistance},onchange:e=>nL({fadeDistance:e})})};G(h,e=>{De().fadeMode===`fixed`&&e(_)});var y=g(h,2);xq(y,{label:`Fade edge`,min:0,max:4,step:.1,decimals:1,get value(){return De().fadeStrength},onchange:e=>nL({fadeStrength:e})});var x=g(y,2);xo(x,{id:`grid-infinite`,get checked(){return De().infinite},onchange:e=>nL({infinite:e.currentTarget.checked}),children:(e,t)=>{W();var n=Te(`Infinite grid`);X(e,n)},$$slots:{default:!0}});var S=g(x,2),C=e=>{xq(e,{label:`Extent`,min:10,max:1e3,step:10,decimals:0,get value(){return De().size},onchange:e=>nL({size:e})})};G(S,e=>{De().infinite||e(C)});var w=g(S,2),T=g(j(w),2);B(T,16,()=>[[`off`,`Off`],[`lookat`,`Look-at`],[`camera`,`Camera`]],Be,(e,t)=>{var n=q(()=>A(t,2));let i=()=>Q(n)[0],a=()=>Q(n)[1];var o=GJ(),s=f(o,!0);O(()=>{r(o,1,`ui-chip `+(De().follow===i()?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),b(o,`title`,i()===`lookat`?`Centre the grid under what you are looking at (horizontal only)`:i()===`camera`?`Centre the grid under the camera itself`:`Keep the grid at the world origin`),Y(s,a())}),L(`click`,o,()=>nL({follow:i()})),X(e,o)}),H(w);var E=g(w,2);xo(E,{id:`grid-axes`,get checked(){return De().showAxes},onchange:e=>nL({showAxes:e.currentTarget.checked}),children:(e,t)=>{W();var n=Te(`Show origin axes`);X(e,n)},$$slots:{default:!0}});var D=g(E,2),k=j(D);W(2),H(D),O(()=>{u(l,De().cellColor),u(d,De().sectionColor)}),L(`input`,l,e=>nL({cellColor:e.currentTarget.value})),L(`input`,d,e=>nL({sectionColor:e.currentTarget.value})),L(`click`,k,()=>rL()),X(e,n)},$$slots:{default:!0}});var C=g(S,2);mq(C,{label:`Snapping`,children:(e,t)=>{var n=rBe(),a=N(n);xo(a,{id:`snap-enabled`,get checked(){return Ae()},onchange:e=>gc.set(e.currentTarget.checked),children:(e,t)=>{W();var n=Te(`Snap transforms to a grid`);X(e,n)},$$slots:{default:!0}});var o=g(a,2),s=g(j(o),2);B(s,20,()=>[.1,.25,.5,1],Be,(e,t)=>{var n=GJ(),i=f(n,!0);O(()=>{r(n,1,`ui-chip `+(Oe().translate===t?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),Y(i,t)}),L(`click`,n,()=>_c.update(e=>({...e,translate:t}))),X(e,n)}),H(s);var c=g(s,2);hq(j(c),{id:`snap-translate`,get value(){return Oe().translate},unit:`length`,decimals:2,min:.01,step:.005,snap:.1,ariaLabel:`translate snap step`,onchange:e=>_c.update(t=>({...t,translate:e||t.translate}))}),H(c),H(o);var l=g(o,2),u=g(j(l),2);B(u,20,()=>[5,15,45,90],Be,(e,t)=>{var n=GJ(),i=f(n);O(()=>{r(n,1,`ui-chip `+(Oe().rotateDeg===t?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),Y(i,`${t??``}°`)}),L(`click`,n,()=>_c.update(e=>({...e,rotateDeg:t}))),X(e,n)}),H(u);var d=g(u,2);hq(j(d),{id:`snap-rotate`,get value(){return Oe().rotateDeg},unit:`angleDeg`,decimals:1,min:.1,step:.2,snap:5,ariaLabel:`rotateDeg snap step`,onchange:e=>_c.update(t=>({...t,rotateDeg:e||t.rotateDeg}))}),H(d),H(l);var p=g(l,2),m=g(j(p),2);B(m,20,()=>[.05,.1,.25],Be,(e,t)=>{var n=GJ(),i=f(n,!0);O(()=>{r(n,1,`ui-chip `+(Oe().scale===t?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),Y(i,t)}),L(`click`,n,()=>_c.update(e=>({...e,scale:t}))),X(e,n)}),H(m);var h=g(m,2);hq(j(h),{id:`snap-scale`,get value(){return Oe().scale}
2317,decimals:2,min:.01,step:.005,snap:.05,ariaLabel:`scale snap step`,onchange:e=>_c.update(t=>({...t,scale:e||t.scale}))}),H(h),H(p);var _=g(p,2);xo(_,{id:`snap-surface`,get checked(){return je()},onchange:e=>vc.set(e.currentTarget.checked),children:(e,t)=>{W();var n=Te(`Rest dragged objects on the surface below`);X(e,n)},$$slots:{default:!0}});var v=g(_,4),y=g(j(v),2),x=f(y,!0);H(v);var S=g(v,2);B(S,21,()=>rt,Be,(e,t)=>{var n=GJ(),a=f(n,!0);O((e,i)=>{b(n,`id`,`snap-target-`+Q(t)[0]),r(n,1,e,`svelte-1kmyk3f`),b(n,`aria-pressed`,i),Y(a,Q(t)[1])},[()=>`ui-chip `+(it(i(),Q(t)[0])?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),()=>it(i(),Q(t)[0])]),L(`click`,n,()=>ot(Q(t)[0])),X(e,n)}),H(S);var C=g(S,2),w=g(j(C),2);B(w,20,()=>[15,25,40],Be,(e,t)=>{var n=GJ(),a=f(n,!0);O(()=>{r(n,1,`ui-chip `+(i().radiusPx===t?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),Y(a,t)}),L(`click`,n,()=>hc.update(e=>({...e,radiusPx:t}))),X(e,n)}),H(w);var T=g(w,2);hq(j(T),{id:`snap-radius`,get value(){return i().radiusPx},decimals:0,min:5,max:60,step:1,ariaLabel:`element snap radius (screen px)`,onchange:e=>hc.update(t=>({...t,radiusPx:Math.min(60,Math.max(5,Math.round(e)||25))}))}),H(T),H(C);var E=g(C,2);xo(E,{id:`snap-align-normal`,get checked(){return i().alignNormal},onchange:e=>hc.update(t=>({...t,alignNormal:e.currentTarget.checked})),children:(e,t)=>{W();var n=Te(`Rotate to the surface (align to normal)`);X(e,n)},$$slots:{default:!0}});var D=g(E,2),k=g(j(D),2),A=j(k),ee=g(A,2);H(k),H(D);var M=g(D,2),te=g(j(M));H(M);var ne=g(M,2),P=e=>{var t=tBe(),n=g(j(t),4);H(t),L(`click`,n,()=>iP()),X(e,t)},re=e=>{var t=nBe(),n=g(j(t),2),r=g(n,2);H(t),L(`click`,n,()=>sP()),L(`click`,r,()=>oP()),X(e,t)};G(ne,e=>{Fe()?e(P):Pe().mode===`picked`&&e(re,1)}),W(4),O(()=>{Y(x,Q(at)===0?`none â element snap is idle`:`${Q(at)} on`),r(A,1,`ui-chip `+(i().anchorMode===`auto`&&Pe().mode!==`picked`?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),r(ee,1,`ui-chip `+(i().anchorMode===`pivot`&&Pe().mode!==`picked`?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),r(M,1,`snap-action `+(Fe()?`snap-action-armed`:``),`svelte-1kmyk3f`),b(M,`aria-pressed`,Fe()),Y(te,` ${Fe()?`Click a point on the objectâ¦`:`Pick a point on the object`}`)}),L(`click`,A,()=>{oP(),hc.update(e=>({...e,anchorMode:`auto`}))}),L(`click`,ee,()=>{oP(),hc.update(e=>({...e,anchorMode:`pivot`}))}),L(`click`,M,()=>Fe()?iP():rP()),X(e,n)},$$slots:{default:!0}});var w=g(C,2);mq(w,{label:`Physics`,children:(e,t)=>{var n=uBe(),i=g(N(n),2);xq(i,{label:`Gravity`,min:-20,max:5,step:.1,get value(){return Le()},onchange:e=>Jee(e)});var a=g(i,2);xq(a,{id:`physics-timescale`,label:`Time scale`,min:.1,max:2,step:.05,get value(){return d().timeScale},onchange:e=>vl({timeScale:e})});var o=g(a,2),s=e=>{var t=iBe();X(e,t)};G(o,e=>{d().timeScale>1.5&&!d().ccd&&e(s)});var c=g(o,2),u=j(c),p=f(u);H(c);var m=g(c,6);xo(m,{id:`physics-ground-enabled`,get checked(){return Re().enabled},onchange:e=>vl({ground:{enabled:e.currentTarget.checked}}),children:(e,t)=>{W();var n=Te(`Ground plane`);X(e,n)},$$slots:{default:!0}});var h=g(m,2),_=e=>{var t=qJ(),n=N(t);hq(n,{id:`physics-ground-height`,label:`Height`,get value(){return Re().height},step:.1,min:-500,max:500,onchange:e=>vl({ground:{height:e}})});var r=g(n,2);xq(r,{id:`physics-ground-friction`,label:`Grip`,min:0,max:2,step:.05,get value(){return Re().friction},onchange:e=>vl({ground:{friction:e}})}),xq(g(r,2),{id:`physics-ground-restitution`,label:`Bounce`,min:0,max:1,step:.05,get value(){return Re().restitution},onchange:e=>vl({ground:{restitution:e}})}),X(e,t)},v=e=>{var t=aBe();X(e,t)};G(h,e=>{Re().enabled?e(_):e(v,-1)});var y=g(h,2);hq(y,{id:`physics-bounds-limit`,label:`Out of bounds below Y`,get value(){return ze().limit},step:1,min:-1e4,max:0,onchange:e=>vl({bounds:{limit:e}})});var b=g(y,2);fq(g(j(b),2),{id:`physics-bounds-action`,class:`flex-1`,get value(){return ze().action},items:[{value:`respawn`,name:`Return to its start`},{value:`freeze`,name:`Freeze in place`},{value:`delete`,name:`Delete the object`}],onchange:e=>vl({bounds:{action:e}})}),H(b);var x=g(b,4),S=g(j(x),2);{let e=q(()=>[{value:``,name:`Per object (rapier default)`},...Object.keys(sh).map(e=>({value:e,name:e})),{value:`custom`,name:`Custom`}]);fq(S,{id:`physics-scene-material`,class:`flex-1`,get value(){return Q(St)},get items(){return Q(e)},onchange:e=>vl({material:e===``||e===`custom`?{friction:null,restitution:null}:{...xt[e]}})})}H(x);var C=g(x,4);xq(C,{id:`physics-damping-linear`,label:`Drag`,min:0,max:5,step:.05,get value(){return d().damping.linear},onchange:e=>vl({damping:{linear:e}})});var w=g(C,2);xq(w,{id:`physics-damping-angular`,label:`Spin drag`,min:0,max:5,step:.05,get value(){return d().damping.angular},onchange:e=>vl({damping:{angular:e}})});var T=g(w,2);xo(T,{id:`physics-ccd`,get checked(){return d().ccd},onchange:e=>vl({ccd:e.currentTarget.checked}),children:(e,t)=>{W();var n=Te(`Continuous collision (fast objects)`);
2317X(e,n)},$$slots:{default:!0}});var E=g(T,4),D=e=>{var t=oBe();X(e,t)},k=e=>{var t=cBe();B(t,21,()=>Q(bt),e=>e.uuid,(e,t)=>{var n=sBe(),i=j(n),a=f(i,!0),o=g(i,2),s=f(o);H(n),O(()=>{r(n,1,`flex items-center justify-between gap-2 rounded-sm px-2 py-1 text-left text-xs transition-colors `+(l()?.uuid===Q(t).uuid?`bg-primary-600 text-white`:`bg-gray-700 text-gray-200 hover:bg-gray-600`),`svelte-1kmyk3f`),Y(a,Q(t).name),r(o,1,`shrink-0 text-[10px] `+(l()?.uuid===Q(t).uuid?``:`opacity-75`),`svelte-1kmyk3f`),Y(s,`${Q(t).mode===`dynamic`?`dynamic · `+Q(t).mass+` kg`:Q(t).mode===`static`?`static`:`collider only`}${Q(t).flow?` · flow`:``}`)}),L(`click`,n,()=>Em(Q(t).uuid)),X(e,n)}),H(t),X(e,t)};G(E,e=>{Q(bt).length===0?e(D):e(k,-1)});var A=g(E,2),ee=g(A,6);xo(ee,{id:`physics-knock-enabled`,get checked(){return He().enabled},onchange:e=>vl({knock:{enabled:e.currentTarget.checked}}),children:(e,t)=>{W();var n=Te(`Hands and players knock dynamic objects`);X(e,n)},$$slots:{default:!0}});var M=g(ee,2),te=e=>{var t=JJ(),n=N(t);xq(n,{id:`physics-knock-gain`,label:`Gain`,min:0,max:5,step:.05,get value(){return He().gain},onchange:e=>vl({knock:{gain:e}})});var r=g(n,2);xq(r,{id:`physics-knock-maxspeed`,label:`Max speed`,min:.5,max:20,step:.5,decimals:1,get value(){return He().maxSpeed},onchange:e=>vl({knock:{maxSpeed:e}})});var i=g(r,2);xq(i,{id:`physics-knock-radius`,label:`Probe radius`,min:.02,max:1,step:.01,get value(){return He().radius},onchange:e=>vl({knock:{radius:e}})}),xq(g(i,2),{id:`physics-knock-spin`,label:`Spin`,min:0,max:2,step:.05,get value(){return He().spin},onchange:e=>vl({knock:{spin:e}})}),X(e,t)};G(M,e=>{He().enabled&&e(te)});var ne=g(M,6);fq(g(j(ne),2),{id:`physics-play-interaction`,class:`flex-1`,get value(){return Ue().interaction},items:[{value:`grab`,name:`Grab and throw`},{value:`click`,name:`Click only`},{value:`off`,name:`Look only`}],onchange:e=>vl({play:{interaction:e}})}),H(ne);var P=g(ne,2);{let e=q(()=>Ue().reach!=null);xo(P,{id:`physics-play-reach-on`,get checked(){return Q(e)},onchange:e=>vl({play:{reach:e.currentTarget.checked?1.3:null}}),children:(e,t)=>{W();var n=Te(`Limit grab reach`);X(e,n)},$$slots:{default:!0}})}var re=g(P,2),ie=e=>{xq(e,{id:`physics-play-reach`,label:`Reach (m)`,min:.5,max:5,step:.1,decimals:1,get value(){return Ue().reach},onchange:e=>vl({play:{reach:e}})})};G(re,e=>{Ue().reach!=null&&e(ie)});var F=g(re,2);xo(F,{id:`physics-play-grounded`,get checked(){return Ue().grounded},onchange:e=>vl({play:{grounded:e.currentTarget.checked}}),children:(e,t)=>{W();var n=Te(`Keep players on the ground`);X(e,n)},$$slots:{default:!0}});var ae=g(F,2);xo(ae,{id:`physics-sim-on-play`,get checked(){return Ue().simOnPlay},onchange:e=>vl({play:{simOnPlay:e.currentTarget.checked}}),children:(e,t)=>{W();var n=Te(`Start the simulation when play mode opens`);
2317X(e,n)},$$slots:{default:!0}});var I=g(ae,2),oe=g(j(I),2),R=f(oe,!0);H(I);var se=g(I,2),ce=j(se),le=g(ce,2),ue=e=>{var t=lBe();L(`click`,t,()=>vl({play:{spawn:null}})),X(e,t)};G(le,e=>{Ue().spawn&&e(ue)}),H(se),W(2),O(e=>{Y(p,`Reset gravity (-9.81)`),Y(R,e)},[()=>Cr(Ue().spawn)]),L(`click`,u,()=>$ee()),L(`click`,A,()=>use()),L(`click`,ce,Sr),X(e,n)},$$slots:{default:!0}});var E=g(w,2);mq(E,{label:`Background`,children:(e,t)=>{var n=YJ(),r=N(n);{let e=q(()=>({...qq,wrapper:Jq}));Ee(r,()=>({"--picker-indicator-size":`20px`,"--cp-bg-color":`#1f2937`,"--cp-border-color":`#353f4e`,"--picker-height":`70px`,"--picker-width":`50px`,"--slider-width":`10px`})),Kq(r.lastChild,{isAlpha:!1,isTextInput:!0,textInputModes:[`hex`,`rgb`,`hsv`],isDialog:!1,get components(){return Q(e)},isOpen:!0,sliderDirection:`horizontal`,get hex(){return P()},onInput:e=>br(e.hex)}),H(r)}X(e,n)},$$slots:{default:!0}}),mq(g(E,2),{label:`Fog`,children:(e,t)=>{var n=dBe(),r=N(n);{let e=q(()=>({...qq,wrapper:Jq})),t=q(()=>Q(hr)?.color??`#ffffff`);Ee(r,()=>({"--picker-indicator-size":`20px`,"--cp-bg-color":`#1f2937`,"--cp-border-color":`#353f4e`,"--picker-height":`70px`,"--picker-width":`50px`,"--slider-width":`10px`})),Kq(r.lastChild,{isAlpha:!1,isTextInput:!0,textInputModes:[`hex`,`rgb`,`hsv`],isDialog:!1,get components(){return Q(e)},isOpen:!0,sliderDirection:`horizontal`,get hex(){return Q(t)},onInput:e=>{Hn(e.hex,Q(hr)?.color??`#ffffff`)||sv({fog:{color:e.hex}})}}),H(r)}var i=g(r,2);{let e=q(()=>Math.max(10,Math.ceil(Q(hr)?.near??0))),t=q(()=>Q(hr)?.near??0);xq(i,{id:`fog-near`,label:`Near`,min:0,get max(){return Q(e)},step:.1,decimals:1,get value(){return Q(t)},onchange:e=>sv({fog:{near:e}})})}var a=g(i,2);{let e=q(()=>Math.max(100,Math.ceil(Q(hr)?.far??0))),t=q(()=>Q(hr)?.far??0);xq(a,{id:`fog-far`,label:`Far`,min:0,get max(){return Q(e)},step:.1,decimals:1,get value(){return Q(t)},onchange:e=>sv({fog:{far:e}})})}var o=g(a,2);Do(o,{size:`xs`,color:`alternative`,onclick:()=>sv({fog:null}),children:(e,t)=>{W();var n=Te(`Remove Fog`);X(e,n)},$$slots:{default:!0}}),X(e,n)},$$slots:{default:!0}}),H(c),O(()=>u(o,ae())),L(`input`,o,e=>us.set(e.currentTarget.value)),L(`keydown`,o,e=>e.key===`Escape`&&us.set(``)),X(e,t)},h=e=>{var t=mBe(),n=N(t);pq(j(n),{title:`Properties`,badge:`Module content`,get pinned(){return F()},onpin:()=>Vo.update(e=>!e),onclose:()=>Ho.set(!0)}),H(n);var r=g(n,2),i=j(r),a=f(i,!0),o=g(i,2),s=g(j(o)),c=f(s,!0);W(),H(o);var l=g(o,2),u=e=>{var t=pBe(),n=f(t);O(()=>Y(n,`Open ${Q(Qt).title??``}`)),L(`click`,t,()=>Tl(Q(Qt).id)),X(e,t)};G(l,e=>{Q(Qt)&&e(u)}),H(r),O(()=>{Y(a,m().label),Y(c,m().moduleName)}),X(e,t)},x=e=>{var t=gVe(),n=N(t),i=j(n);{let e=q(()=>Q(wt)?`${Q(wt)} objects`:l().type);pq(i,{title:`Properties`,get badge(){return Q(e)},get pinned(){return F()},onpin:()=>Vo.update(e=>!e),onclose:()=>Ho.set(!0)})}var a=g(i,2);v(a),H(n);var o=g(n,2),c=j(o),d=e=>{var t=hBe(),n=j(t),r=f(n);W(2),H(t),O(()=>Y(r,`Editing ${Q(wt)??``} objects`)),X(e,t)};G(c,e=>{Q(wt)&&e(d)});var p=g(c,2),m=e=>{var t=gBe(),n=j(t);v(n);var r=g(n,2);ho(r,{placement:`top`,arrow:!1,triggeredBy:`#name`,children:(e,t)=>{W();var n=Te(`Name`);X(e,n)},$$slots:{default:!0}});var i=g(r,2),a=f(i,!0),o=g(i,2),s=j(o);Ie(s,()=>Q(dr),e=>{fq(e,{id:`select-group`,get items(){return Q(ur)},placeholder:`Move to group`,onchange:e=>{let t=Q(ur).find(t=>t.value===e);Cm(l().uuid,t?.name===`Level Up`?`up`:e),ci(),I(dr,!Q(dr))}})}),H(o),H(t),O(()=>{u(n,l().name),b(i,`title`,l().uuid),Y(a,l().uuid)}),L(`change`,n,e=>{me(Di,K(l).name=e.currentTarget.value,K(l)),cr()}),L(`click`,o,fr),X(e,t)};G(p,e=>{Q(wt)||e(m)});var h=g(p,2),_=e=>{let t=q(()=>We()[l().uuid]);mq(e,{label:`Animation`,children:(e,n)=>{var r=_Be(),i=j(r);{let e=q(()=>Q(t).clips.map(e=>({value:e,name:e})));fq(i,{class:`mb-1`,get value(){return Q(t).clip},get items(){return Q(e)},onchange:e=>Sg(l().uuid,{clip:e})})}var a=g(i,2),o=j(a),s=f(o,!0),c=g(o,2),d=f(c),p=g(c,2);v(p),H(a),W(2),H(r),O(e=>{Y(s,Q(t).playing?`⸠Pause`:`â¶ Play`),Y(d,`speed ${e??``}Ã`),u(p,Q(t).speed)},[()=>Q(t).speed.toFixed(1)]),L(`click`,o,()=>Sg(l().uuid,{playing:!Q(t).playing})),L(`input`,p,e=>Sg(l().uuid,{speed:+e.currentTarget.value})),X(e,r)},$$slots:{default:!0}})};G(h,e=>{We()[l().uuid]&&e(_)});var x=g(h,2),C=e=>{let t=q(()=>ix(l()));
2317mq(e,{label:`Camera`,children:(e,n)=>{var i=vBe(),a=N(i),o=g(j(a),2);B(o,16,()=>[[`perspective`,`Perspective`],[`orthographic`,`Orthographic`]],Be,(e,n)=>{var i=q(()=>A(n,2));let a=()=>Q(i)[0],o=()=>Q(i)[1];var s=GJ(),c=f(s,!0);O(()=>{r(s,1,`ui-chip `+(Q(t).kind===a()?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),Y(c,o())}),L(`click`,s,()=>nx(l().uuid,{kind:a()})),X(e,s)}),H(a);var s=g(a,2),c=e=>{xq(e,{label:`FOV`,min:10,max:140,step:1,decimals:0,get value(){return Q(t).fov},onchange:e=>nx(l().uuid,{fov:e})})},u=e=>{xq(e,{label:`Size`,min:.5,max:50,step:.5,decimals:1,get value(){return Q(t).orthoSize},onchange:e=>nx(l().uuid,{orthoSize:e})})};G(s,e=>{Q(t).kind===`perspective`?e(c):e(u,-1)});var d=g(s,2);xq(d,{label:`Near`,min:.01,max:5,step:.01,decimals:2,get value(){return Q(t).near},onchange:e=>nx(l().uuid,{near:e})});var p=g(d,2),m=g(j(p),2);hq(j(m),{id:`camera-object-far`,get value(){return Q(t).far},decimals:0,min:1,step:5,snap:50,ariaLabel:`Far plane`,onchange:e=>nx(l().uuid,{far:e||Q(t).far})}),H(m),H(p);var h=g(p,2),_=g(j(h),2);B(_,17,()=>rhe,Be,(e,n)=>{var i=GJ(),a=f(i,!0);O(()=>{r(i,1,`ui-chip `+(Q(t).aspect===Q(n)?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),Y(a,Q(n))}),L(`click`,i,()=>nx(l().uuid,{aspect:Q(n)})),X(e,i)}),H(h);var v=g(h,2);xo(v,{id:`camera-guide`,get checked(){return Q(t).guide},onchange:e=>nx(l().uuid,{guide:e.currentTarget.checked}),children:(e,t)=>{W();var n=Te(`Letterbox guide while previewing`);X(e,n)},$$slots:{default:!0}});var y=g(v,2),b=j(y),x=f(b,!0),S=g(b,2),C=g(S,2);H(y);var w=g(y,2),T=j(w),E=j(T);wS(E,{name:`camera`,size:13}),W(),H(T),W(2),H(w);var D=g(w,2);{let e=q(()=>Q(t).pip!==!1);xo(D,{id:`camera-pip`,get checked(){return Q(e)},onchange:e=>nx(l().uuid,{pip:e.currentTarget.checked}),children:(e,t)=>{W();var n=Te(`Preview window while selected`);X(e,n)},$$slots:{default:!0}})}var k=g(D,2);xo(k,{id:`camera-frustums`,get checked(){return Ke()},onchange:e=>sx.set(e.currentTarget.checked),children:(e,t)=>{W();var n=Te(`Show camera frustums â this device`);X(e,n)},$$slots:{default:!0}}),W(2),O(()=>{r(b,1,`ui-chip `+(Ge()?.uuid===l().uuid?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`),`svelte-1kmyk3f`),Y(x,Ge()?.uuid===l().uuid?`Previewing`:`Preview`)}),L(`click`,b,()=>Ge()?.uuid===l().uuid?ux():fx(l().uuid)),L(`click`,S,()=>Qme(l().uuid)),L(`click`,C,()=>ehe(l().uuid)),L(`click`,T,()=>nhe(l().uuid)),X(e,i)},$$slots:{default:!0}})},w=q(()=>rx(l()));G(x,e=>{Q(w)&&e(C)});var T=g(x,2),E=e=>{mq(e,{label:`Loading`,children:(e,t)=>{SLe(e,{get object(){return l()}})},$$slots:{default:!0}})},D=q(()=>!Q(wt)&&Er(l(),s()));G(T,e=>{Q(D)&&e(E)});var k=g(T,2);mq(k,{label:`Transform`,children:(e,t)=>{var n=wBe(),r=N(n),i=e=>{var t=yBe(),n=N(t),r=j(n),i=f(r,!0),a=g(r,2),o=j(a);{let e=q(()=>te()?`primary`:`alternative`);Do(o,{id:`origin-mode`,size:`xs`,get color(){return Q(e)},onclick:()=>Zf.update(e=>!e),children:(e,t)=>{W();var n=Te();O(()=>Y(n,te()?`Done`:`Move origin`)),X(e,n)},$$slots:{default:!0}})}var s=g(o,2);Do(s,{id:`origin-reset`,size:`xs`,color:`alternative`,onclick:()=>_ie(),children:(e,t)=>{W();var n=Te(`Centre`);X(e,n)},$$slots:{default:!0}}),H(a),H(n);var c=g(n,2),l=g(j(c),2);{let e=q(()=>[{value:`median`,name:`Median point`},{value:`active`,name:`Active object`},{value:`parent`,name:Qf()?`Parent origin`:`Parent origin (no common parent)`},{value:`individual`,name:`Individual origins`}]);fq(l,{id:`pivot-mode`,get items(){return Q(e)},get value(){return Se(),qe()},set value(e){ke(Jf,e)}})}H(c),O(()=>Y(i,te()?`Moving the origin only`:`Moves all ${Q(wt)} together`)),X(e,t)};G(r,e=>{Q(wt)&&e(i)});var a=g(r,2),o=j(a),s=f(o,!0),c=g(o,2),u=j(c);{let e=q(()=>Q(wt)?y()?.pos?.[0]??0:l().position.x);hq(u,{label:`X`,accent:`text-red-400`,step:.02,unit:`length`,get value(){return Q(e)},onchange:e=>Zn(`position`,`x`,e)})}var d=g(u,2);{let e=q(()=>Q(wt)?y()?.pos?.[1]??0:l().position.y);hq(d,{label:`Y`,accent:`text-green-400`,step:.02,unit:`length`,get value(){return Q(e)},onchange:e=>Zn(`position`,`y`,e)})}var p=g(d,2);{let e=q(()=>Q(wt)?y()?.pos?.[2]??0:l().position.z);hq(p,{label:`Z`,accent:`text-blue-400`,step:.02,unit:`length`,get value(){return Q(e)},onchange:e=>Zn(`position`,`z`,e)})}H(c);var m=g(c,2),h=e=>{var t=bBe(),n=g(N(t),2),r=j(n);{let e=q(()=>Q(wt)?y()?.rot?.[0]??0:l().rotation.x);hq(r,{label:`X`,accent:`text-red-400`,step:.01,snap:ct,unit:`angle`,get value(){return Q(e)},onchange:e=>Zn(`rotation`,`x`,e)})}var i=g(r,2);{let e=q(()=>Q(wt)?y()?.rot?.[1]??0:l().rotation.y);hq(i,{label:`Y`,accent:`text-green-400`,step:.01,snap:ct,unit:`angle`,get value(){return Q(e)},onchange:e=>Zn(`rotation`,`y`,e)})}var a=g(i,2);{let e=q(()=>Q(wt)?y()?.rot?.[2]??0:l().rotation.z);hq(a,{label:`Z`,accent:`text-blue-400`,step:.01,snap:ct,unit:`angle`,get value(){return Q(e)},onchange:e=>Zn(`rotation`,`z`,e)})}H(n);var o=g(n,4),s=j(o);{let e=q(()=>Q(wt)?y()?.scale?.[0]??1:l().scale.x);hq(s,{label:`X`,accent:`text-red-400`,step:.01,snap:.1,get value(){return Q(e)},onchange:e=>Zn(`scale`,`x`,e)})}var c=g(s,2);{let e=q(()=>Q(wt)?y()?.scale?.[1]??1:l().scale.y);hq(c,{label:`Y`,accent:`text-green-400`,step:.01,snap:.1,get value(){return Q(e)},onchange:e=>Zn(`scale`,`y`,e)})}var u=g(c,2);{let e=q(()=>Q(wt)?y()?.scale?.[2]??1:l().scale.z);hq(u,{label:`Z`,accent:`text-blue-400`,step:.01,snap:.1,get value(){return Q(e)},onchange:e=>Zn(`scale`,`z`,e)})}H(o),X(e,t)};G(m,e=>{!Q(bn)&&!te()&&e(h)}),H(a);var _=g(a,2),v=e=>{var t=CBe(),n=j(t),r=j(n),i=f(r),a=g(r,2),o=j(a);{let e=q(()=>te()?`primary`:`alternative`);Do(o,{id:`origin-mode-single`,size:`xs`,get color(){return Q(e)},onclick:()=>{Zf.update(e=>!e),Yf()},children:(e,t)=>{W();var n=Te();O(()=>Y(n,te()?`Done`:`Move origin`)),X(e,n)},$$slots:{default:!0}})}var s=g(o,2);Do(s,{id:`origin-clear`,size:`xs`,color:`alternative`,onclick:gn,children:(e,t)=>{W();var n=Te(`Reset`);X(e,n)},$$slots:{default:!0}}),H(a),H(n);var c=g(n,2),l=g(j(c),2),u=j(l);hq(u,{label:`X`,accent:`text-red-400`,step:.02,unit:`length`,get value(){return Q(on)[0]},onchange:e=>cn(`x`,e)});var d=g(u,2);hq(d,{label:`Y`,accent:`text-green-400`,step:.02,unit:`length`,get value(){return Q(on)[1]},onchange:e=>cn(`y`,e)}),hq(g(d,2),{label:`Z`,accent:`text-blue-400`,step:.02,unit:`length`,get value(){return Q(on)[2]},onchange:e=>cn(`z`,e)}),H(l),H(c);var p=g(c,2),m=j(p),h=e=>{var t=qJ(),n=N(t);Do(n,{id:`origin-bottom`,size:`xs`,color:`alternative`,onclick:()=>ln(`bottom`),children:(e,t)=>{W();var n=Te(`Bottom`);X(e,n)},$$slots:{default:!0}});var r=g(n,2);Do(r,{id:`origin-center`,size:`xs`,color:`alternative`,onclick:()=>ln(`center`),children:(e,t)=>{W();var n=Te(`Centre`);X(e,n)},$$slots:{default:!0}});var i=g(r,2);Do(i,{id:`origin-median`,size:`xs`,color:`alternative`,onclick:()=>ln(`median`),children:(e,t)=>{W();var n=Te(`Median`);
2317X(e,n)},$$slots:{default:!0}}),X(e,t)};G(m,e=>{Q(bn)||e(h)});var _=g(m,2);Do(_,{id:`origin-world`,size:`xs`,color:`alternative`,onclick:()=>ln(`world`),children:(e,t)=>{W();var n=Te(`World 0`);X(e,n)},$$slots:{default:!0}});var v=g(_,2),y=e=>{Do(e,{id:`origin-children`,size:`xs`,color:`alternative`,onclick:()=>ln(`children`),children:(e,t)=>{W();var n=Te(`Children`);X(e,n)},$$slots:{default:!0}})};G(v,e=>{Q(Cn)&&e(y)});var b=g(v,2),x=e=>{var t=xBe();X(e,t)},S=e=>{Do(e,{id:`origin-hinge`,size:`xs`,color:`primary`,onclick:yn,children:(e,t)=>{W();var n=Te();O(()=>Y(n,`Set origin here${Je()>1?` (${Je()} verts)`:``}`)),X(e,n)},$$slots:{default:!0}})},C=e=>{Do(e,{id:`origin-pick`,size:`xs`,color:`alternative`,onclick:vn,children:(e,t)=>{W();var n=Te(`Pick from meshâ¦`);X(e,n)},$$slots:{default:!0}})};G(b,e=>{Q(bn)?e(x):Q(_n)?e(S,1):e(C,-1)}),H(p);var w=g(p,2),T=e=>{var t=SBe();X(e,t)};G(w,e=>{Q(_n)&&e(T)});var E=g(w,2),D=j(E),k=e=>{var t=Te(`Drag the gizmo (or type above) to place the origin â the mesh stays put. Grid and 2318 surface snapping apply. Press Done to transform around it.`);X(e,t)},A=e=>{var t=Te(`Bottom puts the pivot on the footprint so the object sits on the ground. Spin and 2319 Orbit flow nodes turn around this point â that is how you hinge a door.`);X(e,t)};G(D,e=>{te()?e(k):e(A,-1)}),H(E),H(t),O(()=>Y(i,`Origin ${Q(sn)?``:`(default)`}`)),X(e,t)};G(_,e=>{Q(an)&&e(v)});var b=g(_,2),x=j(b),S=e=>{var t=Te(`Re-place the origin, then press Done to rotate or scale the selection around it. The 2320 origin is a local editing aid â peers keep their own.`);X(e,t)},C=e=>{var t=Te(`Rotation and scale are per-gesture handles: they turn the whole set around the origin, 2321 then reset for the next move.`);X(e,t)},w=e=>{var t=Te(`Drag to scrub â Shift fine, Ctrl snap, click to type.`);X(e,t)};G(x,e=>{Q(wt)&&te()?e(S):Q(wt)?e(C,1):e(w,-1)}),H(b),O(()=>Y(s,Q(wt)?`Origin`:`Position`)),X(e,n)},$$slots:{default:!0}});var M=g(k,2),ne=e=>{mq(e,{label:`Object`,children:(e,t)=>{var n=TBe(),r=N(n),i=g(j(r),2);hq(j(i),{id:`inspector-render-order`,get value(){return l().renderOrder},decimals:0,step:.2,snap:5,ariaLabel:`Render order`,onchange:e=>lr(`renderOrder`,Math.round(e)||0)}),H(i),H(r);var a=g(r,2);xo(a,{get checked(){return l().frustumCulled},onchange:e=>lr(`frustumCulled`,e.target.checked),children:(e,t)=>{W();var n=Te(`Frustum culled`);X(e,n)},$$slots:{default:!0}});var o=g(a,4);xo(o,{id:`inspector-pick-through`,get checked(){return Q($t)},onchange:e=>{let t=e.target.checked;en(`Click-through`,e=>toe(e.uuid,t)),Di.update(e=>e)},children:(e,t)=>{W();var n=Te(`Click-through in the viewport`);X(e,n)},$$slots:{default:!0}}),X(e,n)},$$slots:{default:!0}})};G(M,e=>{Q(bn)||e(ne)});var P=g(M,2),re=e=>{mq(e,{label:`LOD`,children:(e,t)=>{yLe(e,{get uuid(){return l().uuid}})},$$slots:{default:!0}})};G(P,e=>{!Q(bn)&&!Q(wt)&&l()?.uuid&&e(re)});var ie=g(P,2),oe=e=>{mq(e,{label:`Water`,children:(e,t)=>{zLe(e,{get uuid(){return l().uuid}})},$$slots:{default:!0}})};G(ie,e=>{!Q(bn)&&!Q(wt)&&l()?.uuid&&e(oe)});var R=g(ie,2),se=e=>{mq(e,{label:`Device`,children:(e,t)=>{var n=kBe(),r=N(n),i=e=>{var t=EBe(),n=f(t);O(()=>Y(n,`Applies to ${Q(Ot).length??``} selected devices.`)),X(e,t)};G(r,e=>{Q(Ot).length>1&&e(i)});var a=g(r,2),o=f(a,!0),s=g(a,2),c=e=>{var t=DBe();X(e,t)};G(s,e=>{Q(At).length||e(c)});var l=g(s,2);B(l,17,()=>Q(At),e=>e.key,(e,t)=>{var n=fe(),r=N(n),i=e=>{var n=OBe(),r=j(n),i=f(r,!0),a=g(r,2);{let e=q(()=>`device-param-`+Q(t).key),n=q(()=>[...Nt(Q(t).key)?[{value:``,name:`â`}]:[],...(Q(t).options??[]).map(e=>({value:String(e.value),name:String(e.label??e.value)}))]),r=q(()=>Nt(Q(t).key)?``:String(Mt(Q(t).key)??Q(t).default??``));fq(a,{get id(){return Q(e)},get items(){return Q(n)},get value(){return Q(r)},onchange:e=>{e!==``&&Ft(Q(t).key,e)}})}H(n),O(()=>Y(i,Q(t).label??Q(t).key)),X(e,n)},a=e=>{{let n=q(()=>`device-param-`+Q(t).key),r=q(()=>!!Mt(Q(t).key));xo(e,{get id(){return Q(n)},get checked(){return Q(r)},onchange:e=>Ft(Q(t).key,e.target.checked),children:(e,n)=>{W();var r=Te();O(e=>Y(r,`${Q(t).label??Q(t).key??``}${e??``}`),[()=>Nt(Q(t).key)?` (mixed)`:``]),X(e,r)},$$slots:{default:!0}})}},o=e=>{{let n=q(()=>`device-param-`+Q(t).key),r=q(()=>Q(t).label??Q(t).key),i=q(()=>Number(Mt(Q(t).key)??Q(t).default??0)),a=q(()=>(Number(Q(t).max??1)-Number(Q(t).min??0))/240),o=q(()=>Q(t).step??.01),s=q(()=>Q(t).step&&Q(t).step>=1?0:2),c=q(()=>Nt(Q(t).key));hq(e,{get id(){return Q(n)},get label(){return Q(r)}
2321,get value(){return Q(i)},get min(){return Q(t).min},get max(){return Q(t).max},get step(){return Q(a)},get snap(){return Q(o)},get decimals(){return Q(s)},get mixed(){return Q(c)},onchange:e=>Rt(Q(t),e),onscrubstart:()=>Lt(Q(t).key),onscrubend:()=>Bt(Q(t).key)})}};G(r,e=>{Q(t).kind===`select`?e(i):Q(t).kind===`toggle`?e(a,1):e(o,-1)}),X(e,n)});var u=g(l,2),d=f(u);W(2),O(e=>Y(o,e),[()=>Sv(Q(kt).userData.device.kind)?.label??Q(kt).userData.device.kind]),L(`click`,d,()=>Vt()),X(e,n)},$$slots:{default:!0}})};G(R,e=>{Q(kt)&&e(se)});var ce=g(R,2),le=e=>{mq(e,{label:`Geometry`,children:(e,t)=>{var n=PBe(),i=N(n),a=f(i),o=g(i,2),s=e=>{var t=ABe(),n=f(t);O(e=>Y(n,`Only the ${Q(On).length??``} ${Q(Tn).gtype??``} object${Q(On).length===1?``:`s`} 2322 in this selection change â ${e??``} 2323 ${Q(kn).length===1?`has`:`have`} different parameters.`),[()=>Q(kn).join(`, `)]),X(e,t)};G(o,e=>{Q(kn).length&&e(s)});var c=g(o,2),u=e=>{var t=jBe(),n=g(N(t),2),r=e=>{Do(e,{id:`terrain-regenerate`,size:`xs`,color:`alternative`,onclick:()=>Mn(),children:(e,t)=>{W();var n=Te(`Regenerate (discards the sculpt)`);X(e,n)},$$slots:{default:!0}})};G(n,e=>{l().userData?.terrain&&e(r)}),X(e,t)},d=e=>{var t=NBe();B(t,21,()=>Q(En).params,e=>e.key,(e,t)=>{var n=fe(),i=N(n),a=e=>{{let n=q(()=>!!Q(Tn).params[Q(t).key]);xo(e,{get checked(){return Q(n)},onchange:e=>jn(Q(t).key,e.target.checked),children:(e,n)=>{W();var r=Te();O(()=>Y(r,Q(t).label)),X(e,r)},$$slots:{default:!0}})}},o=e=>{var n=MBe(),i=j(n),a=f(i,!0),o=g(i,2);B(o,20,()=>Q(t).options??[],e=>e,(e,n)=>{var i=GJ(),a=f(i,!0);O(e=>{b(i,`id`,`geo-choice-${Q(t).key}-${n}`),r(i,1,e,`svelte-1kmyk3f`),Y(a,n)},[()=>`ui-chip `+(String(Q(Tn).params[Q(t).key]??Q(t).def)===n?`bg-primary-600 text-white`:`bg-gray-600 text-gray-200 hover:bg-gray-500`)]),L(`click`,i,()=>jn(Q(t).key,n)),X(e,i)}),H(o),H(n),O(()=>Y(a,Q(t).label)),X(e,n)},s=e=>{{let n=q(()=>Q(t).min??0),r=q(()=>Q(t).max??10),i=q(()=>Q(t).kind===`int`?1:Q(t).step??.05),a=q(()=>Q(t).kind===`int`?0:2),o=q(()=>Number(Q(Tn).params[Q(t).key]??Q(t).def)),s=q(()=>An(Q(t).key,Q(t).def));xq(e,{get label(){return Q(t).label},get min(){return Q(n)},get max(){return Q(r)},get step(){return Q(i)},get decimals(){return Q(a)},get value(){return Q(o)},get mixed(){return Q(s)},onchange:e=>jn(Q(t).key,Q(t).kind===`int`?Math.round(e):e)})}};G(i,e=>{Q(t).kind===`bool`?e(a):Q(t).kind===`choice`?e(o,1):e(s,-1)}),X(e,n)}),H(t),X(e,t)};G(c,e=>{Q(Dn)?e(u):e(d,-1)}),O(()=>Y(a,`${Q(Tn).gtype??``}${Q(On).length>1?` · ${Q(On).length} objects`:``}`)),X(e,n)},$$slots:{default:!0}})};G(ce,e=>{Q(Tn)&&Q(En)&&e(le)});var ue=g(ce,2),de=e=>{mq(e,{label:`Group`,children:(e,t)=>{var n=FBe(),r=f(n);O((e,t)=>Y(r,`${l().children.length??``} direct child${l().children.length===1?``:`ren`}, 2324 ${e??``} object${t??``} in total.`),[()=>pr(l()),()=>pr(l())===1?``:`s`]),X(e,n)},$$slots:{default:!0}})};G(ue,e=>{Q(Cn)&&e(de)});var z=g(ue,2),pe=e=>{mq(e,{label:`Light`,children:(e,t)=>{var n=VBe(),r=N(n);{let e=q(()=>({...qq,wrapper:Jq}));Ee(r,()=>({"--picker-indicator-size":`20px`,"--cp-bg-color":`#1f2937`,"--cp-border-color":`#353f4e`,"--picker-height":`70px`,"--picker-width":`50px`,"--slider-width":`10px`})),Kq(r.lastChild,{isAlpha:!1,isTextInput:!0,textInputModes:[`hex`,`rgb`,`hsv`],isDialog:!1,get components(){return Q(e)},isOpen:!0,sliderDirection:`horizontal`,get hex(){return Q(Bn)},onInput:e=>{Hn(e.hex,Q(Bn))||(l().color.set(e.hex),I(Bn,e.hex,!0),Qn())}}),H(r)}var i=g(r,2),a=e=>{var t=IBe(),n=g(N(t),2);{let e=q(()=>({...qq,wrapper:Jq}));Ee(n,()=>({"--picker-indicator-size":`20px`,"--cp-bg-color":`#1f2937`,"--cp-border-color":`#353f4e`,"--picker-height":`70px`,"--picker-width":`50px`,"--slider-width":`10px`})),Kq(n.lastChild,{isAlpha:!1,isTextInput:!0,textInputModes:[`hex`,`rgb`,`hsv`],isDialog:!1,get components(){return Q(e)},isOpen:!0,sliderDirection:`horizontal`,get hex(){return Q(Vn)},onInput:e=>{Hn(e.hex,Q(Vn))||(l().groundColor.set(e.hex),I(Vn,e.hex,!0),Qn())}}),H(n)}X(e,t)};G(i,e=>{l().type===`HemisphereLight`&&e(a)});var o=g(i,2),s=g(j(o),2);hq(j(s),{label:`I`,accent:`text-yellow-300`,step:.02,min:0,snap:.5,get value(){return l().intensity},onchange:e=>{me(Di,K(l).intensity=e,K(l)),Di.update(e=>e),Qn()}}),H(s),H(o);var c=g(o,2);
2324B(c,1,()=>bde[l().type]??[],e=>e.key,(e,t)=>{{let n=q(()=>Q(t).min??0),r=q(()=>Q(t).max??10),i=q(()=>Q(t).step??.05),a=q(()=>Number(l()[Q(t).key]??0));xq(e,{get label(){return Q(t).label},get min(){return Q(n)},get max(){return Q(r)},get step(){return Q(i)},get value(){return Q(a)},onchange:e=>{me(Di,K(l)[Q(t).key]=e,K(l)),Di.update(e=>e),Qn()}})}});var u=g(c,2),d=e=>{var t=LBe(),n=N(t),r=g(j(n),2);{let e=q(()=>S()===l().uuid?`primary`:`alternative`);Do(r,{id:`light-aim-pick`,size:`xs`,get color(){return Q(e)},title:`Click a surface in the viewport to aim the light at it`,onclick:mn,children:(e,t)=>{W();var n=Te();O(()=>Y(n,S()===l().uuid?`Picking⦠(Esc)`:`Pick in viewport`)),X(e,n)},$$slots:{default:!0}})}H(n);var i=g(n,2);B(i,22,()=>[`X`,`Y`,`Z`],e=>e,(e,t,n)=>{hq(e,{get label(){return t},get accent(){return[`text-red-400`,`text-green-400`,`text-blue-400`][Q(n)]},step:.05,unit:`length`,get value(){return Q(dn)[Q(n)]},onchange:e=>pn(Q(n),e)})}),H(i);var a=g(i,2),o=g(j(a)),s=e=>{var t=Te(`A directional light has a direction, not a distance â the helper's line length is Settings ⸠Scene.`);X(e,t)};G(o,e=>{l().isDirectionalLight&&e(s)}),H(a),X(e,t)};G(u,e=>{Q(un)&&e(d)});var f=g(u,2),p=e=>{var t=zBe(),n=g(N(t),2);xo(n,{onchange:()=>Qn(),get checked(){return l().castShadow},set checked(e){me(Di,K(l).castShadow=e,K(l))},children:(e,t)=>{W();var n=Te(`Cast Shadow`);
2324X(e,n)},$$slots:{default:!0}});var r=g(n,2),i=g(j(r),2);{let e=q(()=>_de.map(e=>({value:e,name:e+` px`}))),t=q(()=>l().userData.shadowMapSize??l().shadow.mapSize.x);fq(i,{class:`flex-1`,get items(){return Q(e)},get value(){return Q(t)},onchange:e=>{mde(l(),+e),Di.update(e=>e),Qn()}})}H(r);var a=g(r,2),o=e=>{var t=RBe();X(e,t)},s=q(()=>vde(l().userData.shadowMapSize??l().shadow.mapSize.x)<(l().userData.shadowMapSize??l().shadow.mapSize.x));G(a,e=>{Q(s)&&e(o)});var c=g(a,2);xq(c,{label:`Bias`,min:-.01,max:.01,step:5e-4,decimals:4,get value(){return l().shadow.bias},onchange:e=>{me(Di,K(l).shadow.bias=e,K(l)),Qn()}}),xq(g(c,2),{label:`Softness`,min:0,max:10,step:.1,decimals:1,get value(){return l().shadow.radius},onchange:e=>{me(Di,K(l).shadow.radius=e,K(l)),Qn()}}),X(e,t)},m=q(()=>yde.includes(l().type));G(f,e=>{Q(m)&&e(p)});var h=g(f,2);xo(h,{onchange:()=>Qn(),get checked(){return l().visible},set checked(e){me(Di,K(l).visible=e,K(l))},children:(e,t)=>{W();var n=Te(`Visible`);X(e,n)},$$slots:{default:!0}});var _=g(h,2),v=e=>{var t=BBe();X(e,t)};G(_,e=>{l().type===`RectAreaLight`&&e(v)}),X(e,n)},$$slots:{default:!0}})};G(z,e=>{Q(bn)&&e(pe)});var V=g(z,2),he=e=>{mq(e,{label:`Material`,children:(e,t)=>{var n=tVe(),i=N(n),a=e=>{var t=HBe(),n=f(t);O(()=>Y(n,`Applies to ${Q(Et)??``} selected objects.`)),X(e,t)};G(i,e=>{Q(Et)&&e(a)});var o=g(i,2);xo(o,{onchange:()=>$n(`visible`),get checked(){return l().visible},set checked(e){me(Di,K(l).visible=e,K(l))},children:(e,t)=>{W();var n=Te(`Visible`);X(e,n)},$$slots:{default:!0}});var s=g(o,2),c=e=>{var t=GBe(),n=j(t),r=f(n,!0),i=g(n,2),a=j(i),o=g(a,2),s=e=>{var t=UBe();L(`click`,t,Yt),X(e,t)},c=e=>{var t=WBe();X(e,t)};G(o,e=>{Q(Jt).length?e(s):e(c,-1)}),H(i),H(t),O(()=>Y(r,Q(qt)?Q(Gt).length>1?`A shader graph drives all ${Q(Gt).length} selected materials.`:`A shader graph drives this material.`:`A shader graph drives ${Q(Gt).length} of ${Q(Tt).length} selected materials â edits below skip those.`)),L(`click`,a,()=>cy()),X(e,t)};G(s,e=>{Q(Gt).length&&e(c)});var d=g(s,2),p=e=>{var t=KBe(),n=j(t),r=f(n),i=g(n,2),a=f(i);H(t),O(()=>Y(r,`This material is shared with ${Q(Ut).length??``} 2325 other object${Q(Ut).length===1?``:`s`} â editing it here changes 2326 ${Q(Ut).length===1?`that one`:`them`} too, for everyone.`)),L(`click`,a,Wt),X(e,t)};G(d,e=>{Q(Ut).length&&e(p)});var m=g(d,2),h=e=>{var t=eVe(),n=N(t);fq(n,{id:`select-material`,get items(){return Pn},get value(){return Q(Nn).type},onchange:e=>{tn(`Material type`,t=>bfe(t.uuid,e)),Di.update(e=>e)}});var i=g(n,2),a=e=>{var t=YJ(),n=N(t);{let e=q(()=>({...qq,wrapper:Jq}));Ee(n,()=>({"--picker-indicator-size":`20px`,"--cp-bg-color":`#1f2937`,"--cp-border-color":`#353f4e`,"--picker-height":`70px`,"--picker-width":`50px`,"--slider-width":`10px`})),Kq(n.lastChild,{isAlpha:!1,isTextInput:!0,textInputModes:[`hex`,`rgb`,`hsv`],isDialog:!1,get components(){return Q(e)},isOpen:!0,sliderDirection:`horizontal`,get hex(){return Q(Bn)},onInput:e=>{if(!Hn(e.hex,Q(Bn))){I(Bn,e.hex,!0),Gn(e.hex);for(let t of Q(Tt))t.material.color.set(e.hex),t.material.needsUpdate=!0,ee().send({type:`color`,uuid:t.uuid,color:e.hex});ci()}}}),H(n)}X(e,t)};G(i,e=>{Q(Nn).color&&Q(Nn).type!==`MeshNormalMaterial`&&e(a)});var o=g(i,2),s=e=>{var t=YBe(),n=N(t),i=f(n),a=g(n,2),o=j(a),s=g(o,2),c=j(s),l=e=>{var t=qBe(),n=N(t),r=g(n,2);Do(r,{size:`xs`,color:`alternative`,onclick:()=>ir(async e=>Wv(e),`Remove texture`),children:(e,t)=>{W();var n=Te(`Remove`);X(e,n)},$$slots:{default:!0}}),O(()=>b(n,`src`,Q(Nn).userData.mapDataUrl)),L(`click`,n,()=>document.getElementById(`texture-file`)?.click()),X(e,t)},u=e=>{var t=JBe(),n=N(t);Do(n,{size:`xs`,color:`alternative`,onclick:()=>document.getElementById(`texture-file`)?.click(),children:(e,t)=>{W();var n=Te(`Set texture...`);X(e,n)},$$slots:{default:!0}}),W(2),X(e,t)};G(c,e=>{Q(Nn).userData?.mapDataUrl?e(l):e(u,-1)}),H(s),H(a),O(()=>{Y(i,`Texture${Q(Et)?` â applies to all ${Q(Et)}`:``}`),r(a,1,`rounded-sm border border-dashed ${Q(Fn)?`border-primary-500 bg-primary-500/10`:`border-transparent`}`)}),Z(`dragover`,a,e=>{e.dataTransfer?.types.includes(`application/x-explorer-item`)&&(e.preventDefault(),I(Fn,!0))}),Z(`dragleave`,a,()=>I(Fn,!1)),Z(`drop`,a,async e=>{let t=e.dataTransfer?.getData(`application/x-explorer-item`);if(I(Fn,!1),!t)return;e.preventDefault(),e.stopPropagation();let n=JSON.parse(t);await ir(e=>tJ(e,n),`Texture`)}),L(`change`,o,e=>{let t=e.currentTarget.files?.[0];t&&ar(t),e.currentTarget.value=``}),X(e,t)};G(o,e=>{Q(Nn).map!==void 0&&e(s)});var c=g(o,2),l=e=>{var t=XBe(),n=N(t);{let e=q(()=>rn(e=>e.material.roughness));
2326xq(n,{label:`Roughness`,min:0,max:1,step:.05,get value(){return Q(Nn).roughness},get mixed(){return Q(e)},onchange:e=>rr(`roughness`,e)})}var r=g(n,2);{let e=q(()=>rn(e=>e.material.metalness));xq(r,{label:`Metalness`,min:0,max:1,step:.05,get value(){return Q(Nn).metalness},get mixed(){return Q(e)},onchange:e=>rr(`metalness`,e)})}X(e,t)};G(c,e=>{(Q(Nn).type===`MeshStandardMaterial`||Q(Nn).type===`MeshPhysicalMaterial`)&&e(l)});var d=g(c,2),p=e=>{var t=JJ(),n=N(t);{let e=q(()=>rn(e=>e.material.clearcoat));xq(n,{label:`Clearcoat`,min:0,max:1,step:.05,get value(){return Q(Nn).clearcoat},get mixed(){return Q(e)},onchange:e=>rr(`clearcoat`,e)})}var r=g(n,2);{let e=q(()=>rn(e=>e.material.clearcoatRoughness));xq(r,{label:`Clearcoat rough`,min:0,max:1,step:.05,get value(){return Q(Nn).clearcoatRoughness},get mixed(){return Q(e)},onchange:e=>rr(`clearcoatRoughness`,e)})}var i=g(r,2);{let e=q(()=>rn(e=>e.material.transmission));xq(i,{label:`Transmission`,min:0,max:1,step:.05,get value(){return Q(Nn).transmission},get mixed(){return Q(e)},onchange:e=>rr(`transmission`,e)})}var a=g(i,2);{let e=q(()=>rn(e=>e.material.ior));xq(a,{label:`IOR`,min:1,max:2.333,step:.01,decimals:2,get value(){return Q(Nn).ior},get mixed(){return Q(e)},onchange:e=>rr(`ior`,e)})}X(e,t)};G(d,e=>{Q(Nn).type===`MeshPhysicalMaterial`&&e(p)});var m=g(d,2),h=e=>{{let t=q(()=>rn(e=>e.material.shininess));xq(e,{label:`Shininess`,min:0,max:100,step:1,decimals:0,get value(){return Q(Nn).shininess},get mixed(){return Q(t)},onchange:e=>rr(`shininess`,e)})}};G(m,e=>{Q(Nn).type===`MeshPhongMaterial`&&e(h)});var _=g(m,2),y=e=>{var t=ZBe();X(e,t)};G(_,e=>{(Q(Nn).type===`MeshNormalMaterial`||Q(Nn).type===`MeshDepthMaterial`)&&e(y)});var x=g(_,2),S=e=>{{let t=q(()=>rn(e=>e.material.opacity));xq(e,{label:`Opacity`,min:0,max:1,step:.05,get value(){return Q(Nn).opacity},get mixed(){return Q(t)},onchange:e=>tn(`Opacity`,t=>{zv(t.uuid,`transparent`,e<1),zv(t.uuid,`opacity`,e)})})}};G(x,e=>{Q(Nn).opacity!==void 0&&Q(Nn).type!==`ShadowMaterial`&&e(S)});var C=g(x,2),w=e=>{xo(e,{get checked(){return Q(Nn).wireframe},onchange:e=>rr(`wireframe`,e.target.checked),children:(e,t)=>{W();var n=Te(`Wireframe`);X(e,n)},$$slots:{default:!0}})};G(C,e=>{Q(Nn).wireframe!==void 0&&e(w)});var T=g(C,2),E=e=>{xo(e,{get checked(){return Q(Nn).flatShading},onchange:e=>rr(`flatShading`,e.target.checked),children:(e,t)=>{W();var n=Te(`Flat shading`);X(e,n)},$$slots:{default:!0}})};G(T,e=>{`flatShading`in Q(Nn)&&e(E)});var D=g(T,2),k=e=>{var t=QBe();fq(g(j(t),2),{class:`flex-1`,items:[{value:0,name:`Front`},{value:1,name:`Back`},{value:2,name:`Double`}],get value(){return Q(Nn).side},onchange:e=>rr(`side`,+e)}),H(t),X(e,t)};G(D,e=>{Q(Nn).side!==void 0&&e(k)});var A=g(D,2),M=e=>{var t=$Be(),n=g(N(t),2);{let e=q(()=>Q(Nn).emissiveIntensity??1),t=q(()=>rn(e=>e.material.emissiveIntensity));xq(n,{label:`Strength`,min:0,max:5,step:.05,get value(){return Q(e)},get mixed(){return Q(t)},onchange:e=>rr(`emissiveIntensity`,e)})}var r=g(n,2),i=g(j(r),2);v(i),W(2),H(r),O(e=>u(i,e),[()=>`#`+Q(Nn).emissive.getHexString()]),L(`input`,i,e=>rr(`emissive`,e.currentTarget.value)),X(e,t)};G(A,e=>{Q(Nn).emissive&&e(M)}),X(e,t)};G(m,e=>{Q(qt)||e(h)});var _=g(m,4),y=j(_);xo(y,{onchange:()=>er(),get checked(){return l().castShadow},set checked(e){me(Di,K(l).castShadow=e,K(l))},children:(e,t)=>{W();var n=Te(`Cast`);X(e,n)},$$slots:{default:!0}});var x=g(y,2);xo(x,{onchange:()=>$n(`receiveShadow`),get checked(){return l().receiveShadow},set checked(e){me(Di,K(l).receiveShadow=e,K(l))},children:(e,t)=>{W();var n=Te(`Receive`);X(e,n)},$$slots:{default:!0}}),H(_),X(e,n)},$$slots:{default:!0}})};G(V,e=>{Q(Nn)&&e(he)});var ge=g(V,2),U=e=>{GLe(e,{get object(){return l()}})};G(ge,e=>{l().userData?.fluid&&e(U)});var _e=g(ge,2),ve=e=>{var t=qJ(),n=N(t);mq(n,{label:`Physics`,children:(e,t)=>{var n=aVe(),r=N(n),i=e=>{var t=nVe(),n=f(t);O(()=>Y(n,`Applies to ${Q(wt)??``} selected objects.`)),X(e,t)};G(r,e=>{Q(wt)&&e(i)});var a=g(r,2),o=g(j(a),2);{let e=q(()=>l().userData.physics?.mode??`auto`);fq(o,{id:`physics-mode`,items:[{value:`auto`,name:`Auto (scenery)`}
2326,{value:`static`,name:`Static`},{value:`dynamic`,name:`Dynamic`}],get value(){return Q(e)},onchange:e=>nr({mode:e})})}H(a);var s=g(a,2),c=e=>{{let t=q(()=>l().userData.physics?.mass??1),n=q(()=>nn(e=>e.userData.physics?.mass??1));xq(e,{label:`Mass`,min:.1,max:100,step:.1,get value(){return Q(t)},get mixed(){return Q(n)},onchange:e=>nr({mass:e})})}};G(s,e=>{(l().userData.physics?.mode??`auto`)===`dynamic`&&e(c)});var u=g(s,2),d=g(j(u),2);{let e=q(()=>or(l().userData.physics));fq(d,{id:`physics-material`,items:[{value:`custom`,name:`Custom`},{value:`ice`,name:`Ice`},{value:`rubber`,name:`Rubber`},{value:`wood`,name:`Wood`},{value:`metal`,name:`Metal`}],get value(){return Q(e)},onchange:e=>{let t=sh[e];t&&nr({restitution:t.restitution,friction:t.friction})}})}H(u);var p=g(u,2);{let e=q(()=>l().userData.physics?.restitution??.3),t=q(()=>nn(e=>e.userData.physics?.restitution??.3));xq(p,{label:`Bounciness`,min:0,max:1,step:.05,get value(){return Q(e)},get mixed(){return Q(t)},onchange:e=>nr({restitution:e})})}var m=g(p,2);{let e=q(()=>l().userData.physics?.friction??.5),t=q(()=>nn(e=>e.userData.physics?.friction??.5));xq(m,{label:`Friction`,min:0,max:2,step:.05,get value(){return Q(e)},get mixed(){return Q(t)},onchange:e=>nr({friction:e})})}var h=g(m,2),_=g(j(h),2);{let e=q(()=>[{value:`box`,name:`Box`},{value:`sphere`,name:`Sphere`},{value:`capsule`,name:`Capsule`},{value:`cylinder`,name:`Cylinder`},{value:`cone`,name:`Cone`},{value:`hull`,name:`Convex hull`},...(l().userData.physics?.mode??`auto`)===`dynamic`?[]:[{value:`trimesh`,name:`Exact mesh (static)`}],{value:`custom`,name:`Custom (editâ¦)`}]),t=q(()=>l().userData.physics?.collider??Pre(l())??`box`);fq(_,{id:`physics-collider`,get items(){return Q(e)},get value(){return Q(t)},onchange:e=>{e===`custom`?eI(l().uuid):nr({collider:e})}})}H(h);var v=g(h,2),y=e=>{var t=rVe();L(`click`,t,()=>eI(l().uuid)),X(e,t)};G(v,e=>{(l().userData.physics?.collider??`box`)===`custom`&&e(y)});var b=g(v,2),x=e=>{Cze(e,{get uuid(){return l().uuid}})};G(b,e=>{(l().isMesh||l().children?.length)&&e(x)});var S=g(b,2);{let e=q(()=>!!l().userData.physics?.sensor);xo(S,{id:`physics-sensor`,get checked(){return Q(e)},onchange:e=>nr({sensor:e.currentTarget.checked||null}),children:(e,t)=>{W();var n=Te(`Sensor â no collision, fires On Enter / On Exit`);X(e,n)},$$slots:{default:!0}})}var C=g(S,2);fze(C,{get physics(){return l().userData.physics},get water(){return l().userData.water},onchange:nr});var w=g(C,2),T=e=>{var t=iVe(),n=N(t),r=g(j(n),2);B(r,16,()=>[[`rx`,`X`],[`ry`,`Y`],[`rz`,`Z`]],([e,t])=>e,(e,t)=>{var n=q(()=>A(t,2));let r=()=>Q(n)[0],i=()=>Q(n)[1];{let t=q(()=>!!l().userData.physics?.freeze?.[r()]);xo(e,{get checked(){return Q(t)},onchange:e=>sr(r(),e.currentTarget.checked),children:(e,t)=>{W();var n=Te();O(()=>Y(n,i())),X(e,n)},$$slots:{default:!0}})}}),H(n);var i=g(n,2),a=g(j(i),2);B(a,16,()=>[[`px`,`X`],[`py`,`Y`],[`pz`,`Z`]],([e,t])=>e,(e,t)=>{var n=q(()=>A(t,2));let r=()=>Q(n)[0],i=()=>Q(n)[1];{let t=q(()=>!!l().userData.physics?.freeze?.[r()]);xo(e,{get checked(){return Q(t)},onchange:e=>sr(r(),e.currentTarget.checked),children:(e,t)=>{W();var n=Te();O(()=>Y(n,i())),X(e,n)},$$slots:{default:!0}})}}),H(i),HLe(g(i,2),{get object(){return l()},setPhysics:nr}),X(e,t)};G(w,e=>{(l().userData.physics?.mode??`auto`)===`dynamic`&&e(T)});var E=g(w,2);{let e=q(()=>Ye().has(l().uuid));xo(E,{id:`physics-show-collider`,get checked(){return Q(e)},onchange:e=>eF(l().uuid,e.currentTarget.checked),children:(e,t)=>{W();var n=Te(`Show collider â this device`);X(e,n)},$$slots:{default:!0}})}W(2),X(e,n)},$$slots:{default:!0}});var r=g(n,2),i=e=>{mq(e,{label:`Spline`,children:(e,t)=>{var n=sVe(),r=N(n),i=f(r),a=g(r,2),o=g(j(a),2);v(o),H(a);var s=g(a,2);{let e=q(()=>Q(Sn)??Q(xn).points[0].radius);xq(s,{id:`spline-thickness`,label:`Thickness`,min:.005,max:1,step:.005,decimals:3,get value(){return Q(e)},onchange:e=>C_(l().uuid,e)})}var c=g(s,2),d=e=>{var t=oVe(),n=g(j(t),2);Do(n,{size:`xs`,color:`alternative`,onclick:()=>w_(l().uuid,1.25),children:(e,t)=>{W();var n=Te(`Thicker`);X(e,n)},$$slots:{default:!0}});var r=g(n,2);Do(r,{size:`xs`,color:`alternative`,onclick:()=>w_(l().uuid,.8),children:(e,t)=>{W();var n=Te(`Thinner`);X(e,n)},$$slots:{default:!0}}),H(t),X(e,t)};G(c,e=>{Q(Sn)===null&&e(d)});var p=g(c,2);xq(p,{id:`spline-sides-row`,label:`Sides`,min:3,max:32,step:1,decimals:0,get value(){return Q(xn).radialSegments},onchange:e=>O_(l().uuid,Math.round(e))});var m=g(p,2);xq(m,{id:`spline-smoothness`,label:`Smoothness`,min:2,max:48,step:1,decimals:0,get value(){return Q(xn).segmentsPerSpan},onchange:e=>Dle(l().uuid,Math.round(e))});var h=g(m,2);xo(h,{get checked(){return Q(xn).closed},onchange:e=>D_(l().uuid,e.target.checked),children:(e,t)=>{W();var n=Te(`Closed loop`);
2326X(e,n)},$$slots:{default:!0}});var _=g(h,2);Do(_,{id:`spline-edit-open`,size:`xs`,color:`alternative`,onclick:()=>Xe()===l().uuid?NM():MM(l().uuid),children:(e,t)=>{W();var n=Te();O(()=>Y(n,Xe()===l().uuid?`Close spline editor`:`Edit control points`)),X(e,n)},$$slots:{default:!0}});var y=g(_,6),b=j(y);Do(b,{id:`spline-carve-pick`,size:`xs`,color:`alternative`,onclick:()=>$(()=>import(`../chunks/CKkrQfIm.js`).then(e=>e.startFlattenPick(`carve`,l().uuid)),[],import.meta.url),children:(e,t)=>{W();var n=Te(`Terrain to thisâ¦`);X(e,n)},$$slots:{default:!0}});var x=g(b,2);Do(x,{id:`spline-drape-pick`,size:`xs`,color:`alternative`,onclick:()=>$(()=>import(`../chunks/CKkrQfIm.js`).then(e=>e.startFlattenPick(`drape`,l().uuid)),[],import.meta.url),children:(e,t)=>{W();var n=Te(`This onto a surfaceâ¦`);X(e,n)},$$slots:{default:!0}}),H(y);var S=g(y,2),C=j(S),w=e=>{var t=Te();O(()=>Y(t,`Click the ${$e().kind===`carve`?`terrain`:`surface`} in the viewport â Esc cancels.`)),X(e,t)},T=e=>{var t=Te(`Either level a strip of ground under this spline, or drop this spline onto a surface and 2327 leave the surface alone. One undo step each.`);X(e,t)};G(C,e=>{$e()?e(w):e(T,-1)}),H(S),O(()=>{Y(i,`${Q(xn).points.length??``} control points`),u(o,Q(xn).color)}),L(`change`,o,e=>Ele(l().uuid,e.currentTarget.value)),X(e,n)},$$slots:{default:!0}})};G(r,e=>{Q(xn)&&e(i)});var a=g(r,2),o=e=>{mq(e,{label:`Particles`,children:(e,t)=>{var n=cVe(),r=f(n);O(()=>Y(r,`${Q(wt)??``} objects selected â an emitter is edited one object at a time so tuned 2328 configs are not overwritten. Right-click the selection for Particles ⸠Add, Burst or 2329 Remove across all ${Q(wt)??``}.`)),X(e,n)},$$slots:{default:!0}})},s=e=>{mq(e,{label:`Particles`,children:(e,t)=>{var n=fe(),r=N(n),i=e=>{var t=lVe(),n=g(j(t),2);{let e=q(()=>[{value:`none`,name:`Add emitterâ¦`},...Ju.map(e=>({value:e.key,name:e.name}))]);fq(n,{id:`particles-add`,get items(){return Q(e)},value:`none`,onchange:e=>{e!==`none`&&mh(l().uuid,e)}})}H(t),X(e,t)},a=e=>{let t=q(()=>l().userData.particles);var n=hVe(),r=N(n),i=g(j(r),2);{let e=q(()=>Ju.map(e=>({value:e.key,name:e.name}))),n=q(()=>Q(t).preset??`sparkles`);fq(i,{id:`particles-preset`,get items(){return Q(e)},get value(){return Q(n)},onchange:e=>mh(l().uuid,e)})}H(r);var a=g(r,2),o=g(j(a),2);{let e=q(()=>Q(t).mode??`continuous`);fq(o,{id:`particles-mode`,items:[{value:`continuous`,name:`Continuous`},{value:`burst`,name:`Burst (triggered)`},{value:`impact`,name:`On impact (physics)`}],get value(){return Q(e)},onchange:e=>tr({mode:e})})}H(a);var s=g(a,2),c=e=>{var t=uVe();X(e,t)};G(s,e=>{(Q(t).mode??`continuous`)===`impact`&&e(c)});var d=g(s,2),f=e=>{var t=fVe(),n=j(t);Do(n,{size:`xs`,color:`alternative`,onclick:()=>ph(l().uuid),children:(e,t)=>{var n=dVe(),r=N(n);gS(r,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}}),W(2),H(t),X(e,t)};G(d,e=>{(Q(t).mode??`continuous`)!==`continuous`&&e(f)});var p=g(d,2);{let e=q(()=>Q(t).count??80);xq(p,{label:`Count`,min:1,max:500,step:1,get value(){return Q(e)},onchange:e=>tr({count:e})})}var m=g(p,2);{let e=q(()=>Q(t).lifetime??1.5);xq(m,{label:`Lifetime`,min:.1,max:6,step:.1,get value(){return Q(e)},onchange:e=>tr({lifetime:e})})}var h=g(m,2);{let e=q(()=>Q(t).speed??1);xq(h,{label:`Speed`,min:0,max:8,step:.1,get value(){return Q(e)},onchange:e=>tr({speed:e})})}var _=g(h,2);{let e=q(()=>Q(t).gravity??0);xq(_,{label:`Gravity`,min:-10,max:10,step:.1,get value(){return Q(e)},onchange:e=>tr({gravity:e})})}var y=g(_,2),b=e=>{var n=pVe(),r=N(n);{let e=q(()=>Q(t).area?.[0]??8);xq(r,{label:`Area width`,min:.5,max:60,step:.5,get value(){return Q(e)},onchange:e=>tr({area:[e,Q(t).area?.[1]??8]})})}var i=g(r,2);{let e=q(()=>Q(t).area?.[1]??8);xq(i,{label:`Area depth`,min:.5,max:60,step:.5,get value(){return Q(e)},onchange:e=>tr({area:[Q(t).area?.[0]??8,e]})})}var a=g(i,2);{let e=q(()=>Q(t).wind?.[0]??0);xq(a,{label:`Wind X`,min:-10,max:10,step:.05,get value(){return Q(e)},onchange:e=>tr({wind:[e,0,Q(t).wind?.[2]??0]})})}var o=g(a,2);{let e=q(()=>Q(t).wind?.[2]??0);
2329xq(o,{label:`Wind Z`,min:-10,max:10,step:.05,get value(){return Q(e)},onchange:e=>tr({wind:[Q(t).wind?.[0]??0,0,e]})})}var s=g(o,2);{let e=q(()=>Q(t).fall??0);xq(s,{label:`Ground below`,min:0,max:40,step:.1,get value(){return Q(e)},onchange:e=>tr({fall:e})})}var c=g(s,2),l=g(j(c),2);{let e=q(()=>Q(t).ground??`none`);fq(l,{id:`particles-ground`,items:[{value:`splash`,name:`Splash (rain)`},{value:`settle`,name:`Settle (snow)`},{value:`none`,name:`Fall through`}],get value(){return Q(e)},onchange:e=>tr({ground:e})})}H(c),X(e,n)};G(y,e=>{Q(t).shape===`box`&&e(b)});var x=g(y,2);{let e=q(()=>Q(t).turbulence??.2);xq(x,{label:`Turbulence`,min:0,max:1,step:.05,get value(){return Q(e)},onchange:e=>tr({turbulence:e})})}var S=g(x,2);{let e=q(()=>Q(t).sizeStart??.1);xq(S,{label:`Size start`,min:.01,max:1,step:.01,get value(){return Q(e)},onchange:e=>tr({sizeStart:e})})}var C=g(S,2);{let e=q(()=>Q(t).sizeEnd??.03);xq(C,{label:`Size end`,min:0,max:1,step:.01,get value(){return Q(e)},onchange:e=>tr({sizeEnd:e})})}var w=g(C,2);{let e=q(()=>Q(t).opacity??.9);xq(w,{label:`Opacity`,min:0,max:1,step:.05,get value(){return Q(e)},onchange:e=>tr({opacity:e})})}var T=g(w,2),E=g(j(T),2);B(E,16,()=>[`x`,`y`,`z`],Be,(e,n,r)=>{var i=mVe(),a=j(i);{let e=q(()=>(Q(t).offset??[0,0,0])[r]??0),i=q(()=>`Emit offset `+n);hq(a,{get value(){return Q(e)},decimals:2,step:.01,snap:.1,get ariaLabel(){return Q(i)},onchange:e=>{let n=[...Q(t).offset??[0,0,0]];n[r]=e,tr({offset:n})}})}H(i),X(e,i)}),H(T);var D=g(T,2),k=g(j(D),2);v(k);var A=g(k,4);v(A),H(D);var ee=g(D,2),M=g(j(ee),2);{let e=q(()=>Q(t).sprite??`dot`);fq(M,{id:`particles-sprite`,items:[{value:`dot`,name:`Soft dot`},{value:`streak`,name:`Spark streak`},{value:`puff`,name:`Smoke puff`},{value:`star`,name:`Star`},{value:`square`,name:`Confetti`}],get value(){return Q(e)},onchange:e=>tr({sprite:e})})}H(ee);var te=g(ee,2),ne=g(j(te),2);{let e=q(()=>Q(t).blending??`additive`);fq(ne,{id:`particles-blending`,items:[{value:`additive`,name:`Additive (glow)`},{value:`normal`,name:`Normal`}],get value(){return Q(e)},onchange:e=>tr({blending:e})})}H(te);var P=g(te,2),re=g(j(P),2);{let e=q(()=>Q(t).space??`local`);fq(re,{id:`particles-space`,items:[{value:`local`,name:`Local (rides object)`},{value:`world`,name:`World (trails behind)`}],get value(){return Q(e)},onchange:e=>tr({space:e})})}H(P);var ie=g(P,2),F=j(ie);Do(F,{size:`xs`,color:`red`,onclick:()=>fh(l().uuid),children:(e,t)=>{W();var n=Te(`Remove emitter`);X(e,n)},$$slots:{default:!0}}),H(ie),O(()=>{u(k,Q(t).colorStart??`#ffffff`),u(A,Q(t).colorEnd??`#8899aa`)}),L(`input`,k,e=>tr({colorStart:e.currentTarget.value})),L(`input`,A,e=>tr({colorEnd:e.currentTarget.value})),X(e,n)};G(r,e=>{l().userData.particles?e(a,-1):e(i)}),X(e,n)},$$slots:{default:!0}})};G(a,e=>{Q(wt)?e(o):e(s,-1)}),X(e,t)};G(_e,e=>{l().isLight||e(ve)}),H(o),O(()=>u(a,ae())),L(`input`,a,e=>us.set(e.currentTarget.value)),L(`keydown`,a,e=>e.key===`Escape`&&us.set(``)),X(e,t)};G(a,e=>{w()===`file`?e(o):w()===`scene`?e(c,1):m()&&!p().length?e(h,2):l()?.name!==void 0&&e(x,3)}),H(t),O(()=>{Ze(t,`bottom: calc(var(--bottom-inset, 0px) + var(--controls-inset, 0px)); z-index: calc(var(--z-bottom) - 1); height: auto; --inspector-h: `+Q(ht)+`px`),r(t,1,`fixed inset-e-0 top-16 z-50 w-80 overflow-y-auto bg-white p-4 dark:bg-gray-800 rounded-tl-lg pt-0`+(Q(ft)?` rounded-bl-lg`:``),`svelte-1kmyk3f`)}),L(`pointerdown`,n,_t),L(`pointermove`,n,vt),L(`pointerup`,n,yt),Me(3,t,()=>To,()=>Q(mt)),X(e,t)};G(Or,e=>{o()||e(kr)}),X(e,Dr),ue(),tt()}ge([`pointerdown`,`pointermove`,`pointerup`,`change`,`click`,`input`,`keydown`]);var yVe=960,XJ=Ue(null);function ZJ(e,t){return new Promise(n=>e.toBlob(e=>n(e),`image/jpeg`,t))}async function bVe(e,t,n){e.render(t,n);let r=e.domElement,i=Math.min(1,960/Math.max(r.width||1,r.height||1)),a=document.createElement(`canvas`);a.width=Math.max(1,Math.round(r.width*i)),a.height=Math.max(1,Math.round(r.height*i));let o=a.getContext(`2d`);return o?(o.drawImage(r,0,0,a.width,a.height),ZJ(a,.72)):null}async function xVe(e,t){let n=e.xr.getCamera(),r=n?.cameras?.[0]??n,i=r?.viewport,a=i&&i.w>0&&i.z>0?i.z/i.w:1,o=a>=1?960:Math.round(960*a),s=a>=1?Math.round(960/a):960,c=new pt;c.matrixAutoUpdate=!1,c.matrixWorldAutoUpdate=!1,c.matrixWorld.copy(r.matrixWorld),c.matrixWorldInverse.copy(r.matrixWorld).invert(),c.matrixWorld.decompose(c.position,c.quaternion,c.scale),c.projectionMatrix.copy(r.projectionMatrix),c.projectionMatrixInverse.copy(r.projectionMatrix).invert(),c.layers.mask=r.layers.mask;let l=new at(o,s);
2329l.texture.colorSpace=sr;let u=e.getRenderTarget(),d=new Uint8Array(o*s*4),f=e.xr.enabled;try{e.xr.enabled=!1,e.setRenderTarget(l),e.clear(),e.render(t,c),e.readRenderTargetPixels(l,0,0,o,s,d)}finally{e.xr.enabled=f,e.setRenderTarget(u),l.dispose()}let p=document.createElement(`canvas`);p.width=o,p.height=s;let m=p.getContext(`2d`);if(!m)return null;let h=m.createImageData(o,s);for(let e=0;e<s;e++)h.data.set(d.subarray((s-1-e)*o*4,(s-e)*o*4),e*o*4);return m.putImageData(h,0,0),ZJ(p,.72)}async function QJ(){let e=U(xi),t=U(Pi),n=U(yi);if(!e||!t)return null;try{return e.xr?.isPresenting?await xVe(e,t):n?await bVe(e,t,n):null}catch(e){return console.warn(`moment screenshot failed`,e),null}}function SVe(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}async function $J(){xc(`moment`,null);let e=ew(I_e,{kind:`moment`,session:Z_e});e.events.push({t:e.meta.durationMs??3e4,kind:`moment`,detail:null});let t=await QJ();return{doc:e,shot:t,shotUrl:t?URL.createObjectURL(t):null,at:Date.now()}}async function eY(e,t={}){let n=String(t.note??``).trim().slice(0,1e3),r=e.doc.meta.durationMs??3e4,i=`Moment `+new Date(e.doc.meta.startedAt+r).toISOString().slice(0,19).replace(`T`,` `),a=structuredClone(e.doc);a.meta.name=i,a.notes=[{t:r,...n?{text:n}:{},...e.shot?{screenshot:await SVe(e.shot)}:{}}];let o=await z_e(a),s=!1;if(t.send&&aw()){let t=structuredClone(e.doc);t.notes=[{t:r,...n?{text:n}:{},...e.shot?{screenshot:`moment.jpg`}:{}}];let i=e.shot&&e.shot.size<=1048576?e.shot:null;JSON.stringify(t).length<=L_e.moment.bytes&&(s=await X_e(`moment`,t,i))}return e.shotUrl&&URL.revokeObjectURL(e.shotUrl),{id:o,sent:s}}async function tY(){let e=await $J();return XJ.set(e),e}async function nY(e){let t=U(XJ);if(XJ.set(null),!t)return null;if(!e)return t.shotUrl&&URL.revokeObjectURL(t.shotUrl),null;let n=await eY(t,e);return es(n.sent?`Moment saved and sent â thank you`:`Moment saved (Profiler ⸠recordings)`),n}async function CVe(e){let t=await $J(),n=U(rw)&&!!aw(),r=e=>eY(t,{note:e,send:n}).then(e=>(es(e.sent?`Moment saved and sent`:`Moment saved`),e));return e?new Promise(t=>{e({title:`What happened? (optional)`,initial:``,onCommit:e=>t(r(e)),onCancel:()=>t(r(``))})}):r(``)}var wVe=V(`<button id="format-gltf" title="Exports the scene as glTF â for other tools, not for keeping your work">GLTF</button>`),TVe=V(`<button id="format-json" title="Saves the scene as raw JSON">JSON</button>`),EVe=V(`<div id="format-row-optional" class="mb-0.5 flex gap-1 pl-9 pr-2"><!> <!></div>`),DVe=V(`<div id="sidebar-cloud-slot" class="side-cloud svelte-18w4jbg"><!></div>`),OVe=V(`<span class="side-hint svelte-18w4jbg"> </span>`),kVe=V(`<button><span class="side-ico svelte-18w4jbg"><!></span> <span class="flex-1 whitespace-nowrap"> </span> <!></button>`),AVe=V(`<nav id="sidebar70" class="app-sidebar fixed rounded-xl border border-gray-200 bg-white/95 p-1.5 text-gray-900 shadow-xl backdrop-blur-sm dark:border-gray-700 dark:bg-gray-800/95 dark:text-gray-100 svelte-18w4jbg"><input type="file" id="import-file" multiple="" style="display: none" accept=".gltf, .glb, .obj, .stl, .fbx, .mtl, .png, .jpg, .jpeg, .webp"/> <input type="file" id="load-file" style="display: none" accept=".json, .tpscene, .tp"/> <button id="open-templates" class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Templates</span></button> <div class="side-div svelte-18w4jbg"></div> <button class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Import</span></button> <button class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Load</span></button> <button class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Save</span></button> <div id="format-row" class="mb-0.5 mt-0.5 flex gap-1 pl-9 pr-2"><button id="format-tp" title="Saves the whole project as .tp â the Explorer library, scene history and manifest">Project</button> <button id="format-tpscene" title="Saves the open scene as .tpscene">Scene</button> <button id="export-settings-cog" class="side-seg svelte-18w4jbg" title="Export settings"><!></button></div> <!> <!> <button id="open-publish-export" class="side-row svelte-18w4jbg" data-tour="publish-export"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Publish / Export</span></button> <div class="side-div svelte-18w4jbg"></div> <button><span class="side-ico svelte-18w4jbg"><!></span> <span class="flex-1 whitespace-nowrap">
2329Configure Scene</span></button> <button id="clear-scene" class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Clear Scene</span></button> <button id="open-modules-manager" class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Modules</span></button> <!> <button id="open-sessions-manager" class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Sessions</span></button> <div class="side-div svelte-18w4jbg"></div> <button id="open-stats" class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Statistics</span></button> <button id="report-moment" class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Report this moment</span></button> <button class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Settings</span></button> <button class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Docs</span></button> <button id="open-whats-new" class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg">â¨</span> <span class="flex-1 whitespace-nowrap">What's new</span> <span></span></button> <button id="open-tour" class="side-row svelte-18w4jbg"><span class="side-ico svelte-18w4jbg"><!></span><span class="flex-1 whitespace-nowrap">Tours</span></button></nav>`),jVe=V(`<button class="fixed inset-0 cursor-default bg-black/40" style="z-index: calc(var(--z-menu) + 1)" aria-label="Close export settings"></button> <div id="export-settings-modal" class="fixed w-64 max-w-[92vw] rounded-lg border border-gray-700 bg-gray-800 p-4 text-sm text-gray-100 shadow-2xl"><p class="mb-2 font-semibold">Export settings</p> <p class="mb-1 text-[11px] text-gray-400">Scene (.tpscene) includes:</p> <label class="flex items-center gap-2 py-0.5"><input class="tp-check" type="checkbox"/> Assets (audio, textures, configs)</label> <label class="flex items-center gap-2 py-0.5"><input id="tpscene-packs" class="tp-check" type="checkbox"/> Imported packs</label> <label class="flex items-center gap-2 py-0.5"><input id="tpscene-flow" class="tp-check" type="checkbox"/> Flow graph (nodes + edges)</label> <div class="my-2 border-t border-gray-700"></div> <p class="mb-1 text-[11px] text-gray-400">Project (.tp) includes:</p> <label class="flex items-center gap-2 py-0.5"><input id="tp-project-versions" class="tp-check" type="checkbox"/> <span title="Every kept version of every scene. Off exports each scene's current version only.">Scene version history</span></label> <div class="my-2 border-t border-gray-700"></div> <label class="flex items-center gap-2 py-0.5"><input id="show-gltf-format" class="tp-check" type="checkbox"/> Show GLTF format</label> <label class="flex items-center gap-2 py-0.5"><input id="show-json-format" class="tp-check" type="checkbox"/> Show JSON format</label> <div class="mt-3 flex justify-end"><button class="rounded-sm bg-gray-600 px-2 py-1 text-xs hover:bg-gray-500">Close</button></div></div>`,1),MVe=V(`<button id="logo-menu"><img src="logo.svg" alt="menu" class="h-9 w-9"/> <span title="Updated â see what's new"></span></button> <!> <!>`,1);function NVe(e,n){Ce(n,!0);let i=()=>z(dc,`$settingsOpen`,T),a=()=>z(Oo,`$modulesOpen`,T),o=()=>z(ac,`$sessionsOpen`,T),s=()=>z(Ls,`$templatesModalOpen`,T),c=()=>z(Js,`$characterModalOpen`,T),l=()=>z(Ys,`$profileSettingsOpen`,T),u=()=>z(Ms,`$closeMenu`,T),d=()=>z(xs,`$connectDocked`,T),p=()=>z(uc,`$connectBarHeight`,T),m=()=>z(khe,`$whatsNewUnseen`,T),h=()=>z(uf,`$sidebarSlot`,T),_=()=>z(Ho,`$inspectorClose`,T),y=()=>z(ms,`$inspectorKind`,T),x=()=>z(wl,`$moduleToolboxes`,T),S=()=>z(El,`$openToolboxes`,T),[T,E]=Ve(),D=typeof localStorage<`u`&&nt.getItem(`showJsonFormat`)===`true`,k=typeof localStorage<`u`&&nt.getItem(`showGltfFormat`)===`true`;function A(e,t,n){return e===`json`&&!t||e===`gltf`&&!n?`tp`:e}let ee=typeof localStorage<`u`&&nt.getItem(`saveFormat`)||`tp`,M=t(Ne(A(ee,D,k
2329))),te=t(Ne(D)),ne=t(Ne(k)),P=t(!1),re=t(Ne({top:0,left:0}));function ie(e){let t=e.currentTarget.getBoundingClientRect(),n=t.left,r=t.bottom+6;n=Math.max(8,Math.min(n,window.innerWidth-256-8)),r=Math.max(8,Math.min(r,window.innerHeight-360-8)),I(re,{top:r,left:n},!0),I(P,!0)}let F=t(Ne(typeof localStorage<`u`&&nt.getItem(`tpsceneAssets`)!==`false`)),ae=t(Ne(typeof localStorage<`u`&&nt.getItem(`tpscenePacks`)===`true`)),oe=t(Ne(typeof localStorage<`u`&&nt.getItem(`tpsceneFlow`)!==`false`)),R=t(Ne(typeof localStorage>`u`||nt.getItem(`tpProjectVersions`)!==`false`));function se(e){I(M,e,!0),nt.setItem(`saveFormat`,e)}function ce(){let e=A(Q(M),Q(te),Q(ne));e!==Q(M)&&se(e)}function le(e){let t=document.getElementById(e);t&&(t.value=``,t.click())}async function de(){if(i()||a()||o()||s()||c()||l()){dc.set(!1),Oo.set(!1),ac.set(!1),Ls.set(!1),Js.set(!1),Ys.set(!1),await C(),Ms.set(!1);return}Ms.update(e=>!e)}var fe=MVe(),pe=N(fe),me=g(j(pe),2);let V;H(pe);var he=g(pe,2),ge=e=>{var t=AVe(),n=j(t),a=g(n,2),o=g(a,2),s=j(o);ike(j(s),{size:16,"aria-hidden":`true`}),H(s),W(),H(o);var c=g(o,4),l=j(c);OOe(j(l),{size:16,"aria-hidden":`true`}),H(l),W(),H(c);var u=g(c,2),v=j(u);nz(j(v),{size:16,"aria-hidden":`true`}),H(v),W(),H(u);var C=g(u,2),w=j(C),T=j(w);dS(T,{size:16,"aria-hidden":`true`}),H(w),W(),H(C);var E=g(C,2),D=j(E),k=g(D,2),A=g(k,2);bz(j(A),{size:16,"aria-hidden":`true`}),H(A),H(E);var ee=g(E,2),N=e=>{var t=EVe(),n=j(t),i=e=>{var t=wVe();O(()=>r(t,1,`side-seg ${Q(M)===`gltf`?`on`:``}`,`svelte-18w4jbg`)),L(`click`,t,()=>se(`gltf`)),X(e,t)};G(n,e=>{Q(ne)&&e(i)});var a=g(n,2),o=e=>{var t=TVe();O(()=>r(t,1,`side-seg ${Q(M)===`json`?`on`:``}`,`svelte-18w4jbg`)),L(`click`,t,()=>se(`json`)),X(e,t)};G(a,e=>{Q(te)&&e(o)}),H(t),X(e,t)};G(ee,e=>{(Q(ne)||Q(te))&&e(N)});var P=g(ee,2),re=e=>{var t=DVe(),n=j(t);bo(n,{get mount(){return h()}}),H(t),X(e,t)};G(P,e=>{h()&&e(re)});var F=g(P,2),ae=j(F),I=j(ae);pS(I,{size:16,"aria-hidden":`true`}),H(ae),W(),H(F);var oe=g(F,4);let R;var ce=j(oe),ue=j(ce);fge(ue,{size:16,"aria-hidden":`true`}),H(ce),W(2),H(oe);var de=g(oe,2),z=j(de),fe=j(z);SS(fe,{size:16,class:`ico-danger`,"aria-hidden":`true`}),H(z),W(),H(de);var pe=g(de,2),me=j(pe);_z(j(me),{size:16,"aria-hidden":`true`}),H(me),W(),H(pe);var V=g(pe,2);B(V,1,()=>Dl(x(),S(),`sidebar`),e=>e.id,(e,t)=>{var n=kVe();let i;var a=j(n),o=j(a);pge(o,{size:14,"aria-hidden":`true`}),H(a);var s=g(a,2),c=f(s,!0),l=g(s,2),u=e=>{var n=OVe(),r=f(n,!0);O(()=>Y(r,Q(t).shortcut)),X(e,n)};G(l,e=>{Q(t).shortcut&&e(u)}),H(n),O(()=>{b(n,`id`,`open-toolbox-${Q(t).id??``}`),i=r(n,1,`side-row side-sub svelte-18w4jbg`,null,i,{active:Q(t).checked}),Y(c,Q(t).label)}),L(`click`,n,()=>{Q(t).action(),Ms.set(!0)}),X(e,n)});var he=g(V,2),ge=j(he),U=j(ge);tS(U,{size:16,"aria-hidden":`true`}),H(ge),W(),H(he);var _e=g(he,4),ve=j(_e);iz(j(ve),{size:16,"aria-hidden":`true`}),H(ve),W(),H(_e);var ye=g(_e,2),be=j(ye);AOe(j(be),{size:16,"aria-hidden":`true`}),H(be),W(),H(ye);var xe=g(ye,2),K=j(xe);bz(j(K),{size:16,"aria-hidden":`true`}),H(K),W(),H(xe);var Se=g(xe,2),Ce=j(Se);sOe(j(Ce),{size:16,"aria-hidden":`true`}),H(Ce),W(),H(Se);var we=g(Se,2),Te=g(j(we),4);let q;H(we);var Ee=g(we,2),J=j(Ee);bOe(j(J),{size:16,"aria-hidden":`true`}),H(J),W(),H(Ee),H(t),O(()=>{Ze(t,`--side-top: ${d()?p()+64:64}px`),r(D,1,`side-seg ${Q(M)===`tp`?`on`:``}`,`svelte-18w4jbg`),r(k,1,`side-seg ${Q(M)===`tpscene`?`on`:``}`,`svelte-18w4jbg`),R=r(oe,1,`side-row svelte-18w4jbg`,null,R,{active:!_()&&y()===`scene`}),q=r(Te,1,`row-dot svelte-18w4jbg`,null,q,{"row-dot-on":m()})}),L(`input`,n,e=>Mge(e.target.files)),L(`input`,a,e=>VS(e.target.files[0])),L(`click`,o,()=>{Ls.set(!0),Ms.set(!0)}),L(`click`,c,()=>le(`import-file`)),L(`click`,u,()=>le(`load-file`)),L(`click`,C,()=>BS(Q(M))),L(`click`,D,()=>se(`tp`)),L(`click`,k,()=>se(`tpscene`)),L(`click`,A,ie),L(`click`,F,()=>{ZC(),Ms.set(!0)}),L(`click`,oe,()=>Ro(`scene`)),L(`click`,de,()=>{Ms.set(!0),ow()}),L(`click`,pe,()=>{Oo.set(!0),Ms.set(!0)}),L(`click`,he,()=>{ac.set(!0),Ms.set(!0)}),L(`click`,_e,()=>{ia.set(!0),Ms.set(!0)}),L(`click`,ye,()=>{Ms.set(!0),tY()}),L(`click`,xe,()=>{dc.set(!i()),Ms.set(!0)}),L(`click`,Se,()=>window.open(`https://docs.theprototype.app`,`_blank`)),L(`click`,we,()=>{Tx(),Ms.set(!0)}),L(`click`,Ee,()=>{Ms.set(!0),jx()}),Me(3,t,()=>Qa,()=>({duration:130})),X(e,t)};G(he,e=>{u()||e(ge)});var U=g(he,2),_e=e=>{var t=jVe(),n=N(t),r=g(n,2),i=g(j(r),4),a=j(i);v(a),W(),H(i);var o=g(i,2),s=j(o);v(s),W(),H(o);var c=g(o,2),l=j(c);v(l),W(),H(c);var u=g(c,6),d=j(u);v(d),W(2),H(u);var p=g(u,4),m=j(p);v(m),W(),H(p);var h=g(p,2),_=j(h);v(_),W(),H(h);var y=g(h,2),b=f(y);H(r),O(()=>{Ze(r,`z-index: calc(var(--z-menu) + 2); top: ${Q(re).top??``}px; left: ${Q(re).left??``}px;`),w(a,Q(F)),w(s,Q(ae)),w(l,Q(oe)),w(d,Q(R)),w(m,Q(ne)),w(_,Q(te))}),L(`click`,n,()=>I(P,!1)),L(`change`,a,e=>{I(F,e.target.checked,!0),nt.setItem(`tpsceneAssets`,String(Q(F)))}),L(`change`,s,e=>{I(ae,e.target.checked,!0),nt.setItem(`tpscenePacks`,String(Q(ae)))}),L(`change`,l,e=>{I(oe,e.target.checked,!0),nt.setItem(`tpsceneFlow`,String(Q(oe)))}),L(`change`,d,e=>{I(R,e.target.checked,!0),nt.setItem(`tpProjectVersions`,String(Q(R)))}),L(`change`,m,e=>{I(ne,e.target.checked,!0),nt.setItem(`showGltfFormat`,String(Q(ne))),ce()}),L(`change`,_,e=>{I(te,e.target.checked,!0),nt.setItem(`showJsonFormat`,String(Q(te))),ce()}),L(`click`,b,()=>I(P,!1)),X(e,t)};G(U,e=>{Q(P)&&e(_e)}),O(()=>{r(pe,1,`burger flex items-center justify-center rounded-lg border bg-gray-800/90 shadow-lg backdrop-blur-sm transition-transform hover:scale-105 ${u()?`border-gray-700/60`:`border-primary-500 ring-2 ring-primary-500/50`}`,`svelte-18w4jbg`),Ze(pe,`height: 48px; width: 48px; ${d()?`top: ${p()+8}px`:``}`),b(pe,`title`,u()?`Open menu`:`Close menu`),V=r(me,1,`update-dot svelte-18w4jbg`,null,V,{"update-dot-on":m()})}),L(`click`,pe,de),X(e,fe),ue(),E()}ge([`click`,`input`,`change`]);var PVe=V(`<div id="touch-tools" aria-label="Touch tools"><button id="touch-undo" class="tt-btn svelte-163c2e6" title="Undo" aria-label="Undo"><!></button> <button id="touch-redo" class="tt-btn svelte-163c2e6" title="Redo" aria-label="Redo"><!></button> <button id="touch-multiselect" aria-label="Multi-select"><!></button></div>`);function FVe(e,n){Ce(n,!0);let i=()=>z(xs,`$connectDocked`,u),a=()=>z(uc,`$connectBarHeight`,u),o=()=>z(Jo,`$touchTools`,u),s=()=>z(Nf,`$canUndo`,u),c=()=>z(If,`$canRedo`,u),l=()=>z(Ds,`$multiSelectMode`,u),[u,d]=Ve(),f=t(!1),m=[`.connect-pill`,`#notes-toggle`,`#peers-trigger`,`#avatar-trigger`];function h(){if(typeof document>`u`)return;let e=document.querySelector(`#logo-menu`)?.getBoundingClientRect();if(!e){I(f,!1);return}let t=e.top,n=e.bottom,r=window.innerWidth;for(let i of m){let a=document.querySelector(i)?.getBoundingClientRect();a&&a.width&&a.height&&(a.bottom<=t||a.top>=n||a.left>e.right&&(r=Math.min(r,a.left)))}I(f,258>r)}Qe(()=>{i(),a(),o(),h();let e=setTimeout(h,120);return()=>clearTimeout(e)}),Qe(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>h());for(let t of[`#logo-menu`,...m]){let n=document.querySelector(t);n&&e.observe(n)}return()=>e.disconnect()});
2329var _=fe();Z(`resize`,p,h);var v=N(_),y=e=>{var t=PVe();let n;var o=j(t),u=j(o);hS(u,{size:20,"aria-hidden":`true`}),H(o);var d=g(o,2),p=j(d);DS(p,{size:20,"aria-hidden":`true`}),H(d);var m=g(d,2);let h;Cz(j(m),{size:20,"aria-hidden":`true`}),H(m),H(t),O(()=>{n=r(t,1,`touch-tools svelte-163c2e6`,null,n,{"tt-stacked":Q(f)}),Ze(t,`--tt-anchor: ${i()?a()+8:20}px`),o.disabled=!s(),d.disabled=!c(),h=r(m,1,`tt-btn svelte-163c2e6`,null,h,{"tt-on":l()}),b(m,`aria-pressed`,l()),b(m,`title`,l()?`Multi-select on â a tap adds to the selection, a drag on empty space boxes`:`Multi-select â tap to add objects, drag empty space to box-select`)}),L(`click`,o,()=>Mf()),L(`click`,d,()=>jf()),L(`click`,m,()=>Ds.update(e=>!e)),X(e,t)};G(v,e=>{o()&&e(y)}),X(e,_),ue(),d()}ge([`click`]);var IVe=[`loading`,`placeholder`,`placeholders`,`preload`,`hologram`,`modern`,`boxes`,`progress`,`stuck`,`retry`,`grid`,`checker`,`uv grid`,`prototype`],LVe=V(`<input id="placeholder-grid-size" type="number" min="0.05" max="10" step="0.05" class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white disabled:opacity-40"/>`),RVe=V(`<input id="placeholder-grid-color" type="color" class="h-7 w-full cursor-pointer rounded-sm border border-gray-500 bg-transparent disabled:opacity-40"/>`),zVe=V(`<input id="placeholder-grid-opacity" type="range" style="width: 100%" min="0" max="1" step="0.05" aria-label="Placeholder grid opacity"/>`),BVe=V(`<input id="placeholder-anim-speed" type="range" style="width: 100%" min="0" max="4" step="0.25" aria-label="Placeholder animation speed"/>`),VVe=V(`<input id="placeholder-stuck-seconds" type="number" min="1" max="120" step="1" class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white"/>`),HVe=V(`<div class="contents"><p class="ui-section-label" data-tour="settings-loading">Loading</p> <!> <!> <!> <!> <!> <!> <!></div>`);function UVe(e,t){Ce(t,!1);let n=()=>z(Rm,`$placeholderGrid`,a),r=()=>z(Im,`$placeholderStyle`,a),i=()=>z(Lm,`$placeholderStuckSeconds`,a),[a,o]=Ve(),c=F();function l(e){Rm.set(Poe({...n(),...e}))}d(()=>r(),()=>{I(c,r()===`modern`)}),h(),R();var f=HVe(),p=g(j(f),2);_o(p,{name:`Loading placeholders`,children:(e,t)=>{W();var n=Te(`What a kit piece shows while its file is still loading. Modern (the default) = a translucent blue box that fills up as the bytes arrive; both turn amber when stuck and red when the file failed (right-click it to retry or replace it)`);
2329X(e,n)},$$slots:{default:!0,control:(e,t)=>{fq(e,{id:`placeholder-style`,items:[{value:`modern`,name:`Modern (default)`},{value:`boxes`,name:`Colored boxes`}],get value(){return Se(),r()},set value(e){ke(Im,e)},$$legacy:!0})}}});var m=g(p,2);_o(m,{name:`Placeholder grid texture`,children:(e,t)=>{W();var n=Te();O(()=>Y(n,`A prototype grid on the modern boxes, sized in world metres so every box reads at the same scale${Q(c)?``:` (Modern style only)`}`)),X(e,n)},$$slots:{default:!0,control:(e,t)=>{{let t=ze(()=>!Q(c));ao(e,{id:`placeholder-grid-on`,get disabled(){return Q(t)},get checked(){return n(),K(()=>n().on)},onchange:e=>l({on:e.currentTarget.checked})})}}}});var _=g(m,2);_o(_,{name:`Grid size (m)`,children:(e,t)=>{W();var n=Te();O(()=>Y(n,`One grid cell, in metres (default ${s(Hm),K(()=>Hm.size)??``})`)),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var r=LVe();v(r),O(()=>{r.disabled=(Q(c),n(),K(()=>!Q(c)||!n().on)),u(r,(n(),K(()=>n().size)))}),Z(`change`,r,e=>l({size:Number(e.currentTarget.value)})),X(e,r)}}});var y=g(_,2);_o(y,{name:`Grid color`,children:(e,t)=>{W();var n=Te(`The grid lines' colour`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var r=RVe();v(r),O(()=>{r.disabled=(Q(c),n(),K(()=>!Q(c)||!n().on)),u(r,(n(),K(()=>n().color)))}),Z(`input`,r,e=>l({color:e.currentTarget.value})),X(e,r)}}});var x=g(y,2);_o(x,{name:`Grid opacity`,children:(e,t)=>{W();var n=Te(`How strongly the grid shows on the boxes`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var r=zVe();v(r),O(()=>{r.disabled=(Q(c),n(),K(()=>!Q(c)||!n().on)),u(r,(n(),K(()=>n().opacity)))}),Z(`input`,r,e=>l({opacity:Number(e.currentTarget.value)})),X(e,r)}}});var S=g(x,2);_o(S,{name:`Placeholder animation speed`,children:(e,t)=>{W();var n=Te(`The pulse and the scan sweep of the modern boxes (0 = still)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var r=BVe();v(r),O(()=>{r.disabled=!Q(c),u(r,(n(),K(()=>n().speed)))}),Z(`input`,r,e=>l({speed:Number(e.currentTarget.value)})),X(e,r)}}});var C=g(S,2);_o(C,{name:`Stuck after (seconds)`,children:(e,t)=>{W();var n=Te(`A loading piece with no new data for this long turns amber; three times this long and the download is restarted (up to three retries, then it turns red)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=VVe();v(n),O(()=>u(n,i())),Z(`change`,n,e=>Lm.set(Loe(e.currentTarget.value))),X(e,n)}}}),H(f),O(e=>b(f,`data-keywords`,e),[()=>K(()=>IVe.join(` `))]),X(e,f),ue(),o()}var rY=`allowTextSelection`,iY=Ue(typeof localStorage<`u`&&nt.getItem(rY)===`true`),aY=!1;iY.subscribe(e=>{if(typeof document<`u`&&document.documentElement.classList.toggle(`allow-text-select`,!!e),!aY){aY=!0;return}nt.setItem(rY,e?`true`:`false`)});function oY(e){let t=e instanceof Element?e:null;return!t||t.closest(`input, textarea, [contenteditable=""], [contenteditable="true"], .cm-editor`)?!1:!!t.closest(`canvas, .svelte-flow__pane, .svelte-flow__node, .svelte-flow__edge, .svelte-flow__renderer`)}var sY=!1;function WVe(e){if(!oY(e.target))return;sY=!0;let t=typeof window<`u`?window.getSelection():null;t&&t.rangeCount&&!t.isCollapsed&&t.removeAllRanges()}function cY(){sY=!1}function GVe(e){sY&&e.preventDefault()}typeof window<`u`&&(window.addEventListener(`pointerdown`,WVe,!0),window.addEventListener(`pointerup`,cY,!0),window.addEventListener(`pointercancel`,cY,!0),document.addEventListener(`selectstart`,GVe,!0));function KVe(){return{gesture:sY,allow:document.documentElement.classList.contains(`allow-text-select`)}}var qVe=[`select`,`selection`,`text`,`copy`,`highlight`,`drag`],JVe=V(`<div><!></div>`);function YVe(e){let t=()=>z(iY,`$allowTextSelection`,n),[n,r]=Ve();var i=JVe(),a=j(i);_o(a,{name:`Allow text selection everywhere`,children:(e,t)=>{W();var n=Te(`Off: only text fields, code, chat, logs and help text can be selected, so a drag across a 2330 menu or a panel never paints a selection. The viewport and the node editor never start one.`);X(e,n)},$$slots:{default:!0,control:(e,n)=>{ao(e,{id:`allow-text-select`,get checked(){return Se(),t()},set checked(e){ke(iY,e)},$$legacy:!0})}}}),H(i),O(e=>b(i,`data-keywords`,e),[()=>qVe.join(` `)]),X(e,i),r()}var lY=new Map(Object.entries({theme:[`dark`,`light`,`colour`,`color`,`contrast`,`appearance`],"custom theme":[`colours`,`colors`,`import`,`export`],"game sounds":[`sfx`,`audio`,`volume`],music:[`audio`,`volume`],"show fps + draw calls":[`performance`,`frame rate`,`framerate`],"send performance reports":[`beacon`,`telemetry`,`profiler`],"trackpad gestures":[`touchpad`,`mac`],"two-finger pan":[`touchpad`,`trackpad`],"pinch zoom":[`touchpad`,`trackpad`],gamepad:[`controller`,`xbox`,`playstation`,`joystick`],"stick deadzone":[`drift`,`controller`],"reduce qual
2330ity when the scene is heavy":[`performance`,`fps`,`lag`,`slow`,`governor`],"simplify distant models":[`lod`,`performance`],"draw repeated kit pieces together":[`instancing`,`performance`],autosave:[`backup`,`recovery`],"auto-restore on load":[`crash`,`recovery`,`backup`],length:[`units`,`metres`,`meters`,`inches`,`feet`],angle:[`units`,`degrees`,`radians`],"snap turn":[`rotate`,`comfort`,`quest`],teleport:[`locomotion`,`quest`],passthrough:[`ar`,`mixed reality`],"vr refresh rate":[`hz`,`quest`],"signaling server":[`peerjs`,`network`],"turn urls":[`relay`,`nat`,`firewall`,`network`],"stun urls":[`nat`,`network`],version:[`release`,`changelog`,`about`],diagnostics:[`bug`,`debug`,`report`],"enable assistant":[`ai`,`llm`,`claude`,`openai`],providers:[`api key`,`model`,`ai`],"mesh generation":[`meshy`,`ai`],"keep a recycle bin":[`trash`],"storage used":[`disk`,`space`,`quota`]})),XVe=new Map(Object.entries({interface:[`appearance`,`toolbar`,`menu`],controls:[`mouse`,`trackpad`,`touchpad`,`keyboard`],input:[`gamepad`,`controller`,`joystick`],scene:[`performance`,`quality`,`grid`,`snap`],explorer:[`files`,`library`,`storage`],vr:[`headset`,`quest`,`xr`],ai:[`assistant`,`llm`,`model`],connection:[`peer`,`network`,`server`,`invite`,`room`,`session`],shortcuts:[`keys`,`hotkey`,`hotkeys`,`keyboard`,`binding`],about:[`version`,`changelog`,`privacy`]})),uY=e=>String(e??``).trim().toLowerCase();function dY(e,t){let n=uY(e),r=(t??[]).map(uY).filter(Boolean),i=lY.get(n)??[];return lY.set(n,[...i,...r]),()=>{let e=[...lY.get(n)??[]];for(let t of r){let n=e.indexOf(t);n>=0&&e.splice(n,1)}e.length?lY.set(n,e):lY.delete(n)}}function fY(e){return lY.get(uY(e))??[]}function ZVe(e){return XVe.get(uY(e))??[]}function pY(e,t,n={}){let r=uY(e).split(/\s+/).filter(Boolean);if(!r.length)return!0;let i=[uY(t.text),uY(t.group),uY(t.section),...fY(t.name??``),...fY(t.group??``),...(t.extra??[]).map(uY),...n.fallback?ZVe(t.section??``):[]].join(` � `);return r.every(e=>i.includes(e))}function QVe(e,t){let n=String(e??``).toLowerCase(),r=[];for(let e of uY(t).split(/\s+/).filter(Boolean)){let t=0;for(;;){let i=n.indexOf(e,t);if(i<0)break;r.push([i,i+e.length]),t=i+e.length}}r.sort((e,t)=>e[0]-t[0]);let i=[];for(let e of r){let t=i[i.length-1];t&&e[0]<=t[1]?t[1]=Math.max(t[1],e[1]):i.push([e[0],e[1]])}return i}var mY=e=>`<svg viewBox="0 0 24 24" width="100%" height="100%" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">`+e+`</svg>`,$Ve={jump:mY(`<path d="M12 17V5"/><path d="M7 10l5-5 5 5"/><path d="M5 20h14"/>`),fire:mY(`<circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="1.5" fill="currentColor"/><path d="M12 2v4M12 18v4M2 12h4M18 12h4"/>`),interact:mY(`<circle cx="12" cy="12" r="3"/><path d="M12 4a8 8 0 0 1 8 8"/><path d="M4 12a8 8 0 0 1 8-8"/><path d="M12 20a8 8 0 0 1-8-8"/>`),crouch:mY(`<path d="M7 8l5 5 5-5"/><path d="M5 18h14"/>`),sprint:mY(`<path d="M5 6l6 6-6 6"/><path d="M13 6l6 6-6 6"/>`),reload:mY(`<path d="M20 12a8 8 0 1 1-2.34-5.66"/><path d="M20 4v5h-5"/>`),grab:mY(`<path d="M8 13V6a1.5 1.5 0 0 1 3 0v5"/><path d="M11 11V4.5a1.5 1.5 0 0 1 3 0V11"/><path d="M14 11V6a1.5 1.5 0 0 1 3 0v7a6 6 0 0 1-6 6h-1a5 5 0 0 1-4.2-2.3L4 14a1.5 1.5 0 0 1 2.4-1.8L8 14"/>`),up:mY(`<path d="M6 15l6-6 6 6"/>`),down:mY(`<path d="M6 9l6 6 6-6"/>`),stick:mY(`<circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="3" fill="currentColor"/>`)};function eHe(e){return $Ve[e]??``}var tHe=V(`<img alt="" draggable="false" class="svelte-1nj82jk"/>`),nHe=V(`<span class="tab-glyph svelte-1nj82jk"></span>`),rHe=V(`<span class="tab-label svelte-1nj82jk"> </span>`),iHe=V(`<span><!></span>`);function hY(t,n){Ce(n,!0);let i=J(n,`pressed`,3,!1),a=J(n,`texture`,3,null),o=J(n,`opacity`,3,1),s=q(()=>i()?a()?.pressed||a()?.released||``:a()?.released||``),c=q(()=>eHe(n.action.icon)),l=q(()=>a()?.scale??1),u=q(()=>Math.max(10,Math.round(n.size*.22)));var d=iHe();let p,m;var h=j(d),g=e=>{var t=tHe();let n;O((e,r)=>{b(t,`src`,Q(s)),n=Ze(t,``,n,{width:e,height:r})},[()=>`${Math.round(100*Q(l))}%`,()=>`${Math.round(100*Q(l))}%`]),X(e,t)},_=t=>{var r=nHe();let i;e(r,()=>Q(c),!0),H(r),O((e,t)=>
2330i=Ze(r,``,i,{width:e,height:t}),[()=>`${Math.round(n.size*.46*Q(l))}px`,()=>`${Math.round(n.size*.46*Q(l))}px`]),X(t,r)},v=e=>{var t=rHe();let r;var i=f(t,!0);O(e=>{r=Ze(t,``,r,{"font-size":e}),Y(i,n.action.label)},[()=>`${Math.round(Q(u)*Q(l))}px`]),X(e,t)};G(h,e=>{Q(s)?e(g):Q(c)?e(_,1):e(v,-1)}),H(d),O(()=>{p=r(d,1,`tab-face svelte-1nj82jk`,null,p,{pressed:i(),"has-image":!!Q(s)}),m=Ze(d,``,m,{width:`${n.size??``}px`,height:`${n.size??``}px`,opacity:o(),"--tab-tint":a()?.tint||null})}),X(t,d),ue()}var gY=we([gte,Kee,Df,Dc],([e,t,n,r])=>{let i=[];for(let e of Object.values(r??{}))for(let t of e?.nodes??[])t?.type===`keypress`&&typeof t.data?.code==`string`&&!i.includes(t.data.code)&&i.push(t.data.code);let a=n;return Pl({declared:e.filter(e=>!t.has(e.owner)),walk:a?.mode===`walk`,fly:!a||a.mode===`fly`,keyCodes:i})}),aHe=[`touch`,`mobile`,`phone`,`tablet`,`buttons`,`joystick`,`stick`,`jump`,`fire`,`haptic`,`vibrate`,`layout`,`on-screen`],oHe=V(`<span id="settings-touch-header" data-tour="settings-touch">Touch controls</span>`),sHe=V(`<span>Auto shows the stick and action buttons in Play on a touch screen (or once you touch the screen). Always forces them on, Never hides them<span class="sr-only"> </span></span>`),cHe=V(`<button type="button" class="tp-seg-btn"> </button>`),lHe=V(`<span class="tp-seg" role="group" aria-label="Show touch controls"></span>`),uHe=V(`<span>Also draw the action buttons while editing (they press keys there too). The stick and look only exist in Play</span>`),dHe=V(`<span>A short vibration when a button is pressed (phones that support it)</span>`),fHe=V(`<span> </span>`),pHe=V(`<input id="touch-look-speed" type="range" style="width: 100%" step="0.05" aria-label="Touch look speed"/>`),mHe=V(`<span>Drag, resize and fade the stick and every button â for this game or all games, saved on this device. Also in the pause menu during a game</span>`),hHe=V(`<span class="sr-stack"><button id="touch-edit-layout" data-tour="touch-edit-layout" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">Edit layout</button> <button id="touch-reset-layout" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">Reset</button></span>`),gHe=V(`<option> </option>`),_He=V(`<button type="button" class="tcs-btn svelte-ctxkt4">â</button>`),vHe=V(`<span class="tcs-state svelte-ctxkt4"><span class="tcs-label svelte-ctxkt4"> </span> <button type="button" class="tcs-btn svelte-ctxkt4">Upload</button> <input type="file" accept="image/png,image/svg+xml,.png,.svg" style="display: none"/> <select class="tcs-select svelte-ctxkt4"><option>Explorerâ¦</option><!></select> <!></span>`),yHe=V(`<button type="button" class="tcs-btn svelte-ctxkt4">Default look</button>`),bHe=V(`<div class="tcs-row svelte-ctxkt4"><span class="tcs-preview svelte-ctxkt4" title="Released"><!></span> <span class="tcs-preview svelte-ctxkt4" title="Pressed"><!></span> <!> <label class="tcs-state svelte-ctxkt4"><span class="tcs-label svelte-ctxkt4">Tint</span> <input type="color" class="tcs-color svelte-ctxkt4"/></label> <label class="tcs-state svelte-ctxkt4"><span class="tcs-label svelte-ctxkt4">Size</span> <input type="range" class="tcs-range svelte-ctxkt4" step="0.05"/></label> <!></div>`),xHe=V(`<p class="ui-section-label">On-screen controls</p> <!> <!> <!> <!> <!> <p class="ui-section-label">Button looks</p> <!>`,1);function SHe(e,t){Ce(t,!1);let n=()=>z(dc,`$settingsOpen`,p),r=()=>z(Ss,`$settingsSection`,p),i=()=>z(gY,`$touchSpec`,p),a=()=>z(Fa,`$explorerItems`,p),o=()=>z(jl,`$touchPrefs`,p),c=()=>z(CR,`$touchLookSpeed`,p),l=()=>z(Bl,`$touchTextures`,p),[p,m]=Ve(),_=F(),y=F(),x=J(t,`searching`,8,!1),S=F(!1),C=null;function w(e){e&&C===null?(C=Q(S),I(S,!0)):!e&&C!==null&&(I(S,C),C=null)}function T(e){let t=[];for(let e of Object.keys(Wl)){let n=lte(e);n&&t.push(n)}for(let n of e.actions)Wl[n.id]||t.push(n);return t}function E(){dc.set(!1),fte()}function D(){zl(`game`,U(Xl)),zl(`global`,U(Xl)),es(`Touch layout reset to the default arrangement`)}function k(e){return e.size>163840?(es(`That image is too big for a button (max `+Math.round(dte/1024)+` KB)`),Promise.resolve(null)):new Promise(t=>{let n=new FileReader;n.onload=()=>t(typeof n.result==`string`?n.result:null),n.onerror=()=>t(null),n.readAsDataURL(e)})}let ee=e=>e===`pressed`?`pressed`:`released`,M=(e,t)=>!!e?.[ee(t)];async function te(e,t,n){let r=n.currentTarget,i=r.files?.[0];if(r.value=``,!i)return;if(!/^image\/(png|svg\+xml|jpeg|webp|gif)$/.test(i.type)){es(`Pick a PNG or SVG image`);return}let a=await k(i);a&&Gl(e,{[ee(t)]:a})}async function ne(e,t,n){let r=n.currentTarget,i=r.value;if(r.value=``,!i)return;let a=await Ja(i);if(!a){es(`That file is not on this device yet`);return}let o=await k(a.type?a:new Blob([a],{type:/\.svg$/i.test(Q(y).find(e=>e.id===i)?.name??``)?`image/svg+xml`:`image/png`}));o&&Gl(e,{[ee(t)]:o})}let P=F({});d(()=>
2330(n(),r()),()=>{n()&&I(S,r()===`touch`)}),d(()=>s(x()),()=>{w(x())}),d(()=>i(),()=>{I(_,T(i()))}),d(()=>a(),()=>{I(y,a().filter(e=>e.kind===`image`||/\.svg$/i.test(e.name??``)))}),h(),R(),Eo(e,{get open(){return Q(S)},set open(e){I(S,e)},header:e=>{var t=oHe();X(e,t)},children:(e,t)=>{var n=xHe(),r=g(N(n),2);_o(r,{name:`Show touch controls`,children:(e,t)=>{var n=sHe(),r=g(j(n)),i=f(r);H(n),O(e=>Y(i,`â ${e??``}`),[()=>K(()=>aHe.join(`, `))]),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=lHe();B(n,4,()=>[[`auto`,`Auto`],[`always`,`Always`],[`never`,`Never`]],([e,t])=>e,(e,t)=>{var n=q(()=>A(t,2));let r=()=>Q(n)[0],i=()=>Q(n)[1];var a=cHe(),s=f(a,!0);O(()=>{b(a,`id`,`touch-visibility-`+r()),b(a,`aria-pressed`,(o(),r(),K(()=>o().visibility===r()))),Y(s,i())}),Z(`click`,a,()=>Il({visibility:r()})),X(e,a)}),H(n),X(e,n)}}});var i=g(r,2);_o(i,{name:`Show in edit`,children:(e,t)=>{var n=uHe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`touch-show-in-edit`,get checked(){return o(),K(()=>o().showInEdit)},onchange:e=>Il({showInEdit:e.currentTarget.checked})})}}});var a=g(i,2);_o(a,{name:`Haptic tick`,children:(e,t)=>{var n=dHe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`touch-haptics`,get checked(){return o(),K(()=>o().haptics)},onchange:e=>Il({haptics:e.currentTarget.checked})})}}});var d=g(a,2);_o(d,{name:`Look speed`,children:(e,t)=>{var n=fHe(),r=f(n);O(e=>Y(r,`How far a drag on the right half turns the view (${e??``}Ã)`),[()=>(c(),K(()=>c().toFixed(2)))]),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=pHe();v(n),O(()=>{b(n,`min`,(s(xR),K(()=>xR.min))),b(n,`max`,(s(xR),K(()=>xR.max))),u(n,c())}),Z(`input`,n,e=>wR(Number(e.currentTarget.value))),X(e,n)}}});var p=g(d,2);_o(p,{name:`Layout`,children:(e,t)=>{var n=mHe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=hHe(),r=j(n),i=g(r,2);H(n),Z(`click`,r,E),Z(`click`,i,D),X(e,n)}}});var m=g(p,4);B(m,1,()=>Q(_),e=>e.id,(e,t)=>{let n=ze(()=>(l(),Q(t),K(()=>l()[Q(t).id]??null)));_o(e,{get name(){return Q(t),K(()=>Q(t).label)},noControl:!0,children:(e,r)=>{var i=bHe(),a=j(i);hY(j(a),{get action(){return Q(t)},size:44,get texture(){return Q(n)}}),H(a);var o=g(a,2);hY(j(o),{get action(){return Q(t)},size:44,get texture(){return Q(n)},pressed:!0}),H(o);var c=g(o,2);B(c,0,()=>[[`released`,`Released`],[`pressed`,`Pressed`]],([e,t])=>e,(e,r)=>{var i=q(()=>A(r,2));let a=()=>Q(i)[0],o=()=>Q(i)[1];var c=vHe(),l=j(c),u=f(l,!0),d=g(l,2),p=g(d,2);We(p,(e,t,n)=>re(P,Q(P)[t.id+n]=e),(e,t)=>Q(P)?.[e.id+t],()=>[Q(t),a()]);var m=g(p,2),h=j(m);h.value=h.__value=``;var _=g(h);B(_,1,()=>Q(y),e=>e.id,(e,t)=>{var n=gHe(),r=f(n,!0),i={};O(()=>{Y(r,(Q(t),K(()=>Q(t).name))),i!==(i=(Q(t),K(()=>Q(t).id)))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(m);var v=g(m,2),x=e=>{var n=_He();O(e=>b(n,`aria-label`,e),[()=>(o(),K(()=>`Clear the `+o().toLowerCase()+` image`))]),Z(`click`,n,()=>Gl(Q(t).id,{[ee(a())]:void 0})),X(e,n)},S=q(()=>(s(Q(n)),a(),K(()=>M(Q(n),a()))));G(v,e=>{Q(S)&&e(x)}),H(c),O((e,n)=>{Y(u,o()),b(d,`id`,e),b(p,`data-touch-tex-file`,(Q(t),a(),K(()=>Q(t).id+`:`+a()))),b(m,`aria-label`,n)},[()=>(a(),Q(t),K(()=>`touch-tex-upload-`+a()+`-`+Q(t).id.replace(/[^\w-]/g,`_`))),()=>(o(),K(()=>`Pick a `+o().toLowerCase()+` image from Explorer`))]),Z(`click`,d,()=>Q(P)[Q(t).id+a()]?.click()),Z(`change`,p,e=>te(Q(t).id,a(),e)),Z(`change`,m,e=>ne(Q(t).id,a(),e)),X(e,c)});var l=g(c,2),d=g(j(l),2);v(d),H(l);var p=g(l,2),m=g(j(p),2);v(m),H(p);var h=g(p,2),_=e=>{var n=yHe();Z(`click`,n,()=>pte(Q(t).id)),X(e,n)};G(h,e=>{Q(n)&&e(_)}),H(i),O(()=>{b(i,`data-touch-texture`,(Q(t),K(()=>Q(t).id))),u(d,(s(Q(n)),K(()=>Q(n)?.tint??`#ffffff`))),b(d,`aria-label`,(Q(t),K(()=>`Tint for `+Q(t).label))),b(m,`min`,(s(Ul),K(()=>Ul.min))),b(m,`max`,(s(Ul),K(()=>Ul.max))),u(m,(s(Q(n)),K(()=>Q(n)?.scale??1))),b(m,`aria-label`,(Q(t),K(()=>`Icon size for `+Q(t).label)))}),Z(`change`,d,e=>Gl(Q(t).id,{tint:e.currentTarget.value})),Z(`input`,m,e=>Gl(Q(t).id,{scale:Number(e.currentTarget.value)})),X(e,i)},$$slots:{default:!0}})}),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0}),ue(),m()}var CHe=[`water`,`ocean`,`pool`,`refraction`,`caustics`,`reflection`,`waves`,`quality`,`performance`],wHe=V(`<div class="contents"><!></div>`);function THe(e){let t=()=>z(_x,`$waterQuality`,n),[n,r]=Ve();var i=wHe(),a=j(i);_o(a,{name:`Water quality`,children:(e,t)=>{W();var n=Te(`High draws refraction, caustics, shoreline foam and planar mirrors at full resolution; Medium at half; Low is the 2331 headset look (waves and ripples, no screen-space passes). Auto picks Low in a headset, on a phone or when the 2332 scene is heavy. Only on THIS machine`);X(e,n)},$$slots:{default:!0,control:(e,n)=>{fq(e,{id:`water-quality`,items:[{value:`auto`,name:`Auto`},{value:`high`,name:`High`},{value:`medium`,name:`Medium`},{value:`low`,name:`Low (headset)`}],get value(){return Se(),t()},set value(e){ke(_x,e)},$$legacy:!0})}}}),H(i),O(e=>b(i,`data-keywords`,e),[()=>CHe.join(` `)]),X(e,i),r()}var _Y=[`tour`,`tours`,`tutorial`,`welcome`,`onboarding`,`help`,`first run`,`guide`],vY={"VR welcome":[`vr welcome`,`controllers`,`quest`],"Offer Enter VR":[`enter vr`,`offer`,`headset browser`,`quest`]};for(let[e,t]of Object.entries(vY))dY(e,t);[..._Y,...Object.values(vY).flat()];var EHe=V(`Your controllers, moving, pointing, grabbing, the radial menu, playing and leaving VR. In a 2333 headset it starts now (also: radial menu ⸠Settings ⸠Welcome tour); on a screen it plays the 2334 next time you enter VR, with a preview offered. <span class="tours-status svelte-asdlyo"> </span>`,1),DHe=V(` <span class="tours-status svelte-asdlyo"> </span>`,1),OHe=V(`<div class="contents"><p class="ui-section-label">Tours</p> <!> <!> <!> <!> <!></div>`);function kHe(e,t){Ce(t,!1);let n=()=>z(Dhe,`$tourRecords`,i),r=()=>z(GI,`$xrOfferEnabled`,i),[i,a]=Ve(),o=F();function c(e,t){let n=Cx.status(e);return n===`done`?`Seen`:n===`progress`?`Started â resumes where you left it`:`Not seen yet`}let l=e=>Cx.autoStartEnabled();function u(e){Cx.setAutoStart(!!e?.target?.checked)}function p(){dc.set(!1),jx()}function m(){dc.set(!1),Phe()}d(()=>n(),()=>{I(o,l(n()))}),h(),R();var _=OHe(),v=g(j(_),2);_o(v,{name:`Show tours automatically`,children:(e,t)=>{W();var n=Te(`Start the short first-run tours by themselves: the editor tour after the welcome card, and 2335 "Welcome to ThePrototype VR" the first time you enter VR. "Don't show again" on a tour turns 2336 this off`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`setting-tours-auto`,get checked(){return Q(o)},onchange:u})}}});var y=g(v,2);_o(y,{name:`VR welcome`,children:(e,t)=>{W();var r=EHe(),i=g(N(r)),a=f(i,!0);O(e=>Y(a,e),[()=>(s(Mx),n(),K(()=>
2336c(Mx,n())))]),X(e,r)},$$slots:{default:!0,control:(e,t)=>{Do(e,{id:`setting-tour-vr`,size:`xs`,color:`alternative`,onclick:m,children:(e,t)=>{W();var n=Te(`Start VR welcome`);X(e,n)},$$slots:{default:!0}})}}});var x=g(y,2);_o(x,{name:`Editor tour`,children:(e,t)=>{W();var r=DHe(),i=N(r),a=g(i),o=f(a,!0);O((e,t)=>{Y(i,`Six steps around the editor â adding things, looking around, the tools, Play, building 2337 together and the logo menu (${e??``}). `),Y(o,t)},[()=>(s(Ax),K(()=>Ax()===`editor-touch`?`the touch-screen version on this device`:`mouse and keyboard`)),()=>(s(Ax),n(),K(()=>c(Ax(),n())))]),X(e,r)},$$slots:{default:!0,control:(e,t)=>{Do(e,{id:`setting-tour-editor`,size:`xs`,color:`alternative`,onclick:p,children:(e,t)=>{W();var n=Te(`Start editor tour`);X(e,n)},$$slots:{default:!0}})}}});var S=g(x,2);_o(S,{name:`Offer Enter VR`,children:(e,t)=>{W();var n=Te(`In a headset's browser (Quest), let the browser show its own "Enter VR" button for this page, once 2338 per visit. Declining it is remembered on this device; switching this off and on asks again`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`setting-xr-offer`,get checked(){return Se(),r()},set checked(e){ke(GI,e)},$$legacy:!0})}}});var C=g(S,2);_o(C,{name:`Reset tours`,children:(e,t)=>{W();var n=Te(`Forget which tours you have seen or skipped and turn automatic tours back on`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{Do(e,{id:`setting-tours-reset`,size:`xs`,color:`alternative`,get onclick(){return Lhe},children:(e,t)=>{W();var n=Te(`Reset all`);X(e,n)},$$slots:{default:!0}})}}}),H(_),O(e=>b(_,`data-keywords`,e),[()=>K(()=>_Y.join(` `))]),X(e,_),ue(),a()}lue();for(let e of R_){let t=Z_.find(t=>t.id===e.page);dY(e.label,[...e.keywords??[],...t?[t.label]:[]])}var AHe=V(`<span class="vr-now svelte-1jxc6zk"> </span>`),jHe=V(` <!><!>`,1),MHe=V(`<input type="number" min="10" step="50" class="w-20 rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white"/>`),NHe=V(`<button class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500"> </button>`),PHe=V(`<span class="vr-remap-locked svelte-1jxc6zk">Both</span> <span class="vr-remap-locked svelte-1jxc6zk"> </span>`,1),FHe=V(`<span class="vr-remap-locked svelte-1jxc6zk"> </span>`),IHe=V(`<!> <!>`,1),LHe=V(`<div class="vr-remap-warn svelte-1jxc6zk" role="alert" id="vr-bind-conflict"> <button id="vr-bind-swap" class="vr-remap-btn svelte-1jxc6zk">Swap them</button> <button id="vr-bind-cancel" class="vr-remap-btn svelte-1jxc6zk">Cancel</button></div>`),RHe=V(`<div><span class="vr-remap-name"> </span> <!> <span class="vr-remap-doc svelte-1jxc6zk"> </span></div> <!>`,1),zHe=V(`<div class="vr-remap svelte-1jxc6zk" data-tour="settings-vr-controls"><div class="vr-remap-head svelte-1jxc6zk"><span>Action</span><span>Hand</span><span>Button</span><span class="vr-remap-doc svelte-1jxc6zk">What it does</span></div> <!> <div class="vr-remap-foot svelte-1jxc6zk"><button id="vr-bind-reset" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">Reset buttons</button> <span class="vr-now svelte-1jxc6zk">Local to this device â your peers keep their own buttons. The headset has the same table: Settings ⸠Controls ⸠Remap buttons.</span></div></div>`),BHe=V(`<h3 class="vr-sub svelte-1jxc6zk"> </h3> <!> <!>`,1),VHe=V(`<div class="vr-settings" data-tour="settings-vr"></div>`);function HHe(e,t){Ce(t,!1);let n=()=>z(W_,`$vrSettingsVersion`,a),i=()=>z(Xpe,`$vrBindings`,a),[a,o]=Ve(),c=F(),l=J(t,`arSupport`,8,null);function p(e){return R_.filter(t=>t.page===e&&t.desktop!==!1)}let m=(e,t)=>
2338e.get?.(),_=(e,t)=>V_(e);function y(e){let t=[],n=e.step??.05;for(let r=e.min;r<=e.max+1e-9;r+=n){let n=Math.round(r*100)/100;t.push({value:n,name:e.format?e.format(n):String(n)})}return t}let x=[{value:`left`,name:`Left`},{value:`right`,name:`Right`}],S=(e,t)=>(eme[e]??[]).map(e=>({value:e,name:lb(t,e)})),C=F(null);function w(e,t){let n=ub(e,t);I(C,!n.ok&&n.conflict?{id:e,want:{...i()[e],...t},other:n.conflict}:null)}function T(){if(!Q(C))return;let e=ub(Q(C).id,Q(C).want,{swap:!0});e.ok&&e.swapped&&es(cb(Q(C).id)?.label+` moved · `+e.swapped.split(`,`).map(e=>cb(e)?.label).join(`, `)+` took its old place`),I(C,null)}let E=e=>cb(e)?.label??e;d(()=>n(),()=>{I(c,n())}),h(),R();var D=VHe();B(D,5,()=>Z_,e=>e.id,(e,t)=>{var n=fe(),a=N(n),o=e=>{var n=BHe(),a=N(n),o=f(a,!0),d=g(a,2);B(d,1,()=>(Q(t),K(()=>p(Q(t).id))),e=>e.id,(e,t)=>{_o(e,{get name(){return Q(t),K(()=>Q(t).label)},children:(e,n)=>{W();var r=jHe(),i=N(r,!0),a=g(i),o=e=>{var t=Te(`â not supported on this device`);X(e,t)};G(a,e=>{Q(t),s(l()),K(()=>Q(t).id===`passthrough`&&l()===!1)&&e(o)});var u=g(a),d=e=>{var n=AHe(),r=f(n);O(e=>Y(r,`· now ${e??``}`),[()=>(Q(t),Q(c),K(()=>_(Q(t),Q(c))))]),X(e,n)};G(u,e=>{Q(t),K(()=>Q(t).kind===`choice`||Q(t).kind===`range`)&&e(d)}),O(()=>Y(i,(Q(t),K(()=>Q(t).note??``)))),X(e,r)},$$slots:{default:!0,control:(e,n)=>{var r=fe(),i=N(r),a=e=>{{let n=ze(()=>(Q(t),Q(c),K(()=>!!m(Q(t),Q(c)))));ao(e,{id:`passthrough-toggle`,color:`red`,size:`small`,get checked(){return Q(n)},onchange:e=>Q(t).set?.(e.target.checked)})}},o=e=>{{let n=ze(()=>(Q(t),K(()=>`vr-set-`+Q(t).id))),r=ze(()=>(Q(t),Q(c),K(()=>!!m(Q(t),Q(c)))));xo(e,{get id(){return Q(n)},get checked(){return Q(r)},onchange:e=>Q(t).set?.(e.target.checked)})}},s=e=>{var n=MHe();v(n),O(e=>{b(n,`id`,(Q(t),K(()=>`vr-set-`+Q(t).id))),u(n,e)},[()=>(Q(t),Q(c),K(()=>m(Q(t),Q(c))))]),Z(`change`,n,e=>{let n=parseInt(e.target.value);Number.isFinite(n)&&n>=10&&Q(t).set?.(n)}),X(e,n)},l=e=>{{let n=ze(()=>(Q(t),K(()=>`vr-set-`+Q(t).id))),r=ze(()=>(Q(t),K(()=>(Q(t).options??[]).map(e=>({value:e.value,name:e.label}))))),i=ze(()=>(Q(t),Q(c),K(()=>m(Q(t),Q(c)))));fq(e,{get id(){return Q(n)},get items(){return Q(r)},get value(){return Q(i)},onchange:e=>Q(t).set?.(e)})}},d=e=>{{let n=ze(()=>(Q(t),K(()=>`vr-set-`+Q(t).id))),r=ze(()=>(Q(t),K(()=>y(Q(t))))),i=ze(()=>(Q(t),Q(c),K(()=>m(Q(t),Q(c)))));fq(e,{get id(){return Q(n)},get items(){return Q(r)},get value(){return Q(i)},onchange:e=>Q(t).set?.(Number(e))})}},p=e=>{var n=NHe(),r=f(n,!0);O(()=>{b(n,`id`,(Q(t),K(()=>`vr-set-`+Q(t).id))),Y(r,(Q(t),K(()=>Q(t).label)))}),Z(`click`,n,()=>Q(t).run?.()),X(e,n)};G(i,e=>{Q(t),K(()=>Q(t).id===`passthrough`)?e(a):(Q(t),K(()=>Q(t).kind===`toggle`)?e(o,1):(Q(t),K(()=>Q(t).kind===`choice`&&(Q(t).id===`faceCap`||Q(t).id===`vertexCap`))?e(s,2):(Q(t),K(()=>Q(t).kind===`choice`)?e(l,3):(Q(t),K(()=>Q(t).kind===`range`)?e(d,4):e(p,-1)))))}),X(e,r)}}})});var h=g(d,2),D=e=>{var t=zHe(),n=g(j(t),2);B(n,1,()=>Qpe,e=>e.id,(e,t)=>{let n=ze(()=>(i(),Q(t),K(()=>i()[Q(t).id])));var a=RHe(),o=N(a);let c;var l=j(o),u=f(l,!0),d=g(l,2),p=e=>{var t=PHe(),r=g(N(t),2),i=f(r,!0);O(e=>Y(i,e),[()=>(s(lb),s(Q(n)),K(()=>lb(`both`,Q(n).control)))]),X(e,t)},m=e=>{var r=fe(),i=N(r);Ie(i,()=>(s(Q(n)),Q(C),K(()=>Q(n).hand+`|`+Q(n).control+`|`+(Q(C)?Q(C).id:``))),e=>{var r=IHe(),i=N(r);{let e=ze(()=>(Q(t),K(()=>`vr-bind-`+Q(t).id+`-hand`)));fq(i,{get id(){return Q(e)},get items(){return x},get value(){return s(Q(n)),K(()=>Q(n).hand)},onchange:e=>w(Q(t).id,{hand:e})})}var a=g(i,2),o=e=>{{let r=ze(()=>(Q(t),K(()=>`vr-bind-`+Q(t).id+`-control`))),i=ze(()=>(Q(t),s(Q(n)),K(()=>S(Q(t).kind,Q(n).hand))));fq(e,{get id(){return Q(r)},get items(){return Q(i)},get value(){return s(Q(n)),K(()=>Q(n).control)},onchange:e=>w(Q(t).id,{control:e})})}},c=e=>{var t=FHe(),r=f(t,!0);O(e=>Y(r,e),[()=>(s(lb),s(Q(n)),K(()=>lb(Q(n).hand,Q(n).control)))]),X(e,t)};G(a,e=>{Q(t),K(()=>Q(t).kind===`button`)?e(o):e(c,-1)}),X(e,r)}),X(e,r)};G(d,e=>{Q(t),K(()=>Q(t).kind===`locked`)?e(p):e(m,-1)});var h=g(d,2),_=f(h,!0);H(o);var v=g(o,2),y=e=>{var t=LHe(),n=j(t),r=g(n),i=g(r,2);H(t),O((e,t)=>
2338Y(n,`â ${e??``} is already ${t??``}. `),[()=>(s(lb),Q(C),K(()=>lb(Q(C).want.hand,Q(C).want.control))),()=>(Q(C),K(()=>E(Q(C).other)))]),Z(`click`,r,T),Z(`click`,i,()=>I(C,null)),X(e,t)};G(v,e=>{Q(C),Q(t),K(()=>Q(C)?.id===Q(t).id)&&e(y)}),O(()=>{c=r(o,1,`vr-remap-row svelte-1jxc6zk`,null,c,{"vr-remap-conflict":Q(C)?.id===Q(t).id||Q(C)?.other===Q(t).id}),b(o,`data-action`,(Q(t),K(()=>Q(t).id))),Y(u,(Q(t),K(()=>Q(t).label))),Y(_,(Q(t),K(()=>Q(t).doc)))}),X(e,a)});var a=g(n,2),o=j(a);W(2),H(a),H(t),Z(`click`,o,()=>{Zpe(),I(C,null),es(`VR buttons reset to the defaults`)}),X(e,t)};G(h,e=>{Q(t),K(()=>Q(t).id===`controls`)&&e(D)}),O(()=>{b(a,`data-tour`,(Q(t),K(()=>`settings-vr-`+Q(t).id))),Y(o,(Q(t),K(()=>Q(t).label)))}),X(e,n)},d=q(()=>(Q(t),K(()=>p(Q(t).id).length)));G(a,e=>{Q(d)&&e(o)}),X(e,n)}),H(D),X(e,D),ue(),o()}var yY=Ue(typeof localStorage<`u`&&nt.getItem(`trackpadMode`)||`auto`);yY.subscribe(e=>{typeof localStorage<`u`&&nt.setItem(`trackpadMode`,e)});var bY=Ue(typeof localStorage<`u`&&nt.getItem(`allowBrowserZoom`)===`true`);bY.subscribe(e=>{typeof localStorage<`u`&&nt.setItem(`allowBrowserZoom`,String(e))});var xY=Ue(typeof localStorage<`u`&&nt.getItem(`trackpadReversePan`)===`true`);xY.subscribe(e=>{typeof localStorage<`u`&&nt.setItem(`trackpadReversePan`,String(e))});var SY=Ue(typeof localStorage>`u`||nt.getItem(`trackpadPanEnabled`)!==`false`);SY.subscribe(e=>{typeof localStorage<`u`&&nt.setItem(`trackpadPanEnabled`,String(e))});var CY=Ue(typeof localStorage>`u`||nt.getItem(`trackpadPinchZoom`)!==`false`);CY.subscribe(e=>{typeof localStorage<`u`&&nt.setItem(`trackpadPinchZoom`,String(e))});var UHe=120,WHe=40,GHe=20,KHe=250,qHe=8,wY=Ue([]);function TY(e){wY.update(t=>{let n=[...t,e];return n.length>8?n.slice(n.length-8):n})}var EY=0,DY=null,OY=null,kY=`__tpWheelReplay`;function AY(e){if(e.deltaMode!==0)return{kind:`wheel`,why:`line/page mode`};let t=e.wheelDeltaY;return typeof t==`number`&&t!==0&&t%120==0?{kind:`wheel`,why:`notch multiple`}:e.deltaX===0&&Number.isInteger(e.deltaY)&&Math.abs(e.deltaY)>=40?{kind:`wheel`,why:`integer ⥠40px`}:e.deltaX===0?null:{kind:`trackpad`,why:`two-axis`}}function JHe(e,t){let n=U(yY);if(n===`off`)return{kind:`wheel`,why:`mode: zoom`};if(n===`on`)return{kind:`trackpad`,why:`mode: pan`};if(e.deltaMode!==0)return{kind:`wheel`,why:`line/page mode`};let r=t-EY;return DY===`trackpad`&&r<250?{kind:`trackpad`,why:`gesture continues`}:AY(e)||(DY===`wheel`&&r<250?{kind:`wheel`,why:`notch stream continues`}:{kind:`hold`,why:`first vertical sample`})}function jY(e,t,n,r){let i=e.wheelDeltaY;return{t,dt:EY?Math.round(t-EY):0,deltaMode:e.deltaMode,deltaX:e.deltaX,deltaY:e.deltaY,wheelDeltaY:typeof i==`number`?i:null,ctrl:!!e.ctrlKey,kind:n,why:r}}function YHe(e,t){let n=U(yi),r=U(Ki),i=U(xi)?.domElement;if(!n||!r||r.enabled===!1||!i)return;let a=n.position.distanceTo(r.target)*Math.tan(n.fov/2*Math.PI/180),o=2*e*a/i.clientHeight,s=2*t*a/i.clientHeight,c=n.position.clone().setFromMatrixColumn(n.matrix,0).multiplyScalar(-o).add(n.position.clone().setFromMatrixColumn(n.matrix,1).multiplyScalar(s));n.position.add(c),r.target.add(c)}function MY(e){let t=U(xY)?1:-1;YHe(t*e.deltaX,t*e.deltaY)}function NY(){typeof localStorage>`u`||nt.getItem(`wheelHintSeen`)||(nt.setItem(`wheelHintSeen`,`1`),$(()=>import(`../chunks/C20P4rQ5.js`).then(e=>e.u).then(e=>e.showToast(`Wheel panned instead of zooming? Viewport menu ⸠View ⸠Mouse wheel switches it`)),__vite__mapDeps([5,1,2,6,3]),import.meta.url))}function PY(e){let t=U(xi)?.domElement;if(!t)return;let n=new WheelEvent(`wheel`,{deltaX:e.deltaX,deltaY:e.deltaY,deltaZ:e.deltaZ,deltaMode:e.deltaMode,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,bubbles:!0,cancelable:!0});n[kY]=!0,t.dispatchEvent(n)}function XHe(){let e=OY;OY=null,e&&(DY=`wheel`,TY(jY(e.e,e.t,`wheel`,`held â alone = notch`)),PY(e.e))}function ZHe(e){if(e[kY]||Tie())return;let t=U(xi)?.domElement,n=!!t&&e.target===t;t&&t.style.touchAction!==`none`&&(t.style.touchAction=`none`);let r=performance.now();if(e.ctrlKey){U(bY)||e.preventDefault(),n&&!U(CY)&&e.stopPropagation(),n&&(TY({...jY(e,r,`wheel`,`ctrl: pinch/zoom`),kind:`pinch`}),EY=r);return}if(!n||document.pointerLockElement)return;if(!U(SY)){TY(jY(e,r,`wheel`,`two-finger pan off`)),EY=r;return}let i=JHe(e,r);if(OY){let t=OY;if(clearTimeout(t.timer),OY=null,r-t.t<20||i.kind===`trackpad`||i.kind===`hold`){DY=`trackpad`,TY(jY(t.e,t.t,`trackpad`,`held â stream = swipe`)),EY=t.t,MY(t.e),TY(jY(e,r,`trackpad`,`dense follow-up`)),EY=r,e.preventDefault(),e.stopPropagation(),MY(e),NY();return}DY=`wheel`,TY(jY(t.e,t.t,`wheel`,`held â alone = notch`)),EY=t.t,PY(t.e)}if(i.kind===`hold`){e.preventDefault(),e.stopPropagation(),OY={e,t:r,timer:setTimeout(XHe,20)},EY=r;return}TY(jY(e,r,i.kind,i.why)),EY=r,DY=i.kind,i.kind!==`wheel`&&(e.preventDefault(),e.stopPropagation(),MY(e),U(yY)===`auto`&&NY())}function QHe(e){U(bY)||e.preventDefault(),FY=1}var FY=1;function $He(e){let t=U(yi),n=U(Ki);if(!t||!n||n.enabled===!1||!(e>0))return;let r=t.position.clone().sub(n.target),i=r.length();if(!(i>0))return;let a=Number.isFinite(n.minDistance)?n.minDistance:0,o=Number.isFinite(n.maxDistance)?n.maxDistance:1/0,s=Math.min(o,Math.max(a,i/e));t.position.copy(n.target).add(r.multiplyScalar(s/i)),n.update?.()}function eUe(e){U(bY)||e.preventDefault();let t=Number(e.scale);if(!Number.isFinite(t)||t<=0)return;let n=U(xi)?.domElement,r=!!n&&e.target===n,i=t/(FY||1);FY=t,r&&!document.pointerLockElement&&U(CY)&&$He(i)}var IY=!1;function LY(){IY||typeof window>`u`||(IY=!0,window.addEventListener(`wheel`,ZHe,{passive:!1,capture:!0}),document.addEventListener(`gesturestart`,QHe,{passive:!1}),document.addEventListener(`gesturechange`,eUe,{passive:!1}),bY.subscribe(e=>{document.body.style.touchAction=e?``:`pan-x pan-y`}))}var RY=`flow:mouseBindings`;function zY(e){return e===`select`?`select`:`classic`}var BY=Ue(zY(nt.getItem(RY)));BY.subscribe(e=>nt.setItem(RY,zY(e)));var tUe=[{value:`classic`,name:`Classic â left-drag pans`},{value:`select`,name:`Select-first â left-drag selects, right-drag pans`}];function nUe(e,t,n,r,i=128){let a=Math.max(-2048,Math.min(2047,Math.floor(e/i+.5)))+2048,o=Math.max(-2048,Math.min(2047,Math.floor(t/i+.5)))+2048;return(a*4096+o)*4+(n?2:0)+ +!!r}function rUe(e,t=128){let n=e%4,r=(e-n)/4,i=r%4096-2048;return{x:(Math.floor(r/4096)-2048)*t,z:i*t,cast:(n&2)==2,receive:(n&1)==1}}var iUe=[`type`,`side`,`opacity`,`transparent`,`alphaTest`,`roughness`,`metalness`,`emissiveIntensity`,`envMapIntensity`,`wireframe`,`flatShading`,`vertexColors`,`visible`,`depthWrite`,`depthTest`,`aoMapIntensity`,`normalScale`,`clearcoat`,`transmission`],aUe
2338=[`color`,`emissive`,`specularColor`,`sheenColor`],oUe=[`map`,`normalMap`,`roughnessMap`,`metalnessMap`,`aoMap`,`emissiveMap`,`alphaMap`,`bumpMap`,`displacementMap`,`lightMap`,`envMap`];function VY(e){if(!e)return``;let t=[];for(let n of iUe){let r=e[n];r!==void 0&&t.push(n+`=`+(r&&typeof r==`object`&&`x`in r?r.x+`,`+r.y:r))}for(let n of aUe){let r=e[n];r&&typeof r.getHex==`function`?t.push(n+`#`+r.getHex()):r&&typeof r==`object`&&`r`in r&&t.push(n+`#`+[r.r,r.g,r.b].join(`,`))}for(let n of oUe){let r=e[n];r&&(t.push(n+`@`+(r.uuid??r)),r.offset&&r.repeat&&t.push(n+`uv`+[r.offset.x,r.offset.y,r.repeat.x,r.repeat.y,r.rotation??0].join(`,`)))}return t.join(`|`)}function sUe({mesh:e,source:t,selected:n=!1}){if(!e?.isMesh)return`not a mesh`;if(!t)return`not a kit piece`;if(e.isSkinnedMesh||e.isInstancedMesh)return`skinned or instanced`;if(Array.isArray(e.material))return`material slots`;let r=e.geometry?.morphAttributes;return r&&Object.keys(r).some(e=>r[e]?.length)?`morph targets`:e.geometry===t.geometry?(e.geometry?.attributes?.position?.version??0)===t.version?e.material===t.material?e.material?.transparent?`transparent`:VY(e.material)===t.sig?n?`selected`:``:`material edited`:`material replaced`:`geometry edited`:`geometry replaced`}var HY=Ue(nt.getItem(`kitInstancing`)!==`false`),UY=!1,WY=!0;HY.subscribe(e=>{if(WY=!!e,!UY){UY=!0;return}nt.setItem(`kitInstancing`,e?`true`:`false`)});var cUe=1e3,lUe=250,GY=[],KY=new Set,qY=new Map,JY=[],YY=[],XY=[],ZY=new WeakSet,QY=null,$Y=new vr,eX=new fr,uUe=new $t,tX={candidates:0,batches:0,members:0,holders:0,passes:0,lastScanMs:0},nX=0,rX=128;function dUe(e){rX=Number.isFinite(e)&&e>0?e:128,oX()}function fUe(){let e=U(Pi);return e?QY&&QY.parent===e?QY:(QY=e.getObjectByName(`kit-instancing-root`),QY||(QY=new Pn,QY.name=`kit-instancing-root`,QY.matrixAutoUpdate=!1,QY.userData.local=!0,e.add(QY)),QY):null}function pUe(e,t,n){let r=qY.get(e);r||qY.set(e,r=new Map);let i=r.get(t);i||r.set(t,i=new Map);let a=i.get(n);return a||(a={key:n,geometry:e,material:t,members:[],count:0,holder:null,capacity:0,drawn:0,signature:0},i.set(n,a),JY.push(a)),a}function mUe(e,t){if(e.holder&&e.capacity>=t)return e.holder;let n=fUe();if(!n)return null;e.holder&&(n.remove(e.holder),e.holder.dispose?.());let r=8;for(;r<t;)r*=2;let i=new jn(e.geometry,e.material,r);i.name=`kit-batch`,i.matrixAutoUpdate=!1,i.visible=!1,i.count=0,i.raycast=()=>{},i.userData.local=!0;let{cast:a,receive:o}=rUe(e.key,rX);return i.castShadow=a,i.receiveShadow=o,n.add(i),e.holder=i,e.capacity=r,e.drawn=0,e.signature=0,tX.holders++,i}function hUe(e,t){for(let n=e;n;n=n.parent){if(!n.visible)return!1;if(n===t)return!0}return!0}function gUe(e){if(!WY||!GY.length)return;tX.passes++;for(let e=0;e<JY.length;e++)JY[e].count=0;eX.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),$Y.setFromProjectionMatrix(eX);for(let t=0;t<GY.length;t++){let n=GY[t],r=n.mesh;if(!r.parent||r.material!==n.source.material||KY.size&&(KY.has(n.root.uuid)||KY.has(r.uuid))||!hUe(r,n.root)||(r.layers.mask&e.layers.mask)===0)continue;let i=r.geometry===n.source.geometry?n.source.template.geometry:r.geometry;if(r.frustumCulled!==!1&&(i.boundingSphere||i.computeBoundingSphere(),!$Y.intersectsSphere(uUe.copy(i.boundingSphere).applyMatrix4(r.matrixWorld))))continue;let a=r.matrixWorld.elements,o=pUe(i,n.source.template.material,nUe(a[12],a[14],r.castShadow,r.receiveShadow,rX));o.members.length<=o.count?o.members.push(r):o.members[o.count]=r,o.count++}let t=0,n=0;for(let e=0;e<JY.length;e++){let r=JY[e],i=r.count;if(i<2)continue;let a=mUe(r,i);if(!a)continue;let o=a.instanceMatrix.array,s=i!==r.drawn,c=0;for(let e=0;e<i;e++){let t=r.members[e],n=t.matrixWorld.elements,i=e*16;for(let e=0;e<16;e++)o[i+e]!==n[e]&&(o[i+e]=n[e],s=!0);c=c*31+t.id|0,t.visible=!1,YY.push(t)}c!==r.signature&&(s=!0),s&&(a.count=i,a.instanceMatrix.needsUpdate=!0,a.computeBoundingSphere(),r.drawn=i,r.signature=c),a.visible=!0,XY.push(a),t++,n+=i}let r=performance.now();(n>=tX.members||r-nX>250)&&(tX.batches=t,tX.members=n,nX=r)}function iX(){for(let e=0;e<YY.length;e++)YY[e].visible=!0;YY.length=0;for(let e=0;e<XY.length;e++)XY[e].visible=!1;XY.length=0}function aX(){let e=performance.now(),t=U(Ui),n=[],r=new Set;if(t&&WY)for(let e of t.children)e.userData?.packRef&&!e.userData.packStub&&e.traverse(t=>{if(!t.isMesh)return;let i=Hoe(t);i&&(i.sig||=VY(i.template.material),!sUe({mesh:t,source:i}
2338)&&(n.push({mesh:t,root:e,source:i}),r.add(i.template.material)))});GY=n,tX.candidates=n.length,n.length||oX(),tX.lastScanMs=Math.round((performance.now()-e)*10)/10,_Ue(r)}function _Ue(e){let t=[];for(let n of e)ZY.has(n)||t.push(n);if(!t.length)return;let n=new Pn,r=new Dr(.01,.01,.01);for(let e of t){ZY.add(e);let t=new jn(r,e,1);t.castShadow=!0,t.receiveShadow=!0,n.add(t)}Promise.resolve(Koe(n)).catch(()=>{}).finally(()=>{for(let e of n.children)e.dispose?.();r.dispose()})}function oX(){iX();for(let e of JY)e.holder&&(e.holder.parent?.remove(e.holder),e.holder.dispose?.());JY.length=0,qY.clear()}var sX=null,cX=null;function lX(){sX||typeof window>`u`||(ga({before:gUe,after:iX}),sX=setInterval(aX,cUe),Ui.subscribe(()=>{cX||=setTimeout(()=>{cX=null,aX()},lUe)}),Kr.subscribe(e=>{KY=new Set(Array.isArray(e)?e.map(e=>typeof e==`string`?e:e?.uuid).filter(Boolean):[])}),HY.subscribe(e=>{e||oX(),aX()}))}function vUe(){return{...tX,enabled:WY,allBatches:JY.length}}var uX=Ue(!1),dX=Ue(null),fX=Ue(!1),pX=[{key:`library`,label:`Library files`,note:`The files in your Explorer library. Deleting one here is the same delete as in the Explorer.`},{key:`versions`,label:`Old scene versions`,note:`Earlier versions of your scenes, kept so you can go back. The project keeps the RECORD either way â this is only the bytes on this machine.`},{key:`bin`,label:`Deleted files`,note:`Files in the recycle bin. Their bytes are still here so a delete can be undone; reclaiming them leaves the record of what was deleted.`},{key:`scenes`,label:`Saved scenes`,note:`Saved sessions holding one scene.`},{key:`projects`,label:`Saved projects`,note:`Saved sessions that carry a whole library with them, which is why they are the largest entries here.`},{key:`autosave`,label:`Autosave`,note:`The snapshot the app restores after a crash or a reload. It is rewritten as you work, so clearing it only loses the restore point.`},{key:`structure`,label:`Project structure`,note:`The library index and the project manifest. Tiny, and everything else here is addressed THROUGH them â so they cannot be removed.`},{key:`prefabs`,label:`Prefabs`,note:`Objects you saved to reuse.`},{key:`thumbs`,label:`Peer thumbnails`,note:`Pictures of files other people shared but you never downloaded. Purely a cache â they come back the next time you see those files.`},{key:`modules`,label:`Installed modules`,note:`Modules you installed from a .zip or a URL, with their packaged files.`},{key:`presets`,label:`Environment presets`,note:`Lighting and sky presets you saved.`},{key:`sleeve`,label:`VR sleeve slots`,note:`The objects on your VR forearm strip.`},{key:`other`,label:`Other`,note:`Keys no part of this build claims â left over from an older version, or from a module that is gone. These are the one thing here deleted directly, because there is nothing left to keep consistent with them.`}],yUe=`explorer:index`,bUe=`explorer:thumbs`,xUe=`explorer:blob:`,SUe=`session:`,CUe=`project:manifest`,wUe=`prefabs-v1`,TUe=`user-modules-v1`,EUe=`envpreset:`,DUe=`vrsleeve-slots-v1`,OUe=`latest`,kUe=5e3,mX=Symbol(`unmeasured`);async function hX(e){let t=null;try{let n=await Promise.race([md(e),new Promise(e=>{t=setTimeout(()=>e(mX),kUe)})]);return n===mX?{value:null,measured:!1}:{value:n,measured:!0}}catch{return{value:null,measured:!1}}finally{clearTimeout(t)}}function gX(e){if(e==null)return 0;try{return typeof Blob<`u`&&e instanceof Blob?e.size:e instanceof ArrayBuffer||typeof e?.byteLength==`number`?e.byteLength:typeof e==`string`?new TextEncoder().encode(e).length:new TextEncoder().encode(JSON.stringify(e)).length}catch{return 0}}function AUe(e){let t=0;try{let{files:n,...r}=e??{};for(let e of Object.values(n??{}))t+=Number(e?.byteLength??e?.length)||0;t+=gX(r)}catch{}return t}function _X(e){if(!e)return``;try{return new Date(e).toLocaleDateString(void 0,{year:`2-digit`,month:`short`,day:`numeric`})}catch{return``}}function jUe(){let e=new Set;try{let t=Object.keys(U(wd).scenes??{});for(let n of t)for(let t of xd(n))e.add(t)}catch{}return e}async function vX(){fX.set(!0);try{let e=null;try{let t=await navigator?.storage?.estimate?.();t&&typeof t.usage==`number`&&(e={used:t.usage??0,quota:t.quota??0})}catch{}try{await Eb()}catch{}let t=[];try{t=await Vne()}catch{}let n=new Map;for(let e of pX)n.set(e.key,[]);let r=e=>n.get(e.category)?.push(e),i=new Map(U(Fa).map(e=>[e.id,e])),a=new Map(U(ja).map(e=>[e.id,e])),o=sC(U(wd)),s=e=>
2338{let t=o.find(t=>t.id&&t.id===e.id)??o.find(t=>!t.id&&t.hash===e.hash);return t?String(t.id||t.hash):null},c=jUe(),l=new Map(U(kb).map(e=>[e.id,e]));for(let e of t){let t=String(e);if(t.startsWith(xUe)){let e=t.slice(14),n=i.get(e)??a.get(e),o=Number(n?.size)||0,l=!0;if(!n){let e=await hX(t);o=gX(e.value),l=e.measured}if(i.has(e))r({id:t,category:`library`,label:n.name,sub:n.kind+(n.hash?` · `+String(n.hash).slice(0,8):``),bytes:o,removable:!0,kind:`item`,ref:e});else if(a.has(e)){let i=s(n),a=i!==null,l=c.has(n.hash);r({id:t,category:a?`bin`:`versions`,label:n.name,sub:a?`in the recycle bin`:`version `+String(n.hash??``).slice(0,8),bytes:o,removable:!l,reason:l?`The project points at this version â it is the current or a pinned one. Unpin it, or lower Settings ⸠Explorer ⸠versions kept, and it becomes removable.`:void 0,kind:a?`bin`:`item`,ref:a?i:e})}else r({id:t,category:`other`,label:`Orphaned file bytes`,sub:e.slice(0,12)+(l?` â no library record`:` â size could not be read`),bytes:o,removable:!0,kind:`item`,ref:e});continue}if(t.startsWith(SUe)){let e=t.slice(8),n=l.get(e);r(n?{id:t,category:n.hasLibrary?`projects`:`scenes`,label:n.name||`Untitled`,sub:n.hasLibrary?n.libraryCount+(n.libraryCount===1?` file`:` files`)+` · `+_X(n.createdAt):_X(n.createdAt),bytes:Number(n.bytes)||0,removable:!0,kind:`session`,ref:e}:{id:t,category:`scenes`,label:`Unreadable session`,sub:e.slice(0,12),bytes:gX((await hX(t)).value),removable:!0,kind:`session`,ref:e});continue}if(t.startsWith(EUe)){let e=t.slice(10);r({id:t,category:`presets`,label:e,bytes:gX((await hX(t)).value),removable:!0,kind:`preset`,ref:e});continue}if(t===yUe){r({id:t,category:`structure`,label:`Library index`,sub:U(Fa).length+` files · `+U(ja).length+` hidden`,bytes:gX((await hX(t)).value),removable:!1,reason:`Every file above is addressed through this index. Removing it would lose the whole library while freeing almost nothing â delete the files instead and it shrinks with them.`,kind:`none`});continue}if(t===CUe){r({id:t,category:`structure`,label:`Project manifest`,sub:Object.keys(U(wd).scenes??{}).length+` scenes`,bytes:gX((await hX(t)).value),removable:!1,reason:`This is the project: which scenes exist and every version of each. Removing it would lose that record while freeing almost nothing.`,kind:`none`});continue}if(t===wUe){let e=U(Av);for(let n of e)r({id:t+`#`+n.id,category:`prefabs`,label:n.name||`Prefab`,sub:_X(n.createdAt),bytes:gX(n),removable:!0,kind:`prefab`,ref:n.id});continue}if(t===TUe){for(let e of U(vb))r({id:t+`#`+e.id,category:`modules`,label:e.name||e.id,sub:(e.version?`v`+e.version:``)+(e.source?` · `+e.source:``),bytes:AUe(e),removable:!0,kind:`module`,ref:e.id});continue}if(t===DUe){for(let e of U(mve))r({id:t+`#`+e.id,category:`sleeve`,label:e.name||`Slot`,bytes:gX(e),removable:!0,kind:`sleeve`,ref:e.id});continue}if(t===bUe){let e=U(bf),n=Object.keys(e),i=0;for(let t of n)i+=gX(e[t]);n.length&&r({id:t,category:`thumbs`,label:`Cached pictures of files you do not hold`,sub:n.length+(n.length===1?` thumbnail`:` thumbnails`),bytes:i,removable:!0,kind:`thumbs`,ref:n});continue}if(t===OUe){r({id:t,category:`autosave`,label:`Restore point`,sub:`the snapshot a reload offers to restore`,bytes:gX((await hX(t)).value),removable:!0,kind:`autosave`});continue}r({id:t,category:`other`,label:t,sub:`no part of this build claims this key`,bytes:gX((await hX(t)).value),removable:!0,kind:`raw`,ref:t})}let u=pX.map(e=>{let t=(n.get(e.key)??[]).sort((e,t)=>t.bytes-e.bytes||e.label.localeCompare(t.label));return{...e,rows:t,bytes:t.reduce((e,t)=>e+t.bytes,0)}}),d=u.reduce((e,t)=>e+t.bytes,0),f={at:Date.now(),estimate:e,categories:u,accounted:d,unaccounted:e?e.used-d:null,keys:t.length};return dX.set(f),f}finally{fX.set(!1)}}async function yX(e){if(!e?.removable)return 0;try{switch(e.kind){case`item`:return await Ga(String(e.ref)),e.bytes;case`bin`:return await gC(String(e.ref)),e.bytes;case`session`:return await jb(String(e.ref)),e.bytes;case`autosave`:return await ky(),e.bytes;case`prefab`:return await Nv(String(e.ref)),e.bytes;case`preset`:return await pv(String(e.ref)),e.bytes;case`module`:return await _b(String(e.ref)),e.bytes;case`sleeve`:return hve(String(e.ref)),e.bytes;case`thumbs`:for(let t of e.ref??[])Dre(t);return e.bytes;case`raw`:return await Hne(String(e.ref)),e.bytes;default:return 0}}catch{return 0}}async function bX(e){let t=0,n=0;for(let r of e??[]){let e=await yX(r);(e>0||r?.removable&&e===0&&r.bytes===0)&&n++,t+=e}let r=await vX();return{freed:t,removed:n,scan:r}}function xX(e){return(e??[]).reduce((e,t)=>
2338e+(t?.removable?t.bytes:0),0)}function SX(){uX.set(!0),vX()}var CX=`arprobe-findings-v1`,wX=`arprobe-anchor-v1`,MUe=[`anchors`,`local-floor`,`hit-test`,`plane-detection`],TX=120,NUe=10,PUe=60,EX=100,FUe=45;function IUe(){try{let e=typeof localStorage<`u`?nt.getItem(CX):null,t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}var DX=Ue(IUe()),OX=Ue(!1);function kX(e){try{typeof localStorage<`u`&&nt.setItem(CX,JSON.stringify(e))}catch{}}function AX(e,t,n){let r=[];DX.update(i=>(r=[...Array.isArray(i)?i:[],{step:e,ok:t,detail:n}],r)),kX(r)}function jX(){DX.set([]),kX([])}function MX(e){if(!e)return`unknown error`;if(typeof e==`string`)return e;let t=e.name?String(e.name):``,n=e.message?String(e.message):String(e);return t&&!n.startsWith(t)?`${t}: ${n}`:n}function NX(e){let t=String(e??``);return t.length>8?`${t.slice(0,8)}â¦`:t}function PX(e){if(!e)return`(none)`;let t=e=>typeof e==`number`?e.toFixed(3):`?`;return`[${t(e.x)}, ${t(e.y)}, ${t(e.z)}]`}function LUe(e,t){if(!e||!t)return NaN;let n=(e.x||0)-(t.x||0),r=(e.y||0)-(t.y||0),i=(e.z||0)-(t.z||0);return Math.sqrt(n*n+r*r+i*i)}function FX(e){if(!Number.isFinite(e)||e<=0)return`an unknown time`;let t=Math.round(e/1e3);if(t<90)return`${t}s`;let n=Math.round(t/60);return n<90?`${n}min`:`${Math.round(n/60)}h`}function IX(){try{let e=typeof localStorage<`u`?nt.getItem(wX):null,t=e?JSON.parse(e):null;return t&&typeof t.handle==`string`&&t.handle?t:null}catch{return null}}function RUe(e){try{return typeof localStorage<`u`&&nt.setItem(wX,JSON.stringify(e)),!0}catch{return!1}}function LX(){return typeof navigator>`u`?null:navigator.xr||null}async function zUe(){jX();let e=LX();AX(`navigator.xr`,!!e,e?`present`:`absent â this browser has no WebXR at all`);let t=globalThis.XRAnchor?.prototype,n=globalThis.XRSession?.prototype;if(AX(`XRAnchor`,!!globalThis.XRAnchor,globalThis.XRAnchor?`constructor present`:`absent â no anchor module`),AX(`XRAnchor.requestPersistentHandle`,typeof t?.requestPersistentHandle==`function`,typeof t?.requestPersistentHandle==`function`?`present â anchors can be persisted`:`absent â anchors would be session-only`),AX(`XRSession.restorePersistentAnchor`,typeof n?.restorePersistentAnchor==`function`,typeof n?.restorePersistentAnchor==`function`?`present`:`absent`),AX(`XRSession.deletePersistentAnchor`,typeof n?.deletePersistentAnchor==`function`,typeof n?.deletePersistentAnchor==`function`?`present`:`absent`),AX(`XRSession.persistentAnchors`,`persistentAnchors`in(n||{}),`persistentAnchors`in(n||{})?`declared on the prototype`:`not declared`),e)for(let t of[`immersive-ar`,`immersive-vr`])try{let n=await e.isSessionSupported(t);AX(`isSessionSupported('${t}')`,!!n,n?`supported`:`NOT supported`)}catch(e){AX(`isSessionSupported('${t}')`,!1,MX(e))}}async function BUe(e){let t=globalThis.XRWebGLLayer;if(typeof t!=`function`)return AX(`base layer`,!1,`XRWebGLLayer is not a constructor`),!1;let n=document.createElement(`canvas`);n.width=4,n.height=4;let r=n.getContext(`webgl`,{xrCompatible:!0});return r||(r=n.getContext(`webgl`),r&&typeof r.makeXRCompatible==`function`&&await r.makeXRCompatible()),r?(e.updateRenderState({baseLayer:new t(e,r)}),AX(`base layer`,!0,`throwaway 4x4 WebGL layer attached (nothing is rendered)`),!0):(AX(`base layer`,!1,`no WebGL context available`),!1)}async function VUe(e){for(let t of[`local-floor`,`local`])try{let n=await e.requestReferenceSpace(t);return AX(`reference space`,!0,`'${t}'`),{space:n,kind:t}}catch(e){AX(`reference space`,!1,`'${t}' refused: ${MX(e)}`)}return null}function HUe(e,t,n){return new Promise(r=>{let i=0,a=!1,o=null,s=!1,c=!n,l=!n,u=!n,d=null,f=!1,p=!1,m=!1,h=!1,g=!1,_=null,v=null;function y(){a||(a=!0,r(void 0))}e.addEventListener(`end`,()=>{a||AX(`session end`,!1,`session ended before the probe finished`),y()});function b(t,n){i+=1;try{x(n)}catch(e){AX(`frame loop`,!1,MX(e)),y();return}let r=s&&l&&u&&p&&m&&g;if(!a){if(r){AX(`probe steps`,!0,`all steps settled after ${i} frames`),y();return}if(i>=TX){AX(`probe steps`,!1,`frame budget (${TX}) exhausted with steps still pending`),y();return}e.requestAnimationFrame(b)}}function x(r){if(!s){let e=i>=NUe?r.getViewerPose(t):null;if(e){let t=e.transform.position;o={x:t.x,y:t.y,z:t.z},AX(`viewer pose`,!0,`available on frame ${i} â head at ${PX(o)}`),s=!0}else i>=PUe&&(AX(`viewer pose`,!1,`none after ${i} frames â tracking never established`),s=!0)}if(!c&&n){c=!0;let t=n.handle;if(typeof e.restorePersistentAnchor!=`function`)AX(`anchor restore`,!1,`session.restorePersistentAnchor is not a function`),l=!0,u=!0;else{let r=typeof n.createdAt==`number`?FX(Date.now()-n.createdAt):`an unknown time`;try{e.restorePersistentAnchor(t).then(e=>{d=e,l=!0,AX(`anchor restore`,!0,`handle ${NX(t)} restored (persisted ${r} ago)`)}).catch(e=>{l=!0,u=!0,AX(`anchor restore`,!1,`handle ${NX(t)}: ${MX(e)}`)})}catch(e){l=!0,u=!0,AX(`anchor restore`,!1,`handle ${NX(t)}: ${MX(e)}`)}}}if(d&&!u){let e=d.anchorSpace?r.getPose(d.anchorSpace,t):null;if(e){let t=e.transform.position,r=LUe(t,n?.pose);u=!0,AX(`restore delta`,Number.isFinite(r),Number.isFinite(r)?`now ${PX(t)} vs persisted ${PX(n?.pose)} â delta ${r.toFixed(3)} m`:`now ${PX(t)} â no persisted pose to compare against`)}else i>=EX&&(u=!0,AX(`restore delta`,!1,`restored anchor never resolved to a pose in this reference space`))}if(!f&&s&&(l||i>=FUe)){f=!0;let e=globalThis.XRRigidTransform;if(!o)S(`no viewer pose to anchor at`);else if(typeof r.createAnchor!=`function`)S(`frame.createAnchor is not a function ('anch
2338ors' not enabled)`);else if(typeof e!=`function`)S(`XRRigidTransform is not a constructor`);else{let n={x:o.x,y:0,z:o.z};try{r.createAnchor(new e(n),t).then(e=>{_=e,p=!0,AX(`anchor create`,!0,`created at the viewer floor projection ${PX(n)}`)}).catch(e=>{S(MX(e))})}catch(e){S(MX(e))}v=n}}if(_&&!m){let e=_.anchorSpace?r.getPose(_.anchorSpace,t):null;if(e){let t=e.transform.position;v={x:t.x,y:t.y,z:t.z},m=!0,AX(`anchor pose`,!0,`anchorSpace resolves â anchor at ${PX(v)}`)}else i>=EX&&(m=!0,AX(`anchor pose`,!1,`anchorSpace never resolved to a pose (keeping the requested position)`))}if(_&&m&&!h){if(h=!0,typeof _.requestPersistentHandle!=`function`)g=!0,AX(`anchor persist`,!1,`anchor.requestPersistentHandle is not a function â no persistence`);else try{_.requestPersistentHandle().then(e=>{g=!0;let t=RUe({handle:String(e),createdAt:Date.now(),pose:v});AX(`anchor persist`,!0,`handle ${NX(e)}${t?``:` (localStorage write FAILED)`} â restart the browser and probe again`)}).catch(e=>{g=!0,AX(`anchor persist`,!1,MX(e))})}catch(e){g=!0,AX(`anchor persist`,!1,MX(e))}}}function S(e){p=!0,m=!0,h=!0,g=!0,AX(`anchor create`,!1,e)}e.requestAnimationFrame(b)})}async function UUe(){let e=LX();if(!e||typeof e.requestSession!=`function`){AX(`session`,!1,`navigator.xr.requestSession is unavailable â nothing to probe on this device`);return}let t=IX();AX(`stored handle`,!!t,t?`handle ${NX(t.handle)} from ${FX(Date.now()-(t.createdAt||0))} ago at ${PX(t.pose)}`:`none â this run only creates one (restart the browser, then run again to test restore)`),OX.set(!0);let n=null,r=!1;try{try{n=await e.requestSession(`immersive-ar`,{optionalFeatures:MUe}),n.addEventListener(`end`,()=>{r=!0}),AX(`session`,!0,`immersive-ar started with all four features OPTIONAL`)}catch(e){AX(`session`,!1,MX(e));return}let i=n.enabledFeatures;i===void 0?AX(`enabledFeatures`,!1,`undefined on this build â cannot tell which features are on`):AX(`enabledFeatures`,!0,Array.from(i||[]).join(`, `)||`(empty)`);let a=n.persistentAnchors;if(a===void 0?AX(`session.persistentAnchors`,!1,`undefined on this session`):AX(`session.persistentAnchors`,!0,`${typeof a.size==`number`?a.size:Array.from(a||[]).length} persisted anchor(s) known to this session`),!await BUe(n))return;let o=await VUe(n);if(!o)return;await HUe(n,o.space,t)}catch(e){AX(`probe`,!1,MX(e))}finally{if(n&&!r)try{await n.end(),AX(`session end`,!0,`ended cleanly`)}catch(e){AX(`session end`,!1,MX(e))}OX.set(!1)}}async function WUe(){let e=IX();jX();try{typeof localStorage<`u`&&(nt.removeItem(wX),nt.removeItem(CX))}catch{}AX(`cleared`,!0,e?`dropped stored handle ${NX(e.handle)} (the runtime may still hold the anchor â no session to delete it through)`:`nothing was stored`)}var RX=`colocation-anchors-v1`,GUe=new hn(0,1,0),KUe=new hn(0,0,-1),qUe=1e3,JUe=.02,zX=Math.PI/180,YUe=.5,BX=1e3,XUe=50,ZUe=400;function VX(){try{let e=typeof localStorage<`u`?nt.getItem(RX):null,t=e?JSON.parse(e):null;return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}var HX=Ue(VX());function UX(e){HX.set(e);try{typeof localStorage<`u`&&nt.setItem(RX,JSON.stringify(e))}catch{}}function QUe(){let e=VX();return HX.set(e),e}var WX=!1,GX=!1,KX=0,qX=null,JX=!1,YX=!1,XX=null,ZX=!1,QX=null,$X=0,eZ=!1,tZ=null,nZ={checks:0,eases:0,snaps:0,mints:0,restores:0,restoreTries:0},rZ=e=>Math.atan2(Math.sin(e),Math.cos(e));function iZ(e){let t=new zt(Number(e?.[0])||0,Number(e?.[1])||0,Number(e?.[2])||0,typeof e?.[3]==`number`?e[3]:1);return t.lengthSq()<1e-12?0:(t.normalize(),yce(KUe.clone().applyQuaternion(t))??0)}function $Ue(e){return new zt().setFromAxisAngle(GUe,e).toArray()}function aZ(e,t){return Math.hypot(e.px-t.px,e.py-t.py,e.pz-t.pz)}function oZ(){return!!U(pw)||yve(ZUe)}function sZ(e,t){let n=mce(e,{roomKey:t,source:`anchor`});n&&(KX=n.at),hce()}function cZ(){tZ&&=(clearInterval(tZ.timer),null)}function eWe(e){let t=U(mg);t&&XX&&(cZ(),tZ={from:{px:t.px,py:t.py,pz:t.pz,yaw:t.yaw},to:{...e},t0:Date.now(),timer:setInterval(()=>lZ(),XUe)},nZ.eases+=1)}function lZ(){if(!tZ||!XX){cZ();return}if(oZ())return;let e=XX.key,t=U(mg);if(!t||t.roomKey!==e){cZ();return}let n=Math.min(1,(Date.now()-tZ.t0)/BX);if(n>=1){let t=tZ.to;cZ(),sZ(t,e);return}let r=n*n*(3-2*n),{from:i,to:a}=tZ;sZ({px:i.px+(a.px-i.px)*r,py:i.py+(a.py-i.py)*r,pz:i.pz+(a.pz-i.pz)*r,yaw:i.yaw+rZ(a.yaw-i.yaw)*r},e)}function tWe(e){e&&typeof e.at==`number`&&e.at!==KX&&(KX=e.at,(e.source===`calibration`||e.source===`spot`)&&e.roomKey&&(cZ(),XX=null,QX=null,_w().presenting&&(qX={px:e.px,py:e.py,pz:e.pz,yaw:e.
2338yaw,roomKey:e.roomKey})))}function nWe(e){let t=qX;if(qX=null,!t)return;JX=!0;let n;try{n=Tve(e.frame,e.refSpace,{pos:[t.px,t.py,t.pz],quat:$Ue(t.yaw)})}catch{JX=!1,uZ();return}n.then(async e=>{if(!e)throw Error(`anchors unavailable in this session`);let n=await wve(e);if(!n)throw Error(`persistent handles unavailable`);let r={...U(HX)},i=r[t.roomKey];r[t.roomKey]={handle:n,alignment:{px:t.px,py:t.py,pz:t.pz,yaw:t.yaw},at:Date.now()},UX(r),i?.handle&&i.handle!==n&&gw(_w().session,i.handle),XX={anchor:e,key:t.roomKey},nZ.mints+=1,JX=!1}).catch(()=>{JX=!1,uZ()})}function uZ(){YX||(YX=!0,es(`Could not save a room anchor â colocation still works this session; recalibrate after the next headset restart`))}function rWe(e){if(ZX||QX)return;let t=Object.entries(U(HX)).sort((e,t)=>(t[1]?.at??0)-(e[1]?.at??0));t.length&&(ZX=!0,(async()=>{let n=null;for(let[r,i]of t){if(U(mg))return;if(i?.handle){nZ.restoreTries+=1;try{let t=await Cve(e.session,i.handle);if(!t)continue;QX={anchor:t,key:r,busy:!1};return}catch(e){e?.name!==`NotFoundError`&&(n=e)}}}n&&es(`Room anchor restore failed â run the colocation ritual to align this room`)})().finally(()=>{ZX=!1}))}function iWe(e,t,n){QX=null,!U(mg)&&(sZ({px:e.pos[0],py:e.pos[1],pz:e.pos[2],yaw:iZ(e.quat)},t),XX={anchor:n,key:t},nZ.restores+=1,es(`Colocated â room `+t+` (restored)`))}function aWe(e,t){if(!XX)return;let n=U(mg);if(!n||n.roomKey!==XX.key)return;if(oZ()){cZ();return}if(lZ(),eZ||t-$X<1e3)return;$X=t,eZ=!0,nZ.checks+=1;let r=XX.key;hw(e.frame,XX.anchor,e.refSpace).then(e=>{if(eZ=!1,!e||!XX||XX.key!==r||oZ())return;let t=U(mg);if(!t||t.roomKey!==r)return;let n={px:e.pos[0],py:e.pos[1],pz:e.pos[2],yaw:iZ(e.quat)};if(aZ(n,t)>.5){cZ(),sZ(n,r),nZ.snaps+=1;return}let i=tZ?tZ.to:t,a=aZ(n,i),o=Math.abs(rZ(n.yaw-i.yaw));(a>.02||o>zX)&&eWe(n)}).catch(()=>{eZ=!1})}function oWe(){let e=_w(),t=!!e?.presenting;if(t&&!GX?!U(mg)&&!U(pw)&&rWe(e):!t&&GX&&(XX=null,QX=null,qX=null,YX=!1,cZ()),GX=t,t){if(qX&&!JX&&e.frame&&nWe(e),QX&&!QX.busy&&e.frame){let t=QX;t.busy=!0,hw(e.frame,t.anchor,e.refSpace).then(e=>{t.busy=!1,QX===t&&e&&iWe(e,t.key,t.anchor)}).catch(()=>{t.busy=!1})}aWe(e,Date.now())}}function dZ(e){let t={...U(HX)},n=t[e],r=xve(e);return n?(delete t[e],UX(t),n.handle&&gw(_w().session,n.handle),XX?.key===e&&(XX=null,cZ()),!0):r}function fZ(e,t){let n=e??{},r=t?.roomKey;if(typeof r==`string`&&r)return n[r]?r:null;let i=null,a=-1;for(let[e,t]of Object.entries(n)){let n=t?.at??0;n>a&&(i=e,a=n)}return i}function pZ(){WX||(WX=!0,mg.subscribe(tWe),Uh(oWe))}function sWe(){qX=null,JX=!1,YX=!1,XX=null,QX=null,ZX=!1,GX=!1,$X=0,eZ=!1,cZ(),nZ={checks:0,eases:0,snaps:0,mints:0,restores:0,restoreTries:0}}function cWe(){return{registered:WX,presenting:GX,records:JSON.parse(JSON.stringify(U(HX))),pendingMint:!!qX,mintInFlight:JX,restoreInFlight:ZX,poseWaiting:!!QX,liveKey:XX?.key??null,easing:!!tZ,easeTarget:tZ?{...tZ.to}:null,suspended:oZ(),stats:{...nZ}}}var lWe=V(`<!> <!> <!>`,1),uWe=V(`<button id="settings-search-clear" class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-white" aria-label="Clear search"><!></button>`),dWe=V(`<span class="inline-flex items-center gap-1 rounded-sm bg-gray-800 px-1.5 py-0.5 text-[11px]"> <button class="text-gray-400 hover:text-red-400" title="Remove theme">â</button></span>`),fWe=V(`<span class="mt-1 flex flex-wrap gap-1"></span>`),pWe=V(`Export the active theme as an editable .theme.json, tweak the colors, then Browse to load it back <!>`,1),mWe=V(`<span class="sr-stack"><button id="theme-export" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">Export template</button> <button id="theme-browse" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">Browseâ¦</button> <input type="file" accept=".json,application/json" style="display: none"/></span>`),hWe=V(`<input id="setting-game-sound-volume" type="range" style="width: 100%" min="0" max="1" step="0.05" aria-label="Game sounds volume"/>`),gWe=V(`<input id="setting-game-music-volume" type="range" style="width: 100%" min="0" max="1" step="0.05" aria-label="Game music volume"/>`),_We=V(`Show the welcome card every time the app opens. It normally appears only on your first 2339 visit â turn this on to keep its quick links handy, or <button class="underline">open it now</button>`,1),vWe=V(`<button id="reset-windows" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">Reset</button>`),yWe=V(`Undo / Redo / Multi-select buttons beside the logo, for touch â no <kbd>Ctrl+Z</kbd> or <kbd>Shift</kbd> needed. Multi-select adds on tap and boxes on drag, for objects and for mesh vertices, edges and faces. On by default on phones`,1),bWe=V(`<p class="ui-section-label">Appearance</p> <!> <!> <!> <p class="ui-section-label">Sound</p> <!> <!> <p class="ui-section-label">Notifications</p> <!> <!> <!> <!> <p class="ui-section-label">Windows & chrome</p> <!> <!> <!> <!> <!> <!> <p class="ui-section-label">Lists & menus</p> <!> <!> <!> <p class="ui-section-label">Viewport</p> <!> <!> <!>`,1),xWe=V(`<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>`),SWe=V(`<div class="overflow-x-auto"><table class="wheel-diag w-full text-left font-mono"><thead><tr><th>
2339Ît ms</th><th>mode</th><th>ÎX</th><th>ÎY</th><th>wheelÎY</th><th>ctrl</th><th>as</th><th>why</th></tr></thead><tbody></tbody></table></div>`),CWe=V(`<p class="text-gray-500 dark:text-gray-400">Scroll over the viewport â the last 8 wheel events land here, with how each was classified.</p>`),wWe=V(`<div id="wheel-diagnostics" class="text-xs"><p class="mb-1 text-gray-500 dark:text-gray-400"> </p> <!> <p class="mt-1 text-gray-500 dark:text-gray-400">If a mouse wheel pans instead of zooming (or a trackpad zooms), pick Viewport menu ⸠View ⸠Mouse wheel, or "Trackpad gestures" above.</p></div>`),TWe=V(`<p class="ui-section-label">Keyboard & mouse</p> <!> <!> <!> <p class="ui-section-label">Trackpad</p> <!> <!> <!> <!> <!> <!>`,1),EWe=V(`<span>A connected controller drives the game with no setup: the left stick walks, the right stick looks, and the d-pad + <strong>A</strong> work a HUD menu. Off ignores the pad entirely</span>`),DWe=V(`<span>Move with the RIGHT stick and look with the left â the southpaw layout</span>`),OWe=V(`<span>Push the look stick up to look DOWN (the flight-stick convention)</span>`),mZ=V(`<span> </span>`),kWe=V(`<input id="gamepad-deadzone" type="number" step="0.01" class="w-20 rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white"/>`),AWe=V(`<input id="gamepad-sensitivity" type="number" step="0.1" class="w-20 rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white"/>`),jWe=V(`<span>A scene can bind the pad itself with the <strong>Gamepad Button</strong> and <strong>Gamepad Axis</strong> nodes in the node editor (Input group) â button presses replicate like a key press, while a stick value stays local to the player holding it. Module bindings are listed under Shortcuts</span>`),MWe=V(`<span>Classic (the default): a left drag on the node editor's canvas pans and <kbd>Shift</kbd>+drag draws a selection box. Select-first: a left drag selects, dragging any selected node moves the whole selection, <kbd>Shift</kbd>+click adds to or removes from it, and the middle or right button pans â a right click that does not move still opens the menu</span>`),NWe=V(`<p class="ui-section-label">Gamepad</p> <!> <!> <!> <!> <!> <p class="ui-section-label">Bindings</p> <!> <p class="ui-section-label">Node editor</p> <!>`,1),PWe=V(`<input id="light-helper-length" type="number" min="0.2" max="50" step="0.5" class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white"/>`),FWe=V(`<span class="sr-stack"><input type="color" id="ping-color" class="h-7 w-full cursor-pointer rounded-sm border border-gray-500 bg-transparent"/> <!> <button id="ping-preview" class="rounded-sm bg-gray-600 px-1.5 py-1 text-white" title="Preview the ping chime">â¶ Preview</button></span>`),IWe=V(`<span>Modules that came with the scene you are leaving (a game's Waves or Untangle) and that the next scene does not use. Ask (the default) shows them and lets you choose; Unload switches them off (back on any time in Modules, and a scene that needs them offers to). A new blank scene always unloads them</span>`),LWe=V(`What a double-click on an object does in the viewport. A single click always just selects it; <kbd>Ctrl+A</kbd> selects everything`,1),RWe=V(`How distances are shown and typed â positions, snapping steps, bevel widths. The 2340 scene is always metres underneath, so this changes nothing but the display. You can 2341 also type a unit into any of those fields directly (<kbd>12cm</kbd>, <kbd>4in</kbd>, <kbd>1.5ft</kbd>) and it converts on entry`,1),zWe=V(`The same for rotations and angular snapping. <kbd>90deg</kbd> and <kbd>1.57rad</kbd> both parse whichever is on display`,1),BWe=V(`<span>Off (the default), a duplicate gets its own copy of the material, so editing one 2342 leaves the other alone. On, the copy and the original share ONE material and an 2343 edit to either changes both â for everyone in the session. Geometry is always 2344 copied either way. Use the Material section's <strong>Unlink</strong> to give one 2345 object its own material back</span>`),VWe=V(`<input type="color" id="wire-color" class="h-7 w-full cursor-pointer rounded-sm border border-gray-500 bg-transparent"/>`),HWe=V(`<input type="color" id="outline-color" class="h-7 w-full cursor-pointer rounded-sm border border-gray-500 bg-transparent"/>`),UWe=V(`<span class="sr-stack"><label class="flex items-center gap-1.5 text-xs whitespace-nowrap"><!> Auto</label> <input type="color" id="edit-wire-color" class="h-7 w-full cursor-pointer rounded-sm border border-gray-500 bg-transparent disabled:opacity-40"/></span>`),WWe=V(`<button id="reset-view-colors" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">Reset</button>`),GWe=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <p class="ui-section-label">Selection</p> <!> <p class="ui-section-label">Units</p> <!> <!> <p class="ui-section-label">Duplicate</p> <!> <!> <!> <!> <p class="ui-section-label">Wireframe & outline</p> <!> <!> <!> <!> <!>`,1),KWe=V(`<span>A file is local until somebody says otherwise, so this is what happens when you 2346 add one while connected. <strong>Ask each time</strong> puts the question in the 2347 Explorer, above the files it is about â and asks once about the library you 2348 brought with you when a session starts. <strong>Share automatically</strong> publishes everything with no gesture at all. <strong>Keep them local</strong> is 2349 silence: nothing is shared and nothing is asked. A file you <strong>explicitly unshared</strong> stays unshared whatever this says â a 2350 setting is a preference and that was a decision. This one is yours alone; peers 2351 choose for themselves.</span>`),qWe=V(`<span>When somebody shares a file or a folder, fetch it straight away. <strong>On by 2352 default</strong>: without it every shared file costs each peer a right-click, 2353 which is an extra step per file per person for something they already agreed to 2354 by being here. Turn it off on a metered connection or a very large project â 2355 shared files still appear, greyed, and download when you open them.</span>`),JWe=V(`<input id="auto-download" class="tp-check" type="checkbox"/>`),YWe=V(`<span>When you connect with work in a scene that was never saved, this app asks you to <strong>save it or dismiss it</strong> â an unsaved scene has no identity, so 2356 there is nothing for the other world to merge into. Turn this on to get the 2357 older question back instead: <strong>Share</strong> your objects into their 2358 world, or <strong>Stash</strong> them to a session first. Per device, and it 2359 changes nothing about what the session allows â only which question is put.</span>`),XWe=V(`<input id="merge-on-connect" class="tp-check" type="checkbox"/>`),ZWe=V(`<span>A shared file is part of the project, so by default any editor can take it 2360 out again â the same way anyone can delete an object. Choose <strong>Only whoever shared it</strong> for a session where one person owns the 2361 library and the rest are guests. Either way, <strong>nobody ever loses a copy 2362 they already downloaded</strong> â unsharing removes the offer, never the file. 2363 This is a preference for <em>this machine's menus</em>, not a rule the session 2364 enforces.</span>`),QWe=V(`<select id="unshare-authority" class="rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white"><option>Anyone in the session</option><option>Only whoever shared it</option></select>
2364`),$We=V(`How many past versions of each scene keep their bytes on this machine â browse 2365 them under <strong>Version history</strong> in a scene file's properties. Pinned 2366 versions are always kept. <strong>0 turns auto-versioning off</strong>: leaving a 2367 scene stops cutting one behind your back, and only the current version plus your 2368 pins keep their bytes â saving a scene and <kbd>Save versionâ¦</kbd> still work`,1),eGe=V(`<input id="keep-versions" type="number" min="0" max="200" step="1" class="w-20 rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white"/>`),tGe=V(`<span>Rule for importing same files which already in your library. <strong>Ask</strong> lets you decide file by file. <strong>Skip</strong> keeps what you have and tells you how many it left out. <strong>Import as copies</strong> brings them in as new files beside the 2369 originals - scenes get a fresh copy, while identical files of other kinds 2370 stay as one</span>`),nGe=V(`<span>What a downloaded scene, project or GLTF file is called. <kbd>[name]</kbd> is 2371 the scene's name (the project's, for a <kbd>.tp</kbd>); the date parts are <kbd>[YYYY]</kbd> <kbd>[YY]</kbd> <kbd>[MM]</kbd> <kbd>[DD]</kbd> <kbd>[HH]</kbd> <kbd>[mm]</kbd> <kbd>[ss]</kbd> <kbd>[ms]</kbd>, in UTC â so <kbd>[name]-[DD]-[MM]-[YY]</kbd> gives <strong>Arena-22-08-26</strong>. 2372 Something with no name yet falls back to a timestamp, so a save is never 2373 nameless</span>`),rGe=V(`<input id="save-name-template" type="text" class="w-40 rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white"/>`),iGe=V(`<span>Deleting a shared file removes it from the project for everyone, so each peer 2374 keeps its own copy in <strong>Deleted files</strong> where it can be restored. 2375 Turn this off and a delete is immediate on <em>this</em> machine â peers still 2376 get their own bin, because their copy is theirs.</span>`),aGe=V(`<input id="recycle-bin" class="tp-check" type="checkbox"/>`),oGe=V(`<span>Skip the confirmation when deleting files and folders. Reasonable only <em>because</em> the recycle bin exists â with the bin also off, a delete is 2377 immediate and final, which is why these two sit together.</span>`),sGe=V(`<input id="delete-no-confirm" class="tp-check" type="checkbox"/>`),cGe=V(`<span>Off by default: the bin is a safety net for the minutes after a delete, not 2378 storage, so its files are reclaimed the next time you load. The file then 2379 leaves <strong>Deleted</strong> for the <strong>Deleted log</strong> beside 2380 it â the record survives, only the bytes on this device go.<
2380/span>`),lGe=V(`<input id="keep-recycle-bin" class="tp-check" type="checkbox"/>`),uGe=V(`<span>Keep a record of what was deleted from this project â the name, who removed 2381 it, when, and the thumbnail taken at the time â in a <strong>Deleted log</strong> beside the bin. On by default. Turning it off 2382 hides the log here and stops writing a record for a delete that keeps no 2383 file; it does not erase what is already there, because the record belongs to 2384 the project and every peer holds the same one. To erase it, open <strong>Deleted</strong> and empty it.</span>`),dGe=V(`<input id="deleted-log" class="tp-check" type="checkbox"/>`),fGe=V(`<span>What is using this deviceâs storage â your library files, saved scenes and 2385 projects, old scene versions, the recycle bin and the caches â with a tick beside 2386 each one so you can reclaim what you no longer want. Every number is an <em>estimate</em>: the browser reports one figure for everything this app 2387 stores, so the breakdown adds ours up and says what is left over. Nothing here 2388 touches your peers â their copies are theirs.</span>`),pGe=V(`<!>Show breakdown`,1),mGe=V(`<!> <!> <!> <!> <!> <!> <!> <p class="ui-section-label">Deleted files</p> <!> <!> <!> <!> <p class="ui-section-label">Disk</p> <!>`,1),hGe=V(`<span class="font-semibold">Custom hands (identity)</span> â a GLB from your Explorer library that OTHER peers see as your hands in VR (bytes push automatically; renders rigid at the wrist)`,1),hZ=V(`<option> </option>`),gGe=V(`<select id="my-hand-model" class="rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white"><option>Default</option><!></select>`),_Ge=V(`<span class="font-semibold">CO0 on-device probe</span> â run this <em>inside the headset</em>: it opens an 2389 immersive-ar session, creates an anchor at your feet, persists the handle and reports what the runtime 2390 actually supports. Run it once, fully restart the browser, run it again â the second run's <em>restore delta</em> `,1),vGe=V(`<span class="sr-stack"><button id="ar-probe-run" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500 disabled:opacity-50"> </button> <button id="ar-probe-clear" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500 disabled:opacity-50">Clear stored anchor</button></span>`),yGe=V(`<div class="flex gap-1.5"><span> </span> <span class="whitespace-nowrap font-semibold"> </span> <span class="min-w-0 break-words text-gray-400"> </span></div>`),bGe=V(`<div class="flex max-h-72 flex-col gap-0.5 overflow-y-auto font-mono text-[11px] leading-snug"></div>`),xGe=V(`<span class="font-semibold" id="colocation-state"> </span> â share one physical room with a co-present peer. <em>Colocate here</em> uses the current 2391 viewpoint (both of you stand on the agreed spot facing the agreed way and press it); in VR the 2392 radial menu's Scene ⸠Colocate offers the more accurate point + aim ritual. While colocated the 2393 world stays 1:1 and a world-grab moves the SHARED room anchor, so your partner sees the scene 2394 move too. Expect ~1â3 cm of agreement, not millimetres. A calibration made in-headset is 2395 REMEMBERED per room (a persistent anchor): the next VR/AR session in that room re-aligns 2396 with no ritual. <em>Stop</em> keeps that memory; <em>Forget</em> drops it`,1),SGe=V(`<button id="colocate-forget" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500"> </button>`),CGe=V(`<span class="sr-stack"><button id="colocate-here" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">Colocate here</button> <button id="colocate-stop" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500 disabled:opacity-50">Stop</button> <!></span>`),wGe=V(`<div class="flex flex-col gap-1.5"><div class="flex flex-wrap items-center gap-2"><!> <!> <!> <!> <button id="nudge-reset" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500 disabled:opacity-50">Reset</button></div> <span>Nudge the world so it lines up with what you actually see â a box that should 2397 sit ON the table corner but hovers a centimetre off it. This is YOURS alone 2398 (each headset's calibration has its own small error, so each corrects its 2399 own), it is remembered per room, and it survives the automatic drift 2400 correction. In VR, arm <em>Fine-tune</em> in the Scene ⸠Colocate radial: the 2401 left stick slides the world, the right stick lifts and turns it. To move the 2402 scene for <em>everyone</em>, two-grip grab it instead.</span></div>`),TGe=V(`<span>While colocated, a room-mate's avatar body, name label and voice are hidden â you are 2403 looking at and listening to the real person. Their HANDS stay, drawn faint, because a 2404 controller is how somebody points at a virtual object standing on a real table; turn this 2405 off to hide those too. Local preference â it changes nothing for anyone else, and a REMOTE 2406 peer always sees and hears you both in full</span>`),EGe=V(`<!> <!> <!> <!> <!> <!> <!> <!>`,1),DGe=V('<span class="font-semibold">AI scene assistant</span> â build and edit the scene with prompts. Press <kbd class="rounded-sm border border-gray-500 px-1 text-[11px]">`</kbd> for the quick prompt bar, or open the AI Assistant window. Edits replicate to peers and undo as one step.',1),OGe=V(`<span class="inline-flex items-center gap-2 rounded-sm bg-gray-800 px-2 py-1 text-[13px]"><input type="radio" name="ai-active" title="Use this provider"/> <span class="font-semibold"> </span> <span class="text-gray-400"> </span> <span class="flex-1"></span> <button class="text-gray-300 hover:text-white">Edit</button> <button class="text-gray-400 hover:text-red-400" title="Remove">â</button></span>`),gZ=V(`<span class="flex flex-col gap-1"></span>`),kGe=V(`<span class="text-gray-400">No providers yet.</span>`),AGe=V(`<!> <button class="mt-1.5 self-start rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">+ Add provider</button>`,1),jGe=V(`<button> </button>`),MGe=V(`<div class="px-2 py-1 text-[12px] text-gray-400">no match â free text works too (aliases / custom ids)</div>`),NGe=V(`<div id="ai-model-list" class="max-h-40 overflow-y-auto rounded-sm border border-gray-600 bg-gray-800"><!> <!></div>`),PGe=V(`<span class="text-red-400">· no model selected</span>`),FGe=V(`<span class="text-emerald-400">· model <span class="font-mono"> </span> â Configuration OK</span>`),_Z=V(`<span class="text-red-400"> </span>`),IGe=V(`<span class="text-emerald-400"> </span> <!>`,1),LGe=V(`<span id="ai-test-result" class="text-[12px] leading-snug"><!></span>`),vZ=V(`<span class="flex flex-col gap-1.5"><select class="ui-input"></select> <input class="ui-input" placeholder="Label" autocomplete="off"/> <input class="ui-input" placeholder="Base URL (â¦/v1)" autocomplete="off"/> <input class="ui-input" type="password" placeholder="API key / bearer token" autocomplete="new-password"/> <input id="ai-model-input" class="ui-input" autocomplete="off"/> <!> <label class="flex items-center gap-2 text-[13px] text-gray-300"><input class="tp-check" type="checkbox"/> Stream responses</label> <label class="flex items-center gap-2 text-[13px] text-gray-300"><input id="ai-physics-tools" class="tp-check" type="checkbox"/> Physics tools (advanced)</label> <span class="text-[11px] leading-snug text-gray-400">Lets the assistant set physics bodies, attach joints and start the simulation. 2407 Multi-step physics is hard for small local models (4B) â recommended for 14B+ 2408 or hosted models. <button class="underline hover:text-gray-200">Local & small models guide</button></span> <input class="ui-input" placeholder="Temperature (blank = server default)"/> <span class="text-[11px] leading-snug text-gray-400">Turn streaming OFF for a self-hosted server whose tool calls only w
2408ork unstreamed â 2409 vLLM with a mismatched <span class="font-mono">--tool-call-parser</span> (e.g. hermes 2410 for a Qwen3.5 model, which needs qwen3_xml) mangles streamed tool calls. The 2411 assistant also detects that at runtime and falls back on its own.</span> <span class="flex gap-1.5"><button class="rounded-sm bg-primary-700 px-2 py-1 text-xs text-white hover:bg-primary-600">Save</button> <button class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500 disabled:opacity-50"> </button> <button class="rounded-sm bg-gray-700 px-2 py-1 text-xs text-white hover:bg-gray-600">Cancel</button></span> <!></span>`),RGe=V(`<span class="font-semibold">Text â 3D mesh</span> â generate custom models from prompts (Add menu â â⨠Generate 3D modelâ, or the assistant). Backends: a self-hosted <span class="font-mono">ComfyUI</span> running TRELLIS, or a hosted API (Meshy). See the Console/AI docs for setup.`,1),zGe=V(`<span class="inline-flex items-center gap-2 rounded-sm bg-gray-800 px-2 py-1 text-[13px]"><input type="radio" name="mesh-active" title="Use this provider"/> <span class="font-semibold"> </span> <span class="text-gray-400"> </span> <span class="flex-1"></span> <button class="text-gray-300 hover:text-white">Edit</button> <button class="text-gray-400 hover:text-red-400" title="Remove">â</button></span>`),BGe=V(`<span class="text-gray-400">No mesh providers yet.</span>`),VGe=V(`<!> <button class="mt-1.5 self-start rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">+ Add mesh provider</button>`,1),HGe=V(`<textarea class="ui-input min-h-[80px] resize-y font-mono text-[11px]"></textarea> <input class="ui-input" placeholder="Output node id (optional â auto-detects the SaveGLB node)"/>`,1),UGe=V(`<select class="ui-input"><option>preview (geometry only â faster, cheaper)</option><option>refine (adds textures â more credits)</option></select> <input class="ui-input" placeholder="Asset proxy URL (optional â blank uses the built-in default)"/> <span class="text-[11px] leading-snug text-gray-400">Meshy's assets CDN sends no CORS headers, so the finished model can't be 2412 downloaded by the browser directly â downloads go through a proxy 2413 (e.g. <span class="font-mono">https://proxy.theprototype.app</span>; blank 2414 tries the built-in defaults, falling back automatically).</span>`,1),WGe=V(`<span class="flex flex-col gap-1.5"><select class="ui-input"></select> <input class="ui-input" placeholder="Label" autocomplete="off"/> <input class="ui-input" autocomplete="off"/> <input class="ui-input" type="password" autocomplete="new-password"/> <!> <span class="flex gap-1.5"><button class="rounded-sm bg-primary-700 px-2 py-1 text-xs text-white hover:bg-primary-600">Save</button> <button class="rounded-sm bg-gray-700 px-2 py-1 text-xs text-white hover:bg-gray-600">Cancel</button></span></span>`),GGe=V(`API keys are stored <span class="font-semibold">unencrypted</span> in this browser's local storage (like all settings) and never leave your device except in requests to the provider you configure. "Reset settings" clears them.`,1),yZ=V(`<!> <!> <!> <!> <!> <!> <!>`,1),KGe=V(`How many people you expect in a session. Everyone connects to everyone, so each 2415 extra person costs every other person bandwidth â voice and live gestures are the 2416 hungry parts. Past this number an approval still works but warns; the hard limit 2417 is <span class="font-mono"> </span>, where approving would degrade 2418 the session for everybody rather than just for whoever joined last.`,1),qGe=V(`<input id="soft-peer-cap" type="number" min="2" class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white"/>`),JGe=V(`Default uses <span class="font-mono"> </span> and falls back to the public PeerJS cloud if it's unreachable.`,1),YGe=V(`Where peers discover each other. <!> Custom pins your own server (no fallback). Local dev is the <span class="font-mono">npm run peer</span> server on this machine â R22 round 9 made it an explicit choice, because a configured <span class="font-mono">.env</span> host now wins on localhost instead of being overridden by the hostname. Takes effect on reload.`,1),XGe=V(`<input class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white" placeholder="peer.example.com"/>`),ZGe=V(`<span class="sr-stack"><input class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white" placeholder="443"/> <input class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white" placeholder="/peerjs"/></span>`),QGe=V(`<input class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white" placeholder="turn:host:3478?transport=udp,â¦"/>
2418`),$Ge=V(`<span class="sr-stack"><input class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white" placeholder="turn user"/> <input class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white" placeholder="turn credential"/></span>`),eKe=V(`<input class="w-full rounded-sm bg-gray-700 px-1 py-0.5 text-xs text-white" placeholder="stun:host:3478"/>`),tKe=V(`<!> <!> <!> <!> <!> <!>`,1),nKe=V(`Switches the signaling server now and keeps your session id; an open session is left 2419 first. <button id="peer-server-reload" class="underline">Reload</button> if anything looks stuck`,1),rKe=V(`<button id="peer-server-apply" class="rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500 disabled:opacity-50"> </button>`),iKe=V(`<!> <!> <!> <!>`,1),aKe=V(`<p id="shortcut-layout-note" class="mb-1 text-xs text-amber-600 dark:text-amber-400">Letter shortcuts use the physical key position on this layout (the key where the letter sits on a QWERTY keyboard).</p>`),oKe=V(`<button title="Click to rebind"> </button>`),sKe=V(`<span class="inline-flex shrink-0 items-center gap-1"><kbd class="min-w-16 rounded-lg border border-gray-200 bg-gray-100 px-2 py-1 text-center text-xs font-semibold text-gray-800 dark:border-gray-500 dark:bg-gray-600 dark:text-gray-100"> </kbd> <!></span>`),cKe=V(`<span class="shortcut-layout shrink-0 text-xs text-gray-400" title="Your keyboard layout prints this on that key"> </span>`),lKe=V(`<button class="shortcut-reset ml-auto shrink-0 rounded-sm p-1 text-gray-400 hover:text-gray-200"><!></button>`),uKe=V(`<div class="shortcut-conflict mt-1 flex flex-wrap items-center gap-2 text-xs text-amber-600 dark:text-amber-400"><span><kbd class="font-semibold"> </kbd> </span> <button class="shortcut-swap rounded-sm bg-gray-600 px-2 py-0.5 text-white hover:bg-gray-500">Swap</button> <button class="shortcut-cancel rounded-sm px-2 py-0.5 underline">Cancel</button></div>`),dKe=V(`<div class="flex flex-col py-1"><div class="flex items-center gap-2"><!> <span class="text-sm text-gray-600 dark:text-gray-300"> </span> <!> <!></div> <!></div>`),fKe=V(`<p class="col-span-full mb-1 mt-3 text-xs font-semibold uppercase text-gray-400"> </p> <!>`,1),pKe=V(`<div id="shortcut-grid" class="grid grid-cols-1 gap-x-8 gap-y-0.5 sm:grid-cols-2 lg:grid-cols-3"></div>`),mKe=V(`<!> <div class="mb-1 flex items-center justify-between gap-3"><p class="text-xs text-gray-500 dark:text-gray-400">Click a shortcut's keys to rebind it - Esc cancels.</p> <button id="shortcut-reset-all" class="shrink-0 rounded-sm bg-gray-600 px-2 py-1 text-xs text-white hover:bg-gray-500">Reset all</button></div> <!>`,1),hKe=V(`<a href="https://alexz005.github.io/theprototype">https://alexz005.github.io/theprototype</a>`),gKe=V(`<a href="https://github.com/theprototype-app/core" target="_blank">github.com/theprototype-app/core</a>`),_Ke=V(`<a href="https://github.com/theprototype-app/modules" target="_blank">github.com/theprototype-app/modules</a>`),vKe=V(`<a href="https://github.com/theprototype-app/docs" target="_blank">github.com/theprototype-app/docs</a>`),yKe=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),bKe=V(`<div class="modal-content p-4"><div class="relative mb-3"><input id="settings-search" type="text" class="ui-input w-full pr-8" placeholder="Search settingsâ¦"/> <!></div> <div><!></div></div>`);function xKe(e,t){Ce(t,!1);let n=()=>z(Es,`$peers`,kt),i=()=>z(xC,`$peerServerStatus`,kt),a=()=>z(dc,`$settingsOpen`,kt),o=()=>z(Ss,`$settingsSection`,kt),l=()=>z(HX,`$anchorRecords`,kt),p=()=>z(mg,`$roomAlignment`,kt),x=()=>z(fve,`$customThemes`,kt),C=()=>z(dw,`$theme`,kt),T=()=>z(Ql,`$gameSoundVolume`,kt),E=()=>z(Zl,`$gameMusicVolume`,kt),k=()=>z(Dx,`$showWelcomeOnStart`,kt),A=()=>z(kx,`$showWhatsNewNotice`,kt),ee=()=>z(ns,`$toastsInDrawerOnly`,kt),te=()=>z(tf,`$drawerSlot`,kt),P=()=>z(ls,`$showRoomsButton`,kt),re=()=>z(zo,`$floatingToolbar`,kt),ie=()=>z(Go,`$toolbarAlwaysOnTop`,kt),ae=()=>z(Jo,`$touchTools`,kt),L=()=>z(rs,`$mobileUndockAllowed`,kt),oe=()=>z(Ps,`$advancedMode`,kt),se=()=>z(ss,`$showEnvInList`,kt),ce=()=>z(Vs,`$objectSearchEnabled`,kt),le=()=>z(Rv,`$perfStatsShown`,kt),de=()=>z(iw,`$perfReportsAvailable`,kt),fe=()=>z(rw,`$perfReportsOn`,kt),me=()=>z(Td,`$viewPrefs`,kt),V=()=>z(Rs,`$enableShiftAdd`,kt),he=()=>z(ll,`$helpersInPlay`,kt),ge=()=>z(nc,`$noteDoubleClickToOpen`,kt),U=()=>z(yY,`$trackpadMode`,kt),_e=()=>z(SY,`$panEnabled`,kt),ye=()=>z(xY,`$reversePan`,kt),be=()=>z(CY,`$pinchZoomEnabled`,kt),xe=()=>z(bY,`$allowBrowserZoom`,kt),we=()=>z(wY,`$lastWheelEvents`,kt),Ee=()=>z(Zu,`$gamepadPrefs`,kt),J=()=>z(BY,`$flowMouseBindings`,kt),De=()=>z(ni,`$showGrid`,kt),Oe=()=>z(bP,`$lightHelperLength`,kt),Ae=()=>z(hv,`$shadowQuality`,kt),je=()=>z(Br,`$autoQuality`,kt),Me=()=>z(ya,`$lodEnabled`,kt),Ne=()=>z(HY,`$kitInstancingEnabled`,kt),Pe=()=>z(Io,`$showSimControls`,kt),Fe=()=>z(Sc,`$syncedAnimations`,kt),Le=()=>z(bg,`$spatialVoice`,kt),Re=()=>z($y,`$pingColor`,kt),He=()=>z(Qy,`$pingSound`,kt),Ue=()=>z(Ey,`$autosaveEnabled`,kt),Ge=()=>z(Oy,`$autoRestoreEnabled`,kt),qe=()=>z(Cb,`$modulesOnOpen`,kt),Je=()=>z(QO,`$doubleClickAction`,kt),Ye=()=>
2419z(zC,`$lengthUnit`,kt),Xe=()=>z(RC,`$angleUnit`,kt),Ze=()=>z(cs,`$duplicateCarriesAnimation`,kt),Qe=()=>z(Lo,`$duplicateCarriesFlow`,kt),$e=()=>z(Fo,`$duplicateCarriesShader`,kt),et=()=>z(vm,`$shareDuplicatedMaterials`,kt),$=()=>z($S,`$shareNewFiles`,kt),tt=()=>z(pC,`$autoDownload`,kt),rt=()=>z(qd,`$mergeOnConnect`,kt),it=()=>z(eC,`$unshareAuthority`,kt),at=()=>z(gd,`$keepVersionsSetting`,kt),ot=()=>z(Pb,`$duplicateImportMode`,kt),st=()=>z(WS,`$saveNameTemplate`,kt),ct=()=>z(nC,`$recycleBinEnabled`,kt),lt=()=>z(mC,`$deleteWithoutConfirm`,kt),ut=()=>z(lC,`$keepRecycleBin`,kt),dt=()=>z(cC,`$deletedLogEnabled`,kt),ft=()=>z(ei,`$vrOverride`,kt),pt=()=>z(zR,`$myHandModel`,kt),mt=()=>z(Fa,`$explorerItems`,kt),ht=()=>z(OX,`$probeRunning`,kt),gt=()=>z(DX,`$probeFindings`,kt),_t=()=>z(_ce,`$roomNudge`,kt),vt=()=>z(_g,`$colocatedGhostHands`,kt),yt=()=>z(Eh,`$aiEnabled`,kt),bt=()=>z(Mh,`$aiProviders`,kt),xt=()=>z(Ah,`$aiActiveProvider`,kt),St=()=>z(kS,`$meshGenEnabled`,kt),Ct=()=>z(AS,`$meshProviders`,kt),wt=()=>z(NS,`$meshActiveProvider`,kt),Tt=()=>z(Hd,`$softPeerCap`,kt),Et=()=>z(CC,`$peerServerConfig`,kt),Dt=()=>z(ice,`$nonLatinLayoutSeen`,kt),Ot=()=>z(rf,`$cloudPluginInfo`,kt),[kt,At]=Ve(),jt=F(),Mt=F(),Nt=Bc(),Pt=F(!1);async function Ft(){let e=n();if(!e?.switchServer){location.reload();return}I(Pt,!0);let t=await e.switchServer(null);I(Pt,!1),t&&es(`Connected to `+(i()?.label??`the peer server`)+` â your session id is unchanged.`)}let It=F([...new Set(cg.map(e=>e.group))]),Lt=F(!1),Rt=typeof navigator>`u`?``:String(navigator.userAgentData?.platform||navigator.platform||``)+(/Firefox/.test(navigator.userAgent)?` · Firefox`:/Chrom/.test(navigator.userAgent)?` · Chromium`:/Safari/.test(navigator.userAgent)?` · Safari`:``),zt=typeof window<`u`&&!!window.matchMedia?.(`(pointer: coarse)`).matches,Bt=e=>e==null?`â`:Number.isInteger(e)?String(e):e.toFixed(2),Vt=F(null),Ht=!1;function Ut(){if(Ht)return;Ht=!0;let e=navigator?.keyboard;e?.getLayoutMap&&e.getLayoutMap().then(e=>{I(Vt,e)}).catch(()=>{})}function Wt(e,t){if(!t)return``;let n=String(e||``).split(`+`).pop()||``;if(!/^[A-Z]$/.test(n))return``;let r=t.get(`Key`+n)||``;return!r||/^[a-z]$/i.test(r)?``:r}let Gt=F(0),Kt=F(null),qt=F(null),Jt=null;function Yt(){Jt&&window.removeEventListener(`keydown`,Jt,!0),Jt=null,I(Kt,null),sg(!1)}function Xt(e){Yt(),I(qt,null),I(Kt,e),sg(!0),Jt=t=>{if(t.key===`Control`||t.key===`Alt`||t.key===`Shift`||t.key===`Meta`)return;if(t.preventDefault(),t.stopPropagation(),t.key===`Escape`){Yt(),pe(Gt);return}let n=lg(t),r=nce(e,n);!r.ok&&r.conflict?I(qt,{id:e,keys:n,other:r.conflict}):r.ok?r.meshEdit&&es(n+` is also a mesh-edit key, so it will do nothing while an Edit Mesh session is open`):es(r.reason||`That key cannot be bound`),Yt(),pe(Gt)},window.addEventListener(`keydown`,Jt,!0)}function Zt(){let e=Q(qt);if(!e)return;let t=cg.find(t=>t.id===e.id);t&&fg(e.other.id,t.keys),fg(e.id,e.keys),I(qt,null),pe(Gt)}function Qt(e){ace(e),I(qt,null),pe(Gt)}function $t(){rce(),I(qt,null),pe(Gt)}let en=F(!1),tn=F(!1),nn=F(!1),rn=F(!1),an=F(!1),on=F(!1),sn=F(!1),cn=F(!1),ln=F(!1),un=F(!1),dn=F(!1),fn=F(null),pn=F(`grok`),mn=F(``),hn=F(``),gn=F(``),_n=F(``),vn=F(!0),yn=F(!1),bn=F(``),xn=F(!1),Sn=F(null),Cn=F([]),wn=F(!1),Tn=F(!1),En={},Dn=`grok`,On=0;async function kn(){let e=Dh(Q(hn));if(!e)return;let t=++On;I(Tn,!0);let n=await Bz({id:`probe`,preset:Q(pn),label:``,baseUrl:e,apiKey:Q(gn).trim(),model:``});t===On&&(I(Tn,!1),n&&n.length&&I(Cn,n))}function An(){En[Dn]=Q(gn),jn(),I(gn,En[Q(pn)]??``),I(Cn,[]),I(wn,!1),I(Sn,null),Dn=Q(pn),(Q(gn).trim()||Q(pn)===`custom`)&&kn()}function jn(){let e=Ese(Q(pn));I(mn,e.label),I(hn,e.baseUrl),I(_n,e.defaultModel)}function Mn(){I(fn,null),I(pn,`grok`),jn(),I(gn,``),I(vn,!0),I(yn,!1),I(bn,``),I(Sn,null),I(Cn,[]),I(wn,!1),En={},Dn=Q(pn),I(dn,!0)}function Nn(e){I(fn,e.id),I(pn,e.preset),I(mn,e.label),I(hn,e.baseUrl),I(gn,e.apiKey),I(_n,e.model),I(vn,e.stream!==!1),I(yn,e.physicsTools===!0),I(bn,typeof e.temperature==`number`?String(e.temperature):``),I(Sn,null),I(Cn,Array.isArray(e.models)?e.models:[]),I(wn,!1),En={[e.preset]:e.apiKey},Dn=e.preset,I(dn,!0),kn()}function Pn(){if(!Q(hn).trim()||!Q(_n).trim()){es(`Base URL and model are required`);return}let e=parseFloat(Q(bn)),t={preset:Q(pn),label:Q(mn),baseUrl:Q(hn),apiKey:Q(gn),model:Q(_n),stream:Q(vn),physicsTools:Q(yn),temperature:Number.isFinite(e)?e:void 0,models:Q(Cn)};Q(fn)?jh(Q(fn),t):Ph(t),I(dn,!1),I(fn,null)}async function Fn(){if(!Q(hn).trim()){I(Sn,{ok:!1,detail:`Enter a base URL first`});return}I(xn,!0),I(Sn,null);let e=await IAe({id:`test`,preset:Q(pn),label:Q(mn),baseUrl:Dh(Q(hn)),apiKey:Q(gn).trim(),model:Q(_n).trim()});e.models&&e.models.length&&I(Cn,e.models),I(Sn,{ok:e.ok,detail:e.detail,modelOk:e.modelOk,model:Q(_n).trim()}),I(xn,!1)}let In=F(!1),Ln=F(null),Rn=F(`comfyui`),zn=F(``),Bn=F(``),Vn=F(``),Hn=F(``),Un=F(``),Wn=F(`preview`),Gn=F(``);function Kn(){let e=xge(Q(Rn));I(zn,e.label),I(Bn,e.baseUrl)}function qn(){I(Ln,null),I(Rn,`comfyui`),Kn(),I(Vn,``),I(Hn,``),I(Un,``),I(Wn,`preview`),I(Gn,``),I(In,!0)}function Jn(e){I(Ln,e.id),I(Rn,e.kind),I(zn,e.label),I(Bn,e.baseUrl),I(Vn,e.apiKey??``),I(Hn,e.workflowJson??``),I(Un,e.outputNodeId??``),I(Wn,e.mode??`preview`),I(Gn,e.assetProxy??``),I(In,!0)}function Yn(){if(!Q(Bn).trim()){es(`A base URL is required`);return}if(Q(Rn)===`comfyui`&&Q(Hn).trim())try{JSON.parse(Q(Hn))}
2419catch{es(`The ComfyUI workflow is not valid JSON â re-export it in API format`);return}let e={kind:Q(Rn),label:Q(zn),baseUrl:Q(Bn),apiKey:Q(Vn)};Q(Rn)===`comfyui`?(e.workflowJson=Q(Hn),e.outputNodeId=Q(Un)):(e.mode=Q(Wn),e.assetProxy=Q(Gn)),Q(Ln)?FS(Q(Ln),e):IS(e),I(In,!1),I(Ln,null)}function Xn(e){CC.update(t=>({...t,mode:e}))}function Zn(e,t){CC.update(n=>({...n,custom:{...n.custom,[e]:t}}))}let Qn=F();async function $n(e){let t=e.currentTarget.files?.[0];if(e.currentTarget.value=``,!t)return;let n=await dve(t);es(n?`Theme imported`:`Not a valid .theme.json file`)}let er=F(null);typeof navigator<`u`&&navigator.xr?.isSessionSupported?.(`immersive-ar`).then(e=>I(er,e)).catch(()=>I(er,!1));let tr=F(``),nr=F(),rr=null;function ir(e){let t=!!(e||``).trim();t&&!rr?(rr={shortcutsExpanded:Q(Lt),aiExpanded:Q(en),sceneExpanded:Q(nn),explorerExpanded:Q(rn),interfaceExpanded:Q(cn),controlsExpanded:Q(ln),inputExpanded:Q(un),connectionExpanded:Q(an),vrExpanded:Q(sn),aboutExpanded:Q(on)},I(Lt,!0),I(en,!0),I(nn,!0),I(rn,!0),I(cn,!0),I(ln,!0),I(un,!0),I(an,!0),I(sn,!0),I(on,!0)):!t&&rr&&(I(Lt,rr.shortcutsExpanded),I(en,rr.aiExpanded),I(nn,rr.sceneExpanded),I(rn,rr.explorerExpanded),I(cn,rr.interfaceExpanded),I(ln,rr.controlsExpanded),I(un,rr.inputExpanded),I(an,rr.connectionExpanded),I(sn,rr.vrExpanded),I(on,rr.aboutExpanded),rr=null)}function ar(e,t){let n=(t||``).trim().toLowerCase(),r=t=>{let n=[];for(let r=t;r&&r!==e;r=r.parentElement){let e=r.getAttribute(`data-keywords`);e&&n.push(e)}return n},i=()=>{let t=[],i=[];e.querySelectorAll(`h2`).forEach(e=>{let t=e.nextElementSibling;if(!(t instanceof HTMLElement)||!(e instanceof HTMLElement))return;let n=e.textContent||``,a=[],o=``;t.querySelectorAll(`.ui-section-label, .setting-row`).forEach(e=>{if(!e.classList.contains(`setting-row`)){o=e.textContent||``;return}a.push({el:e,info:{text:e.textContent||``,name:e.querySelector(`.sr-name`)?.textContent||``,group:o,section:n,extra:r(e)}})}),i.push({header:e,body:t,rows:a})});let o=e=>pY(n,e.info),s=!!n&&i.some(e=>e.rows.some(o)),c=e=>!n||(s?o(e):pY(n,e.info,{fallback:!0}));for(let{header:e,body:r,rows:a}of i){let i=0;for(let e of a){let r=c(e);e.el.style.display=r?``:`none`,r&&(i++,n&&t.push(e.el))}let o=!!n&&a.length>0&&i===0;r.style.display=o?`none`:``,e.style.display=o?`none`:``,n&&!o&&(t.push(e),r.querySelectorAll(`.ui-section-label`).forEach(e=>t.push(e)))}a(t)},a=e=>{let t=globalThis.Highlight,r=globalThis.CSS?.highlights;if(!t||!r)return;if(!n){r.delete(`settings-match`);return}let i=[];for(let t of e){let e=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let t=e.nextNode();t;t=e.nextNode()){let e=t.parentElement;if(e&&!e.closest(`input, textarea, select, option, button[role="switch"]`))for(let[e,r]of QVe(t.data,n)){let n=document.createRange();n.setStart(t,e),n.setEnd(t,r),i.push(n)}}}r.set(`settings-match`,new t(...i))},o=new MutationObserver(()=>i());return o.observe(e,{childList:!0,subtree:!0}),i(),{update(e){n=(e||``).trim().toLowerCase(),i()},destroy:()=>{o.disconnect(),globalThis.CSS?.highlights?.delete(`settings-match`)}}}function or(e){if(Gr())return;let t=Ur(()=>e),n=requestAnimationFrame(()=>requestAnimationFrame(()=>{document.activeElement===e&&e.blur()}));return{destroy:()=>{cancelAnimationFrame(n),t()}}}d(()=>(a(),o(),js),()=>{a()?(jo(),I(It,[...new Set(cg.map(e=>e.group))]),I(Lt,o()===`shortcuts`),I(en,o()===`ai`),I(nn,o()===`scene`),I(an,o()===`connection`),I(sn,o()===`vr`),I(cn,o()===`interface`),I(ln,o()===`controls`),I(un,o()===`input`),I(rn,o()===`explorer`)):a()===!1&&(js(),ke(Ss,null),Yt(),I(qt,null))}),d(()=>Q(Lt),()=>{Q(Lt)&&Ut()}),d(()=>(Q(tr),a(),o()),()=>{((Q(tr)||``).trim()||a()&&o()===`export`)&&I(tn,!0)}),d(()=>(Q(_n),Q(Cn)),()=>{I(jt,(()=>{let e=(Q(_n)||``).trim().toLowerCase();return e?Q(Cn).filter(t=>t.toLowerCase().includes(e)):Q(Cn)})())}),d(()=>Q(tr),()=>{ir(Q(tr))}),d(()=>(l(),p()),()=>{I(Mt,fZ(l(),p()))}),h(),R(),co(e,{title:`Settings`,modal:!1,onkeydown:e=>{if(e.key===`Escape`){if((Q(tr)||``).trim()){e.stopPropagation(),I(tr,``),Q(nr)?.focus();return}dc.set(!1)}},outsideclose:!0,size:`xl`,class:`tp-modal-frame`,classes:{header:`tp-modal-header`,body:`tp-modal-body flex-1`},get open(){return Se(),a()},set open(e){ke(dc,e)},footer:e=>{var t=lWe(),n=N(t);Do(n,{onclick:()=>nt.clear(),children:(e,t)=>{W();var n=Te(`Reset settings`);
2419X(e,n)},$$slots:{default:!0}});var r=g(n,2);Do(r,{color:`alternative`,onclick:()=>ky(),children:(e,t)=>{W();var n=Te(`Clear saved session`);X(e,n)},$$slots:{default:!0}});var i=g(r,2);Do(i,{id:`about-whats-new`,color:`alternative`,onclick:()=>{dc.set(!1),Tx()},children:(e,t)=>{W();var n=Te(`What's new`);X(e,n)},$$slots:{default:!0}}),X(e,t)},children:(e,t)=>{var n=bKe(),i=j(n),a=j(i);v(a),y(()=>S(a,()=>Q(tr),e=>I(tr,e))),We(a,e=>I(nr,e),()=>Q(nr)),ne(a,e=>or?.(e));var o=g(a,2),l=e=>{var t=uWe(),n=j(t);fS(n,{size:14,"aria-hidden":`true`}),H(t),Z(`click`,t,()=>{I(tr,``),Q(nr)?.focus()}),X(e,t)};G(o,e=>{Q(tr)&&e(l)}),H(i);var d=g(i,2),h=j(d);no(h,{multiple:!0,children:(e,t)=>{var n=yKe(),i=N(n);Eo(i,{get open(){return Q(cn)},set open(e){I(cn,e)},header:e=>{W();var t=Te(`Interface`);X(e,t)},children:(e,t)=>{var n=bWe(),r=g(N(n),2);YVe(r,{});var i=g(r,2);_o(i,{name:`Theme`,children:(e,t)=>{W();var n=Te(`UI theme for THIS device (the 3D viewport follows the environment, not the theme)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{{let t=ze(()=>(s(fw),x(),K(()=>[...fw,...x()].map(e=>({value:e.id,name:e.name})))));fq(e,{id:`theme-select`,get items(){return Q(t)},get value(){return Se(),C()},set value(e){ke(dw,e)},$$legacy:!0})}}}});var a=g(i,2);_o(a,{name:`Custom theme`,children:(e,t)=>{W();var n=pWe(),r=g(N(n)),i=e=>{var t=fWe();B(t,5,x,e=>e.id,(e,t)=>{var n=dWe(),r=j(n),i=g(r);H(n),O(()=>Y(r,`${Q(t),K(()=>Q(t).name)??``} `)),Z(`click`,i,()=>uve(Q(t).id)),X(e,n)}),H(t),X(e,t)};G(r,e=>{x(),K(()=>x().length)&&e(i)}),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=mWe(),r=j(n),i=g(r,2),a=g(i,2);We(a,e=>I(Qn,e),()=>Q(Qn)),H(n),Z(`click`,r,()=>pve()),Z(`click`,i,()=>Q(Qn)?.click()),Z(`change`,a,$n),X(e,n)}}});var o=g(a,4);_o(o,{name:`Game sounds`,children:(e,t)=>{W();var n=Te();O(e=>Y(n,`How loud a game's effects are on this device â coins, goals, hits, the clicks a 2420 game makes. Local to you; ${e??``}%`),[()=>(T(),K(()=>Math.round(T()*100)))]),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=hWe();v(n),S(n,T,e=>ke(Ql,e)),X(e,n)}}});var c=g(o,2);_o(c,{name:`Music`,children:(e,t)=>{W();var n=Te();O(e=>Y(n,`The background music a game plays while you are in Interact or Play (it stops when 2421 you go back to editing). Local to you; ${e??``}%`),[()=>(E(),K(()=>Math.round(E()*100)))]),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=gWe();v(n),S(n,E,e=>ke(Zl,e)),X(e,n)}}});var l=g(c,4);_o(l,{name:`Welcome on start`,children:(e,t)=>{W();var n=_We(),r=g(N(n));Z(`click`,r,()=>{dc.set(!1),Ahe()}),X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),k()},set checked(e){ke(Dx,e)},$$legacy:!0})}}});var u=g(l,2);_o(u,{name:`Announce new versions`,children:(e,t)=>{W();var n=Te(`After an update, mark the logo menu with a dot and show one toast linking to the 2422 changelog. Off means updates arrive silently â What's new stays in the logo menu`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),A()},set checked(e){ke(kx,e)},$$legacy:!0})}}});var d=g(u,2);_o(d,{name:`Toasts in drawer only`,children:(e,t)=>{W();var n=Te(`Hide ALL pop-up toasts in the viewport â including connection requests â so they appear only in the connection drawer's Toasts tab (the notification bell still keeps the full history). Pin the drawer to keep the Toasts tab handy`);
2422X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),ee()},set checked(e){ke(ns,e)},$$legacy:!0})}}});var f=g(d,2);kHe(f,{});var p=g(f,4),m=e=>{_o(e,{name:`Show Rooms button`,children:(e,t)=>{W();var n=Te(`Show the "Rooms" shortcut in the Connect bar. Off makes the bar cleaner â you can still open rooms from the connection info drawer (the chevron) ⸠Rooms tab`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),P()},set checked(e){ke(ls,e)},$$legacy:!0})}}})};G(p,e=>{te()&&e(m)});var h=g(p,2);_o(h,{name:`Floating toolbar`,children:(e,t)=>{W();var n=Te(`The bottom toolbar lifts above the docked Node editor or Explorer when one opens, so it never sits over their content (the default). Off, it stays down on the viewport floor beside the chat and simulation buttons â whether an open panel then covers it is "Toolbar always on top" below`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),re()},set checked(e){ke(zo,e)},$$legacy:!0})}}});var _=g(h,2);_o(_,{name:`Toolbar always on top`,children:(e,t)=>{W();var n=Te(`The bottom toolbar paints over the docked panels and over floating windows, so it is always reachable. Off (the default), a window or an open panel covers it instead â the toolbar gets out of the way. Also in the toolbar's own right-click menu; drag the bar itself to slide it left or right`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),ie()},set checked(e){ke(Go,e)},$$legacy:!0})}}});var y=g(_,2);_o(y,{name:`Window positions`,children:(e,t)=>{W();var n=Te(`Bring back any floating window (object list, chat, Explorer, editors) that drifted off-screen or behind the UI`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=vWe();Z(`click`,n,()=>{Zse(),es(`Window positions reset`)}),X(e,n)}}});var b=g(y,2);_o(b,{name:`Touch tools`,children:(e,t)=>{W();var n=yWe();W(4),X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),ae()},set checked(e){ke(Jo,e)},$$legacy:!0})}}});var w=g(b,2);_o(w,{name:`Allow undocking (touch)`,children:(e,t)=>{W();var n=Te(`On touch / small screens the Flow and Explorer panels stay docked and their "undock" buttons are hidden (floating windows are cramped on a phone). Turn this on to allow undocking them into floating windows anyway`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),L()},set checked(e){ke(rs,e)},$$legacy:!0})}}});var D=g(w,4);_o(D,{name:`Advanced mode`,children:(e,t)=>{W();var n=Te(`Show system objects (module content, environment rig) as a System filter in the object list`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{get checked(){return Se(),oe()},set checked(e){ke(Ps,e)},$$legacy:!0})}}});var M=g(D,2);_o(M,{name:`Environment in list`,children:(e,t)=>{W();var n=Te(`Show the environment group as an Environment filter in the object list`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{get checked(){return Se(),se()},set checked(e){ke(ss,e)},$$legacy:!0})}}});var ne=g(M,2);_o(ne,{name:`Object search in menu`,children:(e,t)=>{W();var n=Te(`Add a "Search objectsâ¦" entry to the viewport right-click menu â find a scene object and fly the camera to it`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{get checked(){return Se(),ce()},set checked(e){ke(Vs,e)},$$legacy:!0})}}});var F=g(ne,4);_o(F,{name:`Show FPS + draw calls`,children:(e,t)=>{W();var n=Te(`A small counter with the frame rate, frame time, draw calls and triangles â in the 2423 corner of the viewport and, in a headset, on a strip at the top of the view. The draw 2424 calls turn amber past 120 and red past 150, the practical limit on a Quest`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`show-perf-stats`,get checked(){return Se(),le()},set checked(e){ke(Rv,e)},$$legacy:!0})}}});var R=g(F,2),ue=e=>{_o(e,{name:`Send performance reports`,children:(e,t)=>{W();var n=Te(`Every 10 seconds, send this device's frame times, draw calls, triangles, quality level and 2425 module versions (no account, no scene content) so slow spots on real devices get fixed.
2426 A dot on the FPS counter shows it is on. Off by default`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`send-perf-reports`,get checked(){return Se(),fe()},set checked(e){ke(rw,e)},$$legacy:!0})}}})};G(R,e=>{de()&&e(ue)});var z=g(R,2);_o(z,{name:`Dock resizes the viewport`,children:(e,t)=>{W();var n=Te(`On, the 3D view ends where an open bottom panel begins â the way every editor lays out 2427 its viewport, so nothing you are working on sits behind the Node editor or the 2428 Explorer. Off, the view stays full-window and the panel is drawn over it`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`dock-pushes-viewport`,get checked(){return me(),K(()=>me().dockPushesViewport)},onchange:e=>Ed({dockPushesViewport:e.currentTarget.checked})})}}}),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0});var a=g(i,2);Eo(a,{get open(){return Q(ln)},set open(e){I(ln,e)},header:e=>{W();var t=Te(`Controls`);X(e,t)},children:(e,t)=>{var n=TWe(),r=g(N(n),2);_o(r,{name:`Shift+A quick add`,children:(e,t)=>{W();var n=Te(`Pressing Shift+A opens the Add menu at the cursor and spawns the picked object 2429 under it. Off by default â Shift also strafes the camera in fly mode`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),V()},set checked(e){ke(Rs,e)},$$legacy:!0})}}});var i=g(r,2);_o(i,{name:`Show helpers in Play (debug)`,children:(e,t)=>{W();var n=Te(`Light helpers, camera frustums and camera markers hide when Play starts (camera 2430 previews and captures never show them). On, they render inside Play with a DEBUG 2431 chip so a screenshot cannot be mistaken for the game`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`helpers-in-play`,get checked(){return Se(),he()},set checked(e){ke(ll,e)},$$legacy:!0})}}});var a=g(i,2);_o(a,{name:`Double-click to open notes`,children:(e,t)=>{W();var n=Te(`A single click on a note marker â and the notes drawer's ⹠⺠group arrows â then only 2432 flies the camera to the note; the card opens on a double click. Handy for reviewing a 2433 scene full of notes without a card in the way`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),ge()},set checked(e){ke(nc,e)},$$legacy:!0})}}});var o=g(a,4);_o(o,{name:`Trackpad gestures`,children:(e,t)=>{W();var n=Te(`Two-finger swipes on a laptop trackpad pan the camera; pinch zooms. Auto detects trackpads and leaves mouse wheels zooming as usual â pick On/Off if the detection guesses wrong on your hardware`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{fq(e,{id:`trackpad-mode`,items:[{value:`auto`,name:`Auto`},{value:`on`,name:`On`},{value:`off`,name:`Off`}],get value(){return Se(),U()},set value(e){ke(yY,e)},$$legacy:!0})}}});var s=g(o,2);_o(s,{name:`Two-finger pan`,children:(e,t)=>{W();var n=Te(`Two-finger swipes pan the camera. Off: swipes zoom like a mouse wheel, and panning stays available with a right-click drag`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),_e()},set checked(e){ke(SY,e)},$$legacy:!0})}}});var c=g(s,2);_o(c,{name:`Reverse trackpad pan`,children:(e,t)=>{W();var n=Te(`Flip the two-finger pan direction (default: the scene follows your fingers, like touch scrolling)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),ye()},set checked(e){ke(xY,e)},$$legacy:!0})}}});var l=g(c,2);_o(l,{name:`Pinch zoom`,children:(e,t)=>{W();var n=Te(`Pinching in/out on the viewport zooms the camera. Off: pinch does nothing (the page still never zooms) and zooming stays on the mouse wheel`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),be()},set checked(e){ke(CY,e)},$$legacy:!0})}}});var u=g(l,2);_o(u,{name:`Allow browser pinch zoom`,children:(e,t)=>{W();var n=Te(`Accessibility: let pinch / Ctrl+scroll zoom the whole PAGE again (off keeps pinch as an app gesture and stops accidental page zoom over panels, on desktop and mobile)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),xe()},set checked(e){ke(bY,e)},$$legacy:!0})}}});var d=g(u,2);_o(d,{name:`Wheel diagnostics`,noControl:!0,children:(e,t)=>{var n=wWe(),r=j(n),i=f(r),a=g(r,2),o=e=>{var t=SWe(),n=j(t),r=g(j(n));B(r,7,we,(e,t)=>e.t+`:`+t,(e,t)=>
2433{var n=xWe(),r=j(n),i=f(r,!0),a=g(r),o=f(a,!0),s=g(a),c=f(s,!0),l=g(s),u=f(l,!0),d=g(l),p=f(d,!0),m=g(d),h=f(m,!0),_=g(m),v=f(_,!0),y=g(_),x=f(y,!0);H(n),O((e,r,a)=>{b(n,`data-kind`,(Q(t),K(()=>Q(t).kind))),Y(i,(Q(t),K(()=>Q(t).dt))),Y(o,(Q(t),K(()=>Q(t).deltaMode))),Y(c,e),Y(u,r),Y(p,a),Y(h,(Q(t),K(()=>Q(t).ctrl?`â`:``))),Y(v,(Q(t),K(()=>Q(t).kind))),Y(x,(Q(t),K(()=>Q(t).why)))},[()=>(Q(t),K(()=>Bt(Q(t).deltaX))),()=>(Q(t),K(()=>Bt(Q(t).deltaY))),()=>(Q(t),K(()=>Bt(Q(t).wheelDeltaY)))]),X(e,n)}),H(r),H(n),H(t),X(e,t)},s=e=>{var t=CWe();X(e,t)};G(a,e=>{we(),K(()=>we().length)?e(o):e(s,-1)}),W(2),H(n),O(()=>Y(i,`${Rt||`unknown platform`} · pointer: ${zt?`coarse`:`fine`} · wheel mode: ${U()===`off`?`zoom`:U()===`on`?`pan`:`auto`}`)),X(e,n)},$$slots:{default:!0}}),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0});var o=g(a,2);Eo(o,{get open(){return Q(un)},set open(e){I(un,e)},header:e=>{W();var t=Te(`Input`);X(e,t)},children:(e,t)=>{var n=NWe(),r=g(N(n),2);_o(r,{name:`Gamepad`,children:(e,t)=>{var n=EWe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`gamepad-enabled`,get checked(){return Ee(),K(()=>Ee().enabled)},onchange:e=>Xu({enabled:e.currentTarget.checked})})}}});var i=g(r,2);_o(i,{name:`Swap sticks`,children:(e,t)=>{var n=DWe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`gamepad-swap`,get checked(){return Ee(),K(()=>Ee().swapSticks)},onchange:e=>Xu({swapSticks:e.currentTarget.checked})})}}});var a=g(i,2);_o(a,{name:`Invert look Y`,children:(e,t)=>{var n=OWe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`gamepad-invert-y`,get checked(){return Ee(),K(()=>Ee().invertY)},onchange:e=>Xu({invertY:e.currentTarget.checked})})}}});var o=g(a,2);_o(o,{name:`Stick deadzone`,children:(e,t)=>{var n=mZ(),r=f(n);O(()=>Y(r,`How far a stick may drift at rest before it counts as pushed (${s(Qu),K(()=>Qu.min)??``}â${s(Qu),K(()=>Qu.max)??``}). Raise it if the camera creeps with your hands off the pad; the range beyond it is rescaled, so nothing jumps`)),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=kWe();v(n),O(()=>{b(n,`min`,(s(Qu),K(()=>Qu.min))),b(n,`max`,(s(Qu),K(()=>Qu.max))),u(n,(Ee(),K(()=>Ee().deadzone)))}),Z(`change`,n,e=>Xu({deadzone:parseFloat(e.target.value)})),X(e,n)}}});var c=g(o,2);_o(c,{name:`Look sensitivity`,children:(e,t)=>{var n=mZ(),r=f(n);O(()=>Y(r,`How fast the look stick turns (${s(Yu),K(()=>Yu.min)??``}â${s(Yu),K(()=>Yu.max)??``}Ã). Mouse look has its own speed and is unaffected`)),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=AWe();v(n),O(()=>{b(n,`min`,(s(Yu),K(()=>Yu.min))),b(n,`max`,(s(Yu),K(()=>Yu.max))),u(n,(Ee(),K(()=>Ee().lookSensitivity)))}),Z(`change`,n,e=>Xu({lookSensitivity:parseFloat(e.target.value)})),X(e,n)}}});var l=g(c,4);_o(l,{name:`Per-game controls`,noControl:!0,children:(e,t)=>{var n=jWe();X(e,n)},$$slots:{default:!0}});var d=g(l,4);_o(d,{name:`Mouse bindings`,children:(e,t)=>{var n=MWe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{fq(e,{id:`flow-mouse-bindings`,get items(){return tUe},get value(){return Se(),J()},set value(e){ke(BY,e)},$$legacy:!0})}}}),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0});var l=g(o,2);{let e=ze(()=>(Q(tr),K(()=>!!Q(tr).trim())));SHe(l,{get searching(){return Q(e)}})}var d=g(l,2);Eo(d,{get open(){return Q(nn)},set open(e){I(nn,e)},header:e=>{W();var t=Te(`Scene`);X(e,t)},children:(e,t)=>{var n=GWe(),r=N(n);_o(r,{name:`Show grid`,children:(e,t)=>{W();var n=Te(`Display grid on floor`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{onclick:()=>{nt.getItem(`showGrid`)?nt.removeItem(`showGrid`):nt.setItem(`showGrid`,`false`)},get checked(){return Se(),De()},set checked(e){ke(ni,e)},$$legacy:!0})}}});var i=g(r,2);_o(i,{name:`Light helper length`,children:(e,t)=>{W();var n=Te(`How far a directional or spot light's helper line reaches along its direction (display only â a directional light has a direction, not a distance)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=PWe();v(n),O(()=>u(n,Oe())),Z(`change`,n,e=>bP.set(Math.max(.2,Number(e.target.value)||2))),X(e,n)}}});var a=g(i,2);_o(a,{name:`Shadow quality`,children:(e,t)=>{W();var n=Te(`Caps every light's shadow map size on THIS machine (Off disables shadows entirely; per-light sizes still replicate)`);
2433X(e,n)},$$slots:{default:!0,control:(e,t)=>{fq(e,{id:`shadow-quality`,items:[{value:`off`,name:`Off`},{value:`low`,name:`Low`},{value:`medium`,name:`Medium`},{value:`high`,name:`High`}],get value(){return Se(),Ae()},set value(e){ke(hv,e)},$$legacy:!0})}}});var o=g(a,2);_o(o,{name:`Reduce quality when the scene is heavy`,children:(e,t)=>{W();var n=Te(`When a heavy scene cannot keep 30 frames a second on THIS machine, drop shadows, then resolution, then effects, one step at a time, and give each back when frames recover. Never changes the scene for anyone else; the chip beside the object count says when it is active`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{id:`auto-quality`,get checked(){return Se(),je()},set checked(e){ke(Br,e)},$$legacy:!0})}}});var c=g(o,2);_o(c,{name:`Simplify distant models`,children:(e,t)=>{W();var n=Te(`Draw a lighter version of a dense model (a few thousand triangles or more) when it is far from you, built once per model on THIS machine. Nothing in the scene changes â the full model is what is saved, sent and edited`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{id:`lod-enabled`,get checked(){return Se(),Me()},set checked(e){ke(ya,e)},$$legacy:!0})}}});var l=g(c,2);_o(l,{name:`Draw repeated kit pieces together`,children:(e,t)=>{W();var n=Te(`Every copy of one pack piece (a wall, a floor tile, a battlement) is drawn in one go instead of one by one, which is what keeps a level built from the kits inside a headset's budget. Only on THIS machine; an edited or selected piece is always drawn on its own`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{id:`kit-instancing`,get checked(){return Se(),Ne()},set checked(e){ke(HY,e)},$$legacy:!0})}}});var d=g(l,2);THe(d,{});var f=g(d,2);_o(f,{name:`Simulation controls`,children:(e,t)=>{W();var n=Te(`Show the physics transport (play/pause/stop/reset) at bottom-right. Off by default to avoid confusion with the main play button; the P key still starts/stops the simulation`);
2433X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{get checked(){return Se(),Pe()},set checked(e){ke(Io,e)},$$legacy:!0})}}});var p=g(f,2);_o(p,{name:`Sync animations`,children:(e,t)=>{W();var n=Te(`Node animations use wall-clock time so all peers see the same phase`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{get checked(){return Se(),Fe()},set checked(e){ke(Sc,e)},$$legacy:!0})}}});var m=g(p,2);_o(m,{name:`Spatial voice`,children:(e,t)=>{W();var n=Te(`Voices come from where each peer is (pan + distance falloff)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{get checked(){return Se(),Le()},set checked(e){ke(bg,e)},$$legacy:!0})}}});var h=g(m,2);_o(h,{name:`Ping color + sound`,children:(e,t)=>{W();var n=Te(`Your ping color + sound â peers see and hear YOUR pings this way (color empty = your peer color)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=FWe(),r=j(n);v(r);var i=g(r,2);{let e=ze(()=>(s(Yy),K(()=>Yy.map(e=>({value:e.id,name:e.name})))));fq(i,{get items(){return Q(e)},get value(){return Se(),He()},set value(e){ke(Qy,e)},$$legacy:!0})}var a=g(i,2);H(n),O(()=>u(r,Re()||`#4f83cc`)),Z(`change`,r,e=>$y.set(e.currentTarget.value)),Z(`click`,a,()=>Hpe(He())),X(e,n)}}});var _=g(h,2);_o(_,{name:`Autosave`,children:(e,t)=>{W();var n=Te(`Keep a local session snapshot (restore offered after a crash/reload)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{get checked(){return Se(),Ue()},set checked(e){ke(Ey,e)},$$legacy:!0})}}});var y=g(_,2);_o(y,{name:`Auto-restore on load`,children:(e,t)=>{W();var n=Te(`Restore that snapshot automatically at startup instead of asking. Only ever runs when the scene is still empty; a message tells you what was restored`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{id:`auto-restore`,get checked(){return Se(),Ge()},set checked(e){ke(Oy,e)},$$legacy:!0})}}});var b=g(y,2);_o(b,{name:`When opening another scene`,children:(e,t)=>{var n=IWe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{fq(e,{id:`modules-on-open`,items:[{value:`ask`,name:`Ask`},{value:`keep`,name:`Keep modules`},{value:`unload`,name:`Unload modules`}],get value(){return Se(),qe()},set value(e){ke(Cb,e)},$$legacy:!0})}}});var x=g(b,4);_o(x,{name:`Double-click action`,children:(e,t)=>{W();var n=LWe();W(2),X(e,n)},$$slots:{default:!0,control:(e,t)=>{{let t=ze(()=>(s(XO),K(()=>XO.map(e=>({value:e.value,name:e.label})))));fq(e,{id:`double-click-action`,get items(){return Q(t)},get value(){return Se(),Je()},set value(e){ke(QO,e)},$$legacy:!0})}}}});var S=g(x,4);_o(S,{name:`Length`,children:(e,t)=>{W();var n=RWe();W(6),X(e,n)},$$slots:{default:!0,control:(e,t)=>{{let t=ze(()=>(s(VC),K(()=>VC.map(e=>({value:e,name:e})))));fq(e,{id:`length-unit`,get items(){return Q(t)},get value(){return Se(),Ye()},set value(e){ke(zC,e)},$$legacy:!0})}}}});var C=g(S,2);_o(C,{name:`Angle`,children:(e,t)=>{W();var n=zWe();W(4),X(e,n)},$$slots:{default:!0,control:(e,t)=>{fq(e,{id:`angle-unit`,items:[{value:`deg`,name:`degrees`},{value:`rad`,name:`radians`}],get value(){return Se(),Xe()},set value(e){ke(RC,e)},$$legacy:!0})}}});var w=g(C,4);_o(w,{name:`Carry animation clips`,children:(e,t)=>{W();var n=Te(`A duplicate gets its own copy of the object's animation clips, so the copy plays 2434 independently. Off leaves the copy unanimated`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),Ze()},set checked(e){ke(cs,e)},$$legacy:!0})}}});var T=g(w,2);_o(T,{name:`Carry object flow`,children:(e,t)=>{W();var n=Te(`A duplicate gets its own copy of the object's flow graph, with fresh node ids. An 2435 embedded Object Flow node keeps pointing at the object it referenced â re-aiming it at 2436 the copy is your call. Off leaves the copy without a graph`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),Qe()},set checked(e){ke(Lo,e)},$$legacy:!0})}}});var E=g(T,2);_o(E,{name:`Carry shader graph`,children:(e,t)=>{W();var n=Te(`A duplicate of a shader-driven object gets its own copy of the graph. Off leaves the copy 2437 with a frozen snapshot of the compiled material and nothing to edit. An object inheriting 2438 the scene default keeps inheriting it either way`);
2438X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),$e()},set checked(e){ke(Fo,e)},$$legacy:!0})}}});var D=g(E,2);_o(D,{name:`Share materials`,children:(e,t)=>{var n=BWe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{get checked(){return Se(),et()},set checked(e){ke(vm,e)},$$legacy:!0})}}});var k=g(D,4);_o(k,{name:`Wireframe color`,children:(e,t)=>{W();var n=Te(`Line color of the Wireframe view mode (Configure Scene ⸠View mode)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=VWe();v(n),O(()=>u(n,(me(),K(()=>me().wireColor)))),Z(`input`,n,e=>Ed({wireColor:e.currentTarget.value})),X(e,n)}}});var A=g(k,2);_o(A,{name:`Selection outline color`,children:(e,t)=>{W();var n=Te(`Outline drawn around your selected objects (objects a peer has locked keep their own color)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=HWe();v(n),O(()=>u(n,(me(),K(()=>me().outlineColor)))),Z(`input`,n,e=>Ed({outlineColor:e.currentTarget.value})),X(e,n)}}});var ee=g(A,2);_o(ee,{name:`Edit Mesh wireframe`,children:(e,t)=>{W();var n=Te(`Edge overlay while editing a mesh. Auto picks dark or light from the object's own color; turn it off to pin one color`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=UWe(),r=j(n),i=j(r);{let e=ze(()=>(me(),K(()=>me().editWireColor===`auto`)));xo(i,{id:`edit-wire-auto`,get checked(){return Q(e)},onchange:e=>Ed({editWireColor:e.currentTarget.checked?`auto`:`#2f81f7`})})}W(),H(r);var a=g(r,2);v(a),H(n),O(()=>{a.disabled=(me(),K(()=>me().editWireColor===`auto`)),u(a,(me(),K(()=>me().editWireColor===`auto`?`#2f81f7`:me().editWireColor)))}),Z(`input`,a,e=>Ed({editWireColor:e.currentTarget.value})),X(e,n)}}});var M=g(ee,2);_o(M,{name:`Reset line colors`,children:(e,t)=>{W();var n=Te();O(()=>Y(n,`Back to the defaults (${s(Dd),K(()=>Dd.wireColor)??``} / ${s(Dd),K(()=>Dd.outlineColor)??``} / auto). Per-device, never shared`)),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=WWe();Z(`click`,n,()=>{$ne(),es(`Line colors reset`)}),X(e,n)}}}),UVe(g(M,2),{}),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0});var h=g(d,2);Eo(h,{get open(){return Q(rn)},set open(e){I(rn,e)},header:e=>{W();var t=Te(`Explorer`);X(e,t)},children:(e,t)=>{var n=mGe(),r=N(n);_o(r,{name:`When you add files during a session`,children:(e,t)=>{var n=KWe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{fq(e,{id:`share-new-files`,items:[{value:`ask`,name:`Ask each time`},{value:`always`,name:`Share automatically`},{value:`never`,name:`Keep them local`}],get value(){return Se(),$()},set value(e){ke($S,e)},$$legacy:!0})}}});var i=g(r,2);_o(i,{name:`Download shared files automatically`,children:(e,t)=>{var n=qWe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=JWe();v(n),O(()=>w(n,tt())),Z(`change`,n,e=>pC.set(!!e.target.checked)),X(e,n)}}});var a=g(i,2);_o(a,{name:`Offer to merge unsaved work on connect`,children:(e,t)=>{var n=YWe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=XWe();v(n),O(()=>w(n,rt())),Z(`change`,n,e=>qd.set(!!e.target.checked)),X(e,n)}}});var o=g(a,2);_o(o,{name:`Who can unshare a file`,children:(e,t)=>{var n=ZWe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=QWe(),r=j(n);r.value=r.__value=`anyone`;var i=g(r);i.value=i.__value=`owner`,H(n);var a;_(n),O(()=>{a!==(a=it())&&(n.value=(n.__value=a)??``,D(n,a))}),Z(`change`,n,e=>eC.set(e.target.value===`owner`?`owner`:`anyone`)),X(e,n)}}});var s=g(o,2);_o(s,{name:`Keep versions per scene`,children:(e,t)=>{W();var n=$We();W(6),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=eGe();v(n),O(()=>u(n,at())),Z(`change`,n,e=>gd.set(Math.max(0,Math.floor(Number(e.target.value)||0)))),X(e,n)}}});var c=g(s,2);_o(c,{name:`When importing files already in your library`,children:(e,t)=>{var n=tGe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{fq(e,{id:`import-duplicate-mode`,items:[{value:`ask`,name:`Ask`},{value:`skip`,name:`Skip them`},{value:`copy`,name:`Import as copies`}],get value(){return Se(),ot()},set value(e){ke(Pb,e)},$$legacy:!0})}}});var l=g(c,2);_o(l,{name:`Save name`,children:(e,t)=>{var n=nGe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=rGe();v(n),O(()=>u(n,st())),Z(`change`,n,e=>WS.set(String(e.target.value??``))),X(e,n)}}});var d=g(l,4);_o(d,{name:`Keep a recycle bin`,children:(e,t)=>{var n=iGe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=aGe();v(n),O(()=>w(n,ct())),Z(`change`,n,e=>nC.set(!!e.target.checked)),X(e,n)}}});var f=g(d,2);_o(f,{name:`Delete without asking`,children:(e,t)=>{var n=oGe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=sGe();v(n),O(()=>w(n,lt())),Z(`change`,n,e=>mC.set(!!e.target.checked)),X(e,n)}}});var p=g(f,2);_o(p,{name:`Keep deleted files after a reload`,children:(e,t)=>{var n=cGe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=lGe();v(n),O(()=>w(n,ut())),Z(`change`,n,e=>lC.set(!!e.target.checked)),X(e,n)}}});var m=g(p,2);_o(m,{name:`Deleted files log`,children:(e,t)=>{var n=uGe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=dGe();v(n),O(()=>w(n,dt())),Z(`change`,n,e=>cC.set(!!e.target.checked)),X(e,n)}}});var h=g(m,4);_o(h,{name:`Storage used`,children:(e,t)=>{var n=fGe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{Do(e,{id:`settings-storage`,size:`xs`,color:`alternative`,get onclick(){return SX},children:(e,t)=>{var n=pGe(),r=N(n);$x(r,{size:14,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}})}}}),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0});var y=g(h,2);Eo(y,{get open(){return Q(sn)},set open(e){I(sn,e)},header:e=>{W();var t=Te(`VR`);X(e,t)},children:(e,t)=>{var n=EGe(),i=N(n);_o(i,{name:`VR override`,children:(e,t)=>{W();var n=Te(`Forces normal play even if immersive-vr is enabled`);
2438X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{onclick:()=>{nt.getItem(`vrOverride`)?nt.removeItem(`vrOverride`):nt.setItem(`vrOverride`,`true`)},get checked(){return Se(),ft()},set checked(e){ke(ei,e)},$$legacy:!0})}}});var a=g(i,2);HHe(a,{get arSupport(){return Q(er)}});var o=g(a,2);_o(o,{name:`My hand model`,children:(e,t)=>{var n=hGe();W(),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=gGe(),r=j(n);r.value=r.__value=``;var i=g(r);B(i,1,()=>(mt(),K(()=>mt().filter(e=>e.kind===`object`))),e=>e.id,(e,t)=>{var n=hZ(),r=f(n,!0),i={};O(()=>{Y(r,(Q(t),K(()=>Q(t).name))),i!==(i=(Q(t),K(()=>Q(t).hash)))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(n);var a;_(n),O(()=>{a!==(a=pt())&&(n.value=(n.__value=a)??``,D(n,a))}),Z(`change`,n,e=>UR(e.target.value)),X(e,n)}}});var c=g(o,2);_o(c,{name:`Colocation probe (dev)`,children:(e,t)=>{var n=_Ge(),r=g(N(n),5);O(()=>Y(r,` line is the answer. The report survives the session, a reload and a restart${Q(er)===!1?`. This device reports no immersive-ar support`:``}`)),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=vGe(),r=j(n),i=f(r,!0),a=g(r,2);H(n),O(()=>{r.disabled=ht(),Y(i,ht()?`Probingâ¦`:`Probe AR capabilities`),a.disabled=ht()}),Z(`click`,r,()=>{zUe(),UUe()}),Z(`click`,a,()=>WUe()),X(e,n)}}});var l=g(c,2),u=e=>{_o(e,{name:`Probe report`,noControl:!0,children:(e,t)=>{var n=bGe();B(n,5,gt,Be,(e,t)=>{var n=yGe(),i=j(n),a=f(i,!0),o=g(i,2),s=f(o,!0),c=g(o,2),l=f(c,!0);H(n),O(()=>{r(i,1,M((Q(t),K(()=>Q(t).ok?`text-green-400`:`text-red-400`)))),Y(a,(Q(t),K(()=>Q(t).ok?`â`:`â`))),Y(s,(Q(t),K(()=>Q(t).step))),Y(l,(Q(t),K(()=>Q(t).detail)))}),X(e,n)}),H(n),X(e,n)},$$slots:{default:!0}})};G(l,e=>{gt(),K(()=>gt().length)&&e(u)});var d=g(l,2);_o(d,{name:`Colocation`,children:(e,t)=>{var n=xGe(),r=N(n),i=f(r,!0);W(7),O(()=>Y(i,(p(),K(()=>p()?`Colocated · `+(p().roomKey??`room`):`Not colocated`)))),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=CGe(),r=j(n),i=g(r,2),a=g(i,2),o=e=>{var t=SGe(),n=f(t);O(()=>{b(t,`title`,`Forget the saved room anchor for `+Q(Mt)+` â the next visit needs the ritual again. Stop does NOT forget.`),Y(n,`Forget ${Q(Mt)??``}`)}),Z(`click`,t,()=>dZ(Q(Mt))),X(e,t)};G(a,e=>{Q(Mt)&&e(o)}),H(n),O(()=>i.disabled=!p()),Z(`click`,r,()=>vve()),Z(`click`,i,()=>gve()),X(e,n)}}});var m=g(d,2),h=e=>{_o(e,{name:`Fine-tune`,noControl:!0,children:(e,t)=>{var n=wGe(),r=j(n),i=j(r);{let e=ze(()=>(_t(),K(()=>_t()?.dx??0))),t=ze(()=>-hg);hq(i,{id:`nudge-dx`,label:`X`,get value(){return Q(e)},unit:`length`,step:.002,snap:.01,decimals:3,get min(){return Q(t)},get max(){return hg},onchange:e=>mw({dx:e})})}var a=g(i,2);{let e=ze(()=>(_t(),K(()=>_t()?.dy??0))),t=ze(()=>-hg);hq(a,{id:`nudge-dy`,label:`Y`,get value(){return Q(e)},unit:`length`,step:.002,snap:.01,decimals:3,get min(){return Q(t)},get max(){return hg},onchange:e=>mw({dy:e})})}var o=g(a,2);{let e=ze(()=>(_t(),K(()=>_t()?.dz??0))),t=ze(()=>-hg);hq(o,{id:`nudge-dz`,label:`Z`,get value(){return Q(e)},unit:`length`,step:.002,snap:.01,decimals:3,get min(){return Q(t)},get max(){return hg},onchange:e=>mw({dz:e})})}var c=g(o,2);{let e=ze(()=>(_t(),K(()=>(_t()?.dyaw??0)*(180/Math.PI))));hq(c,{id:`nudge-dyaw`,label:`Yaw`,get value(){return Q(e)},unit:`angleDeg`,step:.05,snap:.5,decimals:2,min:-15,max:15,onchange:e=>mw({dyaw:e*Math.PI/180})})}var l=g(c,2);H(r),W(2),H(n),O(e=>l.disabled=e,[()=>(s(pg),_t(),K(()=>pg(_t())))]),Z(`click`,l,()=>Sve()),X(e,n)},$$slots:{default:!0}})};G(m,e=>{p()&&e(h)});var v=g(m,2);_o(v,{name:`Ghost hands`,children:(e,t)=>{var n=TGe();X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{id:`colocated-ghost-hands`,get checked(){return Se(),vt()},set checked(e){ke(_g,e)},$$legacy:!0})}}}),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0});var ne=g(y,2);Eo(ne,{get open(){return Q(en)},set open(e){I(en,e)},header:e=>{W();var t=Te(`AI`);X(e,t)},children:(e,t)=>{var n=yZ(),i=N(n);_o(i,{name:`Enable assistant`,children:(e,t)=>{var n=DGe();W(3),X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{onchange:()=>Nh(yt()),get checked(){return Se(),yt()},set checked(e){ke(Eh,e)},$$legacy:!0})}}});var a=g(i,2);_o(a,{name:`Providers`,noControl:!0,children:(e,t)=>{var n=AGe(),r=N(n),i=e=>{var t=gZ();B(t,5,bt,e=>e.id,(e,t)=>{var n=OGe(),r=j(n);v(r);var i=g(r,2),a=f(i,!0),o=g(i,2),s=f(o,!0),c=g(o,4),l=g(c,2);H(n),O(()=>{w(r,(xt(),Q(t),K(()=>xt()===Q(t).id))),Y(a,(Q(t),K(()=>Q(t).label))),Y(s,(Q(t),K(()=>Q(t).model)))}),Z(`change`,r,()=>kh(Q(t).id)),Z(`click`,c,()=>Nn(Q(t))),Z(`click`,l,()=>Oh(Q(t).id)),X(e,n)}),H(t),X(e,t)},a=e=>{var t=kGe();X(e,t)};G(r,e=>{bt(),K(()=>bt().length)?e(i):e(a,-1)});var o=g(r,2);Z(`click`,o,Mn),X(e,n)},$$slots:{default:!0}});var o=g(a,2),s=e=>{{let t=ze(()=>Q(fn)?`Edit provider`:`New provider`);_o(e,{get name(){return Q(t)},noControl:!0,children:(e,t)=>{var n=vZ(),i=j(n);B(i,5,()=>Ose,Be,(e,t)=>{var n=hZ(),r=f(n,!0),i={};O(()=>{Y(r,(Q(t),K(()=>Q(t).label))),i!==(i=(Q(t),K(()=>Q(t).preset)))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(i),_(i);var a=g(i,2);v(a);var o=g(a,2);v(o);var s=g(o,2);v(s);var l=g(s,2);v(l);var u=g(l,2),d=e=>{var t=NGe(),n=j(t);B(n,1,()=>Q(jt),e=>e,(e,t)=>{var n=jGe(),i=f(n,!0);O(e=>{r(n,1,`block w-full px-2 py-1 text-left font-mono text-[12px] ${e??``}`),Y(i,Q(t))},[()=>(Q(t),Q(_n),K(()=>Q(t)===Q(_n).trim()?`bg-primary-700 text-white`:`text-gray-200 hover:bg-gray-700`))]),Z(`mousedown`,n,Ke(()=>{I(_n,Q(t)),I(wn,!1)})),X(e,n)});var i=g(n,2),a=e=>{var t=MGe();X(e,t)};G(i,e=>{Q(jt),K(()=>!Q(jt).length)&&e(a)}),H(t),X(e,t)};G(u,e=>{Q(wn),Q(Cn),K(()=>Q(wn)&&Q(Cn).length)&&e(d)});var p=g(u,2),h=j(p);v(h),W(),H(p);var y=g(p,2),x=j(y);v(x),W(),H(y);
2438var C=g(y,2),w=g(j(C));H(C);var T=g(C,2);v(T);var E=g(T,4),D=j(E),k=g(D,2),A=f(k,!0),ee=g(k,2);H(E);var M=g(E,2),te=e=>{var t=LGe(),n=j(t),r=e=>{var t=IGe(),n=N(t),r=f(n),i=g(n,2),a=e=>{var t=PGe();X(e,t)},o=e=>{var t=FGe(),n=g(j(t)),r=f(n,!0);W(),H(t),O(()=>Y(r,(Q(Sn),K(()=>Q(Sn).model)))),X(e,t)},s=e=>{var t=_Z(),n=f(t);O(()=>Y(n,`· model "${Q(Sn),K(()=>Q(Sn).model)??``}" did not respond â pick one from the list`)),X(e,t)};G(i,e=>{Q(Sn),K(()=>!Q(Sn).model)?e(a):(Q(Sn),K(()=>Q(Sn).modelOk)?e(o,1):(Q(Sn),K(()=>Q(Sn).modelOk===!1)&&e(s,2)))}),O(()=>Y(r,`â ${Q(Sn),K(()=>Q(Sn).detail)??``}`)),X(e,t)},i=e=>{var t=_Z(),n=f(t);O(()=>Y(n,`â ${Q(Sn),K(()=>Q(Sn).detail)??``}`)),X(e,t)};G(n,e=>{Q(Sn),K(()=>Q(Sn).ok)?e(r):e(i,-1)}),H(t),X(e,t)};G(M,e=>{Q(Sn)&&e(te)}),H(n),O(()=>{b(l,`placeholder`,(Q(Tn),Q(Cn),K(()=>Q(Tn)?`Model id â fetching listâ¦`:Q(Cn).length?`Model id â `+Q(Cn).length+` available`:`Model id`))),k.disabled=Q(xn),Y(A,Q(xn)?`Testingâ¦`:`Test connection`)}),m(i,()=>Q(pn),e=>I(pn,e)),Z(`change`,i,An),S(a,()=>Q(mn),e=>I(mn,e)),S(o,()=>Q(hn),e=>I(hn,e)),Z(`change`,o,kn),S(s,()=>Q(gn),e=>I(gn,e)),Z(`change`,s,kn),S(l,()=>Q(_n),e=>I(_n,e)),Z(`focus`,l,()=>I(wn,!0)),Z(`input`,l,()=>I(wn,!0)),Z(`keydown`,l,e=>{(e.key===`Escape`||e.key===`Enter`)&&I(wn,!1)}),Z(`blur`,l,()=>setTimeout(()=>I(wn,!1),150)),c(h,()=>Q(vn),e=>I(vn,e)),c(x,()=>Q(yn),e=>I(yn,e)),Z(`click`,w,()=>window.open(`https://docs.theprototype.app/ai/local-models/`,`_blank`)),S(T,()=>Q(bn),e=>I(bn,e)),Z(`click`,D,Pn),Z(`click`,k,Fn),Z(`click`,ee,()=>{I(dn,!1),I(fn,null)}),X(e,n)},$$slots:{default:!0}})}};G(o,e=>{Q(dn)&&e(s)});var l=g(o,2);_o(l,{name:`Mesh generation`,children:(e,t)=>{var n=RGe();W(3),X(e,n)},$$slots:{default:!0,control:(e,t)=>{ao(e,{onchange:()=>MS(St()),get checked(){return Se(),St()},set checked(e){ke(kS,e)},$$legacy:!0})}}});var u=g(l,2);_o(u,{name:`Mesh providers`,noControl:!0,children:(e,t)=>{var n=VGe(),r=N(n),i=e=>{var t=gZ();B(t,5,Ct,e=>e.id,(e,t)=>{var n=zGe(),r=j(n);v(r);var i=g(r,2),a=f(i,!0),o=g(i,2),s=f(o,!0),c=g(o,4),l=g(c,2);H(n),O(()=>{w(r,(wt(),Q(t),K(()=>wt()===Q(t).id))),Y(a,(Q(t),K(()=>Q(t).label))),Y(s,(Q(t),K(()=>Q(t).kind)))}),Z(`change`,r,()=>jS(Q(t).id)),Z(`click`,c,()=>Jn(Q(t))),Z(`click`,l,()=>LS(Q(t).id)),X(e,n)}),H(t),X(e,t)},a=e=>{var t=BGe();X(e,t)};G(r,e=>{Ct(),K(()=>Ct().length)?e(i):e(a,-1)});var o=g(r,2);Z(`click`,o,qn),X(e,n)},$$slots:{default:!0}});var d=g(u,2),p=e=>{{let t=ze(()=>Q(Ln)?`Edit mesh provider`:`New mesh provider`);_o(e,{get name(){return Q(t)},noControl:!0,children:(e,t)=>{var n=WGe(),r=j(n);B(r,5,()=>Sge,Be,(e,t)=>{var n=hZ(),r=f(n,!0),i={};O(()=>{Y(r,(Q(t),K(()=>Q(t).label))),i!==(i=(Q(t),K(()=>Q(t).kind)))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(r),_(r);var i=g(r,2);v(i);var a=g(i,2);v(a);var o=g(a,2);v(o);var s=g(o,2),c=e=>{var t=HGe(),n=N(t);ve(n),b(n,`placeholder`,`Workflow JSON (API format). Put {{PROMPT}} in the text node and {{SEED}} in the sampler seed.`);var r=g(n,2);v(r),S(n,()=>Q(Hn),e=>I(Hn,e)),S(r,()=>Q(Un),e=>I(Un,e)),X(e,t)},l=e=>{var t=UGe(),n=N(t),r=j(n);r.value=r.__value=`preview`;var i=g(r);i.value=i.__value=`refine`,H(n),_(n);var a=g(n,2);v(a),W(2),m(n,()=>Q(Wn),e=>I(Wn,e)),S(a,()=>Q(Gn),e=>I(Gn,e)),X(e,t)};G(s,e=>{Q(Rn)===`comfyui`?e(c):e(l,-1)});var u=g(s,2),d=j(u),p=g(d,2);H(u),H(n),O(()=>{b(a,`placeholder`,Q(Rn)===`comfyui`?`ComfyUI URL (http://host:8188)`:`API base (https://api.meshy.ai)`),b(o,`placeholder`,Q(Rn)===`comfyui`?`Bearer token (only if proxied; blank for LAN)`:`API key`)}),m(r,()=>Q(Rn),e=>I(Rn,e)),Z(`change`,r,Kn),S(i,()=>Q(zn),e=>I(zn,e)),S(a,()=>Q(Bn),e=>I(Bn,e)),S(o,()=>Q(Vn),e=>I(Vn,e)),Z(`click`,d,Yn),Z(`click`,p,()=>{I(In,!1),I(Ln,null)}),X(e,n)},$$slots:{default:!0}})}};G(d,e=>{Q(In)&&e(p)});var h=g(d,2);_o(h,{name:`Storage`,noControl:!0,children:(e,t)=>{W();var n=GGe();W(2),X(e,n)},$$slots:{default:!0}}),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0});var F=g(ne,2);Eo(F,{get open(){return Q(tn)},set open(e){I(tn,e)},header:e=>{W();var t=Te(`Export`);X(e,t)},children:(e,t)=>{So(e,{})},$$slots:{header:!0,default:!0},$$legacy:!0});var R=g(F,2);Eo(R,{get open(){return Q(an)},set open(e){I(an,e)},header:e=>{W();var t=Te(`Connection`);X(e,t)},children:(e,t)=>{var n=iKe(),r=N(n);_o(r,{name:`Session size`,children:(e,t)=>{W();
2438var n=KGe(),r=g(N(n)),i=f(r,!0);W(),O(()=>Y(i,16)),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=qGe();v(n),O(()=>{b(n,`max`,16),u(n,Tt())}),Z(`change`,n,e=>{let t=Number(e.target.value);Hd.set(Number.isFinite(t)?Math.min(16,Math.max(2,Math.round(t))):8)}),X(e,n)}}});var i=g(r,2);_o(i,{name:`Signaling server`,children:(e,t)=>{W();var n=YGe(),r=g(N(n)),i=e=>{var t=JGe(),n=g(N(t)),r=f(n,!0);W(),O(()=>Y(r,n_e)),X(e,t)},a=e=>{var t=Te(`Default is the public PeerJS cloud.`);X(e,t)};G(r,e=>{TC?e(i):e(a,-1)}),W(5),X(e,n)},$$slots:{default:!0,control:(e,t)=>{{let t=ze(()=>[{value:`default`,name:TC?`Default (self-hosted + fallback)`:`Default (public cloud)`},{value:`public`,name:`Public PeerJS cloud`},{value:`custom`,name:`Custom server`},{value:`local`,name:`Local dev (localhost:9001)`}]);fq(e,{id:`peer-server-mode`,get items(){return Q(t)},get value(){return Et(),K(()=>Et().mode)},onchange:e=>Xn(e)})}}}});var a=g(i,2),o=e=>{var t=tKe(),n=N(t);_o(n,{name:`Server host`,children:(e,t)=>{W();var n=Te(`Your PeerJS server host (no https://, no path)`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=XGe();v(n),O(()=>u(n,(Et(),K(()=>Et().custom.host)))),Z(`change`,n,e=>Zn(`host`,e.target.value)),X(e,n)}}});var r=g(n,2);_o(r,{name:`Port + path`,children:(e,t)=>{W();var n=Te(`Port + path (Caddy/TLS defaults: 443 and /peerjs) â each on its own line`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=ZGe(),r=j(n);v(r);var i=g(r,2);v(i),H(n),O(()=>{u(r,(Et(),K(()=>Et().custom.port))),u(i,(Et(),K(()=>Et().custom.path)))}),Z(`change`,r,e=>Zn(`port`,e.target.value)),Z(`change`,i,e=>Zn(`path`,e.target.value)),X(e,n)}}});var i=g(r,2);_o(i,{name:`Secure (wss)`,children:(e,t)=>{W();var n=Te(`Use TLS â leave on unless testing a plain-ws server`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{xo(e,{get checked(){return Et(),K(()=>Et().custom.secure)},onchange:e=>Zn(`secure`,e.target.checked)})}}});var a=g(i,2);_o(a,{name:`TURN URLs`,children:(e,t)=>{W();var n=Te(`TURN URLs (comma-separated) â the NAT relay; blank = STUN-only, direct connections only`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=QGe();v(n),O(()=>u(n,(Et(),K(()=>Et().custom.turnUrls)))),Z(`change`,n,e=>Zn(`turnUrls`,e.target.value)),X(e,n)}}});var o=g(a,2);_o(o,{name:`TURN credentials`,children:(e,t)=>{W();var n=Te(`TURN username + credential â each on its own line`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=$Ge(),r=j(n);v(r);var i=g(r,2);v(i),H(n),O(()=>{u(r,(Et(),K(()=>Et().custom.turnUsername))),u(i,(Et(),K(()=>Et().custom.turnCredential)))}),Z(`change`,r,e=>Zn(`turnUsername`,e.target.value)),Z(`change`,i,e=>Zn(`turnCredential`,e.target.value)),X(e,n)}}});var s=g(o,2);_o(s,{name:`STUN URLs`,children:(e,t)=>{W();var n=Te(`STUN URLs (comma-separated) â optional`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=eKe();v(n),O(()=>u(n,(Et(),K(()=>Et().custom.stunUrls)))),Z(`change`,n,e=>Zn(`stunUrls`,e.target.value)),X(e,n)}}}),X(e,t)};G(a,e=>{Et(),K(()=>Et().mode===`custom`)&&e(o)});var s=g(a,2);_o(s,{name:`Apply changes`,children:(e,t)=>{W();var n=nKe(),r=g(N(n));W(),Z(`click`,r,()=>location.reload()),X(e,n)},$$slots:{default:!0,control:(e,t)=>{var n=rKe(),r=f(n,!0);O(()=>{n.disabled=Q(Pt),Y(r,Q(Pt)?`Switchingâ¦`:`Apply`)}),Z(`click`,n,Ft),X(e,n)}}}),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0});var ue=g(R,2);Eo(ue,{get open(){return Q(Lt)},set open(e){I(Lt,e)},header:e=>{W();var t=Te(`Shortcuts`);X(e,t)},children:(e,t)=>{var n=mKe(),i=N(n),a=e=>{var t=aKe();X(e,t)};G(i,e=>{Dt()&&!Q(Vt)&&e(a)});var o=g(i,2),c=g(j(o),2);H(o);var l=g(o,2);Ie(l,()=>Q(Gt),e=>{var t=pKe();B(t,5,()=>Q(It),Be,(e,t)=>{var n=fKe(),i=N(n),a=f(i,!0),o=g(i,2);B(o,1,()=>(s(cg),Q(t),K(()=>cg.filter(e=>e.group===Q(t)))),Be,(e,t)=>{var n=dKe(),i=j(n),a=j(i),o=e=>{var n=oKe(),i=f(n,!0);O(()=>{r(n,1,`shortcut-keys min-w-16 rounded-lg border border-gray-200 bg-gray-100 px-2 py-1 text-center text-xs font-semibold text-gray-800 dark:border-gray-500 dark:bg-gray-600 dark:text-gray-100 ${Q(Kt),Q(t),K(()=>Q(Kt)===Q(t).id?`bg-amber-100 text-amber-900 dark:bg-amber-600 dark:text-white`:`hover:border-gray-400 dark:hover:border-gray-300`)??``}`),b(n,`aria-label`,(Q(t),K(()=>`Rebind `+Q(t).label))),Y(i,(Q(Kt),Q(t),K(()=>Q(Kt)===Q(t).id?`Press keys... Esc cancels`:Q(t).keys)))}),Z(`click`,n,()=>Xt(Q(t).id)),X(e,n)},c=q(()=>(s(ug),Q(t),K(()=>ug(Q(t))))),l=e=>{var n=sKe(),r=j(n),i=f(r,!0),a=g(r,2);Ux(a,{class:`h-3 w-3 text-gray-400`,"aria-hidden":`true`}),H(n),O(()=>{b(n,`title`,(Q(t),K(()=>Q(t).fixedReason||`listed for reference`))),Y(i,(Q(t),K(()=>Q(t).keys)))}),X(e,n)};G(a,e=>{Q(c)?e(o):e(l,-1)});var u=g(a,2),d=f(u,!0),p=g(u,2),m=e=>{var n=cKe(),r=f(n);O(e=>Y(r,`· ${e??``} on your layout`),[()=>(Q(t),Q(Vt),K(()=>Wt(Q(t).keys,Q(Vt))))]),X(e,n)},h=q(()=>(Q(t),Q(Vt),K(()=>Wt(Q(t).keys,Q(Vt)))));G(p,e=>{Q(h)&&e(m)});var _=g(p,2),v=e=>{var n=lKe(),r=j(n);OS(r,{class:`h-3 w-3`,"aria-hidden":`true`}),H(n),O(()=>{b(n,`title`,(Q(t),K(()=>`Reset to `+Q(t).defaultKeys))),b(n,`aria-label`,(Q(t),K(()=>`Reset `+Q(t).label+` to `+Q(t).defaultKeys)))}),Z(`click`,n,()=>Qt(Q(t).id)),X(e,n)},y=q(()=>(s(ug),Q(t),K(()=>ug(Q(t))&&Q(t).keys!==Q(t).defaultKeys)));G(_,e=>{Q(y)&&e(v)}
2438),H(i);var x=g(i,2),S=e=>{var t=uKe(),n=j(t),r=j(n),i=f(r,!0),a=g(r);H(n);var o=g(n,2),s=g(o,2);H(t),O(()=>{Y(i,(Q(qt),K(()=>Q(qt).keys))),Y(a,` is bound to ${Q(qt),K(()=>Q(qt).other.label)??``}`)}),Z(`click`,o,Zt),Z(`click`,s,()=>I(qt,null)),X(e,t)};G(x,e=>{Q(qt),Q(t),K(()=>Q(qt)&&Q(qt).id===Q(t).id)&&e(S)}),H(n),O(()=>{b(n,`data-shortcut`,(Q(t),K(()=>Q(t).id))),Y(d,(Q(t),K(()=>Q(t).label)))}),X(e,n)}),O(()=>Y(a,Q(t))),X(e,n)}),H(t),X(e,t)}),Z(`click`,c,$t),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0});var z=g(ue,2);Eo(z,{get open(){return Q(on)},set open(e){I(on,e)},header:e=>{W();var t=Te(`About`);X(e,t)},children:(e,t)=>{var n=yZ(),r=N(n);_o(r,{name:`Version`,noControl:!0,children:(e,t)=>{W();var n=Te();O(()=>Y(n,Nt)),X(e,n)},$$slots:{default:!0}});var i=g(r,2);_o(i,{name:`Diagnostics`,children:(e,t)=>{W();var n=Te(`What the app has been doing: version, this session's peer and scene counts, and the last 2439 300 log lines. It goes to your clipboard and nowhere else â paste it into a bug report.`);X(e,n)},$$slots:{default:!0,control:(e,t)=>{Do(e,{id:`about-copy-diagnostics`,size:`xs`,color:`alternative`,onclick:async()=>{let e=await Kc();es(e?`Diagnostics copied to the clipboard`:`Could not copy the diagnostics`)},children:(e,t)=>{W();var n=Te(`Copy diagnostics`);X(e,n)},$$slots:{default:!0}})}}});var a=g(i,2),o=e=>{_o(e,{name:`Cloud plugin`,noControl:!0,children:(e,t)=>{W();var n=Te();O(()=>Y(n,`${Ot(),K(()=>Ot().name)??``} ${Ot(),K(()=>Ot().version)??``}`)),X(e,n)},$$slots:{default:!0}})};G(a,e=>{Ot()&&e(o)});var s=g(a,2);_o(s,{name:`Dev Builds`,noControl:!0,children:(e,t)=>{var n=hKe();X(e,n)},$$slots:{default:!0}});var c=g(s,2);_o(c,{name:`Source Code`,noControl:!0,children:(e,t)=>{var n=gKe();X(e,n)},$$slots:{default:!0}});var l=g(c,2);_o(l,{name:`Modules`,noControl:!0,children:(e,t)=>{var n=_Ke();X(e,n)},$$slots:{default:!0}});var u=g(l,2);_o(u,{name:`Docs`,noControl:!0,children:(e,t)=>{var n=vKe();X(e,n)},$$slots:{default:!0}}),X(e,n)},$$slots:{header:!0,default:!0},$$legacy:!0}),X(e,n)},$$slots:{default:!0}}),H(d),ne(d,(e,t)=>ar?.(e,t),()=>Q(tr)),H(n),X(e,n)},$$slots:{footer:!0,default:!0},$$legacy:!0}),ue(),At()}function bZ(){let e=U(Bb);return e?.name&&typeof e?.signature==`string`?yC():(U(Ui)?.children?.length??0)>0}async function xZ(e){let t=U(Bb),n=!!t?.name&&typeof t?.signature==`string`;if(!bZ())return!0;let r=t?.name??`This scene`,i=await Rd({title:`Open "${e}"?`,message:n?`"${r}" has unsaved changes, and opening a scene replaces what is on screen.`:`The scene on screen has never been saved, and opening a scene replaces it.`,choices:[{value:`save`,label:`Save and open`},{value:`open`,label:`Open anyway`,color:`red`}]});return i?(i===`save`&&(await Fme({force:!0})?es(`Saved a version of "${r}" first`):await Lb(r,U(Ba)??null)),!0):!1}async function SZ(e,t){let n=U(Xb)[e],r=n?.scene??``;if(!r||!await xZ(r))return!1;try{t?.()}catch{}let i=n.hash?Hb(n.hash,r):Ub(r);return await Promise.race([i,new Promise(e=>setTimeout(()=>e(null),15e3))])===null&&es(`Could not fetch "`+r+`" from your peers yet â it will still open if the bytes arrive.`),!0}var CZ=`explorer:mounts`,wZ=Ue([]),TZ=!1,EZ=null;function SKe(e){return typeof indexedDB>`u`?Promise.resolve():Bne(CZ,e).catch(e=>console.log(`mounts persist failed`,e))}function DZ(e){let t=[];return wZ.update(n=>t=e(n)),SKe(t)}async function OZ(){if(typeof indexedDB<`u`)return TZ?EZ??void 0:(TZ=!0,EZ=(async()=>{try{let e=await md(CZ);Array.isArray(e)&&wZ.set(e.map(CKe))}catch(e){console.log(`mounts load failed`,e)}await zZ()})(),EZ)}function CKe(e){return{id:String(e?.id??crypto.randomUUID()),sessionId:String(e?.sessionId??``),name:String(e?.name??`Project`),folders:Array.isArray(e?.folders)?e.folders:[],items:Array.isArray(e?.items)?e.items:[],dirty:!!e?.dirty,rev:Number(e?.rev)||0,at:Number(e?.at)||Date.now(),...e?.missing?{missing:!0}:{}}}function kZ(e){if(typeof e!=`string`||!e.startsWith(`vol:`))return null;let t=e.slice(4);if(!t)return null;let n=t.indexOf(`:`);return n<0?{volumeId:t,folderId:null}:{volumeId:t.slice(0,n),folderId:t.slice(n+1)||null}}function AZ(e,t=null){return t?`vol:`+e+`:`+t:`vol:`+e}
2439function jZ(e){return e?U(wZ).find(t=>t.id===e)??null:null}function MZ(e){return jZ(e)?.folders??[]}function NZ(e){return jZ(e)?.items??[]}function PZ(e,t){let n=MZ(e),r=[t];for(let e=0;e<r.length;e++)for(let t of n)t.parentId===r[e]&&r.push(t.id);return r}async function wKe(e){let t=jZ(e);if(!t)return null;let n=[];for(let r of t.items){let t=await BZ(e,r.id);t&&n.push({name:r.name,kind:r.kind,folderId:r.folderId??null,hash:r.hash,blob:t,...r.thumbnail?{thumbnail:r.thumbnail}:{}})}return{folders:t.folders.map(e=>({id:e.id,name:e.name,parentId:e.parentId??null})),items:n}}function FZ(e){let t=e?.library??{};return{folders:(t.folders??[]).map(e=>({id:String(e?.id??crypto.randomUUID()),name:String(e?.name??`Folder`),parentId:e?.parentId??null})),items:(t.items??[]).map(e=>({id:`vitem:`+crypto.randomUUID(),name:String(e?.name??`file`),kind:String(e?.kind??`text`),folderId:e?.folderId??null,hash:String(e?.hash??``),size:Number(e?.blob?.size)||0,thumbnail:e?.thumbnail??null,createdAt:0}))}}async function IZ(e){let t=String(e??``).trim();if(!t)return null;await OZ();let n=U(wZ).find(e=>e.sessionId===t);if(n)return es(`"`+n.name+`" is already mounted`),n;let{getSession:r}=await $(async()=>{let{getSession:e}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{getSession:e}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url),i=await r(t);if(!i)return es(`That saved entry is no longer here`),null;if(!i.library)return es(`"`+(i.name??`That entry`)+`" is a scene, not a project â nothing to mount`),null;let{folders:a,items:o}=FZ(i),s={id:crypto.randomUUID(),sessionId:t,name:String(i.name??`Project`),folders:a,items:o,dirty:!1,rev:0,at:Date.now()};return await DZ(e=>[...e,s]),es(`Mounted "`+s.name+`" (`+o.length+` file`+(o.length===1?``:`s`)+`)`),s}async function LZ(e){return await DZ(t=>t.filter(t=>t.id!==e)),!0}async function RZ(e){let t=jZ(e);if(!t)return!1;let{getSession:n}=await $(async()=>{let{getSession:e}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{getSession:e}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url),r=await n(t.sessionId);if(!r?.library)return await DZ(t=>t.map(t=>t.id===e?{...t,missing:!0}:t)),es(`"`+t.name+`" is no longer saved â its files cannot be read`),!1;let{folders:i,items:a}=FZ(r);return await DZ(t=>t.map(t=>t.id===e?{...t,name:String(r.name??t.name),folders:i,items:a,dirty:!1,rev:(t.rev??0)+1,missing:!1}:t)),!0}async function zZ(){let e=U(wZ);if(!e.length)return;let{getSession:t}=await $(async()=>{let{getSession:e}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{getSession:e}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url),n={};for(let r of e){let e=await t(r.sessionId).catch(()=>null);n[r.id]=!e?.library}await DZ(e=>e.map(e=>{let t=!!n[e.id];if(!!e.missing===t)return e;let r={...e};return t?r.missing=!0:delete r.missing,r}))}async function BZ(e,t){let n=jZ(e),r=n?.items.find(e=>e.id===t);if(!n||!r)return null;if(r.blob)return r.blob;let{getSession:i}=await $(async()=>{let{getSession:e}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{getSession:e}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url);return((await i(n.sessionId))?.library?.items??[]).find(e=>e?.hash===r.hash)?.blob??null}function VZ(e,t){let n=!1;
2439return DZ(r=>r.map(r=>r.id===e?(n=!0,{...t(r),dirty:!0,rev:(r.rev??0)+1}):r)),n}function TKe(e){return VZ(e,e=>e)}function HZ(e){return!!e?.trim()&&!/[*\\/]/.test(e)}function UZ(e,t,n=null){if(!HZ(t))return null;let r={id:crypto.randomUUID(),name:t.trim(),parentId:n??null};return VZ(e,e=>({...e,folders:[...e.folders,r]}))?r:null}function WZ(e,t,n){return HZ(n)?VZ(e,e=>({...e,folders:e.folders.map(e=>e.id===t?{...e,name:n.trim()}:e)})):!1}function GZ(e,t,n){return String(n??``).trim()?VZ(e,e=>({...e,items:e.items.map(e=>e.id===t?{...e,name:String(n).trim()}:e)})):!1}function KZ(e,t,n){return VZ(e,e=>({...e,items:e.items.map(e=>e.id===t?{...e,folderId:n??null}:e)}))}function qZ(e,t,n){return t===n||n&&PZ(e,t).includes(n)?!1:VZ(e,e=>({...e,folders:e.folders.map(e=>e.id===t?{...e,parentId:n??null}:e)}))}function JZ(e,t){return VZ(e,e=>({...e,items:e.items.filter(e=>e.id!==t)}))}function YZ(e,t){let n=PZ(e,t);return VZ(e,e=>({...e,folders:e.folders.filter(e=>!n.includes(e.id)),items:e.items.filter(e=>!n.includes(e.folderId??``))}))}function XZ(e,t){let n=PZ(e,t),r=NZ(e).filter(e=>n.includes(e.folderId??``));return{folders:n.length,items:r.length}}function ZZ(e,t){let n=jZ(e);if(!n)return null;let r=n.items.find(e=>e.hash===t.hash);if(r)return r;let i={id:`vitem:`+crypto.randomUUID(),name:String(t.name??`file`),kind:String(t.kind??`text`),folderId:t.folderId??null,hash:String(t.hash??``),size:t.buffer?.byteLength??0,thumbnail:t.thumbnail??null,createdAt:Date.now(),blob:new Blob([t.buffer])};return VZ(e,e=>({...e,items:[...e.items,i]})),i}function QZ(e,t,n){return VZ(e,e=>({...e,items:e.items.map(e=>e.id===t?{...e,hash:String(n.hash??e.hash),size:n.buffer?.byteLength??e.size,blob:new Blob([n.buffer])}:e)}))}async function $Z(e){let t=jZ(e);if(!t)return!1;let n=t.rev??0,r=await wKe(e);if(!r)return!1;let{writeSessionLibrary:i}=await $(async()=>{let{writeSessionLibrary:e}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{writeSessionLibrary:e}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url);return await i(t.sessionId,r)?(await DZ(t=>t.map(t=>t.id===e?(t.rev??0)===n?{...t,items:t.items.map(e=>{if(!e.blob)return e;let{blob:t,...n}=e;return n}),dirty:!1,at:Date.now()}:{...t,at:Date.now()}:t)),es(`Saved "`+t.name+`" (`+r.items.length+` file`+(r.items.length===1?``:`s`)+`)`),!0):(DZ(t=>t.map(t=>t.id===e?{...t,missing:!0}:t)),es(`Could not save "`+t.name+`" â that saved entry is gone`),!1)}var EKe=V(`<!>Save`,1),DKe=V(`<input id="session-save-name" class="ui-input w-52 text-sm" type="text" aria-label="Session name" placeholder="Session name"/> <span id="session-save-kind" class="text-[10px] uppercase tracking-wide text-gray-400"> </span> <!> <!>`,1),OKe=V(`<!>Save current scene`,1),kKe=V(`<!>Save current project`,1),eQ=V(`<!> <!>`,1),AKe=V(`<!>Import session file`,1),jKe=V(`<button class="tp-seg-btn"> </button>`),MKe=V(`<span id="session-picked" class="text-gray-300"> </span> <button id="session-delete-picked" class="ui-button-quiet hover:bg-red-700" title="Delete every selected entry"> </button> <button class="ui-button-quiet" title="Clear the selection">Clear</button>`,1),NKe=V(`<div class="mb-2 flex flex-wrap items-center gap-2 text-xs text-gray-400"><div class="tp-seg" role="group" aria-label="Filter sessions"></div> <span id="session-total"> </span> <!> <span class="flex-1"></span> <div class="tp-seg" role="group" aria-label="View"><button id="session-view-grid" class="tp-seg-btn" title="Thumbnails"><!></button> <button id="session-view-list" class="tp-seg-btn" title="Details, with a button per row"><!></button></div></div>`),PKe=V(`<p class="rounded-lg border border-dashed border-gray-600 p-4 text-center text-sm italic text-gray-400">No saved sessions yet â Save current scene keeps a named snapshot you can reload, 2440 share as a file or pick objects from later.</p>`),FKe=V(`<img alt="" class="h-8 w-12 shrink-0 rounded-sm object-cover"/>
2440`),IKe=V(`<span class="flex h-8 w-12 shrink-0 items-center justify-center rounded-sm bg-gray-700 text-gray-400"><!></span>`),LKe=V(`<input class="ui-input min-w-0 flex-1 text-sm" type="text" aria-label="Session name"/>`),RKe=V(`<span class="min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold text-gray-100" title="Double-click to rename"> </span>`),tQ=V(`<span class="session-badge rounded-sm bg-teal-500/20 px-1 py-px font-semibold text-teal-300">Project</span> <span class="text-gray-500"> </span>`,1),zKe=V(`<span class="session-badge rounded-sm bg-gray-600/40 px-1 py-px font-semibold text-gray-300">Scene</span>`),nQ=V(`<button class="ui-button-quiet session-mount inline-flex items-center gap-1"><!> </button>`),BKe=V(`<button class="ui-button-quiet session-download-project" title="Download as .tp â the whole project: this scene plus its library files and folders, in the format this app opens as a project">.tp</button>`),VKe=V(`<button class="ui-button-quiet session-download-scene" title="Download as .tpscene â the scene bundle this app can open again, with the assets it uses">.tpscene</button>`),HKe=V(`<div><!> <!> <span class="session-meta flex shrink-0 items-center gap-1.5 text-[10px]"><!></span> <span class="shrink-0 text-[10px] text-gray-500"> </span> <span class="session-size shrink-0 text-[10px] text-gray-500"> </span> <span class="shrink-0 text-[10px] text-gray-500"> </span> <div class="flex shrink-0 gap-1"><button class="ui-button-quiet session-load inline-flex items-center gap-1"><!>Open</button> <!> <button class="ui-button-quiet session-import inline-flex items-center gap-1"><!> </button> <!> <button class="ui-button-quiet session-download-json" title="Download as JSON â readable, and what a bug report can carry">.json</button> <button class="ui-button-quiet inline-flex items-center hover:bg-red-700" title="Delete" aria-label="Delete"><!></button></div></div>`),UKe=V(`<div id="session-list" class="flex flex-col gap-0.5"></div>`),WKe=V(`<img class="h-24 w-full object-cover"/>`),GKe=V(`<div class="flex h-24 w-full items-center justify-center bg-gray-700 text-2xl text-gray-400"><!></div>`),KKe=V(`<input class="ui-input w-full text-sm" type="text" aria-label="Session name"/>`),qKe=V(`<p class="overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold text-gray-100" title="Double-click to rename"> </p>`),JKe=V(`<span class="session-badge rounded-sm bg-gray-600/40 px-1 py-px font-semibold text-gray-300" title="The scene only â the Explorer's files are not in this entry">Scene</span>`),YKe=V(`<button class="ui-button-quiet session-download-project inline-flex items-center gap-1" title="Download as .tp â the whole project: this scene plus its library files and folders, in the format this app opens as a project"><!>.tp</button>`),XKe=V(`<button class="ui-button-quiet session-download-scene inline-flex items-center gap-1" title="Download as .tpscene â the scene bundle this app can open again, with the assets it uses"><!>.tpscene</button>`),ZKe=V(`<div><!> <div class="flex flex-col gap-1 p-2"><!> <p class="text-[10px] text-gray-400"> </p> <p class="session-meta flex items-center gap-1.5 text-[10px]"><!> <span class="session-size text-gray-500" title="Approximate â idb's own overhead is not measurable from here"> </span></p> <div class="flex flex-wrap gap-1"><button class="ui-button-quiet session-load inline-flex items-center gap-1"><!>Open</button> <!> <button class="ui-button-quiet session-import inline-flex items-center gap-1"><!> </button> <!> <button class="ui-button-quiet session-download-json inline-flex items-center gap-1" title="Download as JSON â readable, and what a bug report can carry"><!>.json</button> <button class="ui-button-quiet inline-flex items-center hover:bg-red-700" title="Delete" aria-label="Delete"><!></button></div></div></div>`),QKe=V(`<div class="grid grid-cols-2 gap-3 md:grid-cols-3"></div>`),$Ke=V(`<div class="modal-content p-1"><div class="mb-3 flex flex-wrap items-center gap-2"><!> <!> <input type="file" id="session-import-file" style="display: none" accept=".json,.zip,.tpscene,.tp"/> <span class="text-xs text-gray-400">Loading with peers connected asks everyone first; a backup session is stashed before any replace.</span></div> <!> <!></div>`),eqe=V(`<button id="session-file-back" class="ui-button-quiet" title="Back to the files">â¹ Files</button> <span class="text-gray-200"> </span>`,1),tqe=V(`<span class="text-gray-200"> </span>`),nqe=V(`<button><span class="text-gray-400"><!></span> <span class="w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs text-gray-200"> </span> <span class="text-[10px] uppercase text-gray-500"> </span></button>`),rQ=V(`<div class="grid grid-cols-[repeat(auto-fill,120px)] justify-start gap-2"></div>`),rqe=V(`<label class="picker-row flex cursor-pointer items-center gap-2 rounded-sm px-1 py-0.5 text-sm text-gray-200 hover:bg-gray-700"><input class="tp-check" type="checkbox"/> <span class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap"> </span> <span class="text-[10px] uppercase text-gray-400"> </span></label>`),iQ=V(`<div class="flex flex-col gap-0.5"></div>`),iqe=V(`<p class="p-1 text-xs italic text-gray-400">This scene has no objects.</p>`),aqe=V(`<div id="session-object-list" class="min-h-0 flex-1 overflow-y-auto"><!> <!></div> <div class="flex shrink-0 gap-2"><!> <!></div>`,1),oqe=V(`<img alt="" class="h-12 w-full rounded-sm object-cover"/>
2440`),sqe=V(`<span class="flex h-12 items-center text-gray-400"><!></span>`),cqe=V(`<button><!> <span class="w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs text-gray-200"> </span></button>`),lqe=V(`<img alt="" class="h-6 w-8 shrink-0 rounded-sm object-cover"/>`),uqe=V(`<span class="shrink-0 text-gray-400"><!></span>`),dqe=V(`<button class="session-file-open ui-button-quiet" title="Open this scene and pick objects out of it">Openâ¦</button>`),fqe=V(`<label class="picker-row session-file flex cursor-pointer items-center gap-2 rounded-sm px-1 py-1 text-sm text-gray-200 hover:bg-gray-700"><input class="tp-check" type="checkbox"/> <!> <span class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap"> </span> <!> <span class="text-[10px] uppercase text-gray-400"> </span></label>`),pqe=V(`<p class="p-1 text-xs italic text-gray-400">This entry has no library files â it is a scene on its own.</p>`),mqe=V(`<div id="session-file-list" class="min-h-0 flex-1 overflow-y-auto"><!> <!></div> <div class="flex shrink-0 flex-wrap items-center gap-2"><!> <!> <span class="flex-1"></span> <!></div>`,1),hqe=V(`<div id="session-picker" class="flex h-full min-h-0 flex-col gap-2 p-1"><div class="flex flex-wrap items-center gap-2 text-xs text-gray-400"><!> <span class="flex-1"></span> <div class="tp-seg" role="group" aria-label="View"><button id="picker-view-list" class="tp-seg-btn" title="Details"><!></button> <button id="picker-view-grid" class="tp-seg-btn" title="Thumbnails"><!></button></div></div> <!></div>`);function gqe(e,t){Ce(t,!1);let n=()=>z(ac,`$sessionsOpen`,s),i=()=>z(kb,`$sessions`,s),a=()=>z(wZ,`$mountedVolumes`,s),o=()=>z(Es,`$peers`,s),[s,c]=Ve(),l=F(),u={scene:`map`,object:`box`,image:`image`,texture:`image`,audio:`music`,text:`file-text`},p=F(null),m=F(typeof localStorage<`u`&&nt.getItem(`sessions:view`)===`list`?`list`:`grid`),_=F(typeof localStorage<`u`&&nt.getItem(`sessions:pickerView`)===`grid`?`grid`:`list`),x=F(new Set);function C(e,t){if(t.target?.closest?.(`button, input, a, label`))return;let n=new Set(Q(x));t.ctrlKey||t.metaKey||t.shiftKey?n.has(e)?n.delete(e):n.add(e):n.has(e)&&n.size===1?n.clear():(n.clear(),n.add(e)),I(x,n)}let T=F(!1),E=F(``),D=F(`scene`),k=F(`all`),A=F([]),ee=F(0),M=F(new Set);function te(e){return!e||isNaN(e)?`â`:e<1024?e+` B`:e<1048576?(e/1024).toFixed(1)+` KB`:e<1073741824?(e/1024/1024).toFixed(1)+` MB`:(e/1024/1024/1024).toFixed(1)+` GB`}let P=F(null),re=F(``);function ie(e){e.focus(),e.select()}function ae(e=!1){I(D,e?`project`:`scene`),I(E,(e?`Project `:`Session `)+new Date().toLocaleDateString()),I(T,!0)}function oe(){let e=Q(E).trim();e&&(Q(D)===`project`?vme(e):kme(e),I(T,!1))}async function se(e){let t=e.filter(Boolean);if(!t.length)return;let n=t.length===1?`"`+t[0].name+`"`:t.length+` saved entries`,r=t.reduce((e,t)=>e+(Number(t.bytes)||0),0);if(await Bd({title:`Delete `+n+`?`,message:`This frees about `+te(r)+`. Saved entries live on this machine only, so nobody else is affected â and there is no bin for them.`,confirmLabel:t.length===1?`Delete`:`Delete `+t.length})){for(let e of t)await jb(e.id);I(x,new Set)}}function ce(e){I(P,e.id),I(re,e.name)}function le(){let e=Q(re).trim();Q(P)&&e&&Tb(Q(P),e),I(P,null)}async function de(e){if(e.hasLibrary)return fe(e);await xZ(e.name)&&(ac.set(!1),await wb(e.id)&&await pe(e))}async function fe(e){let t=o(),n=t?.openedPeers?.size??0,r=e.libraryCount??0;if(await Bd({title:`Open project "`+e.name+`"?`,message:`This replaces the scene on screen, and the Explorer becomes exactly this project - its `+r+` saved file`+(r===1?``:`s`)+`. What is in the Explorer now is removed first.`+(bZ()?` Unsaved changes to the scene on screen are lost too - Cancel and press Save project here first to keep them.`:``)+(n?` You will leave the session first â `+n+` connected peer`+(n===1?``:`s`)+` cannot follow a project swap, and a proposal they could only decline is not the question.`:``),confirmLabel:n?`Leave and open`:`Open project`})){if(ac.set(!1),n){try{t.leaveSession?.()}catch{}es(`Left the session â opening "`+e.name+`"`)}if(!await Ob(e.id))return es(`That saved entry is no longer here`);await Ma(),Sd(vd({name:String(e.name??``)}),!1),await wb(e.id)&&await pe(e)}}async function pe(e){let t=await Ob(e.id),n=String(e.name??``).trim()||`Opened sce
2440ne`;Bb.set({hash:``,name:n+` (from Sessions)`,unsaved:!0,...t?{signature:Lme(t)}:{}})}async function me(e){let t=await Ob(e.id);if(!t)return;let n=gme(t);I(p,{id:e.id,name:e.name,payload:t,files:n,tree:_me(t),file:null,entries:[],innerPayload:null,checked:new Set,pickedFiles:new Set,pickedFolders:new Set}),e.hasLibrary||await U(n[0])}function V(e){if(!Q(p))return;let t=new Set(Q(p).pickedFiles),n=new Set(Q(p).pickedFolders);e.kind===`folder`?n.has(e.id)?n.delete(e.id):n.add(e.id):t.has(e.index)?t.delete(e.index):t.add(e.index),I(p,{...Q(p),pickedFiles:t,pickedFolders:n})}function he(e){return Q(p)?e.kind===`folder`&&Q(p).pickedFolders.has(e.id)||e.kind===`file`&&Q(p).pickedFiles.has(e.index)?!0:Q(p).tree.some(t=>t.kind===`folder`&&t.id!==e.id&&Q(p).pickedFolders.has(t.id)&&e.path.startsWith(t.path+`/`)):!1}async function ge(){if(!Q(p))return;let e=await Sme(Q(p).payload,{items:[...Q(p).pickedFiles],folders:[...Q(p).pickedFolders]});es(e?`Imported `+e+` file`+(e===1?``:`s`)+` into your Library`:`Nothing was imported`),I(p,null)}async function U(e){if(!Q(p))return;if(e.kind!==`scene`)return es(`"`+e.name+`" is `+e.kind+` â objects come from scene files`);let t=await hme(Q(p).payload,e);if(!t)return es(`"`+e.name+`" could not be read`);I(p,{...Q(p),file:e,entries:t.entries,innerPayload:t.payload,checked:new Set})}function _e(){Q(p)&&I(p,{...Q(p),file:null,entries:[],checked:new Set})}function ve(e){Q(p).checked.has(e)?Q(p).checked.delete(e):Q(p).checked.add(e),I(p,Q(p))}function ye(){Q(p)&&Q(p).checked.size!==0&&(Eme(Q(p).innerPayload??Q(p).payload,[...Q(p).checked]),I(p,null),ac.set(!1))}function be(e,t){let n=document.createElement(`a`);n.href=URL.createObjectURL(e),n.download=t,n.click(),URL.revokeObjectURL(n.href)}async function xe(e,t=`scene`){let n=await Ob(e.id);if(!n)return;let r=String(e.name).replace(/[^\w-]+/g,`_`);if(t===`json`){be(new Blob([Cme(n)],{type:`application/json`}),r+`.session.json`);return}if(t===`project`){let{exportProjectFromSession:e}=await $(async()=>{let{exportProjectFromSession:e}=await import(`../chunks/D3XMbCQo.js`);return{exportProjectFromSession:e}},[],import.meta.url),t=await e(n);if(!t)return;be(new Blob([t.bytes],{type:`application/zip`}),r+`.tp`),t.skippedItems&&es(`Project downloaded â `+t.skippedItems+` library file`+(t.skippedItems===1?``:`s`)+` had no stored bytes and could not be carried.`);return}let i=await Mb(n);be(new Blob([i],{type:`application/zip`}),r+`.tpscene`)}async function we(e){let t=e.target.files?.[0];if(!t)return;let n=t.name.toLowerCase(),r=t.name.replace(/\.[^.]+$/,``);try{if(n.endsWith(`.tp`)){let{importProjectAsSession:e}=await $(async()=>{let{importProjectAsSession:e}=await import(`../chunks/D3XMbCQo.js`);return{importProjectAsSession:e}},[],import.meta.url);await e(await t.arrayBuffer(),{fileName:t.name})}else if(n.endsWith(`.zip`)||n.endsWith(`.tpscene`)){let e=await xme(await t.arrayBuffer());e&&!e.name&&await Tb(e.id,r)}else await wme(await t.text())}catch{es(`Not a valid session or project file`)}e.target.value=``}function q(e){return new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}d(()=>(n(),js),()=>{n()?(jo(),Eb(),I(p,null)):n()===!1&&js()}),d(()=>Q(m),()=>{typeof localStorage<`u`&&nt.setItem(`sessions:view`,Q(m))}),d(()=>Q(_),()=>{typeof localStorage<`u`&&nt.setItem(`sessions:pickerView`,Q(_))}),d(()=>n(),()=>{n()||I(x,new Set)}),d(()=>(i(),Q(k)),()=>{I(A,i().filter(e=>Q(k)===`all`?!0:Q(k)===`project`?e.hasLibrary:!e.hasLibrary))}),d(()=>a(),()=>{I(M,new Set(a().map(e=>e.sessionId)))}),d(()=>Q(A),()=>{I(ee,Q(A).reduce((e,t)=>e+(Number(t.bytes)||0),0))}),d(()=>Q(p),()=>{I(l,Q(p)?Q(p).tree.filter(e=>e.kind===`file`&&he(e)).length:0)}),h(),R();var Ee=eQ(),J=N(Ee);co(J,{title:`Sessions`,modal:!1,onkeydown:e=>{e.key===`Escape`&&ac.set(!1)},outsideclose:!0,size:`lg`,class:`tp-modal-frame`,classes:{header:`tp-modal-header`,body:`tp-modal-body flex-1`},get open(){return Se(),n()},set open(e){ke(ac,e)},children:(e,t)=>{var n=$Ke(),a=j(n),o=j(a),s=e=>{var t=DKe(),n=N(t);v(n),y(()=>S(n,()=>Q(E),e=>I(E,e))),ne(n,e=>ie?.(e));var r=g(n,2),i=f(r,!0),a=g(r,2);{let e=ze(()=>(Q(E),K(()=>!Q(E).trim())));Do(a,{id:`session-save-confirm`,size:`xs`,get disabled(){return Q(e)},onclick:oe,children:(e,t)=>{var n=EKe(),r=N(n);dS(r,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}})}var o=g(a,2);Do(o,{size:`xs`,color:`alternative`,onclick:()=>I(T,!1),children:(e,t)=>{W();var n=Te(`Cancel`);X(e,n)},$$slots:{default:!0}}),O(()=>Y(i,Q(D)===`project`?`project + library`:`scene only`)),L(`keydown`,n,e=>{e.key===`Enter`?oe():e.key===`Escape`&&I(T,!1)}),X(e,t)},c=e=>{var t=eQ(),n=N(t);Do(n,{id:`session-save`,size:`xs`,onclick:()=>ae(!1),children:(e,t)=>{var n=OKe(),r=N(n);dS(r,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}});var r=g(n,2);Do(r,{id:`session-save-project`,size:`xs`,color:`alternative`,title:`The scene AN
2440D every file in the Explorer â folders, records and their bytes`,onclick:()=>ae(!0),children:(e,t)=>{var n=kKe(),r=N(n);dS(r,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}}),X(e,t)};G(o,e=>{Q(T)?e(s):e(c,-1)});var l=g(o,2);Do(l,{size:`xs`,color:`alternative`,onclick:()=>document.getElementById(`session-import-file`)?.click(),children:(e,t)=>{var n=AKe(),r=N(n);pS(r,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}});var u=g(l,2);W(2),H(a);var d=g(a,2),p=e=>{var t=NKe(),n=j(t);B(n,4,()=>[{v:`all`,l:`All`},{v:`scene`,l:`Scenes`},{v:`project`,l:`Projects`}],e=>e.v,(e,t)=>{var n=jKe(),r=f(n,!0);O(()=>{b(n,`id`,K(()=>`session-filter-`+t.v)),b(n,`aria-pressed`,(Q(k),K(()=>Q(k)===t.v))),Y(r,K(()=>t.l))}),L(`click`,n,()=>I(k,t.v)),X(e,n)}),H(n);var r=g(n,2),a=f(r),o=g(r,2),s=e=>{var t=MKe(),n=N(t),r=f(n),i=g(n,2),a=f(i),o=g(i,2);O(()=>{Y(r,`${Q(x),K(()=>Q(x).size)??``} selected`),Y(a,`Delete ${Q(x),K(()=>Q(x).size)??``}`)}),L(`click`,i,()=>se(Q(A).filter(e=>Q(x).has(e.id)))),L(`click`,o,()=>I(x,new Set)),X(e,t)};G(o,e=>{Q(x),K(()=>Q(x).size)&&e(s)});var c=g(o,4),l=j(c);lz(j(l),{size:14,"aria-hidden":`true`}),H(l);var u=g(l,2);uz(j(u),{size:14,"aria-hidden":`true`}),H(u),H(c),H(t),O(e=>{Y(a,`${Q(A),K(()=>Q(A).length)??``} of ${i(),K(()=>i().length)??``} · about ${e??``}`),b(l,`aria-pressed`,Q(m)===`grid`),b(u,`aria-pressed`,Q(m)===`list`)},[()=>(Q(ee),K(()=>te(Q(ee))))]),L(`click`,l,()=>I(m,`grid`)),L(`click`,u,()=>I(m,`list`)),X(e,t)};G(d,e=>{i(),K(()=>i().length)&&e(p)});var h=g(d,2),_=e=>{var t=PKe();X(e,t)},w=e=>{var t=UKe();B(t,5,()=>Q(A),e=>e.id,(e,t)=>{var n=HKe(),i=j(n),a=e=>{var n=FKe();O(()=>b(n,`src`,(Q(t),K(()=>Q(t).thumbnail)))),X(e,n)},o=e=>{var t=IKe(),n=j(t);tS(n,{size:14,"aria-hidden":`true`}),H(t),X(e,t)};G(i,e=>{Q(t),K(()=>Q(t).thumbnail)?e(a):e(o,-1)});var s=g(i,2),c=e=>{var t=LKe();v(t),y(()=>S(t,()=>Q(re),e=>I(re,e))),ne(t,e=>ie?.(e)),L(`click`,t,e=>e.stopPropagation()),Z(`blur`,t,le),L(`keydown`,t,e=>{e.key===`Enter`?le():e.key===`Escape`&&I(P,null)}),X(e,t)},l=e=>{var n=RKe(),r=f(n,!0);O(()=>Y(r,(Q(t),K(()=>Q(t).name)))),L(`dblclick`,n,e=>{e.stopPropagation(),ce(Q(t))}),X(e,n)};G(s,e=>{Q(P),Q(t),K(()=>Q(P)===Q(t).id)?e(c):e(l,-1)});var u=g(s,2),d=j(u),p=e=>{var n=tQ(),r=g(N(n),2),i=f(r);O(()=>Y(i,`${Q(t),K(()=>Q(t).libraryCount)??``} file${Q(t),K(()=>Q(t).libraryCount===1?``:`s`)??``}`)),X(e,n)},m=e=>{var t=zKe();X(e,t)};G(d,e=>{Q(t),K(()=>Q(t).hasLibrary)?e(p):e(m,-1)}),H(u);var h=g(u,2),_=f(h),w=g(h,2),T=f(w,!0),E=g(w,2),D=f(E,!0),k=g(E,2),A=j(k);nz(j(A),{size:16,"aria-hidden":`true`}),W(),H(A);var ee=g(A,2),F=e=>{var n=nQ(),r=j(n);$x(r,{size:16,"aria-hidden":`true`});var i=g(r,1,!0);H(n),O((e,t,r)=>{n.disabled=e,b(n,`title`,t),Y(i,r)},[()=>(Q(M),Q(t),K(()=>Q(M).has(Q(t).id))),()=>(Q(M),Q(t),K(()=>Q(M).has(Q(t).id)?`Already mounted â it is above Library in the Explorer`:`Add this project's files to the Explorer as a root of its own, above Library. The scene on screen is not touched.`)),()=>(Q(M),Q(t),K(()=>Q(M).has(Q(t).id)?`Mounted`:`Mount`))]),L(`click`,n,()=>void IZ(Q(t).id)),X(e,n)};G(ee,e=>{Q(t),K(()=>Q(t).hasLibrary)&&e(F)});var ae=g(ee,2),oe=j(ae);az(oe,{size:16,"aria-hidden":`true`});var R=g(oe,1,!0);H(ae);var ue=g(ae,2),z=e=>{var n=BKe();L(`click`,n,()=>xe(Q(t),`project`)),X(e,n)},fe=e=>{var n=VKe();L(`click`,n,()=>xe(Q(t))),X(e,n)};G(ue,e=>{Q(t),K(()=>Q(t).hasLibrary)?e(z):e(fe,-1)});var pe=g(ue,2),B=g(pe,2),V=j(B);fS(V,{size:16,"aria-hidden":`true`}),H(B),H(k),H(n),O((e,i,a)=>{r(n,1,`session-card session-row flex items-center gap-2 rounded-sm border px-2 py-1 ${e??``}`),Y(_,`${Q(t),K(()=>Q(t).count)??``} obj`),Y(T,i),Y(D,a),b(A,`title`,(Q(t),K(()=>Q(t).hasLibrary?`Open this project: the scene comes back and so do its files, and you leave the session first`:`Open this scene â it replaces the scene on screen (peers must accept)`))),b(ae,`title`,(Q(t),K(()=>Q(t).hasLibrary?`Browse this entry's files, and pick objects out of any scene in it`:`Pick objects from this scene to add to the one on screen`))),Y(R,(Q(t),K(()=>Q(t).hasLibrary?`Import filesâ¦`:`Import objectsâ¦`)))},[()=>(Q(x),Q(t),K(()=>Q(x).has(Q(t).id)?`session-picked border-primary-500 bg-primary-600/20`:`border-gray-700/60 bg-gray-800/70`)),()=>(Q(t),K(()=>te(Q(t).bytes))),()=>(Q(t),K(()=>q(Q(t).createdAt)))]),L(`click`,n,e=>C(Q(t).id,e)),L(`click`,A,()=>void de(Q(t))),L(`click`,ae,()=>me(Q(t))),L(`click`,pe,()=>xe(Q(t),`json`)),L(`click`,B,()=>se([Q(t)])),X(e,n)}),H(t),X(e,t)},F=e=>{var t=QKe();B(t,5,()=>Q(A),e=>e.id,(e,t)=>{var n=ZKe(),i=j(n),a=e=>{var n=WKe();O(()=>{b(n,`src`,(Q(t),K(()=>Q(t).thumbnail))),b(n,`alt`,(Q(t),K(()=>Q(t).name)))}),X(e,n)},o=e=>{var t=GKe(),n=j(t);tS(n,{size:16,"aria-hidden":`true`}),H(t),X(e,t)};G(i,e=>{Q(t),K(()=>Q(t).thumbnail)?e(a):e(o,-1)});var s=g(i,2),c=j(s),l=e=>{var t=KKe();v(t),y(()=>S(t,()=>Q(re),e=>I(re,e))),ne(t,e=>ie?.(e)),Z(`blur`,t,le),L(`keydown`,t,e=>{e.key===`Enter`?le():e.key===`Escape`&&I(P,null)}),X(e,t)},u=e=>{var n=qKe(),r=f(n,!0);O(()=>Y(r,(Q(t),K(()=>Q(t).name)))),L(`dblclick`,n,()=>ce(Q(t))),X(e,n)};G(c,e=>{Q(P),Q(t),K(()=>Q(P)===Q(t).id)?e(l):e(u,-1)});var d=g(c,2),p=f(d),m=g(d,2),h=j(m),_=e=>{var n=tQ(),r=N(n),i=g(r,2),a=f(i);O(()=>{b(r,`title`,(Q(t),K(()=>
2440`The scene AND `+Q(t).libraryCount+` library file`+(Q(t).libraryCount===1?``:`s`)))),Y(a,`${Q(t),K(()=>Q(t).libraryCount)??``} file${Q(t),K(()=>Q(t).libraryCount===1?``:`s`)??``}`)}),X(e,n)},w=e=>{var t=JKe();X(e,t)};G(h,e=>{Q(t),K(()=>Q(t).hasLibrary)?e(_):e(w,-1)});var T=g(h,2),E=f(T,!0);H(m);var D=g(m,2),k=j(D);nz(j(k),{size:16,"aria-hidden":`true`}),W(),H(k);var A=g(k,2),ee=e=>{var n=nQ(),r=j(n);$x(r,{size:16,"aria-hidden":`true`});var i=g(r,1,!0);H(n),O((e,t,r)=>{n.disabled=e,b(n,`title`,t),Y(i,r)},[()=>(Q(M),Q(t),K(()=>Q(M).has(Q(t).id))),()=>(Q(M),Q(t),K(()=>Q(M).has(Q(t).id)?`Already mounted â it is above Library in the Explorer`:`Add this project's files to the Explorer as a root of its own, above Library. The scene on screen is not touched.`)),()=>(Q(M),Q(t),K(()=>Q(M).has(Q(t).id)?`Mounted`:`Mount`))]),L(`click`,n,()=>void IZ(Q(t).id)),X(e,n)};G(A,e=>{Q(t),K(()=>Q(t).hasLibrary)&&e(ee)});var F=g(A,2),ae=j(F);az(ae,{size:16,"aria-hidden":`true`});var oe=g(ae,1,!0);H(F);var R=g(F,2),ue=e=>{var n=YKe(),r=j(n);iS(r,{size:16,"aria-hidden":`true`}),W(),H(n),L(`click`,n,()=>xe(Q(t),`project`)),X(e,n)},z=e=>{var n=XKe(),r=j(n);iS(r,{size:16,"aria-hidden":`true`}),W(),H(n),L(`click`,n,()=>xe(Q(t))),X(e,n)};G(R,e=>{Q(t),K(()=>Q(t).hasLibrary)?e(ue):e(z,-1)});var fe=g(R,2),pe=j(fe);iS(pe,{size:16,"aria-hidden":`true`}),W(),H(fe);var B=g(fe,2),V=j(B);fS(V,{size:16,"aria-hidden":`true`}),H(B),H(D),H(s),H(n),O((e,i,a)=>{r(n,1,`session-card flex flex-col overflow-hidden rounded-lg border ${e??``}`),Y(p,`${Q(t),K(()=>Q(t).count)??``} object${Q(t),K(()=>Q(t).count===1?``:`s`)??``} · ${i??``}`),Y(E,a),b(k,`title`,(Q(t),K(()=>Q(t).hasLibrary?`Open this project: the scene comes back and so do its files, and you leave the session first`:`Open this scene â it replaces the scene on screen (peers must accept)`))),b(F,`title`,(Q(t),K(()=>Q(t).hasLibrary?`Browse this entry's files, and pick objects out of any scene in it`:`Pick objects from this scene to add to the one on screen`))),Y(oe,(Q(t),K(()=>Q(t).hasLibrary?`Import filesâ¦`:`Import objectsâ¦`)))},[()=>(Q(x),Q(t),K(()=>Q(x).has(Q(t).id)?`session-picked border-primary-500 bg-primary-600/20`:`border-gray-700/60 bg-gray-800/70`)),()=>(Q(t),K(()=>q(Q(t).createdAt))),()=>(Q(t),K(()=>te(Q(t).bytes)))]),L(`click`,n,e=>C(Q(t).id,e)),L(`click`,k,()=>void de(Q(t))),L(`click`,F,()=>me(Q(t))),L(`click`,fe,()=>xe(Q(t),`json`)),L(`click`,B,()=>se([Q(t)])),X(e,n)}),H(t),X(e,t)};G(h,e=>{i(),K(()=>!i().length)?e(_):Q(m)===`list`?e(w,1):e(F,-1)}),H(n),L(`change`,u,we),X(e,n)},$$slots:{default:!0},$$legacy:!0});var De=g(J,2),Oe=e=>{{let t=ze(()=>(Q(p),K(()=>Q(p).file?`Import objects`:`Import files`)));co(e,{get title(){return Q(t)},open:!0,modal:!1,onkeydown:e=>{e.key===`Escape`&&I(p,null)},outsideclose:!0,size:`lg`,class:`tp-modal-frame`,classes:{header:`tp-modal-header`,body:`tp-modal-body flex-1`},children:(e,t)=>{var n=hqe(),i=j(n),a=j(i),o=e=>{var t=eqe(),n=N(t),r=g(n,2),i=f(r,!0);O(()=>Y(i,(Q(p),K(()=>Q(p).file.name)))),L(`click`,n,_e),X(e,t)},s=e=>{var t=tqe(),n=f(t,!0);O(()=>Y(n,(Q(p),K(()=>Q(p).name)))),X(e,t)};G(a,e=>{Q(p),K(()=>Q(p).file)?e(o):e(s,-1)});var c=g(a,4),d=j(c);uz(j(d),{size:14,"aria-hidden":`true`}),H(d);var m=g(d,2);lz(j(m),{size:14,"aria-hidden":`true`}),H(m),H(c),H(i);var h=g(i,2),y=e=>{var t=aqe(),n=N(t),i=j(n),a=e=>{var t=rQ();B(t,5,()=>(Q(p),K(()=>
2440Q(p).entries)),e=>e.index,(e,t)=>{var n=nqe(),i=j(n),a=j(i);wS(a,{get name(){return K(()=>u.object)},size:22}),H(i);var o=g(i,2),s=f(o,!0),c=g(o,2),l=f(c,!0);H(n),O(e=>{r(n,1,`picker-card flex flex-col items-center gap-1 rounded border p-2 text-center ${e??``}`),Y(s,(Q(t),K(()=>Q(t).name))),Y(l,(Q(t),K(()=>Q(t).type)))},[()=>(Q(p),Q(t),K(()=>Q(p).checked.has(Q(t).index)?`border-primary-500 bg-primary-600/20`:`border-gray-700/60 hover:border-gray-500`))]),L(`click`,n,()=>ve(Q(t).index)),X(e,n)}),H(t),X(e,t)},o=e=>{var t=iQ();B(t,5,()=>(Q(p),K(()=>Q(p).entries)),e=>e.index,(e,t)=>{var n=rqe(),r=j(n);v(r);var i=g(r,2),a=f(i,!0),o=g(i,2),s=f(o,!0);H(n),O(e=>{w(r,e),Y(a,(Q(t),K(()=>Q(t).name))),Y(s,(Q(t),K(()=>Q(t).type)))},[()=>(Q(p),Q(t),K(()=>Q(p).checked.has(Q(t).index)))]),L(`change`,r,()=>ve(Q(t).index)),X(e,n)}),H(t),X(e,t)};G(i,e=>{Q(_)===`grid`?e(a):e(o,-1)});var s=g(i,2),c=e=>{var t=iqe();X(e,t)};G(s,e=>{Q(p),K(()=>!Q(p).entries.length)&&e(c)}),H(n);var l=g(n,2),d=j(l);{let e=ze(()=>(Q(p),K(()=>Q(p).checked.size===0)));Do(d,{id:`session-import-selected`,size:`xs`,get disabled(){return Q(e)},onclick:ye,children:(e,t)=>{W();var n=Te();O(()=>Y(n,`Import ${Q(p),K(()=>Q(p).checked.size)??``} into the scene`)),X(e,n)},$$slots:{default:!0}})}var m=g(d,2);Do(m,{size:`xs`,color:`alternative`,onclick:()=>I(p,null),children:(e,t)=>{W();var n=Te(`Cancel`);X(e,n)},$$slots:{default:!0}}),H(l),X(e,t)},x=e=>{var t=mqe(),n=N(t),i=j(n),a=e=>{var t=rQ();B(t,5,()=>(Q(p),K(()=>Q(p).tree)),e=>e.key,(e,t)=>{var n=cqe(),i=j(n),a=e=>{var n=oqe();O(()=>b(n,`src`,(Q(t),K(()=>Q(t).thumbnail)))),X(e,n)},o=e=>{var n=sqe(),r=j(n);{let e=ze(()=>(Q(t),K(()=>Q(t).kind===`folder`?`folder`:u[Q(t).kindOf]??`package`)));wS(r,{get name(){return Q(e)},size:22})}H(n),X(e,n)};G(i,e=>{Q(t),K(()=>Q(t).thumbnail)?e(a):e(o,-1)});var s=g(i,2),c=f(s,!0);H(n),O(e=>{r(n,1,`picker-card session-file flex flex-col items-center gap-1 rounded border p-2 text-center ${e??``}`),b(n,`data-kind`,(Q(t),K(()=>Q(t).kind===`folder`?`folder`:Q(t).kindOf))),b(n,`title`,(Q(t),K(()=>Q(t).path))),Y(c,(Q(t),K(()=>Q(t).name)))},[()=>(Q(t),K(()=>he(Q(t))?`border-primary-500 bg-primary-600/20`:`border-gray-700/60 hover:border-gray-500`))]),L(`click`,n,()=>V(Q(t))),X(e,n)}),H(t),X(e,t)},o=e=>{var t=iQ();B(t,5,()=>(Q(p),K(()=>Q(p).tree)),e=>e.key,(e,t)=>{var n=fqe(),r=j(n);v(r);var i=g(r,2),a=e=>{var n=lqe();O(()=>b(n,`src`,(Q(t),K(()=>Q(t).thumbnail)))),X(e,n)},o=e=>{var n=uqe(),r=j(n);{let e=ze(()=>(Q(t),K(()=>Q(t).kind===`folder`?`folder`:u[Q(t).kindOf]??`package`)));wS(r,{get name(){return Q(e)},size:14})}H(n),X(e,n)};G(i,e=>{Q(t),K(()=>Q(t).thumbnail)?e(a):e(o,-1)});var s=g(i,2),c=f(s,!0),l=g(s,2),d=e=>{var n=dqe();L(`click`,n,e=>{e.preventDefault(),e.stopPropagation(),U({index:Q(t).index,kind:`scene`,name:Q(t).name})}),X(e,n)};G(l,e=>{Q(t),K(()=>Q(t).kindOf===`scene`)&&e(d)});var p=g(l,2),m=f(p,!0);H(n),O(e=>{b(n,`data-kind`,(Q(t),K(()=>Q(t).kind===`folder`?`folder`:Q(t).kindOf))),b(n,`title`,(Q(t),K(()=>Q(t).path))),Ze(n,`padding-left: ${Q(t),K(()=>4+Q(t).depth*16)??``}px`),w(r,e),Y(c,(Q(t),K(()=>Q(t).name))),Y(m,(Q(t),K(()=>Q(t).kind===`folder`?`folder`:Q(t).kindOf)))},[()=>(Q(t),K(()=>he(Q(t))))]),L(`change`,r,()=>V(Q(t))),X(e,n)}),H(t),X(e,t)};G(i,e=>{Q(_)===`grid`?e(a):e(o,-1)});var s=g(i,2),c=e=>{var t=pqe();X(e,t)};G(s,e=>{Q(p),K(()=>!Q(p).tree.length)&&e(c)}),H(n);var d=g(n,2),m=j(d);{let e=ze(()=>Q(l)===0);Do(m,{id:`session-import-files`,size:`xs`,get disabled(){return Q(e)},onclick:ge,children:(e,t)=>{W();var n=Te();O(()=>Y(n,`Import ${Q(l)??``} file${Q(l)===1?``:`s`} into the Library`)),X(e,n)},$$slots:{default:!0}})}var h=g(m,2);Do(h,{id:`session-open-scene`,size:`xs`,color:`alternative`,title:`Open this entry's own scene and pick objects out of it`,onclick:()=>void U(Q(p).files[0]),children:(e,t)=>{W();var n=Te(`Objects from its sceneâ¦`);X(e,n)},$$slots:{default:!0}});var y=g(h,4);Do(y,{size:`xs`,color:`alternative`,onclick:()=>I(p,null),children:(e,t)=>{W();var n=Te(`Close`);X(e,n)},$$slots:{default:!0}}),H(d),X(e,t)};G(h,e=>{Q(p),K(()=>Q(p).file)?e(y):e(x,-1)}),H(n),O(()=>{b(d,`aria-pressed`,Q(_)===`list`),b(m,`aria-pressed`,Q(_)===`grid`)}),L(`click`,d,()=>I(_,`list`)),L(`click`,m,()=>I(_,`grid`)),X(e,n)},$$slots:{default:!0}})}};G(De,e=>{Q(p)&&e(Oe)}),X(e,Ee),ue(),c()}ge([`keydown`,`change`,`click`,`dblclick`]);var aQ=e=>{var t=Aqe();B(t,20,()=>[0,1,2],e=>e,(e,t)=>{var n=kqe();X(e,n)}),H(t),X(e,t)},_qe=V(`<img class="h-24 w-full object-cover" loading="lazy"/> <div class="tpl-thumb-ph hidden h-24 w-full items-center justify-center bg-gray-700 text-gray-400 svelte-xhq6jc"><!></div>`,1),vqe=V(`<div class="flex h-24 w-full items-center justify-center bg-gray-700 text-gray-400"><!></div>`),yqe=V(`<p class="tpl-desc text-xs text-gray-400 svelte-xhq6jc"> </p>`),bqe=V(`<span><!> </span>`),xqe=V(`<span> </span>`),Sqe=V(`<span class="pl-1"> </span>`),Cqe=V(`<span class="tpl-likes pl-1 svelte-xhq6jc" title="Likes"> </span>`),wqe=V(`<span class="tpl-remix pl-1 svelte-xhq6jc" title="A remix of another published sce
2440ne">remix<!></span>`),Tqe=V(`<div class="tpl-card-wrap relative svelte-xhq6jc"><button class="tpl-card flex h-full w-full flex-col overflow-hidden rounded-lg border border-gray-700/60 bg-gray-800/70 text-left svelte-xhq6jc"><!> <div class="flex flex-1 flex-col gap-1 p-2"><p class="overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold text-gray-100"> </p> <!> <!> <p class="mt-auto text-[10px] text-gray-500"><!> <!> <!> <!> <!> <!></p></div></button> <button class="tpl-save svelte-xhq6jc"><!></button></div>`),Eqe=V(`<a target="_blank" rel="noopener"> </a>`),Dqe=V(`<button type="button"> </button>`),Oqe=V(`<a target="_blank" rel="noopener">Submit yours on GitHub</a>`),kqe=V(`<div class="h-40 animate-pulse rounded-lg border border-gray-700/60 bg-gray-800/70"></div>`),Aqe=V(`<div class="grid grid-cols-2 gap-3 md:grid-cols-3"></div>`),jqe=V(`<button> </button>`),Mqe=V(`<button id="templates-chips-clear" class="tpl-chip tpl-chip-clear svelte-xhq6jc">Clear</button>`),Nqe=V(`<div id="templates-chips" class="tpl-chips svelte-xhq6jc"><!> <!></div>`),Pqe=V(`<p id="templates-fallback-note" class="mb-2 text-xs italic text-gray-500">Showing the bundled starters â the scene library couldn't be reached.</p>`),Fqe=V(`<div class="mt-3 flex items-center gap-2 rounded-lg border border-dashed border-gray-600 p-3 text-sm text-gray-400"><span class="flex-1">Couldn't load the template library and nothing is bundled.</span> <button id="templates-retry" class="ui-button-quiet"><!> Retry</button></div>`),Iqe=V(`<!> <div class="grid grid-cols-2 gap-3 md:grid-cols-3"><button id="template-blank" class="tpl-card tpl-blank flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-gray-600 p-4 text-gray-300 svelte-xhq6jc" title="Clear the scene and start fresh (peers see it too)"><!> <span class="text-sm font-semibold">Blank scene</span> <span class="text-[10px] text-gray-500">Start from nothing</span></button> <!></div> <!>`,1),Lqe=V(`<p class="mb-2 text-xs italic text-gray-500">Showing bundled examples â the scene library couldn't be reached.</p>`),Rqe=V(`<!> <div class="grid grid-cols-2 gap-3 md:grid-cols-3"></div>`,1),zqe=V(`<button id="examples-retry" class="ui-button-quiet"><!> Retry</button>`),Bqe=V(`<div id="examples-empty" class="flex flex-col items-center gap-2 rounded-lg border border-dashed border-gray-600 p-6 text-center"><p class="text-sm text-gray-400"> </p> <!></div>`),Vqe=V(`<p id="games-filtered-empty" class="mt-3 text-xs italic text-gray-500">No games match those tags.</p>`),Hqe=V(`<div class="grid grid-cols-2 gap-3 md:grid-cols-3"></div> <!> <p class="mt-3 text-xs text-gray-500">A game is a scene plus a module. Loading one offers to install what it needs â <span class="text-gray-400">every player needs their own copy</span>.</p>`,1),Uqe=V(`<button id="games-retry" class="ui-button-quiet"><!> Retry</button>`),Wqe=V(`<div id="games-empty" class="flex flex-col items-center gap-2 rounded-lg border border-dashed border-gray-600 p-6 text-center"><!> <p class="text-sm text-gray-400"> </p> <!></div>`),Gqe=V(`<a class="tpl-link svelte-xhq6jc" target="_blank" rel="noopener">More</a>`),Kqe=V(`<p id="community-notice" class="tpl-notice svelte-xhq6jc"> <!></p>`),qqe=V(`<div class="grid grid-cols-2 gap-3 md:grid-cols-3"></div> <p class="mt-3 text-xs text-gray-500"><!> <!></p>`,1),Jqe=V(`<p class="text-xs text-gray-500">Scenes are shared as pull requests and reviewed before they appear here.</p>`),Yqe=V(`<button id="community-retry" class="ui-button-quiet"><!> Retry</button>`),Xqe=V(`<div id="community-empty" class="flex flex-col items-center gap-2 rounded-lg border border-dashed border-gray-600 p-6 text-center"><p class="text-sm text-gray-400"> </p> <!> <div class="flex items-center gap-2"><!> <!></div></div>`),Zqe=V(`<!> <!>`,1),Qqe=V(`<div id="templates-modal" class="p-1"><div class="tpl-tabs svelte-xhq6jc" role="tablist"><button id="templates-tab-general" role="tab">General</button> <button id="templates-tab-examples" role="tab">Examples</button> <button id="templates-tab-games" role="tab"><!> Games</button> <button id="templates-tab-community" role="tab">Community</button></div> <!> <!> <p class="mt-4 border-t border-gray-700/60 pt-2 text-xs text-gray-500">Loading a scene replaces the current one for everyone â a backup session is stashed first, 2441 and connected peers are asked before anything changes.</p></div>`);function $qe(e,n){Ce(n,!0);let i=()=>z(Q_e,`$templates`,_),a=()=>z(ive,`$examples`,_),o=()=>z(ove,`$games`,_),s=()=>z(rve,`$communityEntries`,_),c=()=>z(pre,`$communityProvider`,_),l=()=>
2441z(Ls,`$templatesModalOpen`,_),u=()=>z(Xo,`$templatesModalTab`,_),d=()=>z(tve,`$communityState`,_),p=()=>z(eve,`$loadingSlug`,_),m=()=>z(lve,`$templatesState`,_),h=()=>z(ave,`$communityNotice`,_),[_,v]=Ve(),y=(e,t=qe)=>{var n=Tqe(),i=j(n),a=j(i),o=e=>{var n=_qe(),r=N(n),i=g(r,2),a=j(i);Qx(a,{size:20,"aria-hidden":`true`}),H(i),O(()=>{b(r,`src`,t().thumbUrl),b(r,`alt`,t().title)}),Z(`error`,r,ae),ce(r),X(e,n)},s=e=>{var t=vqe(),n=j(t);Qx(n,{size:20,"aria-hidden":`true`}),H(t),X(e,t)};G(a,e=>{t().thumbUrl?e(o):e(s,-1)});var c=g(a,2),l=j(c),u=f(l,!0),d=g(l,2),m=e=>{var n=yqe(),r=f(n,!0);O(()=>Y(r,t().description)),X(e,n)};G(d,e=>{t().description&&e(m)});var h=g(d,2),_=e=>{let n=q(()=>te(t()));var i=bqe();let a;var o=j(i);_z(o,{size:11,"aria-hidden":`true`});var s=g(o,1,!0);H(i),O(()=>{a=r(i,1,`tpl-needs svelte-xhq6jc`,null,a,{"tpl-needs-ok":Q(n)?.ok}),b(i,`data-needs`,t().slug),b(i,`title`,Q(n)?.ok?`Installed â every player needs their own copy`:Q(n)?.skew?`You have a different version than this scene was built against â every player must run the same one, or the game will drift`:`Each player needs this module; loading will offer to install it`),Y(s,Q(n)?.text)}),X(e,i)},v=q(()=>te(t()));G(h,e=>{Q(v)&&e(_)});var y=g(h,2),x=j(y),S=e=>{var n=Te();O(()=>Y(n,t().author)),X(e,n)};G(x,e=>{t().author&&e(S)});var C=g(x,2),w=e=>{var t=Te(`·`);X(e,t)};G(C,e=>{t().author&&t().license&&e(w)});var T=g(C,2),E=e=>{var n=xqe(),r=f(n,!0);O(e=>{b(n,`title`,e),Y(r,t().license)},[()=>Pm(t().license)]),X(e,n)};G(T,e=>{t().license&&e(E)});var D=g(T,2),k=e=>{var n=Sqe(),r=f(n,!0);O(e=>Y(r,e),[()=>F(t().bytes)]),X(e,n)};G(D,e=>{t().bytes&&e(k)});var A=g(D,2),ee=e=>{var n=Cqe(),r=f(n);O(()=>Y(r,`⥠${t().likeCount??``}`)),X(e,n)};G(A,e=>{t().likeCount!=null&&e(ee)});var M=g(A,2),ne=e=>{var n=wqe(),r=g(j(n)),i=e=>{var n=Te();O(()=>Y(n,` of ${t().remixOf.title??``}`)),X(e,n)};G(r,e=>{t().remixOf.title&&e(i)}),H(n),X(e,n)};G(M,e=>{t().remixOf&&e(ne)}),H(y),H(c),H(i);var re=g(i,2);MOe(j(re),{size:14,"aria-hidden":`true`}),H(re),H(n),O(()=>{b(i,`data-scene-slug`,t().slug),i.disabled=p()===t().slug,b(i,`title`,`Load "`+t().title+`" â replaces the current scene (a backup is stashed first)`),Y(u,t().title),b(re,`data-scene-save`,t().slug),re.disabled=p()===t().slug,b(re,`title`,`Save "`+t().title+`" to your Library as a new scene â the current scene stays as it is`),b(re,`aria-label`,`Save `+t().title+` to your Library`)}),L(`click`,i,()=>P(t())),L(`click`,re,()=>ie(t())),X(e,n)},x=(e,t=qe,n=qe)=>{var i=fe(),a=N(i),o=e=>{var i=fe(),a=N(i),o=e=>{var i=Eqe(),a=f(i,!0);O(()=>
2441{b(i,`id`,t()),r(i,1,M(n()),`svelte-xhq6jc`),b(i,`href`,Q(k).href),Y(a,Q(k).label)}),X(e,i)},s=e=>{var i=Dqe(),a=f(i,!0);O(()=>{b(i,`id`,t()),r(i,1,M(n()),`svelte-xhq6jc`),Y(a,Q(k).label)}),L(`click`,i,re),X(e,i)};G(a,e=>{Q(k).href?e(o):e(s,-1)}),X(e,i)},s=e=>{var i=Oqe();O(()=>{b(i,`id`,t()),r(i,1,M(n()),`svelte-xhq6jc`),b(i,`href`,sve)}),X(e,i)};G(a,e=>{Q(k)?e(o):e(s,-1)}),X(e,i)},S=t(`general`),C=t(Ne([])),w=q(()=>Q(S)===`general`?i():Q(S)===`examples`?a():Q(S)===`games`?o():s()),T=q(()=>cw(Q(w))),E=q(()=>Q(w).filter(e=>uw(e,Q(C)))),D=q(()=>!!c()),k=q(()=>c()?.submit&&typeof c().submit==`object`&&c().submit.label?c().submit:null);function A(e){I(C,Q(C).includes(e)?Q(C).filter(t=>t!==e):[...Q(C),e],!0)}function ee(e){I(S,e,!0),I(C,[],!0)}function te(e){if(!e.modules?.length)return null;let{missing:t,disabled:n,mismatched:r}=ame(e.modules),i=e.modules.map(e=>e.id).join(`, `);if(t.length)return{text:`Needs `+i,ok:!1};if(n.length)return{text:`Enable `+i,ok:!1};if(r.length){let e=r[0];return{text:e.id+` v`+e.want+` (you have `+e.have+`)`,ok:!1,skew:!0}}return{text:i,ok:!0}}Qe(()=>{let e=l();K(()=>{if(e){jo(),sw();let e=u();e&&(ee(e),Xo.set(null))}else e===!1&&js()})}),Qe(()=>{let e=l()&&Q(S)===`community`;K(()=>{e&&lw()})}),Qe(()=>{let e=d()===`idle`,t=l()&&Q(S)===`community`;K(()=>{e&&t&&lw()})});function ne(){Ls.set(!1),ow({blank:!0})}function P(e){Ls.set(!1),Q(S)===`community`?$_e(e):cve(e)}function re(){try{typeof Q(k)?.action==`function`&&Q(k).action()}catch(e){console.error(`community submit action failed:`,e)}}function ie(e){nve(e)}function F(e){return e?e>=1048576?(e/1024/1024).toFixed(1)+` MB`:Math.max(1,Math.round(e/1024))+` KB`:``}function ae(e){e.target.style.display=`none`;let t=e.target.nextElementSibling;t&&(t.style.display=`flex`)}co(e,{title:`Templates`,modal:!1,onkeydown:e=>{e.key===`Escape`&&Ls.set(!1)},outsideclose:!0,size:`lg`,class:`tp-modal-frame`,classes:{header:`tp-modal-header`,body:`tp-modal-body flex-1`},get open(){return Se(),l()},set open(e){ke(Ls,e)},children:(e,t)=>{var n=Qqe(),i=j(n),s=j(i);let c;var l=g(s,2);let u;var p=g(l,2);let _;var v=j(p);Zx(v,{size:14,"aria-hidden":`true`}),W(),H(p);var w=g(p,2);let k;H(i);var M=g(i,2),te=e=>{var t=Nqe(),n=j(t);B(n,16,()=>Q(T),e=>e,(e,t)=>{var n=jqe();let i;var a=f(n,!0);O((e,o)=>{i=r(n,1,`tpl-chip svelte-xhq6jc`,null,i,{active:e}),b(n,`data-chip`,t),b(n,`aria-pressed`,o),Y(a,t)},[()=>Q(C).includes(t),()=>Q(C).includes(t)]),L(`click`,n,()=>A(t)),X(e,n)});var i=g(n,2),a=e=>{var t=Mqe();L(`click`,t,()=>I(C,[],!0)),X(e,t)};G(i,e=>{Q(C).length&&e(a)}),H(t),X(e,t)};G(M,e=>{Q(T).length&&e(te)});var P=g(M,2),re=e=>{var t=fe(),n=N(t),r=e=>{aQ(e)},i=e=>{var t=Iqe(),n=N(t),r=e=>{var t=Pqe();X(e,t)};G(n,e=>{m()===`fallback`&&e(r)});var i=g(n,2),a=j(i),o=j(a);yge(o,{size:24,"aria-hidden":`true`}),W(4),H(a);var s=g(a,2);B(s,17,()=>Q(E),e=>e.slug,(e,t)=>{y(e,()=>Q(t))}),H(i);var c=g(i,2),l=e=>{var t=Fqe(),n=g(j(t),2),r=j(n);Gx(r,{size:14,"aria-hidden":`true`}),W(),H(n),H(t),L(`click`,n,()=>sw(!0)),X(e,t)};G(c,e=>{m()===`error`&&e(l)}),L(`click`,a,ne),X(e,t)};G(n,e=>{m()===`loading`||m()===`idle`?e(r):e(i,-1)}),X(e,t)},ie=e=>{var t=fe(),n=N(t),r=e=>{aQ(e)},i=e=>{var t=Rqe(),n=N(t),r=e=>{var t=Lqe();X(e,t)};G(n,e=>{m()===`fallback`&&e(r)});var i=g(n,2);B(i,21,()=>Q(E),e=>e.slug,(e,t)=>{y(e,()=>Q(t))}),H(i),X(e,t)},o=e=>{var t=Bqe(),n=j(t),r=f(n,!0),i=g(n,2),a=e=>{var t=zqe(),n=j(t);Gx(n,{size:14,"aria-hidden":`true`}),W(),H(t),L(`click`,t,()=>sw(!0)),X(e,t)};G(i,e=>{m()!==`ready`&&e(a)}),H(t),O(()=>Y(r,m()===`ready`?`No examples published yet â check back after the next content release.`:`Examples are curated online content â reconnect to browse them.`)),X(e,t)};G(n,e=>{m()===`loading`||m()===`idle`?e(r):a().length?e(i,1):e(o,-1)}),X(e,t)},F=e=>{var t=fe(),n=N(t),r=e=>{aQ(e)},i=e=>{var t=Hqe(),n=N(t);B(n,21,()=>Q(E),e=>e.slug,(e,t)=>{y(e,()=>Q(t))}),H(n);var r=g(n,2),i=e=>{var t=Vqe();X(e,t)};G(r,e=>{Q(E).length||e(i)}),W(2),X(e,t)},a=e=>{var t=Wqe(),n=j(t);Zx(n,{size:22,"aria-hidden":`true`});var r=g(n,2),i=f(r,!0),a=g(r,2),o=e=>{var t=Uqe(),n=j(t);Gx(n,{size:14,"aria-hidden":`true`}),W(),H(t),L(`click`,t,()=>sw(!0)),X(e,t)};G(a,e=>{m()!==`ready`&&e(o)}),H(t),O(()=>Y(i,m()===`ready`?`No games published yet â check back after the next content release.`:`Games are curated online content â reconnect to browse them.`)),X(e,t)};G(n,e=>{m()===`loading`||m()===`idle`?e(r):o().length?e(i,1):e(a,-1)}),X(e,t)},ae=e=>{var t=Zqe(),n=N(t),r=e=>{var t=Kqe(),n=j(t),r=g(n),i=e=>{var t=Gqe();O(()=>b(t,`href`,h().href)),X(e,t)};G(r,e=>{h().href&&e(i)}),H(t),O(()=>Y(n,`${h().text??``} `)),X(e,t)};G(n,e=>{h()&&e(r)});var i=g(n,2),a=e=>{aQ(e)},o=e=>{var t=qqe(),n=N(t);B(n,21,()=>Q(E),e=>e.slug,(e,t)=>{y(e,()=>Q(t))}),H(n);var r=g(n,2),i=j(r),a=e=>{var t=Te(`Community scenes are contributed via pull request and reviewed before they appear.`);X(e,t)};G(i,e=>{Q(D)||e(a)});var o=g(i,2);x(o,()=>`community-submit`,()=>`tpl-link`),H(r),X(e,t)},s=e=>{var t=Xqe(),n=j(t),r=f(n,!0),i=g(n,2),a=e=>{var t=Jqe();X(e,t)};G(i,e=>{Q(D)||e(a)});var o=g(i,2),s=j(o);x(s,()=>`community-submit-link`,()=>`tpl-link text-sm`);var c=g(s,2),l=e=>{var t=Yqe(),n=j(t);Gx(n,{size:14,"aria-hidden":`true`}),W(),H(t),L(`click`,t,()=>lw(!0)),X(e,t)};G(c,e=>{d()===`error`&&e(l)}),H(o),H(t),O(()=>Y(r,d()===`error`?`Couldn't reach the community gallery â check your connection.`:`No community scenes yet â be the first!`)),X(e,t)};G(i,e=>{d()===`loading`||d()===`idle`?e(a):d()===`ready`?e(o,1):e(s,-1)}),X(e,t)};G(P,e=>{Q(S)===`general`?e(re):Q(S)===`examples`?e(ie,1):Q(S)===`games`?e(F,2):e(ae,-1)}),W(2),H(n),O(()=>{c=r(s,1,`tpl-tab svelte-xhq6jc`,null,c,{active:Q(S)===`general`}),b(s,`aria-selected`,Q(S)===`general`),u=r(l,1,`tpl-tab svelte-xhq6jc`,null,u,{active:Q(S)===`examples`}),b(l,`aria-selected`,Q(S)===`examples`),_=r(p,1,`tpl-tab svelte-xhq6jc`,null,_,{active:Q(S)===`games`}),b(p,`aria-selected`,Q(S)===`games`),k=r(w,1,`tpl-tab svelte-xhq6jc`,null,k,{active:Q(S)===`community`}),b(w,`aria-selected`,Q(S)===`community`)}),L(`click`,s,()=>ee(`general`)),L(`click`,l,()=>ee(`examples`)),L(`click`,p,()=>ee(`games`)),L(`click`,w,()=>ee(`community`)),X(e,n)},$$slots:{default:!0}}),ue(),v()}ge([`click`]);var eJe=V(`<center><b>Customize Character</b></center> <div class="modal-content p-4"><div class="flex px-6 pb-3"><p>Body color</p> <input type="color" class="h-11 min-w-0 flex-1 cursor-pointer rounded-e-lg border border-gray-300 bg-white p-1 dark:border-gray-600 dark:bg-gray-700"/></div> <div class="flex px-6 pb-3"><p>Hat</p> <!></div> <div class="flex px-6 pb-3"><p>Head shape</p> <!></div> <div class="flex px-6 pb-1"><p>Face</p> <!></div> <div class="flex items-center gap-2 px-6 pt-3"><!></div> <p class="px-6 pt-2 text-xs text-gray-400">The face photo uses your profile avatar image (Profile Settings). Changes apply for all
2442 connected peers immediately.</p></div>`,1);function tJe(e,t){Ce(t,!1);let n=()=>z(Os,`$avatarConfig`,s),i=()=>z(as,`$userdata`,s),a=()=>z(Es,`$peers`,s),o=()=>z(Js,`$characterModalOpen`,s),[s,c]=Ve(),l=F(),f=[{value:`none`,name:`None`},{value:`cap`,name:`Cap`},{value:`tophat`,name:`Top hat`},{value:`crown`,name:`Crown`}],p=[{value:`label`,name:`Name label only`},{value:`image`,name:`My avatar photo`}];function m(e){let t={...n(),...e};ke(Os,t),nt.setItem(`avatarConfig`,JSON.stringify(t)),i().forEach(e=>{e[0]===a().peer.id&&(e[5]=t)}),ke(as,i()),a().send({type:`userdata`,userdata:i()})}d(()=>n(),()=>{I(l,FR(n()))}),h(),R(),co(e,{title:``,outsideclose:!0,modal:!1,onkeydown:e=>{e.key===`Escape`&&Js.set(!1)},class:`tp-modal-frame`,size:`sm`,get open(){return Se(),o()},set open(e){ke(Js,e)},children:(e,t)=>{var i=eJe(),a=g(N(i),2),o=j(a),s=j(o);r(s,1,`z-10 inline-flex w-32 sm:w-40 shrink-0 items-center border border-gray-300 bg-gray-100 px-4 py-2.5 text-sm font-medium text-gray-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white rounded-s-lg`);var c=g(s,2);v(c),H(o);var d=g(o,2),h=j(d);r(h,1,`z-10 inline-flex w-32 sm:w-40 shrink-0 items-center border border-gray-300 bg-gray-100 px-4 py-2.5 text-sm font-medium text-gray-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white rounded-s-lg`),fq(g(h,2),{class:`char-select min-w-0 flex-1`,get items(){return f},get value(){return n(),K(()=>n().hat)},onchange:e=>m({hat:e})}),H(d);var _=g(d,2),y=j(_);r(y,1,`z-10 inline-flex w-32 sm:w-40 shrink-0 items-center border border-gray-300 bg-gray-100 px-4 py-2.5 text-sm font-medium text-gray-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white rounded-s-lg`),fq(g(y,2),{class:`char-select min-w-0 flex-1`,get items(){return PR},get value(){return Q(l),K(()=>Q(l).shape)},onchange:e=>m({shape:e})}),H(_);var b=g(_,2),x=j(b);r(x,1,`z-10 inline-flex w-32 sm:w-40 shrink-0 items-center border border-gray-300 bg-gray-100 px-4 py-2.5 text-sm font-medium text-gray-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white rounded-s-lg`),fq(g(x,2),{class:`char-select min-w-0 flex-1`,get items(){return p},get value(){return Q(l),K(()=>Q(l).face)},onchange:e=>m({face:e})}),H(b);var S=g(b,2),C=j(S);xo(C,{get checked(){return Q(l),K(()=>Q(l).showLabel)},onchange:e=>m({showLabel:e.target.checked}),children:(e,t)=>{W();var n=Te(`Show name label`);X(e,n)},$$slots:{default:!0}}),H(S),W(2),H(a),O(()=>u(c,(n(),K(()=>n().body)))),Z(`input`,c,e=>m({body:e.currentTarget.value})),X(e,i)},$$slots:{default:!0},$$legacy:!0}),ue(),c()}var oQ=[{group:`Mesh`,items:[{label:`Cube`,command:`/create Box 2 2 2`},{label:`Sphere`,command:`/create Sphere 1`},{label:`Cylinder`,command:`/create Cylinder 1 1 2`},{label:`Cone`,command:`/create Cone 1 2`},{label:`Capsule`,command:`/create Capsule 0.5 1`},{label:`Torus`,command:`/create Torus 1 0.4`},{label:`Torus Knot`,command:`/create TorusKnot 1 0.3`},{label:`Ring`,command:`/create Ring 0.5 1`},{label:`Circle`,command:`/create Circle 1`},{label:`Plane`,command:`/create Plane 4 4`},{label:`Dodecahedron`,command:`/create Dodecahedron 1`},{label:`Icosahedron`,command:`/create Icosahedron 1`},{label:`Octahedron`,command:`/create Octahedron 1`},{label:`Tetrahedron`,command:`/create Tetrahedron 1`},{label:`Lathe`,command:`/create Lathe`},{label:`Tube`,command:`/create Tube`}]},{group:`Building blocks`,items:[{label:`Wedge`,command:`/create Wedge 2 1 2`},{label:`Stairs`,command:`/create Stairs 2 1.5 2 6`},{label:`Arch`,command:`/create Arch 2 2 0.5`},{label:`Corner`,command:`/create Corner 2 2 0.25`}]},{group:`Ground`,items:[{label:`Terrain`,command:`/create Terrain 24 48`}]},{group:`Simulation`,items:[{label:`Fluid tank`,command:`/create FluidTank 1.2 0.8 0.8`}]},{group:`Camera`,items:[{label:`Perspective`,command:`/create Camera`},{label:`Orthographic`,command:`/create CameraOrtho`}]},{group:`Light`,items:[{label:`Ambient`,command:`/light ambient`},{label:`Directional`,command:`/light directional`},{label:`Hemisphere`,command:`/light hemisphere`},{label:`Point`,command:`/light point`},{label:`Spot`,command:`/light spot`},{label:`Rect Area`,command:`/light rectarea`}]}],sQ=null;$(()=>import(`../chunks/DBHVHnyQ.js`).then(e=>e.f).then(e=>sQ=e),__vite__mapDeps([212,1,2,3,0,4,5,6,57,58,59,17,9,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,210,211]),import.meta.url);var cQ=null;$(()=>import(`../chunks/CGrPdQPS.js`).then(e=>e.r).then(e=>cQ=e),__vite__mapDeps([140,1,2,9,0,3,4,5,6,10,22,29,17,18,19,7,20,21,23,11,12,13,8,14,24,25,26,27,28,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,141,138]),import.meta.url);function lQ(e,t){Gy(e);let n=U(Di);if(t&&n?.uuid&&!e.startsWith(`/group`)){n.position.set(t[0],t[1],t[2]);let e=U(Es);e&&e.send({type:`move`,uuid:n.uuid,pos:n.position.toArray(),rot:n.rotation.toArray(),scale:n.scale.toArray()})}return n?.uuid&&Ro(`properties`),n}function nJe(e){let t=cQ?.deviceCatalog?.()??[];if(!t.length)return[];let n={};for(let r of t){let t=r.group&&r.group!==`devices`?`Devices: `+r.group:`Devices`;(n[t]??=[]).push({label:r.label||r.kind,tooltip:`Place a `+(r.label||r.kind)+` device`,kind:r.kind,action:()=>cQ.addDevice(r.kind,{position:e()})})}return Object.entries(n).map(([e,t])=>({label:e,children:t}))}function uQ(e){return[...oQ.map(t=>({label:t.group,children:t.items.map(t=>({label:t.label,action:()=>lQ(t.command,e())}))})),{label:`Group`,tooltip:`Create an empty group`,action:()=>lQ(`/group New`,null)},...nJe(e),{label:`Effects`,children:Ju.map(t=>({label:t.name,tooltip:`Place a `+t.name+` particle emitter`,action:()=>{let n=lQ(`/create Sphere 0.15`,e());if(!n?.uuid)return;let r=U(Es);n.name=t.name+` emitter`,r&&r.send({type:`name`,uuid:n.uuid,name:n.name}),n.castShadow=!1,n.userData.shadow=!1,r&&r.send({type:`objectParameters`,parameter:`castShadow`,uuid:n.uuid,castShadow:!1}),delete n.userData.physics,r&&r.send({type:`objectParameters`,parameter:`physics`,uuid:n.uuid,physics:null}),mh(n.uuid,t.key);let i=Number(t.config.fall)||0;i>0&&(n.position.y+=i,r&&r.send({type:`move`,uuid:n.uuid,pos:n.position.toArray(),rot:n.rotation.toArray(),scale:n.scale.toArray()}))}}))},{label:`Water`,children:[...(sQ?.WATER_KINDS??[]).map(t=>({label:t.label,tooltip:`Place `+t.label.toLowerCase()+` (`+t.preset+` preset)`,action:()=>sQ?.makeWater(lQ(t.command,e()),t.key)})),{label:`Bubbles`,tooltip:`Place a bubble emitter (rises to the surface of the water it sits in)`,action:()=>sQ?.makeBubbles(lQ(`/create Sphere 0.08`,e()))}]},...PS()?[{label:`⨠Generate 3D modelâ¦`,tooltip:`Create a custom mesh from a text prompt`,action:()=>hs.set({position:e()})}]:[]]}function rJe(e,t){Ce(t,!1);let n=()=>
2442z(ps,`$viewportMenu`,E),r=()=>z(_c,`$snapSettings`,E),i=()=>z(hc,`$snapTargets`,E),a=()=>z(Kr,`$selectedObjects`,E),o=()=>z(Di,`$selectedObject`,E),s=()=>z(Ci,`$lockedObjects`,E),c=()=>z(Vs,`$objectSearchEnabled`,E),l=()=>z(Nf,`$canUndo`,E),u=()=>z(If,`$canRedo`,E),f=()=>z(c_,`$drawMode`,E),p=()=>z(mP,`$measureMode`,E),m=()=>z(lh,`$simulating`,E),g=()=>z(th,`$remoteSimulating`,E),_=()=>z(Xm,`$simPaused`,E),v=()=>z(gc,`$snapEnabled`,E),y=()=>z(vc,`$surfaceSnap`,E),b=()=>z(ni,`$showGrid`,E),x=()=>z(ll,`$helpersInPlay`,E),S=()=>z(yY,`$trackpadMode`,E),C=()=>z(wl,`$moduleToolboxes`,E),w=()=>z(El,`$openToolboxes`,E),T=()=>z(zh,`$bookmarks`,E),[E,D]=Ve(),O=F(),k=F(),A=F(),ee=F(),j=()=>ps.set(null);function M(){let e=U(xi),t=U(Pi),n=U(yi);e&&t&&n&&(e.render(t,n),e.domElement.toBlob(e=>{if(!e)return;let t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`ThePrototype-${new Date().toISOString().replace(/[T:.Z]/g,`-`)}.png`,t.click(),URL.revokeObjectURL(t.href)}))}let te=e=>String(Number(Number(e).toFixed(4)));function ne(e,t,n){return{label:n??te(t),checked:r()[e]===t,action:()=>_c.update(n=>({...n,[e]:t}))}}function P(e){return{label:`${te(e)}°`,checked:r().rotateDeg===e,action:()=>_c.update(t=>({...t,rotateDeg:e}))}}function re(e,t){let n=r()[e];return(t.includes(n)?t:[...t,n].sort((e,t)=>e-t)).map(t=>ne(e,t))}function ie(e){let t=r().rotateDeg;return(e.includes(t)?e:[...e,t].sort((e,t)=>e-t)).map(e=>P(e))}let ae=[[`vertex`,`Vertex`],[`edge`,`Edge`],[`face`,`Face`],[`surface`,`Surface`],[`object`,`Object`]];function L(e,t){return{label:t,checked:!!i()[e],action:()=>hc.update(t=>({...t,[e]:!t[e]}))}}d(()=>n(),()=>{I(O,n())}),d(()=>i(),()=>{I(k,i().enabled?ae.filter(([e])=>i()[e]).map(([,e])=>e[0]).join(` `):``)}),d(()=>(a(),o(),s()),()=>{I(A,a().length>0||!!o()?.uuid&&s().some(e=>e[1]===o().uuid))}),d(()=>(c(),Q(O),l(),u(),Q(A),o(),f(),p(),m(),g(),_(),v(),r(),Q(k),y(),i(),a(),b(),x(),S(),C(),w(),T(),Rh),()=>{I(ee,[...c()?[{label:`Search objectsâ¦`,icon:`search`,tooltip:`Find a scene object and fly to it`,action:()=>ws.set({x:Q(O).x,y:Q(O).y})}]:[],{label:`Add`,icon:`plus`,children:uQ(()=>Q(O)?.point??null)},{label:`Undo`,icon:`undo-2`,hint:`Ctrl+Z`,disabled:!l(),action:Mf},{label:`Redo`,icon:`redo-2`,hint:`Ctrl+Y`,disabled:!u(),action:jf},{label:`Ping here`,icon:`radar`,tooltip:`Everyone sees a pulse at this spot (or Alt+click anywhere)`,action:()=>Zy(Q(O)?.point??[0,0,0])},...Q(A)?[{label:`Selected`,icon:`box`,children:UK(o().uuid)}]:[],{section:`Tools & view`},{label:`Tools`,icon:`wrench`,children:[{label:`Node editor`,icon:`workflow`,hint:`N`,tooltip:`Show or hide the graph editor`,action:()=>og(`flow`)},{label:`Draw mode`,checked:f(),tooltip:`Drag on surfaces to draw 3D strokes (Esc exits)`,action:f_},{label:p()?`Stop measuring`:`Measure distance`,checked:p(),tooltip:`Click two points; Esc stops`,action:()=>_P()},{label:m()?`â¹ Stop simulation`:`â¶ Simulate physics`,disabled:!!g(),tooltip:g()?hh(g())+` is simulating`:`Dynamic objects fall and collide; stop leaves one undo step (P)`,action:Zm},...m()?[{label:_()?`â¶ Resume simulation`:`⸠Pause simulation`,action:()=>rh()},{label:`⺠Reset simulation`,tooltip:`Restore the initial layout (no undo entry)`,action:()=>uh()}]:[]]},{label:`Snapping`,icon:`grid-3x3`,hint:(v()?`${te(r().translate)} · ${te(r().rotateDeg)}° · ${te(r().scale)}`:`off`)+(Q(k)?` · ${Q(k)}`:``),children:[{label:v()?`Disable snapping`:`Enable snapping`,icon:`magnet`,action:()=>gc.update(e=>!e)},{section:`Position`},...re(`translate`,[.1,.25,.5,1]),{section:`Rotation`},...ie([5,15,45,90]),{section:`Scale`},...re(`scale`,[.05,.1,.25]),{section:`Surface`},{label:`Snap to surface`,checked:y(),tooltip:`Dragged objects rest on whatever is underneath`,action:()=>vc.update(e=>!e)},{section:`Elements`},...ae.map(([e,t])=>L(e,t)),{label:`Align to normal`,checked:i().alignNormal,tooltip:`Snapping to a face also turns the object onto that surface`,action:()=>hc.update(e=>({...e,alignNormal:!e.alignNormal}))},...a().length===1?[{label:`Pick snap origin`,icon:`crosshair`,tooltip:`Click a point on the selected object â drags snap that point`,action:()=>rP()}]:[],{section:` `},{label:`More snapping settingsâ¦`,icon:`sliders-horizontal`,tooltip:`Custom steps live in Configure Scene ⸠Snapping`,action:()=>rc(`Snapping`)}]},{label:`View`,icon:`eye`,children:[{label:`Show grid`,checked:!!b(),action:()=>{ni.update(e=>!e),nt.getItem(`showGrid`)?nt.removeItem(`showGrid`):nt.setItem(`showGrid`,`false`)}},{label:`Grid & axes settingsâ¦`,icon:`sliders-horizontal`,tooltip:`Cell size, colours, fade and the origin axes (Configure Scene ⸠Grid)`,action:()=>rc(`Grid`)},{label:`Show helpers in Play (debug)`,checked:x(),tooltip:`Render light helpers, camera frustums and camera markers inside Play mode (a DEBUG chip marks the frame)`,action:()=>ll.update(e=>!e)},{label:`Mouse wheel`,hint:S()===`off`?`Zoom`:S()===`on`?`Pan`:`Auto`,tooltip:`What a scroll over the viewport does: zoom (a mouse wheel), pan (a trackpad swipe), or detect per event`,children:[{label:`Zoom (mouse wheel)`,checked:S()===`off`,action:()=>yY.set(`off`)},{label:`Pan (trackpad swipe)`,checked:S()===`on`,action:()=>yY.set(`on`)},{label:`Auto-detect`,checked:S()===`auto`,action:()=>yY.set(`auto`)}]},{label:`Scene lookâ¦`,icon:`sliders-horizontal`,tooltip:`Ambient occlusion, colour grading, camera effects and shader materials (Configure Scene ⸠Scene look)`,action:()=>rc(`Scene look`)},{label:`Screenshot`,icon:`camera`,action:M}]},...C().length?[{label:`Module tools`,icon:`wrench`,children:Dl(C(),w()).map(e=>({label:e.label,checked:e.checked,hint:e.shortcut??``,action:e.action}))}]:[],{label:`Camera bookmarks`,icon:`camera`,hint:T().length?String(T().length):``,children:[{label:`Save current view`,icon:`plus`,action:()=>Vh()},...T().length?[{section:`Saved views`}]:[],...T().map((e,t)=>({label:e.name,hint:t<5?`â§${t+1}`:``,tooltip:e.lens?`Restores the view and its lens (${Math.round(e.lens.fov)}° FOV)`:`Saved before lenses were stored â restores the view only`,action:()=>Lh(t)})),{section:` `},{label:`Manage saved viewsâ¦`,icon:`sliders-horizontal`,tooltip:`Rename, re-sh
2442oot, reorder or delete (Configure Scene ⸠Camera)`,action:()=>rc(`Camera:Saved views`)},{label:`Clear bookmarks`,icon:`trash-2`,danger:!0,disabled:T().length===0,action:()=>Rh()}]}])}),h(),R();var oe=fe(),se=N(oe),ce=e=>{xS(e,{get x(){return Q(O),K(()=>Q(O).x)},get y(){return Q(O),K(()=>Q(O).y)},get items(){return Q(ee)},sizeKey:`viewport`,$$events:{close:j}})};G(se,e=>{Q(O)&&e(ce)}),X(e,oe),ue(),D()}var iJe=V(`<button type="button" class="tbx-sec-head"><!> </button> <!>`,1);function dQ(e,n){Ce(n,!0);let r=J(n,`open`,3,!1),i=J(n,`forceOpen`,3,!1),a=J(n,`id`,3,void 0),o=q(()=>`tbx:sec:`+n.key),s=t(null),c=q(()=>{if(i())return!0;let e=Q(s)??(typeof localStorage<`u`?nt.getItem(Q(o)):null);return e===null?r():e===`open`});function l(){I(s,Q(c)?`closed`:`open`,!0);try{nt.setItem(Q(o),Q(s))}catch{}}var u=iJe(),d=N(u),f=j(d);tz(f,{size:11,class:`tbx-sec-chev`,"aria-hidden":`true`});var p=g(f);H(d);var m=g(d,2),h=e=>{var t=fe(),r=N(t);ae(r,()=>n.children),X(e,t)};G(m,e=>{Q(c)&&e(h)}),O(()=>{b(d,`id`,a()),b(d,`aria-expanded`,Q(c)),d.disabled=i(),Y(p,` ${n.label??``}`)}),L(`click`,d,l),X(e,u),ue()}ge([`click`]);var aJe=V(`<div id="mesh-op-hint" class="tbx-row text-xs text-amber-300"> </div>`),oJe=V(`<button id="mesh-adjust-revert" class="tbx-cmd tbx-danger" title="Revert â undo this operation and drop its history entry">â Revert</button>`),sJe=V(`<button id="mesh-op-apply" class="tbx-primary" title="Apply the active op to the selected face">Apply</button>`),cJe=V(`<span class="tbx-label"> </span> <!> <div id="mesh-op-params" class="tbx-row text-xs text-gray-300"><!> <!> <label class="flex items-center gap-1"><input class="tbx-check" type="checkbox"/> individual</label> <label class="flex items-center gap-1" title="Apply the op when you click a face"><input id="mesh-op-autoapply" class="tbx-check" type="checkbox"/> auto-apply</label> <!></div>`,1),lJe=V(`<label class="flex items-center gap-1" title="Profile: 0 is a flat cap, more bulges it â the Out/In buttons pick dome vs dish">profile <input id="bevel-profile" type="range" min="0" max="1" step="0.1" class="w-20"/> <span class="w-10 text-right tabular-nums"> </span></label>`),uJe=V(`<button id="face-bevel" class="tbx-primary">Apply bevel</button>`),dJe=V(`<span class="tbx-label"> </span> <!> <div id="bevel-params" class="tbx-row text-xs text-gray-300"><!> <!> <div class="tbx-seg"><button id="bevel-dir-out">Out</button> <button id="bevel-dir-in">In</button></div> <!> <!> <!></div>`,1),fJe=V(`<div id="loopcut-axis" class="tbx-seg" title="A quad lies on two rings â flip the cut onto the perpendicular one"><button id="loopcut-axis-along" title="Cut across the ring the pick chose">Along</button> <button id="loopcut-axis-across">Across</button></div>`),pJe=V(`<button id="mesh-loopcut-apply" class="tbx-primary" title="Insert the loops across the ring the selection lies on (C)">Cut</button>`),mJe=V(`<span class="tbx-label"> </span> <!> <div id="loopcut-params" class="tbx-row text-xs text-gray-300"><!> <!> <!> <!></div>`,1),hJe=V(`<button id="mesh-bridge-apply" class="tbx-primary" title="Bridge the two selected pieces (B) â they need one closed boundary each and matching edge counts">Bridge</button>`),gJe=V(`<span class="tbx-label"> </span> <!> <div id="bridge-params" class="tbx-row text-xs text-gray-300"><!> <!> <label class="flex items-center gap-1" title="Flip which way the tunnel walls face. The bridge guesses from the shape â a hole through one solid shows its inner surface, two separate pieces make a tube seen from outside â and an unusual shape can fool that guess."><input id="bridge-invert" class="tbx-check" type="checkbox"/> invert faces</label> <!></div>`,1),_Je=V(`<button id="mesh-subdivide-apply" class="tbx-primary" title="Split the selected faces (S) â quad-aware, so the loop tools survive it">Apply</button>`),vJe=V(`<span class="tbx-label"> </span> <!> <div id="subdivide-params" class="tbx-row text-xs text-gray-300"><!> <!></div>`,1),yJe=V(`<button id="edge-extrude-apply" class="tbx-primary" title="Extrude the selected border edges into one welded strip">Extrude</button>`),bJe=V(`<span class="tbx-label"> </span> <!> <div id="edge-extrude-params" class="tbx-row text-xs text-gray-300"><!> <!></div>`,1),xJe=V(`<span class="tbx-label">Smooth options</span> <!> <div id="smooth-params" class="tbx-row text-xs text-gray-300"><!> <!> <button id="mesh-smooth-apply" class="tbx-primary" title="Relax the selected vertices â one undoable commit per click">Smooth</button></div>`,1),SJe=V(`<span class="tbx-label">Proportional options</span> <div class="tbx-row text-xs text-gray-300"><!></div>`,1),CJe=V(`<span class="tbx-label">Slide options</span> <div id="slide-params" class="tbx-row text-xs text-gray-300"><label class="flex items-center gap-1" title="ON (default): the vertex stops at the edge's ends. OFF: it may slide PAST either end, continuing the edge's direction â a marker shows where it will land while it is off the edge."><input id="slide-clamp" class="tbx-check" type="checkbox"/> clamp to edge</label></div>`,1),wJe=V(`<span class="tbx-label">Knife options</span> <div class="tbx-row text-xs text-gray-400">Click one end of the cut, then the other. Esc drops a pending cut.</div>`,1);function TJe(e,t){Ce(t,!0);let n=()=>z(vp,`$bevelProfile`,te),i=()=>z(cm,`$opAdjustState`,te),a=()=>z(lm,`$faceEditAmount`,te),o=()=>z(hp,`$insetDepth`,te),s=()=>z(up,`$extrudeIndividual`,te),l=()=>z(pp,`$insetIndividual`,te),d=()=>z(Rp,`$faceAutoApply`,te),p=()=>z(sp,`$bevelWidth`,te),m=()=>z(mp,`$bevelSegments`,te),h=()=>z(bp,`$bevelDirection`,te),_=()=>z(gp,`$bevelFaceProfile`,te),y=()=>z(op,`$loopCuts`,te),x=()=>z(fp,`$loopCutPosition`,te),S=()=>z(_p,`$bridgeCuts`,te),C=()=>z(lp,`$bridgeTwist`,te),T=()=>z(yp,`$bridgeInvert`,te),E=()=>z(Cp,`$subdivideLevelCount`,te),D=()=>z(xp,`$edgeExtrudeDistance`,te),k=()=>z(ip,`$smoothFactor`,te),A=()=>z(np,`$smoothIterations`,te),ee=()=>z(Ep,`$proportionalRadius`,te),M=()=>z(wp,`$slideClamp`,te),[te,ne]=Ve(),P=e=>{var t=fe(),n=N(t),r=e=>{var t=aJe(),n=f(t,!0);O(()=>Y(n,ie())),X(e,t)};G(n,e=>{ie()&&!F()&&e(r)}),X(e,t)},re=e=>{var t=oJe();L(`click`,t,function(...e){ce()?.apply(this,e)}),X(e,t)},ie=J(t,`hint`,3,``),F=J(t,`adjusting`,3,!1),ae=J(t,`onApplySubdivide`,3,()=>{}),I=J(t,`onApplyEdgeExtrude`,3,()=>{}),oe=J(t,`onApplySmooth`,3,()=>{}),R=J(t,`onAdjust`,3,()=>{}),se=J(t,`onSettle`,3,()=>{}),ce=J(t,`onRevert`,3,()=>{}),le=q(()=>t.mode!==`vertices`),de=q(()=>t.mode!==`faces`);function pe(e,t){return(e===`in`?-1:1)*Math.abs(t)}function B(e){bp.set(e),F()&&(t.mode===`faces`?he({direction:e}):he({profile:pe(e,n())}))}let me=0,V=!1;function he(e){R()(e),V||(clearTimeout(me),me=setTimeout(()=>se()(),300))}function ge(){F()&&(V=!0,clearTimeout(me))}function U(){F()&&(V=!1,clearTimeout(me),se()())}let _e=q(()=>+(i()?.params?.axis===1)),ve=q(()=>!!i()?.axisAlt);function ye(e){F()&&e!==Q(_e)&&he({axis:e})}var be=fe(),xe=N(be),K=e=>{var n=cJe(),r=N(n),i=f(r,!0),u=g(r,2);P(u);var p=g(u,2),m=j(p);hq(m,{id:`mesh-op-amount`,label:`amount`,get value(){return a()}
2442,step:.01,decimals:2,title:`How far Extrude pushes, or how far Inset shrinks (drag to scrub, type, arrows step)`,onchange:e=>{lm.set(e),F()&&he({distance:e})},onscrubstart:ge,onscrubend:U});var h=g(m,2),_=e=>{hq(e,{id:`inset-depth`,label:`depth`,get value(){return o()},step:.01,decimals:2,min:-2,max:2,title:`Push the inset cap along its normal (world units) â 0 keeps it in the surface, negative sinks it`,onchange:e=>{hp.set(e),F()&&he({depth:e})},onscrubstart:ge,onscrubend:U})};G(h,e=>{t.focus===`inset`&&e(_)});var y=g(h,2),x=j(y);v(x),W(),H(y);var S=g(y,2),C=j(S);v(C),W(),H(S);var T=g(S,2),E=e=>{re(e)},D=e=>{var n=sJe();L(`click`,n,function(...e){t.onApplyOp?.apply(this,e)}),X(e,n)};G(T,e=>{F()?e(E):e(D,-1)}),H(p),O(()=>{Y(i,F()?`Adjusting ${t.focus}`:`${t.focus} options`),b(y,`title`,t.focus===`extrude`?`Extrude each separate piece along its OWN normal instead of one averaged direction`:`Inset each picked face separately â one ring apiece instead of one shared ring`),b(x,`id`,t.focus===`extrude`?`extrude-individual`:`inset-individual`),w(x,t.focus===`extrude`?s():l())}),L(`change`,x,e=>{let n=e.currentTarget.checked;(t.focus===`extrude`?up:pp).set(n),F()&&he({individual:n})}),c(C,d,e=>ke(Rp,e)),X(e,n)},Se=e=>{var i=dJe(),a=N(i),o=f(a,!0),s=g(a,2);P(s);var c=g(s,2),l=j(c);hq(l,{id:`bevel-width`,label:`width`,get value(){return p()},unit:`length`,step:.005,snap:.05,decimals:3,min:.001,title:`How far the chamfer reaches (clamped per edge so two bevels can never cross)`,onchange:e=>{sp.set(e),F()&&he({width:e})},onscrubstart:ge,onscrubend:U});var d=g(l,2),y=e=>{hq(e,{id:`bevel-segments`,label:`segments`,get value(){return m()},step:.05,decimals:0,min:1,max:8,title:`More segments = a rounder edge`,onchange:e=>{mp.set(Math.round(e)),F()&&he({segments:Math.round(e)})},onscrubstart:ge,onscrubend:U})};G(d,e=>{Q(le)&&e(y)});var x=g(d,2),S=j(x),C=g(S,2);H(x);var w=g(x,2),T=e=>{hq(e,{id:`bevel-face-profile`,label:`profile`,get value(){return _()},step:.01,decimals:2,min:-1,max:1,title:`Profile of the chamfer: 1 rounds it outward (quarter-circle), 0 is a straight 45° ramp, -1 hollows it the other way. The chamfer reaches just as far whichever you pick.`,onchange:e=>{gp.set(e),F()&&he({profile:e})},onscrubstart:ge,onscrubend:U})};G(w,e=>{t.mode===`faces`&&e(T)});var E=g(w,2),D=e=>{var t=lJe(),r=g(j(t));v(r);var i=g(r,2),a=f(i,!0);H(t),O((e,t)=>{u(r,e),Y(a,t)},[()=>Math.abs(n()),()=>Math.abs(n())<.05?`flat`:(h()===`in`?`in `:`out `)+Math.abs(n()).toFixed(1)]),L(`input`,r,e=>{let t=parseFloat(e.currentTarget.value);vp.set(t),F()&&he({profile:pe(h(),t)})}),X(e,t)};G(E,e=>{Q(de)&&e(D)});var k=g(E,2),A=e=>{re(e)},ee=e=>{var n=uJe();O(()=>b(n,`title`,t.mode===`vertices`?`Cut the corner off every selected vertex and cap it`:t.mode===`edges`?`Replace each selected edge with a chamfer strip`:`Chamfer the selected face's border (inset + push per segment)`)),L(`click`,n,function(...e){t.onApplyBevel?.apply(this,e)}),X(e,n)};G(k,e=>{F()?e(A):e(ee,-1)}),H(c),O(()=>{Y(o,F()?`Adjusting bevel`:`Bevel options`),b(x,`title`,t.mode===`faces`?`Chamfer direction â Out raises the cap along the face normal, In recesses it into the surface`:`Cap direction â Out domes the cap outward, In dishes it inward (needs profile > 0)`),r(S,1,`px-2 py-0.5 ${h()===`out`?`bg-primary-600 text-white`:`bg-gray-700 hover:bg-gray-600`}`),r(C,1,`px-2 py-0.5 ${h()===`in`?`bg-primary-600 text-white`:`bg-gray-700 hover:bg-gray-600`}`)}),L(`click`,S,()=>B(`out`)),L(`click`,C,()=>B(`in`)),X(e,i)},we=e=>{var n=mJe(),i=N(n),a=f(i,!0),o=g(i,2);P(o);var s=g(o,2),c=j(s);hq(c,{id:`mesh-loop-cuts`,label:`cuts`,get value(){return y()},step:.05,decimals:0,min:1,max:20,title:`How many edge loops Loop cut inserts`,onchange:e=>{op.set(Math.round(e)),F()&&he({cuts:Math.round(e)})},onscrubstart:ge,onscrubend:U});var l=g(c,2);{let e=q(()=>y()>1),t=q(()=>y()>1?`Multiple cuts are always evenly spaced â set cuts to 1 to place a single cut`:`Where the single cut lands along the ring (0.5 = midway)`);hq(l,{id:`loopcut-position`,label:`position`,get value(){return x()},step:.005,decimals:2,min:.01,max:.99,get disabled(){return Q(e)},get title(){return Q(t)},onchange:e=>{fp.set(e),F()&&he({position:e})},onscrubstart:ge,onscrubend:U})}var u=g(l,2),d=e=>{var t=fJe(),n=j(t),i=g(n,2);H(t),O(()=>{r(n,1,`px-2 py-0.5 ${Q(_e)===0?`bg-primary-600 text-white`:`bg-gray-700 hover:bg-gray-600`}`),r(i,1,`px-2 py-0.5 ${Q(_e)===1?`bg-primary-600 text-white`:`bg-gray-700 hover:bg-gray-600`}`),i.disabled=!Q(ve),b(i,`title`,Q(ve)?`Cut across the PERPENDICULAR ring instead`:`No perpendicular loop runs through that quad`)}),L(`click`,n,()=>ye(0)),L(`click`,i,()=>ye(1)),X(e,t)};G(u,e=>{F()&&e(d)});var p=g(u,2),m=e=>{re(e)},h=e=>{var n=pJe();L(`click`,n,function(...e){t.onApplyLoopCut?.apply(this,e)}),X(e,n)};G(p,e=>{F()?e(m):e(h,-1)}),H(s),O(()=>Y(a,F()?`Adjusting loop cut`:`Loop cut options`)),X(e,n)},Te=e=>{var n=gJe(),r=N(n),i=f(r,!0),a=g(r,2);P(a);var o=g(a,2),s=j(o);hq(s,{id:`mesh-bridge-cuts`,label:`cuts`,get value(){return S()},step:.05,decimals:0,min:0,max:20,title:`Extra loops along the tunnel. 0 is a single band; more rings give the bridge something to deform with afterwards.`,onchange:e=>{_p.set(Math.round(e)),F()&&he({cuts:Math.round(e)})},onscrubstart:ge,onscrubend:U});var c=g(s,2);hq(c,{id:`bridge-twist`,label:`twist`,get value(){return C()},step:.05,decimals:0,min:-20,max:20,title:`Rotate how the two loops pair up, one edge per step â untwists a skewed tunnel`,onchange:e=>{lp.set(Math.round(e)),F()&&he({twist:Math.round(e)})},onscrubstart:ge,onscrubend:U});var l=g(c,2),u=j(l);v(u),W(),H(l);var d=g(l,2),p=e=>{re(e)},m=e=>{var n=hJe();L(`click`,n,function(...e){t.onApplyBridge?.apply(this,e)}),X(e,n)};G(d,e=>{F()?e(p):e(m,-1)}),H(o),O(()=>{Y(i,F()?`Adjusting bridge`:`Bridge options`),w(u,T())}),L(`change`,u,e=>{let t=e.currentTarget.checked;yp.set(t),F()&&he({invert:t})}),X(e,n)},Ee=e=>{var t=vJe(),n=N(t),r=f(n,!0),i=g(n,2);P(i);var a=g(i,2),o=j(a);hq(o,{id:`subdivide-levels`,label:`levels`,get value(){return E()},step:.05,decimals:0,min:1,max:3,title:`How many times to split â each level turns every quad into four (growth is 4^levels, capped by the sync limit)`,onchange:e=>{Cp.set(Math.round(e)),F()&&he({levels:Math.round(e)})},onscrubstart:ge,onscrubend:U});var s=g(o,2),c=e=>{re(e)},l=e=>{var t=_Je();L(`click`,t,function(...e){ae()?.apply(this,e)}),X(e,t)};G(s,e=>{F()?e(c):e(l,-1)}),H(a),O(()=>Y(r,F()?`Adjusting subdivide`:`Subdivide options`)),X(e,t)},De=e=>{var t=bJe(),n=N(t),r=f(n,!0),i=g(n,2);P(i);var a=g(i,2),o=j(a);hq(o,{id:`edge-extrude-distance`,label:`distance`,get value(){return D()},step:.01,decimals:2,min:-5,max:5,title:`How far the strip reaches, along the border's averaged surface normal (world units; negative pulls the other way)`,onchange:e=>{xp.set(e),F()&&he({distance:e})},onscrubstart:ge,onscrubend:U});var s=g(o,2),c=e=>{re(e)},l=e=>{var t=yJe();L(`click`,t,function(...e){I()?.apply(this,e)}),X(e,t)};G(s,e=>{F()?e(c):e(l,-1)}),H(a),O(()=>Y(r,F()?`Adjusting edge extrude`:`Edge extrude options`)),X(e,t)},Oe=e=>{var t=xJe(),n=g(N(t),2);P(n);var r=g(n,2),i=j(r);hq(i,{id:`smooth-factor`,label:`factor`,get value(){return k()},step:.01,decimals:2,min:0,max:1,title:`How far each vertex moves toward the average of its neighbours (1 = lands exactly on it)`,onchange:e=>ip.set(e)});var a=g(i,2);hq(a,{id:`smooth-iterations`,label:`passes`,get value(){return A()},step:.05,decimals:0,min:1,max:10,title:`How many relax passes one click runs (each pass reads the previous pass's result)`,onchange:e=>np.set(Math.round(e))});var o=g(a,2);H(r),L(`click`,o,function(...e){oe()?.apply(this,e)}),X(e,t)},Ae=e=>{var n=SJe(),r=g(N(n),2);hq(j(r),{id:`mesh-proportional-radius`,label:`radius`,get value(){return ee()},step:.02,decimals:2,min:.01,title:`How far the drag carries its neighbours (local units). Weight fades smoothly to zero at the radius.`,onchange:e=>Ep.set(e),onscrubstart:()=>Eie(t.mode),onscrubend:()=>Die()}),H(r),X(e,n)},je=e=>{var t=CJe(),n=g(N(t),2),r=j(n),i=j(r);v(i),W(),H(r),H(n),O(()=>w(i,M())),L(`change`,i,e=>wp.set(e.currentTarget.checked)),X(e,t)},Me=e=>{var t=wJe();W(2),X(e,t)};G(xe,e=>{t.focus===`extrude`||t.focus===`inset`?e(K):t.focus===`bevel`?e(Se,1):t.focus===`loopcut`?e(we,2):t.focus===`bridge`?e(Te,3):t.focus===`subdivide`?e(Ee,4):t.focus===`edge-extrude`?e(De,5):t.focus===`smooth`?e(Oe,6):t.focus===`proportional`?e(Ae,7):t.focus===`slide`?e(je,8):t.focus===`knife`&&e(Me,9)}),X(e,be),ue(),ne()}ge([`click`,`change`,`input`]);var EJe=V(`<div class="tbx-sheet-resize svelte-5r5vme"><div class="tbx-sheet-grab svelte-5r5vme"></div></div>`),DJe=V(`<div class="tbx-tabs svelte-5r5vme" role="tablist"><!></div>`),OJe=V(`<div class="toolbox-status svelte-5r5vme"><!></div>`),kJe=V(`<div><!> <div class="toolbox-header move-handle svelte-5r5vme"><!> <span class="toolbox-title svelte-5r5vme"> </span> <span class="toolbox-spacer svelte-5r5vme"></span> <!></div> <!> <div class="toolbox-body svelte-5r5vme"><!></div> <!></div>`);function fQ(e,n){Ce(n,!0);let i=J(n,`defaultRect`,19,()=>({left:12,top:76})),a=J(n,`minW`,3,134),o=J(n,`width`,3,174),s=J(n,`tabs`,3,null),c=J(n,`actions`,3,null),l=J(n,`status`,3,null),u=t(!1);Qe(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: 640px)`);I(u,e.matches,!0);let t=()=>I(u,e.matches,!0);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}),Qe(()=>{Q(u)&&(Gs.set(!1),Ho.set(!0))});let d=t(0),p=q(()=>`tbxSheetH:`+n.key);Qe(()=>{if(Q(d)||typeof window>`u`)return;let e=parseInt(nt.getItem(Q(p))||``);I(d,!e||Number.isNaN(e)?Math.round(window.innerHeight*.4):e,!0)});let m=t(!1);function h(e){I(m,!0),e.currentTarget.setPointerCapture?.(e.pointerId),e.preventDefault(),e.stopPropagation()}function _(e){if(!Q(m))return;let t=parseFloat(getComputedStyle(document.documentElement).getPropertyValue(`--connect-bottom`))||54,n=Math.max(180,window.innerHeight-t-56);I(d,Math.min(Math.max(140,window.innerHeight-e.clientY),n),!0)}function v(e){if(Q(m)){I(m,!1);try{e.currentTarget.releasePointerCapture?.(e.pointerId)}catch{}try{nt.setItem(Q(p),String(Q(d)))}catch{}}}var y=kJe();let x,S;
2442var C=j(y),w=e=>{var t=EJe();L(`pointerdown`,t,h),L(`pointermove`,t,_),L(`pointerup`,t,v),X(e,t)};G(C,e=>{Q(u)&&e(w)});var T=g(C,2),E=j(T);qOe(E,{size:14,"aria-hidden":`true`});var D=g(E,2),k=f(D,!0),A=g(D,4);ae(A,()=>c()??qe),H(T);var ee=g(T,2),M=e=>{var t=DJe(),n=j(t);ae(n,s),H(t),X(e,t)};G(ee,e=>{s()&&e(M)});var te=g(ee,2),N=j(te);ae(N,()=>n.children),H(te);var P=g(te,2),re=e=>{var t=OJe(),n=j(t);ae(n,l),H(t),X(e,t)};G(P,e=>{l()&&e(re)}),H(y),ne(y,(e,t)=>Zh?.(e,t),()=>({key:n.key,defaultRect:i(),resizable:!0,axis:`x`,minW:a(),inert:()=>Q(u)})),ne(y,(e,t)=>Kh?.(e,t),()=>n.key),O(()=>{b(y,`id`,n.id),x=r(y,1,`ui-panel toolbox svelte-5r5vme`,null,x,{"tbx-sheet":Q(u)}),S=Ze(y,`z-index: var(--z-window)`,S,{"--tbx-w":`${o()??``}px`,"--tbx-sheet-h":`${Q(d)??``}px`}),Y(k,n.title)}),X(e,y),ue()}ge([`pointerdown`,`pointermove`,`pointerup`]);var pQ=je(`<path></path>`),AJe=je(`<path stroke="none"></path>`),jJe=je(`<svg class="lucide" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><!><!><!></svg>`);function mQ(e,t){let n={extrude:{base:[`M4 20h10V10H4z`],accent:[`M9 10V3`,`M5.5 6.5L9 3l3.5 3.5`,`M14 20l6-4V6l-6 4`]},inset:{base:[`M3 3h18v18H3z`],accent:[`M8 8h8v8H8z`]}
2442,move:{base:[`M9.5 9.5h5v5h-5z`],accent:[`M12 3v4`,`M12 17v4`,`M3 12h4`,`M17 12h4`,`M10 5l2-2 2 2`,`M10 19l2 2 2-2`,`M5 10l-2 2 2 2`,`M19 10l2 2-2 2`]},knife:{base:[`M3 21l5.5-5.5`],accent:[`M8.5 15.5l5-5`,`M13.5 10.5l6-6 2.5 2.5-6 6z`]},"loop-cut":{base:[`M4 4h16v16H4z`],accent:[`M10 3v18`,`M15 3v18`]},subdivide:{base:[`M4 4h16v16H4z`],accent:[`M12 4v16`,`M4 12h16`]},bridge:{base:[`M3 5h4v14H3z`,`M17 5h4v14h-4z`],accent:[`M7 8.5h10`,`M7 15.5h10`]},"flip-normals":{base:[`M3 12h18`],accent:[`M8 12V5`,`M5.5 7.5L8 5l2.5 2.5`,`M16 12v7`,`M13.5 16.5L16 19l2.5-2.5`]},"delete-face":{base:[`M4 4h16v16H4z`],accent:[`M8.5 8.5l7 7`,`M15.5 8.5l-7 7`]},bevel:{base:[`M4 4h9v0M4 4v16h16v-9`],accent:[`M13 4l7 7`],accentFill:[]},"bevel-vertex":{base:[`M4 20L11 6`,`M20 20L13 6`],accent:[`M9.5 9l5 0`],accentFill:[`M12 5.6a1.6 1.6 0 100 3.2 1.6 1.6 0 100-3.2z`]},dissolve:{base:[`M3 5h18v14H3z`],accent:[`M12 6v2`,`M12 11v2`,`M12 16v2`]},"edge-extrude":{base:[`M4 19h16`],accent:[`M4 7h16`,`M4 19V7`,`M20 19V7`]},"edge-subdivide":{base:[`M3 12h18`],accent:[`M12 7v2`,`M12 15v2`],accentFill:[`M12 10.4a1.6 1.6 0 100 3.2 1.6 1.6 0 100-3.2z`]},"duplicate-face":{base:[`M4 4h11v11H4z`],accent:[`M9 9h11v11H9z`]},weld:{base:[`M3 12h4`,`M17 12h4`],accent:[`M8.5 9.5L11 12l-2.5 2.5`,`M15.5 9.5L13 12l2.5 2.5`],accentFill:[`M12 10.4a1.6 1.6 0 100 3.2 1.6 1.6 0 100-3.2z`]},"create-face":{base:[],accent:[`M12 5l7 14H5z`],accentFill:[`M12 3.6a1.6 1.6 0 100 3.2 1.6 1.6 0 100-3.2z`,`M5 17.6a1.6 1.6 0 100 3.2 1.6 1.6 0 100-3.2z`,`M19 17.6a1.6 1.6 0 100 3.2 1.6 1.6 0 100-3.2z`]},proportional:{base:[`M2 18h20`],accent:[`M4 18c5 0 4-11 8-11s3 11 8 11`]},"vertex-slide":{base:[`M3 17L21 7`],accent:[`M7.5 6.5L4.5 8l1.5 3`,`M16.5 17.5l3-1.5-1.5-3`],accentFill:[`M12 10.4a1.6 1.6 0 100 3.2 1.6 1.6 0 100-3.2z`]},"recalc-normals":{base:[`M3 14h18`],accent:[`M7 14V6`,`M4.5 8.5L7 6l2.5 2.5`,`M17 14V6`,`M14.5 8.5L17 6l2.5 2.5`]},"merge-distance":{base:[`M4 5v14`,`M20 5v14`],accent:[`M8 10l3 2-3 2`,`M16 10l-3 2 3 2`],accentFill:[`M12 10.4a1.6 1.6 0 100 3.2 1.6 1.6 0 100-3.2z`]},shading:{base:[`M12 3l-7 5v8l7 5`,`M5 8l7 4`,`M12 21V12`],accent:[`M12 3a9 9 0 010 18`]},symmetrize:{base:[`M10 4L4 12l6 8z`],accent:[`M12 2v20`,`M14 4l6 8-6 8`]},wireframe:{base:[`M3 8h13v13H3z`],accent:[`M8 3h13v13`,`M3 8l5-5`,`M16 8l5-5`,`M16 21l5-5`]},outline:{base:[`M8.5 8.5h7v7h-7z`],accent:[`M4 4h4`,`M16 4h4`,`M4 20h4`,`M16 20h4`,`M4 4v4`,`M20 4v4`,`M4 16v4`,`M20 16v4`]},"tris-to-quads":{base:[`M3 4h8L3 12z`,`M3 20h8l-8-8z`],accent:[`M13 8h8v8h-8z`]},triangulation:{base:[`M4 4h16v16H4z`],accent:[`M4 20L20 4`]},gizmo:{base:[`M5 19h14`],accent:[`M5 19V6`,`M2.5 8.5L5 6l2.5 2.5`,`M5 19h13`,`M15.5 16.5L19 19l-3.5 2.5`],accentFill:[`M5 17.4a1.6 1.6 0 100 3.2 1.6 1.6 0 100-3.2z`]},raise:{base:[`M3 18c4 0 4.5-5 9-5s5 5 9 5`],accent:[`M12 9V3`,`M9 6l3-3 3 3`]},lower:{base:[`M3 13c4 0 4.5 5 9 5s5-5 9-5`],accent:[`M12 3v6`,`M9 6l3 3 3-3`]},smooth:{base:[`M3 8.5C6 4 9 4 12 7s6 3 9-1.5`],accent:[`M3 17c6 0 12 0 18 0`]},flatten:{base:[`M4 7h16`],accent:[`M12 7v6`,`M9 10l3 3 3-3`,`M4 18h16`]}},r=J(t,`size`,3,18),i=q(()=>{let e=n[t.name]??n.wireframe;return Array.isArray(e)?{base:e}:e}),a=`var(--icon-accent, var(--accent, var(--color-primary-500, #60a5fa)))`;var o=jJe(),s=j(o);B(s,16,()=>Q(i).base??[],e=>e,(e,t)=>{var n=pQ();O(()=>b(n,`d`,t)),X(e,n)});var c=g(s);B(c,16,()=>Q(i).accent??[],e=>e,(e,t)=>{var n=pQ();b(n,`stroke`,a),O(()=>b(n,`d`,t)),X(e,n)});var l=g(c);B(l,16,()=>Q(i).accentFill??[],e=>e,(e,t)=>{var n=AJe();b(n,`fill`,a),O(()=>b(n,`d`,t)),X(e,n)}),H(o),O(()=>{b(o,`width`,r()),b(o,`height`,r())}),X(e,o)}var hQ=V(`<button><!></button>`),MJe=V(`<button id="mesh-proportional" aria-label="Proportional editing" title="Proportional editing â drag a vertex, edge or face and its neighbourhood follows, weighted by distance (radius below). For smooth bulges and dips instead of a crease."><!></button>`),NJe=V(`<button id="collider-edit-done" class="tbx-hbtn tbx-ok" aria-label="Save the collider" title="Save the custom collider (each shell = one convex piece)"><!></button> <button id="collider-edit-cancel" class="tbx-hbtn" aria-label="Cancel the collider edit" title="Drop the collider edit (Esc)"><!></button>`,1),PJe=V(`<button id="mesh-undo" class="tbx-hbtn" aria-label="Undo" title="Undo (Ctrl+Z) â steps back inside this edit session"><!></button> <button id="mesh-redo" class="tbx-hbtn" aria-label="Redo" title="Redo (Ctrl+Y) â replay the step you just undid"><!></button> <button id="mesh-edit-cancel" class="tbx-hbtn tbx-danger" aria-label="Cancel â revert every change made in this session" title="Cancel â revert EVERY change made since Edit Mesh opened (asks first)"><!></button> <button id="mesh-edit-done" class="tbx-hbtn tbx-done" aria-label="Done" title="Finish (Esc)"><!></button>`,1),FJe=V(`<button id="mesh-keys-help" class="tbx-hbtn" aria-label="Show mesh-edit key bindings" title="Key bindings â opens a movable cheat sheet you can park anywhere"><!></button> <!>`,1),IJe=V(`<button id="mesh-mode-vertices" role="tab" title="Vertices (1) â drag single points">Vertices</button> <button id="mesh-mode-edges" role="tab" title="Edges (2) â loops, rings, bevel and dissolve act on them">Edges</button> <button id="mesh-mode-faces" role="tab" title="Faces (3) â extrude, inset, bridge and the rest">Faces</button>`,1),LJe=V(`<span id="edge-sel-count"> </span>`),RJe=V(`<span title="Boundary edges of the two selected pieces â Bridge needs them EQUAL"> </span>`),zJe=V(`<span id="mesh-sel-counts" title="Selected faces · triangles (Ctrl+click adds)"> <!></span>`),BJe=V(`<span id="mesh-sel-count"> </span>`),VJe=V(`<span id="collider-shell-count" class="text-emerald-300" title="Disconnected shells â each becomes one convex piece"> </span>`),gQ=V(`<!> <!>`,1),HJe=V(`<div id="mesh-cancel-confirm" class="tbx-row text-xs"><span class="text-gray-200">Revert all mesh edits?</span> <button id="mesh-cancel-yes" class="tbx-cmd tbx-danger">Revert</button> <button id="mesh-cancel-no" class="tbx-cmd">Keep</button></div>`),_Q=V(`<button> </button>`),UJe=V(`<div class="tbx-row"><div class="tbx-seg"></div></div>`),WJe=V(`<span class="tbx-label">Tools</span> <button id="edge-move" aria-label="Move edges with the gizmo" title="Move â seat the gizmo on the selected edges (X runs along the edge, Z out of the surface). The welded neighbours stretch with it."><!></button> <button id="edge-bevel" aria-label="Bevel edges" title="Bevel â replace the selected edge with a chamfer strip, adjustable below (P3: with an edge picked the click applies immediately, like the faces grid). Each end needs three faces around it; more than that needs a mitered corner, which is refused rather than guessed."><!></button> <button id="edge-extrude" aria-label="Extrude edges" title="Extrude â pull the selected BORDER edges out into a
2442new strip, distance adjustable below (with an edge picked the click applies immediately). A chain of edges extrudes as ONE welded strip; an interior edge (a face on both sides) is refused."><!></button> <button id="edge-subdivide" aria-label="Subdivide edges" title="Subdivide â split every face along the selected edges at their midpoints. Both sides split at the identical welded point, so the mesh stays watertight; the two halves stay selected."><!></button> <button id="edge-dissolve" aria-label="Dissolve edges" title="Dissolve â remove the edge and merge the two coplanar faces it joins"><!></button> <button id="edge-delete" aria-label="Delete edges" title="Delete â remove the faces on BOTH sides of the selected edges, leaving a hole. (Dissolve keeps the surface; this opens it up, which is how you make a hole to bridge or fill.)"><!></button> <!>`,1),GJe=V(`<span class="tbx-label">Tools</span> <!> <!> <span class="tbx-label">Operations</span> <!>`,1),KJe=V(`<span class="tbx-label">Tools</span> <button id="mesh-weld" aria-label="Weld the selected vertices" title="Weld (W) â merge the selected vertices into one (Ctrl+click adds)"><!></button> <button id="mesh-create-face" aria-label="Create a face from the selected vertices" title="Create face â select 3-4 vertices (Ctrl+click adds) first"><!></button> <button id="mesh-vertex-bevel" aria-label="Bevel the selected vertices" title="Bevel â cut the corner off every selected vertex and cap it, adjustable below (P3: with a vertex picked the click applies immediately, like the faces grid). Works on any number of vertices."><!></button> <button id="mesh-smooth" aria-label="Smooth the selected vertices" title="Smooth â relax each selected vertex toward the average of its neighbours (factor and passes below; with a vertex picked the click applies immediately). Evens out lumps; unselected vertices never move."><!></button> <!> <button id="mesh-slide" aria-label="Slide the vertex along an edge" title="Slide â constrain the drag to one of this vertex's own edges (it picks the edge you drag toward and clamps to its ends). Adjusts a profile without pulling the vertex off the surface."><!></button> <button id="mesh-delete-verts" aria-label="Delete the selected vertices" title="Delete â remove every face that uses a selected vertex, leaving a hole (Ctrl+click adds vertices)"><!></button>`,1),qJe=V(`<div class="tbx-row" id="mesh-gizmo-row"><button id="mesh-gizmo-toggle" aria-label="Show the transform gizmo"><!></button> <div id="mesh-gizmo-space" class="tbx-seg" title="Gizmo orientation â Local aligns to what is selected (for a face, Z = its normal; for an edge, X runs along it). Scale handles always orient local."><button id="mesh-space-local">Local</button> <button id="mesh-space-world">World</button></div></div> <div class="tbx-row" id="mesh-snap-row"><label class="flex items-center gap-1" title="Snap gizmo drags to a grid â vertices, edges, faces AND whole objects, the one app-wide setting"><input id="mesh-snap-enabled" class="tbx-check" type="checkbox"/> grid snap</label> <!> <!></div> <div id="mesh-snap-note" class="tbx-row text-[10px] italic text-gray-400">App-wide â the same setting as Configure Scene ⸠Snapping.</div> <span class="tbx-label">Pivot</span> <div class="tbx-row" id="mesh-pivot-row"><button id="mesh-pivot-set" class="tbx-cmd" title="Put the pivot at the centre of what is selected right now">Set here</button> <button id="mesh-pivot-pick" title="Click a point on the mesh to place the pivot (a nearby vertex wins; Esc cancels)"> </button> <button id="mesh-pivot-move" title="Drag the transform gizmo to place the pivot â the mesh does not move (Esc leaves)"> </button> <button id="mesh-pivot-clear" class="tbx-cmd tbx-danger" title="Back to the selection's own centre">Clear</button></div> <div id="mesh-pivot-state" class="tbx-row text-[11px] text-gray-400"> </div>`,1),JJe=V(`<!> <button id="mesh-shading" aria-label="Smooth shading"><!></button> <div class="tbx-row text-xs text-gray-300"><!></div>`,1),YJe=V(`<div id="mesh-symmetrize" class="tbx-row text-xs text-gray-300"><span title="Keep one half and replace the other with its mirror image, across an object-local axis through the origin">mirror</span> <div class="tbx-seg"></div> <button id="mesh-sym-side" class="tbx-cmd" title="Which half to KEEP â the other one is replaced by its mirror"> </button>
2442 <button id="mesh-sym-apply" class="tbx-primary">Symmetrize</button></div>`),XJe=V(`<div class="tbx-row text-xs text-gray-300"><label class="flex items-center gap-1" title="Vertex dot size â a multiplier over the size derived from the object, so it stays sane on a terrain and on a cube">dots <input id="mesh-handle-scale" type="range" min="0.2" max="3" step="0.1" class="w-20"/> <span class="w-8 text-right tabular-nums"> </span></label> <button id="mesh-handle-adaptive" class="tbx-cmd"> </button></div>`),ZJe=V(`<button id="mesh-wireframe-toggle" class="tbx-btn" aria-label="Wireframe overlay" title="Show the edit wireframe overlay"><!></button> <button id="mesh-outline-toggle" class="tbx-btn" aria-label="Selection outline"><!></button> <button id="mesh-triwire-toggle" class="tbx-btn" aria-label="Show triangulation"><!></button> <button id="mesh-hotkeys-toggle" class="tbx-btn" aria-label="Toggle mesh-edit keyboard shortcuts"><!></button> <!>`,1),QJe=V(`<button id="collider-add-box" class="tbx-btn" aria-label="Add a box piece" title="Merge a box into the collider as a new convex piece"><!></button> <button id="collider-add-sphere" class="tbx-btn" aria-label="Add a sphere piece" title="Merge a sphere into the collider as a new convex piece"><!></button>`,1),$Je=V(`<!> <span class="tbx-label">Select</span> <!> <div class="tbx-row"></div> <!> <!> <!> <!> <!> <!> <!>`,1),eYe=V(`<button id="mesh-keys-close" class="tbx-hbtn" aria-label="Close the key list" title="Close"><!></button>`),tYe=V(`<span class="rounded-sm bg-primary-600 px-1 text-[9px] text-white">active</span>`),nYe=V(`<div class="flex items-baseline justify-between gap-3 py-0.5"><span class="shrink-0 font-mono text-primary-300"> </span> <span class="text-right text-gray-300"> </span></div>`),rYe=V(`<div> <!></div> <!>`,1),iYe=V(`<div class="tbx-row flex-col items-stretch gap-0 text-xs"></div>`);function aYe(e,n){Ce(n,!0);let i=()=>z(wi,`$isVRMode`,Fe),a=()=>z(mm,`$editingObject`,Fe),o=()=>z(Up,`$faceEditObject`,Fe),s=()=>z(am,`$faceEditSubmode`,Fe),c=()=>z(YF,`$colliderEditObject`,Fe),l=()=>z(Ui,`$objectsGroup`,Fe),u=()=>z(Mie,`$meshPivots`,Fe),d=()=>z(Di,`$selectedObject`,Fe),m=()=>z(Sp,`$mergeDistance`,Fe),h=()=>z(Ip,`$faceEditSelectedTris`,Fe),_=()=>z(Op,`$faceEditGranularity`,Fe),y=()=>z(iae,`$faceEditHighlight`,Fe),x=()=>z(Wie,`$faceEditHoverTri`,Fe),C=()=>z(_ae,`$edgeEditSelected`,Fe),T=()=>z(cp,`$optionsFocus`,Fe),E=()=>z(um,`$vertexSelectionSize`,Fe),D=()=>z(cm,`$opAdjustState`,Fe),k=()=>z(bp,`$bevelDirection`,Fe),ee=()=>z(vp,`$bevelProfile`,Fe),te=()=>z(lm,`$faceEditAmount`,Fe),ne=()=>z(hp,`$insetDepth`,Fe),P=()=>z(pp,`$insetIndividual`,Fe),re=()=>z(up,`$extrudeIndividual`,Fe),ie=()=>z(sp,`$bevelWidth`,Fe),F=()=>z(mp,`$bevelSegments`,Fe),ae=()=>z(gp,`$bevelFaceProfile`,Fe),oe=()=>z(op,`$loopCuts`,Fe),R=()=>z(fp,`$loopCutPosition`,Fe),se=()=>z(_p,`$bridgeCuts`,Fe),ce=()=>z(lp,`$bridgeTwist`,Fe),le=()=>z(yp,`$bridgeInvert`,Fe),de=()=>z(Cp,`$subdivideLevelCount`,Fe),pe=()=>z(xp,`$edgeExtrudeDistance`,Fe),me=()=>z(ip,`$smoothFactor`,Fe),V=()=>z(np,`$smoothIterations`,Fe),he=()=>z(Mp,`$faceEditOp`,Fe),ge=()=>z(Tp,`$proportionalEdit`,Fe),_e=()=>z(Xp,`$meshEditHotkeys`,Fe),ve=()=>z(Nf,`$canUndo`,Fe),ye=()=>z(If,`$canRedo`,Fe),be=()=>z(pm,`$vertexSlide`,Fe),xe=()=>z(Zp,`$meshGizmoEnabled`,Fe),Se=()=>z(Wp,`$faceGizmoSpace`,Fe),we=()=>z(gc,`$snapEnabled`,Fe),Te=()=>z(_c,`$snapSettings`,Fe),Ee=()=>z(Dp,`$meshPivotPicking`,Fe),J=()=>z(Aie,`$meshPivotMoving`,Fe),De=()=>z(ap,`$symAxis`,Fe),Oe=()=>z(rp,`$symKeep`,Fe),Ae=()=>z($p,`$meshEditWireframe`,Fe),je=()=>z(im,`$meshEditOutline`,Fe),Me=()=>z(nm,`$meshEditTriWire`,Fe),Ne=()=>z(dm,`$vertexHandleScale`,Fe),Pe=()=>z(_m,`$vertexHandleAdaptive`,Fe),[Fe,Ie]=Ve(),Le=(e,t=qe)=>{var n=fe(),i=N(n);B(i,17,t,e=>e.op,(e,t)=>{var n=hQ();let i;mQ(j(n),{get name(){return Q(t).icon}}),H(n),O(()=>{b(n,`id`,`mesh-op-${Q(t).op}`),i=r(n,1,`tbx-btn ${Q(t).op===`delete`?`tbx-danger`:Q(t).param&&T()===Q(t).op?`tbx-sel`:!Q(t).oneShot&&Q(t).op===he()?`tbx-on bg-primary-600 text-white`:``}`,null,i,{"mesh-op-active":!Q(t).oneShot&&Q(t).op===he(),"tbx-flash":Q(ct)===Q(t).op}),b(n,`aria-label`,Q(t).label),b(n,`aria-pressed`,Q(t).param?T()===Q(t).op:void 0),b(n,`title`,`${Q(t).hint?`${Q(t).label} (${Q(t).hint})`:Q(t).label} â ${Q(t).desc}${Q(t).param?` (sets options below)`:``}`)}),Z(`animationend`,n,()=>I(ct,``)),L(`click`,n,()=>ft(Q(t).op)),X(e,n)}),X(e,n)},Re=e=>{var t=MJe();mQ(j(t),{name:`proportional`}),H(t),O(()=>{r(t,1,`tbx-btn ${ge()?`tbx-on bg-primary-600 text-white`:``}`),b(t,`aria-pressed`,ge())}),L(`click`,t,()=>Tp.set(!ge())),X(e,t)},ze=q(()=>!i()&&(!!a()||!!o())),Be=q(()=>o()?s()===`edges`?`edges`:`faces`:`vertices`),He=q(()=>c()&&l()?nI():0),Ue=q(()=>a()??o()??null),We=q(()=>!!Q(Ue)&&!!u()[Q(Ue)]);function Ge(e){let t=a()||o()||d()?.uuid;if(t&&e!==Q(Be)){if(Jie(),oae(),e===`vertices`){Fp(),gm(t);return}fm(),o()||zp(t),Pp(e===`edges`?`edges`:`faces`)}}let Ke=[{op:`move`,label:`Move`,hint:`G`,oneShot:!1,param:!1,icon:`move`,desc:`seat the gizmo on the selection and drag it`},{op:`extrude`,label:`Extrude`,hint:`E`,oneShot:!1,param:!1,icon:`extrude`,desc:`pull the face out along its normal`},{op:`inset`,label:`Inset`,hint:`I`,oneShot:!1,param:!1,icon:`inset`,desc:`shrink a copy inside a stitched ring`},{op:`knife`,label:`Knife`,hint:`K`,oneShot:!1,param:!1,icon:`knife`,de
2442sc:`cut across the mesh: click one end of the line, then the other`}],Je=[{op:`bevel`,label:`Bevel`,hint:``,oneShot:!0,param:!0,icon:`bevel`,desc:`chamfer the selected face's border`},{op:`loopcut`,label:`Loop cut`,hint:`C`,oneShot:!0,param:!0,icon:`loop-cut`,desc:`insert edge loops across the ring this face lies on`},{op:`bridge`,label:`Bridge`,hint:`B`,oneShot:!0,param:!0,icon:`bridge`,desc:`tunnel between two selected pieces`},{op:`subdivide`,label:`Subdivide`,hint:`S`,oneShot:!0,param:!0,icon:`subdivide`,desc:`split each quad into four, once per level`},{op:`duplicate`,label:`Duplicate`,hint:``,oneShot:!0,param:!1,icon:`duplicate-face`,desc:`copy the selected faces in place â coincident until you drag the gizmo`},{op:`flip`,label:`Flip normals`,hint:`F`,oneShot:!0,param:!1,icon:`flip-normals`,desc:`reverse the winding`},{op:`delete`,label:`Delete`,hint:`X`,oneShot:!0,param:!1,icon:`delete-face`,desc:`remove the selection`}],Ye=[{op:`edge-extrude`,label:`Extrude edges`,hint:``,oneShot:!0,param:!0,icon:`edge-extrude`,desc:``},{op:`smooth`,label:`Smooth`,hint:``,oneShot:!0,param:!0,icon:`smooth`,desc:``}],Xe=[...Ke,...Je,...Ye],Ze=[{value:`quad`,label:`Quad`,title:`Pick the quad under the cursor â the two triangles that form it (a 3-sided face picks alone)`},{value:`face`,label:`Face`,title:`Pick the whole coplanar face`},{value:`triangle`,label:`Tri`,title:`Pick the single triangle under the cursor`},{value:`shell`,label:`Shell`,title:`Pick the connected island under the cursor â on a one-piece mesh that IS the whole object`},{value:`object`,label:`Object`,title:`Pick every triangle, including islands that are not connected to each other`}],$e=[{id:`loop`,label:`Loop`,hint:`L`,run:Kie,desc:`the quad ring running through this face â press again for the perpendicular one`},{id:`grow`,label:`Grow`,hint:`Ctrl +`,run:mae,desc:`add the neighbouring ring`},{id:`shrink`,label:`Shrink`,hint:`Ctrl -`,run:Cae,desc:`drop the border ring`},{id:`all`,label:`All`,hint:`Ctrl A`,run:Yie,desc:`every face of the mesh`},{id:`invert`,label:`Invert`,hint:`Ctrl I`,run:xae,desc:`swap picked and unpicked`},{id:`linked`,label:`Linked`,hint:``,run:eae,desc:`the whole connected island this face belongs to`}],et=[{id:`eloop`,label:`Loop`,hint:`L`,run:Zie,desc:`the edge chain running end to end through this edge`},{id:`ering`,label:`Ring`,hint:``,run:Uie,desc:`the parallel rungs a face loop crosses â the other half of the standard pair`},{id:`eall`,label:`All`,hint:`Ctrl A`,run:qie,desc:`every edge of the mesh`},{id:`einvert`,label:`Invert`,hint:`Ctrl I`,run:uae,desc:`swap picked and unpicked`},{id:`enone`,label:`None`,hint:``,run:()=>(Qp(),!0),desc:`deselect everything`}],$=[{id:`vall`,label:`All`,hint:`Ctrl A`,run:Fae,desc:`every vertex of the mesh`},{id:`vinvert`,label:`Invert`,hint:`Ctrl I`,run:Rae,desc:`swap picked and unpicked`},{id:`vnone`,label:`None`,hint:``,run:()=>(hm(),!0),desc:`deselect everything`}],tt=q(()=>Q(Be)===`edges`?et:Q(Be)===`vertices`?$:$e);function nt(e){e.run()&&ut(e.id)}let rt=[{id:`normals`,label:`Recalculate normals`,icon:`recalc-normals`,run:()=>nae(),desc:`rewind every face to point outward`},{id:`merge`,label:`Merge by distance`,icon:`merge-distance`,run:()=>pae(m()),desc:`collapse near-coincident vertices and drop the degenerate faces`},{id:`triangulate`,label:`Triangulate`,icon:`triangulation`,run:()=>gae(),desc:`split every quad and n-gon back into its triangles (positions are untouched)`},{id:`quads`,label:`Tris to quads`,icon:`tris-to-quads`,run:()=>wae(),desc:`pair coplanar triangles back into quads (positions are untouched)`}];function it(){return!!(h().length||(_()===`face`?y():x())>=0)}let at=q(()=>(h(),l(),Qie())),ot=q(()=>{h(),l(),x(),y(),C(),_();let e=T();return Q(Be)===`vertices`?e===`bevel`&&!E()||e===`smooth`&&!E()?`Pick a vertex first (Ctrl+click adds)`:``:Q(Be)===`edges`?e===`bevel`&&!C().length?`Pick an edge first`:e===`edge-extrude`&&!C().length?`Pick a border edge first`:``:e===`extrude`||e===`inset`?it()?e===`extrude`&&!Bp()?`The selection is a closed surface â nothing to extrude from`:``:`Click a face first`:e===`bevel`?it()?Bp()?``:`The selection is a closed surface â no border to fold`:`Select a face with a border`:e===`loopcut`?Eae()?``:`Click a quad to choose the ring`:e===`subdivide`?it()?``:`Click a face first`:e===`bridge`?Q(at).pieces===2?Q(at).loops?Q(at).loops[0]===Q(at).loops[1]?``:`${Q(at).loops[0]} â ${Q(at).loops[1]} edges â the counts must match`:`Each piece needs one closed boundary`:`Select two separate pieces (Ctrl+click both)`:``}),st=q(()=>!!D()&&D().op===T()),ct=t(``),lt=0;function ut(e){I(ct,e,!0),clearTimeout(lt),lt=setTimeout(()=>I(ct,``),400)}function dt(e){let t=!1,n=(k()===`in`?-1:1)*Math.abs(ee());if(e===`extrude`||e===`inset`){if(!it())return es(`Click a face first`),!1;t=qp(e,e===`inset`?{distance:te(),depth:ne(),individual:P()}:{distance:te(),individual:re()})}else if(e===`bevel`)t=Q(Be)===`vertices`?Hae(ie(),n):Q(Be)===`edges`?qp(`bevel`,{width:ie(),segments:F(),profile:n},{kind:`edges`}):qp(`bevel`,{width:ie(),segments:F(),profile:ae(),direction:k()},{kind:`faces`});else if(e===`loopcut`)t=qp(`loopcut`,{cuts:oe(),position:R()});else if(e===`bridge`)t=qp(`bridge`,{cuts:se(),twist:ce(),invert:le()});else if(e===`subdivide`){if(!it())return es(`Click a face first`),!1;t=qp(`subdivide`,{levels:de()})}else e===`edge-extrude`?t=qp(`edge-extrude`,{distance:pe()}):e===`smooth`&&(t=Lae(me(),V()));return t&&ut(e),t}function ft(e){if(e===`duplicate`){Xie()&&ut(e);return}let t=Xe.find(t=>t.op===e);if(t?.param){dp(e),dt(e);return}if(t?.oneShot){if(!it()){es(`Click a face first`);return}Kp(e,te())&&ut(e);return}Hp(e)}function pt(){if(!it()){es(`Click a face first`);return}let e=he();e===`extrude`||e===`inset`?dt(e):Kp(e,te())}function mt(){dt(`bevel`)}function ht(){dt(`loopcut`)}function gt(){dt(`bridge`)}function _t(){dt(`subdivide`)}let vt=q(()=>!!o());function yt(e){if(!Q(vt)){es(`Switch to Edges or Faces to run whole-mesh tools`);return}e()}Qe(()=>{let e=he();K(()=>{Q(Be)!==`vertices`&&dp(wie(e)?e:``)})}),Qe(()=>{Q(Be),K(()=>dp(Cie(Q(Be),he())))}),Qe(()=>{Q(ze)||dp(``)}),Qe(()=>
2442{let e=ge();K(()=>{e?dp(`proportional`):U(cp)===`proportional`&&dp(``)})});function bt(){Bae()||es(`Select 3 or 4 vertices (Ctrl+click adds) to create a face`)}function xt(){Nae()||es(`Select 2+ vertices (Ctrl+click adds) to weld them`)}function St(){fm(),Fp(),ep()}let Ct=t(!1);Qe(()=>{Q(ze)||I(Ct,!1)});function wt(){if(!Mae()){es(`Nothing to revert â no edits yet this session`);return}I(Ct,!0)}function Tt(){I(Ct,!1),fae(),fm(),Fp(),ep(`discard`)}function Et(e){if(!Q(ze))return;if(e.key===`Escape`){if(Hie(e)||Iie(e)||Pie(e))return;c()||St();return}if(!_e())return;let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable))return;let n=Ol(e);if((e.ctrlKey||e.metaKey)&&!e.altKey){let t={"=":[`grow`],"+":[`grow`],"-":[`shrink`],_:[`shrink`],a:[`all`,`eall`,`vall`],i:[`invert`,`einvert`,`vinvert`]}[n],r=t&&Q(tt).find(e=>t.includes(e.id));if(!r)return;nt(r),e.preventDefault();return}if(!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key===`Tab`){let t=[`vertices`,`edges`,`faces`];Ge(t[(t.indexOf(Q(Be))+(e.shiftKey?-1:1)+t.length)%t.length]),e.preventDefault();return}if(!(e.ctrlKey||e.metaKey||e.altKey)){if(Q(Be)===`faces`){if(n===`l`){nt(Q(tt)[0]),e.preventDefault();return}if(n===`c`){ft(`loopcut`),e.preventDefault();return}if(n===`b`){ft(`bridge`),e.preventDefault();return}let t=e.key===`Delete`?`delete`:{e:`extrude`,i:`inset`,g:`move`,s:`subdivide`,f:`flip`,x:`delete`}[n];if(!t)return;ft(t),e.preventDefault()}else n===`w`&&(xt(),e.preventDefault())}}let Dt=t(!1);Qe(()=>{Q(ze)||I(Dt,!1)});let Ot=[{id:`any`,title:`Any mode`,rows:[[`Tab`,`Next element mode (Vertices - Edges - Faces)`],[`Shift Tab`,`Previous element mode`],[`1 / 2 / 3`,`Gizmo: Move / Rotate / Scale`],[`Ctrl A`,`Select all`],[`Ctrl I`,`Invert the selection`],[`Esc`,`Done â leave the session`]]},{id:`faces`,title:`Faces`,rows:[[`E / I / G`,`Arm Extrude / Inset / Move`],[`S / C`,`Subdivide / Loop cut`],[`B / F / X`,`Bridge / Flip normals / Delete`],[`L`,`Loop select (again = perpendicular)`],[`Ctrl + / -`,`Grow / shrink the selection`]]},{id:`edges`,title:`Edges`,rows:[[`L`,`Edge loop â the chain end to end`]]},{id:`vertices`,title:`Vertices`,rows:[[`W`,`Weld the selected vertices`]]}];var kt=fe();Z(`keydown`,p,Et);var At=N(kt),jt=e=>{var t=gQ(),n=N(t);{let e=e=>{var t=FJe(),n=N(t);fOe(j(n),{size:14,"aria-hidden":`true`}),H(n);var r=g(n,2),i=e=>{var t=NJe(),n=N(t);$R(j(n),{size:14,"aria-hidden":`true`}),H(n);var r=g(n,2),i=j(r);fS(i,{size:14,"aria-hidden":`true`}),H(r),L(`click`,n,()=>rI()),L(`click`,r,()=>iI()),X(e,t)},a=e=>{var t=PJe(),n=N(t),r=j(n);hS(r,{size:14,"aria-hidden":`true`}),H(n);var i=g(n,2),a=j(i);DS(a,{size:14,"aria-hidden":`true`}),H(i);var o=g(i,2),s=j(o);fS(s,{size:14,"aria-hidden":`true`}),H(o);var c=g(o,2);$R(j(c),{size:14,"aria-hidden":`true`}),H(c),O(()=>{n.disabled=!ve(),i.disabled=!ye()}),L(`click`,n,()=>Mf()),L(`click`,i,()=>jf()),L(`click`,o,wt),L(`click`,c,St),X(e,t)};G(r,e=>{c()?e(i):e(a,-1)}),O(()=>b(n,`aria-pressed`,Q(Dt))),L(`click`,n,()=>I(Dt,!Q(Dt))),X(e,t)},t=e=>{var t=IJe(),n=N(t),i=g(n,2),a=g(i,2);O(()=>{b(n,`aria-selected`,Q(Be)===`vertices`),r(n,1,`tbx-tab ${Q(Be)===`vertices`?`tbx-tab-on bg-primary-600 text-white`:``}`),b(i,`aria-selected`,Q(Be)===`edges`),r(i,1,`tbx-tab ${Q(Be)===`edges`?`tbx-tab-on bg-primary-600 text-white`:``}`),b(a,`aria-selected`,Q(Be)===`faces`),r(a,1,`tbx-tab ${Q(Be)===`faces`?`tbx-tab-on bg-primary-600 text-white`:``}`)}),L(`click`,n,()=>Ge(`vertices`)),L(`click`,i,()=>Ge(`edges`)),L(`click`,a,()=>Ge(`faces`)),X(e,t)},i=e=>{var t=gQ(),n=N(t),i=e=>{var t=LJe(),n=f(t);O(()=>Y(n,`${C().length??``} edge${C().length===1?``:`s`}`)),X(e,t)},a=e=>{var t=zJe(),n=j(t),i=g(n),a=e=>{var t=RJe(),n=f(t);O(()=>{r(t,1,M(Q(at).loops[0]===Q(at).loops[1]?``:`text-red-400`)),Y(n,`· ${Q(at).loops[0]??``} â ${Q(at).loops[1]??``} edges`)}),X(e,t)};G(i,e=>{Q(at).loops&&e(a)}),H(t),O(()=>Y(n,`${Q(at).faces??``} face${Q(at).faces===1?``:`s`} · ${Q(at).tris??``} tri${Q(at).tris===1?``:`s`}`)),X(e,t)},o=e=>{var t=BJe(),n=f(t);O(()=>Y(n,`${E()??``} sel`)),X(e,t)};G(n,e=>{Q(Be)===`edges`?e(i):Q(Be)===`faces`?e(a,1):e(o,-1)});var s=g(n,2),l=e=>{var t=VJe(),n=f(t);O(()=>Y(n,`${Q(He)??``} shell${Q(He)===1?``:`s`}`)),X(e,t)};G(s,e=>{c()&&e(l)}
2442),X(e,t)},a=q(()=>c()?`Edit Collider`:`Edit Mesh`);fQ(n,{id:`mesh-edit-popup`,key:`meshToolbox`,get title(){return Q(a)},width:212,minW:180,actions:e,tabs:t,status:i,children:(e,t)=>{var n=$Je(),i=N(n),a=e=>{var t=HJe(),n=g(j(t),2),r=g(n,2);H(t),L(`click`,n,Tt),L(`click`,r,()=>I(Ct,!1)),X(e,t)};G(i,e=>{Q(Ct)&&e(a)});var o=g(i,4),s=e=>{var t=UJe(),n=j(t);B(n,21,()=>Ze,e=>e.value,(e,t)=>{var n=_Q(),i=f(n,!0);O(()=>{b(n,`id`,`mesh-gran-${Q(t).value}`),r(n,1,`px-2 py-0.5 ${_()===Q(t).value?`bg-primary-600 text-white`:`bg-gray-700 hover:bg-gray-600`}`),b(n,`title`,Q(t).title),Y(i,Q(t).label)}),L(`click`,n,()=>Bie(Q(t).value)),X(e,n)}),H(n),H(t),X(e,t)};G(o,e=>{Q(Be)===`faces`&&e(s)});var l=g(o,2);B(l,21,()=>Q(tt),e=>e.id,(e,t)=>{var n=_Q();let i;var a=f(n,!0);O(()=>{b(n,`id`,`mesh-sel-${Q(t).id}`),i=r(n,1,`tbx-cmd`,null,i,{"tbx-flash":Q(ct)===Q(t).id}),b(n,`title`,Q(t).hint?`${Q(t).label} (${Q(t).hint}) â ${Q(t).desc}`:`${Q(t).label} â ${Q(t).desc}`),Y(a,Q(t).label)}),Z(`animationend`,n,()=>I(ct,``)),L(`click`,n,()=>nt(Q(t))),X(e,n)}),H(l);var u=g(l,2),d=e=>{var t=WJe(),n=g(N(t),2);mQ(j(n),{name:`move`}),H(n);var i=g(n,2);let a;mQ(j(i),{name:`bevel`}),H(i);var o=g(i,2);let s;mQ(j(o),{name:`edge-extrude`}),H(o);var c=g(o,2);let l;mQ(j(c),{name:`edge-subdivide`}),H(c);var u=g(c,2);let d;mQ(j(u),{name:`dissolve`}),H(u);var f=g(u,2);let p;mQ(j(f),{name:`delete-face`}),H(f);var m=g(f,2);Re(m),O(()=>{r(n,1,`tbx-btn ${he()===`move`?`tbx-on bg-primary-600 text-white`:``}`),a=r(i,1,`tbx-btn ${T()===`bevel`?`tbx-sel`:``}`,null,a,{"tbx-flash":Q(ct)===`bevel`}),b(i,`aria-pressed`,T()===`bevel`),s=r(o,1,`tbx-btn ${T()===`edge-extrude`?`tbx-sel`:``}`,null,s,{"tbx-flash":Q(ct)===`edge-extrude`}),b(o,`aria-pressed`,T()===`edge-extrude`),l=r(c,1,`tbx-btn`,null,l,{"tbx-flash":Q(ct)===`esubdivide`}),d=r(u,1,`tbx-btn tbx-danger`,null,d,{"tbx-flash":Q(ct)===`dissolve`}),p=r(f,1,`tbx-btn tbx-danger`,null,p,{"tbx-flash":Q(ct)===`edelete`})}),L(`click`,n,()=>Hp(`move`)),Z(`animationend`,i,()=>I(ct,``)),L(`click`,i,()=>ft(`bevel`)),Z(`animationend`,o,()=>I(ct,``)),L(`click`,o,()=>ft(`edge-extrude`)),Z(`animationend`,c,()=>I(ct,``)),L(`click`,c,()=>{sae()&&ut(`esubdivide`)}),Z(`animationend`,u,()=>I(ct,``)),L(`click`,u,()=>{Vie()&&ut(`dissolve`)}),Z(`animationend`,f,()=>I(ct,``)),L(`click`,f,()=>{Oae()&&ut(`edelete`)}),X(e,t)},p=e=>{var t=GJe(),n=g(N(t),2);Le(n,()=>Ke);var r=g(n,2);Re(r);var i=g(r,4);Le(i,()=>Je),X(e,t)},h=e=>{var t=KJe(),n=g(N(t),2);mQ(j(n),{name:`weld`}),H(n);var i=g(n,2);mQ(j(i),{name:`create-face`}),H(i);var a=g(i,2);let o;mQ(j(a),{name:`bevel`}),H(a);var s=g(a,2);let c;mQ(j(s),{name:`smooth`}),H(s);var l=g(s,2);Re(l);var u=g(l,2);mQ(j(u),{name:`vertex-slide`}),H(u);var d=g(u,2);let f;mQ(j(d),{name:`delete-face`}),H(d),O(()=>{r(n,1,`tbx-btn ${E()>=2?`tbx-on bg-primary-600 text-white`:`tbx-disabled`}`),r(i,1,`tbx-btn ${E()>=3&&E()<=4?`tbx-on bg-primary-600 text-white`:`tbx-disabled`}`),o=r(a,1,`tbx-btn ${T()===`bevel`?`tbx-sel`:``}`,null,o,{"tbx-flash":Q(ct)===`bevel`}),b(a,`aria-pressed`,T()===`bevel`),c=r(s,1,`tbx-btn ${T()===`smooth`?`tbx-sel`:``}`,null,c,{"tbx-flash":Q(ct)===`smooth`}),b(s,`aria-pressed`,T()===`smooth`),r(u,1,`tbx-btn ${be()?`tbx-on bg-primary-600 text-white`:``} ${E()===1?``:`tbx-disabled`}`),b(u,`aria-pressed`,be()),f=r(d,1,`tbx-btn tbx-danger ${E()>=1?``:`tbx-disabled`}`,null,f,{"tbx-flash":Q(ct)===`vdelete`})}),L(`click`,n,xt),L(`click`,i,bt),Z(`animationend`,a,()=>I(ct,``)),L(`click`,a,()=>ft(`bevel`)),Z(`animationend`,s,()=>I(ct,``)),L(`click`,s,()=>ft(`smooth`)),L(`click`,u,()=>{let e=!be();pm.set(e),e?dp(`slide`):U(cp)===`slide`&&dp(``)}),Z(`animationend`,d,()=>I(ct,``)),L(`click`,d,()=>{Iae()&&ut(`vdelete`)}),X(e,t)};G(u,e=>{Q(Be)===`edges`?e(d):Q(Be)===`faces`?e(p,1):e(h,-1)});var y=g(u,2);TJe(y,{get mode(){return Q(Be)},get focus(){return T()},get hint(){return Q(ot)},get adjusting(){return Q(st)},onApplyOp:pt,onApplyBevel:mt,onApplyLoopCut:ht,onApplyBridge:gt,onApplySubdivide:_t,onApplyEdgeExtrude:()=>dt(`edge-extrude`),onApplySmooth:()=>dt(`smooth`),onAdjust:e=>kae(e),onSettle:()=>aae(),onRevert:()=>vae()});var x=g(y,2);dQ(x,{key:`gizmo`,label:`Gizmo & pivot`,open:!0,id:`mesh-sec-gizmo`,children:(e,t)=>{var n=qJe(),i=N(n),a=j(i);mQ(j(a),{name:`gizmo`}),H(a);var o=g(a,2),s=j(o),c=g(s,2);H(o),H(i);var l=g(i,2),u=j(l),d=j(u);v(d),W(),H(u);var p=g(u,2);{let e=q(()=>!we());hq(p,{id:`mesh-snap-translate`,label:`step`,get value(){return Te().translate}
2442,step:.005,snap:.1,decimals:2,min:.01,get disabled(){return Q(e)},title:`Translate drags land on multiples of this (world units)`,onchange:e=>_c.update(t=>({...t,translate:e||t.translate}))})}var m=g(p,2);{let e=q(()=>!we());hq(m,{id:`mesh-snap-rotate`,label:`angle`,get value(){return Te().rotateDeg},step:.2,snap:5,decimals:1,min:.1,get disabled(){return Q(e)},title:`Rotate drags land on multiples of this (degrees)`,onchange:e=>_c.update(t=>({...t,rotateDeg:e||t.rotateDeg}))})}H(l);var h=g(l,6),_=j(h),y=g(_,2),x=f(y,!0),S=g(y,2),C=f(S,!0),T=g(S,2);H(h);var E=g(h,2),D=f(E,!0);O(()=>{r(a,1,`tbx-btn ${xe()?`tbx-on bg-primary-600 text-white`:``}`),b(a,`aria-pressed`,xe()),b(a,`title`,xe()?`Gizmo ON â click to hide it and select/operate without handles in the way`:`Gizmo OFF â click to show it again (vertices, edges and faces)`),r(s,1,`px-2 py-0.5 ${Se()===`local`?`bg-primary-600 text-white`:`bg-gray-700 hover:bg-gray-600`}`),s.disabled=!xe(),r(c,1,`px-2 py-0.5 ${Se()===`world`?`bg-primary-600 text-white`:`bg-gray-700 hover:bg-gray-600`}`),c.disabled=!xe(),w(d,we()),r(y,1,`tbx-cmd ${Ee()?`tbx-on bg-primary-600 text-white`:``}`),b(y,`aria-pressed`,Ee()),Y(x,Ee()?`Pickingâ¦`:`Pickâ¦`),r(S,1,`tbx-cmd ${J()?`tbx-on bg-primary-600 text-white`:``}`),b(S,`aria-pressed`,J()),Y(C,J()?`Movingâ¦`:`Move`),T.disabled=!Q(We),Y(D,J()?`Drag the gizmo to place the pivot â the mesh stays put.`:Q(We)?`Rotate and scale turn about the placed pivot.`:`Rotate and scale turn about the selection centre.`)}),L(`click`,a,()=>Zp.set(!xe())),L(`click`,s,()=>Wp.set(`local`)),L(`click`,c,()=>Wp.set(`world`)),L(`change`,d,e=>gc.set(e.currentTarget.checked)),L(`click`,_,()=>Oie(Q(Be))),L(`click`,y,()=>Ee()?Nie():Rie()),L(`click`,S,()=>Lie()),L(`click`,T,()=>Fie(Q(Ue))),X(e,n)},$$slots:{default:!0}});var C=g(x,2);dQ(C,{key:`cleanup`,label:`Cleanup`,id:`mesh-sec-cleanup`,children:(e,t)=>{var n=JJe(),i=N(n);B(i,17,()=>rt,e=>e.id,(e,t)=>{var n=hQ();let i;mQ(j(n),{get name(){return Q(t).icon}}),H(n),O(()=>{b(n,`id`,`mesh-fix-${Q(t).id}`),i=r(n,1,`tbx-btn ${Q(vt)?``:`tbx-disabled`}`,null,i,{"tbx-flash":Q(ct)===Q(t).id}),b(n,`aria-label`,Q(t).label),b(n,`title`,`${Q(t).label} â ${Q(t).desc}`)}),Z(`animationend`,n,()=>I(ct,``)),L(`click`,n,()=>yt(()=>nt(Q(t)))),X(e,n)});var a=g(i,2);mQ(j(a),{name:`shading`}),H(a);var o=g(a,2);hq(j(o),{id:`mesh-merge-dist`,label:`merge dist`,get value(){return m()},unit:`length`,step:5e-4,snap:.01,decimals:4,min:1e-4,max:1,title:`Vertices closer than this merge into one`,onchange:e=>Sp.set(e)}),H(o),O((e,t)=>
2442{r(a,1,`tbx-btn ${Q(vt)?``:`tbx-disabled`}`),b(a,`aria-pressed`,e),b(a,`title`,t)},[()=>Np()===`smooth`,()=>Np()===`smooth`?`Smooth shading â click for flat`:`Flat shading â click for smooth`]),L(`click`,a,()=>yt(()=>{rae(Np()!==`smooth`),ut(`shading`)})),X(e,n)},$$slots:{default:!0}});var D=g(C,2);dQ(D,{key:`symmetry`,label:`Symmetry`,id:`mesh-sec-symmetry`,children:(e,t)=>{var n=YJe(),i=g(j(n),2);B(i,20,()=>[`x`,`y`,`z`],e=>e,(e,t)=>{var n=_Q(),i=f(n,!0);O((e,a)=>{b(n,`id`,`mesh-sym-${t}`),r(n,1,`px-2 py-0.5 ${De()===t?`bg-primary-600 text-white`:`bg-gray-700 hover:bg-gray-600`}`),b(n,`title`,e),Y(i,a)},[()=>`Mirror across the ${t.toUpperCase()} plane`,()=>t.toUpperCase()]),L(`click`,n,()=>ap.set(t)),X(e,n)}),H(i);var a=g(i,2),o=f(a,!0),s=g(a,2);H(n),O(()=>Y(o,Oe()>0?`keep +`:`keep -`)),L(`click`,a,()=>rp.set(-Oe())),L(`click`,s,()=>yt(()=>{$ie(De(),Oe())&&ut(`symmetrize`)})),X(e,n)},$$slots:{default:!0}});var k=g(D,2);dQ(k,{key:`display`,label:`Display`,open:!0,id:`mesh-sec-display`,children:(e,t)=>{var n=ZJe(),r=N(n);mQ(j(r),{name:`wireframe`}),H(r);var i=g(r,2);mQ(j(i),{name:`outline`}),H(i);var a=g(i,2);mQ(j(a),{name:`triangulation`}),H(a);var o=g(a,2);oz(j(o),{size:18,"aria-hidden":`true`}),H(o);var s=g(o,2),c=e=>{var t=XJe(),n=j(t),r=g(j(n));v(r);var i=g(r,2),a=f(i);H(n);var o=g(n,2),s=f(o,!0);H(t),O(e=>{Y(a,`${e??``}x`),b(o,`aria-pressed`,Pe()),b(o,`title`,Pe()?`Adaptive: the dots keep a constant SCREEN size as you zoom (what modelling tools do). Click for a fixed world size.`:`Fixed world size: the dots grow as you zoom in and shrink away as you zoom out. Click for adaptive.`),Y(s,Pe()?`adaptive`:`fixed`)},[()=>Ne().toFixed(1)]),S(r,Ne,e=>ke(dm,e)),L(`click`,o,()=>_m.set(!Pe())),X(e,t)};G(s,e=>{Q(Be)===`vertices`&&e(c)}),O(()=>{b(r,`aria-pressed`,Ae()),b(i,`aria-pressed`,je()),b(i,`title`,je()?`Selection outline ON â it draws over vertices and edges`:`Selection outline OFF while editing (clearer handles)`),b(a,`aria-pressed`,Me()),b(a,`title`,Me()?`Showing triangulation â every triangle edge, diagonals included`:`Showing quads â the diagonals are hidden (they cannot be picked)`),b(o,`aria-pressed`,_e()),b(o,`title`,_e()?`Keyboard shortcuts ON â E/I/G/S/B/F/X, W (camera fly keys pause)`:`Keyboard shortcuts OFF â W/A/S/D fly the camera again`)}),L(`click`,r,()=>$p.update(e=>!e)),L(`click`,i,()=>im.update(e=>!e)),L(`click`,a,()=>nm.update(e=>!e)),L(`click`,o,()=>Xp.update(e=>!e)),X(e,n)},$$slots:{default:!0}});var A=g(k,2),ee=e=>{dQ(e,{key:`collider`,label:`Collider`,forceOpen:!0,id:`mesh-sec-collider`,children:(e,t)=>{var n=QJe(),r=N(n),i=j(r);sS(i,{size:18,"aria-hidden":`true`}),H(r);var a=g(r,2),o=j(a);qx(o,{size:18,"aria-hidden":`true`}),H(a),L(`click`,r,()=>tI(`box`)),L(`click`,a,()=>tI(`sphere`)),X(e,n)},$$slots:{default:!0}})};G(A,e=>{c()&&e(ee)}),X(e,n)},$$slots:{actions:!0,tabs:!0,status:!0,default:!0}})}var i=g(n,2),a=e=>{fQ(e,{id:`mesh-keys-popover`,key:`meshKeysCheatsheet`,title:`Mesh edit keys`,width:260,minW:200,defaultRect:{left:12,top:320},actions:e=>{var t=eYe(),n=j(t);fS(n,{size:14,"aria-hidden":`true`}),H(t),L(`click`,t,()=>I(Dt,!1)),X(e,t)},children:(e,t)=>{var n=iYe();B(n,21,()=>Ot,e=>e.id,(e,t)=>{var n=rYe(),i=N(n),a=j(i),o=g(a),s=e=>{var t=tYe();X(e,t)};G(o,e=>{Q(t).id===Q(Be)&&e(s)}),H(i);var c=g(i,2);B(c,17,()=>Q(t).rows,([e,t])=>e,(e,t)=>{var n=q(()=>A(Q(t),2));let r=()=>Q(n)[0],i=()=>Q(n)[1];var a=nYe(),o=j(a),s=f(o,!0),c=g(o,2),l=f(c,!0);H(a),O(()=>{Y(s,r()),Y(l,i())}),X(e,a)}),O(()=>{r(i,1,`mt-1.5 mb-0.5 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider first:mt-0 ${Q(t).id===Q(Be)?`text-primary-300`:`text-gray-500`}`),Y(a,`${Q(t).title??``} `)}),X(e,n)}),H(n),X(e,n)},$$slots:{actions:!0,default:!0}})};G(i,e=>{Q(Dt)&&e(a)}),X(e,t)};G(At,e=>{Q(ze)&&e(jt)}),X(e,kt),ue(),Ie()}ge([`click`,`change`]);var oYe=V(`<div class="pointer-events-none fixed border border-primary-400 bg-primary-500/10"></div>`);function sYe(e,t){Ce(t,!1);let n=()=>z(mi,`$marqueeRect`,r),[r,i]=Ve();R();var a=fe(),o=N(a),s=e=>{var t=oYe();O(()=>Ze(t,`left: ${n().x0??``}px; top: ${n().y0??``}px; 2443 width: ${n().x1-n().x0}px; height: ${n().y1-n().y0}px; 2444 z-index: var(--z-hud)`)),X(e,t)};G(o,e=>{n()&&e(s)}),X(e,a),ue(),i()}function vQ(e,t={}){let{exclude:n=`input`,onMove:r}=t,i=!1,a=t=>{t.button!==2||t.target.closest(n)||(i=!0,e.setPointerCapture?.(t.pointerId),t.preventDefault())},o=t=>{if(!i)return;if(r){r(t.movementX,t.movementY);return}let n=e.getBoundingClientRect(),a=Math.max(8,window.innerWidth-n.width-8),o=Math.max(8,window.innerHeight-n.height-8);e.style.left=Math.max(8,Math.min(n.left+t.movementX,a))+`px`,e.style.top=Math.max(8,Math.min(n.top+t.movementY,o))+`px`},s=t=>{i&&(i=!1,e.releasePointerCapture?.(t.pointerId))},c=e=>{e.target.closest(n)||e.preventDefault()};return e.addEventListener(`pointerdown`,a),e.addEventListener(`pointermove`,o),e.addEventListener(`pointerup`,s),e.addEventListener(`contextmenu`,c),{destroy(){e.removeEventListener(`pointerdown`,a),e.removeEventListener(`pointermove`,o),e.removeEventListener(`pointerup`,s),e.removeEventListener(`contextmenu`,c)}}}function yQ(e){let t=null,n=()=>{t?.remove(),t=null,window.removeEventListener(`pointerdown`,r,!0)},r=e=>{t&&!t.contains(e.target)&&n()},i=i=>{i.preventDefault(),i.stopPropagation(),n(),t=document.createElement(`div`),t.id=`input-context-menu`,t.className=`fixed z-1001 flex overflow-hidden rounded-lg border border-gray-600 bg-gray-800 text-xs text-gray-200 shadow-xl`,t.style.left=i.clientX+`px`,t.style.top=i.clientY+`px`;let a=(e,r)=>{let i=document.createElement(`button`);return i.textContent=e,i.className=`px-2.5 py-1 hover:bg-gray-600`,i.addEventListener(`click`,async()=>{await r(),n()}),t.appendChild(i),i};a(`Copy`,async()=>{let t=e.value.slice(e.selectionStart??0,e.selectionEnd??0);try{await navigator.clipboard.writeText(t||e.value)}catch{}});let o=a(`Paste`,async()=>{try{let t=await navigator.clipboard.readText(),n=e.selectionStart??e.value.length,r=e.selectionEnd??n;e.value=e.value.slice(0,n)+t+e.value.slice(r),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus()}catch{o.remove()}});a(`Clear`,()=>{e.value=``,e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus()}),document.body.appendChild(t),setTimeout(()=>window.addEventListener(`pointerdown`,r,!0),0)};return e.addEventListener(`contextmenu`,i),{destroy(){e.removeEventListener(`contextmenu`,i),n()}}}var cYe=V(`<button><span class="text-[10px] uppercase tracking-wider text-gray-400"> </span> <span> </span></button>`),lYe=V(`<p class="px-2 py-1 italic text-gray-400"> </p>`),uYe=V(`<div class="fixed inset-0" style="z-index: 999" role="presentation"></div>
2444 <div id="add-search-box" class="fixed w-64 rounded-lg border border-gray-600 bg-gray-800 p-1.5 text-xs text-gray-200 shadow-xl"><input id="add-search-input" type="text" class="ui-input w-full" placeholder="Search objectsâ¦"/> <div class="mt-1 max-h-64 overflow-y-auto"><!> <!></div></div>`,1);function dYe(e,n){Ce(n,!0);let i=()=>z(tc,`$addMenu`,a),[a,o]=Ve(),s=t(``),c=t(0),l=t(null),d=t(null),m=t(Ne({left:0,top:0})),h=!1;function _(e,t){let n=Q(d)?.offsetWidth||256,r=Q(d)?.offsetHeight||320;return{left:Math.max(8,Math.min(e,Math.max(8,window.innerWidth-n-8))),top:Math.max(8,Math.min(t,Math.max(8,window.innerHeight-r-8)))}}function y(){let e=i();if(!e||!Q(d))return;if(h){I(m,_(Q(m).left,Q(m).top),!0);return}let t=Q(d).offsetWidth||256,n=Q(d).offsetHeight||320,r=e.x+8;r+t>window.innerWidth-8&&(r=e.x-t-8);let a=e.y+8;a+n>window.innerHeight-8&&(a=e.y-n-8),I(m,_(r,a),!0)}function x(e,t){h=!0,I(m,_(Q(m).left+e,Q(m).top+t),!0)}Qe(()=>{let e=!!i(),t=Q(d);if(!e||!t)return;K(()=>y());let n=new ResizeObserver(()=>K(()=>y()));return n.observe(t),()=>n.disconnect()});function S(){tc.set(null),I(s,``),I(c,0),h=!1}function C(e){lQ(e,i()?.point??null),S()}Qe(()=>{i()&&setTimeout(()=>Q(l)?.focus(),0)});let w=oQ.flatMap(e=>e.items.map(t=>({...t,group:e.group}))),T=q(()=>{let e=Q(s).trim().toLowerCase();if(!e)return w;let t=w.filter(t=>t.label.toLowerCase().startsWith(e)),n=w.filter(t=>!t.label.toLowerCase().startsWith(e)&&t.label.toLowerCase().includes(e));return[...t,...n]});function E(e){e.key===`Escape`?(e.stopPropagation(),S()):e.key===`Enter`&&Q(T)[Q(c)]?C(Q(T)[Q(c)].command):e.key===`ArrowDown`?(e.preventDefault(),I(c,Math.min(Q(c)+1,Q(T).length-1),!0),D()):e.key===`ArrowUp`&&(e.preventDefault(),I(c,Math.max(Q(c)-1,0),!0),D())}function D(){requestAnimationFrame(()=>document.querySelector(`#add-search-box [data-selected="true"]`)?.scrollIntoView({block:`nearest`}))}var k=fe();Z(`resize`,p,y);var A=N(k),ee=e=>{var t=uYe(),n=N(t),i=g(n,2),a=j(i);v(a),We(a,e=>I(l,e),()=>Q(l)),ne(a,e=>yQ?.(e));var o=g(a,2),p=j(o);B(p,19,()=>Q(T),e=>e.command,(e,t,n)=>{var i=cYe(),a=j(i),o=f(a,!0),s=g(a,2),l=f(s,!0);H(i),O(()=>{r(i,1,`flex w-full items-baseline gap-2 rounded-sm px-2 py-1 text-left `+(Q(n)===Q(c)?`bg-primary-700 text-white`:`hover:bg-gray-700`)),b(i,`data-selected`,Q(n)===Q(c)),Y(o,Q(t).group),Y(l,Q(t).label)}),Z(`mouseenter`,i,()=>I(c,Q(n),!0)),L(`click`,i,()=>C(Q(t).command)),X(e,i)});var h=g(p,2),_=e=>{var t=lYe(),n=f(t);O(()=>Y(n,`No matches for â${Q(s)??``}â`)),X(e,t)};G(h,e=>{Q(T).length||e(_)}),H(o),H(i),We(i,e=>I(d,e),()=>Q(d)),ne(i,(e,t)=>vQ?.(e,t),()=>({onMove:x})),O(()=>{Ze(i,`left: ${Q(m).left??``}px; top: ${Q(m).top??``}px; z-index: 1000;`),u(a,Q(s))}),L(`click`,n,S),L(`contextmenu`,n,e=>{e.preventDefault(),S()}),L(`input`,a,e=>{I(s,e.currentTarget.value,!0),I(c,0)}),L(`keydown`,a,E),X(e,t)};G(A,e=>{i()&&e(ee)}),X(e,k),ue(),o()}ge([`click`,`contextmenu`,`input`,`keydown`]);var fYe=V(`<span class="text-[9px] text-red-300"> </span>`),pYe=V(`<button><span class="text-gray-400"> </span> <span> </span> <!></button>`),mYe=V(`<p class="px-2 py-1 italic text-gray-400"> </p>`),hYe=V(`<div class="fixed inset-0" style="z-index: 999" role="presentation"></div> <div id="object-search-box" class="fixed w-64 rounded-lg border border-gray-600 bg-gray-800 p-1.5 text-xs text-gray-200 shadow-xl"><input id="object-search-input" type="text" class="ui-input w-full" placeholder="Search scene objectsâ¦"/> <div class="mt-1 max-h-64 overflow-y-auto"><!> <!></div></div>`,1);function gYe(e,n){Ce(n,!0);let i=()=>z(ws,`$objectSearch`,s),a=()=>z(Ui,`$objectsGroup`,s),o=()=>z(Ci,`$lockedObjects`,s),[s,c]=Ve(),l=t(``),d=t(0),p=t(null);function m(){ws.set(null),I(l,``),I(d,0)}function h(e){Em(e.uuid),Sm(e.uuid),m()}Qe(()=>{i()&&setTimeout(()=>Q(p)?.focus(),0)});let _={Mesh:`â£`,Group:`â§`,Line:`â`};function y(e){return e.type?.endsWith(`Light`)?`â`:_[e.type]??`âª`}let x=q(()=>{let e=a()?.children??[],t=Q(l).trim().toLowerCase(),n=e.map(e=>({child:e,label:e.name||e.type,lock:o().find(t=>t[1]===e.uuid)?.[0]??null}));return t?n.filter(e=>e.label.toLowerCase().includes(t)):n});function S(e){e.key===`Escape`?(e.stopPropagation(),m()):e.key===`Enter`&&Q(x)[Q(d)]?h(Q(x)[Q(d)].child):e.key===`ArrowDown`?
2444(e.preventDefault(),I(d,Math.min(Q(d)+1,Q(x).length-1),!0)):e.key===`ArrowUp`&&(e.preventDefault(),I(d,Math.max(Q(d)-1,0),!0))}var C=fe(),w=N(C),T=e=>{var t=hYe(),n=N(t),a=g(n,2),o=j(a);v(o),We(o,e=>I(p,e),()=>Q(p)),ne(o,e=>yQ?.(e));var s=g(o,2),c=j(s);B(c,19,()=>Q(x),e=>e.child.uuid,(e,t,n)=>{var i=pYe(),a=j(i),o=f(a,!0),s=g(a,2),c=f(s,!0),l=g(s,2),u=e=>{var n=fYe(),r=f(n,!0);O(e=>Y(r,e),[()=>hh(Q(t).lock)]),X(e,n)};G(l,e=>{Q(t).lock&&e(u)}),H(i),O(e=>{r(i,1,`flex w-full items-baseline gap-2 rounded-sm px-2 py-1 text-left `+(Q(n)===Q(d)?`bg-primary-700 text-white`:`hover:bg-gray-700`)),b(i,`data-selected`,Q(n)===Q(d)),Y(o,e),r(s,1,`flex-1 truncate ${Q(t).lock?`text-red-300`:``}`),Y(c,Q(t).label)},[()=>y(Q(t).child)]),Z(`mouseenter`,i,()=>I(d,Q(n),!0)),L(`click`,i,()=>h(Q(t).child)),X(e,i)});var _=g(c,2),C=e=>{var t=mYe(),n=f(t);O(()=>Y(n,`No objects match â${Q(l)??``}â`)),X(e,t)};G(_,e=>{Q(x).length||e(C)}),H(s),H(a),ne(a,e=>vQ?.(e)),O((e,t)=>{Ze(a,`left: ${e??``}px; top: ${t??``}px; z-index: 1000;`),u(o,Q(l))},[()=>Math.min(i().x,window.innerWidth-270),()=>Math.min(i().y,window.innerHeight-320)]),L(`click`,n,m),L(`contextmenu`,n,e=>{e.preventDefault(),m()}),L(`input`,o,e=>{I(l,e.currentTarget.value,!0),I(d,0)}),L(`keydown`,o,S),X(e,t)};G(w,e=>{i()&&e(T)}),X(e,C),ue(),c()}ge([`click`,`contextmenu`,`input`,`keydown`]);var _Ye=V(`<button role="tab" title="Click to switch â drag out to detach â right-click to hide"> </button>`),vYe=V(`<div class="tab-strip fixed flex items-end gap-0.5 overflow-hidden rounded-t-lg border-b border-gray-700/60 bg-gray-900 px-1.5 pt-1" role="tablist" tabindex="-1"><!> <span class="flex-1"></span> <button class="ui-button-quiet mb-1 shrink-0" title="Close all tabs in this window">â</button></div>`),yYe=V(`<!> <!>`,1);function bYe(e,t){Ce(t,!1);let n=()=>z(Qh,`$tabGroups`,a),i=()=>z(Xse,`$focusTick`,a),[a,o]=Ve();function s(e){let t=eg(e.active),n=t?parseInt(t.style.zIndex):NaN;return Number.isFinite(n)?n:44}let c=F(null),l=null,u=null;function d(e,t){e.target.closest(`.tab-note, button`)||(qh(eg(t.active)),l={groupId:t.id,x:e.clientX,y:e.clientY},e.preventDefault())}function m(e,t,n){qh(eg(n)),u={groupId:t,key:n,x:e.clientX,y:e.clientY,torn:!1}}function h(e){if(l&&=(ece(l.groupId,e.clientX-l.x,e.clientY-l.y),{...l,x:e.clientX,y:e.clientY}),u&&!u.torn)(Math.abs(e.clientY-u.y)>26||Math.abs(e.clientX-u.x)>120)&&(rg(u.key,e.clientX,e.clientY),u={...u,torn:!0});else if(u?.torn){let t=eg(u.key);t&&(t.style.left=Math.max(0,e.clientX-100)+`px`,t.style.top=Math.max(0,e.clientY-12)+`px`)}}function _(e){u&&!u.torn&&Math.hypot(e.clientX-u.x,e.clientY-u.y)<6&&tce(u.groupId,u.key),l=null,u=null}R();var v=yYe();Z(`pointermove`,p,h),Z(`pointerup`,p,_);var y=N(v);B(y,1,n,e=>e.id,(e,t)=>{var n=vYe(),a=j(n);B(a,1,()=>Q(t).members,e=>e,(e,n)=>{var i=_Ye(),a=f(i,!0);O(e=>{r(i,1,`tab-note relative px-4 pb-1 pt-0.5 text-xs `+(Q(n)===Q(t).active?`bg-gray-800 text-gray-100`:`bg-gray-700/70 text-gray-400 hover:text-gray-200`),`svelte-1ykoql4`),b(i,`aria-selected`,Q(n)===Q(t).active),Y(a,e)},[()=>tg(Q(n))]),L(`pointerdown`,i,e=>
2444{e.stopPropagation(),m(e,Q(t).id,Q(n))}),L(`contextmenu`,i,e=>{e.preventDefault(),e.stopPropagation(),I(c,{x:e.clientX,y:e.clientY,key:Q(n)})}),X(e,i)});var o=g(a,4);H(n),O(e=>Ze(n,`left: ${Q(t).rect.left??``}px; top: ${Q(t).rect.top??``}px; width: ${Q(t).rect.width??``}px; height: 34px; z-index: ${e??``}; cursor: move`),[()=>[i(),s(Q(t))][1]]),L(`pointerdown`,n,e=>d(e,Q(t))),L(`click`,o,()=>ng(Q(t).active)),X(e,n)});var x=g(y,2),S=e=>{xS(e,{get x(){return Q(c).x},get y(){return Q(c).y},items:[{label:`Hide tab`,action:()=>ig(Q(c).key)}],$$events:{close:()=>I(c,null)}})};G(x,e=>{Q(c)&&e(S)}),X(e,v),ue(),o()}ge([`pointerdown`,`contextmenu`,`click`]);var xYe=V(`<audio autoplay=""></audio>`),SYe=V(`<!> <button id="mic-button"><!></button>`,1);function CYe(e,t){Ce(t,!1);let n=()=>z(Tce,`$remoteStreams`,c),i=()=>z(yg,`$mutedPeers`,c),a=()=>z(bg,`$spatialVoice`,c),o=()=>z(xg,`$micActive`,c),s=()=>z(kce,`$pttActive`,c),[c,l]=Ve();function u(e,t){let n=t=>{e.srcObject!==t.stream&&(e.srcObject=t.stream),e.muted=t.muted,e.volume=+!t.spatial};return n(t),{update:n}}R();var d=SYe(),f=N(d);B(f,1,()=>Object.entries(n()),([e,t])=>e,(e,t)=>{var n=q(()=>A(Q(t),2));let r=()=>Q(n)[0],o=()=>Q(n)[1];var s=xYe();ne(s,(e,t)=>u?.(e,t),()=>({stream:o(),muted:i().includes(r()),spatial:a()})),X(e,s)});var p=g(f,2),m=j(p),h=e=>{vke(e,{size:18,class:`text-white`,"aria-hidden":`true`})},_=e=>{gke(e,{size:18,class:`text-white`,"aria-hidden":`true`})};G(m,e=>{o()||s()?e(h):e(_,-1)}),H(p),O(()=>{r(p,1,`fixed bottom-16 right-4 z-30 flex h-11 w-11 items-center justify-center rounded-full shadow-lg transition-colors 2445 ${o()||s()?`bg-green-600 hover:bg-green-700`:`bg-gray-700 hover:bg-gray-600`}`),b(p,`title`,o()?`Microphone on â click to mute`:`Microphone off â click to talk, or hold V for push-to-talk`)}),Z(`click`,p,function(...e){Ace?.apply(this,e)}),X(e,d),ue(),l()}var wYe=V(`<button class="note-icon svelte-c0s8uu" title="Edit note" aria-label="Edit note"><!></button>`),TYe=V(`<button></button>`),EYe=V(`<button><!> <span> </span></button>`),DYe=V(`<option></option>`),OYe=V(`<button class="note-icon svelte-c0s8uu" title="Forget the saved view" aria-label="Clear the saved camera view"><!></button>`),kYe=V(`<button class="note-danger svelte-c0s8uu" title="Delete note" aria-label="Delete note"><!> Delete</button>`),AYe=V(`<div class="note-body svelte-c0s8uu"><input class="ui-input w-full" placeholder="Name (optional)"/> <textarea class="ui-input h-20 w-full resize-none" placeholder="Description⦠(Enter saves, Shift+Enter for a new line)"></textarea> <span class="note-caption svelte-c0s8uu">Pin color</span> <div class="note-swatches svelte-c0s8uu" role="group" aria-label="Pin color"></div> <span class="note-caption svelte-c0s8uu">Pin shape â VR only</span> <div class="note-shapes svelte-c0s8uu" role="group" aria-label="Pin shape"></div> <span class="note-caption svelte-c0s8uu">Label â groups notes in the drawer</span> <input class="ui-input w-full" list="note-labels" placeholder="e.g. mechanics"/> <datalist id="note-labels"></datalist> <span class="note-caption svelte-c0s8uu">Camera</span> <div class="note-camera svelte-c0s8uu"><button class="note-flat svelte-c0s8uu" title="Store the current view with this note"><!> </button> <!></div> <label class="note-check svelte-c0s8uu"><input type="checkbox" class="note-switch svelte-c0s8uu"/> <span>Follow the pin when opened</span></label></div> <div class="note-actions svelte-c0s8uu"><!> <span class="flex-1"></span> <button class="ui-button-quiet">Cancel</button> <button class="note-primary svelte-c0s8uu"><!> Save</button></div>`,1),jYe=V(`<p class="note-desc svelte-c0s8uu"> </p>`),MYe=V(`<p class="note-desc note-muted svelte-c0s8uu">No description</p>`),NYe=V(`<span class="note-chip svelte-c0s8uu"> </span>`),PYe=V(`<!> Following`,1),FYe=V(`<!> Follow`,1),IYe=V(`<div class="note-body svelte-c0s8uu"><!> <div class="note-meta svelte-c0s8uu"><!> <span class="note-dot svelte-c0s8uu"></span> <span class="truncate"> </span></div></div> <div class="note-actions svelte-c0s8uu"><button class="note-danger svelte-c0s8uu" title="Delete note" aria-label="Delete note"><!> Delete</button> <span class="flex-1"></span> <button><!></button> <button class="note-primary svelte-c0s8uu"><!> Edit</button></div>`,1),LYe=V(`<div role="dialog" tabindex="-1"><div class="note-head svelte-c0s8uu"><span class="note-num svelte-c0s8uu"> </span> <span class="note-title svelte-c0s8uu"> </span> <!> <button class="note-icon svelte-c0s8uu" title="Close" aria-label="Close note"><!></button></div> <!></div>`);function RYe(e,n){Ce(n,!0);let i=()=>z(By,`$activeAnnotation`,u),a=()=>z(Uy,`$annotations`,u),o=()=>z(Ry,`$followingNote`,u),s=()=>z(yi,`$globalCamera`,u),l=()=>z(Ki,`$orbitControls`,u),[u,d]=Ve(),p=q(()=>i()?.id?a().find(e=>e.id===i().id)??null:null),m=q(()=>i()?.draft??null),h=q(()=>Q(p)??Q(m)),_=q(()=>!!Q(h)),y=q(()=>!!Q(m)||i()?.mode===`edit`),x=q(()=>[...new Set(a().map(e=>
2445(e.label||``).trim()).filter(Boolean))].sort()),C=q(()=>!!Q(h)&&o()?.id===Q(h).id),w=t(``),T=t(``),E=t(Ne(Wy)),D=t(``),k=t(`round`),A=t(null),ee=t(!1),M=``;Qe(()=>{let e=(Q(h)?.id??``)+`:`+(Q(y)?`edit`:`view`);if(e===M)return;M=e;let t=Q(h);K(()=>{I(w,t?.name??``,!0),I(T,t?.text??``,!0),I(E,t?.color||Wy,!0),I(D,t?.label??``,!0),I(k,t?.shape||`round`,!0),I(A,t?.camera??null,!0),I(ee,t?.follow===!0)})});function te(){let e=s(),t=l();e&&t&&I(A,{position:e.position.toArray(),target:t.target.toArray()},!0)}let ne={round:qx,star:Tz,square:_S},re=t(null);Qe(()=>{Q(y)&&Q(re)&&Q(re).focus()});let ie=t(null),F=t(Ne({x:0,y:0,anchored:!1})),ae=t(!1);Qe(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: 640px)`),t=()=>I(ae,e.matches,!0);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}),Qe(()=>{Q(_)&&Q(ae)&&K(()=>{Ho.set(!0),Gs.set(!1)})}),Qe(()=>{if(!Q(_)||Q(ae))return;let e=requestAnimationFrame(t);function t(){e=requestAnimationFrame(t);let n=U(By),r=n?.draft??n?.id;if(!r)return;let i=wpe(r),a=U(yi),o=U(xi);if(!i||!a||!o?.domElement)return;let s=i.clone().project(a),c=o.domElement.getBoundingClientRect(),l=Q(ie)?.offsetWidth||300,u=Q(ie)?.offsetHeight||220,d=!0,f,p;if(s.z>=1)d=!1,f=Math.max(8,(window.innerWidth-l)/2),p=Math.max(8,(window.innerHeight-u)/2);else{let e=c.left+(s.x+1)/2*c.width,t=c.top+(1-s.y)/2*c.height;f=e+18,f+l>window.innerWidth-8&&(f=e-18-l),f=Math.min(Math.max(8,f),Math.max(8,window.innerWidth-l-8)),p=Math.min(Math.max(8,t-24),Math.max(8,window.innerHeight-u-8))}(Math.abs(f-Q(F).x)>.5||Math.abs(p-Q(F).y)>.5||d!==Q(F).anchored)&&I(F,{x:f,y:p,anchored:d},!0)}return()=>cancelAnimationFrame(e)});function oe(){By.set(null)}function R(){let e=Q(p)??Q(m);if(!e)return;let t=Q(T).trim(),n=Q(w).trim();if(!t&&!n)return;let r=ype(e);gpe({...e,name:n,text:t,color:Q(E),shape:Q(k),camera:Q(A),follow:Q(ee),label:Q(D).trim(),author:r?Ape():e.author,authorKey:r?Dpe():e.authorKey,ts:Date.now()}),By.set({id:e.id,mode:`view`})}function se(){Q(p)?Ly(Q(p).id):oe()}function ce(){Q(p)?By.set({id:Q(p).id,mode:`view`}):oe()}function le(e){try{return new Date(e).toLocaleString()}catch{return``}}var de=fe(),pe=N(de),me=e=>{var t=LYe();let n;var i=j(t),a=j(i),o=f(a,!0),s=g(a,2),l=f(s,!0),u=g(s,2),d=e=>{var t=wYe(),n=j(t);eS(n,{size:15,"aria-hidden":`true`}),H(t),L(`click`,t,()=>By.set({id:Q(h).id,mode:`edit`})),X(e,t)};G(u,e=>{Q(y)||e(d)});var m=g(u,2),_=j(m);fS(_,{size:15,"aria-hidden":`true`}),H(m),H(i);var M=g(i,2),ue=e=>{var t=AYe(),n=N(t),i=j(n);v(i),We(i,e=>I(re,e),()=>Q(re));var a=g(i,2);ve(a);var o=g(a,4);B(o,20,()=>Cpe,e=>e,(e,t)=>{var n=TYe();let i;O(()=>{i=r(n,1,`note-swatch svelte-c0s8uu`,null,i,{"is-on":Q(E)===t}),Ze(n,`background:${t??``}`),b(n,`title`,t),b(n,`aria-label`,`Pin color `+t),b(n,`aria-pressed`,Q(E)===t)}),L(`click`,n,()=>I(E,t,!0)),X(e,n)}),H(o);var s=g(o,4);B(s,20,()=>Tpe,e=>e,(e,t)=>{let n=q(()=>ne[t]);var i=EYe();let a;var o=j(i);P(o,()=>Q(n),(e,t)=>{t(e,{size:14,"aria-hidden":`true`})});var s=g(o,2),c=f(s,!0);H(i),O(()=>{a=r(i,1,`note-shape svelte-c0s8uu`,null,a,{"is-on":Q(k)===t}),b(i,`title`,`Pin shape: `+t),b(i,`aria-label`,`Pin shape `+t),b(i,`aria-pressed`,Q(k)===t),Y(c,t)}),L(`click`,i,()=>I(k,t,!0)),X(e,i)}),H(s);var l=g(s,4);v(l);var u=g(l,2);B(u,20,()=>Q(x),e=>e,(e,t)=>{var n=DYe(),r={};O(()=>{r!==(r=t)&&(n.value=(n.__value=r)??``)}),X(e,n)}),H(u);var d=g(u,4),m=j(d),h=j(m);uke(h,{size:13,"aria-hidden":`true`});var _=g(h);H(m);var y=g(m,2),C=e=>{var t=OYe(),n=j(t);fS(n,{size:13,"aria-hidden":`true`}),H(t),L(`click`,t,()=>I(A,null)),X(e,t)};G(y,e=>{Q(A)&&e(C)}),H(d);var M=g(d,2),ie=j(M);v(ie),W(2),H(M),H(n);var F=g(n,2),ae=j(F),oe=e=>{var t=kYe(),n=j(t);SS(n,{size:14,"aria-hidden":`true`}),W(),H(t),L(`click`,t,se),X(e,t)};G(ae,e=>{Q(p)&&e(oe)});var le=g(ae,4),ue=g(le,2);$R(j(ue),{size:14,"aria-hidden":`true`}),W(),H(ue),H(F),O(()=>Y(_,` ${Q(A)?`Update saved view`:`Save camera view`}`)),L(`keydown`,i,e=>{e.key===`Enter`&&(e.preventDefault(),R())}),S(i,()=>Q(w),e=>I(w,e)),L(`keydown`,a,e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),R())}),S(a,()=>Q(T),e=>I(T,e)),L(`keydown`,l,e=>{e.key===`Enter`&&(e.preventDefault(),R())}),S(l,()=>Q(D),e=>I(D,e)),L(`click`,m,te),c(ie,()=>Q(ee),e=>I(ee,e)),L(`click`,le,ce),L(`click`,ue,R),X(e,t)},de=e=>{var t=IYe(),n=N(t),i=j(n),a=e=>{var t=jYe(),n=f(t,!0);O(()=>Y(n,Q(h).text)),X(e,t)},o=q(()=>Q(h).name?.trim()&&Q(h).text?.trim()),s=e=>{var t=MYe();X(e,t)},c=q(()=>!Q(h).text?.trim());G(i,e=>{Q(o)?e(a):Q(c)&&e(s,1)});var l=g(i,2),u=j(l),d=e=>{var t=NYe(),n=f(t,!0);O(()=>Y(n,Q(h).label)),X(e,t)};G(u,e=>{Q(h).label&&e(d)});var p=g(u,2),m=g(p,2),_=f(m);H(l),H(n);var v=g(n,2),y=j(v),x=j(y);SS(x,{size:14,"aria-hidden":`true`}),W(),H(y);var S=g(y,4);let w;var T=j(S),E=e=>{var t=PYe();uAe(N(t),{size:14,"aria-hidden":`true`}),W(),X(e,t)},D=e=>{var t=FYe();fAe(N(t),{size:14,"aria-hidden":`true`}),W(),X(e,t)};G(T,e=>{Q(C)?e(E):e(D,-1)}),H(S);var k=g(S,2),A=j(k);eS(A,{size:14,"aria-hidden":`true`}),W(),H(k),H(v),O((e,t)=>
2445{Ze(p,`background:${(Q(h).color||Wy)??``}`),Y(_,`${e??``} · ${t??``}`),w=r(S,1,`note-flat svelte-c0s8uu`,null,w,{"is-on":Q(C)}),b(S,`title`,Q(C)?`Stop riding this pin with the camera`:`Ride this pin with the camera (keeps going after you close this card)`)},[()=>Hy(Q(h)),()=>le(Q(h).ts)]),L(`click`,y,se),L(`click`,S,()=>Q(C)?hpe():xpe(Q(h).id)),L(`click`,k,()=>By.set({id:Q(h).id,mode:`edit`})),X(e,t)};G(M,e=>{Q(y)?e(ue):e(de,-1)}),H(t),We(t,e=>I(ie,e),()=>Q(ie)),O((e,i)=>{n=r(t,1,`note-card ui-panel svelte-c0s8uu`,null,n,{"note-sheet":Q(ae)}),Ze(t,Q(ae)?``:`left:${Q(F).x}px; top:${Q(F).y}px;`),b(t,`aria-label`,Q(y)?`Edit note`:`Note`),Ze(a,`background:${(Q(h).color||Wy)??``}`),Y(o,e),Y(l,i)},[()=>kpe(Q(h).id)||`+`,()=>Q(y)?Q(p)?`Edit note`:`New note`:Vy(Q(h))]),L(`click`,m,oe),X(e,t)};G(pe,e=>{Q(_)&&Q(h)&&e(me)}),X(e,de),ue(),d()}ge([`click`,`keydown`]);var zYe=je(`<g><line stroke-width="3" stroke-opacity="0.22" stroke-linecap="round"></line><line stroke-width="1.25" stroke-opacity="0.95" stroke-linecap="round"></line><circle r="2.6" stroke-width="0"></circle><circle r="4" fill="none" stroke="var(--marker-outline, rgba(255,255,255,0.85))" stroke-width="1" stroke-dasharray="none"></circle></g>`),BYe=V(`<b> </b>`),VYe=V(`<span class="marker-tip-text svelte-1nymxm4"> </span>`),HYe=V(`<span class="marker-tip-meta svelte-1nymxm4"> </span>`),UYe=V(`<span class="marker-tip-meta svelte-1nymxm4">Click to spread them out</span>`),WYe=V(`<div class="marker-tip svelte-1nymxm4"><span class="marker-tip-title svelte-1nymxm4"><!> </span> <!> <!></div>`),GYe=V(`<button><!> <span class="marker-num svelte-1nymxm4"> </span></button> <!>`,1),KYe=V(`<svg class="marker-lines svelte-1nymxm4" aria-hidden="true"></svg> <div class="marker-layer svelte-1nymxm4"></div>`,1);function qYe(e,n){Ce(n,!0);let i=()=>z(By,`$activeAnnotation`,s),a=()=>z(Fy,`$noteMarkers`,s),o=()=>z(nc,`$noteDoubleClickToOpen`,s),[s,c]=Ve(),l=t(``),u=t(``),d=q(()=>i()?.id??``);function p(e){try{return new Date(e).toLocaleString()}catch{return``}}let m=q(()=>h(a().map(e=>({id:e.id,color:e.color,ink:e.ink,number:e.number,title:e.title,author:e.author,when:p(e.ts),text:e.text,x:e.px,y:e.py-38,px:e.px,py:e.py,occluded:e.occluded,fade:e.fade,cluster:null}))));function h(e){let t=[];for(let n of e){let e=t.find(e=>Math.hypot(e[0].x-n.x,e[0].y-n.y)<34);e?e.push(n):t.push([n])}let n=[];for(let e of t){if(e.length===1){n.push(e[0]);continue}let t=e.map(e=>e.id).join(`|`);if(Q(u)===t){let t=e.reduce((e,t)=>e+t.x,0)/e.length,r=e.reduce((e,t)=>e+t.y,0)/e.length,i=Math.min(Math.PI*1.5,e.length*.7);e.forEach((a,o)=>{let s=-Math.PI/2-i/2+i*o/Math.max(1,e.length-1);n.push({...a,x:t+Math.cos(s)*52,y:r+Math.sin(s)*52})});continue}let r=e[0];n.push({...r,id:t,title:e.length+` notes here`,text:e.map(e=>`#`+e.number+` `+e.title).join(` · `),occluded:e.every(e=>e.occluded),number:e.length,cluster:e.map(e=>e.id)})}return n}function _(e){if(e.cluster){I(u,Q(u)===e.id?``:e.id,!0);return}I(u,``),o()?zy(e.id):Ny(e.id,`view`)}function v(e){e.cluster||(I(u,``),Ny(e.id,`view`))}var y=fe(),x=N(y),S=e=>{var t=KYe(),n=N(t);B(n,21,()=>Q(m),e=>e.id,(e,t)=>{var n=zYe(),r=j(n),i=g(r),a=g(i),o=g(a);H(n),O(()=>{b(n,`opacity`,(Q(t).occluded?.5:1)*Q(t).fade),b(n,`stroke-dasharray`,Q(t).occluded?`3 3`:`none`),b(r,`x1`,Q(t).x),b(r,`y1`,Q(t).y+13-2),b(r,`x2`,Q(t).px),b(r,`y2`,Q(t).py),b(r,`stroke`,Q(t).color),b(i,`x1`,Q(t).x),b(i,`y1`,Q(t).y+13-2),b(i,`x2`,Q(t).px),b(i,`y2`,Q(t).py),b(i,`stroke`,Q(t).color),b(a,`cx`,Q(t).px),b(a,`cy`,Q(t).py),b(a,`fill`,Q(t).color),b(o,`cx`,Q(t).px),b(o,`cy`,Q(t).py)}),X(e,n)}),H(n);var i=g(n,2);B(i,21,()=>Q(m),e=>e.id,(e,t)=>{let n=q(()=>Q(t).cluster?cz:pz);var i=GYe(),a=N(i);let s;var c=j(a);P(c,()=>Q(n),(e,t)=>{t(e,{size:12,"aria-hidden":`true`})});var u=g(c,2),p=f(u,!0);H(a);var m=g(a,2),h=e=>{var n=WYe(),r=j(n),i=j(r),a=e=>{var n=BYe(),r=f(n);O(()=>Y(r,`#${Q(t).number??``}`)),X(e,n)};G(i,e=>{Q(t).cluster||e(a)});var o=g(i);H(r);var s=g(r,2),c=e=>{var n=VYe(),r=f(n,!0);O(()=>Y(r,Q(t).text)),X(e,n)};G(s,e=>{Q(t).text&&e(c)});var l=g(s,2),u=e=>{var n=HYe(),r=f(n);O(()=>Y(r,`${Q(t).author??``} · ${Q(t).when??``}`)),X(e,n)},d=e=>{var t=UYe();X(e,t)};G(l,e=>{Q(t).cluster?e(d,-1):e(u)}),H(n),O(e=>{Ze(n,`left:${e??``}px; top:${Q(t).y+16}px;`),Y(o,` ${Q(t).title??``}`)},[()=>Math.min(Q(t).x+16,window.innerWidth-240)]),X(e,n)};G(m,e=>{Q(l)===Q(t).id&&e(h)}),O(e=>{s=r(a,1,`marker-badge svelte-1nymxm4`,null,s,{"is-occluded":Q(t).occluded,"is-active":!Q(t).cluster&&Q(d)===Q(t).id,"is-cluster":!!Q(t).cluster}),Ze(a,` 2446 left:${Q(t).x??``}px; top:${Q(t).y??``}px; opacity:${Q(t).fade??``}; 2447 --fill:${e??``}; 2448 --ink:${Q(t).ink??``}; 2449 --ring:${Q(t).color??``}; 2450 `),b(a,`title`,Q(t).cluster?Q(t).title:`#`+Q(t).number+` `+Q(t).title+(o()?` (double-click to open)`:``)),b(a,`aria-label`,Q(t).cluster?Q(t).title:`Note `+Q(t).number+`: `+Q(t).title),Y(p,Q(t).number)},[()=>Q(t).occluded?Ope(Q(t).color,.5):Q(t).color]),L(`click`,a,()=>_(Q(t))),L(`dblclick`,a,()=>v(Q(t))),Z(`pointerenter`,a,()=>I(l,Q(t).id,!0)),Z(`pointerleave`,a,()=>I(l,Q(l)===Q(t).id?``:Q(l),!0)),X(e,i)}),H(i),X(e,t)};G(x,e=>{Q(m).length&&e(S)}),X(e,y),ue(),c()}ge([`click`,`dblclick`]);
2450var JYe=je(`<svg class="knife-overlay svelte-18jrn3n" width="100%" height="100%" aria-hidden="true"><line stroke="#ff7a1a" stroke-width="1.5" stroke-dasharray="6 4"></line><circle r="3.5" fill="#ff7a1a"></circle><circle r="3.5" fill="none" stroke="#ff7a1a" stroke-width="1.5"></circle></svg>`);function YYe(e,t){Ce(t,!1);let n=()=>z(Yp,`$knifePreview`,r),[r,i]=Ve();R();var a=fe(),o=N(a),s=e=>{var t=JYe(),r=j(t),i=g(r),a=g(i);H(t),O(()=>{b(r,`x1`,n().from[0]),b(r,`y1`,n().from[1]),b(r,`x2`,n().to[0]),b(r,`y2`,n().to[1]),b(i,`cx`,n().from[0]),b(i,`cy`,n().from[1]),b(a,`cx`,n().to[0]),b(a,`cy`,n().to[1])}),X(e,t)};G(o,e=>{n()&&e(s)}),X(e,a),ue(),i()}var XYe=V(`<span class="text-xs text-gray-400"> </span>`),ZYe=V(`<p class="px-1 py-6 text-center text-sm text-gray-400">No notes yet. Select an object and add a note from its context menu or the object list.</p>`),QYe=V(`<span class="notes-desc svelte-1ti00p8"> </span>`),$Ye=V(`<li><div class="flex items-start gap-2 p-2"><button class="min-w-0 flex-1 text-left"><div class="flex min-w-0 items-baseline gap-1.5"><span class="notes-num svelte-1ti00p8"> </span> <span class="shrink-0 text-sm text-gray-100"> </span> <!></div> <div class="mt-0.5 flex items-center gap-1.5 truncate text-[10px] text-gray-500"><span class="rounded-sm bg-gray-700/70 px-1 text-gray-300"> </span> <span class="truncate"> </span></div></button> <button class="notes-icon shrink-0 svelte-1ti00p8" title="Edit note" aria-label="Edit note"><!></button> <button class="shrink-0 text-gray-500 hover:text-red-400" title="Delete note" aria-label="Delete note">â</button></div></li>`),eXe=V(`<ul class="flex flex-col gap-1.5 pb-1"></ul>`),tXe=V(`<div class="notes-group svelte-1ti00p8"><div class="notes-group-head svelte-1ti00p8"><button class="notes-group-toggle svelte-1ti00p8"><!> <span class="truncate"> </span> <span class="text-gray-500"> </span></button> <button class="notes-icon svelte-1ti00p8" title="Previous note in this group"><!></button> <button class="notes-icon svelte-1ti00p8" title="Next note in this group"><!></button></div> <!></div>`),nXe=V(`<aside id="notes-drawer" class="ui-panel flex flex-col svelte-1ti00p8"><div class="notes-resize svelte-1ti00p8" title="Drag to resize"><span class="notes-grabber svelte-1ti00p8"></span></div> <div class="ui-panel-header shrink-0 justify-between"><span>Scene notes <!></span> <div class="flex items-center gap-1"><button class="notes-icon svelte-1ti00p8"><!></button> <button class="ui-button-quiet" title="Close" aria-label="Close notes">â</button></div></div> <div class="notes-body min-h-0 flex-1 overflow-y-auto p-2 svelte-1ti00p8"><!></div></aside>`);function rXe(e,n){Ce(n,!0);let i=()=>z(Gs,`$notesDrawerOpen`,d),a=()=>z(Ui,`$objectsGroup`,d),o=()=>z(Uy,`$annotations`,d),s=()=>z(nc,`$noteDoubleClickToOpen`,d),c=()=>z(By,`$activeAnnotation`,d),l=()=>z(_pe,`$visitedNote`,d),u=()=>z(My,`$showNotePins`,d),[d,p]=Ve();Qe(()=>{i()&&typeof window<`u`&&window.matchMedia(`(max-width: 640px)`).matches&&Ho.set(!0)});let m=typeof localStorage<`u`?parseInt(nt.getItem(`notesSheetH`)||``):NaN,h=t(Ne(!m||Number.isNaN(m)?Math.round((typeof window<`u`?window.innerHeight:800)*.45):m)),_=!1;function v(e){_=!0,e.currentTarget.setPointerCapture?.(e.pointerId),e.preventDefault()}function y(e){if(!_)return;let t=parseFloat(getComputedStyle(document.documentElement).getPropertyValue(`--connect-bottom`))||54,n=Math.max(200,window.innerHeight-t-56);I(h,Math.min(Math.max(160,window.innerHeight-e.clientY),n),!0)}function x(e){if(_){_=!1,e.currentTarget.releasePointerCapture?.(e.pointerId);try{nt.setItem(`notesSheetH`,String(Q(h)))}catch{}}}function S(e){let t=a(),n=t&&t.getObjectByProperty?t.getObjectByProperty(`uuid`,e):null;return n?.name||n?.type||e.slice(0,8)}function C(e){try{return new Date(e).toLocaleString()}catch{return``}}let w=q(()=>{let e=new Map;o().forEach((t,n)=>{let r=(t.label||``).trim()||`General`;e.has(r)||e.set(r,[]),e.get(r).push({a:t,n:n+1})});let t=[...e.keys()].filter(e=>e!==`General`).sort((e,t)=>e.localeCompare(t));return(e.has(`General`)?[`General`,...t]:t).map(t=>({label:t,rows:e.get(t)}))}),T=t(Ne({}));function E(e){s()?zy(e):Ny(e,`view`)}function D(e,t){let n=e.rows;if(!n.length)return;
2450let r=c()?.id??l(),i=n.findIndex(e=>e.a.id===r);E((i<0?t>0?n[0]:n[n.length-1]:n[(i+t+n.length)%n.length]).a.id)}var k=fe(),A=N(k),ee=e=>{var t=nXe(),n=j(t),i=g(n,2),a=j(i),d=g(j(a)),p=e=>{var t=XYe(),n=f(t);O(()=>Y(n,`(${o().length??``})`)),X(e,t)};G(d,e=>{o().length&&e(p)}),H(a);var m=g(a,2),_=j(m),k=j(_),A=e=>{Wx(e,{size:15,"aria-hidden":`true`})},ee=e=>{aS(e,{size:15,"aria-hidden":`true`})};G(k,e=>{u()?e(A):e(ee,-1)}),H(_);var M=g(_,2);H(m),H(i);var te=g(i,2),ne=j(te),P=e=>{var t=ZYe();X(e,t)},re=e=>{var t=fe(),n=N(t);B(n,17,()=>Q(w),e=>e.label,(e,t)=>{var n=tXe(),i=j(n),a=j(i),o=j(a),u=e=>{tz(e,{size:14,"aria-hidden":`true`})},d=e=>{Xx(e,{size:14,"aria-hidden":`true`})};G(o,e=>{Q(T)[Q(t).label]?e(u):e(d,-1)});var p=g(o,2),m=f(p,!0),h=g(p,2),_=f(h);H(a);var v=g(a,2);ez(j(v),{size:14,"aria-hidden":`true`}),H(v);var y=g(v,2);tz(j(y),{size:14,"aria-hidden":`true`}),H(y),H(i);var x=g(i,2),w=e=>{var n=eXe();B(n,21,()=>Q(t).rows,e=>e.a.id,(e,t)=>{var n=$Ye();let i;var a=j(n),o=j(a),u=j(o),d=j(u),p=f(d,!0),m=g(d,2),h=f(m,!0),_=g(m,2),v=e=>{var n=QYe(),r=f(n,!0);O(()=>Y(r,Q(t).a.text)),X(e,n)},y=q(()=>(Q(t).a.name||``).trim()&&(Q(t).a.text||``).trim());G(_,e=>{Q(y)&&e(v)}),H(u);var x=g(u,2),w=j(x),T=f(w,!0),D=g(w,2),k=f(D);H(x),H(o);var A=g(o,2),ee=j(A);eS(ee,{size:14,"aria-hidden":`true`}),H(A);var M=g(A,2);H(a),H(n),O((e,a,u,f)=>{i=r(n,1,`group rounded-sm bg-gray-800/60 hover:bg-gray-700/60 svelte-1ti00p8`,null,i,{"notes-row-active":(c()?.id??l())===Q(t).a.id}),b(o,`title`,s()?`Fly to this note (double-click to open it)`:`Fly to this note and open it`),Ze(d,`background:${(Q(t).a.color||Wy)??``}`),Y(p,Q(t).n),Y(h,e),Y(T,a),Y(k,`${u??``} · ${f??``}`)},[()=>Vy(Q(t).a),()=>S(Q(t).a.objectUuid),()=>Hy(Q(t).a),()=>C(Q(t).a.ts)]),L(`click`,o,()=>E(Q(t).a.id)),L(`dblclick`,o,()=>Ny(Q(t).a.id,`view`)),L(`click`,A,()=>Ny(Q(t).a.id,`edit`)),L(`click`,M,()=>Ly(Q(t).a.id)),X(e,n)}),H(n),X(e,n)};G(x,e=>{Q(T)[Q(t).label]||e(w)}),H(n),O(()=>{b(a,`aria-expanded`,!Q(T)[Q(t).label]),Y(m,Q(t).label),Y(_,`(${Q(t).rows.length??``})`),b(v,`aria-label`,`Previous note in `+Q(t).label),b(y,`aria-label`,`Next note in `+Q(t).label)}),L(`click`,a,()=>I(T,{...Q(T),[Q(t).label]:!Q(T)[Q(t).label]},!0)),L(`click`,v,()=>D(Q(t),-1)),L(`click`,y,()=>D(Q(t),1)),X(e,n)}),X(e,t)};G(ne,e=>{o().length?e(re,-1):e(P)}),H(te),H(t),O(()=>{Ze(t,`--notes-h: ${Q(h)??``}px;`),b(_,`title`,u()?`Hide note pins in the viewport`:`Show note pins in the viewport`),b(_,`aria-label`,u()?`Hide note pins`:`Show note pins`),b(_,`aria-pressed`,u())}),L(`pointerdown`,n,v),L(`pointermove`,n,y),L(`pointerup`,n,x),L(`click`,_,()=>My.set(!u())),L(`click`,M,()=>Gs.set(!1)),X(e,t)};G(A,e=>{i()&&e(ee)}),X(e,k),ue(),p()}ge([`pointerdown`,`pointermove`,`pointerup`,`click`,`dblclick`]);function iXe(){return U(Es)?.openedPeers?.size??0}async function bQ(e){let t=String(e??``).trim();if(!t)return`share`;let n=iXe();if(!n||Une(t))return`share`;let r=await Rd({title:`Share "`+t+`" with this session?`,message:`This scene is not part of the session yet. Sharing lets the `+(n===1?`other person`:n+` others`)+` see its name and open it. Editing privately keeps it on this machine â its name never leaves, and no edits cross in either direction until you share it.`,choices:[{value:`share`,label:`Share with the session`},{value:`private`,label:`Edit privately`}]});return r===`private`?`private`:r===`share`?`share`:null}var xQ=Ue([]);function SQ(e,t){try{let n=U(Es),r=n?.connections?.[e];return!r?.open||!n?.peer?.id?!1:(r.send({...t,peerId:n.peer.id}),!0)}catch{return!1}}function CQ(e){return!Xme(e)||!SQ(e,{type:`sceneaccess`,op:`request`})?!1:(xQ.update(t=>t.includes(e)?t:[...t,e]),es(`Asked `+hh(e)+` to share their scene.`),!0)}function wQ(e){xQ.update(t=>t.filter(t=>t!==e))}function aXe(e,t){let n=String(e||t?.peerId||``);if(!n)return!1;let r=String(t?.op??``);if(r===`request`){if(!Jb())return!1;let e=String(U(Bb)?.name??``).trim(),t=`scene-access-`+n;return Po(t,hh(n)+` asks to see your private scene "`+e+`". Sharing it shares it with everyone in this session.`,[{label:`Share scene`,action:()=>{oc(t),TQ(n)}},{label:`Keep private`,action:()=>{oc(t),SQ(n,{type:`sceneaccess`,op:`deny`})}}]),!0}if(r===`grant`){wQ(n);
2450let e=String(t?.scene??U(Xb)[n]?.scene??``).trim(),r=`scene-shared-`+n;return Po(r,hh(n)+` shared "`+e+`"`,[{label:`Go to`,action:()=>{oc(r),SZ(n)}}]),!0}return r===`deny`&&(wQ(n),es(hh(n)+` kept their scene private.`),!0)}async function TQ(e){let t=await Pme();return t?(e&&SQ(e,{type:`sceneaccess`,op:`grant`,scene:t.scene}),es(`"`+t.scene+`" is shared with this session now.`),!0):!1}function EQ(){let e=U(Xb),t=String(U(Vd)??``),n=t?e[t]:null;if(n?.scene&&!n.private)return{scene:n.scene,hash:String(n.hash??``),peerId:t};let r={},i={},a={};for(let[t,n]of Object.entries(e))n?.scene&&!n.private&&(r[n.scene]=(r[n.scene]??0)+1,n.scene in i||(i[n.scene]=String(n.hash??``),a[n.scene]=t));let o=Object.keys(r).sort((e,t)=>r[t]-r[e]||e.localeCompare(t));return o.length?{scene:o[0],hash:i[o[0]],peerId:a[o[0]]}:null}async function DQ(e={}){let t=Jb(),n=!!String(U(Bb)?.name??``).trim();if(!t&&!n)return!1;let r=e.world===!0?null:EQ();if(!await xZ(r?.scene||`the session`))return!1;if(r)return(r.hash?await Hb(r.hash,r.scene):await Ub(r.scene))?(es(`Back in the session, in "`+r.scene+`".`),!0):(es(`Could not open "`+r.scene+`" yet â you are still editing privately.`),!1);Bb.set(null);try{let e=await $(()=>import(`../chunks/CFe4PVuz.js`).then(e=>e.A),__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url);await e.applySession(e.emptySessionPayload(`Rejoining the session`),{backup:!1,replicate:!1,game:!1,workspace:!1})}catch{}let i=U(Es),a=U(Xb),o=0;for(let[e,t]of Object.entries(i?.connections??{})){let n=t;if(n?.open&&!Gb(a,``,e,U(Vd)))try{i.requestFullState?.(n),o++}catch{}}return es(o?`Back in the session â asked `+o+` peer`+(o===1?``:`s`)+` for the shared world.`:`Back in the session.`),!0}function OQ(){return DQ({world:!0})}var oXe=V(`<span class="absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-semibold text-white"> </span>`),sXe=V(`<button class="text-[11px] text-gray-400 hover:text-gray-200">Clear all</button>`),cXe=V(`<p class="px-1 py-4 text-center text-xs text-gray-400">No notifications yet.</p>`),lXe=V(`<li class="rounded-sm bg-gray-800/60 px-2 py-1.5"><div class="text-xs text-gray-100"> </div> <div class="mt-0.5 text-[10px] text-gray-500"> </div></li>`),uXe=V(`<ul class="flex flex-col gap-1"></ul>`),dXe=V(`<div class="fixed inset-0" style="z-index: 996;" role="presentation"></div> <div id="notif-panel" class="ui-panel absolute right-0 top-10 w-80 p-2" style="z-index: 998;"><div class="mb-1 flex items-center justify-between"><p class="ui-section-label">Notifications</p> <!></div> <div class="max-h-[60vh] overflow-y-auto"><!></div></div>`,1),fXe=V(`<div class="relative"><button id="notif-bell" class="relative flex h-8 w-8 items-center justify-center rounded-full border border-gray-700/60 bg-gray-800/85 text-gray-200 backdrop-blur-sm hover:bg-gray-700/85" title="Notifications" aria-label="Notifications"><!> <!></button> <!></div>`);function pXe(e,t){Ce(t,!1);let n=()=>z(Qs,`$notificationCenterOpen`,a),r=()=>z(bs,`$notificationsUnread`,a),i=()=>z(Fs,`$notifications`,a),[a,o]=Ve();function s(){let e=!n();Qs.set(e),e&&bs.set(0)}function c(){Fs.set([]),bs.set(0)}function l(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return n+`m ago`;let r=Math.floor(n/60);return r<24?r+`h ago`:Math.floor(r/24)+`d ago`}R();var u=fXe(),d=j(u),p=j(d);aOe(p,{size:16,class:`text-xs`,"aria-hidden":`true`});var m=g(p,2),h=e=>{var t=oXe(),n=f(t,!0);O(()=>Y(n,r()>9?`9+`:r())),X(e,t)};G(m,e=>{r()>0&&e(h)}),H(d);var _=g(d,2),v=e=>{var t=dXe(),n=N(t),r=g(n,2),a=j(r),o=g(j(a),2),s=e=>{var t=sXe();L(`click`,t,c),X(e,t)};G(o,e=>{i().length&&e(s)}),H(a);var u=g(a,2),d=j(u),p=e=>{var t=cXe();X(e,t)},m=e=>{var t=uXe();B(t,5,()=>[...i()].reverse(),e=>e.id,(e,t)=>{var n=lXe(),r=j(n),i=f(r,!0),a=g(r,2),o=f(a,!0);H(n),O(e=>{Y(i,Q(t).text),Y(o,e)},[()=>l(Q(t).ts)]),X(e,n)}),H(t),X(e,t)};G(d,e=>{i().length?e(m,-1):e(p)}),H(u),H(r),L(`click`,n,()=>Qs.set(!1)),X(e,t)};G(_,e=>{n()&&e(v)}
2450),H(u),L(`click`,d,s),X(e,u),ue(),o()}ge([`click`]);var mXe=V(`<span class="text-[10px] text-primary-300">(you)</span>`),hXe=V(`<span title="Muted"><!></span>`),gXe=V(`<span title="In VR"><!></span>`),_Xe=V(`<span class="mode-chip svelte-173ze8w"> </span>`),vXe=V(`<span> </span>`),yXe=V(`<span class="text-amber-300"> </span>`),bXe=V(`<span class="text-orange-300" title="Relayed through a TURN server">relayed</span>`),xXe=V(`<span> </span> <!>`,1),SXe=V(`<span class="role-badge svelte-173ze8w" title="Your role"> </span>`),CXe=V(`<button type="button" class="role-badge role-btn svelte-173ze8w" aria-haspopup="listbox" title="Change role"> <!></button>`),wXe=V(`<span class="role-badge svelte-173ze8w"> </span>`),TXe=V(`<button class="peer-watch peer-preview shrink-0 rounded px-2 py-0.5 text-xs bg-gray-600 text-gray-100 hover:bg-gray-500"><!> </button>`),EXe=V(`<button> </button>`),DXe=V(`<button class="peer-join shrink-0 rounded bg-gray-600 px-2 py-0.5 text-xs text-gray-100 hover:bg-gray-500" title="In the session's world â go back there"><!>Join</button>`),OXe=V(`<button class="peer-goto shrink-0 rounded bg-gray-600 px-2 py-0.5 text-xs text-gray-100 hover:bg-gray-500"><!>Go to</button>`),kXe=V(`<button><!> </button>`),AXe=V(`<div><!> <div class="min-w-0 flex-1"><div class="flex items-center gap-1 truncate text-sm text-gray-100"><span class="truncate"> </span> <!></div> <div class="flex items-center gap-1.5 text-[10px] text-gray-400"><span class="truncate"> </span> <!> <!> <!> <!> <!> <!></div></div> <!> <!> <!></div>`),jXe=V(`<div id="peers-private-note" class="peers-private-note svelte-173ze8w"><span class="truncate">Editing <b> </b> privately â nobody here can see it.</span> <div class="peers-private-actions svelte-173ze8w"><button id="peers-share-scene" class="peers-private-btn svelte-173ze8w" title="Share this scene with everyone in the session â its name, and the world in it">Share with session</button> <button id="peers-rejoin" class="peers-private-btn svelte-173ze8w" title="Leave this scene and stand where the session is">Rejoin session</button></div></div>`),MXe=V(`<span class="peers-room-mine svelte-173ze8w">â your room</span>`),NXe=V(`<div class="peers-room-head svelte-173ze8w"><span class="truncate"> </span> <span class="peers-room-count svelte-173ze8w"> </span> <!></div> <!>`,1),PXe=V(`<div class="mt-1 border-t border-gray-700/60 pt-1"><button id="reset-game" type="button" class="reset-game-btn svelte-173ze8w">Reset game</button></div>`),FXe=V(`<button class="cross-scene-invite rounded bg-primary-600/80 px-1.5 py-0.5 text-xs text-white hover:bg-primary-500" title="Ask them to join your scene â they get a toast; accepting connects them to your session">Invite</button>`),IXe=V(`<div class="peers-row flex items-center gap-2 rounded px-1.5 py-1"><span class="min-w-0 flex-1 truncate text-sm"> </span> <span class="mode-chip svelte-173ze8w"> </span> <button class="rounded px-1.5 py-0.5 text-xs text-gray-500" disabled="" title="In another scene â Watch cannot reach a peer outside your session. Join their room to watch.">Watch</button> <!></div>`),LXe=V(`<div class="px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-gray-500"> </div> <!>`,1),RXe=V(`<div class="mt-1 border-t border-gray-700/60 pt-1" id="cross-scene-presence"></div>`),zXe=V(`<div class="mt-1 border-t border-gray-700/60 pt-1"><!></div>`),BXe=V(`<button type="button" role="option"><span class="role-badge svelte-173ze8w" style="pointer-events:none"> </span><!></button>`),VXe=V(`<div class="role-menu role-menu-portal svelte-173ze8w" role="listbox"></div>`),HXe=V(`<div class="fixed inset-0" style="z-index: 996;" role="presentation"></div> <div id="peers-popover" class="ui-panel absolute right-0 top-11 w-72 p-2"><div class="mb-1 flex items-center justify-between gap-2"><p class="ui-section-label"> </p> <div class="tp-seg" role="group" aria-label="Peers view"><button id="peers-view-flat" class="tp-seg-btn" title="Every peer in one list">All</button> <button id="peers-view-rooms" class="tp-seg-btn" title="Grouped by the scene each peer is standing in">Rooms</button></div></div> <!> <div class="peers-scroll svelte-173ze8w"><!></div> <!> <!> <!></div> <!>`,1),UXe=V(`<div class="relative"><button id="peers-trigger" class="flex items-center gap-2 rounded-full border border-gray-700/60 bg-gray-800/85 px-2 py-1 backdrop-blur-sm hover:bg-gray-700/85" title="Connected peers">
2450<div class="flex -space-x-2"></div> <span class="pr-1 text-xs font-semibold text-gray-200"> </span></button> <!></div>`),WXe=V(`<span class="block truncate text-xs text-gray-400"> </span>`),GXe=V(`<div class="min-w-0"><span class="block truncate text-base font-semibold"> </span> <!></div>`),KXe=V(`<!> <!>`,1),qXe=V(`<!> <div class="cloud-profile px-3 py-2"><!></div>`,1),JXe=V(`<button type="button" class="absolute right-0 top-0 z-10 cursor-pointer rounded-full leading-none" aria-label="Close profile menu"><!></button> <!> <!> <!>`,1),YXe=V(`<img id="avatar-preview" alt="avatar" class="h-14 w-14 rounded-full border-2 dark:border-gray-800 cursor-pointer object-cover"/>`),XXe=je(`<svg fill="currentColor" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" class="h-14 w-14 rounded-full border-2 dark:border-gray-400 cursor-pointer"><path fill-rule="evenodd" d="M8 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd"></path></svg>`),ZXe=V(`<button id="avatar-reset" class="rounded-sm border border-gray-500 px-2 py-1 text-xs text-gray-300 hover:bg-gray-700"> </button>`),QXe=V(`<center><b>Profile Settings</b></center> <div class="modal-content max-h-[90vh] overflow-y-auto p-4"><div class="flex px-10 pf-row svelte-173ze8w"><p>Avatar</p> <input type="file" id="avatar-file" style="display: none"/> <div class="flex items-center gap-3"><!> <!></div></div> <br/> <div class="flex px-10 pf-row svelte-173ze8w"><p>Peer ID</p> <!></div> <div class="flex px-10 pf-row svelte-173ze8w"><p>Username</p> <!></div></div> <br/>`,1),$Xe=V(`<div class="top-right-chrome"><div class="flex items-center gap-2" style=" position: absolute; top: 15px; right: 100px; z-index: 997;"><button id="notes-toggle" title="Scene notes" aria-label="Scene notes"><!></button> <!> <!></div> <div id="avatar-menu" class="mr-5 flex w-52 items-center md:order-2"><div class="flex items-center space-x-3"><div id="avatar-trigger" style="position: absolute; top: 8px; right: 20px; cursor: pointer; z-index: 999; line-height: 0;"><!></div></div></div> <!></div> <!> <!>`,1);function eZe(e,n){Ce(n,!0);let i=()=>z(as,`$userdata`,ie),a=()=>z(Es,`$peers`,ie),o=()=>z(vs,`$cloudIdentity`,ie),s=()=>z(pc,`$username`,ie),c=()=>z(cf,`$rolesInfo`,ie),l=()=>z(of,`$scenePresence`,ie),u=()=>z(Xb,`$peerScenes`,ie),d=()=>z(Bb,`$currentLevel`,ie),p=()=>z(Vd,`$sessionHost`,ie),m=()=>z(Xc,`$gameState`,ie),h=()=>z(zs,`$specatorMode`,ie),_=()=>z(Ti,`$camSave`,ie),v=()=>z(yi,`$globalCamera`,ie),y=()=>z(Pi,`$globalScene`,ie),x=()=>z(yg,`$mutedPeers`,ie),S=()=>z(si,`$peerHands`,ie),C=()=>z(AC,`$peerPlayModes`,ie),w=()=>z(ki,`$isLocked`,ie),T=()=>z(Xv,`$peerQuality`,ie),E=()=>z(ohe,`$cameraPreviews`,ie),D=()=>z(xQ,`$sceneAccessAsked`,ie),k=()=>z(xs,`$connectDocked`,ie),A=()=>z(uc,`$connectBarHeight`,ie),ee=()=>z(Gs,`$notesDrawerOpen`,ie),te=()=>z(ef,`$usersSlot`,ie),P=()=>z(nf,`$profileSlot`,ie),re=()=>z(Ys,`$profileSettingsOpen`,ie),[ie,F]=Ve(),ae=(e,t=qe,n=qe,i=qe)=>{var a=AXe(),o=j(a);oo(o,{get src(){return t()[2]},class:`h-8 w-8 shrink-0 rounded-full`});var s=g(o,2),c=j(s),l=j(c),m=f(l,!0),_=g(l,2),v=e=>{var t=mXe();X(e,t)};G(_,e=>{n()&&e(v)}),H(c);var y=g(c,2),k=j(y),A=f(k,!0),ee=g(k,2),M=e=>{var t=hXe();Oz(j(t),{size:16,"aria-hidden":`true`}),H(t),X(e,t)},te=q(()=>x().includes(t()[0]));G(ee,e=>{Q(te)&&e(M)});var ne=g(ee,2),P=e=>{var t=gXe();UOe(j(t),{size:16,"aria-hidden":`true`}),H(t),X(e,t)};G(ne,e=>{S()[t()[0]]?.active&&e(P)});var re=g(ne,2),ie=e=>{let r=q(()=>Ue(C(),w(),t()[0],n()));var i=_Xe(),a=f(i,!0);O(()=>{b(i,`data-mode`,Q(r)),b(i,`title`,Q(r)===`playing`?`In play mode`:`In the editor, not playing`),Y(a,Q(r))}),X(e,i)},F=q(()=>Ue(C(),w(),t()[0],n())===`playing`||Q(He));G(re,e=>{Q(F)&&e(ie)});var ae=g(re,2),ue=e=>{let i=q(()=>se(u(),d(),t()[0],n()));var a=vXe();let o;var s=f(a,!0);O(()=>{o=r(a,1,`scene-chip svelte-173ze8w`,null,o,{"scene-chip-here":Q(i)===(d()?.name??null)}),b(a,`title`,n()?`The scene you have open`:Q(i)===R?`They have not saved a scene â you share one world until they do.`:`In `+Q(i)),Y(s,Q(i))}),X(e,a)},de=q(()=>i()&&se(u(),d(),t()[0],n()));G(ae,e=>{Q(de)&&e(ue)});var z=g(ae,2),pe=e=>{var n=yXe(),r=f(n);O(e=>Y(r,`⸠${e??``}`),[()=>he(t()[3])]),X(e,n)};G(z,e=>{t()[3]&&e(pe)});var B=g(z,2),me=e=>{let n=q(()=>T()[t()[0]]);var r=xXe(),i=N(r),a=f(i),o=g(i,2),s=e=>{var t=bXe();X(e,t)};G(o,e=>{Q(n).relayed&&e(s)}
2450),O((e,t,n)=>{b(i,`title`,e),Ze(i,`color: ${t??``}`),Y(a,`â${n??``}`)},[()=>Q(n).rtt==null?`measuringâ¦`:`${Math.round(Q(n).rtt)} ms round-trip`,()=>le(Q(n).level),()=>Q(n).rtt==null?``:` ${Math.round(Q(n).rtt)}ms`]),X(e,r)};G(B,e=>{!n()&&T()[t()[0]]&&e(me)}),H(y),H(s);var U=g(s,2),_e=e=>{var r=fe(),i=N(r),a=e=>{var t=SXe(),n=f(t,!0);O(()=>{b(t,`data-role`,Q(De).myRole),Y(n,Q(De).myRole)}),X(e,t)},o=e=>{var n=CXe(),r=j(n,!0),i=g(r);Xx(i,{size:10,class:`role-caret`,"aria-hidden":`true`}),H(n),O((e,i)=>{b(n,`data-role`,e),b(n,`aria-expanded`,Q(Ke)===t()[0]),Y(r,i)},[()=>Q(De).roleOf(t()[0]),()=>Q(De).roleOf(t()[0])]),L(`click`,n,e=>Ye(e,t()[0])),X(e,n)},s=e=>{var n=wXe(),r=f(n,!0);O((e,t)=>{b(n,`data-role`,e),Y(r,t)},[()=>Q(De).roleOf(t()[0]),()=>Q(De).roleOf(t()[0])]),X(e,n)};G(i,e=>{n()?e(a):Q(De).amAdmin?e(o,1):e(s,-1)}),X(e,r)};G(U,e=>{Q(De)&&e(_e)});var ve=g(U,2),ye=e=>{var n=TXe(),r=j(n);CS(r,{size:14,class:`mr-1`,"aria-hidden":`true`});var i=g(r,1,!0);H(n),O((e,t)=>{b(n,`title`,e),Y(i,t)},[()=>`Previewing ${cx(E()[t()[0]])} â click to look through it too`,()=>cx(E()[t()[0]])]),L(`click`,n,()=>{fhe(t()[0]),I(V,!1)}),X(e,n)},be=q(()=>!n()&&E()[t()[0]]&&!oe(u(),d()?.name??``,t()[0],p()));G(ve,e=>{Q(be)&&e(ye)});var xe=g(ve,2),K=e=>{let i=q(()=>oe(u(),d()?.name??``,t()[0],p()));var a=fe(),o=N(a),s=e=>{var n=EXe(),i=f(n,!0);O((e,t,a,o)=>{r(n,1,`peer-request shrink-0 rounded px-2 py-0.5 text-xs ${e??``}`),n.disabled=t,b(n,`title`,a),Y(i,o)},[()=>D().includes(t()[0])?`bg-gray-700 text-gray-500`:`bg-gray-600 text-gray-100 hover:bg-gray-500`,()=>D().includes(t()[0]),()=>D().includes(t()[0])?`Asked â they decide`:`Ask them to share this scene with the session`,()=>D().includes(t()[0])?`Requestedâ¦`:`Request access`]),L(`click`,n,()=>Ie(t()[0])),X(e,n)},c=q(()=>ce(u(),t()[0],n())),l=e=>{var t=DXe();ZR(j(t),{size:14,class:`mr-1`,"aria-hidden":`true`}),W(),H(t),L(`click`,t,()=>Le()),X(e,t)},m=e=>{var n=OXe();ZR(j(n),{size:14,class:`mr-1`,"aria-hidden":`true`}),W(),H(n),O(()=>b(n,`title`,`In `+Q(i)+` â travel to their scene`)),L(`click`,n,()=>Fe(t()[0])),X(e,n)},_=e=>{var n=kXe(),a=j(n);Wx(a,{size:16,class:`mr-1`,"aria-hidden":`true`});var o=g(a,1,!0);H(n),O(()=>{r(n,1,`peer-watch shrink-0 rounded px-2 py-0.5 text-xs ${Q(i)?`bg-gray-700 text-gray-500`:h()===t()[0]?`bg-primary-600 text-white`:`bg-gray-600 text-gray-100 hover:bg-gray-500`}`),n.disabled=!!Q(i),b(n,`title`,Q(i)?`In `+Q(i)+` â open that scene to watch them`:h()===t()[0]?`Watching (exit from the banner)`:`Watch this peer`),Y(o,h()===t()[0]?`Watching`:`Watch`)}),L(`click`,n,()=>{tt(t()[0]),I(V,!1)}),L(`contextmenu`,n,e=>ge(e,t()[0])),X(e,n)};G(o,e=>{Q(c)?e(s):Q(i)===`(the session)`?e(l,1):Q(i)?e(m,2):e(_,-1)}),X(e,a)};G(xe,e=>{n()||e(K)}),H(a),O(e=>{r(a,1,`peers-row flex items-center gap-2 rounded px-1.5 py-1 ${h()===t()[0]?`bg-primary-800/60`:`hover:bg-gray-700/60`}`),b(l,`title`,t()[1]||`Peer`),Y(m,t()[1]||`Peer`),Y(A,e)},[()=>he(t()[0])]),X(e,a)},oe=Gb,R=`Untitled scene`;function se(e,t,n,r){if(r)return t?.private?(t?.name||R)+` (private)`:t?.name||R;let i=e?.[n];return i?.private?`Private scene`:i?i.scene||R:``}let ce=(e,t,n)=>!n&&e?.[t]?.private===!0,le=e=>e===`good`?`#4ade80`:e===`ok`?`#fbbf24`:e===`bad`?`#f87171`:`#9ca3af`,de=t(!1),pe=t(null),V=t(!1);function he(e){return String(e??``).slice(0,6)}function ge(e,t){e.preventDefault(),I(pe,{x:e.clientX,y:e.clientY,peerId:t},!0)}let U=`z-10 z-10 inline-flex w-40 shrink-0 shrink-0 items-center rounded-s-lg border border-gray-300 bg-gray-100 px-4 py-2.5 text-center text-sm font-medium text-gray-500 hover:bg-gray-200 focus:outline-hidden focus:ring-4 focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-700`,ve=t(``);function ye(e){let t=e.target.files[0];if(e.target.files&&t){let e=new FileReader;e.onload=function(e){I(ve,e.target.result,!0),nt.setItem(`avatar`,Q(ve)),i().forEac
2450h(e=>{e[0]===a().peer.id&&(e[2]=Q(ve))}),a().send({type:`userdata`,userdata:i()})},e.readAsDataURL(t);try{nt.removeItem(`avatarReset`)}catch{}}}let be=e=>typeof localStorage<`u`?nt.getItem(e):null,xe=()=>be(`usernameCustom`)===`1`,we=q(o),Ee=q(()=>s()||Q(we)?.username||`Anonymous`),J=q(()=>Q(ve)||be(`avatar`)||Q(we)?.avatar||``),De=q(c),Oe=q(()=>(l()?.rooms??[]).filter(e=>e&&e.id!==l()?.myRoomId&&(e.members?.length??0)>0)),Ae=t(Ne(be(`peers:view`)===`rooms`?`rooms`:`flat`));function je(e){I(Ae,e,!0);try{nt.setItem(`peers:view`,e)}catch{}}let Me=q(()=>a()?.peer?.id||i()?.[0]?.[0]||``),Pe=q(()=>{let e=u()??{},t=i()??[],n=e=>t.find(t=>t[0]===e),r=d()?.private===!0,a=r?``:d()?.name??``,o=p(),s=Gme(e,o,a),c=r?null:tx({scene:a},s)??``,l=new Set,f=e=>{let t=n(e);return t&&l.add(e),t},m=()=>{let e=n(Q(Me));return e&&l.add(Q(Me)),e?[e]:[]},h=[];for(let t of qme(e,r?null:{scene:a},o)){let e=[...t.mine?m():[],...t.peerIds.map(f).filter(Boolean)];e.length&&h.push({key:`scene:`+t.scene,label:t.scene,mine:t.mine,title:`Standing in `+t.scene,users:e})}let g=[...c===``?m():[],...Object.keys(e).filter(t=>!e[t]?.private&&tx(e[t],s)===``).map(f).filter(Boolean)];g.length&&h.push({key:`untitled`,label:R,mine:c===``,title:`The sessionâs unnamed world â nobody has saved a scene yet`,users:g}),h.sort((e,t)=>e.mine===t.mine?0:e.mine?-1:1);let _=[...r?m():[],...Object.keys(e).filter(t=>e[t]?.private).map(f).filter(Boolean)],v=t.filter(e=>!l.has(e[0]));return v.length&&h.push({key:`unknown`,label:`Scene unknown`,mine:!1,title:`They have not said which scene they are in â an older build`,users:v}),_.length&&h.push({key:`private`,label:`In a private scene`,mine:!1,title:`A scene of their own that this session has never seen â its name never leaves their machine, and nothing they edit crosses over`,users:_}),h});function Fe(e){SZ(e,()=>I(V,!1))}function Ie(e){CQ(e)}function Le(){OQ().then(e=>{e&&I(V,!1)})}function Re(){DQ().then(e=>{e&&I(V,!1)})}function ze(){TQ()}let He=q(()=>m().state===`playing`||m().state===`paused`),Ue=(e,t,n,r)=>r?t===!0?`playing`:`editor`:e[n]===`playing`?`playing`:`editor`,Z=q(()=>m().round>0||m().state!==`menu`),We=q(()=>f_e(Q(De),p(),a()));function Ge(){let e=d_e();!e.ok&&e.reason&&es(e.reason),I(V,!1)}let Ke=t(null),Je=t(Ne({top:0,right:0}));function Ye(e,t){if(e.stopPropagation(),Q(Ke)===t){I(Ke,null);return}let n=e.currentTarget.getBoundingClientRect();I(Je,{top:n.bottom+4,right:Math.max(8,window.innerWidth-n.right)},!0),I(Ke,t,!0)}function Xe(e){return document.body.appendChild(e),{destroy(){e.remove()}}}function $e(){a()?.peer&&(i().forEach(e=>{e[0]===a().peer.id&&(e[1]=s()||``,e[2]=be(`avatar`)||Q(ve)||Q(we)?.avatar||``)}),a().send({type:`userdata`,userdata:i()}))}_e(()=>{xe()&&be(`username`)&&K(()=>pc.set(be(`username`)||``))}),Qe(()=>{let e=o();K(()=>{let t=!1;!xe()&&e?.username&&s()!==e.username&&(pc.set(e.username),t=!0),!be(`avatar`)&&e?.avatar&&Q(ve)!==e.avatar&&(t=!0),t&&$e()})});function et(){try{nt.setItem(`username`,s()||``),nt.setItem(`usernameCustom`,(s()||``).trim()?`1`:`0`)}catch{}$e()}function $(){I(ve,``);try{nt.removeItem(`avatar`)}catch{}$e()}function tt(e){if(h())return;ke(zs,e),jo([`chat`,`flow`]),ke(Ti,new pt),_().position.copy(v().position),_().rotation.copy(v().rotation),me(Ti,K(_).zoom=v().zoom,K(_)),me(Ti,K(_).fov=v().fov,K(_));let t=y().getObjectByName(e);t&&(y().getObjectByName(e).visible=!1,v().position.set(t.position.x,t.position.y,t.position.z),v().rotation.set(t.rotation.x,t.rotation.y,t.rotation.z),t.attach(v()),i()&&i().forEach(t=>{t[0]===e&&t[4]&&me(yi,K(v).fov=t[4],K(v))}),v().updateProjectionMatrix(),a().send({type:`specator`,peerId:a().peer.id,watching:e}))}var rt=$Xe(),it=N(rt),at=j(it),ot=j(at),st=j(ot);mge(st,{size:16,class:`text-xs`,"aria-hidden":`true`}),H(ot);var ct=g(ot,2);pXe(ct,{});var lt=g(ct,2),ut=e=>{var t=UXe(),n=j(t),a=j(n);B(a,5,()=>i().slice(1,4),e=>e[0],(e,t)=>{oo(e,{stacked:!0,get src(){return Q(t)[2]},class:`h-7 w-7 rounded-full border-2 border-gray-800`})}),H(a);var o=g(a,2),s=f(o,!0);H(n);var c=g(n,2),u=e=>{var t=HXe(),n=N(t),a=g(n,2),o=j(a),s=j(o),c=f(s),u=g(s,2),p=j(u),m=g(p,2);H(u),H(o);var h=g(o,2),_=e=>{var t=jXe(),n=j(t),r=g(j(n)),i=f(r,!0);W(),H(n);var a=g(n,2),o=j(a),s=g(o,2);H(a),H(t),O(()=>Y(i,d().name)),L(`click`,o,ze),L(`click`,s,Re),X(e,t)};G(h,e=>{d()?.private&&e(_)});var v=g(h,2),y=j(v),x=e=>{var t=fe(),n=N(t);B(n,17,()=>Q(Pe),e=>e.key,(e,t)=>{var n=NXe(),r=N(n),i=j(r),a=f(i,!0),o=g(i,2),s=f(o),c=g(o,2),l=e=>{var t=MXe();X(e,t)};G(c,e=>{Q(t).mine&&e(l)}),H(r);var u=g(r,2);B(u,17,()=>Q(t).users,e=>e[0],(e,t)=>{ae(e,()=>Q(t),()=>Q(t)[0]===Q(Me),()=>!1)}),O(()=>{b(r,`data-mine`,Q(t).mine?`true`:null),b(r,`title`,Q(t).title),Y(a,Q(t).label),Y(s,`(${Q(t).users.length??``})`)}),X(e,n)}),X(e,t)},S=e=>{var t=fe(),n=N(t);B(n,3,i,e=>e[0],(e,t,n)=>{ae(e,()=>Q(t),()=>Q(n)===0,()=>!0)}),X(e,t)};G(y,e=>{Q(Ae)===`rooms`?e(x):e(S,-1)}),H(v);var C=g(v,2),w=e=>{var t=PXe(),n=f(t);O(()=>{n.disabled=!Q(We),b(n,`title`,Q(We)?`Send everyone back to the game menu`:Q(De)?`Only an admin can reset the game`:`Only the session host can reset the game`)}),L(`click`,n,Ge),X(e,t)};G(C,e=>{Q(Z)&&e(w)});var T=g(C,2),E=e=>{var t=RXe();B(t,21,()=>Q(Oe),e=>e.id,(e,t)=>{var n=LXe(),r=N(n),i=f(r),a=g(r,2);B(a,17,()=>Q(t).members??[],e=>e.peerId,(e,n)=>{var r=IXe(),i=j(r),a=f(i,!0),o=g(i,2),s=f(o,!0),c=g(o,4),u=e=>{var r=FXe();L(`click`,r,()=>l().invite(Q(n).peerId,Q(t))),X(e,r)};G(c,e=>{typeof l()?.invite==`function`&&e(u)}),H(r),O(e=>{b(i,`title`,Q(n).name||Q(n).peerId),Y(a,e),b(o,`data-mode`,Q(n).mode===`playing`?`playing`:`editor`),Y(s,Q(n).mode===`playing`?`playing`:`editor`)},[()=>Q(n).name||String(Q(n).peerId??``).slice(0,6)]),X(e,r)}),O(()=>Y(i,`in ${(Q(t).scene||Q(t).name||`another scene`)??``}`)),X(e,n)}),H(t),X(e,t)};G(T,e=>{Q(Oe).length&&e(E)});var D=g(T,2),ee=e=>{var t=zXe(),n=j(t);bo(n,{get mount(){return te()}}),H(t),X(e,t)};G(D,e=>{te()&&e(ee)}),H(a);var M=g(a,2),P=e=>{let t=q(()=>Q(Ke));var n=VXe();B(n,21,()=>Q(De).order,Be,(e,n)=>{var i=BXe();let a;var o=j(i),s=f(o,!0),c=g(o),l=e=>{$R(e,{size:16,class:`role-check`,"aria-hidden":`true`})},u=q(()=>Q(De).roleOf(Q(t))===Q(n));G(c,e=>{Q(u)&&e(l)}),H(i),O((e,t)=>
2450{a=r(i,1,`role-menu-item svelte-173ze8w`,null,a,{sel:e}),b(i,`aria-selected`,t),b(o,`data-role`,Q(n)),Y(s,Q(n))},[()=>Q(De).roleOf(Q(t))===Q(n),()=>Q(De).roleOf(Q(t))===Q(n)]),L(`click`,i,e=>{e.stopPropagation(),Q(De).setRole(Q(t),Q(n)),I(Ke,null)}),X(e,i)}),H(n),ne(n,e=>Xe?.(e)),O(()=>Ze(n,`top:${Q(Je).top??``}px; right:${Q(Je).right??``}px;`)),X(e,n)};G(M,e=>{Q(Ke)&&Q(De)&&Q(De).amAdmin&&e(P)}),O(()=>{Ze(a,`z-index: 998; ${k()?`position: fixed; top: ${A()+44}px; right: 8px; left: auto; max-width: calc(100vw - 16px);`:``}`),Y(c,`Connected (${i().length??``})`),b(p,`aria-pressed`,Q(Ae)===`flat`),b(m,`aria-pressed`,Q(Ae)===`rooms`)}),L(`click`,n,()=>{I(V,!1),I(Ke,null)}),L(`click`,p,()=>je(`flat`)),L(`click`,m,()=>je(`rooms`)),X(e,t)};G(c,e=>{Q(V)&&e(u)}),H(t),O(()=>Y(s,i().length)),L(`click`,n,()=>I(V,!Q(V))),X(e,t)};G(lt,e=>{(i()&&i().length>1&&a()&&a().openedPeers?.size>0||Q(Oe).length>0)&&e(ut)}),H(at);var dt=g(at,2),ft=j(dt),mt=j(ft),ht=j(mt);{let e=q(()=>Q(J)||void 0);oo(ht,{get src(){return Q(e)},class:`h-12 w-12 rounded-full border-2 border-gray-600 dark:border-gray-600`})}H(mt),H(ft),H(dt);var gt=g(dt,2);uo(gt,{id:`avatar-dropdown`,placement:`bottom-end`,triggeredBy:`#avatar-trigger`,class:`w-56`,style:`border-top-right-radius: 1.5rem; padding-right: 0px; z-index: 996; margin-top: -50px;`,get isOpen(){return Q(de)},set isOpen(e){I(de,e,!0)},children:(e,t)=>{var n=JXe(),r=N(n),i=j(r);{let e=q(()=>Q(J)||void 0);oo(i,{get src(){return Q(e)},class:`h-12 w-12 rounded-full border-2 border-gray-600 dark:border-gray-600`})}H(r);var a=g(r,2);go(a,{children:(e,t)=>{var n=GXe(),r=j(n),i=f(r,!0),a=g(r,2),o=e=>{var t=WXe(),n=f(t,!0);O(()=>Y(n,Q(we).email)),X(e,t)};G(a,e=>{Q(we)?.email&&e(o)}),H(n),O(()=>Y(i,Q(Ee))),X(e,n)},$$slots:{default:!0}});var o=g(a,2);io(o,{children:(e,t)=>{var n=KXe(),r=N(n);yo(r,{onclick:()=>{Js.set(!0),I(de,!1)},children:(e,t)=>{W();var n=Te(`Customize Character`);X(e,n)},$$slots:{default:!0}});var i=g(r,2);yo(i,{onclick:()=>{Ys.set(!0),I(de,!1)},children:(e,t)=>{W();var n=Te(`Profile Settings`);X(e,n)},$$slots:{default:!0}}),X(e,n)},$$slots:{default:!0}});var s=g(o,2),c=e=>{var t=qXe(),n=N(t);fo(n,{});var r=g(n,2),i=j(r);bo(i,{get mount(){return P()}}),H(r),X(e,t)};G(s,e=>{P()&&e(c)}),L(`click`,r,()=>I(de,!1)),X(e,n)},$$slots:{default:!0}}),H(it);var _t=g(it,2),vt=e=>{{let t=q(()=>[{label:x().includes(Q(pe).peerId)?`Unmute voice`:`Mute voice`,action:()=>Oce(Q(pe).peerId)}]);xS(e,{get x(){return Q(pe).x},get y(){return Q(pe).y},get items(){return Q(t)},$$events:{close:()=>I(pe,null)}})}};G(_t,e=>{Q(pe)&&e(vt)});var yt=g(_t,2);co(yt,{title:``,outsideclose:!0,modal:!1,onkeydown:e=>{e.key===`Escape`&&Ys.set(!1)},class:`tp-modal-frame`,get open(){return Se(),re()},set open(e){ke(Ys,e)},children:(e,t)=>{var n=QXe(),i=g(N(n),2),o=j(i),c=j(o);r(c,1,M(U),`svelte-173ze8w`);var l=g(c,2),u=g(l,2),d=j(u),p=e=>{var t=YXe();O(()=>b(t,`src`,Q(J))),L(`click`,t,()=>document.getElementById(`avatar-file`).click()),X(e,t)},m=e=>{var t=XXe();L(`click`,t,()=>document.getElementById(`avatar-file`).click()),X(e,t)};G(d,e=>{Q(J)?e(p):e(m,-1)});var h=g(d,2),_=e=>{var t=ZXe(),n=f(t);O(()=>Y(n,`Reset to ${Q(we)?.avatar?`account picture`:`default`}`)),L(`click`,t,$),X(e,t)},v=q(()=>Q(ve)||typeof localStorage<`u`&&nt.getItem(`avatar`));G(h,e=>{Q(v)&&e(_)}),H(u),H(o);var y=g(o,4),x=j(y);r(x,1,U+` rounded-bl-none`,`svelte-173ze8w`);var S=g(x,2);vo(S,{id:`peer-id`,class:`rounded-s-none! rounded-br-none`,get placeholder(){return a().peer.id},disabled:!0}),H(y);var C=g(y,2),w=j(C);r(w,1,U+` rounded-tl-none`,`svelte-173ze8w`);var T=g(w,2);{let e=q(()=>Q(we)?.username?``+Q(we).username:`Username`);vo(T,{id:`update-username`,class:`rounded-s-none! rounded-tr-none`,get placeholder(){return Q(e)},onchange:et,get value(){return Se(),s()},set value(e){ke(pc,e)}})}H(C),H(i),W(2),L(`change`,l,e=>ye(e)),X(e,n)},$$slots:{default:!0}}),O(()=>{Ze(it,`position: fixed; right: 0px; z-index: 997; top: ${k()?A()+`px`:`0px`};`),r(ot,1,`flex h-8 w-8 items-center justify-center rounded-full border border-gray-700/60 bg-gray-800/85 text-gray-200 backdrop-blur-sm hover:bg-gray-700/85 ${ee()?`ring-2 ring-primary-500/60`:``}`)}),L(`click`,ot,()=>Gs.update(e=>!e)),X(e,rt),ue(),F()}ge([`click`,`contextmenu`,`change`]);var kQ=`gh:stars:core`,tZe=432e5,AQ=Ue(null),jQ=!1;function nZe(){try{let e=nt.getItem(kQ);if(!e)return null;let t=JSON.parse(e);return typeof t?.n==`number`?t:null}catch{return null}}function rZe(){if(jQ||Om||typeof window>`u`)return;jQ=!0;let e=nZe();e&&AQ.set(e.n),!(e&&Date.now()-e.ts<tZe)&&fetch(`https://api.github.com/repos/theprototype-app/core`,{headers:{Accept:`application/vnd.github+json`}}).then(e=>e.ok?e.json():null).then(e=>{let t=e?.stargazers_count;if(typeof t==`number`){AQ.set(t);try{nt.setItem(kQ,JSON.stringify({n:t,ts:Date.now()}))}catch{}}}).catch(()=>{})}var iZe=V(`<span class="welcome-stars svelte-35zmm4"> </span>`),aZe=V(`<div class="welcome-backdrop svelte-35zmm4" style="z-index: calc(var(--z-modal) - 1)"></div> <div id="welcome-overlay" class="welcome-card svelte-35zmm4" style="z-index: var(--z-modal)" role="dialog" aria-modal="true" aria-label="Welcome to theprototype.app" tabindex="-1"><div class="welcome-head svelte-35zmm4"><img src="logo.svg" alt="" class="h-8 w-8"/> <div><h2 class="welcome-title svelte-35zmm4">theprototype<span class="welcome-dim svelte-35zmm4">.app</span></h2> <p class="welcome-ver svelte-35zmm4"> </p></div> <button class="welcome-x svelte-35zmm4" title="Close" aria-label="Close welcome">â</button></div> <p class="welcome-lead svelte-35zmm4">Build 3D prototypes in your browser â alone or together. Sessions are <strong class="svelte-35zmm4">peer‑to‑peer</strong>: share your ID and everything you do shows up for 2451 everyone, with no account and no server holding your scene.</p> <p class="welcome-sub svelte-35zmm4">Right‑click the viewport to add something, or open the logo menu for files, modules and 2452 settings. Not sure where to start? The logo menu's <strong>Templates</strong> has starting 2453 scenes, examples and community creations.</p> <div class="welcome-actions svelte-35zmm4"><button id="welcome-start" class="welcome-btn welcome-btn-primary svelte-35zmm4">Start building</button> <button id="welcome-templates" class="welcome-btn svelte-35zmm4">Start from a template</button> <button class="welcome-btn svelte-35zmm4">â¶ Watch the demo</button> <button class="welcome-btn svelte-35zmm4">GitHub<!></button></div> <div class="welcome-foot svelte-35zmm4"><label class="welcome-check svelte-35zmm4"><input type="checkbox"/> Show this on start</label> <button class="welcome-link svelte-35zmm4">What's new</button></div></div>`,1);function oZe(e,t){Ce(t,!1);let n=()=>z(jhe,`$welcomeOpen`,a),r=()=>z(AQ,`$githubStars`,a),i=()=>z(Dx,`$showWelcomeOnStart`,a),[a,o]=Ve();rZe();let s=e=>e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,``)+`k`:String(e);function c(){Ex()}function l(){Ex(),Ls.set(!0)}function u(){window.open(`https://www.youtube.com/watch?v=yR21_x4jV7g&list=PLBSyotD7wAZvjCW3ZSKQbNpb-9_f7Q3YM`,`_blank`,`noopener`)}function d(){window.open(`https://github.com/theprototype-app/core`,`_blank`,`noopener`)}function p(e){e.key===`Escape`&&(e.preventDefault(),Ex())}R();var m=fe(),h=N(m),_=e=>{var t=aZe(),n=g(N(t),2),a=j(n),o=g(j(a),2),m=g(j(o),2),h=f(m,!0);H(o);var _=g(o,2);H(a);var y=g(a,6),x=j(y),S=g(x,2),C=g(S,2),T=g(C,2),E=g(j(T)),D=e=>{var t=iZe(),n=f(t);O(e=>{b(t,`title`,`${r()??``} stars on GitHub`),Y(n,`â ${e??``}`)},[()=>s(r())]),X(e,t)};G(E,e=>{r()!==null&&e(D)}),H(T),H(y);var k=g(y,2),A=j(k),ee=j(A);v(ee),W(),H(A);var M=g(A,2);H(k),H(n),O(e=>
2453{Y(h,e),w(ee,i())},[()=>Bc()]),L(`keydown`,n,p),L(`click`,_,function(...e){Ex?.apply(this,e)}),L(`click`,x,c),L(`click`,S,l),L(`click`,C,u),L(`click`,T,d),L(`change`,ee,e=>Dx.set(e.target.checked)),L(`click`,M,()=>{Ex(),Tx()}),X(e,t)};G(h,e=>{n()&&e(_)}),X(e,m),ue(),o()}ge([`keydown`,`click`,`change`]);var sZe=V(`<h3 class="svelte-1hzw7bv"></h3>`),cZe=V(`<h4 class="svelte-1hzw7bv"></h4>`),lZe=V(`<li class="svelte-1hzw7bv"></li>`),uZe=V(`<ul class="svelte-1hzw7bv"></ul>`),dZe=V(`<p class="svelte-1hzw7bv"></p>`),fZe=V(`<details class="wn-release svelte-1hzw7bv"><summary class="svelte-1hzw7bv"><h2 class="svelte-1hzw7bv"></h2></summary> <!></details>`),pZe=V(`<div id="whats-new-window" tabindex="-1" class="ui-panel fixed flex flex-col overflow-hidden outline-hidden svelte-1hzw7bv" style="z-index: var(--z-window); width: min(620px, 94vw); height: min(620px, 80vh)"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span>⨠What's new</span> <span class="flex-1"></span> <button id="whats-new-close" class="ui-button-quiet" title="Close">â</button></div> <div class="wn-body min-h-0 flex-1 overflow-y-auto px-4 py-3 svelte-1hzw7bv"><!> <!></div></div>`);function mZe(n,r){Ce(r,!0);let i=()=>z(Nhe,`$whatsNewOpen`,a),[a,o]=Ve(),s=t(null);Qe(()=>{i()&&setTimeout(()=>Q(s)?.focus(),0)});let c=t(!1);Qe(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: 640px)`),t=()=>I(c,e.matches,!0);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}),Qe(()=>{let e=i()&&Q(c);return document.documentElement.classList.toggle(`wn-sheet`,e),()=>document.documentElement.classList.remove(`wn-sheet`)});function l(e){e.key===`Escape`&&(e.preventDefault(),Ox())}function u(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function d(e){return u(e).replace(/`([^`]+)`/g,`<code>$1</code>`).replace(/\*\*([^*]+)\*\*/g,`<strong>$1</strong>`).replace(/\[([^\]]+)\]\((https?:[^)\s]+)\)/g,`<a href="$2" target="_blank" rel="noopener">$1</a>`)}function f(e){let t=e.replace(/<!--[\s\S]*?-->/g,``),n=[],r=[],i=[],a=()=>{r.length&&n.push({kind:`p`,html:d(r.join(` `))}),r=[]},o=()=>{i.length&&n.push({kind:`ul`,html:``,items:i.map(d)}),i=[]},s=()=>{a(),o()};for(let e of t.split(/\r?\n/)){let t=e.trim();if(!t){s();continue}let o=/^(#{1,4})\s+(.*)$/.exec(t);if(o){s(),n.push({kind:`h`+o[1].length,html:d(o[2])});continue}let c=/^[-*]\s+(.*)$/.exec(t);if(c){a(),i.push(c[1]);continue}i.length?i[i.length-1]+=` `+t:r.push(t)}return s(),n}let p=f(Mhe).filter(e=>e.kind!==`h1`),m=[],h=[];for(let e of p)e.kind===`h2`?h.push({title:e.html,body:[]}):h.length?h[h.length-1].body.push(e):m.push(e);var _=fe(),v=N(_),y=t=>{var n=pZe(),r=j(n),i=g(j(r),4);H(r);var a=g(r,2);{let t=(t,n=qe)=>{var r=fe(),i=N(r);B(i,17,n,Be,(t,n)=>{var r=fe(),i=N(r),a=t=>{var r=sZe();e(r,()=>Q(n).html,!0),H(r),X(t,r)},o=t=>{var r=cZe();e(r,()=>Q(n).html,!0),H(r),X(t,r)},s=t=>{var r=uZe();B(r,21,()=>Q(n).items??[],Be,(t,n)=>{var r=lZe();e(r,()=>Q(n),!0),H(r),X(t,r)}
2453),H(r),X(t,r)},c=t=>{var r=dZe();e(r,()=>Q(n).html,!0),H(r),X(t,r)};G(i,e=>{Q(n).kind===`h3`?e(a):Q(n).kind===`h4`?e(o,1):Q(n).kind===`ul`?e(s,2):e(c,-1)}),X(t,r)}),X(t,r)};var o=j(a);t(o,()=>m);var c=g(o,2);B(c,19,()=>h,e=>e.title,(n,r,i)=>{var a=fZe(),o=j(a),s=j(o);e(s,()=>Q(r).title,!0),H(s),H(o);var c=g(o,2);t(c,()=>Q(r).body),H(a),O(()=>a.open=Q(i)===0),X(n,a)}),H(a)}H(n),We(n,e=>I(s,e),()=>Q(s)),ne(n,(e,t)=>Zh?.(e,t),()=>({key:`whatsNewWin`,defaultRect:{left:220,top:90},resizable:!0,minW:320,minH:240})),ne(n,e=>Kh?.(e)),L(`keydown`,n,l),L(`click`,i,function(...e){Ox?.apply(this,e)}),X(t,n)};G(v,e=>{i()&&e(y)}),X(n,_),ue(),o()}ge([`keydown`,`click`]);function hZe(e,t={}){if(!e)return[];if(/^[[.#]/.test(e))return[e];let n=[`[data-tour="${e.replace(/["\\]/g,``)}"]`];return t[e]&&n.push(t[e]),n}function gZe(e,t,n,r,i=`auto`){if(n<520){let i=n-24,a=!e||e.y+e.h/2<r/2;return{x:12,y:a?Math.max(12,r-t.h-12):12,side:a?`sheet-bottom`:`sheet-top`,w:i}}let a=t.w,o={x:Math.round((n-a)/2),y:Math.round((r-t.h)/2),side:`center`,w:a};if(!e||i===`center`)return o;let s=e=>Math.min(Math.max(12,e),n-a-12),c=e=>Math.min(Math.max(12,e),r-t.h-12),l=e.x+e.w/2,u=e.y+e.h/2,d={bottom:()=>e.y+e.h+16+t.h<=r-12?{x:s(l-a/2),y:e.y+e.h+16}:null,top:()=>e.y-16-t.h>=12?{x:s(l-a/2),y:e.y-16-t.h}:null,right:()=>e.x+e.w+16+a<=n-12?{x:e.x+e.w+16,y:c(u-t.h/2)}:null,left:()=>e.x-16-a>=12?{x:e.x-16-a,y:c(u-t.h/2)}:null},f=[`bottom`,`top`,`right`,`left`];i&&d[i]&&f.unshift(i);for(let e of f){let t=d[e]();if(t)return{...t,side:e,w:a}}return o}var _Ze=V(`<div id="tour-spotlight" class="tour-spot svelte-tvkmlc" aria-hidden="true"></div>`),vZe=V(`<div class="tour-family svelte-tvkmlc" role="group" aria-label="Controllers"><button>Quest 2</button> <button>Quest 3 / 3S</button></div>`),yZe=V(`<p class="tour-dim svelte-tvkmlc"> </p>`),bZe=V(`<div class="tour-art svelte-tvkmlc"></div> <!>`,1),xZe=V(`<p class="tour-hint svelte-tvkmlc"> </p>`),SZe=V(`<button id="tour-back" class="tour-btn svelte-tvkmlc">Back</button>`),CZe=V(`<!> <div id="tour-card" role="dialog" aria-modal="false" aria-labelledby="tour-title" tabindex="-1"><div class="tour-head svelte-tvkmlc"><span class="tour-name svelte-tvkmlc"> </span> <span class="tour-count svelte-tvkmlc" id="tour-count"> </span></div> <h3 id="tour-title" class="tour-title svelte-tvkmlc"> </h3> <p class="tour-body svelte-tvkmlc"> </p> <!> <!> <div class="tour-actions svelte-tvkmlc"><button id="tour-skip" class="tour-link svelte-tvkmlc">Skip</button> <button id="tour-never" class="tour-link svelte-tvkmlc">Don't show again</button> <span class="tour-spacer svelte-tvkmlc"></span> <!> <button id="tour-next" class="tour-btn tour-primary svelte-tvkmlc"> </button></div></div>`,1);function wZe(n,i){Ce(i,!0);let a=()=>z(wx,`$activeTour`,s),o=()=>z(wi,`$isVRMode`,s),[s,c]=Ve(),l=null;_e(()=>{l=Ihe()}),Pe(()=>l?.());let u=q(()=>a()&&!o()&&(a().surface===`card`||a().preview)?a():null),d=t(null),p=t(null),m=t(Ne({x:0,y:0,side:`center`,w:340})),h=t(Ne(nt.getItem(`tourControllerFamily`)||`quest3`));function _(e){for(let t of hZe(e??``,Rhe)){let e=null;try{e=document.querySelector(t)}catch{e=null}let n=e?.getBoundingClientRect();if(e instanceof HTMLElement&&n&&n.width>0&&n.height>0)return e}return null}function v(){if(!Q(u))return;let e=(Q(u).step.placement===`center`?null:_(Q(u).step.target))?.getBoundingClientRect();I(p,e?{x:e.x-6,y:e.y-6,w:e.width+12,h:e.height+12}:null,!0);let t=window.innerWidth,n=window.innerHeight,r={w:Math.min(360,t-24),h:Q(d)?.offsetHeight||200};I(m,gZe(Q(p),r,t,n,Q(u).step.placement??`auto`),!0)}Qe(()=>{if(!Q(u))return;Q(u).step.id,Q(h);let e=requestAnimationFrame(()=>{v(),requestAnimationFrame(v),Q(d)?.focus({preventScroll:!0})});window.addEventListener(`resize`,v);let t=setInterval(v,400);return()=>{cancelAnimationFrame(e),window.removeEventListener(`resize`,v),clearInterval(t)}});function y(e){e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),Cx.skip()):e.key===`ArrowRight`?(e.preventDefault(),Cx.next()):e.key===`ArrowLeft`&&(e.preventDefault(),Cx.back())}let x={line:`var(--muted, #9ca3af)`,fill:`var(--surface-2, #374151)`,accent:`var(--accent, #3b82f6)`,accentFill:`var(--accent, #3b82f6)`,text:`var(--text, #f3f4f6)`,label:`#ffffff`};var S=fe(),C=N(S),w=t=>{var n=CZe(),i=N(n),a=e=>{var t=_Ze();O(()=>Ze(t,`left: ${Q(p).x??``}px; top: ${Q(p).y??``}px; width: ${Q(p).w??``}px; height: ${Q(p).h??``}px;`)),X(e,t)};G(i,e=>{Q(p)&&e(a)});var o=g(i,2);let s;var c=j(o),l=j(c),_=f(l),v=g(l,2),S=f(v);H(c);var C=g(c,2),w=f(C,!0),T=g(C,2),E=f(T,!0),D=g(T,2),k=t=>{var n=bZe(),i=N(n);e(i,()=>fI({family:Q(h),lit:pI(Q(u).step.controls),colors:x}),!0),H(i);var a=g(i,2),o=e=>{var t=vZe(),n=j(t);let i;var a=g(n,2);let o;H(t),O(()=>{i=r(n,1,`svelte-tvkmlc`,null,i,{on:Q(h)===`quest2`}),o=r(a,1,`svelte-tvkmlc`,null,o,{on:Q(h)===`quest3`})}),L(`click`,n,()=>I(h,`quest2`)),L(`click`,a,()=>I(h,`quest3`)),X(e,t)},s=e=>{var t=yZe(),n=f(t,!0);O(e=>Y(n,e),[()=>uI(Q(h))]),X(e,t)};G(a,e=>{Q(u).preview?e(o):e(s,-1)}),O(()=>b(i,`data-family`,Q(h))),X(t,n)};G(D,e=>{Q(u).step.controls&&e(k)});var A=g(D,2),ee=e=>{var t=xZe(),n=f(t);O(()=>Y(n,`â ${Q(u).step.hint??``}`)),X(e,t)};G(A,e=>{Q(u).step.hint&&e(ee)});var M=g(A,2),te=j(M),ne=g(te,2),P=g(ne,4),re=e=>{var t=SZe();L(`click`,t,()=>Cx.back()),X(e,t)};G(P,e=>{Q(u).first||e(re)});var ie=g(P,2),F=f(ie,!0);H(M),H(o),We(o,e=>I(d,e),()=>Q(d)),O(e=>{s=r(o,1,`tour-card svelte-tvkmlc`,null,s,{sheet:e}),Ze(o,`left: ${Q(m).x??``}px; top: ${Q(m).y??``}px; width: ${Q(m).w??``}px;`),b(o,`data-tour-id`,Q(u).id),b(o,`data-step`,Q(u).step.id),b(o,`data-side`,Q(m).side),Y(_,`${Q(u).title??``}${Q(u).preview?` · preview`:``}`),Y(S,`${Q(u).index+1} / ${Q(u).total??``}`),Y(w,Q(u).step.title),Y(E,Q(u).step.body),Y(F,Q(u).last?`Done`:`Next`)},[()=>Q(m).side.startsWith(`sheet`)]),L(`keydown`,o,y),L(`click`,te,()=>Cx.skip()),L(`click`,ne,()=>Cx.dontShowAgain()),L(`click`,ie,()=>Cx.next()),X(t,n)};G(C,e=>{Q(u)&&e(w)}),X(n,S),ue(),c()}ge([`keydown`,`click`]);var TZe=V(`<!> <!> <!> <!> <div id="editor-chrome"><!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!></div> <div class="dark-mode hidden"><!></div>`,1);function EZe(e){let t=()=>z(ki,`$isLocked`,i),n=()=>z(Ym,`$embedMode`,i),[i,a]=Ve();var o=TZe(),s=N(o);kAe(s,{});var c=g(s,2);nje(c,{});var l=g(c,2);kje(l,{});var u=g(l,2);zje(u,{});var d=g(u,2),f=j(d);oZe(f,{});var p=g(f,2);mZe(p,{});var m=g(p,2);wZe(m,{});var h=g(m,2);AFe(h,{});var _=g(h,2);IIe(_,{});var v=g(_,2);vVe(v,{});var y=g(v,2);NVe(y,{});var b=g(y,2);FVe(b,{});var x=g(b,2);xKe(x,{});var S=g(x,2);gqe(S,{});
2453var C=g(S,2);$qe(C,{});var w=g(C,2);tJe(w,{});var T=g(w,2);rJe(T,{});var E=g(T,2);aYe(E,{});var D=g(E,2);sYe(D,{});var k=g(D,2);dYe(k,{});var A=g(k,2);gYe(A,{});var ee=g(A,2);bYe(ee,{});var te=g(ee,2);CYe(te,{});var ne=g(te,2);qYe(ne,{});var P=g(ne,2);YYe(P,{});var re=g(P,2);RYe(re,{});var ie=g(re,2);rXe(ie,{});var F=g(ie,2);fMe(F,{});var ae=g(F,2);eZe(ae,{});var I=g(ae,2);mMe(I,{}),gMe(g(I,2),{}),H(d);var L=g(d,2),oe=j(L);wo(oe,{}),H(L),O(()=>r(d,1,M(t()||n()?`hidden`:``))),X(e,o),a()}var DZe=V(`<li class="rounded-sm bg-gray-100 px-2 py-1 dark:bg-gray-700/70"> </li>`),OZe=V(`<ul id="confirm-dialog-items" class="mx-auto mb-4 flex max-w-xs flex-col gap-1 text-left text-sm text-gray-800 dark:text-gray-100"></ul>`),kZe=V(`<span class="block text-xs text-gray-500 dark:text-gray-400"> </span>`),AZe=V(`<label class="mx-auto mb-4 flex max-w-xs items-start gap-2 text-left text-sm text-gray-700 dark:text-gray-200"><input id="confirm-dialog-check" type="checkbox" class="tp-check mt-0.5"/> <span> <!></span></label>`),jZe=V(`<div class="flex flex-wrap justify-center gap-2"><!> <!></div>`),MZe=V(`<div class="flex justify-center gap-3"><!> <!></div>`),NZe=V(`<div class="text-center"><h3 class="mb-2 text-lg font-semibold text-gray-900 dark:text-white"> </h3> <p class="mb-5 whitespace-pre-line text-sm text-gray-600 dark:text-gray-300"> </p> <!> <!> <!></div>`);function PZe(e,t){Ce(t,!1);let n=()=>z(are,`$confirmDialog`,r),[r,i]=Ve(),a=F(!1);function o(e,t){return t&&e.checkedLabel?e.checkedLabel:e.label}d(()=>n(),()=>{I(a,!!n())}),d(()=>(Q(a),n(),zd),()=>{!Q(a)&&n()&&zd(!1)}),h(),R();var s=fe(),c=N(s),l=e=>{co(e,{size:`xs`,autoclose:!1,class:`w-full`,get open(){return Q(a)},set open(e){I(a,e)},children:(e,t)=>{var r=NZe(),i=j(r),a=f(i,!0),s=g(i,2),c=f(s,!0),l=g(s,2),u=e=>{var t=OZe();B(t,5,()=>(n(),K(()=>n().items)),e=>e,(e,t)=>{var n=DZe(),r=f(n,!0);O(()=>Y(r,Q(t))),X(e,n)}),H(t),X(e,t)};G(l,e=>{n(),K(()=>n().items?.length)&&e(u)});var d=g(l,2),p=e=>{var t=AZe(),r=j(t);v(r);var i=g(r,2),a=j(i),o=g(a),s=e=>{var t=kZe(),r=f(t,!0);O(()=>Y(r,(n(),K(()=>n().checkbox.hint)))),X(e,t)};G(o,e=>{n(),K(()=>n().checkbox.hint)&&e(s)}),H(i),H(t),O(()=>{w(r,(n(),K(()=>n().checked))),Y(a,`${n(),K(()=>n().checkbox.label)??``} `)}),Z(`change`,r,e=>ire(e.currentTarget.checked)),X(e,t)};G(d,e=>{n(),K(()=>n().checkbox)&&e(p)});var m=g(d,2),h=e=>{var t=jZe(),r=j(t);B(r,1,()=>(n(),K(()=>n().choices)),e=>e.value,(e,t)=>{{let r=ze(()=>(Q(t),K(()=>`confirm-dialog-`+Q(t).value))),i=ze(()=>(Q(t),K(()=>Q(t).color??`primary`)));Do(e,{get id(){return Q(r)},get color(){return Q(i)},onclick:()=>zd(Q(t).value),children:(e,r)=>{W();var i=Te();O(e=>Y(i,e),[()=>(Q(t),n(),K(()=>o(Q(t),n().checked)))]),X(e,i)},$$slots:{default:!0}})}});var i=g(r,2);Do(i,{id:`confirm-dialog-cancel`,color:`alternative`,onclick:()=>zd(!1),children:(e,t)=>{W();var r=Te();O(()=>Y(r,(n(),K(()=>n().cancelLabel)))),X(e,r)},$$slots:{default:!0}}),H(t),X(e,t)},_=e=>{var t=MZe(),r=j(t);Do(r,{id:`confirm-dialog-ok`,color:`red`,onclick:()=>zd(!0),children:(e,t)=>{W();var r=Te();O(()=>Y(r,(n(),K(()=>n().confirmLabel)))),X(e,r)},$$slots:{default:!0}});var i=g(r,2);Do(i,{id:`confirm-dialog-cancel`,color:`alternative`,onclick:()=>zd(!1),children:(e,t)=>{W();var r=Te();O(()=>Y(r,(n(),K(()=>n().cancelLabel)))),X(e,r)},$$slots:{default:!0}}),H(t),X(e,t)};G(m,e=>{n(),K(()=>n().choices?.length)?e(h):e(_,-1)}),H(r),O(()=>{b(r,`id`,(n(),K(()=>n().id?`confirm-`+n().id:void 0))),Y(a,(n(),K(()=>n().title))),Y(c,(n(),K(()=>n().message)))}),X(e,r)},$$slots:{default:!0},$$legacy:!0})};G(c,e=>{n()&&e(l)}),X(e,s),ue(),i()}var FZe=V(`<li class="dup-row svelte-1n5nm1c"><input class="tp-check" type="checkbox"/> <span class="dup-name svelte-1n5nm1c"> </span> <span class="dup-meta svelte-1n5nm1c"> </span> <button type="button" class="dup-reveal svelte-1n5nm1c" title="Show the file you already have">Reveal</button></li>`),IZe=V(`<div class="mb-3"><div class="mb-1 flex items-center justify-between"><p class="ui-section-label !mb-0">Scenes â a real copy is possible</p> <label class="flex cursor-pointer items-center gap-1.5 text-xs text-gray-400"><input id="dup-select-all" class="tp-check" type="checkbox"/> Select all</label></div> <ul class="dup-list svelte-1n5nm1c"></ul></div>`),LZe=V(`<li class="dup-row svelte-1n5nm1c"><span class="dup-name dup-name--wide svelte-1n5nm1c"> </span> <span class="dup-meta svelte-1n5nm1c"> </span> <button type="button" class="dup-reveal svelte-1n5nm1c" title="Show the file you already have">Reveal</button></li>`),RZe=V(`<div class="mb-3"><p class="ui-section-label">Other files â the same file, not a copy</p> <ul class="dup-list svelte-1n5nm1c"></ul> <p class="mt-1 text-xs text-gray-400">A file is identified by its contents, so two identical files of these kinds are 2454 one file. These will be left as they are.</p></div>`),zZe=V(`<h3 class="mb-1 text-lg font-semibold text-gray-900 dark:text-white">Already in your library</h3> <p class="mb-3 text-sm text-gray-600 dark:text-gray-300"> </p> <!> <!> <label class="mb-3 flex cursor-pointer items-center gap-2 text-xs text-gray-400"><input id="dup-remember" class="tp-check" type="checkbox"/> Always do this â don't ask again (Settings ⸠Files)</label> <div class="flex justify-end gap-2"><!> <!></div>`,1);function BZe(e,t){Ce(t,!1);let n=()=>z(Mme,`$duplicateImportDialog`,r),[r,i]=Ve(),a=F(),o=F(),s=F(),l=F(),u=F(!1),p=F(new Set),m=F(null),_=F(!1);function y(e){let t=new Set(Q(p));t.has(e)?t.delete(e):t.add(e),I(p,t)}function x(){I(p,Q(l)?new Set:new Set(Q(o).map(e=>e.hash)))}function S(e){Q(_)&&Pb.set(e===`copy`?`copy`:`skip`),Nb({action:e,hashes:[...Q(p)]})}function C(e){Xa(e.existing?.id),Nb({action:`skip`,hashes:[]})}function T(e){let t=(Number(e)||0)/1024;return t<1024?Math.max(1,Math.round(t))+` KB`:(t/1024).toFixed(1)+` MB`}d(()=>n(),()=>{I(u,!!n())}),d(()=>(Q(u),n(),Nb),()=>{!Q(u)&&n()&&Nb(null)}),d(()=>(n(),Q(m),Fb),()=>{n()&&n().rows!==Q(m)&&(I(m,n().rows),I(p,new Set(n().rows.filter(Fb).map(e=>e.hash))),I(_,!1))}),d(()=>n(),()=>{I(a,n()?.rows??[])}),d(()=>(Q(a),Fb),()=>{I(o,Q(a).filter(Fb))}),d(()=>(Q(a),Fb),()=>{I(s,Q(a).filter(e=>!Fb(e)))}),d(()=>(Q(o),Q(p)),()=>{I(l,Q(o).length>0&&Q(o).every(e=>Q(p).has(e.hash)))}),h(),R();var E=fe(),D=N(E),k=e=>{co(e,{size:`md`,autoclose:!1,class:`w-full`,get open(){return Q(u)},set open(e){I(u,e)},children:(e,t)=>{var r=zZe(),i=g(N(r),2),u=f(i),d=g(i,2),m=e=>{var t=IZe(),n=j(t),r=g(j(n),2),i=j(r);v(i),W(),H(r),H(n);var a=g(n,2);B(a,5,()=>Q(o),e=>e.hash,(e,t)=>
2454{var n=FZe(),r=j(n);v(r);var i=g(r,2),a=f(i,!0),o=g(i,2),s=f(o,!0),c=g(o,2);H(n),O((e,o)=>{b(n,`data-dup-hash`,(Q(t),K(()=>Q(t).hash))),b(r,`aria-label`,(Q(t),K(()=>`Import a copy of `+Q(t).name))),w(r,e),b(i,`title`,(Q(t),K(()=>Q(t).name))),Y(a,(Q(t),K(()=>Q(t).name))),Y(s,o)},[()=>(Q(p),Q(t),K(()=>Q(p).has(Q(t).hash))),()=>(Q(t),K(()=>T(Q(t).existing?.size??0)))]),Z(`change`,r,()=>y(Q(t).hash)),Z(`click`,c,()=>C(Q(t))),X(e,n)}),H(a),H(t),O(()=>w(i,Q(l))),Z(`change`,i,x),X(e,t)};G(d,e=>{Q(o),K(()=>Q(o).length)&&e(m)});var h=g(d,2),E=e=>{var t=RZe(),n=g(j(t),2);B(n,5,()=>Q(s),e=>e.hash,(e,t)=>{var n=LZe(),r=j(n),i=f(r,!0),a=g(r,2),o=f(a,!0),s=g(a,2);H(n),O(e=>{b(n,`data-dup-hash`,(Q(t),K(()=>Q(t).hash))),b(r,`title`,(Q(t),K(()=>Q(t).name))),Y(i,(Q(t),K(()=>Q(t).name))),Y(o,e)},[()=>(Q(t),K(()=>T(Q(t).existing?.size??0)))]),Z(`click`,s,()=>C(Q(t))),X(e,n)}),H(n),W(2),H(t),X(e,t)};G(h,e=>{Q(s),K(()=>Q(s).length)&&e(E)});var D=g(h,2),k=j(D);v(k),W(),H(D);var A=g(D,2),ee=j(A);{let e=ze(()=>(Q(p),K(()=>!Q(p).size)));Do(ee,{id:`dup-import-copies`,color:`primary`,get disabled(){return Q(e)},onclick:()=>S(`copy`),children:(e,t)=>{W();var n=Te(`Import as copies`);X(e,n)},$$slots:{default:!0}})}var M=g(ee,2);Do(M,{id:`dup-skip`,color:`alternative`,onclick:()=>S(`skip`),children:(e,t)=>{W();var n=Te(`Skip them`);X(e,n)},$$slots:{default:!0}}),H(A),O(()=>Y(u,`${Q(a),K(()=>Q(a).length)??``} 2455 ${Q(a),K(()=>Q(a).length===1?`file is`:`files are`)??``} byte-for-byte identical to 2456 ${Q(a),K(()=>Q(a).length===1?`a file`:`files`)??``} you already have${n(),K(()=>n().group?` (`+n().group+`)`:``)??``}. Nothing has been imported yet.`)),c(k,()=>Q(_),e=>I(_,e)),X(e,r)},$$slots:{default:!0},$$legacy:!0})};G(D,e=>{n()&&e(k)}),X(e,E),ue(),i()}var VZe=V(` <strong> </strong> would be freed`,1),MQ=V(`<!> `,1),HZe=V(`<div class="flex w-full flex-wrap items-center justify-end gap-2"><span id="storage-selection" class="mr-auto text-xs text-gray-400"><!></span> <!> <!></div>`),UZe=V(`<div class="storage-bar svelte-3d8w16" aria-hidden="true"><div class="storage-bar-fill svelte-3d8w16"></div></div>`),WZe=V(`<span id="storage-unaccounted-line">The remaining <strong id="storage-unaccounted"> </strong> is everything else this origin keeps â cached code, browser bookkeeping and 2457 IndexedDB's own overhead â which no list here can clean up. <!></span>`),GZe=V(`<p id="storage-summary" class="mt-1.5 text-xs text-gray-400">This app accounts for <strong id="storage-accounted"> </strong> <!></p>`),KZe=V(`<p class="mt-1.5 text-xs text-gray-400">Reading the storeâ¦</p>`),qZe=V(`Autosave is <strong>off</strong>, so nothing here is crash recovery.`,1),JZe=V(`<strong id="storage-autosave-error">Autosave is failing</strong> â the last snapshot 2458 could not be written, so there is nothing to recover from a crash.`,1),YZe=V(`, and the last one took <strong id="storage-autosave-cost"> </strong> to prepare`,1),XZe=V(`<span id="storage-autosave-backoff">It has slowed itself down because this scene is expensive to export; a shorter 2459 interval would stutter while you work.</span>`),ZZe=V(`Autosave writes a snapshot <strong id="storage-autosave-cadence"> </strong> after a change<!>. <!>`,1),QZe=V(`<span class="storage-group-picked svelte-3d8w16"> </span>`),$Ze=V(`<span class="storage-row-sub svelte-3d8w16"> </span>`),eQe=V(`<span class="storage-row-reason svelte-3d8w16"><!> </span>`),tQe=V(`<li class="storage-row svelte-3d8w16"><input class="tp-check" type="checkbox"/> <span class="storage-row-main svelte-3d8w16"><span class="storage-row-name svelte-3d8w16"> </span> <!> <!></span> <span class="storage-row-bytes svelte-3d8w16"> </span></li>`),nQe=V(`<div class="storage-group-body"><p class="storage-group-note svelte-3d8w16"> </p> <ul class="storage-rows svelte-3d8w16"></ul></div>`),rQe=V(`<div class="storage-group svelte-3d8w16"><div class="storage-group-head svelte-3d8w16"><label class="storage-group-tick svelte-3d8w16"><input class="tp-check" type="checkbox"/></label> <button type="button" class="storage-group-toggle svelte-3d8w16"><!> <span class="storage-group-name svelte-3d8w16"> </span> <span class="storage-group-count svelte-3d8w16"> <!></span></button> <span class="storage-group-bytes svelte-3d8w16"> </span></div> <!></div>`),iQe=V(`<div class="mb-2 flex items-center justify-between"><p class="ui-section-label !mb-0">What is using it</p> <button id="storage-select-all" type="button" class="storage-link svelte-3d8w16">Select everything removable</button></div> <!>`,1),aQe=V(`<p class="text-xs text-gray-400">Nothing is stored on this device yet.</p>`),oQe=V(`<div id="storage-modal" class="modal-content p-3"><div class="mb-3"><div class="mb-1 flex flex-wrap items-center gap-2"><span class="flex items-center gap-1.5 text-sm font-semibold text-gray-200"><!> <!></span> <!></div> <!> <!> <p id="storage-autosave" class="mt-1.5 text-xs text-gray-400"><!></p></div> <!></div>`);function sQe(e,n){Ce(n,!0);let r=()=>z(dX,`$storageScan`,c),i=()=>z(uX,`$storageModalOpen`,c),a=()=>z(fX,`$storageScanning`,c),o=()=>z(Ey,`$autosaveEnabled`,c),s=()=>z(dpe,`$autosaveStatus`,c),[c,l]=Ve(),u=t(Ne(new Set)),d=t(0),p=t(!1),m=t(Ne(new Set)),h=q(r),_=q(()=>(Q(h)?.categories??[]).filter(e=>e.rows.length)),y=q(()=>Q(_).flatMap(e=>e.rows)),x=q(()=>Q(y).filter(e=>Q(u).has(e.id))),S=q(()=>xX(Q(x)));Qe(()=>{let e=Q(h)?.at??0,t=new Set(Q(y).map(e=>e.id));e!==Q(d)&&(I(d,e,!0),K(()=>{let e=new Set;for(let n of Q(u))t.has(n)&&e.add(n);e.size!==Q(u).size&&I(u,e,!0)}))});function C(e){if(!Q(y).find(t=>
2459t.id===e)?.removable)return;let t=new Set(Q(u));t.has(e)?t.delete(e):t.add(e),I(u,t,!0)}function T(e){return e.rows.filter(e=>e.removable)}function E(e){let t=T(e);return t.length>0&&t.every(e=>Q(u).has(e.id))}function D(e){let t=T(e),n=new Set(Q(u));if(E(e))for(let e of t)n.delete(e.id);else for(let e of t)n.add(e.id);I(u,n,!0)}function k(e){return e.rows.filter(e=>Q(u).has(e.id)).length}function A(e){return Q(m).has(e)}function ee(e){let t=new Set(Q(m));t.has(e)?t.delete(e):t.add(e),I(m,t,!0)}function M(){let e=Q(y).filter(e=>e.removable),t=e.length>0&&e.every(e=>Q(u).has(e.id));I(u,t?new Set:new Set(e.map(e=>e.id)),!0)}async function te(){let e=Q(x).filter(e=>e.removable);if(e.length&&!Q(p)&&await Bd({title:`Reclaim `+vf(Q(S))+`?`,message:e.length+(e.length===1?` item will be removed`:` items will be removed`)+` from this device, freeing about `+vf(Q(S))+`. This cannot be undone, and it only affects this machine â peers keep their own copies.`,confirmLabel:`Reclaim`,cancelLabel:`Keep them`})){I(p,!0);try{let t=await bX(e);es(`Freed about `+vf(t.freed))}finally{I(p,!1)}}}function ne(e){let t=Math.round(e/1e3);if(t<90)return t+` seconds`;let n=Math.round(t/60);return n+(n===1?` minute`:` minutes`)}function P(e){return e?.estimate?.quota?Math.min(100,Math.max(.5,e.estimate.used/e.estimate.quota*100)):0}co(e,{title:`Storage`,modal:!1,onkeydown:e=>{e.key===`Escape`&&uX.set(!1)},outsideclose:!0,size:`lg`,class:`tp-modal-frame`,classes:{header:`tp-modal-header`,body:`tp-modal-body flex-1`},get open(){return Se(),i()},set open(e){ke(uX,e)},footer:e=>{var t=HZe(),n=j(t),r=j(n),i=e=>{var t=VZe(),n=N(t),r=g(n),i=f(r,!0);W(),O(e=>{Y(n,`${Q(x).length??``} 2460 ${Q(x).length===1?`item`:`items`} selected · about `),Y(i,e)},[()=>vf(Q(S))]),X(e,t)},a=e=>{var t=Te(`Tick what you want gone. Nothing is removed until you press Reclaim.`);X(e,t)};G(r,e=>{Q(x).length?e(i):e(a,-1)}),H(n);var o=g(n,2);{let e=q(()=>!Q(x).length||Q(p));Do(o,{id:`storage-reclaim`,size:`xs`,color:`red`,get disabled(){return Q(e)},onclick:te,children:(e,t)=>{var n=MQ(),r=N(n);SS(r,{size:14,class:`mr-1`,"aria-hidden":`true`});var i=g(r,1,!0);O(()=>Y(i,Q(p)?`Reclaimingâ¦`:`Reclaim`)),X(e,n)},$$slots:{default:!0}})}var s=g(o,2);Do(s,{id:`storage-close`,size:`xs`,color:`alternative`,onclick:()=>uX.set(!1),children:(e,t)=>{W();var n=Te(`Close`);X(e,n)},$$slots:{default:!0}}),H(t),X(e,t)},children:(e,t)=>{var n=oQe(),r=j(n),i=j(r),c=j(i),l=j(c);$x(l,{size:16,"aria-hidden":`true`});var d=g(l,2),m=e=>{var t=Te();O((e,n)=>Y(t,`${e??``} used of ${n??``} granted`),[()=>vf(Q(h).estimate.used),()=>vf(Q(h).estimate.quota)]),X(e,t)},y=e=>{var t=Te(`Browser storage`);X(e,t)};G(d,e=>{Q(h)?.estimate?e(m):e(y,-1)}),H(c);var x=g(c,2);{let e=q(()=>a()||Q(p));Do(x,{id:`storage-rescan`,size:`xs`,color:`alternative`,get disabled(){return Q(e)},onclick:()=>void vX(),children:(e,t)=>{var n=MQ(),r=N(n);Gx(r,{size:14,class:`mr-1`,"aria-hidden":`true`});var i=g(r,1,!0);O(()=>Y(i,a()?`Readingâ¦`:`Rescan`)),X(e,n)},$$slots:{default:!0}})}H(i);var S=g(i,2),te=e=>{var t=UZe(),n=j(t);let r;H(t),O(e=>r=Ze(n,``,r,{width:e}),[()=>`${P(Q(h))??``}%`]),X(e,t)};G(S,e=>{Q(h)?.estimate?.quota&&e(te)});var re=g(S,2),ie=e=>{var t=GZe(),n=g(j(t)),r=f(n,!0),i=g(n),a=g(i),o=e=>{var t=WZe(),n=g(j(t)),r=f(n,!0),i=g(n,2),a=e=>{var t=Te(`A negative figure means our own measurements add up to more than the browser 2461 reports; every number here is an estimate.`);X(e,t)};G(i,e=>{Q(h).unaccounted<0&&e(a)}),H(t),O(e=>Y(r,e),[()=>vf(Q(h).unaccounted)]),X(e,t)};G(a,e=>{Q(h).unaccounted!=null&&e(o)}),H(t),O(e=>{Y(r,e),Y(i,` of that across ${Q(h).keys??``} stored records. `)},[()=>vf(Q(h).accounted)]),X(e,t)},F=e=>{var t=KZe();X(e,t)};G(re,e=>{Q(h)?e(ie):e(F,-1)});var ae=g(re,2),I=j(ae),oe=e=>{var t=qZe();W(2),X(e,t)},R=e=>{var t=JZe();W(),X(e,t)},se=e=>{var t=ZZe(),n=g(N(t)),r=f(n,!0),i=g(n,2),a=e=>{var t=YZe(),n=g(N(t)),r=f(n);W(),O(e=>Y(r,`${e??``}ms`),[()=>Math.round(s().lastExportMs)]),X(e,t)};G(i,e=>{s().lastExportMs&&e(a)});var o=g(i,2),c=e=>{var t=XZe();X(e,t)};G(o,e=>{s().debounceMs>3e4&&e(c)}),O(e=>Y(r,e),[()=>ne(s().debounceMs)]),X(e,t)};G(I,e=>{o()?s().lastError?e(R,1):e(se,-1):e(oe)}),H(ae),H(r);var ce=g(r,2),le=e=>{var t=iQe(),n=N(t),r=g(j(n),2);H(n);var i=g(n,2);B(i,17,()=>Q(_),e=>e.key,(e,t)=>{let n=q(()=>k(Q(t)));var r=rQe(),i=j(r),a=j(i),o=j(a);v(o),H(a);var s=g(a,2),c=j(s);tz(c,{size:12,class:`storage-group-chev`,"aria-hidden":`true`});var l=g(c,2),d=f(l,!0),m=g(l,2),h=j(m,!0),_=g(h),y=e=>{var t=QZe(),r=f(t);O(()=>Y(r,` · ${Q(n)??``} selected`)),X(e,t)};G(_,e=>{Q(n)&&e(y)}),H(m),H(s);var x=g(s,2),S=f(x,!0);H(i);var M=g(i,2),te=e=>{var n=nQe(),r=j(n),i=f(r,!0),a=g(r,2);B(a,21,()=>Q(t).rows,e=>e.id,(e,t)=>{var n=tQe(),r=j(n);v(r);var i=g(r,2),a=j(i),o=f(a,!0),s=g(a,2),c=e=>{var n=$Ze(),r=f(n,!0);O(()=>Y(r,Q(t).sub)),X(e,n)};G(s,e=>{Q(t).sub&&e(c)});var l=g(s,2),d=e=>{var n=eQe(),r=j(n);yS(r,{size:12,class:`storage-row-reason-icon`,"aria-hidden":`true`});var i=g(r,1,!0);H(n),O(()=>Y(i,Q(t).reason)),X(e,n)};G(l,e=>{!Q(t).removable&&Q(t).reason&&e(d)}),H(i);var m=g(i,2),h=f(m,!0);H(n),O((e,i)=>{b(n,`data-storage-row`,Q(t).id),b(n,`data-removable`,Q(t).removable),b(r,`aria-label`,(Q(t).removable?`Remove `:`Cannot remove `)+Q(t).label),r.disabled=!Q(t).removable||Q(p),b(r,`title`,Q(t).removable?void 0:Q(t).reason),w(r,e),b(a,`title`,Q(t).label),Y(o,Q(t).label),b(m,`data-bytes`,Q(t).bytes),Y(h,i)},[()=>Q(u).has(Q(t).id),()=>vf(Q(t).bytes)]),L(`change`,r,()=>C(Q(t).id)),X(e,n)}),H(a),H(n),O(()=>{b(n,`id`,`storage-group-body-`+Q(t).key),Y(i,Q(t).note)}),X(e,n)},ne=q(()=>A(Q(t).key));G(M,e=>{Q(ne)&&e(te)}),H(r),O((e,i,c,l,u,f)=>{b(r,`data-storage-group`,Q(t).key),b(r,`data-open`,e),b(a,`title`,i),b(o,`id`,`storage-group-check-`+Q(t).key),b(o,`aria-label`,`Select all `+Q(t).label),o.disabled=c,w(o,l),b(s,`id`,`storage-group-toggle-`+Q(t).key),b(s,`aria-expanded`,u),b(s,`aria-controls`,`storage-group-body-`+Q(t).key),Y(d,Q(t).label),b(m,`data-picked`,Q(n)),Y(h,Q(t).rows.length),b(x,`data-bytes`,Q(t).bytes),Y(S,f)},[()=>A(Q(t).key),()=>T(Q(t)).length?`Select all in this group`:`Nothing in this group can be removed`,()=>!T(Q(t)).length,()=>E(Q(t)),()=>A(Q(t).key),()=>vf(Q(t).bytes)]),L(`change`,o,()=>D(Q(t))),L(`click`,s,()=>ee(Q(t).key)),X(e,r)}),L(`click`,r,M),X(e,t)},ue=e=>{var t=aQe();X(e,t)};G(ce,e=>{Q(_).length?e(le):Q(h)&&e(ue,1)}),H(n),X(e,n)},$$slots:{footer:!0,default:!0}}),ue(),l()}ge([`click`,`change`]);var cQe=V(`<p class="col-span-full p-2 text-xs opacity-70">Loading the packâ¦</p>`),lQe=V(`<p class="col-span-full p-2 text-xs opacity-70"> </p>`),uQe=V(`<img alt="" loading="lazy" class="svelte-e6g7ki"/>`),dQe=V(`<span class="replace-noimg svelte-e6g7ki" aria-hidden="true"></span>`),fQe=V(`<button class="replace-card svelte-e6g7ki"><!> <span class="replace-label svelte-e6g7ki"> </span></button>`),pQe=V(`<div id="replace-model" class="flex flex-col gap-2 text-sm"><p class="text-xs opacity-80">Pick what goes where the placeholder is. A pack item keeps the object (its links, notes and flows) and loads on every peer; a library model is added as a new object.</p> <div class="flex gap-2"><div class="w-1/2"><!></div> <input id="replace-model-search" class="ui-input w-1/2" type="text" placeholder="Searchâ¦"/></div> <div class="replace-grid svelte-e6g7ki"><!> <!></div></div>`);function mQe(e,n){Ce(n,!0);let r=()=>z(gq,`$replaceModelTarget`,o),i=()=>z(Fm,`$packs`,o),a=()=>z(Fa,`$explorerItems`,o),[o,s]=Ve(),c=t(!1),l=t(`library`),u=t(``),d=t([]),p=t(!1),m=t(!1),h=!1;Qe(()=>{I(c,!!r())}),Qe(()=>{Q(c)&&!i().length&&Nm()}),Qe(()=>{Q(c)&&Q(l)===`library`&&i().length&&!h&&I(l,`pack:`+i()[0].name)}),Qe(()=>{let e=Q(l).startsWith(`pack:`)?Q(l).slice(5):null;if(!e)return;let t=i().find(t=>t.name===e);t&&(I(p,!0),joe(t).then(t=>{Q(l)===`pack:`+e&&I(d,t)}).finally(()=>I(p,!1)))});let _=q(()=>[{value:`library`,name:`Library models`},...i().map(e=>({value:`pack:`+e.name,name:e.title||e.name}))]),y=q(()=>{let e=Q(u).trim().toLowerCase(),t;return t=Q(l)===`library`?a().filter(e=>e.kind===`object`).map(e=>({key:e.id,label:e.name,thumb:e.thumbnail,lib:e})):Q(d).filter(e=>!e.behavior).map(e=>e.glbUrl?{key:e.glbUrl,label:e.label||e.name,thumb:e.resolvedThumb||e.thumbs?.[0],pack:e}:{key:e.id,label:e.name,thumb:e.thumbnail,lib:e}),e?t.filter(t=>String(t.label).toLowerCase().includes(e)):t});function x(){gq.set(null)}async function C(e){let t=r();if(t&&!Q(m)){I(m,!0);try{e.pack?yq(t,e.pack):await bq(t,e.lib)}finally{I(m,!1),x()}}}co(e,{title:`Replace model`,modal:!1,onkeydown:e=>{e.key===`Escape`&&x()},onclose:x,outsideclose:!0,size:`md`,class:`tp-modal-frame`,classes:{header:`tp-modal-header`,body:`tp-modal-body flex-1`},get open(){return Q(c)},set open(e){I(c,e,!0)},children:(e,t)=>{var n=pQe(),r=g(j(n),2),i=j(r);fq(j(i),{id:`replace-model-source`,get items(){return Q(_)},onchange:()=>h=!0,get value(){return Q(l)},set value(e){I(l,e,!0)}}),H(i);var a=g(i,2);v(a),H(r);var o=g(r,2),s=j(o),c=e=>{var t=cQe();X(e,t)},d=e=>{var t=lQe(),n=f(t);O(()=>Y(n,`Nothing here${Q(u)?` matches "`+Q(u)+`"`:``}.`)),X(e,t)};G(s,e=>{Q(p)?e(c):Q(y).length||e(d,1)});var x=g(s,2);B(x,17,()=>Q(y),e=>e.key,(e,t)=>{var n=fQe(),r=j(n),i=e=>{var n=uQe();O(()=>b(n,`src`,Q(t).thumb)),X(e,n)},a=e=>{var t=dQe();X(e,t)};G(r,e=>{Q(t).thumb?e(i):e(a,-1)});var o=g(r,2),s=f(o,!0);H(n),O(()=>{b(n,`data-key`,Q(t).key),b(n,`title`,Q(t).label),n.disabled=Q(m),Y(s,Q(t).label)}),L(`click`,n,()=>C(Q(t))),X(e,n)}),H(o),H(n),O(()=>b(o,`data-count`,Q(y).length)),S(a,()=>Q(u),e=>I(u,e)),X(e,n)},$$slots:{default:!0}}),ue(),s()}ge([`click`]);var hQe=V(`<div id="placeholder-tooltip" class="ph-tip svelte-vhx9vk" role="tooltip"><div class="ph-title svelte-vhx9vk"> </div> <div class="ph-text svelte-vhx9vk"> </div> <div class="ph-hint svelte-vhx9vk"> </div></div>`);function gQe(e,n){Ce(n,!0);let r=()=>z(xi,`$globalRenderer`,s),i=()=>z(yi,`$globalCamera`,s),a=()=>z(ki,`$isLocked`,s),o=()=>z(Lm,`$placeholderStuckSeconds`,s),[s,c]=Ve(),l=t(null),u=new Wn,d=new yn,m=0;function h(e){let t=performance.now();if(t-m<80)return;m=t;let n=zoe(),s=r(),c=i();if(!n.length||!s||!c||a()===!0||e.pointerType===`touch`||e.target!==s.domElement){I(l,null);return}let f=s.domElement.getBoundingClientRect();d.set((e.clientX-f.left)/f.width*2-1,-((e.clientY-f.top)/f.height)*2+1),u.setFromCamera(d,c);let p=u.intersectObjects(n,!1)[0],h=p?Wm(p.object):null;if(!h){I(l,null);return}let g=Bm(h.load,Vm(),o()*1e3);I(l,{x:e.clientX+14,y:e.clientY+16,title:(p.object.name||h.item)+(g===2?` â failed`:g===1?` â stuck`:` â loading`),text:Um(h.load),hint:g===2?`Double-click or right-click ⸠Retry loading · Replace modelâ¦`:`You can already move it â the model lands where the box is`,tone:g===2?`var(--icon-danger)`:g===1?`var(--icon-warning, var(--icon-danger))`:`var(--accent)`},!0)}
2461var _=fe();Z(`pointermove`,p,h);var v=N(_),y=e=>{var t=hQe();let n;var r=j(t),i=f(r,!0),a=g(r,2),o=f(a,!0),s=g(a,2),c=f(s,!0);H(t),O(()=>{n=Ze(t,``,n,{left:Q(l).x+`px`,top:Q(l).y+`px`,"border-color":Q(l).tone}),Y(i,Q(l).title),Y(o,Q(l).text),Y(c,Q(l).hint)}),X(e,t)};G(v,e=>{Q(l)&&e(y)}),X(e,_),ue(),c()}var _Qe={value:()=>{}};function NQ(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new PQ(n)}function PQ(e){this._=e}function vQe(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}PQ.prototype=NQ.prototype={constructor:PQ,on:function(e,t){var n=this._,r=vQe(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=yQe(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=FQ(n[i],e.name,t);else if(t==null)for(i in n)n[i]=FQ(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new PQ(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function yQe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function FQ(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=_Qe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var IQ={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function LQ(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),IQ.hasOwnProperty(t)?{space:IQ[t],local:e}:e}function bQe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function xQe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function RQ(e){var t=LQ(e);return(t.local?xQe:bQe)(t)}function SQe(){}function zQ(e){return e==null?SQe:function(){return this.querySelector(e)}}function CQe(e){typeof e!=`function`&&(e=zQ(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new e$(r,this._parents)}function wQe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function TQe(){return[]}function BQ(e){return e==null?TQe:function(){return this.querySelectorAll(e)}}function EQe(e){return function(){return wQe(e.apply(this,arguments))}}function DQe(e){e=typeof e==`function`?EQe(e):BQ(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new e$(r,i)}function VQ(e){return function(){return this.matches(e)}}function HQ(e){return function(t){return t.matches(e)}}var OQe=Array.prototype.find;function kQe(e){return function(){return OQe.call(this.children,e)}}function AQe(){return this.firstElementChild}function jQe(e){return this.select(e==null?AQe:kQe(typeof e==`function`?e:HQ(e)))}var MQe=Array.prototype.filter;function NQe(){return Array.from(this.children)}function PQe(e){return function(){return MQe.call(this.children,e)}}function FQe(e){return this.selectAll(e==null?NQe:PQe(typeof e==`function`?e:HQ(e)))}function IQe(e){typeof e!=`function`&&(e=VQ(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new e$(r,this._parents)}function UQ(e){return Array(e.length)}function LQe(){return new e$(this._enter||this._groups.map(UQ),this._parents)}function WQ(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}WQ.prototype={constructor:WQ,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function RQe(e){return function(){return e}}function zQe(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new WQ(e,a[o]);for(;o<c;
vendor: 23,540 bytes, line 2461
2461++o)(s=t[o])&&(i[o]=s)}function BQe(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new WQ(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function VQe(e){return e.__data__}function HQe(e,t){if(!arguments.length)return Array.from(this,VQe);var n=t?BQe:zQe,r=this._parents,i=this._groups;typeof e!=`function`&&(e=RQe(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=UQe(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new e$(o,r),o._enter=s,o._exit=c,o}function UQe(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function WQe(){return new e$(this._exit||this._groups.map(UQ),this._parents)}function GQe(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function KQe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new e$(s,this._parents)}function qQe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function JQe(e){e||=YQe;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new e$(i,this._parents).order()}function YQe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function XQe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ZQe(){return Array.from(this)}function QQe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function $Qe(){let e=0;for(let t of this)++e;return e}function e$e(){return!this.node()}function t$e(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function n$e(e){return function(){this.removeAttribute(e)}}function r$e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function i$e(e,t){return function(){this.setAttribute(e,t)}}function a$e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function o$e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function s$e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function c$e(e,t){var n=LQ(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?r$e:n$e:typeof t==`function`?n.local?s$e:o$e:n.local?a$e:i$e)(n,t))}function GQ(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function l$e(e){return function(){this.style.removeProperty(e)}}function u$e(e,t,n){return function(){this.style.setProperty(e,t,n)}}function d$e(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function f$e(e,t,n){return arguments.length>1?this.each((t==null?l$e:typeof t==`function`?d$e:u$e)(e,t,n??``)):KQ(this.node(),e)}function KQ(e,t){return e.style.getPropertyValue(t)||GQ(e).getComputedStyle(e,null).getPropertyValue(t)}function p$e(e){return function(){delete this[e]}}function m$e(e,t){return function(){this[e]=t}}function h$e(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function g$e(e,t){return arguments.length>1?this.each((t==null?p$e:typeof t==`function`?h$e:m$e)(e,t)):this.node()[e]}function qQ(e){return e.trim().split(/^|\s+/)}function JQ(e){return e.classList||new YQ(e)}function YQ(e){this._node=e,this._names=qQ(e.getAttribute(`class`)||``)}YQ.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function XQ(e,t){for(var n=JQ(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function ZQ(e,t){for(var n=JQ(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function _$e(e){return function(){XQ(this,e)}}function v$e(e){return function(){ZQ(this,e)}}function y$e(e,t){return function(){(t.apply(this,arguments)?XQ:ZQ)(this,e)}}function b$e(e,t){var n=qQ(e+``);if(arguments.length<2){for(var r=JQ(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?y$e:t?_$e:v$e)(n,t))}function x$e(){this.textContent=``}function S$e(e){return function(){this.textContent=e}}function C$e(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function w$e(e){return arguments.length?this.each(e==null?x$e:(typeof e==`function`?C$e:S$e)(e)):this.node().textContent}function T$e(){this.innerHTML=``}function E$e(e){return function(){this.innerHTML=e}}function D$e(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function O$e(e){return arguments.length?this.each(e==null?T$e:(typeof e==`function`?D$e:E$e)(e)):this.node().innerHTML}function k$e(){this.nextSibling&&this.parentNode.appendChild(this)}function A$e(){return this.each(k$e)}function j$e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function M$e(){return this.each(j$e)}function N$e(e){var t=typeof e==`function`?e:RQ(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function P$e(){return null}function F$e(e,t){var n=typeof e==`function`?e:RQ(e),r=t==null?P$e:typeof t==`function`?t:zQ(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function I$e(){var e=this.parentNode;e&&e.removeChild(this)}function L$e(){return this.each(I$e)}function R$e(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z$e(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function B$e(e){return this.select(e?z$e:R$e)}function V$e(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function H$e(e){return function(t){e.call(this,t,this.__data__)}}function U$e(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function W$e(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function G$e(e,t,n){return function(){var r=this.__on,i,a=H$e(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function K$e(e,t,n){var r=U$e(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?G$e:W$e,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function QQ(e,t,n){var r=GQ(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function q$e(e,t){return function(){return QQ(this,e,t)}}function J$e(e,t){return function(){return QQ(this,e,t.apply(this,arguments))}}function Y$e(e,t){return this.each((typeof t==`function`?J$e:q$e)(e,t))}function*X$e(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var $Q=[null];function e$(e,t){this._groups=e,this._parents=t}function t$(){return new e$([[document.documentElement]],$Q)}function Z$e(){return this}e$.prototype=t$.prototype={constructor:e$,select:CQe,selectAll:DQe,selectChild:jQe,selectChildren:FQe,filter:IQe,data:HQe,enter:LQe,exit:WQe,join:GQe,merge:KQe,selection:Z$e,order:qQe,sort:JQe,call:XQe,nodes:ZQe,node:QQe,size:$Qe,empty:e$e,each:t$e,attr:c$e,style:f$e,property:g$e,classed:b$e,text:w$e,html:O$e,raise:A$e,lower:M$e,append:N$e,insert:F$e,remove:L$e,clone:B$e,datum:V$e,on:K$e,dispatch:Y$e,[Symbol.iterator]:X$e};function n$(e){return typeof e==`string`?new e$([[document.querySelector(e)]],[document.documentElement]):new e$([[e]],$Q)}function Q$e(e){let t;for(;t=e.sourceEvent;)e=t;return e}function r$(e,t){if(e=Q$e(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var $$e={passive:!1},i$={capture:!0,passive:!1};function a$(e){e.stopImmediatePropagation()}function o$(e){e.preventDefault(),e.stopImmediatePropagation()}function s$(e){var t=e.document.documentElement,n=n$(e).on(`dragstart.drag`,o$,i$);`onselectstart`in t?n.on(`selectstart.drag`,o$,i$):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function c$(e,t){var n=e.document.documentElement,r=n$(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,o$,i$),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var l$=e=>()=>e;function u$(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}u$.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function e1e(e){return!e.ctrlKey&&!e.button}function t1e(){return this.parentNode}function n1e(e,t){return t??{x:e.x,y:e.y}}function r1e(){return navigator.maxTouchPoints||`ontouchstart`in this}function i1e(){var e=e1e,t=t1e,n=n1e,r=r1e,i={},a=NQ(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,$$e).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(n$(n.view).on(`mousemove.drag`,m,i$).on(`mouseup.drag`,h,i$),s$(n.view),a$(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(o$(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){n$(e.view).on(`mousemove.drag mouseup.drag`,null),c$(e.view,l),o$(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(a$(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(o$(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(a$(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=r$(l||r,t),p,m,h;if((h=n.call(e,new u$(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=r$(l||a,t),_=o}u.call(r,e,new u$(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:l$(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:l$(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:l$(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:l$(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function d$(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function f$(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function p$(){}var m$=.7,h$=1/m$,g$=`\\s*([+-]?\\d+)\\s*`,_$=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,v$=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,a1e=/^#([0-9a-f]{3,8})$/,o1e=RegExp(`^rgb\\(${g$},${g$},${g$}\\)$`),s1e=RegExp(`^rgb\\(${v$},${v$},${v$}\\)$`),c1e=RegExp(`^rgba\\(${g$},${g$},${g$},${_$}\\)$`),l1e=RegExp(`^rgba\\(${v$},${v$},${v$},${_$}\\)$`),u1e=RegExp(`^hsl\\(${_$},${v$},${v$}\\)$`),d1e=RegExp(`^hsla\\(${_$},${v$},${v$},${_$}\\)$`),y$={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};d$(p$,S$,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:b$,formatHex:b$,formatHex8:f1e,formatHsl:p1e,formatRgb:x$,toString:x$});function b$(){return this.rgb().formatHex()}function f1e(){return this.rgb().formatHex8()}function p1e(){return N$(this).formatHsl()}function x$(){return this.rgb().formatRgb()}function S$(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=a1e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?C$(t):n===3?new E$(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?w$(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?w$(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=o1e.exec(e))?new E$(t[1],t[2],t[3],1):(t=s1e.exec(e))?new E$(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=c1e.exec(e))?w$(t[1],t[2],t[3],t[4]):(t=l1e.exec(e))?w$(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=u1e.exec(e))?M$(t[1],t[2]/100,t[3]/100,1):(t=d1e.exec(e))?M$(t[1],t[2]/100,t[3]/100,t[4]):y$.hasOwnProperty(e)?C$(y$[e]):e===`transparent`?new E$(NaN,NaN,NaN,0):null}function C$(e){return new E$(e>>16&255,e>>8&255,e&255,1)}function w$(e,t,n,r){return r<=0&&(e=t=n=NaN),new E$(e,t,n,r)}function m1e(e){return e instanceof p$||(e=S$(e)),e?(e=e.rgb(),new E$(e.r,e.g,e.b,e.opacity)):new E$}function T$(e,t,n,r){return arguments.length===1?m1e(e):new E$(e,t,n,r??1)}function E$(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}d$(E$,T$,f$(p$,{brighter(e){return e=e==null?h$:h$**+e,new E$(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?m$:m$**+e,new E$(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new E$(A$(this.r),A$(this.g),A$(this.b),k$(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:D$,formatHex:D$,formatHex8:h1e,formatRgb:O$,toString:O$}));function D$(){return`#${j$(this.r)}${j$(this.g)}${j$(this.b)}`}function h1e(){return`#${j$(this.r)}${j$(this.g)}${j$(this.b)}${j$((isNaN(this.opacity)?1:this.opacity)*255)}`}function O$(){let e=k$(this.opacity);return`${e===1?`rgb(`:`rgba(`}${A$(this.r)}, ${A$(this.g)}, ${A$(this.b)}${e===1?`)`:`, ${e})`}`}function k$(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function A$(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function j$(e){return e=A$(e),(e<16?`0`:``)+e.toString(16)}function M$(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new P$(e,t,n,r)}function N$(e){if(e instanceof P$)return new P$(e.h,e.s,e.l,e.opacity);if(e instanceof p$||(e=S$(e)),!e)return new P$;if(e instanceof P$)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new P$(o,s,c,e.opacity)}function g1e(e,t,n,r){return arguments.length===1?N$(e):new P$(e,t,n,r??1)}function P$(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}d$(P$,g1e,f$(p$,{brighter(e){return e=e==null?h$:h$**+e,new P$(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?m$:m$**+e,new P$(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new E$(L$(e>=240?e-240:e+120,i,r),L$(e,i,r),L$(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new P$(F$(this.h),I$(this.s),I$(this.l),k$(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=k$(this.opacity);return`${e===1?`hsl(`:`hsla(`}${F$(this.h)}, ${I$(this.s)*100}%, ${I$(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function F$(e){return e=(e||0)%360,e<0?e+360:e}function I$(e){return Math.max(0,Math.min(1,e||0))}function L$(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var R$=e=>()=>e;function _1e(e,t){return function(n){return e+n*t}}function v1e(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function y1e(e){return(e=+e)==1?z$:function(t,n){return n-t?v1e(t,n,e):R$(isNaN(t)?n:t)}}function z$(e,t){var n=t-e;return n?_1e(e,n):R$(isNaN(e)?t:e)}var B$=(function e(t){var n=y1e(t);function r(e,t){var r=n((e=T$(e)).r,(t=T$(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=z$(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function b1e(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function x1e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function S1e(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=G$(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function C1e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function V$(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function w1e(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=G$(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var H$=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,U$=new RegExp(H$.source,`g`);function T1e(e){return function(){return e}}function E1e(e){return function(t){return e(t)+``}}function W$(e,t){var n=H$.lastIndex=U$.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=H$.exec(e))&&(i=U$.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:V$(r,i)})),n=U$.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?E1e(c[0].x):T1e(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function G$(e,t){var n=typeof t,r;return t==null||n===`boolean`?R$(t):(n===`number`?V$:n===`string`?(r=S$(t))?(t=r,B$):W$:t instanceof S$?B$:t instanceof Date?C1e:x1e(t)?b1e:Array.isArray(t)?S1e:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?w1e:V$)(e,t)}var K$=180/Math.PI,q$={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function J$(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*K$,skewX:Math.atan(c)*K$,scaleX:o,scaleY:s}}var Y$;function D1e(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?q$:J$(t.a,t.b,t.c,t.d,t.e,t.f)}function O1e(e){return e==null||(Y$||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Y$.setAttribute(`transform`,e),!(e=Y$.transform.baseVal.consolidate()))?q$:(e=e.matrix,J$(e.a,e.b,e.c,e.d,e.e,e.f))}
2461function X$(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:V$(e,i)},{i:c-2,x:V$(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:V$(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:V$(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:V$(e,n)},{i:s-2,x:V$(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var k1e=X$(D1e,`px, `,`px)`,`deg)`),A1e=X$(O1e,`, `,`)`,`)`),j1e=1e-12;function Z$(e){return((e=Math.exp(e))+1/e)/2}function M1e(e){return((e=Math.exp(e))-1/e)/2}function N1e(e){return((e=Math.exp(2*e))-1)/(e+1)}var Q$=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<j1e)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Z$(y),c=s/(n*g)*(i*N1e(t*r+y)-M1e(y));return[a+c*d,o+c*f,s*i/Z$(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),$$=0,e1=0,t1=0,n1=1e3,r1,i1,a1=0,o1=0,s1=0,c1=typeof performance==`object`&&performance.now?performance:Date,l1=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function u1(){return o1||=(l1(P1e),c1.now()+s1)}function P1e(){o1=0}function d1(){this._call=this._time=this._next=null}d1.prototype=f1.prototype={constructor:d1,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?u1():+n)+(t==null?0:+t),!this._next&&i1!==this&&(i1?i1._next=this:r1=this,i1=this),this._call=e,this._time=n,m1()},stop:function(){this._call&&(this._call=null,this._time=1/0,m1())}};function f1(e,t,n){var r=new d1;return r.restart(e,t,n),r}function F1e(){u1(),++$$;for(var e=r1,t;e;)(t=o1-e._time)>=0&&e._call.call(void 0,t),e=e._next;--$$}function p1(){o1=(a1=c1.now())+s1,$$=e1=0;try{F1e()}finally{$$=0,L1e(),o1=0}}function I1e(){var e=c1.now(),t=e-a1;t>n1&&(s1-=t,a1=e)}function L1e(){for(var e,t=r1,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:r1=n);i1=e,m1(r)}function m1(e){$$||(e1&&=clearTimeout(e1),e-o1>24?(e<1/0&&(e1=setTimeout(p1,e-c1.now()-s1)),t1&&=clearInterval(t1)):(t1||=(a1=c1.now(),setInterval(I1e,n1)),$$=1,l1(p1)))}function h1(e,t,n){var r=new d1;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var R1e=NQ(`start`,`end`,`cancel`,`interrupt`),z1e=[];function g1(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;B1e(e,n,{name:t,index:r,group:i,on:R1e,tween:z1e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function _1(e,t){var n=y1(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function v1(e,t){var n=y1(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function y1(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function B1e(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=f1(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return h1(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(h1(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[
vendor: 19,484 bytes, line 2461
2461++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function b1(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function V1e(e){return this.each(function(){b1(this,e)})}function H1e(e,t){var n,r;return function(){var i=v1(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function U1e(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=v1(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function W1e(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=y1(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?H1e:U1e)(n,e,t))}function x1(e,t,n){var r=e._id;return e.each(function(){var e=v1(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return y1(e,r).value[t]}}function S1(e,t){var n;return(typeof t==`number`?V$:t instanceof S$?B$:(n=S$(t))?(t=n,B$):W$)(e,t)}function G1e(e){return function(){this.removeAttribute(e)}}function K1e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function q1e(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function J1e(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Y1e(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function X1e(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Z1e(e,t){var n=LQ(e),r=n===`transform`?A1e:S1;return this.attrTween(e,typeof t==`function`?(n.local?X1e:Y1e)(n,r,x1(this,`attr.`+e,t)):t==null?(n.local?K1e:G1e)(n):(n.local?J1e:q1e)(n,r,t))}function Q1e(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function $1e(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function e0e(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&$1e(e,i)),n}return i._value=t,i}function t0e(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Q1e(e,i)),n}return i._value=t,i}function n0e(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=LQ(e);return this.tween(n,(r.local?e0e:t0e)(r,t))}function r0e(e,t){return function(){_1(this,e).delay=+t.apply(this,arguments)}}function i0e(e,t){return t=+t,function(){_1(this,e).delay=t}}function a0e(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?r0e:i0e)(t,e)):y1(this.node(),t).delay}function o0e(e,t){return function(){v1(this,e).duration=+t.apply(this,arguments)}}function s0e(e,t){return t=+t,function(){v1(this,e).duration=t}}function c0e(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?o0e:s0e)(t,e)):y1(this.node(),t).duration}function l0e(e,t){if(typeof t!=`function`)throw Error();return function(){v1(this,e).ease=t}}function u0e(e){var t=this._id;return arguments.length?this.each(l0e(t,e)):y1(this.node(),t).ease}function d0e(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();v1(this,e).ease=n}}function f0e(e){if(typeof e!=`function`)throw Error();return this.each(d0e(this._id,e))}function p0e(e){typeof e!=`function`&&(e=VQ(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new w1(r,this._parents,this._name,this._id)}function m0e(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new w1(o,this._parents,this._name,this._id)}function h0e(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function g0e(e,t,n){var r,i,a=h0e(t)?_1:v1;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function _0e(e,t){var n=this._id;return arguments.length<2?y1(this.node(),n).on.on(e):this.each(g0e(n,e,t))}function v0e(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function y0e(){return this.on(`end.remove`,v0e(this._id))}function b0e(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=zQ(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,g1(l[f],t,n,f,l,y1(u,n)));return new w1(a,this._parents,t,n)}function x0e(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=BQ(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=y1(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&g1(p,t,n,h,f,m);a.push(f),o.push(u)}return new w1(a,o,t,n)}var S0e=t$.prototype.constructor;function C0e(){return new S0e(this._groups,this._parents)}function w0e(e,t){var n,r,i;return function(){var a=KQ(this,e),o=(this.style.removeProperty(e),KQ(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function C1(e){return function(){this.style.removeProperty(e)}}function T0e(e,t,n){var r,i=n+``,a;return function(){var o=KQ(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function E0e(e,t,n){var r,i,a;return function(){var o=KQ(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),KQ(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function D0e(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=v1(this,e),l=c.on,u=c.value[a]==null?s||=C1(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function O0e(e,t,n){var r=(e+=``)==`transform`?k1e:S1;return t==null?this.styleTween(e,w0e(e,r)).on(`end.style.`+e,C1(e)):typeof t==`function`?this.styleTween(e,E0e(e,r,x1(this,`style.`+e,t))).each(D0e(this._id,e)):this.styleTween(e,T0e(e,r,t),n).on(`end.style.`+e,null)}function k0e(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function A0e(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&k0e(e,a,n)),r}return a._value=t,a}function j0e(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,A0e(e,t,n??``))}function M0e(e){return function(){this.textContent=e}}function N0e(e){return function(){var t=e(this);this.textContent=t??``}}function P0e(e){return this.tween(`text`,typeof e==`function`?N0e(x1(this,`text`,e)):M0e(e==null?``:e+``))}function F0e(e){return function(t){this.textContent=e.call(this,t)}}function I0e(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&F0e(r)),t}return r._value=e,r}function L0e(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,I0e(e))}function R0e(){for(var e=this._name,t=this._id,n=T1(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=y1(c,t);g1(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new w1(r,this._parents,e,n)}function z0e(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=v1(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var B0e=0;function w1(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function T1(){return++B0e}var E1=t$.prototype;w1.prototype={constructor:w1,select:b0e,selectAll:x0e,selectChild:E1.selectChild,selectChildren:E1.selectChildren,filter:p0e,merge:m0e,selection:C0e,transition:R0e,call:E1.call,nodes:E1.nodes,node:E1.node,size:E1.size,empty:E1.empty,each:E1.each,on:_0e,attr:Z1e,attrTween:n0e,style:O0e,styleTween:j0e,text:P0e,textTween:L0e,remove:y0e,tween:W1e,delay:a0e,duration:c0e,ease:u0e,easeVarying:f0e,end:z0e,[Symbol.iterator]:E1[Symbol.iterator]};function V0e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var H0e={time:null,delay:0,duration:250,ease:V0e};function U0e(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function W0e(e){var t,n;e instanceof w1?(t=e._id,e=e._name):(t=T1(),(n=H0e).time=u1(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&g1(c,e,t,l,o,n||U0e(c,t));return new w1(r,this._parents,e,t)}t$.prototype.interrupt=V1e,t$.prototype.transition=W0e;var D1=e=>()=>e;function G0e(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function O1(e,t,n){this.k=e,this.x=t,this.y=n}O1.prototype={constructor:O1,scale:function(e){return e===1?this:new O1(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new O1(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var k1=new O1(1,0,0);A1.prototype=O1.prototype;function A1(e){for(;!e.__zoom;)if(!(e=e.parentNode))return k1;return e.__zoom}function j1(e){e.stopImmediatePropagation()}function M1(e){e.preventDefault(),e.stopImmediatePropagation()}function K0e(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function q0e(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function N1(){return this.__zoom||k1}function J0e(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Y0e(){return navigator.maxTouchPoints||`ontouchstart`in this}function X0e(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function P1(){var e=K0e,t=q0e,n=X0e,r=J0e,i=Y0e,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Q$,l=NQ(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,N1).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,N1),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(k1.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new O1(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new O1(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new O1(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=n$(this.that).datum();l.call(e,this.that,new G0e(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=r$(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],b1(this),s.start();M1(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=n$(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=r$(t,i),l=t.clientX,u=t.clientY;s$(t.view),j1(t),a.mouse=[c,this.__zoom.invert(c)],b1(this),a.start();function d(e){if(M1(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=r$(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),c$(e.view,a.moved),M1(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=r$(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);M1(r),s>0?n$(this).transition().duration(s).call(x,d,c,r):n$(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(j1(t),s=0;s<i;++s)c=r[s],l=r$(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),b1(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(M1(e),s=0;s<a;++s)c=i[s],l=r$(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(j1(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=r$(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=n$(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:D1(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:D1(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:D1(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:D1([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var F1={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>
2461`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},I1=[[-1/0,-1/0],[1/0,1/0]],L1=[`Enter`,` `,`Escape`],Z0e={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},R1;(function(e){e.Strict=`strict`,e.Loose=`loose`})(R1||={});var z1;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(z1||={});var B1;(function(e){e.Partial=`partial`,e.Full=`full`})(B1||={});var V1={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},H1;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(H1||={});var U1;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(U1||={});var W1;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(W1||={});var G1={[W1.Left]:W1.Right,[W1.Right]:W1.Left,[W1.Top]:W1.Bottom,[W1.Bottom]:W1.Top},K1=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,Q0e=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),q1=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),J1=(e,t=[0,0])=>{let{width:n,height:r}=x0(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},$0e=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):q1(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,r0(e,s0(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?a0(r):{x:0,y:0,width:0,height:0}},Y1=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=r0(n,s0(e)),r=!0)}),r?a0(n):{x:0,y:0,width:0,height:0}},X1=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=l0(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},e2e=(e,t)=>
2461{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function t2e(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=x0(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function n2e({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=v0(Y1(t2e(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function Z1({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,F1.error005());else{let{width:e,height:t}=x0(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&b0(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=b0(d)?$1(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,F1.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function r2e({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=e2e(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var Q1=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),$1=(e={x:0,y:0},t,n)=>({x:Q1(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Q1(e.y,t[0][1],t[1][1]-(n?.height??0))});function e0(e,t,n){let{width:r,height:i}=x0(n),{x:a,y:o}=n.internals.positionAbsolute;return $1(e,[[a,o],[a+r,o+i]],t)}var t0=(e,t,n)=>e<t?Q1(Math.abs(e-t),1,t)/t:e>n?-Q1(Math.abs(e-n),1,t)/t:0,n0=(e,t,n=15,r=40)=>[t0(e.x,r,t.width-r)*n,t0(e.y,r,t.height-r)*n],r0=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),i0=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),a0=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),o0=(e,t=[0,0])=>{let{x:n,y:r}=q1(e)?e.internals.positionAbsolute:J1(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},s0=(e,t=[0,0])=>{let{x:n,y:r}=q1(e)?e.internals.positionAbsolute:J1(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},c0=(e,t)=>a0(r0(i0(e),i0(t))),l0=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},u0=(e,t)=>l0(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),d0=e=>f0(e.width)&&f0(e.height)&&f0(e.x)&&f0(e.y),f0=e=>!isNaN(e)&&isFinite(e),p0=(e,t)=>(e,t)=>{},m0=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),h0=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?m0(s,o):s},g0=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function _0(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function i2e(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=_0(e,n),i=_0(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=_0(e.top??e.y??0,n),i=_0(e.bottom??e.y??0,n),a=_0(e.left??e.x??0,t),o=_0(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function a2e(e,t,n,r,i,a){let{x:o,y:s}=g0(e,[t,n,r]),{x:c,y:l}=g0({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var v0=(e,t,n,r,i,a)=>{let o=i2e(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=Q1(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=a2e(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}}
2461,y0=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function b0(e){return e!=null&&e!==`parent`}function x0(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function S0(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function o2e(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function s2e(e){return{...Z0e,...e||{}}}function c2e(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(let n of e.keys())if(!t.has(n))return!1;return!0}function C0(e,t,n){if(!n)return;let r=[];e.forEach((e,n)=>{t?.has(n)||r.push(e)}),r.length&&n(r)}function l2e(e){return e===null?null:e?`valid`:`invalid`}function w0(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=k0(e),s=h0({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?m0(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var T0=e=>({width:e.offsetWidth,height:e.offsetHeight}),E0=e=>e?.getRootNode?.()||window?.document,u2e=[`INPUT`,`SELECT`,`TEXTAREA`];function D0(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?u2e.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var O0=e=>`clientX`in e,k0=(e,t)=>{let n=O0(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},A0=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...T0(t)}})};function d2e({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function j0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function M0({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case W1.Left:return[t-j0(t-r,a),n];case W1.Right:return[t+j0(r-t,a),n];case W1.Top:return[t,n-j0(n-i,a)];case W1.Bottom:return[t,n+j0(i-n,a)]}}function N0({sourceX:e,sourceY:t,sourcePosition:n=W1.Bottom,targetX:r,targetY:i,targetPosition:a=W1.Top,curvature:o=.25}){let[s,c]=M0({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=M0({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=d2e({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function P0({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function f2e({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function p2e({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=r0(s0(e),s0(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),u0({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},a0(a))>0}var m2e=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,h2e=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),g2e=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,F1.error006()),t;let r=n.getEdgeId||m2e,i;return i=K1(e)?{...e}:{...e,id:r(e)},h2e(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function F0({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=P0({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var I0={[W1.Left]:{x:-1,y:0},[W1.Right]:{x:1,y:0},[W1.Top]:{x:0,y:-1},[W1.Bottom]:{x:0,y:1}},_2e=({source:e,sourcePosition:t=W1.Bottom,target:n})=>t===W1.Left||t===W1.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},L0=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function v2e({source:e,sourcePosition:t=W1.Bottom,target:n,targetPosition:r=W1.Top,center:i,offset:a,stepPosition:o}){let s=I0[t],c=I0[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=_2e({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=P0({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function y2e(e,t,n,r){let i=Math.min(L0(e,t)/2,L0(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function R0({sourceX:e,sourceY:t,sourcePosition:n=W1.Bottom,targetX:r,targetY:i,targetPosition:a=W1.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=v2e({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=y2e(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function z0(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function b2e(e){let{sourceNode:t,targetNode:n}=e;if(!z0(t)||!z0(n))return null;let r=t.internals.handleBounds||B0(t.handles),i=n.internals.handleBounds||B0(n.handles),a=H0(r?.source??[],e.sourceHandle),o=H0(e.connectionMode===R1.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);
2461if(!a||!o)return e.onError?.(`008`,F1.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||W1.Bottom,c=o?.position||W1.Top,l=V0(t,a,s),u=V0(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function B0(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function V0(e,t,n=W1.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??x0(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case W1.Top:return{x:i+o/2,y:a};case W1.Right:return{x:i+o,y:a+s/2};case W1.Bottom:return{x:i+o/2,y:a+s};case W1.Left:return{x:i,y:a+s/2}}}function H0(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function U0(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function x2e(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=U0(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var W0=1e3,S2e=10,G0={nodeOrigin:[0,0],nodeExtent:I1,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},C2e={...G0,checkEquality:!0};function K0(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function w2e(e,t,n){let r=K0(G0,n);for(let n of e.values())if(n.parentId)J0(n,e,t,r);else{let e=$1(J1(n,r.nodeOrigin),b0(n.extent)?n.extent:r.nodeExtent,x0(n));n.internals.positionAbsolute=e}}function T2e(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function q0(e){return e===`manual`}function E2e(e,t,n,r={}){let i=K0(C2e,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!q0(i.zIndexMode)?W0:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=$1(J1(u,i.nodeOrigin),b0(u.extent)?u.extent:i.nodeExtent,x0(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:T2e(u,e),z:Y0(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&J0(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function D2e(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function J0(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=K0(G0,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}D2e(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*S2e),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=O2e(e,u,o,s,a&&!q0(c)?W0:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function Y0(e,t,n){let r=f0(e.zIndex)?e.zIndex:0;return q0(n)?r:r+(e.selected?t:0)}function O2e(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=x0(e),l=J1(e,n),u=b0(e.extent)?$1(l,e.extent,c):l,d=$1({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=e0(d,c,t));let f=Y0(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function k2e(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=c0(a.get(n.parentId)?.expandedRect??o0(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=x0(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function A2e(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=T0(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=b0(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);
2461n&&(h=e0(h,s,n))}else m&&(h=$1(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:A0(`source`,r.nodeElement,p,d,e.id),target:A0(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&J0(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:o0(g,i)}))}}if(f.length>0){let e=k2e(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function j2e({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function X0(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function M2e(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;X0(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),X0(`target`,s,c,e,i,o),t.set(r.id,r)}}function Z0(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Z0(n,t):!1}function Q0(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function N2e(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Z0(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function $0({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function P2e({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=m0(a,t);return{x:o.x-a.x,y:o.y-a.y}}function F2e({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=n$(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?i0(Y1(s)):null,x=v&&l?P2e({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:m0(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=Z1({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=$0({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=n0(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);
2461let v=w0(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=N2e(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=$0({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=i1e().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=w0(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=k0(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=w0(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=k0(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=k0(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=$0({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!Q0(t,`.${g}`,v))&&(!_||Q0(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function I2e(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())u0(i,o0(e))>0&&r.push(e);return r}var L2e=250;function R2e(e,t,n,r){let i=[],a=1/0,o=I2e(e,n,t+L2e);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=V0(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function e2(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...V0(o,c,c.position,!0)}:c}function t2(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function z2e(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var n2=()=>!0;function B2e(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNo
2461de:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=n2,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=E0(e.target),E=0,D,{x:O,y:k}=k0(e),A=t2(a,w),ee=s?.getBoundingClientRect(),j=!1;if(!ee||!A)return;let M=e2(i,A,r,c,t);if(!M)return;let te=k0(e,ee),ne=!1,N=null,P=!1,re=null;function ie(){if(!u||!ee)return;let[e,t]=n0(te,ee,S);f({x:e,y:t}),E=requestAnimationFrame(ie)}let F={...M,nodeId:i,type:A,position:M.position},ae=c.get(i),I={inProgress:!0,isValid:null,from:V0(ae,F,W1.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:ae,to:te,toHandle:null,toPosition:G1[F.position],toNode:null,pointer:te};function L(){j=!0,y(I),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&L();function oe(e){if(!j){let{x:t,y:n}=k0(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;L()}if(!x()||!F){R(e);return}let a=b();te=k0(e,ee),D=R2e(h0(te,a,!1,[1,1]),n,c,F),ne||=(ie(),!0);let s=r2(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});re=s.handleDomNode,N=s.connection,P=z2e(!!D,s.isValid);let u=c.get(i),f=u?V0(u,F,W1.Left,!0):I.from,p={...I,from:f,isValid:P,to:s.toHandle&&P?g0({x:s.toHandle.x,y:s.toHandle.y},a):te,toHandle:s.toHandle,toPosition:P&&s.toHandle?s.toHandle.position:G1[F.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:te};y(p),I=p}function R(e){if(!(`touches`in e&&e.touches.length>0)){if(j){(D||re)&&N&&P&&h?.(N);let{inProgress:t,...n}=I,r={...n,toPosition:I.toHandle?I.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),ne=!1,P=!1,N=null,re=null,T.removeEventListener(`mousemove`,oe),T.removeEventListener(`mouseup`,R),T.removeEventListener(`touchmove`,oe),T.removeEventListener(`touchend`,R)}}T.addEventListener(`mousemove`,oe),T.addEventListener(`mouseup`,R),T.addEventListener(`touchmove`,oe),T.addEventListener(`touchend`,R)}function r2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=n2,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=k0(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=t2(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===R1.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=e2(t,e,a,u,n,!0)}return _}var i2={onPointerDown:B2e,isValid:r2};function V2e({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=n$(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&y0()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=P1().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:r$}}var a2=e=>({x:e.x,y:e.y,zoom:e.k}),o2=({x:e,y:t,zoom:n})=>k1.translate(e,t).scale(n),s2=(e,t)=>
2461e.target.closest(`.${t}`),c2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),H2e=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,l2=(e,t=0,n=H2e,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},u2=e=>{let t=e.ctrlKey&&y0()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function U2e({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(s2(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=r$(u),t=d*2**u2(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===z1.Vertical?0:u.deltaX*f,m=i===z1.Horizontal?0:u.deltaY*f;!y0()&&u.shiftKey&&i!==z1.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=a2(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function W2e({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=s2(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function G2e({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=a2(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function K2e({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&c2(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,a2(a.transform))}}function q2e({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&c2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=a2(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function J2e({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(s2(f,`${u}-flow__node`)||s2(f,`${u}-flow__edge`)||s2(f,`${u}-flow__selection`)||s2(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||s2(f,c)&&h||s2(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function Y2e({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=P1().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=n$(e).call(f);y({x:i.x,y:i.y,zoom:Q1(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(u2);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?G$:Q$).transform(l2(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:O}){r&&!l.isZoomingOrPanning&&v();let k=i&&!C&&!r;f.clickDistance(O?1/0:!f0(D)||D<0?0:D);let A=k?U2e({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):W2e({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,A,{passive:!1});let ee=G2e({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,ee);let j=K2e({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,j);let M=q2e({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,M);let te=J2e({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});
2461f.filter(te),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=o2(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=o2(e);return await g(n,t),n}function x(e){if(p){let t=o2(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?A1(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?G$:Q$).scaleTo(l2(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?G$:Q$).scaleBy(l2(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!f0(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var X2e;(function(e){e.Line=`line`,e.Handle=`handle`})(X2e||={});var Z2e=p0(`Svelte Flow`,`https://svelteflow.dev/`);function Q2e(e,t,n={}){return g2e(e,t,{...n,onError:n.onError??Z2e})}function d2(){let e={};return[t=>{if(t&&!Re(e))throw Error(t);return De(e)},t=>He(e,t)]}var[$2e,e4e]=d2(),[t4e,n4e]=d2(),[r4e,i4e]=d2(),a4e=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`type`,`position`,`style`,`class`,`isConnectable`,`isConnectableStart`,`isConnectableEnd`,`isValidConnection`,`onconnect`,`ondisconnect`,`children`]),o4e=V(`<div><!></div>`);function f2(e,t){Ce(t,!0);let n=J(t,`id`,3,null),r=J(t,`type`,3,`source`),a=J(t,`position`,19,()=>W1.Top),o=J(t,`isConnectableStart`,3,!0),s=J(t,`isConnectableEnd`,3,!0),c=Le(t,a4e),l=$2e(`Handle must be used within a Custom Node component`),u=t4e(`Handle must be used within a Custom Node component`),d=q(()=>r()===`target`),f=q(()=>t.isConnectable===void 0?u.value:t.isConnectable),p=C2(),m=q(()=>p.ariaLabelConfig),h=null;i(()=>{if(t.onconnect||t.ondisconnect){p.edges;let e=p.connectionLookup.get(`${l}-${r()}${n()?`-${n()}`:``}`);if(h&&!c2e(e,h)){let n=e??new Map;C0(h,n,t.ondisconnect),C0(n,h,t.onconnect)}h=new Map(e)}});let g=q(()=>{if(!p.connection.inProgress)return[!1,!1,!1,!1,null];let{fromHandle:e,toHandle:t,isValid:i}=p.connection,a=e&&e.nodeId===l&&e.type===r()&&e.id===n(),o=t&&t.nodeId===l&&t.type===r()&&t.id===n();return[!0,a,o,p.connectionMode===R1.Strict?e?.type!==r():l!==e?.nodeId||n()!==e?.id,o&&i]}),_=q(()=>A(Q(g),5)),v=q(()=>Q(_)[0]),y=q(()=>Q(_)[1]),b=q(()=>Q(_)[2]),x=q(()=>Q(_)[3]),S=q(()=>Q(_)[4]);function C(e){let t=p.onbeforeconnect?p.onbeforeconnect(e):e;t&&(p.addEdge(t),p.onconnect?.(e))}function w(e){let r=O0(e);e.currentTarget&&(r&&e.button===0||!r)&&i2.onPointerDown(e,{handleId:n(),nodeId:l,isTarget:Q(d),connectionRadius:p.connectionRadius,domNode:p.domNode,nodeLookup:p.nodeLookup,connectionMode:p.connectionMode,lib:`svelte`,autoPanOnConnect:p.autoPanOnConnect,autoPanSpeed:p.autoPanSpeed,flowId:p.flowId,isValidConnection:t.isValidConnection||((...e)=>p.isValidConnection?.(...e)??!0),updateConnection:p.updateConnection,cancelConnection:p.cancelConnection,panBy:p.panBy,onConnect:C,onConnectStart:p.onconnectstart,onConnectEnd:(...e)=>p.onconnectend?.(...e),getTransform:()=>[p.viewport.x,p.viewport.y,p.viewport.zoom],getFromHandle:()=>p.connection.fromHandle,dragThreshold:p.connectionDragThreshold,handleDomNode:e.currentTarget})}function T(e){if(!l||!p.clickConnectStartHandle&&!o())return;if(!p.clickConnectStartHandle){p.onclickconnectstart?.(e,{nodeId:l,handleId:n(),handleType:r()}),p.clickConnectStartHandle={nodeId:l,type:r(),id:n()};return}let i=E0(e.target),a=t.isValidConnection??p.isValidConnection,{connectionMode:s,clickConnectStartHandle:c,flowId:u,nodeLookup:d}=p,{connection:f,isValid:m}=i2.isValid(e,{handle:{nodeId:l,id:n(),type:r()},connectionMode:s,fromNodeId:c.nodeId,fromHandleId:c.id??null,fromType:c.type,isValidConnection:a,flowId:u,doc:i,lib:`svelte`,nodeLookup:d});m&&f&&C(f);let h=structuredClone(Ae(p.connection));delete h.inProgress,h.toPosition=h.toHandle?h.toHandle.position:null,p.onclickconnectend?.(e,h),p.clickConnectStartHandle=null}var E=o4e(),D=()=>{};ye(E,()=>({"data-handleid":n(),"data-nodeid":l,"data-handlepos":a(),"data-id":`${p.flowId??``}-${l??``}-${n()??`null`??``}-${r()??``}`,class:[`svelte-flow__handle`,`svelte-flow__handle-${a()}`,p.noDragClass,p.noPanClass,a(),t.class],onmousedown:w,ontouchstart:w,onclick:p.clickConnect?T:void 0,onkeypress:D,style:t.style,role:`button`,"aria-label":Q(m)[`handle.ariaLabel`],tabindex:`-1`,...c,[xe]:{valid:Q(S),connectingto:Q(b),connectingfrom:Q(y),source:!Q(d),target:Q(d),connectablestart:o(),connectableend:s(),connectable:Q(f),connectionindicator:Q(f)&&(!Q(v)||Q(x))&&(Q(v)||p.clickConnectStartHandle?s():o())}}));var O=j(E);ae(O,()=>t.children??qe),H(E),X(e,E),ue()}var s4e=V(`<!> <!>`,1);function p2(e,t){Ce(t,!0);let n=J(t,`targetPosition`,19,()=>W1.Top),r=J(t,`sourcePosition`,19,()=>W1.Bottom);
2461var i=s4e(),a=N(i);f2(a,{type:`target`,get position(){return n()}});var o=g(a);f2(g(o),{type:`source`,get position(){return r()}}),O(()=>Y(o,` ${t.data?.label??``} `)),X(e,i),ue()}var c4e=V(` <!>`,1);function l4e(e,t){Ce(t,!0);let n=J(t,`data`,19,()=>({label:`Node`})),r=J(t,`sourcePosition`,19,()=>W1.Bottom);W();var i=c4e(),a=N(i);f2(g(a),{type:`source`,get position(){return r()}}),O(()=>Y(a,`${n()?.label??``} `)),X(e,i),ue()}var u4e=V(` <!>`,1);function d4e(e,t){Ce(t,!0);let n=J(t,`data`,19,()=>({label:`Node`})),r=J(t,`targetPosition`,19,()=>W1.Top);W();var i=u4e(),a=N(i);f2(g(a),{type:`target`,get position(){return r()}}),O(()=>Y(a,`${n()?.label??``} `)),X(e,i),ue()}function f4e(e,t){}function m2(e,t,n){if(!n||!t)return;let r=n===`root`?t:t.querySelector(`.svelte-flow__${n}`);r&&r.appendChild(e)}function p4e(e,t){let n=q(C2),r=q(()=>Q(n).domNode),i;return Q(r)?m2(e,Q(r),t):i=x(()=>{Qe(()=>{m2(e,Q(r),t),i?.()})}),{async update(t){m2(e,Q(r),t)},destroy(){e.parentNode&&e.parentNode.removeChild(e),i?.()}}}function m4e(){let e=t(typeof window>`u`);if(Q(e)){let t=x(()=>{Qe(()=>{I(e,!1),t?.()})})}return{get value(){return Q(e)}}}var h2=e=>Q0e(e),h4e=e=>K1(e);function g2(e){return e===void 0?void 0:`${e}px`}var _2={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},g4e=new Set([`$$slots`,`$$events`,`$$legacy`,`x`,`y`,`width`,`height`,`selectEdgeOnClick`,`transparent`,`class`,`children`]),_4e=V(`<div><!></div>`);function v4e(e,t){Ce(t,!0);let r=J(t,`x`,3,0),i=J(t,`y`,3,0),a=J(t,`selectEdgeOnClick`,3,!1),o=J(t,`transparent`,3,!1),s=Le(t,g4e),c=C2(),l=r4e(`EdgeLabel must be used within a Custom Edge component`),u=q(()=>c.visible.edges.get(l)?.zIndex);var d=_4e(),f=()=>{a()&&l&&c.handleEdgeSelection(l)};ye(d,(e,c,l)=>({class:[`svelte-flow__edge-label`,{transparent:o()},t.class],tabindex:`-1`,onclick:f,...s,[n]:{display:e,cursor:a()?`pointer`:void 0,transform:`translate(-50%, -50%) translate(${r()??``}px,${i()??``}px)`,"pointer-events":`all`,width:c,height:l,"z-index":Q(u)}}),[()=>m4e().value?`none`:void 0,()=>g2(t.width),()=>g2(t.height)],void 0,void 0,`svelte-1wg91mu`);var p=j(d);ae(p,()=>t.children??qe),H(d),ne(d,(e,t)=>p4e?.(e,t),()=>`edge-labels`),X(e,d),ue()}var y4e=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`path`,`label`,`labelX`,`labelY`,`labelStyle`,`markerStart`,`markerEnd`,`style`,`interactionWidth`,`class`]),b4e=je(`<path></path>`),x4e=je(`<path fill="none"></path><!><!>`,1);function v2(e,t){let n=J(t,`interactionWidth`,3,20),i=Le(t,y4e);var a=x4e(),o=N(a),s=g(o),c=e=>{var r=b4e();ye(r,()=>({d:t.path,"stroke-opacity":0,"stroke-width":n(),fill:`none`,class:`svelte-flow__edge-interaction`,...i})),X(e,r)};G(s,e=>{n()>0&&e(c)});var l=g(s),u=e=>{v4e(e,{get x(){return t.labelX},get y(){return t.labelY},get style(){return t.labelStyle},selectEdgeOnClick:!0,children:(e,n)=>{W();var r=Te();O(()=>Y(r,t.label)),X(e,r)},$$slots:{default:!0}})};G(l,e=>{t.label&&e(u)}),O(()=>{b(o,`id`,t.id),b(o,`d`,t.path),r(o,0,M([`svelte-flow__edge-path`,t.class])),b(o,`marker-start`,t.markerStart),b(o,`marker-end`,t.markerEnd),Ze(o,t.style)}),X(e,a)}function y2(e,t){Ce(t,!0);let n=q(()=>N0({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,curvature:t.pathOptions?.curvature})),r=q(()=>A(Q(n),3)),i=q(()=>Q(r)[0]),a=q(()=>Q(r)[1]),o=q(()=>Q(r)[2]);v2(e,{get id(){return t.id},get path(){return Q(i)},get labelX(){return Q(a)},get labelY(){return Q(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),ue()}function S4e(e,t){Ce(t,!0);let n=q(()=>R0({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition})),r=q(()=>A(Q(n),3)),i=q(()=>Q(r)[0]),a=q(()=>Q(r)[1]),o=q(()=>Q(r)[2]);v2(e,{get path(){return Q(i)},get labelX(){return Q(a)},get labelY(){return Q(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),ue()}function C4e(e,t){Ce(t,!0);let n=q(()=>F0({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY})),r=q(()=>A(Q(n),3)),i=q(()=>Q(r)[0]),a=q(()=>Q(r)[1]),o=q(()=>Q(r)[2]);v2(e,{get path(){return Q(i)},get labelX(){return Q(a)},get labelY(){return Q(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),ue()}function w4e(e,t){Ce(t,!0);let n=q(()=>R0({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,borderRadius:0})),r=q(()=>A(Q(n),3)),i=q(()=>Q(r)[0]),a=q(()=>Q(r)[1]),o=q(()=>Q(r)[2]);v2(e,{get path(){return Q(i)},get labelX(){return Q(a)},get labelY(){return Q(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),ue()}function T4e(e,t,n,r){let i=new Map;return X1(e,{x:0,y:0,width:n,height:r}
2461,t,!0).forEach(e=>{i.set(e.id,e)}),i}function b2(e){let{edges:t,defaultEdgeOptions:n,nodeLookup:r,previousEdges:i,connectionMode:a,onerror:o,onlyRenderVisible:s,elevateEdgesOnSelect:c,zIndexMode:l}=e,u=new Map;for(let d of t){let t=r.get(d.source),f=r.get(d.target);if(!t||!f||t.hidden||f.hidden)continue;if(s){let{visibleNodes:n,transform:r,width:i,height:a}=e;if(p2e({sourceNode:t,targetNode:f,width:i,height:a,transform:r}))n.set(t.id,t),n.set(f.id,f);else continue}let p=i.get(d.id);if(p&&d===p.edge&&t==p.sourceNode&&f==p.targetNode){u.set(d.id,p);continue}let m=b2e({id:d.id,sourceNode:t,targetNode:f,sourceHandle:d.sourceHandle||null,targetHandle:d.targetHandle||null,connectionMode:a,onError:o});m&&u.set(d.id,{...n,...d,...m,zIndex:f2e({selected:d.selected,zIndex:d.zIndex??n.zIndex,sourceNode:t,targetNode:f,elevateOnSelect:c,zIndexMode:l}),sourceNode:t,targetNode:f,edge:d})}return u}var E4e=p0(`Svelte Flow`,`https://svelteflow.dev/`),x2={input:l4e,output:d4e,default:p2,group:f4e},S2={straight:C4e,smoothstep:S4e,default:y2,step:w4e};function D4e(e,t,n,r,i,a){return t&&!n&&r&&i?v0(Y1(a,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),r,i,.5,2,.1):n??{x:0,y:0,zoom:1}}function O4e(e){class n{#e=q(()=>e.props.id??`1`);get flowId(){return Q(this.#e)}set flowId(e){I(this.#e,e)}#t=t(null);get domNode(){return Q(this.#t)}set domNode(e){I(this.#t,e)}#n=t(null);get panZoom(){return Q(this.#n)}set panZoom(e){I(this.#n,e)}#r=t(e.width??0);get width(){return Q(this.#r)}set width(e){I(this.#r,e)}#i=t(e.height??0);get height(){return Q(this.#i)}set height(e){I(this.#i,e)}#a=t(e.props.zIndexMode??`basic`);get zIndexMode(){return Q(this.#a)}set zIndexMode(e){I(this.#a,e)}#o=q(()=>{let{nodesInitialized:t}=E2e(e.nodes,this.nodeLookup,this.parentLookup,{nodeExtent:this.nodeExtent,nodeOrigin:this.nodeOrigin,elevateNodesOnSelect:e.props.elevateNodesOnSelect??!0,checkEquality:!0,zIndexMode:this.zIndexMode});return this.fitViewQueued&&t&&(this.fitViewOptions?.duration?this.resolveFitView():queueMicrotask(()=>{this.resolveFitView()})),t});get nodesInitialized(){return Q(this.#o)}set nodesInitialized(e){I(this.#o,e)}#s=q(()=>this.panZoom!==null);get viewportInitialized(){return Q(this.#s)}set viewportInitialized(e){I(this.#s,e)}#c=q(()=>(M2e(this.connectionLookup,this.edgeLookup,e.edges),e.edges));get _edges(){return Q(this.#c)}set _edges(e){I(this.#c,e)}get nodes(){return this.nodesInitialized,e.nodes}set nodes(t){e.nodes=t}get edges(){return this._edges}set edges(t){e.edges=t}_prevSelectedNodes=[];_prevSelectedNodeIds=new Set;#l=q(()=>{let e=this._prevSelectedNodeIds.size,t=new Set,n=this.nodes.filter(e=>(e.selected&&(t.add(e.id),this._prevSelectedNodeIds.delete(e.id)),e.selected));return(e!==t.size||this._prevSelectedNodeIds.size>0)&&(this._prevSelectedNodes=n),this._prevSelectedNodeIds=t,this._prevSelectedNodes});get selectedNodes(){return Q(this.#l)}set selectedNodes(e){I(this.#l,e)}_prevSelectedEdges=[];_prevSelectedEdgeIds=new Set;#u=q(()=>{let e=this._prevSelectedEdgeIds.size,t=new Set,n=this.edges.filter(e=>(e.selected&&(t.add(e.id),this._prevSelectedEdgeIds.delete(e.id)),e.selected));return(e!==t.size||this._prevSelectedEdgeIds.size>0)&&(this._prevSelectedEdges=n),this._prevSelectedEdgeIds=t,this._prevSelectedEdges});get selectedEdges(){return Q(this.#u)}set selectedEdges(e){I(this.#u,e)}selectionChangeHandlers=new Map;nodeLookup=new Map;parentLookup=new Map;connectionLookup=new Map;edgeLookup=new Map;_prevVisibleEdges=new Map;#d=q(()=>{let{nodes:t,_edges:n,_prevVisibleEdges:r,nodeLookup:i,connectionMode:a,onerror:o,onlyRenderVisibleElements:s,defaultEdgeOptions:c,zIndexMode:l}=this,u,d,f={edges:n,defaultEdgeOptions:c,previousEdges:r,nodeLookup:i,connectionMode:a,elevateEdgesOnSelect:e.props.elevateEdgesOnSelect??!0,zIndexMode:l,onerror:o};if(s){let{viewport:e,width:t,height:n}=this,r=[e.x,e.y,e.zoom];u=T4e(i,r,t,n),d=b2({...f,onlyRenderVisible:!0,visibleNodes:u,transform:r,width:t,height:n})}else u=this.nodeLookup,d=b2(f);return this._prevVisibleEdges=d,{nodes:u,edges:d}});get visible(){return Q(this.#d)}set visible(e){I(this.#d,e)}#f=q(()=>e.props.nodesDraggable??!0);get nodesDraggable(){return Q(this.#f)}set nodesDraggable(e){I(this.#f,e)}#p=q(()=>e.props.nodesConnectable??!0);get nodesConnectable(){return Q(this.#p)}set nodesConnectable(e){I(this.#p,e)}#m=q(()=>e.props.elementsSelectable??!0);get elementsSelectable(){return Q(this.#m)}set elementsSelectable(e){I(this.#m,e)}#h=q(()=>e.props.nodesFocusable??!0);get nodesFocusable(){return Q(this.#h)}set nodesFocusable(e){I(this.#h,e)}#g=q(()=>e.props.edgesFocusable??!0);get edgesFocusable(){return Q(this.#g)}set edgesFocusable(e){I(this.#g,e)}#_=q(()=>e.props.disableKeyboardA11y??!1);get disableKeyboardA11y(){return Q(this.#_)}set disableKeyboardA11y(e){I(this.#_,e)}#v=q(()=>e.props.minZoom??.5);get minZoom(){return Q(this.#v)}set minZoom(e){I(this.#v,e)}#y=q(()=>e.props.maxZoom??2);get maxZoom(){return Q(this.#y)}set maxZoom(e){I(this.#y,e)}#b=q(()=>e.props.nodeOrigin??[0,0]);get nodeOrigin(){return Q(this.#b)}set nodeOrigin(e){I(this.#b,e)}#x=q(()=>e.props.nodeExtent??I1);get nodeExtent(){return Q(this.#x)}set nodeExtent(e){I(this.#x,e)}#S=q(()=>e.props.translateExtent??I1);get translateExtent(){return Q(this.#S)}set translateExtent(e){I(this.#S,e)}#C=q(()=>e.props.defaultEdgeOptions??{});get defaultEdgeOptions(){return Q(this.#C)}set defaultEdgeOptions(e){I(this.#C,e)}#w=q(()=>e.props.nodeDragThreshold??1);get nodeDragThreshold(){return Q(this.#w)}set nodeDragThreshold(e){I(this.#w,e)}#T=q(()=>e.props.autoPanOnNodeDrag??!0);get autoPanOnNodeDrag(){return Q(this.#T)}
2461set autoPanOnNodeDrag(e){I(this.#T,e)}#E=q(()=>e.props.autoPanOnConnect??!0);get autoPanOnConnect(){return Q(this.#E)}set autoPanOnConnect(e){I(this.#E,e)}#D=q(()=>e.props.autoPanOnNodeFocus??!0);get autoPanOnNodeFocus(){return Q(this.#D)}set autoPanOnNodeFocus(e){I(this.#D,e)}#O=q(()=>e.props.autoPanSpeed??15);get autoPanSpeed(){return Q(this.#O)}set autoPanSpeed(e){I(this.#O,e)}#k=q(()=>e.props.connectionDragThreshold??1);get connectionDragThreshold(){return Q(this.#k)}set connectionDragThreshold(e){I(this.#k,e)}fitViewQueued=e.props.fitView??!1;fitViewOptions=e.props.fitViewOptions;fitViewResolver=null;#A=q(()=>e.props.snapGrid??null);get snapGrid(){return Q(this.#A)}set snapGrid(e){I(this.#A,e)}#j=t(!1);get dragging(){return Q(this.#j)}set dragging(e){I(this.#j,e)}#M=t(null);get selectionRect(){return Q(this.#M)}set selectionRect(e){I(this.#M,e)}#N=t(!1);get selectionKeyPressed(){return Q(this.#N)}set selectionKeyPressed(e){I(this.#N,e)}#P=t(!1);get multiselectionKeyPressed(){return Q(this.#P)}set multiselectionKeyPressed(e){I(this.#P,e)}#F=t(!1);get deleteKeyPressed(){return Q(this.#F)}set deleteKeyPressed(e){I(this.#F,e)}#I=t(!1);get panActivationKeyPressed(){return Q(this.#I)}set panActivationKeyPressed(e){I(this.#I,e)}#L=t(!1);get zoomActivationKeyPressed(){return Q(this.#L)}set zoomActivationKeyPressed(e){I(this.#L,e)}#R=t(null);get selectionRectMode(){return Q(this.#R)}set selectionRectMode(e){I(this.#R,e)}#z=t(``);get ariaLiveMessage(){return Q(this.#z)}set ariaLiveMessage(e){I(this.#z,e)}#B=q(()=>e.props.selectionMode??B1.Partial);get selectionMode(){return Q(this.#B)}set selectionMode(e){I(this.#B,e)}#V=q(()=>({...x2,...e.props.nodeTypes}));get nodeTypes(){return Q(this.#V)}set nodeTypes(e){I(this.#V,e)}#H=q(()=>({...S2,...e.props.edgeTypes}));get edgeTypes(){return Q(this.#H)}set edgeTypes(e){I(this.#H,e)}#U=q(()=>e.props.noPanClass??`nopan`);get noPanClass(){return Q(this.#U)}set noPanClass(e){I(this.#U,e)}#W=q(()=>e.props.noDragClass??`nodrag`);get noDragClass(){return Q(this.#W)}set noDragClass(e){I(this.#W,e)}#G=q(()=>e.props.noWheelClass??`nowheel`);get noWheelClass(){return Q(this.#G)}set noWheelClass(e){I(this.#G,e)}#K=q(()=>s2e(e.props.ariaLabelConfig));get ariaLabelConfig(){return Q(this.#K)}set ariaLabelConfig(e){I(this.#K,e)}#q=t(D4e(this.nodesInitialized,e.props.fitView,e.props.initialViewport,this.width,this.height,this.nodeLookup));get _viewport(){return Q(this.#q)}set _viewport(e){I(this.#q,e)}get viewport(){return e.viewport??this._viewport}set viewport(t){e.viewport&&=t,this._viewport=t}#J=t(V1);get _connection(){return Q(this.#J)}set _connection(e){I(this.#J,e)}#Y=q(()=>this._connection.inProgress?{...this._connection,to:h0(this._connection.to,[this.viewport.x,this.viewport.y,this.viewport.zoom])}:this._connection);get connection(){return Q(this.#Y)}set connection(e){I(this.#Y,e)}#X=q(()=>e.props.connectionMode??R1.Strict);get connectionMode(){return Q(this.#X)}set connectionMode(e){I(this.#X,e)}#Z=q(()=>e.props.connectionRadius??20);get connectionRadius(){return Q(this.#Z)}set connectionRadius(e){I(this.#Z,e)}#Q=q(()=>e.props.isValidConnection??(()=>!0));get isValidConnection(){return Q(this.#Q)}set isValidConnection(e){I(this.#Q,e)}#$=q(()=>e.props.selectNodesOnDrag??!0);get selectNodesOnDrag(){return Q(this.#$)}set selectNodesOnDrag(e){I(this.#$,e)}#ee=q(()=>e.props.defaultMarkerColor===void 0?`#b1b1b7`:e.props.defaultMarkerColor);get defaultMarkerColor(){return Q(this.#ee)}set defaultMarkerColor(e){I(this.#ee,e)}#te=q(()=>x2e(e.edges,{defaultColor:this.defaultMarkerColor,id:this.flowId,defaultMarkerStart:this.defaultEdgeOptions.markerStart,defaultMarkerEnd:this.defaultEdgeOptions.markerEnd}));get markers(){return Q(this.#te)}set markers(e){I(this.#te,e)}#ne=q(()=>e.props.onlyRenderVisibleElements??!1);get onlyRenderVisibleElements(){return Q(this.#ne)}set onlyRenderVisibleElements(e){I(this.#ne,e)}#re=q(()=>e.props.onflowerror??E4e);get onerror(){return Q(this.#re)}set onerror(e){I(this.#re,e)}#ie=q(()=>e.props.ondelete);get ondelete(){return Q(this.#ie)}set ondelete(e){I(this.#ie,e)}#ae=q(()=>e.props.onbeforedelete);get onbeforedelete(){return Q(this.#ae)}set onbeforedelete(e){I(this.#ae,e)}#oe=q(()=>e.props.onbeforeconnect);get onbeforeconnect(){return Q(this.#oe)}set onbeforeconnect(e){I(this.#oe,e)}#se=q(()=>e.props.onconnect);get onconnect(){return Q(this.#se)}set onconnect(e){I(this.#se,e)}#ce=q(()=>e.props.onconnectstart);get onconnectstart(){return Q(this.#ce)}set onconnectstart(e){I(this.#ce,e)}#le=q(()=>e.props.onconnectend);get onconnectend(){return Q(this.#le)}set onconnectend(e){I(this.#le,e)}#ue=q(()=>e.props.onbeforereconnect);get onbeforereconnect(){return Q(this.#ue)}set onbeforereconnect(e){I(this.#ue,e)}#de=q(()=>e.props.onreconnect);get onreconnect(){return Q(this.#de)}set onreconnect(e){I(this.#de,e)}#fe=q(()=>e.props.onreconnectstart);get onreconnectstart(){return Q(this.#fe)}set onreconnectstart(e){I(this.#fe,e)}#pe=q(()=>e.props.onreconnectend);get onreconnectend(){return Q(this.#pe)}set onreconnectend(e){I(this.#pe,e)}#me=q(()=>e.props.clickConnect??!0);get clickConnect(){return Q(this.#me)}set clickConnect(e){I(this.#me,e)}#he=q(()=>e.props.onclickconnectstart);get onclickconnectstart(){return Q(this.#he)}set onclickconnectstart(e){I(this.#he,e)}#ge=q(()=>e.props.onclickconnectend);get onclickconnectend(){return Q(this.#ge)}set onclickconnectend(e){I(this.#ge,e)}#_e=t(null);get clickConnectStartHandle(){return Q(this.#_e)}set clickConnectStartHandle(e){I(this.#_e,e)}#ve=q(()=>e.props.onselectiondrag);get onselectiondrag(){return Q(this.#ve)}set onselectiondrag(e){I(this.#ve,e)}#ye=q(()=>e.props.onselectiondragstart);get onselectiondragstart(){return Q(this.#ye)}set onselectiondragstart(e){I(this.#ye,e)}#be=q(()=>e.props.onselectiondragstop);get onselectiondragstop(){return Q(this.#be)}set onselectiondragstop(e){I(this.#be,e)}resolveFitView=async()=>{this.panZoom&&(await n2e({nodes:this.nodeLookup,width:this.width,height:this.height,panZoom:this.panZoom,minZoom:this.minZoom,maxZoom:this.maxZoom},this.fitViewOptions),this.fitViewResolver?.resolve(!0),this.fitViewQueued=!1,this.fitViewOptions=void 0,this.fitViewResolver=null)};_prefersDark=new Ir(`(prefers-color-scheme: dark)`,e.props.colorModeSSR===`dark`);#xe=q(()=>e.props.colorMode===`system`?this._prefersDark.current?`dark`:`light`:e.props.colorMode??`light`);get colorMode(){return Q(this.#xe)}set colorMode(e){I(this.#xe,e)}constructor(){}resetStoreValues(){this.dragging=!1,this.selectionRect=null,this.selectionRectMode=null,this.selectionKeyPressed=!1,this.multiselectionKeyPressed=!1,this.deleteKeyPressed=!1,this.panActivationKeyPressed=!1,this.zoomActivationKeyPressed=!1,this._connection=V1,this.clickConnectStartHandle=null,this.viewport=e.props.initialViewport??{x:0,y:0,zoom:1},this.ariaLiveMessage=``}}return new n}var k4e=F1.error001(`svelte`);function C2(){let e=De(w2);if(!e)throw Error(k4e);return e.getStore()}var w2=Symbol();function T2(e){let t=O4e(e);function n(e){t.nodeTypes={...x2,...e}}function r(e){t.edgeTypes={...S2,...e}}function i(e){t.edges=Q2e(e,t.edges,{onError:t.onerror})}let a=(e,n=!1)=>{t.nodes=t.nodes.map(r=>{if(t.connection.inProgress&&t.connection.fromNode.id===r.id){let e=t.nodeLookup.get(r.id);e&&(t.connection={...t.connection,from:V0(e,t.connection.fromHandle,W1.Left,!0)})}let i=e.get(r.id);return i?{...r,position:i.position,dragging:n}:r})};function o(e){let{changes:n,updatedInternals:r}=A2e(e,t.nodeLookup,t.parentLookup,t.domNode,t.nodeOrigin,t.nodeExtent,t.zIndexMode);
2461if(!r)return;w2e(t.nodeLookup,t.parentLookup,{nodeOrigin:t.nodeOrigin,nodeExtent:t.nodeExtent,zIndexMode:t.zIndexMode}),t.fitViewQueued&&t.resolveFitView();let i=new Map;for(let e of n){let n=t.nodeLookup.get(e.id)?.internals.userNode;if(!n)continue;let r={...n};switch(e.type){case`dimensions`:{let t={...r.measured,...e.dimensions};e.setAttributes&&(r.width=e.dimensions?.width??r.width,r.height=e.dimensions?.height??r.height),r.measured=t;break}case`position`:r.position=e.position??r.position}i.set(e.id,r)}t.nodes=t.nodes.map(e=>i.get(e.id)??e)}function s(e){let n=t.fitViewResolver??Promise.withResolvers();return t.fitViewQueued=!0,t.fitViewOptions=e,t.fitViewResolver=n,t.nodes=[...t.nodes],n.promise}async function c(e,n,r){let i=r?.zoom===void 0?t.maxZoom:r.zoom,a=t.panZoom;return a?(await a.setViewport({x:t.width/2-e*i,y:t.height/2-n*i,zoom:i},{duration:r?.duration,ease:r?.ease,interpolate:r?.interpolate}),!0):!1}async function l(e,n){let r=t.panZoom;return r?r.scaleBy(e,n):!1}async function u(e){return l(1.2,e)}function d(e){return l(1/1.2,e)}function f(e){let n=t.panZoom;n&&(n.setScaleExtent([e,t.maxZoom]),t.minZoom=e)}function p(e){let n=t.panZoom;n&&(n.setScaleExtent([t.minZoom,e]),t.maxZoom=e)}function m(e){let n=t.panZoom;n&&(n.setTranslateExtent(e),t.translateExtent=e)}function h(e,t=null){let n=!1,r=e.map(e=>(!t||t.has(e.id))&&e.selected?(n=!0,{...e,selected:!1}):e);return[n,r]}function g(e){let n=e?.nodes?new Set(e.nodes.map(e=>e.id)):null,[r,i]=h(t.nodes,n);r&&(t.nodes=i);let a=e?.edges?new Set(e.edges.map(e=>e.id)):null,[o,s]=h(t.edges,a);o&&(t.edges=s)}function _(e){let n=t.multiselectionKeyPressed;t.nodes=t.nodes.map(t=>{let r=e.includes(t.id),i=n&&t.selected||r;return!!t.selected===i?t:{...t,selected:i}}),n||g({nodes:[]})}function v(e){let n=t.multiselectionKeyPressed;t.edges=t.edges.map(t=>{let r=e.includes(t.id),i=n&&t.selected||r;return!!t.selected===i?t:{...t,selected:i}}),n||g({edges:[]})}function y(e,n,r){let i=t.nodeLookup.get(e);if(!i){t.onerror(`012`,F1.error012(e));return}t.selectionRect=null,t.selectionRectMode=null,i.selected?(n||i.selected&&t.multiselectionKeyPressed)&&(g({nodes:[i.internals.userNode],edges:[]}),requestAnimationFrame(()=>r?.blur())):_([e])}function b(e){let n=t.edgeLookup.get(e);if(!n){t.onerror(`016`,F1.error016(e));return}(n.selectable||t.elementsSelectable&&n.selectable===void 0)&&(t.selectionRect=null,t.selectionRectMode=null,n.selected?n.selected&&t.multiselectionKeyPressed&&g({nodes:[],edges:[n]}):v([e]))}function x(e,n){let{nodeExtent:r,snapGrid:i,nodeOrigin:o,nodeLookup:s,nodesDraggable:c,onerror:l}=t,u=new Map,d=i?.[0]??5,f=i?.[1]??5,p=e.x*d*n,m=e.y*f*n;for(let e of s.values()){if(!(e.selected&&(e.draggable||c&&e.draggable===void 0)))continue;let t={x:e.internals.positionAbsolute.x+p,y:e.internals.positionAbsolute.y+m};i&&(t=m0(t,i));let{position:n,positionAbsolute:a}=Z1({nodeId:e.id,nextPosition:t,nodeLookup:s,nodeExtent:r,nodeOrigin:o,onError:l});e.position=n,e.internals.positionAbsolute=a,u.set(e.id,e)}a(u)}function S(e){return j2e({delta:e,panZoom:t.panZoom,transform:[t.viewport.x,t.viewport.y,t.viewport.zoom],translateExtent:t.translateExtent,width:t.width,height:t.height})}let C=e=>{t._connection={...e}};function w(){t._connection=V1}function T(){t.resetStoreValues(),g()}return Object.assign(t,{setNodeTypes:n,setEdgeTypes:r,addEdge:i,updateNodePositions:a,updateNodeInternals:o,zoomIn:u,zoomOut:d,fitView:s,setCenter:c,setMinZoom:f,setMaxZoom:p,setTranslateExtent:m,unselectNodesAndEdges:g,addSelectedNodes:_,addSelectedEdges:v,handleNodeSelection:y,handleEdgeSelection:b,moveSelectedNodes:x,panBy:S,updateConnection:C,cancelConnection:w,reset:T})}function A4e(e,t){let{minZoom:n,maxZoom:r,initialViewport:i,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:s,translateExtent:c,setPanZoomInstance:l,onDraggingChange:u,onTransformChange:d}=t,f=Y2e({domNode:e,minZoom:n,maxZoom:r,translateExtent:c,viewport:i,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:s,onDraggingChange:u}),p=f.getViewport();return(i.x!==p.x||i.y!==p.y||i.zoom!==p.zoom)&&d([p.x,p.y,p.zoom]),l(f),f.update(t),{update(e){f.update(e)}}}var j4e=V(`<div class="svelte-flow__zoom svelte-flow__container"><!></div>`);function M4e(e,t){Ce(t,!0);let n=J(t,`store`,15),r=q(()=>n().panActivationKeyPressed||t.panOnDrag),i=q(()=>
2461n().panActivationKeyPressed||t.panOnScroll),{viewport:a}=n(),o=!1;Qe(()=>{!o&&n().viewportInitialized&&(t.oninit?.(),o=!0)});var s=j4e(),c=j(s);ae(c,()=>t.children),H(s),ne(s,(e,t)=>A4e?.(e,t),()=>({viewport:n().viewport,minZoom:n().minZoom,maxZoom:n().maxZoom,initialViewport:a,onDraggingChange:e=>{n(n().dragging=e,!0)},setPanZoomInstance:e=>{n(n().panZoom=e,!0)},onPanZoomStart:t.onmovestart,onPanZoom:t.onmove,onPanZoomEnd:t.onmoveend,zoomOnScroll:t.zoomOnScroll,zoomOnDoubleClick:t.zoomOnDoubleClick,zoomOnPinch:t.zoomOnPinch,panOnScroll:Q(i),panOnDrag:Q(r),panOnScrollSpeed:t.panOnScrollSpeed,panOnScrollMode:t.panOnScrollMode,panActivationKeyPressed:n().panActivationKeyPressed,zoomActivationKeyPressed:n().zoomActivationKeyPressed,preventScrolling:typeof t.preventScrolling!=`boolean`||t.preventScrolling,noPanClassName:n().noPanClass,noWheelClassName:n().noWheelClass,userSelectionActive:!!n().selectionRect,translateExtent:n().translateExtent,lib:`svelte`,paneClickDistance:t.paneClickDistance,selectionOnDrag:t.selectionOnDrag,onTransformChange:e=>{n(n().viewport={x:e[0],y:e[1],zoom:e[2]},!0)},connectionInProgress:n().connection.inProgress})),X(e,s),ue()}function E2(e,t){return n=>{n.target===t&&e?.(n)}}function D2(e){return t=>{let n=e.has(t.id);return!!t.selected===n?t:{...t,selected:n}}}function O2(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var N4e=V(`<div><!></div>`);function P4e(e,t){Ce(t,!0);let n=J(t,`store`,15),i=J(t,`panOnDrag`,3,!0),a=J(t,`paneClickDistance`,3,1),o=J(t,`autoPanOnSelection`,3,!0),s,c=null,l=!1,u=new Set,d=new Set,f=q(()=>n().panActivationKeyPressed||i()),p=q(()=>n().selectionKeyPressed||!!n().selectionRect||t.selectionOnDrag&&Q(f)!==!0),m=q(()=>n().elementsSelectable&&(Q(p)||n().selectionRectMode===`user`)),h=!1,g=0,_={x:0,y:0},v=!1;function y(e){if(e.pointerType===`touch`&&Q(f)!==!1&&!n().selectionKeyPressed||(c=s?.getBoundingClientRect(),!c))return;let r=e.target===s,i=!r&&!!e.target.closest(`.nokey`),a=t.selectionOnDrag&&r||n().selectionKeyPressed;if(i||!Q(p)||!a||e.button!==0||!e.isPrimary)return;e.target?.setPointerCapture?.(e.pointerId),h=!1,v=!1;let{x:o,y:l}=k0(e,c),u=h0({x:o,y:l},[n().viewport.x,n().viewport.y,n().viewport.zoom]);n(n().selectionRect={width:0,height:0,startX:u.x,startY:u.y,x:o,y:l},!0),r||(e.stopPropagation(),e.preventDefault())}function b(e,t){if(n().selectionRect?.startX===void 0||n().selectionRect.startY===void 0)return;let r={x:n().selectionRect?.startX,y:n().selectionRect?.startY},i=g0(r,[n().viewport.x,n().viewport.y,n().viewport.zoom]),a={startX:r.x,startY:r.y,x:e<i.x?e:i.x,y:t<i.y?t:i.y,width:Math.abs(e-i.x),height:Math.abs(t-i.y)},o=u,s=d;u=new Set(X1(n().nodeLookup,a,[n().viewport.x,n().viewport.y,n().viewport.zoom],n().selectionMode===B1.Partial,!0).map(e=>e.id));let c=n().defaultEdgeOptions.selectable??!0;d=new Set;for(let e of u){let t=n().connectionLookup.get(e);if(t)for(let{edgeId:e}of t.values()){let t=n().edgeLookup.get(e);t&&(t.selectable??c)&&d.add(e)}}O2(o,u)||n(n().nodes=n().nodes.map(D2(u)),!0),O2(s,d)||n(n().edges=n().edges.map(D2(d)),!0),n(n().selectionRectMode=`user`,!0),n(n().selectionRect=a,!0)}function x(){if(!o()||!c)return;let[e,t]=n0(_,c,n().autoPanSpeed);n().panBy({x:e,y:t}).then(e=>{if(!h||!e){g=requestAnimationFrame(x);return}b(_.x,_.y),g=requestAnimationFrame(x)})}function S(){cancelAnimationFrame(g),g=0,v=!1}Pe(()=>{typeof window<`u`&&S()});function C(e){if(!Q(p)||!c||!n().selectionRect)return;let r=k0(e,c);_={x:r.x,y:r.y};let i=g0({x:n().selectionRect.startX,y:n().selectionRect.startY},[n().viewport.x,n().viewport.y,n().viewport.zoom]);if(!h){let o=n().selectionKeyPressed?0:a();if(Math.hypot(r.x-i.x,r.y-i.y)<=o)return;n().unselectNodesAndEdges(),t.onselectionstart?.(e)}h=!0,v||=(x(),!0),b(r.x,r.y)}function w(e){if(!Q(m)){e.target===s&&n().connection.inProgress&&(l=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!h&&e.target===s&&k?.(e),n(n().selectionRect=null,!0),h&&n(n().selectionRectMode=u.size>0?`nodes`:null,!0),h&&t.onselectionend?.(e),S())}function T(e){e.target?.releasePointerCapture?.(e.pointerId),S()}let E=e=>{if(Array.isArray(Q(f))&&Q(f).includes(2)){e.preventDefault();return}t.onpanecontextmenu?.({event:e})},D=e=>{h&&=(e.stopPropagation(),!1)};function k(e){if(h||n().connection.inProgress||l){h=!1,l=!1;return}t.onpaneclick?.({event:e}),n().unselectNodesAndEdges(),n(n().selectionRectMode=null,!0),n(n().selectionRect=null,!0)}var A=N4e();let ee;var M=q(()=>Q(m)?void 0:E2(k,s)),te=q(()=>E2(E,s)),ne=j(A);ae(ne,()=>t.children),H(A),We(A,e=>s=e,()=>s),O(e=>ee=r(A,1,`svelte-flow__pane svelte-flow__container`,null,ee,{draggable:e,dragging:n().dragging,selection:Q(p)}),[()=>i()===!0||Array.isArray(i())&&i().includes(0)]),L(`click`,A,function(...e){Q(M)?.apply(this,e)}),Z(`pointerdown`,A,function(...e){(Q(m)?y:void 0)?.apply(this,e)},!0),L(`pointermove`,A,function(...e){(Q(m)?C:void 0)?.apply(this,e)}),L(`pointerup`,A,w),Z(`pointercancel`,A,function(...e){(Q(m)?T:void 0)?.apply(this,e)}),L(`contextmenu`,A,function(...e){Q(te)?.apply(this,e)}),Z(`click`,A,function(...e){(Q(m)?D:void 0)?.apply(this,e)},!0),X(e,A),ue()}ge([`click`,`pointermove`,`pointerup`,`contextmenu`]);var F4e=V(`<div class="svelte-flow__viewport xyflow__viewport svelte-flow__container"><!></div>`);function I4e(e,t){Ce(t,!0);var n=F4e();let r;var i=j(n);ae(i,()=>t.children),H(n),O(()=>r=Ze(n,``,r,{transform:`translate(${t.store.viewport.x??``}px, ${t.store.viewport.y??``}px) scale(${t.store.viewport.zoom??``})`})),X(e,n),ue()}function k2(e,t){let{store:n,onDrag:r,onDragStart:i,onDragStop:a,onNodeMouseDown:o}=t,s=F2e({onDrag:r,onDragStart:i,onDragStop:a,onNodeMouseDown:o,getStoreItems:()=>{let{snapGrid:e,viewport:t}=n;return{nodes:n.nodes,nodeLookup:n.nodeLookup,edges:n.edges,nodeExtent:n.nodeExtent,snapGrid:e||[0,0],snapToGri
2461d:!!e,nodeOrigin:n.nodeOrigin,multiSelectionActive:n.multiselectionKeyPressed,domNode:n.domNode,transform:[t.x,t.y,t.zoom],autoPanOnNodeDrag:n.autoPanOnNodeDrag,nodesDraggable:n.nodesDraggable,selectNodesOnDrag:n.selectNodesOnDrag,nodeDragThreshold:n.nodeDragThreshold,unselectNodesAndEdges:n.unselectNodesAndEdges,updateNodePositions:n.updateNodePositions,onSelectionDrag:n.onselectiondrag,onSelectionDragStart:n.onselectiondragstart,onSelectionDragStop:n.onselectiondragstop,panBy:n.panBy}}});function c(e,t){if(t.disabled){s.destroy();return}s.update({domNode:e,noDragClassName:t.noDragClass,handleSelector:t.handleSelector,nodeId:t.nodeId,isSelectable:t.isSelectable,nodeClickDistance:t.nodeClickDistance})}return c(e,t),{update(t){c(e,t)},destroy(){s.destroy()}}}var L4e=V(`<div aria-live="assertive" aria-atomic="true" class="a11y-live-msg svelte-13pq11u"> </div>`),R4e=V(`<div class="a11y-hidden svelte-13pq11u"> </div> <div class="a11y-hidden svelte-13pq11u"> </div> <!>`,1);function z4e(e,t){Ce(t,!0);var n=R4e(),r=N(n),i=f(r,!0),a=g(r,2),o=f(a,!0),s=g(a,2),c=e=>{var n=L4e(),r=f(n,!0);O(()=>{b(n,`id`,`${B4e}-${t.store.flowId}`),Y(r,t.store.ariaLiveMessage)}),X(e,n)};G(s,e=>{t.store.disableKeyboardA11y||e(c)}),O(()=>{b(r,`id`,`${A2}-${t.store.flowId}`),Y(i,t.store.disableKeyboardA11y?t.store.ariaLabelConfig[`node.a11yDescription.default`]:t.store.ariaLabelConfig[`node.a11yDescription.keyboardDisabled`]),b(a,`id`,`${j2}-${t.store.flowId}`),Y(o,t.store.ariaLabelConfig[`edge.a11yDescription.default`])}),X(e,n),ue()}var A2=`svelte-flow__node-desc`,j2=`svelte-flow__edge-desc`,B4e=`svelte-flow__aria-live`,V4e=V(`<div><!></div>`);function H4e(e,r){Ce(r,!0);let i=J(r,`store`,15),a=q(()=>se(r.node.data,()=>({}),!0)),o=q(()=>se(r.node.selected,!1)),s=q(()=>r.node.draggable),c=q(()=>r.node.selectable),l=q(()=>se(r.node.deletable,!0)),u=q(()=>r.node.connectable),d=q(()=>r.node.focusable),f=q(()=>se(r.node.hidden,!1)),p=q(()=>se(r.node.dragging,!1)),m=q(()=>se(r.node.style,``)),h=q(()=>r.node.class),g=q(()=>se(r.node.type,`default`)),_=q(()=>r.node.parentId),v=q(()=>r.node.sourcePosition),y=q(()=>r.node.targetPosition),b=q(()=>se(r.node.measured,()=>({width:0,height:0}),!0).width),x=q(()=>se(r.node.measured,()=>({width:0,height:0}),!0).height),S=q(()=>r.node.initialWidth),C=q(()=>r.node.initialHeight),w=q(()=>r.node.width),T=q(()=>r.node.height),E=q(()=>r.node.dragHandle),D=q(()=>se(r.node.internals.z,0)),O=q(()=>r.node.internals.positionAbsolute.x),k=q(()=>r.node.internals.positionAbsolute.y),A=q(()=>r.node.internals.userNode),{id:ee}=r.node,M=q(()=>Q(s)??i().nodesDraggable),te=q(()=>Q(c)??i().elementsSelectable),re=q(()=>Q(u)??i().nodesConnectable),ie=q(()=>S0(r.node)),F=q(()=>!!r.node.internals.handleBounds),ae=q(()=>Q(ie)&&Q(F)),L=q(()=>Q(d)??i().nodesFocusable);function oe(e){return i().parentLookup.has(e)}let R=q(()=>oe(ee)),ce=t(null),le=null,de=Q(g),z=Q(v),pe=Q(y),B=q(()=>i().nodeTypes[Q(g)]??p2),me=q(()=>i().ariaLabelConfig);e4e(ee),n4e({get value(){return Q(re)}});let V=q(()=>{let e=Q(b)===void 0?Q(w)??Q(S):Q(w),t=Q(x)===void 0?Q(T)??Q(C):Q(T);if(e!==void 0||t!==void 0||Q(m)!==void 0)return`${Q(m)};${e?`width:${g2(e)};`:``}${t?`height:${g2(t)};`:``}`});Qe(()=>{(Q(g)!==de||Q(v)!==z||Q(y)!==pe)&&Q(ce)!==null&&requestAnimationFrame(()=>{Q(ce)!==null&&i().updateNodeInternals(new Map([[ee,{id:ee,nodeElement:Q(ce),force:!0}]]))}),de=Q(g),z=Q(v),pe=Q(y)}),Qe(()=>{r.resizeObserver&&(!Q(ae)||Q(ce)!==le)&&(le&&r.resizeObserver.unobserve(le),Q(ce)&&r.resizeObserver.observe(Q(ce)),le=Q(ce))}),Pe(()=>{le&&r.resizeObserver?.unobserve(le)});function he(e){Q(te)&&(!i().selectNodesOnDrag||!Q(M)||i().nodeDragThreshold>0)&&i().handleNodeSelection(ee),r.onnodeclick?.({node:Q(A),event:e})}function ge(e){if(!(D0(e)||i().disableKeyboardA11y)){if(L1.includes(e.key)&&Q(te)){let t=e.key===`Escape`;i().handleNodeSelection(ee,t,Q(ce))}else Q(M)&&r.node.selected&&Object.prototype.hasOwnProperty.call(_2,e.key)&&(e.preventDefault(),i(i().ariaLiveMessage=Q(me)[`node.a11yDescription.ariaLiveMessage`]({direction:e.key.replace(`Arrow`,``).toLowerCase(),x:~~r.node.internals.positionAbsolute.x,y:~~r.node.internals.positionAbsolute.y}),!0),i().moveSelectedNodes(_2[e.key],e.shiftKey?4:1))}}let U=()=>
2461{if(i().disableKeyboardA11y||!i().autoPanOnNodeFocus||!Q(ce)?.matches(`:focus-visible`))return;let{width:e,height:t,viewport:n}=i();X1(new Map([[ee,r.node]]),{x:0,y:0,width:e,height:t},[n.x,n.y,n.zoom],!0).length>0||i().setCenter(r.node.position.x+(r.node.measured.width??0)/2,r.node.position.y+(r.node.measured.height??0)/2,{zoom:n.zoom})};var W=fe(),_e=N(W),ve=e=>{var t=V4e();ye(t,()=>({"data-id":ee,class:[`svelte-flow__node`,`svelte-flow__node-${Q(g)}`,Q(h)],style:Q(V),onclick:he,onpointerenter:r.onnodepointerenter?e=>r.onnodepointerenter({node:Q(A),event:e}):void 0,onpointerleave:r.onnodepointerleave?e=>r.onnodepointerleave({node:Q(A),event:e}):void 0,onpointermove:r.onnodepointermove?e=>r.onnodepointermove({node:Q(A),event:e}):void 0,oncontextmenu:r.onnodecontextmenu?e=>r.onnodecontextmenu({node:Q(A),event:e}):void 0,onkeydown:Q(L)?ge:void 0,onfocus:Q(L)?U:void 0,tabIndex:Q(L)?0:void 0,role:r.node.ariaRole??(Q(L)?`group`:void 0),"aria-label":r.node.ariaLabel,"aria-roledescription":`node`,"aria-describedby":i().disableKeyboardA11y?void 0:`${A2}-${i().flowId}`,...r.node.domAttributes,[xe]:{dragging:Q(p),selected:Q(o),draggable:Q(M),connectable:Q(re),selectable:Q(te),nopan:Q(M),parent:Q(R)},[n]:{"z-index":Q(D),transform:`translate(${Q(O)??``}px, ${Q(k)??``}px)`,visibility:Q(ie)?`visible`:`hidden`}}));var s=j(t);P(s,()=>Q(B),(e,t)=>{t(e,{get data(){return Q(a)},get id(){return ee},get selected(){return Q(o)},get selectable(){return Q(te)},get deletable(){return Q(l)},get sourcePosition(){return Q(v)},get targetPosition(){return Q(y)},get zIndex(){return Q(D)},get dragging(){return Q(p)},get draggable(){return Q(M)},get dragHandle(){return Q(E)},get parentId(){return Q(_)},get type(){return Q(g)},get isConnectable(){return Q(re)},get positionAbsoluteX(){return Q(O)},get positionAbsoluteY(){return Q(k)},get width(){return Q(w)},get height(){return Q(T)}})}),H(t),ne(t,(e,t)=>k2?.(e,t),()=>({nodeId:ee,isSelectable:Q(te),disabled:!Q(M),handleSelector:Q(E),noDragClass:i().noDragClass,nodeClickDistance:r.nodeClickDistance,onNodeMouseDown:i().handleNodeSelection,onDrag:(e,t,n,i)=>{r.onnodedrag?.({event:e,targetNode:n,nodes:i})},onDragStart:(e,t,n,i)=>{r.onnodedragstart?.({event:e,targetNode:n,nodes:i})},onDragStop:(e,t,n,i)=>{r.onnodedragstop?.({event:e,targetNode:n,nodes:i})},store:i()})),We(t,e=>I(ce,e),()=>Q(ce)),X(e,t)};G(_e,e=>{Q(f)||e(ve)}),X(e,W),ue()}var U4e=V(`<div class="svelte-flow__nodes"></div>`);function W4e(e,t){Ce(t,!0);let n=J(t,`store`,15),r=typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{let t=new Map;e.forEach(e=>{let n=e.target.getAttribute(`data-id`);t.set(n,{id:n,nodeElement:e.target,force:!0})}),n().updateNodeInternals(t)});Pe(()=>{r?.disconnect()});var i=U4e();B(i,21,()=>n().visible.nodes.values(),e=>e.id,(e,i)=>{H4e(e,{get node(){return Q(i)},get resizeObserver(){return r},get nodeClickDistance(){return t.nodeClickDistance},get onnodeclick(){return t.onnodeclick},get onnodepointerenter(){return t.onnodepointerenter},get onnodepointermove(){return t.onnodepointermove},get onnodepointerleave(){return t.onnodepointerleave},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get onnodecontextmenu(){return t.onnodecontextmenu},get store(){return n()},set store(e){n(e)}})}),H(i),X(e,i),ue()}var G4e=je(`<svg class="svelte-flow__edge-wrapper"><g><!></g></svg>`);function K4e(e,t){Ce(t,!0);let n=q(()=>t.edge.id),r=q(()=>t.edge.source),i=q(()=>t.edge.target),a=q(()=>t.edge.sourceX),o=q(()=>t.edge.sourceY),s=q(()=>t.edge.targetX),c=q(()=>t.edge.targetY),l=q(()=>t.edge.sourcePosition),u=q(()=>t.edge.targetPosition),d=q(()=>se(t.edge.animated,!1)),f=q(()=>se(t.edge.selected,!1)),p=q(()=>t.edge.label),m=q(()=>t.edge.labelStyle),h=q(()=>se(t.edge.data,()=>({}),!0)),g=q(()=>t.edge.style),_=q(()=>t.edge.interactionWidth),v=q(()=>se(t.edge.type,`default`)),y=q(()=>t.edge.sourceHandle),b=q(()=>t.edge.targetHandle),x=q(()=>t.edge.markerStart),S=q(()=>t.edge.markerEnd),C=q(()=>t.edge.selectable),w=q(()=>t.edge.focusable),T=q(()=>se(t.edge.deletable,!0)),E=q(()=>t.edge.hidden),D=q(()=>t.edge.zIndex),k=q(()=>t.edge.class),A=q(()=>t.edge.ariaLabel);
2461i4e(Q(n));let ee=null,M=q(()=>Q(C)??t.store.elementsSelectable),te=q(()=>Q(w)??t.store.edgesFocusable),ne=q(()=>t.store.edgeTypes[Q(v)]??y2),re=q(()=>Q(x)?`url('#${U0(Q(x),t.store.flowId)}')`:void 0),ie=q(()=>Q(S)?`url('#${U0(Q(S),t.store.flowId)}')`:void 0);function F(e){let r=t.store.edgeLookup.get(Q(n));r&&(Q(M)&&t.store.handleEdgeSelection(Q(n)),t.onedgeclick?.({event:e,edge:r}))}function ae(e,r){let i=t.store.edgeLookup.get(Q(n));i&&r({event:e,edge:i})}function I(e){if(!t.store.disableKeyboardA11y&&L1.includes(e.key)&&Q(M)){let{unselectNodesAndEdges:r,addSelectedEdges:i}=t.store;e.key===`Escape`?(ee?.blur(),r({edges:[t.edge]})):i([Q(n)])}}var L=fe(),oe=N(L),R=e=>{var x=G4e();let S;var C=j(x);ye(C,()=>({class:[`svelte-flow__edge`,Q(k)],"data-id":Q(n),onclick:F,oncontextmenu:t.onedgecontextmenu?e=>{ae(e,t.onedgecontextmenu)}:void 0,onpointerenter:t.onedgepointerenter?e=>{ae(e,t.onedgepointerenter)}:void 0,onpointerleave:t.onedgepointerleave?e=>{ae(e,t.onedgepointerleave)}:void 0,"aria-label":Q(A)===null?void 0:Q(A)?Q(A):`Edge from ${Q(r)} to ${Q(i)}`,"aria-describedby":Q(te)?`${j2}-${t.store.flowId}`:void 0,role:t.edge.ariaRole??(Q(te)?`group`:`img`),"aria-roledescription":`edge`,onkeydown:Q(te)?I:void 0,tabindex:Q(te)?0:void 0,...t.edge.domAttributes,[xe]:{animated:Q(d),selected:Q(f),selectable:Q(M)}}));var w=j(C);P(w,()=>Q(ne),(e,t)=>{t(e,{get id(){return Q(n)},get source(){return Q(r)},get target(){return Q(i)},get sourceX(){return Q(a)},get sourceY(){return Q(o)},get targetX(){return Q(s)},get targetY(){return Q(c)},get sourcePosition(){return Q(l)},get targetPosition(){return Q(u)},get animated(){return Q(d)},get selected(){return Q(f)},get label(){return Q(p)},get labelStyle(){return Q(m)},get data(){return Q(h)},get style(){return Q(g)},get interactionWidth(){return Q(_)},get selectable(){return Q(M)},get deletable(){return Q(T)},get type(){return Q(v)},get sourceHandleId(){return Q(y)},get targetHandleId(){return Q(b)},get markerStart(){return Q(re)},get markerEnd(){return Q(ie)}})}),H(C),We(C,e=>ee=e,()=>ee),H(x),O(()=>S=Ze(x,``,S,{"z-index":Q(D)})),X(e,x)};G(oe,e=>{Q(E)||e(R)}),X(e,L),ue()}var q4e=je(`<defs></defs>`);function J4e(e,t){Ce(t,!1);let n=C2();R();var r=q4e();B(r,5,()=>n.markers,e=>e.id,(e,t)=>{Q4e(e,le(()=>Q(t)))}),H(r),X(e,r),ue()}var Y4e=je(`<polyline class="arrow" fill="none" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4"></polyline>`),X4e=je(`<polyline class="arrowclosed" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>`),Z4e=je(`<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>`);function Q4e(e,t){Ce(t,!0);let n=J(t,`width`,3,12.5),r=J(t,`height`,3,12.5),i=J(t,`markerUnits`,3,`strokeWidth`),a=J(t,`orient`,3,`auto-start-reverse`),o=J(t,`color`,3,`none`);var s=Z4e(),c=j(s),l=e=>{var n=Y4e();let r;O(()=>{b(n,`stroke-width`,t.strokeWidth),r=Ze(n,``,r,{stroke:o()})}),X(e,n)},u=e=>{var n=X4e();let r;O(()=>{b(n,`stroke-width`,t.strokeWidth),r=Ze(n,``,r,{stroke:o(),fill:o()})}),X(e,n)};G(c,e=>{t.type===U1.Arrow?e(l):t.type===U1.ArrowClosed&&e(u,1)}),H(s),O(()=>{b(s,`id`,t.id),b(s,`markerWidth`,`${n()}`),b(s,`markerHeight`,`${r()}`),b(s,`markerUnits`,i()),b(s,`orient`,a())}),X(e,s),ue()}var $4e=V(`<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!></div>`);function e3e(e,t){Ce(t,!0);let n=J(t,`store`,15);var r=$4e(),i=j(r);J4e(j(i),{}),H(i);var a=g(i,2);B(a,17,()=>n().visible.edges.values(),e=>e.id,(e,r)=>{K4e(e,{get edge(){return Q(r)},get onedgeclick(){return t.onedgeclick},get onedgecontextmenu(){return t.onedgecontextmenu},get onedgepointerenter(){return t.onedgepointerenter},get onedgepointerleave(){return t.onedgepointerleave},get store(){return n()},set store(e){n(e)}})}),H(r),X(e,r),ue()}var t3e=V(`<div class="svelte-flow__selection svelte-1vr3gfi"></div>`);function M2(e,t){Ce(t,!0);let n=J(t,`x`,3,0),r=J(t,`y`,3,0),i=J(t,`width`,3,0),a=J(t,`height`,3,0),o=J(t,`isVisible`,3,!0);var s=fe(),c=N(s),l=e=>{var t=t3e();let o;O((e,i)=>o=Ze(t,``,o,{width:e,height:i,transform:`translate(${n()}px, ${r()}px)`}),[()=>typeof i()==`string`?i():g2(i()),()=>typeof a()==`string`?a():g2(a())]),X(e,t)};G(c,e=>{o()&&e(l)}
2461),X(e,s),ue()}var n3e=V(`<div><!></div>`);function r3e(e,n){Ce(n,!0);let i=t(void 0);Qe(()=>{n.store.disableKeyboardA11y||Q(i)?.focus({preventScroll:!0})});let a=q(()=>{if(n.store.selectionRectMode===`nodes`){n.store.nodes;let e=Y1(n.store.nodeLookup,{filter:e=>!!e.selected});if(e.width>0&&e.height>0)return e}return null});function o(e){let t=n.store.nodes.filter(e=>e.selected);n.onselectioncontextmenu?.({nodes:t,event:e})}function s(e){let t=n.store.nodes.filter(e=>e.selected);n.onselectionclick?.({nodes:t,event:e})}function c(e){Object.prototype.hasOwnProperty.call(_2,e.key)&&(e.preventDefault(),n.store.moveSelectedNodes(_2[e.key],e.shiftKey?4:1))}var l=fe(),u=N(l),d=e=>{var t=n3e();let l;M2(j(t),{width:`100%`,height:`100%`,x:0,y:0}),H(t),ne(t,(e,t)=>k2?.(e,t),()=>({disabled:!1,store:n.store,onDrag:(e,t,r,i)=>{n.onnodedrag?.({event:e,targetNode:null,nodes:i})},onDragStart:(e,t,r,i)=>{n.onnodedragstart?.({event:e,targetNode:null,nodes:i})},onDragStop:(e,t,r,i)=>{n.onnodedragstop?.({event:e,targetNode:null,nodes:i})}})),We(t,e=>I(i,e),()=>Q(i)),O((e,i)=>{r(t,1,M([`svelte-flow__selection-wrapper`,n.store.noPanClass]),`svelte-sf2y5e`),b(t,`role`,n.store.disableKeyboardA11y?void 0:`button`),b(t,`tabindex`,n.store.disableKeyboardA11y?void 0:-1),l=Ze(t,``,l,{width:e,height:i,transform:`translate(${Q(a).x??``}px, ${Q(a).y??``}px)`})},[()=>g2(Q(a).width),()=>g2(Q(a).height)]),L(`contextmenu`,t,o),L(`click`,t,s),L(`keydown`,t,function(...e){(n.store.disableKeyboardA11y?void 0:c)?.apply(this,e)}),X(e,t)},f=q(()=>n.store.selectionRectMode===`nodes`&&Q(a)&&f0(Q(a).x)&&f0(Q(a).y));G(u,e=>{Q(f)&&e(d)}),X(e,l),ue()}ge([`contextmenu`,`click`,`keydown`]);function i3e(e){switch(e){case`none`:return 0;case`ctrl`:return 8;case`shift`:return 4;case`alt`:return 2;case`meta`:return 1}}function N2(e,t){let{enabled:n=!0,trigger:r,type:i=`keydown`}=t;function a(t){let n=Array.isArray(r)?r:[r],i=[t.metaKey,t.altKey,t.shiftKey,t.ctrlKey].reduce((e,t,n)=>t?e|1<<n:e,0);for(let r of n){let n={preventDefault:!1,enabled:!0,...r},{modifier:a,key:o,code:s,callback:c,preventDefault:l,enabled:u}=n;if(!o&&!s&&console.warn("[svelte-put/shortcut] Trigger should have either `key` or `code`, a trigger missing both was detected! Check your configuration"),u&&(o||s)){if(s&&t.code!==s||o&&t.key!==o)continue;if(a===null||a===!1){if(i!==0)continue}else if(a!==void 0&&a?.[0]?.length>0){let e=Array.isArray(a)?a:[a],t=!1;for(let n of e)if((Array.isArray(n)?n:[n]).reduce((e,t)=>e|i3e(t),0)===i){t=!0;break}if(!t)continue}l&&t.preventDefault();let r={node:e,trigger:n,originalEvent:t};e.dispatchEvent(new CustomEvent(`shortcut`,{detail:r})),c?.(r)}}}let o;return n&&(o=Xe(e,i,a)),{update:t=>{let{enabled:s=!0,type:c=`keydown`}=t;n&&(!s||i!==c)?o?.():!n&&s&&(o=Xe(e,c,a)),n=s,i=c,r=t.trigger},destroy:()=>{o?.()}}}function P2(){let e=q(C2),t=t=>{let n=h2(t)?t:Q(e).nodeLookup.get(t.id),r=n.parentId?o2e(n.position,n.measured,n.parentId,Q(e).nodeLookup,Q(e).nodeOrigin):n.position;return o0({...n,position:r,width:n.measured?.width??n.width,height:n.measured?.height??n.height})};function n(t,n,r={replace:!1}){Q(e).nodes=K(()=>Q(e).nodes).map(e=>{if(e.id===t){let t=typeof n==`function`?n(e):n;return r?.replace&&h2(t)?t:{...e,...t}}return e})}function r(t,n,r={replace:!1}){Q(e).edges=K(()=>Q(e).edges).map(e=>{if(e.id===t){let t=typeof n==`function`?n(e):n;return r.replace&&h4e(t)?t:{...e,...t}}return e})}let i=t=>Q(e).nodeLookup.get(t);return{zoomIn:Q(e).zoomIn,zoomOut:Q(e).zoomOut,getInternalNode:i,getNode:e=>i(e)?.internals.userNode,getNodes:t=>t===void 0?Q(e).nodes:F2(Q(e).nodeLookup,t),getEdge:t=>Q(e).edgeLookup.get(t),getEdges:t=>t===void 0?Q(e).edges:F2(Q(e).edgeLookup,t),setZoom:async(t,n)=>{let r=Q(e).panZoom;return r?r.scaleTo(t,n):!1},getZoom:()=>Q(e).viewport.zoom,setViewport:async(t,n)=>{let r=Q(e).viewport;return Q(e).panZoom?(await Q(e).panZoom.setViewport({x:t.x??r.x,y:t.y??r.y,zoom:t.zoom??r.zoom},n),!0):!1},getViewport:()=>Ae(Q(e).viewport),setCenter:async(t,n,r)=>Q(e).setCenter(t,n,r),fitView:t=>Q(e).fitView(t),fitBounds:async(t,n)=>{if(!Q(e).panZoom)return!1;let r=v0(t,Q(e).width,Q(e).height,Q(e).minZoom,Q(e).maxZoom,n?.padding??.1);return await Q(e).panZoom.setViewport(r,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},getIntersectingNodes:(n,r=!0,i)=>{let a=d0(n),o=a?n:t(n);return o?(i||Q(e).nodes).filter(t=>{let i=Q(e).nodeLookup.get(t.id);if(!i||!a&&t.id===n.id)return!1;let s=o0(i),c=u0(s,o);return r&&c>0||c>=s.width*s.height||c>=o.width*o.height}):[]},isNodeIntersecting:(e,n,r=!0)=>{let i=d0(e)?e:t(e);
2461if(!i)return!1;let a=u0(i,n);return r&&a>0||a>=n.width*n.height||a>=i.width*i.height},deleteElements:async({nodes:t=[],edges:n=[]})=>{let{nodes:r,edges:i}=await r2e({nodesToRemove:t,edgesToRemove:n,nodes:Q(e).nodes,edges:Q(e).edges,onBeforeDelete:Q(e).onbeforedelete});return r&&(Q(e).nodes=K(()=>Q(e).nodes).filter(e=>!r.some(({id:t})=>t===e.id))),i&&(Q(e).edges=K(()=>Q(e).edges).filter(e=>!i.some(({id:t})=>t===e.id))),(r.length>0||i.length>0)&&Q(e).ondelete?.({nodes:r,edges:i}),{deletedNodes:r,deletedEdges:i}},screenToFlowPosition:(t,n={snapToGrid:!0})=>{if(!Q(e).domNode)return t;let r=n.snapToGrid?Q(e).snapGrid:!1,{x:i,y:a,zoom:o}=Q(e).viewport,{x:s,y:c}=Q(e).domNode.getBoundingClientRect();return h0({x:t.x-s,y:t.y-c},[i,a,o],r!==null,r||[1,1])},flowToScreenPosition:t=>{if(!Q(e).domNode)return t;let{x:n,y:r,zoom:i}=Q(e).viewport,{x:a,y:o}=Q(e).domNode.getBoundingClientRect(),s=g0(t,[n,r,i]);return{x:s.x+a,y:s.y+o}},toObject:()=>structuredClone({nodes:[...Q(e).nodes],edges:[...Q(e).edges],viewport:{...Q(e).viewport}}),updateNode:n,updateNodeData:(t,r,i)=>{let a=Q(e).nodeLookup.get(t)?.internals.userNode;if(!a)return;let o=typeof r==`function`?r(a):r;n(t,e=>({...e,data:i?.replace?o:{...e.data,...o}}))}
2461,updateEdge:r,getNodesBounds:t=>$0e(t,{nodeLookup:Q(e).nodeLookup,nodeOrigin:Q(e).nodeOrigin}),getHandleConnections:({type:t,id:n,nodeId:r})=>Array.from(Q(e).connectionLookup.get(`${r}-${t}-${n??null}`)?.values()??[])}}function F2(e,t){let n=[];for(let r of t){let t=e.get(r);if(t){let e=`internals`in t?t.internals?.userNode:t;n.push(e)}}return n}function a3e(e,t){Ce(t,!0);let n=J(t,`store`,15),r=J(t,`selectionKey`,3,`Shift`),i=J(t,`multiSelectionKey`,19,()=>y0()?`Meta`:`Control`),a=J(t,`deleteKey`,3,`Backspace`),o=J(t,`panActivationKey`,3,` `),s=J(t,`zoomActivationKey`,19,()=>y0()?`Meta`:`Control`),{deleteElements:c}=P2();function l(e){return typeof e==`object`&&!!e}function u(e){return l(e)&&e.modifier||[]}function d(e){return e==null?``:l(e)?e.key:e}function f(e,t){return(Array.isArray(e)?e:[e]).map(e=>{let n=d(e);return{key:n,modifier:u(e),enabled:n!==null,callback:t}})}function m(){n(n().selectionRect=null,!0),n(n().selectionKeyPressed=!1,!0),n(n().multiselectionKeyPressed=!1,!0),n(n().deleteKeyPressed=!1,!0),n(n().panActivationKeyPressed=!1,!0),n(n().zoomActivationKeyPressed=!1,!0)}function h(){let e=n().nodes.filter(e=>e.selected),t=n().edges.filter(e=>e.selected);c({nodes:e,edges:t})}Z(`blur`,p,m),Z(`contextmenu`,p,m),ne(p,(e,t)=>N2?.(e,t),()=>({trigger:f(r(),()=>n(n().selectionKeyPressed=!0,!0)),type:`keydown`})),ne(p,(e,t)=>N2?.(e,t),()=>({trigger:f(r(),()=>n(n().selectionKeyPressed=!1,!0)),type:`keyup`})),ne(p,(e,t)=>N2?.(e,t),()=>({trigger:f(i(),()=>{n(n().multiselectionKeyPressed=!0,!0)}),type:`keydown`})),ne(p,(e,t)=>N2?.(e,t),()=>({trigger:f(i(),()=>n(n().multiselectionKeyPressed=!1,!0)),type:`keyup`})),ne(p,(e,t)=>N2?.(e,t),()=>({trigger:f(a(),e=>{!(e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)&&!D0(e.originalEvent)&&(n(n().deleteKeyPressed=!0,!0),h())}),type:`keydown`})),ne(p,(e,t)=>N2?.(e,t),()=>({trigger:f(a(),()=>n(n().deleteKeyPressed=!1,!0)),type:`keyup`})),ne(p,(e,t)=>N2?.(e,t),()=>({trigger:f(o(),()=>n(n().panActivationKeyPressed=!0,!0)),type:`keydown`})),ne(p,(e,t)=>N2?.(e,t),()=>({trigger:f(o(),()=>n(n().panActivationKeyPressed=!1,!0)),type:`keyup`})),ne(p,(e,t)=>N2?.(e,t),()=>({trigger:f(s(),()=>n(n().zoomActivationKeyPressed=!0,!0)),type:`keydown`})),ne(p,(e,t)=>N2?.(e,t),()=>({trigger:f(s(),()=>n(n().zoomActivationKeyPressed=!1,!0)),type:`keyup`})),ue()}var o3e=je(`<path fill="none" class="svelte-flow__connection-path"></path>`),s3e=je(`<svg class="svelte-flow__connectionline"><g><!></g></svg>`);function c3e(e,t){Ce(t,!0);let n=q(()=>{if(!t.store.connection.inProgress)return``;let e={sourceX:t.store.connection.from.x,sourceY:t.store.connection.from.y,sourcePosition:t.store.connection.fromPosition,targetX:t.store.connection.to.x,targetY:t.store.connection.to.y,targetPosition:t.store.connection.toPosition};switch(t.type){case H1.Bezier:{let[t]=N0(e);return t}case H1.Straight:{let[t]=F0(e);return t}case H1.Step:case H1.SmoothStep:{let[n]=R0({...e,borderRadius:t.type===H1.Step?0:void 0});return n}}});var i=fe(),a=N(i),o=e=>{var i=s3e(),a=j(i),o=j(a),s=e=>{var n=fe(),r=N(n);P(r,()=>t.LineComponent,(e,t)=>{t(e,{})}),X(e,n)},c=e=>{var r=o3e();O(()=>{b(r,`d`,Q(n)),Ze(r,t.style)}),X(e,r)};G(o,e=>{t.LineComponent?e(s):e(c,-1)}),H(a),H(i),O(e=>{b(i,`width`,t.store.width),b(i,`height`,t.store.height),Ze(i,t.containerStyle),r(a,0,e)},[()=>M([`svelte-flow__connection`,l2e(t.store.connection.isValid)])]),X(e,i)};G(a,e=>{t.store.connection.inProgress&&e(o)}),X(e,i),ue()}var l3e=new Set([`$$slots`,`$$events`,`$$legacy`,`position`,`style`,`class`,`children`]),u3e=V(`<div><!></div>`);function I2(e,t){Ce(t,!0);let n=J(t,`position`,3,`top-right`),r=Le(t,l3e),i=q(()=>`${n()}`.split(`-`));var a=u3e();ye(a,e=>({class:e,style:t.style,...r}),[()=>[`svelte-flow__panel`,t.class,...Q(i)]]);var o=j(a);ae(o,()=>t.children??qe),H(a),X(e,a),ue()}var d3e=V(`<a target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>`);function f3e(e,t){Ce(t,!0);let n=J(t,`position`,3,`bottom-right`),r=`https://svelteflow.dev?utm_source=attribution`;var i=fe(),a=N(i),o=e=>{{let t=q(()=>`Please only hide this attribution when you are subscribed to Svelte Flow Pro: ${r}`);I2(e,{get position(){return n()},class:`svelte-flow__attribution`,get"data-message"(){return Q(t)},children:(e,t)=>{var n=d3e();O(()=>b(n,`href`,r)),X(e,n)},$$slots:{default:!0}})}};G(a,e=>{t.proOptions?.hideAttribution||e(o)}),X(e,i),ue()}var p3e=V(`<div><!></div>`);function m3e(e,t){Ce(t,!0);let r=J(t,`domNode`,15),i=J(t,`clientWidth`,15),a=J(t,`clientHeight`,15);q(()=>t.rest.id);let o=q(()=>t.rest.class);q(()=>t.rest.nodeTypes),q(()=>t.rest.edgeTypes),q(()=>t.rest.colorMode),q(()=>t.rest.isValidConnection),q(()=>t.rest.onmove),q(()=>t.rest.onmovestart),q(()=>t.rest.onmoveend),q(()=>t.rest.onflowerror),q(()=>t.rest.ondelete),q(()=>t.rest.onbeforedelete),q(()=>t.rest.onbeforeconnect),q(()=>t.rest.onconnect),q(()=>t.rest.onconnectstart),q(()=>t.rest.onconnectend),q(()=>t.rest.onbeforereconnect),q(()=>t.rest.onreconnect),q(()=>t.rest.onreconnectstart),q(()=>t.rest.onreconnectend),q(()=>t.rest.onclickconnectstart),q(()=>t.rest.onclickconnectend),q(()=>t.rest.oninit),q(()=>t.rest.onselectionchange),q(()=>t.rest.onselectiondragstart),q(()=>t.rest.onselectiondrag),q(()=>t.rest.onselectiondragstop),q(()=>t.rest.onselectionstart),q(()=>t.rest.onselectionend),q(()=>t.rest.clickConnect),q(()=>t.rest.fitView),q(()=>t.rest.fitViewOptions),q(()=>t.rest.nodeOrigin),q(()=>t.rest.nodeDragThreshold),q(()=>t.rest.connectionDragThreshold),q(()=>t.rest.minZoom),q(()=>t.rest.maxZoom),q(()=>t.rest.initialViewport),q(()=>t.rest.connectionRadius),q(()=>t.rest.connectionMode),q(()=>
2461t.rest.selectionMode),q(()=>t.rest.selectNodesOnDrag),q(()=>t.rest.snapGrid),q(()=>t.rest.defaultMarkerColor),q(()=>t.rest.translateExtent),q(()=>t.rest.nodeExtent),q(()=>t.rest.onlyRenderVisibleElements),q(()=>t.rest.autoPanOnConnect),q(()=>t.rest.autoPanOnNodeDrag),q(()=>t.rest.colorModeSSR),q(()=>t.rest.defaultEdgeOptions),q(()=>t.rest.elevateNodesOnSelect),q(()=>t.rest.elevateEdgesOnSelect),q(()=>t.rest.nodesDraggable),q(()=>t.rest.autoPanOnNodeFocus),q(()=>t.rest.nodesConnectable),q(()=>t.rest.elementsSelectable),q(()=>t.rest.nodesFocusable),q(()=>t.rest.edgesFocusable),q(()=>t.rest.disableKeyboardA11y),q(()=>t.rest.noDragClass),q(()=>t.rest.noPanClass),q(()=>t.rest.noWheelClass),q(()=>t.rest.ariaLabelConfig),q(()=>t.rest.autoPanSpeed),q(()=>t.rest.panOnScrollSpeed),q(()=>t.rest.zIndexMode),q(()=>t.rest.autoPanOnSelection);let s=q(()=>Ye(t.rest,`id.class.nodeTypes.edgeTypes.colorMode.isValidConnection.onmove.onmovestart.onmoveend.onflowerror.ondelete.onbeforedelete.onbeforeconnect.onconnect.onconnectstart.onconnectend.onbeforereconnect.onreconnect.onreconnectstart.onreconnectend.onclickconnectstart.onclickconnectend.oninit.onselectionchange.onselectiondragstart.onselectiondrag.onselectiondragstop.onselectionstart.onselectionend.clickConnect.fitView.fitViewOptions.nodeOrigin.nodeDragThreshold.connectionDragThreshold.minZoom.maxZoom.initialViewport.connectionRadius.connectionMode.selectionMode.selectNodesOnDrag.snapGrid.defaultMarkerColor.translateExtent.nodeExtent.onlyRenderVisibleElements.autoPanOnConnect.autoPanOnNodeDrag.colorModeSSR.defaultEdgeOptions.elevateNodesOnSelect.elevateEdgesOnSelect.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.elementsSelectable.nodesFocusable.edgesFocusable.disableKeyboardA11y.noDragClass.noPanClass.noWheelClass.ariaLabelConfig.autoPanSpeed.panOnScrollSpeed.zIndexMode.autoPanOnSelection`.split(`.`)));function c(e){e.currentTarget.scrollTo({top:0,left:0,behavior:`auto`}),t.rest.onscroll&&t.rest.onscroll(e)}var l=p3e();ye(l,(e,r)=>({class:[`svelte-flow`,`svelte-flow__container`,t.colorMode,Q(o)],"data-testid":`svelte-flow__wrapper`,role:`application`,onscroll:c,...Q(s),[n]:{width:e,height:r}}),[()=>g2(t.width),()=>g2(t.height)],void 0,void 0,`svelte-mkap6j`);var u=j(l);ae(u,()=>t.children??qe),H(l),We(l,e=>r(e),()=>r()),ee(l,`clientHeight`,a),ee(l,`clientWidth`,i),X(e,l),ue()}var h3e=new Set(`$$slots.$$events.$$legacy.width.height.proOptions.selectionKey.deleteKey.panActivationKey.multiSelectionKey.zoomActivationKey.paneClickDistance.nodeClickDistance.onmovestart.onmoveend.onmove.oninit.onnodeclick.onnodecontextmenu.onnodedrag.onnodedragstart.onnodedragstop.onnodepointerenter.onnodepointermove.onnodepointerleave.onselectionclick.onselectioncontextmenu.onselectionstart.onselectionend.onedgeclick.onedgecontextmenu.onedgepointerenter.onedgepointerleave.onpaneclick.onpanecontextmenu.panOnScrollMode.preventScrolling.zoomOnScroll.zoomOnDoubleClick.zoomOnPinch.panOnScroll.panOnScrollSpeed.panOnDrag.selectionOnDrag.autoPanOnSelection.connectionLineComponent.connectionLineStyle.connectionLineContainerStyle.connectionLineType.attributionPosition.children.nodes.edges.viewport`.split(`.`)),g3e=V(`<div class="svelte-flow__viewport-back svelte-flow__container"></div> <!> <div class="svelte-flow__edge-labels svelte-flow__container"></div> <!> <!> <!> <div class="svelte-flow__viewport-front svelte-flow__container"></div>`,1),_3e=V(`<!> <!>`,1),v3e=V(`<!> <!> <!> <!> <!>`,1);function L2(e,t){Ce(t,!0);let n=J(t,`paneClickDistance`,3,1),r=J(t,`nodeClickDistance`,3,1),i=J(t,`panOnScrollMode`,19,()=>z1.Free),a=J(t,`preventScrolling`,3,!0),o=J(t,`zoomOnScroll`,3,!0),s=J(t,`zoomOnDoubleClick`,3,!0),c=J(t,`zoomOnPinch`,3,!0),l=J(t,`panOnScroll`,3,!1),u=J(t,`panOnScrollSpeed`,3,.5),d=J(t,`panOnDrag`,3,!0),f=J(t,`selectionOnDrag`,3,!1),p=J(t,`autoPanOnSelection`,3,!0),m=J(t,`connectionLineType`,19,()=>H1.Bezier),h=J(t,`nodes`,31,()=>Ne([])),_=J(t,`edges`,31,()=>Ne([])),v=J(t,`viewport`,15,void 0),y=Le(t,h3e),b=T2({props:y,width:t.width,height:t.height,get nodes(){return h()},set nodes(e){h(e)},get edges(){return _()},set edges(e){_(e)},get viewport(){return v()},set viewport(e){v(e)}}),x=De(w2);x&&x.setStore&&x.setStore(b),He(w2,{provider:!1,getStore(){return b}}),Qe(()=>{let e={nodes:b.selectedNodes,edges:b.selectedEdges};K(()=>t.onselectionchange)?.(e);for(let t of b.selectionChangeHandlers.values())t(e)}),Pe(()=>{x?.setStore(T2({width:0,height:0,nodes:[],edges:[],props:{}}))}),m3e(e,{get colorMode(){return b.colorMode},get width(){return t.width},get height(){return t.height},get rest(){return y},get domNode(){return b.domNode},set domNode(e){b.domNode=e},get clientWidth(){return b.width},set clientWidth(e){b.width=e},get clientHeight(){return b.height},set clientHeight(e){b.height=e},children:(e,h)=>{var _=v3e(),v=N(_);a3e(v,{get selectionKey(){return t.selectionKey},get deleteKey(){return t.deleteKey},get panActivationKey(){return t.panActivationKey},get multiSelectionKey(){return t.multiSelectionKey},get zoomActivationKey(){return t.zoomActivationKey}
2461,get store(){return b},set store(e){b=e}});var y=g(v,2);M4e(y,{get panOnScrollMode(){return i()},get preventScrolling(){return a()},get zoomOnScroll(){return o()},get zoomOnDoubleClick(){return s()},get zoomOnPinch(){return c()},get panOnScroll(){return l()},get panOnScrollSpeed(){return u()},get panOnDrag(){return d()},get paneClickDistance(){return n()},get selectionOnDrag(){return f()},get onmovestart(){return t.onmovestart},get onmove(){return t.onmove},get onmoveend(){return t.onmoveend},get oninit(){return t.oninit},get store(){return b},set store(e){b=e},children:(e,i)=>{P4e(e,{get onpaneclick(){return t.onpaneclick},get onpanecontextmenu(){return t.onpanecontextmenu},get onselectionstart(){return t.onselectionstart},get onselectionend(){return t.onselectionend},get panOnDrag(){return d()},get paneClickDistance(){return n()},get selectionOnDrag(){return f()},get autoPanOnSelection(){return p()},get store(){return b},set store(e){b=e},children:(e,n)=>{var i=_3e(),a=N(i);I4e(a,{get store(){return b},set store(e){b=e},children:(e,n)=>{var i=g3e(),a=g(N(i),2);e3e(a,{get onedgeclick(){return t.onedgeclick},get onedgecontextmenu(){return t.onedgecontextmenu},get onedgepointerenter(){return t.onedgepointerenter},get onedgepointerleave(){return t.onedgepointerleave},get store(){return b},set store(e){b=e}});var o=g(a,4);c3e(o,{get type(){return m()},get LineComponent(){return t.connectionLineComponent},get containerStyle(){return t.connectionLineContainerStyle},get style(){return t.connectionLineStyle},get store(){return b},set store(e){b=e}});var s=g(o,2);W4e(s,{get nodeClickDistance(){return r()},get onnodeclick(){return t.onnodeclick},get onnodecontextmenu(){return t.onnodecontextmenu},get onnodepointerenter(){return t.onnodepointerenter},get onnodepointermove(){return t.onnodepointermove},get onnodepointerleave(){return t.onnodepointerleave},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get store(){return b},set store(e){b=e}}),r3e(g(s,2),{get onselectionclick(){return t.onselectionclick},get onselectioncontextmenu(){return t.onselectioncontextmenu},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get store(){return b},set store(e){b=e}}),W(2),X(e,i)},$$slots:{default:!0}});var o=g(a,2);{let e=q(()=>!!(b.selectionRect&&b.selectionRectMode===`user`)),t=q(()=>b.selectionRect?.width),n=q(()=>b.selectionRect?.height),r=q(()=>b.selectionRect?.x),i=q(()=>b.selectionRect?.y);M2(o,{get isVisible(){return Q(e)},get width(){return Q(t)},get height(){return Q(n)},get x(){return Q(r)},get y(){return Q(i)}})}X(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}});var x=g(y,2);f3e(x,{get proOptions(){return t.proOptions},get position(){return t.attributionPosition}});var S=g(x,2);z4e(S,{get store(){return b}});var C=g(S,2);ae(C,()=>t.children??qe),X(e,_)},$$slots:{default:!0}}),ue()}function R2(e,n){Ce(n,!0);let r=t(T2({props:{},nodes:[],edges:[]}));He(w2,{provider:!0,getStore(){return Q(r)},setStore:e=>{I(r,e)}}),Pe(()=>{Q(r).reset()});var i=fe(),a=N(i);ae(a,()=>n.children??qe),X(e,i),ue()}var y3e=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`bgColor`,`bgColorHover`,`color`,`colorHover`,`borderColor`,`onclick`,`children`]),b3e=V(`<button><!></button>`);function z2(e,t){let r=Le(t,y3e);var i=b3e();ye(i,()=>({type:`button`,onclick:t.onclick,class:[`svelte-flow__controls-button`,t.class],...r,[n]:{"--xy-controls-button-background-color-props":t.bgColor,"--xy-controls-button-background-color-hover-props":t.bgColorHover,"--xy-controls-button-color-props":t.color,"--xy-controls-button-color-hover-props":t.colorHover,"--xy-controls-button-border-color-props":t.borderColor}}));var a=j(i);ae(a,()=>t.children??qe),H(i),X(e,i)}var x3e=je(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"></path></svg>`);function S3e(e){var t=x3e();X(e,t)}var C3e=je(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>`);function w3e(e){var t=C3e();X(e,t)}var T3e=je(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 30"><path d="M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"></path></svg>`);function E3e(e){var t=T3e();X(e,t)}var D3e=je(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"></path></svg>`);function O3e(e){var t=D3e();X(e,t)}var k3e=je(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"></path></svg>`);function A3e(e){var t=k3e();X(e,t)}var j3e=new Set([`$$slots`,`$$events`,`$$legacy`,`position`,`orientation`,`showZoom`,`showFitView`,`showLock`,`style`,`class`,`buttonBgColor`,`buttonBgColorHover`,`buttonColor`,`buttonColorHover`,`buttonBorderColor`,`fitViewOptions`,`children`,`before`,`after`]),M3e=V(`<!> <!>`,1),N3e=V(`<!> <!> <!> <!> <!> <!>`,1);function B2(e,t){Ce(t,!0);let n=J(t,`position`,3,`bottom-left`),r=J(t,`orientation`,3,`vertical`),i=J(t,`showZoom`,3,!0),a=J(t,`showFitView`,3,!0),o=J(t,`showLock`,3,!0),s=Le(t,j3e),c=q(C2),l=q(()=>({bgColor:t.buttonBgColor,bgColorHover:t.buttonBgColorHover,color:t.buttonColor,colorHover:t.buttonColorHover,borderColor:t.buttonBorderColor})),u=q(()=>Q(c).nodesDraggable||Q(c).nodesConnectable||Q(c).elementsSelectable),d=q(()=>
2461Q(c).viewport.zoom<=Q(c).minZoom),f=q(()=>Q(c).viewport.zoom>=Q(c).maxZoom),p=q(()=>Q(c).ariaLabelConfig),m=q(()=>r()===`horizontal`?`horizontal`:`vertical`),h=()=>{Q(c).zoomIn()},_=()=>{Q(c).zoomOut()},v=()=>{Q(c).fitView(t.fitViewOptions)},y=()=>{let e=!Q(u);Q(c).nodesDraggable=e,Q(c).nodesConnectable=e,Q(c).elementsSelectable=e};{let r=q(()=>[`svelte-flow__controls`,Q(m),t.class]);I2(e,le({get class(){return Q(r)},get position(){return n()},"data-testid":`svelte-flow__controls`,get"aria-label"(){return Q(p)[`controls.ariaLabel`]},get style(){return t.style}},()=>s,{children:(e,n)=>{var r=N3e(),s=N(r),c=e=>{var n=fe(),r=N(n);ae(r,()=>t.before),X(e,n)};G(s,e=>{t.before&&e(c)});var m=g(s,2),b=e=>{var t=M3e(),n=N(t);z2(n,le({onclick:h,class:`svelte-flow__controls-zoomin`,get title(){return Q(p)[`controls.zoomIn.ariaLabel`]},get"aria-label"(){return Q(p)[`controls.zoomIn.ariaLabel`]},get disabled(){return Q(f)}},()=>Q(l),{children:(e,t)=>{S3e(e,{})},$$slots:{default:!0}})),z2(g(n,2),le({onclick:_,class:`svelte-flow__controls-zoomout`,get title(){return Q(p)[`controls.zoomOut.ariaLabel`]},get"aria-label"(){return Q(p)[`controls.zoomOut.ariaLabel`]},get disabled(){return Q(d)}},()=>Q(l),{children:(e,t)=>{w3e(e,{})},$$slots:{default:!0}})),X(e,t)};G(m,e=>{i()&&e(b)});var x=g(m,2),S=e=>{z2(e,le({class:`svelte-flow__controls-fitview`,onclick:v,get title(){return Q(p)[`controls.fitView.ariaLabel`]},get"aria-label"(){return Q(p)[`controls.fitView.ariaLabel`]}},()=>Q(l),{children:(e,t)=>{E3e(e,{})},$$slots:{default:!0}}))};G(x,e=>{a()&&e(S)});var C=g(x,2),w=e=>{z2(e,le({class:`svelte-flow__controls-interactive`,onclick:y,get title(){return Q(p)[`controls.interactive.ariaLabel`]},get"aria-label"(){return Q(p)[`controls.interactive.ariaLabel`]}},()=>Q(l),{children:(e,t)=>{var n=fe(),r=N(n),i=e=>{A3e(e,{})},a=e=>{O3e(e,{})};G(r,e=>{Q(u)?e(i):e(a,-1)}),X(e,n)},$$slots:{default:!0}}))};G(C,e=>{o()&&e(w)});var T=g(C,2),E=e=>{var n=fe(),r=N(n);ae(r,()=>t.children),X(e,n)};G(T,e=>{t.children&&e(E)});var D=g(T,2),O=e=>{var n=fe(),r=N(n);ae(r,()=>t.after),X(e,n)};G(D,e=>{t.after&&e(O)}),X(e,r)},$$slots:{default:!0}}))}ue()}var V2;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(V2||={});var P3e=je(`<circle></circle>`);function F3e(e,t){var n=P3e();O(()=>{b(n,`cx`,t.radius),b(n,`cy`,t.radius),b(n,`r`,t.radius),r(n,0,M([`svelte-flow__background-pattern`,`dots`,t.class]))}),X(e,n)}var I3e=je(`<path></path>`);function L3e(e,t){Ce(t,!0);var n=I3e();O(()=>{b(n,`stroke-width`,t.lineWidth),b(n,`d`,`M${t.dimensions[0]/2} 0 V${t.dimensions[1]} M0 ${t.dimensions[1]/2} H${t.dimensions[0]}`),r(n,0,M([`svelte-flow__background-pattern`,t.variant,t.class]))}),X(e,n),ue()}var R3e={[V2.Dots]:1,[V2.Lines]:1,[V2.Cross]:6},z3e=je(`<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>`);function H2(e,t){Ce(t,!0);let n=J(t,`variant`,19,()=>V2.Dots),i=J(t,`gap`,3,20),a=J(t,`lineWidth`,3,1),o=q(C2),s=q(()=>n()===V2.Dots),c=q(()=>n()===V2.Cross),l=q(()=>Array.isArray(i())?i():[i(),i()]),u=q(()=>`background-pattern-${Q(o).flowId}-${t.id??``}`),d=q(()=>[Q(l)[0]*Q(o).viewport.zoom||1,Q(l)[1]*Q(o).viewport.zoom||1]),f=q(()=>(t.size??R3e[n()])*Q(o).viewport.zoom),p=q(()=>Q(c)?[Q(f),Q(f)]:Q(d)),m=q(()=>Q(s)?[Q(f)/2,Q(f)/2]:[Q(p)[0]/2,Q(p)[1]/2]);var h=z3e();let _;var v=j(h),y=j(v),x=e=>{{let n=q(()=>Q(f)/2);F3e(e,{get radius(){return Q(n)},get class(){return t.patternClass}})}},S=e=>{L3e(e,{get dimensions(){return Q(p)},get variant(){return n()},get lineWidth(){return a()},get class(){return t.patternClass}})};G(y,e=>{Q(s)?e(x):e(S,-1)}),H(v);var C=g(v);H(h),O(()=>{r(h,0,M([`svelte-flow__background`,`svelte-flow__container`,t.class])),_=Ze(h,``,_,{"--xy-background-color-props":t.bgColor,"--xy-background-pattern-color-props":t.patternColor}),b(v,`id`,Q(u)),b(v,`x`,Q(o).viewport.x%Q(d)[0]),b(v,`y`,Q(o).viewport.y%Q(d)[1]),b(v,`width`,Q(d)[0]),b(v,`height`,Q(d)[1]),b(v,`patternTransform`,`translate(-${Q(m)[0]},-${Q(m)[1]})`),b(C,`fill`,`url(#${Q(u)})`)}
2461),X(e,h),ue()}function B3e(e){let t=q(C2),n=q(()=>Q(t).nodeLookup),r=q(()=>Q(t).nodes),i=q(()=>(Q(r),Q(n).get(e)));return{get current(){return Q(i)}}}var V3e=je(`<rect></rect>`);function H3e(e,t){Ce(t,!0);let n=J(t,`borderRadius`,3,5),i=J(t,`strokeWidth`,3,2),a=q(()=>B3e(t.id)),o=q(()=>{if(!Q(a).current)return{width:0,height:0,x:0,y:0};let{width:e,height:n}=x0(Q(a).current);return{width:t.width??e,height:t.height??n,x:t.x??Q(a).current.internals.positionAbsolute.x,y:t.y??Q(a).current.internals.positionAbsolute.y}}),s=q(()=>Q(o).width),c=q(()=>Q(o).height),l=q(()=>Q(o).x),u=q(()=>Q(o).y);var d=fe(),f=N(d),p=e=>{let r=q(()=>t.nodeComponent);var a=fe(),o=N(a);P(o,()=>Q(r),(e,r)=>{r(e,{get id(){return t.id},get x(){return Q(l)},get y(){return Q(u)},get width(){return Q(s)},get height(){return Q(c)},get borderRadius(){return n()},get class(){return t.class},get color(){return t.color},get shapeRendering(){return t.shapeRendering},get strokeColor(){return t.strokeColor},get strokeWidth(){return i()},get selected(){return t.selected}})}),X(e,a)},m=e=>{var a=V3e();let o,d;O(()=>{o=r(a,0,M([`svelte-flow__minimap-node`,t.class]),null,o,{selected:t.selected}),b(a,`x`,Q(l)),b(a,`y`,Q(u)),b(a,`rx`,n()),b(a,`ry`,n()),b(a,`width`,Q(s)),b(a,`height`,Q(c)),b(a,`shape-rendering`,t.shapeRendering),d=Ze(a,``,d,{fill:t.color,stroke:t.strokeColor,"stroke-width":i()})}),X(e,a)};G(f,e=>{t.nodeComponent?e(p):e(m,-1)}),X(e,d),ue()}function U3e(e,t){let n=V2e({domNode:e,panZoom:t.panZoom,getTransform:()=>{let{viewport:e}=t.store;return[e.x,e.y,e.zoom]},getViewScale:t.getViewScale});n.update({translateExtent:t.translateExtent,width:t.width,height:t.height,inversePan:t.inversePan,zoomStep:t.zoomStep,pannable:t.pannable,zoomable:t.zoomable});function r(e){n.update({translateExtent:e.translateExtent,width:e.width,height:e.height,inversePan:e.inversePan,zoomStep:e.zoomStep,pannable:e.pannable,zoomable:e.zoomable})}return{update:r,destroy(){n.destroy()}}}var U2=e=>e instanceof Function?e:()=>e,W3e=new Set([`$$slots`,`$$events`,`$$legacy`,`position`,`ariaLabel`,`nodeStrokeColor`,`nodeColor`,`nodeClass`,`nodeBorderRadius`,`nodeStrokeWidth`,`nodeComponent`,`bgColor`,`maskColor`,`maskStrokeColor`,`maskStrokeWidth`,`width`,`height`,`pannable`,`zoomable`,`inversePan`,`zoomStep`,`class`]),G3e=je(`<title> </title>`),K3e=je(`<svg class="svelte-flow__minimap-svg" role="img"><!><!><path class="svelte-flow__minimap-mask" fill-rule="evenodd" pointer-events="none"></path></svg>`),q3e=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function W2(e,t){Ce(t,!0);let n=J(t,`position`,3,`bottom-right`),r=J(t,`nodeStrokeColor`,3,`transparent`),i=J(t,`nodeClass`,3,``),a=J(t,`nodeBorderRadius`,3,5),o=J(t,`nodeStrokeWidth`,3,2),s=J(t,`width`,3,200),c=J(t,`height`,3,150),l=J(t,`pannable`,3,!0),u=J(t,`zoomable`,3,!0),d=Le(t,W3e),p=q(C2),m=q(()=>Q(p).ariaLabelConfig),h=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`,_=q(()=>`svelte-flow__minimap-desc-${Q(p).flowId}`),v=q(()=>({x:-Q(p).viewport.x/Q(p).viewport.zoom,y:-Q(p).viewport.y/Q(p).viewport.zoom,width:Q(p).width/Q(p).viewport.zoom,height:Q(p).height/Q(p).viewport.zoom})),y=q(()=>Q(p).nodes.some(e=>!e.hidden)),x=q(()=>Q(y)?c0(Y1(Q(p).nodeLookup,{filter:e=>!e.hidden}),Q(v)):Q(v)),S=q(()=>Q(x).width/s()),C=q(()=>Q(x).height/c()),w=q(()=>Math.max(Q(S),Q(C))),T=q(()=>Q(w)*s()),E=q(()=>Q(w)*c()),D=q(()=>5*Q(w)),k=q(()=>Q(x).x-(Q(T)-Q(x).width)/2-Q(D)),A=q(()=>Q(x).y-(Q(E)-Q(x).height)/2-Q(D)),ee=q(()=>Q(T)+Q(D)*2),M=q(()=>Q(E)+Q(D)*2),te=()=>Q(w);var P=q3e(),re=N(P);{let e=q(()=>[`svelte-flow__minimap`,t.class]);Ee(re,()=>({"--xy-minimap-background-color-props":t.bgColor})),I2(re.lastChild,le({get position(){return n()},get class(){return Q(e)},"data-testid":`svelte-flow__minimap`},()=>d,{children:(e,n)=>{var d=fe(),y=N(d),x=e=>{var n=K3e();let d;var y=j(n),x=e=>{var n=G3e(),r=f(n,!0);O(()=>{b(n,`id`,Q(_)),Y(r,t.ariaLabel??Q(m)[`minimap.ariaLabel`])}),X(e,n)};G(y,e=>{(t.ariaLabel??Q(m)[`minimap.ariaLabel`])&&e(x)});var S=g(y);B(S,17,()=>Q(p).nodes,e=>e.id,(e,n)=>{let s=q(()=>Q(p).nodeLookup.get(Q(n).id));var c=fe(),l=N(c),u=e=>
2461{{let c=q(()=>t.nodeColor===void 0?void 0:U2(t.nodeColor)(Q(n))),l=q(()=>U2(r())(Q(n))),u=q(()=>U2(i())(Q(n)));H3e(e,{get id(){return Q(s).id},get selected(){return Q(s).selected},get nodeComponent(){return t.nodeComponent},get color(){return Q(c)},get borderRadius(){return a()},get strokeColor(){return Q(l)},get strokeWidth(){return o()},get shapeRendering(){return h},get class(){return Q(u)}})}},d=q(()=>Q(s)&&S0(Q(s))&&!Q(s).hidden);G(l,e=>{Q(d)&&e(u)}),X(e,c)});var C=g(S);H(n),ne(n,(e,t)=>U3e?.(e,t),()=>({store:Q(p),panZoom:Q(p).panZoom,getViewScale:te,translateExtent:Q(p).translateExtent,width:Q(p).width,height:Q(p).height,inversePan:t.inversePan,zoomStep:t.zoomStep,pannable:l(),zoomable:u()})),O(()=>{b(n,`width`,s()),b(n,`height`,c()),b(n,`viewBox`,`${Q(k)??``} ${Q(A)??``} ${Q(ee)??``} ${Q(M)??``}`),b(n,`aria-labelledby`,Q(_)),d=Ze(n,``,d,{"--xy-minimap-mask-background-color-props":t.maskColor,"--xy-minimap-mask-stroke-color-props":t.maskStrokeColor,"--xy-minimap-mask-stroke-width-props":t.maskStrokeWidth?t.maskStrokeWidth*Q(w):void 0}),b(C,`d`,`M${Q(k)-Q(D)},${Q(A)-Q(D)}h${Q(ee)+Q(D)*2}v${Q(M)+Q(D)*2}h${-Q(ee)-Q(D)*2}z 2462 M${Q(v).x??``},${Q(v).y??``}h${Q(v).width??``}v${Q(v).height??``}h${-Q(v).width}z`)}),X(e,n)};G(y,e=>{Q(p).panZoom&&e(x)}),X(e,d)},$$slots:{default:!0}})),H(re)}X(e,P),ue()}var J3e={behaviour:`Game logic written as a small JavaScript file (params, replicated state, event handlers, kit calls) - run once on the authority peer, with a live node view of its events, state and knobs.`,slider:`An interactive slider that outputs a number - the quickest way to hand-tune any numeric input live.`,colorpicker:`Outputs a color chosen with a swatch - the color source for anything that paints.`,switcher:`A radio-button list that outputs the index of the selected item - a hand-operated multi-way switch.`,number:`A constant numeric value - the simplest source node.`,vector3:`An x/y/z triple - used as a direction, an offset, or most often a fixed point in the world.`,toggle:`A checkbox that outputs true or false - a hand-operated on/off switch.`,random:`A random number in a range - deterministic, so every peer sees the same "random" value.`,time:`The synced clock as a value - the heartbeat behind almost every animation recipe.`,objectselector:`Binds the graph to a scene object - the sink every effect must reach, and an object reference for sensor nodes.`,velocity:`Outputs how fast the connected object is moving right now, in metres per second.`,measure:`Reads a number off an object: how tall it is, where its top is, how fast it is going.`,spawn:`Makes copies of an object while the simulation runs - crates off a conveyor, targets, debris, ammo, waves of anything.`,flowinput:`Declares a public input socket for an object flow - the way the Scene flow feeds a value into an object's own graph.`,flowoutput:`Declares a public output socket for an object flow - the way an object publishes a value back to the Scene flow.`,objectflow:`Embeds an object's own graph into the Scene flow as a single card - the way to compose object flows into a bigger machine without opening each one.`,setgamestate:`Switches the shared game state (menu, playing, paused, over) when a pulse arrives - every peer follows the same state.`,ongamestate:`Fires a pulse when the shared game state becomes the one you pick - the hook for "when the round starts".`,setcamera:`Makes a camera object the active view for every player when a pulse arrives.`,setlook:`Points the player's view at a target when a pulse arrives - a cutscene glance or a spawn orientation.`,gamestart:`Fires once when the game starts (Play, or a round reset) - the place to spawn, reset counters and arm timers.`,travel:`Loads another saved scene by name when a pulse arrives - a door to the next level, replicated to everyone.`,allplayers:`Iterates the connected players so a per-player value can be read, or a HUD row shown, for each of them.`,setvariable:`Stores a named value in the replicated scene variables when a pulse arrives - shared state without an object.`,getvariable:`Reads a named scene variable as a value - the read side of Set Variable, live on every peer.`,storevalue:`Saves a value on THIS device when a pulse arrives (set, keep the max or min, or add) - a best score or a level reached that survives a reload; never sent to other players.`,storedvalue:`Reads what Store Value saved on this device, as a number or text - the read side of a best score; each player sees their own.`,ongrab:`Fires a pulse when a player picks the object up - a carry in Play or Interact, or a VR grip in Interact; editor moves never fire it.`,announce:`Shows a big banner - 'Ring 2 reached', 'GOAL!' - on every screen and in VR when a pulse arrives; {v} in the text shows a wired number.`,gamesound:`Plays one of the built-in game sounds (coin, ring, levelup, cheer...) when a pulse arrives, at the wired object if one is wired; no sound files needed.`,effectburst:`Fires a short sparkle, confetti, smoke or sparks burst at the wired object (or in front of the player) when a pulse arrives; pooled and local to each device.`,hapticpulse:`Buzzes the VR controllers with a named pattern (tap, bump, success...) when a pulse arrives - only in Interact or Play, never while editing.`,gamemusic:`Plays a looping built-in music preset while you are in Interact or Play - always, or only during a round; wire 'on' to switch it by a condition.`,gamesetting:`Declares one row in the game's Settings (a toggle, a range or a choice) and outputs this player's value - saved on this device for this game, never shared.`,pointgrab:`While 'enabled' reads off, players cannot pick objects up by pointing at them (the VR grip ray, the desktop carry); a hand touching an object still moves it.`,onclap:`Fires a pulse when a VR player brings both hands together and holds them - with where they met (point) and whether it was you (byMe); wire 'enabled' to a setting to switch it.`,gametime:`Seconds since the game (or the round) started, the same on every peer - a clock that pauses with the game.`,peervariable:`A value kept PER PLAYER (score, lives, team) - each peer reads its own row, or a named player's.`,charcontroller:`Turns the connected object into a walking, jumping character driven by the player'
2462s movement input.`,moveinput:`The player's movement input as numbers - stick or WASD axes and the jump button - for driving things by hand.`,possessnode:`Puts the player in control of the connected object when a pulse arrives - a vehicle, a turret, a ball.`,camerafollow:`Makes the camera follow the connected object at a set distance and height - a third-person or chase view.`,movespeed:`Overrides the character's walking speed while a value is wired - sprint, mud, slow motion.`,hudscreen:`Shows or hides a whole HUD screen (a named layer of elements) while its condition holds.`,hudtext:`Writes a number into a HUD text element through a format such as 'Gems: {v}' - a score, a count, a readout.`,hudtimer:`Runs a countdown in a HUD text element from its duration, formatted like '{v}s' - starts by itself or on a pulse.`,hudbar:`Drives a HUD bar element's fill from a number - health, fuel, progress.`,hudbutton:`Fires a pulse when a HUD button is pressed - the on-screen counterpart of On Click.`,hudlist:`Fills a HUD list element with the items a value provides - an inventory, objectives, players.`,leaderboard:`Ranks the players by their own per-player variable (laps, score) into a HUD element, highest or lowest first, top N rows.`,hudrows:`Appends or replaces rows in a HUD rows element from a pulse - a log, a chat, a scoreboard feed.`,hudinput:`Reads what the player typed into a HUD input element as a value.`,hudset:`Writes a value into a HUD input element when a pulse arrives - to prefill, clear or correct it.`,script:`Your own JavaScript - an effect that moves its object every frame, or (with declared typed inputs and outputs) a small pure function whose return feeds other nodes.`,math:`Combines two numbers with an arithmetic operation.`,compare:`Compares two numbers and outputs true or false.`,gate:`Boolean logic on two inputs - AND, OR, NOT, XOR.`,maprange:`Remaps a number from one range to another - the glue between free-range sources and bounded parameters.`,select:`Chooses between two values: outputs a when the index is low, b when it's high.`,latch:`Holds a boolean until told otherwise - set, reset and toggle pulses make it a memory bit.`,delay:`Passes a pulse on after a set number of seconds - the timing of a fuse, or a door that closes later.`,sequence:`Fires its outputs one after another, one per pulse, then wraps around - a step-by-step trigger.`,once:`Lets exactly one pulse through until it is re-armed - a checkpoint, a pickup, a first-time event.`,counter:`Counts trigger pulses and outputs the running total.`,loop:`Sweeps a number from one value to another over time, repeating - a ready-made animation ramp.`,timer:`A delay line: outputs its input as it was a set number of seconds ago.`,distance:`Measures the live distance between two things in the scene.`,proximity:`True while two things are within a radius of each other - a distance sensor with the threshold built in.`,lookat:`Keeps the connected object facing a target - another object or a fixed point - every frame.`,setcolor:`Paints the connected object's material with a color, re-applied every frame.`,visibility:`Shows or hides the connected object based on a boolean.`,
2462setuniform:`Writes one number inside an object's shader graph, so a trigger, a`,onclick:`Fires a short pulse when its object is clicked - the bridge from user input into the graph.`,keypress:`Fires a pulse while a keyboard key is pressed - the bridge from your keyboard into the graph.`,onimpact:`Fires a pulse when a physics simulation lands the connected object on the ground or another object.`,onhit:`Fires a pulse when a hand or a walking player knocks the object - with how hard it was hit (speed) and whether you did it (byMe).`,onenter:`Fires a pulse when something enters a trigger volume - the checkpoint, doorway and pressure-plate node.`,onexit:`Fires a pulse when something leaves a trigger volume - the other half of On Enter.`,onrest:`Fires a pulse when a physics body has finished moving - the counterpart to On Impact, which fires when it starts.`,gamepadbutton:`Fires a pulse (or holds a level) while a gamepad button is pressed - the pad's counterpart of Key Press.`,gamepadaxis:`A gamepad stick or trigger axis as a number between -1 and 1, with a dead zone.`,shake:`Jitters the connected object around its resting position - rumble, nervousness, impact feedback.`,spin:`Rotates the connected object continuously around one axis.`,bounce:`Bounces the connected object up and down off its resting height, like a dribbled ball.`,orbit:`Circles the connected object around its resting position on the horizontal plane.`,pathpatrol:`Walks the connected object along a series of waypoints you click into the scene, facing along the path.`,animfinished:`Fires a pulse when the connected object's animation clip reaches its end.`,animmarker:`Fires a pulse when the connected object's animation passes a named marker.`,animstate:`Reads the connected object's animation transport as a number - playing, position or progress.`,playanim:`Starts, stops or restarts an animation clip on the connected object when a pulse arrives.`,mass:`Gives the connected object weight for the physics simulation - objects with a Mass fall and collide.`,bounciness:`Sets how much the connected object rebounds in the physics simulation (restitution).`,friction:`Sets how much the connected object grips surfaces in the physics simulation.`,angularvelocity:`Gives the connected object a constant spin under physics - a rolling barrel, a spinning hazard, a rotating platform other objects can stand on.`,collider:`Overrides the collision shape the physics simulation uses for the connected object - the flow equivalent of the Inspector's Physics > Collider pick, and it wins over it.`,motor:`Drives every hinge joint attached to the connected object - the flow way to make wheels turn, turntables spin and doors swing under power.`,impulse:`Pushes or spins a physics body when an event fires - a jump, a kick, a cannon, a nudge.`,setvelocity:`Sets a physics body's speed outright - to launch it at an exact velocity, to hold it at a constant one, or to stop it dead.`,joint:`Attaches two objects to each other when an event fires - a hinge, or a rigid weld.`,pulse:`Throbs the connected object's scale in and out around its resting size.`,blink:`Flashes the connected object on and off at a steady rate.`,sound:`Plays an Explorer audio clip on the connected object when a pulse arrives - spatial, replicated, by content hash.`,particle:`Emits a particle effect from the connected object - a preset burst, a stream, a trail.`,jiggle:`Makes the connected object jiggle - it lags behind when moved, wobbles like jelly on impact and sways in the wind; skinned models swing their bone chains.`,deviceparam:`Writes a number into one parameter of the connected audio device every frame - an LFO on a cutoff, a fader on a level.`,devicelevel:`The live output level of the connected audio device (or a wired one) as a number - a meter you can drive anything with.`,transportbeat:`The shared music transport as a number - beat, bar, phase, bpm or playing - identical on every peer.`,notetrigger:`Plays a note on the connected audio device when a pulse arrives - a drum pad, a sampler pad, a synth key.`};function G2(e){let t=typeof e==`string`?e:``;return J3e[t]??(t.startsWith(`kit-`)?Sne(t):``)??``}
2462var Y3e=V(`<div class="touch-pan-y cursor-grab rounded-2xl border border-solid border-gray-200 bg-white/70 shadow-[0_7px_9px_0_rgba(0,0,0,0.02)]" role="listitem"><div class="family-mono rounded-2xl px-3 py-2 text-center font-mono text-xs font-semibold text-[#0F172A] dark:bg-gray-700 dark:text-gray-200"> </div></div>`),X3e=V(`<p class="mt-1 text-xs font-semibold uppercase text-gray-400"> </p> <!>`,1),Z3e=V(`<div class="pointer-events-none fixed z-1400 -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-primary-400 bg-gray-800 px-3 py-2 text-center font-mono text-xs font-semibold text-gray-100 shadow-lg"> </div>`),Q3e=V(`<aside class="flex flex-col gap-2 p-2"><input id="palette-filter" class="rounded-sm border border-gray-300 bg-transparent px-2 py-1 text-xs focus:outline-hidden focus:ring-1 focus:ring-primary-500 dark:border-gray-600 dark:text-gray-200" placeholder="Filter nodesâ¦"/> <p class="text-center text-xs italic text-gray-400">Drag a node to the canvas, or tap to add it</p> <!></aside> <!>`,1);function $3e(e,t){Ce(t,!1);let n=()=>z(cl,`$moduleNodeGroups`,i),r=()=>z(Pc,`$customNodeDefs`,i),[i,a]=Ve(),o=F(),c=J(t,`onPick`,8,()=>{}),l=J(t,`onPlaceAt`,8,()=>{}),u=(e,t)=>{if(!e.dataTransfer)return null;e.dataTransfer.setData(`application/svelteflow`,t),e.dataTransfer.effectAllowed=`move`},p=null,m=F(!1),_=F(``),y=F(0),x=F(0),C=0,w=0,T=!1;function E(e,t,n){e.pointerType!==`mouse`&&(p=t,I(_,n),C=e.clientX,w=e.clientY,I(m,!1),T=!1)}function D(e){if(p==null||e.pointerType===`mouse`)return;let t=e.clientX-C,n=e.clientY-w;if(!Q(m)){if(Math.abs(t)>10&&Math.abs(t)>Math.abs(n)){I(m,!0);try{e.currentTarget.setPointerCapture?.(e.pointerId)}catch{}}else Math.abs(n)>10&&(p=null);if(!Q(m))return}e.preventDefault(),I(y,e.clientX),I(x,e.clientY)}function k(e){Q(m)&&p&&(document.elementFromPoint(e.clientX,e.clientY)?.closest(`.svelte-flow`)&&l()(p,e.clientX,e.clientY),T=!0),I(m,!1),p=null}function A(e){if(T){T=!1;return}c()(e)}let ee=F(``);d(()=>(n(),r(),Q(ee)),()=>{I(o,[...$u,...n(),...r().length>0?[{group:`Custom`,items:r().map(e=>({type:`customnode:`+e.id,label:e.name}))}]:[]].map(e=>({...e,items:e.items.filter(t=>!Q(ee).trim()||(t.label+` `+t.type+` `+e.group).toLowerCase().includes(Q(ee).trim().toLowerCase()))})).filter(e=>e.items.length>0))}),h(),R();var M=Q3e(),te=N(M),ne=j(te);v(ne);var P=g(ne,4);B(P,1,()=>Q(o),Be,(e,t)=>{var n=X3e(),r=N(n),i=f(r,!0),a=g(r,2);B(a,1,()=>(Q(t),K(()=>Q(t).items)),Be,(e,t)=>{var n=Y3e();b(n,`draggable`,!0);var r=j(n),i=f(r,!0);H(n),O(e=>{b(n,`title`,e),Y(i,(Q(t),K(()=>Q(t).label)))},[()=>(s(G2),Q(t),K(()=>G2(Q(t).type)))]),Z(`dragstart`,n,e=>u(e,Q(t).type)),Z(`pointerdown`,n,e=>E(e,Q(t).type,Q(t).label)),Z(`pointermove`,n,D),Z(`pointerup`,n,k),Z(`click`,n,()=>A(Q(t).type)),X(e,n)}),O(()=>Y(i,(Q(t),K(()=>Q(t).group)))),X(e,n)}),H(te);var re=g(te,2),ie=e=>{var t=Z3e(),n=f(t,!0);O(()=>{Ze(t,`left: ${Q(y)??``}px; top: ${Q(x)??``}px;`),Y(n,Q(_))}),X(e,t)};G(re,e=>{Q(m)&&e(ie)}),S(ne,()=>Q(ee),e=>I(ee,e)),X(e,M),ue(),a()}var e6e=V(`<span class="gt-count svelte-1rta6jt"> </span>`),t6e=V(`<button><span class="flex-1 truncate text-left"> </span> <span class="gt-count svelte-1rta6jt"> </span></button>`),n6e=V(`<p class="gt-empty svelte-1rta6jt"> </p>`),r6e=V(`<div class="gt-body svelte-1rta6jt" role="tree"><button title="The scene-wide graph â deselect everything"><span class="gt-ico svelte-1rta6jt"><!></span> <span class="flex-1 truncate text-left">Scene</span> <!></button> <!> <!></div> <div style="touch-action: none" title="Drag to resize the list"></div>`,1),i6e=V(`<div class="gt-wrap svelte-1rta6jt"><button class="gt-head svelte-1rta6jt"><!> <span class="flex-1 text-left"> </span> <span class="gt-count svelte-1rta6jt"> </span></button> <!></div>`);function K2(e,n){Ce(n,!0);let i=()=>z(Ui,`$objectsGroup`,o),a=()=>z(Kr,`$selectedObjects`,o),[o,s]=Ve(),c=J(n,`label`,3,`Graphs`),l=J(n,`paneHeight`,3,0),u=typeof localStorage<`u`?localStorage:null,d=t(u?.getItem(`graphTree:`+n.kind)!==`false`);function p(){I(d,!Q(d)),u?.setItem(`graphTree:`+n.kind,String(Q(d)))}let m=t(Ne(parseInt(u?.getItem(`graphTree:h:`+n.kind)??`120`)||120)),h=t(!1),_=q(()=>Math.max(56,(l()||320)-132));Qe(()=>{let e=Q(_);Q(m)>e&&I(m,e,!0)});function v(e){I(h,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function y(e){Q(h)&&I(m,Math.min(Math.max(56,Q(m)+e.movementY),Q(_)),!0)}function x(e){Q(h)&&(I(h,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),u?.setItem(`graphTree:h:`+n.kind,String(Q(m))))}let S=q(()=>Object.keys(n.documents??{}).filter(e=>e!==n.sceneKey).map(e=>{let t=i()?.getObjectByProperty(`uuid`,e);
2462return{uuid:e,name:t?.name||t?.type||`Object`,missing:!t,nodes:(n.documents?.[e]?.nodes??[]).length}}).sort((e,t)=>e.name.localeCompare(t.name))),C=q(()=>(n.documents?.[n.sceneKey]?.nodes??[]).length),w=q(()=>(a()?.length??0)!==1),T=e=>a()?.length===1&&a()[0]===e;var E=i6e(),D=j(E),k=j(D),A=e=>{Xx(e,{size:12,"aria-hidden":`true`})},ee=e=>{tz(e,{size:12,"aria-hidden":`true`})};G(k,e=>{Q(d)?e(A):e(ee,-1)});var M=g(k,2),te=f(M,!0),ne=g(M,2),P=f(ne,!0);H(D);var re=g(D,2),ie=e=>{var t=r6e(),i=N(t),a=j(i);let o;var s=j(a);_Ae(j(s),{size:12,"aria-hidden":`true`}),H(s);var l=g(s,4),u=e=>{var t=e6e(),n=f(t,!0);O(()=>Y(n,Q(C))),X(e,t)};G(l,e=>{Q(C)&&e(u)}),H(a);var d=g(a,2);B(d,17,()=>Q(S),e=>e.uuid,(e,t)=>{var n=t6e();let i;var a=j(n),o=f(a,!0),s=g(a,2),c=f(s,!0);H(n),O(e=>{i=r(n,1,`gt-row gt-child svelte-1rta6jt`,null,i,{"gt-active":e,"gt-missing":Q(t).missing}),n.disabled=Q(t).missing,b(n,`title`,Q(t).missing?Q(t).name+` â the object is gone; the graph is dropped on the next save`:`Edit `+Q(t).name+`'s own graph`),Y(o,Q(t).name),Y(c,Q(t).nodes)},[()=>T(Q(t).uuid)]),L(`click`,n,()=>!Q(t).missing&&Tm([Q(t).uuid])),X(e,n)});var p=g(d,2),_=e=>{var t=n6e(),r=f(t,!0);O(()=>Y(r,n.kind===`shader`?`No object has its own shader yet â select one and create it.`:`No object has its own flow yet.`)),X(e,t)};G(p,e=>{Q(S).length||e(_)}),H(i);var E=g(i,2);let D;O(()=>{b(i,`aria-label`,c()),Ze(i,`max-height: ${Q(m)??``}px`),o=r(a,1,`gt-row gt-root svelte-1rta6jt`,null,o,{"gt-active":Q(w)}),b(a,`id`,`graph-tree-`+n.kind+`-scene`),b(E,`id`,`graph-tree-`+n.kind+`-resize`),D=r(E,1,`gt-grip svelte-1rta6jt`,null,D,{"gt-grip-on":Q(h)})}),L(`click`,a,()=>bm()),L(`pointerdown`,E,v),L(`pointermove`,E,y),L(`pointerup`,E,x),X(e,t)};G(re,e=>{Q(d)&&e(ie)}),H(E),O(()=>{b(E,`id`,`graph-tree-`+n.kind),b(D,`aria-expanded`,Q(d)),Y(te,c()),Y(P,Q(S).length+ +!!Q(C))}),L(`click`,D,p),X(e,E),ue(),s()}ge([`click`,`pointerdown`,`pointermove`,`pointerup`]);var a6e=V(`<div class="absolute flex items-start"><svg width="18" height="18" viewBox="0 0 24 24"><path fill="currentColor" stroke="white" stroke-width="1.5" d="M4 2 L20 12 L12 13.5 L8.5 21 Z"></path></svg> <span class="ml-1 mt-3 whitespace-nowrap rounded-sm px-1.5 py-0.5 text-xs text-white"> </span></div>`),o6e=V(`<div class="pointer-events-none absolute inset-0 overflow-hidden" style="z-index: 10;"></div>`);function s6e(e,t){Ce(t,!1);let n=()=>z(Mc,`$flowCursors`,i),r=()=>z(Nc,`$activeGraphId`,i),[i,a]=Ve(),o=J(t,`viewport`,8),c;_e(()=>{c=setInterval(()=>{Mc.update(e=>{let t=Date.now(),n=Object.keys(e).filter(n=>t-e[n].ts>4e3);if(n.length===0)return e;let r={...e};return n.forEach(e=>delete r[e]),r})},1e3)}),Pe(()=>clearInterval(c));function l(e){let t=0;for(let n of e)t=(t*31+n.charCodeAt(0))%360;return`hsl(${t}, 70%, 50%)`}R();var u=o6e();B(u,5,()=>(n(),s(Fc),r(),K(()=>Object.entries(n()).filter(([,e])=>(e.graphId??`scene`)===r()))),([e,t])=>e,(e,t)=>{var n=q(()=>A(Q(t),2));let r=()=>Q(n)[0],i=()=>Q(n)[1];var a=a6e(),c=j(a),u=g(c,2),d=f(u,!0);H(a),O((e,t)=>
2462{Ze(a,`left: ${i(),s(o()),K(()=>i().x*o().zoom+o().x)??``}px; top: ${i(),s(o()),K(()=>i().y*o().zoom+o().y)??``}px;`),Ze(c,`color: ${e??``}`),Ze(u,`background: ${t??``}`),Y(d,(i(),K(()=>i().name)))},[()=>(r(),K(()=>l(r()))),()=>(r(),K(()=>l(r())))]),X(e,a)}),H(u),X(e,u),ue(),a()}var c6e={number:`number`,slider:`number`,time:`number`,loop:`number`,timer:`number`,random:`number`,math:`number`,distance:`number`,counter:`number`,switcher:`number`,maprange:`number`,select:`number`,vector3:`vector3`,toggle:`boolean`,compare:`boolean`,gate:`boolean`,proximity:`boolean`,colorpicker:`color`,objectselector:`object`,onclick:`event`,ongrab:`event`,keypress:`event`,gamepadbutton:`event`,gamepadaxis:`number`,onimpact:`event`,onhit:`event`,onclap:`event`,gamesetting:`boolean`,pointgrab:`effect`,onenter:`event`,onexit:`event`,animfinished:`event`,animmarker:`event`,animstate:`number`,velocity:`number`,measure:`number`,onrest:`event`,impulse:`effect`,setvelocity:`effect`,joint:`effect`,spawn:`effect`,flowinput:`number`,hudbutton:`event`,hudtimer:`number`,hudrows:`effect`,leaderboard:`effect`,hudinput:`number`,ongamestate:`event`,getvariable:`number`,gametime:`number`,storedvalue:`number`,peervariable:`number`,latch:`boolean`,delay:`event`,sequence:`event`,once:`event`,allplayers:`event`,movespeed:`number`,moveinput:`number`,charcontroller:`effect`,possessnode:`effect`,camerafollow:`effect`},q2={objectselector:{_default:`effect`},collider:{source:`object`,scale:`number`},velocity:{target:`object`},measure:{target:`object`},impulse:{trigger:`event`,force:`vector3`,target:`object`},setvelocity:{trigger:`event`,linear:`vector3`,angular:`vector3`,target:`object`},joint:{trigger:`event`,a:`object`,b:`object`},spawn:{trigger:`event`,at:`vector3`,source:`object`,position:`vector3`},random:{seed:`number`,reroll:`event`},animstate:{target:`object`},math:{a:`number`,b:`number`},compare:{a:`number`,b:`number`},gate:{a:`boolean`,b:`boolean`},sound:{volume:`number`,trigger:`event`},timer:{a:`number`},maprange:{a:`number`},select:{index:`number`,a:`number`,b:`number`,c:`number`,d:`number`},script:{a:`number`,b:`number`,c:`number`},distance:{a:`object`,b:`object`},proximity:{a:`object`,b:`object`},lookat:{target:`object`},setcolor:{color:`color`},visibility:{on:`boolean`},setuniform:{value:`number`},counter:{pulse:`event`,reset:`event`},latch:{set:`event`,reset:`event`,toggle:`event`},delay:{trigger:`event`,cancel:`event`,seconds:`number`},sequence:{trigger:`event`},once:{trigger:`event`,rearm:`event`},playanim:{trigger:`event`,speed:`number`},particle:{count:`number`,color:`color`,offset:`vector3`,speed:`number`,gravity:`number`,size:`number`,trigger:`event`},deviceparam:{value:`number`},notetrigger:{trigger:`event`,note:`number`,velocity:`number`},hudtext:{value:`number`},hudbar:{value:`number`,min:`number`,max:`number`},hudscreen:{trigger:`event`},hudtimer:{start:`event`,duration:`number`},hudlist:{trigger:`event`},hudrows:{trigger:`event`,text:`number`},hudinput:{},hudset:{trigger:`event`,value:`number`,options:`number`},setgamestate:{trigger:`event`},setcamera:{trigger:`event`,camera:`object`},setlook:{trigger:`event`,camera:`object`,on:`boolean`},setvariable:{trigger:`event`,value:`number`},storevalue:{trigger:`event`,value:`number`},announce:{trigger:`event`,value:`number`},gamesound:{trigger:`event`,at:`object`},effectburst:{trigger:`event`,at:`object`},hapticpulse:{trigger:`event`},gamemusic:{on:`boolean`},onclap:{enabled:`boolean`},onimpact:{filter:`object`},onenter:{filter:`object`},onexit:{filter:`object`},pointgrab:{enabled:`boolean`},gamestart:{camera:`object`},travel:{trigger:`event`},allplayers:{condition:`boolean`},charcontroller:{speed:`number`},possessnode:{trigger:`event`,release:`event`,target:`object`},camerafollow:{trigger:`event`,stop:`event`,target:`object`},movespeed:{set:`event`,value:`number`}},l6e={onclap:{point:`vector3`,byMe:`boolean`},onimpact:{other:`object`},onenter:{other:`object`},onexit:{other:`object`}};function J2(e,t){return t&&l6e[e]?.[t]||Y2(e)}var u6e={number:[`boolean`,`vector3`],boolean:[`number`],event:[`number`,`boolean`],vector3:[`object`],object:[`vector3`]};function Y2(e){return Jc[e]?Jc[e]:c6e[e]??`effect`}function d6e(e){let t={...qc[e]??{},...q2[e]??{}};return Object.keys(t).filter(e=>e!==`_default`)}function X2(e,t){let n=qc[e];if(n){if(t&&n[t])return n[t];
2462if(n._default)return n._default}let r=q2[e];return r&&(t&&r[t]||r._default)||`number`}function Z2(e,t){return e===t||e===`event`&&t===`effect`?!0:e===`effect`||t===`effect`?!1:(u6e[e]||[]).includes(t)}function Q2(e){return{number:`#38bdf8`,vector3:`#a78bfa`,boolean:`#f472b6`,color:`#fbbf24`,object:`#4ade80`,event:`#facc15`,effect:`#fb923c`}[e]||`#94a3b8`}function $2(e,t){if(!e||e.source===e.target)return!1;let n=t.find(t=>t.id===e.source),r=t.find(t=>t.id===e.target);if(!n||!r)return!1;let i=n.type===`flowinput`?n.data?.vtype??`number`:od(n.type,n.data,e.sourceHandle,`output`)??J2(n.type,e.sourceHandle);if(n.type===`objectflow`)return e4(r,e.targetHandle)!==`effect`;let a=e4(r,e.targetHandle);return a===`any`?i!==`effect`:Z2(i,a)}function e4(e,t){return e?e.type===`flowoutput`?`any`:od(e.type,e.data,t,`input`)||(e.type===`objectflow`?(Lc(e.data?.flowUuid??``)?.nodes.find(e=>e.type===`flowinput`&&(e.data?.name??`value`)===t))?.data?.vtype??`number`:X2(e.type,t)):`number`}function t4(e,t,n){if(!e?.targetHandle)return[];let r=e4(t.find(t=>t.id===e.target),e.targetHandle);return r===`effect`||r===`event`?[]:n.filter(t=>t.target===e.target&&t.targetHandle===e.targetHandle).map(e=>e.id)}function n4(e,t){Ce(t,!1);let n=F(),r=F(),i=F(),a=J(t,`kind`,8,`source`),o=J(t,`nodeType`,8),c=J(t,`id`,8,void 0),l=J(t,`position`,8,void 0),u=J(t,`top`,8,void 0),f=J(t,`style`,8,``),p=J(t,`forceType`,8,void 0),m=W1.Right,g=W1.Left;d(()=>(s(p()),s(a()),s(o()),s(c())),()=>{I(n,p()??(a()===`source`?Y2(o()):X2(o(),c()??`a`)))}),d(()=>(s(l()),s(a())),()=>{I(r,l()??(a()===`source`?m:g))}),d(()=>(Q(n),s(u()),s(f())),()=>{I(i,`--socket-color: ${Q2(Q(n))};${u()===void 0?``:` top: ${u()}px;`}${f()}`)}),h(),R(),f2(e,{get type(){return a()},get position(){return Q(r)},get id(){return c()},class:`socket-typed`,get style(){return Q(i)}}),ue()}var f6e=V(`<div class="node-card flex h-full flex-col rounded-lg border border-gray-600/70 bg-gray-800/95 text-gray-200 shadow-lg svelte-3ajph0"><div class="flex items-center gap-1.5 rounded-t-md border-b border-gray-700/60 bg-gray-900/50 px-3 py-1.5 font-mono text-xs font-semibold text-gray-100"><span class="h-2 w-2 shrink-0 rounded-full" style="background: var(--node-accent)"></span> <span class="overflow-hidden text-ellipsis whitespace-nowrap"> </span></div> <div class="relative flex rounded-b-lg p-3 text-xs text-gray-300"><!></div></div>`);function r4(e,t){Ce(t,!1);let n=F(),r=F(),i=J(t,`type`,8),a=J(t,`label`,8,``),o=J(t,`accent`,8,``),c={Input:`#38bdf8`,Scene:`#4ade80`,Animation:`#fb923c`,Effects:`#c084fc`,Physics:`#f87171`,Logic:`#2dd4bf`,Triggers:`#facc15`,HUD:`#f0abfc`,Game:`#34d399`,Character:`#fbbf24`,Music:`#fb7185`,"Object Flow":`#818cf8`};d(()=>s(i()),()=>{I(n,xne(i()))}),d(()=>(s(o()),Q(n)),()=>{I(r,o()||(Q(n)?c[Q(n)]??`#94a3b8`:`#e879f9`))}),h(),R();var l=f6e(),u=j(l),p=g(j(u),2),m=f(p,!0);H(u);var _=g(u,2),v=j(_);T(v,t,`default`,{},null),H(_),H(l),O(()=>{Ze(l,`--node-accent: ${Q(r)}; border-top: 2px solid ${Q(r)}`),Y(m,a()?a():i())}),X(e,l),ue()}var p6e=V(`<div class="flex items-center space-x-2"><input class="nodrag border-md h-6 w-6" type="color"/> <p> </p></div> <!>`,1);function m6e(e,t){Ce(t,!1);let n=J(t,`id`,8),r=J(t,`data`,8);R(),r4(e,{get type(){return s(r()),K(()=>r().type)},get label(){return s(r()),K(()=>r().label)},children:(e,t)=>{var i=p6e(),a=N(i),o=j(a);v(o);var c=g(o,2),l=f(c,!0);H(a),n4(g(a,2),{kind:`source`,get nodeType(){return s(r()),K(()=>r().type)},get position(){return s(W1),K(()=>W1.Right)}}),O(()=>{u(o,(s(r()),K(()=>r().color??`#ff4000`))),Y(l,(s(r()),K(()=>r().color??`#ff4000`)))}),Z(`input`,o,e=>nu(n(),{color:e.currentTarget.value})),X(e,i)},$$slots:{default:!0}}),ue()}var h6e=V(`<!> <label class="flex w-full flex-col"><span class="flex justify-between"><span>value</span> <span> </span></span> <input class="nodrag accent-[#ff4000]" style="direction: rtl;" type="range"/></label>`,1);function g6e(e,t){Ce(t,!1);let n=F(),r=F(),i=J(t,`id`,8),a=J(t,`data`,8);d(()=>s(a()),()=>{I(n,a().min??0)}),d(()=>s(a()),()=>{I(r,a().max??40)}),h(),R(),r4(e,{get type(){return s(a()),K(()=>a().type)},get label(){return s(a()),K(()=>a().label)},children:(e,t)=>{var o=h6e(),c=N(o);n4(c,{kind:`source`,get nodeType(){return s(a()),K(()=>a().type)},get position(){return s(W1),K(()=>W1.Right)}});var l=g(c,2),d=j(l),p=g(j(d),2),m=f(p,!0);H(d);var h=g(d,2);v(h),H(l),O(()=>{Y(m,(s(a()),K(()=>a().value??20))),b(h,`min`,Q(n)),b(h,`max`,Q(r)),u(h,(s(a()),K(()=>a().value??20)))}),Z(`input`,h,e=>nu(i(),{value:+e.currentTarget.value})),X(e,o)},$$slots:{default:!0}}),ue()}var _6e=V(`<label class="flex"><input class="accent-[#ff4000]" type="radio"/> <span class="ml-2"> </span></label>`),v6e=V(`<!> <div class="nodrag flex flex-col"></div>`,1);function y6e(e,t){Ce(t,!1);let n=F(),r=F(),i=J(t,`id`,8),a=J(t,`data`,8);d(()=>s(a()),()=>{I(n,Array.isArray(a().items)&&a().items.length?a().items:[`cube`,`pyramid`])}),d(()=>(s(a()),Q(n)),()=>{I(r,Math.min(Math.max(a().index??Math.max(Q(n).indexOf(a().shape??`cube`),0),0),Q(n).length-1))}),h(),R(),r4(e,{get type(){return s(a()),K(()=>a().type)},get label(){return s(a()),K(()=>a().label)},children:(e,t)=>{var o=v6e(),c=N(o);n4(c,{kind:`source`,get nodeType(){return s(a()),K(()=>a().type)},get position(){return s(W1),K(()=>W1.Right)}});var l=g(c,2);B(l,5,()=>Q(n),Be,(e,t,n)=>{var a=_6e(),o=j(a);v(o);var s=g(o,2),c=f(s,!0);H(a),O(()=>{b(o,`name`,`shape-${i()}`),u(o,Q(t)),w(o,Q(r)===n),Y(c,Q(t))}),Z(`change`,o,()=>nu(i(),{index:n,shape:Q(t)})),X(e,a)}),H(l),X(e,o)},$$slots:{default:!0}}),ue()}var b6e=V(`<option> </option>`),x6e=V(`<div class="flex w-full items-center space-x-2"><select class="nodrag"><option>-None-</option><!></select></div> <!> <!>`,1);function S6e(e,t){Ce(t,!1);let n=()=>z(Ui,`$objectsGroup`,r),[r,i]=Ve(),a=J(t,`id`,8),o=J(t,`data`,8),c=F(),l=F([]);d(()=>n(),()=>{I(c,n())}),d(()=>Q(c),()=>{I(l,Q(c)?Q(c).children.map(e=>({id:e.uuid,name:e.name||e.type})):[])}),h(),R(),r4(e,{get type(){return s(o()),K(()=>o().type)},get label(){return s(o()),K(()=>o().label)},children:(e,t)=>{var n=x6e(),r=N(n),i=j(r),c=g(j(i));
2462B(c,1,()=>Q(l),Be,(e,t)=>{var n=b6e(),r=f(n,!0),i={};O(()=>{Y(r,(Q(t),K(()=>Q(t).name))),i!==(i=(Q(t),K(()=>Q(t).id)))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(i);var u;_(i),H(r);var d=g(r,2);n4(d,{kind:`target`,get nodeType(){return s(o()),K(()=>o().type)},get position(){return s(W1),K(()=>W1.Left)}}),n4(g(d,2),{kind:`source`,get nodeType(){return s(o()),K(()=>o().type)},get position(){return s(W1),K(()=>W1.Right)}}),O(()=>{u!==(u=(s(o()),K(()=>o().selected??`-None-`)))&&(i.value=(i.__value=u)??``,D(i,u))}),Z(`change`,i,e=>nu(a(),{selected:e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),i()}var C6e=V(`<div class="relative -mx-3 flex h-5 items-center px-3"><!> <span class="max-w-full truncate text-[10px] text-gray-300"> </span></div>`),w6e=V(`<span> </span>`),T6e=V(`<span class="wired-value rounded-sm bg-gray-900/70 px-1.5 py-0.5 font-mono text-[11px] text-primary-300" title="Driven by the wired input"> </span>`),E6e=V(`<input class="nodrag accent-[#ff4000]" type="range"/>`),D6e=V(`<span class="nodrag flex items-center gap-1.5"><input type="checkbox"/></span>`),O6e=V(`<input class="nodrag w-full rounded-sm bg-gray-900/70 px-1.5 py-0.5 font-mono text-[11px]" type="text"/>`),k6e=V(`<option> </option>`),A6e=V(`<select class="nodrag"></select>`),j6e=V(`<label><!> <span class="flex justify-between"><span> </span> <!></span> <!></label>`),M6e=V(`<span class="node-note svelte-1bgpml9"> </span>`),N6e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><!> <!> <!></div>`,1);function i4(e,t){Ce(t,!1);let n=()=>z(cl,`$moduleNodeGroups`,o),i=()=>z(Ic,`$flowEdges`,o),a=()=>z(kc,`$flowValues`,o),[o,c]=Ve(),l=F(),p=F(),m=F(),y=F(),x=J(t,`id`,8),S=J(t,`data`,8),C=(e,t)=>_ee(e);function T(e){return e==null?`â¦`:typeof e==`number`?(+e).toFixed(2):Array.isArray(e)?e.map(e=>(+e).toFixed(1)).join(`, `):typeof e==`object`&&e.__handles?Object.keys(e.__handles).filter(t=>e.__handles[t]).join(` `)||`â`:String(e)}d(()=>s(S()),()=>{I(l,ed(S().type))}),d(()=>Q(l),()=>{I(p,(Q(l)?.params??[]).filter(e=>e.kind===`range`).map(e=>e.key))}),d(()=>(Q(p),s(S()),n()),()=>{I(m,[...Q(p),...C(S().type,n()).filter(e=>!Q(p).includes(e))])}),d(()=>(i(),s(x())),()=>{I(y,e=>i().find(t=>t.target===x()&&t.targetHandle===e)?.source??null)}),h(),R(),r4(e,{get type(){return s(S()),K(()=>S().type)},get label(){return s(S()),K(()=>S().label)},children:(e,t)=>{var n=N6e(),i=N(n);n4(i,{kind:`source`,get nodeType(){return s(S()),K(()=>S().type)},get position(){return s(W1),K(()=>W1.Right)}});var o=g(i,2),c=e=>{var t=fe(),n=N(t);B(n,1,()=>Q(m),Be,(e,t,n)=>{n4(e,{kind:`target`,get nodeType(){return s(S()),K(()=>S().type)},get position(){return s(W1),K(()=>W1.Left)},get id(){return Q(t)},style:`top: ${34+n*38}px`})}),X(e,t)};G(o,e=>{Q(l),K(()=>!Q(l)?.inputs)&&e(c)});var d=g(o,2),p=j(d);B(p,1,()=>(Q(l),K(()=>Q(l)?.inputs??[])),e=>e,(e,t)=>{var n=C6e(),r=j(n);n4(r,{kind:`target`,get nodeType(){return s(S()),K(()=>S().type)},get position(){return s(W1),K(()=>W1.Left)},get id(){return Q(t)},style:`top: 50%;`});var i=g(r,2),a=f(i,!0);H(n),O(()=>{b(i,`title`,Q(t)),Y(a,(Q(l),Q(t),K(()=>Q(l)?.inputLabels?.[Q(t)]??Q(t))))}),X(e,n)});var h=g(p,2),C=e=>{var t=fe(),n=N(t);B(n,1,()=>(Q(l),K(()=>Q(l).params)),Be,(e,t)=>{var n=j6e();let i;var o=j(n),c=e=>{n4(e,{kind:`target`,get nodeType(){return s(S()),K(()=>S().type)},get position(){return s(W1),K(()=>W1.Left)},get id(){return Q(t),K(()=>Q(t).key)},style:`top: 10px;`})};G(o,e=>{Q(l),Q(t),K(()=>Q(l)?.inputs&&Q(t).kind===`range`)&&e(c)});var d=g(o,2),p=j(d),m=f(p,!0),h=g(p,2),C=e=>{var n=w6e(),r=f(n,!0);O(()=>Y(r,(s(S()),Q(t),Q(l),K(()=>S()[Q(t).key]??Q(l).defaults[Q(t).key])))),X(e,n)},E=q(()=>(Q(t),Q(y),K(()=>Q(t).kind===`range`&&!Q(y)(Q(t).key))));G(h,e=>{Q(E)&&e(C)}),H(d);var k=g(d,2),A=e=>{var n=T6e(),r=f(n);O(e=>Y(r,`â ${e??``}`),[()=>(a(),Q(y),Q(t),K(()=>T(a()[Q(y)(Q(t).key)])))]),X(e,n)},ee=q(()=>(Q(t),Q(y),K(()=>Q(t).kind===`range`&&Q(y)(Q(t).key)))),M=e=>{var n=E6e();v(n),O(()=>{b(n,`min`,(Q(t),K(()=>Q(t).min))),b(n,`max`,(Q(t),K(()=>Q(t).max))),b(n,`step`,(Q(t),K(()=>Q(t).step))),u(n,(s(S()),Q(t),Q(l),K(()=>S()[Q(t).key]??Q(l).defaults[Q(t).key])))}),Z(`input`,n,e=>nu(x(),{[Q(t).key]:+e.currentTarget.value})),X(e,n)},te=e=>{var n=D6e(),r=j(n);v(r),H(n),O(()=>w(r,(s(S()),Q(t),Q(l),K(()=>!!(S()[Q(t).key]??Q(l).defaults[Q(t).key]))))),Z(`change`,r,e=>nu(x(),{[Q(t).key]:e.currentTarget.checked})),X(e,n)},ne=e=>{var n=O6e();v(n),O(()=>{b(n,`placeholder`,(Q(t),K(()=>Q(t).placeholder??``))),b(n,`maxlength`,(Q(t),K(()=>Q(t).maxLength??null))),u(n,(s(S()),Q(t),Q(l),K(()=>S()[Q(t).key]??Q(l).defaults[Q(t).key]??``)))}),Z(`change`,n,e=>nu(x(),{[Q(t).key]:e.currentTarget.value})),X(e,n)},N=e=>{var n=A6e();B(n,5,()=>(Q(t),K(()=>Q(t).options)),Be,(e,t)=>{var n=k6e(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(n);var r;_(n),O(()=>{r!==(r=(s(S()),Q(t),Q(l),K(()=>S()[Q(t).key]??Q(l).defaults[Q(t).key])))&&(n.value=(n.__value=r)??``,D(n,r))}),Z(`change`,n,e=>nu(x(),{[Q(t).key]:e.currentTarget.value})),X(e,n)};G(k,e=>{Q(ee)?e(A):(Q(t),K(()=>Q(t).kind===`range`)?e(M,1):(Q(t),K(()=>Q(t).kind===`toggle`)?e(te,2):(Q(t),K(()=>Q(t).kind===`text`)?e(ne,3):(Q(t),K(()=>Q(t).kind===`select`)&&e(N,4)))))}),H(n),O(()=>{i=r(n,1,`relative flex flex-col`,null,i,{"-mx-3":!!Q(l)?.inputs,"px-3":!!Q(l)?.inputs}),b(p,`title`,(Q(t),K(()=>Q(t).key))),Y(m,(Q(t),K(()=>Q(t).label??Q(t).key)))}),X(e,n)}),X(e,t)};G(h,e=>{Q(l),K(()=>Q(l)?.params)&&e(C)});var E=g(h,2),k=e=>{var t=M6e(),n=f(t,!0);O(()=>Y(n,(Q(l),K(()=>Q(l).note)))),X(e,t)};G(E,e=>{Q(l),K(()=>Q(l)?.note)&&e(k)}),H(d),X(e,n)},$$slots:{default:!0}}),ue(),c()}var P6e=V(`<input class="nodrag hud-ep-manual svelte-6ed3yp"/>`),F6e=V(`<span class="hud-ep-sub svelte-6ed3yp"> </span>`),I6e=V(`<button type="button" aria-label="Pick on the artboard"><!></button>`),L6e=V(`<button type="button" class="nodrag hud-ep-icon svelte-6ed3yp" aria-label="Clear" title="Clear"><!></button>`),R6e=V(`<button type="button" class="nodrag hud-ep-field svelte-6ed3yp"><span class="hud-ep-name svelte-6ed3yp"> </span> <!> <!></button> <!> <!>`,1),z6e=V(`<div class="hud-ep svelte-6ed3yp"><!></div> <!>`,1);function a4(e,n){Ce(n,!0);let i=()=>z(bu,`$hudPickArm`,s),a=()=>z(wu,`$hudDocs`,s),o=()=>z(ku,`$hudPickResult`,s),[s,c]=Ve(),l=J(n,`value`,3,``),d=J(n,`docKey`,3,`scene`),p=J(n,`mode`,3,`element`),m=J(n,`label`,3,``),h=t(null),_=t(!1),y=`hudpick-`+Math.random().toString(36).slice(2,9),x=q(()=>i()===y),S=(e,t)=>p()===`screen`?Rte(e):Vte(e),C=q(()=>S(d(),a())),w=q(()=>{if(a(),d()===`scene`)return`Scene HUD`;let e=ox().find(e=>e.uuid===d());return e?(e.name||`Camera`)+` HUD`:`HUD `+d().slice(-4)});function T(){PC(d());let e=xu(d(),``);FC(d()),n.onpick?.(e)}let E=q(()=>{if(a(),!l())return null;if(p()===`screen`){let e=Ite(Cu(d()),l());return e?{id:e.id,name:e.name}:null}return Fte(d(),l())}),D=q(()=>l()?Q(E)?`ready`:`unresolved`:`empty`),k=q(()=>{if(!l())return m()||(p()===`screen`?`no screen`:`no element`);if(!Q(E))return l();if(p()===`screen`)return Q(E).name;let e=Q(E);return(e.label?e.label+` - `:``)+e.kind}),A=q(()=>p()===`screen`||!Q(E)?``:Q(E).screen);Qe(()=>{let e=o();e&&e.token===y&&(ku.set(null),n.onpick?.(e.id))}),Pe(()=>{i()===y&&bu.set(null)});function ee(e){let t=e.currentTarget.getBoundingClientRect(),r=[];if(r.push({section:Q(w)}),Q(C).length>6&&r.push({label:`Search...`,icon:`search`,revealFilter:!0}),p()===`screen`)for(let e of Q(C))r.push({label:e.name,checked:e.id===l(),action:()=>n.onpick?.(e.id)});else{let e={};for(let t of Q(C))(e[t.screen]??=[]).push(t);for(let[t,i]of Object.entries(e)){r.push({section:t});for(let e of i)r.push({label:(e.label?e.label+` - `:``)+e.kind,hint:e.id.slice(-4),checked:e.id===l(),action:()=>n.onpick?.(e.id)})}}Q(C).length||r.push({label:p()===`screen`?`no screens yet`:`nothing on any screen yet`,disabled:!0}),r.push({section:``}),p()===`screen`&&r.push({label:`New screen...`,icon:`plus`,action:T}),r.push({label:`Open HUD editor`,icon:`layout-dashboard`,action:()=>{Lte()}}),r.push({label:`Enter id manually...`,icon:`pencil`,action:()=>I(_,!0)}),I(h,{x:t.left,y:t.bottom+2,items:r},!0)}var M=z6e(),te=N(M),ne=j(te),P=e=>{var t=P6e();v(t),O(()=>{b(t,`placeholder`,p()===`screen`?`screen id`:`element id`),u(t,l())}),L(`change`,t,e=>{n.onpick?.(e.currentTarget.value.trim()),I(_,!1)}),Z(`blur`,t,()=>I(_,!1)),X(e,t)},re=e=>{var t=R6e(),i=N(t),a=j(i),o=f(a,!0),s=g(a,2),c=e=>{var t=F6e(),n=f(t,!0);O(()=>Y(n,Q(A))),X(e,t)};G(s,e=>{Q(A)&&e(c)});var u=g(s,2);Xx(u,{size:12,"aria-hidden":`true`}),H(i);var d=g(i,2),m=e=>{var t=I6e();let n;Mke(j(t),{size:12,"aria-hidden":`true`}),H(t),O(()=>{n=r(t,1,`nodrag hud-ep-icon svelte-6ed3yp`,null,n,{"hud-ep-armed":Q(x)}),b(t,`aria-pressed`,Q(x)),b(t,`title`,Q(x)?`Click an element on the artboard (Esc to cancel)`:`Pick on the artboard`)}),L(`click`,t,()=>Q(x)?bu.set(null):Ute(y)),X(e,t)};G(d,e=>{p()===`element`&&e(m)});var h=g(d,2),_=e=>{var t=L6e(),r=j(t);fS(r,{size:12,"aria-hidden":`true`}),H(t),L(`click`,t,()=>n.onpick?.(``)),X(e,t)};G(h,e=>{l()&&e(_)}),O(()=>{b(i,`title`,l()||`nothing picked`),Y(o,Q(k))}),L(`click`,i,ee),X(e,t)};G(ne,e=>{Q(_)?e(P):e(re,-1)}),H(te);var ie=g(te,2),F=e=>{xS(e,{get x(){return Q(h).x},get y(){return Q(h).y},get items(){return Q(h).items},sizeKey:`hud-element`,onclose:()=>I(h,null)})};G(ie,e=>{Q(h)&&e(F)}),O(()=>b(te,`data-state`,Q(D))),X(e,M),ue(),c()}ge([`change`,`click`]);var B6e=V(`<div class="flex flex-col"><span>screen</span> <!></div> <span class="hud-note svelte-1f7e0my">Shows on THIS peer only â each player has their own screen.</span>`,1),V6e=V(`<div class="flex flex-col"><span>element</span> <!></div>`),H6e=V(`<span> </span>`),U6e=V(`<span class="wired-value svelte-1f7e0my" title="Driven by the wired input"> </span>`),W6e=V(`<input class="nodrag accent-[#ff4000]" type="range"/>`),G6e=V(`<span class="nodrag flex items-center gap-1.5"><input type="checkbox"/></span>`),K6e=V(`<input class="nodrag" type="text"/>`),q6e=V(`<option> </option>`),J6e=V(`<select class="nodrag"></select>`),Y6e=V(`<label class="flex flex-col"><span class="flex justify-between"><span> </span> <!></span> <!></label>`),X6e=V(`<em class="svelte-1f7e0my"> </em>`),Z6e=V(`<span class="hud-live svelte-1f7e0my" title="What the bound element is showing now"> <!></span>`),Q6e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><!> <!> <!></div>`,1);function o4(e,t){Ce(t,!1);let n=()=>z(Nc,`$activeGraphId`,c),r=()=>z(wu,`$hudDocs`,c),i=()=>z(Ic,`$flowEdges`,c),a=()=>z(Su,`$hudRuntime`,c),o=()=>z(kc,`$flowValues`,c),[c,l]=Ve(),p=F(),m=F(),y=F(),x=F(),S=F(),C=F(),T=J(t,`id`,8),E=J(t,`data`,8),k=(e,t)=>Gte(e),A={hudtext:[`value`],hudbar:[`value`,`min`,`max`],hudtimer:[`start`,`duration`],hudscreen:[`trigger`],hudlist:[`trigger`],hudbutton:[]};function ee(e){return e==null?`â¦`:typeof e==`number`?(+e).toFixed(2):String(e)}d(()=>s(E()),()=>{I(p,ed(E().type))}),d(()=>
2462(n(),r()),()=>{I(m,k(n(),r()))}),d(()=>s(E()),()=>{I(y,E().type===`hudscreen`)}),d(()=>s(E()),()=>{I(x,A[E().type]??[])}),d(()=>(i(),s(T())),()=>{I(S,e=>i().find(t=>t.target===T()&&t.targetHandle===e)?.source??null)}),d(()=>(s(E()),a()),()=>{I(C,E().element?a()[String(E().element).trim()]:null)}),h(),R(),r4(e,{get type(){return s(E()),K(()=>E().type)},get label(){return s(E()),K(()=>E().label)},children:(e,t)=>{var n=Q6e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(E()),K(()=>E().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2);B(i,3,()=>Q(x),e=>e,(e,t,n)=>{{let r=ze(()=>`top: ${34+Q(n)*38}px`);n4(e,{kind:`target`,get nodeType(){return s(E()),K(()=>E().type)},get position(){return s(W1),K(()=>W1.Left)},get id(){return Q(t)},get style(){return Q(r)}})}});var a=g(i,2),c=j(a),l=e=>{var t=B6e(),n=N(t),r=g(j(n),2);{let e=ze(()=>(s(E()),K(()=>E().screen??``)));a4(r,{mode:`screen`,get docKey(){return Q(m)},get value(){return Q(e)},onpick:e=>nu(T(),{screen:e})})}H(n),W(2),X(e,t)},d=e=>{var t=V6e(),n=g(j(t),2);{let e=ze(()=>(s(E()),K(()=>E().element??``)));a4(n,{get docKey(){return Q(m)},get value(){return Q(e)},onpick:e=>nu(T(),{element:e})})}H(t),X(e,t)};G(c,e=>{Q(y)?e(l):e(d,-1)});var h=g(c,2),k=e=>{var t=fe(),n=N(t);B(n,1,()=>(Q(p),K(()=>Q(p).params)),e=>e.key,(e,t)=>{var n=fe(),r=N(n),i=e=>{var n=Y6e(),r=j(n),i=j(r),a=f(i,!0),c=g(i,2),l=e=>{var n=H6e(),r=f(n,!0);O(()=>Y(r,(s(E()),Q(t),Q(p),K(()=>E()[Q(t).key]??Q(p).defaults[Q(t).key])))),X(e,n)},d=q(()=>(Q(t),Q(S),K(()=>Q(t).kind===`range`&&!Q(S)(Q(t).key))));G(c,e=>{Q(d)&&e(l)}),H(r);var m=g(r,2),h=e=>{var n=U6e(),r=f(n);O(e=>Y(r,`â ${e??``}`),[()=>(o(),Q(S),Q(t),K(()=>ee(o()[Q(S)(Q(t).key)])))]),X(e,n)},y=q(()=>(Q(t),Q(S),K(()=>Q(t).kind===`range`&&Q(S)(Q(t).key)))),x=e=>{var n=W6e();v(n),O(()=>{b(n,`min`,(Q(t),K(()=>Q(t).min))),b(n,`max`,(Q(t),K(()=>Q(t).max))),b(n,`step`,(Q(t),K(()=>Q(t).step))),u(n,(s(E()),Q(t),Q(p),K(()=>E()[Q(t).key]??Q(p).defaults[Q(t).key])))}),Z(`input`,n,e=>nu(T(),{[Q(t).key]:+e.currentTarget.value})),X(e,n)},C=e=>{var n=G6e(),r=j(n);v(r),H(n),O(()=>w(r,(s(E()),Q(t),Q(p),K(()=>!!(E()[Q(t).key]??Q(p).defaults[Q(t).key]))))),Z(`change`,r,e=>nu(T(),{[Q(t).key]:e.currentTarget.checked})),X(e,n)},k=e=>{var n=K6e();v(n),O(()=>{b(n,`placeholder`,(Q(t),K(()=>Q(t).placeholder??``))),b(n,`maxlength`,(Q(t),K(()=>Q(t).maxLength??null))),u(n,(s(E()),Q(t),Q(p),K(()=>E()[Q(t).key]??Q(p).defaults[Q(t).key]??``)))}),Z(`change`,n,e=>nu(T(),{[Q(t).key]:e.currentTarget.value})),X(e,n)},A=e=>{var n=J6e();B(n,5,()=>(Q(t),K(()=>Q(t).options??[])),e=>e,(e,t)=>{var n=q6e(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(n);var r;_(n),O(()=>{r!==(r=(s(E()),Q(t),Q(p),K(()=>E()[Q(t).key]??Q(p).defaults[Q(t).key])))&&(n.value=(n.__value=r)??``,D(n,r))}),Z(`change`,n,e=>nu(T(),{[Q(t).key]:e.currentTarget.value})),X(e,n)};G(m,e=>{Q(y)?e(h):(Q(t),K(()=>Q(t).kind===`range`)?e(x,1):(Q(t),K(()=>Q(t).kind===`toggle`)?e(C,2):(Q(t),K(()=>Q(t).kind===`text`)?e(k,3):(Q(t),K(()=>Q(t).kind===`select`)&&e(A,4)))))}),H(n),O(()=>Y(a,(Q(t),K(()=>Q(t).key)))),X(e,n)};G(r,e=>{Q(y),Q(t),K(()=>!(Q(y)&&Q(t).key===`screen`))&&e(i)}),X(e,n)}),X(e,t)};G(h,e=>{Q(p),K(()=>Q(p)?.params)&&e(k)});var A=g(h,2),M=e=>{var t=Z6e(),n=j(t),r=g(n),i=e=>{var t=X6e(),n=f(t,!0);O(e=>Y(n,e),[()=>(Q(C),K(()=>ee(Q(C).value)))]),X(e,t)};G(r,e=>{Q(C),K(()=>Q(C).value!==void 0)&&e(i)}),H(t),O(()=>Y(n,`${Q(C),K(()=>Q(C).text===void 0?``:Q(C).text)??``} `)),X(e,t)};G(A,e=>{Q(C)&&e(M)}),H(a),X(e,n)},$$slots:{default:!0}}),ue(),l()}var $6e=V(`<!> <!> <!>`,1),s4=V(`<option> </option>`),e8e=V(`<option>(missing camera)</option>`),t8e=V(`<label class="flex flex-col"><span>when state is</span> <select class="nodrag"></select></label> <span class="gc-note svelte-75wuu4">Every peer looks here when the game reaches this state â including someone who 2463 joins later.</span>`,1),n8e=V(`<span class="gc-warn svelte-75wuu4">Nothing is looking through that camera, so this will not change the picture. Turn 2464 "look through it too" on, or use a Set Active Camera node.</sp
2464an>`),r8e=V(`<label class="flex flex-col"><span>look</span> <select class="nodrag"><option>on</option><option>off</option></select></label> <label class="flex flex-col"><span>look through it too</span> <select class="nodrag"><option>yes</option><option>no</option></select></label> <span class="gc-note svelte-75wuu4">Switches that look for each peer when the trigger fires. It does not edit the saved 2465 look, so turning it off here never changes what anyone has authored.</span> <!>`,1),i8e=V(`<span class="gc-note svelte-75wuu4">Moves each peer's own view. Nothing is sent; the trigger already was.</span>`),a8e=V(`<span class="gc-warn svelte-75wuu4">That camera is not in the scene.</span>`),o8e=V(`<span class="gc-state svelte-75wuu4"> </span>`),s8e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><label class="flex flex-col"><span>camera</span> <select class="nodrag"><option> </option><!><!></select></label> <!> <!> <!></div>`,1);function c4(e,t){Ce(t,!1);let n=()=>z(Ui,`$objectsGroup`,a),r=()=>z(px,`$cameraPreview`,a),i=()=>z(Xc,`$gameState`,a),[a,o]=Ve(),c=F(),l=F(),u=F(),p=F(),m=F(),v=F(),y=F(),b=F(),x=J(t,`id`,8),S=J(t,`data`,8),C=e=>ox();d(()=>n(),()=>{I(c,C(n()))}),d(()=>s(S()),()=>{I(l,String(S().camera??``))}),d(()=>(Q(l),Q(c)),()=>{I(u,!!Q(l)&&!Q(c).some(e=>e.uuid===Q(l)))}),d(()=>s(S()),()=>{I(p,S().type===`gamestart`)}),d(()=>s(S()),()=>{I(m,S().type===`setlook`)}),d(()=>Q(m),()=>{I(v,Q(m)?`â the scene look â`:`â none â`)}),d(()=>(Q(m),s(S()),Q(l)),()=>{I(y,Q(m)&&S().activate!==!1&&!!Q(l))}),d(()=>(Q(m),Q(y),Q(l),r()),()=>{I(b,Q(m)&&!Q(y)&&!!Q(l)&&r()?.uuid!==Q(l))}),h(),R(),r4(e,{get type(){return s(S()),K(()=>S().type)},get label(){return s(S()),K(()=>S().label)},children:(e,t)=>{var n=s8e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(S()),K(()=>S().type)},get position(){return s(W1),K(()=>W1.Right)}});var a=g(r,2),o=e=>{n4(e,{kind:`target`,get nodeType(){return s(S()),K(()=>S().type)},get position(){return s(W1),K(()=>W1.Left)},id:`camera`,style:`top: 34px`})},d=e=>{var t=$6e(),n=N(t);n4(n,{kind:`target`,get nodeType(){return s(S()),K(()=>S().type)},get position(){return s(W1),K(()=>W1.Left)},id:`trigger`,style:`top: 34px`});var r=g(n,2);n4(r,{kind:`target`,get nodeType(){return s(S()),K(()=>S().type)},get position(){return s(W1),K(()=>W1.Left)},id:`camera`,style:`top: 72px`});var i=g(r,2),a=e=>{n4(e,{kind:`target`,get nodeType(){return s(S()),K(()=>S().type)},get position(){return s(W1),K(()=>W1.Left)},id:`on`,style:`top: 110px`})};G(i,e=>{Q(m)&&e(a)}),X(e,t)};G(a,e=>{Q(p)?e(o):e(d,-1)});var h=g(a,2),y=j(h),C=g(j(y),2),w=j(C),T=f(w,!0);w.value=w.__value=``;var E=g(w);B(E,1,()=>Q(c),e=>e.uuid,(e,t)=>{var n=s4(),r=f(n,!0),i={};O(()=>{Y(r,(Q(t),K(()=>Q(t).name||`Camera`))),i!==(i=(Q(t),K(()=>Q(t).uuid)))&&(n.value=(n.__value=i)??``)}),X(e,n)});var k=g(E),A=e=>{var t=e8e(),n={};O(()=>{n!==(n=Q(l))&&(t.value=(t.__value=n)??``)}),X(e,t)};G(k,e=>{Q(u)&&e(A)}),H(C);var ee;_(C),H(y);var M=g(y,2),te=e=>{var t=t8e(),n=N(t),r=g(j(n),2);B(r,5,()=>$c,e=>e,(e,t)=>{var n=s4(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(r);var i;_(r),H(n),W(2),O(()=>{i!==(i=(s(S()),K(()=>S().state??`playing`)))&&(r.value=(r.__value=i)??``,D(r,i))}),Z(`change`,r,e=>nu(x(),{state:e.currentTarget.value})),X(e,t)},ne=e=>{var t=r8e(),n=N(t),r=g(j(n),2),i=j(r);i.value=i.__value=`on`;var a=g(i);a.value=a.__value=`off`,H(r);var o;_(r),H(n);var c=g(n,2),l=g(j(c),2),u=j(l);u.value=u.__value=`yes`;var d=g(u);d.value=d.__value=`no`,H(l);var f;_(l),H(c);var p=g(c,4),m=e=>{var t=n8e();X(e,t)};G(p,e=>{Q(b)&&e(m)}),O(()=>{o!==(o=(s(S()),K(()=>S().on===!1?`off`:`on`)))&&(r.value=(r.__value=o)??``,D(r,o)),f!==(f=(s(S()),K(()=>S().activate===!1?`no`:`yes`)))&&(l.value=(l.__value=f)??``,D(l,f))}),Z(`change`,r,e=>nu(x(),{on:e.currentTarget.value===`on`})),Z(`change`,l,e=>nu(x(),{activate:e.currentTarget.value===`yes`})),X(e,t)},P=e=>{var t=i8e();X(e,t)};G(M,e=>{Q(p)?e(te):Q(m)?e(ne,1):e(P,-1)});var re=g(M,2),ie=e=>{var t=a8e();X(e,t)};G(re,e=>{Q(u)&&e(ie)});var F=g(re,2),ae=e=>{var t=o8e(),n=f(t);O(()=>Y(n,`state: ${i(),K(()=>i().state)??``}`)),X(e,t)};G(F,e=>{Q(m)||e(ae)}),H(h),O(()=>{Y(T,Q(v)),ee!==(ee=Q(l))&&(C.value=(C.__value=ee)??``,D(C,ee))}),Z(`change`,C,e=>nu(x(),{camera:e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),o()}var l4=V(`<option> </option>`),c8e=V(`<optgroup label="Project scenes (latest version)"></optgroup>`),l8e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><label class="flex flex-col"><span>
2465scene</span> <select class="nodrag"><option>â none â</option><!><optgroup label="Library files (that exact version)"></optgroup><!><!></select></label> <span class="text-[10px] text-gray-400">everyone travels â peers pull the scene and load it themselves; the game state carries</span></div>`,1);function u8e(e,t){Ce(t,!1);let n=()=>z(Fa,`$explorerItems`,i),r=()=>z(wd,`$projectManifest`,i),[i,a]=Ve(),o=F(),c=F(),l=F(),u=F(),p=F(),m=F(),v=J(t,`id`,8),y=J(t,`data`,8),b=e=>zme(),x=e=>Jne();function S(e){if(e.startsWith(`name:`)){nu(v(),{sceneName:e.slice(5),level:``,levelName:``});return}let t=Q(o).find(t=>t.hash===e),n=t?String(t.name??``).replace(/\.tpscene$/i,``):String(y().levelName??``);nu(v(),{level:e,levelName:n,sceneName:``})}d(()=>n(),()=>{I(o,b(n()))}),d(()=>r(),()=>{I(c,x(r()))}),d(()=>s(y()),()=>{I(l,String(y().sceneName??``))}),d(()=>(Q(l),s(y())),()=>{I(u,Q(l)?`name:`+Q(l):String(y().level??``))}),d(()=>(Q(l),Q(u),Q(o)),()=>{I(p,!Q(l)&&!!Q(u)&&!Q(o).some(e=>e.hash===Q(u)))}),d(()=>(Q(l),Q(c)),()=>{I(m,!!Q(l)&&!Q(c).includes(Q(l)))}),h(),R(),r4(e,{get type(){return s(y()),K(()=>y().type)},get label(){return s(y()),K(()=>y().label)},children:(e,t)=>{var n=l8e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(y()),K(()=>y().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2);n4(i,{kind:`target`,get nodeType(){return s(y()),K(()=>y().type)},get position(){return s(W1),K(()=>W1.Left)},id:`trigger`,style:`top: 34px`});var a=g(i,2),d=j(a),h=g(j(d),2),v=j(h);v.value=v.__value=``;var b=g(v),x=e=>{var t=c8e();B(t,5,()=>Q(c),e=>e,(e,t)=>{var n=l4(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=`name:`+Q(t))&&(n.value=n.__value=i)}),X(e,n)}),H(t),X(e,t)};G(b,e=>{Q(c),K(()=>Q(c).length)&&e(x)});var C=g(b);B(C,5,()=>Q(o),e=>e.hash,(e,t)=>{var n=l4(),r=f(n,!0),i={};O(e=>{Y(r,e),i!==(i=(Q(t),K(()=>Q(t).hash)))&&(n.value=(n.__value=i)??``)},[()=>(Q(t),K(()=>Q(t).name.replace(/\.tpscene$/i,``)))]),X(e,n)}),H(C);var w=g(C),T=e=>{var t=l4(),n=f(t),r={};O(()=>{Y(n,`(${s(y()),K(()=>y().levelName||`missing scene`)??``})`),r!==(r=Q(u))&&(t.value=(t.__value=r)??``)}),X(e,t)};G(w,e=>{Q(p)&&e(T)});var E=g(w),k=e=>{var t=l4(),n=f(t),r={};O(()=>{Y(n,`(${Q(l)??``} â not in the project yet)`),r!==(r=Q(u))&&(t.value=(t.__value=r)??``)}),X(e,t)};G(E,e=>{Q(m)&&e(k)}),H(h);var A;_(h),H(d),W(2),H(a),O(()=>{A!==(A=Q(u))&&(h.value=(h.__value=A)??``,D(h,A))}),Z(`change`,h,e=>S(e.currentTarget.value)),X(e,n)},$$slots:{default:!0}}),ue(),a()}var d8e=V(`<div class="relative -mx-3 flex h-6 items-center gap-1 px-3"><span class="w-10 shrink-0 text-[10px] text-gray-400">wait</span> <!> <span> </span> <!></div>`),f8e=V(`<div class="flex w-full flex-col gap-0.5"><div class="relative -mx-3 flex h-5 items-center px-3"><!> <span class="text-[10px] text-gray-300">trigger</span></div> <!> <p class="text-[10px] text-gray-400">delays add up from the trigger</p></div>`);function p8e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,i),[i,a]=Ve(),o=F(),c=J(t,`id`,8),l=J(t,`data`,8),u=[1,2,3,4];d(()=>(n(),s(c())),()=>{I(o,n()[c()]?.__handles??{})}),h(),R(),r4(e,{get type(){return s(l()),K(()=>l().type)},get label(){return s(l()),K(()=>l().label)},children:(e,t)=>{var n=f8e(),i=j(n);n4(j(i),{kind:`target`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Left)},id:`trigger`,style:`top: 50%;`}),W(2),H(i);var a=g(i,2);B(a,1,()=>u,e=>e,(e,t)=>{var n=d8e(),i=g(j(n),2);{let e=ze(()=>(s(l()),Q(t),K(()=>l()[`delay`+Q(t)]??0)));hq(i,{nodrag:!0,step:.05,decimals:2,min:0,get value(){return Q(e)},onchange:e=>nu(c(),{[`delay`+Q(t)]:e})})}var a=g(i,2);let u;var d=f(a),p=g(a,2);{let e=ze(()=>`step${Q(t)}`);n4(p,{kind:`source`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Right)},get id(){return Q(e)},style:`top: 50%;`})}H(n),O(()=>{u=r(a,1,`w-12 shrink-0 text-right text-[10px]`,null,u,{"text-primary-300":!!Q(o)[`step`+Q(t)],"text-gray-300":!Q(o)[`step`+Q(t)]}),Y(d,`${Q(o),Q(t),K(()=>Q(o)[`step`+Q(t)]?`â `:``)??``}step${Q(t)??``}`)}),X(e,n)}),W(2),H(n),X(e,n)},$$slots:{default:!0}}),ue(),a()}var m8e=V(`<div class="relative -mx-3 flex h-6 items-center gap-1 px-3"><span class="font-mono text-[10px] text-gray-300"> </span> <span> </span> <!></div>`),h8e=V(`<div class="flex w-full flex-col gap-0.5"><!> <p class="text-[10px] text-gray-400">your own keys â every peer reads its own</p></div>`);function g8e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,i),[i,a]=Ve(),o=F(),c=J(t,`id`,8),l=J(t,`data`,8),u=[{id:`x`,label:`x A / D`},{id:`y`,label:`y S / W`}],p=e=>typeof e==`number`?e>0?`+1`:e<0?`-1`:`0`:`0`;d(()=>
2465(n(),s(c())),()=>{I(o,n()[c()]?.__handles??{})}),h(),R(),r4(e,{get type(){return s(l()),K(()=>l().type)},get label(){return s(l()),K(()=>l().label)},children:(e,t)=>{var n=h8e(),i=j(n);B(i,1,()=>u,e=>e.id,(e,t)=>{var n=m8e(),i=j(n),a=f(i,!0),c=g(i,2);let u;var d=f(c,!0);n4(g(c,2),{kind:`source`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Right)},get id(){return Q(t),K(()=>Q(t).id)},style:`top: 50%;`}),H(n),O(e=>{Y(a,(Q(t),K(()=>Q(t).label))),u=r(c,1,`ml-auto w-6 shrink-0 text-right font-mono text-[11px]`,null,u,{"text-primary-300":!!Q(o)[Q(t).id],"text-gray-400":!Q(o)[Q(t).id]}),Y(d,e)},[()=>(Q(o),Q(t),K(()=>p(Q(o)[Q(t).id])))]),X(e,n)}),W(2),H(n),X(e,n)},$$slots:{default:!0}}),ue(),a()}var _8e=V(`<!> <!> <!>`,1),v8e=V(`<span class="overflow-hidden text-ellipsis whitespace-nowrap text-xs text-gray-200"> </span>`),y8e=V(`<div class="script-in relative -mx-3 flex h-5 items-center px-3"><!> <span class="max-w-full truncate text-[10px] text-gray-300"> <span class="text-gray-500"> </span></span></div>`),b8e=V(`<div class="script-out relative -mx-3 flex h-5 items-center justify-end gap-1 px-3"><span class="max-w-[90px] truncate font-mono text-[10px] text-sky-300" title="live value"> </span> <span class="truncate text-[10px] text-gray-300"> </span> <!></div>`),x8e=V(`<span class="max-w-[180px] wrap-break-word text-[10px] text-red-500"> </span>`),S8e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><!> <!> <!> <span class="text-[10px] text-gray-400"> </span> <button class="nodrag rounded-sm bg-[#ff4000] px-2 py-0.5 text-white">Edit code</button> <!></div>`,1);function C8e(e,t){Ce(t,!1);let n=()=>z(Cc,`$scriptErrors`,i),r=()=>z(kc,`$flowValues`,i),[i,a]=Ve(),o=F(),c=F(),l=F(),u=F(),p=F(),m=J(t,`id`,8),_=J(t,`data`,8);function v(e){return e==null?`â`:typeof e==`number`?String(Math.round(e*1e3)/1e3):Array.isArray(e)?e.map(e=>Math.round(Number(e)*100)/100).join(`, `):String(e)}d(()=>(n(),s(m())),()=>{I(o,n()[m()])}),d(()=>s(_()),()=>{I(c,(_().code??``).split(` 2466`).filter(e=>e.trim()&&!e.trim().startsWith(`//`)).length)}),d(()=>s(_()),()=>{I(l,rd(_()))}),d(()=>s(_()),()=>{I(u,id(_()))}),d(()=>(r(),s(m())),()=>{I(p,r()[m()]?.__handles??null)}),h(),R(),r4(e,{get type(){return s(_()),K(()=>_().type)},get label(){return s(_()),K(()=>_().label)},children:(e,t)=>{var n=S8e(),r=N(n),i=e=>{var t=_8e(),n=N(t);n4(n,{kind:`target`,get nodeType(){return s(_()),K(()=>_().type)},get position(){return s(W1),K(()=>W1.Left)},id:`a`,style:`top: 30px`});var r=g(n,2);n4(r,{kind:`target`,get nodeType(){return s(_()),K(()=>_().type)},get position(){return s(W1),K(()=>W1.Left)},id:`b`,style:`top: 52px`}),n4(g(r,2),{kind:`target`,get nodeType(){return s(_()),K(()=>_().type)},get position(){return s(W1),K(()=>W1.Left)},id:`c`,style:`top: 74px`}),X(e,t)};G(r,e=>{Q(l)||e(i)});var a=g(r,2),d=e=>{n4(e,{kind:`source`,get nodeType(){return s(_()),K(()=>_().type)},get position(){return s(W1),K(()=>W1.Right)}})};G(a,e=>{Q(u),K(()=>!Q(u).length)&&e(d)});var h=g(a,2),y=j(h),x=e=>{var t=v8e(),n=f(t,!0);O(()=>{b(t,`title`,(s(_()),K(()=>_().name))),Y(n,(s(_()),K(()=>_().name)))}),X(e,t)};G(y,e=>{s(_()),K(()=>_().name)&&e(x)});var S=g(y,2),C=e=>{var t=fe(),n=N(t);B(n,1,()=>Q(l),e=>e.name,(e,t)=>{var n=y8e(),r=j(n);n4(r,{kind:`target`,nodeType:`script`,get id(){return Q(t),K(()=>Q(t).name)},get position(){return s(W1),K(()=>W1.Left)},get forceType(){return Q(t),K(()=>Q(t).type)},style:`top: 50%;`});var i=g(r,2),a=j(i),o=g(a),c=f(o,!0);H(i),H(n),O(()=>{b(n,`data-socket`,(Q(t),K(()=>Q(t).name))),Y(a,`${Q(t),K(()=>Q(t).name)??``} `),Y(c,(Q(t),K(()=>Q(t).type)))}),X(e,n)}),X(e,t)};G(S,e=>{Q(l)&&e(C)});var w=g(S,2);B(w,1,()=>Q(u),e=>e.name,(e,t)=>{var n=b8e(),r=j(n),i=f(r,!0),a=g(r,2),o=f(a,!0);n4(g(a,2),{kind:`source`,nodeType:`script`,get id(){return Q(t),K(()=>Q(t).name)},get position(){return s(W1),K(()=>W1.Right)},get forceType(){return Q(t),K(()=>Q(t).type)},style:`top: 50%;`}),H(n),O(e=>{b(n,`data-socket`,(Q(t),K(()=>Q(t).name))),Y(i,e),Y(o,(Q(t),K(()=>Q(t).name)))},[()=>(Q(p),Q(t),K(()=>v(Q(p)?.[Q(t).name])))]),X(e,n)});var T=g(w,2),E=f(T),D=g(T,2),k=g(D,2),A=e=>{var t=x8e(),n=f(t);O(()=>{b(t,`title`,Q(o)),Y(n,`â ${Q(o)??``}`)}),X(e,t)};G(k,e=>{Q(o)&&e(A)}),H(h),O(()=>Y(E,`${Q(c)??``} line${Q(c)===1?``:`s`} of code`)),Z(`click`,D,()=>Rc.set(m())),X(e,n)},$$slots:{default:!0}}),ue(),a()}var w8e=V(`<span class="max-w-[200px] wrap-break-word text-[10px] text-red-500"> </span>`),T8e=V(`<div class="flex w-full flex-col gap-1"><span class="overflow-hidden text-ellipsis whitespace-nowrap text-xs text-gray-200"> </span> <span class="flex items-center gap-1 text-[10px] text-gray-400"><span></span> <span data-behaviour-state=""> </span> <!></span> <div class="flex gap-1"><button class="nodrag behaviour-open rounded-sm bg-[#ff4000] px-2 py-0.5 text-white">Open view</button> <button class="nodrag rounded-sm bg-gray-600 px-2 py-0.5 text-white"> </button></div> <!></div>`);function E8e(e,t){Ce(t,!1);let n=()=>z(Nc,`$activeGraphId`,i),[i,a]=Ve(),o=F(),c=F(),l=F(),u=J(t,`id`,8),p=J(t,`data`,8),m=F(null);_e(()=>{let e=()=>{};return $(()=>import(`../chunks/BuiBbCDp.js`).then(t=>{e=t.behaviourStatus.subscribe(e=>I(m,e[u()]??null))}),[],import.meta.url),()=>e()}),d(()=>(s(p()),Q(m)),()=>{I(o,p().enabled===!1?`off`:Q(m)?.status??`loading`)}),d(()=>Q(m),()=>{I(c,Q(m)?.model?.handlers?.length??0)}),d(()=>Q(m),()=>{I(l,Q(m)?.errors?.[0])}),h(),R(),r4(e,{get type(){return s(p()),K(()=>p().type)},get label(){return s(p()),K(()=>p().label)},children:(e,t)=>{var i=T8e(),a=j(i),d=f(a,!0),m=g(a,2),h=j(m);let _;var v=g(h,2),y=f(v,!0),x=g(v,2),S=e=>{var t=Te();O(()=>Y(t,`· ${Q(c)??``} handler${Q(c)===1?``:`s`}`)),X(e,t)};G(x,e=>{Q(o)===`running`&&e(S)}),H(m);var C=g(m,2),w=j(C),T=g(w,2),E=f(T,!0);H(C);var D=g(C,2),k=e=>{var t=w8e(),n=f(t);O(()=>{b(t,`title`,(Q(l),K(()=>Q(l).message))),Y(n,`â ${Q(l),K(()=>Q(l).line?`line `+Q(l).line+`: `:``)??``}${Q(l),K(()=>Q(l).message)??``}`)}),X(e,t)};G(D,e=>{Q(l)&&e(k)}),H(i),O(()=>{b(i,`data-behaviour-card`,u()),b(a,`title`,(s(p()),K(()=>p().name))),Y(d,(s(p()),K(()=>p().name||`Behaviour`))),_=r(h,1,`inline-block h-2 w-2 rounded-full`,null,_,{"bg-emerald-400":Q(o)===`running`,"bg-amber-400":Q(o)===`loading`,"bg-red-500":Q(o)===`error`,"bg-gray-500":Q(o)===`off`}),Y(y,Q(o)),b(T,`title`,(s(p()),K(()=>p().enabled===!1?`Run this behaviour`:`Stop this behaviour (its state is kept)`))),Y(E,(s(p()),K(()=>p().enabled===!1?`Run`:`Stop`)))}),Z(`click`,w,()=>wc.set({id:u(),graphId:n()})),Z(`click`,T,()=>nu(u(),{enabled:p().enabled===!1})),X(e,i)},$$slots:{default:!0}}),ue(),a()}var D8e=V(`<label class="flex items-center gap-1"><span class="w-12 text-gray-400"> </span> <!></label>`),O8e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><div class="flex justify-between"><span>out</span><span class="font-mono"> </span></div> <!> <label class="flex items-center gap-1"><input class="nodrag" type="checkbox"/> clamp</label></div>`,1);function k8e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,r),[r,i]=Ve(),a=F(),o=F(),c=J(t,`id`,8),l=J(t,`data`,8),u=[[`inMin`,`in min`],[`inMax`,`in max`],[`outMin`,`out min`],[`outMax`,`out max`]],p={inMin:0,inMax:1,outMin:0,outMax:1};d(()=>
2466(n(),s(c())),()=>{I(a,n()[c()])}),d(()=>Q(a),()=>{I(o,Q(a)===void 0?`â`:(+Q(a)).toFixed(2))}),h(),R(),r4(e,{get type(){return s(l()),K(()=>l().type)},get label(){return s(l()),K(()=>l().label)},children:(e,t)=>{var n=O8e(),r=N(n);n4(r,{kind:`target`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Left)},id:`a`,style:`top: 30px`});var i=g(r,2);n4(i,{kind:`source`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Right)}});var a=g(i,2),d=j(a),m=g(j(d)),h=f(m,!0);H(d);var _=g(d,2);B(_,1,()=>u,Be,(e,t)=>{var n=q(()=>A(Q(t),2));let r=()=>Q(n)[0],i=()=>Q(n)[1];var a=D8e(),o=j(a),u=f(o,!0),d=g(o,2);{let e=ze(()=>(s(l()),r(),K(()=>l()[r()]??p[r()])));hq(d,{nodrag:!0,step:.01,decimals:2,get value(){return Q(e)},onchange:e=>nu(c(),{[r()]:e})})}H(a),O(()=>Y(u,i())),X(e,a)});var y=g(_,2),b=j(y);v(b),W(),H(y),H(a),O(()=>{Y(h,Q(o)),w(b,(s(l()),K(()=>l().clamp??!0)))}),Z(`change`,b,e=>nu(c(),{clamp:e.currentTarget.checked})),X(e,n)},$$slots:{default:!0}}),ue(),i()}var A8e=V(`<label class="flex items-center gap-1"><span class="w-8 whitespace-nowrap text-gray-400"> </span> <!></label>`),j8e=V(`<!> <!> <!> <!> <!> <!> <div class="flex w-full flex-col gap-1"><div class="flex justify-between"><span>out</span><span class="font-mono"> </span></div> <!></div>`,1);function M8e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,r),[r,i]=Ve(),a=F(),o=F(),c=J(t,`id`,8),l=J(t,`data`,8);d(()=>(n(),s(c())),()=>{I(a,n()[c()])}),d(()=>Q(a),()=>{I(o,Q(a)===void 0?`â`:typeof Q(a)==`boolean`?String(Q(a)):(+Q(a)).toFixed(2))}),h(),R(),r4(e,{get type(){return s(l()),K(()=>l().type)},get label(){return s(l()),K(()=>l().label)},children:(e,t)=>{var n=j8e(),r=N(n);n4(r,{kind:`target`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Left)},id:`index`,style:`top: 30px`});var i=g(r,2);n4(i,{kind:`target`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Left)},id:`a`,style:`top: 54px`});var a=g(i,2);n4(a,{kind:`target`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Left)},id:`b`,style:`top: 78px`});var u=g(a,2);n4(u,{kind:`target`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Left)},id:`c`,style:`top: 102px`});var d=g(u,2);n4(d,{kind:`target`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Left)},id:`d`,style:`top: 126px`});var p=g(d,2);n4(p,{kind:`source`,get nodeType(){return s(l()),K(()=>l().type)},get position(){return s(W1),K(()=>W1.Right)}});var m=g(p,2),h=j(m),_=g(j(h)),v=f(_,!0);H(h);var y=g(h,2);B(y,0,()=>[[`index`,`idx`],[`a`,`0 a`],[`b`,`1 b`],[`c`,`2 c`],[`d`,`3 d`]],Be,(e,t)=>{var n=q(()=>A(t,2));let r=()=>Q(n)[0],i=()=>Q(n)[1];var a=A8e(),o=j(a),u=f(o,!0),d=g(o,2);{let e=ze(()=>(s(l()),r(),K(()=>l()[r()]??0)));hq(d,{nodrag:!0,step:.01,decimals:2,get value(){return Q(e)},onchange:e=>nu(c(),{[r()]:e})})}H(a),O(()=>Y(u,i())),X(e,a)}),H(m),O(()=>Y(v,Q(o))),X(e,n)},$$slots:{default:!0}}),ue(),i()}var N8e=V(`<span class="text-[10px] text-red-500">definition missing</span>`),P8e=V(`<span> </span>`),F8e=V(`<span class="wired-value rounded-sm bg-gray-900/70 px-1.5 py-0.5 font-mono text-[11px] text-primary-300" title="Driven by the wired input"> </span>`),I8e=V(`<input class="nodrag accent-[#ff4000]" type="range"/>`),L8e=V(`<option> </option>`),R8e=V(`<select class="nodrag"></select>`),z8e=V(`<label class="flex flex-col"><span class="flex justify-between"><span> </span> <!></span> <!></label>`),B8e=V(`<!> <button class="nodrag rounded-sm bg-gray-600 px-2 py-0.5 text-[10px] text-white">Edit definition</button>`,1),V8e=V(`<span class="max-w-[180px] wrap-break-word text-[10px] text-red-500"> </span>`),H8e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><!> <!></div>`,1);function U8e(e,t){Ce(t,!1);let n=()=>z(Pc,`$customNodeDefs`,o),r=()=>z(Cc,`$scriptErrors`,o),i=()=>z(Ic,`$flowEdges`,o),a=()=>z(kc,`$flowValues`,o),[o,c]=Ve(),l=F(),p=F(),m=F(),y=J(t,`id`,8),x=J(t,`data`,8);function S(e){return e==null?`â¦`:typeof e==`number`?(+e).toFixed(2):Array.isArray(e)?e.map(e=>(+e).toFixed(1)).join(`, `):String(e)}d(()=>(n(),s(x())),()=>{I(l,n().find(e=>e.id===x().defId)??null)}),d(()=>(r(),s(y())),()=>{I(p,r()[y()])}),d(()=>(i(),s(y())),()=>{I(m,e=>i().find(t=>t.target===y()&&t.targetHandle===e)?.source??null)}),h(),R();{let t=ze(()=>(Q(l),K(()=>Q(l)?.name??`custom`)));r4(e,{get type(){return Q(t)},children:(e,t)=>{var n=H8e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(x()),K(()=>x().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2);B(i,3,()=>(Q(l),K(()=>(Q(l)?.params??[]).filter(e=>e.kind===`range`))),e=>e.key,(e,t,n)=>{{let r=ze(()=>`top: ${34+Q(n)*38}px`);n4(e,{kind:`target`,get nodeType(){return s(x()),K(()=>x().type)},get position(){return s(W1),K(()=>W1.Left)},get id(){return Q(t),K(()=>Q(t).key)},get style(){return Q(r)}
2466})}});var o=g(i,2),c=j(o),d=e=>{var t=N8e();X(e,t)},h=e=>{var t=B8e(),n=N(t);B(n,1,()=>(Q(l),K(()=>Q(l).params??[])),Be,(e,t)=>{var n=z8e(),r=j(n),i=j(r),o=f(i,!0),c=g(i,2),l=e=>{var n=P8e(),r=f(n,!0);O(()=>Y(r,(s(x()),Q(t),K(()=>x()[Q(t).key]??Q(t).min??0)))),X(e,n)},d=q(()=>(Q(t),Q(m),K(()=>Q(t).kind===`range`&&!Q(m)(Q(t).key))));G(c,e=>{Q(d)&&e(l)}),H(r);var p=g(r,2),h=e=>{var n=F8e(),r=f(n);O(e=>Y(r,`â ${e??``}`),[()=>(a(),Q(m),Q(t),K(()=>S(a()[Q(m)(Q(t).key)])))]),X(e,n)},C=q(()=>(Q(t),Q(m),K(()=>Q(t).kind===`range`&&Q(m)(Q(t).key)))),w=e=>{var n=I8e();v(n),O(()=>{b(n,`min`,(Q(t),K(()=>Q(t).min))),b(n,`max`,(Q(t),K(()=>Q(t).max))),b(n,`step`,(Q(t),K(()=>Q(t).step))),u(n,(s(x()),Q(t),K(()=>x()[Q(t).key]??Q(t).min??0)))}),Z(`input`,n,e=>nu(y(),{[Q(t).key]:+e.currentTarget.value})),X(e,n)},T=e=>{var n=R8e();B(n,5,()=>(Q(t),K(()=>Q(t).options??[])),Be,(e,t)=>{var n=L8e(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(n);var r;_(n),O(()=>{r!==(r=(s(x()),Q(t),K(()=>x()[Q(t).key]??Q(t).options?.[0])))&&
2466(n.value=(n.__value=r)??``,D(n,r))}),Z(`change`,n,e=>nu(y(),{[Q(t).key]:e.currentTarget.value})),X(e,n)};G(p,e=>{Q(C)?e(h):(Q(t),K(()=>Q(t).kind===`range`)?e(w,1):(Q(t),K(()=>Q(t).kind===`select`)&&e(T,2)))}),H(n),O(()=>Y(o,(Q(t),K(()=>Q(t).key)))),X(e,n)});var r=g(n,2);Z(`click`,r,()=>zc.set(Q(l))),X(e,t)};G(c,e=>{Q(l)?e(h,-1):e(d)});var C=g(c,2),w=e=>{var t=V8e(),n=f(t);O(()=>{b(t,`title`,Q(p)),Y(n,`â ${Q(p)??``}`)}),X(e,t)};G(C,e=>{Q(p)&&e(w)}),H(o),X(e,n)},$$slots:{default:!0}})}ue(),c()}var W8e=V(`<!> <div class="flex w-full flex-col gap-1"><span class="text-[10px] text-gray-400"> <!></span> <div class="flex gap-1"><button> </button> <button class="nodrag rounded-sm bg-gray-600 px-1 py-0.5 text-white">Clear</button></div> <label class="flex flex-col"><span class="flex justify-between"><span>speed</span><span> </span></span> <input class="nodrag accent-[#ff4000]" type="range" min="0.1" max="5" step="0.1"/></label> <label class="flex flex-col"><span>mode</span> <select class="nodrag"><option>loop</option><option>ping-pong</option></select></label></div>`,1);function G8e(e,t){Ce(t,!1);let n=()=>z(iN,`$pathCaptureNode`,i),[i,a]=Ve(),o=F(),c=F(),l=J(t,`id`,8),p=J(t,`data`,8);d(()=>(n(),s(l())),()=>{I(o,n()===l())}),d(()=>s(p()),()=>{I(c,(p().points??[]).length)}),h(),R(),r4(e,{get type(){return s(p()),K(()=>p().type)},get label(){return s(p()),K(()=>p().label)},children:(e,t)=>{var n=W8e(),i=N(n);n4(i,{kind:`source`,get nodeType(){return s(p()),K(()=>p().type)},get position(){return s(W1),K(()=>W1.Right)}});var a=g(i,2),d=j(a),m=j(d),h=g(m),y=e=>{var t=Te(`(need 2+)`);X(e,t)};G(h,e=>{Q(c)<2&&e(y)}),H(d);var b=g(d,2),x=j(b),S=f(x,!0),C=g(x,2);H(b);var w=g(b,2),T=j(w),E=g(j(T)),k=f(E,!0);H(T);var A=g(T,2);v(A),H(w);var ee=g(w,2),M=g(j(ee),2),te=j(M);te.value=te.__value=`loop`;var ne=g(te);ne.value=ne.__value=`pingpong`,H(M);var P;_(M),H(ee),H(a),O(()=>{Y(m,`${Q(c)??``} waypoint${Q(c)===1?``:`s`} `),r(x,1,`nodrag flex-1 rounded px-1 py-0.5 text-white ${Q(o)?`bg-green-600`:`bg-[#ff4000]`}`),Y(S,Q(o)?`Capturing⦠(click scene)`:`Capture clicks`),Y(k,(s(p()),K(()=>p().speed??1))),u(A,(s(p()),K(()=>p().speed??1))),P!==(P=(s(p()),K(()=>p().mode??`loop`)))&&(M.value=(M.__value=P)??``,D(M,P))}),Z(`click`,x,()=>oN(l())),Z(`click`,C,()=>nu(l(),{points:[]})),Z(`input`,A,e=>nu(l(),{speed:+e.currentTarget.value})),Z(`change`,M,e=>nu(l(),{mode:e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),a()}var u4=V(`<option> </option>`),K8e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><select class="nodrag"><option>â pick a sound â</option><!><!></select> <label class="flex flex-col"><span class="flex justify-between"><span>volume</span><span> </span></span> <input class="nodrag accent-[#ff4000]" type="range" min="0" max="1" step="0.05"/></label> <label class="flex flex-col"><span class="flex justify-between"><span>radius</span><span> </span></span> <input class="nodrag accent-[#ff4000]" type="range" min="1" max="60" step="1"/></label> <label class="flex flex-col"><span class="flex justify-between"><span>rolloff</span><span> </span></span> <input class="nodrag accent-[#ff4000]" type="range" min="0.5" max="4" step="0.1"/></label> <div class="flex items-center gap-2"><button> </button> <label class="flex items-center gap-1"><input class="nodrag" type="checkbox"/> loop</label></div></div>`,1);function q8e(e,t){Ce(t,!1);let n=()=>z(Fa,`$explorerItems`,i),[i,a]=Ve(),o=F(),c=F(),l=J(t,`id`,8),p=J(t,`data`,8);d(()=>n(),()=>{I(o,n().filter(e=>e.kind===`audio`))}),d(()=>(s(p()),Q(o)),()=>{I(c,!p().hash||Q(o).some(e=>e.hash===p().hash))}),h(),R(),r4(e,{get type(){return s(p()),K(()=>p().type)},get label(){return s(p()),K(()=>p().label)},children:(e,t)=>{var n=K8e(),i=N(n);n4(i,{kind:`source`,get nodeType(){return s(p()),K(()=>p().type)},get position(){return s(W1),K(()=>W1.Right)}});var a=g(i,2);n4(a,{kind:`target`,get nodeType(){return s(p()),K(()=>p().type)},get position(){return s(W1),K(()=>W1.Left)},id:`volume`,style:`top: 74px`});var d=g(a,2),m=j(d),h=j(m);h.value=h.__value=``;var y=g(h);B(y,1,()=>Q(o),e=>e.id,(e,t)=>
2466{var n=u4(),r=f(n,!0),i={};O(()=>{Y(r,(Q(t),K(()=>Q(t).name))),i!==(i=(Q(t),K(()=>Q(t).hash)))&&(n.value=(n.__value=i)??``)}),X(e,n)});var b=g(y),x=e=>{var t=u4(),n=f(t),r={};O(()=>{Y(n,`${s(p()),K(()=>p().file||`shared sound`)??``} (fetchingâ¦)`),r!==(r=(s(p()),K(()=>p().hash)))&&(t.value=(t.__value=r)??``)}),X(e,t)};G(b,e=>{Q(c)||e(x)}),H(m);var S;_(m);var C=g(m,2),T=j(C),E=g(j(T)),k=f(E,!0);H(T);var A=g(T,2);v(A),H(C);var ee=g(C,2),M=j(ee),te=g(j(M)),ne=f(te);H(M);var P=g(M,2);v(P),H(ee);var re=g(ee,2),ie=j(re),F=g(j(ie)),ae=f(F,!0);H(ie);var I=g(ie,2);v(I),H(re);var L=g(re,2),oe=j(L),R=f(oe,!0),se=g(oe,2),ce=j(se);v(ce),W(),H(se),H(L),H(d),O((e,t)=>{S!==(S=(s(p()),K(()=>p().hash??``)))&&(m.value=(m.__value=S)??``,D(m,S)),Y(k,e),u(A,(s(p()),K(()=>p().volume??.8))),Y(ne,`${s(p()),K(()=>p().radius??5)??``}m`),u(P,(s(p()),K(()=>p().radius??5))),Y(ae,t),u(I,(s(p()),K(()=>p().rolloff??1))),r(oe,1,`nodrag flex-1 rounded-sm px-1 py-0.5 text-white ${s(p()),K(()=>p().playing?`bg-green-600`:`bg-[#ff4000]`)??``}`),Y(R,(s(p()),K(()=>p().playing?`â Stop`:`â¶ Play`))),w(ce,(s(p()),K(()=>p().loop!==!1)))},[()=>(s(p()),K(()=>(p().volume??.8).toFixed(2))),()=>(s(p()),K(()=>(p().rolloff??1).toFixed(1)))]),Z(`change`,m,e=>{let t=e.currentTarget.value||null,n=Q(o).find(e=>e.hash===t);nu(l(),{hash:t,file:n?.name??``}),t&&Sf(t)}),Z(`input`,A,e=>nu(l(),{volume:+e.currentTarget.value})),Z(`input`,P,e=>nu(l(),{radius:+e.currentTarget.value})),Z(`input`,I,e=>nu(l(),{rolloff:+e.currentTarget.value})),Z(`click`,oe,()=>nu(l(),{playing:!p().playing})),Z(`change`,ce,e=>nu(l(),{loop:e.currentTarget.checked})),X(e,n)},$$slots:{default:!0}}),ue(),a()}var J8e=V(`<option> </option>`),Y8e=V(`<!> <div class="flex w-full flex-col gap-1"><label class="flex flex-col"><span>preset</span> <select class="nodrag"></select></label> <label class="flex flex-col"><span>emission</span> <select class="nodrag"><option>continuous</option><option>burst (triggered)</option><option>on impact (physics)</option></select></label> <div class="relative -mx-3 flex flex-col px-3"><!> <span>offset</span> <span class="text-[10px] text-gray-400">wire a Vector3 (spawn point)</span></div> <label class="relative -mx-3 flex flex-col px-3"><!> <span class="flex justify-between"><span>count</span><span> </span></span> <input class="nodrag accent-[#c084fc]" type="range" min="1" max="500" step="1"/></label> <label class="relative -mx-3 flex flex-col px-3"><!> <span class="flex justify-between"><span>speed</span><span> </span></span> <input class="nodrag accent-[#c084fc]" type="range" min="0" max="8" step="0.1"/></label> <label class="relative -mx-3 flex flex-col px-3"><!> <span class="flex justify-between"><span>gravity</span><span> </span></span> <input class="nodrag accent-[#c084fc]" type="range" min="-10" max="10" step="0.1"/></label> <label class="relative -mx-3 flex flex-col px-3"><!> <span class="flex justify-between"><span>size</span><span> </span></span> <input class="nodrag accent-[#c084fc]" type="range" min="0.01" max="1" step="0.01"/></label> <label class="relative -mx-3 flex flex-col px-3"><!> <span>color</span> <span class="flex items-center gap-2"><input class="nodrag h-5 w-7" type="color"/> <span class="text-[10px] text-gray-400">or wire a color</span></span></label> <div class="relative -mx-3 flex flex-col px-3"><!> <span>trigger</span> <span class="text-[10px] text-gray-400">wire an event to burst</span></div> <label class="flex flex-col"><span>sprite</span> <select class="nodrag"><option>soft dot</option><option>spark streak</option><option>smoke puff</option><option>star</option><option>confetti</option></select></label> <label class="flex flex-col"><span>space</span> <select class="nodrag"><option>local (rides object)</option><option>world (trails)</option></select></label></div>`,1);function X8e(e,t){Ce(t,!1);let n=J(t,`id`,8),r=J(t,`data`,8),i=e=>nu(n(),e);R(),r4(e,{get type(){return s(r()),K(()=>r().type)},get label(){return s(r()),K(()=>r().label)},children:(e,t)=>{var n=Y8e(),a=N(n);n4(a,{kind:`source`,get nodeType(){return s(r()),K(()=>r().type)},get position(){return s(W1),K(()=>W1.Right)}});var o=g(a,2),c=j(o),l=g(j(c),2);B(l,5,()=>Ju,e=>e.key,(e,t)=>
2466{var n=J8e(),r=f(n,!0),i={};O(()=>{Y(r,(Q(t),K(()=>Q(t).name))),i!==(i=(Q(t),K(()=>Q(t).key)))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(l);var d;_(l),H(c);var p=g(c,2),m=g(j(p),2),h=j(m);h.value=h.__value=`continuous`;var y=g(h);y.value=y.__value=`burst`;var b=g(y);b.value=b.__value=`impact`,H(m);var x;_(m),H(p);var S=g(p,2);n4(j(S),{kind:`target`,get nodeType(){return s(r()),K(()=>r().type)},id:`offset`,get position(){return s(W1),K(()=>W1.Left)},style:`top: 50%;`}),W(4),H(S);var C=g(S,2),w=j(C);n4(w,{kind:`target`,get nodeType(){return s(r()),K(()=>r().type)},id:`count`,get position(){return s(W1),K(()=>W1.Left)},style:`top: 50%;`});var T=g(w,2),E=g(j(T)),k=f(E,!0);H(T);var A=g(T,2);v(A),H(C);var ee=g(C,2),M=j(ee);n4(M,{kind:`target`,get nodeType(){return s(r()),K(()=>r().type)},id:`speed`,get position(){return s(W1),K(()=>W1.Left)},style:`top: 50%;`});var te=g(M,2),ne=g(j(te)),P=f(ne,!0);H(te);var re=g(te,2);v(re),H(ee);var ie=g(ee,2),F=j(ie);n4(F,{kind:`target`,get nodeType(){return s(r()),K(()=>r().type)},id:`gravity`,get position(){return s(W1),K(()=>W1.Left)},style:`top: 50%;`});var ae=g(F,2),I=g(j(ae)),L=f(I,!0);H(ae);var oe=g(ae,2);v(oe),H(ie);var R=g(ie,2),se=j(R);n4(se,{kind:`target`,get nodeType(){return s(r()),K(()=>r().type)},id:`size`,get position(){return s(W1),K(()=>W1.Left)},style:`top: 50%;`});var ce=g(se,2),le=g(j(ce)),ue=f(le,!0);H(ce);var de=g(ce,2);v(de),H(R);var z=g(R,2),fe=j(z);n4(fe,{kind:`target`,get nodeType(){return s(r()),K(()=>r().type)},id:`color`,get position(){return s(W1),K(()=>W1.Left)},style:`top: 50%;`});var pe=g(fe,4),me=j(pe);v(me),W(2),H(pe),H(z);var V=g(z,2);n4(j(V),{kind:`target`,get nodeType(){return s(r()),K(()=>r().type)},id:`trigger`,get position(){return s(W1),K(()=>W1.Left)},style:`top: 50%;`}),W(4),H(V);var he=g(V,2),ge=g(j(he),2),U=j(ge);U.value=U.__value=`dot`;var _e=g(U);_e.value=_e.__value=`streak`;var ve=g(_e);ve.value=ve.__value=`puff`;var G=g(ve);G.value=G.__value=`star`;var ye=g(G);ye.value=ye.__value=`square`,H(ge);var be;_(ge),H(he);var xe=g(he,2),Se=g(j(xe),2),Ce=j(Se);Ce.value=Ce.__value=`local`;var we=g(Ce);we.value=we.__value=`world`,H(Se);var Te;_(Se),H(xe),H(o),O(()=>{d!==(d=(s(r()),K(()=>r().preset??`sparkles`)))&&(l.value=(l.__value=d)??``,D(l,d)),x!==(x=(s(r()),K(()=>r().mode??`continuous`)))&&(m.value=(m.__value=x)??``,D(m,x)),Y(k,(s(r()),K(()=>r().count??80))),u(A,(s(r()),K(()=>r().count??80))),Y(P,(s(r()),K(()=>r().speed??1))),u(re,(s(r()),K(()=>r().speed??1))),Y(L,(s(r()),K(()=>r().gravity??0))),u(oe,(s(r()),K(()=>r().gravity??0))),Y(ue,(s(r()),K(()=>r().sizeStart??.1))),u(de,(s(r()),K(()=>r().sizeStart??.1))),u(me,(s(r()),K(()=>r().colorStart??`#ffffff`))),be!==(be=(s(r()),K(()=>r().sprite??`dot`)))&&(ge.value=(ge.__value=be)??``,D(ge,be)),Te!==(Te=(s(r()),K(()=>r().space??`local`)))&&(Se.value=(Se.__value=Te)??``,D(Se,Te))}),Z(`change`,l,e=>i(_ne(e.currentTarget.value))),Z(`change`,m,e=>i({mode:e.currentTarget.value})),Z(`input`,A,e=>i({count:+e.currentTarget.value})),Z(`input`,re,e=>i({speed:+e.currentTarget.value})),Z(`input`,oe,e=>i({gravity:+e.currentTarget.value})),Z(`input`,de,e=>i({sizeStart:+e.currentTarget.value})),Z(`input`,me,e=>i({colorStart:e.currentTarget.value})),Z(`change`,ge,e=>i({sprite:e.currentTarget.value})),Z(`change`,Se,e=>i({space:e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue()}var Z8e=V(`<!> <label class="flex w-full flex-col"><span>value</span> <!></label>`,1);function Q8e(e,t){Ce(t,!1);let n=J(t,`id`,8),r=J(t,`data`,8);R(),r4(e,{get type(){return s(r()),K(()=>r().type)},get label(){return s(r()),K(()=>r().label)},children:(e,t)=>{var i=Z8e(),a=N(i);n4(a,{kind:`source`,get nodeType(){return s(r()),K(()=>r().type)},get position(){return s(W1),K(()=>W1.Right)}});var o=g(a,2),c=g(j(o),2);{let e=ze(()=>(s(r()),K(()=>r().value??0))),t=ze(()=>(s(r()),K(()=>(r().step??1)/100)));hq(c,{nodrag:!0,get value(){return Q(e)},get step(){return Q(t)},decimals:2,onchange:e=>nu(n(),{value:e})})}H(o),X(e,i)},$$slots:{default:!0}}),ue()}var $8e=V(`<label class="flex items-center gap-1"><span class="w-3 text-gray-400"> </span> <!></label>`),e5e=V(`<!> <div class="flex w-full flex-col gap-1"></div>`,1);function t5e(e,t){Ce(t,!1);let n=J(t,`id`,8),r=J(t,`data`,8),i=[`x`,`y`,`z`];R(),r4(e,{get type(){return s(r()),K(()=>r().type)},get label(){return s(r()),K(()=>r().label)},children:(e,t)=>{var a=e5e(),o=N(a);n4(o,{kind:`source`,get nodeType(){return s(r()),K(()=>r().type)},get position(){return s(W1),K(()=>W1.Right)}});var c=g(o,2);B(c,5,()=>i,Be,(e,t)=>{var i=$8e(),a=j(i),o=f(a,!0),c=g(a,2);{let e=ze(()=>(s(r()),Q(t),K(()=>r()[Q(t)]??0)));
2466hq(c,{nodrag:!0,step:.01,decimals:2,get value(){return Q(e)},onchange:e=>nu(n(),{[Q(t)]:e})})}H(i),O(()=>Y(o,Q(t))),X(e,i)}),H(c),X(e,a)},$$slots:{default:!0}}),ue()}var n5e=V(`<!> <label class="flex w-full items-center gap-2"><input class="nodrag" type="checkbox"/> <span class="font-mono"> </span></label>`,1);function r5e(e,t){Ce(t,!1);let n=J(t,`id`,8),r=J(t,`data`,8);R(),r4(e,{get type(){return s(r()),K(()=>r().type)},get label(){return s(r()),K(()=>r().label)},children:(e,t)=>{var i=n5e(),a=N(i);n4(a,{kind:`source`,get nodeType(){return s(r()),K(()=>r().type)},get position(){return s(W1),K(()=>W1.Right)}});var o=g(a,2),c=j(o);v(c);var l=g(c,2),u=f(l,!0);H(o),O(()=>{w(c,(s(r()),K(()=>!!r().on))),Y(u,(s(r()),K(()=>r().on?`true`:`false`)))}),Z(`change`,c,e=>nu(n(),{on:e.currentTarget.checked})),X(e,i)},$$slots:{default:!0}}),ue()}var i5e=V(`<!> <div class="flex w-full flex-col gap-1"><div class="flex justify-between"><span>random</span> <span class="font-mono"> </span></div> <label class="flex items-center gap-1"><span class="w-12 text-gray-400">min</span> <!></label> <label class="flex items-center gap-1"><span class="w-12 text-gray-400">max</span> <!></label> <label class="flex items-center gap-1"><span class="w-12 text-gray-400">every</span> <!> <span class="text-gray-400">s</span></label></div>`,1);function a5e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,r),[r,i]=Ve(),a=F(),o=J(t,`id`,8),c=J(t,`data`,8);d(()=>(n(),s(o())),()=>{I(a,n()[o()])}),h(),R(),r4(e,{get type(){return s(c()),K(()=>c().type)},get label(){return s(c()),K(()=>c().label)},children:(e,t)=>{var n=i5e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(c()),K(()=>c().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2),l=j(i),u=g(j(l),2),d=f(u,!0);H(l);var p=g(l,2),m=g(j(p),2);{let e=ze(()=>(s(c()),K(()=>c().min??0)));hq(m,{nodrag:!0,step:.01,decimals:2,get value(){return Q(e)},onchange:e=>nu(o(),{min:e})})}H(p);var h=g(p,2),_=g(j(h),2);{let e=ze(()=>(s(c()),K(()=>c().max??1)));hq(_,{nodrag:!0,step:.01,decimals:2,get value(){return Q(e)},onchange:e=>nu(o(),{max:e})})}H(h);var v=g(h,2),y=g(j(v),2);{let e=ze(()=>(s(c()),K(()=>c().interval??0)));hq(y,{nodrag:!0,step:.01,decimals:2,min:0,get value(){return Q(e)},onchange:e=>nu(o(),{interval:e})})}W(2),H(v),H(i),O(e=>Y(d,e),[()=>(Q(a),K(()=>typeof Q(a)==`number`?Q(a).toFixed(2):`â`))]),X(e,n)},$$slots:{default:!0}}),ue(),i()}var o5e=V(`<!> <div class="flex w-full flex-col gap-1"><div class="flex justify-between"><span>time</span> <span class="font-mono"> </span></div> <select class="nodrag"><option>t (seconds)</option><option>sin</option><option>saw</option><option>pingpong</option></select> <label class="flex items-center gap-1"><span class="w-10 text-gray-400">rate</span> <input class="nodrag w-full accent-[#ff4000]" type="range" min="0.1" max="5" step="0.1"/> <span class="font-mono"> </span></label></div>`,1);function s5e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,r),[r,i]=Ve(),a=F(),o=J(t,`id`,8),c=J(t,`data`,8);d(()=>(n(),s(o())),()=>{I(a,n()[o()])}),h(),R(),r4(e,{get type(){return s(c()),K(()=>c().type)},get label(){return s(c()),K(()=>c().label)},children:(e,t)=>{var n=o5e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(c()),K(()=>c().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2),l=j(i),d=g(j(l),2),p=f(d,!0);H(l);var m=g(l,2),h=j(m);h.value=h.__value=`t`;var y=g(h);y.value=y.__value=`sin`;var b=g(y);b.value=b.__value=`saw`;var x=g(b);x.value=x.__value=`pingpong`,H(m);var S;_(m);var C=g(m,2),w=g(j(C),2);v(w);var T=g(w,2),E=f(T,!0);H(C),H(i),O((e,t)=>{Y(p,e),S!==(S=(s(c()),K(()=>c().mode??`sin`)))&&(m.value=(m.__value=S)??``,D(m,S)),u(w,(s(c()),K(()=>c().rate??1))),Y(E,t)},[()=>(Q(a),K(()=>typeof Q(a)==`number`?Q(a).toFixed(2):`â`)),()=>(s(c()),K(()=>(c().rate??1).toFixed(1)))]),Z(`change`,m,e=>nu(o(),{mode:e.currentTarget.value})),Z(`input`,w,e=>nu(o(),{rate:+e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),i()}var c5e=V(`<option> </option>`),l5e=V(`<label class="flex items-center gap-1"><input class="nodrag" type="checkbox"/> b</label>`),u5e=V(`<label class="flex items-center gap-1"><input class="nodrag" type="checkbox"/> a</label> <!>`,1),d5e=V(`<label class="flex items-center gap-1"><span class="w-3 text-gray-400">a</span> <!></label> <label class="flex items-center gap-1"><span class="w-3 text-gray-400">b</span> <!></label>`,1),f5e=V(`<!> <!> <!> <div class="flex w-full flex-col gap-1"><div class="flex justify-between"><span>out</span><span class="font-mono"> </span></div> <select class="nodrag"></select> <!></div>`,1);function d4(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,r),[r,i]=Ve(),a=F(),o=F(),c=F(),l=F(),u=J(t,`id`,8),p=J(t,`data`,8),m={math:[[`add`,`+`],[`sub`,`â`],[`mul`,`Ã`],[`div`,`÷`],[`min`,`min`],[`max`,`max`],[`mod`,`mod`]],compare:[[`gt`,`>`],[`lt`,`<`],[`eq`,`=`],[`gte`,`â¥`],[`lte`,`â¤`],[`neq`,`â `]],gate:[[`and`,`AND`],[`or`,`OR`],[`not`,`NOT`],[`xor`,`XOR`]]};d(()=>s(p()),()=>{I(a,m[p().type]??m.math)}),d(()=>s(p()),()=>{I(o,p().type===`gate`)}),d(()=>(n(),s(u())),()=>{I(c,n()[u()])}),d(()=>Q(c),()=>{I(l,Q(c)===void 0?`â`:typeof Q(c)==`boolean`?Q(c)?`true`:`false`:(+Q(c)).toFixed(2))}),h(),R(),r4(e,{get type(){return s(p()),K(()=>p().type)},get label(){return s(p()),K(()=>p().label)},children:(e,t)=>{var n=f5e(),r=N(n);n4(r,{kind:`target`,get nodeType(){return s(p()),K(()=>p().type)},get position(){return s(W1),K(()=>W1.Left)},id:`a`,style:`top: 30px`});var i=g(r,2);n4(i,{kind:`target`,get nodeType(){return s(p()),K(()=>p().type)},get position(){return s(W1),K(()=>W1.Left)},id:`b`,style:`top: 54px`});var c=g(i,2);n4(c,{kind:`source`,get nodeType(){return s(p()),K(()=>p().type)},get position(){return s(W1),K(()=>W1.Right)}});var d=g(c,2),m=j(d),h=g(j(m)),y=f(h,!0);H(m);var b=g(m,2);B(b,5,()=>Q(a),Be,(e,t)=>{var n=q(()=>A(Q(t),2));let r=()=>Q(n)[0],i=()=>Q(n)[1];var a=c5e(),o=f(a,!0),s={};O(()=>{Y(o,i()),s!==(s=r())&&(a.value=(a.__value=s)??``)}),X(e,a)}),H(b);var x;_(b);var S=g(b,2),C=e=>{var t=u5e(),n=N(t),r=j(n);v(r),W(),H(n);var i=g(n,2),a=e=>{var t=l5e(),n=j(t);v(n),W(),H(t),O(()=>w(n,(s(p()),K(()=>!!p().b)))),Z(`change`,n,e=>nu(u(),{b:e.currentTarget.checked})),X(e,t)};G(i,e=>{s(p()),K(()=>p().op!==`not`)&&e(a)}),O(()=>w(r,(s(p()),K(()=>!!p().a)))),Z(`change`,r,e=>nu(u(),{a:e.currentTarget.checked})),X(e,t)},T=e=>{var t=d5e(),n=N(t),r=g(j(n),2);{let e=ze(()=>(s(p()),K(()=>p().a??0)));
2466hq(r,{nodrag:!0,step:.01,decimals:2,get value(){return Q(e)},onchange:e=>nu(u(),{a:e})})}H(n);var i=g(n,2),a=g(j(i),2);{let e=ze(()=>(s(p()),K(()=>p().b??0)));hq(a,{nodrag:!0,step:.01,decimals:2,get value(){return Q(e)},onchange:e=>nu(u(),{b:e})})}H(i),X(e,t)};G(S,e=>{Q(o)?e(C):e(T,-1)}),H(d),O(()=>{Y(y,Q(l)),x!==(x=(s(p()),Q(a),K(()=>p().op??Q(a)[0][0])))&&(b.value=(b.__value=x)??``,D(b,x))}),Z(`change`,b,e=>nu(u(),{op:e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),i()}var p5e=V(`<!> <div class="flex w-full flex-col gap-1"><div class="flex justify-between"><span>loop</span><span class="font-mono"> </span></div> <select class="nodrag"><option>wrap</option><option>pingpong</option><option>once</option></select> <label class="flex items-center gap-1"><span class="w-10 text-gray-400">from</span> <!></label> <label class="flex items-center gap-1"><span class="w-10 text-gray-400">to</span> <!></label> <label class="flex items-center gap-1"><span class="w-10 text-gray-400">rate</span> <input class="nodrag w-full accent-[#ff4000]" type="range" min="0.1" max="5" step="0.1"/></label></div>`,1);function m5e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,r),[r,i]=Ve(),a=F(),o=J(t,`id`,8),c=J(t,`data`,8);d(()=>(n(),s(o())),()=>{I(a,n()[o()])}),h(),R(),r4(e,{get type(){return s(c()),K(()=>c().type)},get label(){return s(c()),K(()=>c().label)},children:(e,t)=>{var n=p5e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(c()),K(()=>c().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2),l=j(i),d=g(j(l)),p=f(d,!0);H(l);var m=g(l,2),h=j(m);h.value=h.__value=`wrap`;var y=g(h);y.value=y.__value=`pingpong`;var b=g(y);b.value=b.__value=`once`,H(m);var x;_(m);var S=g(m,2),C=g(j(S),2);{let e=ze(()=>(s(c()),K(()=>c().from??0)));hq(C,{nodrag:!0,step:.01,decimals:2,get value(){return Q(e)},onchange:e=>nu(o(),{from:e})})}H(S);var w=g(S,2),T=g(j(w),2);{let e=ze(()=>(s(c()),K(()=>c().to??1)));hq(T,{nodrag:!0,step:.01,decimals:2,get value(){return Q(e)},onchange:e=>nu(o(),{to:e})})}H(w);var E=g(w,2),k=g(j(E),2);v(k),H(E),H(i),O(e=>{Y(p,e),x!==(x=(s(c()),K(()=>c().mode??`wrap`)))&&(m.value=(m.__value=x)??``,D(m,x)),u(k,(s(c()),K(()=>c().rate??1)))},[()=>(Q(a),K(()=>typeof Q(a)==`number`?Q(a).toFixed(2):`â`))]),Z(`change`,m,e=>nu(o(),{mode:e.currentTarget.value})),Z(`input`,k,e=>nu(o(),{rate:+e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),i()}var h5e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><div class="flex justify-between"><span>delayed</span><span class="font-mono"> </span></div> <label class="flex items-center gap-1"><span class="w-12 text-gray-400">delay</span> <!> <span class="text-gray-400">s</span></label></div>`,1);function g5e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,r),[r,i]=Ve(),a=F(),o=J(t,`id`,8),c=J(t,`data`,8);d(()=>(n(),s(o())),()=>{I(a,n()[o()])}),h(),R(),r4(e,{get type(){return s(c()),K(()=>c().type)},get label(){return s(c()),K(()=>c().label)},children:(e,t)=>{var n=h5e(),r=N(n);n4(r,{kind:`target`,get nodeType(){return s(c()),K(()=>c().type)},get position(){return s(W1),K(()=>W1.Left)},id:`a`,style:`top: 30px`});var i=g(r,2);n4(i,{kind:`source`,get nodeType(){return s(c()),K(()=>c().type)},get position(){return s(W1),K(()=>W1.Right)}});var l=g(i,2),u=j(l),d=g(j(u)),p=f(d,!0);H(u);var m=g(u,2),h=g(j(m),2);{let e=ze(()=>(s(c()),K(()=>c().delay??1)));hq(h,{nodrag:!0,step:.01,decimals:2,min:0,get value(){return Q(e)},onchange:e=>nu(o(),{delay:e})})}W(2),H(m),H(l),O(e=>Y(p,e),[()=>(Q(a),K(()=>typeof Q(a)==`number`?Q(a).toFixed(2):`â`))]),X(e,n)},$$slots:{default:!0}}),ue(),i()}var _5e=V(`<label class="flex items-center gap-1"><span class="w-12 text-gray-400">radius</span> <!></label>`),v5e=V(`<!> <!> <!> <div class="flex w-full flex-col gap-1"><div class="flex justify-between"><span> </span><span class="font-mono"> </span></div> <p class="text-[10px] text-gray-400">wire two Object Selectors to a/b</p> <!></div>`,1);function f4(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,r),[r,i]=Ve(),a=F(),o=F(),c=F(),l=J(t,`id`,8),u=J(t,`data`,8);d(()=>s(u()),()=>{I(a,u().type===`proximity`)}),d(()=>(n(),s(l())),()=>{I(o,n()[l()])}),d(()=>Q(o),()=>{I(c,Q(o)===void 0?`â`:typeof Q(o)==`boolean`?Q(o)?`near`:`far`:(+Q(o)).toFixed(2))}),h(),R(),r4(e,{get type(){return s(u()),K(()=>u().type)},get label(){return s(u()),K(()=>u().label)},children:(e,t)=>{var n=v5e(),r=N(n);n4(r,{kind:`target`,get nodeType(){return s(u()),K(()=>u().type)},get position(){return s(W1),K(()=>W1.Left)},id:`a`,style:`top: 30px`});var i=g(r,2);n4(i,{kind:`target`,get nodeType(){return s(u()),K(()=>u().type)},get position(){return s(W1),K(()=>W1.Left)},id:`b`,style:`top: 54px`});var o=g(i,2);n4(o,{kind:`source`,get nodeType(){return s(u()),K(()=>u().type)},get position(){return s(W1),K(()=>W1.Right)}});var d=g(o,2),p=j(d),m=j(p),h=f(m,!0),_=g(m),v=f(_,!0);H(p);var y=g(p,4),b=e=>{var t=_5e(),n=g(j(t),2);{let e=ze(()=>(s(u()),K(()=>u().radius??3)));
2466hq(n,{nodrag:!0,step:.01,decimals:2,min:0,get value(){return Q(e)},onchange:e=>nu(l(),{radius:e})})}H(t),X(e,t)};G(y,e=>{Q(a)&&e(b)}),H(d),O(()=>{Y(h,Q(a)?`within`:`dist`),Y(v,Q(c))}),X(e,n)},$$slots:{default:!0}}),ue(),i()}var y5e=V(`<p class="text-[10px] text-gray-400">faces the wired target object/point</p>`),b5e=V(`<label class="flex items-center gap-2"><input class="nodrag h-5 w-7" type="color"/> <span class="text-[10px] text-gray-400">or wire a color</span></label>`),x5e=V(`<label class="flex w-full flex-col gap-0.5"><span class="text-[9px] text-gray-400">uniform</span> <input class="nodrag w-full font-mono text-[10px]" type="text" placeholder="u_c1_value"/></label> <p class="text-[9px] leading-tight text-gray-500">the name shown beside that param in the Shader editor</p>`,1),S5e=V(`<label class="flex items-center gap-2"><input class="nodrag" type="checkbox"/> <span> </span></label> <label class="flex items-center gap-2" title="Outside play mode this node leaves the object alone, so you can hide and show it by hand"><input class="nodrag" type="checkbox"/> <span class="text-[10px] text-gray-400">only while playing</span></label>`,1),C5e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><!></div>`,1);function p4(e,t){Ce(t,!1);let n=F(),r=J(t,`id`,8),i=J(t,`data`,8),a={lookat:`target`,setcolor:`color`,visibility:`on`,setuniform:`value`};d(()=>s(i()),()=>{I(n,a[i().type]??`in`)}),h(),R(),r4(e,{get type(){return s(i()),K(()=>i().type)},get label(){return s(i()),K(()=>i().label)},children:(e,t)=>{var a=C5e(),o=N(a);n4(o,{kind:`target`,get nodeType(){return s(i()),K(()=>i().type)},get position(){return s(W1),K(()=>W1.Left)},get id(){return Q(n)},style:`top: 30px`});var c=g(o,2);n4(c,{kind:`source`,get nodeType(){return s(i()),K(()=>i().type)},get position(){return s(W1),K(()=>W1.Right)}});var l=g(c,2),d=j(l),p=e=>{var t=y5e();X(e,t)},m=e=>{var t=b5e(),n=j(t);v(n),W(2),H(t),O(()=>u(n,(s(i()),K(()=>i().color??`#ff4000`)))),Z(`input`,n,e=>nu(r(),{color:e.currentTarget.value})),X(e,t)},h=e=>{var t=x5e(),n=N(t),a=g(j(n),2);v(a),H(n),W(2),O(()=>u(a,(s(i()),K(()=>i().uniform??``)))),Z(`change`,a,e=>nu(r(),{uniform:e.currentTarget.value})),X(e,t)},_=e=>{var t=S5e(),n=N(t),a=j(n);v(a);var o=g(a,2),c=f(o,!0);H(n);var l=g(n,2),u=j(l);v(u),W(2),H(l),O(()=>{w(a,(s(i()),K(()=>i().on!==!1))),Y(c,(s(i()),K(()=>i().on===!1?`hidden`:`visible`))),w(u,(s(i()),K(()=>!!i().whilePlaying)))}),Z(`change`,a,e=>nu(r(),{on:e.currentTarget.checked})),Z(`change`,u,e=>nu(r(),{whilePlaying:e.currentTarget.checked})),X(e,t)};G(d,e=>{s(i()),K(()=>i().type===`lookat`)?e(p):(s(i()),K(()=>i().type===`setcolor`)?e(m,1):(s(i()),K(()=>i().type===`setuniform`)?e(h,2):(s(i()),K(()=>i().type===`visibility`)&&e(_,3))))}),H(l),X(e,a)},$$slots:{default:!0}}),ue()}var w5e=V(`<option></option>`),T5e=V(`<label class="flex flex-col"><span>marker</span> <input class="nodrag" placeholder="any marker"/> <datalist></datalist></label>`),E5e=V(`<!> <div class="flex w-full flex-col gap-1"><!> <div class="flex items-center gap-2"><span class="h-2.5 w-2.5 rounded-full"></span> <span> </span></div> <p class="text-[10px] text-gray-400"> </p></div>`,1);function m4(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,a),r=()=>z(Nc,`$activeGraphId`,a),i=()=>z(i_,`$animations`,a),[a,o]=Ve(),c=F(),l=F(),p=F(),m=F(),_=F(),y=J(t,`id`,8),x=J(t,`data`,8),S={onclick:[`clicked!`,`connect to the object; pulses on click`],onenter:[`entered!`,`pulses when something enters the sensor object`],onexit:[`exited!`,`pulses when a sensor overlap ends`],ongrab:[`grabbed!`,`pulses when a player picks the object up`],animfinished:[`finished!`,`pulses when the clip on this object reaches its end`],animmarker:[`marker!`,`pulses as the playhead crosses a marker; blank = any`]};d(()=>(n(),s(y())),()=>{I(c,n()[y()]===1)}),d(()=>s(x()),()=>{I(l,S[x().type]??S.onclick)}),d(()=>(r(),Fc),()=>{I(p,r()&&r()!==`scene`?r():null)}),d(()=>i(),()=>{I(m,i())}),d(()=>(Q(p),Q(m),Og),()=>{I(_,Q(p)&&Q(m)[Q(p)]?[...new Set(Og(Q(p)).map(e=>e.name))]:[])}),h(),R(),r4(e,{get type(){return s(x()),K(()=>x().type)},get label(){return s(x()),K(()=>x().label)},children:(e,t)=>{var n=E5e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(x()),K(()=>x().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2),a=j(i),o=e=>{var t=T5e(),n=g(j(t),2);v(n);var r=g(n,2);B(r,5,()=>Q(_),e=>e,(e,t)=>{var n=w5e(),r={};O(()=>{r!==(r=Q(t))&&(n.value=(n.__value=r)??``)}),X(e,n)}),H(r),H(t),O(()=>{b(n,`list`,`animmarker-names-${y()??``}`),u(n,(s(x()),K(()=>x().name??``))),b(r,`id`,`animmarker-names-${y()??``}`)}),Z(`change`,n,e=>nu(y(),{name:e.currentTarget.value.trim()})),X(e,t)};G(a,e=>{s(x()),K(()=>x().type===`animmarker`)&&e(o)});var d=g(a,2),p=j(d),m=g(p,2),h=f(m,!0);H(d);var S=g(d,2),C=f(S,!0);H(i),O(()=>{Ze(p,`background: ${Q(c)?`#22c55e`:`#374151`}`),Y(h,(Q(c),Q(l),K(()=>Q(c)?Q(l)[0]:`idle`))),Y(C,(Q(l),K(()=>Q(l)[1])))}),X(e,n)},$$slots:{default:!0}}),ue(),o()}var D5e=V(`<option> </option>`),O5e=V(`<p class="text-[10px] text-gray-400">â wire an Object Selector into source</p>`),k5e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><label class="flex flex-col"><span>shape</span> <select class="nodrag"></select></label> <!> <label class="flex flex-col"><span class="flex justify-between"><span>scale</span><span> </span></span> <input class="nodrag accent-[#ff4000]" type="range" min="0.25" max="4" step="0.05"/></label> <label class="nodrag flex items-center gap-1.5"><input type="checkbox"/> <span>sensor</span></label> <p class="text-[10px] text-gray-400">overrides the Inspector collider; applies live</p></div>`,1);function A5e(e,t){Ce(t,!1);let n=F(),r=F(),i=J(t,`id`,8),a=J(t,`data`,8);d(()=>s(a()),()=>{I(n,ed(a().type))}),d(()=>Q(n),()=>{I(r,Q(n)?.params?.find(e=>e.key===`shape`)?.options??[`box`])}),h(),R(),r4(e,{get type(){return s(a()),K(()=>a().type)},get label(){return s(a()),K(()=>a().label)},children:(e,t)=>{var n=k5e(),o=N(n);n4(o,{kind:`source`,get nodeType(){return s(a()),K(()=>a().type)},get position(){return s(W1),K(()=>W1.Right)}});var c=g(o,2);n4(c,{kind:`target`,get nodeType(){return s(a()),K(()=>a().type)},get position(){return s(W1),K(()=>W1.Left)},id:`source`,style:`top: 34px`});var l=g(c,2),d=j(l),p=g(j(d),2);B(p,5,()=>Q(r),Be,(e,t)=>
2466{var n=D5e(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(p);var m;_(p),H(d);var h=g(d,2),y=e=>{var t=O5e();X(e,t)};G(h,e=>{s(a()),K(()=>(a().shape??`box`)===`object`)&&e(y)});var b=g(h,2),x=j(b),S=g(j(x)),C=f(S,!0);H(x);var T=g(x,2);v(T),H(b);var E=g(b,2),k=j(E);v(k),W(2),H(E),W(2),H(l),O(e=>{m!==(m=(s(a()),K(()=>a().shape??`box`)))&&(p.value=(p.__value=m)??``,D(p,m)),Y(C,e),u(T,(s(a()),K(()=>a().scale??1))),w(k,(s(a()),K(()=>!!a().sensor)))},[()=>(s(a()),K(()=>(+(a().scale??1)).toFixed(2)))]),Z(`change`,p,e=>nu(i(),{shape:e.currentTarget.value})),Z(`input`,T,e=>nu(i(),{scale:+e.currentTarget.value})),Z(`change`,k,e=>nu(i(),{sensor:e.currentTarget.checked})),X(e,n)},$$slots:{default:!0}}),ue()}var j5e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><span class="rounded-sm bg-gray-900/70 px-1.5 py-0.5 font-mono text-[11px] text-primary-300"> </span> <p class="text-[10px] text-gray-400">object speed; approximate on non-sim peers</p></div>`,1);function M5e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,r),[r,i]=Ve(),a=F(),o=J(t,`id`,8),c=J(t,`data`,8);d(()=>(n(),s(o())),()=>{I(a,typeof n()[o()]==`number`?n()[o()]:0)}),h(),R(),r4(e,{get type(){return s(c()),K(()=>c().type)},get label(){return s(c()),K(()=>c().label)},children:(e,t)=>{var n=j5e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(c()),K(()=>c().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2);n4(i,{kind:`target`,get nodeType(){return s(c()),K(()=>c().type)},get position(){return s(W1),K(()=>W1.Left)},id:`target`,style:`top: 34px`});var o=g(i,2),l=j(o),u=f(l);W(2),H(o),O(e=>Y(u,`${e??``} m/s`),[()=>(Q(a),K(()=>Q(a).toFixed(2)))]),X(e,n)},$$slots:{default:!0}}),ue(),i()}var N5e=V(`<!> <!> <!> <div class="flex w-full flex-col gap-1"><div class="flex justify-between"><span>count</span><span class="font-mono text-sm"> </span></div> <select class="nodrag"><option>count up</option><option>count down</option><option>reset to 0</option></select> <p class="text-[10px] text-gray-400">wire an event into pulse; the second input resets to 0</p></div>`,1);function P5e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,r),[r,i]=Ve(),a=F(),o=J(t,`id`,8),c=J(t,`data`,8);d(()=>(n(),s(o())),()=>{I(a,n()[o()]??0)}),h(),R(),r4(e,{get type(){return s(c()),K(()=>c().type)},get label(){return s(c()),K(()=>c().label)},children:(e,t)=>{var n=N5e(),r=N(n);n4(r,{kind:`target`,get nodeType(){return s(c()),K(()=>c().type)},get position(){return s(W1),K(()=>W1.Left)},id:`pulse`,style:`top: 30px`});var i=g(r,2);n4(i,{kind:`target`,get nodeType(){return s(c()),K(()=>c().type)},get position(){return s(W1),K(()=>W1.Left)},id:`reset`,style:`top: 54px`});var l=g(i,2);n4(l,{kind:`source`,get nodeType(){return s(c()),K(()=>c().type)},get position(){return s(W1),K(()=>W1.Right)}});var u=g(l,2),d=j(u),p=g(j(d)),m=f(p,!0);H(d);var h=g(d,2),v=j(h);v.value=v.__value=`up`;var y=g(v);y.value=y.__value=`down`;var b=g(y);b.value=b.__value=`reset`,H(h);var x;_(h),W(2),H(u),O(()=>{Y(m,Q(a)),x!==(x=(s(c()),K(()=>c().op??`up`)))&&(h.value=(h.__value=x)??``,D(h,x))}),Z(`change`,h,e=>nu(o(),{op:e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),i()}var F5e=V(`<option> </option>`),I5e=V(`<label class="flex items-center gap-1"><input class="nodrag" type="checkbox"/> <span> </span></label>`),L5e=V(`<input class="nodrag h-6 w-full" type="color"/>`),R5e=V(`<div class="flex w-full gap-0.5"></div>`),z5e=V(`<label class="flex w-full flex-col"><span class="text-gray-400">type</span> <select class="nodrag w-full"></select></label> <div class="flex w-full flex-col"><span class="text-gray-400">fallback</span> <!></div>`,1),B5e=V(`<!> <div class="flex w-full flex-col gap-1"><label class="flex w-full flex-col"><span class="text-gray-400">name</span> <input class="nodrag w-full" type="text"/></label> <!></div>`,1);function h4(e,t){Ce(t,!1);let n=J(t,`id`,8),r=J(t,`data`,8),i=[`number`,`boolean`,`vector3`,`color`];function a(e){return e===`boolean`?!1:e===`vector3`?[0,0,0]:e===`color`?`#ffffff`:0}function o(e){nu(n(),{vtype:e,fallback:a(e)})}function c(e,t){let i=Array.isArray(r().fallback)?[...r().fallback]:[0,0,0];i[e]=t,nu(n(),{fallback:i})}R(),r4(e,{get type(){return s(r()),K(()=>r().type)},get label(){return s(r()),K(()=>r().label)},children:(e,t)=>{var a=B5e(),l=N(a),d=e=>{{let t=ze(()=>(s(r()),K(()=>r().vtype??`number`)));n4(e,{kind:`source`,get nodeType(){return s(r()),K(()=>r().type)},get position(){return s(W1),K(()=>W1.Right)},get forceType(){return Q(t)}})}}
2466,p=e=>{n4(e,{kind:`target`,get nodeType(){return s(r()),K(()=>r().type)},id:`value`,get position(){return s(W1),K(()=>W1.Left)},forceType:`any`})};G(l,e=>{s(r()),K(()=>r().type===`flowinput`)?e(d):e(p,-1)});var m=g(l,2),h=j(m),y=g(j(h),2);v(y),H(h);var b=g(h,2),x=e=>{var t=z5e(),a=N(t),l=g(j(a),2);B(l,5,()=>i,e=>e,(e,t)=>{var n=F5e(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(l);var d;_(l),H(a);var p=g(a,2),m=g(j(p),2),h=e=>{var t=I5e(),i=j(t);v(i);var a=g(i,2),o=f(a,!0);H(t),O(()=>{w(i,(s(r()),K(()=>r().fallback===!0))),Y(o,(s(r()),K(()=>r().fallback===!0?`true`:`false`)))}),Z(`change`,i,e=>nu(n(),{fallback:e.currentTarget.checked})),X(e,t)},y=e=>{var t=L5e();v(t),O(()=>u(t,(s(r()),K(()=>typeof r().fallback==`string`?r().fallback:`#ffffff`)))),Z(`change`,t,e=>nu(n(),{fallback:e.currentTarget.value})),X(e,t)},b=e=>{var t=R5e();B(t,6,()=>[`x`,`y`,`z`],e=>e,(e,t,n)=>{{let i=ze(()=>(s(r()),s(Q(n)),K(()=>Array.isArray(r().fallback)?r().fallback[Q(n)]??0:0)));hq(e,{nodrag:!0,step:.01,decimals:2,get title(){return t},get value(){return Q(i)},onchange:e=>c(Q(n),e)})}}),H(t),X(e,t)},x=e=>{{let t=ze(()=>(s(r()),K(()=>typeof r().fallback==`number`?r().fallback:0)));hq(e,{nodrag:!0,step:.01,decimals:2,get value(){return Q(t)},onchange:e=>nu(n(),{fallback:e})})}};G(m,e=>{s(r()),K(()=>(r().vtype??`number`)===`boolean`)?e(h):(s(r()),K(()=>(r().vtype??`number`)===`color`)?e(y,1):(s(r()),K(()=>(r().vtype??`number`)===`vector3`)?e(b,2):e(x,-1)))}),H(p),O(()=>{d!==(d=(s(r()),K(()=>r().vtype??`number`)))&&(l.value=(l.__value=d)??``,D(l,d))}),Z(`change`,l,e=>o(e.currentTarget.value)),X(e,t)};G(b,e=>{s(r()),K(()=>r().type===`flowinput`)&&e(x)}),H(m),O(()=>u(y,(s(r()),K(()=>r().name??(r().type===`flowinput`?`value`:`out`))))),Z(`change`,y,e=>nu(n(),{name:e.currentTarget.value.trim()||`value`})),X(e,a)},$$slots:{default:!0}}),ue()}var V5e=V(`<option> </option>`),H5e=V(`<div class="relative -mx-3 flex h-5 items-center px-3"><!> <span class="max-w-full truncate text-[10px] text-gray-300"> </span></div>`),U5e=V(`<div class="relative -mx-3 flex h-5 items-center justify-end px-3"><span class="max-w-full truncate text-[10px] text-gray-300"> </span> <!></div>`),W5e=V(`<div class="text-center text-[10px] opacity-60">no Flow Input/Output declared</div>`),G5e=V(`<div class="text-center text-[9px] text-gray-500">double-click to open</div>`),K5e=V(`<div class="flex w-full flex-col gap-0.5"><label class="flex w-full flex-col"><span>object</span> <select class="nodrag"><option>â pick a flow â</option><!></select></label> <!> <!> <!> <!></div>`),q5e=V(`<div title="Double-click to open this object's flow"><!></div>`);function J5e(e,t){Ce(t,!1);let n=()=>z(Dc,`$flowGraphs`,a),r=()=>z(Nc,`$activeGraphId`,a),i=()=>z(Ui,`$objectsGroup`,a),[a,o]=Ve(),c=F(),l=F(),u=J(t,`id`,8),p=J(t,`data`,8);function m(){p().flowUuid&&Em(p().flowUuid)}d(()=>(n(),r(),i()),()=>{I(c,Object.keys(n()).filter(e=>e!==`scene`&&e!==r()).map(e=>{let t=i()?.getObjectByProperty?.(`uuid`,e);return{uuid:e,name:t?.name||t?.type||e.slice(0,8)}}))}),d(()=>(n(),s(p())),()=>{I(l,(()=>{let e=n()[p().flowUuid],t=[],r=[];if(e){let n=new Set,i=new Set;for(let a of e.nodes)if(a.type===`flowinput`){let e=a.data?.name??`value`;n.has(e)||(n.add(e),t.push({name:e,vtype:a.data?.vtype??`number`}))}else if(a.type===`flowoutput`){let e=a.data?.name??`out`;i.has(e)||(i.add(e),r.push({name:e}))}}return{inputs:t,outputs:r}})())}),h(),R();var v=q5e(),y=j(v);{let e=ze(()=>(s(p()),K(()=>p().label??`Object Flow`)));r4(y,{type:`objectselector`,get label(){return Q(e)},children:(e,t)=>{var n=K5e(),r=j(n),i=g(j(r),2),a=j(i);a.value=a.__value=``;var o=g(a);B(o,1,()=>Q(c),e=>e.uuid,(e,t)=>{var n=V5e(),r=f(n,!0),i={};O(()=>{Y(r,(Q(t),K(()=>Q(t).name))),i!==(i=(Q(t),K(()=>Q(t).uuid)))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(i);var d;_(i),H(r);var m=g(r,2);B(m,1,()=>(Q(l),K(()=>Q(l).inputs)),e=>e.name,(e,t)=>{var n=H5e(),r=j(n);n4(r,{kind:`target`,nodeType:`objectflow`,get id(){return Q(t),K(()=>Q(t).name)},get position(){return s(W1),K(()=>W1.Left)},get forceType(){return Q(t),K(()=>Q(t).vtype)},style:`top: 50%;`});var i=g(r,2),a=f(i,!0);H(n),O(()=>Y(a,(Q(t),K(()=>Q(t).name)))),X(e,n)});var h=g(m,2);B(h,1,()=>(Q(l),K(()=>Q(l).outputs)),e=>e.name,(e,t)=>{var n=U5e(),r=j(n),i=f(r,!0);n4(g(r,2),{kind:`source`,nodeType:`objectflow`,get id(){return Q(t),K(()=>Q(t).name)},get position(){return s(W1),K(()=>W1.Right)},forceType:`any`,style:`top: 50%;`}),H(n),O(()=>Y(i,(Q(t),K(()=>Q(t).name)))),X(e,n)});var v=g(h,2),y=e=>{var t=W5e();X(e,t)};G(v,e=>{s(p()),Q(l),K(()=>p().flowUuid&&!Q(l).inputs.length&&!Q(l).outputs.length)&&e(y)});var b=g(v,2),x=e=>{var t=G5e();X(e,t)};G(b,e=>{s(p()),K(()=>p().flowUuid)&&e(x)}),H(n),O(()=>{d!==(d=(s(p()),K(()=>p().flowUuid??``)))&&(i.value=(i.__value=d)??``,D(i,d))}),Z(`change`,i,e=>nu(u(),{flowUuid:e.currentTarget.value})),X(e,n)},$$slots:{default:!0}})}H(v),Z(`dblclick`,v,k(m)),X(e,v),ue(),o()}var Y5e=V(`<option> </option>`),X5e=V(`<!> <div class="flex w-full flex-col gap-1"><button>
2466 </button> <label class="flex w-full flex-col"><span class="text-gray-400">edge</span> <select class="nodrag rounded-sm border border-gray-600 bg-transparent px-1 py-0.5 text-xs"></select></label> <label class="flex w-full flex-col"><span class="text-gray-400">pulse (s)</span> <!></label></div>`,1);function Z5e(e,t){Ce(t,!1);let n=J(t,`id`,8),i=J(t,`data`,8),a=F(!1);function o(e){e.preventDefault(),e.stopPropagation(),I(a,!1),nu(n(),{code:e.code})}R(),r4(e,{get type(){return s(i()),K(()=>i().type)},get label(){return s(i()),K(()=>i().label)},children:(e,t)=>{var c=X5e(),l=N(c);n4(l,{kind:`source`,get nodeType(){return s(i()),K(()=>i().type)},get position(){return s(W1),K(()=>W1.Right)}});var u=g(l,2),d=j(u),p=f(d,!0),m=g(d,2),h=g(j(m),2);B(h,4,()=>[`down`,`up`,`held`],e=>e,(e,t)=>{var n=Y5e(),r=f(n,!0),i={};O(()=>{Y(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(h);var v;_(h),H(m);var y=g(m,2),b=g(j(y),2);{let e=ze(()=>(s(i()),K(()=>i().pulse??.3)));hq(b,{nodrag:!0,step:.01,decimals:2,min:.1,get value(){return Q(e)},onchange:e=>nu(n(),{pulse:e})})}H(y),H(u),O(()=>{r(d,1,`nodrag w-full rounded-sm border border-gray-600 px-1 py-0.5 text-xs ${Q(a)?`bg-primary-700 text-white`:``}`),Y(p,(Q(a),s(i()),K(()=>Q(a)?`press a keyâ¦`:i().code??`KeyR`))),v!==(v=(s(i()),K(()=>i().edge??`down`)))&&(h.value=(h.__value=v)??``,D(h,v))}),Z(`click`,d,()=>I(a,!0)),Z(`keydown`,d,function(...e){(Q(a)?o:void 0)?.apply(this,e)}),Z(`blur`,d,()=>I(a,!1)),Z(`change`,h,e=>nu(n(),{edge:e.currentTarget.value})),X(e,c)},$$slots:{default:!0}}),ue()}var g4=V(`<option> </option>`),Q5e=V(`<label class="flex w-full flex-col"><span class="text-gray-400">button</span> <select class="nodrag rounded-sm border border-gray-600 bg-transparent px-1 py-0.5 text-xs"></select></label> <button> </button> <label class="flex w-full flex-col"><span class="text-gray-400">edge</span> <select class="nodrag rounded-sm border border-gray-600 bg-transparent px-1 py-0.5 text-xs"></select></label> <label class="flex w-full flex-col"><span class="text-gray-400">pulse (s)</span> <!></label> <p class="text-[10px] text-gray-400">presses replicate as trigger stamps, like a key</p>`,1),$5e=V(`<label class="flex w-full flex-col"><span class="text-gray-400">axis</span> <select class="nodrag rounded-sm border border-gray-600 bg-transparent px-1 py-0.5 text-xs"></select></label> <span class="rounded-sm bg-gray-900/70 px-1.5 py-0.5 font-mono text-[11px] text-primary-300"> </span> <label class="flex w-full flex-col"><span class="text-gray-400">deadzone</span> <!></label> <label class="flex w-full flex-col"><span class="text-gray-400">scale</span> <!></label> <label class="flex w-full items-center gap-1"><input type="checkbox" class="nodrag"/> <span class="text-gray-400">invert</span></label> <p class="text-[10px] text-gray-400">local to this player â peers do not see this value</p>`,1),e7e=V(`<p class="text-[10px] text-amber-400">no gamepad detected</p>`),t7e=V(`<!> <div class="flex w-full flex-col gap-1"><!> <!></div>`,1);function _4(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,i),[i,a]=Ve(),o=F(),c=F(),l=J(t,`id`,8),u=J(t,`data`,8),p=F(!1),m=null;function y(){I(p,!1),m?.(),m=null}function b(){if(Q(p))return y();I(p,!0),m=nb((e,t)=>{e===`down`&&t.startsWith(`Gamepad`)&&(nu(l(),{button:t}),y())})}Pe(y);let x=e=>Jpe(),S=e=>String(e??``).replace(/^Gamepad/,``);d(()=>(n(),s(l())),()=>{I(o,typeof n()[l()]==`number`?n()[l()]:0)}),d(()=>n(),()=>{I(c,x(n()))}),h(),R(),r4(e,{get type(){return s(u()),K(()=>u().type)},get label(){return s(u()),K(()=>u().label)},children:(e,t)=>{var n=t7e(),i=N(n);n4(i,{kind:`source`,get nodeType(){return s(u()),K(()=>u().type)},get position(){return s(W1),K(()=>W1.Right)}});var a=g(i,2),d=j(a),m=e=>{var t=Q5e(),n=N(t),i=g(j(n),2);B(i,5,()=>yne,e=>e,(e,t)=>{var n=g4(),r=f(n,!0),i={};O(e=>{Y(r,e),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)},[()=>(Q(t),K(()=>S(Q(t))))]),X(e,n)}),H(i);var a;_(i),H(n);var o=g(n,2),c=f(o,!0),d=g(o,2),m=g(j(d),2);B(m,4,()=>[`down`,`up`,`held`],e=>e,(e,t)=>{var n=g4(),r=f(n,!0),i={};O(()=>{Y(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(m);var h;_(m),H(d);var v=g(d,2),y=g(j(v),2);{let e=ze(()=>(s(u()),K(()=>u().pulse??.3)));
2466hq(y,{nodrag:!0,step:.01,decimals:2,min:.1,get value(){return Q(e)},onchange:e=>nu(l(),{pulse:e})})}H(v),W(2),O(()=>{a!==(a=(s(u()),K(()=>u().button??`GamepadA`)))&&(i.value=(i.__value=a)??``,D(i,a)),r(o,1,`nodrag w-full rounded-sm border border-gray-600 px-1 py-0.5 text-xs ${Q(p)?`bg-primary-700 text-white`:``}`),Y(c,Q(p)?`press a buttonâ¦`:`capture`),h!==(h=(s(u()),K(()=>u().edge??`down`)))&&(m.value=(m.__value=h)??``,D(m,h))}),Z(`change`,i,e=>nu(l(),{button:e.currentTarget.value})),Z(`click`,o,b),Z(`change`,m,e=>nu(l(),{edge:e.currentTarget.value})),X(e,t)},h=e=>{var t=$5e(),n=N(t),r=g(j(n),2);B(r,5,()=>vne,e=>e,(e,t)=>{var n=g4(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(r);var i;_(r),H(n);var a=g(n,2),c=f(a,!0),d=g(a,2),p=g(j(d),2);{let e=ze(()=>(s(u()),K(()=>u().deadzone??0)));hq(p,{nodrag:!0,step:.01,decimals:2,min:0,max:.9,get value(){return Q(e)},onchange:e=>nu(l(),{deadzone:e})})}H(d);var m=g(d,2),h=g(j(m),2);{let e=ze(()=>(s(u()),K(()=>u().scale??1)));hq(h,{nodrag:!0,step:.1,decimals:2,get value(){return Q(e)},onchange:e=>nu(l(),{scale:e})})}H(m);var y=g(m,2),b=j(y);v(b),W(2),H(y),W(2),O(e=>{i!==(i=(s(u()),K(()=>u().axis??`lx`)))&&(r.value=(r.__value=i)??``,D(r,i)),Y(c,e),w(b,(s(u()),K(()=>!!u().invert)))},[()=>(Q(o),K(()=>Q(o).toFixed(2)))]),Z(`change`,r,e=>nu(l(),{axis:e.currentTarget.value})),Z(`change`,b,e=>nu(l(),{invert:e.currentTarget.checked})),X(e,t)};G(d,e=>{s(u()),K(()=>u().type===`gamepadbutton`)?e(m):e(h,-1)});var y=g(d,2),x=e=>{var t=e7e();X(e,t)};G(y,e=>{Q(c)||e(x)}),H(a),X(e,n)},$$slots:{default:!0}}),ue(),a()}var n7e=V(`<option></option>`),r7e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><label class="flex flex-col"><span>clip</span> <input class="nodrag" placeholder="default clip"/> <datalist></datalist></label> <label class="flex flex-col"><span>on trigger</span> <select class="nodrag"><option>toggle</option><option>play</option><option>stop</option><option>restart</option></select></label> <label class="flex flex-col"><span class="flex justify-between"><span>speed</span><span> </span></span> <input class="nodrag accent-[#ff4000]" type="range" min="0.1" max="4" step="0.1"/></label> <div class="flex items-center gap-2"><span class="h-2.5 w-2.5 rounded-full"></span> <span class="text-[10px] text-gray-400"> </span></div></div>`,1);function i7e(e,t){Ce(t,!1);let n=()=>z(Nc,`$activeGraphId`,o),r=()=>z(i_,`$animations`,o),i=()=>z(Cg,`$animatedObjects`,o),a=()=>z(Ng,`$playback`,o),[o,c]=Ve(),l=F(),p=F(),m=F(),y=F(),x=F(),S=J(t,`id`,8),C=J(t,`data`,8);d(()=>(n(),Fc),()=>{I(l,n()&&n()!==`scene`?n():null)}),d(()=>r(),()=>{I(p,r())}),d(()=>i(),()=>{I(m,i())}),d(()=>(Q(l),Q(p),Q(m),Tg),()=>{I(y,Q(l)?[...Q(p)[Q(l)]?Ig(Q(l)).map(e=>e.name):[],...Q(m)[Q(l)]?Tg(Q(l)).map(e=>e.name):[]]:[])}),d(()=>(Q(l),a()),()=>{I(x,!!(Q(l)&&a()[Q(l)]?.playing))}),h(),R(),r4(e,{get type(){return s(C()),K(()=>C().type)},get label(){return s(C()),K(()=>C().label)},children:(e,t)=>{var n=r7e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(C()),K(()=>C().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2);n4(i,{kind:`target`,get nodeType(){return s(C()),K(()=>C().type)},get position(){return s(W1),K(()=>W1.Left)},id:`trigger`,style:`top: 34px`});var a=g(i,2),o=j(a),c=g(j(o),2);v(c);var l=g(c,2);B(l,5,()=>Q(y),e=>e,(e,t)=>{var n=n7e(),r={};O(()=>{r!==(r=Q(t))&&(n.value=(n.__value=r)??``)}),X(e,n)}),H(l),H(o);var d=g(o,2),p=g(j(d),2),m=j(p);m.value=m.__value=`toggle`;var h=g(m);h.value=h.__value=`play`;var w=g(h);w.value=w.__value=`stop`;var T=g(w);T.value=T.__value=`restart`,H(p);var E;_(p),H(d);var k=g(d,2),A=j(k),ee=g(j(A)),M=f(ee);H(A);var te=g(A,2);v(te),H(k);var ne=g(k,2),P=j(ne),re=g(P,2),ie=f(re,!0);H(ne),H(a),O(e=>{b(c,`list`,`playanim-clips-${S()??``}`),u(c,(s(C()),K(()=>C().clip??``))),b(l,`id`,`playanim-clips-${S()??``}`),E!==(E=(s(C()),K(()=>C().action??`toggle`)))&&(p.value=(p.__value=E)??``,D(p,E)),Y(M,`${e??``}Ã`),u(te,(s(C()),K(()=>C().speed??1))),Ze(P,`background: ${Q(x)?`#22c55e`:`#374151`}`),Y(ie,Q(x)?`playing`:`idle`)},[()=>(s(C()),K(()=>(C().speed??1).toFixed(1)))]),Z(`change`,c,e=>nu(S(),{clip:e.currentTarget.value.trim()})),Z(`change`,p,e=>nu(S(),{action:e.currentTarget.value})),Z(`input`,te,e=>nu(S(),{speed:+e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),c()}var a7e=V(`<option></option>`),o7e=V(`<!> <!> <div class="flex w-full flex-col gap-1"><label class="flex flex-col"><span>clip</span> <input class="nodrag" placeholder="any clip"/> <datalist></datalist></label> <label class="flex flex-col"><span>read</span> <select class="nodrag"><option>progress (0-1)</option><option>playing (1/0)</option><option>position (s)</option><option>duration (s)</option><option>remaining (s)</option></select></label> <div class="flex items-center gap-2"><span class="h-2.5 w-2.5 rounded-full"></span> <span class="rounded-sm bg-gray-900/70 px-1.5 py-0.5 font-mono text-[11px] text-primary-300"> </span></div></div>`,1);function s7e(e,t){Ce(t,!1);let n=()=>z(Nc,`$activeGraphId`,o),r=()=>z(i_,`$animations`,o),i=()=>z(kc,`$flowValues`,o),a=()=>z(Ng,`$playback`,o),[o,c]=Ve(),l=F(),p=F(),m=F(),y=F(),x=F(),S=F(),C=F(),w=J(t,`id`,8),T=J(t,`data`,8);d(()=>(n(),Fc),()=>
2466{I(l,n()&&n()!==`scene`?n():null)}),d(()=>r(),()=>{I(p,r())}),d(()=>(Q(l),Q(p),Ig),()=>{I(m,Q(l)&&Q(p)[Q(l)]?Ig(Q(l)).map(e=>e.name):[])}),d(()=>s(T()),()=>{I(y,T().read??`progress`)}),d(()=>(i(),s(w())),()=>{I(x,typeof i()[w()]==`number`?i()[w()]:0)}),d(()=>(Q(l),a()),()=>{I(S,!!(Q(l)&&a()[Q(l)]?.playing))}),d(()=>(Q(y),Q(x)),()=>{I(C,Q(y)===`playing`?Q(x)?`yes`:`no`:Q(y)===`progress`?Q(x).toFixed(3):Q(x).toFixed(2)+`s`)}),h(),R(),r4(e,{get type(){return s(T()),K(()=>T().type)},get label(){return s(T()),K(()=>T().label)},children:(e,t)=>{var n=o7e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(T()),K(()=>T().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2);n4(i,{kind:`target`,get nodeType(){return s(T()),K(()=>T().type)},get position(){return s(W1),K(()=>W1.Left)},id:`target`,style:`top: 34px`});var a=g(i,2),o=j(a),c=g(j(o),2);v(c);var l=g(c,2);B(l,5,()=>Q(m),e=>e,(e,t)=>{var n=a7e(),r={};O(()=>{r!==(r=Q(t))&&(n.value=(n.__value=r)??``)}),X(e,n)}),H(l),H(o);var d=g(o,2),p=g(j(d),2),h=j(p);h.value=h.__value=`progress`;var x=g(h);x.value=x.__value=`playing`;var E=g(x);E.value=E.__value=`position`;var k=g(E);k.value=k.__value=`duration`;var A=g(k);A.value=A.__value=`remaining`,H(p);var ee;_(p),H(d);var M=g(d,2),te=j(M),ne=g(te,2),P=f(ne,!0);H(M),H(a),O(()=>{b(c,`list`,`animstate-clips-${w()??``}`),u(c,(s(T()),K(()=>T().clip??``))),b(l,`id`,`animstate-clips-${w()??``}`),ee!==(ee=Q(y))&&(p.value=(p.__value=ee)??``,D(p,ee)),Ze(te,`background: ${Q(S)?`#22c55e`:`#374151`}`),Y(P,Q(C))}),Z(`change`,c,e=>nu(w(),{clip:e.currentTarget.value.trim()})),Z(`change`,p,e=>nu(w(),{read:e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),c()}var c7e=V(`<option> </option>`),l7e=V(`<!> <div class="flex w-full flex-col gap-1"><div class="flex items-center gap-2"><span class="h-2.5 w-2.5 rounded-full"></span> <span> </span></div> <div class="flex items-center gap-1"><span class="w-14 shrink-0 text-[10px] text-gray-400">min m/s</span> <!></div> <label class="flex items-center gap-1"><span class="w-14 shrink-0 text-[10px] text-gray-400">who</span> <select class="nodrag flex-1 rounded bg-gray-700 px-1 text-[11px]"></select></label> <div class="relative -mx-3 flex h-5 items-center gap-1 px-3"><span class="text-[10px] text-gray-300">speed</span> <span class="ml-auto font-mono text-[10px] text-gray-400"> </span> <!></div> <div class="relative -mx-3 flex h-5 items-center gap-1 px-3"><span class="text-[10px] text-gray-300">by me</span> <span> </span> <!></div> <p class="text-[10px] text-gray-400">connect to the object; pulses when a hand or player knocks it</p></div>`,1);function u7e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,i),[i,a]=Ve(),o=F(),c=F(),l=F(),u=J(t,`id`,8),p=J(t,`data`,8),m=[`anyone`,`me`,`others`];d(()=>(n(),s(u())),()=>{I(o,n()[u()])}),d(()=>Q(o),()=>{I(c,Q(o)?.__default===1)}),d(()=>Q(o),()=>{I(l,Q(o)?.__handles??{})}),h(),R(),r4(e,{get type(){return s(p()),K(()=>p().type)},get label(){return s(p()),K(()=>p().label)},children:(e,t)=>{var n=l7e(),i=N(n);n4(i,{kind:`source`,get nodeType(){return s(p()),K(()=>p().type)},get position(){return s(W1),K(()=>W1.Right)}});var a=g(i,2),o=j(a),d=j(o),h=g(d,2),v=f(h,!0);H(o);var y=g(o,2),b=g(j(y),2);{let e=ze(()=>(s(p()),K(()=>p().minSpeed??0)));hq(b,{nodrag:!0,step:.1,decimals:1,min:0,max:10,get value(){return Q(e)},onchange:e=>nu(u(),{minSpeed:e})})}H(y);var x=g(y,2),S=g(j(x),2);B(S,5,()=>m,e=>e,(e,t)=>{var n=c7e(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(S);var C;_(S),H(x);var w=g(x,2),T=g(j(w),2),E=f(T,!0);n4(g(T,2),{kind:`source`,get nodeType(){return s(p()),K(()=>p().type)},get position(){return s(W1),K(()=>W1.Right)},id:`speed`,forceType:`number`,style:`top: 50%;`}),H(w);var k=g(w,2),A=g(j(k),2);let ee;var M=f(A,!0);n4(g(A,2),{kind:`source`,get nodeType(){return s(p()),K(()=>p().type)},get position(){return s(W1),K(()=>W1.Right)},id:`byMe`,forceType:`boolean`,style:`top: 50%;`}),H(k),W(2),H(a),O(e=>{Ze(d,`background: ${Q(c)?`#22c55e`:`#374151`}`),Y(v,Q(c)?`hit!`:`idle`),C!==(C=(s(p()),K(()=>p().who??`anyone`)))&&(S.value=(S.__value=C)??``,D(S,C)),Y(E,e),ee=r(A,1,`ml-auto font-mono text-[10px]`,null,ee,{"text-primary-300":!!Q(l).byMe,"text-gray-400":!Q(l).byMe}),Y(M,(Q(l),K(()=>Q(l).byMe?`yes`:`no`)))},[()=>(Q(l),K(()=>(+(Q(l).speed??0)).toFixed(2)))]),Z(`change`,S,e=>nu(u(),{who:e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),a()}var d7e=V(`<option> </option>`),f7e=V(`<!> <div class="flex w-full flex-col gap-1"><div class="relative -mx-3 flex h-5 items-center gap-1 px-3"><!> <span class="text-[10px] text-gray-300">enabled</span></div> <div class="flex items-center gap-2"><span class="h-2.5 w-2.5 rounded-full"></span> <span> </span></div> <label class="flex items-center gap-1"><span class="w-14 shrink-0 text-[10px] text-gray-400">who</span> <select class="nodrag flex-1 rounded bg-gray-700 px-1 text-[11px]"></select></label> <div class="relative -mx-3 flex h-5 items-center gap-1 px-3"><span class="text-[10px] text-gray-300">point</span> <span class="ml-auto font-mono text-[10px] text-gray-400"> </span> <!></div> <div class="relative -mx-3 flex h-5 items-center gap-1 px-3"><span class="text-[10px] text-gray-300">by me</span> <span> </span> <!></div> <p class="text-[10px] text-gray-400">VR: bring both hands together and hold â the point is where they met</p></div>`,1);function p7e(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,i),[i,a]=Ve(),o=F(),c=F(),l=F(),u=F(),p=J(t,`id`,8),m=J(t,`data`,8),v=[`anyone`,`me`];d(()=>(n(),s(p())),()=>{I(o,n()[p()])}),d(()=>Q(o),()=>{I(c,Q(o)?.__default===1)}),d(()=>Q(o),()=>{I(l,Q(o)?.__handles??{})}),d(()=>Q(l),()=>{I(u,Array.isArray(Q(l).point)?Q(l).point:[0,0,0])}),h(),R(),r4(e,{get type(){return s(m()),K(()=>m().type)},get label(){return s(m()),K(()=>m().label)},children:(e,t)=>{var n=f7e(),i=N(n);n4(i,{kind:`source`,get nodeType(){return s(m()),K(()=>m().type)},get position(){return s(W1),K(()=>W1.Right)}});var a=g(i,2),o=j(a);n4(j(o),{kind:`target`,get nodeType(){return s(m()),K(()=>m().type)},get position(){return s(W1),K(()=>W1.Left)},id:`enabled`,style:`top: 50%;`}),W(2),H(o);var d=g(o,2),h=j(d),y=g(h,2),b=f(y,!0);H(d);var x=g(d,2),S=g(j(x),2);B(S,5,()=>v,e=>e,(e,t)=>{var n=d7e(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(S);
2466var C;_(S),H(x);var w=g(x,2),T=g(j(w),2),E=f(T,!0);n4(g(T,2),{kind:`source`,get nodeType(){return s(m()),K(()=>m().type)},get position(){return s(W1),K(()=>W1.Right)},id:`point`,forceType:`vector3`,style:`top: 50%;`}),H(w);var k=g(w,2),A=g(j(k),2);let ee;var M=f(A,!0);n4(g(A,2),{kind:`source`,get nodeType(){return s(m()),K(()=>m().type)},get position(){return s(W1),K(()=>W1.Right)},id:`byMe`,forceType:`boolean`,style:`top: 50%;`}),H(k),W(2),H(a),O(e=>{Ze(h,`background: ${Q(c)?`#22c55e`:`#374151`}`),Y(b,Q(c)?`clap!`:`idle`),C!==(C=(s(m()),K(()=>m().who??`anyone`)))&&(S.value=(S.__value=C)??``,D(S,C)),Y(E,e),ee=r(A,1,`ml-auto font-mono text-[10px]`,null,ee,{"text-primary-300":!!Q(l).byMe,"text-gray-400":!Q(l).byMe}),Y(M,(Q(l),K(()=>Q(l).byMe?`yes`:`no`)))},[()=>(Q(u),K(()=>Q(u).map(e=>(+e).toFixed(1)).join(`, `)))]),Z(`change`,S,e=>nu(p(),{who:e.currentTarget.value})),X(e,n)},$$slots:{default:!0}}),ue(),a()}var m7e=V(`<label class="flex items-center gap-1"><span class="w-14 shrink-0 text-[10px] text-gray-400">min m/s</span> <input class="nodrag flex-1" type="range" min="0" max="10" step="0.1"/> <span class="w-6 text-right font-mono text-[10px] text-gray-400"> </span></label>`),h7e=V(`<!> <div class="flex w-full flex-col gap-1"><div class="relative -mx-3 flex h-5 items-center gap-1 px-3"><!> <span class="text-[10px] text-gray-300">only with</span></div> <div class="flex items-center gap-2"><span class="h-2.5 w-2.5 rounded-full"></span> <span> </span></div> <!> <div class="relative -mx-3 flex h-5 items-center gap-1 px-3"><span class="text-[10px] text-gray-300">other</span> <span class="ml-auto max-w-[80px] truncate font-mono text-[10px] text-gray-400"> </span> <!></div></div>`,1);function v4(e,t){Ce(t,!1);let n=()=>z(kc,`$flowValues`,i),r=()=>z(Ui,`$objectsGroup`,i),[i,a]=Ve(),o=F(),c=F(),l=F(),p=F(),m=F(),_=F(),y=J(t,`id`,8),b=J(t,`data`,8);d(()=>(n(),s(y())),()=>{I(o,n()[y()])}),d(()=>Q(o),()=>{I(c,(Q(o)&&typeof Q(o)==`object`?Q(o).__default:Q(o))===1)}),d(()=>Q(o),()=>{I(l,Q(o)&&typeof Q(o)==`object`?Q(o).__handles?.other??``:``)}),d(()=>(Q(l),r()),()=>{I(p,Q(l)?r()?.getObjectByProperty?.(`uuid`,Q(l))?.name??Q(l).slice(0,8):`â`)}),d(()=>s(b()),()=>{I(m,b().type===`onimpact`)}),d(()=>(Q(m),s(b())),()=>{I(_,Q(m)?`impact!`:b().type===`onexit`?`left`:`entered`)}),h(),R(),r4(e,{get type(){return s(b()),K(()=>b().type)},get label(){return s(b()),K(()=>b().label)},children:(e,t)=>{var n=h7e(),r=N(n);n4(r,{kind:`source`,get nodeType(){return s(b()),K(()=>b().type)},get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2),a=j(i);n4(j(a),{kind:`target`,get nodeType(){return s(b()),K(()=>b().type)},get position(){return s(W1),K(()=>W1.Left)},id:`filter`,style:`top: 50%;`}),W(2),H(a);var o=g(a,2),l=j(o),d=g(l,2),h=f(d,!0);H(o);var x=g(o,2),S=e=>{var t=m7e(),n=g(j(t),2);v(n);var r=g(n,2),i=f(r,!0);H(t),O(e=>{u(n,(s(b()),K(()=>b().minStrength??1))),Y(i,e)},[()=>(s(b()),K(()=>(+(b().minStrength??1)).toFixed(1)))]),Z(`change`,n,e=>nu(y(),{minStrength:+e.currentTarget.value})),X(e,t)};G(x,e=>{Q(m)&&e(S)});var C=g(x,2),w=g(j(C),2),T=f(w,!0);n4(g(w,2),{kind:`source`,get nodeType(){return s(b()),K(()=>b().type)},get position(){return s(W1),K(()=>W1.Right)},id:`other`,forceType:`object`,style:`top: 50%;`}),H(C),H(i),O(()=>{Ze(l,`background: ${Q(c)?`#22c55e`:`#374151`}`),Y(h,Q(c)?Q(_):`idle`),Y(T,Q(p))}),X(e,n)},$$slots:{default:!0}}),ue(),a()}var g7e=V(`<span class="text-[10px] text-gray-400">Provided by <span class="font-mono"> </span></span>`),_7e=V(`<div class="flex w-full max-w-[190px] flex-col gap-1.5"><span class="text-[10px] leading-snug text-yellow-300">
2466This node comes from a module that isn't installed.</span> <!> <span class="text-[10px] leading-snug text-gray-500">It is kept exactly as saved, so installing the module brings it back to life.</span> <button class="nodrag rounded-sm bg-yellow-600/80 px-2 py-0.5 text-[10px] font-semibold text-white hover:bg-yellow-600">Install module</button></div>`);function v7e(e,t){Ce(t,!1);let n=F(),r=J(t,`data`,8);d(()=>s(r()),()=>{I(n,ime(r()?.type??``))}),h(),R();{let t=ze(()=>(s(r()),K(()=>r()?.type??`unknown`))),i=ze(()=>(s(r()),K(()=>`â `+(r()?.type??`unknown`))));r4(e,{get type(){return Q(t)},get label(){return Q(i)},accent:`#facc15`,children:(e,t)=>{var r=_7e(),i=g(j(r),2),a=e=>{var t=g7e(),r=g(j(t)),i=f(r,!0);H(t),O(()=>Y(i,Q(n))),X(e,t)};G(i,e=>{Q(n)&&e(a)});var o=g(i,4);H(r),L(`click`,o,()=>Oo.set(!0)),X(e,r)},$$slots:{default:!0}})}ue()}ge([`click`]);var y7e=V(`<div class="flex h-full w-40 shrink-0 flex-col overflow-hidden"><!> <div class="min-h-0 flex-1 overflow-y-auto"><!></div></div>`),b7e=V(`<button id="flow-scope-scene" class="pointer-events-auto rounded-full border border-gray-700/60 bg-gray-800/85 px-2 py-0.5 text-xs text-gray-400 backdrop-blur-sm hover:text-gray-100" title="Back to the Scene flow (deselects the object)">â Scene</button>`),x7e=V(`<button id="flow-scope-delete" class="pointer-events-auto rounded-full border border-gray-700/60 bg-gray-800/85 px-2 py-0.5 text-xs text-gray-400 backdrop-blur-sm hover:text-red-400" title="Delete this object's flow"><!></button>`),S7e=V(`<button id="flow-unknown-badge" class="pointer-events-auto rounded-full border border-yellow-600/60 bg-yellow-900/40 px-2.5 py-0.5 text-xs font-semibold text-yellow-300 backdrop-blur-sm hover:bg-yellow-900/70" title="These nodes come from a module that isn't installed â click to open Modules"> </button>`),C7e=V(`<div id="flow-empty-state" class="absolute inset-0 z-5 flex flex-col items-center justify-center gap-3 bg-gray-900/60 backdrop-blur-[2px]"><p class="text-sm text-gray-300"><span class="font-semibold text-gray-100"> </span> has no flow yet</p> <button id="flow-create-btn" class="rounded-lg bg-primary-700 px-4 py-2 text-sm font-medium text-white hover:bg-primary-600">Create flow</button> <p class="text-[11px] text-gray-500">Nodes here will drive this object (no Object Selector needed)</p></div>`),w7e=V(`<!> <!> <!>`,1),T7e=V(`<p id="flow-node-doc" class="text-[11px] leading-snug text-gray-400"> </p>`),E7e=V(`<label class="flex items-center justify-between gap-2">Min <input id="param-slider-min" class="ui-input w-16" type="number"/></label> <label class="flex items-center justify-between gap-2">Max <input id="param-slider-max" class="ui-input w-16" type="number"/></label>`,1),D7e=V(`<div class="flex items-center gap-1"><input class="ui-input flex-1"/> <button class="rounded-sm bg-gray-600 px-1.5 hover:bg-red-700" title="Remove item">â</button></div>`),O7e=V(`<!> <button id="param-switcher-add" class="rounded-sm bg-gray-600 px-2 py-1 hover:bg-gray-500">ï¼ Add item</button>`,1),k7e=V(`<label class="flex items-center justify-between gap-2">Step <input id="param-number-step" class="ui-input w-16" type="number" min="0"/></label>`),A7e=V(`<p class="text-gray-400">This node's parameters live on its card.</p>`),j7e=V(`<p class="ui-section-label"> </p> <!> <!>`,1),M7e=V(`<p class="text-gray-400">Select a node to edit its parameters.</p>`),N7e=V(`<p class="ui-section-label">Node</p> <label class="flex flex-col gap-1">Name <input id="flow-node-name" class="ui-input"/></label> <label class="flex flex-col gap-1">Note <textarea class="ui-input" rows="2"></textarea></label>`,1),P7e=V(`<span class="flex items-center gap-1"><span class="inline-block h-2 w-2 rounded-full"></span> </span>`),F7e=V(`<p class="ui-section-label">Graph</p> <label class="flex flex-col gap-1">Edge style <!></label> <label class="flex flex-col gap-1">Background <!></label> <label class="flex items-center gap-2"><input id="flow-minimap-toggle" type="checkbox"/> Minimap</label> <label class="flex items-center gap-2"><input type="checkbox"/> Snap to grid</label> <label class="flex items-center gap-2">Grid size <input class="ui-input w-16" type="number" min="1"/></label> <div class="mt-1 flex gap-1"><button id="flow-fit" class="rounded-sm bg-gray-600 px-2 py-1 hover:bg-gray-500">Fit</button> <button id="flow-reset-view" class="rounded-sm bg-gray-600 px-2 py-1 hover:bg-gray-500">Reset view</button></div> <p class="ui-section-label mt-1">Socket types</p> <div id="socket-legend" class="flex flex-wrap gap-x-2 gap-y-0.5 text-[10px] text-gray-300"></div>`,1),I7e=V(`<div id="flow-props" class="flex h-full w-52 shrink-0 flex-col gap-2 overflow-y-auto bg-gray-800 p-2 text-xs text-gray-200"><div class="flex gap-1"><button id="flow-tab-info">â Params</button> <button id="flow-tab-settings">â Settings</button></div> <!></div>`),L7e=V(`<div class="flex h-full w-full"><!> <div class="relative z-10 w-0" style="order: 2"><button id="palette-toggle"> </button> <button id="palette-side" title="Move the palette to the other side">â</button></div> <div class="svelteFlow relative h-full grow"><div id="flow-scope-chip" class="pointer-events-none absolute left-1/2 top-2 z-10 flex -translate-x-1/2 items-center gap-1.5"><!> <span class="pointer-events-auto rounded-full border border-gray-700/60 bg-gray-800/85 px-2.5 py-0.5 text-xs text-gray-200 backdrop-blur-sm"> </span> <!> <!></div> <!> <!> <!></div> <div class="relative z-10 w-0"><button id="flow-props-toggle">â</button></div> <!></div> <!>`,1);function y4(e,n){Ce(n,!0);let i=()=>z(qo,`$flowFocus`,x),a=()=>z(Oc,`$flowNodesStore`,x),o=()=>z(cl,`$moduleNodeGroups`,x),s=()=>z(Dc,`$flowGraphs`,x),c=()=>z(BY,`$flowMouseBindings`,x),l=()=>z(Kr,`$selectedObjects`,x),d=()=>z(Di,`$selectedObject`,x),p=()=>z(Nc,`$activeGraphId`,x),m=()=>z(Ui,`$objectsGroup`,x),h=()=>z(Es,`$peers`,x),_=()=>z(pc,`$username`,x),y=()=>z(Pc,`$customNodeDefs`,x),[x,S]=Ve();Qe(()=>{let e=i();e&&K(()=>C(e))});function C(e){qo.set(null),a().some(t=>t.id===e)&&setTimeout(()=>{try{ne({nodes:[{id:e}],duration:200,maxZoom:1.2})}catch{}},60)}let T={colorpicker:m6e,slider:g6e,switcher:y6e,objectselector:S6e,shake:i4,spin:i4,bounce:i4,orbit:i4,pulse:i4,blink:i4,script:C8e,behaviour:E8e,maprange:k8e,select:M8e,customnode:U8e,pathpatrol:G8e,sound:q8e,particle:X8e,jiggle:i4,mass:i4,bounciness:i4,friction:i4,angularvelocity:i4,motor:i4,deviceparam:i4,devicelevel:i4,transportbeat:i4,notetrigger:i4,number:Q8e,vector3:t5e,toggle:r5e,random:a5e,time:s5e,math:d4,compare:d4,gate:d4,loop:m5e,timer:g5e,distance:f4,proximity:f4,lookat:p4,setcolor:p4,visibility:p4,setuniform:p4,onclick:m4,ongrab:m4,onimpact:v4,onhit:u7e,onenter:v4,onexit:v4,collider:A5e,velocity:M5e,measure:i4,onrest:i4,impulse:i4,setvelocity:i4,joint:i4,spawn:i4,counter:P5e,flowinput:h4,flowoutput:h4,objectflow:J5e,keypress:Z5e,gamepadbutton:_4,gamepadaxis:_4,playanim:i7e,animfinished:m4,animmarker:m4,animstate:s7e,hudscreen:o4,hudtext:o4,hudbar:o4,hudbutton:o4,hudtimer:o4,hudlist:o4,hudinput:o4,hudrows:o4,hudset:o4,leaderboard:o4,setgamestate:i4,ongamestate:i4,setvariable:i4,getvariable:i4,storevalue:i4,storedvalue:i4,announce:i4,gamesound:i4,effectburst:i4,hapticpulse:i4,gamemusic:i4,gamesetting:i4,pointgrab:i4,onclap:p7e,gametime:i4,peervariable:i4,setcamera:c4,gamestart:c4,setlook:c4,travel:u8e,allplayers:i4,latch:i4,delay:i4,once:i4,sequence:p8e,charcontroller:i4,possessnode:i4,camerafollow:i4,movespeed:i4,moveinput:g8e,...Object.fromEntries(bne().map(e=>[e,i4]))},E=q(()=>Object.fromEntries(o().flatMap(e=>e.items).map(e=>[e.type,Iee[e.type]??i4])));Qe(()=>{let e=Object.keys(Q(E)).filter(e=>e in T);e.length&&console.log(`module node type(s) shadow core types and were ignored:`,e.join(`, `))});let D=q(()=>[...new Set(s()?Object.values(s()).flatMap(e=>(e.nodes??[]).map(e=>e.type)):[])].filter(e=>!!e&&!(e in T)&&!(e in Q(E)))),k=q(()=>({...Q(E),...T,...Object.fromEntries(Q(D).map(e=>[e,v7e]))})),A=q(()=>a().filter(e=>Q(D).includes(e.type)).length),M=Object.keys(Q(k)),{screenToFlowPosition:te,fitView:ne,setViewport:P}=P2();Qe(()=>{if(typeof window<`u`&&typeof localStorage<`u`&&nt.getItem(`debugStores`)===`true`)return window.__flowViewport={setViewport:P,fitView:ne},window.__flowNodeTypes={live:()=>Object.keys(Q(k)),atMount:M,unknown:()=>[...Q(D)],unknownHere:()=>Q(A)},()=>{delete window.__flowViewport,delete window.__flowNodeTypes}});
2466let re=J(n,`paletteOpen`,31,()=>Ne(typeof localStorage>`u`||nt.getItem(`flowPaletteOpen`)!==`false`)),ie=t(Ne(typeof localStorage<`u`?nt.getItem(`flowPaletteSide`)??`left`:`left`)),F=t(0),ae=t([]),oe=t([]),R=!1;Qe(()=>K(()=>Oc.subscribe(e=>{R||e!==Q(ae)&&I(ae,e)}))),Qe(()=>K(()=>Ic.subscribe(e=>{R||e!==Q(oe)&&I(oe,e)}))),Qe(()=>{let e=Q(ae);K(()=>{e!==U(Oc)&&(R=!0,Oc.set(e),R=!1)})}),Qe(()=>{let e=Q(oe);K(()=>{e!==U(Ic)&&(R=!0,Ic.set(e),R=!1)})});let se=typeof localStorage<`u`?localStorage:null,ce=t(se?.getItem(`flowPropsOpen`)===`true`),le=t(Ne(se?.getItem(`flowPropsTab`)||`settings`)),de=q(()=>Q(ie)===`right`?`left`:`right`),pe=t(Ne(se?.getItem(`flowEdgeStyle`)??`bezier`)),me=t(se?.getItem(`flowMinimap`)!==`false`),V=t(Ne(se?.getItem(`flowBg`)??`dots`)),he=t(se?.getItem(`flowGridSnap`)!==`false`),ge=t(+(se?.getItem(`flowGridSize`)??`25`)),_e=V2.Lines,ye=V2.Dots,be=q(()=>[Q(he)?Q(ge):1,Q(he)?Q(ge):1]),xe=q(()=>Q(V)===`lines`?_e:ye),Se=q(()=>Q(ae).find(e=>e.selected)??null),we=q(()=>c()===`select`),Te=null,Ee=e=>{let t=e.target,n=!!t?.closest(`.svelte-flow__pane`)&&!t.closest(`.svelte-flow__node, .svelte-flow__edge`);Te=e.button===2&&n?{x:e.clientX,y:e.clientY}:null},De=e=>{if(!Q(we)||e.button!==2||!Te)return;let t=Math.hypot(e.clientX-Te.x,e.clientY-Te.y);Te=null,!(t>4)&&tt({event:e})};Qe(()=>{let e=l(),t=d()?.uuid,n=e.length?t&&e.includes(t)?t:e[e.length-1]:null;K(()=>dee(n??`scene`))});let Oe=q(p),ke=q(()=>Q(Oe)===`scene`||!!s()[Q(Oe)]),Ae=q(()=>Q(Oe)===`scene`?`Scene`:m()?.getObjectByProperty?.(`uuid`,Q(Oe))?.name||m()?.getObjectByProperty?.(`uuid`,Q(Oe))?.type||Q(Oe).slice(0,8));function je(e){I(pe,e,!0),se?.setItem(`flowEdgeStyle`,e),I(oe,Q(oe).map(t=>({...t,type:e})))}let Me=t({x:0,y:0,zoom:1}),Pe=q(h),Fe=0,Le=e=>{if(!Q(Pe))return;let t=Date.now();if(t-Fe<50)return;Fe=t;let n=te({x:e.clientX,y:e.clientY});Q(Pe).send({type:`flowcursor`,id:Q(Pe).peer.id,name:_()||Q(Pe).peer.id,x:n.x,y:n.y,graphId:Q(Oe)})},Re=()=>{Q(Pe)&&Q(Pe).send({type:`flowcursor`,id:Q(Pe).peer.id,leave:!0})},ze=t(null);function He(e,t,n,r=null){Q(Oe)!==`scene`&&!Q(ke)&&Zv(Q(Oe));let i=ed(e),a={id:crypto.randomUUID(),type:e,position:n,data:{label:t,type:e,...i?.defaults??{},...r??{}},class:`w-[150px]`};I(ae,[...Q(ae),a]),Q(Pe)?.send({type:`nodecreate`,node:iu(a),graphId:Q(Oe)})}function Ue(e){let t=document.querySelector(`.svelte-flow`)?.getBoundingClientRect(),n=t?t.left+t.width/2:window.innerWidth/2,r=t?t.top+t.height/2:window.innerHeight/2,i=te({x:n,y:r});if(e.startsWith(`customnode:`)){let t=y().find(t=>t.id===e.slice(11));t&&He(`customnode`,t.name,i,pd(t));return}He(e,ed(e)?.label??`${e} node`,i)}function We(e,t,n){let r=te({x:t,y:n});if(e.startsWith(`customnode:`)){let t=y().find(t=>t.id===e.slice(11));t&&He(`customnode`,t.name,r,pd(t));return}He(e,ed(e)?.label??`${e} node`,r)}let Ge=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`)},Ke=e=>{if(e.preventDefault(),!e.dataTransfer)return;let t=e.dataTransfer.getData(`application/svelteflow`);if(!t)return;let n=te({x:e.clientX,y:e.clientY});if(t.startsWith(`customnode:`)){let e=y().find(e=>e.id===t.slice(11));e&&He(`customnode`,e.name,n,pd(e));return}He(t,ed(t)?.label??`${t} node`,n)},qe=({nodes:e})=>{e.forEach(e=>{Q(Pe)?.send({type:`nodemove`,id:e.id,position:{x:e.position.x,y:e.position.y},graphId:Q(Oe)})})},Je=e=>$2(e,Q(ae)),Ye=e=>{let t=t4(e,Q(ae),Q(oe));t.length&&(ru(t,Q(Oe)),Q(Pe)?.send({type:`edgedelete`,ids:t,graphId:Q(Oe)}));let n={id:`e-${e.source}${e.sourceHandle?`.`+e.sourceHandle:``}-${e.target}${e.targetHandle?`.`+e.targetHandle:``}`,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle,type:Q(pe),markerEnd:{type:U1.ArrowClosed,width:16,height:16}};return Q(Pe)?.send({type:`edgecreate`,edge:eu(n),graphId:Q(Oe)}),n},Xe=({nodes:e,edges:t})=>{e.length&&Q(Pe)?.send({type:`nodedelete`,ids:e.map(e=>e.id),graphId:Q(Oe)}),t.length&&Q(Pe)?.send({type:`edgedelete`,ids:t.map(e=>e.id),graphId:Q(Oe)})};function $e(e){au([e],Q(Oe)),Q(Pe)?.send({type:`nodedelete`,ids:[e],graphId:Q(Oe)})}function et(e){let t=Q(oe).filter(t=>t.source===e||t.target===e).map(e=>e.id);t.length&&(ru(t,Q(Oe)),Q(Pe)?.send({type:`edgedelete`,ids:t,graphId:Q(Oe)}))}function $(e){ru([e],Q(Oe)),Q(Pe)?.send({type:`edgedelete`,ids:[e],graphId:Q(Oe)})}let tt=({event:e})=>{e.preventDefault();let t=te({x:e.clientX,y:e.clientY});I(ze,{x:e.clientX,y:e.clientY,flowPos:t,items:[{label:`Search nodesâ¦`,revealFilter:!0},...[...$u,...o()].map(e=>({label:e.group,children:e.items.map(e=>({label:e.label,action:()=>He(e.type,e.label,t)}))})),{label:`Custom`,children:[...y().map(e=>({label:e.name,action:()=>He(`customnode`,e.name,t,pd(e))})),{label:`New custom nodeâ¦`,action:()=>zc.set(`new`)}]}]},!0)};function rt(e){let t=Q(ae).find(t=>
2466t.id===e);if(!t)return;let n={id:crypto.randomUUID(),type:t.type,position:{x:t.position.x+30,y:t.position.y+30},data:{...t.data},...t.class?{class:t.class}:{}};I(ae,[...Q(ae),n]),Q(Pe)?.send({type:`nodecreate`,node:iu(n),graphId:Q(Oe)})}let it=({node:e,event:t})=>{t.preventDefault();let n=e.id;I(ze,{x:t.clientX,y:t.clientY,items:[{label:`Duplicate`,action:()=>rt(n)},{label:`Disconnect all`,action:()=>et(n)},{label:`Delete node`,danger:!0,action:()=>$e(n)}]},!0)},at=({edge:e,event:t})=>{t.preventDefault();let n=e.id;I(ze,{x:t.clientX,y:t.clientY,items:[{label:`Disconnect`,action:()=>$(n)}]},!0)};var ot=L7e(),st=N(ot),ct=j(st),lt=e=>{var t=y7e(),n=j(t);K2(n,{kind:`flow`,get documents(){return s()},get sceneKey(){return Fc},label:`Flows`,get paneHeight(){return Q(F)}});var r=g(n,2);$3e(j(r),{onPick:Ue,onPlaceAt:We}),H(r),H(t),O(()=>Ze(t,`order: ${Q(ie)===`right`?3:1}`)),ee(t,`clientHeight`,e=>I(F,e)),X(e,t)};G(ct,e=>{re()&&e(lt)});var ut=g(ct,2),dt=j(ut),ft=f(dt,!0),pt=g(dt,2);H(ut);var mt=g(ut,2),ht=j(mt),gt=j(ht),_t=e=>{var t=b7e();L(`click`,t,()=>bm()),X(e,t)};G(gt,e=>{Q(Oe)!==`scene`&&e(_t)});var vt=g(gt,2),yt=f(vt,!0),bt=g(vt,2),xt=e=>{var t=x7e(),n=j(t);SS(n,{size:16,"aria-hidden":`true`}),H(t),L(`click`,t,()=>Ffe(Q(Oe),Q(Ae))),X(e,t)};G(bt,e=>{Q(Oe)!==`scene`&&Q(ke)&&e(xt)});var St=g(bt,2),Ct=e=>{var t=S7e(),n=f(t);O(()=>Y(n,`â ${Q(A)??``} node${Q(A)===1?` needs`:`s need`} modules`)),L(`click`,t,()=>Oo.set(!0)),X(e,t)};G(St,e=>{Q(A)&&e(Ct)}),H(ht);var wt=g(ht,2),Tt=e=>{var t=C7e(),n=j(t),r=j(n),i=f(r,!0);W(),H(n);var a=g(n,2);W(2),H(t),O(()=>Y(i,Q(Ae))),L(`contextmenu`,t,e=>tt({event:e})),L(`click`,a,()=>Zv(Q(Oe))),X(e,t)};G(wt,e=>{Q(Oe)!==`scene`&&!Q(ke)&&e(Tt)});var Et=g(wt,2);{let e=q(()=>!Q(we)||[1,2]),t=q(()=>Q(we)?`Shift`:void 0),n=q(()=>({type:Q(pe),markerEnd:{type:U1.ArrowClosed,width:16,height:16}}));L2(Et,{get nodeTypes(){return Q(k)},get snapGrid(){return Q(be)},onbeforeconnect:Ye,ondelete:Xe,isValidConnection:Je,get panOnDrag(){return Q(e)},get selectionOnDrag(){return Q(we)},get selectionMode(){return B1.Partial},get multiSelectionKey(){return Q(t)},get defaultEdgeOptions(){return Q(n)},deleteKey:[`Backspace`,`Delete`],fitView:!0,maxZoom:1,minZoom:.5,ondragover:Ge,ondrop:Ke,onnodedragstop:qe,onpanecontextmenu:tt,onnodecontextmenu:it,onedgecontextmenu:at,onpaneclick:()=>I(ze,null),get nodes(){return Q(ae)},set nodes(e){I(ae,e)},get edges(){return Q(oe)},set edges(e){I(oe,e)},get viewport(){return Q(Me)},set viewport(e){I(Me,e)},children:(e,t)=>{var n=w7e(),r=N(n),i=e=>{var t=fe(),n=N(t);Ie(n,()=>Q(V),e=>{H2(e,{bgColor:`transparent`,get variant(){return Q(xe)},lineWidth:.6,patternColor:`rgba(128,128,128,0.18)`})}),X(e,t)};G(r,e=>{Q(V)!==`none`&&e(i)});var a=g(r,2);B2(a,{showLock:!1});var o=g(a,2),s=e=>{W2(e,{pannable:!0,zoomable:!0,width:140,height:90,nodeColor:()=>`#475569`,maskColor:`rgb(17 24 39 / 0.65)`})};G(o,e=>{Q(me)&&e(s)}),X(e,n)},$$slots:{default:!0}})}s6e(g(Et,2),{get viewport(){return Q(Me)}}),H(mt);
2466var Dt=g(mt,2),Ot=f(Dt),kt=g(Dt,2),At=e=>{var t=I7e(),n=j(t),i=j(n),a=g(i,2);H(n);var o=g(n,2),s=e=>{var t=fe(),n=N(t),r=e=>{var t=j7e(),n=N(t),r=f(n,!0),i=g(n,2),a=e=>{var t=T7e(),n=f(t,!0);O(e=>Y(n,e),[()=>G2(Q(Se).type)]),X(e,t)},o=q(()=>G2(Q(Se).type));G(i,e=>{Q(o)&&e(a)});var s=g(i,2),c=e=>{var t=E7e(),n=N(t),r=g(j(n));v(r),H(n);var i=g(n,2),a=g(j(i));v(a),H(i),O(()=>{u(r,Q(Se).data?.min??0),u(a,Q(Se).data?.max??40)}),L(`change`,r,e=>nu(Q(Se).id,{min:+e.currentTarget.value||0})),L(`change`,a,e=>nu(Q(Se).id,{max:+e.currentTarget.value||0})),X(e,t)},l=e=>{var t=O7e(),n=N(t);B(n,17,()=>Q(Se).data?.items??[`cube`,`pyramid`],Be,(e,t,n)=>{var r=D7e(),i=j(r);v(i);var a=g(i,2);H(r),O(()=>u(i,Q(t))),L(`change`,i,e=>{let t=[...Q(Se).data?.items??[`cube`,`pyramid`]];t[n]=e.currentTarget.value,nu(Q(Se).id,{items:t})}),L(`click`,a,()=>{let e=(Q(Se).data?.items??[`cube`,`pyramid`]).filter((e,t)=>t!==n);e.length&&nu(Q(Se).id,{items:e,index:0,shape:e[0]})}),X(e,r)});var r=g(n,2);L(`click`,r,()=>{let e=[...Q(Se).data?.items??[`cube`,`pyramid`],`item `+((Q(Se).data?.items?.length??2)+1)];nu(Q(Se).id,{items:e})}),X(e,t)},d=e=>{var t=k7e(),n=g(j(t));v(n),H(t),O(()=>u(n,Q(Se).data?.step??1)),L(`change`,n,e=>nu(Q(Se).id,{step:+e.currentTarget.value||1})),X(e,t)},p=e=>{var t=A7e();X(e,t)};G(s,e=>{Q(Se).type===`slider`?e(c):Q(Se).type===`switcher`?e(l,1):Q(Se).type===`number`?e(d,2):e(p,-1)}),O(()=>Y(r,Q(Se).data?.label??Q(Se).type)),X(e,t)},i=e=>{var t=M7e();X(e,t)};G(n,e=>{Q(Se)?e(r):e(i,-1)}),X(e,t)},c=e=>{var t=fe(),n=N(t),r=e=>{var t=N7e(),n=g(N(t),2),r=g(j(n));v(r),H(n);var i=g(n,2),a=g(j(i));ve(a),H(i),O(()=>{u(r,Q(Se).data?.label??``),u(a,Q(Se).data?.note??``)}),L(`change`,r,e=>nu(Q(Se).id,{label:e.currentTarget.value})),L(`change`,a,e=>nu(Q(Se).id,{note:e.currentTarget.value})),X(e,t)},i=e=>{var t=F7e(),n=g(N(t),2);fq(g(j(n)),{id:`flow-edge-style`,items:[{value:`bezier`,name:`Bezier`},{value:`smoothstep`,name:`Step`},{value:`straight`,name:`Straight`}],get value(){return Q(pe)},onchange:e=>je(e)}),H(n);var r=g(n,2);fq(g(j(r)),{id:`flow-bg-pattern`,items:[{value:`dots`,name:`Dots`},{value:`lines`,name:`Lines`},{value:`none`,name:`None`}],get value(){return Q(V)},onchange:e=>{I(V,e,!0),se?.setItem(`flowBg`,e)}}),H(r);var i=g(r,2),a=j(i);v(a),W(),H(i);var o=g(i,2),s=j(o);v(s),W(),H(o);var c=g(o,2),l=g(j(c));v(l),H(c);var d=g(c,2),f=j(d),p=g(f,2);H(d);var m=g(d,4);B(m,20,()=>[`number`,`vector3`,`boolean`,`color`,`object`,`event`,`effect`],Be,(e,t)=>{var n=P7e(),r=j(n),i=g(r,1,!0);H(n),O(e=>{Ze(r,`background: ${e??``}`),Y(i,t)},[()=>Q2(t)]),X(e,n)}),H(m),O(()=>{w(a,Q(me)),w(s,Q(he)),u(l,Q(ge))}),L(`change`,a,e=>{I(me,e.currentTarget.checked,!0),se?.setItem(`flowMinimap`,String(Q(me)))}),L(`change`,s,e=>{I(he,e.currentTarget.checked,!0),se?.setItem(`flowGridSnap`,String(Q(he)))}),L(`change`,l,e=>{I(ge,+e.currentTarget.value||25,!0),se?.setItem(`flowGridSize`,String(Q(ge)))}),L(`click`,f,()=>ne()),L(`click`,p,()=>P({x:0,y:0,zoom:1})),X(e,t)};G(n,e=>{Q(Se)?e(r):e(i,-1)}),X(e,t)};G(o,e=>{Q(le)===`info`?e(s):e(c,-1)}),H(t),O(()=>{Ze(t,`order: ${Q(de)===`left`?-1:5}`),r(i,1,`flex-1 rounded-sm px-2 py-1 ${Q(le)===`info`?`bg-primary-700 text-white`:`bg-gray-700 hover:bg-gray-600`}`),r(a,1,`flex-1 rounded-sm px-2 py-1 ${Q(le)===`settings`?`bg-primary-700 text-white`:`bg-gray-700 hover:bg-gray-600`}`)}),L(`click`,i,()=>{I(le,`info`),se?.setItem(`flowPropsTab`,`info`)}),L(`click`,a,()=>{I(le,`settings`),se?.setItem(`flowPropsTab`,`settings`)}),X(e,t)};G(kt,e=>{Q(ce)&&e(At)}),H(st);var jt=g(st,2),Mt=e=>{xS(e,{get x(){return Q(ze).x},get y(){return Q(ze).y},get items(){return Q(ze).items},sizeKey:`nodes`,$$events:{close:()=>I(ze,null)}})};G(jt,e=>{Q(ze)&&e(Mt)}),O(()=>{r(dt,1,`palette-tab ${Q(ie)===`right`?`palette-tab-mirrored`:``} absolute top-8 flex h-14 w-4 items-center justify-center bg-gray-700 text-[10px] text-gray-200 hover:bg-gray-600`),Ze(dt,`${Q(ie)===`right`?`right`:`left`}: -1px`),b(dt,`title`,re()?`Hide the node palette`:`Show the node palette`),Y(ft,re()?Q(ie)===`right`?`â¸`:`â`:Q(ie)===`right`?`â`:`â¸`),r(pt,1,`palette-tab ${Q(ie)===`right`?`palette-tab-mirrored`:``} absolute top-24 flex h-9 w-4 items-center justify-center bg-gray-700 text-[9px] text-gray-300 hover:bg-gray-600`),Ze(pt,`${Q(ie)===`right`?`right`:`left`}: -1px`),Ze(mt,`order: ${Q(ie)===`right`?1:3}
2466`),Y(yt,Q(Oe)===`scene`?`Scene flow`:Q(Ae)+` â object flow`),Ze(Dt,`order: ${Q(de)===`left`?0:4}`),r(Ot,1,`palette-tab ${Q(de)===`left`?``:`palette-tab-mirrored`} absolute top-8 flex h-14 w-4 items-center justify-center bg-gray-700 text-xs text-gray-200 hover:bg-gray-600`),Ze(Ot,`${Q(de)===`left`?`left`:`right`}: -1px`),b(Ot,`title`,Q(ce)?`Hide properties`:`Show properties`)}),L(`click`,dt,()=>{re(!re()),nt.setItem(`flowPaletteOpen`,String(re()))}),L(`click`,pt,()=>{I(ie,Q(ie)===`right`?`left`:`right`,!0),nt.setItem(`flowPaletteSide`,Q(ie))}),L(`pointerdown`,mt,Ee),L(`pointerup`,mt,De),L(`pointermove`,mt,Le),Z(`pointerleave`,mt,Re),L(`click`,Ot,()=>{I(ce,!Q(ce)),se?.setItem(`flowPropsOpen`,String(Q(ce)))}),X(e,ot),ue(),S()}ge([`click`,`pointerdown`,`pointerup`,`pointermove`,`contextmenu`,`change`]);var b4=[0,290,580],R7e={event:96,param:86,fn:64,state:58,kit:70,timer:58,action:50},z7e=e=>e.charAt(0).toUpperCase()+e.slice(1);function B7e(e){let t=[],n=[];if(!e)return{nodes:t,edges:n};let r=[0,0,0],i=(e,n,i,a)=>t.some(e=>e.id===n)?n:(t.push({id:n,type:`bview`,position:{x:b4[e],y:r[e]},draggable:!1,connectable:!1,deletable:!1,selectable:!1,data:{...a,view:{kind:i,key:a.key??n}}}),r[e]+=R7e[i]??56,n),a=(e,t,r)=>{let i=e+`>`+t;n.some(e=>e.id===i)||n.push({id:i,source:e,target:t,type:`smoothstep`,animated:!1,selectable:!1,class:`bview-edge bview-edge-`+r,data:{kind:r},...r===`read`?{style:`stroke-dasharray: 4 3; opacity: 0.6`}:{}})},o=[...(e.handlers??[]).map(e=>({...e,fid:`h:`+e.name,title:`on.`+e.name,handler:!0})),...(e.methods??[]).map(e=>({...e,fid:`m:`+e.name,title:e.name+`()`,handler:!1}))];for(let t of e.handlers??[]){let e=t.event;i(0,`e:`+t.name,`event`,{key:t.name,label:e?.label??`on.`+t.name,sub:e?(e.piece?`kit.`+e.piece+`.`+e.event:e.name)+(e.local?` · local`:` · authority`):`unknown event`,outputs:Object.entries(e?.payload??{}).map(([e,t])=>e+`: `+t),line:t.line,unknown:!e})}for(let t of e.params??[])i(0,`p:`+t.key,`param`,{key:t.key,label:t.key,value:t.value,ptype:t.type,min:t.min,max:t.max,step:t.step,unit:t.unit??``,editable:!!t.range,line:t.line});for(let e of o)i(1,e.fid,`fn`,{key:e.handler?`on.`+e.name:e.name,label:e.title,handler:e.handler,random:e.random,line:e.line});for(let t of e.handlers??[])a(`e:`+t.name,`h:`+t.name,`event`);for(let t of e.state??[])i(2,`s:`+t.key,`state`,{key:t.key,label:`state.`+t.key,init:t.init,line:t.line});for(let e of o){for(let n of e.reads?.params??[])t.some(e=>e.id===`p:`+n)&&a(`p:`+n,e.fid,`param`);for(let t of e.writes??[])i(2,`s:`+t,`state`,{key:t,label:`state.`+t,init:void 0}),a(e.fid,`s:`+t,`write`);for(let t of e.reads?.state??[])e.writes?.includes(t)||(i(2,`s:`+t,`state`,{key:t,label:`state.`+t,init:void 0}),a(`s:`+t,e.fid,`read`));for(let n of e.calls??[])t.some(e=>e.id===`m:`+n)&&a(e.fid,`m:`+n,`call`);(e.timers??[]).forEach((n,r)=>{let o=i(2,`t:`+e.fid+`:`+r,`timer`,{key:e.fid+`:`+r,label:`after`+(n.params?.length?` `+n.params.join(`, `):``),method:n.method,line:n.line});a(e.fid,o,`timer`);for(let e of n.params??[])t.some(t=>t.id===`p:`+e)&&a(`p:`+e,o,`param`);n.method&&t.some(e=>e.id===`m:`+n.method)&&a(o,`m:`+n.method,`call`)});for(let t of e.kit??[]){let n=i(2,`k:`+t.piece+`.`+t.call,`kit`,{key:t.piece+`.`+t.call,label:t.label,sub:`Kit: `+z7e(t.piece)+(t.type?` · `+t.type:` · code only`),nodeType:t.type,kitKind:t.kind,line:t.line});a(e.fid,n,`kit`)}for(let t of e.actions??[]){let n=i(2,`a:`+e.fid+`:`+t,`action`,{key:e.fid+`:`+t,label:t+`()`,line:e.line});a(e.fid,n,`action`)}}let s=Math.max(...r);for(let e of t){let t=b4.indexOf(e.position.x);e.position.y+=Math.max(0,(s-r[t])/2)}return{nodes:t,edges:n}}function x4(e){if(e===void 0)return`â`;if(typeof e==`number`)return String(Number.isInteger(e)?e:Math.round(e*1e3)/1e3);if(typeof e==`string`)return JSON.stringify(e.length>24?e.slice(0,23)+`â¦`:e);try{let t=JSON.stringify(e);return t.length>28?t.slice(0,27)+`â¦`:t}catch{return String(e)}}var V7e=V(`<div class="h-full overflow-auto rounded-sm border border-gray-600 bg-gray-900 text-left"></div>`);function S4(e,t){Ce(t,!1);let n=J(t,`value`,8,``),r=J(t,`onChange`,8,e=>{}),i=F(),a=F(null),o=F(n());_e(async()=>{let[{EditorView:e,basicSetup:t},{javascript:s}]=await Promise.all([$(()=>import(`../chunks/DxqG1aTX.js`),__vite__mapDeps([250,251]),import.meta.url),$(()=>import(`../chunks/yhou7yh7.js`),__vite__mapDeps([252,251]),import.meta.url)]);I(a,new e({doc:n(),parent:Q(i),extensions:[t,s(),e.updateListener.of(e=>{e.docChanged&&(I(o,e.state.doc.toString()),r()(Q(o)))}),e.theme({"&":{fontSize:`12px`,height:`100%`,backgroundColor:`#111827`,color:`#e5e7eb`},".cm-scroller":{fontFamily:`ui-monospace, Consolas, monospace`},".cm-gutters":{backgroundColor:`#1f2937`,color:`#6b7280`,border:`none`},".cm-activeLine":{backgroundColor:`rgba(59, 130, 246, 0.08)`},".cm-activeLineGutter":{backgroundColor:`rgba(59, 130, 246, 0.12)`},".cm-content":{caretColor:`#f97316`},".cm-cursor":{borderLeftColor:`#f97316`}
2466,"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:`rgba(59, 130, 246, 0.28) !important`}},{dark:!0})]}))}),Pe(()=>Q(a)?.destroy()),d(()=>(Q(a),s(n()),Q(o)),()=>{Q(a)&&n()!==Q(o)&&n()!==Q(a).state.doc.toString()&&(I(o,n()),Q(a).dispatch({changes:{from:0,to:Q(a).state.doc.length,insert:n()}}))}),h(),R();var c=V7e();We(c,e=>I(i,e),()=>Q(i)),X(e,c),ue()}var H7e=V(`<span class="bview-tag svelte-2ihqw1" title="uses this.rand()">ð²</span>`),C4=V(`<div class="bview-sub svelte-2ihqw1"> </div>`),U7e=V(`<input class="nodrag bview-knob svelte-2ihqw1" type="range"/>`),W7e=V(`<label class="nodrag bview-sub svelte-2ihqw1"><input type="checkbox"/> on</label>`),G7e=V(`<div class="bview-value svelte-2ihqw1" data-bview-value=""> </div> <!>`,1),K7e=V(`<div class="bview-value svelte-2ihqw1" data-bview-value=""> </div>`),q7e=V(`<div class="bview-err svelte-2ihqw1"> </div>`),J7e=V(`<div><!> <div class="bview-head svelte-2ihqw1"><span class="bview-icon svelte-2ihqw1"> </span> <span class="bview-label svelte-2ihqw1"> </span> <!></div> <!> <!> <!> <!> <!></div>`);function Y7e(e,n){Ce(n,!0);let i={event:`â¡`,param:`â`,fn:`Æ`,state:`â£`,kit:`â`,timer:`â±`,action:`â`},a=q(()=>n.data.view?.kind??`fn`),o=t(null),s=q(()=>Q(o)??n.data.live);var c=J7e();let l;var d=j(c),p=e=>{f2(e,{type:`target`,get position(){return W1.Left},isConnectable:!1})};G(d,e=>{Q(a)!==`event`&&Q(a)!==`param`&&e(p)});var m=g(d,2),h=j(m),_=f(h,!0),y=g(h,2),x=f(y,!0),S=g(y,2),C=e=>{var t=H7e();X(e,t)};G(S,e=>{Q(a)===`fn`&&n.data.random&&e(C)}),H(m);var T=g(m,2),E=e=>{var t=C4(),r=f(t,!0);O(()=>Y(r,n.data.sub)),X(e,t)};G(T,e=>{n.data.sub&&e(E)});var D=g(T,2),k=e=>{var t=C4(),r=f(t,!0);O(e=>Y(r,e),[()=>n.data.outputs.join(` · `)]),X(e,t)};G(D,e=>{Q(a)===`event`&&n.data.outputs?.length&&e(k)});var A=g(D,2),ee=e=>{var t=G7e(),r=N(t),i=f(r),a=g(r,2),c=e=>{var t=U7e();v(t),O(()=>{b(t,`min`,n.data.min),b(t,`max`,n.data.max),b(t,`step`,n.data.step),u(t,Q(s)),b(t,`data-bview-knob`,n.data.key)}),L(`input`,t,e=>{I(o,Number(e.currentTarget.value),!0),n.data.onKnob?.(n.data.key,Q(o),!1)}),L(`change`,t,e=>{let t=Number(e.currentTarget.value);n.data.onKnob?.(n.data.key,t,!0),I(o,null)}),X(e,t)},l=e=>{var t=W7e(),r=j(t);v(r),W(),H(t),O(()=>w(r,!!Q(s))),L(`change`,r,e=>n.data.onKnob?.(n.data.key,e.currentTarget.checked,!0)),X(e,t)};G(a,e=>{n.data.editable&&n.data.ptype===`number`?e(c):n.data.editable&&n.data.ptype===`boolean`&&e(l,1)}),O(e=>Y(i,`${e??``}${n.data.unit?` `+n.data.unit:``}`),[()=>x4(Q(s))]),X(e,t)},M=e=>{var t=K7e(),r=f(t,!0);O(()=>Y(r,n.data.liveText)),X(e,t)};G(A,e=>{Q(a)===`param`?e(ee):n.data.liveText!==void 0&&e(M,1)});var te=g(A,2),ne=e=>{var t=q7e(),r=f(t);O(()=>Y(r,`â ${n.data.error??``}`)),X(e,t)};G(te,e=>{n.data.error&&e(ne)});var P=g(te,2),re=e=>{f2(e,{type:`source`,get position(){return W1.Right},isConnectable:!1})};G(P,e=>{Q(a)!==`state`&&Q(a)!==`kit`&&Q(a)!==`action`&&e(re)}),H(c),O(()=>{l=r(c,1,`bview-node bview-${Q(a)??``}`,`svelte-2ihqw1`,l,{"bview-glow":n.data.glow,"bview-error":!!n.data.error||n.data.unknown}),b(c,`data-bview-id`,n.id),b(c,`data-bview-kind`,Q(a)),b(c,`title`,n.data.line?`line `+n.data.line:``),Y(_,i[Q(a)]??`â¢`),Y(x,n.data.label)}),X(e,c),ue()}ge([`input`,`change`]);var X7e=V(`<span class="text-gray-400" title="Handlers run on ONE peer (the kit's authority); state reaches everyone"> </span>`),Z7e=V(`<p class="p-4 text-sm text-gray-400">This behaviour node is gone.</p>`),Q7e=V(`<!> <!>`,1),$7e=V(`<div class="flex w-[44%] min-w-[280px] flex-col border-l border-gray-700"><div class="min-h-0 flex-1" id="behaviour-view-editor"><!></div></div>`),e9e=V(`<div class="text-red-400"> </div>`),t9e=V(`<div class="text-amber-300"> </div>`),n9e=V(`<div class="max-h-24 shrink-0 overflow-auto border-t border-gray-700 px-2 py-1 text-[11px]" id="behaviour-view-problems"><!> <!></div>`),r9e=V(`<div id="behaviour-view" class="absolute inset-0 z-20 flex flex-col bg-gray-900"><div class="flex shrink-0 items-center gap-2 border-b border-gray-700 px-2 py-1 text-xs text-gray-200"><button id="behaviour-view-back" class="ui-button-quiet" title="Back to the graph">â Graph</button> <span class="font-semibold"> </span> <span class="text-gray-400" data-behaviour-view-status=""> </span> <!> <span class="flex-1"></span> <span class="text-gray-500">derived from the code · read-only · knobs write the source</span> <button id="behaviour-view-code" class="ui-button-quiet"> </button></div> <div class="flex min-h-0 flex-1"><div class="relative min-w-0 flex-1"><!></div> <!></div> <!></div>`);function w4(e,n){Ce(n,!0);let r=()=>z(wc,`$behaviourViewOpen`,a),i=()=>z(Dc,`$flowGraphs`,a),[a,o]=Ve(),s={bview:Y7e},c=t(null),l=t(Ne({})),u=t([]),d=t([]),p=t(!1),m=``,h=new Map,_=q(r),v=q(()=>Q(_)?(i()?.[Q(_).graphId])?.nodes?.find(e=>e.id===Q(_).id)??null:null),y=q(()=>String(Q(v)?.data?.code??``)),x=q(()=>Q(_)?Q(l)[Q(_).id]??null:null),S=()=>{};_e(()=>{$(()=>import(`../chunks/BuiBbCDp.js`).then(e=>{I(c,e,!0),S=e.behaviourStatus.subscribe(e=>I(l,e,!0))}),[],import.meta.url)}),Pe(()=>S()),Qe(()=>{let e=Q(x)?.model??cK(Q(y)),t=JSON.stringify([e.params?.map(e=>[e.key,e.min,e.max,e.step]),e.state,e.handlers?.map(e=>[e.name,e.reads,e.writes,e.calls,e.timers,e.kit,e.actions]),e.methods?.map(e=>[e.name,e.reads,e.writes,e.calls,e.timers,e.kit])]),n=(Q(_)?.id??``)+t;if(n===m)return;m=n,h.clear();let r=B7e(e);I(u,r.nodes.map(e=>e.data.view.kind===`param`?{...e,data:{...e.data,onKnob:C}}:e)),I(d,r.edges)});
2466function C(e,t,n){if(!Q(_)||!Q(c)||(Q(c).runtime.setParam(Q(_).id,e,t),!n))return;let r=Q(y),i=wPe(r,e,t);i.changed&&(nu(Q(_).id,{code:i.source},Q(_).graphId),Qv({op:`data`,graphId:Q(_).graphId,items:[{id:Q(_).id,before:{code:r},after:{code:i.source}}]}))}let w=null,T=null;function E(e){if(!Q(_))return;T??=Q(y),clearTimeout(w);let t=Q(_).id,n=Q(_).graphId;w=setTimeout(()=>{let r=T??``;T=null,e!==r&&(nu(t,{code:e},n),Qv({op:`data`,graphId:n,items:[{id:t,before:{code:r},after:{code:e}}]}))},600)}let D=t(null),k=null;_e(()=>{k=setInterval(()=>{if(!Q(c)||!Q(_))return;I(D,Q(c).runtime.live(Q(_).id),!0);let e=yc(),t=performance.now(),n=(e,n)=>{let r=JSON.stringify(n??null),i=h.get(e);return i?(i.key!==r&&h.set(e,{key:r,at:t}),t-(h.get(e)?.at??-1/0)<900):(h.set(e,{key:r,at:-1/0}),!1)};I(u,Q(u).map(t=>{let r=t.data.view,i={...t.data,glow:!1,error:``};if(!Q(D))return{...t,data:{...i,liveText:r.kind===`state`?`â`:void 0}};if(r.kind===`param`)i.live=Q(D).params[r.key];else if(r.kind===`state`)i.liveText=x4(Q(D).state?.[r.key]),i.glow=n(t.id,Q(D).state?.[r.key]);else if(r.kind===`event`){let a=Q(D).fired?.[`on.`+r.key];i.liveText=a?`Ã`+a.n+` · `+((e-a.at)/1e3).toFixed(1)+` s ago`:`not fired yet`,i.glow=n(t.id,a?.n)}else if(r.kind===`fn`){let e=t.data.handler?Q(D).fired?.[r.key]:Q(D).methods?.[r.key],a=t.data.handler?null:Q(D).fired?.[`after:`+r.key];i.liveText=e||a?`Ã`+((e?.n??0)+(a?.n??0)):``,i.glow=n(t.id,[e?.n,a?.n]),i.error=e?.err??a?.err??``}else if(r.kind===`kit`){let e=Q(D).calls?.[r.key];i.liveText=e?`Ã`+e.n:``,i.glow=n(t.id,e?.n)}else if(r.kind===`timer`){let n=(Q(D).timers??[]).filter(e=>e.method===t.data.method);i.liveText=n.length?`in `+Math.max(0,(n[0].at-e)/1e3).toFixed(1)+` s`:``}return{...t,data:i}}))},100)}),Pe(()=>{clearInterval(k),clearTimeout(w)});let A=q(()=>[...Q(x)?.errors??[],...(Q(D)?.errors??[]).slice(-3).map(e=>({message:e.where+`: `+e.message,line:0}))]),ee=q(()=>[...(Q(x)?.lint??[]).filter(e=>e.level===`warning`),...(Q(D)?.problems??[]).map(e=>({message:e,line:0}))]);var M=fe(),te=N(M),ne=e=>{var t=r9e(),n=j(t),r=j(n),i=g(r,2),a=f(i,!0),o=g(i,2),c=f(o,!0),l=g(o,2),m=e=>{var t=X7e(),n=f(t);O(()=>Y(n,`· ${Q(D).authority?`runs here (authority)`:`runs on the authority`}`)),X(e,t)};G(l,e=>{Q(D)&&e(m)});var h=g(l,6),S=f(h,!0);H(n);var C=g(n,2),w=j(C),T=j(w),k=e=>{var t=Z7e();X(e,t)},M=e=>{L2(e,{get nodes(){return Q(u)},get edges(){return Q(d)},get nodeTypes(){return s},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,fitView:!0,minZoom:.3,maxZoom:1.5,proOptions:{hideAttribution:!0},children:(e,t)=>{var n=Q7e(),r=N(n);H2(r,{}),B2(g(r,2),{showLock:!1}),X(e,n)},$$slots:{default:!0}})};G(T,e=>{Q(v)?e(M,-1):e(k)}),H(w);var te=g(w,2),ne=e=>{var t=$7e(),n=j(t),r=j(n);Ie(r,()=>Q(_).id,e=>{S4(e,{get value(){return Q(y)},onChange:E})}),H(n),H(t),X(e,t)};G(te,e=>{Q(p)&&Q(v)&&e(ne)}),H(C);var P=g(C,2),re=e=>{var t=n9e(),n=j(t);B(n,17,()=>Q(A),Be,(e,t)=>{var n=e9e(),r=f(n);O(()=>Y(r,`â ${Q(t).line?`line `+Q(t).line+`: `:``}${Q(t).message??``}`)),X(e,n)});var r=g(n,2);B(r,17,()=>Q(ee),Be,(e,t)=>{var n=t9e(),r=f(n);O(()=>Y(r,`â³ ${Q(t).line?`line `+Q(t).line+`: `:``}${Q(t).message??``}`)),X(e,n)}),H(t),X(e,t)};G(P,e=>{(Q(A).length||Q(ee).length)&&e(re)}),H(t),O(()=>{b(t,`data-behaviour-view`,Q(_).id),Y(a,Q(v)?.data?.name||Q(x)?.name||`Behaviour`),Y(c,Q(v)?.data?.enabled===!1?`off`:Q(x)?.status??`â¦`),b(h,`aria-pressed`,Q(p)),Y(S,Q(p)?`Hide code`:`Code`)}),L(`click`,r,()=>wc.set(null)),L(`click`,h,()=>I(p,!Q(p))),X(e,t)};G(te,e=>{Q(_)&&e(ne)}),X(e,M),ue(),o()}ge([`click`]);var i9e=`// runs every frame on every peer (keep it deterministic)`;function T4(e,t,n){let r=n??U(Nc),i=Lc(r),a=i?.nodes.find(t=>t.id===e);if(!a||a.type!==`script`)return[];let o={};`inputs`in t&&(o.inputs=t.inputs===null?void 0:rd({inputs:t.inputs})),`outputs`in t&&(o.outputs=t.outputs===null?void 0:id({outputs:t.outputs}));let s={...a.data,...o};nu(e,o,r);let c=rd(s),l=new Set(c?c.map(e=>e.name):[`a`,`b`,`c`]),u=id(s),d=new Set(u.map(e=>e.name)),f=i.edges.filter(t=>t.target===e&&t.targetHandle&&!l.has(t.targetHandle)||t.source===e&&(u.length?!t.sourceHandle||!d.has(t.sourceHandle):!!t.sourceHandle)).map(e=>e.id);return f.length&&(ru(f,r),U(Es)?.send({type:`edgedelete`,ids:f,graphId:r})),f}function E4(e,t){let n=t??U(Nc),r=Lc(n)?.nodes.find(t=>
2466t.id===e);if(!r||r.type!==`script`)return;let i=String(r.data?.code??``);(!i.trim()||i.startsWith(i9e))&&nu(e,{code:wne},n),T4(e,{inputs:[{name:`a`,type:`number`}],outputs:[{name:`out`,type:`number`}]},n)}var a9e=V(`<div class="flex items-center gap-2"><span class="flex-1 text-gray-400">Inputs a, b, c (numbers) â no outputs.</span> <button id="script-upgrade-v2" class="rounded-sm bg-gray-600 px-2 py-0.5" title="Declare typed inputs and outputs (the code returns its outputs)">Typed socketsâ¦</button></div>`),o9e=V(`<option> </option>`),s9e=V(`<div class="script-socket-row flex items-center gap-1"><input class="w-28 rounded-sm bg-gray-900 px-1"/> <select class="rounded-sm bg-gray-900 px-1"></select> <button class="ml-auto rounded-sm px-1 text-gray-400 hover:text-red-400">â</button></div>`),c9e=V(`<div class="flex items-center gap-2"><span class="font-semibold text-gray-300"> </span> <span class="flex-1"></span> <button class="script-add-socket rounded-sm bg-gray-600 px-2"> </button></div> <!>`,1),l9e=V(`<!> <button id="script-back-v1" class="self-start text-[11px] text-gray-400 underline">Back to a, b, c</button>`,1),u9e=V(`<p class="text-xs text-red-400"> </p>`),d9e=V(`<p class="text-xs text-gray-400"> </p>`),f9e=V(`<p id="script-lint-advice" class="text-xs text-amber-400"> </p>`),p9e=V(`<p class="text-xs text-gray-400"></p> <!>`,1),m9e=V(`<div class="fixed right-0 top-16 z-40 flex h-[70%] w-[420px] max-w-[90vw] flex-col gap-2 rounded-bl-lg bg-gray-800 p-3 text-white shadow-xl"><div class="move-handle flex items-center justify-between"><span class="font-semibold">Script â runs on every peer</span> <button id="script-panel-close" class="rounded-sm bg-gray-600 px-2">â</button></div> <div id="script-sockets" class="flex max-h-[40%] shrink-0 flex-col gap-1 overflow-auto text-xs"><!></div> <div class="min-h-0 flex-1"><!></div> <!></div>`);function h9e(e,t){Ce(t,!1);let n=()=>z(Oc,`$flowNodes`,a),r=()=>z(Rc,`$scriptEditorOpen`,a),i=()=>z(Cc,`$scriptErrors`,a),[a,o]=Ve(),s=F(),c=F(),l=F(),p=F(),m=F(),y=F(),x=F(),S;function C(e){clearTimeout(S);let t=Q(s)?.id;t&&(S=setTimeout(()=>nu(t,{code:e}),400))}function w(e,t){Q(s)&&T4(Q(s).id,{[e]:t})}function T(e){let t=Q(e===`inputs`?l:p)??[],n=t.length+1,r=e===`inputs`?`in`:`out`;for(;t.some(e=>e.name===r+n);)n++;w(e,[...t,{name:r+n,type:`number`}])}function E(e,t,n,r){let i=[...Q(e===`inputs`?l:p)??[]];if(i[t]={...i[t],...n},((e===`inputs`?rd({inputs:i}
2466):id({outputs:i}))?.length??0)!==i.length){r&&(r.value=Q(e===`inputs`?l:p)?.[t]?.name??``);return}w(e,i)}function k(e,t){let n=[...Q(e===`inputs`?l:p)??[]];n.splice(t,1),w(e,n)}function A(){Q(s)&&T4(Q(s).id,{inputs:null,outputs:null})}d(()=>(n(),r()),()=>{I(s,n().find(e=>e.id===r())??null)}),d(()=>(Q(s),i()),()=>{I(c,Q(s)?i()[Q(s).id]:null)}),d(()=>(Q(s),rd),()=>{I(l,Q(s)?rd(Q(s).data):null)}),d(()=>(Q(s),id),()=>{I(p,Q(s)?id(Q(s).data):[])}),d(()=>(Q(l),Q(p)),()=>{I(m,!!Q(l)||Q(p).length>0)}),d(()=>(Q(l),Q(p),ad),()=>{I(y,[{kind:`inputs`,list:Q(l)??[],types:Tne},{kind:`outputs`,list:Q(p),types:ad}])}),d(()=>(Q(s),Q(m),nd),()=>{I(x,Q(s)&&!Q(m)?nd(Q(s).data.code??``):[])}),h(),R();var ee=fe(),M=N(ee),te=e=>{var t=m9e(),n=j(t),r=g(j(n),2);H(n);var i=g(n,2),a=j(i),o=e=>{var t=a9e(),n=g(j(t),2);H(t),Z(`click`,n,()=>E4(Q(s).id)),X(e,t)},l=e=>{var t=l9e(),n=N(t);B(n,1,()=>Q(y),({kind:e,list:t,types:n})=>e,(e,t)=>{let n=()=>Q(t).kind,r=()=>Q(t).list,i=()=>Q(t).types;var a=c9e(),o=N(a),s=j(o),c=f(s,!0),l=g(s,4),d=f(l);H(o);var p=g(o,2);B(p,3,r,e=>e.name,(e,t,r)=>{var a=s9e(),o=j(a);v(o);var s=g(o,2);B(s,5,i,e=>e,(e,t)=>{var n=o9e(),r=f(n,!0),i={};O(()=>{Y(r,Q(t)),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(s);var c;_(s);var l=g(s,2);H(a),O(()=>{b(a,`data-kind`,n()),b(a,`data-socket`,(Q(t),K(()=>Q(t).name))),b(o,`aria-label`,`${n()??``} name`),u(o,(Q(t),K(()=>Q(t).name))),b(s,`aria-label`,`${n()??``} type`),c!==(c=(Q(t),K(()=>Q(t).type)))&&(s.value=(s.__value=c)??``,D(s,c)),b(l,`aria-label`,`Remove ${Q(t),K(()=>Q(t).name)??``}`)}),Z(`change`,o,e=>E(n(),Q(r),{name:e.currentTarget.value.trim()},e.currentTarget)),Z(`change`,s,e=>E(n(),Q(r),{type:e.currentTarget.value})),Z(`click`,l,()=>k(n(),Q(r))),X(e,a)}),O(()=>{Y(c,n()===`inputs`?`Inputs`:`Outputs`),b(l,`data-kind`,n()),Y(d,`+ ${n()===`inputs`?`input`:`output`}`)}),Z(`click`,l,()=>T(n())),X(e,a)});var r=g(n,2);Z(`click`,r,A),X(e,t)};G(a,e=>{Q(m)?e(l,-1):e(o)}),H(i);var d=g(i,2),h=j(d);{let e=ze(()=>(Q(s),K(()=>Q(s).data.code??``)));S4(h,{get value(){return Q(e)},onChange:C})}H(d);var S=g(d,2),w=e=>{var t=u9e(),n=f(t);O(()=>Y(n,`â ${Q(c)??``}`)),X(e,t)},ee=e=>{var t=d9e(),n=f(t);O(e=>Y(n,`inputs.<name>, time, dist/lerp/clamp â ${e??``}. 2467 No DOM, Math.random, Date.now or storage: peers must agree.`),[()=>(Q(p),K(()=>Q(p).length?`return { `+Q(p).map(e=>e.name).join(`, `)+` }`:`drives its object (object, base, data)`))]),X(e,t)},M=e=>{var t=p9e(),n=N(t);n.textContent=`object, base ({pos, rot, scale, visible}), data, time â keep it a pure function 2468 of these so peers stay in sync.`;var r=g(n,2),i=e=>{var t=f9e(),n=f(t);O(()=>Y(n,`line ${Q(x),K(()=>Q(x)[0].line)??``}: ${Q(x),K(()=>Q(x)[0].message)??``}${Q(x),K(()=>Q(x).length>1?` (+`+(Q(x).length-1)+` more)`:``)??``}`)),X(e,t)};G(r,e=>{Q(x),K(()=>Q(x).length)&&e(i)}),X(e,t)};G(S,e=>{Q(c)?e(w):Q(m)?e(ee,1):e(M,-1)}),H(t),ne(t,e=>Kh?.(e)),ne(t,(e,t)=>$h?.(e,t),()=>({key:`script`,title:`Script`,openStore:Rc,isOpen:e=>!!e,close:()=>Rc.set(null)})),Z(`click`,r,()=>Rc.set(null)),X(e,t)};G(M,e=>{Q(s)&&e(te)}),X(e,ee),ue(),o()}var g9e=V(`<input class="w-14 rounded-sm bg-gray-700 px-1 py-0.5" type="number" placeholder="min"/> <input class="w-14 rounded-sm bg-gray-700 px-1 py-0.5" type="number" placeholder="max"/> <input class="w-14 rounded-sm bg-gray-700 px-1 py-0.5" type="number" placeholder="step"/>`,1),_9e=V(`<input class="flex-1 rounded-sm bg-gray-700 px-1 py-0.5" placeholder="red,green,blue"/>`),v9e=V(`<div class="flex items-center gap-1 text-xs"><input class="w-24 rounded-sm bg-gray-700 px-1 py-0.5" placeholder="key"/> <select class="rounded-sm bg-gray-700 px-1 py-0.5"><option>range</option><option>select</option></select> <!> <button class="rounded-sm bg-gray-600 px-1">â</button></div>`),y9e=V(`<button class="rounded-sm bg-red-700 px-3 py-1">Delete definition</button>`),b9e=V(`<span></span>`),x9e=V(`<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"><div class="flex h-[80vh] w-[640px] max-w-[95vw] flex-col gap-2 rounded-lg bg-gray-800 p-4 text-white shadow-xl"><div class="flex items-center justify-between"><span class="text-lg font-semibold"> </span> <button class="rounded-sm bg-gray-600 px-2">â</button></div> <label class="flex items-center gap-2 text-sm">Name <input class="flex-1 rounded-sm bg-gray-700 px-2 py-1" placeholder="Wobble"/></label> <div class="text-sm"><div class="mb-1 flex items-center justify-between"><span>
2468Controls</span> <button class="rounded-sm bg-gray-600 px-2 text-xs">+ add</button></div> <div class="flex max-h-40 flex-col gap-1 overflow-y-auto"></div></div> <span class="text-sm">Code (object, base, data, time â controls arrive in data)</span> <div class="min-h-0 flex-1"><!></div> <div class="flex justify-between"><!> <button class="rounded-sm bg-[#ff4000] px-3 py-1">Save for everyone</button></div></div></div>`);function S9e(e,t){Ce(t,!1);let n=()=>z(zc,`$nodeDesignerOpen`,r),[r,i]=Ve(),a=F(``),o=F([]),s=F(``),c=F(null),l=F(null);function p(){I(o,[...Q(o),{key:`param`+(Q(o).length+1),kind:`range`,min:0,max:10,step:.1}])}function y(e){I(o,Q(o).filter((t,n)=>n!==e))}function b(){Q(a).trim()&&(Pne({id:Q(c)??crypto.randomUUID(),name:Q(a).trim(),params:Q(o).filter(e=>e.key.trim()).map(e=>e.kind===`select`?{key:e.key.trim(),kind:`select`,options:(e.optionsText??(e.options??[]).join(`,`)).split(`,`).map(e=>e.trim()).filter(Boolean)}:{key:e.key.trim(),kind:`range`,min:+e.min||0,max:+e.max||10,step:+e.step||.1}),code:Q(s)}),zc.set(null))}function x(){Q(c)&&Lne(Q(c)),zc.set(null)}d(()=>(n(),Q(l)),()=>{if(n()&&n()!==Q(l)){I(l,n());let e=n();e===`new`?(I(c,null),I(a,`My node`),I(o,[{key:`speed`,kind:`range`,min:0,max:10,step:.1}]),I(s,`// object, base ({pos, rot, scale, visible}), data, time 2469// node controls arrive in data (data.speed here) 2470object.rotation.y = base.rot[1] + time * (data.speed ?? 1); 2471`)):(I(c,e.id),I(a,e.name),I(o,(e.params??[]).map(e=>({...e,options:e.options?[...e.options]:void 0}))),I(s,e.code??``))}}),d(()=>n(),()=>{n()||I(l,null)}),h(),R();var C=fe(),w=N(C),T=e=>{var t=x9e(),n=j(t),r=j(n),i=j(r),l=f(i,!0),d=g(i,2);H(r);var h=g(r,2),C=g(j(h));v(C),H(h);var w=g(h,2),T=j(w),E=g(j(T),2);H(T);var D=g(T,2);B(D,5,()=>Q(o),Be,(e,t,n)=>{var r=v9e(),i=j(r);v(i);var a=g(i,2),s=j(a);s.value=s.__value=`range`;var c=g(s);c.value=c.__value=`select`,H(a),_(a);var l=g(a,2),d=e=>{var n=g9e(),r=N(n);v(r);var i=g(r,2);v(i);var a=g(i,2);v(a),S(r,()=>Q(t).min,e=>(Q(t).min=e,be(()=>Q(o)))),S(i,()=>Q(t).max,e=>(Q(t).max=e,be(()=>Q(o)))),S(a,()=>Q(t).step,e=>(Q(t).step=e,be(()=>Q(o)))),X(e,n)},f=e=>{var n=_9e();v(n),O(e=>u(n,e),[()=>(Q(t),K(()=>Q(t).optionsText??(Q(t).options??[]).join(`,`)))]),Z(`input`,n,e=>(Q(t).optionsText=e.currentTarget.value,be(()=>Q(o)))),X(e,n)};G(l,e=>{Q(t),K(()=>Q(t).kind===`range`)?e(d):e(f,-1)});var p=g(l,2);H(r),S(i,()=>Q(t).key,e=>(Q(t).key=e,be(()=>Q(o)))),m(a,()=>Q(t).kind,e=>(Q(t).kind=e,be(()=>Q(o)))),Z(`click`,p,()=>y(n)),X(e,r)}),H(D),H(w);var k=g(w,4);S4(j(k),{get value(){return Q(s)},onChange:e=>I(s,e)}),H(k);var A=g(k,2),ee=j(A),M=e=>{var t=y9e();Z(`click`,t,x),X(e,t)},te=e=>{var t=b9e();X(e,t)};G(ee,e=>{Q(c)?e(M):e(te,-1)});var ne=g(ee,2);H(A),H(n),H(t),O(()=>Y(l,Q(c)?`Edit node definition`:`New custom node`)),Z(`click`,d,()=>zc.set(null)),S(C,()=>Q(a),e=>I(a,e)),Z(`click`,E,p),Z(`click`,ne,b),X(e,t)};G(w,e=>{n()&&e(T)}),X(e,C),ue(),i()}var C9e=V(`<div id="flow-list"><div class="resize-cue absolute -top-1 left-0 right-0 z-30 h-2 cursor-ns-resize hover:bg-primary-600/30" style="touch-action: none" title="Drag to resize"></div> <!> <button id="flow-undock" class="ui-button-quiet absolute right-2 top-2 z-10" title="Undock into a floating window">â§</button> <div class="relative"><!> <!></div></div>`),w9e=V(`<div id="flow-window" class="ui-panel fixed flex flex-col overflow-hidden"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span>Node editor</span> <span class="flex-1"></span> <button id="flow-add-view" class="ui-button-quiet" title="Add a view (Flow Code, Animation, UV editor, Shader editor)">ï¼</button> <button id="flow-dock" class="ui-button-quiet" title="Dock to the bottom">â© Dock</button> <button class="ui-button-quiet" title="Close (N)">â</button></div> <div class="relative min-h-0 flex-1"><!> <!></div> <div class="resize-cue absolute bottom-0 right-0 z-10 h-3.5 w-3.5 cursor-se-resize rounded-tl bg-gray-500/40" style="touch-action: none" title="Drag to resize · double-click to reset size"></div></div>`),T9e=V(`<!> <!> <!> <!>`,1);function E9e(e,n){Ce(n,!0);let i=()=>z(Ad,`$dockModeArm`,u),a=()=>z(Qh,`$tabGroups`,u),o=()=>z(is,`$flowGraphClose`,u),s=()=>z(Md,`$dockHeight`,u),c=()=>z(Ld,`$visibleDockKey`,u),l=()=>z(Fd,`$dockMinimized`,u),[u,d]=Ve(),f=e=>Math.min(Math.max(e||320,200),Math.round(window.innerHeight*.8)),p={minW:280,minH:240},m={w:760,h:480},h=t(!0),_=t(Ne(typeof localStorage<`u`?nt.getItem(`flowPaletteOpen`)!==`false`:!0)),v=t(760),y=t(480);function b(){if(typeof window>`u`)return;let e=Xh(Q(v),Q(y),p);I(v,e.w,!0),I(y,Math.min(e.h,Math.round(window.innerHeight*.9)),!0)}typeof localStorage<`u`&&(I(h,nt.getItem(`flowDocked`)!==`false`),I(v,parseInt(nt.getItem(`flowWinW`)??`760`)||760,!0),I(y,parseInt(nt.getItem(`flowWinH`)??`480`)||480,!0),b()),typeof window<`u`&&window.matchMedia?.(`(pointer: coarse)`).matches&&!U(rs)&&I(h,!0),_e(()=>{b();let e=()=>b();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)});function x(e){I(h,e,!0),nt.setItem(`flowDocked`,String(e)),e?jd(`flow`):Nd(`flow`)}Qe(()=>{let e=i();e&&e.key===`flow`&&(Ad.set(null),K(()=>{e.docked!==Q(h)&&x(e.docked),is.set(!1)}))});let S=q(()=>a().find(e=>e.members.includes(`flow`))??null),C=q(()=>Q(S)?Q(S).rect.width:Q(v)),w=q(()=>Q(S)?Q(S).rect.height:Q(y)),T=t(null),E=gge();function D(e){let t=e.currentTarget.getBoundingClientRect();I(T,{x:t.left,y:t.bottom+4},!0)}Qe(()=>(Od(`flow`,!o()&&Q(h),s()),()=>Od(`flow`,!1)));let k=q(()=>c()===`flow`&&!l()),A=t(!1);function ee(e){I(A,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function M(e){Q(A)&&Md.update(t=>f(t-e.movementY))}function te(e){Q(A)&&(I(A,!1),e.currentTarget.releasePointerCapture?.(e.pointerId))}let P=t(!1);function re(e){I(P,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()}function ie(e){if(!Q(P))return;let t=Q(S)?Q(S).rect.width:Q(v),n=Q(S)?Q(S).rect.height:Q(y),r=Gh(e.currentTarget.parentElement),i=Yh(t+e.movementX,n+e.movementY,r.left,r.top,p);I(v,i.w,!0),I(y,i.h,!0),ag(`flow`,Q(v),Q(y))}function F(){let e=Xh(m.w,m.h,p);I(v,e.w,!0),I(y,e.h,!0),ag(`flow`,Q(v),Q(y)),nt.setItem(`flowWinW`,String(Q(v))),nt.setItem(`flowWinH`,String(Q(y)))}function ae(e){Q(P)&&(I(P,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),nt.setItem(`flowWinW`,String(Q(v))),nt.setItem(`flowWinH`,String(Q(y))))}var oe=T9e(),R=N(oe),se=e=>{var t=fe(),n=N(t),i=e=>{var t=C9e(),n=j(t),i=g(n,2);TS(i,{});var a=g(i,2),o=g(a,2),c=j(o);R2(c,{children:(e,t)=>{y4(e,{get paletteOpen(){return Q(_)},set paletteOpen(e){I(_,e,!0)}})},$$slots:{default:!0}}),R2(g(c,2),{children:(e,t)=>{w4(e,{})},$$slots:{default:!0}}),H(o),H(t),O(()=>{r(t,1,`fixed inset-x-0 bottom-0 bg-white p-2 dark:bg-gray-800 ${Q(k)?``:`hidden`}`),Ze(t,`z-index: var(--z-bottom); height: ${s()??``}px; border-top: 1px solid rgb(55 65 81 / 0.6)`),Ze(o,`height: ${s()-16}px`)}),L(`pointerdown`,n,ee),L(`pointermove`,n,M),L(`pointerup`,n,te),L(`click`,a,()=>x(!1)),Me(3,t,()=>To,()=>({y:320,duration:200})),X(e,t)},a=e=>{var t=w9e();let n;var r=j(t),i=g(j(r),4),a=g(i,2),o=g(a,2);H(r);var s=g(r,2),c=j(s);R2(c,{children:(e,t)=>{y4(e,{get paletteOpen(){return Q(_)},set paletteOpen(e){I(_,e,!0)}})},$$slots:{default:!0}}),R2(g(c,2),{children:(e,t)=>{w4(e,{})},$$slots:{default:!0}}),H(s);var l=g(s,2);H(t),ne(t,(e,t)=>Zh?.(e,t),()=>({key:`flowWin`,defaultRect:{left:120,top:90}})),ne(t,(e,t)=>Kh?.(e,t),()=>`flow`),ne(t,(e,t)=>$h?.(e,t),()=>({key:`flow`,title:`Node editor`,openStore:is,isOpen:e=>!e,close:()=>is.set(!0),minW:460,minH:320})),ne(t,(e,t)=>uS?.(e,t),()=>({key:`flow`})),ne(t,(e,t)=>lq?.(e,t),()=>({key:`flow`})),O(()=>n=Ze(t,`z-index: var(--z-window)`,n,{width:`${Q(C)??``}px`,height:`${Q(w)??``}px`})),L(`click`,i,D),L(`click`,a,()=>x(!0)),L(`click`,o,()=>is.set(!0)),L(`pointerdown`,l,re),L(`pointermove`,l,ie),L(`pointerup`,l,ae),L(`dblclick`,l,F),X(e,t)};G(n,e=>{Q(h)?e(i):e(a,-1)}),X(e,t)};G(R,e=>{o()||e(se)});var ce=g(R,2);h9e(ce,{});var le=g(ce,2);S9e(le,{});var de=g(le,2),pe=e=>{xS(e,{get x(){return Q(T).x},get y(){return Q(T).y},get items(){return E},$$events:{close:()=>I(T,null)}})};G(de,e=>{Q(T)&&e(pe)}),X(e,oe),ue(),d()}ge([`pointerdown`,`pointermove`,`pointerup`,`click`,`dblclick`]);var D9e=V(`<span class="tp-seg" role="group" aria-label="Code format"><button id="flow-code-format-text" class="tp-seg-btn" title="Compact text: id = type "label" params @x,y and a.out -> b.in (unapplied edits are dropped)">Text</button> <button id="flow-code-format-json" class="tp-seg-btn" title="The graph as JSON (unapplied edits are dropped)">JSON</button></span> <button class="ui-button-quiet" title="Reload the text from the graph">â» Reload</button>
2471 <button class="ui-button-quiet text-primary-400" title="Apply the text to the graph (replaces it)">Apply</button>`,1),O9e=V(`<div class="flex shrink-0 items-center gap-1 border-b border-gray-700/60 px-2 py-1"><span class="flex-1"></span> <!></div>`),k9e=V(`<div class="shrink-0 bg-red-900/40 px-2 py-1 text-[11px] text-red-300"> </div>`),A9e=V(`<!> <!> <div class="min-h-0 flex-1 p-1"><!></div>`,1),j9e=V(`<div id="flow-code-dock"><div class="resize-cue absolute -top-1 left-0 right-0 z-30 h-2 cursor-ns-resize hover:bg-primary-600/30" style="touch-action: none" title="Drag to resize"></div> <!> <div class="flex shrink-0 items-center gap-1 pb-1"><span class="text-xs font-semibold text-gray-200">Flow Code</span> <span class="flex-1"></span> <!> <button class="ui-button-quiet" title="Undock into a floating window">â§</button> <button class="ui-button-quiet" title="Close">â</button></div> <div class="flex min-h-0 flex-1 flex-col"><!></div></div>`),M9e=V(`<div id="flow-code-window" class="ui-panel fixed flex flex-col overflow-hidden"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span>Flow Code</span> <span class="flex-1"></span> <!> <button class="ui-button-quiet" title="Dock to the bottom">â© Dock</button> <button class="ui-button-quiet" title="Close">â</button></div> <!> <div class="resize-cue absolute bottom-0 right-0 z-10 h-3.5 w-3.5 cursor-se-resize rounded-tl bg-gray-500/40" style="touch-action: none" title="Drag to resize"></div></div>`);function N9e(e,n){Ce(n,!0);let i=()=>z(Ad,`$dockModeArm`,u),a=()=>z(Qh,`$tabGroups`,u),o=()=>z(Wo,`$flowCodeClose`,u),s=()=>z(Md,`$dockHeight`,u),c=()=>z(Ld,`$visibleDockKey`,u),l=()=>z(Fd,`$dockMinimized`,u),[u,d]=Ve(),p=e=>{var t=D9e(),n=N(t),r=j(n),i=g(r,2);H(n);var a=g(n,2),o=g(a,2);O(()=>{b(r,`aria-pressed`,Q(S)===`text`),b(i,`aria-pressed`,Q(S)===`json`)}),L(`click`,r,()=>k(`text`)),L(`click`,i,()=>k(`json`)),L(`click`,a,()=>I(h,D(),!0)),L(`click`,o,M),X(e,t)},m=e=>{var t=A9e(),n=N(t),r=e=>{var t=O9e(),n=g(j(t),2);p(n),H(t),X(e,t)};G(n,e=>{Q(w)&&e(r)});var i=g(n,2),a=e=>{var t=k9e(),n=f(t,!0);O(()=>Y(n,Q(_))),X(e,t)};G(i,e=>{Q(_)&&e(a)});var o=g(i,2);S4(j(o),{get value(){return Q(h)},onChange:e=>I(h,e,!0)}),H(o),X(e,t)},h=t(``),_=t(``),v=t(!0),y=t(460),x=t(440),S=t(`text`);typeof localStorage<`u`&&(I(S,nt.getItem(`flowCodeFormat`)===`json`?`json`:`text`,!0),I(v,nt.getItem(`flowCodeDocked`)!==`false`),I(y,parseInt(nt.getItem(`flowCodeWinW`)??`460`)||460,!0),I(x,parseInt(nt.getItem(`flowCodeWinH`)??`440`)||440,!0));function C(e){I(v,e,!0),nt.setItem(`flowCodeDocked`,String(e)),e?jd(`flowcode`):Nd(`flowcode`)}Qe(()=>{let e=i();e&&e.key===`flowcode`&&(Ad.set(null),K(()=>{e.docked!==Q(v)&&C(e.docked),Wo.set(!1)}))});let w=q(()=>a().find(e=>e.members.includes(`flowcode`))??null),T=q(()=>Q(w)?Q(w).rect.width:Q(y)),E=q(()=>Q(w)?Q(w).rect.height:Q(x));function D(){let e={nodes:U(Oc).map(iu),edges:U(Ic).map(eu)};return Q(S)===`text`?Cge(e):JSON.stringify(e,null,2)}function k(e){e!==Q(S)&&(I(S,e,!0),nt.setItem(`flowCodeFormat`,e),I(h,D(),!0),I(_,``))}function A(){if(Q(S)===`json`)try{return JSON.parse(Q(h))}catch(e){return`Invalid JSON: `+(e?.message??e)}let{graphs:e,order:t,errors:n}=wge(Q(h));if(n.length)return n.slice(0,3).map(e=>e.message).join(` · `)+(n.length>3?` (+`+(n.length-3)+` more)`:``);let r=t.filter(t=>e[t].nodes.length||e[t].edges.length);return r.length>1?`This view edits ONE graph; remove the @graph sections`:e[r[0]??``]??{nodes:[],edges:[]}}Qe(()=>{o()||(I(h,D(),!0),I(_,``))}),Qe(()=>(Od(`flowcode`,!o()&&Q(v),s()),()=>Od(`flowcode`,!1)));let ee=q(()=>c()===`flowcode`&&!l());function M(){let e=A();if(typeof e==`string`){I(_,e,!0);return}if(!e||!Array.isArray(e.nodes)){I(_,`Expected an object like { "nodes": [...], "edges": [...] }`);return}let t=Array.isArray(e.edges)?e.edges:[];if(e.nodes.some(e=>!e||!e.id||!e.type)){I(_,`Every node needs at least an "id" and a "type"`);return}let n=new Map(U(Oc).map(e=>[e.id,e.position])),r=0,i=Math.max(0,...e.nodes.filter(e=>e.position).map(e=>Number(e.position.y)||0)),a=e.nodes.map(e=>e.position?e:{...e,position:n.get(e.id)??{x:60+r%4*190,y:i+130+Math.floor(r++/4)*130}}),o=new Set(a.map(e=>e.id)),s=new Set(t.map(e=>e.id)),c=U(Oc).map(e=>e.id).filter(e=>!o.has(e)),l=U(Ic).map(e=>e.id).filter(e=>!s.has(e));Oc.set(a),Ic.set(t);let u=U(Es);u&&(c.length&&u.send({type:`nodedelete`,ids:c}),l.length&&u.send({type:`edgedelete`,ids:l}
2471),u.send({type:`nodes`,nodes:a.map(iu),edges:t.map(eu)})),I(_,``)}let te=e=>Math.min(Math.max(e||320,200),Math.round(window.innerHeight*.8)),P=t(!1),re=t(!1);function ie(e){I(P,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function F(e){Q(P)&&Md.update(t=>te(t-e.movementY))}function ae(e){Q(P)&&(I(P,!1),e.currentTarget.releasePointerCapture?.(e.pointerId))}function oe(e){I(re,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()}function R(e){if(!Q(re))return;let t=Q(w)?Q(w).rect.width:Q(y),n=Q(w)?Q(w).rect.height:Q(x);I(y,Math.min(Math.max(320,t+e.movementX),window.innerWidth-8),!0),I(x,Math.min(Math.max(240,n+e.movementY),window.innerHeight),!0),ag(`flowcode`,Q(y),Q(x))}function se(e){Q(re)&&(I(re,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),nt.setItem(`flowCodeWinW`,String(Q(y))),nt.setItem(`flowCodeWinH`,String(Q(x))))}var ce=fe(),le=N(ce),de=e=>{var t=fe(),n=N(t),i=e=>{var t=j9e(),n=j(t),i=g(n,2);TS(i,{});var a=g(i,2),o=g(j(a),4);p(o);var c=g(o,2),l=g(c,2);H(a);var u=g(a,2),d=j(u);m(d),H(u),H(t),O(()=>{r(t,1,`fixed inset-x-0 bottom-0 flex flex-col bg-white p-2 dark:bg-gray-800 ${Q(ee)?``:`hidden`}`),Ze(t,`z-index: var(--z-bottom); height: ${s()??``}px; border-top: 1px solid rgb(55 65 81 / 0.6)`)}),L(`pointerdown`,n,ie),L(`pointermove`,n,F),L(`pointerup`,n,ae),L(`click`,c,()=>C(!1)),L(`click`,l,()=>Wo.set(!0)),X(e,t)},a=e=>{var t=M9e();let n;var r=j(t),i=g(j(r),4),a=e=>{p(e)};G(i,e=>{Q(w)||e(a)});var o=g(i,2),s=g(o,2);H(r);var c=g(r,2);m(c);var l=g(c,2);H(t),ne(t,(e,t)=>Zh?.(e,t),()=>({key:`flowCode`,defaultRect:{left:160,top:120}})),ne(t,(e,t)=>Kh?.(e,t),()=>`flowcode`),ne(t,(e,t)=>$h?.(e,t),()=>({key:`flowcode`,title:`Flow Code`,openStore:Wo,isOpen:e=>!e,close:()=>Wo.set(!0)})),ne(t,(e,t)=>uS?.(e,t),()=>({key:`flowcode`})),O(()=>n=Ze(t,`z-index: var(--z-window); max-width: 96vw; max-height: 85vh`,n,{width:`${Q(T)??``}px`,height:`${Q(E)??``}px`})),L(`click`,o,()=>C(!0)),L(`click`,s,()=>Wo.set(!0)),L(`pointerdown`,l,oe),L(`pointermove`,l,R),L(`pointerup`,l,se),X(e,t)};G(n,e=>{Q(v)?e(i):e(a,-1)}),X(e,t)};G(le,e=>{o()||e(de)}),X(e,ce),ue(),d()}ge([`click`,`pointerdown`,`pointermove`,`pointerup`]);var P9e=V(`<div class="flex flex-1 items-center justify-center p-6 text-center text-sm text-gray-400">Select an object in the viewport to see and edit its animation.</div>`),F9e=V(`<button><span class="min-w-0 truncate"> </span> <span class="shrink-0 text-[10px] tabular-nums text-gray-500"> </span></button>`),I9e=V(`<p id="animation-behavior-note" class="px-2 pb-1 text-[10px] leading-snug text-amber-300/90"> </p>`),L9e=V(`<div id="animation-clips" class="border-b border-gray-700/60"><div class="flex items-center justify-between px-2 pt-1.5"><span class="text-[10px] uppercase tracking-wider text-gray-500">Imported clips</span> <span class="text-[10px] text-gray-500"> </span></div> <div class="max-h-24 overflow-y-auto p-1"></div> <!> <div class="flex items-center gap-2 px-2 pb-1"><button id="clip-play" class="ui-button-quiet text-primary-400"> </button> <input type="range" min="0.1" max="3" step="0.1" class="min-w-0 flex-1 accent-primary-600" aria-label="Clip speed"/> <span class="shrink-0 text-[10px] tabular-nums text-gray-400"> </span></div></div>`),R9e=V(`<input class="w-full rounded-sm border border-primary-500 bg-gray-900 px-1 py-0.5 text-xs text-gray-100" aria-label="Clip name"/>`),z9e=V(`<button title="Edit this clip (and make it the object's default)"><span class="min-w-0 truncate"> </span> <span class="shrink-0 text-[10px] tabular-nums text-gray-500"> </span></button>`),B9e=V(`<div id="authored-clips" class="border-b border-gray-700/60"><div class="flex items-center justify-between px-2 pt-1.5"><span class="text-[10px] uppercase tracking-wider text-gray-500">Clips</span> <span class="text-[10px] text-gray-500"> </span></div> <div class="overflow-y-auto p-1"></div> <div id="animation-clips-resize" class="group h-1.5 cursor-ns-resize border-t border-gray-700/60 bg-gray-800/40 hover:bg-primary-700/40" style="touch-action: none" title="Drag to resize the clip list"></div></div>`),D4=V(`<option> </option>`),V9e=V(`<div class="p-3 text-center text-[11px] text-gray-500"> </div>`),H9e=V(`<div><button>
2471 </button> <span class="shrink-0 text-[10px] tabular-nums text-gray-500"> </span> <button class="ui-button-quiet shrink-0 text-red-400" title="Remove" aria-label="Remove channel">â</button></div>`),U9e=V(`<input class="w-full rounded-sm border border-primary-500 bg-gray-900 px-1 py-0.5 text-xs text-gray-100" aria-label="Marker name"/>`),W9e=V(`<div class="flex items-center gap-1"><button class="min-w-0 flex-1 truncate px-2 py-1 text-left text-xs text-gray-300 hover:bg-gray-700/60" title="Go to this marker (double-click to rename)"> </button> <span class="shrink-0 text-[10px] tabular-nums text-gray-500"> </span> <button class="ui-button-quiet shrink-0 text-red-400" title="Remove marker" aria-label="Remove marker">â</button></div>`),G9e=V(`<div id="animation-marker-list" class="shrink-0 border-t border-gray-700/60"><div class="flex items-center justify-between px-2 pt-1.5"><span class="text-[10px] uppercase tracking-wider text-gray-500">Markers</span> <span class="text-[10px] text-gray-500"> </span></div> <div class="overflow-y-auto p-1" style="max-height: 96px"></div></div>`),K9e=V(`<button id="animation-clear-range" class="rounded-sm border border-primary-600 px-1.5 py-0.5 text-primary-300 hover:bg-gray-700/70">A/B â</button>`),q9e=V(`<span class="shrink-0 rounded-sm bg-amber-500/20 px-1.5 py-0.5 text-[10px] font-medium text-amber-300"> </span>`),J9e=V(`<span class="shrink-0 text-[10px] text-primary-300"> </span>`),Y9e=V(`<span class="pointer-events-none absolute top-1/2 h-1 w-px -translate-y-1/2 bg-gray-500/70"></span>`),X9e=V(`<div id="animation-navigator" class="relative mx-2 mt-1.5 mb-1 h-3 shrink-0 cursor-pointer rounded-full bg-gray-900/70" style="touch-action: none" title="The whole clip â drag the bar to move the visible window"><!> <span class="pointer-events-none absolute inset-y-0 rounded-full border border-primary-500/70 bg-primary-500/25"></span> <span class="pointer-events-none absolute inset-y-0 w-px bg-amber-400"></span></div>`),Z9e=V(`<div class="flex h-full items-center justify-center text-center text-sm text-gray-500">Add a movement to build a timeline.</div>`),Q9e=je(`<line stroke="rgb(75 85 99 / 0.35)" pointer-events="none"></line><text font-size="9" fill="rgb(107 114 128)" pointer-events="none"> </text>`,1),$9e=je(`<line stroke="rgb(45 212 191 / 0.55)" stroke-width="1" stroke-dasharray="3 2" pointer-events="none"></line><rect width="7" class="cursor-ew-resize"></rect><text font-size="8" fill="rgb(153 246 228)" pointer-events="none"> </text>`,1),eet=je(`<rect id="animation-markers" x="0" fill="rgb(17 24 39 / 0.7)" pointer-events="none"></rect><!>`,1),O4=je(`<rect fill="rgb(17 24 39 / 0.55)" pointer-events="none"></rect>`),tet=je(`<!><!><line stroke="rgb(34 197 94 / 0.9)" stroke-width="1.5" pointer-events="none"></line><line stroke="rgb(239 68 68 / 0.9)" stroke-width="1.5" pointer-events="none"></line><text font-size="8" fill="rgb(34 197 94)" pointer-events="none">A</text><text font-size="8" fill="rgb(239 68 68)" pointer-events="none">B</text>`,1),net=je(`<rect width="8" height="8" class="cursor-ew-resize" stroke="rgb(17 24 39)"></rect>`),ret=je(`<line></line><!>`,1),iet=je(`<g data-anim-tangents="1"><line stroke="rgb(56 189 248 / 0.7)" stroke-width="1" stroke-dasharray="2 2" pointer-events="none"></line><line stroke="rgb(56 189 248 / 0.7)" stroke-width="1" stroke-dasharray="2 2" pointer-events="none"></line><circle id="animation-tangent-1" r="4.5" fill="rgb(56 189 248)" stroke="rgb(17 24 39)"></circle><circle id="animation-tangent-2" r="4.5" fill="rgb(56 189 248)" stroke="rgb(17 24 39)"></circle></g>`),aet=je(`<circle r="5" class="cursor-move" stroke="rgb(17 24 39)"></circle>`),oet=je(`<path fill="none" stroke="rgb(129 140 248)" stroke-width="2"></path><!><!><text font-size="9" fill="rgb(107 114 128)"> </text><text font-size="9" fill="rgb(107 114 128)"> </text>`,1),set=je(`<rect id="animation-marquee" fill="rgb(129 140 248 / 0.12)" stroke="rgb(129 140 248 / 0.9)" stroke-width="1" stroke-dasharray="4 3" pointer-events="none"></rect>`),cet=je(`<polygon id="animation-lasso" fill="rgb(129 140 248 / 0.12)" stroke="rgb(129 140 248 / 0.9)" stroke-width="1" stroke-dasharray="4 3" pointer-events="none"></polygon>`),uet=je(`<svg id="animation-timeline" class="touch-none select-none rounded-sm bg-gray-900/60" role="application" aria-label="Timeline"><rect x="0" y="0" fill="rgb(31 41 55 / 0.8)" class="cursor-ew-resize"></rect><!><!><!><!><line stroke="rgb(250 204 21 / 0.9)" stroke-width="1.5"></line><!></svg>`),det=V(`<div class="ui-section-label"> </div> <div class="mb-2 grid grid-cols-2 gap-2"><label class="text-[11px] text-gray-400">Time (s) <!></label> <label class="text-[11px] text-gray-400"> <!></label></div> <button class="mb-2 w-full rounded-sm border border-gray-600 px-1.5 py-0.5 text-[11px] text-gray-300 hover:bg-gray-700">Remove key</button>`,1),fet=V(`<div class="mb-2 text-[11px] text-gray-500"> </div>`),pet=V(`<button class="rounded-sm border border-gray-600 px-1.5 py-0.5 text-[10px] text-gray-300 hover:bg-gray-700"> </button>`),met=V(`<div class="ui-section-label"> </div> <svg class="touch-none rounded-sm bg-gray-900/60"><rect fill="none" stroke="rgb(75 85 99 / 0.6)"></rect><line stroke="rgb(75 85 99 / 0.45)"></line><line stroke="rgb(75 85 99 / 0.45)"></line><line stroke="rgb(75 85 99 / 0.35)" stroke-dasharray="3 3"></line><line stroke="rgb(129 140 248 / 0.5)"></line><line stroke="rgb(129 140 248 / 0.5)"></line><path fill="none" stroke="rgb(129 140 248)" stroke-width="2"></path><circle r="3" fill="rgb(148 163 184)"></circle><circle r="3" fill="rgb(148 163 184)"></circle><circle class="cursor-grab" r="6" fill="rgb(99 102 241)"></circle><circle class="cursor-grab" r="6" fill="rgb(99 102 241)"></circle></svg> <div class="mt-1 flex flex-wrap gap-1"></div>`,1),het=V(`<div class="text-[11px] text-gray-500"> </div>`),get=V(`<div class="ui-section-label">Movement</div> <label class="mb-2 block text-[11px] text-gray-400">Channel <select class="mt-0.5 w-full rounded-sm border border-gray-600 bg-gray-900 px-1 py-1 text-xs text-gray-200"></select></label> <!> <!>`,1),_et=V(`<div class="text-[11px] text-gray-500">Select a movement on the left.</div>`),vet=V(`<div class="flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-gray-700/60 px-2 py-1.5"><div class="flex items-center overflow-hidden rounded-md border border-gray-600/80 bg-gray-900/60 text-gray-300 [&>button]:px-1.5 [&>button]:py-1 [&>button:hover]:bg-gray-700/70"><button id="animation-rewind" title="Go to the start of the clip" aria-label="Go to start"><!></button> <button id="animation-prev-key" title="Previous key" aria-label="Previous key"><!></button> <button id="animation-play-back" title="Play backwards from here" aria-label="Play backwards"><!></button> <button id="animation-play"><!></button> <button id="animation-stop" title="Stop and go back to the frame this run started from" aria-label="Stop"><!></button> <button id="animation-next-key" class="border-l border-gray-600/80" title="Next key" aria-label="Next key"><!></button> <button id="animation-end" title="Go to the end of the clip" aria-label="Go to end"><!></button></div> <div class="flex min-w-40 flex-1 items-center gap-2"><input type="range" min="0" step="0.01" class="min-w-0 flex-1 accent-primary-500" aria-label="Playhead"/> <span class="shrink-0 font-mono text-[11px] tabular-nums text-gray-300"> <span class="text-gray-500"> </span></span></div> <div class="flex items-center gap-1.5"><label class="flex items-center gap-1 text-[11px] text-gray-400" title="Clip length. Keys keep their times â use ï¼ â¸ Retime to stretch the movement itself."><span>length</span> <!></label> <label class="flex items-center gap-1 text-[11px] text-gray-400" title="Playback rate â how fast it runs, without changing any keys"><span>speed</span> <!></label> <label class="flex items-center gap-1 text-[11px] text-gray-400" title="Frames per second for THIS clip â what its key times mean, and the grid the arrows and snapping use"><span>fps</span> <!></label> <label class="flex items-center gap-1 text-[11px] text-gray-400" title="Sample the movement on a COARSER grid than its keys â the stepped 'on twos' look. 0 = smooth."><span>step</span> <!></label> <select class="rounded-sm border border-gray-600 bg-gray-900 px-1 py-0.5 text-xs" aria-label="Loop mode"><option>Loop</option><option>Once</option><option>Ping-pong</option></select></div> <div class="flex items-center gap-1.5"><button id="animation-autokey" aria-label="Auto-key"><span>â</span> REC</button> <button id="animation-add" class="shrink-0 rounded-md border border-gray-600 px-2 py-1 text-xs text-gray-300 hover:bg-gray-700/70" title="Add movements, keys, presets and clips" aria-label="Add">ï¼</button></div></div> <div class="flex min-h-0 flex-1"><div class="flex w-56 shrink-0 flex-col border-r border-gray-700/60"><!> <!> <div class="flex items-center justify-between px-2 pt-1.5"><span class="text-[10px] uppercase tracking-wider text-gray-500">Channels</span> <span class="text-[10px] text-gray-500"> </span></div> <div class="flex items-center gap-1 border-b border-gray-700/60 p-1.5"><select class="min-w-0 flex-1 rounded-sm border border-gray-600 bg-gray-900 px-1 py-0.5 text-xs" aria-label="Channel to animate"></select> <button class="ui-button-quiet shrink-0" title="Animate this channel" aria-label="Add channel">ï¼</button></div> <div class="min-h-0 flex-1 overflow-y-auto"><!> <!></div> <!></div> <div class="flex min-w-0 flex-1 flex-col" tabindex="-1"><div class="flex shrink-0 items-center gap-2 border-b border-gray-700/60 px-2 py-1 text-[11px] text-gray-400"><button>
2471Sheet</button> <button>Graph</button> <div class="flex items-center overflow-hidden rounded-sm border border-gray-600"><button id="animation-mode-move" title="Move keys (1)">Move</button> <button id="animation-mode-scale" title="Scale keys about the playhead (2)">Scale</button></div> <div class="flex items-center overflow-hidden rounded-sm border border-gray-600"><button id="animation-marquee-box" title="Box select keys (drag a rectangle on the plot; Shift adds)" aria-label="Box select"><!></button> <button id="animation-marquee-lasso" title="Lasso select keys (draw around them on the plot; Shift adds)" aria-label="Lasso select"><!></button></div> <button id="animation-onion" title="Onion skin: faint copies of the object at the keys either side of the playhead (local only)" aria-label="Onion skin"><!></button> <label class="flex items-center gap-1" title="What key times snap to while you drag">snap <select id="animation-snap" class="rounded-sm border border-gray-600 bg-gray-900 px-1 py-0.5 text-[11px]"><option>off</option><option> </option><option>0.1s</option><option>0.5s</option></select></label> <div class="flex items-center gap-1"><button id="animation-mark-in" class="rounded-sm border border-gray-600 px-1.5 py-0.5 hover:bg-gray-700/70" title="Set the loop START here (A)">A</button> <button id="animation-mark-out" class="rounded-sm border border-gray-600 px-1.5 py-0.5 hover:bg-gray-700/70" title="Set the loop END here (B)">B</button> <!></div> <span class="cursor-help text-gray-500" title="Double-click empty space adds a key · drag moves it · shift-click builds a
2471selection · RIGHT-CLICK locks the selection to the pointer (click to place, Esc to cancel) · Del removes · ctrl+wheel zooms, wheel pans">?</span> <div class="flex items-center gap-0.5"><button class="rounded-sm border border-gray-600 p-0.5 hover:bg-gray-700/70" title="Zoom out" aria-label="Zoom out"><!></button> <button class="rounded-sm border border-gray-600 p-0.5 hover:bg-gray-700/70" title="Zoom in" aria-label="Zoom in"><!></button> <button id="animation-fit" class="rounded-sm border border-gray-600 p-0.5 hover:bg-gray-700/70" title="Fit the whole clip" aria-label="Fit"><!></button></div> <span class="flex-1"></span> <!> <span class="truncate font-mono text-[10px] text-gray-500"> </span></div> <!> <div><!></div></div> <div class="w-52 shrink-0 overflow-y-auto border-l border-gray-700/60 p-2"><!></div></div>`,1),yet=V(`<div id="animation-dock"><div class="resize-cue absolute -top-1 left-0 right-0 z-30 h-2 cursor-ns-resize hover:bg-primary-600/30" style="touch-action: none" title="Drag to resize"></div> <!> <div class="flex shrink-0 items-center gap-2 pb-1"><span class="text-xs font-semibold text-gray-200">Animation</span> <span class="text-[11px] text-gray-400"> </span> <span class="flex-1"></span> <button class="ui-button-quiet" title="Undock into a floating window" aria-label="Undock">â§</button> <button class="ui-button-quiet" title="Close" aria-label="Close">â</button></div> <div class="flex min-h-0 flex-1 flex-col"><!></div></div>`),bet=V(`<div id="animation-window" class="ui-panel fixed flex flex-col overflow-hidden"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span>Animation</span> <span class="text-[11px] font-normal text-gray-400"> </span> <span class="flex-1"></span> <button class="ui-button-quiet" title="Dock to the bottom">â© Dock</button> <button class="ui-button-quiet" title="Close" aria-label="Close">â</button></div> <!> <div class="resize-cue absolute bottom-0 right-0 z-10 h-3.5 w-3.5 cursor-se-resize rounded-tl bg-gray-500/40" style="touch-action: none" title="Drag to resize · double-click to reset size"></div></div>`),xet=V(`<!> <!>`,1);function Cet(e,n){Ce(n,!0);let i=()=>z(Di,`$selectedObject`,T),a=()=>z(i_,`$animations`,T),o=()=>z(Cg,`$animatedObjects`,T),s=()=>z(Ng,`$playback`,T),c=()=>z(Kce,`$playheads`,T),l=()=>z(Vg,`$autoKeyFor`,T),d=()=>z(Ad,`$dockModeArm`,T),m=()=>z(Qh,`$tabGroups`,T),h=()=>z($s,`$animationClose`,T),y=()=>z(Md,`$dockHeight`,T),x=()=>z(Ld,`$visibleDockKey`,T),S=()=>z(Fd,`$dockMinimized`,T),C=()=>z(Uce,`$clipboardSize`,T),w=()=>z(rF,`$showOnionSkin`,T),[T,E]=Ve(),k=e=>{var t=fe(),n=N(t),i=e=>{var t=P9e();X(e,t)},a=e=>{var t=vet(),n=N(t),i=j(n),a=j(i);xz(j(a),{size:14}),H(a);var o=g(a,2);eAe(j(o),{size:14}),H(o);var s=g(o,2);Vke(j(s),{size:14}),H(s);var c=g(s,2),l=j(c),d=e=>{hz(e,{size:14})},p=e=>{gz(e,{size:14})};G(l,e=>{Q(Oe)?e(d):e(p,-1)}),H(c);var m=g(c,2),h=j(m);_S(h,{size:13}),H(m);var y=g(m,2);nAe(j(y),{size:14}),H(y);var x=g(y,2);Sz(j(x),{size:14}),H(x),H(i);var S=g(i,2),C=j(S);v(C);var T=g(C,2),E=j(T,!0),k=g(E),ue=f(k);H(T),H(S);var de=g(S,2),z=j(de);hq(g(j(z),2),{id:`animation-length`,step:.01,decimals:2,min:.1,get value(){return Q(Ae)},onchange:e=>Q(A)&&Kg(Q(A).uuid,{duration:Math.max(.1,e)})}),H(z);var me=g(z,2);hq(g(j(me),2),{id:`animation-speed`,step:.01,decimals:2,min:.1,max:8,get value(){return Q(je)},onchange:e=>Q(A)&&ole(Q(A).uuid,e||1)}),H(me);var U=g(me,2);hq(g(j(U),2),{id:`animation-fps`,step:.25,decimals:0,min:1,max:240,get value(){return Q(sn)},onchange:e=>Q(A)&&Kg(Q(A).uuid,{fps:Math.round(e)})}),H(U);var ve=g(U,2),be=g(j(ve),2);{let e=q(()=>Q(te)?.step??0);hq(be,{id:`animation-step`,step:.25,decimals:0,min:0,max:240,get value(){return Q(e)},onchange:e=>{let t=Math.round(e);Q(A)&&Kg(Q(A).uuid,{step:t>=1?t:0})}})}H(ve);var K=g(ve,2),Ce=j(K);Ce.value=Ce.__value=`loop`;var Ne=g(Ce);Ne.value=Ne.__value=`once`;var Ve=g(Ne);Ve.value=Ve.__value=`pingpong`,H(K);var qe;_(K),H(de);var Je=g(de,2),Ye=j(Je),Xe=j(Ye);W(),H(Ye);var Qe=g(Ye,2);H(Je),H(n);var $e=g(n,2),et=j($e),$=j(et),tt=e=>{var t=L9e(),n=j(t),i=g(j(n),2),a=f(i,!0);H(n);var o=g(n,2);B(o,21,()=>Q(Ee),e=>e.name,(e,t)=>{var n=F9e(),i=j(n),a=f(i,!0),o=g(i,2),s=f(o);H(n),O(e=>{r(n,1,`flex w-full items-center justify-between gap-2 rounded-sm px-2 py-1 text-left text-xs hover:bg-gray-700/60 ${Q(Te)?.clip===Q(t).name?`bg-primary-900/40 text-primary-200`:`text-gray-300`}`),b(n,`title`,Q(J)?`Preview this clip here â not sent, not saved`:`Play this clip â on every peer`),Y(a,Q(t).name),Y(s,`${e??``}s`)},[()=>Q(t).duration.toFixed(2)]),L(`click`,n,()=>
2471Q(A)&&Sg(Q(A).uuid,{clip:Q(t).name,playing:!0})),X(e,n)}),H(o);var s=g(o,2),c=e=>{var t=I9e(),n=f(t);O(()=>Y(n,`${Q(J).type===`loop`&&Q(J).autoplay?`Ambient loop`:`Functional item`} â runs in 2472 Interact or Play${Q(J).type===`loop`&&Q(J).autoplay?``:` on its `+Q(J).trigger}. 2473 Here â¶ previews it once; nothing is sent or saved.`)),X(e,t)};G(s,e=>{Q(J)&&e(c)});var l=g(s,2),d=j(l),p=f(d,!0),m=g(d,2);v(m);var h=g(m,2),_=f(h);H(l),H(t),O(e=>{Y(a,Q(Ee).length),b(d,`title`,Q(Te)?.playing?`Pause the clip`:`Play the clip`),Y(p,Q(Te)?.playing?`â¸`:`â¶`),u(m,Q(Te)?.speed??1),Y(_,`${e??``}Ã`)},[()=>(Q(Te)?.speed??1).toFixed(1)]),L(`click`,d,()=>Q(A)&&Sg(Q(A).uuid,{playing:!Q(Te)?.playing})),L(`input`,m,e=>Q(A)&&Sg(Q(A).uuid,{speed:parseFloat(e.currentTarget.value)})),X(e,t)};G($,e=>{Q(Ee).length&&e(tt)});var rt=g($,2),it=e=>{var t=B9e(),n=j(t),i=g(j(n),2),a=f(i,!0);H(n);var o=g(n,2);B(o,21,()=>Q(re),e=>e.id,(e,t)=>{var n=fe(),i=N(n),a=e=>{var n=R9e();v(n),Fe(n,!0),O(()=>u(n,Q(t).name)),Z(`blur`,n,e=>{Q(A)&&tle(Q(A).uuid,Q(t).id,e.currentTarget.value),I(ge,null)}),L(`keydown`,n,e=>{e.key===`Enter`?e.currentTarget.blur():e.key===`Escape`&&I(ge,null)}),X(e,n)},o=e=>{var n=z9e(),i=j(n),a=f(i,!0),o=g(i,2),s=f(o);H(n),O(e=>{r(n,1,`flex w-full items-center justify-between gap-2 rounded-sm px-2 py-1 text-left text-xs hover:bg-gray-700/60 ${Q(t).active?`bg-primary-900/40 text-primary-200`:`text-gray-300`}`),Y(a,Q(t).name),Y(s,`${Q(t).tracks??``}âª${e??``}s`)},[()=>Q(t).duration.toFixed(1)]),L(`click`,n,()=>{Q(A)&&(lle(Q(A).uuid,Q(t).id),I(ie,null),I(R,[],!0))}),L(`dblclick`,n,()=>I(ge,Q(t).id,!0)),X(e,n)};G(i,e=>{Q(ge)===Q(t).id?e(a):e(o,-1)}),X(e,n)}),H(o);var s=g(o,2);H(t),O(()=>{Y(a,Q(re).length),Ze(o,`max-height: ${Q(_e)??``}px`)}),L(`pointerdown`,s,xe),L(`pointermove`,s,Se),L(`pointerup`,s,we),X(e,t)};G(rt,e=>{Q(re).length&&e(it)});var at=g(rt,2),ft=g(j(at),2),wt=f(ft,!0);H(at);var Tt=g(at,2),Ot=j(Tt);B(Ot,21,()=>Q(oe),Be,(e,t)=>{var n=D4(),r=f(n,!0),i={};O(e=>{Y(r,e),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)},[()=>kg(Q(t))]),X(e,n)}),H(Ot);var At;_(Ot);var Nt=g(Ot,2);H(Tt);var Rt=g(Tt,2),Vt=j(Rt),Ht=e=>{var t=V9e(),n=f(t,!0);O(()=>Y(n,Q(Ee).length?`This clip is empty. The modelâs own clips are listed above.`:`Nothing animated yet. Pick a channel and add it, or use ï¼ â¸ Presets.`)),X(e,t)};G(Vt,e=>{Q(P).length||e(Ht)});var Ut=g(Vt,2);B(Ut,17,()=>Q(P),e=>e.id,(e,t)=>{var n=H9e(),i=j(n),a=f(i,!0),o=g(i,2),s=f(o,!0),c=g(o,2);H(n),O((e,o)=>{r(n,1,`flex items-center gap-1 ${Q(F)?.id===Q(t).id?`bg-primary-900/40`:``}`),r(i,1,`min-w-0 flex-1 truncate px-2 py-1 text-left text-xs hover:bg-gray-700/60 ${Q(F)?.id===Q(t).id?`text-primary-200`:`text-gray-300`}`),b(i,`title`,e),Y(a,o),Y(s,Q(t).keys.length)},[()=>qce(Q(t).channel)?kg(Q(t).channel)+` â a look channel: it drives the material, so a GLTF export cannot carry it`:kg(Q(t).channel),()=>kg(Q(t).channel)]),L(`click`,i,()=>{I(ie,Q(t).id,!0),I(R,[],!0)}),L(`click`,c,()=>{Q(A)&&Vce(Q(A).uuid,Q(t).id)}),X(e,n)}),H(Rt);var Wt=g(Rt,2),Gt=e=>{var t=G9e(),n=j(t),r=g(j(n),2),i=f(r,!0);H(n);var a=g(n,2);B(a,21,()=>Q(yt),Be,(e,t,n)=>{var r=fe(),i=N(r),a=e=>{var r=U9e();v(r),Fe(r,!0),O(()=>u(r,Q(t).name)),Z(`blur`,r,e=>{Q(A)&&Xg(Q(A).uuid,n,{name:e.currentTarget.value}),I(qt,-1)}),L(`keydown`,r,e=>{e.key===`Enter`?e.currentTarget.blur():e.key===`Escape`&&I(qt,-1)}),X(e,r)},o=e=>{var r=W9e(),i=j(r),a=f(i,!0),o=g(i,2),s=f(o),c=g(o,2);H(r),O(e=>{Y(a,Q(t).name),Y(s,`${e??``}s`)},[()=>Q(t).t.toFixed(2)]),L(`click`,i,()=>{Q(A)&&Jg(Q(A).uuid,Q(t).t)}),L(`dblclick`,i,()=>I(qt,n,!0)),L(`click`,c,()=>{Q(A)&&Fg(Q(A).uuid,n)}),X(e,r)};G(i,e=>{Q(qt)===n?e(a):e(o,-1)}),X(e,r)}),H(a),H(t),O(()=>Y(i,Q(yt).length)),X(e,t)};G(Wt,e=>{Q(yt).length&&e(Gt)}),H(et);var Yt=g(et,2),Xt=j(Yt),Zt=j(Xt),$t=g(Zt,2),tn=g($t,2),nn=j(tn),on=g(nn,2);H(tn);var cn=g(tn,2),ln=j(cn);Cz(j(ln),{size:13,"aria-hidden":`true`}),H(ln);var mn=g(ln,2);sz(j(mn),{size:13,"aria-hidden":`true`}),H(mn),H(cn);var hn=g(cn,2);zOe(j(hn),{size:13,"aria-hidden":`true`}),H(hn);var gn=g(hn,2),_n=g(j(gn)),vn=j(_n);vn.value=vn.__value=`off`;var xn=g(vn),Sn=f(xn);xn.value=xn.__value=`frame`;var wn=g(xn);wn.value=wn.__value=`0.1`;var Tn=g(wn);Tn.value=Tn.__value=`0.5`,H(_n);var En;_(_n),H(gn);var Dn=g(gn,2),kn=j(Dn),An=g(kn,2),jn=g(An,2),Mn=e=>{var t=K9e();O((e,n)=>b(t,`title`,`Play the whole clip again (${e??``}â${n??``}s now)`),[()=>Q(Me).toFixed(2),()=>Q(Pe).toFixed(2)]),L(`click`,t,()=>Q(A)&&Gg(Q(A).uuid,null,null)),X(e,t)};G(jn,e=>{Q(Ie)&&e(Mn)}),H(Dn);var Nn=g(Dn,4),Pn=j(Nn);xAe(j(Pn),{size:12}),H(Pn);var In=g(Pn,2);yAe(j(In),{size:12}),H(In);var Ln=g(In,2);fz(j(Ln),{size:12}),H(Ln),H(Nn);var Rn=g(Nn,4),zn=e=>{var t=q9e(),n=f(t);O(()=>Y(n,`moving ${Q(R).length>1?Q(R).length+` keys`:`key`} â click to place, Esc to cancel`)),X(e,t)},Vn=e=>{var t=J9e(),n=f(t);O(()=>Y(n,`${Q(R).length??``} keys selected`)),X(e,t)};G(Rn,e=>{Q(pn)?e(zn):Q(R).length>1&&e(Vn,1)});var Hn=g(Rn,2),Wn=f(Hn);H(Xt);
2473var qn=g(Xt,2),Qn=e=>{var t=X9e(),n=j(t);B(n,17,()=>Q(P),e=>e.id,(e,t)=>{var n=fe(),r=N(n);B(r,17,()=>Q(t).keys,Be,(e,t)=>{var n=Y9e();O(e=>Ze(n,`left: ${e??``}%`),[()=>Q(t).t/Math.max(Q(Ae),.001)*100]),X(e,n)}),X(e,n)});var r=g(n,2),i=g(r,2);H(t),O((e,t,n)=>{Ze(r,`left: ${e??``}%; width: ${t??``}%`),Ze(i,`left: ${n??``}%`)},[()=>Q(Le)/Math.max(Q(Ae),.001)*100,()=>Math.max(2,Q(ze)/Math.max(Q(Ae),.001)*100),()=>Math.min(Q(ke),Q(Ae))/Math.max(Q(Ae),.001)*100]),L(`pointerdown`,t,On),X(e,t)};G(qn,e=>{Q(P).length&&e(Qn)});var er=g(qn,2),tr=j(er),rr=e=>{var t=Z9e();X(e,t)},ir=e=>{var t=uet(),n=j(t);b(n,`height`,vt);var i=g(n);B(i,16,()=>Q(an),e=>e,(e,t)=>{var n=Q9e(),r=N(n);b(r,`y1`,0);var i=g(r);b(i,`y`,11);var a=f(i);O((e,n,o)=>{b(r,`x1`,e),b(r,`x2`,n),b(r,`y2`,Q(Et)),b(i,`x`,o),Y(a,`${t??``}s`)},[()=>Dt(t),()=>Dt(t),()=>Dt(t)+2]),X(e,n)});var a=g(i),o=e=>{var t=eet(),n=N(t);b(n,`y`,vt);var r=g(n);B(r,17,()=>Q(yt),Be,(e,t,n)=>{var r=$9e(),i=N(r);b(i,`y1`,vt);var a=g(i);b(a,`data-marker`,n),b(a,`y`,vt);var o=g(a),s=f(o,!0);O((e,r,c,l)=>{b(i,`x1`,e),b(i,`x2`,r),b(i,`y2`,Q(Et)),b(a,`x`,c),b(a,`height`,Q(bt)),b(a,`fill`,Q(Kt)===n?`rgb(250 204 21)`:`rgb(45 212 191)`),b(o,`x`,l),b(o,`y`,vt+Q(bt)-3),Y(s,Q(t).name)},[()=>Dt(Q(t).t),()=>Dt(Q(t).t),()=>Dt(Q(t).t)-3,()=>Dt(Q(t).t)+6]),L(`pointerdown`,a,e=>Jt(n,e)),L(`contextmenu`,a,e=>Qt(n,e)),X(e,r)}),O(()=>{b(n,`width`,Q(Ct)),b(n,`height`,Q(bt))}),X(e,t)};G(a,e=>{Q(yt).length&&e(o)});var s=g(a),c=e=>{var t=tet(),n=N(t),r=e=>{var t=O4();O((e,n)=>{b(t,`x`,e),b(t,`y`,Q(xt)),b(t,`width`,n),b(t,`height`,Q(Et)-Q(xt))},[()=>Dt(Q(Le)),()=>Math.max(0,Dt(Math.min(Q(Me),Q(Re)))-Dt(Q(Le)))]),X(e,t)};G(n,e=>{Q(Me)>Q(Le)&&e(r)});var i=g(n),a=e=>{var t=O4();O((e,n)=>{b(t,`x`,e),b(t,`y`,Q(xt)),b(t,`width`,n),b(t,`height`,Q(Et)-Q(xt))},[()=>Dt(Math.max(Q(Pe),Q(Le))),()=>Math.max(0,Dt(Q(Re))-Dt(Math.max(Q(Pe),Q(Le))))]),X(e,t)};G(i,e=>{Q(Pe)<Q(Re)&&e(a)});var o=g(i);b(o,`y1`,0);var s=g(o);b(s,`y1`,0);var c=g(s),l=g(c);O((e,t,n,r,i,a)=>{b(o,`x1`,e),b(o,`x2`,t),b(o,`y2`,Q(Et)),b(s,`x1`,n),b(s,`x2`,r),b(s,`y2`,Q(Et)),b(c,`x`,i),b(c,`y`,Q(xt)+9),b(l,`x`,a),b(l,`y`,Q(xt)+9)},[()=>Dt(Q(Me)),()=>Dt(Q(Me)),()=>Dt(Q(Pe)),()=>Dt(Q(Pe)),()=>Dt(Q(Me))+2,()=>Dt(Q(Pe))-8]),X(e,t)};G(s,e=>{Q(Ie)&&e(c)});var l=g(s),u=e=>{var t=fe(),n=N(t);B(n,19,()=>Q(P),e=>e.id,(e,t,n)=>{var r=ret(),i=N(r),a=g(i);B(a,17,()=>Q(t).keys,Be,(e,r,i)=>{var a=net();O((e,t,n,r,i)=>{b(a,`x`,e),b(a,`y`,t),b(a,`transform`,`rotate(45 ${n??``} ${r??``})`),b(a,`fill`,i)},[()=>Dt(Q(r).t)-4,()=>kt(Q(n))-4,()=>Dt(Q(r).t),()=>kt(Q(n)),()=>le(Q(t).id,i)?`rgb(250 204 21)`:`rgb(99 102 241)`]),L(`pointerdown`,a,e=>yn(e,Q(t).id,i)),L(`contextmenu`,a,e=>bn(e,Q(t).id,i)),X(e,a)}),O((e,n,r,a)=>{b(i,`x1`,e),b(i,`y1`,n),b(i,`x2`,r),b(i,`y2`,a),b(i,`stroke`,Q(F)?.id===Q(t).id?`rgb(129 140 248 / 0.5)`:`rgb(75 85 99 / 0.5)`)},[()=>Dt(Q(Le)),()=>kt(Q(n)),()=>Dt(Q(Re)),()=>kt(Q(n))]),X(e,r)}),X(e,t)},d=e=>{var t=oet(),n=N(t),i=g(n),a=e=>{var t=iet(),n=j(t),i=g(n),a=g(i),o=g(a);H(t),O(()=>{b(n,`x1`,Q(Pt).from.x),b(n,`y1`,Q(Pt).from.y),b(n,`x2`,Q(Pt).p1.x),b(n,`y2`,Q(Pt).p1.y),b(i,`x1`,Q(Pt).to.x),b(i,`y1`,Q(Pt).to.y),b(i,`x2`,Q(Pt).p2.x),b(i,`y2`,Q(Pt).p2.y),b(a,`cx`,Q(Pt).p1.x),b(a,`cy`,Q(Pt).p1.y),r(a,0,M(Q(Pt).flat?`cursor-ew-resize`:`cursor-grab`)),b(o,`cx`,Q(Pt).p2.x),b(o,`cy`,Q(Pt).p2.y),r(o,0,M(Q(Pt).flat?`cursor-ew-resize`:`cursor-grab`))}),L(`pointerdown`,a,e=>en(0,e)),L(`pointerdown`,o,e=>en(1,e)),X(e,t)};G(i,e=>{Q(Pt)&&e(a)});var o=g(i);B(o,17,()=>Q(F).keys,Be,(e,t,n)=>{var r=aet();O((e,t,n)=>{b(r,`cx`,e),b(r,`cy`,t),b(r,`fill`,n)},[()=>Dt(Q(t).t),()=>Mt(Q(t).v),()=>le(Q(F).id,n)?`rgb(250 204 21)`:`rgb(99 102 241)`]),L(`pointerdown`,r,e=>yn(e,Q(F).id,n)),L(`contextmenu`,r,e=>bn(e,Q(F).id,n)),X(e,r)});var s=g(o);b(s,`x`,_t);var c=f(s,!0),l=g(s);b(l,`x`,_t);var u=f(l,!0);O((e,t)=>{b(n,`d`,Q(rn)),b(s,`y`,Q(xt)+10),Y(c,e),b(l,`y`,Q(xt)+Q(St)-2),Y(u,t)},[()=>dt(Q(jt).hi,Q(F).channel),()=>dt(Q(jt).lo,Q(F).channel)]),X(e,t)};G(l,e=>{Q(V)===`sheet`?e(u):Q(F)&&e(d,1)});var p=g(l);b(p,`y1`,0);var m=g(p),h=e=>{var t=set();O((e,n,r,i)=>{b(t,`x`,e),b(t,`y`,n),b(t,`width`,r),b(t,`height`,i)},[()=>Math.min(Q(It).x0,Q(It).x1),()=>Math.min(Q(It).y0,Q(It).y1),()=>Math.abs(Q(It).x1-Q(It).x0),()=>Math.abs(Q(It).y1-Q(It).y0)]),X(e,t)},_=e=>{var t=cet();O(e=>b(t,`points`,e),[()=>Q(Lt).map(([e,t])=>e+`,`+t).join(` `)]),X(e,t)};G(m,e=>{Q(It)&&Q(zt)?e(h):Q(Lt).length>1&&Q(zt)&&e(_,1)}),H(t),We(t,e=>I(dn,e),()=>Q(dn)),O((e,r)=>{b(t,`width`,Q(Ct)),b(t,`height`,Q(Et)),b(n,`width`,Q(Ct)),b(p,`x1`,e),b(p,`x2`,r),b(p,`y2`,Q(Et))},[()=>Dt(Math.min(Q(ke),Q(Ae))),()=>Dt(Math.min(Q(ke),Q(Ae)))]),L(`dblclick`,t,Fn),L(`pointerdown`,t,Cn),Z(`wheel`,t,Ge),L(`contextmenu`,t,e=>e.preventDefault()),X(e,t)};G(tr,e=>{Q(P).length?e(ir,-1):e(rr)}),H(er),H(Yt),We(Yt,e=>
2473I(fn,e),()=>Q(fn)),ne(Yt,e=>Bn?.(e));var ar=g(Yt,2),or=j(ar),sr=e=>{var t=get(),n=g(N(t),2),r=g(j(n));B(r,21,()=>r_,Be,(e,t)=>{var n=D4(),r=f(n,!0),i={};O(e=>{Y(r,e),i!==(i=Q(t))&&(n.value=(n.__value=i)??``)},[()=>kg(Q(t))]),X(e,n)}),H(r);var i;_(r),H(n);var a=g(n,2),o=e=>{var t=det(),n=N(t),r=f(n),i=g(n,2),a=j(i),o=g(j(a));{let e=q(()=>Math.round(Q(ce).t*1e3)/1e3);hq(o,{id:`animation-key-time`,step:.005,decimals:3,min:0,get value(){return Q(e)},onscrubstart:()=>Q(A)&&Ug(Q(A).uuid,`Key time`),onscrubend:()=>Ag(),onchange:e=>Q(se)&&mt(Q(se)[1],String(e))})}H(a);var s=g(a,2),c=j(s),l=g(c);{let e=q(()=>dt(Q(ce).v,Q(F).channel));hq(l,{id:`animation-key-value`,step:.01,decimals:3,get value(){return Q(e)},onscrubstart:()=>Q(A)&&Ug(Q(A).uuid,`Key value`),onscrubend:()=>Ag(),onchange:e=>Q(se)&&pt(Q(se)[1],String(e))})}H(s),H(i);var u=g(i,2);O(e=>{Y(r,`Key ${Q(se)[1]+1} / ${Q(F).keys.length??``}`),Y(c,`Value${e??``} `)},[()=>ut(Q(F).channel)?` (deg)`:``]),L(`click`,u,()=>{Q(A)&&Q(se)&&(Bg(Q(A).uuid,Q(se)[0],Q(se)[1]),I(R,[],!0))}),X(e,t)},s=e=>{var t=fet(),n=f(t);O(()=>Y(n,`${Q(F).keys.length??``} keys â click one to edit its time and value.`)),X(e,t)};G(a,e=>{Q(ce)&&Q(se)?e(o):e(s,-1)});var c=g(a,2),l=e=>{var t=met(),n=N(t),r=f(n),i=g(n,2);b(i,`width`,Gn),b(i,`height`,Gn),b(i,`viewBox`,`0 0 132 132`);var a=j(i);b(a,`x`,Kn),b(a,`y`,Kn),b(a,`width`,Jn),b(a,`height`,Jn);var o=g(a);b(o,`x1`,Kn),b(o,`x2`,Kn+Jn);var s=g(o);b(s,`x1`,Kn),b(s,`x2`,Kn+Jn);var c=g(s),l=g(c),u=g(l),d=g(u),p=g(d),m=g(p),h=g(m),_=g(h);H(i),We(i,e=>I(Zn,e),()=>Q(Zn));var v=g(i,2);B(v,21,()=>Object.keys(Zg),Be,(e,t)=>{var n=pet(),r=f(n,!0);O(()=>Y(r,Q(t))),L(`click`,n,()=>nr(Q(t))),X(e,n)}),H(v),O((e,t,n,i,a,f,g,v,y,x,S,C,w,T,E,D,O,k,A,ee,j,M,te,ne,N,P,re,ie,F,ae,I,L)=>{Y(r,`Easing out of key ${Q(se)?Q(se)[1]+1:1}`),b(o,`y1`,e),b(o,`y2`,t),b(s,`y1`,n),b(s,`y2`,i),b(c,`x1`,a),b(c,`y1`,f),b(c,`x2`,g),b(c,`y2`,v),b(l,`x1`,y),b(l,`y1`,x),b(l,`x2`,S),b(l,`y2`,C),b(u,`x1`,w),b(u,`y1`,T),b(u,`x2`,E),b(u,`y2`,D),b(d,`d`,`M ${O??``} ${k??``} C ${A??``} ${ee??``} ${j??``} ${M??``} ${te??``} ${ne??``}`),b(p,`cx`,N),b(p,`cy`,P),b(m,`cx`,re),b(m,`cy`,ie),b(h,`cx`,F),b(h,`cy`,ae),b(_,`cx`,I),b(_,`cy`,L)},[()=>Xn(0),()=>Xn(0),()=>Xn(1),()=>Xn(1),()=>Yn(0),()=>Xn(0),()=>Yn(1),()=>Xn(1),()=>Yn(0),()=>Xn(0),()=>Yn(Q(pe)[0]),()=>Xn(Q(pe)[1]),()=>Yn(1),()=>Xn(1),()=>Yn(Q(pe)[2]),()=>Xn(Q(pe)[3]),()=>Yn(0),()=>Xn(0),()=>Yn(Q(pe)[0]),()=>Xn(Q(pe)[1]),()=>Yn(Q(pe)[2]),()=>Xn(Q(pe)[3]),()=>Yn(1),()=>Xn(1),()=>Yn(0),()=>Xn(0),()=>Yn(1),()=>Xn(1),()=>Yn(Q(pe)[0]),()=>Xn(Q(pe)[1]),()=>Yn(Q(pe)[2]),()=>Xn(Q(pe)[3])]),L(`pointerdown`,h,e=>$n(0,e)),L(`pointerdown`,_,e=>$n(1,e)),X(e,t)},u=q(()=>!qg.has(Q(F).channel)),d=e=>{var t=het(),n=f(t);O(e=>Y(n,`${e??``} is stepped: it holds each key's value until the next 2474 one, so there is no curve to shape.`),[()=>kg(Q(F).channel)]),X(e,t)};G(c,e=>{Q(u)?e(l):e(d,-1)}),O(()=>{i!==(i=Q(F).channel)&&(r.value=(r.__value=i)??``,D(r,i))}),L(`change`,r,e=>Q(A)&&ile(Q(A).uuid,Q(F).id,{channel:e.currentTarget.value})),X(e,t)},cr=e=>{var t=_et();X(e,t)};G(or,e=>{Q(F)?e(sr):e(cr,-1)}),H(ar),H($e),O((e,t,n,i)=>{r(s,1,`border-l border-gray-600/80 ${Q(Oe)&&Q(De)?.reverse?`bg-primary-600/30 text-primary-200`:`text-primary-300`}`),b(s,`aria-pressed`,!!(Q(Oe)&&Q(De)?.reverse)),r(c,1,`border-x border-gray-600/80 ${Q(Oe)&&!Q(De)?.reverse?`bg-primary-600/30 text-primary-200`:`text-primary-300`}`),b(c,`title`,Q(Oe)?`Pause`:`Play from here`),b(c,`aria-label`,Q(Oe)?`Pause`:`Play`),b(c,`aria-pressed`,Q(Oe)),b(C,`max`,Q(Ae)),u(C,Q(ke)),Y(E,e),Y(ue,`/${t??``}s`),qe!==(qe=Q(te)?.loop??`loop`)&&(K.value=(K.__value=qe)??``,D(K,qe)),r(Ye,1,`flex shrink-0 items-center gap-1 rounded-md border px-2 py-1 text-[11px] font-medium ${Q(Ke)?`border-red-500 bg-red-500/20 text-red-300`:`border-gray-600 text-gray-400 hover:bg-gray-700/70`}`),b(Ye,`title`,Q(Ke)?`Recording: posing this object writes keys at the playhead`:`Auto-key: pose the object and keys are written at the playhead`),b(Ye,`aria-pressed`,Q(Ke)),r(Xe,1,M(Q(Ke)?`animate-pulse`:``)),Y(wt,Q(P).length),At!==(At=Q(ae))&&(Ot.value=(Ot.__value=At)??``,D(Ot,At)),r(Zt,1,`rounded-sm border px-1.5 py-0.5 ${Q(V)===`sheet`?`border-primary-500 text-primary-300`:`border-gray-600`}`),r($t,1,`rounded-sm border px-1.5 py-0.5 ${Q(V)===`graph`?`border-primary-500 text-primary-300`:`border-gray-600`}`),r(nn,1,`px-1.5 py-0.5 ${Q(un)===`move`?`bg-primary-600/30 text-primary-200`:`hover:bg-gray-700/70`}`),b(nn,`aria-pressed`,Q(un)===`move`),r(on,1,`border-l border-gray-600 px-1.5 py-0.5 ${Q(un)===`scale`?`bg-primary-600/30 text-primary-200`:`hover:bg-gray-700/70`}`),b(on,`aria-pressed`,Q(un)===`scale`),r(ln,1,`px-1.5 py-0.5 ${Q(Ft)===`box`?`bg-primary-600/30 text-primary-200`:`hover:bg-gray-700/70`}`),b(ln,`aria-pressed`,Q(Ft)===`box`),r(mn,1,`border-l border-gray-600 px-1.5 py-0.5 ${Q(Ft)===`lasso`?`bg-primary-600/30 text-primary-200`:`hover:bg-gray-700/70`}`),b(mn,`aria-pressed`,Q(Ft)===`lasso`),r(hn,1,`rounded-sm border px-1.5 py-0.5 ${w()?`border-primary-500 text-primary-300`:`border-gray-600`}`),b(hn,`aria-pressed`,w()),Y(Sn,`frame (${Q(sn)??``}fps)`),En!==(En=Q(he))&&(_n.value=(_n.__value=En)??``,D(_n,En)),Y(Wn,`${n??``}â${i??``}s`),r(er,1,`min-h-0 flex-1 overflow-x-hidden ${Q(V)===`graph`?`overflow-y-hidden`:`overflow-y-auto`} p-2`)},[()=>Q(ke).toFixed(2),()=>Q(Ae).toFixed(2),()=>Q(Le).toFixed(2),()=>Q(Re).toFixed(2)]),L(`click`,a,()=>Q(A)&&Jg(Q(A).uuid,Q(Me))),L(`click`,o,()=>lt(-1)),L(`click`,s,ct),L(`click`,c,st),L(`click`,m,()=>Q(A)&&mle(Q(A).uuid)),L(`click`,y,()=>lt(1)),L(`click`,x,()=>Q(A)&&Jg(Q(A).uuid,Q(Pe))),L(`input`,C,e=>Q(A)&&Jg(Q(A).uuid,parseFloat(e.currentTarget.value))),L(`change`,K,e=>Q(A)&&Kg(Q(A).uuid,{loop:e.currentTarget.value})),L(`click`,Ye,()=>Q(A)&&n_(Q(Ke)?null:Q(A).uuid)),L(`click`,Qe,Un),L(`change`,Ot,e=>I(ae,e.currentTarget.value,!0)),L(`click`,Nt,ot),ee(et,`clientHeight`,e=>I(ye,e)),L(`click`,Zt,()=>I(V,`sheet`)),L(`click`,$t,()=>I(V,`graph`)),L(`click`,nn,()=>I(un,`move`)),L(`click`,on,()=>I(un,`scale`)),L(`click`,ln,()=>Bt(`box`)),L(`click`,mn,()=>Bt(`lasso`)),L(`click`,hn,()=>
2474iF(!w())),L(`change`,_n,e=>{I(he,e.currentTarget.value,!0),nt.setItem(`animationSnap`,Q(he))}),L(`click`,kn,()=>Q(A)&&Gg(Q(A).uuid,Q(ke),Q(Pe)>Q(ke)?Q(Pe):null)),L(`click`,An,()=>Q(A)&&Gg(Q(A).uuid,Q(Me)<Q(ke)?Q(Me):null,Q(ke))),L(`click`,Pn,()=>He(1.4)),L(`click`,In,()=>He(1/1.4)),L(`click`,Ln,Ue),ee(er,`clientWidth`,e=>I(ht,e)),ee(er,`clientHeight`,e=>I(gt,e)),X(e,t)};G(n,e=>{Q(A)?e(a,-1):e(i)}),X(e,t)},A=q(()=>i()&&i().uuid?i():null),te=q(()=>(a(),Q(A)?Hg(Q(A).uuid):null)),P=q(()=>Q(te)?.tracks??[]),re=q(()=>(a(),Q(A)?Ig(Q(A).uuid):[])),ie=t(null),F=q(()=>Q(P).find(e=>e.id===Q(ie))??Q(P)[0]??null),ae=t(`pos.y`),oe=q(()=>Q(A)?r_.filter(e=>Xce(Q(A),e)):r_),R=t(Ne([])),se=q(()=>Q(R).length===1?Q(R)[0]:null),ce=q(()=>{let e=Q(se);return e?Q(P).find(t=>t.id===e[0])?.keys[e[1]]??null:null}),le=(e,t)=>Q(R).some(([n,r])=>n===e&&r===t),de=q(()=>Q(ce)??Q(F)?.keys?.[0]??null),pe=q(()=>Q(de)?.ease??Zg.linear),me=q(()=>Q(se)&&Q(ce)?Q(se)[1]:0),V=t(`sheet`),he=t(Ne(typeof localStorage<`u`?nt.getItem(`animationSnap`)??`frame`:`frame`)),ge=t(null),_e=t(Ne(typeof localStorage<`u`&&parseInt(nt.getItem(`animationClipsH`)??`96`)||96)),ve=t(!1),ye=t(0),be=q(()=>Math.max(48,(Q(ye)||320)-104));Qe(()=>{let e=Q(be);Q(_e)>e&&I(_e,e,!0)});function xe(e){I(ve,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function Se(e){Q(ve)&&I(_e,Math.min(Math.max(48,Q(_e)+e.movementY),Q(be)),!0)}function we(e){Q(ve)&&(I(ve,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),nt.setItem(`animationClipsH`,String(Q(_e))))}let Te=q(()=>Q(A)?o()[Q(A).uuid]??null:null),Ee=q(()=>(o(),Q(A)?Tg(Q(A).uuid):[])),J=q(()=>(o(),Q(A)?wg(Q(A).uuid):null)),De=q(()=>Q(A)?s()[Q(A).uuid]??null:null),Oe=q(()=>!!Q(De)?.playing),ke=q(()=>Q(A)?c()[Q(A).uuid]??Q(De)?.pausedAt??0:0),Ae=q(()=>Q(te)?.duration??2),je=q(()=>Q(De)?.speed??1),Me=q(()=>Math.min(Math.max(Q(De)?.rangeIn??0,0),Q(Ae))),Pe=q(()=>Math.min(Q(De)?.rangeOut??Q(Ae),Q(Ae))),Ie=q(()=>Q(Me)>1e-6||Q(Pe)<Q(Ae)-1e-6),Le=t(0),Re=t(2);Qe(()=>{let e=Q(Ae);K(()=>{(Q(Re)<=Q(Le)||Q(Re)>e+1e-6||Q(Le)===0&&Math.abs(Q(Re)-2)<1e-9)&&(I(Le,0),I(Re,e,!0))})});let ze=q(()=>Math.max(Q(Re)-Q(Le),.05));function He(e,t){let n=t??(Q(Le)+Q(Re))/2,r=Math.min(Math.max(Q(ze)*e,.1),Q(Ae)),i=n-(n-Q(Le))*(r/Q(ze));i=Math.min(Math.max(i,0),Math.max(0,Q(Ae)-r)),I(Le,i,!0),I(Re,Math.min(i+r,Q(Ae)),!0)}function Ue(){I(Le,0),I(Re,Q(Ae),!0)}function Ge(e){if(!Q(dn))return;e.preventDefault();let t=Q(dn).getBoundingClientRect(),n=Ot(e.clientX-t.left),r=e.deltaY===0?e.deltaX:e.deltaY;if(e.shiftKey){let e=Q(ze),t=r*.0015*e,n=Math.min(Math.max(Q(Le)+t,0),Math.max(0,Q(Ae)-e));I(Le,n,!0),I(Re,Math.min(n+e,Q(Ae)),!0);return}He(r<0?1/1.2:1.2,n)}let Ke=q(()=>!!Q(A)&&l()===Q(A).uuid),qe=t(!0),Je={minW:360,minH:260},Ye={w:660,h:460},Xe=t(660),$e=t(460);if(typeof localStorage<`u`){I(qe,nt.getItem(`animationDocked`)!==`false`);let e=Xh(parseInt(nt.getItem(`animationWinW`)??`660`)||660,parseInt(nt.getItem(`animationWinH`)??`460`)||460,Je);I(Xe,e.w,!0),I($e,e.h,!0)}function et(e){I(qe,e,!0),nt.setItem(`animationDocked`,String(e)),e?jd(`animation`):Nd(`animation`)}Qe(()=>{let e=d();e&&e.key===`animation`&&(Ad.set(null),K(()=>{e.docked!==Q(qe)&&et(e.docked),$s.set(!1)}))});let $=q(()=>m().find(e=>e.members.includes(`animation`))??null),tt=q(()=>Q($)?Q($).rect.width:Q(Xe)),rt=q(()=>Q($)?Q($).rect.height:Q($e));Qe(()=>(Od(`animation`,!h()&&Q(qe),y()),()=>Od(`animation`,!1)));let it=q(()=>x()===`animation`&&!S()),at=null;Qe(()=>{let e=Q(A)?.uuid??null;K(()=>{if(e===at)return;let t=at;at=e,I(R,[],!0),t&&t!==e&&U(Vg)===t&&n_(null)})});function ot(){Q(A)&&(I(ie,Wg(Q(A).uuid,Q(ae),Q(A)),!0),I(R,[],!0),Jg(Q(A).uuid,Q(ke)))}function st(){Q(A)&&(Q(Oe)?zg(Q(A).uuid):jg(Q(A).uuid,void 0,{from:Math.max(0,Q(ke)-Q(Me)),reverse:!1}))}function ct(){if(Q(A)){if(Q(Oe)&&Q(De)?.reverse){zg(Q(A).uuid);return}jg(Q(A).uuid,void 0,{from:Math.max(0,Q(Pe)-Q(ke)),reverse:!0})}}function lt(e){if(!Q(A))return;let t=Q(V)===`graph`&&Q(F)?Q(F).keys.map(e=>e.t):s_(Q(A).uuid),n=[...new Set([...t,0,Q(Ae)])].sort((e,t)=>e-t),r=Q(ke),i=e<0?[...n].reverse().find(e=>e<r-1e-4):n.find(e=>e>r+1e-4);Jg(Q(A).uuid,i??(e<0?0:Q(Ae)))}let ut=e=>Yce(e);function dt(e,t){let n=e??0;return ut(t)?Math.round(n*180/Math.PI*100)/100:Math.round(n*1e3)/1e3}function ft(e,t){return ut(t)?e*Math.PI/180:e}function pt(e,t){let n=parseFloat(t);!Number.isNaN(n)&&Q(A)&&Q(F)&&$g(Q(A).uuid,Q(F).id,e,{v:ft(n,Q(F).channel)})}function mt(e,t){let n=parseFloat(t);!Number.isNaN(n)&&Q(A)&&Q(F)&&$g(Q(A).uuid,Q(F).id,e,{t:Math.max(0,n)})}let ht=t(420),gt=t(220),_t=10,vt=16,yt=q(()=>Q(te)?.markers??[]),bt=q(()=>Q(yt).length?12:0),xt=q(()=>16+Q(bt)),St=q(()=>Math.max(80,Q(gt)-Q(xt)-22)),Ct=q(()=>Math.max(80,Q(ht)-16)),wt=q(()=>Math.max(60,Q(Ct)-20)),Tt=q(()=>Q(xt)+Math.max(1,Q(P).length)*22+6),Et=q(()=>Q(V)===`graph`?Q(xt)+Q(St)+6:Q(Tt)),Dt=e=>10+(e-Q(Le))/Q(ze)*Q(wt),Ot=e=>Q(Le)+(e-10)/Q(wt)*Q(ze),kt=e=>Q(xt)+e*22+11,At=t(null),jt=q(()=>{if(Q(At))return Q(At);let e=Q(F)?.keys??[];if(!e.length)return{lo:0,hi:1};let t=1/0,n=-1/0;for(let r of e)t=Math.min(t,r.v),n=Math.max(n,r.v);n-t<1e-6&&(t-=.5,n+=.5);let r=(n-t)*.15;return{lo:t-r,hi:n+r}}),Mt=e=>Q(xt)+Q(St)-(e-Q(jt).lo)/(Q(jt).hi-Q(jt).lo)*Q(St),Nt=e=>Q(jt).lo+(Q(xt)+Q(St)-e)/Q(St)*(Q(jt).hi-Q(jt).lo),Pt=q(()=>{if(Q(V)!==`graph`||!Q(F)||qg.has(Q(F).channel))return null;let e=Q(F).keys[Q(me)],t=Q(F).keys[Q(me)+1];if(!e||!t)return null;let n=t.t-e.t,r=t.v-e.v,i=e.ease??Zg.linear;return{dt:n,dv:r,flat:Math.abs(r)<1e-9,p1:{x:Dt(e.t+n*i[0]),y:Mt(e.v+r*i[1])},p2:{x:Dt(e.t+n*i[2]),y:Mt(e.v+r*i[3])},from:{x:Dt(e.t),y:Mt(e.v)},to:{x:Dt(t.t),y:Mt(t.v)}}}),Ft=t(Ne(typeof localStorage<`u`&&nt.getItem(`animationMarquee`)===`lasso`?`lasso`:`box`)),It=t(null),Lt=t(Ne([])),Rt=[],zt=t(!1);function Bt(e){I(Ft,e,!0);try{nt.setItem(`animationMarquee`,e)}catch{}}function Vt(){let e=[],t=Q(V)===`graph`?Q(F)?[Q(F)]:[]:Q(P),n=Q(It)?{lo:Math.min(Q(It).x0,Q(It).x1),hi:Math.max(Q(It).x0,Q(It).x1),top:Math.min(Q(It).y0,Q(It).y1),bottom:Math.max(Q(It).y0,Q(It).y1)}:null;return t.forEach((t,r)=>{let i=Q(V)===`graph`?null:kt(r);t.keys.forEach((r,a)=>{let o=Dt(r.t),s=i??Mt(r.v);(n?o>=n.lo&&o<=n.hi&&s>=n.top&&s<=n.bottom:Ht(o,s))&&e.push([t.id,a])})}),e}function Ht(e,t){if(Q(Lt).length<3)return!1;let n=!1;for(let r=0,i=Q(Lt).length-1;r<Q(Lt).length;i=r++){let[a,o]=Q(Lt)[r],[s,c]=Q(Lt)[i];o>t!=c>t&&e<(s-a)*(t-o)/(c-o)+a&&(n=!n)}return n}
2474function Ut(){let e=Vt();if(!Rt.length)I(R,e,!0);else{let t=[...Rt];for(let[n,r]of e)t.some(([e,t])=>e===n&&t===r)||t.push([n,r]);I(R,t,!0)}e[0]&&I(ie,e[0][0],!0)}function Wt(e){if(!Q(dn))return;let t=Q(dn).getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;if(!(!Q(zt)&&Math.abs(n-(Q(It)?.x0??Q(Lt)[0]?.[0]??n))<3&&Math.abs(r-(Q(It)?.y0??Q(Lt)[0]?.[1]??r))<3)){if(I(zt,!0),Q(It))I(It,{...Q(It),x1:n,y1:r},!0);else{let e=Q(Lt)[Q(Lt).length-1];(!e||Math.abs(e[0]-n)>1.5||Math.abs(e[1]-r)>1.5)&&I(Lt,[...Q(Lt),[n,r]],!0)}Ut()}}Qe(()=>(window.__animationDebug={selKeys:()=>Q(R).map(([e,t])=>e+`:`+t),marqueeMode:()=>Q(Ft),markerCount:()=>Q(yt).length,xform:()=>Q(un)},()=>delete window.__animationDebug));function Gt(){Q(zt)&&Ut(),I(It,null),I(Lt,[],!0),I(zt,!1),Rt=[],window.removeEventListener(`pointermove`,Wt),window.removeEventListener(`pointerup`,Gt)}let Kt=t(-1),qt=t(-1);function Jt(e,t){Q(A)&&t.button!==2&&(t.preventDefault(),t.stopPropagation(),I(Kt,e,!0),Ug(Q(A).uuid,`Move marker`),window.addEventListener(`pointermove`,Yt),window.addEventListener(`pointerup`,Xt))}function Yt(e){if(Q(Kt)<0||!Q(A)||!Q(dn))return;let t=Q(dn).getBoundingClientRect(),n=Math.max(0,Math.min(Q(Ae),ln(Ot(e.clientX-t.left)))),r=Q(yt)[Q(Kt)];if(!r)return;Xg(Q(A).uuid,Q(Kt),{t:n});let i=(Q(te)?.markers??[]).findIndex(e=>e.name===r.name);i>=0&&I(Kt,i,!0)}function Xt(){Q(Kt)<0||(I(Kt,-1),Ag(),window.removeEventListener(`pointermove`,Yt),window.removeEventListener(`pointerup`,Xt))}function Zt(){Q(A)&&(fle(Q(A).uuid,ln(Q(ke))),es(`Marker added at `+ln(Q(ke)).toFixed(2)+`s`))}function Qt(e,t){if(!Q(A))return;t.preventDefault(),t.stopPropagation();let n=Q(A).uuid,r=Q(yt)[e];r&&I(Vn,{x:t.clientX,y:t.clientY,items:[{header:r.name},{label:`Rename`,action:()=>I(qt,e,!0)},{label:`Move to the playhead`,tooltip:`Put it at `+ln(Q(ke)).toFixed(2)+`s`,action:()=>Xg(n,e,{t:ln(Q(ke))})},{label:`Go to it`,tooltip:r.t.toFixed(2)+`s`,action:()=>Jg(n,r.t)},{label:`Delete marker`,danger:!0,action:()=>Fg(n,e)}]},!0)}let $t=t(-1);function en(e,t){Q(A)&&Q(F)&&Q(Pt)&&t.button===0&&(_n.isModal()||(t.preventDefault(),t.stopPropagation(),I($t,e,!0),Ug(Q(A).uuid,`Easing`),window.addEventListener(`pointermove`,tn),window.addEventListener(`pointerup`,nn)))}function tn(e){if(Q($t)<0||!Q(A)||!Q(F)||!Q(dn))return;let t=Q(F).keys[Q(me)],n=Q(F).keys[Q(me)+1];if(!t||!n)return;let r=Q(dn).getBoundingClientRect(),i=n.t-t.t,a=n.v-t.v,o=i>1e-9?Math.min(1,Math.max(0,(Ot(e.clientX-r.left)-t.t)/i)):0,s=[...t.ease??Zg.linear];if(Q($t)===0?s[0]=o:s[2]=o,Math.abs(a)>1e-9){let n=(Nt(e.clientY-r.top)-t.v)/a;Q($t)===0?s[1]=n:s[3]=n}$g(Q(A).uuid,Q(F).id,Q(me),{ease:s})}function nn(){Q($t)<0||(I($t,-1),Ag(),window.removeEventListener(`pointermove`,tn),window.removeEventListener(`pointerup`,nn))}let rn=q(()=>{if(Q(V)!==`graph`||!Q(F))return``;let e=``;for(let t=0;t<=96;t++){let n=Q(Le)+t/96*Q(ze),r=t_(Q(F),n);r!==null&&(e+=(e?` L `:`M `)+Dt(n).toFixed(2)+` `+Mt(r).toFixed(2))}return e}),an=q(()=>{let e=Q(ze)/8,t=[.05,.1,.25,.5,1,2,5,10,30,60].find(t=>t>=e)??60,n=[];for(let e=Math.ceil(Q(Le)/t)*t;e<=Q(Re)+1e-6;e+=t)n.push(Math.round(e*1e4)/1e4);return n}),on=(()=>{let e=typeof localStorage<`u`?Number(nt.getItem(`animationFps`)):NaN;return Number.isFinite(e)&&e>=1&&e<=240?e:30})(),sn=q(()=>Q(te)?.fps??on),cn=q(()=>1/Q(sn));function ln(e){return Q(he)===`frame`?Math.round(e*Q(sn))/Q(sn):Q(he)===`off`?Math.round(e*1e3)/1e3:Math.round(e/Number(Q(he)))*Number(Q(he))}let un=t(`move`),dn=t(null),fn=t(null),pn=t(!1);function mn(){let e=[];for(let[t,n]of Q(R)){let r=Q(P).find(e=>e.id===t),i=r?.keys[n];r&&i&&e.push({trackId:t,index:n,t0:i.t,v0:i.v,stepped:qg.has(r.channel)})}return e}function hn(e,t,n){if(!Q(A)||!e?.snapshot.length)return;let r=Q(un)===`scale`,i=r?Math.max(.05,1+t/Math.max(Q(ze),.001)*1.5):1,a=r&&n!==null?Math.max(.05,1+n/Math.max(Q(jt).hi-Q(jt).lo,1e-6)*1.5):1,o=e.pivot.t,s=e.pivot.v,c=e.snapshot.map(e=>{let c=r?o+(e.t0-o)*i:e.t0+t,l=r?s+(e.v0-s)*a:e.v0+(n??0);return{trackId:e.trackId,index:e.index,t:r?Math.max(0,Math.min(Q(Ae),c)):ln(Math.max(0,Math.min(Q(Ae),c))),...(r||n!==null)&&!e.stepped?{v:l}:{}}}),l=Mg(Q(A).uuid,c),u=[];e.snapshot.forEach((e,t)=>{let n=l[t];n&&(e.index=n.index,u.push([n.trackId,n.index]))}),u.length&&I(R,u,!0)}function gn(e){if(!Q(dn))return{dt:0,dv:null};let t=Q(dn).getBoundingClientRect(),n=e.origin.x-t.left,r=e.origin.y-t.top;return{dt:Ot(n+e.dx)-Ot(n),dv:Q(V)===`graph`?Nt(r+e.dy)-Nt(r):null}}let _n=WK({snapshot:mn,start:e=>{if(!Q(A))return!1;e.pivot={t:Q(ke),v:e.snapshot.reduce((e,t)=>
2474e+t.v0,0)/e.snapshot.length},Q(V)===`graph`&&I(At,{lo:Q(jt).lo,hi:Q(jt).hi},!0),Ug(Q(A).uuid,e.data?.label??`Move keys`)},apply:e=>{let{dt:t,dv:n}=gn(e);hn(e,t,n)},revert:e=>{Q(A)&&Mg(Q(A).uuid,e.snapshot.map(e=>({trackId:e.trackId,index:e.index,t:e.t0,v:e.v0})))},end:()=>{I(At,null),Ag()},onActive:(e,t)=>{I(pn,e&&t,!0)}});function vn(e,t){Q(A)&&_n.begin(e,{modal:t,data:{label:Q(R).length>1?`Move keys`:`Move key`}})}function yn(e,t,n){if(Q(A)&&!_n.isModal()&&e.button!==2){if(e.preventDefault(),e.stopPropagation(),Q(fn)?.focus?.({preventScroll:!0}),I(ie,t,!0),e.button===1){le(t,n)||I(R,[[t,n]],!0),vn(e,!0);return}if(e.shiftKey){I(R,le(t,n)?Q(R).filter(([e,r])=>e!==t||r!==n):[...Q(R),[t,n]],!0);return}le(t,n)||I(R,[[t,n]],!0),vn(e,!1)}}function bn(e,t,n){if(Q(A)){if(e.preventDefault(),e.stopPropagation(),_n.active())return _n.finish(!0);I(ie,t,!0),le(t,n)||I(R,[[t,n]],!0),Hn(e)}}let xn=!1;function Sn(e){if(!Q(A)||!Q(dn))return;let t=Q(dn).getBoundingClientRect();Jg(Q(A).uuid,ln(Math.max(0,Math.min(Q(Ae),Ot(e-t.left)))))}function Cn(e){if(!Q(A)||!Q(dn))return;Q(dn).parentElement?.parentElement?.focus?.({preventScroll:!0});let t=Q(dn).getBoundingClientRect();if(e.button===2||e.button===1){e.preventDefault(),wn={x:e.clientX,y:e.clientY,start:Q(Le),span:Q(ze),moved:!1},window.addEventListener(`pointermove`,Tn),window.addEventListener(`pointerup`,jn);return}let n=e.clientY-t.top;if(n<=16){e.preventDefault(),xn=!0,Sn(e.clientX),window.addEventListener(`pointermove`,Mn),window.addEventListener(`pointerup`,Nn);return}n<=Q(xt)||_n.isModal()||(e.preventDefault(),Rt=e.shiftKey?[...Q(R)]:[],I(zt,!1),Q(Ft)===`lasso`?(I(Lt,[[e.clientX-t.left,n]],!0),I(It,null)):(I(It,{x0:e.clientX-t.left,y0:n,x1:e.clientX-t.left,y1:n},!0),I(Lt,[],!0)),window.addEventListener(`pointermove`,Wt),window.addEventListener(`pointerup`,Gt))}let wn=null;function Tn(e){if(!wn||!Q(dn))return;let t=e.clientX-wn.x;if(!wn.moved&&Math.abs(t)<4&&Math.abs(e.clientY-wn.y)<4)return;wn.moved=!0;let n=t/Math.max(Q(wt),1)*wn.span,r=Math.min(Math.max(wn.start-n,0),Math.max(0,Q(Ae)-wn.span));I(Le,r,!0),I(Re,Math.min(r+wn.span,Q(Ae)),!0)}let En=null;function Dn(e,t){if(!En)return;let n=En.el.getBoundingClientRect(),r=(e-n.left)/Math.max(n.width,1)*Q(Ae),i=Math.min(Math.max(r-t/2,0),Math.max(0,Q(Ae)-t));I(Le,i,!0),I(Re,Math.min(i+t,Q(Ae)),!0)}function On(e){e.preventDefault(),En={el:e.currentTarget,span:Q(ze)},Dn(e.clientX,En.span),window.addEventListener(`pointermove`,kn),window.addEventListener(`pointerup`,An)}function kn(e){En&&Dn(e.clientX,En.span)}function An(){En=null,window.removeEventListener(`pointermove`,kn),window.removeEventListener(`pointerup`,An)}function jn(e){let t=wn?.moved;wn=null,window.removeEventListener(`pointermove`,Tn),window.removeEventListener(`pointerup`,jn),!t&&e.button===2&&Hn(e)}function Mn(e){xn&&Sn(e.clientX)}function Nn(){xn=!1,window.removeEventListener(`pointermove`,Mn),window.removeEventListener(`pointerup`,Nn)}function Pn(e,t){if(!e)return-1;let n=-1,r=9;return e.keys.forEach((e,i)=>{let a=Math.abs(Dt(e.t)-Dt(t));a<=r&&(r=a,n=i)}),n}function Fn(e){if(!Q(A)||!Q(dn))return;let t=Q(dn).getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;if(r<=Q(xt))return;let i=ln(Math.max(0,Math.min(Q(Ae),Ot(n)))),a=Q(V)===`graph`?Q(F):Q(P)[Math.floor((r-Q(xt))/22)];if(!a)return;I(ie,a.id,!0);let o=Pn(a,i);if(o>=0){I(R,[[a.id,o]],!0);return}let s=Q(V)===`graph`&&!qg.has(a.channel)?Nt(r):t_(a,i)??0;Qg(Q(A).uuid,a.id,i,s)}function In(e){let t=e=>e.preventDefault();return e.addEventListener(`contextmenu`,t),{destroy:()=>e.removeEventListener(`contextmenu`,t)}}function Ln(){if(!Q(A)||!Q(R).length)return;let e=[...Q(R)].sort((e,t)=>t[1]-e[1]);Ug(Q(A).uuid,e.length>1?`Remove keys`:`Remove key`);for(let[t,n]of e)Bg(Q(A).uuid,t,n);Ag(),I(R,[],!0)}function Rn(){let e=Q(V)===`graph`&&Q(F)?[Q(F)]:Q(P),t=[];for(let n of e){let e=-1,r=Q(cn)*1.5;n.keys.forEach((t,n)=>{let i=Math.abs(t.t-Q(ke));i<=r&&(r=i,e=n)}),e>=0&&t.push([n.id,e])}return t}function zn(e,t,n){if(!Q(A)||!Q(R).length||!_n.begin(null,{data:{label:Q(un)===`scale`?`Scale keys`:`Move keys`}}))return;let r=_n.ctx();if(Q(un)===`scale`)hn(r,e*n*Q(ze)*.0133,t?t*n*(Q(jt).hi-Q(jt).lo)*.0133:null);else{let i=Q(cn)*n,a=(Q(jt).hi-Q(jt).lo)/100*n;hn(r,e*i,t?t*a:null)}_n.finish(!0)}function Bn(e){let t=e=>{e.preventDefault(),e.stopPropagation()},n=e=>{if(!Q(A))return;let n=e.target?.tagName;if(n===`INPUT`||n===`SELECT`||n===`TEXTAREA`)return;let r=e.ctrlKey||e.metaKey?10:e.shiftKey?100:1,i={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,1],ArrowDown:[0,-1]}[e.key],a=kl(e);if(lg(e)===dg(`animation.grab`)){t(e),I(un,`move`);return}if(e.key===`Delete`||e.key===`Backspace`){if(!Q(R).length)return;t(e),Ln();return}if(e.key===`Escape`){if(_n.isModal()||!Q(R).length)return;t(e),I(R,[],!0);return}if((e.ctrlKey||e.metaKey)&&a===`C`){if(!Q(R).length)return;t(e);let n=Yg(Q(A).uuid,Q(R));n&&es(n===1?`Copied 1 key`:`Copied `+n+` keys`);return}if((e.ctrlKey||e.metaKey)&&a===`V`){if(!C())return;t(e);let n=Lg(Q(A).uuid,ln(Q(ke)));n.length&&(I(R,n,!0),I(ie,n[0][0],!0));return}if((e.ctrlKey||e.metaKey)&&a===`D`){if(!Q(R).length)return;t(e);let n=Pg(Q(A).uuid,Q(R));n.length&&I(R,n,!0);return}if(a===`M`&&!e.ctrlKey&&!e.metaKey){if(!Q(R).length)return;t(e),Rg(Q(A).uuid,Q(R),ln(Q(ke)));return}if(!e.shiftKey&&(a===`1`||a===`2`)){t(e),I(un,a===`1`?`move`:`scale`,!0);return}if(e.code===`Space`&&(e.ctrlKey||e.metaKey)){t(e);let n=Rn();if(!n.length)return;let r=n.filter(([e,t])=>!le(e,t));I(R,r.length?[...Q(R),...r]:Q(R).filter(([e,t])=>!n.some(([n,r])=>n===e&&r===t)),!0),n[0]&&I(ie,n[0][0],!0);return}if(i){if(t(e),e.shiftKey&&Q(R).length){zn(i[0],Q(V)===`graph`?i[1]:0,e.ctrlKey||e.metaKey?10:1);return}if(i[1]===0){if(e.altKey){lt(i[0]);return}Jg(Q(A).uuid,Math.max(0,Math.min(Q(Ae),Q(ke)+i[0]*Q(cn)*r)))}}};
2474return e.addEventListener(`keydown`,n),{destroy:()=>e.removeEventListener(`keydown`,n)}}let Vn=t(null);function Hn(e){if(!Q(A)||!Q(dn))return;let t=Q(A).uuid,n=Q(dn).getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,a=ln(Math.max(0,Math.min(Q(Ae),Ot(r)))),o=Q(V)===`graph`?Q(F):Q(P)[Math.floor((i-Q(xt))/22)],s=Q(R).length,c=[];if(s&&(c.push({header:s>1?s+` keys`:`Key`}),c.push({label:s>1?`Delete `+s+` keys`:`Delete key`,danger:!0,action:()=>{let e=[...Q(R)].sort((e,t)=>t[1]-e[1]);Ug(t,s>1?`Remove keys`:`Remove key`);for(let[n,r]of e)Bg(t,n,r);Ag(),I(R,[],!0)}}),c.push({label:`Reset easing (linear)`,tooltip:`Drop the curve on the segment leaving each selected key`,action:()=>{Ug(t,`Reset easing`);for(let[e,n]of Q(R))$g(t,e,n,{ease:null});Ag()}}),c.push({label:`Easing`,children:Object.keys(Zg).map(e=>({label:e,action:()=>{Ug(t,`Easing`);for(let[n,r]of Q(R))$g(t,n,r,{ease:[...Zg[e]]});Ag()}}))}),c.push({label:`Move to the playhead`,tooltip:`Put the selection at `+Q(ke).toFixed(2)+`s, keeping their spacing`,action:()=>{let e=Math.min(...Q(R).map(([e,t])=>Q(P).find(t=>t.id===e)?.keys[t]?.t??0)),n=ln(Q(ke))-e;Ug(t,`Move keys`),Mg(t,Q(R).map(([e,t])=>{let r=Q(P).find(t=>t.id===e);return{trackId:e,index:t,t:Math.max(0,(r?.keys[t]?.t??0)+n)}})),Ag()}}),c.push({label:s>1?`Copy `+s+` keys`:`Copy key`,hint:`Ctrl+C`,tooltip:`Keeps their spacing and channels â paste lands at the playhead, in any clip or on any object`,action:()=>{let e=Yg(t,Q(R));e&&es(e===1?`Copied 1 key`:`Copied `+e+` keys`)}}),c.push({label:`Duplicate`,hint:`Ctrl+D`,tooltip:`Repeat the selection after itself, keeping its spacing`,action:()=>{let e=Pg(t,Q(R));e.length&&I(R,e,!0)}}),c.push({label:`Mirror around the playhead`,hint:`M`,tooltip:`The same shape backwards â a close made from an open`,action:()=>Rg(t,Q(R),ln(Q(ke)))}),c.push({label:`Value from the object now`,tooltip:`Read the object as it stands and store that as the key value`,action:()=>{Ug(t,`Key pose`);for(let[e,n]of Q(R)){let r=Q(P).find(t=>t.id===e);r&&$g(t,e,n,{v:a_(Q(A),r.channel)})}Ag()}}),c.push({section:`Timeline`})),C()){let e=Wce();c.push({label:`Paste `+e.keys+(e.keys===1?` key`:` keys`)+` here`,hint:`Ctrl+V`,tooltip:e.channels.join(`, `)+` â a channel this clip lacks gets a track`,action:()=>{let e=Lg(t,ln(Q(ke)));e.length&&(I(R,e,!0),I(ie,e[0][0],!0))}})}c.push({label:`Add key here`,disabled:!o,tooltip:o?kg(o.channel)+` at `+a.toFixed(2)+`s`:`No channel here`,action:()=>{if(!o)return;I(ie,o.id,!0);let e=Q(V)===`graph`&&!qg.has(o.channel)?Nt(i):t_(o,a)??0;Qg(t,o.id,a,e)}}),c.push({label:`Marker at the playhead`,tooltip:`A named point at `+ln(Q(ke)).toFixed(2)+`s â an Animation Marker node pulses as the playhead crosses it`,action:Zt}),c.push({label:`Select every key`,disabled:!Q(P).length,action:()=>{I(R,Q(P).flatMap(e=>Q(V)===`graph`&&Q(F)&&e.id!==Q(F).id?[]:e.keys.map((t,n)=>[e.id,n])),!0)}}),c.push({section:`View`}),c.push({label:`Reset view (fit the clip)`,action:Ue}),c.push({label:`Zoom to the selection`,disabled:Q(R).length<2,action:()=>{let e=Q(R).map(([e,t])=>Q(P).find(t=>t.id===e)?.keys[t]?.t??0),t=Math.min(...e),n=Math.max(...e),r=Math.max((n-t)*.15,.05);I(Le,Math.max(0,t-r),!0),I(Re,Math.min(Q(Ae),n+r),!0)}}),c.push({label:`Snap to frames`,checked:Q(he)===`frame`,tooltip:Q(sn)+` fps`,action:()=>{I(he,Q(he)===`frame`?`off`:`frame`,!0),nt.setItem(`animationSnap`,Q(he))}}),I(Vn,{x:e.clientX,y:e.clientY,items:c},!0)}function Un(e){if(!Q(A))return;let t=Q(A).uuid,n=Q(ke);I(Vn,{x:e.clientX,y:e.clientY,items:[{header:`Add`},{label:`Channel`,children:Q(oe).map(e=>({label:kg(e),action:()=>{I(ie,Wg(t,e,Q(A)),!0),I(R,[],!0)}}))},{label:`Key at playhead`,disabled:!Q(F),tooltip:`Insert a key on the selected channel at `+n.toFixed(2)+`s`,action:()=>{Q(F)&&Qg(t,Q(F).id,ln(n),t_(Q(F),n)??0)}},{label:`Keys on every channel`,disabled:!Q(P).length,tooltip:`Hold this frame: drop a key on every channel at once`,action:()=>{Ug(t,`Add keys`);for(let e of Q(P))Qg(t,e.id,ln(n),t_(e,n)??0);Ag()}},{label:`Key the current pose`,tooltip:`Read the object as it stands now and key every channel that moved â the same thing REC does after a drag, on demand`,action:()=>{let e=U(Vg);e!==t&&(Zce(t),n_(t)),Ug(t,`Key pose`);for(let e of Q(P))Qg(t,e.id,ln(n),a_(Q(A),e.channel));Ag(),o_(t,ln(n)),e!==t&&n_(e)}},{label:`Marker at playhead`,tooltip:`A named point at `+ln(n).toFixed(2)+`s. An Animation Marker node pulses as the playhead crosses it, so a footstep or a puff of dust can sit at an exact frame of the movement.`,action:Zt},{section:`Timing`},{label:`Clear the preview`,tooltip:`Put the object back to the pose it had before anything previewed it, and rewind. Stop only returns to where the run began.`,action:()=>ple(t)},{label:`Retime the movementâ¦`,disabled:!Q(P).length,tooltip:`Stretch or squash every key time by the same ratio, so the movement keeps its shape and only its pace changes`,children:[.5,1,2,4,8].map(e=>({label:e+`s`,action:()=>{cle(t,e),es(`Retimed the movement to `+e+`s.`)}}))},{section:`Presets`},...Object.entries(dle).map(([e,n])=>({label:n.name,tooltip:n.needsOrigin?`Needs its origin on the hinge edge to swing there`:`Adds a ready-made `+n.name.toLowerCase()+` clip`,action:()=>{let n=nle(e,t,Q(A));I(ie,null),I(R,[],!0),n?.needsOrigin&&es(`Door clip added. Move its origin onto the hinge edge to swing there.`,[{label:`Set origin`,action:()=>rc(`Transform`)}])}})),{section:`Clip`},{label:`New clip`,action:()=>I(ie,null)||Hce(t)},{label:`Duplicate clip`,disabled:!Q(re).length,action:()=>Jce(t,Q(Wn)??``)},{label:`Rename clip`,disabled:!Q(re).length,action:()=>I(ge,Q(Wn),!0)},{label:`Delete clip`,danger:!0,disabled:!Q(re).length,action:()=>Q(Wn)&&ale(t,Q(Wn))},{section:`Export`},{label:`Check the GLTF bake`,disabled:!Q(P).length,tooltip:`Authored clips are sampled into real animation tracks whenever you export GLTF â this reports what this object would carry`,action:()=>{let e=hle(Q(A),t),n=e.map(e=>e.name+` (`+e.duration.toFixed(2)+`s)`);es(e.length?`A GLTF export carries `+n.join(`, `)+` with this object.`:`This object has no clip that a GLTF export can carry yet.`)}}]},!0)}let Wn=q(()=>Q(re).find(e=>e.active)?.id??null),Gn=132,Kn=10,qn=1.5,Jn=112,Yn=e=>10+e*112,Xn=e=>10+(qn-e)/2*112,Zn=t(null),Qn=t(-1);function $n(e,t){Q(A)&&Q(F)&&(I(Qn,e,!0),t.preventDefault(),Ug(Q(A).uuid,`Easing`),window.addEventListener(`pointermove`,er),window.addEventListener(`pointerup`,tr))}function er(e){if(Q(Qn)<0||!Q(Zn)||!Q(F)||!Q(A))return;let t=Q(Zn).getBoundingClientRect(),n=(e.clientX-t.left-10)/112,r=qn-(e.clientY-t.top-10)/112*2;n=Math.min(1,Math.max(0,n)),r=Math.min(qn,Math.max(-.5,r));let i=[...Q(pe)];Q(Qn)===0?(i[0]=n,i[1]=r):(i[2]=n,i[3]=r),$g(Q(A).uuid,Q(F).id,Q(me),{ease:i})}function tr(){I(Qn,-1),Ag(),window.removeEventListener(`pointermove`,er),window.removeEventListener(`pointerup`,tr)}function nr(e){Q(F)&&Q(A)&&$g(Q(A).uuid,Q(F).id,Q(me),{ease:[...Zg[e]]})}let rr=e=>Math.min(Math.max(e||320,200),Math.round(window.innerHeight*.8)),ir=t
2474(!1),ar=t(!1);function or(e){I(ir,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function sr(e){Q(ir)&&Md.update(t=>rr(t-e.movementY))}function cr(e){Q(ir)&&(I(ir,!1),e.currentTarget.releasePointerCapture?.(e.pointerId))}function lr(e){I(ar,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()}function ur(e){if(!Q(ar))return;let t=Q($)?Q($).rect.width:Q(Xe),n=Q($)?Q($).rect.height:Q($e),r=Gh(e.currentTarget.parentElement),i=Yh(t+e.movementX,n+e.movementY,r.left,r.top,Je);I(Xe,i.w,!0),I($e,i.h,!0),ag(`animation`,Q(Xe),Q($e))}function dr(e){Q(ar)&&(I(ar,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),fr())}function fr(){nt.setItem(`animationWinW`,String(Q(Xe))),nt.setItem(`animationWinH`,String(Q($e)))}function pr(){let e=Xh(Ye.w,Ye.h,Je);I(Xe,e.w,!0),I($e,e.h,!0),ag(`animation`,Q(Xe),Q($e)),fr()}function mr(){let e=Xh(Q(Xe),Q($e),Je);(e.w!==Q(Xe)||e.h!==Q($e))&&(I(Xe,e.w,!0),I($e,e.h,!0),ag(`animation`,Q(Xe),Q($e)))}var hr=xet();Z(`resize`,p,mr);var gr=N(hr),_r=e=>{var t=fe(),n=N(t),i=e=>{var t=yet(),n=j(t),i=g(n,2);TS(i,{});var a=g(i,2),o=g(j(a),2),s=f(o,!0),c=g(o,4),l=g(c,2);H(a);var u=g(a,2),d=j(u);k(d),H(u),H(t),ne(t,e=>In?.(e)),O(()=>{r(t,1,`fixed inset-x-0 bottom-0 flex flex-col bg-white p-2 text-gray-800 dark:bg-gray-800 dark:text-gray-200 ${Q(it)?``:`hidden`}`),Ze(t,`z-index: var(--z-bottom); height: ${y()??``}px; border-top: 1px solid rgb(55 65 81 / 0.6)`),Y(s,Q(A)?Q(A).name||`object`:`no selection`)}),L(`pointerdown`,n,or),L(`pointermove`,n,sr),L(`pointerup`,n,cr),L(`click`,c,()=>et(!1)),L(`click`,l,()=>$s.set(!0)),X(e,t)},a=e=>{var t=bet();let n;var r=j(t),i=g(j(r),2),a=f(i,!0),o=g(i,4),s=g(o,2);H(r);var c=g(r,2);k(c);var l=g(c,2);H(t),ne(t,e=>In?.(e)),ne(t,(e,t)=>Zh?.(e,t),()=>({key:`animation`,defaultRect:{left:200,top:120}})),ne(t,(e,t)=>Kh?.(e,t),()=>`animation`),ne(t,(e,t)=>$h?.(e,t),()=>({key:`animation`,title:`Animation`,openStore:$s,isOpen:e=>!e,close:()=>$s.set(!0)})),ne(t,(e,t)=>uS?.(e,t),()=>({key:`animation`})),O(()=>{n=Ze(t,`z-index: var(--z-window); max-width: 96vw; max-height: 88vh`,n,{width:`${Q(tt)??``}px`,height:`${Q(rt)??``}px`}),Y(a,Q(A)?Q(A).name||`object`:`no selection`)}),L(`click`,o,()=>et(!0)),L(`click`,s,()=>$s.set(!0)),L(`pointerdown`,l,lr),L(`pointermove`,l,ur),L(`pointerup`,l,dr),L(`dblclick`,l,pr),X(e,t)};G(n,e=>{Q(qe)?e(i):e(a,-1)}),X(e,t)};G(gr,e=>{h()||e(_r)});var vr=g(gr,2),yr=e=>{xS(e,{get x(){return Q(Vn).x},get y(){return Q(Vn).y},get items(){return Q(Vn).items},sizeKey:`animation`,$$events:{close:()=>I(Vn,null)}})};G(vr,e=>{Q(Vn)&&e(yr)}),X(e,hr),ue(),E()}ge([`click`,`input`,`change`,`keydown`,`dblclick`,`pointerdown`,`pointermove`,`pointerup`,`contextmenu`]);var wet=V(`<div class="ws-panel flex h-full shrink-0 flex-col overflow-y-auto svelte-q9256w"><!></div>`),Tet=V(`<div class="ws-resize svelte-q9256w" style="touch-action: none" title="Drag to resize"></div>`),Eet=V(`<div class="shrink-0"><!></div>`),Det=V(`<button> </button>`),Oet=V(`<div class="ws-resize svelte-q9256w" style="touch-action: none" data-ws-secondary-resize="" title="Drag to resize · double-click to reset"></div>`),ket=V(`<div class="ws-panel ws-panel-secondary flex h-full shrink-0 flex-col overflow-y-auto svelte-q9256w"><div class="ws-panel-head flex shrink-0 items-center gap-1 px-2 py-1"><span class="flex-1 truncate text-xs font-semibold opacity-80"> </span> <button class="ws-mini svelte-q9256w" title="Switch sidebar side" data-ws-switch-side="">â</button> <button class="ws-mini svelte-q9256w" title="Close">â</button></div> <div class="min-h-0 flex-1 overflow-y-auto"><!></div></div>`),Aet=V(`<div class="ws-root flex h-full w-full overflow-hidden"><!> <div class="ws-edge shrink-0 svelte-q9256w"><button class="ws-edge-btn svelte-q9256w" data-ws-primary-toggle=""> </button> <!></div> <div class="ws-main flex min-w-0 flex-1 flex-col" style="order: 3"><!> <div class="min-h-0 flex-1 overflow-hidden"><!></div></div> <div class="ws-tabs shrink-0 svelte-q9256w"><!> <!></div> <!></div>`);function k4(e,n){Ce(n,!0);let i=J(n,`primaryLabel`,3,`sidebar`),a=J(n,`primaryDefaultOpen`,3,!0),o=J(n,`primaryDefaultWidth`,3,176),s=J(n,`secondaryModes`,19,()=>[{key:`settings`,icon:`â`,label:`Settings`}
2474]),c=J(n,`secondaryDefaultOpen`,3,!1),l=J(n,`secondaryDefaultWidth`,3,224),u=typeof localStorage>`u`?null:localStorage,d=(e,t)=>{let n=u?.getItem(e);return n==null?t:n!==`false`},p=t(Ne(d(`ws:${n.key}:primaryOpen`,a()))),m=t(Ne(d(`ws:${n.key}:secondaryOpen`,c()))),h=t(Ne(u?.getItem(`ws:${n.key}:secondaryMode`)??s()[0]?.key??`settings`)),_=t(u?.getItem(`ws:${n.key}:secondaryPinned`)===`true`),v=t(Ne(u?.getItem(`ws:${n.key}:side`)===`right`?`right`:`left`)),y=t(Ne(Number(u?.getItem(`ws:${n.key}:primaryWidth`))||o())),x=t(Ne(Number(u?.getItem(`ws:${n.key}:secondaryWidth`))||l())),S=q(()=>Q(v)===`left`?`right`:`left`),C=t(0),w=q(()=>Math.max(140,(Q(C)||640)-24-(Q(p)?Q(y):0)-160)),T=q(()=>Math.min(Q(x),Q(w)));function E(){I(p,!Q(p)),u?.setItem(`ws:${n.key}:primaryOpen`,String(Q(p)))}function D(){I(v,Q(v)===`left`?`right`:`left`,!0),u?.setItem(`ws:${n.key}:side`,Q(v))}function k(){u?.setItem(`ws:${n.key}:secondaryOpen`,String(Q(m))),u?.setItem(`ws:${n.key}:secondaryMode`,Q(h)),u?.setItem(`ws:${n.key}:secondaryPinned`,String(Q(_)))}function A(e){Q(m)&&Q(h)===e?I(m,!1):(I(h,e,!0),I(m,!0),I(_,!0)),k()}function M(e){Q(m)||I(_,!1),I(h,e,!0),I(m,!0),k()}function te(){I(m,!1),k()}function ne(){return{open:Q(m),mode:Q(h),pinned:Q(_)}}let N=t(!1);function P(e){I(N,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function re(e){if(!Q(N))return;let t=Q(v)===`left`?e.movementX:-e.movementX;I(y,Math.min(Math.max(110,Q(y)+t),460),!0)}function ie(e){Q(N)&&(I(N,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),u?.setItem(`ws:${n.key}:primaryWidth`,String(Q(y))))}let F=t(!1);function oe(e){I(F,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function R(e){if(!Q(F))return;let t=Q(S)===`left`?e.movementX:-e.movementX;I(x,Math.min(Math.max(140,Q(T)+t),Q(w)),!0)}function se(e){Q(F)&&(I(F,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),u?.setItem(`ws:${n.key}:secondaryWidth`,String(Q(x))))}function ce(){I(x,l()),u?.removeItem(`ws:${n.key}:secondaryWidth`)}let le=q(()=>Q(v)===`left`?0:6),de=q(()=>Q(v)===`left`?2:4),z=q(()=>Q(S)===`left`?2:4),fe=q(()=>Q(S)===`left`?0:6),pe=q(()=>s().find(e=>e.key===Q(h))??s()[0]),me=q(()=>Q(v)===`left`===Q(p)?`â¹`:`âº`);var V={showSecondary:M,hideSecondary:te,secondaryStatus:ne},he=Aet(),ge=j(he),U=e=>{var t=wet(),r=j(t);ae(r,()=>n.primary??qe),H(t),O(()=>Ze(t,`order: ${Q(le)??``}; width: ${Q(y)??``}px`)),X(e,t)};G(ge,e=>{Q(p)&&e(U)});var W=g(ge,2),_e=j(W),ve=f(_e,!0),ye=g(_e,2),be=e=>{var t=Tet();L(`pointerdown`,t,P),L(`pointermove`,t,re),L(`pointerup`,t,ie),X(e,t)};G(ye,e=>{Q(p)&&e(be)}),H(W);var xe=g(W,2),K=j(xe),Se=e=>{var t=Eet(),r=j(t);ae(r,()=>n.topbar),H(t),X(e,t)};G(K,e=>{n.topbar&&e(Se)});var we=g(K,2),Te=j(we);ae(Te,()=>n.main??qe),H(we),H(xe);var Ee=g(xe,2),De=j(Ee);B(De,17,s,e=>e.key,(e,t)=>{var n=Det(),i=f(n,!0);O(()=>{r(n,1,`ws-tab-btn ${Q(m)&&Q(h)===Q(t).key?`ws-tab-active`:``}`,`svelte-q9256w`),b(n,`title`,Q(t).label),b(n,`data-ws-mode`,Q(t).key),Y(i,Q(t).icon)}),L(`click`,n,()=>A(Q(t).key)),X(e,n)});var Oe=g(De,2),ke=e=>{var t=Oet();L(`pointerdown`,t,oe),L(`pointermove`,t,R),L(`pointerup`,t,se),L(`dblclick`,t,ce),X(e,t)};G(Oe,e=>{Q(m)&&e(ke)}),H(Ee);var Ae=g(Ee,2),je=e=>{var t=ket(),r=j(t),i=j(r),a=f(i,!0),o=g(i,2),s=g(o,2);H(r);var c=g(r,2),l=j(c);ae(l,()=>n.secondary??qe,()=>Q(h)),H(c),H(t),O(()=>{Ze(t,`order: ${Q(fe)??``}; width: ${Q(T)??``}px`),Y(a,Q(pe)?.label)}),L(`click`,o,D),L(`click`,s,te),X(e,t)};return G(Ae,e=>{Q(m)&&e(je)}),H(he),O(()=>{Ze(W,`order: ${Q(de)??``}`),b(_e,`title`,Q(p)?`Hide ${i()}`:`Show ${i()}`),Y(ve,Q(me)),Ze(Ee,`order: ${Q(z)??``}`)}),L(`click`,_e,E),ee(he,`clientWidth`,e=>I(C,e)),X(e,he),ue(V)}ge([`click`,`pointerdown`,`pointermove`,`pointerup`,`dblclick`]);var jet=V(`<button class="uv-slot-btn text-red-400 svelte-q2yuu7" title="Remove this image" aria-label="Remove this image">â</button>`),Met=V(`<div><button><span class="h-7 w-7 shrink-0 rounded-sm border border-gray-600 bg-gray-900 bg-cover bg-center"></span> <span class="min-w-0 flex-1 truncate"> </span></button> <button class="uv-slot-btn svelte-q2yuu7" aria-label="Assign the selected faces to this slot"><!></button> <button class="uv-slot-btn svelte-q2yuu7"><!></button> <!></div>
2474`),Net=V(`<button><!></button>`),Pet=V(`<button> </button>`),Fet=V(`<button class="block w-full px-2 py-1 text-left text-[11px] text-gray-200 hover:bg-gray-700"> </button>`),Iet=V(`<div id="uv-unwrap-menu" class="absolute left-0 top-full z-30 mt-1 w-44 rounded-sm border border-gray-600 bg-gray-800 py-1 shadow-lg"><!> <p class="border-t border-gray-700 px-2 pt-1 text-[10px] leading-relaxed text-gray-500"> </p></div>`),Let=V(`<span id="uv-multi-note" class="shrink-0 text-[10px] text-amber-400"> </span>`),Ret=V(`<span id="uv-paint-only" class="shrink-0 text-[10px] text-amber-400">paint only</span>`),zet=V(`<span id="uv-dense-note" class="shrink-0 text-[10px] text-amber-400">UV wireframe hidden (dense mesh)</span>`),Bet=V(`<span id="uv-filter-note"> </span>`),Vet=V(`<span id="uv-sel-count" class="shrink-0 text-[11px] tabular-nums text-amber-400"> </span>`),Het=V(`<div class="flex items-center gap-1 border-b border-gray-700/60 px-2 py-1"><div class="flex shrink-0 items-center gap-0.5"></div> <button id="uv-filter-faces" title="Edit only the faces selected in Edit Mesh. Needed wherever faces share UV space, so a drag moves one face instead of all of them." aria-label="Only the faces selected in Edit Mesh"><!></button> <div class="flex shrink-0 items-center overflow-hidden rounded-sm border border-gray-600 text-[10px] uppercase tracking-wide text-gray-300"></div> <button id="uv-nav" title="Pick vertices with the keyboard (Ctrl+Space): the arrows walk a cursor from vertex to vertex, Ctrl+Space takes the one under it into the selection, Esc leaves" aria-label="Keyboard vertex navigation"><!></button> <button id="uv-origin" aria-label="Transform origin"><!></button> <div class="flex shrink-0 items-center gap-0.5 border-l border-gray-700/60 pl-1"><button class="uv-tool svelte-q2yuu7" id="uv-op-linked" title="Select the whole UV island (grow to everything connected in UV space)" aria-label="Select linked UV island"><!></button> <button class="uv-tool svelte-q2yuu7" id="uv-op-rotate" title="Rotate the selection 90 degrees" aria-label="Rotate the selection 90 degrees"><!></button> <button class="uv-tool svelte-q2yuu7" id="uv-op-flip-u" title="Flip the selection horizontally" aria-label="Flip the selection horizontally"><!></button> <button class="uv-tool svelte-q2yuu7" id="uv-op-flip-v" title="Flip the selection vertically" aria-label="Flip the selection vertically"><!></button> <button class="uv-tool svelte-q2yuu7" id="uv-op-fit" title="Fit the selection to the 0..1 square (keeps its aspect)" aria-label="Fit the selection to the UV square"><!></button></div> <div class="relative shrink-0"><button class="ui-button-quiet" id="uv-unwrap">Unwrap â¾</button> <!></div> <span class="truncate text-[11px] text-gray-400"> </span> <!> <!> <!> <span class="flex-1"></span> <!> <button class="ui-button-quiet" title="Zoom out" aria-label="Zoom out">â</button> <span class="w-12 text-center text-[11px] tabular-nums text-gray-400"> </span> <button class="ui-button-quiet" title="Zoom in" aria-label="Zoom in">ï¼</button> <button class="ui-button-quiet" title="Fit the UV square">Fit</button></div>`),Uet=V(`<p class="p-2 text-[11px] text-gray-500">No material on this object.</p>`),Wet=V(`<!> <button id="uv-add-slot" class="mt-1 flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[11px] text-gray-300 hover:bg-gray-700/60" title="Add a material slot (a copy of the last one), then assign faces to it"><!> Add material slot</button> <p class="px-2 pt-1.5 text-[10px] leading-relaxed text-gray-500">Drop an image on a slot, or use its image button, to texture it. To give 2475 one part of the model its own texture: select faces in Edit Mesh, add a 2476 slot, then use that slot's â button to assign them. All of it is shared 2477 with peers.</p>`,1),Get=V(`<div class="ui-section-label px-2 pt-2">Materials</div> <!> <input id="uv-texture-file" type="file" class="hidden"/>`,1),Ket=V(`<div class="flex h-full items-center justify-center p-6 text-center text-sm text-gray-400">Select a mesh in the viewport to see and edit its UV map.</div>`),qet=V(`<div class="flex h-full items-center justify-center p-6 text-center text-sm text-gray-400"> </div>`),Jet=V(`<div id="uv-nav-badge" class="pointer-events-none absolute left-1/2 top-2 -translate-x-1/2 roun
2477ded-sm bg-gray-900/85 px-2 py-0.5 text-[11px] text-amber-300">Picking with the keyboard â arrows move the cursor, Ctrl+Space selects, Esc leaves</div>`),Yet=V(`<div id="uv-grab-badge" class="pointer-events-none absolute left-1/2 top-2 -translate-x-1/2 rounded-sm bg-amber-500/90 px-2 py-0.5 text-[11px] font-medium text-gray-900"> </div>`),Xet=V(`<canvas id="uv-canvas" class="absolute inset-0 h-full w-full" style="touch-action: none"></canvas> <!> <!>`,1),Zet=V(`<div id="uv-canvas-wrap" class="relative h-full w-full overflow-hidden bg-gray-900 outline-none" tabindex="-1"><!></div>`),Qet=V(`<button type="button" role="radio"> </button>`),$et=V(`<div class="border-b border-gray-700/60 p-2"><div class="ui-section-label">Brush</div> <label class="mb-2 block text-[11px] text-gray-400">Colour <input id="uv-brush-color" type="color" class="mt-1 h-7 w-full cursor-pointer rounded-sm border border-gray-600 bg-gray-900"/></label> <label class="block text-[11px] text-gray-400">Size <span class="tabular-nums text-gray-200"> </span> <input id="uv-brush-size" type="range" min="1" max="128" step="1" class="mt-1 w-full accent-primary-500"/></label> <div class="mt-2 text-[11px] text-gray-400">Pen pressure</div> <div id="uv-pen-pressure" class="mt-1 flex gap-1" role="radiogroup" aria-label="Pen pressure"></div> <p class="mt-1 text-[10px] leading-relaxed text-gray-500">Size is in texture pixels, so it paints the same width at any zoom. 2478 Each stroke is one undo step; peers watch it live. A pen's pressure varies the 2479 width (or the opacity); a mouse stroke is unchanged.</p></div>`),ett=V(`<!> <div class="p-2 text-[11px] leading-relaxed text-gray-400"><p class="mb-2">Drag a vertex to move its UV corner. Corners that share a point move together, and dragging any selected vertex moves the whole selection.</p> <p class="mb-2"><span class="text-gray-200">Shift</span> (or Ctrl) adds to the selection â clicking a vertex, or with box and lasso.</p> <p class="mb-2"><span class="text-gray-200">Box</span> and <span class="text-gray-200">Lasso</span> select everything they enclose. Middle-drag pans in any tool; in Select, dragging the background pans and clicking it deselects.</p> <p class="mb-2"><span class="text-gray-200">1 / 2 / 3</span> arm Move, Rotate and Scale.</p> <p class="mb-2">Rotate and scale turn about the selection's centre. The <span class="text-gray-200">origin</span> button places one you can <span class="text-gray-200">drag</span> instead â it snaps onto a point when you come near one, Alt places it freely â and right-click ⸠Origin puts it under the pointer. <span class="text-gray-200">Alt</span> while STARTING a gesture uses the cursor for that gesture alone.</p> <p class="mb-2"><span class="text-gray-200">Middle-press a selected point</span> to grab the selection: it follows the pointer with no button held until a click or <span class="text-gray-200">Enter</span> places it, and <span class="text-gray-200">Esc</span> puts it back.</p> <p class="mb-2"><span class="text-gray-200">Arrows</span> apply the armed transform about the origin: one texture pixel, one degree, or 1% â <span class="text-gray-200">Ctrl</span> Ã10 and <span class="text-gray-200">Shift</span> Ã100. Scaling works per axis (left/right in U, up/down in V); Alt scales both.</p> <p class="mb-2"><span class="text-gray-200">Ctrl+Space</span> picks with the keyboard: a cursor appears, the arrows walk it vertex to vertex, each Ctrl+Space takes the one under it into the selection (or out again), Esc leaves. <span class="text-gray-200">Ctrl+Shift+arrow</span> grows the selection in a direction, <span class="text-gray-200">Ctrl+A</span> / <span class="text-gray-200">Ctrl+I</span> select all and invert, <span class="text-gray-200">L</span> takes the whole island.</p> <p class="mb-2"><span class="text-gray-200">Right-click</span> for everything above on the point under the pointer.</p> <p class="text-gray-500">Each drag, nudge and menu action is one undo step and is shared with connected peers.</p></div>`,1),ttt=V(`<button class="uv-chip svelte-q2yuu7"> </button>`),ntt=V(`<div id="uv-tex-size" class="mb-1">
2479Size <span class="tabular-nums text-gray-200"> </span> <span class="text-gray-500"> </span></div> <div class="mb-2 flex flex-wrap gap-1"><button class="uv-chip svelte-q2yuu7" id="uv-tex-half" title="Halve the longest side">Half</button> <!></div> <p class="mb-2 text-[10px] leading-relaxed text-gray-500">Resizing keeps the aspect and is shared with peers as one undo step.</p>`,1),rtt=V(`<div class="mb-2 text-gray-500">This slot has no texture yet.</div>`),itt=V(`<p class="mb-2 text-[10px] leading-relaxed text-amber-400">The grid replaces every material in the scene while it is on. It is local 2480 to you and is never saved or sent.</p>`),att=V(`<div class="p-2 text-[11px] text-gray-400"><div class="ui-section-label">Texture</div> <!> <button id="uv-checker" title="Show a UV test grid instead of the scene's textures â LOCAL only, never saved or sent"><!> <span class="text-[11px]">UV test grid</span></button> <!> <div class="ui-section-label">Mesh</div> <div class="mb-1">Triangles in this slot: <span class="tabular-nums text-gray-200"> </span></div> <div>Material slots: <span class="tabular-nums text-gray-200"> </span></div></div>`),ott=V(`<div id="uv-dock"><div class="resize-cue absolute -top-1 left-0 right-0 z-30 h-2 cursor-ns-resize hover:bg-primary-600/30" style="touch-action: none" title="Drag to resize"></div> <!> <div class="flex shrink-0 items-center gap-2 pb-1"><span class="text-xs font-semibold text-gray-200">UV editor</span> <span class="flex-1"></span> <button class="ui-button-quiet" title="Undock into a floating window">â§</button> <button class="ui-button-quiet" title="Close">â</button></div> <div class="flex min-h-0 flex-1 flex-col"><!></div></div>`),stt=V(`<div id="uv-window" class="ui-panel fixed flex flex-col overflow-hidden"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span>UV editor</span> <span class="text-[11px] font-normal text-gray-400"> </span> <span class="flex-1"></span> <button class="ui-button-quiet" title="Dock to the bottom">â© Dock</button> <button class="ui-button-quiet" title="Close">â</button></div> <div class="flex min-h-0 flex-1 flex-col"><!></div> <div class="resize-cue absolute bottom-0 right-0 z-10 h-3.5 w-3.5 cursor-se-resize rounded-tl bg-gray-500/40" style="touch-action: none" title="Drag to resize · double-click to reset size"></div></div>`),ctt=V(`<!> <!>`,1);function ltt(e,n){Ce(n,!0);let i=()=>z(Up,`$faceEditObject`,te),a=()=>z(mm,`$editingObject`,te),o=()=>z(Ui,`$objectsGroup`,te),s=()=>z(Di,`$selectedObject`,te),c=()=>z(Kr,`$selectedObjects`,te),l=()=>z(JV,`$uvActiveSlot`,te),d=()=>z(eH,`$uvFaceFilter`,te),m=()=>z(Ip,`$faceEditSelectedTris`,te),h=()=>z(Ad,`$dockModeArm`,te),_=()=>z(Qh,`$tabGroups`,te),y=()=>z(Mo,`$uvEditorClose`,te),x=()=>z(Md,`$dockHeight`,te),S=()=>z(Ld,`$visibleDockKey`,te),C=()=>z(Fd,`$dockMinimized`,te),w=()=>z(YV,`$uvTool`,te),T=()=>z(rU,`$uvPaintTick`,te),E=()=>z(XV,`$uvBrushColor`,te),D=()=>z(ZV,`$uvBrushSize`,te),k=()=>z(QV,`$uvPenPressure`,te),ee=()=>z(oU,`$uvCheckerOn`,te),M=()=>z(Pi,`$globalScene`,te),[te,re]=Ve(),ie=(e,t=qe,n=qe)=>{var i=Met(),a=j(i),o=j(a),s=g(o,2),c=f(s,!0);H(a);var l=g(a,2);aAe(j(l),{size:14,"aria-hidden":`true`}),H(l);var u=g(l,2);ZOe(j(u),{size:14,"aria-hidden":`true`}),H(u);var d=g(u,2),p=e=>{var t=jet();O(()=>b(t,`id`,`uv-slot-remove-${n()??``}`)),L(`click`,t,()=>Q(se)&&Wv(Q(se).uuid,n())),X(e,t)};G(d,e=>{t().mapUrl&&e(p)}),H(i),O(()=>{r(i,1,`uv-slot group/slot ${n()===Q(V)?`uv-slot-active`:``} ${Q(ln)===n()?`uv-slot-drop`:``}`,`svelte-q2yuu7`),b(i,`data-uv-slot`,n()),r(a,1,`flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left text-xs ${n()===Q(V)?`text-primary-200`:`text-gray-300`}`),b(a,`title`,t()?.name||`Material slot ${n()}`),Ze(o,t().mapUrl?`background-image:url(${t().mapUrl})`:``),Y(c,t()?.name||t()?.type||`Slot ${n()}`),b(l,`id`,`uv-slot-assign-${n()??``}`),b(l,`title`,Q(kn)?`Assign the ${Q(kn)} selected face triangles to this slot`:`Select faces in Edit Mesh first, then assign them to a slot`),l.disabled=!Q(kn),b(u,`id`,`uv-slot-image-${n()??``}`),b(u,`title`,t().mapUrl?`Replace this image`:`Add an image`),b(u,`aria-label`,t().mapUrl?`Replace this image`:`Add an image`)}
2480),Z(`dragover`,i,e=>pn(e,n())),Z(`dragleave`,i,()=>I(ln,Q(ln)===n()?-1:Q(ln),!0)),Z(`drop`,i,e=>mn(e,n())),L(`click`,a,()=>JV.set(n())),L(`click`,l,()=>jn(n())),L(`click`,u,()=>Mn(n())),X(e,i)},F=e=>{We(k4(e,{key:`uv`,primaryLabel:`materials`,primaryDefaultWidth:168,secondaryModes:[{key:`tool`,icon:`ð`,label:`Tool`},{key:`settings`,icon:`â`,label:`Settings`}],topbar:e=>{var t=Het(),n=j(t);B(n,21,()=>oe,e=>e.key,(e,t)=>{let n=q(()=>Q(t).icon);var i=Net(),a=j(i);P(a,()=>Q(n),(e,t)=>{t(e,{size:15,"aria-hidden":`true`})}),H(i),O(()=>{r(i,1,`uv-tool ${w()===Q(t).key?`uv-tool-active`:``}`,`svelte-q2yuu7`),b(i,`id`,`uv-tool-${Q(t).key??``}`),b(i,`title`,Q(t).title),b(i,`aria-label`,Q(t).title),b(i,`aria-pressed`,w()===Q(t).key)}),L(`click`,i,()=>YV.set(Q(t).key)),X(e,i)}),H(n);var i=g(n,2);IOe(j(i),{size:15,"aria-hidden":`true`}),H(i);var a=g(i,2);B(a,21,()=>ae,([e,t,n])=>e,(e,t)=>{var n=q(()=>A(Q(t),3));let i=()=>Q(n)[0],a=()=>Q(n)[1],o=()=>Q(n)[2];var s=Pet(),c=f(s,!0);O(()=>{b(s,`id`,`uv-mode-${i()??``}`),r(s,1,`px-1.5 py-0.5 ${Q(ft)===i()?`bg-primary-600/30 text-primary-200`:`hover:bg-gray-700/70`}`),b(s,`title`,`${a()??``} the selection (${o()??``}) â drag it, middle-press a selected vertex to grab it, or nudge with the arrows`),b(s,`aria-pressed`,Q(ft)===i()),Y(c,a())}),L(`click`,s,()=>Qt(i())),X(e,s)}),H(a);var o=g(a,2);oz(j(o),{size:15,"aria-hidden":`true`}),H(o);var s=g(o,2);wOe(j(s),{size:15,"aria-hidden":`true`}),H(s);var l=g(s,2),u=j(l);oke(j(u),{size:15,"aria-hidden":`true`}),H(u);var p=g(u,2);yz(j(p),{size:15,"aria-hidden":`true`}),H(p);var m=g(p,2);qke(j(m),{size:15,"aria-hidden":`true`}),H(m);var h=g(m,2);Yke(j(h),{size:15,"aria-hidden":`true`}),H(h);var _=g(h,2);fz(j(_),{size:15,"aria-hidden":`true`}),H(_),H(l);var v=g(l,2),y=j(v),x=g(y,2),S=e=>{var t=Iet(),n=j(t);B(n,17,()=>wn,e=>e.key,(e,t)=>{var n=Fet(),r=f(n,!0);O(()=>{b(n,`id`,`uv-unwrap-${Q(t).key??``}`),Y(r,Q(t).label)}),L(`click`,n,()=>Tn(Q(t).key)),X(e,n)});var r=g(n,2),i=f(r,!0);H(t),O(()=>Y(i,Q(kn)?`Applies to the ${Q(kn)} selected face triangles.`:`Applies to the whole mesh.`)),X(e,t)};G(x,e=>{Q(Cn)&&e(S)}),H(v);var C=g(v,2),T=f(C,!0),E=g(C,2),D=e=>{var t=Let(),n=f(t);O(()=>Y(n,`1 of ${c().length??``} selected`)),X(e,t)};G(E,e=>{c().length>1&&e(D)});var k=g(E,2),ee=e=>{var t=Ret();O(()=>b(t,`title`,Q(le).reason)),X(e,t)},M=e=>{var t=zet();X(e,t)};G(k,e=>{!Q(le).ok&&Q(ce).ok?e(ee):Q(de)&&e(M,1)});var te=g(k,2),ne=e=>{var t=Bet(),n=f(t,!0);O(()=>{r(t,1,`shrink-0 text-[10px] ${Q(he)?`text-primary-300`:`text-amber-400`}`),Y(n,Q(he)?`${Q(he).size} face tris`:`no face selection`)}),X(e,t)};G(te,e=>{d()===`selection`&&e(ne)});var N=g(te,4),re=e=>{var t=Vet(),n=f(t);O(()=>Y(n,`${Q(Ie).length??``} selected`)),X(e,t)};G(N,e=>{Q(Ie).length&&e(re)});var ie=g(N,2),F=g(ie,2),R=f(F),ue=g(F,2),z=g(ue,2);H(t),O(e=>{r(i,1,`uv-tool ${d()===`selection`?`uv-tool-active`:``}`,`svelte-q2yuu7`),b(i,`aria-pressed`,d()===`selection`),r(o,1,`uv-tool ${Q(gt)?`uv-tool-active`:``}`,`svelte-q2yuu7`),b(o,`aria-pressed`,Q(gt)),r(s,1,`uv-tool ${Q(ht)?`uv-tool-active`:``}`,`svelte-q2yuu7`),b(s,`title`,Q(ht)?`Rotating and scaling about the origin you placed â drag it on the canvas to adjust it (Alt while dragging places it freely). Click to go back to the selection centre.`:`Rotate and scale turn about the selection centre. Click to place an origin you can drag instead.`),b(s,`aria-pressed`,!!Q(ht)),u.disabled=!Q(le).ok||!Q(Ie).length,p.disabled=!Q(hn),m.disabled=!Q(hn),h.disabled=!Q(hn),_.disabled=!Q(hn),b(y,`title`,Q(le).ok?`Generate new UVs for this mesh, or just the faces selected in Edit Mesh`:Q(le).reason),y.disabled=!Q(le).ok,Y(T,Q(se)?Q(se).name||`object`:`no selection`),Y(R,`${e??``}%`)},[()=>Math.round(Q(je)*100)]),L(`click`,i,()=>eH.set(d()===`selection`?`all`:`selection`)),L(`click`,o,()=>Q(gt)?Ft():Nt()),L(`click`,s,kt),L(`click`,u,Sn),L(`click`,p,vn),L(`click`,m,yn),L(`click`,h,bn),L(`click`,_,xn),L(`click`,y,()=>I(Cn,!Q(Cn))),L(`click`,ie,()=>sn(1/1.25)),L(`click`,ue,()=>sn(1.25)),L(`click`,z,on),X(e,t)},primary:e=>{var t=Get(),n=g(N(t),2),r=e=>{var t=Uet();X(e,t)},i=e=>{var t=Wet(),n=N(t);B(n,17,()=>Q(pe),Be,(e,t,n)=>{ie(e,()=>Q(t),()=>n)});var r=g(n,2),i=j(r);rS(i,{size:13,"aria-hidden":`true`}),W(),H(r),W(2),L(`click`,r,An),X(e,t)};G(n,e=>{Q(pe).length?e(i,-1):e(r)});var a=g(n,2);b(a,`accept`,fn),We(a,e=>I(un,e),()=>Q(un)),L(`change`,a,Nn),X(e,t)},main:e=>{var t=Zet(),n=j(t),r=e=>{var t=Ket();X(e,t)},i=e=>{var t=qet(),n=f(t,!0);O(()=>Y(n,Q(ce).reason)),X(e,t)},a=e=>{var t=Xet(),n=N(t);We(n,e=>I(Ae,e),()=>Q(Ae)),ne(n,e=>cn?.(e));var r=g(n,2),i=e=>{var t=Jet();X(e,t)};G(r,e=>{Q(gt)&&!Q(pt)&&e(i)});var a=g(r,2),o=e=>{var t=Yet(),n=f(t);O(()=>Y(n,`${Q(ft)===`rotate`?`Rotating`:Q(ft)===`scale`?`Scaling`:`Moving`} 2481 ${Q(Ie).length===1?`1 point`:Q(Ie).length+` points`} â click or Enter to place, Esc to cancel`)),X(e,t)};G(a,e=>{Q(pt)&&e(o)}),X(e,t)};G(n,e=>{Q(se)?Q(ce).ok?e(a,-1):e(i,1):e(r)}),H(t),We(t,e=>I(dt,e),()=>Q(dt)),ne(t,e=>en?.(e)),X(e,t)},secondary:(e,t=qe)=>{var n=fe(),i=N(n),a=e=>{var t=ett(),n=N(t),i=e=>{var t=$et(),n=g(j(t),2),i=g(j(n));v(i),H(n);var a=g(n,2),o=g(j(a)),s=f(o),c=g(o,2);v(c),H(a);var l=g(a,4);B(l,20,()=>[[`size`,`Size`],[`opacity`,`Opacity`],[`off`,`Off`]],([e,t])=>e,(e,t)=>{var n=q(()=>A(t,2));let i=()=>Q(n)[0],a=()=>Q(n)[1];var o=Qet(),s=f(o,!0);O(()=>{b(o,`aria-checked`,k()===i()),b(o,`data-value`,i()),r(o,1,`flex-1 rounded-sm px-2 py-0.5 text-[11px] `+(k()===i()?`bg-primary-600 text-white`:`bg-gray-700 text-gray-300 hover:bg-gray-600`),`svelte-q2yuu7`),Y(s,a())}),L(`click`,o,()=>QV.set(i())),X(e,o)}),H(l),W(2),H(t),O(()=>{u(i,E()),Y(s,`${D()??``}px`),u(c,D())}),L(`input`,i,e=>XV.set(e.currentTarget.value)),L(`input`,c,e=>ZV.set(parseInt(e.currentTarget.value)||1)),X(e,t)};G(n,e=>{w()===`paint`&&e(i)}),W(2),X(e,t)},o=e=>{var t=att(),n=g(j(t),2),i=e=>{var t=ntt(),n=N(t),r=g(j(n)),i=f(r),a=g(r,2),o=f(a);H(n);var s=g(n,2),c=j(s),l=g(c,2);B(l,16,()=>[512,1024,2048],e=>e,(e,t)=>{var n=ttt(),r=f(n,!0);O(()=>{b(n,`id`,`uv-tex-${t??``}`),b(n,`title`,`Resize the longest side to ${t??``}px`),Y(r,t)}),L(`click`,n,()=>On(t)),X(e,n)}),H(s),W(2),O(()=>{Y(i,`${Q(En).w??``} Ã ${Q(En).h??``}`),Y(o,`(~${Q(Dn)??``} MB on the GPU)`)}
2481),L(`click`,c,()=>On(Math.max(Math.round(Math.max(Q(En).w,Q(En).h)/2),8))),X(e,t)},a=e=>{var t=rtt();X(e,t)};G(n,e=>{Q(En)?e(i):e(a,-1)});var o=g(n,2),s=j(o);cge(s,{size:14,"aria-hidden":`true`}),W(2),H(o);var c=g(o,2),l=e=>{var t=itt();X(e,t)};G(c,e=>{ee()&&e(l)});var u=g(c,4),d=g(j(u)),p=f(d,!0);H(u);var m=g(u,2),h=g(j(m)),_=f(h,!0);H(m),H(t),O(()=>{r(o,1,`uv-tool mb-2 w-auto gap-1.5 px-2 ${ee()?`uv-tool-active`:``}`,`svelte-q2yuu7`),b(o,`aria-pressed`,ee()),Y(p,Q(ge).length),Y(_,Q(me))}),L(`click`,o,()=>oU.set(!ee())),X(e,t)};G(i,e=>{t()===`tool`?e(a):e(o,-1)}),X(e,n)},$$slots:{topbar:!0,primary:!0,main:!0,secondary:!0}}),e=>I(ke,e,!0),()=>Q(ke))},ae=[[`move`,`Move`,`1`],[`rotate`,`Rotate`,`2`],[`scale`,`Scale`,`3`]],oe=[{key:`select`,icon:mz,title:`Select (click a vertex; Shift adds)`},{key:`box`,icon:Cz,title:`Box select (drag a rectangle; Shift adds)`},{key:`lasso`,icon:sz,title:`Lasso select (draw around vertices; Shift adds)`},{key:`paint`,icon:lge,title:`Paint on the texture`}],R=q(()=>i()??a()??null),se=q(()=>(o(),rH(s(),c(),Q(R)))),ce=q(()=>(o(),Q(se)?oH(Q(se)):{ok:!1,reason:`Select a mesh to edit its UVs.`})),le=q(()=>(o(),Q(se)?sH(Q(se)):{ok:!1,reason:`Select a mesh to edit its UVs.`})),de=q(()=>(o(),Q(se)?sm(Q(se))>cH:!1)),pe=q(()=>(o(),nH(Q(se)).map((e,t)=>({slot:t,name:e?.name||``,type:e?.type||``,mapUrl:e?.userData?.mapDataUrl??null})))),me=q(()=>Q(se)?SH(Q(se)):0),V=q(()=>Math.min(l(),Math.max(Q(me)-1,0))),he=q(()=>(o(),d(),m(),tH(Q(se)?.uuid))),ge=q(()=>(o(),Q(se)&&Q(ce).ok&&!Q(de)?lH(Q(se),Q(V),Q(he)):[])),U=q(()=>Q(he)?xH(Q(ge)):null),ve=q(()=>Q(pe)[Q(V)]?.mapUrl??null),ye=t(!0),be={minW:360,minH:260},xe={w:640,h:460},Se=t(640),we=t(460);if(typeof localStorage<`u`){I(ye,nt.getItem(`uvDocked`)!==`false`);let e=Xh(parseInt(nt.getItem(`uvWinW`)??`640`)||640,parseInt(nt.getItem(`uvWinH`)??`460`)||460,be);I(Se,e.w,!0),I(we,e.h,!0)}function Te(e){I(ye,e,!0),nt.setItem(`uvDocked`,String(e)),e?jd(`uv`):Nd(`uv`)}Qe(()=>{let e=h();e&&e.key===`uv`&&(Ad.set(null),K(()=>{e.docked!==Q(ye)&&Te(e.docked),Mo.set(!1)}))});let Ee=q(()=>_().find(e=>e.members.includes(`uv`))??null),J=q(()=>Q(Ee)?Q(Ee).rect.width:Q(Se)),De=q(()=>Q(Ee)?Q(Ee).rect.height:Q(we));Qe(()=>(Od(`uv`,!y()&&Q(ye),x()),()=>Od(`uv`,!1)));let Oe=q(()=>S()===`uv`&&!C()),ke=t(null);Qe(()=>{w()===`paint`&&K(()=>Q(ke)?.showSecondary(`tool`))});let Ae=t(null),je=t(1),Me=t(0),Pe=t(0),Fe=t(-1),Ie=t(Ne([])),Le=t(null),Re=t(Ne([])),ze=t(320),He=t(320),Ue=t(null),Ge=q(()=>(T(),o(),nU(Q(se)?.uuid,Q(V)))),Ke=q(()=>(o(),aH(Q(se),Q(V)))),Je=q(()=>Q(Ge)??Q(Ue)??Q(Ke)),Ye=q(()=>(o(),lU(Q(se),Q(V)))),Xe=q(()=>Math.max(Math.min(Q(ze),Q(He))-32,32)),$e=q(()=>(Q(ze)-Q(Xe)*Q(je))/2+Q(Me)),et=q(()=>(Q(He)-Q(Xe)*Q(je))/2+Q(Pe)),$=e=>Q($e)+e*Q(Xe)*Q(je),tt=e=>Q(et)+(1-e)*Q(Xe)*Q(je),rt=e=>(e-Q($e))/(Q(Xe)*Q(je)),it=e=>1-(e-Q(et))/(Q(Xe)*Q(je));Qe(()=>{let e=Q(ve);if(!e){I(Ue,null);return}let t=new Image;t.onload=()=>{I(Ue,t,!0)},t.src=e}),Qe(()=>{let e=Q(Ae);if(!e)return;let t=()=>{let t=e.getBoundingClientRect();t.width>0&&I(ze,t.width,!0),t.height>0&&I(He,t.height,!0)},n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()}),_e(()=>(window.__uvDebug=()=>({viewW:Q(ze),viewH:Q(He),zoom:Q(je),panX:Q(Me),panY:Q(Pe),span:Q(Xe),slot:Q(V),slotTotal:Q(me),tris:Q(ge).length,gesture:Q(st),xform:Q(ft),grabbing:Q(pt),pivot:Q(mt)?{...Q(mt)}:null,pivotPlaced:Q(ht)?{...Q(ht)}:null,navMode:Q(gt),navCursor:Q(_t),pixelStep:Ct(),hoverIndex:Q(Fe),selected:Q(Ie).length,selectedIndices:[...Q(Ie)],marquee:Q(Le),lassoPoints:Q(Re).length,tool:w(),faceFilter:d(),scopedTris:Q(he)?Q(he).size:null,weldScope:Q(U)?Q(U).size:null,backdropIsLiveCanvas:!!Q(Ge)&&Q(Je)===Q(Ge),tick:T(),brush:{color:E(),size:D()},project:(e,t)=>({x:$(e),y:tt(t)})}),()=>{delete window.__uvDebug}));let at=null;Qe(()=>{let e=Q(se)?.uuid??null;e!==at&&(at=e,Et.cancel(),PH(),QH(),I(Ie,[],!0),I(Fe,-1),I(ht,null),Ft())}),Qe(()=>{Q(ge),Q(Je),Q(Ke),Q(Ye),T(),Q(je),Q(Me),Q(Pe),Q(ze),Q(He),Q(Fe),Q(Ie),Q(Le),Q(Re),Q(Oe),Q(ye),Q(mt),Q(ht),Q(pt),Q(gt),Q(_t),ot()});function ot(){let e=Q(Ae);if(!e)return;let t=typeof devicePixelRatio==`number`?devicePixelRatio:1;(e.width!==Math.round(Q(ze)*t)||e.height!==Math.round(Q(He)*t))&&(e.width=Math.round(Q(ze)*t),e.height=Math.round(Q(He)*t));let n=e.getContext(`2d`);if(!n)return;n.setTransform(t,0,0,t,0,0),n.clearRect(0,0,Q(ze),Q(He));let r=Q(Xe)*Q(je);n.save(),n.beginPath(),n.rect(Q($e),Q(et),r,r),n.clip();for(let e=0;e<r;e+=8)for(let t=0;t<r;t+=8)n.fillStyle=(t/8+e/8)%2==0?`#3a3a3a`:`#2e2e2e`,n.fillRect(Q($e)+t,Q(et)+e,8,8);Q(Je)&&(Q(Ye)?(n.save(),n.translate(0,Q(et)*2+r),n.scale(1,-1),n.drawImage(Q(Je),Q($e),Q(et),r,r),n.restore(
2481)):n.drawImage(Q(Je),Q($e),Q(et),r,r)),n.restore(),n.strokeStyle=`rgba(148,163,184,0.7)`,n.lineWidth=1,n.strokeRect(Q($e),Q(et),r,r),n.strokeStyle=`rgba(96,165,250,0.85)`,n.lineWidth=1,n.beginPath();for(let e of Q(ge)){let[t,r,i]=e.corners;n.moveTo($(t[0]),tt(t[1])),n.lineTo($(r[0]),tt(r[1])),n.lineTo($(i[0]),tt(i[1])),n.closePath()}n.stroke();let i=new Set(Q(Ie));for(let e of Q(ge))e.corners.forEach((t,r)=>{let a=e.indices[r],o=$(t[0]),s=tt(t[1]),c=i.has(a),l=a===Q(Fe),u=c||l?7:5;n.fillStyle=c?`#f59e0b`:l?`#e5e7eb`:`#60a5fa`,n.fillRect(o-u/2,s-u/2,u,u)});let a=Q(mt)??Q(ht);if(a){let e=$(a.cu),t=tt(a.cv),r=Q(mt)?7:9;n.strokeStyle=`#f59e0b`,n.lineWidth=Q(mt)?1:1.5,n.beginPath(),n.moveTo(e-r,t),n.lineTo(e+r,t),n.moveTo(e,t-r),n.lineTo(e,t+r),n.stroke(),n.beginPath(),n.arc(e,t,Q(mt)?3.5:4.5,0,Math.PI*2),n.stroke()}if(Q(gt)&&Q(_t)>=0){let e=Q(se)?.geometry?.attributes?.uv;if(e&&Q(_t)<e.count){let t=$(e.getX(Q(_t))),r=tt(e.getY(Q(_t)));n.fillStyle=`rgba(251,191,36,0.18)`,n.fillRect(t-9,r-9,18,18),n.strokeStyle=`#fbbf24`,n.lineWidth=1.5,n.strokeRect(t-9,r-9,18,18)}}if(n.setLineDash([4,3]),n.strokeStyle=`#fbbf24`,n.fillStyle=`rgba(251,191,36,0.10)`,Q(Le)){let e=Math.min(Q(Le).x0,Q(Le).x1),t=Math.min(Q(Le).y0,Q(Le).y1),r=Math.abs(Q(Le).x1-Q(Le).x0),i=Math.abs(Q(Le).y1-Q(Le).y0);n.fillRect(e,t,r,i),n.strokeRect(e,t,r,i)}else if(Q(Re).length>1){n.beginPath(),n.moveTo(Q(Re)[0][0],Q(Re)[0][1]);for(let[e,t]of Q(Re).slice(1))n.lineTo(e,t);n.closePath(),n.fill(),n.stroke()}n.setLineDash([])}let st=t(`idle`),ct=0,lt=0,ut=!1,dt=t(null),ft=t(`move`),pt=t(!1),mt=t(null),ht=t(null),gt=t(!1),_t=t(-1);function vt(e){let t=Q(Ae)?.getBoundingClientRect();return{x:e.clientX-(t?.left??0),y:e.clientY-(t?.top??0)}}let yt=()=>8/(Q(Xe)*Q(je));function bt(e){return hH(e,Q(Ie)).map(e=>({u:e.u,v:e.v}))}function xt(e){let t=e?.geometry?.attributes?.uv;return!t||Q(_t)<0||Q(_t)>=t.count?null:{u:t.getX(Q(_t)),v:t.getY(Q(_t))}}function St(e,t,n=null){if(e){if(t.length){let n=_H(e,t,Q(U));n.length&&I(Ie,n,!0)}if(n){let t=_H(e,[n],Q(U));I(_t,t.length?t[0]:-1,!0)}}}function Ct(){let e=Q(se)?iU(Q(se),Q(V)):null;return{u:1/(e?.w||1024),v:1/(e?.h||1024)}}function wt(e){let t=Q(Ae)?.getBoundingClientRect(),n=e.origin.x-(t?.left??0),r=e.origin.y-(t?.top??0);return{from:{u:rt(n),v:it(r)},to:{u:rt(n+e.dx),v:it(r+e.dy)}}}function Tt(e){let t=e.data?.object;if(!t)return;if(Q(ft)===`move`){let n=Q(Xe)*Q(je);gH(t,e.snapshot,{du:e.dx/n,dv:-e.dy/n});return}let n=e.pivot;if(!n)return;let{from:r,to:i}=wt(e);if(Q(ft)===`rotate`){let a=Math.atan2(r.v-n.cv,r.u-n.cu),o=Math.atan2(i.v-n.cv,i.u-n.cu);gH(t,e.snapshot,{rotate:o-a,pivot:n})}else{let a=Math.hypot(r.u-n.cu,r.v-n.cv),o=Math.hypot(i.u-n.cu,i.v-n.cv),s=a>1e-6?Math.max(o/a,.01):1;gH(t,e.snapshot,{scaleU:s,scaleV:s,pivot:n})}}let Et=WK({snapshot:()=>Q(se)&&Q(hn)?hH(Q(se),Q(Ie)):[],start:e=>{let t=e.data?.object;if(!t||!MH(t.uuid))return!1;if(e.data?.pivotAtCursor){let{from:t}=wt(e);e.pivot={cu:t.u,cv:t.v}}else if(Q(ht))e.pivot={...Q(ht)};else{let n=pH(t,e.snapshot.map(e=>e.i));e.pivot=n?{cu:n.cu,cv:n.cv}:null}return Q(ft)!==`move`&&I(mt,e.pivot,!0),!0},apply:Tt,revert:e=>{gH(e.data?.object,e.snapshot,{})},end:(e,t)=>{let n=e.data?.object,r=n?bt(n):[],i=n?xt(n):null;n&&NH(n.uuid)&&St(n,r,i),t&&!e.dx&&!e.dy&&e.data?.collapseTo&&I(Ie,e.data.collapseTo,!0),I(st,`idle`),I(mt,null)},onActive:(e,t)=>{I(pt,e&&t,!0)}});function Dt(e,t,n=null){if(!Q(se))return!1;I(st,`drag`);let r=Et.begin(e,{modal:t,data:{object:Q(se),collapseTo:n,pivotAtCursor:!!e?.altKey}});return r||I(st,`idle`),r}function Ot(e){let{x:t,y:n}=vt(e),r=rt(t),i=it(n);if(!e.altKey&&Q(se)&&Q(le).ok&&!Q(de)){let e=wH(Q(se),Q(V),r,i,yt(),Q(he));if(e>=0){let t=Q(se).geometry.attributes.uv;r=t.getX(e),i=t.getY(e)}}I(ht,{cu:r,cv:i},!0)}function kt(){if(Q(ht)){I(ht,null);return}let e=Q(se)&&Q(Ie).length?pH(Q(se),Q(Ie)):null;I(ht,e?{cu:e.cu,cv:e.cv}:{cu:.5,cv:.5},!0)}function At(e,t,n){if(!Q(se)||!Q(hn)||!Dt(null,!1))return!1;let r=Et.ctx(),i=Ct();return gH(Q(se),r.snapshot,{du:e*i.u*n,dv:t*i.v*n}),Et.finish(!0),!0}function jt(e,t,n,r){if(!Q(se)||!Q(hn)||Q(ft)===`move`||!Dt(null,!1))return!1;let i=Et.ctx(),a=i.pivot,o=e+t>=0?1:-1;if(Q(ft)===`rotate`)gH(Q(se),i.snapshot,{rotate:o*n*(Math.PI/180),pivot:a});else{let s=.01*n,c=o>0?1+s:1/(1+s),l=r||e!==0&&t!==0;gH(Q(se),i.snapshot,{scaleU:l||e!==0?c:1,scaleV:l||t!==0?c:1,pivot:a})}return Et.finish(!0),!0}function Mt(){return Q(Ie).length?Q(Ie)[0]:Q(Fe)>=0?Q(Fe):Q(se)?wH(Q(se),Q(V),rt(Q(ze)/2),it(Q(He)/2),1/0,Q(he)):-1}function Nt(){if(!Q(se)||!Q(ce).ok)return!1;if(!Q(gt))return I(gt,!0),I(_t,Mt(),!0),Q(_t)>=0;if(Q(_t)<0)return I(_t,Mt(),!0),Q(_t)>=0;let e=CH(Q(se).geometry,Q(_t),Q(U));if(!e.length)return!1;let t=e.some(e=>Q(Ie).includes(e));return I(Ie,t?Q(Ie).filter(t=>!e.includes(t)):[...new Set([...Q(Ie),...e])],!0),!0}function Pt(e,t){if(!Q(se)||Q(_t)<0)return!1;let n=yH(Q(se),Q(V),[Q(_t)],e,t,Q(he));return n<0?!1:(I(_t,n,!0),!0)}function Ft(){I(gt,!1),I(_t,-1)}let It=e=>e.shiftKey||e.ctrlKey||e.metaKey;function Lt(e){if(!Q(se)||!Q(ce).ok||Et.isModal()||e.button===2)return;let{x:t,y:n}=vt(e);ct=e.clientX,lt=e.clientY,ut=!1,e.preventDefault(),Q(dt)?.focus?.({preventScroll:!0});let r=Q(le).ok&&!Q(de);if(e.button===1){let i=r?wH(Q(se),Q(V),rt(t),it(n),yt(),Q(he)):-1;if(i>=0&&Q(Ie).includes(i)&&Dt(e,!0))return;I(st,`pan`),Rt();return}if(e.button===0&&Q(ht)&&w()!==`paint`&&Math.hypot(rt(t)-Q(ht).cu,it(n)-Q(ht).cv)<=yt()*1.5){I(st,`pivot`),Rt();return}if(w()===`paint`){I(st,`paint`),Rt();let r=Q(se).uuid,i={u:rt(t),v:it(n)},a=Vt(e);qH(r,Q(V)).then(e=>{if(!e){Q(st)===`paint`&&I(st,`idle`);return}YH(i.u,i.v,E(),Ht(),a)});return}let i=r?wH(Q(se),Q(V),rt(t),it(n),yt(),Q(he)):-1;if(i>=0){Q(gt)&&I(_t,i,!0);let t=CH(Q(se).geometry,i,Q(U)),n=t.some(e=>Q(Ie).includes(e)),r=null;if(It(e)){if(I(Ie,n?Q(Ie).filter(e=>!t.includes(e)):[...Q(Ie),...t],!0),!Q(Ie).length)return}else n?r=t:I(Ie,t,!0);Dt(e,!1,r);return}Rt(),w()===`box`?(I(Le,{x0:t,y0:n,x1:t,y1:n},!0),I(st,`box`)):w()===`lasso`?(I(Re,[[t,n]],!0),I(st,`lasso`)):I(st,`pan`),It(e)||(zt=!0)}function Rt(){window.addEventListener(`pointermove`,Bt),window.addEventListener(`pointerup`,Ut)}let zt=!1;function Bt(e){let t=e.clientX-ct,n=e.clientY-lt;if((Math.abs(t)>0||Math.abs(n)>0)&&(ut=!0),ct=e.clientX,lt=e.clientY,Q(st)===`pan`)I(Me,Q(Me)+t),I(Pe,Q(Pe)+n);else if(Q(st)===`pivot`)Ot(e);else if(Q(st)===`box`&&Q(Le)){let{x:t,y:n}=vt(e);I(Le,{...Q(Le),x1:t,y1:n},!0)}else if(Q(st)===`lasso`){let{x:t,y:n}=vt(e),r=Q(Re)[Q(Re).length-1];(!r||Math.abs(r[0]-t)>1.5||Math.abs(r[1]-n)>1.5)&&I(Re,[...Q(Re),[t,n]],!0)}else if(Q(st)===`paint`){let t=[];try{t=e.getCoalescedEvents?.()??[]}catch{t=[]}for(let n of t.length?t:[e]){let{x:e,y:t}=vt(n);YH(rt(e),it(t),E(),Ht(),Vt(n))}}}function Vt(e){if(k()===`off`||e?.pointerType!==`pen`)return;let t=Number(e.pressure);return Number.isFinite(t)?Math.max(0,Math.min(1,t)):void 0}let Ht=()=>D();function Ut(e){if(Q(st)===`paint`)ZH(E(),Ht());else if(Q(st)===`box`&&Q(Le)&&Q(se))Wt(EH(Q(se),Q(V),{u0:rt(Q(Le).x0),v0:it(Q(Le).y0),u1:rt(Q(Le).x1),v1:it(Q(Le).y1)},Q(he)),e);else if(Q(st)===`lasso`&&Q(se)){let t=Q(Re).map(([e,t])=>[rt(e),it(t)]);Wt(DH(Q(se),Q(V),t,Q(he)),e)}else Q(st)===`pan`&&!ut&&zt&&I(Ie,[],!0);I(Le,null),I(Re,[],!0),zt=!1,Gt()}function Wt(e,t){if(!Q(se))return;let n=TH(Q(se).geometry,e,Q(U));I(Ie,It(t)?[...new Set([...Q(Ie),...n])]:n,!0)}function Gt(){I(st,`idle`),window.removeEventListener(`pointermove`,Bt),window.removeEventListener(`pointerup`,Ut)}function Kt(e){if(Q(st)!==`idle`||!Q(se)||!Q(le).ok||Q(de))return;let{x:t,y:n}=vt(e);I(Fe,wH(Q(se),Q(V),rt(t),it(n),yt(),Q(he)),!0)}let qt=()=>[...xH(Q(ge))];
2481function Jt(){return Q(ge).length?(I(Ie,qt(),!0),!0):!1}function Yt(){let e=new Set(Q(Ie));return I(Ie,qt().filter(t=>!e.has(t)),!0),!0}function Xt(e,t){if(!Q(se)||!Q(le).ok||!Q(Ie).length)return!1;let n=yH(Q(se),Q(V),Q(Ie),e,t,Q(he));return n<0?!1:(I(Ie,[...new Set([...Q(Ie),...CH(Q(se).geometry,n,Q(U))])],!0),!0)}function Zt(){let e=Q(se)?iU(Q(se),Q(V)):null,t=e?.w||1024,n=e?.h||1024;gn(e=>vH(Q(se),e,t,n))}function Qt(e){I(ft,e,!0),Et.active()&&(I(mt,e===`move`?null:Et.ctx()?.pivot??null,!0),Et.refresh())}function $t(e){if(!Q(se)||!Q(ce).ok)return;let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable))return;let n=e.ctrlKey||e.metaKey,r=kl(e),i=()=>{e.preventDefault(),e.stopPropagation()};if(lg(e)===dg(`uv.grab`)){i(),Qt(`move`);return}if(!n&&!e.altKey&&!e.shiftKey&&(r===`1`||r===`2`||r===`3`)){i(),Qt(r===`1`?`move`:r===`2`?`rotate`:`scale`);return}if(e.code===`Space`&&n){i(),Nt();return}if(e.key===`Escape`){if(Et.active())return;if(Q(gt)){i(),Ft();return}if(!Q(Ie).length)return;i(),I(Ie,[],!0);return}if(n&&!e.shiftKey&&r===`A`){i(),Jt();return}if(n&&!e.shiftKey&&r===`I`){i(),Yt();return}if(!n&&!e.altKey&&r===`L`){i(),Sn();return}if(e.key===`Delete`||e.key===`Backspace`){i(),Q(Ie).length&&es(`UV vertices cannot be deleted â Esc clears the selection`);return}let a={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,1],ArrowDown:[0,-1]}[e.key];if(!a)return;if(i(),n&&e.shiftKey){Xt(a[0],a[1]);return}if(Q(gt)){Pt(a[0],a[1]);return}let o=n?10:e.shiftKey?100:1;Q(ft)===`move`?At(a[0],a[1],o):jt(a[0],a[1],o,e.altKey)}function en(e){let t=$t,n=rn;return e.addEventListener(`keydown`,t,!0),e.addEventListener(`contextmenu`,n),{destroy:()=>{e.removeEventListener(`keydown`,t,!0),e.removeEventListener(`contextmenu`,n)}}}let tn=t(null);function nn(){if(!Q(se)||!Q(Ie).length)return;let e=pH(Q(se),Q(Ie));if(!e)return;let t=Math.max(e.uMax-e.uMin,.001),n=Math.max(e.vMax-e.vMin,.001);I(je,Math.min(Math.max(.85/Math.max(t,n),.1),32),!0),I(Me,0),I(Pe,0),I(Me,Q(ze)/2-$(e.cu)),I(Pe,Q(He)/2-tt(e.cv))}function rn(e){if(!Q(se)||!Q(ce).ok)return;if(e.preventDefault(),e.stopPropagation(),Et.active()){Et.finish(!0);return}Q(dt)?.focus?.({preventScroll:!0});let{x:t,y:n}=vt(e),r=Q(le).ok&&!Q(de)?wH(Q(se),Q(V),rt(t),it(n),yt(),Q(he)):-1,i=Q(Ie).length,a=iU(Q(se),Q(V)),o=[];i?(o.push({header:i===1?`1 point`:i+` points`}),o.push({label:`Transform`,children:ae.map(([e,t,n])=>({label:t,hint:n,checked:Q(ft)===e,tooltip:`Drag the selection, middle-press it to grab, or nudge with the arrows`,action:()=>Qt(e)}))}),o.push({label:`Rotate 90`,action:()=>_n(Math.PI/2)}),o.push({label:`Rotate -90`,action:()=>_n(-Math.PI/2)}),o.push({label:`Flip U`,action:yn}),o.push({label:`Flip V`,action:bn}),o.push({label:`Scale to fit the square`,tooltip:`Fill 0..1, keeping the aspect`,action:xn}),o.push({label:`Snap to pixels`,tooltip:a?`Land every point on a texel boundary of the `+a.w+` x `+a.h+` texture`:`Land every point on a texel boundary (assuming 1024 x 1024 â this slot has no texture)`,action:Zt}),o.push({section:`Selection`}),o.push({label:`Select the island`,hint:`L`,action:Sn}),o.push({label:r>=0&&Q(Ie).includes(r)?`Remove this point from the selection`:`Clear the selection`,hint:r>=0&&Q(Ie).includes(r)?void 0:`Esc`,action:()=>{if(r>=0&&Q(Ie).includes(r)){let e=CH(Q(se).geometry,r,Q(U));I(Ie,Q(Ie).filter(t=>!e.includes(t)),!0)}else I(Ie,[],!0)}})):r>=0&&o.push({label:`Select this point`,action:()=>I(Ie,CH(Q(se).geometry,r,Q(U)),!0)}),o.push({section:`Origin`}),o.push({label:`Place the origin here`,tooltip:`Rotate and scale turn about it â drag it to adjust, and it snaps onto a point when you come near one (Alt to place it freely)`,action:()=>I(ht,{cu:rt(t),cv:it(n)},!0)}),o.push({label:`Origin on the selection`,disabled:!i,tooltip:`Place it at the middle of the selection, where you can then drag it`,action:()=>{let e=pH(Q(se),Q(Ie));e&&I(ht,{cu:e.cu,cv:e.cv},!0)}}),o.push({label:`Automatic origin`,checked:!Q(ht),tooltip:`The selection's own centre, recomputed for every gesture`,action:()=>I(ht,null)}),o.push({section:`Selection`}),o.push({label:`Pick with the keyboard`,hint:`Ctrl+Space`,checked:Q(gt),tooltip:`The arrows walk a cursor from vertex to vertex; Ctrl+Space takes the one under it`,action:()=>Q(gt)?Ft():Nt()}),o.push({label:`Select all`,hint:`Ctrl+A`,disabled:!Q(ge).length,action:Jt}),o.push({label:`Invert`,hint:`Ctrl+I`,disabled:!Q(ge).length,action:Yt}),o.push({section:`Unwrap`}),o.push({label:`Unwrap`,disabled:!Q(le).ok,tooltip:Q(kn)?`Applies to the `+Q(kn)+` face triangles selected in Edit Mesh`:`Applies to the whole mesh`,children:wn.map(e=>({label:e.label,action:()=>Tn(e.key)}))}
2481),o.push({section:`View`}),o.push({label:`Reset view`,action:on}),o.push({label:`Zoom to the selection`,disabled:!i,action:nn}),o.push({label:`Paint on the texture`,checked:w()===`paint`,action:()=>YV.set(w()===`paint`?`select`:`paint`)}),o.push({label:`Only the faces picked in Edit Mesh`,checked:d()===`selection`,tooltip:`Needed wherever faces share UV space, so a drag moves one face instead of all of them`,action:()=>eH.set(d()===`selection`?`all`:`selection`)}),o.push({label:`UV test grid`,checked:ee(),tooltip:`A checker instead of the scene textures â local to you, never saved or sent`,action:()=>oU.set(!ee())}),I(tn,{x:e.clientX,y:e.clientY,items:o},!0)}function an(e){e.preventDefault();let{x:t,y:n}=vt(e),r=rt(t),i=it(n);I(je,Math.min(Math.max(Q(je)*(e.deltaY<0?1.12:1/1.12),.1),32),!0),I(Me,Q(Me)+(t-$(r))),I(Pe,Q(Pe)+(n-tt(i)))}function on(){I(je,1),I(Me,0),I(Pe,0)}function sn(e){let t=rt(Q(ze)/2),n=it(Q(He)/2);I(je,Math.min(Math.max(Q(je)*e,.1),32),!0),I(Me,Q(Me)+(Q(ze)/2-$(t))),I(Pe,Q(Pe)+(Q(He)/2-tt(n)))}function cn(e){return e.addEventListener(`pointerdown`,Lt),e.addEventListener(`wheel`,an,{passive:!1}),e.addEventListener(`pointermove`,Kt),{destroy:()=>{e.removeEventListener(`pointerdown`,Lt),e.removeEventListener(`wheel`,an),e.removeEventListener(`pointermove`,Kt)}}}let ln=t(-1),un=t(null),dn=0,fn=`image/png,image/jpeg,image/webp`;function pn(e,t){let n=[...e.dataTransfer?.types??[]];(n.includes(`application/x-explorer-item`)||n.includes(`Files`))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),I(ln,t,!0))}async function mn(e,t){if(e.preventDefault(),e.stopPropagation(),I(ln,-1),!Q(se))return;let n=e.dataTransfer?.getData(`application/x-explorer-item`);if(n){await tJ(Q(se).uuid,JSON.parse(n),t)||es(`That Explorer item is not an image`);return}let r=[...e.dataTransfer?.files??[]].find(e=>e.type.startsWith(`image/`));if(!r){es(`Drop an image to texture this material`);return}await Vv(Q(se).uuid,r,t)}let hn=q(()=>Q(le).ok&&!Q(de)&&Q(Ie).length>0);function gn(e){if(!Q(se)||!Q(hn))return;let t=Q(se);if(!MH(t.uuid))return;e(Q(Ie));let n=bt(t),r=xt(t);NH(t.uuid)&&St(t,n,r)}let _n=e=>gn(t=>mH(Q(se),t,{rotate:e})),vn=()=>_n(Math.PI/2),yn=()=>gn(e=>mH(Q(se),e,{flipU:!0})),bn=()=>gn(e=>mH(Q(se),e,{flipV:!0})),xn=()=>gn(e=>bH(Q(se),e,.02));function Sn(){Q(se)&&Q(le).ok&&Q(Ie).length&&I(Ie,fH(Q(se),Q(V),Q(Ie),Q(he)),!0)}let Cn=t(!1),wn=Xge();async function Tn(e){if(I(Cn,!1),!Q(se))return;let t=Q(he)??tH(Q(se).uuid);await OH(Q(se).uuid,e,{margin:.02},t)&&es(t?`Unwrapped the selected faces`:`Unwrapped `+(Q(se).name||`the mesh`))}let En=q(()=>(o(),T(),Q(se)?iU(Q(se),Q(V)):null)),Dn=q(()=>Q(En)?(Q(En).bytes/1048576).toFixed(1):null);async function On(e){Q(se)&&await aU(Q(se).uuid,Q(V),e)}Qe(()=>{cU(M(),ee())}),Qe(()=>{y()&&ee()&&K(()=>oU.set(!1))});let kn=q(()=>{o();let e=m();return Q(se)&&i()===Q(se).uuid&&e?.length?e.length:0});function An(){if(!Q(se))return;let e=Cfe(Q(se).uuid);if(e<0){es(`Could not add a material slot to this object`);return}JV.set(e),es(Q(kn)?`Slot `+e+` added â use its assign button to give it the selected faces`:`Slot `+e+` added â select faces in Edit Mesh, then assign them to it`)}function jn(e){Q(se)&&Q(kn)&&kH(Q(se).uuid,m(),e)&&(JV.set(e),es(Q(kn)+` face triangles now use slot `+e))}function Mn(e){dn=e,Q(un)?.click()}async function Nn(e){let t=e.currentTarget,n=t.files?.[0];t.value=``,n&&Q(se)&&await Vv(Q(se).uuid,n,dn)}let Pn=e=>Math.min(Math.max(e||320,200),Math.round(window.innerHeight*.8)),Fn=t(!1),In=t(!1);function Ln(e){I(Fn,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function Rn(e){Q(Fn)&&Md.update(t=>Pn(t-e.movementY))}function zn(e){Q(Fn)&&(I(Fn,!1),e.currentTarget.releasePointerCapture?.(e.pointerId))}function Bn(e){I(In,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()}function Vn(e){if(!Q(In))return;let t=Q(Ee)?Q(Ee).rect.width:Q(Se),n=Q(Ee)?Q(Ee).rect.height:Q(we),r=Gh(e.currentTarget.parentElement),i=Yh(t+e.movementX,n+e.movementY,r.left,r.top,be);I(Se,i.w,!0),I(we,i.h,!0),ag(`uv`,Q(Se),Q(we))}function Hn(e){Q(In)&&(I(In,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),Un())}function Un(){nt.setItem(`uvWinW`,String(Q(Se))),nt.setItem(`uvWinH`,String(Q(we)))}function Wn(){let e=Xh(xe.w,xe.h,be);I(Se,e.w,!0),I(we,e.h,!0),ag(`uv`,Q(Se),Q(we)),Un()}function Gn(){let e=Xh(Q(Se),Q(we),be);(e.w!==Q(Se)||e.h!==Q(we))&&(I(Se,e.w,!0),I(we,e.h,!0),ag(`uv`,Q(Se),Q(we)))}var Kn=ctt();Z(`resize`,p,Gn);var qn=N(Kn),Jn=e=>{var t=fe(),n=N(t),i=e=>{var t=ott(),n=j(t),i=g(n,2);TS(i,{});var a=g(i,2),o=g(j(a),4),s=g(o,2);H(a);var c=g(a,2),l=j(c);F(l),H(c),H(t),O(()=>{r(t,1,`fixed inset-x-0 bottom-0 flex flex-col bg-white p-2 text-gray-800 dark:bg-gray-800 dark:text-gray-200 ${Q(Oe)?``:`hidden`}`),Ze(t,`z-index: var(--z-bottom); height: ${x()??``}px; border-top: 1px solid rgb(55 65 81 / 0.6)`)}),L(`pointerdown`,n,Ln),L(`pointermove`,n,Rn),L(`pointerup`,n,zn),L(`click`,o,()=>Te(!1)),L(`click`,s,()=>Mo.set(!0)),X(e,t)},a=e=>{var t=stt();let n;var r=j(t),i=g(j(r),2),a=f(i,!0),o=g(i,4),s=g(o,2);H(r);var c=g(r,2),l=j(c);F(l),H(c);var u=g(c,2);H(t),ne(t,(e,t)=>Zh?.(e,t),()=>({key:`uv`,defaultRect:{left:220,top:140}})),ne(t,(e,t)=>Kh?.(e,t),()=>`uv`),ne(t,(e,t)=>$h?.(e,t),()=>({key:`uv`,title:`UV editor`,openStore:Mo,isOpen:e=>!e,close:()=>Mo.set(!0)})),ne(t,(e,t)=>uS?.(e,t),()=>({key:`uv`})),O(()=>{n=Ze(t,`z-index: var(--z-window); max-width: 96vw; max-height: 88vh`,n,{width:`${Q(J)??``}px`,height:`${Q(De)??``}px`}),Y(a,Q(se)?Q(se).name||`object`:`no selection`)}),L(`click`,o,()=>Te(!0)),L(`click`,s,()=>Mo.set(!0)),L(`pointerdown`,u,Bn),L(`pointermove`,u,Vn),L(`pointerup`,u,Hn),L(`dblclick`,u,Wn),X(e,t)};G(n,e=>{Q(ye)?e(i):e(a,-1)}),X(e,t)};G(qn,e=>{y()||e(Jn)});var Yn=g(qn,2),Xn=e=>{xS(e,{get x(){return Q(tn).x},get y(){return Q(tn).y},get items(){return Q(tn).items},sizeKey:`uv`,$$events:{close:()=>I(tn,null)}})};G(Yn,e=>{Q(tn)&&e(Xn)}),X(e,Kn),ue(),re()}ge([`click`,`change`,`input`,`pointerdown`,`pointermove`,`pointerup`,`dblclick`]);var utt=V(`<img class="svelte-1749zcd"/>`),dtt=V(`<button class="shader-tex-clear svelte-1749zcd" title="Remove this texture" aria-label="Remove this texture"><!></button>`),ftt=V(`<img/>`),ptt=V(`<span class="shader-tex-card-empty svelte-1749zcd">waiting for the imageâ¦</span>`),mtt=V(`<dt class="svelte-1749zcd">
2481size</dt> <dd class="svelte-1749zcd"> </dd>`,1),htt=V(`<dt class="svelte-1749zcd">file</dt> <dd class="svelte-1749zcd"> </dd>`,1),gtt=V(`<div class="shader-tex-card-note svelte-1749zcd">Pulling the bytes from a peer.</div>`),_tt=V(`<div class="shader-tex-card-note svelte-1749zcd">Decodingâ¦</div>`),vtt=V(`<div class="shader-tex-card svelte-1749zcd" data-shader-tex-card=""><div class="shader-tex-card-img svelte-1749zcd"><!></div> <div class="shader-tex-card-name svelte-1749zcd"> </div> <dl class="shader-tex-card-meta svelte-1749zcd"><!> <!> <dt class="svelte-1749zcd">wrap</dt> <dd class="svelte-1749zcd">repeat (tiles)</dd> <dt class="svelte-1749zcd">id</dt> <dd class="shader-tex-card-hash svelte-1749zcd"> </dd></dl> <!></div>`),ytt=V(`<div><label class="shader-tex-slot svelte-1749zcd"><!> <input class="shader-tex-file svelte-1749zcd" type="file" accept="image/*" aria-label="Choose an image for this texture"/></label> <span class="shader-tex-state svelte-1749zcd"><!></span> <!></div> <!>`,1);function A4(e,n){Ce(n,!0);let i=()=>z(Fa,`$explorerItems`,a),[a,o]=Ve(),s=J(n,`hash`,3,``),c=J(n,`compact`,3,!1),l=t(0),u=Yfe(()=>I(l,Q(l)+1));Pe(u);let d=q(()=>i()&&s()?ka(s()):null),p=q(()=>(Q(l),!!(s()&&i()&&qfe(s())))),m=q(()=>(Q(l),s()?Kfe(s()):null)),h=t(!1),_=t(!1),v=t(null);function y(e){if(!s())return;let t=e.currentTarget.getBoundingClientRect(),n=t.right+168+24>window.innerWidth?Math.max(8,t.left-168-18):t.right+10,r=t.top-16,i=window.innerHeight-t.bottom-16;I(v,r>=200||r>=i?{x:n,top:null,bottom:window.innerHeight-t.top+8,max:r}:{x:n,top:t.bottom+8,bottom:null,max:i},!0)}function x(){I(v,null)}function S(e){return document.body.appendChild(e),{destroy(){e.remove()}}}function C(e){return e?e<1024?e+` B`:e<1048576?(e/1024).toFixed(1)+` KB`:(e/1048576).toFixed(1)+` MB`:``}function w(e){n.onpick?.(e),e&&Jfe(e),x()}async function T(e){let t=e.currentTarget,n=t?.files;if(n?.length){I(h,!0);try{let e=await qa([n[0]]);e?.length&&w(e[0].hash)}finally{I(h,!1),t&&(t.value=``)}}}function E(e){e.preventDefault(),e.stopPropagation(),I(_,!1);let t=e.dataTransfer?.getData(`application/x-explorer-item`);if(t)try{let e=JSON.parse(t),n=i().find(t=>t.id===e.id);if(!n||n.kind!==`image`)return;w(n.hash)}catch{}}function D(e){e.dataTransfer?.types?.includes(`application/x-explorer-item`)&&(e.preventDefault(),e.stopPropagation(),I(_,!0))}var k=ytt(),A=N(k);let ee;var M=j(A),te=j(M),P=e=>{var t=utt();O(()=>{b(t,`src`,Q(d).thumbnail),b(t,`alt`,Q(d).name)}),X(e,t)},re=e=>{{let t=q(()=>c()?12:14);Qx(e,{get size(){return Q(t)},"aria-hidden":`true`})}};G(te,e=>{Q(d)?.thumbnail?e(P):e(re,-1)});var ie=g(te,2);H(M);var F=g(M,2),ae=j(F),oe=e=>{var t=Te(`importingâ¦`);X(e,t)},R=e=>{var t=Te();O(()=>Y(t,c()?`pick`:`pick or drop`)),X(e,t)},se=e=>{var t=Te();O(()=>Y(t,Q(d).name)),X(e,t)},ce=e=>{var t=Te(`waiting for peerâ¦`);X(e,t)};G(ae,e=>{Q(h)?e(oe):s()?Q(d)?e(se,2):e(ce,-1):e(R,1)}),H(F);var le=g(F,2),de=e=>{var t=dtt(),n=j(t);fS(n,{size:11,"aria-hidden":`true`}),H(t),L(`click`,t,()=>w(``)),X(e,t)};G(le,e=>{s()&&e(de)}),H(A);var fe=g(A,2),pe=e=>{var t=vtt();let n;var i=j(t),a=j(i),o=e=>{var t=ftt();let n;O(e=>{b(t,`src`,Q(d).thumbnail),b(t,`alt`,Q(d).name),n=r(t,1,`svelte-1749zcd`,null,n,{pixelated:e})},[()=>!!Q(m)&&Math.max(Q(m).width,Q(m).height)<=64]),X(e,t)},c=e=>{var t=ptt();X(e,t)};G(a,e=>{Q(d)?.thumbnail?e(o):e(c,-1)}),H(i);var l=g(i,2),u=f(l,!0),h=g(l,2),_=j(h),y=e=>{var t=mtt(),n=g(N(t),2),r=f(n);O(()=>Y(r,`${Q(m).width??``} à ${Q(m).height??``} px`)),X(e,t)};G(_,e=>{Q(m)&&e(y)});var x=g(_,2),w=e=>{var t=htt(),n=g(N(t),2),r=f(n,!0);O(e=>Y(r,e),[()=>C(Q(d).size)]),X(e,t)};G(x,e=>{Q(d)?.size&&e(w)});var T=g(x,8),E=f(T);H(h);var D=g(h,2),k=e=>{var t=gtt();X(e,t)},A=e=>{var t=_tt();X(e,t)};G(D,e=>{Q(d)?Q(p)||e(A,1):e(k)}),H(t),ne(t,e=>S?.(e)),O(e=>{n=Ze(t,``,n,{left:`${Q(v).x??``}px`,top:Q(v).top===null?null:Q(v).top+`px`,bottom:Q(v).bottom===null?null:Q(v).bottom+`px`,width:`168px`,"max-height":`${Q(v).max??``}px`}),Y(u,Q(d)?.name??`not here yet`),Y(E,`${e??``}â¦`)},[()=>s().slice(0,12)]),X(e,t)};G(fe,e=>{Q(v)&&s()&&e(pe)}),O(()=>{ee=r(A,1,`shader-tex svelte-1749zcd`,null,ee,{compact:c(),"drag-over":Q(_)}),b(A,`data-state`,s()?Q(d)?Q(p)?`ready`:`loading`:`missing`:`empty`),b(M,`title`,s()?``:`Pick or drop an image`)}),Z(`drop`,A,E),Z(`dragover`,A,D),Z(`dragleave`,A,()=>I(_,!1)),L(`mouseover`,M,y),L(`mouseout`,M,x),L(`change`,ie,T),X(e,k),ue(),o()}ge([`mouseover`,`mouseout`,`change`,`click`]);var btt=V(`<label class="shader-vec-part svelte-x4d1b9"><span aria-hidden="true" class="svelte-x4d1b9"> </span> <!></label>`),xtt=V(`<span class="shader-vec svelte-x4d1b9"></span>`);function j4(e,t){Ce(t,!0);let n=J(t,`value`,19,()=>[]),r=J(t,`size`,3,2),i=[`x`,`y`,`z`,`w`];function a(e){return Array.isArray(e)?Array.from({length:r()},(t,n)=>Number(e[n]??0)):e&&typeof e==`object`?i.slice(0,r()).map(t=>Number(e[t]??0)):Array.from({length:r()},()=>0)}let o=q(()=>a(n()));function s(e,n){let r=[...Q(o)],i=Number(n);r[e]=Number.isFinite(i)?i:0,t.onchange?.(r)}var c=xtt();B(c,21,()=>Q(o),Be,(e,n,r)=>{var a=btt(),o=j(a),c=f(o,!0);
2481hq(g(o,2),{nodrag:!0,step:.005,decimals:3,get ariaLabel(){return i[r]},get value(){return Q(n)},onscrubstart:()=>t.onstart?.(),onscrubend:()=>t.onend?.(),onchange:e=>s(r,e)}),H(a),O(()=>{b(a,`title`,i[r]),Y(c,i[r])}),X(e,a)}),H(c),X(e,c),ue()}var Stt=V(`<div class="socket-row relative -mx-3 px-3 svelte-rziqf4"><!> <span class="socket-label svelte-rziqf4"> </span></div>`),Ctt=V(`<div class="shader-param svelte-rziqf4"><span class="socket-label svelte-rziqf4"> </span> <!></div>`),wtt=V(`<input type="color" class="svelte-rziqf4"/>`),Ttt=V(`<option> </option>`),Ett=V(`<select></select>`),Dtt=V(`<input type="text"/>`),Ott=V(`<label class="shader-param svelte-rziqf4"><span class="socket-label svelte-rziqf4"> </span> <!></label>`),ktt=V(`<div class="socket-row relative -mx-3 px-3 text-right svelte-rziqf4"><span class="socket-label svelte-rziqf4"> </span> <!></div>`),Att=V(`<p class="mt-1 text-[9px] leading-tight text-gray-500">Unconnected inputs keep the material's own value</p>`),jtt=V(`<div class="node-card flex h-full flex-col rounded-lg border border-gray-600/70 bg-gray-800/95 text-gray-200 shadow-lg svelte-rziqf4"><div class="flex items-center gap-1.5 rounded-t-md border-b border-gray-700/60 bg-gray-900/50 px-3 py-1.5 font-mono text-xs font-semibold text-gray-100"><span class="h-2 w-2 shrink-0 rounded-full" style="background: var(--node-accent)"></span> <span class="overflow-hidden text-ellipsis whitespace-nowrap"> </span></div> <div class="relative flex flex-col gap-1 rounded-b-lg p-3 text-xs text-gray-300"><!> <!> <!> <!></div></div>`);function Mtt(e,t){Ce(t,!0);let n=q(()=>$v(t.type)),r=q(()=>t.data?.__graphKey??null),i={Input:`#38bdf8`,Math:`#2dd4bf`,Channel:`#facc15`,UV:`#4ade80`,Utility:`#c084fc`,Output:`#fb923c`},a=q(()=>i[Q(n)?.group??``]??`#94a3b8`),o={float:`#9ca3af`,vec2:`#4ade80`,vec3:`#60a5fa`,vec4:`#c084fc`,sampler2D:`#fbbf24`};function s(e){return`--socket-color: `+(o[e?.type]??`#9ca3af`)+`; top: 50%;`}function c(e,n){Q(r)&&Bfe(Q(r),t.id,e,n)}function l(){Q(r)&&_U(Q(r))}function d(){Q(r)&&vU(Q(r))}var p=jtt(),m=j(p),h=g(j(m),2),y=f(h,!0);H(m);var b=g(m,2),x=j(b);B(x,17,()=>
2481Q(n)?.inputs??[],e=>e.name,(e,t)=>{var n=Stt(),r=j(n);{let e=q(()=>s(Q(t)));f2(r,{type:`target`,get position(){return W1.Left},get id(){return Q(t).name},class:`socket-typed`,get style(){return Q(e)}})}var i=g(r,2),a=f(i,!0);H(n),O(()=>Y(a,Q(t).name)),X(e,n)});var S=g(x,2);B(S,17,()=>Q(n)?.params??[],e=>e.name,(e,n)=>{var r=fe(),i=N(r),a=e=>{var r=Ctt(),i=j(r),a=f(i,!0),o=g(i,2);{let e=q(()=>t.data?.[Q(n).name]??``);A4(o,{compact:!0,get hash(){return Q(e)},onpick:e=>c(Q(n).name,e)})}H(r),O(()=>Y(a,Q(n).name)),X(e,r)},o=e=>{var r=Ott(),i=j(r),a=f(i,!0),o=g(i,2),s=e=>{var r=wtt();v(r),O(()=>u(r,t.data?.[Q(n).name]??Q(n).default)),L(`input`,r,e=>c(Q(n).name,e.currentTarget.value)),X(e,r)},p=e=>{{let r=q(()=>t.data?.[Q(n).name]??Q(n).default),i=q(()=>Q(n).type===`vec2`?2:Q(n).type===`vec4`?4:3);j4(e,{get value(){return Q(r)},get size(){return Q(i)},onchange:e=>c(Q(n).name,e),onstart:l,onend:d})}},m=e=>{{let r=q(()=>t.data?.[Q(n).name]??Q(n).default);hq(e,{nodrag:!0,step:.005,decimals:3,get value(){return Q(r)},onscrubstart:l,onscrubend:d,onchange:e=>c(Q(n).name,e)})}},h=e=>{var r=Ett();B(r,20,()=>Q(n).options??[],e=>e,(e,t)=>{var n=Ttt(),r=f(n,!0),i={};O(()=>{Y(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(r);var i;_(r),O(()=>{i!==(i=t.data?.[Q(n).name]??Q(n).default)&&(r.value=(r.__value=i)??``,D(r,i))}),L(`change`,r,e=>c(Q(n).name,e.currentTarget.value)),X(e,r)},y=e=>{var r=Dtt();v(r),O(()=>u(r,t.data?.[Q(n).name]??Q(n).default)),L(`change`,r,e=>c(Q(n).name,e.currentTarget.value)),X(e,r)};G(o,e=>{Q(n).type===`vec3`&&typeof(t.data?.[Q(n).name]??Q(n).default)==`string`?e(s):Q(n).type===`vec2`||Q(n).type===`vec3`||Q(n).type===`vec4`?e(p,1):Q(n).type===`float`?e(m,2):Q(n).type===`enum`?e(h,3):e(y,-1)}),H(r),O(()=>Y(a,Q(n).name)),X(e,r)};G(i,e=>{Q(n).type===`texture`?e(a):e(o,-1)}),X(e,r)});var C=g(S,2);B(C,17,()=>Q(n)?.outputs??[],e=>e.name,(e,t)=>{var n=ktt(),r=j(n),i=f(r,!0),a=g(r,2);{let e=q(()=>s(Q(t)));f2(a,{type:`source`,get position(){return W1.Right},get id(){return Q(t).name},class:`socket-typed`,get style(){return Q(e)}})}H(n),O(()=>Y(i,Q(t).name)),X(e,n)});var w=g(C,2),T=e=>{var t=Att();X(e,t)};G(w,e=>{t.type===`surface`&&e(T)}),H(b),H(p),O(()=>{Ze(p,`--node-accent: ${Q(a)}; border-top: 2px solid ${Q(a)}`),Y(y,t.data?.label||Q(n)?.label||t.type)}),X(e,p),ue()}ge([`input`,`change`]);var Ntt=V(`<button class="shader-palette-item svelte-163ljs2" draggable="true"> </button>`),Ptt=V(`<div class="shader-palette-group svelte-163ljs2"><span class="dot svelte-163ljs2"></span> </div> <!>`,1),Ftt=V(`<div class="shader-palette-list svelte-163ljs2" id="shader-palette"></div>`);function Itt(e,t){Ce(t,!0);let n=J(t,`onPick`,3,e=>{}),r=J(t,`entries`,3,null),i=ty().filter(e=>e.key!==ey),a=q(()=>r()??i),o=q(()=>[...new Set(Q(a).map(e=>e.group))]),s={Post:`#f472b6`,Input:`#38bdf8`,Math:`#2dd4bf`,Channel:`#facc15`,UV:`#4ade80`,Utility:`#c084fc`,Output:`#fb923c`};function c(e,t){e.dataTransfer&&(e.dataTransfer.setData(`application/shadernode`,t),e.dataTransfer.effectAllowed=`move`)}var l=Ftt();B(l,20,()=>Q(o),e=>e,(e,t)=>{var r=Ptt(),i=N(r),o=j(i),l=g(o);H(i);var u=g(i,2);B(u,17,()=>Q(a).filter(e=>e.group===t),e=>e.key,(e,t)=>{var r=Ntt(),i=f(r,!0);O(()=>{b(r,`title`,Q(t).doc?Q(t).label+` â `+Q(t).doc:Q(t).key),Y(i,Q(t).label)}),Z(`dragstart`,r,e=>c(e,Q(t).key)),L(`click`,r,()=>n()(Q(t).key)),X(e,r)}),O(()=>{Ze(o,`background: ${s[t]??`#94a3b8`??``}`),Y(l,` ${t??``}`)}),X(e,r)}),H(l),X(e,l),ue()}ge([`click`]);var M4=V(`<option> </option>`),Ltt=V(`<select id="shader-post-pick" class="shader-post-pick svelte-78zb25" title="Which post effect to edit"></select>`),Rtt=V(`<div class="tp-seg shader-domain svelte-78zb25" id="shader-domain" role="group" aria-label="Shader domain"><button class="tp-seg-btn" id="shader-domain-surface" title="Materials: this object's, or the scene's default">Surface</button> <button class="tp-seg-btn" id="shader-domain-post" title="Post effects: a fragment over the finished frame, added to the scene look">Post</button></div> <!>`,1),ztt=V(`<button class="ui-button-quiet" id="shader-remove" title="Remove this shader graph and restore the material" aria-label="Remove this shader graph"><!></button>`),Btt=V(`<!> <button class="ui-button-quiet" id="shader-close" title="Close" aria-label="Close the shader editor">â</button>`,1),Vtt=V(`<div> </div>`),Htt=V(`<div class="shader-errors svelte-78zb25" id="shader-errors"></div>`),Utt=V(`<div class="shader-side shader-side-left svelte-78zb25"><!> <div class="shader-side-scroll svelte-78zb25"><!></div></div>`),Wtt=V(`<!> <!> <!>`,1),Gtt=V(`<span class="font-semibold text-gray-100"> </span> has no shader yet`,1),Ktt=V(`<button class="shader-preset svelte-78zb25"> </button>`),qtt=V(`<div class="shader-preset-row svelte-78zb25"></div> <p class="text-[11px] text-gray-500">A post effect runs over the finished frame â add it to a look in Configure 2482 Scene ⸠Post-processing</p>`,1),Jtt=V(`<p class="text-[11px] text-gray-500"> </p>
2482`),Ytt=V(`<div id="shader-empty-state" class="shader-empty svelte-78zb25"><p class="text-sm text-gray-300"><!></p> <button id="shader-create-btn" class="shader-create svelte-78zb25"> </button> <!></div>`),Xtt=V(`<p class="shader-doc svelte-78zb25" id="shader-node-doc"> </p>`),Ztt=V(`<div class="shader-field svelte-78zb25"><span> </span> <!></div>`),Qtt=V(`<input type="color" class="svelte-78zb25"/>`),$tt=V(`<select class="svelte-78zb25"></select>`),ent=V(`<input type="text" class="svelte-78zb25"/>`),tnt=V(`<label class="shader-field svelte-78zb25"><span> </span> <!></label>`),nnt=V(`<code class="shader-uniform-name svelte-78zb25"> </code>`),rnt=V(`<p class="shader-hint svelte-78zb25">uniforms â paste into a Set Shader Uniform node:</p> <!>`,1),int=V(`<div class="shader-props-body svelte-78zb25" id="shader-props-node"><div class="shader-props-title svelte-78zb25"> </div> <!> <label class="shader-field svelte-78zb25"><span>name</span> <input type="text" class="svelte-78zb25"/></label> <!> <p class="shader-hint svelte-78zb25"> </p> <!></div>`),ant=V(`<p class="shader-hint svelte-78zb25"> </p> <p class="shader-hint svelte-78zb25">Replicates to peers · saved with the scene</p>`,1),ont=V(`<p class="shader-hint svelte-78zb25">Create a post effect, then add it to a look in Configure Scene ⸠2483 Post-processing.</p>`),snt=V(`<p class="shader-hint svelte-78zb25">Select nothing for the scene shader, or one object for its own.</p>`),cnt=V(`<div class="shader-props-body svelte-78zb25" id="shader-props-graph"><div class="shader-props-title svelte-78zb25">Graph</div> <label class="shader-field svelte-78zb25"><span>edges</span> <select class="svelte-78zb25"><option>bezier</option><option>smoothstep</option><option>step</option><option>straight</option></select></label> <label class="shader-field svelte-78zb25"><span>background</span> <select class="svelte-78zb25"><option>dots</option><option>lines</option><option>cross</option></select></label> <label class="shader-field svelte-78zb25"><span>snap to grid</span> <input type="checkbox"/></label> <label class="shader-field svelte-78zb25"><span>minimap</span> <input type="checkbox"/></label> <!></div>`),lnt=V(`<div class="shader-side shader-side-right svelte-78zb25" id="shader-props"><div class="shader-props-tabs svelte-78zb25"><button title="Selected node" aria-label="Selected node properties"><!></button> <button title="Graph settings" aria-label="Graph settings"><!></button></div> <!></div>`),unt=V(`<!> <div class="shader-body svelte-78zb25"><!> <button id="shader-palette-toggle" class="shader-divider svelte-78zb25" aria-label="Toggle the node palette"> </button> <div class="shader-canvas svelte-78zb25"><!></div> <button id="shader-props-toggle" class="shader-divider svelte-78zb25" aria-label="Toggle the properties panel"> </button> <!></div>`,1),dnt=V(`<div id="shader-editor" class="shader-editor ui-panel svelte-78zb25"><div class="resize-cue absolute -top-1 left-0 right-0 z-30 h-2 cursor-ns-resize hover:bg-primary-600/30" style="touch-action: none" title="Drag to resize"></div> <div class="shader-topbar svelte-78zb25"><!> <!> <span class="shader-scope svelte-78zb25" id="shader-scope"> </span> <div class="shader-actions svelte-78zb25"><button class="ui-button-quiet" id="shader-undock" title="Undock into a floating window" aria-label="Undock the shader editor">â§</button> <!></div></div> <!></div>`),fnt=V(`<div id="shader-window" class="ui-panel fixed flex flex-col overflow-hidden"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span>Shader editor</span> <!> <span class="shader-scope svelte-78zb25" id="shader-scope"> </span> <span class="flex-1"></span> <button class="ui-button-quiet" id="shader-dock" title="Dock to the bottom" aria-label="Dock the shader editor">â© Dock</button> <!></div> <!> <div class="resize-cue absolute bottom-0 right-0 z-10 h-3.5 w-3.5 cursor-se-resize rounded-tl bg-gray-500/40" style="touch-action: none" title="Drag to resize · double-click to reset size"></div></div>`),pnt=V(`<!> <!>`,1);function mnt(e,n){Ce(n,!0);let i=()=>z(YL,`$shaderDomain`,T),a=()=>z(Kr,`$selectedObjects`,T),o=()=>z(ry,`$shaderGraphs`,T),s=()=>z(XL,`$activePostGraph`,T),l=()=>z(sy,`$shaderErrors`,T),d=()=>z(Ui,`$objectsGroup`,T),h=()=>z(Ad,`$dockModeArm`,T),y=()=>z(Qh,`$tabGroups`,T),x=()=>z(lc,`$shaderEditorClose`,T),S=()=>z(Md,`$dockHeight`,T),C=()=>z(Ld,`$visibleDockKey`,T),w=()=>z(Fd,`$dockMinimized`,T),[T,E]=Ve(),k=e=>{var t=Rtt(),n=N(t),r=j(n),i=g(r,2);H(n);var a=g(n,2),o=e=>{var t=Ltt();B(t,21,()=>Q(le),e=>e.key,(e,t)=>{var n=M4(),r=f(n,!0),i={};O(()=>{Y(r,Q(t).name),i!==(i=Q(t).key)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(t);var n;_(t),O(()=>{n!==(n=Q(pe))&&(t.value=(t.__value=n)??``,D(t,n))}),L(`change`,t,e=>XL.set(e.currentTarget.value)),X(e,t)};G(a,e=>{Q(se)&&Q(le).length&&e(o)}),O(()=>{b(r,`aria-pressed`,!Q(se)),b(i,`aria-pressed`,Q(se))}),L(`click`,r,()=>YL.set(`surface`)),L(`click`,i,()=>YL.set(`post`)),X(e,t)},A=e=>{var t=Btt(),n=N(t),r=e=>{var t=ztt(),n=j(t);SS(n,{size:14,"aria-hidden":`true`}),H(t),L(`click`,t,Ie),X(e,t)};G(n,e=>{Q(V)&&e(r)});var i=g(n,2);L(`click`,i,()=>lc.set(!0)),X(e,t)},M=e=>{var t=unt(),n=N(t),i=e=>{var t=Htt();B(t,21,()=>Q(he),Be,(e,t)=>{var n=Vtt(),r=f(n,!0);O(()=>Y(r,Q(t))),X(e,n)}),H(t),X(e,t)};G(n,e=>{Q(he).length&&e(i)});var a=g(n,2),o=j(a),s=e=>{var t=Utt(),n=j(t);{let e=q(()=>Q(se)?`Post effects`:`Shaders`);K2(n,{kind:`shader`,get documents(){return Q(me)},get sceneKey(){return uy},get label(){return Q(e)},get paneHeight(){return Q(xe)}})}var r=g(n,2);Itt(j(r),{onPick:Re,get entries(){return Q(ie)}}),H(r),H(t),ee(t,`clientHeight`,e=>I(xe,e)),X(e,t)};G(o,e=>{Q(ye)&&e(s)});var l=g(o,2),d=f(l,!0),p=g(l,2),h=j(p),y=e=>{{let t=q(()=>Q(J)?[16,16]:void 0),n=q(()=>({type:Q(Se),markerEnd:{type:U1.ArrowClosed,width:16,height:16}}
2483));L2(e,{get nodeTypes(){return te},ondelete:$e,isValidConnection:et,onpanecontextmenu:Je,onnodecontextmenu:Ye,onedgecontextmenu:Xe,get snapGrid(){return Q(t)},get defaultEdgeOptions(){return Q(n)},deleteKey:[`Backspace`,`Delete`],fitView:!0,minZoom:.4,maxZoom:1.4,get nodes(){return Q(Oe)},set nodes(e){I(Oe,e)},get edges(){return Q(ke)},set edges(e){I(ke,e)},children:(e,t)=>{var n=Wtt(),r=N(n);H2(r,{get variant(){return Q(De)}});var i=g(r,2);B2(i,{});var a=g(i,2),o=e=>{W2(e,{})};G(a,e=>{Q(Ee)&&e(o)}),X(e,n)},$$slots:{default:!0}})}},x=e=>{var t=Ytt(),n=j(t),r=j(n),i=e=>{var t=Te(`No post effect to edit yet`);X(e,t)},a=e=>{var t=Gtt(),n=N(t),r=f(n,!0);W(),O(()=>Y(r,Q(ge))),X(e,t)};G(r,e=>{Q(se)?e(i):e(a,-1)}),H(n);var o=g(n,2),s=f(o,!0),c=g(o,2),l=e=>{var t=qtt(),n=N(t);B(n,21,uR,e=>e.key,(e,t)=>{var n=Ktt(),r=f(n,!0);O(()=>{b(n,`title`,Q(t).hint),Y(r,Q(t).label)}),L(`click`,n,()=>XL.set(QL({preset:Q(t).key}))),X(e,n)}),H(n),W(2),X(e,t)},u=e=>{var t=Jtt(),n=f(t,!0);O(()=>Y(n,Q(pe)===`scene`?`A scene shader drives every object that has no shader of its own`:`Deselect to edit the scene-wide shader instead`)),X(e,t)};G(c,e=>{Q(se)?e(l):e(u,-1)}),H(t),O(()=>Y(s,Q(se)?`Create post effect`:`Create shader`)),L(`click`,o,Fe),X(e,t)};G(h,e=>{Q(V)?e(y):e(x,-1)}),H(p),We(p,e=>I(qe,e),()=>Q(qe));var S=g(p,2),C=f(S,!0),w=g(S,2),T=e=>{var t=lnt(),n=j(t),i=j(n);let a;var o=j(i);yS(o,{size:13,"aria-hidden":`true`}),H(i);var s=g(i,2);let l;bz(j(s),{size:13,"aria-hidden":`true`}),H(s),H(n);var d=g(n,2),p=e=>{var t=int(),n=j(t),r=f(n,!0),i=g(n,2),a=e=>{var t=Xtt(),n=f(t,!0);O(()=>Y(n,Q(Me).doc)),X(e,t)};G(i,e=>{Q(Me).doc&&e(a)});var o=g(i,2),s=g(j(o),2);v(s),H(o);var c=g(o,2);B(c,17,()=>Q(Me).params??[],e=>e.name,(e,t)=>{var n=fe(),r=N(n),i=e=>{var n=Ztt(),r=j(n),i=f(r,!0),a=g(r,2);{let e=q(()=>Q(je).data?.[Q(t).name]??``);A4(a,{get hash(){return Q(e)},onpick:e=>tt(Q(t).name,e)})}H(n),O(()=>Y(i,Q(t).name)),X(e,n)},a=e=>{var n=tnt(),r=j(n),i=f(r,!0),a=g(r,2),o=e=>{var n=Qtt();v(n),O(()=>u(n,Q(je).data?.[Q(t).name]??Q(t).default)),L(`input`,n,e=>tt(Q(t).name,e.currentTarget.value)),X(e,n)},s=e=>{{let n=q(()=>Q(je).data?.[Q(t).name]??Q(t).default),r=q(()=>Q(t).type===`vec2`?2:Q(t).type===`vec4`?4:3);j4(e,{get value(){return Q(n)},get size(){return Q(r)},onchange:e=>tt(Q(t).name,e),onstart:()=>_U(Q(pe)),onend:()=>vU(Q(pe))})}},c=e=>{{let n=q(()=>Q(je).data?.[Q(t).name]??Q(t).default);hq(e,{step:.005,decimals:3,get value(){return Q(n)},onscrubstart:()=>_U(Q(pe)),onscrubend:()=>vU(Q(pe)),onchange:e=>tt(Q(t).name,e)})}},l=e=>{var n=$tt();B(n,20,()=>Q(t).options??[],e=>e,(e,t)=>{var n=M4(),r=f(n,!0),i={};O(()=>{Y(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(n);var r;_(n),O(()=>{r!==(r=Q(je).data?.[Q(t).name]??Q(t).default)&&(n.value=(n.__value=r)??``,D(n,r))}),L(`change`,n,e=>tt(Q(t).name,e.currentTarget.value)),X(e,n)},d=e=>{var n=ent();v(n),O(()=>u(n,Q(je).data?.[Q(t).name]??Q(t).default)),L(`change`,n,e=>tt(Q(t).name,e.currentTarget.value)),X(e,n)};G(a,e=>{Q(t).type===`vec3`&&typeof(Q(je).data?.[Q(t).name]??Q(t).default)==`string`?e(o):Q(t).type===`vec2`||Q(t).type===`vec3`||Q(t).type===`vec4`?e(s,1):Q(t).type===`float`?e(c,2):Q(t).type===`enum`?e(l,3):e(d,-1)}),H(n),O(()=>Y(i,Q(t).name)),X(e,n)};G(r,e=>{Q(t).type===`texture`?e(i):e(a,-1)}),X(e,n)});var l=g(c,2),d=f(l),p=g(l,2),m=e=>{var t=rnt(),n=g(N(t),2);B(n,16,()=>Q(Pe),e=>e,(e,t)=>{var n=nnt(),r=f(n,!0);O(()=>Y(r,t)),X(e,n)}),X(e,t)};G(p,e=>{Q(Pe).length&&e(m)}),H(t),O(()=>{Y(r,Q(Me).label),u(s,Q(je).data?.label??``),b(s,`placeholder`,Q(Me).label),Y(d,`${(Q(Me).inputs??[]).length??``} in · ${(Q(Me).outputs??[]).length??``} out`)}),L(`change`,s,e=>tt(`label`,e.currentTarget.value)),X(e,t)},h=e=>{var t=cnt(),n=g(j(t),2),r=g(j(n),2),i=j(r);i.value=i.__value=`bezier`;var a=g(i);a.value=a.__value=`smoothstep`;var o=g(a);o.value=o.__value=`step`;var s=g(o);s.value=s.__value=`straight`,H(r),_(r),H(n);var l=g(n,2),u=g(j(l),2),d=j(u);d.value=d.__value=`dots`;var p=g(d);p.value=p.__value=`lines`;var h=g(p);h.value=h.__value=`cross`,H(u),_(u),H(l);var y=g(l,2),b=g(j(y),2);v(b),H(y);var x=g(y,2),S=g(j(x),2);v(S),H(x);var C=g(x,2),w=e=>{var t=ant(),n=N(t),r=f(n);W(2),O(()=>Y(r,`${Q(V).nodes.length??``} nodes · ${Q(V).edges.length??``} wires · ${Q(V).backend??``}`)),X(e,t)},T=e=>{var t=ont();X(e,t)},E=e=>{var t=snt();X(e,t)};G(C,e=>
2483{Q(V)?e(w):Q(se)?e(T,1):e(E,-1)}),H(t),m(r,()=>Q(Se),e=>I(Se,e)),m(u,()=>Q(we),e=>I(we,e)),c(b,()=>Q(J),e=>I(J,e)),c(S,()=>Q(Ee),e=>I(Ee,e)),X(e,t)};G(d,e=>{Q(be)===`info`&&Q(je)&&Q(Me)?e(p):e(h,-1)}),H(t),O(()=>{a=r(i,1,`svelte-78zb25`,null,a,{active:Q(be)===`info`}),l=r(s,1,`svelte-78zb25`,null,l,{active:Q(be)===`settings`})}),L(`click`,i,()=>I(be,`info`)),L(`click`,s,()=>I(be,`settings`)),X(e,t)};G(w,e=>{Q(ve)&&e(T)}),H(a),O(()=>{b(l,`title`,Q(ye)?`Hide the node palette`:`Show the node palette`),Y(d,Q(ye)?`â¹`:`âº`),b(S,`title`,Q(ve)?`Hide properties`:`Show properties`),Y(C,Q(ve)?`âº`:`â¹`)}),L(`click`,l,()=>I(ye,!Q(ye))),Z(`drop`,p,$),Z(`dragover`,p,e=>e.preventDefault()),L(`click`,S,()=>I(ve,!Q(ve))),X(e,t)},te=Object.fromEntries(ty().map(e=>[e.key,Mtt])),P=ty(),re=e=>P.filter(t=>t.key!==`surface`&&t.key!==`postOutput`&&(!t.stages||t.stages.includes(e===`post`?`post`:`fragment`))),ie=q(()=>re(i())),F=q(()=>[...new Set(Q(ie).map(e=>e.group))]),{screenToFlowPosition:ae}=P2(),oe=typeof localStorage<`u`?localStorage:null,R=q(()=>a()?.length===1?a()[0]:null),se=q(()=>i()===`post`),ce=e=>KL(),le=q(()=>ce(o())),de=q(()=>s()&&o()[s()]?s():Q(le)[0]?.key??``),pe=q(()=>Q(se)?Q(de):Q(R)??`scene`),me=q(()=>Object.fromEntries(Object.entries(o()).filter(([e])=>e.startsWith(`post:`)===Q(se)))),V=q(()=>Q(pe)?o()[Q(pe)]??null:null),he=q(()=>Q(pe)?l()[Q(pe)]??[]:[]),ge=q(()=>Q(se)?Q(pe)?qL(Q(pe)):`No post effect`:Q(pe)===`scene`?`The scene`:d()?.getObjectByProperty(`uuid`,Q(pe))?.name||`This object`),_e=q(()=>Q(se)?Q(ge)+` â post effect`:Q(pe)===`scene`?`Scene default material`:Q(ge)+` â own material`),ve=t(oe?.getItem(`shaderPropsOpen`)!==`false`),ye=t(oe?.getItem(`shaderPaletteOpen`)!==`false`),be=t(Ne(oe?.getItem(`shaderPropsTab`)||`settings`)),xe=t(0),Se=t(Ne(oe?.getItem(`shaderEdgeStyle`)??`bezier`)),we=t(Ne(oe?.getItem(`shaderBg`)??`dots`)),Ee=t(oe?.getItem(`shaderMinimap`)===`true`),J=t(oe?.getItem(`shaderSnap`)===`true`);Qe(()=>{oe?.setItem(`shaderPropsOpen`,String(Q(ve))),oe?.setItem(`shaderPaletteOpen`,String(Q(ye))),oe?.setItem(`shaderPropsTab`,Q(be)),oe?.setItem(`shaderEdgeStyle`,Q(Se)),oe?.setItem(`shaderBg`,Q(we)),oe?.setItem(`shaderMinimap`,String(Q(Ee))),oe?.
2483setItem(`shaderSnap`,String(Q(J)))});let De=q(()=>Q(we)===`lines`?V2.Lines:Q(we)===`cross`?V2.Cross:V2.Dots),Oe=t([]),ke=t([]),Ae=!1;Qe(()=>{let e=Q(V),t=Q(pe);K(()=>{Ae=!0,I(Oe,(e?.nodes??[]).map(e=>({...e,data:{...e.data??{},__graphKey:t}}))),I(ke,e?.edges??[]),Ae=!1})}),Qe(()=>{let e=Q(Oe),t=Q(ke);K(()=>{if(Ae||!Q(V))return;let n=e.map(e=>{let{__graphKey:t,...n}=e.data??{};return{...e,data:n}});(JSON.stringify(n)!==JSON.stringify(Q(V).nodes)||JSON.stringify(t)!==JSON.stringify(Q(V).edges))&&dy(Q(pe),{nodes:n,edges:t})})});let je=q(()=>Q(Oe).find(e=>e.selected)??null),Me=q(()=>Q(je)?$v(Q(je).type):null),Pe=q(()=>(Q(Me)?.params??[]).filter(e=>e.uniform&&e.type!==`texture`).map(e=>`u_`+String(Q(je)?.id??``).replace(/[^A-Za-z0-9_]/g,`_`)+`_`+e.name));function Fe(){if(Q(se)){XL.set(QL({}));return}if(Q(pe)!==`scene`){let e=d()?.getObjectByProperty(`uuid`,Q(pe));if(e&&!Gfe(e)){es(Rfe(e));return}}dy(Q(pe),{nodes:[{id:`surface`,type:ey,position:{x:380,y:120},data:{}},{id:`colour`,type:`color`,position:{x:90,y:130},data:{value:`#cccccc`}}],edges:[{id:`e-colour`,source:`colour`,sourceHandle:`out`,target:`surface`,targetHandle:`albedo`}]})}function Ie(){if(Q(se)){Q(pe)&&$L(Q(pe)),XL.set(null);return}if(Q(pe)!==`scene`){let e=d()?.getObjectByProperty(`uuid`,Q(pe));e&&ly(e)}dy(Q(pe),null)}function Le(e,t){if(!Q(V)||!Q(pe))return;let n=e+`_`+Math.random().toString(36).slice(2,7);dy(Q(pe),{nodes:[...Q(V).nodes,{id:n,type:e,position:t??{x:140,y:120},data:{}}]})}function Re(e){let t=Q(qe)?.getBoundingClientRect();Le(e,t?ae({x:t.left+t.width/2,y:t.top+t.height/2}):void 0)}function ze(e){Q(V)&&e.length&&dy(Q(pe),{edges:Q(V).edges.filter(t=>!e.includes(t.id))})}function He(e){Q(V)&&dy(Q(pe),{nodes:Q(V).nodes.filter(t=>t.id!==e),edges:Q(V).edges.filter(t=>t.source!==e&&t.target!==e)})}function Ue(e){Q(V)&&dy(Q(pe),{edges:Q(V).edges.filter(t=>t.source!==e&&t.target!==e)})}function Ge(e){if(!Q(V))return;let t=Q(V).nodes.find(t=>t.id===e);t&&dy(Q(pe),{nodes:[...Q(V).nodes,{...t,id:t.type+`_`+Math.random().toString(36).slice(2,7),position:{x:t.position.x+32,y:t.position.y+32},data:{...t.data??{}}}]})}let Ke=t(null),qe=t(null),Je=e=>{let t=e?.event??e;if(t.preventDefault?.(),!Q(V))return;let n=ae({x:t.clientX,y:t.clientY});I(Ke,{x:t.clientX,y:t.clientY,items:[{label:`Search nodesâ¦`,revealFilter:!0},...Q(F).map(e=>({label:e,children:Q(ie).filter(t=>t.group===e).map(e=>({label:e.label,action:()=>Le(e.key,n)}))}))]},!0)},Ye=e=>{let{node:t,event:n}=e;n.preventDefault?.();let r=t.id;I(Ke,{x:n.clientX,y:n.clientY,items:[{label:`Duplicate`,action:()=>Ge(r)},{label:`Disconnect all`,action:()=>Ue(r)},...t.type===`surface`?[]:[{label:`Delete node`,danger:!0,action:()=>He(r)}]]},!0)},Xe=e=>{let{edge:t,event:n}=e;n.preventDefault?.();let r=t.id;I(Ke,{x:n.clientX,y:n.clientY,items:[{label:`Disconnect`,danger:!0,action:()=>ze([r])}]},!0)},$e=e=>{let t=e?.nodes??[];if(!t.length||!Q(V))return;let n=t.map(e=>e.id);dy(Q(pe),{edges:Q(V).edges.filter(e=>!n.includes(e.source)&&!n.includes(e.target))})},et=e=>{let t=Q(Oe).find(t=>t.id===e.source),n=Q(Oe).find(t=>t.id===e.target);if(!t||!n)return!1;let r=($v(t.type)?.outputs??[]).find(t=>t.name===e.sourceHandle),i=($v(n.type)?.inputs??[]).find(t=>t.name===e.targetHandle);return!r||!i||r.type===`sampler2D`==(i.type===`sampler2D`)};function $(e){e.preventDefault();let t=e.dataTransfer?.getData(`application/shadernode`);t&&Le(t,ae({x:e.clientX,y:e.clientY}))}function tt(e,t){Q(je)&&Q(V)&&dy(Q(pe),{nodes:Q(V).nodes.map(n=>n.id===Q(je).id?{...n,data:{...n.data??{},[e]:t}}:n)})}let rt=t(!0),it={minW:380,minH:280},at={w:720,h:480},ot=t(720),st=t(480);if(typeof localStorage<`u`){I(rt,nt.getItem(`shaderDocked`)!==`false`);let e=Xh(parseInt(nt.getItem(`shaderWinW`)??`720`)||720,parseInt(nt.getItem(`shaderWinH`)??`480`)||480,it);I(ot,e.w,!0),I(st,e.h,!0)}typeof window<`u`&&window.matchMedia?.(`(pointer: coarse)`).matches&&!U(rs)&&I(rt,!0);function ct(e){I(rt,e,!0),nt.setItem(`shaderDocked`,String(e)),e?jd(`shader`):Nd(`shader`)}Qe(()=>{let e=h();e&&e.key===`shader`&&(Ad.set(null),K(()=>{e.docked!==Q(rt)&&ct(e.docked),lc.set(!1)}))});let lt=q(()=>y().find(e=>e.members.includes(`shader`))??null),ut=q(()=>Q(lt)?Q(lt).rect.width:Q(ot)),dt=q(()=>Q(lt)?Q(lt).rect.height:Q(st));Qe(()=>(Od(`shader`,!x()&&Q(rt),S()),()=>Od(`shader`,!1)));let ft=q(()=>C()===`shader`&&!w()),pt=e=>Math.min(Math.max(e||320,200),Math.round(window.innerHeight*.8)),mt=t(!1),ht=t(!1);function gt(e){I(mt,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function _t(e){Q(mt)&&Md.update(t=>pt(t-e.movementY))}function vt(e){Q(mt)&&(I(mt,!1),e.currentTarget.releasePointerCapture?.(e.pointerId))}function yt(e){I(ht,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()}function bt(e){if(!Q(ht))return;let t=Q(lt)?Q(lt).rect.width:Q(ot),n=Q(lt)?Q(lt).rect.height:Q(st),r=Gh(e.currentTarget.parentElement),i=Yh(t+e.movementX,n+e.movementY,r.left,r.top,it);I(ot,i.w,!0),I(st,i.h,!0),ag(`shader`,Q(ot),Q(st))}function xt(e){Q(ht)&&(I(ht,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),St())}function St(){nt.setItem(`shaderWinW`,String(Q(ot))),nt.setItem(`shaderWinH`,String(Q(st)))}function Ct(){let e=Xh(at.w,at.h,it);I(ot,e.w,!0),I(st,e.h,!0),ag(`shader`,Q(ot),Q(st)),St()}function wt(){let e=Xh(Q(ot),Q(st),it);(e.w!==Q(ot)||e.h!==Q(st))&&(I(ot,e.w,!0),I(st,e.h,!0),ag(`shader`,Q(ot),Q(st)))}var Tt=pnt();Z(`resize`,p,wt);var Et=N(Tt),Dt=e=>{var t=dnt();let n;var r=j(t),i=g(r,2),a=j(i);TS(a,{});var o=g(a,2);k(o);var s=g(o,2),c=f(s,!0),l=g(s,2),u=j(l),d=g(u,2);A(d),H(l),H(i);var p=g(i,2);M(p),H(t),O(()=>{n=Ze(t,``,n,{height:S()+`px`}),Y(c,Q(_e))}),L(`pointerdown`,r,gt),L(`pointermove`,r,_t),L(`pointerup`,r,vt),L(`click`,u,()=>ct(!1)),X(e,t)},Ot=e=>{var t=fnt();let n;var r=j(t),i=g(j(r),2);k(i);var a=g(i,2),o=f(a,!0),s=g(a,4),c=g(s,2);A(c),H(r);var l=g(r,2);M(l);var u=g(l,2);H(t),ne(t,(e,t)=>Zh?.(e,t),()=>({key:`shader`,defaultRect:{left:240,top:150}})),ne(t,(e,t)=>Kh?.(e,t),()=>`shader`),ne(t,(e,t)=>$h?.(e,t),()=>({key:`shader`,title:`Shader editor`,openStore:lc,isOpen:e=>!e,close:()=>lc.set(!0)})),ne(t,(e,t)=>uS?.(e,t),()=>({key:`shader`})),O(()=>{n=Ze(t,`z-index: var(--z-window); max-width: 96vw; max-height: 88vh`,n,{width:`${Q(ut)??``}px`,height:`${Q(dt)??``}px`}),Y(o,Q(_e))}),L(`click`,s,()=>ct(!0)),L(`pointerdown`,u,yt),L(`pointermove`,u,bt),L(`pointerup`,u,xt),L(`dblclick`,u,Ct),
2483X(e,t)};G(Et,e=>{!x()&&Q(rt)&&Q(ft)?e(Dt):!x()&&!Q(rt)&&e(Ot,1)});var kt=g(Et,2),At=e=>{xS(e,{get x(){return Q(Ke).x},get y(){return Q(Ke).y},get items(){return Q(Ke).items},sizeKey:`shader`,$$events:{close:()=>I(Ke,null)}})};G(kt,e=>{Q(Ke)&&e(At)}),X(e,Tt),ue(),E()}ge([`click`,`change`,`input`,`pointerdown`,`pointermove`,`pointerup`,`dblclick`]);var hnt=V(`<audio></audio>`),gnt=V(`<button id="audio-loop" title="Loop (L)" aria-label="Loop"><!></button>`),_nt=V(`<p id="audio-error" class="ap-error svelte-lok1sm"> </p>`),vnt=V(`<p class="ap-name svelte-lok1sm"> </p>`),ynt=V(`<div><!> <div class="ap-strip tp-tr-strip svelte-lok1sm"><button id="audio-toggle" class="ap-btn ap-play tp-tr-btn tp-tr-play" data-keys=", . step 1s · up/down 5s · Home/End · 0-9 jump · M mute · L loop"><!></button> <span class="ap-time tp-tr-time" id="audio-at"> </span> <input id="audio-seek" class="ap-seek tp-tr-range tp-tr-seek" type="range" min="0" max="1000" step="1" aria-label="Position"/> <span class="ap-time tp-tr-time" id="audio-duration"> </span> <button id="audio-mute" class="ap-btn tp-tr-btn"><!></button> <input id="audio-volume" class="ap-vol tp-tr-range svelte-lok1sm" type="range" min="0" max="100" step="1" aria-label="Volume"/> <!></div> <!></div>`);function N4(e,n){Ce(n,!0);let i=J(n,`itemId`,3,``),a=J(n,`src`,3,``),o=J(n,`name`,3,``),s=J(n,`compact`,3,!1),c=J(n,`autoFocus`,3,!1),l=t(void 0),d=t(``),p=!1,m=t(``),h=t(!1),_=t(0),y=t(0),x=t(1),S=t(!1),C=t(!1),w=t(!1);Qe(()=>{let e=i(),t=a(),n=!1;if(I(m,``),t){I(d,t,!0),p=!1;return}if(!e){I(d,``);return}return(async()=>{let t=await Ja(e);if(!n){if(!t){I(m,`The bytes for this file are not on this device.`),I(d,``);return}p&&Q(d)&&URL.revokeObjectURL(Q(d)),I(d,URL.createObjectURL(t),!0),p=!0}})(),()=>{n=!0}}),Qe(()=>()=>{try{Q(l)?.pause()}catch{}p&&Q(d)&&URL.revokeObjectURL(Q(d))}),Qe(()=>{Q(l)&&(Q(l).volume=Q(x),Q(l).muted=Q(S))});function T(e){e.volume=Q(x),e.muted=Q(S),c()&&setTimeout(()=>e.focus?.(),0)}function E(){Q(l)&&(Q(l).paused?Q(l).play().catch(()=>I(m,`This file could not be played.`)):Q(l).pause())}function D(){return Q(h)}function k(e){if(!Q(l)||!Q(y))return;let t=Math.max(0,Math.min(Q(y),(Q(l).currentTime||0)+e));Q(l).currentTime=t,I(_,t,!0)}function A(e){P(e)}function ee(){I(S,!Q(S))}function M(){I(C,!Q(C))}function te(e){I(x,Math.max(0,Math.min(1,Q(x)+e)),!0),Q(x)>0&&I(S,!1)}function N(){return Q(y)>0}function P(e){if(!Q(l)||!Q(y))return;let t=Math.max(0,Math.min(Q(y),e*Q(y)));Q(l).currentTime=t,I(_,t,!0)}function re(e){let t=Number(e.currentTarget.value);I(_,t/1e3*(Q(y)||0)),Q(w)||P(t/1e3)}function ie(e){I(w,!1),P(Number(e.currentTarget.value)/1e3)}var F={toggle:E,isPlaying:D,nudge:k,toFraction:A,toggleMute:ee,toggleLoop:M,nudgeVolume:te,hasAudio:N},ae=ynt(),oe=j(ae),R=e=>{var t=hnt();We(t,e=>I(l,e),()=>Q(l)),ne(t,e=>T?.(e)),O(()=>{b(t,`src`,Q(d)),t.loop=Q(C)}),Z(`play`,t,()=>I(h,!0)),Z(`pause`,t,()=>I(h,!1)),Z(`ended`,t,()=>I(h,!1)),Z(`timeupdate`,t,()=>{Q(w)||I(_,Q(l)?.currentTime??0,!0)}),Z(`loadedmetadata`,t,()=>I(y,Number.isFinite(Q(l)?.duration)?Q(l)?.duration??0:0,!0)),Z(`error`,t,()=>I(m,`This file could not be played.`)),X(e,t)};G(oe,e=>{Q(d)&&e(R)});var se=g(oe,2),ce=j(se),le=j(ce),de=e=>{hz(e,{size:16,"aria-hidden":`true`})},z=e=>{gz(e,{size:16,"aria-hidden":`true`})};G(le,e=>{Q(h)?e(de):e(z,-1)}),H(ce);var fe=g(ce,2),pe=f(fe,!0),B=g(fe,2);v(B);var me=g(B,2),V=f(me,!0),he=g(me,2),ge=j(he),U=e=>{Oz(e,{size:14,"aria-hidden":`true`})},W=e=>{mAe(e,{size:14,"aria-hidden":`true`})};G(ge,e=>{Q(S)?e(U):e(W,-1)}),H(he);var _e=g(he,2);v(_e);var ve=g(_e,2),ye=e=>{var t=gnt();zke(j(t),{size:14,"aria-hidden":`true`}),H(t),O(()=>{r(t,1,`ap-btn tp-tr-btn ${Q(C)?`ap-on tp-tr-on`:``}`),b(t,`aria-pressed`,Q(C))}),L(`click`,t,()=>I(C,!Q(C))),X(e,t)};G(ve,e=>{s()||e(ye)}),H(se);var be=g(se,2),xe=e=>{var t=_nt(),n=f(t,!0);O(()=>Y(n,Q(m))),X(e,t)},K=e=>{var t=vnt(),n=f(t,!0);O(()=>{b(t,`title`,o()),Y(n,o())}),X(e,t)};return G(be,e=>{Q(m)?e(xe):!s()&&o()&&e(K,1)}),H(ae),O((e,t,n,i)=>{r(ae,1,`ap-root ${s()?`ap-compact`:``}`,`svelte-lok1sm`),b(ae,`data-playing`,Q(h)),b(ce,`title`,Q(h)?`Pause (Space)`:`Play (Space)`),b(ce,`aria-label`,Q(h)?`Pause`:`Play`),ce.disabled=!Q(d),Y
2483(pe,e),B.disabled=!Q(y),u(B,t),Y(V,n),b(he,`aria-pressed`,Q(S)),b(he,`title`,Q(S)?`Unmute (M)`:`Mute (M)`),b(he,`aria-label`,Q(S)?`Unmute`:`Mute`),u(_e,i)},[()=>JC(Q(_)),()=>Q(y)?Math.round(Q(_)/Q(y)*1e3):0,()=>JC(Q(y)),()=>Math.round(Q(x)*100)]),L(`click`,ce,E),L(`pointerdown`,B,()=>I(w,!0)),L(`input`,B,re),L(`change`,B,ie),L(`pointerup`,B,ie),L(`click`,he,()=>I(S,!Q(S))),L(`input`,_e,e=>(I(x,Number(e.currentTarget.value)/100),I(S,!1))),X(e,ae),ue(F)}ge([`click`,`pointerdown`,`input`,`change`,`pointerup`]);var bnt=V(`<button id="version-download-all" class="vh-archive svelte-1detttp" type="button" aria-label="Download all versions (.zip)" title="Every version of this scene as one .zip of .tpscene files â versions whose bytes are no longer here are reported"><!></button>`),xnt=V(`<div class="vh-save svelte-1detttp"><input id="version-label" class="vh-input svelte-1detttp" placeholder="Name this versionâ¦"/> <button id="version-save" class="ui-button-quiet shrink-0">Save versionâ¦</button></div>`),Snt=V(`<p id="version-save-hint" class="vh-hint svelte-1detttp">Open this scene to save a version of it.</p>`),Cnt=V(`<p id="version-empty" class="vh-hint svelte-1detttp">No versions recorded yet.</p>`),wnt=V(`<img class="vh-thumb svelte-1detttp" alt=""/>`),Tnt=V(`<span class="vh-thumb vh-thumb-empty svelte-1detttp"></span>`),Ent=V(`<span class="vh-badge svelte-1detttp">Current</span>`),Dnt=V(`<span class="vh-badge vh-badge-prev svelte-1detttp">Previous</span>`),Ont=V(`<span class="vh-badge vh-badge-away svelte-1detttp">Not held</span>`),knt=V(`<button class="ui-button-quiet vh-delete shrink-0" aria-label="Delete this version's local copy" title="Free the bytes here. The version stays in the project â a peer who still holds it can serve it back"><!></button>`),Ant=V(`<button class="ui-button-quiet vh-restore shrink-0" aria-label="Restore this version" title="Save what is open as a checkpoint, then load this version"><!></button> <!>`,1),jnt=V(`<div class="vh-row svelte-1detttp"><!> <span class="min-w-0 flex-1"><span class="vh-label svelte-1detttp"> </span> <span class="vh-when svelte-1detttp"> </span></span> <!> <!> <!> <button class="ui-button-quiet vh-download shrink-0" aria-label="Download this version (.tpscene)"><!></button> <button class="ui-button-quiet vh-pin shrink-0"><!></button> <!></div>`),Mnt=V(`<div id="version-history" class="vh-wrap svelte-1detttp"><div class="vh-head svelte-1detttp"><!> <span class="flex-1">Version history</span> <!> <span class="vh-count svelte-1detttp"> </span></div> <!> <!> <!></div>`);function Nnt(e,n){Ce(n,!0);let r=()=>z(wd,`$projectManifest`,s),i=()=>z(Bb,`$currentLevel`,s),a=()=>z(Fa,`$explorerItems`,s),o=()=>z(ja,`$hiddenItems`,s),[s,c]=Ve(),l=J(n,`item`,3,null),u=J(n,`onDownloadAll`,3,null),d=(e,t)=>yd(t.hash)??Ib(t.name),p=q(()=>l()&&l().kind===`scene`&&!l().packEntry?d(r(),l()):null),m=q(()=>!!Q(p)&&i()?.name===Q(p)),h=q(()=>{if(!Q(p))return[];let e=r().scenes[Q(p)];if(!e)return[];let t=new Map;for(let e of[...a(),...o()])t.has(e.hash)||t.set(e.hash,e);let n=e.history[e.history.length-1],i=e.history.length>1?e.history[e.history.length-2]:null,s=new Set,c=[];for(let r=e.history.length-1;r>=0;r--){let a=e.history[r];if(s.has(a))continue;s.add(a);let o=t.get(a)??null;c.push({hash:a,item:o,label:e.labels?.[a]??`Auto`,pointer:a===n,previous:a!==n&&a===i,pinned:e.pinned.includes(a),when:o?new Date(o.createdAt).toLocaleString():`â`})}return c}),_=t(``),y=t(!1);async function x(){if(Q(p)&&!Q(y)){I(y,!0);try{await Vme(Q(p),Q(_)),I(_,``)}finally{I(y,!1)}}}async function C(e){if(!e?.item)return;let t=await Ja(e.item.id);if(!t)return;let n=document.createElement(`a`);document.body.appendChild(n),n.style.display=`none`;let r=URL.createObjectURL(t);n.href=r,n.download=`${GS(Q(p)??``)||`scene`}-${US(e.item.createdAt)}.tpscene`,n.click(),URL.revokeObjectURL(r),n.remove()}async function w(e){if(Q(p)&&!Q(y)){I(y,!0);try{await Ime(Q(p),e)}finally{I(y,!1)}}}var T=fe(),E=N(T),D=e=>{var t=Mnt(),n=j(t),r=j(n);dge(r,{size:14,"aria-hidden":`true`});var i=g(r,4),a=e=>{var t=bnt(),n=j(t);lS(n,{size:13,"aria-hidden":`true`}),H(t),L(`click`,t,()=>u()?.(l())),X(e,t)};G(i,e=>{Q(h).length>1&&u()&&e(a)});var o=g(i,2),s=f(o,!0);H(n);var c=g(n,2),d=e=>{var t=xnt(),n=j(t);v(n);var r=g(n,2);H(t),O(()=>{r.disabled=Q(y),b(r,`title`,`Save the current scene as a new version of `+Q(p))}),L(`keydown`,n,e=>{e.key===`Enter`&&x()}),S(n,()=>Q(_),e=>I(_,e)),L(`click`,r,()=>x()),X(e,t)},T=e=>{var t=Snt();X(e,t)};G(c,e=>
2483{Q(m)?e(d):e(T,-1)});var E=g(c,2),D=e=>{var t=Cnt();X(e,t)};G(E,e=>{Q(h).length||e(D)});var k=g(E,2);B(k,17,()=>Q(h),e=>e.hash,(e,t)=>{var n=jnt(),r=j(n),i=e=>{var n=wnt();O(()=>b(n,`src`,Q(t).item.thumbnail)),X(e,n)},a=e=>{var t=Tnt();X(e,t)};G(r,e=>{Q(t).item?.thumbnail?e(i):e(a,-1)});var o=g(r,2),s=j(o),c=f(s,!0),l=g(s,2),u=f(l,!0);H(o);var d=g(o,2),m=e=>{var t=Ent();X(e,t)};G(d,e=>{Q(t).pointer&&e(m)});var h=g(d,2),_=e=>{var t=Dnt();X(e,t)};G(h,e=>{Q(t).previous&&e(_)});var v=g(h,2),x=e=>{var t=Ont();X(e,t)};G(v,e=>{Q(t).item||e(x)});var S=g(v,2),T=j(S);lS(T,{size:13,"aria-hidden":`true`}),H(S);var E=g(S,2),D=j(E);Kx(D,{size:13,"aria-hidden":`true`}),H(E);var k=g(E,2),A=e=>{var n=Ant(),r=N(n),i=j(r);OS(i,{size:13,"aria-hidden":`true`}),H(r);var a=g(r,2),o=e=>{var n=knt(),r=j(n);SS(r,{size:13,class:`ico-danger`,"aria-hidden":`true`}),H(n),L(`click`,n,()=>Ga(Q(t).item.id)),X(e,n)};G(a,e=>{Q(t).item&&e(o)}),O(()=>r.disabled=Q(y)),L(`click`,r,()=>w(Q(t).hash)),X(e,n)};G(k,e=>{Q(t).pointer||e(A)}),H(n),O(()=>{b(n,`data-hash`,Q(t).hash),b(n,`data-pointer`,Q(t).pointer?`1`:`0`),Y(c,Q(t).label),Y(u,Q(t).when),S.disabled=!Q(t).item,b(S,`title`,Q(t).item?`Save this version to your computer as a .tpscene`:`The bytes of this version are not on this machine â nothing to download`),b(E,`aria-pressed`,Q(t).pinned),b(E,`aria-label`,Q(t).pinned?`Unpin this version`:`Pin this version so it is never pruned`),b(E,`title`,Q(t).pinned?`Pinned â the prune never drops it`:`Pin so the prune never drops it`)}),L(`click`,S,()=>C(Q(t))),L(`click`,E,()=>Zne(Q(p)??``,Q(t).hash,!Q(t).pinned)),X(e,n)}),H(t),O(()=>Y(s,Q(h).length)),X(e,t)};G(E,e=>{Q(p)&&e(D)}),X(e,T),ue(),c()}ge([`click`,`keydown`]);var P4=[{key:`name`,label:`Name`,always:!0,width:`220px`},{key:`kind`,label:`Type`,width:`72px`},{key:`size`,label:`Size`,numeric:!0,width:`76px`},{key:`added`,label:`Added`,numeric:!0,width:`104px`},{key:`owner`,label:`Owner`,width:`112px`}],F4=[{key:`name`,label:`Name`,always:!0,width:`220px`},{key:`kind`,label:`Type`,width:`72px`},{key:`location`,label:`Location`,width:`160px`},{key:`deletedBy`,label:`Deleted by`,width:`116px`},{key:`deletedAt`,label:`Deleted at`,numeric:!0,width:`124px`}];function I4(e){return e===`deleted`?F4:P4}var L4=`explorer:viewMode`,R4=`explorer:columns`,z4=`explorer:sort`,B4=`explorer:deletedGroup`;function V4(e,t){if(typeof localStorage>`u`)return t;try{let n=nt.getItem(e);if(!n)return t;let r=JSON.parse(n);return r&&typeof r==`object`?{...t,...r}:t}catch{return t}}function H4(e,t){if(typeof localStorage<`u`)try{nt.setItem(e,JSON.stringify(t))}catch{}}var U4=Ue(typeof localStorage<`u`&&nt.getItem(L4)===`list`?`list`:`thumbnails`);U4.subscribe(e=>{if(typeof localStorage<`u`)try{nt.setItem(L4,e)}catch{}});var W4=`explorer:columnsSeen`,G4={library:[`name`,`kind`,`size`,`added`,`owner`],deleted:[`name`,`kind`,`deletedBy`,`deletedAt`]};function Pnt(e){let t=V4(W4,G4),n={...e};for(let e of[`library`,`deleted`]){let r=n[e];if(!Array.isArray(r))continue;let i=new Set(t[e]??G4[e]??[]),a=I4(e).map(e=>e.key).filter(e=>!i.has(e)&&!r.includes(e));if(!a.length)continue;let o=new Set([...r,...a]);n[e]=I4(e).map(e=>e.key).filter(e=>o.has(e))}return n}var K4=Ue(Pnt(V4(R4,{library:P4.map(e=>e.key),deleted:F4.map(e=>e.key)})));K4.subscribe(e=>{H4(R4,e),H4(W4,{library:P4.map(e=>e.key),deleted:F4.map(e=>e.key)})});var q4=Ue(V4(z4,{library:{key:`name`,dir:1},deleted:{key:`deletedAt`,dir:-1}}));q4.subscribe(e=>H4(z4,e));var J4=Ue(typeof localStorage<`u`&&nt.getItem(B4)===`deleter`?`deleter`:`none`);J4.subscribe(e=>{if(typeof localStorage<`u`)try{nt.setItem(B4,e)}catch{}});var Y4=`explorer:binLayout`,X4=`explorer:binShowSpent`,Z4=Ue(typeof localStorage<`u`&&nt.getItem(Y4)===`plain`?`plain`:`tree`);Z4.subscribe(e=>{if(typeof localStorage<`u`)try{nt.setItem(Y4,e)}catch{}});var Q4=Ue(typeof localStorage<`u`&&nt.getItem(X4)===`true`);Q4.subscribe(e=>{if(typeof localStorage<`u`)try{nt.setItem(X4,String(e))}catch{}});var $4=`explorer:columnWidths`,e3=`explorer:columnOrder`,Fnt=48,Int=600,t3=Ue(V4($4,{library:{},deleted:{}}));t3.subscribe(e=>H4($4,e));var n3=Ue(V4(e3,{library:[],deleted:[]}));n3.subscribe(e=>H4(e3,e));function r3(e,t){let n=e??[],r=(t??[]).filter(e=>n.some(t=>t.key===e));if(!r.length)return[...n];let i=r.map(e=>n.find(t=>
2483t.key===e)).filter(Boolean),a=n.filter(e=>!r.includes(e.key)),o=[],s=0;for(let e of n)a.includes(e)?o.push(e):o.push(i[s++]);let c=o.findIndex(e=>e.always);return c>0&&o.unshift(o.splice(c,1)[0]),o}function i3(e,t){let n=t?.[e?.key??``];if(Number.isFinite(n))return a3(n);let r=parseInt(String(e?.width??``),10);return Number.isFinite(r)?r:120}function a3(e){return Math.max(48,Math.min(600,Math.round(e)))}function o3(e,t,n){t3.update(r=>({...r,[e]:{...r[e]??{},[t]:a3(n)}}))}function s3(e,t){t3.update(n=>{let r={...n[e]??{}};return delete r[t],{...n,[e]:r}})}function c3(e,t,n,r){let i=(t??[]).filter(Boolean),a=i.indexOf(n);if(a<0)return;let o=+(i[0]===`name`);if(a<o)return;let s=Math.max(o,Math.min(i.length-1,r));if(s===a)return;let c=[...i];c.splice(a,1),c.splice(s,0,n),n3.update(t=>({...t,[e]:c}))}function l3(e,t,n){if(I4(e).find(e=>e.key===t)?.always)return!0;let r=(n??U(K4))[e];return!r||r.includes(t)}function u3(e,t){let n=I4(e).find(e=>e.key===t);n&&!n.always&&K4.update(n=>{let r=n[e]??I4(e).map(e=>e.key),i=r.includes(t)?r.filter(e=>e!==t):[...r,t],a=I4(e).map(e=>e.key).filter(e=>i.includes(e));return{...n,[e]:a}})}function d3(e,t){q4.update(n=>{let r=n[e];if(r?.key===t)return{...n,[e]:{key:t,dir:r.dir===1?-1:1}};let i=t===`added`||t===`deletedAt`;return{...n,[e]:{key:t,dir:i?-1:1}}})}function f3(e,t,n={}){let r=n.ownerLabel??(e=>String(e?.owner?.name??e?.owner?.id??``));switch(t){case`name`:return String(e?.name??``).toLowerCase();case`kind`:return String(e?.kind??``).toLowerCase();case`location`:return String(e?.location??``).toLowerCase();case`size`:return Number(e?.size)||0;case`added`:case`deletedAt`:return Number(e?.createdAt)||0;case`owner`:case`deletedBy`:return r(e).toLowerCase();default:return String(e?.name??``).toLowerCase()}}function p3(e,t,n={}){let{key:r=`name`,dir:i=1}=t??{},a=(e,t)=>{if(!!e.folder!=!!t.folder)return e.folder?-1:1;let a=f3(e,r,n),o=f3(t,r,n),s=0;if(s=typeof a==`number`&&typeof o==`number`?a-o:String(a).localeCompare(String(o)),s!==0)return s*i;let c=String(e.name??``).localeCompare(String(t.name??``));return c===0?String(e.id??``).localeCompare(String(t.id??``)):c};return[...e].sort(a)}function m3(e,t={}){let n=t.ownerLabel??(e=>String(e?.owner?.name??``)),r=String(t.myId??``),i=new Map;for(let t of e){let e=String(t?.owner?.id??``),a=e!==``,o=a&&e===r,s=o?`__me__`:a?e:`__unknown__`;i.has(s)||i.set(s,{id:s,name:o?`Deleted by me`:a?`Deleted by `+(n(t)||`someone`):`Deleted by someone`,mine:o,unknown:!a,rows:[]}),i.get(s)?.rows.push(t)}return[...i.values()].sort((e,t)=>e.mine===t.mine?!!e.unknown==!!t.unknown?e.name.localeCompare(t.name):e.unknown?1:-1:e.mine?-1:1)}var Lnt=3;function h3(e){return(String(e?.name??``).match(/\.[a-z0-9]+$/i)?.[0]??``).toLowerCase()}function g3(e){let t=typeof e==`string`?e.trim():``;if(!t)return null;let n=new Set(La(t)),r=new Set;for(let e of Ra())n.has(e.folderId??``)&&r.add(e.hash);return{id:t,ids:n,name:U(Ka).find(e=>e.id===t)?.name??``,hashes:r}}async function _3(e){let t=ka(e);if(!t)return null;let n=await Ja(t.id);return n?{item:t,bytes:new Uint8Array(await n.arrayBuffer())}:null}async function v3(e={}){let{zipSync:t,strToU8:n}=await $(async()=>{let{zipSync:e,strToU8:t}=await import(`../chunks/BJRbKqus.js`).then(e=>e.t);return{zipSync:e,strToU8:t}},__vite__mapDeps([98,1]),import.meta.url),r=e.versions??y3();await wa();let i=g3(e.folderId),a=vd(U(wd)),o=Object.keys(a.scenes).filter(e=>!i||a.scenes[e].history.some(e=>i.hashes.has(e))),s=Object.keys(a.scenes).length-o.length,c=a.assets.filter(e=>!i||i.hashes.has(e)),l={},u=[],d=[],f=0,p=0,m=0,h=new Set;for(let e of o){let t=xd(e),n=Xne(e),i=r?t:new Set(n?[n]:[]);r||(m+=[...t].filter(e=>!i.has(e)).length);for(let e of i){if(h.has(e))continue;h.add(e);let t=await _3(e);if(!t){f++;continue}let n=`scenes/`+e+`.tpscene`;l[n]=t.bytes,u.push({hash:e,name:t.item.name,file:n})}}for(let e of c){let t=await _3(e);if(!t){p++;continue}let n=`assets/`+e+h3(t.item);l[n]=t.bytes,d.push({hash:e,name:t.item.name,file:n})}let g=e=>!i||i.ids.has(e??``),_=e=>i&&e===i.id?null:e??null,v=U(Ka).filter(e=>g(e.id)&&(!i||e.id!==i.id)).map(e=>({id:e.id,name:e.name,parentId:_(e.parentId)})),y=[],b={};for(let e of u)b[e.hash]=e.file;for(let e of d)b[e.hash]=e.file;for(let e of U(Fa)){if(!g(e.folderId))continue;let t=b[e.hash];if(!t){let n=await _3(e.hash);if(!n)continue;t=`items/`+e.hash+h3(e),l[t]=n.bytes,b[e.hash]=t}y.push({id:e.id,hash:e.hash,name:e.name,kind:e.kind,folderId:_(e.folderId),file:t})}let x=e=>{if(r||!e)return e;let t=e.history?.[e.history.length-1];if(!t)return e;let n=e.labels?.[t],i={...e,history:[t],pinned:(e.pinned??[]).filter(e=>e===t)};return n?i.labels={[t]:n}:delete i.labels,i},S=i?o:Object.keys(a.scenes),C={...a,...i?{name:i.name,assets:c}:{},scenes:Object.fromEntries(S.map(e=>[e,x(a.scenes[e])]))};return l[`project.json`]=n(JSON.stringify({format:3,appVersion:Vc,createdAt:Date.now(),name:String(C.name??``),manifest:C,scenes:u,assets:d,folders:v,items:y,skipped:{scenes:f,assets:p,omittedVersions:m,omittedScenes:s}})),{bytes:t(l,{level:6}),scenes:u.length,assets:d.length,items:y.length,folder:i?i.name:null,skippedScenes:f,skippedAssets:p,omittedVersions:m,omittedScenes:s}}async function Rnt(e){if(!e||typeof e!=`object`)return null;let{zipSync:t,strToU8:n}=await $(async()=>{let{zipSync:e,strToU8:t}=await import(`../chunks/BJRbKqus.js`).then(e=>e.t);return{zipSync:e,strToU8:t}},__vite__mapDeps([98,1]),import.meta.url),{exportSessionZip:r}=await $(async()=>{let{exportSessionZip:e}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{exportSessionZip:e}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url),i=String(e.name??``).trim()||`Untitled scene`,a={},o={...e};delete o.library;let s=await r(o,{assets:!1,packs:!1,flow:!0}),c=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),l=await Ia(c),u=`scenes/`+l+`.tpscene`;a[u]=s;let d=[{hash:l,name:i+`.tpscene`,file:u}],f=(e.library?.folders??[]).map(e=>({id:String(e?.id??``),name:String(e?.name??`Folder`),parentId:e?.parentId==null?null:String(e.parentId)})),p=[],m={[l]:u},h=0;for(let t of e.library?.items??[]){let e=null;try{e=t?.blob?await t.blob.arrayBuffer():null}catch{e=null}if(!e){h++;continue}let n=String(t?.name??`file`),r=await Ia(e),i=m[r];i||(i=`items/`+r+h3(t),a[i]=new Uint8Array(e),m[r]=i),p.push({hash:r,name:n,kind:String(t?.kind??Aa(n)??`text`),folderId:t?.folderId==null?null:String(t.folderId),file:i})}let g=vd({name:i,scenes:{[i]:{history:[l],pinned:[]}},assets:[],changedAt:Date.now()});return a[`project.json`]=n(JSON.stringify({format:3,appVersion:Vc,createdAt:Date.now(),name:i,manifest:g,scenes:d,assets:[],folders:f,items:p,skipped:{scenes:0,assets:0,omittedVersions:0,omittedScenes:0,items:h}})),{bytes:t(a,{level:6}),name:i,scenes:d.length,items:p.length,skippedItems:h}}function y3(){try{return nt.getItem(`tpProjectVersions`)!==`false`}catch{return!0}}function znt(e){return GS(e)}async function Bnt(){let e=await Hme();Is.set(!1),Pd.set(`explorer`),Ts(e)}async function b3(e={}){await wa();let t=g3(e.folderId);if(t){if(!t.hashes.size&&t.ids.size<=1)return es(`"`+(t.name||`That folder`)+`" is empty â there is nothing to export yet.`),null}else{let e=U(Fa).length>0||U(Ka).length>0;if(!Cd()&&!e)return es(`There is nothing here yet â save a scene and this becomes a project.`,[{label:`Save a scene`,action:()=>void Bnt()}]),null}let n=await v3({folderId:e.folderId??null}),r=new Blob([n.bytes],{type:`application/zip`}),i=document.createElement(`a`);document.body.appendChild(i),i.style.display=`none`;let a=URL.createObjectURL(r);i.href=a,i.download=`${Nge(t?t.name:Qne())}.tp`,i.click(),URL.revokeObjectURL(a),i.remove();let o=n.skippedScenes+n.skippedAssets,s=(e,t)=>e+` `+t+(e===1?``:`s`);return es((t?`Folder exported: `+(t.name||`folder`)+` â `:`Project exported: `)+s(n.scenes,`scene version`)+`, `+s(n.items,`library item`)+`, `+s(n.assets,`asset`)+(o?` â `+o+` whose bytes are not on this machine were left out`:``)+(n.omittedScenes?` â `+s(n.omittedScenes,`project scene`)+` outside this folder `+(n.omittedScenes===1?`was`:`were`)+` left out`:``)+(n.omittedVersions?` â `+s(n.omittedVersions,`older version`)+` left out (scene version history is off in Export settings)`:``)),n}async function x3(e){let t=Number(e?.format)||0;return t<=3||Bd({title:`Newer project format`,message:`This project was saved by app `+(e?.appVersion||`unknown`)+` (format `+t+`); this app supports format 3. Some content may not load correctly.`,confirmLabel:`Import anyway`})}async function S3(e){let{unzipSync:t,strFromU8:n}=await $(async()=>{let{unzipSync:e,strFromU8:t}=await import(`../chunks/BJRbKqus.js`).then(e=>e.t);return{unzipSync:e,strFromU8:t}},__vite__mapDeps([98,1]),import.meta.url),r;try{r=t(new Uint8Array(e))}catch{return es(`That file could not be read as a project (.tp).`),null}let i=r[`project.json`];if(!i)return es(`That .tp file has no project.json â it is not a project export.`),null;let a=null;try{a=JSON.parse(n(i))}catch{a=null}return a?.manifest?{entries:r,doc:a}:(es(`That project file is missing its manifest.`),null)}function Vnt(e,t){let n=new Map,r=[...e??[]],i=0;for(;r.length&&i<=r.length;){let e=r.shift(),a=e?.parentId==null?null:String(e.parentId),o=a===null?t:n.get(a);if(a!==null&&o===void 0){r.push(e),i++;continue}i=0;let s=Va(String(e?.name??`Folder`),o??t);s&&e?.id!=null&&n.set(String(e.id),s.id)}for(let e of r){let r=Va(String(e?.name??`Folder`),t);r&&e?.id!=null&&n.set(String(e.id),r.id)}return n}async function C3(e,t,n,r,i={}){let a=Vnt(e.folders??[],n),o=new Map,s=!!i.imported,c=new Map;if(i.duplicates===`ask`){let n=[],r=new Set;
2483for(let i of[...e.items??[],...e.scenes??[]]){let e=t[i.file];if(!e)continue;let a=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),o=await Ia(a);if(r.has(o))continue;r.add(o);let s=ka(o);if(!s)continue;let c=i.name||String(i.hash??`item`);n.push({name:c,kind:Aa(c)??`text`,hash:o,buffer:a,existing:s})}if(n.length){let{copies:e}=await Nme(n,{group:`from this project file`})??{copies:[]};for(let t of e??[]){let e=c.get(t.from)??[];e.push(t),c.set(t.from,e)}}}let l=0,u=new Set;for(let r of e.items??[]){let e=t[r.file];if(!e)continue;let i=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),d=await Ia(i),f=r.folderId==null?n:a.get(String(r.folderId))??n,p=await Wa(i,r.name||String(r.hash??`item`),f,{imported:s,allowDuplicate:u.has(d)});u.add(d),p&&r?.id!=null&&o.set(String(r.id),p.id);for(let e of c.get(d)??[])await Wa(e.buffer,e.name,f,{imported:s});l++}let d=0;for(let n of e.assets??[]){let e=t[n.file];e&&(await yf({hash:n.hash,name:n.name,buffer:e}),d++)}let f=0;for(let n of e.scenes??[]){let e=t[n.file];if(!e)continue;let i=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);await Wa(i,n.name||n.hash+`.tpscene`,r,{imported:s});for(let e of c.get(await Ia(i))??[])await Wa(e.buffer,e.name,r,{imported:s});f++}return{scenes:f,assets:d,items:l,remap:a,itemRemap:o}}function w3(e,t,n=new Map){if(!e||typeof e!=`object`)return e;let r=Array.isArray(e.folders)?e.folders:null,i=Array.isArray(e.items)?e.items:null;if(!r&&!i)return e;let a=e=>e==null?null:t.get(String(e))??null,o={...e};return r&&(o.folders=r.map(e=>({...e,id:a(e.id),parentId:a(e.parentId)})).filter(e=>!!e.id)),i&&(o.items=i.map(e=>({...e,...e?.id==null?{}:{id:n.get(String(e.id))??e.id},folderId:a(e.folderId)}))),o}function Hnt(e,t,n){return w3(e,t,n)}async function Unt(e){let t=await S3(e);if(!t)return null;let{entries:n,doc:r}=t;if(!await x3(r))return null;let i=String(r.name??``).trim();if(!await Bd({title:`Open project`+(i?`: `+i:``),message:`This replaces your current project â the Explorer library, its folders and the scene history. The scene on screen stays, but it no longer belongs to a saved project scene until you save it. Continue?`,confirmLabel:`Open project`}))return null;await wa(),await Ma();let a=await C3(r,n,null,null);Sd(w3(r.manifest,a.remap,a.itemRemap),!0),Bb.set(null);let o=Object.keys(vd(r.manifest).scenes);return es(`Project opened`+(i?`: `+i:``)+` â `+o.length+` scene`+(o.length===1?``:`s`)+`, `+(a.items||a.scenes+a.assets)+` library item`+((a.items||a.scenes+a.assets)===1?``:`s`)+`. Nothing was loaded â travel to a scene when you are ready.`),a}async function Wnt(e,t={}){let n=await S3(e);if(!n)return null;let{entries:r,doc:i}=n;if(!await x3(i))return null;await wa();let a=String(t.fileName??``).replace(/\.tp$/i,``).trim()||String(i.name??``).trim()||`Imported project`,o=typeof t.parentId==`string`?t.parentId.trim():``,s=o&&U(Ka).some(e=>e.id===o)?o:null,c=Va(a,s)??Va(`Imported project`,s),l=c?.id??null,u=await C3(i,r,l,l,{imported:!0,duplicates:`ask`}),d=u.items||u.scenes+u.assets;return es(`Imported "`+(c?.name??a)+`" as a folder: `+d+` item`+(d===1?``:`s`)+`. Your project and manifest are untouched.`),u}async function Gnt(e,t={}){let n=await S3(e);if(!n)return null;let{entries:r,doc:i}=n;if(!await x3(i))return null;let{unzipSync:a,strFromU8:o}=await $(async()=>{let{unzipSync:e,strFromU8:t}=await import(`../chunks/BJRbKqus.js`).then(e=>e.t);return{unzipSync:e,strFromU8:t}},__vite__mapDeps([98,1]),import.meta.url),{emptySessionPayload:s,importSessionPayload:c}=await $(async()=>{let{emptySessionPayload:e,importSessionPayload:t}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{emptySessionPayload:e,importSessionPayload:t}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url),l=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),u=vd(i.manifest),d=Object.keys(u.scenes??{}),f=d.includes(String(u.name??``))?String(u.name):d[0],p=f?u.scenes[f]?.history??[]:[],m=p[p.length-1]??null,h=Array.isArray(i.scenes)?i.scenes:[],g=h.find(e=>e.hash===m)??h[0]??null,_=String(t.fileName??``).replace(/\.tp$/i,``).trim()||String(i.name??``).trim()||`Imported project`,v=null,y=g?r[g.file]:null;if(y)try{let e=a(y)[`session.json`];e&&(v=JSON.parse(o(e)))}catch{v=null}(!v||!Array.isArray(v.objects))&&(v=s(_)),v.name=_;let b=[],x=new Set,S=async(e,t)=>{let n=r[e?.file];if(!n)return;let i=l(n),a=await Ia(i);if(x.has(a))return;let o=String(e?.name??t);b.push({name:o,kind:String(e?.kind??Aa(o)??`text`),folderId:e?.folderId==null?null:String(e.folderId),hash:a,blob:new Blob([i])}),x.add(a)};for(let e of i.items??[])await S(e,`file`);for(let e of i.assets??[])await S(e,String(e?.hash??`asset`));for(let e of h)g&&e.file===g.file||await S(e,String(e?.hash??`scene`)+`.tpscene`);v.library={folders:(i.folders??[]).map(e=>({id:String(e?.id??crypto.randomUUID()),name:String(e?.name??`Folder`),parentId:e?.parentId==null?null:String(e.parentId)})),items:b};let C=await c(v);return C&&es(`"`+C.name+`" is in Sessions now â a project with `+b.length+` file`+(b.length===1?``:`s`)+`. Your library and manifest are untouched.`),C}var Knt=V(`<canvas class="h-full w-full" style="touch-action: none; cursor: grab"></canvas>`);function T3(e,n){Ce(n,!0);let r=J(n,`itemId`,3,``),i=J(n,`prefabId`,3,``),a=J(n,`name`,3,``),o=J(n,`autoSpin`,3,!0),s=J(n,`autoPlay`,3,!0),c=null;function l(e){c?.play(e)}function u(e){c?.seek(e)}function d(e){c?.clip(e)}let f=o();Qe(()=>{f=o()});let p=t(void 0);Qe(()=>{if(!Q(p))return;let e=Q(p),t=r(),o=i(),l=a(),u=0,d=!1,m=!1,h=null,g=K(()=>n.onStats),_=K(()=>n.onAnim),v=K(()=>s()),y=null,b=null,x=[],S=0,C=!1,w=0,T=()=>({clips:x.map(e=>({name:e.name||`Clip`,duration:e.duration})),index:S,duration:x[S]?.duration??0,playing:C,time:b?b.time:0}),E=()=>_?.(x.length?T():null),D=(e,t)=>{y&&x[e]&&(b?.stop(),S=e,b=y.clipAction(x[e]),b.reset(),b.play(),b.paused=!t,C=t,y.update(0),E())};c={play:e=>{if(!b)return;let t=x[S]?.duration??0;e&&t&&b.time>=t-1e-4&&(b.time=0),b.paused=!e,C=e,E()},seek:e=>{if(!b||!y)return;let t=x[S]?.duration??0;b.time=Math.max(0,Math.min(t,e)),y.update(0),E()},clip:e=>D(e,C)},g?.(null);let O;try{O=new Un({canvas:e,antialias:!0,alpha:!0})}catch(e){console.log(`model preview: no WebGL context`,e);return}
2483O.setPixelRatio(Math.min(2,window.devicePixelRatio||1));let k=new tr;k.add(new cr(16777215,1093,2.2));let A=new Pt(16777215,1.1);A.position.set(1,2,1.5),k.add(A);let ee=new pt(40,1,.01,100),j=new Pn;k.add(j);let M=1,te=1,ne=0,N=1,P=0,re=0,ie=()=>{ee.position.set(P,re+ne,N),ee.lookAt(P,re,0)},F=()=>{let t=e.clientWidth||1,n=e.clientHeight||1;O.setSize(t,n,!1),ee.aspect=t/n,ee.updateProjectionMatrix()};(async()=>{let e;if(o){if(e=Mv(o),d||!e)return}else{let n;try{n=await Ja(t)}catch{return}if(!n||d)return;let r=await n.arrayBuffer(),i=(l.split(`.`).pop()||`glb`).toLowerCase();try{e=await xa(r,i)}catch{return}}if(d||!e)return;h=e,x=Array.isArray(e.animations)?e.animations.filter(e=>e?.duration>0):[],x.length?(y=new Ln(e),D(0,v)):E();let n=new Or().setFromObject(e);if(!isFinite(n.min.x))return;let r=Math.max(n.getSize(new hn).length(),.001),i=n.getCenter(new hn);e.position.sub(i),j.add(e),ee.near=r/100,ee.far=r*10,M=r,te=r*1.1,ne=r*.12,N=te,P=0,re=0,ie(),ee.updateProjectionMatrix();let a=0,s=0,c=0;e.traverse(e=>{if(e.isMesh&&e.geometry){c++;let t=e.geometry,n=t.attributes?.position?.count??0;s+=n,a+=t.index?t.index.count/3:n/3}}),g?.({tris:Math.round(a),verts:s,meshes:c}),F()})();let ae=!1,I=0,L=t=>{ae=t.button===1||t.shiftKey,m=!0,I=0,e.setPointerCapture(t.pointerId),t.button===1&&t.preventDefault()},oe=t=>{if(m){if(I+=Math.abs(t.movementX)+Math.abs(t.movementY),ae){let n=N/Math.max(1,e.clientHeight)*1.4;P-=t.movementX*n,re+=t.movementY*n,ie();return}j.rotation.y+=t.movementX*.01,j.rotation.x=Math.max(-1.4,Math.min(1.4,j.rotation.x+t.movementY*.01))}},R=()=>{m&&I<=4&&!ae&&K(()=>n.onToggleSpin)?.(),m=!1,ae=!1},se=e=>{e.preventDefault(),N=Math.max(M*.15,Math.min(M*8,N*(e.deltaY>0?1.12:.89))),ie()},ce=()=>{N=te,P=0,re=0,j.rotation.set(0,0,0),ie()};e.addEventListener(`pointerdown`,L),e.addEventListener(`pointermove`,oe),e.addEventListener(`wheel`,se,{passive:!1}),e.addEventListener(`dblclick`,ce),e.addEventListener(`contextmenu`,e=>e.preventDefault()),window.addEventListener(`pointerup`,R);let le=new Xn,ue=()=>{if(d)return;u=requestAnimationFrame(ue);let e=le.getDelta();if(f&&!m&&h&&(j.rotation.y+=.005),y&&(y.update(e),C)){let e=performance.now();e-w>66&&(w=e,E())}O.render(k,ee)};F(),ue();let de=new ResizeObserver(F);return de.observe(e),()=>{d=!0;try{b?.stop(),y?.stopAllAction(),h&&y?.uncacheRoot(h)}catch{}y=null,b=null,c=null,cancelAnimationFrame(u),de.disconnect(),e.removeEventListener(`pointerdown`,L),e.removeEventListener(`pointermove`,oe),e.removeEventListener(`wheel`,se),e.removeEventListener(`dblclick`,ce),window.removeEventListener(`pointerup`,R),k.traverse(e=>{e.geometry?.dispose?.(),e.material&&(Array.isArray(e.material)?e.material:[e.material]).forEach(e=>e.dispose?.())}),O.dispose(),O.forceContextLoss?.()}});var m={setAnimPlaying:l,seekAnim:u,setAnimClip:d},h=Knt();return We(h,e=>I(p,e),()=>Q(p)),X(e,h),ue(m)}var qnt=V(`<span class="tx-label svelte-1uqz4ze"> </span>`),Jnt=V(`<span class="tx-pop-pct svelte-1uqz4ze"> </span>`),Ynt=V(`<div class="tx-bar svelte-1uqz4ze"><div class="tx-bar-fill svelte-1uqz4ze"></div></div> <div class="tx-pop-note svelte-1uqz4ze"> </div>`,1),Xnt=V(`<div class="tx-pop-note svelte-1uqz4ze">Nothing leaves this device until you connect. Files you share then become 2484 available to your peers.</div>`),Znt=V(`<div class="tx-pop-note svelte-1uqz4ze"> </div>`),Qnt=V(`<div class="tx-pop-row svelte-1uqz4ze"><span class="tx-pop-name svelte-1uqz4ze"> </span> <span class="tx-pop-sub svelte-1uqz4ze"> </span></div>`),$nt=V(`<button id="explorer-transfers-more" class="tx-pop-link svelte-1uqz4ze"> </button>`),ert=V(`<button id="explorer-transfers-retry" class="tx-pop-action svelte-1uqz4ze"> </button>`),trt=V(`<button class="tx-backdrop svelte-1uqz4ze" aria-label="Close transfers"></button> <div class="tx-popover svelte-1uqz4ze" role="status"><div class="tx-pop-head svelte-1uqz4ze"><span><!></span> <!></div> <!> <!> <!> <!> <button id="explorer-transfers-logs" class="tx-pop-link svelte-1uqz4ze"> </button></div>`,1),nrt=V(`<div class="tx-wrap shrink-0 svelte-1uqz4ze"><button id="explorer-transfers"><!> <!></button> <span class="tx-sr svelte-1uqz4ze" aria-live="polite"> </span> <!></div>`),rrt=V(`<p class="tx-log-empty svelte-1uqz4ze"> </p>`),irt=V(`<span class="tx-err svelte-1uqz4ze"> </span>`),art=V(`<div class="tx-row-bar svelte-1uqz4ze"><div class="tx-row-fill svelte-1uqz4ze"></div></div>`),ort=V(`<div><span><!></span> <span class="tx-row-dir svelte-1uqz4ze"> </span> <span class="tx-row-name svelte-1uqz4ze"> </span> <span class="tx-row-size svelte-1uqz4ze"> </span> <span class="tx-row-state svelte-1uqz4ze"><!></span> <button class="tx-row-more svelte-1uqz4ze" title="Actions" aria-label="Transfer actions">â¯</button> <!></div>`),srt=V(`<div class="tx-log svelte-1uqz4ze"><div class="tx-log-head svelte-1uqz4ze"><span class="tx-log-title svelte-1uqz4ze">Transfers</span> <span class="tx-log-sub svelte-1uqz4ze"> </span> <button class="ui-button-quiet ml-auto" title="Clear the finished rows">Clear</button> <button id="explorer-transfers-hide" class="ui-button-quiet" title="Hide the full log" aria-label="Hide the full log">â</button></div> <div class="tx-log-body svelte-1uqz4ze"><!></div></div>`),crt=V(`<!> <!>`,1);function E3(e,n){Ce(n,!0);let i=()=>z(Sre,`$transfers`,s),a=()=>z(Es,`$peers`,s),o=()=>z(bre,`$transferSummary`,s),[s,c]=Ve(),l=e=>{var t=nrt(),n=j(t);let i;var a=j(n);{let e=q(()=>Q(T)&&Q(w)===`idle`?`check`:A[Q(w)]);wS(a,{get name(){return Q(e)},size:12,"aria-hidden":`true`})}var s=g(a,2),c=e=>{var t=qnt(),n=f(t,!0);O(()=>Y(n,Q(ee))),X(e,t)};G(s,e=>{Q(ee)&&e(c)}),H(n);var l=g(n,2),u=f(l,!0),d=g(l,2),_=e=>{var t=trt(),n=N(t),r=g(n,2),i=j(r),a=j(i),s=j(a),c=e=>{var t=Te();O(()=>Y(t,`${o().dir===`out`?`Sending`:`Downloading`} 2485 ${o().doneInBatch??``} of ${o().inBatch??``}`)),X(e,t)},l=e=>{var t=Te();O(()=>Y(t,`${o().failed??``} did not finish`)),X(e,t)},u=e=>{var t=Te(`Not connected`);X(e,t)},d=e=>{var t=Te(`Up to date`);X(e,t)};G(s,e=>{Q(w)===`active`?e(c):Q(w)===`failed`?e(l,1):Q(w)===`offline`?e(u,2):e(d,-1)}),H(a);var _=g(a,2),v=e=>{var t=Jnt(),n=f(t);O(()=>Y(n,`${o().pct??``}%`)),X(e,t)};G(_,e=>{Q(w)===`active`&&e(v)}),H(i);
2485var C=g(i,2),T=e=>{var t=Ynt(),n=N(t),r=j(n);let i;H(n);var a=g(n,2),s=f(a,!0);O(()=>{i=Ze(r,``,i,{width:`${o().pct??``}%`}),Y(s,o().byBytes?`by size`:`by file count`)}),X(e,t)},E=e=>{var t=Xnt();X(e,t)},D=e=>{var t=Znt(),n=f(t,!0);O(()=>Y(n,Q(x).length?Q(x).length+` transfer`+(Q(x).length===1?``:`s`)+` this session`:`Nothing has transferred yet`)),X(e,t)};G(C,e=>{Q(w)===`active`?e(T):Q(w)===`offline`?e(E,1):Q(w)===`idle`&&e(D,2)});var k=g(C,2);B(k,17,()=>Q(h)?Q(y):Q(y).slice(0,4),e=>e.id,(e,t)=>{var n=Qnt(),r=j(n),i=f(r,!0),a=g(r,2),o=f(a,!0);H(n),O(e=>{b(r,`title`,Q(t).name),Y(i,Q(t).name),Y(o,e)},[()=>Q(t).size?_f(Q(t))+`%`:`â¦`]),X(e,n)});var A=g(k,2),ee=e=>{var t=$nt(),n=f(t,!0);O(()=>Y(n,Q(h)?`Show less`:`+`+(Q(y).length-4)+` more`)),L(`click`,t,()=>I(h,!Q(h))),X(e,t)};G(A,e=>{Q(y).length>4&&e(ee)});var M=g(A,2),te=e=>{var t=ert(),n=f(t);O(()=>Y(n,`Retry ${o().retryable??``} failed`)),L(`click`,t,()=>{let e=Bge(Q(S).map(e=>e.hash));es(e?`Retrying `+e+` file`+(e===1?``:`s`):`No peer is connected to ask`)}),X(e,t)};G(M,e=>{o().retryable>0&&e(te)});var ne=g(M,2),P=f(ne);H(r),O(()=>Y(P,`${p()?`Hide`:`Show`} full log`)),L(`pointerdown`,n,()=>I(m,!1)),L(`click`,ne,()=>{p(!p()),I(m,!1)}),X(e,t)};G(d,e=>{Q(m)&&e(_)}),H(t),O(()=>{i=r(n,1,`tx-pill ${k[Q(w)]??``}`,`svelte-1uqz4ze`,i,{"tx-fresh":Q(T)&&Q(w)===`idle`}),b(n,`title`,Q(M)),b(n,`aria-label`,Q(M)),Y(u,Q(M))}),L(`click`,n,()=>I(m,!Q(m))),X(e,t)},u=e=>{var t=srt(),n=j(t),i=g(j(n),2),a=f(i),o=g(i,2),s=g(o,2);H(n);var c=g(n,2),l=j(c),u=e=>{var t=rrt(),n=f(t,!0);O(()=>Y(n,Q(C)?`Nothing has moved yet. Files appear here as they are sent or downloaded â including the ones the app fetches on its own.`:`Not connected. Transfers appear here once you are in a session with somebody.`)),X(e,t)},d=e=>{var t=fe(),n=N(t);B(n,17,()=>Q(v),e=>e.id,(e,t)=>{var n=ort();let i;var a=j(n),o=j(a);{let e=q(()=>Q(t).state===`done`?`check`:Q(t).state===`failed`?`triangle-alert`:Q(t).state===`active`?`arrow-down-to-line`:`clock`);wS(o,{get name(){return Q(e)},size:12,"aria-hidden":`true`})}H(a);var s=g(a,2),c=f(s,!0),l=g(s,2),u=f(l,!0),d=g(l,2),p=f(d,!0),m=g(d,2),h=j(m),_=e=>{var n=Te();O(e=>Y(n,`${e??``}%`),[()=>_f(Q(t))]),X(e,n)},v=e=>{var n=irt(),r=f(n,!0);O(()=>{b(n,`title`,Q(t).error),Y(r,Q(t).error??`failed`)}),X(e,n)},y=e=>{var n=Te();O(()=>Y(n,Q(t).state)),X(e,n)};G(h,e=>{Q(t).state===`active`&&Q(t).size?e(_):Q(t).state===`failed`?e(v,1):e(y,-1)}),H(m);var x=g(m,2),S=g(x,2),C=e=>{var n=art(),r=j(n);let i;H(n),O(e=>i=Ze(r,``,i,{width:e}),[()=>`${_f(Q(t))??``}%`]),X(e,n)};G(S,e=>{Q(t).state===`active`&&Q(t).size&&e(C)}),H(n),O(e=>{i=r(n,1,`tx-row svelte-1uqz4ze`,null,i,{"tx-row-fail":Q(t).state===`failed`}),r(a,1,`tx-row-icon tx-s-${Q(t).state??``}`,`svelte-1uqz4ze`),b(s,`title`,Q(t).dir===`in`?`Downloading`:`Sending`),Y(c,Q(t).dir===`in`?`â`:`â`),b(l,`title`,Q(t).name),Y(u,Q(t).name),Y(p,e)},[()=>Q(t).size?vf(Q(t).size):`â`]),L(`click`,x,e=>te(e,Q(t))),X(e,n)}),X(e,t)};G(l,e=>{Q(v).length?e(d,-1):e(u)}),H(c),H(t),O(()=>Y(a,`${Q(y).length??``} live · ${Q(x).length??``} finished`)),L(`click`,o,function(...e){Cre?.apply(this,e)}),L(`click`,s,()=>p(!1)),X(e,t)},d=J(n,`mode`,3,`indicator`),p=J(n,`open`,15,!1),m=t(!1),h=t(!1),_=t(null),v=q(()=>[...i()].reverse()),y=q(()=>Q(v).filter(e=>e.state===`queued`||e.state===`active`)),x=q(()=>Q(v).filter(e=>e.state===`done`||e.state===`failed`)),S=q(()=>Q(v).filter(e=>e.state===`failed`&&e.dir===`in`)),C=q(()=>(a()?.openedPeers?.size??0)>0),w=q(()=>wre(o(),Q(C))),T=t(!1),E=null,D=0;Qe(()=>{let e=o().left,t=o().failed;D>0&&e===0&&t===0&&(I(T,!0),clearTimeout(E),E=setTimeout(()=>I(T,!1),4e3)),D=e});let k={offline:`tx-off`,idle:`tx-idle`,active:`tx-on`,failed:`tx-bad`},A={offline:`cloud-off`,idle:`check`,active:`arrow-down-to-line`,failed:`triangle-alert`},ee=q(()=>Q(w)===`active`?`${o().left} · ${o().pct}%`:Q(w)===`failed`?String(o().failed):``),M=q(()=>Q(w)===`active`?`${o().dir===`out`?`Sending`:`Downloading`} ${o().left} file${o().left===1?``:`s`} â ${o().pct}%`:Q(w)===`failed`?`${o().failed} transfer${o().failed===1?``:`s`}
2485 did not finish â click for detail`:Q(w)===`offline`?`No peers â files stay on this device`:`Up to date â nothing is transferring`);function te(e,t){e.preventDefault(),e.stopPropagation();let n=[];if(t.state===`failed`&&t.dir===`in`&&n.push({label:`Retry`,icon:`rotate-ccw`,tooltip:`Ask the session again â a retry clears every reason we gave up on it`,action:()=>{qS(t.hash)?es(`Retrying `+t.name):es(`No peer is connected to ask`)}}),(t.state===`queued`||t.state===`active`)&&t.dir===`in`&&n.push({label:`Cancel`,icon:`x`,tooltip:`Stop waiting for this file`,action:()=>{Rge(t.hash),es(`Cancelled `+t.name)}}),t.state===`done`&&t.dir===`in`){let e=ka(t.hash);e&&n.push({label:`Show in Explorer`,icon:`folder`,action:()=>Xa(e.id)})}n.push({label:`Remove from log`,action:()=>xre(t.id)}),t.error&&n.push({section:t.error}),I(_,{x:e.clientX,y:e.clientY,items:n},!0)}var ne=crt(),P=N(ne),re=e=>{u(e)},ie=e=>{l(e)};G(P,e=>{d()===`pane`?e(re):e(ie,-1)});var F=g(P,2),ae=e=>{xS(e,{get x(){return Q(_).x},get y(){return Q(_).y},get items(){return Q(_).items},onclose:()=>I(_,null)})};G(F,e=>{Q(_)&&e(ae)}),X(e,ne),ue(),c()}ge([`click`,`pointerdown`]);var D3=Ue(null);function O3(e,t,n){D3.set(e.length?{entries:[...e],mode:t,from:n}:null)}function k3(){D3.set(null)}function A3(e){let t=U(D3);return!!t&&t.mode===`cut`&&t.entries.some(t=>t.id===e)}function j3(e){if(!e?.entries.length)return`Paste`;let t=e.entries.filter(e=>e.kind===`item`).length,n=e.entries.length-t,r=[];return t&&r.push(t===1?`1 file`:t+` files`),n&&r.push(n===1?`1 folder`:n+` folders`),`Paste `+r.join(` + `)}var lrt=V(`<span class="text-[10px] text-red-400">names can't contain * \\ /</span>`),urt=V(`<div class="flex flex-col gap-0.5"><input/> <!></div>`),drt=V(`<input/>`),frt=V(`<button id="explorer-filter" aria-label="Filter files"> </button>`),prt=V(`<div class="tp-seg shrink-0" role="group" aria-label="View mode"><button id="explorer-view-thumbnails" class="tp-seg-btn" title="Thumbnails" aria-label="Thumbnails"><!></button> <button id="explorer-view-list" class="tp-seg-btn" title="List â sortable columns; right-click the header to choose them" aria-label="List"><!></button></div>`),mrt=V(`<button id="explorer-storage" type="button" class="shrink-0 cursor-pointer whitespace-nowrap text-[10px] text-gray-500 underline decoration-dotted hover:text-gray-300"> </button>`),M3=V(`<span><!></span>`),hrt=V(`<img alt=""/>`),N3=V(`<span> </span>`),grt=V(`<span class="explorer-animated shrink-0 text-amber-300"><!></span>`),_rt=V(`<span class="ex-dot explorer-mount-dot bg-indigo-400 svelte-w8o4wk"></span>`),vrt=V(`<span class="ex-dot bg-emerald-400 svelte-w8o4wk" title="The scene you have open"></span>`),yrt=V(`<span class="ex-dot bg-sky-400 svelte-w8o4wk" title="In this project, not on this device yet â open it to download it"></span>`),P3=V(`<span></span>`),brt=V(`<span class="ex-dot border border-gray-500 svelte-w8o4wk"></span>`),xrt=V(`<span class="ex-dot bg-amber-400 svelte-w8o4wk"></span>`),Srt=V(`<span class="explorer-here ml-1 shrink-0 rounded-full bg-gray-700 px-1 text-[9px] leading-4 text-gray-200"> </span>`),Crt=V(`<!> <!> <!>`,1),wrt=V(`<span class="flex min-w-0 items-center gap-1.5"><!> <!> <!> <!></span>`),Trt=V(`<span class="overflow-hidden text-ellipsis whitespace-nowrap text-gray-400"> </span>`),Ert=V(`<td><!></td>`),Drt=V(`<tr><!><td class="ex-cell ex-cell-spacer svelte-w8o4wk" aria-hidden="true"></td></tr>`),Ort=V(`<span class="ex-sort svelte-w8o4wk"> </span>`),krt=V(`<th><button class="ex-th-btn svelte-w8o4wk"> <!></button> <div title="Drag to resize · double-click to reset" style="touch-action: none"></div></th>`),Art=V(`<thead><tr id="explorer-list-head" class="ex-head svelte-w8o4wk"><!><th class="ex-th ex-th-spacer svelte-w8o4wk" aria-hidden="true"></th></tr></thead>`),jrt=V(`<input id="explorer-project-input" class="ui-input w-40 shrink py-0 text-[11px]" aria-label="Project name"/>`),Mrt=V(`<button id="explorer-project"> </button>`),Nrt=V(`<input id="explorer-scene-input" class="ui-input w-40 shrink py-0 text-[11px]" aria-label="Scene name"/>`),Prt=V(`<span id="explorer-scene-file" class="min-w-0 shrink truncate text-[10px] text-gray-500"> </span>`),Frt=V(`<button id="explorer-scene" class="min-w-0 truncate rounded-sm px-1 py-0.5 text-white hover:bg-gray-700"> </button> <!>`,1),Irt=V(`<span id="explorer-dirty" class="shrink-0 text-[9px] leading-none text-amber-400" title="This scene has changes that are not in the version its name points at" aria-label="Unsaved changes">â</span>`),Lrt=V(`<span class="shrink-0 px-0.5 text-gray-600" aria-hidden="true">
2485â¸</span> <!> <button id="explorer-save-scene"><!></button> <!>`,1),Rrt=V(`<div id="explorer-identity" class="flex min-w-0 flex-1 items-center gap-0.5 text-[11px] font-normal"><!> <!></div>`),zrt=V(`<span class="px-0.5 text-gray-600">/</span>`),Brt=V(`<!> <button> </button>`,1),Vrt=V(`<button id="deleted-log-toggle" class="ex-crumb-toggle svelte-w8o4wk" aria-label="Show cleaned-up files"><!></button>`),Hrt=V(`<div id="explorer-crumbs" class="flex items-center gap-0.5 overflow-x-auto whitespace-nowrap border-b border-gray-700/60 px-2 py-1 text-[11px] text-gray-300"><!> <!></div>`),Urt=V(`<span class="mount-dirty text-amber-400" title="Unsaved changes"> â¢</span>`),F3=V(`<div class="flex items-center whitespace-nowrap" role="treeitem" tabindex="-1"><button class="w-4 shrink-0 text-gray-500"> </button> <button draggable="true"><!> </button></div>`),I3=V(`<!> <!>`,1),Wrt=V(`<div class="flex items-center whitespace-nowrap"><button class="w-4 shrink-0 text-gray-500"> </button> <button><!> <!></button> <button><!></button> <button class="shrink-0 rounded px-1 py-1 text-gray-400 hover:bg-gray-700 hover:text-gray-200" title="Stop showing this project here â the saved project is not deleted"><!></button></div> <!>`,1),L3=V(`<button style="padding-left: 22px"><!> </button>`),Grt=V(`<span class="px-2 py-1 text-[10px] italic text-gray-500" style="padding-left: 22px">No packs</span>`),Krt=V(`<span class="text-gray-500">(drop here)</span>`),qrt=V(`<span class="text-gray-500"> </span>`),Jrt=V(`<button id="deleted-folder"><!>Deleted <!></button>`),Yrt=V(`<div id="explorer-tree" class="flex h-full flex-col text-xs"><div id="explorer-mounts" class="flex shrink-0 flex-col gap-0.5 border-b border-gray-700/60 p-1"><button id="explorer-mount-add" class="shrink-0 whitespace-nowrap rounded-sm border border-dashed border-gray-600 px-2 py-1 text-left text-gray-400 hover:border-gray-400 hover:text-gray-200" title="Browse another saved project's files here, without replacing the one you have open">ï¼ Mount projectâ¦</button> <div id="explorer-mount-list" class="flex min-h-0 flex-col gap-0.5 overflow-y-auto"></div></div> <div id="explorer-folder-list" class="flex min-h-0 flex-1 flex-col gap-0.5 overflow-x-auto overflow-y-auto p-1"><button id="explorer-root-row"><!>Library</button> <!> <!></div> <div class="flex shrink-0 flex-col gap-0.5 border-t border-gray-700/60 p-1"><button id="new-folder" class="whitespace-nowrap rounded-sm border border-dashed border-gray-600 px-2 py-1 text-left text-gray-400 hover:border-gray-400 hover:text-gray-200">ï¼ New folder</button> <div id="explorer-roots-resize" style="touch-action: none" title="Drag to resize this section (double-click to reset)"></div> <div id="explorer-roots" class="flex flex-col gap-0.5 overflow-y-auto"><button id="prefabs-folder" title="Your prefab library. Drop a 3D object or a scene file here to make one â it keeps its own format."><!>Prefabs</button> <button id="packs-folder" title="Asset packs â click to list them, double-click to expand the tree"><!> </button> <!> <button id="scene-folder" title="Assets the shared scene uses right now â identical on every peer"><!> </button> <!> <!></div></div></div>`),Xrt=V(`<button id="explorer-confirm-alt" class="ex-confirm-yes svelte-w8o4wk"> </button>`),Zrt=V(`<button id="explorer-confirm-settings" class="ex-confirm-settings svelte-w8o4wk" title="Open the file settings â the recycle bin, and whether deleting asks at all">File settings</button>`),Qrt=V(`<div id="explorer-confirm" class="ex-confirm svelte-w8o4wk"><span><!></span> <span class="ex-confirm-text svelte-w8o4wk"><span class="ex-confirm-title svelte-w8o4wk"> </span> <span class="ex-confirm-detail svelte-w8o4wk"> </span></span> <button id="explorer-confirm-yes"> </button> <!> <button id="explorer-confirm-no" class="ex-confirm-no svelte-w8o4wk">Cancel</button> <!></div>`),$rt=V(`<button id="explorer-share-stash" class="ex-confirm-no svelte-w8o4wk" title="Save your library into a session, then take the session's files instead"> </button>`),eit=V(`<div id="explorer-share-ask" class="ex-confirm ex-confirm--ask svelte-w8o4wk"><span class="ex-confirm-icon ex-ask-icon svelte-w8o4wk"><!></span> <span class="ex-confirm-text svelte-w8o4wk"><span class="ex-confirm-title svelte-w8o4wk"><!></span> <span class="ex-confirm-detail svelte-w8o4wk"> </span></span> <label class="ex-ask-remember svelte-w8o4wk" title="Share: every file on this device is shared now, and every file you add later. Keep local: nothing is shared automatically and you are not asked again. Change it any time in File settings."><input id="explorer-share-remember" class="tp-check" type="checkbox"/> Apply to all my files, now and from now on</label> <button id="explorer-share-yes" class="ex-confirm-yes ex-ask-yes svelte-w8o4wk"> </button> <button id="explorer-share-no" class="ex-confirm-no svelte-w8o4wk">Keep local</button> <!> <button id="explorer-share-settings" class="ex-confirm-settings svelte-w8o4wk" title="Open the file settings â what happens to files you add during a session">File settings</button></div>`),tit=V(`<div id="pack-loading" class="flex items-center justify-center gap-2 p-6 text-xs text-gray-400"><!> Loading pack contentsâ¦</div>`),nit=V(`<div class="flex flex-col items-center gap-2 p-6 text-center"><span class="text-4xl text-gray-300"><!></span> <span class="text-sm text-gray-300"> </span> <button id="pack-install" class="rounded-sm bg-primary-600 px-3 py-1.5 text-sm text-white hover:bg-primary-500 disabled:opacity-50"><!> </button></div>`),rit=V(`<p class="p-4 text-center text-xs italic text-gray-500"> </p>`),iit=V(`<div id="explorer-new-card" class="ex-new flex items-center gap-1.5 svelte-w8o4wk"><span><!></span> <!></div>`),R3=V(`<tbody></tbody>`),ait=V(`<tbody><tr class="ex-group svelte-w8o4wk"><td class="svelte-w8o4wk"><button class="ex-group-btn svelte-w8o4wk"><span class="ex-group-caret svelte-w8o4wk"> </span> <span class="ex-group-n svelte-w8o4wk"> </span></button></td></tr><!></tbody>`),oit=V(`<p class="px-2 py-3 text-[11px] text-gray-500">Nothing here.</p>`),sit=V(`<div class="ex-list svelte-w8o4wk"><!> <table class="ex-table svelte-w8o4wk"><!><!></table> <!></div>`),cit=V(`<div id="explorer-new-card" class="explorer-folder-card flex flex-col items-center gap-1 rounded border border-dashed border-primary-600/70 bg-primary-600/5 p-1.5"><span><!></span> <!></div>`),lit=V(`<div role="button" tabindex="0"><!> <span><!></span> <!></div>`),uit=V(`<span class="explorer-open-dot absolute left-1 top-1 h-2.5 w-2.5 rounded-full bg-emerald-400" title="The scene you have open"></span>`),dit=V(`<span class="explorer-mount-dot absolute right-1 top-1 h-2.5 w-2.5 rounded-full bg-indigo-400"></span>`),fit=V(`<span class="explorer-remote-dot absolute right-1 top-1 h-2.5 w-2.5 rounded-full bg-sky-4
248500" title="In this project, not on this device yet â open it to download it"></span>`),pit=V(`<span class="explorer-unshared-dot absolute bottom-1 left-1 h-2 w-2 rounded-full border border-gray-500"></span>`),mit=V(`<span class="absolute right-1 top-1 h-2.5 w-2.5 rounded-full bg-amber-400"></span>`),hit=V(`<span class="h-1.5 w-1.5 rounded-full bg-emerald-400"></span>`),git=V(`<span class="h-1.5 w-1.5 rounded-full"></span>`),_it=V(`<span class="explorer-here absolute bottom-1 right-1 flex items-center gap-0.5 rounded-full bg-gray-900/80 px-1 py-px text-[9px] leading-none text-gray-200"><!> <!> <span> </span></span>`),vit=V(`<span class="explorer-animated absolute left-1 top-1 flex h-4 w-4 items-center justify-center rounded-full bg-gray-900/80 text-amber-300"><!></span>`),yit=V(`<img class="h-14 w-14 rounded-sm object-cover"/>`),bit=V(`<img/>`),xit=V(`<div draggable="true" role="listitem"><!> <!> <!> <!> <!> <!> <!> <!> <!></div>`),Sit=V(`<div class="ex-cards grid grid-cols-[repeat(auto-fill,96px)] justify-start gap-1 svelte-w8o4wk"><!> <!> <!></div>`),Cit=V(`<div class="ex-log svelte-w8o4wk"><!></div>`),wit=V(`<div><!> <!></div>`),Tit=V(`<div id="explorer-marquee" class="pointer-events-none absolute z-20 rounded-xs border border-sky-400 bg-sky-4
248500/15"></div>`),Eit=V(`<div id="explorer-drop-band" class="pointer-events-none absolute left-1 right-1 z-20 rounded-lg border-2 border-dashed border-primary-500 bg-primary-500/10"></div>`),Dit=V(`<div id="explorer-grid" class="relative h-full min-w-0 select-none overflow-y-auto p-1 outline-hidden" style="scrollbar-gutter: stable" tabindex="-1" role="region"><!> <!> <!> <!></div>`),z3=V(`<div class="text-[11px] text-gray-400"> </div>`),Oit=V(`<a id="pack-source" class="ui-button-quiet mt-1 inline-flex items-center gap-1.5 self-start" target="_blank" rel="noopener" title="Open the content source"><!> </a>`),kit=V(`<div class="flex flex-col gap-1 border-b border-gray-700/40 pb-2"><div class="flex items-center gap-2"><span class="text-gray-400"><!></span> <span class="min-w-0 flex-1 wrap-break-word font-semibold"> </span></div> <!> <!> <button id="pack-attribution" class="ui-button-quiet mt-1 self-start">â Attribution / license</button> <!></div>`),Ait=V(`<img alt="" class="h-12 w-12 rounded-sm object-cover"/>`),jit=V(`<div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Saved</span> <span id="prefab-saved"> </span></div>`),Mit=V(`<div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Updated</span> <span id="prefab-updated"> </span></div>`),Nit=V(`<div id="prefab-facts" class="flex flex-col gap-1"><div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Kind</span><span>prefab</span></div> <div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Objects</span> <span id="prefab-objects"> </span></div> <div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Mesh</span> <span id="prefab-tris"> </span></div> <!> <!></div>`),Pit=V(`<div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Added</span> <span> </span></div>`),Fit=V(`<div class="flex items-center gap-2"><span class="w-14 shrink-0 text-gray-500">Hash</span> <span class="min-w-0 flex-1 truncate font-mono text-[10px]"> </span> <button class="ui-button-quiet shrink-0" title="Copy full hash">â§</button></div>`),Iit=V(`<div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Details</span><span> </span></div>`),Lit=V(`<div class="flex flex-col gap-1"><div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Kind</span><span> </span></div> <div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Size</span><span> </span></div> <div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Folder</span> <span class="min-w-0 truncate"> </span></div> <div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Owner</span> <span class="min-w-0 truncate"> </span></div> <div class="flex gap-2"><span class="w-14 shrink-0 text-gray-500">Sharing</span> <span class="min-w-0 truncate"> </span></div> <!> <!> <!></div>`),Rit=V(`<img id="preview-suspended-thumb" class="h-full w-full object-contain"/>`),zit=V(`<div class="flex h-full w-full items-center justify-center text-gray-600"><!></div>`),Bit=V(`<div id="preview-suspended" class="relative mt-1 overflow-hidden rounded-sm bg-[#0d1117]" style="height: 150px"><!> <div class="pointer-events-none absolute inset-x-0 bottom-0 bg-black/60 px-2 py-1 text-center text-[10px] text-gray-300">Previewing in its own window</div></div>`),Vit=V(`<div id="inline-audio" class="mt-1"><!></div>`),Hit=V(`<div class="flex gap-2 text-[11px]"><span class="w-14 shrink-0 text-gray-500">Mesh</span> <span class="text-gray-300"> </span></div>`),Uit=V(`<div id="inline-preview" class="mt-1 overflow-hidden rounded-sm bg-[#0d1117]" style="height: 150px"><!></div> <!>`,1),Wit=V(`<button id="prefab-preview" class="ui-button-quiet">3D preview</button>`),Git=V(`<button id="prefab-add" class="ui-button-quiet">Add to scene</button> <button id="prefab-rename" class="ui-button-quiet">Rename</button> <!>`,1),Kit=V(`<button class="ui-button-quiet">Place in scene</button>`),qit=V(`<button class="ui-button-quiet"> </button>`),Jit=V(`<button class="ui-button-quiet">3D preview</button>`),Yit=V(`<button class="ui-button-quiet">Rename</button> <!>`,1),Xit=V(`<div class="flex items-center gap-2"><!> <span class="min-w-0 flex-1 wrap-break-word font-semibold"> </span></div> <!> <!> <div class="mt-1 flex flex-wrap gap-2"><!></div> <!>`,1),Zit=V(`<div class="flex items-center gap-2"><span class="ico-folder"><!></span> <span class="min-w-0 flex-1 wrap-break-word font-semibold"> </span></div> <p class="text-gray-400"> </p> <div class="mt-1 flex gap-2"><button class="ui-button-quiet">Open</button> <button class="ui-button-quiet">Rename</button></div>`,1),Qit=V(`<p class="leading-relaxed text-gray-400">Select a folder or file (or right-click ⸠Properties) to see its details here.</p>`),$it=V(`<div class="flex flex-col gap-2 p-2 text-xs text-gray-200"><!> <!></div>`),eat=V(`<button class="ui-button-quiet self-start text-[11px]"> </button>`),tat=V(`<div class="flex flex-col gap-2 p-2 text-xs text-gray-200"><label class="flex items-center gap-2"><input class="tp-check" type="checkbox"/> Single-click opens folders</label> <label class="flex items-center gap-2"><input class="tp-check" type="checkbox"/> Show path bar</label> <label class="flex items-center gap-2" title="Show a rotatable 3D preview for model items in Properties + on open"><input class="tp-check" type="checkbox"/> 3D model preview</label> <label class="flex items-center gap-2" title="Drop several selected cards on the same spot instead of spreading them out"><input id="explorer-stack-on-drop" type="checkbox"/> Stack multiple drops on one spot</label> <label class="flex items-center gap-2" title="Ask before 'Update from selection' replaces a prefab's stored bytes"><input id="explorer-confirm-prefab-update" class="tp-check" type="checkbox"/> Confirm before updating a prefab</label> <label class="flex items-center gap-2" title="Hide the bundled packs, showing only your imported ones"><input class="tp-check" type="checkbox"/> Hide built-in packs</label> <!> <div class="mt-1 border-t border-gray-700/40 pt-2"><button class="ui-button-quiet w-full">ï¼ Import pack (.zip)</button> <input type="file" accept=".zip" class="hidden"/></div></div>`),nat=V(`<div id="explorer-list" role="region"><div class="resize-cue absolute -top-1 left-0 right-0 z-30 h-2 cursor-ns-resize hover:bg-primary-600/30" style="touch-action: none" title="Drag to resize"></div> <!> <div class="mb-1 flex items-center gap-2"><span class="shrink-0 text-xs font-semibold text-gray-200"><!>Explorer</span> <input id="explorer-search" class="ui-input w-48 shrink-0 py-0.5" placeholder="Search assetsâ¦"/> <!> <!> <!> <!> <!> <button id="explorer-undock" class="ui-button-quiet shrink-0" title="Undock into a floating window">â§</button></div> <div><!></div></div>`),rat=V(`<input id="explorer-search" class="ui-input w-44 shrink-0 py-0.5 font-normal" placeholder="Search assetsâ¦"/>`),iat=V(`<div id="explorer-window" class="ui-panel fixed flex flex-col overflow-hidden" role="region"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span class="shrink-0" title="Explorer"><!> </span> <div class="flex min-w-0 flex-1 items-center gap-2 overflow-hidden"><!> <!> <!> <!> <!> <!></div> <button id="explorer-dock" class="ui-button-quiet shrink-0" title="Dock to the bottom">â© Dock</button> <button id="explorer-close" class="ui-button-quiet shrink-0" title="Close" aria-label="Close the Explorer">â</button></div> <div class="min-h-0 flex-1 p-1"><!></div> <div class="resize-cue absolute bottom-0 right-0 z-10 h-3.5 w-3.5 cursor-se-resize rounded-tl bg-gray-500/40" style="touch-action: none" title="Drag to resize · double-click to reset size"></div></div>`),aat=V(`<input type="file" accept=".tp" class="hidden"/> <input type="file" accept=".tp" class="hidden"/> <!>`,1),oat=V(`<div class="pointer-events-none fixed z-1400 max-w-[160px] -translate-x-1/2 -translate-y-1/2 truncate rounded-sm border border-primary-400 bg-gray-800 px-2 py-1 text-center text-xs font-semibold text-gray-100 shadow-lg"> </div>`),sat=V(`<div class="flex items-center gap-2 p-4 text-sm text-gray-400"><!> Loading attributionâ¦</div>`),cat=V(`<div class="prose prose-invert prose-sm max-w-none"></div>`),lat=V(`<button class="fixed inset-0 z-(--z-window) cursor-default bg-black/50" aria-label="Close attribution"></button> <div id="pack-attrib-modal" class="ui-panel fixed left-1/2 top-1/2 z-(--z-window) max-h-[70vh] w-96 -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-lg p-4 text-sm" style="z-index: calc(var(--z-window) + 1)"><!> <div class="mt-3 flex justify-end"><button class="ui-button-quiet">Close</button></div></div>`,1),uat=V(`<!> <!> <!> <!>`,1);function dat(n,i){Ce(i,!0);let a=()=>z(Xb,`$peerScenes`,Fe),o=()=>z(Bb,`$currentLevel`,Fe),s=()=>z(Vd,`$sessionHost`,Fe),c=()=>z(Ad,`$dockModeArm`,Fe),l=()=>z(Is,`$explorerClose`,Fe),d=()=>z(Md,`$dockHeight`,Fe),m=()=>z(Ld,`$visibleDockKey`,Fe),h=()=>z(Fd,`$dockMinimized`,Fe),_=()=>z(Qh,`$tabGroups`,Fe),y=()=>z(Fa,`$explorerItems`,Fe),x=()=>z(Es,`$peers`,Fe),T=()=>z(wd,`$projectManifest`,Fe),E=()=>z(bf,`$sharedThumbs`,Fe),D=()=>z(Tre,`$unavailableHashes`,Fe),k=()=>z(Fm,`$packs`,Fe),A=()=>z(Ba,`$activeFolder`,Fe),te=()=>z(wZ,`$mountedVolumes`,Fe),P=()=>z(Ka,`$explorerFolders`,Fe),re=()=>z(ja,`$hiddenItems`,Fe),ie=()=>z(Q4,`$explorerBinShowSpent`,Fe),F=()=>z(Z4,`$explorerBinLayout`,Fe),ae=()=>z(Av,`$prefabs`,Fe),oe=()=>z(Moe,`$openPackItems`,Fe),R=()=>z(kde,`$sceneAssets`,Fe),se=()=>z(Sa,`$revealItemId`,Fe),le=()=>z(n3,`$explorerColumnOrder`,Fe),de=()=>z(K4,`$explorerColumns`,Fe),pe=()=>z(t3,`$explorerColumnWidths`,Fe),me=()=>
2485z(U4,`$explorerViewMode`,Fe),V=()=>z(q4,`$explorerSort`,Fe),he=()=>z(cC,`$deletedLogEnabled`,Fe),ge=()=>z(J4,`$explorerDeletedGroup`,Fe),_e=()=>z(Zo,`$explorerSceneSaveArm`,Fe),ve=()=>z(Yo,`$explorerRevealArm`,Fe),ye=()=>z(kb,`$sessions`,Fe),be=()=>z(aC,`$pendingShareAsk`,Fe),xe=()=>z(D3,`$explorerClipboard`,Fe),Se=()=>z(Kr,`$selectedObjects`,Fe),we=()=>z(ic,`$confirmPrefabUpdate`,Fe),Ee=()=>z(mC,`$deleteWithoutConfirm`,Fe),J=()=>z(Ya,`$inspectedFile`,Fe),De=()=>z(Jge,`$pendingPulls`,Fe),Oe=()=>z(vC,`$sceneDirty`,Fe),ke=()=>z(Eoe,`$openPackLoading`,Fe),Ae=()=>z($o,`$enable3dPreview`,Fe),je=()=>z(yJ,`$previewSuspended`,Fe),Pe=()=>z(Ao,`$stackOnDrop`,Fe),[Fe,Le]=Ve(),Re=(e,t=qe)=>{var n=urt(),i=j(n);v(i),ne(i,e=>Gi?.(e));var a=g(i,2),o=e=>{var t=lrt();X(e,t)},s=q(()=>!Na(Q(fn).value));G(a,e=>{Q(s)&&e(o)}),H(n),O(e=>{Ze(n,`padding-left: ${8+t()*14}px`),r(i,1,`ui-input w-40 py-0.5 ${e??``}`),u(i,Q(fn).value)},[()=>Na(Q(fn).value)?``:`border-red-500`]),L(`input`,i,e=>I(fn,{...Q(fn),value:e.currentTarget.value},!0)),L(`keydown`,i,Wi),Z(`blur`,i,Hi),X(e,n)},ze=e=>{var t=drt();v(t),ne(t,e=>Gi?.(e)),O(e=>{r(t,1,`ui-input w-full select-text py-0 text-center text-[10px] ${e??``}`),u(t,Q(fn).value)},[()=>Na(Q(fn).value)?``:`border-red-500`]),L(`input`,t,e=>I(fn,{...Q(fn),value:e.currentTarget.value},!0)),L(`keydown`,t,Wi),L(`click`,t,e=>e.stopPropagation()),Z(`blur`,t,Hi),X(e,t)},He=e=>{var t=frt(),n=f(t);O(()=>{r(t,1,`ui-button-quiet shrink-0 ${Q(Ut)?`text-primary-400`:``}`),b(t,`title`,Q(Ut)?`Filtering â click to change or clear`:`Filter by type, and by who can see it`),Y(n,`â·${Q(Ut)?` â¢`:``}`)}),L(`click`,t,e=>Qo(e)),X(e,t)},Ue=e=>{E3(e,{get open(){return Q(It)},set open(e){I(It,e,!0)}})},Ge=e=>{var t=prt(),n=j(t);lz(j(n),{size:14,"aria-hidden":`true`}),H(n);var r=g(n,2);uz(j(r),{size:14,"aria-hidden":`true`}),H(r),H(t),O(()=>{b(n,`aria-pressed`,me()===`thumbnails`),b(r,`aria-pressed`,me()===`list`)}),L(`click`,n,()=>U4.set(`thumbnails`)),L(`click`,r,()=>U4.set(`list`)),X(e,t)},Ke=e=>{var t=fe(),n=N(t),r=e=>{var t=mrt(),n=f(t);O((e,r,i)=>{b(t,`title`,e),Y(n,`${r??``} / ${i??``}`)},[()=>ai(Q(ii))+` Click for the breakdown.`,()=>Rr(Q(ii).used),()=>Rr(Q(ii).quota)]),L(`click`,t,function(...e){SX?.apply(this,e)}),X(e,t)};G(n,e=>{Q(ii)&&!Q(zt)&&e(r)}),X(e,t)},Je=(e,t=qe)=>{let n=q(()=>t().kind===`folder`),i=q(()=>t().item),c=q(()=>t().folder),l=q(()=>Q(n)?Q(c).id:Q(i).id);var u=Drt();let d,p;var m=j(u);B(m,19,()=>Q(Ur),e=>e.key,(e,u,d)=>{var p=Ert();let m;var h=j(p),_=e=>{var t=wrt(),u=j(t),d=e=>{var t=M3(),n=j(t);nS(n,{size:14,"aria-hidden":`true`}),H(t),O(e=>r(t,1,`shrink-0 ${e??``}`,`svelte-w8o4wk`),[()=>Zt(Q(c))?$t:`ico-folder`]),X(e,t)},p=e=>{var t=hrt();O((e,n)=>{b(t,`src`,e),r(t,1,`h-4 w-4 shrink-0 rounded-sm object-cover ${n??``}`,`svelte-w8o4wk`)},[()=>en(Q(i)),()=>Xt(Q(i))?Qt:``]),X(e,t)},m=q(()=>en(Q(i))),h=e=>{var t=M3(),n=j(t);{let e=q(()=>Jn[Q(i).kind]??`package`);wS(n,{get name(){return Q(e)},size:14})}H(t),O(e=>r(t,1,`shrink-0 ${e??``}`,`svelte-w8o4wk`),[()=>Xt(Q(i))?$t:Zn[Q(i).kind]??`text-gray-400`]),X(e,t)};G(u,e=>{Q(n)?e(d):Q(m)?e(p,1):e(h,-1)});var _=g(u,2),v=e=>{ze(e)},y=e=>{var t=N3(),a=f(t,!0);O(e=>{r(t,1,`min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap ${e??``}`),Y(a,Q(n)?Q(c).name:Q(i).name)},[()=>(Q(n)?Zt(Q(c)):Xt(Q(i)))?`text-gray-500`:`text-gray-300`]),X(e,t)};G(_,e=>{Q(fn)?.mode===`rename`&&Q(fn).inGrid&&(Q(fn).cardId??Q(fn).folderId)===Q(l)||Q(fn)?.mode===`rename-item`&&Q(fn).itemId===Q(l)||Q(fn)?.mode===`rename-scene`&&Q(fn).itemId===Q(l)||Q(fn)?.mode===`rename-prefab`&&Q(fn).prefabId===Q(i)?.prefabId?e(v):e(y,-1)});var x=g(_,2),S=e=>{var t=grt();gz(j(t),{size:10,"aria-hidden":`true`}),H(t),O(e=>{b(t,`title`,e),b(t,`data-behavior`,Q(i).behavior.type)},[()=>Wn(Q(i).behavior)]),X(e,t)};G(x,e=>{!Q(n)&&Q(i).behavior&&e(S)});var C=g(x,2),w=e=>{var t=Crt(),n=N(t),c=e=>{var t=_rt();O(()=>b(t,`title`,`In the mounted project â`+(Q(i).volumeName??``)+`â â not in your library`)),X(e,t)},l=e=>{var t=vrt();X(e,t)},u=e=>{var t=yrt();X(e,t)},d=e=>{var t=P3();O((e,n)=>{r(t,1,`ex-dot ${e??``}`,`svelte-w8o4wk`),b(t,`title`,n)},[()=>D().has(Q(i).hash)?`bg-red-400`:De().has(Q(i).hash)?`animate-pulse bg-amber-400`:`bg-sky-4
248500`,()=>De().has(Q(i).hash)?`Downloading from peersâ¦`:tn(Q(i))]),X(e,t)},p=e=>{var t=P3();O((e,n)=>{r(t,1,`ex-dot ${e??``}`,`svelte-w8o4wk`),b(t,`title`,n)},[()=>Wt(Q(i))===`mine`?`bg-teal-400`:`bg-sky-400`,()=>tn(Q(i))]),X(e,t)},m=q(()=>Q(Jt)&&Gt(Q(i))),h=e=>{var t=brt();O(e=>b(t,`title`,e),[()=>tn(Q(i))]),X(e,t)};G(n,e=>{Q(i).volumeItem?e(c):Q(vr)&&Q(i).hash===Q(vr)?e(l,1):Q(i).remoteScene?e(u,2):Q(i).remoteItem?e(d,3):Q(m)?e(p,4):Q(Jt)&&Q(i).wasShared&&e(h,5)});var _=g(n,2),v=e=>{var t=xrt();O(e=>b(t,`title`,e),[()=>`An update of "`+et(T(),Q(i).hash)+`" exists â this file is an older version`]),X(e,t)},y=q(()=>Q(i).kind===`scene`&&!Q(i).remoteScene&&et(T(),Q(i).hash));G(_,e=>{Q(y)&&e(v)});var x=g(_,2),S=e=>{let t=q(()=>tt(a(),o(),s(),Q(i)));var n=fe(),r=N(n),c=e=>{var n=Srt(),r=f(n);O((e,t,i)=>{b(n,`title`,e),b(n,`data-here`,t),Y(r,`${i??``} here`)},[()=>rt(Q(t)),()=>it(Q(t)),()=>it(Q(t))]),X(e,n)};G(r,e=>{(Q(t).me||Q(t).peerIds.length)&&e(c)}),X(e,n)};G(x,e=>{Q(i).kind===`scene`&&e(S)}),X(e,t)},E=e=>{var t=P3();O(()=>{r(t,1,`ex-dot ${Q(c).share===`mine`?`bg-teal-400`:`bg-sky-400`}`,`svelte-w8o4wk`),b(t,`title`,Q(c).share===`mine`?`Shared by you â peers see this folder, and anything you add to it`:`Shared â a peer offered this folder`)}),X(e,t)};G(C,e=>{Q(n)?Q(Jt)&&(Q(c).share===`mine`||Q(c).share===`peer`)&&e(E,1):e(w)}),H(t),X(e,t)},v=e=>{var n=Trt(),r=f(n,!0);O(e=>Y(r,e),[()=>Vr(t(),Q(u).key)]),X(e,n)};G(h,e=>{Q(u).key===`name`?e(_):e(v,-1)}),H(p),O(()=>{r(p,1,`ex-cell ${Q(u).numeric?`text-right tabular-nums`:``}`,`svelte-w8o4wk`),b(p,`data-col`,Q(u).key),m=Ze(p,``,m,{width:`${Q(Wr)[Q(d)]??``}px`})}),X(e,p)}),W(),H(u),O((e,t,a)=>{b(u,`data-card-id`,Q(l)),b(u,`data-cut`,e),d=r(u,1,`ex-row ${Q(n)?`explorer-folder-card`:`explorer-card`} ${Q(n)&&Q(c).deletedNode?`ex-deleted-node`:``} ${Q(n)&&Q(c).ghost?`ex-deleted-ghost`:``} ${t??``} ${!Q(n)&&Q(vr)&&Q(i).hash===Q(vr)?`explorer-open-scene`:``} ${!Q(n)&&(Q(i).remoteScene||Q(i).remoteItem||Q(i).deletedEntry&&!Q(i).restorable)?`explorer-remote opacity-60`:``} ${Q(dn)===Q(l)&&Q(n)?`ex-row-drop`:``}`,`svelte-w8o4wk`,d,{"opacity-50":a}),b(u,`draggable`,!(Q(n)&&Q(c).deletedNode&&(Q(c).ghost||!Q(c).row))),b(u,`title`,Q(n)?Q(c).ghost?`Still in Library â holds deleted files`:Q(c).name:Q(i).name),p=Ze(u,``,p,{"touch-action":Q(bs)?`none`:`pan-y`})},[()=>xe()&&A3(Q(l))?`1`:void 0,()=>Ti(Q(vi),J(),Q(gt),Q(l)),()=>!!xe()&&A3(Q(l))]),Z(`dragstart`,u,e=>Q(n)?ps(e,Q(c)):fs(e,Q(i))),Z(`dragover`,u,e=>Q(n)&&oo(e,Q(c).id)),Z(`dragleave`,u,()=>Q(n)&&I(dn,null)),Z(`drop`,u,e=>Q(n)&&ao(e,Q(c).id)),L(`pointerdown`,u,e=>!Q(n)&&ks(e,Q(i))),L(`pointermove`,u,e=>!Q(n)&&As(e)),L(`pointerup`,u,e=>!Q(n)&&js(e)),L(`contextmenu`,u,e=>Q(n)?so(e,Q(c),!1):Ho(e,Q(i))),L(`click`,u,e=>Q(n)?Ns(e,Q(c)):Ms(e,Q(i))),L(`dblclick`,u,()=>Q(n)?zs(Q(c).id):tc(Q(i))),X(e,u)},Ye=e=>{var t=Art(),n=j(t),i=j(n);B(i,19,()=>Q(Ur),e=>e.key,(e,t,n)=>{var i=krt();let a;var o=j(i),s=j(o,!0),c=g(s),l=e=>{var t=Ort(),n=f(t,!0);O(()=>Y(n,(V()[Q(zr)]??{}).dir===-1?`â¾`:`â´`)),X(e,t)};G(c,e=>{(V()[Q(zr)]??{}).key===Q(t).key&&e(l)}),H(o);var u=g(o,2);H(i),O(e=>{r(i,1,`ex-th ${Q(t).numeric?`text-right`:``} ${Q(Zr)?.moved&&Q(Zr).over===Q(n)?`ex-th-over`:``} ${Q(Zr)?.moved&&Q(Zr).key===Q(t).key?`ex-th-dragging`:``}`,`svelte-w8o4wk`),b(i,`data-col`,Q(t).key),a=Ze(i,``,a,{width:`${Q(Wr)[Q(n)]??``}px`}),b(o,`data-col`,Q(t).key),b(o,`title`,e),Y(s,Q(t).label),r(u,1,`ex-grip ${Q(qr)?.key===Q(t).key?`ex-grip-on`:``}`,`svelte-w8o4wk`),b(u,`data-grip`,Q(t).key)},[()=>Q(t).always?`Sort by `+Q(t).label.toLowerCase()+` â this column stays first`:`Sort by `+Q(t).label.toLowerCase()+` · drag sideways to reorder`]),L(`pointerdown`,o,e=>$r(e,Q(t))),L(`click`,o,()=>ni(Q(t).key)),L(`pointerdown`,u,e=>Jr(e,Q(t),Q(Wr)[Q(n)])),L(`pointermove`,u,Yr),L(`pointerup`,u,Xr),Z(`pointercancel`,u,Xr),L(`dblclick`,u,()=>s3(Q(zr),Q(t).key)),X(e,i)}),W(),H(n),H(t),L(`contextmenu`,n,e=>ri(e)),X(e,t)},Xe=e=>{var t=fe(),n=N(t),i=e=>{var t=Rrt(),n=j(t),i=e=>{var t=jrt();v(t),ne(t,e=>Gi?.(e)),O(()=>u(t,Q(gr))),L(`input`,t,e=>I(gr,e.currentTarget.value,!0)),L(`keydown`,t,Dr),Z(`blur`,t,Er),X(e,t)},a=e=>{var t=Mrt(),n=f(t,!0);O(()=>{r(t,1,`min-w-0 truncate rounded-sm px-1 py-0.5 font-medium hover:bg-gray-700 ${T().name?`text-gray-200`:`italic text-gray-500`}`),b(t,`title`,Q(_r)+` â click to rename this project`),Y(n,Q(_r))}),L(`click`,t,Tr),X(e,t)};G(n,e=>{Q(gr)===null?e(a,-1):e(i)});var s=g(n,2),c=e=>{var t=Lrt(),n=g(N(t),2),i=e=>{var t=Nrt();v(t),ne(t,e=>Gi?.(e)),O(()=>u(t,Q(yr))),L(`input`,t,e=>
2485I(yr,e.currentTarget.value,!0)),L(`keydown`,t,Cr),Z(`blur`,t,Sr),X(e,t)},a=e=>{var t=Frt(),n=N(t),r=f(n,!0),i=g(n,2),a=e=>{var t=Prt(),n=f(t);O(()=>{b(t,`title`,`Loaded from `+Q(br)+` â renaming the scene renames its files`),Y(n,`[${Q(br)??``}]`)}),X(e,t)};G(i,e=>{Q(br)&&e(a)}),O(()=>{b(n,`title`,`The scene you have open: `+o().name+` â click to find its file, double-click to rename it`),Y(r,o().name)}),L(`click`,n,kr),L(`dblclick`,n,xr),L(`contextmenu`,n,wr),X(e,t)};G(n,e=>{Q(yr)===null?e(a,-1):e(i)});var s=g(n,2),c=j(s);dS(c,{size:12,"aria-hidden":`true`}),H(s);var l=g(s,2),d=e=>{var t=Irt();X(e,t)};G(l,e=>{Oe()&&e(d)}),O(()=>{r(s,1,`shrink-0 rounded-sm p-0.5 ${Oe()?`text-amber-400 hover:bg-gray-700`:`text-gray-500`}`),s.disabled=!Oe(),b(s,`title`,Oe()?`Save "`+o().name+`" (Ctrl+S)`:`Nothing to save - this scene matches the version its name points at`),b(s,`aria-label`,Oe()?`Save scene`:`Nothing to save`)}),L(`click`,s,Or),X(e,t)};G(s,e=>{o()?.name&&e(c)}),H(t),X(e,t)};G(n,e=>{Q(Ht)||e(i)}),X(e,t)},$e=e=>{We(k4(e,{key:`explorer`,primaryLabel:`folder tree`,secondaryModes:[{key:`props`,icon:`â`,label:`Properties`},{key:`settings`,icon:`â`,label:`Settings`}],topbar:e=>{var t=fe(),n=N(t),i=e=>{var t=Hrt(),n=j(t);B(n,19,()=>Q(Mr),e=>e.id??`root`,(e,t,n)=>{var i=Brt(),a=N(i),o=e=>{var t=zrt();X(e,t)};G(a,e=>{Q(n)>0&&e(o)});var s=g(a,2),c=f(s,!0);O(()=>{r(s,1,`rounded-sm px-1 py-0.5 hover:bg-gray-700 ${Q(n)===Q(Mr).length-1?`text-white`:``}`),Y(c,Q(t).label)}),L(`click`,s,()=>zs(Q(t).id)),X(e,i)});var i=g(n,2),a=e=>{var t=Vrt(),n=j(t);wS(n,{name:`history`,size:13,"aria-hidden":`true`}),H(t),O(()=>{b(t,`aria-pressed`,ie()),t.disabled=!he(),b(t,`title`,he()?`Show cleaned-up files â the record of deleti
2485ons whose bytes are gone from this device (`+Q(li)+` of `+Q(ui)+` can be put back)`:`The deleted files log is switched off in File settings`)}),L(`click`,t,()=>Q4.update(e=>!e)),X(e,t)};G(i,e=>{Q(mi)&&e(a)}),H(t),X(e,t)};G(n,e=>{Q(mt)&&e(i)}),X(e,t)},primary:e=>{var t=Yrt(),n=j(t),i=j(n),a=g(i,2);B(a,5,te,e=>e.id,(e,t)=>{var n=Wrt(),i=N(n),a=j(i),o=f(a,!0),s=g(a,2),c=j(s);{let e=q(()=>Q(t).missing?`text-amber-400`:`text-indigo-300`);$x(c,{size:16,get class(){return`mr-1.5 w-4 text-center ${Q(e)??``}`},"aria-hidden":`true`})}var l=g(c,1,!0),u=g(l),d=e=>{var t=Urt();X(e,t)};G(u,e=>{Q(t).dirty&&e(d)}),H(s);var p=g(s,2),m=j(p);dS(m,{size:14,"aria-hidden":`true`}),H(p);var h=g(p,2),_=j(h);fS(_,{size:14,"aria-hidden":`true`}),H(h),H(i);var v=g(i,2),y=e=>{var n=I3(),i=N(n);B(i,17,()=>ra(Q(t)),e=>e.folder.id,(e,n)=>{var i=I3(),a=N(i),o=e=>{Re(e,()=>Q(n).depth+1)},s=e=>{var t=F3(),i=j(t),a=f(i,!0),o=g(i,2),s=j(o);nS(s,{size:16,class:`ico-folder mr-1.5 w-4 text-center`,"aria-hidden":`true`});var c=g(s,1,!0);H(o),H(t),O(e=>{Ze(t,`padding-left: ${16+Q(n).depth*14}px`),b(t,`aria-selected`,A()===Q(n).folder.id),b(i,`aria-label`,Q(n).hasChildren?`Expand or collapse`:`No subfolders`),Y(a,e),b(o,`data-vol-folder`,Q(n).folder.id),r(o,1,`flex-1 truncate rounded px-1.5 py-1 text-left ${A()===Q(n).folder.id?`bg-primary-700 text-white`:`text-gray-300 hover:bg-gray-700`} ${Q(dn)===Q(n).folder.id?`outline-solid outline-2 outline-primary-500`:``}`),Y(c,Q(n).folder.name)},[()=>Q(n).hasChildren?Q(pn).has(Q(n).folder.id)?`â¾`:`â¸`:``]),Z(`dragover`,t,e=>oo(e,Q(n).folder.id)),Z(`dragleave`,t,()=>I(dn,null)),Z(`drop`,t,e=>ao(e,Q(n).folder.id)),L(`click`,i,()=>mn(Q(n).folder.id)),Z(`dragstart`,o,e=>ps(e,Q(n).folder)),L(`contextmenu`,o,e=>so(e,Q(n).folder)),L(`click`,o,()=>zs(Q(n).folder.id)),X(e,t)};G(a,e=>{Q(fn)?.mode===`rename`&&!Q(fn).inGrid&&Q(fn).volumeId===Q(t).id&&Q(fn).folderId===Q(n).folder.folderId?e(o):e(s,-1)});var c=g(a,2),l=e=>{Re(e,()=>Q(n).depth+2)};G(c,e=>{Q(fn)?.mode===`create`&&!Q(fn).inGrid&&Q(fn).volumeId===Q(t).id&&Q(fn).parentId===Q(n).folder.folderId&&e(l)}),X(e,i)});var a=g(i,2),o=e=>{Re(e,()=>1)};G(a,e=>{Q(fn)?.mode===`create`&&!Q(fn).inGrid&&Q(fn).volumeId===Q(t).id&&Q(fn).parentId===null&&e(o)}),X(e,n)},x=q(()=>Q(pn).has(AZ(Q(t).id)));G(v,e=>{Q(x)&&e(y)}),O((e,n,i)=>{b(a,`aria-label`,e),Y(o,n),b(s,`data-mount`,Q(t).id),r(s,1,`min-w-0 flex-1 truncate rounded px-1.5 py-1 text-left ${Q(Qn)?.volumeId===Q(t).id?`bg-primary-700 text-white`:`text-gray-300 hover:bg-gray-700`} ${i??``}`),b(s,`title`,(Q(t).missing?`The saved project behind this mount is gone â these rows are what was read before it went`:`A saved project, browsed from here. Your open project is not affected.`)+(Q(t).dirty?` â unsaved changes`:``)),Y(l,Q(t).name),b(p,`id`,`mount-save-`+Q(t).id),r(p,1,`shrink-0 rounded px-1 py-1 ${Q(t).dirty?`text-amber-300 hover:bg-gray-700`:`cursor-default text-gray-600`}`),p.disabled=!Q(t).dirty,b(p,`aria-label`,`Save `+Q(t).name),b(p,`title`,Q(t).dirty?`Write these files back into the saved project`:`No unsaved changes`),b(h,`id`,`mount-unmount-`+Q(t).id),b(h,`aria-label`,`Unmount `+Q(t).name)},[()=>Q(pn).has(AZ(Q(t).id))?`Collapse`:`Expand`,()=>Q(t).folders.length?Q(pn).has(AZ(Q(t).id))?`â¾`:`â¸`:``,()=>Q(dn)===AZ(Q(t).id)?`outline-solid outline-2 outline-primary-500`:``]),L(`click`,a,()=>mn(AZ(Q(t).id))),L(`contextmenu`,s,e=>ga(e,Q(t))),Z(`dragover`,s,e=>oo(e,AZ(Q(t).id))),Z(`dragleave`,s,()=>I(dn,null)),Z(`drop`,s,e=>ao(e,AZ(Q(t).id))),L(`click`,s,()=>zs(AZ(Q(t).id))),L(`click`,p,()=>void $Z(Q(t).id)),L(`click`,h,()=>la(Q(t))),X(e,n)}),H(a),H(n);var o=g(n,2),s=j(o);YOe(j(s),{size:16,class:`mr-1.5 w-4 text-center text-gray-400`,"aria-hidden":`true`}),W(),H(s);var c=g(s,2),l=e=>{Re(e,()=>0)};G(c,e=>{Q(fn)?.mode===`create`&&!Q(fn).inGrid&&Q(fn).parentId===null&&e(l)});var u=g(c,2);B(u,17,()=>Q(nr),e=>e.folder.id,(e,t)=>{var n=I3(),i=N(n),a=e=>{Re(e,()=>Q(t).depth)},o=e=>{var n=F3(),i=j(n),a=f(i,!0),o=g(i,2),s=j(o);nS(s,{size:16,class:`ico-folder mr-1.5 w-4 text-center`,"aria-hidden":`true`});var c=g(s,1,!0);H(o),H(n),O((e,s)=>{Ze(n,`padding-left: ${2+Q(t).depth*14}px`),b(n,`aria-selected`,A()===Q(t).folder.id),b(i,`title`,e),Y(a,s),r(o,1,`flex-1 rounded px-1.5 py-1 text-left ${A()===Q(t).folder.id?`bg-primary-700 text-white`:`text-gray-300 hover:bg-gray-700`} ${Q(dn)===Q(t).folder.id?`outline-solid outline-2 outline-primary-500`:``}`),Y(c,Q(t).folder.name)}
2485,[()=>Q(t).hasChildren?Q(pn).has(Q(t).folder.id)?`Collapse`:`Expand`:``,()=>Q(t).hasChildren?Q(pn).has(Q(t).folder.id)?`â¾`:`â¸`:``]),Z(`dragover`,n,e=>oo(e,Q(t).folder.id)),Z(`dragleave`,n,()=>I(dn,null)),Z(`drop`,n,e=>ao(e,Q(t).folder.id)),L(`click`,i,()=>mn(Q(t).folder.id)),Z(`dragstart`,o,e=>ps(e,Q(t).folder)),L(`contextmenu`,o,e=>so(e,Q(t).folder)),L(`click`,o,()=>zs(Q(t).folder.id)),L(`dblclick`,o,()=>mn(Q(t).folder.id)),X(e,n)};G(i,e=>{Q(fn)?.mode===`rename`&&!Q(fn).inGrid&&Q(fn).folderId===Q(t).folder.id?e(a):e(o,-1)});var s=g(i,2),c=e=>{Re(e,()=>Q(t).depth+1)};G(s,e=>{Q(fn)?.mode===`create`&&!Q(fn).inGrid&&Q(fn).parentId===Q(t).folder.id&&e(c)}),X(e,n)}),H(o);var d=g(o,2),p=j(d),m=g(p,2),h=g(m,2),_=j(h),v=j(_);cS(v,{size:16,class:`ico-prefab mr-1.5 w-4 text-center`,"aria-hidden":`true`}),W(),H(_);var y=g(_,2),x=j(y);bS(x,{size:16,class:`mr-1.5 w-4 text-center text-gray-400`,"aria-hidden":`true`});var S=g(x);H(y);var C=g(y,2),w=e=>{var t=I3(),n=N(t);B(n,17,()=>Q(Dn),e=>e.name,(e,t)=>{var n=fe(),i=N(n),a=e=>{Re(e,()=>1)},o=e=>{var n=L3(),i=j(n);bS(i,{size:16,class:`mr-1.5 w-4 text-center text-gray-500`,"aria-hidden":`true`});var a=g(i,1,!0);H(n),O(()=>{b(n,`data-pack`,Q(t).name),r(n,1,`whitespace-nowrap rounded px-2 py-1 text-left ${Q(dn)===`pack:`+Q(t).name?`bg-primary-500/20 text-white ring-1 ring-primary-400`:A()===`pack:`+Q(t).name?`bg-primary-700 text-white`:`text-gray-400 hover:bg-gray-700`}`),b(n,`title`,Q(t).source==="default"?(Q(t).license?Q(t).title+` · `+Q(t).license:Q(t).title)+` â built in`:(Q(t).license?Q(t).title+` · `+Q(t).license:Q(t).title)+` â drop library files or folders here to add them`),Y(a,Q(t).title)}),L(`contextmenu`,n,e=>Vn(e,Q(t))),Z(`dragover`,n,e=>{no(e)&&Q(t).source!=="default"&&(e.preventDefault(),e.stopPropagation(),I(dn,`pack:`+Q(t).name))}),Z(`dragleave`,n,()=>I(dn,null)),Z(`drop`,n,e=>void gs(e,Q(t))),L(`click`,n,()=>zs(`pack:`+Q(t).name)),X(e,n)};G(i,e=>{Q(fn)?.mode===`rename-pack`&&Q(fn).packName===Q(t).name?e(a):e(o,-1)}),X(e,n)});var i=g(n,2),a=e=>{var t=Grt();X(e,t)};G(i,e=>{Q(Dn).length===0&&e(a)}),X(e,t)};G(C,e=>{Q(_n)&&e(w)});var T=g(C,2),E=j(T);Yx(E,{size:16,class:`mr-1.5 w-4 text-center text-gray-400`,"aria-hidden":`true`});var D=g(E);H(T);var k=g(T,2),M=e=>{var t=fe(),n=N(t);B(n,16,()=>[`audio`,`config`,`textures`],Be,(e,t)=>{var n=L3(),i=j(n);nS(i,{size:16,class:`ico-folder mr-1.5 w-4 text-center`,"aria-hidden":`true`});var a=g(i);H(n),O(e=>{r(n,1,`whitespace-nowrap rounded px-2 py-1 text-left ${A()===`scene:`+t?`bg-primary-700 text-white`:`text-gray-400 hover:bg-gray-700`}`),Y(a,`${t??``} (${e??``})`)},[()=>R().filter(e=>e.group===t).length]),L(`click`,n,()=>zs(`scene:`+t)),X(e,n)}),X(e,t)};G(k,e=>{Q(hn)&&e(M)});var ne=g(k,2),P=e=>{var t=Jrt(),n=j(t);wS(n,{name:`trash-2`,size:16,class:`mr-1.5 w-4 text-center text-gray-400`,"aria-hidden":`true`});var i=g(n,2),a=e=>{var t=Krt();X(e,t)},o=e=>{var t=qrt(),n=f(t);O(()=>Y(n,`(${Q(fi)??``})`)),X(e,t)};G(i,e=>{Q(rn)&&!Q(fi)?e(a):e(o,-1)}),H(t),O(()=>{r(t,1,`whitespace-nowrap rounded px-2 py-1 text-left ${Q(on)?`bg-red-600/30 text-white ring-1 ring-red-400`:Q(rr).inBin?`bg-primary-700 text-white`:`text-gray-300 hover:bg-gray-700`}`),b(t,`title`,(he()&&Q(ui)!==Q(li)?Q(ui)+` deleted, of which `+Q(li)+` can still be restored. `:``)+`Files removed from the project â restore them, or free the disk. Drop files or folders here to delete them.`)}),L(`click`,t,()=>zs(`deleted`)),L(`contextmenu`,t,Xo),Z(`dragover`,t,e=>{!Q(an)&&no(e)&&(e.preventDefault(),e.stopPropagation(),I(on,!0))}),Z(`dragleave`,t,()=>I(on,!1)),Z(`drop`,t,e=>void vs(e)),X(e,t)};G(ne,e=>{Q(pi)&&e(P)}),H(h),H(d),H(t),O(()=>{Ze(a,`max-height: ${Q(Xi)??``}px`),r(s,1,`whitespace-nowrap rounded px-2 py-1 text-left ${A()===null&&!Q(Nt)?`bg-primary-700 text-white`:`text-gray-300 hover:bg-gray-700`} ${Q(dn)===`root`?`outline-solid outline-2 outline-primary-500`:``}`),r(m,1,`my-0.5 h-1.5 shrink-0 cursor-ns-resize border-t border-gray-700/40 ${Q(Ji)?`bg-primary-600/60`:`hover:bg-gray-600/60`}`),Ze(h,`max-height: ${Q(Yi)??``}px`),r(_,1,`whitespace-nowrap rounded px-2 py-1 text-left ${Q(dn)===`prefabs`?`bg-primary-500/20 ring-1 ring-primary-400 text-white`:A()===`prefabs`?`bg-primary-700 text-white`:`text-gray-300 hover:bg-gray-700`}`),r(y,1,`whitespace-nowrap rounded px-2 py-1 text-left ${A()===`packs`?`bg-primary-700 text-white`:`text-gray-300 hover:bg-gray-700`}`),Y(S,`Packs ${Q(_n)?`â¾`:`â¸`}`),r(T,1,`whitespace-nowrap rounded px-2 py-1 text-left ${A()===`scene`?`bg-primary-700 text-white`:`text-gray-300 hover:bg-gray-700`}`),Y(D,`Scene ${Q(hn)?`â¾`:`â¸`}`)}),L(`click`,i,ia),ee(n,`clientHeight`,e=>I(Zi,e)),Z(`dragover`,s,e=>oo(e,`root`)),Z(`dragleave`,s,()=>I(dn,null)),Z(`drop`,s,e=>ao(e,null)),L(`click`,s,()=>zs(null)),L(`click`,p,()=>ji(typeof A()==`string`&&(A()===`prefabs`||A().startsWith(`scene`))?null:A())),L(`pointerdown`,m,$i),L(`pointermove`,m,ea),L(`pointerup`,m,ta),Z(`pointercancel`,m,ta),L(`dblclick`,m,na),Z(`dragover`,_,e=>{no(e)&&(e.preventDefault(),e.stopPropagation(),I(dn,`prefabs`))}),Z(`dragleave`,_,()=>I(dn,null)),Z(`drop`,_,e=>void _s(e)),L(`click`,_,()=>zs(`prefabs`)),L(`click`,y,()=>zs(`packs`)),L(`dblclick`,y,vn),L(`click`,T,()=>zs(`scene`)),L(`dblclick`,T,gn),ee(t,`clientHeight`,e=>I(qi,e)),X(e,t)},main:e=>{var t=Dit(),n=j(t),i=e=>{var t=Qrt(),n=j(t),i=j(n);{let e=q(()=>Q(_a).icon??`trash-2`);wS(i,{get name(){return Q(e)},size:14})}H(n);var a=g(n,2),o=j(a),s=f(o,!0),c=g(o,2),l=f(c,!0);H(a);var u=g(a,2),d=f(u,!0);ne(u,e=>Za?.(e));var p=g(u,2),m=e=>{var t=Xrt(),n=f(t,!0);O(()=>Y(n,Q(_a).altLabel)),L(`click`,t,Da),X(e,t)};G(p,e=>{Q(_a).altLabel&&e(m)});var h=g(p,2),_=g(h,2),v=e=>{var t=Zrt();L(`click`,t,va),X(e,t)};G(_,e=>{Q(_a).noSettings||e(v)}
2485),H(t),O(()=>{r(n,1,`ex-confirm-icon ${Q(_a).safe?`ex-confirm-icon--safe`:``}`,`svelte-w8o4wk`),Y(s,Q(_a).title),Y(l,Q(_a).detail),r(u,1,`ex-confirm-yes ${Q(_a).safe?`ex-confirm-safe`:``}`,`svelte-w8o4wk`),Y(d,Q(_a).confirmLabel)}),L(`click`,t,e=>e.stopPropagation()),L(`pointerdown`,t,e=>e.stopPropagation()),L(`keydown`,t,e=>{e.key===`Escape`&&(e.stopPropagation(),Ma())}),L(`click`,u,ba),L(`click`,h,Ma),X(e,t)},c=e=>{var t=eit(),n=j(t),r=j(n);ES(r,{size:14,"aria-hidden":`true`}),H(n);var i=g(n,2),a=j(i),o=j(a),s=e=>{var t=Te();O(()=>Y(t,`Share your ${Q(Ra).items.length??``} file${Q(Ra).items.length===1?``:`s`} with the session?`)),X(e,t)},c=e=>{var t=Te();O(()=>Y(t,`Share â${Q(Ra).items[0].name??``}â with the session?`)),X(e,t)},l=e=>{var t=Te();O(()=>Y(t,`Share ${Q(Ra).items.length??``} new files with 2486 the session?`)),X(e,t)};G(o,e=>{Q(Ra).kind===`connect`?e(s):Q(Ra).items.length===1?e(c,1):e(l,-1)}),H(a);var u=g(a,2),d=f(u,!0);H(i);var p=g(i,2),m=j(p);v(m),W(),H(p);var h=g(p,2),_=f(h,!0);ne(h,e=>Za?.(e));var y=g(h,2),b=g(y,2),x=e=>{var t=$rt(),n=f(t,!0);O(()=>Y(n,Q(Ua)?`Really replace my library?`:`Stash mine`)),L(`click`,t,()=>{if(!Q(Ua)){I(Ua,!0);return}YS(`stash`)}),X(e,t)};G(b,e=>{Q(Ra).kind===`connect`&&e(x)});var S=g(b,2);H(t),O(()=>{Y(d,Q(Ra).kind===`connect`?`They are only on this device â only shared files are visible to peers.`:`Only shared files are visible to peers â everything else stays on this device.`),w(m,Q(Ga)),Y(_,Q(Ra).items.length===1?`Share`:`Share all`)}),L(`click`,t,e=>e.stopPropagation()),L(`pointerdown`,t,e=>e.stopPropagation()),L(`keydown`,t,e=>{e.key===`Escape`&&(e.stopPropagation(),Xa(`keep`))}),L(`change`,m,e=>I(Ga,e.currentTarget.checked,!0)),L(`click`,h,()=>Xa(`share`)),L(`click`,y,()=>Xa(`keep`)),L(`click`,S,va),X(e,t)};G(n,e=>{Q(_a)?e(i):Q(Ra)&&e(c,1)});var l=g(n,2),u=e=>{var t=fe(),n=N(t),r=e=>{var t=tit();dz(j(t),{size:16,class:`animate-spin`,"aria-hidden":`true`}),W(),H(t),X(e,t)},i=e=>{var t=nit(),n=j(t);VOe(j(n),{size:16,"aria-hidden":`true`}),H(n);var r=g(n,2),i=f(r),a=g(r,2),o=j(a);iS(o,{size:16,class:`mr-1`,"aria-hidden":`true`});var s=g(o,1,!0);H(a),H(t),O(()=>{Y(i,`"${Q(An).title??``}" installs into your local library.`),a.disabled=Q(Rn),Y(s,Q(Rn)?`Installingâ¦`:`Install ${Q(An).title}`)}),L(`click`,a,()=>zn(Q(An))),X(e,t)},a=e=>{var t=rit(),n=f(t,!0);O(e=>Y(n,e),[()=>Q(Qn)?Q($n)?.missing?`The saved project behind this mount is gone â unmount it, or save it back to store it again.`:`This folder of the mounted project is empty.`:A()===`prefabs`?`No prefabs yet â right-click an object and Save as prefab.`:A()===`packs`?`No packs. Right-click here to import a pack (.zip) or load one from a URL.`:typeof A()==`string`&&A().startsWith(`pack:`)?`This pack has no items.`:typeof A()==`string`&&A().startsWith(`scene`)?`No shared assets in this scene group yet.`:`Drop images, audio, text or 3D files here to import them.`]),X(e,t)};G(n,e=>{Q(An)&&ke()?e(r):Q(An)&&Q(An).source==="default"&&Q(An).zip?e(i,1):e(a,-1)}),X(e,t)},d=e=>{var t=wit();let n;var i=j(t),c=e=>{var t=sit(),n=j(t),i=e=>{var t=iit(),n=j(t),i=j(n),a=e=>{nS(e,{size:14,"aria-hidden":`true`})},o=e=>{wS(e,{get name(){return Jn.scene},size:14})};G(i,e=>{Q(Ki)===`create`?e(a):e(o,-1)}),H(n);var s=g(n,2);ze(s),H(t),O(()=>r(n,1,M(Q(Ki)===`create`?`ico-folder`:`text-gray-400`))),X(e,t)};G(n,e=>{Q(Ki)&&e(i)});var a=g(n,2);let o;var s=j(a);Ye(s);var c=g(s),l=e=>{var t=I3(),n=N(t),r=e=>{var t=R3();B(t,21,()=>Q(ci).filter(e=>e.kind===`folder`),e=>e.folder.id,(e,t)=>{Je(e,()=>Q(t))}),H(t),X(e,t)};G(n,e=>{Q(dr).length&&e(r)});var i=g(n,2);B(i,17,()=>Q(hi),e=>e.id,(e,t)=>{var n=ait(),r=j(n),i=j(r),a=j(i),o=j(a),s=f(o,!0),c=g(o),l=g(c),u=f(l,!0);H(a),H(i),H(r);var d=g(r),p=e=>{var n=fe(),r=N(n);B(r,17,()=>Q(t).rows,e=>e.id,(e,t)=>{Je(e,()=>({kind:`item`,item:Q(t)}))}),X(e,n)},m=q(()=>!Q(gi).has(Q(t).id));G(d,e=>{Q(m)&&e(p)}),H(n),O(e=>{b(i,`colspan`,Q(Ur).length+1),Y(s,e),Y(c,` ${Q(t).name??``}`),Y(u,Q(t).rows.length)},[()=>Q(gi).has(Q(t).id)?`â¸`:`â¾`]),L(`click`,a,()=>_i(Q(t).id)),X(e,n)}),X(e,t)},u=e=>{var t=R3();B(t,21,()=>Q(ci),e=>e.kind===`folder`?`f:`+e.folder.id:`i:`+e.item.id,(e,t)=>{Je(e,()=>Q(t))}),H(t),X(e,t)};G(c,e=>{Q(hi)?e(l):e(u,-1)}),H(a);var d=g(a,2),p=e=>{var t=oit();X(e,t)};G(d,e=>{!Q(ci).length&&!Q(Ki)&&e(p)}),H(t),O(()=>
2486o=Ze(a,``,o,{"min-width":`${Q(Gr)??``}px`})),X(e,t)},l=e=>{var t=Sit(),n=j(t),i=e=>{var t=cit(),n=j(t),i=j(n),a=e=>{nS(e,{size:32,"aria-hidden":`true`})},o=e=>{wS(e,{get name(){return Jn.scene},size:32})};G(i,e=>{Q(Ki)===`create`?e(a):e(o,-1)}),H(n);var s=g(n,2);ze(s),H(t),O(()=>r(n,1,`flex h-14 w-14 items-center justify-center ${Q(Ki)===`create`?`ico-folder`:`text-gray-400`}`)),X(e,t)};G(n,e=>{Q(Ki)&&e(i)});var c=g(n,2),l=e=>{var t=fe(),n=N(t);B(n,17,()=>Q(mr),e=>e.id,(e,t)=>{var n=lit(),i=j(n),a=e=>{var n=P3();O(e=>{r(n,1,`explorer-share-dot absolute bottom-1 left-1 h-2 w-2 rounded-full ${Q(t).share===`mine`?`bg-teal-400`:`bg-sky-400`}`),b(n,`title`,e)},[()=>Q(t).share===`mine`?`Shared by you â peers see this folder, and anything you add to it`:`Shared`+(Yt(Q(t))?` by `+Yt(Q(t)):``)+` â a peer offered this folder`]),X(e,n)};G(i,e=>{Q(Jt)&&(Q(t).share===`mine`||Q(t).share===`peer`)&&e(a)});var o=g(i,2),s=j(o);nS(s,{size:32,"aria-hidden":`true`}),H(o);var c=g(o,2),l=e=>{ze(e)},u=e=>{var n=N3(),i=f(n,!0);O(e=>{r(n,1,`w-full overflow-hidden text-ellipsis whitespace-nowrap text-center text-[10px] ${e??``}`),Y(i,Q(t).name)},[()=>Zt(Q(t))?`text-gray-500`:`text-gray-300`]),X(e,n)};G(c,e=>{Q(fn)?.mode===`rename`&&Q(fn).inGrid&&(Q(fn).cardId??Q(fn).folderId)===Q(t).id?e(l):e(u,-1)}),H(n),O((e,i)=>{b(n,`data-card-id`,Q(t).id),r(n,1,`explorer-folder-card relative flex cursor-pointer flex-col items-center gap-1 rounded border p-1.5 ${e??``} ${Q(t).deletedNode?`ex-deleted-node`:``} ${Q(t).ghost?`ex-deleted-ghost`:``}`,`svelte-w8o4wk`),b(n,`title`,Q(t).ghost?`Still in Library â holds deleted files`:Q(t).name),b(n,`draggable`,!(Q(t).deletedNode&&(Q(t).ghost||!Q(t).row))),r(o,1,`flex h-14 w-14 items-center justify-center ${i??``}`,`svelte-w8o4wk`)},[()=>Q(dn)===Q(t).id?`border-primary-500 bg-primary-500/10`:Ti(Q(vi),null,Q(gt),Q(t).id),()=>Zt(Q(t))?$t:`ico-folder`]),Z(`dragstart`,n,e=>ps(e,Q(t))),Z(`dragover`,n,e=>oo(e,Q(t).id)),Z(`dragleave`,n,()=>I(dn,null)),Z(`drop`,n,e=>ao(e,Q(t).id)),L(`contextmenu`,n,e=>so(e,Q(t),!1)),L(`click`,n,e=>Ns(e,Q(t))),L(`dblclick`,n,()=>zs(Q(t).id)),L(`keydown`,n,e=>e.key===`Enter`&&zs(Q(t).id)),X(e,n)}),X(e,t)};G(c,e=>{!Q(Nt)&&A()!==`prefabs`&&e(l)});var u=g(c,2);B(u,17,()=>Q(hr),e=>e.id,(e,t)=>{var n=xit();let i,c;var l=j(n),u=e=>{var t=uit();X(e,t)};G(l,e=>{Q(vr)&&Q(t).hash===Q(vr)&&e(u)});var d=g(l,2),p=e=>{var n=dit();O(()=>b(n,`title`,`In the mounted project â`+(Q(t).volumeName??``)+`â â not in your library`)),X(e,n)};G(d,e=>{Q(t).volumeItem&&e(p)});var m=g(d,2),h=e=>{var t=fit();X(e,t)};G(m,e=>{Q(t).remoteScene&&e(h)});var _=g(m,2),v=e=>{var n=P3();O((e,t)=>{r(n,1,`explorer-remote-dot absolute right-1 top-1 h-2.5 w-2.5 rounded-full ${e??``}`),b(n,`title`,t)},[()=>D().has(Q(t).hash)?`bg-red-400`:De().has(Q(t).hash)?`animate-pulse bg-amber-400`:`bg-sky-400`,()=>De().has(Q(t).hash)?`Downloading from peersâ¦`:tn(Q(t))]),X(e,n)},y=e=>{var n=P3();O((e,t)=>{r(n,1,`explorer-share-dot absolute bottom-1 left-1 h-2 w-2 rounded-full ${e??``}`),b(n,`title`,t)},[()=>Wt(Q(t))===`mine`?`bg-teal-400`:`bg-sky-400`,()=>tn(Q(t))]),X(e,n)},x=q(()=>Q(Jt)&&Gt(Q(t))),S=e=>{var n=pit();O(e=>b(n,`title`,e),[()=>tn(Q(t))]),X(e,n)};G(_,e=>{Q(t).remoteItem?e(v):Q(x)?e(y,1):Q(Jt)&&Q(t).wasShared&&e(S,2)});var C=g(_,2),w=e=>{var n=mit();O(e=>b(n,`title`,e),[()=>`An update of "`+et(T(),Q(t).hash)+`" exists â this file is an older version`]),X(e,n)},E=q(()=>Q(t).kind===`scene`&&!Q(t).remoteScene&&et(T(),Q(t).hash));G(C,e=>{Q(E)&&e(w)});var k=g(C,2),A=e=>{let n=q(()=>tt(a(),o(),s(),Q(t)));var r=fe(),i=N(r),c=e=>{var t=_it(),r=j(t),i=e=>{var t=hit();X(e,t)};G(r,e=>{Q(n).me&&e(i)});var a=g(r,2);B(a,16,()=>Q(n).peerIds.slice(0,3),e=>e,(e,t)=>{var n=git();let r;O(e=>r=Ze(n,``,r,{background:e}),[()=>gh(t)]),X(e,n)});var o=g(a,2),s=f(o,!0);H(t),O((e,n,r)=>{b(t,`title`,e),b(t,`data-here`,n),Y(s,r)},[()=>rt(Q(n)),()=>it(Q(n)),()=>it(Q(n))]),X(e,t)};G(i,e=>{(Q(n).me||Q(n).peerIds.length)&&e(c)}),X(e,r)};G(k,e=>{Q(t).kind===`scene`&&e(A)});var ee=g(k,2),M=e=>{var n=vit();gz(j(n),{size:9,"aria-hidden":`true`}),H(n),O(e=>{b(n,`title`,e),b(n,`data-behavior`,Q(t).behavior.type)},[()=>Wn(Q(t).behavior)]),X(e,n)};G(ee,e=>{Q(t).behavior&&e(M)});var te=g(ee,2),ne=e=>{var n=fe(),i=N(n),a=e=>{var n=yit();O(e=>{b(n,`src`,e),b(n,`alt`,Q(t).name)},[()=>
2486Gn(Q(t))]),Z(`error`,n,()=>Kn(Q(t))),Z(`load`,n,e=>qn(Q(t),e.currentTarget.src)),ce(n),X(e,n)},o=q(()=>Gn(Q(t))),s=e=>{var n=M3(),i=j(n);{let e=q(()=>Jn[Q(t).kind]??`package`);wS(i,{get name(){return Q(e)},size:28})}H(n),O(()=>r(n,1,`flex h-14 w-14 items-center justify-center rounded-sm bg-gray-700 ${Zn[Q(t).kind]??`text-gray-400`??``}`,`svelte-w8o4wk`)),X(e,n)};G(i,e=>{Q(o)?e(a):e(s,-1)}),X(e,n)},P=e=>{var n=bit();O((e,i)=>{b(n,`src`,e),b(n,`alt`,Q(t).name),r(n,1,`h-14 w-14 rounded-sm object-cover ${i??``}`,`svelte-w8o4wk`)},[()=>en(Q(t)),()=>Xt(Q(t))?Qt:``]),X(e,n)},re=q(()=>en(Q(t))),ie=e=>{var n=M3(),i=j(n);{let e=q(()=>Jn[Q(t).kind]??`package`);wS(i,{get name(){return Q(e)},size:28})}H(n),O(e=>r(n,1,`flex h-14 w-14 items-center justify-center rounded-sm bg-gray-700 ${e??``}`,`svelte-w8o4wk`),[()=>Xt(Q(t))?$t:Zn[Q(t).kind]??`text-gray-400`]),X(e,n)};G(te,e=>{Q(t).packEntry?e(ne):Q(re)?e(P,1):e(ie,-1)});var F=g(te,2),ae=e=>{ze(e)},I=e=>{var n=N3(),i=f(n,!0);O((e,a)=>{r(n,1,`w-full overflow-hidden text-ellipsis whitespace-nowrap text-center text-[10px] ${e??``}`),b(n,`title`,a),Y(i,Q(t).name)},[()=>Xt(Q(t))?`text-gray-500`:`text-gray-300`,()=>Q(t).name+` â `+tn(Q(t))]),X(e,n)};G(F,e=>{Q(fn)?.mode===`rename-item`&&Q(fn).itemId===Q(t).id||Q(fn)?.mode===`rename-scene`&&Q(fn).itemId===Q(t).id||Q(fn)?.mode===`rename-prefab`&&Q(fn).prefabId===Q(t).prefabId?e(ae):e(I,-1)}),H(n),O((e,a,o)=>{b(n,`data-card-id`,Q(t).id),i=r(n,1,`explorer-card group relative flex cursor-grab flex-col items-center gap-1 rounded border p-1.5 ${e??``} ${Q(vr)&&Q(t).hash===Q(vr)?`explorer-open-scene ring-1 ring-emerald-400`:``} ${Q(t).remoteScene||Q(t).remoteItem||Q(t).deletedEntry&&!Q(t).restorable?`explorer-remote opacity-60`:``}`,`svelte-w8o4wk`,i,{"opacity-50":a}),b(n,`title`,Q(t).name),b(n,`data-cut`,o),c=Ze(n,``,c,{"touch-action":Q(bs)?`none`:`pan-y`})},[()=>Ti(Q(vi),J(),Q(gt),Q(t).id),()=>!!xe()&&A3(Q(t).id),()=>xe()&&A3(Q(t).id)?`1`:void 0]),Z(`dragstart`,n,e=>fs(e,Q(t))),L(`pointerdown`,n,e=>ks(e,Q(t))),L(`pointermove`,n,As),L(`pointerup`,n,js),L(`contextmenu`,n,e=>Ho(e,Q(t))),L(`click`,n,e=>Ms(e,Q(t))),L(`dblclick`,n,()=>tc(Q(t))),X(e,n)}),H(t),X(e,t)};G(i,e=>{me()===`list`?e(c):e(l,-1)});var u=g(i,2),d=e=>{var t=Cit();E3(j(t),{mode:`pane`,get open(){return Q(It)},set open(e){I(It,e,!0)}}),H(t),X(e,t)};G(u,e=>{Q(It)&&e(d)}),H(t),O(()=>n=r(t,1,`ex-split svelte-w8o4wk`,null,n,{"ex-split-on":Q(It)})),X(e,t)};G(l,e=>{!Q(Ki)&&Q(mr).length===0&&Q(hr).length===0?e(u):e(d,-1)});var p=g(l,2),m=e=>{var t=Tit();O(()=>Ze(t,`left: ${Q(Ws).left??``}px; top: ${Q(Ws).top??``}px; width: ${Q(Ws).width??``}px; height: ${Q(Ws).height??``}px`)),X(e,t)};G(p,e=>{Q(Ws)&&e(m)});var h=g(p,2),_=e=>{var t=Eit();O(()=>Ze(t,`top: ${Q(sn)??``}px; height: ${Q(cn)??``}px`)),X(e,t)};G(h,e=>{Q(nn)&&e(_)}),H(t),We(t,e=>I(si,e),()=>Q(si)),L(`contextmenu`,t,ts),L(`click`,t,Xs),L(`pointerdown`,t,Ks),L(`keydown`,t,ki),X(e,t)},secondary:(e,t=qe)=>{var n=fe(),i=N(n),a=e=>{var t=$it(),n=j(t),i=e=>{var t=kit(),n=j(t),r=j(n),i=j(r);bS(i,{size:18,"aria-hidden":`true`}),H(r);var a=g(r,2),o=f(a,!0);H(n);var s=g(n,2),c=e=>{var t=z3(),n=f(t);O(e=>Y(n,`License: ${e??``}`),[()=>Pm(Q(An).license)]),X(e,t)};G(s,e=>{Q(An).license&&e(c)});var l=g(s,2),u=e=>{var t=z3(),n=f(t,!0);O(()=>Y(n,Q(An).copyright)),X(e,t)};G(l,e=>{Q(An).copyright&&e(u)});var d=g(l,2),p=g(d,2),m=e=>{var t=Oit(),n=j(t);Jx(n,{size:14,"aria-hidden":`true`});var r=g(n);H(t),O((e,n)=>{b(t,`href`,e),Y(r,` ${n??``}`)},[()=>In(Q(An)),()=>Ln(In(Q(An)))]),X(e,t)},h=q(()=>In(Q(An)));G(p,e=>{Q(h)&&e(m)}),H(t),O(()=>Y(o,Q(An).title)),L(`click`,d,()=>Fn(Q(An))),X(e,t)};G(n,e=>{Q(An)&&e(i)});var a=g(n,2),o=e=>{var t=Xit(),n=N(t),i=j(n),a=e=>{var t=Ait();O(()=>b(t,`src`,Q(Nr).thumbnail)),X(e,t)},o=e=>{var t=M3(),n=j(t);{let e=q(()=>Jn[Q(Nr).kind]??`package`);wS(n,{get name(){return Q(e)},size:24})}H(t),O(()=>r(t,1,`flex h-12 w-12 items-center justify-center rounded-sm bg-gray-700 ${Zn[Q(Nr).kind]??`text-gray-400`??``}`,`svelte-w8o4wk`)),X(e,t)};G(i,e=>{Q(Nr).thumbnail?e(a):e(o,-1)});var s=g(i,2),c=f(s,!0);H(n);var l=g(n,2),u=e=>{var t=Nit(),n=g(j(t),2),r=g(j(n),2),i=f(r,!0);H(n);var a=g(n,2),o=g(j(a),2),s=f(o);H(a);var c=g(a,2),l=e=>{var t=jit(),n=g(j(t),2),r=f(n,!0);H(t),O(e=>Y(r,e),[()=>
2486new Date(Q(Ir).createdAt).toLocaleString()]),X(e,t)};G(c,e=>{Q(Ir)?.createdAt&&e(l)});var u=g(c,2),d=e=>{var t=Mit(),n=g(j(t),2),r=f(n,!0);H(t),O(e=>Y(r,e),[()=>new Date(Q(Ir).updatedAt).toLocaleString()]),X(e,t)};G(u,e=>{Q(Ir)?.updatedAt&&e(d)}),H(t),O((e,t)=>{Y(i,Q(Ir)?.objects??0),Y(s,`${e??``} tris · ${t??``} verts 2487 · ${Q(Ir)?.meshes??0??``} mesh${Q(Ir)?.meshes===1?``:`es`}`)},[()=>(Q(Ir)?.tris??0).toLocaleString(),()=>(Q(Ir)?.verts??0).toLocaleString()]),X(e,t)},d=e=>{var t=Lit(),n=j(t),r=g(j(n)),i=f(r,!0);H(n);var a=g(n,2),o=g(j(a)),s=f(o,!0);H(a);var c=g(a,2),l=g(j(c),2),u=f(l,!0);H(c);var d=g(c,2),p=g(j(d),2),m=f(p,!0);H(d);var h=g(d,2),_=g(j(h),2),v=f(_,!0);H(h);var y=g(h,2),x=e=>{var t=Pit(),n=g(j(t),2),r=f(n,!0);H(t),O(e=>Y(r,e),[()=>new Date(Q(Nr).createdAt).toLocaleString()]),X(e,t)};G(y,e=>{Q(Nr).createdAt&&e(x)});var S=g(y,2),C=e=>{var t=Fit(),n=g(j(t),2),r=f(n),i=g(n,2);H(t),O(e=>{b(n,`title`,Q(Nr).hash),Y(r,`${e??``}â¦`)},[()=>Q(Nr).hash.slice(0,16)]),L(`click`,i,()=>navigator.clipboard?.writeText(Q(Nr).hash)),X(e,t)};G(S,e=>{Q(Nr).hash&&e(C)});var w=g(S,2),T=e=>{var t=Iit(),n=g(j(t)),r=f(n,!0);H(t),O(()=>Y(r,Q(Lr))),X(e,t)};G(w,e=>{Q(Lr)&&e(T)}),H(t),O((e,t,n,r)=>{Y(i,Q(Nr).kind),Y(s,e),b(l,`title`,Q(Pr)),Y(u,Q(Pr)),b(p,`title`,t),Y(m,n),Y(v,r)},[()=>Rr(Q(Nr).size),()=>tn(Q(Nr)),()=>Yt(Q(Nr))||`You`,()=>Q(Nr).remoteItem?`Shared â not downloaded`:Wt(Q(Nr))===`mine`?`Shared by you`:Wt(Q(Nr))===`peer`?`Shared`:Q(Nr).wasShared?`No longer shared`:`Local only`]),X(e,t)};G(l,e=>{Q(Nr).kind===`prefab`?e(u):e(d,-1)});var p=g(l,2),m=e=>{var t=Bit(),n=j(t),r=e=>{var t=Rit();O(()=>{b(t,`src`,Q(Nr).thumbnail),b(t,`alt`,Q(Nr).name)}),X(e,t)},i=e=>{var t=zit(),n=j(t);sS(n,{size:40,"aria-hidden":`true`}),H(t),X(e,t)};G(n,e=>{Q(Nr).thumbnail?e(r):e(i,-1)}),W(2),H(t),X(e,t)},h=e=>{var t=Vit(),n=j(t);Ie(n,()=>Q(Nr).id,e=>{N4(e,{get itemId(){return Q(Nr).id},get name(){return Q(Nr).name},compact:!0})}),H(t),X(e,t)},_=e=>{var t=Uit(),n=N(t),r=j(n);Ie(r,()=>Q(Nr).id,e=>{{let t=q(()=>Q(Nr).kind===`prefab`?``:Q(Nr).id),n=q(()=>Q(Nr).kind===`prefab`?Q(Nr).prefabId:``);T3(e,{get itemId(){return Q(t)},get prefabId(){return Q(n)},get name(){return Q(Nr).name},onStats:e=>I(lt,e,!0)})}}),H(n);var i=g(n,2),a=e=>{var t=Hit(),n=g(j(t),2),r=f(n);H(t),O((e,t)=>Y(r,`${e??``} tris · ${t??``} verts · ${Q(lt).meshes??``} 2488 mesh${Q(lt).meshes===1?``:`es`}`),[()=>Q(lt).tris.toLocaleString(),()=>Q(lt).verts.toLocaleString()]),X(e,t)};G(i,e=>{Q(lt)&&e(a)}),X(e,t)};G(p,e=>{(Q(Nr).kind===`object`||Q(Nr).kind===`prefab`)&&Ae()&&!Q(Nr).packEntry&&je()?e(m):Q(Nr).kind===`audio`&&!Q(Nr).packEntry&&!Q(Nr).remoteItem?e(h,1):(Q(Nr).kind===`object`||Q(Nr).kind===`prefab`)&&Ae()&&!Q(Nr).packEntry&&e(_,2)});var v=g(p,2),y=j(v),x=e=>{var t=Git(),n=N(t),r=g(n,2),i=g(r,2),a=e=>{var t=Wit();L(`click`,t,()=>tc(Q(Nr))),X(e,t)};G(i,e=>{Ae()&&e(a)}),L(`click`,n,()=>{let e=Pv(Q(Nr).prefabId);e&&jv(e)}),L(`click`,r,()=>Ii(Q(Nr))),X(e,t)},S=e=>{var t=Kit();L(`click`,t,()=>tc(Q(Nr))),X(e,t)},C=e=>{var t=Yit(),n=N(t),r=g(n,2),i=e=>{var t=qit(),n=f(t,!0);O(()=>Y(n,Q(Nr).kind===`text`?`Edit`:`Preview`)),L(`click`,t,()=>tc(Q(Nr))),X(e,t)},a=e=>{var t=Jit();L(`click`,t,()=>tc(Q(Nr))),X(e,t)};G(r,e=>{Q(Nr).kind===`text`||Q(Nr).kind===`image`?e(i):Q(Nr).kind===`object`&&Ae()&&e(a,1)}),L(`click`,n,()=>Ni(Q(Nr))),X(e,t)};G(y,e=>{Q(Nr).kind===`prefab`?e(x):Q(Nr).packEntry?e(S,1):e(C,-1)}),H(v),Nnt(g(v,2),{get item(){return Q(Nr)},onDownloadAll:Do}),O(()=>Y(c,Q(Nr).name)),X(e,t)},s=e=>{let t=q(()=>Ha(Q(gt).folder.id));var n=Zit(),r=N(n),i=j(r),a=j(i);nS(a,{size:22,"aria-hidden":`true`}),H(i);var o=g(i,2),s=f(o,!0);H(r);var c=g(r,2),l=f(c),u=g(c,2),d=j(u),p=g(d,2);H(u),O(()=>{Y(s,Q(gt).folder.name),Y(l,`${Q(t).folders??``} folder${Q(t).folders===1?``:`s`}, ${Q(t).items??``} item${Q(t).items===1?``:`s`}`)}),L(`click`,d,()=>zs(Q(gt).folder.id)),L(`click`,p,()=>Mi(Q(gt).folder,!1)),X(e,n)},c=e=>{var t=Qit();X(e,t)};G(a,e=>{Q(Nr)?e(o):Q(gt)?.kind===`folder`?e(s,1):e(c,-1)}),H(t),X(e,t)},o=e=>{var t=tat(),n=j(t),r=j(n);v(r),W(),H(n);var i=g(n,2),a=j(i);v(a),W(),H(i);var o=g(i,2),s=j(o);v(s),W(),H(o);var c=g(o,2),l=j(c);v(l),W(),H(c);var u=g(c,2),d=j(u);v(d),W(),H(u);var p=g(u,2),m=j(p);v(m),W(),H(p);var h=g(p,2),_=e=>{var t=eat(),n=f(t);O(()=>Y(n,`Show ${Q(Cn).size??``} hidden pack${Q(Cn).size===1?``:`s`}`)),L(`click`,t,En),X(e,t)};G(h,e=>{Q(Cn).size>0&&e(_)});var y=g(h,2),b=j(y),x=g(b,2);We(x,e=>I(bn,e),()=>
2488Q(bn)),H(y),H(t),O(()=>{w(r,Q(pt)),w(a,Q(mt)),w(s,Ae()),w(l,Pe()),w(d,we()),w(m,Q(Sn))}),L(`change`,r,e=>{I(pt,e.currentTarget.checked,!0),nt.setItem(`explorerSingleClickOpen`,String(Q(pt)))}),L(`change`,a,e=>{I(mt,e.currentTarget.checked,!0),nt.setItem(`explorerBreadcrumb`,String(Q(mt)))}),L(`change`,s,e=>$o.set(e.currentTarget.checked)),L(`change`,l,e=>Ao.set(e.currentTarget.checked)),L(`change`,d,e=>ic.set(e.currentTarget.checked)),L(`change`,m,e=>{I(Sn,e.currentTarget.checked,!0),nt.setItem(`explorerHideBuiltinPacks`,String(Q(Sn)))}),L(`click`,b,()=>Q(bn)?.click()),L(`change`,x,kn),X(e,t)};G(i,e=>{t()===`props`?e(a):e(o,-1)}),X(e,n)},$$slots:{topbar:!0,primary:!0,main:!0,secondary:!0}}),e=>I(ht,e,!0),()=>Q(ht))},et=(e,t)=>Wne(t);function tt(e,t,n,r){let i=yd(r.hash)??Ib(r.name),a=t?.private?``:String(t?.name??``);return Yme(e,i,a,n)}function rt(e){let t=e.peerIds.map(e=>hh(e));return e.me&&t.unshift(`You`),t.length===1?e.me?`You are here`:t[0]+` is here`:t.slice(0,-1).join(`, `)+` and `+t[t.length-1]+` are here`}function it(e){return e.peerIds.length+ +!!e.me}function at(e){return tt(a(),o(),s(),e).peerIds.slice(0,6).map(e=>({label:`Join `+hh(e),icon:`arrow-right`,tooltip:`Travel to this scene, where `+hh(e)+` is â you leave the one you are in`,action:()=>void SZ(e)}))}let ot=e=>Math.min(Math.max(e||300,200),Math.round(window.innerHeight*.8)),st={minW:420,minH:280},ct={w:720,h:440},lt=t(null),ut=t(!0),dt=t(720),ft=t(440),pt=t(!1),mt=t(!0),ht=t(null),gt=t(null);if(typeof localStorage<`u`){try{let e=nt.getItem(`explorerHeight`);e&&(Md.set(ot(parseInt(e)||300)),nt.removeItem(`explorerHeight`))}catch{}I(ut,nt.getItem(`explorerDocked`)!==`false`);let e=Xh(parseInt(nt.getItem(`explorerWinW`)??`720`)||720,parseInt(nt.getItem(`explorerWinH`)??`440`)||440,st);I(dt,e.w,!0),I(ft,e.h,!0),I(pt,nt.getItem(`explorerSingleClickOpen`)===`true`),I(mt,nt.getItem(`explorerBreadcrumb`)!==`false`)}typeof window<`u`&&window.matchMedia?.(`(pointer: coarse)`).matches&&!U(rs)&&I(ut,!0),wa(),kv(),OZ();function _t(e){I(ut,e,!0),nt.setItem(`explorerDocked`,String(e)),e?Pd.set(`explorer`):Nd(`explorer`)}Qe(()=>{let e=c();e&&e.key===`explorer`&&(Ad.set(null),K(()=>{e.docked!==Q(ut)&&_t(e.docked),Is.set(!1)}))}),Qe(()=>(Od(`explorer`,!l()&&Q(ut),d()),()=>Od(`explorer`,!1)));let vt=q(()=>m()===`explorer`&&!h()),yt=q(()=>_().find(e=>e.members.includes(`explorer`))??null),bt=q(()=>Q(yt)?Q(yt).rect.width:Q(dt)),xt=q(()=>Q(yt)?Q(yt).rect.height:Q(ft)),St=t(!1);function Ct(e){I(St,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function wt(e){Q(St)&&Md.update(t=>ot(t-e.movementY))}function Tt(e){Q(St)&&(I(St,!1),e.currentTarget.releasePointerCapture?.(e.pointerId))}let Et=t(!1);function Dt(e){I(Et,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()}function Ot(e){if(!Q(Et))return;let t=Q(yt)?Q(yt).rect.width:Q(dt),n=Q(yt)?Q(yt).rect.height:Q(ft),r=Gh(e.currentTarget.parentElement),i=Yh(t+e.movementX,n+e.movementY,r.left,r.top,st);I(dt,i.w,!0),I(ft,i.h,!0),ag(`explorer`,Q(dt),Q(ft))}function kt(e){Q(Et)&&(I(Et,!1),e.currentTarget.releaseCapture?.(e.pointerId),At())}function At(){nt.setItem(`explorerWinW`,String(Q(dt))),nt.setItem(`explorerWinH`,String(Q(ft)))}function jt(){let e=Xh(ct.w,ct.h,st);I(dt,e.w,!0),I(ft,e.h,!0),ag(`explorer`,Q(dt),Q(ft)),At()}function Mt(){let e=Xh(Q(dt),Q(ft),st);(e.w!==Q(dt)||e.h!==Q(ft))&&(I(dt,e.w,!0),I(ft,e.h,!0),ag(`explorer`,Q(dt),Q(ft)))}let Nt=t(``),Pt=t(Ne(new Set)),Ft=t(!1),It=t(!1),Lt=t(1e3);function Rt(e){let t=()=>{let t=e.clientWidth;t>0&&I(Lt,t,!0)},n=new ResizeObserver(t);return n.observe(e),t(),{destroy:()=>n.disconnect()}}let zt=q(()=>Q(Lt)<700),Bt=q(()=>Q(Lt)<520),Vt=q(()=>Q(Lt)<420),Ht=q(()=>Q(Lt)<340),Ut=q(()=>Q(Pt).size>0||Q(Ft));function Wt(e){return e?.remoteItem?`peer`:e?.share??``}let Gt=e=>{let t=Wt(e);return t===`mine`||t===`peer`};function Kt(e){if(Q(Pt).size&&!Q(Pt).has(e.kind))return!1;if(Q(Ft)){if(e.volumeItem)return!0;if(!fo(e)||Gt(e))return!1}return!0}function qt(e){let t=La(e.id);return Q(Pt).size&&!y().filter(e=>t.includes(e.folderId??``)).some(e=>Kt(e))?!1:Q(Ft)&&(e?.share===`mine`||e?.share===`peer`)?y().some(e=>t.includes(e.folderId??``)&&!Gt(e)):!0}let Jt=q(()=>(x()?.openedPeers?.size??0)>0||Ige(T())||Q(Ut));function Yt(e){let t=e?.owner;return t?t.account?t.account+` â`:!t.name&&!t.id?``:t.name||`peer `+String(t.id??``).slice(0,4):``}function Xt(e){return Q(Jt)&&fo(e)&&!Gt(e)}function Zt(e){return Q(Jt)&&e?.share!==`mine`&&e?.share!==`peer`}let Qt=`opacity-50 saturate-50`,$t=`text-gray-600`;function en(e){return e?.thumbnail?e.thumbnail:e?.hash?E()[e.hash]||((e.remoteItem||e.remoteScene)&&kre(e.hash),null):null}function tn(e){let t=Yt(e);return e?.remoteItem&&D().has(e.hash)?`Nobody here has this file`+(t?` â `+t+` shared it and has left`:``)+`. It will be fetched if they come back.`:e?.remoteItem?`Shared`+(t?` by `+t:``)+` â not on this device yet. Open it to download it.`:Wt(e)===`mine`?`Shared by you â peers can see and download this`:Wt(e)===`peer`?`Shared`+(t?` by `+t:``)+` â you have a copy`:e?.wasShared?`No longer shared â your copy is still here`:`Local â only on this device`}let nn=t(!1),rn=t(!1),an=t(!1),on=t(!1),sn=t(4),cn=t(0);
2488function ln(){I(nn,!0),I(sn,(Q(si)?.scrollTop??0)+4),I(cn,Math.max(0,(Q(si)?.clientHeight??0)-8),!0)}let un=t(null),dn=t(null),fn=t(null),pn=t(Ne(new Set));if(typeof localStorage<`u`)try{I(pn,new Set(JSON.parse(nt.getItem(`explorerExpanded`)??`[]`)),!0)}catch{}function mn(e){let t=new Set(Q(pn));t.has(e)?t.delete(e):t.add(e),I(pn,t,!0),nt.setItem(`explorerExpanded`,JSON.stringify([...t]))}let hn=t(Ne(typeof localStorage<`u`&&nt.getItem(`explorerSceneExpanded`)===`true`));function gn(){I(hn,!Q(hn)),nt.setItem(`explorerSceneExpanded`,String(Q(hn)))}let _n=t(Ne(typeof localStorage<`u`&&nt.getItem(`explorerPacksExpanded`)===`true`));function vn(){I(_n,!Q(_n)),nt.setItem(`explorerPacksExpanded`,String(Q(_n))),Q(_n)&&k().length===0&&Nm()}let yn=t(Ne({})),bn=t(void 0),xn=t(void 0),Sn=t(Ne(typeof localStorage<`u`&&nt.getItem(`explorerHideBuiltinPacks`)===`true`)),Cn=t(Ne(new Set(wn())));function wn(){try{return JSON.parse(nt.getItem(`explorerHiddenPacks`)||`[]`)}catch{return[]}}function Tn(e){let t=new Set(Q(Cn));t.add(e),I(Cn,t,!0),nt.setItem(`explorerHiddenPacks`,JSON.stringify([...t])),A()===`pack:`+e&&zs(`packs`)}function En(){I(Cn,new Set,!0),nt.setItem(`explorerHiddenPacks`,`[]`)}let Dn=q(()=>k().filter(e=>!(Q(Sn)&&e.source==="default")&&!Q(Cn).has(e.name)));Nm();async function On(e){try{let t=await Mm(e);I(_n,!0),zs(`pack:`+t.name),es(`Imported pack "${t.title}"`)}catch(e){es(`Pack import failed: `+(e?.message??`bad .zip`))}}async function kn(e){let t=e.target.files?.[0];e.target.value=``,t&&On(t)}let An=q(()=>typeof A()==`string`&&A().startsWith(`pack:`)?jm(A().slice(5)):null),jn=t(!1),Mn=t(``),Nn=t(!1);async function Fn(e){let t=e.attributionHtml||``;if(!t&&e.attributionUrl){I(Mn,``),I(Nn,!0),I(jn,!0);try{let n=await fetch(e.attributionUrl);n.ok&&(t=await n.text())}catch{}I(Nn,!1),t&&(e.attributionHtml=t)}t||=`<h3>${e.title}</h3>`+(e.copyright?`<p>${e.copyright}</p>`:``)+(e.license?`<p>License: ${Pm(e.license)}</p>`:``),I(Mn,t,!0),I(jn,!0)}function In(e){return e?.sourceUrl||e?.homepage||``}function Ln(e){let t=/github\.com\/([^/]+\/[^/#?]+)/.exec(e);if(t)return t[1].replace(/\.git$/,``);try{return new URL(e).hostname}catch{return e}}let Rn=t(!1);async function zn(e){if(!Q(Rn)){I(Rn,!0);try{let t=await Toe(e);I(_n,!0),zs(`pack:`+t.name),Am(t),es(`Installed "${t.title}"`)}catch(e){es(`Install failed: `+(e?.message??`bad .zip`))}finally{I(Rn,!1)}}}function Vn(e,t){e.preventDefault();let n=[{label:`Rename`,tooltip:`Your name for this pack â local to you, and it survives a reload`,action:()=>{I(_n,!0),Li(t)}},{label:`Attribution / license`,action:()=>Fn(t)}];In(t)&&n.push({label:`Open source`,action:()=>window.open(In(t),`_blank`,`noopener`)}),t.source==="default"&&t.zip&&n.push({label:`Install pack`,action:()=>zn(t)}),t.source===`imported`?n.push({label:`Delete pack`,danger:!0,action:()=>{Doe(t.name),A()===`pack:`+t.name&&zs(`packs`)}}):n.push({label:`Hide pack`,action:()=>Tn(t.name)}),I(un,{x:e.clientX,y:e.clientY,items:n},!0)}Qe(()=>{let e=A();typeof e==`string`&&e.startsWith(`pack:`)&&(I(yn,{},!0),Am(jm(e.slice(5))))});let Hn={door:`Opens and closes`,toggle:`Switches on and off`,oneshot:`Plays once`,loop:`Loops`},Un={click:`on a click`,proximity:`when you walk up to it`,knock:`when you knock on it`};function Wn(e){if(!e)return``;let t=Hn[e.type]??`Animated`,n=e.type===`loop`&&e.autoplay?`by itself`:Un[e.trigger]??`on a click`;return`Animated â `+t.toLowerCase()+` `+n+` in Interact or Play (never in Edit)`}function Gn(e){return e.resolvedThumb?e.resolvedThumb:e.thumbnail?e.thumbnail:(e.thumbs||[])[Q(yn)[e.name]??0]??null}function Kn(e){I(yn,{...Q(yn),[e.name]:(Q(yn)[e.name]??0)+1},!0)}function qn(e,t){e.packName&&!e.resolvedThumb&&!e.thumbnail&&(e.resolvedThumb=t,Ooe(e.packName,e.name,t))}let Jn={image:`image`,audio:`music`,text:`file-text`,object:`box`,prefab:`boxes`,scene:`map`},Yn={image:`Images`,audio:`Audio`,text:`Text and config`,object:`3D models`,prefab:`Prefabs`,scene:`Scenes`},Xn=[`image`,`object`,`audio`,`text`,`scene`,`prefab`],Zn={image:`ico-image`,audio:`ico-audio`,text:`ico-doc`,object:`ico-object`,prefab:`ico-prefab`,scene:`ico-prefab`},Qn=q(()=>kZ(A())),$n=q(()=>Q(Qn)?te().find(e=>e.id===Q(Qn).volumeId)??null:null),er=(e,t)=>({id:AZ(e.id,t.id),volumeId:e.id,folderId:t.id,name:t.name,parentId:t.parentId??null});function tr(e,t){if(!Q(Pt).size)return!0;let n=[t.folderId];for(let t=0;t<n.length;
2488t++)for(let r of e.folders)r.parentId===n[t]&&n.push(r.id);return e.items.some(e=>n.includes(e.folderId??``)&&Q(Pt).has(e.kind))}let nr=q(()=>{let e=P(),t=[],n=(r,i)=>{for(let a of e.filter(e=>(e.parentId??null)===r)){let r=e.some(e=>e.parentId===a.id);t.push({folder:a,depth:i,hasChildren:r}),Q(pn).has(a.id)&&n(a.id,i+1)}};return n(null,0),t}),rr=q(()=>{let e=A();return e===`deleted`||e===`deletedlog`?{inBin:!0,folderId:null}:typeof e==`string`&&e.startsWith(`deleted:`)?{inBin:!0,folderId:e.slice(8)||null}:{inBin:!1,folderId:null}}),ir=q(()=>sC(T())),ar=q(()=>new Set([...y(),...re()].map(e=>e.hash))),or=q(()=>new Set([...y(),...re()].map(e=>e.id))),sr=e=>e?.id?Q(or).has(e.id):Q(ar).has(e?.hash),cr=q(()=>Uge(Q(ir),P())),lr=q(()=>ie()?Q(ir):hC(Q(ir),Q(ar),P(),Q(or)).bin),ur=q(()=>new Set(Q(lr).map(e=>_d(e)))),dr=q(()=>!Q(rr).inBin||F()!==`tree`?[]:(Q(cr).children.get(Q(rr).folderId)??{folders:[],items:[]}).folders.filter(e=>{if(!e.ghost)return Q(ur).has(_d(e.row));let t=Q(cr).descendants(e.id);return t.items.some(e=>Q(ur).has(_d(e)))||t.folders.some(e=>e.row&&Q(ur).has(_d(e.row)))}).map(e=>({id:`deletedfolder:`+e.id,nodeId:e.id,name:e.name,parentId:e.parentId??null,deletedNode:!0,ghost:e.ghost,row:e.row??null}))),fr=q(()=>Q(rr).inBin?(F()===`tree`?(Q(cr).children.get(Q(rr).folderId)??{folders:[],items:[]}).items.filter(e=>Q(ur).has(_d(e))):Q(lr).filter(e=>!zge(e))).map(e=>({id:`deleted:`+_d(e),binKey:_d(e),name:e.name,kind:e.kind||`text`,hash:e.hash,folderId:e.folderId??null,location:Q(cr).locationOf(e),size:0,createdAt:e.at,thumbnail:Gge(e),owner:e.by??null,deletedEntry:!0,restorable:sr(e)})):[]);function pr(e){let t=[],n=e?Q(cr).nodes.get(e):null;for(;n;)t.unshift(n.name),n=n.parentId?Q(cr).nodes.get(n.parentId):null;return t.join(` / `)}let mr=q(()=>Q(Qn)?Q($n)?Q($n).folders.filter(e=>(e.parentId??null)===Q(Qn).folderId).map(e=>er(Q($n),e)).filter(e=>tr(Q($n),e)):[]:Q(rr).inBin?Q(dr):P().filter(e=>(e.parentId??null)===(A()===`prefabs`?`__none__`:A()??null)).filter(qt)),hr=q(()=>{if(Q(Qn)){if(!Q($n))return[];let e=Q(Nt).trim().toLowerCase();return(e?Q($n).items.filter(t=>t.name.toLowerCase().includes(e)):Q($n).items.filter(e=>(e.folderId??null)===Q(Qn).folderId)).map(e=>({...e,volumeId:Q($n).id,volumeName:Q($n).name,volumeItem:!0})).filter(Kt)}if(A()===`prefabs`)return ae().map(e=>({id:`prefab:`+e.id,name:e.name,kind:`prefab`,thumbnail:e.thumbnail,prefabId:e.id}));if(A()===`packs`)return Q(Dn).map(e=>({id:`packfolder:`+e.name,name:e.title,kind:`pack-folder`,packName:e.name}));if(typeof A()==`string`&&A().startsWith(`pack:`))return oe().map(e=>({...e,packEntry:!0,id:e.id??`pack:${e.packName}:${e.name}`}));if(Q(rr).inBin)return Q(fr);if(typeof A()==`string`&&A().startsWith(`scene`)){let e=A().split(`:`)[1]??null;return R().filter(t=>!e||t.group===e).map(e=>({...e,sceneEntry:!0,thumbnail:e.dataUrl??null}))}let e=y().filter(e=>(e.folderId??null)===(A()??null)),t=Q(Nt).trim().toLowerCase(),n=t?y().filter(e=>e.name.toLowerCase().includes(t)):e,r=new Set([...y(),...re()].map(e=>e.hash)),i=Object.entries(T().scenes).map(([e,t])=>({name:e,hash:t.history[t.history.length-1]})).filter(e=>e.hash&&!r.has(e.hash)).filter(e=>!t||e.name.toLowerCase().includes(t)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({id:`remote:`+e.hash,name:e.name+`.tpscene`,kind:`scene`,hash:e.hash,folderId:null,size:0,thumbnail:null,createdAt:0,remoteScene:!0})),a=Fge(T()).filter(e=>!i.some(t=>t.hash===e.hash)).filter(e=>t?e.name.toLowerCase().includes(t):(e.folderId??null)===(A()??null)).sort((e,t)=>String(e.name).localeCompare(String(t.name))).map(e=>({id:`shared:`+hd(e),rowKey:hd(e),name:e.name,kind:e.kind||`text`,hash:e.hash,folderId:e.folderId??null,size:0,thumbnail:null,createdAt:0,owner:e.owner??null,remoteItem:!0}));return(!t&&(A()??null)===null||t?[...n,...i,...a]:[...n,...a]).filter(Kt)}),gr=t(null),_r=q(()=>T().name||`Untitled project`),vr=q(()=>o()?.hash??null),yr=t(null),br=q(()=>Q(vr)?[...y(),...re()].find(e=>e.hash===Q(vr))?.name??``:``);function xr(){o()?.name&&(Ai(),I(yr,o().name,!0))}function Sr(){if(Q(yr)===null)return;let e=Q(yr).trim(),t=o()?.name??``;if(I(yr,null),e&&e!==t){if(!Na(e))return es(`A scene name cannot be empty or contain * \\ /`);Vb(t,e)}}function Cr(e){e.key===`Enter`?Sr():e.key===`Escape`&&I(yr,null),e.stopPropagation()}function wr(e){e.preventDefault(),e.stopPropagation(),I(un,{x:e.clientX,y:e.clientY,items:[{label:`Rename sceneâ¦`,
2488icon:`pencil`,tooltip:`Rename "`+(o()?.name??``)+`" â its files follow, on every peer`,action:xr},{label:`Find its file`,icon:`search`,action:()=>void kr()}]},!0)}function Tr(){I(gr,T().name??``,!0)}function Er(){Q(gr)!==null&&(Kne(Q(gr)),I(gr,null))}function Dr(e){e.key===`Enter`?Er():e.key===`Escape`&&I(gr,null),e.stopPropagation()}async function Or(){let e=o()?.name;if(!e)return;let t=await Lb(e,jr());es(t?`Saved "`+e+`"`:`Could not save "`+e+`"`)}async function kr(){let e=Q(vr);if(!e)return;let t=y().find(t=>t.hash===e);if(!t){es(`The open scene has no file in this library`);return}await Ar(t)}async function Ar(e){Q(Nt)&&I(Nt,``),Ba.set(e.folderId??null),await C(),await C(),bi([e.id]),Fs(e),await C(),document.querySelector(`[data-card-id="${e.id}"]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})}Qe(()=>{let e=se();e&&K(()=>{Sa.set(null);let t=[...y()].find(t=>t.id===e);t?Ar(t):es(`That file is no longer in your library`)})});function jr(){let e=A();return typeof e!=`string`||!e||Q(rr).inBin||e===`prefabs`||e===`packs`||e.startsWith(`pack:`)||e.startsWith(`scene`)||kZ(e)?null:e}let Mr=q(()=>{let e=A();if(Q(Qn)){let e=[{label:Q($n)?.name??`Mounted project`,id:AZ(Q(Qn).volumeId)}],t=Q($n)?.folders??[],n=[],r=t.find(e=>e.id===Q(Qn).folderId);for(;r;)n.unshift(r),r=r.parentId?t.find(e=>e.id===r.parentId):void 0;for(let t of n)e.push({label:t.name,id:AZ(Q(Qn).volumeId,t.id)});return e}if(e===`prefabs`)return[{label:`Prefabs`,id:`prefabs`}];if(e===`packs`)return[{label:`Packs`,id:`packs`}];if(Q(rr).inBin){let e=[{label:`Deleted`,id:`deleted`}],t=[],n=Q(rr).folderId?Q(cr).nodes.get(Q(rr).folderId):null;for(;n;)t.unshift(n),n=n.parentId?Q(cr).nodes.get(n.parentId):null;for(let n of t)e.push({label:n.name,id:`deleted:`+n.id});return e}if(typeof e==`string`&&e.startsWith(`pack:`))return[{label:`Packs`,id:`packs`},{label:jm(e.slice(5))?.title||e.slice(5),id:e}];if(typeof e==`string`&&e.startsWith(`scene`)){let t=e.split(`:`)[1],n=[{label:`Scene`,id:`scene`}];return t&&n.push({label:t,id:e}),n}let t=[{label:`Library`,id:null}];if(typeof e==`string`){let n=[],r=P().find(t=>t.id===e);for(;r;)n.unshift(r),r=r.parentId?P().find(e=>e.id===r.parentId):void 0;for(let e of n)t.push({label:e.name,id:e.id})}return t}),Nr=q(()=>Q(gt)?.kind===`item`?Q(gt).item:null),Pr=q(()=>{if(!Q(Nr))return``;let e=[];if(Q(Nr).volumeItem){let t=MZ(Q(Nr).volumeId),n=Q(Nr).folderId??null;for(;n;){let r=t.find(e=>e.id===n);if(!r)break;e.unshift(r.name),n=r.parentId??null}return(Q(Nr).volumeName??`Mounted project`)+(e.length?` / `+e.join(` / `):``)}let t=Q(Nr).folderId??null;for(;t;){let n=P().find(e=>e.id===t);if(!n)break;e.unshift(n.name),t=n.parentId??null}return`Library`+(e.length?` / `+e.join(` / `):``)}),Fr=(e,t)=>Gde(t),Ir=q(()=>Q(Nr)?.kind===`prefab`?Fr(ae(),Q(Nr).prefabId):null),Lr=t(``);Qe(()=>{let e=Q(Nr);I(Lr,``),e&&e.kind!==`prefab`&&Ja(e.id).then(async t=>{if(t&&Q(Nr)?.id===e.id)try{if(e.kind===`image`){let e=await createImageBitmap(t);I(Lr,e.width+` à `+e.height+` px`)}else if(e.kind===`text`)I(Lr,(await t.text()).split(` 2489`).length+` lines`);else if(e.kind===`audio`){let e=await ql(t);I(Lr,e.duration.toFixed(2)+` s · `+e.channels+` ch`)}}catch{}})});function Rr(e){return e==null||isNaN(e)?`â`:e<1024?e+` B`:e<1048576?(e/1024).toFixed(1)+` KB`:e<1073741824?(e/1024/1024).toFixed(1)+` MB`:(e/1024/1024/1024).toFixed(1)+` GB`}let zr=q(()=>Q(rr).inBin?`deleted`:`library`);function Br(e){if(!e)return`â`;let t=new Date(e);return t.toLocaleDateString()+` `+t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}function Vr(e,t){if(e.kind===`folder`)return t===`name`?e.folder?.name:t===`kind`?`Folder`:t===`location`&&e.folder?.deletedNode&&pr(e.folder.parentId)||`â`;let n=e.item;switch(t){case`location`:return String(n?.location??``)||`â`;case`kind`:return Hr(n);case`size`:return n?.remoteItem||n?.remoteScene||n?.deletedEntry?`â`:Rr(n?.size);case`added`:case`deletedAt`:return Br(Number(n?.createdAt)||0);case`owner`:case`deletedBy`:return n?.owner?.id&&String(n.owner.id)===String(x()?.peer?.id??``)?`Me`:Yt(n)||`â`;default:return String(n?.name??``)}}function Hr(e){let t=String(e?.kind??`â`);if(t!==`prefab`)return t;let n=e.prefabId?Pv(e.prefabId):null,r=n?LC(n):`snapshot`;return r===`snapshot`?t:t+` (.`+r+`)`}let Ur=q(()=>r3(I4(Q(zr)),le()[Q(zr)]).filter(e=>l3(Q(zr),e.key,de()))),Wr=q(()=>Q(Ur).map(e=>i3(e,pe()[Q(zr)]))),Gr=q(()=>Q(Wr).reduce((e,t)=>
2489e+t,0)),qr=t(null);function Jr(e,t,n){e.button===0&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),I(qr,{key:t.key,x0:e.clientX,w0:n},!0))}function Yr(e){Q(qr)&&o3(Q(zr),Q(qr).key,Q(qr).w0+(e.clientX-Q(qr).x0))}function Xr(e){Q(qr)&&(e.currentTarget.releasePointerCapture?.(e.pointerId),I(qr,null))}let Zr=t(null),Qr=!1;function $r(e,t){e.button!==0||t.always||(I(Zr,{key:t.key,x:e.clientX,over:-1,moved:!1},!0),window.addEventListener(`pointermove`,ei),window.addEventListener(`pointerup`,ti),window.addEventListener(`pointercancel`,ti))}function ei(e){if(!Q(Zr)||(Math.abs(e.clientX-Q(Zr).x)>4&&I(Zr,{...Q(Zr),moved:!0},!0),!Q(Zr).moved))return;let t=[...document.querySelectorAll(`#explorer-list-head .ex-th[data-col]`)],n=-1;t.forEach((t,r)=>{let i=t.getBoundingClientRect();e.clientX>=i.left&&e.clientX<=i.right&&(n=r)}),I(Zr,{...Q(Zr),over:n},!0)}function ti(){window.removeEventListener(`pointermove`,ei),window.removeEventListener(`pointerup`,ti),window.removeEventListener(`pointercancel`,ti);let e=Q(Zr);I(Zr,null),e?.moved&&(Qr=!0,e.over>=0&&c3(Q(zr),Q(Ur).map(e=>e.key),e.key,e.over))}function ni(e){if(Qr){Qr=!1;return}d3(Q(zr),e)}function ri(e){e.preventDefault(),e.stopPropagation();let t=Object.keys(pe()[Q(zr)]??{}).length>0||(le()[Q(zr)]??[]).length>0;I(un,{x:e.clientX,y:e.clientY,items:[...I4(Q(zr)).map(e=>e.always?{label:e.label,checked:!0,tooltip:`A row has to be identifiable â this column cannot be hidden`,action:()=>{}}:{label:e.label,checked:l3(Q(zr),e.key,de()),action:()=>u3(Q(zr),e.key)}),...t?[{section:`Layout`},{label:`Reset widths and order`,tooltip:`Back to the default column layout for this view`,action:()=>{t3.update(e=>({...e,[Q(zr)]:{}})),n3.update(e=>({...e,[Q(zr)]:[]}))}}]:[]]},!0)}let ii=t(null);function ai(e){return`Browser storage for this app: `+Rr(e.used)+` used of `+Rr(e.quota)+` granted. That covers everything this origin stores, not the library alone.`}async function oi(){try{let e=await navigator.storage?.estimate?.();e&&typeof e.usage==`number`&&I(ii,{used:e.usage??0,quota:e.quota??0},!0)}catch{}}Qe(()=>{y(),re(),K(()=>void oi())});let si=t(null),ci=q(()=>{let e=[...!Q(Nt)&&A()!==`prefabs`&&!(typeof A()==`string`&&A().startsWith(`scene`))?Q(mr).map(e=>({kind:`folder`,folder:e})):[],...Q(hr).map(e=>({kind:`item`,item:e}))];return me()===`list`?p3(e.map(e=>e.kind===`folder`?{folder:!0,id:e.folder.id,name:e.folder.name,kind:`folder`,entry:e}:{folder:!1,id:e.item.id,name:e.item.name,kind:e.item.kind,size:e.item.size,createdAt:e.item.createdAt,owner:e.item.owner,entry:e}),V()[Q(zr)]??{key:`name`,dir:1},{ownerLabel:Yt}).map(e=>e.entry):e});Qe(()=>{let e=Q(ci),t=A(),n=typeof t==`string`&&!t.includes(`:`)?P().find(e=>e.id===t)?.parentId??null:null;K(()=>qC.set({folderId:t,parentId:n,entries:e}))});let li=q(()=>hC(Q(ir),Q(ar),P(),Q(or)).bin.length),ui=q(()=>Q(ir).length),di=q(()=>Math.max(0,Q(ui)-Q(li))),fi=q(()=>he()?Q(ui):Q(li)),pi=q(()=>Q(fi)>0||Q(rn)),mi=q(()=>Q(rr).inBin);Qe(()=>{he()||K(()=>Q4.set(!1))});let hi=q(()=>Q(zr)!==`deleted`||ge()!==`deleter`?null:m3(Q(ci).filter(e=>e.kind===`item`).map(e=>e.item),{ownerLabel:Yt,myId:x()?.peer?.id??``})),gi=t(Ne(new Set));function _i(e){let t=new Set(Q(gi));t.has(e)?t.delete(e):t.add(e),I(gi,t,!0)}let vi=t(Ne(new Set)),yi=e=>e.kind===`folder`?e.folder.id:e.item.id;function bi(e){I(vi,new Set(e),!0)}function xi(){return Q(gt)?(Q(gt).kind===`folder`?Q(gt).folder?.id:Q(gt).item?.id)??null:null}function Si(e,t){let n=Q(ci).map(yi),r=n.indexOf(t);if(r<0)return[t];let i=e?n.indexOf(e):-1;return i<0?[t]:i<=r?n.slice(i,r+1):n.slice(r,i+1)}function Ci(e,t,n){if(e.shiftKey){let n=Si(xi(),t);bi(e.ctrlKey||e.metaKey?[...Q(vi),...n]:n);return}let r=new Set(Q(vi));r.has(t)?r.delete(t):r.add(t),I(vi,r,!0),n()}function wi(){return Q(ci).filter(e=>Q(vi).has(yi(e)))}Qe(()=>{A(),Q(Nt),K(()=>{Q(vi).size&&I(vi,new Set,!0)})});function Ti(e,t,n,r){let i=e.has(r),a=(t===r||(n?.kind===`item`?n.item?.id:n?.folder?.id)===r)&&(e.size===0||i)?`border-primary-600 bg-primary-600/10`:i?`border-sky-400 bg-sky-4
248900/20`:`border-transparent hover:border-gray-600 hover:bg-gray-700/60`;return i?`explorer-selected `+a:a}function Ei(){return Q(gt)?Q(ci).findIndex(e=>e.kind===Q(gt).kind?e.kind===`folder`?e.folder.id===Q(gt).folder?.id:e.item.id===Q(gt).item?.id:!1):-1}function Di(e){if(!Q(ci).length)return;let t=Ei();t=t<0?e>0?0:Q(ci).length-1:Math.min(Math.max(t+e,0),Q(ci).length-1);let n=Q(ci)[t];bi([yi(n)]),n.kind===`folder`?Ls(n.folder):Fs(n.item)}function Oi(){let e=A();if(e!=null){if(Q(Qn)){if(!Q(Qn).folderId)return zs(null);let e=MZ(Q(Qn).volumeId).find(e=>e.id===Q(Qn).folderId);return zs(AZ(Q(Qn).volumeId,e?.parentId??null))}if(typeof e==`string`&&e.startsWith(`pack:`))return zs(`packs`);if(Q(rr).inBin){if(!Q(rr).folderId)return zs(null);let e=Q(cr).nodes.get(Q(rr).folderId);return zs(e?.parentId?`deleted:`+e.parentId:`deleted`)}if(e===`prefabs`||e===`packs`||typeof e==`string`&&e.startsWith(`scene`))return zs(null);zs(P().find(t=>t.id===e)?.parentId??null)}}function ki(e){let t=e.target?.tagName;if(t===`INPUT`||t===`TEXTAREA`)return;let n=e.ctrlKey||e.metaKey;if(n&&e.code===`KeyA`)e.preventDefault(),e.stopPropagation(),bi(Q(ci).map(yi));else if(n&&e.code===`KeyI`)e.preventDefault(),e.stopPropagation(),bi(Q(ci).map(yi).filter(e=>!Q(vi).has(e)));else if(n&&(e.code===`KeyD`||e.code===`KeyC`||e.code===`KeyX`||e.code===`KeyV`)){if(e.code!==`KeyV`&&!Q(vi).size)return;e.preventDefault(),e.stopPropagation(),e.code===`KeyD`?ho():e.code===`KeyC`?go(`copy`):e.code===`KeyX`?go(`cut`):_o()}else if(e.key===`Escape`){if(!Q(vi).size)return;e.preventDefault(),e.stopPropagation(),bi([])}else if(e.key===`Delete`){if(!Q(vi).size)return;e.preventDefault(),e.stopPropagation(),bo()}else e.key===`ArrowRight`||e.key===`ArrowDown`?(e.preventDefault(),Di(1)):e.key===`ArrowLeft`||e.key===`ArrowUp`?(e.preventDefault(),Di(-1)):e.key===`Enter`?(e.preventDefault(),Q(gt)?.kind===`item`?tc(Q(gt).item):Q(gt)?.kind===`folder`&&zs(Q(gt).folder.id)):e.key===`Backspace`&&(e.preventDefault(),Oi())}function Ai(){Q(fn)&&Ui()}function ji(e,t=!1){let n=kZ(e)??(e===null?Q(Qn):null);if(n){Ai(),I(fn,{mode:`create`,volumeId:n.volumeId,parentId:n.folderId,value:`New folder`,inGrid:t},!0);return}if(Q(fn)?.mode===`create`&&Q(fn).parentId===e&&Q(fn).inGrid===t){queueMicrotask(()=>{let e=document.querySelector(`#explorer-new-card input, .explorer-edit-input`);e?.focus(),e?.select()});return}if(Ai(),e){let t=new Set(Q(pn));t.add(e),I(pn,t,!0)}I(fn,{mode:`create`,parentId:e,value:`New folder`,inGrid:t},!0)}function Mi(e,t=!1){Ai(),I(fn,{mode:`rename`,folderId:e.volumeId?e.folderId:e.id,cardId:e.id,...e.volumeId?{volumeId:e.volumeId}:{},parentId:e.parentId??null,value:e.name,inGrid:t},!0)}function Ni(e){Ai(),I(fn,{mode:`rename-item`,itemId:e.id,...e.volumeId?{volumeId:e.volumeId}:{},value:e.name},!0)}function Pi(e){let t=yd(e.hash);t&&(Ai(),I(fn,{mode:`rename-scene`,itemId:e.id,sceneName:t,value:t},!0))}function Fi(e){let t=e?.kind===`scene`&&!e.remoteScene?yd(e.hash):null;return t?[{label:`Rename sceneâ¦`,icon:`pencil`,tooltip:`Rename "`+t+`" â every version file follows, on every peer`,action:()=>Pi(e)}]:[]}function Ii(e){Ai(),I(fn,{mode:`rename-prefab`,prefabId:e.prefabId,value:e.name},!0)}function Li(e){Ai(),I(fn,{mode:`rename-pack`,packName:e.name,value:e.title||e.name},!0)}function Ri(e,t){Ai(),I(fn,{mode:e,value:e===`save-scene`?`Scene`:`New scene`,inGrid:!0,consent:t},!0)}function zi(e){Ai(),I(fn,{mode:`duplicate-scene`,itemId:e.id,value:Rb(e.name),inGrid:!0},!0)}function Bi(e){return e?.mode===`duplicate-scene`&&Rme(e.value)}function Vi(){Ai(),I(fn,{mode:`new-pack`,value:`My pack`,inGrid:!0},!0)}function Hi(){if(Q(fn)){if(!Na(Q(fn).value)){I(fn,null);return}if(Bi(Q(fn))){es(`Duplicate cancelled â a scene called "`+Q(fn).value.trim()+`" already exists`),I(fn,null);return}Ui()}}async function Ui(){if(!Q(fn)||!Na(Q(fn).value))return;if(Bi(Q(fn))){es(`A scene called "`+Q(fn).value.trim()+`" already exists â choose another name`);return}let e=Q(fn);if(I(fn,null),e.volumeId){e.mode===`create`?UZ(e.volumeId,e.value,e.parentId):e.mode===`rename`?WZ(e.volumeId,e.folderId,e.value):e.mode===`rename-item`&&GZ(e.volumeId,e.itemId,e.value);return}if(e.mode===`create`)Va(e.value,e.parentId);else if(e.mode===`rename-item`){Ea(e.itemId,e.value);let t=y().find(t=>
2489t.id===e.itemId);t?.kind===`scene`&&Bme(t.hash,e.value)}else if(e.mode===`rename-scene`)Vb(e.sceneName,e.value);else if(e.mode===`rename-prefab`)qde(e.prefabId,e.value);else if(e.mode===`rename-pack`)woe(e.packName,e.value);else if(e.mode===`save-scene`)await Lb(e.value,jr(),{consent:e.consent});else if(e.mode===`new-scene`)await Ume(e.value,jr());else if(e.mode===`duplicate-scene`){let t=y().find(t=>t.id===e.itemId);if(!t)return es(`That scene is no longer in the Library`);let n=await zb(t,e.value);n&&bi([n.id])}else if(e.mode===`new-pack`){let t=Aoe(e.value);zs(`pack:`+t.name),es(`Pack created: `+t.title+` â drag files here to fill it`)}else eee(e.folderId,e.value)}function Wi(e){e.key===`Enter`?Ui():e.key===`Escape`&&I(fn,null),e.stopPropagation()}function Gi(e){e.focus(),e.select()}Qe(()=>{let e=_e();e&&(Zo.set(null),K(()=>{zs(e.folderId),Ri(`save-scene`,e.consent)}))}),Qe(()=>{let e=ve();e&&(Yo.set(null),K(()=>{let t=[...bd(e.name)?.history??[]].reverse(),n=[e.hash,...t].filter(Boolean),r=null;for(let e of n)if(r=ka(e),r)break;if(!r){es(`No copy of "${e.name}" here yet â its versions are on a peer. Use "Open here (downloads it)" on its card to fetch one.`);return}Rs({kind:`item`,item:r})}))});let Ki=q(()=>Q(fn)&&(Q(fn).mode===`save-scene`||Q(fn).mode===`new-scene`||Q(fn).mode===`duplicate-scene`||Q(fn).mode===`new-pack`||Q(fn).mode===`create`&&Q(fn).inGrid)?Q(fn).mode:null),qi=t(0),Ji=t(!1),Yi=t(Ne(typeof localStorage<`u`&&parseInt(nt.getItem(`explorerRootsH`)??``)||160)),Xi=q(()=>Math.min(140,Math.max(28,(Q(qi)||320)-96-40-50-56))),Zi=t(0),Qi=q(()=>Math.max(56,(Q(qi)||320)-(Q(Zi)||40)-96-50));Qe(()=>{let e=Q(Qi);Q(Yi)>e&&I(Yi,e,!0)});function $i(e){I(Ji,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function ea(e){Q(Ji)&&I(Yi,Math.min(Math.max(56,Q(Yi)-e.movementY),Q(Qi)),!0)}function ta(e){Q(Ji)&&(I(Ji,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),nt.setItem(`explorerRootsH`,String(Q(Yi))))}function na(){I(Yi,Math.min(160,Q(Qi)),!0),nt.setItem(`explorerRootsH`,String(Q(Yi)))}function ra(e){let t=[],n=(r,i)=>{for(let a of e.folders.filter(e=>(e.parentId??null)===r)){let r=er(e,a);t.push({folder:r,depth:i,hasChildren:e.folders.some(e=>e.parentId===a.id)}),Q(pn).has(r.id)&&n(a.id,i+1)}};return n(null,0),t}async function ia(e){let t=e.currentTarget;await Eb();let n=t?.getBoundingClientRect(),r=(ye()??[]).filter(e=>e.hasLibrary),i=new Set(te().map(e=>e.sessionId));I(un,{x:n?n.right:e.clientX,y:n?n.bottom:e.clientY,maxHeight:360,items:r.length?[{section:`Mount a saved project`},...r.map(e=>({label:e.name+` (`+uo(e.libraryCount??0,`file`)+`)`,icon:`hard-drive`,checked:i.has(e.id),tooltip:i.has(e.id)?`Already mounted`:`Browse this projectâs files here â your open project is not touched`,action:()=>void ca(e.id)})),...aa()]:[{label:`No saved projects yet`,tooltip:`Sessions ⸠"Save current project" stores the scene AND every Explorer file â that is what a mount reads`,action:()=>{}},...aa()]},!0)}function aa(){return[{section:`From a file`},{label:`Import project (.tp)â¦`,icon:`folder-input`,tooltip:`Reads a .tp file into your saved projects and mounts it here straight away. Your open project, its Library and its manifest are untouched.`,action:()=>Q(oa)?.click()}]}let oa=t(void 0);async function sa(e){let t=e.currentTarget,n=t?.files?.[0];if(n){let{importProjectAsSession:e}=await $(async()=>{let{importProjectAsSession:e}=await import(`../chunks/D3XMbCQo.js`);return{importProjectAsSession:e}},[],import.meta.url),t=await e(await n.arrayBuffer(),{fileName:n.name});t?.id&&await ca(t.id)}t&&(t.value=``)}async function ca(e){let t=await IZ(e);if(!t)return;let n=new Set(Q(pn));n.add(AZ(t.id)),I(pn,n,!0),nt.setItem(`explorerExpanded`,JSON.stringify([...n])),zs(AZ(t.id))}function la(e){let t=A(),n=AZ(e.id),r=r=>{if(A()!==n){r&&kZ(A())?.volumeId===e.id&&zs(null);return}let i=t;r&&kZ(i)?.volumeId===e.id&&(i=null);let a=da(i)?i:null;Ba.set(a)},i=()=>{LZ(e.id),r(!0)};if(!e.dirty)return i();zs(n),ya({icon:`hard-drive`,safe:!0,noSettings:!0,title:`Unmount â`+e.name+`â with unsaved changes?`,detail
2489:`These are its files. Save writes them back into the saved project; discard throws the edits away.`,confirmLabel:`Save and unmount`,run:()=>{(async()=>{await $Z(e.id)?i():r(!1)})()},altLabel:`Discard and unmount`,alt:i,cancel:()=>r(!1)})}let ua=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function da(e){if(e==null)return!0;let t=kZ(e);if(t){let e=te().find(e=>e.id===t.volumeId);return e?!t.folderId||e.folders.some(e=>e.id===t.folderId):!1}return e.startsWith(`deleted:`)?Q(cr).nodes.has(e.slice(8)):!ua.test(e)||P().some(t=>t.id===e)}async function fa(e,t){let n=0,r=0;for(let i of e){let e=await BZ(i.volumeId,i.id);if(!e){r++;continue}await Wa(await e.arrayBuffer(),i.name,t,{imported:!0}),n++}return n?es(uo(n,`file`)+` copied into your Library`+(r?` (`+r+` had no bytes)`:``)):r&&es(`Those bytes are not in the saved project any more`),n}async function pa(e,t,n){let r=0;for(let i of n){let n=y().find(e=>e.id===i);if(!n)continue;let a=await Ja(n.id);a&&(ZZ(e,{name:n.name,kind:n.kind,hash:n.hash,buffer:await a.arrayBuffer(),folderId:t,thumbnail:n.thumbnail??null}),r++)}return r&&es(uo(r,`file`)+` copied into the mount â press Save to write it back`),r}function ma(e){JZ(e.volumeId,e.id),bi([]),es(e.name+` removed from the mount â Refresh undoes it, Save writes it back`)}function ha(e){let t=XZ(e.volumeId,e.folderId);ya({title:`Remove "`+e.name+`" from this mount?`,detail:uo(t.folders,`folder`)+` and `+uo(t.items,`file`)+` â buffered, so Refresh undoes it and nothing reaches the saved project until you press Save.`,confirmLabel:`Remove`,run:()=>{YZ(e.volumeId,e.folderId),bi([])}})}function ga(e,t){e.preventDefault(),e.stopPropagation(),I(un,{x:e.clientX,y:e.clientY,items:[{label:`Open`,icon:`folder`,action:()=>zs(AZ(t.id))},{label:`Refresh`,icon:`refresh-cw`,tooltip:t.dirty?`Re-read this project from disk â YOUR UNSAVED EDITS HERE ARE DISCARDED`:`Re-read this project from disk`,action:()=>void RZ(t.id)},...t.dirty?[{label:`Save changes`,icon:`save`,tooltip:`Write these files back into the saved project`,action:()=>void $Z(t.id)}]:[],{section:`Mount`},{label:`Unmount`,icon:`x`,danger:t.dirty,tooltip:`Stop showing this project here. The saved project is not deleted.`,action:()=>la(t)}]},!0)}Qe(()=>{ye(),te().length&&K(()=>void zZ())});let _a=t(null);function va(){I(_a,null),Ss.set(`explorer`),dc.set(!0)}function ya(e){I(_a,e,!0)}function ba(){let e=Q(_a);I(_a,null),e?.run()}function Da(){let e=Q(_a);I(_a,null),e?.alt?.()}function Ma(){let e=Q(_a);I(_a,null),e?.cancel?.()}let Ra=q(be),Ua=t(!1),Ga=t(!1);Qe(()=>{Q(Ra),I(Ua,!1),I(Ga,!1)});function Xa(e){let t=Q(Ra)?.items?.length??0;YS(e,Q(Ga)),e===`share`&&es(`Sharing ${t} file${t===1?``:`s`} with the session`)}function Za(e){e.focus()}function Qa(e){iC({hash:e.hash,name:e.name,kind:e.kind,thumb:e.thumbnail,folderId:e.folderId??null,path:ree(e.folderId)}),tee(e.id,!0)}function $a(e){iC({hash:`prefab:`+e.id,name:e.name??`Prefab`,kind:`prefab`,thumb:e.thumbnail??null}),Nv(e.id)}function eo(e){let t=Ha(e.id);ya({title:`Delete "`+e.name+`"?`,detail:uo(t.folders,`folder`)+` and `+uo(t.items,`file`)+` move to Deleted, where the folder can be restored with its structure. Peers' copies move to their Deleted too.`,confirmLabel:`Delete folder`,run:()=>{fC(e.id),es(`â`+e.name+`â moved to Deleted`,[{label:`Open Deleted`,action:()=>zs(`deleted`)}])}})}function to(e){let t=e.dataTransfer?.getData(`application/x-explorer-item`);if(t)return{type:`item`,...JSON.parse(t)};let n=e.dataTransfer?.getData(`application/x-explorer-folder`);return n?{type:`folder`,...JSON.parse(n)}:null}function no(e){let t=e.dataTransfer?.types??[];return t.includes(`application/x-explorer-item`)||t.includes(`application/x-explorer-folder`)}function ro(e){let t=e?.items?.length?e.items:e?.type===`item`?[e]:[],n=e?.folders?.length?e.folders:e?.type===`folder`&&e.id?[e.id]:[];return{hashes:t.map(e=>String(e?.id??``)).filter(e=>e.startsWith(`deleted:`)).map(e=>e.slice(8)).filter(Boolean),nodes:n.map(e=>String(e??``)).filter(e=>e.startsWith(`deletedfolder:`)).map(e=>e.slice(14)).filter(Boolean)}}function io(e,t){let{hashes:n,nodes:r}=ro(e);if(!n.length&&!r.length)return!1;if(kZ(t))return es(`Restore puts files back in your Library â a mounted project is a different one`),!0;let i=t??null,a=i?P().find(e=>e.id===i)?.name??`the Library`:`the Library`,o=0,s=0,c=0,l=[];for(let e of r){let t=Q(cr).nodes.get(e);if(!t)continue;if(t.ghost){c++;continue}let n=QS(e,{into:i});s+=n.folders,o+=n.files,(n.folders||n.files)&&l.push(t.name)}for(let e of n){let t=Q(ir).find(t=>_d(t)===e)??Q(ir).find(t=>t.hash===e);dC(e,{into:i})&&(o++,l.push(String(t?.name??`file`)))}if(bi([]),Ys(),c&&!o&&!s)return es(`That folder is still in your Library â what is deleted are the files under it, so drag those`),!0;if(!o&&!s)return es(`Nothing there could be put back`),!0;let u=l.length===1?`â`+l[0]+`â`:[s&&uo(s,`folder`),o&&uo(o,`file`)].filter(
2489Boolean).join(` and `);return es(`Restored `+u+` into `+a,[{label:`Open`,action:()=>zs(i)}]),!0}function ao(e,t){if(typeof t==`string`&&t.startsWith(`deletedfolder:`))return;let n=to(e);if(I(dn,null),!n||(e.preventDefault(),e.stopPropagation(),io(n,t)))return;let r=n.items?.length?n.items:n.type===`item`?[n]:[];for(let e of r.filter(e=>e?.prefabId)){let n=Pv(e.prefabId);n&&ms(n,t)}let i=n.folders?.length?n.folders:n.type===`folder`?[n.id]:[],a=kZ(t),o=r.filter(e=>e?.volumeId);if(a){let e=a.volumeId;for(let t of o.filter(t=>t.volumeId===e))KZ(e,t.id,a.folderId);let t=0,n=0;for(let r of i){let i=kZ(r);i?.volumeId===e&&i.folderId?qZ(e,i.folderId,a.folderId)||n++:t++}let s=r.filter(e=>e&&!e.prefabId&&e.id&&!e.volumeId).map(e=>e.id);s.length&&pa(e,a.folderId,s),n&&es(`A folder can't move into its own subtree`),t&&es(uo(t,`folder`)+` stayed put â drag the FILES across, not the folder`),o.some(t=>t.volumeId!==e)&&es(`Copy between two mounted projects through your Library`);return}o.length&&fa(o,t);let s=r.filter(e=>e&&!e.prefabId&&e.id&&!e.volumeId).map(e=>e.id),c=0,l=i.filter(e=>!kZ(e));i.length!==l.length&&es(`A folder in a mounted project stays there â drag its FILES across`);for(let e of l)Ca(e,t)||c++;for(let e of s)Oa(e,t);c&&es(c===1&&l.length===1?`A folder can't move into its own subtree`:`${c} folder${c===1?``:`s`} could not move into their own subtree`)}function oo(e,t){typeof t==`string`&&t.startsWith(`deletedfolder:`)||no(e)&&(e.preventDefault(),e.stopPropagation(),I(dn,t,!0))}function so(e,t,n=!0){if(e.preventDefault(),t?.deletedNode)return Jo(e,t);if(!n&&(Q(vi).has(t.id)||bi([t.id]),Q(vi).size>1))return jo(e);if(t.volumeId){I(un,{x:e.clientX,y:e.clientY,items:[{label:`Open`,icon:`folder`,action:()=>zs(t.id)},{label:`New folder`,icon:`folder-plus`,action:()=>ji(t.id,!n)},{label:`Rename`,icon:`pencil`,action:()=>Mi(t,!n)},{label:`Remove`,icon:`trash-2`,danger:!0,tooltip:`Buffered â Refresh undoes it, Save writes it back to the saved project`,action:()=>ha(t)},{section:`Mount`},{label:`Refresh mount`,icon:`refresh-cw`,tooltip:`Re-read this project from disk â any unsaved edits here are discarded`,action:()=>void RZ(t.volumeId)}]},!0);return}I(un,{x:e.clientX,y:e.clientY,items:[...t.share===`peer`?[{label:`Shared by `+(Yt(t)||`a peer`),icon:`users`,tooltip:`Only whoever shared this folder can stop sharing it`,action:()=>{}}]:[t.share===`mine`?{label:`Unshare folder`,icon:`eye-off`,tooltip:`Stop offering this folder and its files to peers. Copies they already have stay theirs.`,action:()=>{_C(t.id),es(t.name+` is no longer shared`)}}:{label:`Share folder`,icon:`users`,tooltip:`Peers see this folder and its files, and anything you add to it later`,action:()=>{XS(t.id),es(`Sharing `+t.name+` with peers`)}}],{label:`Properties`,icon:`info`,action:()=>Rs({kind:`folder`,folder:t})},{label:`Duplicate folder`,icon:`copy`,hint:`Ctrl+D`,tooltip:`A copy of this folder and everything in it, beside it`,action:()=>void Pa(t.id).then(e=>e&&es(`Duplicated `+t.name+` as `+e.name))},{label:`Copy`,icon:`clipboard-copy`,hint:`Ctrl+C`,action:()=>{O3([{id:t.id,kind:`folder`}],`copy`,jr()),es(`Copied `+t.name+` â paste into a folder`)}},{label:`Cut`,icon:`scissors`,hint:`Ctrl+X`,action:()=>{O3([{id:t.id,kind:`folder`}],`cut`,jr()),es(`Cut `+t.name+` â paste into a folder to move it`)}},{label:j3(xe())+` here`,icon:`clipboard-paste`,hint:`Ctrl+V`,disabled:!xe()?.entries.length,tooltip:xe()?.entries.length?`Into `+t.name:`Copy or cut something first`,action:()=>void _o(t.id)},...n?[{label:`New subfolder`,icon:`folder-plus`,action:()=>ji(t.id)}]:[],{label:`Rename`,icon:`pencil`,action:()=>Mi(t,!n)},{label:`Export folder as .tp`,icon:`arrow-down-to-line`,tooltip:`This folder and everything under it as a project file â its scenes, their version history and the assets they use`,action:()=>b3({folderId:t.id})},{label:`Delete folder`,icon:`trash-2`,danger:!0,action:()=>eo(t)}]},!0)}async function co(e){let t=await Ja(e.id);if(!t)return es(`That file has no stored bytes to download`);let n=document.createElement(`a`);document.body.appendChild(n),n.style.display=`none`;let r=URL.createObjectURL(t);n.href=r,n.download=e.name||`download`,n.click(),URL.revokeObjectURL(r),n.remove()}function lo(e,t){let n=document.createElement(`a`);document.body.appendChild(n),n.style.display=`none`;let r=URL.createObjectURL(e);n.href=r,n.download=t,n.click(),URL.revokeObjectURL(r),n.remove()}let uo=(e,t)=>`${e} ${t}${e===1?``:`s`}`,fo=e=>!!e&&!e.packEntry&&!e.sceneEntry&&!e.remoteScene&&!e.remoteItem&&!e.volumeItem&&!e.deletedEntry&&e.kind!==`pack-folder`;function po(e){if(e!==void 0)return{ok:!0,folderId:e};let t=A();if(typeof t!=`string`||!t)return{ok:!Q(rr).inBin,folderId:null};let n=jr();return{ok:n!==null,folderId:n}}function mo(){let e=[];for(let t of wi())t.kind===`folder`&&t.folder&&!t.folder.deletedNode&&!t.folder.volumeId?e.push({id:t.folder.id,kind:`folder`}):t.kind===`item`&&t.item?.volumeItem?e.push({id:t.item.id,kind:`item`,volumeId:t.item.volumeId}):t.kind===`item`&&t.item&&fo(t.item)&&!t.item.packEntry&&!t.item.deletedEntry&&e.push({id:t.item.id,kind:`item`});return e}async function ho(){let e=mo().filter(e=>!e.volumeId),t=e=>e.kind===`item`?y().find(t=>
2489t.id===e.id):null;if(e.length===1&&t(e[0])?.kind===`scene`){zi(t(e[0]));return}let n=[],r=0;for(let i of e)if(i.kind===`folder`){let e=await Pa(i.id);e&&n.push(e.id)}else{if(t(i)?.kind===`scene`){r++;continue}let e=await za(i.id);e&&n.push(e.id)}if(n.length&&bi(n),!n.length&&!r)return es(`Nothing to duplicate here`);es((n.length?`Duplicated `+uo(n.length,`item`):``)+(r?(n.length?` â `:``)+uo(r,`scene`)+` skipped (duplicate a scene on its own, so it can take a name)`:``))}function go(e){let t=mo();if(e===`cut`){let e=t.filter(e=>!e.volumeId);if(!e.length)return es(`Nothing here can be cut â use Copy`);O3(e,`cut`,jr()),es(`Cut `+uo(e.length,`item`)+` â paste into a folder to move`);return}if(!t.length)return es(`Nothing to copy`);O3(t,`copy`,jr()),es(`Copied `+uo(t.length,`item`)+` â paste into a folder`)}async function _o(e){let t=xe();if(!t?.entries.length)return es(`Nothing to paste`);let n=po(e);if(!n.ok)return es(`Paste into a Library folder`);let r=n.folderId,i=[],a=t.entries.filter(e=>e.volumeId);a.length&&await fa(a.map(e=>vo(e.volumeId,e.id)).filter(Boolean),r);for(let e of t.entries)if(!e.volumeId){if(t.mode===`cut`){if(e.kind===`folder`)Ca(e.id,r)&&i.push(e.id);else{let t=y().find(t=>t.id===e.id);if(!t)continue;(t.folderId??null)!==(r??null)&&Oa(e.id,r),i.push(e.id)}}else if(e.kind===`folder`){let t=await Pa(e.id,r);t&&i.push(t.id)}else{let t=y().find(t=>t.id===e.id),n=t?.kind===`scene`?await zb(t,Rb(t.name),{folderId:r}):await za(e.id,{folderId:r});n&&i.push(n.id)}}t.mode===`cut`&&k3(),i.length?((r??null)!==(A()??null)&&A(),bi(i),es((t.mode===`cut`?`Moved `:`Pasted `)+uo(i.length,`item`))):a.length||es(`Nothing pasted`)}function vo(e,t){let n=te().find(t=>t.id===e)?.items?.find(e=>e.id===t);return n?{...n,volumeId:e}:null}function yo(){let e=wi(),t=e.filter(e=>e.kind===`folder`&&!e.folder?.deletedNode).map(e=>e.folder),n=e.filter(e=>e.kind===`item`&&fo(e.item)).map(e=>e.item);return{entries:e,folders:t,items:n,skipped:e.length-t.length-n.length}}function bo(){let{folders:e,items:t,skipped:n}=yo();if(!e.length&&!t.length)return es(n?`Nothing to delete â ${uo(n,`card`)} here ${n===1?`is a view`:`are views`} of something else (pack or scene contents)`:`Nothing selected`);let r=0,i=0;for(let t of e){let e=Ha(t.id);r+=e.folders-1,i+=e.items}let a=[];t.length&&a.push(uo(t.length,`item`)),e.length&&a.push(uo(e.length,`folder`));let o=r||i?` â with ${uo(r,`subfolder`)} and ${uo(i,`file`)} inside, all moving to Deleted where they can be restored`:``,s=n?`${uo(n,`pack/scene card`)} will be skipped.`:``;ya({title:`Delete ${a.join(` and `)}?`,detail:[o.replace(/^ â /,``),s].filter(Boolean).join(` `)||`This cannot be undone.`,confirmLabel:`Delete`,run:()=>void xo(e,t)})}async function xo(e,t){let n=t.filter(e=>e.kind===`prefab`),r=t.filter(e=>e.kind!==`prefab`);for(let e of n)await Nv(e.prefabId);r.length&&oC(r.map(e=>e.id));for(let t of e)fC(t.id);bi([]),Ys()}function So(e,t){if(!e[t])return t;let n=t.lastIndexOf(`.`),r=n>0?t.slice(0,n):t,i=n>0?t.slice(n):``,a=2;for(;e[`${r} (${a})${i}`];)a++;return`${r} (${a})${i}`}function Co(){let e=jr();return e&&P().find(t=>t.id===e)?.name||`Library`}async function wo(){let e=yo().items.filter(e=>e.kind!==`prefab`&&e.id);if(!e.length)return es(`Nothing in this selection has stored bytes to download`);if(e.length===1)return co(e[0]);let{zipSync:t}=await $(async()=>{let{zipSync:e}=await import(`../chunks/BJRbKqus.js`).then(e=>e.t);return{zipSync:e}},__vite__mapDeps([98,1]),import.meta.url),n={},r=0;for(let t of e){let e=await Ja(t.id);if(!e){r++;continue}n[So(n,t.name||`file`)]=new Uint8Array(await e.arrayBuffer())}let i=Object.keys(n).length;if(!i)return es(`None of those files still have stored bytes`);lo(new Blob([t(n,{level:6})],{type:`application/zip`}),No(Co())+`.zip`),es(`Downloaded ${uo(i,`file`)} as a .zip`+(r?` (${r} had no bytes)`:``))}function Eo(e){if(!e||e.kind!==`scene`||e.packEntry||e.sceneEntry||e.remoteScene)return[];let t=yd(e.hash),n=t?bd(t):null;return[...new Set((n?.history??[]).filter(Boolean))]}async function Do(e){let t=yd(e.hash),n=Eo(e);if(!t||n.length<2)return es(`That scene has only one version â use Download for it`);let{zipSync:r}=await $(async()=>{let{zipSync:e}=await import(`../chunks/BJRbKqus.js`).then(e=>e.t);return{zipSync:e}},__vite__mapDeps([98,1]),import.meta.url),i={},a=0;for(let e of n){let t=ka(e),n=t?await Ja(t.id):null;if(!n){a++;continue}let r=`${US(t.createdAt)}-${String(e).slice(0,8)}.tpscene`;i[So(i,r)]=new Uint8Array(await n.arrayBuffer())}let o=Object.keys(i).length;if(!o)return es(`None of ${t}'s ${uo(n.length,`version`)} still have stored bytes here`);lo(new Blob([r(i,{level:6}
2489)],{type:`application/zip`}),`${GS(t)||`scene`}-versions.zip`),es(`Downloaded ${uo(o,`version`)} of ${t} as a .zip`+(a?` â ${a} whose bytes are not on this machine ${a===1?`was`:`were`} left out`:``))}async function Oo(){let e=[],t=0;for(let n of yo().items)if(n.kind===`prefab`){let r=Mv(n.prefabId);r?e.push(r):t++}else if(n.kind===`object`){let r=await Ja(n.id);if(!r){t++;continue}try{e.push(await xa(await r.arrayBuffer(),n.name.split(`.`).pop()?.toLowerCase()??`glb`))}catch{t++}}if(!e.length)return es(`Select prefabs or 3D objects to export as GLTF`);HS(e,No(Co())+`.gltf`),es(`Exported ${uo(e.length,`object`)} as one GLTF`+(t?` (${t} could not be read)`:``))}function ko(){let{items:e,folders:t,skipped:n}=yo();return{files:e.filter(e=>e.kind!==`prefab`&&e.id).length,models:e.filter(e=>e.kind===`prefab`||e.kind===`object`).length,deletable:e.length+t.length,skipped:n}}function jo(e){let t=Q(vi).size,n=ko(),r=[];n.files&&r.push({label:n.files===1?`Download`:`Download ${uo(n.files,`file`)} as .zip`,icon:`arrow-down-to-line`,tooltip:`Save them to your computer â several files come down as one .zip`,action:()=>void wo()}),n.models&&r.push({label:`Export ${uo(n.models,`object`)} as GLTF`,icon:`box`,tooltip:`One .gltf file containing every selected prefab and 3D object`,action:()=>void Oo()});let i=yo(),a=i.items.filter(e=>Wt(e)!==`mine`&&Wt(e)!==`peer`),o=i.items.filter(e=>Wt(e)===`mine`),s=i.folders.filter(e=>e.share!==`mine`&&e.share!==`peer`),c=i.folders.filter(e=>e.share===`mine`);(a.length||s.length)&&r.push({label:`Share `+uo(a.length+s.length,`item`),icon:`users`,tooltip:`Let peers in this session see and download them`,action:()=>{for(let e of s)XS(e.id);for(let e of a)ZS(e.id);es(`Sharing `+uo(a.length+s.length,`item`)+` with peers`)}}),(o.length||c.length)&&r.push({label:`Unshare `+uo(o.length+c.length,`item`),icon:`eye-off`,tooltip:`Stop offering them. Copies peers already downloaded stay theirs.`,action:()=>{for(let e of c)_C(e.id);for(let e of o)rC(e.id);es(uo(o.length+c.length,`item`)+` no longer shared`)}});let l=mo().length;l&&r.push({label:`Duplicate ${uo(l,`item`)}`,icon:`copy`,hint:`Ctrl+D`,action:()=>void ho()},{label:`Copy ${uo(l,`item`)}`,icon:`clipboard-copy`,hint:`Ctrl+C`,action:()=>go(`copy`)},{label:`Cut ${uo(l,`item`)}`,icon:`scissors`,hint:`Ctrl+X`,action:()=>go(`cut`)}),n.deletable&&r.push({label:`Delete ${uo(n.deletable,`item`)}`,icon:`trash-2`,danger:!0,action:bo}),r.push({label:`Clear selection (${t})`,icon:`x`,action:()=>bi([])}),I(un,{x:e.clientX,y:e.clientY,items:r},!0)}let Mo=()=>[...Se()??[]],No=e=>String(e||`prefab`).replace(/[^\w-]+/g,`_`);function Po(e){let t=new Blob([Yde(e)],{type:`application/json`}),n=document.createElement(`a`);document.body.appendChild(n),n.style.display=`none`;let r=URL.createObjectURL(t);n.href=r,n.download=No(e.name)+`.prefab.json`,n.click(),URL.revokeObjectURL(r),n.remove()}function Fo(e){let t=Mv(e.id);if(!t)return es(`This prefab could not be loaded`);HS(t,No(e.name)+`.gltf`)}async function Io(e){let t=Mv(e.id);if(!t)return es(`This prefab could not be loaded`);let n=bme(e.name);n.objects=[t.toJSON()],n.count=1,n.thumbnail=e.thumbnail??null;let r=await Mb(n,{assets:!1,packs:!1,flow:!0});lo(new Blob([r],{type:`application/zip`}),No(e.name)+`.tpscene`),es(`Exported "${e.name}" as a scene`)}function Lo(e){let t=Mo();if(!t.length)return es(`Select the object (or objects) to save into this prefab first`);if(we())return es(`Replace "${e.name}" with ${t.length===1?`the selected object`:t.length+` selected objects`}?`,[{label:`Update`,action:()=>void Ro(e,t)},{label:`Cancel`,action:()=>{}}]);Ro(e,t)}async function Ro(e,t){let n=Zde(e.id),r=await $de(e.id,t,{toast:!1});r&&es(`Updated "${r.name}" from ${t.length===1?`the selection`:t.length+` selected objects`}`,n?[{label:`Undo`,action:()=>void zo(n,r.name)}]:void 0)}async function zo(e,t){let n=await Kde(e);es(n?`Restored the previous "${n.name}"`:`"${t}" is no longer in your library`)}async function Bo(){let e=Mo();if(!e.length)return es(`Select the object (or objects) to save as a prefab first`);await Qde(e)}function Vo(e,t){let n=Pv(t.prefabId);n&&I(un,{x:e.clientX,y:e.clientY,items:[{label:`Add to scene`,icon:`boxes`,tooltip:`Place a copy of this prefab in the scene (every peer gets it)`,action:()=>jv(n)},{label:`Duplicate`,icon:`copy`,hint:`Ctrl+D`,tooltip:`A copy of this prefab under a new name`,action:()=>void Jde(n.id).then(e=>e&&es(`Duplicated as `+e.name))},{label:`Export`,icon:`arrow-down-to-line`,children:[...LC(n)!==`snapshot`&&n.bytes?[{label:`The original file (.`+LC(n)+`)`,tooltip:`The exact bytes this prefab was saved from â nothing is converted or re-exported`,action:()=>S_e(n.bytes,IC(n))}]:[],{label:`GLTF`,tooltip:`A .gltf model file other tools can open`,action:()=>Fo(n)},{label:`prefab (.json)`,tooltip:`This prefab as a file â import it back on any machine`,action:()=>Po(n)},{label:`scene (.tpscene)`,tooltip:`A scene containing just this prefab â opens like any other scene file`,action:()=>void Io(n)}]},{label:`Update from selection`,tooltip:`Re-save this prefab from the objects selected in the scene`,action:()=>Lo(n)},{label:`Properties`,icon:`info`,action:()=>Rs({kind:`item`,item:t})},{label:`Rename`,icon:`pencil`,action:()=>Ii(t)},{label:`Delete`,icon:`trash-2`,danger:!0,action:()=>void Wo(n)}]},!0)}function Ho(e,t){if(e.preventDefault(),e.stopPropagation(),Q(vi).has(t.id)||bi([t.id]),Q(vi).size>1)return jo(e);if(t.kind===`pack-folder`){let n=jm(t.packName);n&&Vn(e,n);return}if(t.volumeItem){I(un,{x:e.clientX,y:e.clientY,items:[t.kind===`scene`?{label:`Open here (this screen)`,icon:`external-link`,tooltip:`Load this
2489scene into the viewport. It stays outside your Library until you save it in.`,action:()=>void tc(t)}:{label:`Open`,icon:`external-link`,action:()=>void tc(t)},{label:`Copy to Library`,icon:`download`,tooltip:`Import these bytes into your own library â deduped by content hash, like any other import`,action:()=>void fa([t],jr())},{label:`Copy`,icon:`clipboard-copy`,hint:`Ctrl+C`,tooltip:`Paste into a Library folder to import it there`,action:()=>{O3([{id:t.id,kind:`item`,volumeId:t.volumeId}],`copy`,jr()),es(`Copied `+t.name+` â paste into a Library folder`)}},{section:t.volumeName??`Mounted project`},{label:`Rename`,icon:`pencil`,action:()=>Ni(t)},{label:`Remove`,icon:`trash-2`,danger:!0,tooltip:`Buffered â Refresh undoes it, Save writes it back to the saved project`,action:()=>ma(t)},{label:`Properties`,icon:`info`,action:()=>Rs({kind:`item`,item:t})}]},!0);return}if(t.kind===`prefab`){Vo(e,t);return}if(t.deletedEntry){let n=Yt(t);I(un,{x:e.clientX,y:e.clientY,items:[t.restorable?{label:`Restore`,icon:`rotate-ccw`,tooltip:t.location?`Put it back in `+t.location:`Put it back in the Library`,action:()=>{dC(t.binKey??t.hash),es(`Restored `+t.name)}}:{label:`Cleaned up on this device`,tooltip:`The bytes were freed from Deleted on this machine, so it cannot be restored from here. A peer who still has it in their Deleted can restore it.`,action:()=>{}},...t.restorable?[{label:`Delete permanently`,icon:`trash-2`,danger:!0,tooltip:`Free the disk on THIS machine. Peers keep their own copies.`,action:()=>{gC(t.binKey??t.hash),es(t.name+` removed from this device`)}}]:[],{label:`Deleted by `+(n||`someone`)+` · `+new Date(t.createdAt).toLocaleString(),action:()=>{}},...t.location?[{label:`Location: `+t.location,action:()=>{}}]:[]]},!0);return}if(!t.sceneEntry){if(t.remoteItem){let n=Yt(t);I(un,{x:e.clientX,y:e.clientY,items:[{label:`Download from peers`,icon:`download`,tooltip:`Shared`+(n?` by `+n:``)+` â the bytes are not here yet. This asks the mesh for them.`,action:()=>{tC(t.hash)&&es(`Fetching `+t.name+` from peersâ¦`)}},...uC(t)?[{label:`Unshare`,icon:`eye-off`,tooltip:`Take it out of the project. You do not hold this file, so there is nothing here to lose.`,action:()=>{JS(t.rowKey??t.hash),es(t.name+` is no longer shared`)}}]:[],{label:`Properties`,icon:`info`,action:()=>Rs({kind:`item`,item:t})}]},!0);return}if(t.remoteScene){I(un,{x:e.clientX,y:e.clientY,items:[{label:`Open here (downloads it)`,icon:`download`,tooltip:`This project scene is not on this device yet â opening it fetches it from a peer`,action:()=>void Zs(t)},...at(t)]},!0);return}I(un,{x:e.clientX,y:e.clientY,items:[...t.kind===`scene`?[{label:`Open here (this screen)`,icon:`external-link`,tooltip:`Load this scene locally â use a Travel node to move every player together`,action:()=>void Zs(t)},{label:`Version history`,icon:`history`,tooltip:`Earlier versions of this scene â restore, pin or free their bytes`,action:()=>Rs({kind:`item`,item:t})},...at(t),...Fi(t)]:[],{label:`Duplicate`,icon:`copy`,hint:`Ctrl+D`,disabled:!!t.packEntry,tooltip:t.packEntry?`Packs are read-only bundles`:t.kind===`scene`?`A copy of this scene under a new name â its own file, its own version history`:`A second copy beside this one â same bytes, its own record`,action:()=>t.kind===`scene`?zi(t):void za(t.id).then(e=>e&&bi([e.id]))},...t.packEntry?[]:[{label:`Copy`,icon:`clipboard-copy`,hint:`Ctrl+C`,tooltip:`Then paste into another folder`,action:()=>{O3([{id:t.id,kind:`item`}],`copy`,jr()),es(`Copied `+t.name+` â paste into a folder`)}},{label:`Cut`,icon:`scissors`,hint:`Ctrl+X`,tooltip:`Then paste into another folder to move it`,action:()=>{O3([{id:t.id,kind:`item`}],`cut`,jr()),es(`Cut `+t.name+` â paste into a folder to move it`)}}],...t.kind===`text`?[{label:`Copy contents`,icon:`copy`,tooltip:`Copy the file text to the clipboard (96)`,action:async()=>{let e=await Ja(t.id);e&&navigator.clipboard?.writeText(await e.text())}}]:[],...t.packEntry?[]:[{label:t.kind===`scene`?`Download (.tpscene)`:`Download`,icon:`download`,tooltip:`Save this file to your computer`,action:()=>co(t)}],...Wt(t)===`peer`?[uC(t)?{label:`Unshare`,icon:`eye-off`,tooltip:`Take it out of the project for everyone. Owner: `+(Yt(t)||`unknown`)+`. Nobody loses the copy they already have.`,action:()=>{rC(t.id),es(t.name+` is no longer shared`)}}:{label:`Owner: `+(Yt(t)||`a peer`),icon:`users`,tooltip:`Settings has this project set so only the owner may unshare. Your copy stays either way.`,action:()=>{}}]:[Wt(t)===`mine`?{label:`Unshare`,icon:`eye-off`,tooltip:`Stop offering this to peers. Copies they already downloaded stay theirs.`,action:()=>{rC(t.id),es(t.name+` is no longer shared`)}}:{label:`Share with peers`,icon:`share-2`,tooltip:`Let peers in this session see and download this file`,action:()=>{ZS(t.id),es(`Sharing `+t.name+` with peers`)}}],{label:`Properties`,icon:`info`,action:()=>Rs({kind:`item`,item:t})},{label:`Rename`,icon:`pencil`,action:()=>Ni(t)},Gt(t)?{label:`Delete for everyone`,icon:`trash-2`,danger:!0,tooltip:`Removes it from the project. Every copy moves to Deleted files, where it can be restored.`,action:()=>{Vge(t.id),es(t.name+` deleted for everyone â restore it from Deleted files`)}}:{label:`Delete`,icon:`trash-2`,danger:!0,tooltip:`Moves it to Deleted, where you can restore it`,action:()=>void Uo(t)}]},!0)}}function Uo(e){let t=()=>{Qa(e),es(e.name+` moved to Deleted`)};if(Ee())return t();
2489ya({title:`Delete â`+e.name+`â?`,detail:`It moves to Deleted, where you can restore it or free the disk. Nobody else has this file, so nobody else is affected.`,confirmLabel:`Delete`,run:t})}function Wo(e){let t=()=>{$a(e),es((e.name??`Prefab`)+` moved to the Deleted log`)};if(Ee())return t();ya({title:`Delete prefab â`+(e?.name??``)+`â?`,detail:`The prefab is removed. A record of it stays in the Deleted log, but a prefab cannot be restored from there yet.`,confirmLabel:`Delete`,run:t})}function Go(){let e=sC(T()).length;e&&ya({title:`Empty Deleted?`,detail:`Reclaims the disk for `+uo(e,`deleted file`)+` and clears the record. This machine only â every peer keeps its own bin, and nothing already restored is affected.`,confirmLabel:`Empty`,run:()=>void Hge().then(e=>es(`Emptied `+uo(e,`file`)+` from Deleted`))})}function Ko(){let e=Q(di);e&&ya({title:`Clear the log?`,detail:`Forgets `+uo(e,`cleaned-up record`)+` â deletions whose bytes are already gone from this device. Files still in Deleted stay restorable, and peers keep their own record.`,confirmLabel:`Clear`,run:()=>{let e=Wge();es(`Cleared `+uo(e,`record`)+` from the log`)}})}function qo(){let e=V().deleted??{key:`deletedAt`,dir:-1},t=e.key===`deletedAt`,n=Q(li);return[{section:`View`},{label:`Plain list without folders`,checked:F()===`plain`,tooltip:`Every deleted file in one flat list, with a Location column saying where it was`,action:()=>Z4.set(F()===`plain`?`tree`:`plain`)},{label:`Show cleaned-up files`,checked:ie(),disabled:!he(),tooltip:he()?`Also list the deletions whose bytes are already gone from this device`:`Switched off in File settings`,action:()=>Q4.update(e=>!e)},{section:`Group`},{label:`No grouping`,checked:ge()===`none`,action:()=>J4.set(`none`)},{label:`By who deleted it`,checked:ge()===`deleter`,tooltip:`One section per person, yours first`,action:()=>J4.set(`deleter`)},{section:`Sort`},{label:`Newest deleted first`,checked:t&&e.dir===-1,action:()=>q4.update(e=>({...e,deleted:{key:`deletedAt`,dir:-1}}))},{label:`Oldest deleted first`,checked:t&&e.dir===1,action:()=>q4.update(e=>({...e,deleted:{key:`deletedAt`,dir:1}}))},{label:`By name`,checked:e.key===`name`,action:()=>q4.update(e=>({...e,deleted:{key:`name`,dir:1}}))},...n||Q(ui)&&ie()?[{section:`Disk`}]:[],...n?[{label:`Empty Deleted (`+n+`)`,danger:!0,icon:`trash-2`,tooltip:`Reclaim the disk on THIS machine and clear the record. Peers keep their own bins.`,action:()=>void Go()}]:[],...Q(di)&&ie()?[{label:`Clear the log (`+Q(di)+`)`,danger:!0,icon:`trash-2`,tooltip:`Forgets the deletions whose bytes are already gone from this device. Files still in Deleted stay restorable; peers keep their own record.`,action:()=>void Ko()}]:[]]}function Jo(e,t){e.preventDefault(),e.stopPropagation();let n=Q(cr).descendants(t.nodeId),r=n.items.filter(e=>sr(e)).length,i=uo(n.folders.length,`folder`)+` and `+uo(n.items.length,`file`),a=t.row?Yt({owner:t.row.by??null}):``;I(un,{x:e.clientX,y:e.clientY,items:[{label:`Open`,icon:`folder`,action:()=>zs(`deleted:`+t.nodeId)},{label:`Restore folder (`+i+`)`,icon:`rotate-ccw`,tooltip:`Puts back the folder and everything in it that this machine still holds, where it was`,action:()=>{let e=QS(t.nodeId);es(`Restored `+t.name+` â `+uo(e.files,`file`)+` put back`)}},...r?[{label:`Delete permanently (`+r+`)`,icon:`trash-2`,danger:!0,tooltip:`Free the disk on THIS machine for everything inside. Peers keep their own copies.`,action:()=>{Pge(t.nodeId).then(e=>es(`Freed `+uo(e,`file`)+` from this device`))}}]:[],{label:t.ghost?`Still in Library â holds deleted files`:`Deleted by `+(a||`someone`)+` · `+new Date(Number(t.row?.at)||0).toLocaleString(),action:()=>{}}]},!0)}function Xo(e){e.preventDefault(),I(un,{x:e.clientX,y:e.clientY,items:[{label:`Open`,action:()=>zs(`deleted`)},...qo()]},!0)}function Qo(e){e.preventDefault(),e.stopPropagation();let t=Xn,n=e=>{let t=new Set(Q(Pt));t.has(e)?t.delete(e):t.add(e),I(Pt,t,!0)},r=t.map(e=>({label:Yn[e]??e,checked:Q(Pt).has(e),action:()=>n(e)}));r.unshift({section:`Type`}),r.push({section:`Visibility`}),r.push({label:`Local only`,checked:Q(Ft),icon:`eye-off`,tooltip:`Show only the files nobody else can see yet â folders included`,action:()=>I(Ft,!Q(Ft))}),Q(Ut)&&r.push({label:`Clear filters`,action:()=>{I(Pt,new Set,!0),I(Ft,!1)}}),I(un,{x:e.clientX,y:e.clientY,items:r},!0)}function ts(e){if(e.target?.closest(`.explorer-card, .explorer-folder-card`))return;if(Q(Qn)){e.preventDefault();let t=Q($n);I(un,{x:e.clientX,y:e.clientY,items:[{label:`New folder`,icon:`folder-plus`,tooltip:`Inside this mounted project â buffered until you press Save`,action:()=>ji(A()??null,!0)},{section:t?.name??`Mounted project`},{label:`Refresh`,icon:`refresh-cw`,tooltip:t?.dirty?`Re-read this project from disk â YOUR UNSAVED EDITS HERE ARE DISCARDED`:`Re-read this project from disk`,action:()=>void RZ(Q(Qn).volumeId)},...t?.dirty?[{label:`Save changes`,icon:`save`,tooltip:`Write these files back into the saved project`,action:()=>void $Z(Q(Qn).volumeId)}]:[],{label:`Unmount`,icon:`x`,danger:!!t?.dirty,tooltip:`Stop showing this project here. The saved project is not deleted.`,action:()=>t&&la(t)}]},!0);return}if(Q(rr).inBin){e.preventDefault(),I(un,{x:e.clientX,y:e.clientY,items:qo()},!0);return}let t=A()===`packs`||typeof A()==`string`&&A().startsWith(`pack:`),n=!t&&A()===`prefabs`;if(t||n||typeof A()!=`string`||!A().startsWith(`scene`)){if(e.preventDefault(),n){I(un,{x:e.clientX,y:e.clientY,items:[{label:`Create from selection`,icon:`boxes`,tooltip:`Save the objects selected in the scene as a new prefab`,action:()=>void Bo()}]},!0);return}I(un,{x:e.clientX,y:e.clientY,items:t?[{label:`ï¼ Create packâ¦`,icon:`package-open`,tooltip:`An empty pack of your own â drag files from the Library into it`,action:Vi},{label:`ï¼ Import pack (.zip)`,icon:`package`,action:()=>Q(bn)?.click()},{label:`Load pack from URL`,icon:`globe`,action:ns}]:[{label:j3(xe()),icon:`clipboard-paste`,hint:`Ctrl+V`,disabled:!xe()?.entries.length,tooltip:xe()?.entries.length?(xe().mode===`cut`?`Move`:`Copy`)+` into this folder`:`Copy or cut something first (Ctrl+C / Ctrl+X on a card)`,action:()=>void _o()},{label:`New folder`,icon:`folder-plus`,action:()=>ji(A()??null,!0)}
2489,{label:`Save sceneâ¦`,icon:`save`,tooltip:`Save this scene as a .tpscene asset a Travel node can load`,action:()=>Ri(`save-scene`)},{label:`New sceneâ¦`,icon:`file-plus`,tooltip:`An EMPTY scene asset â it captures nothing from what is open`,action:()=>Ri(`new-scene`)},...A()?[{label:`Export folder as .tp`,icon:`arrow-down-to-line`,tooltip:`This folder and everything under it as a project file â its scenes, their version history and the assets they use`,action:()=>b3({folderId:A()})}]:Cd()||y().length>0||P().length>0?[{label:`Export project (.tp)`,icon:`arrow-down-to-line`,tooltip:`The project manifest, every scene version still stored here, and the assets it uses â as one file`,action:()=>b3()}]:[],{label:`Import project as folder (.tp)â¦`,icon:`folder-input`,tooltip:`Adds a .tp fileâs contents to your library as one folder â nothing opens, your project stays`,action:()=>Q(xn)?.click()},{section:`Disk`},{label:`Storage usedâ¦`,icon:`hard-drive`,tooltip:`What is using this deviceâs storage, and what can be cleaned up`,action:SX}]},!0)}}async function ns(){let e=prompt(`Pack URL â a .zip, or a GitHub repo link:`);if(!e)return;let t=e.trim(),n=t.match(/^https?:\/\/github\.com\/([^/]+)\/([^/?#]+)\/?$/);n&&(t=`https://codeload.github.com/${n[1]}/${n[2].replace(/\.git$/,``)}/zip/refs/heads/main`);try{let e=await fetch(t);if(!e.ok)return es(`Could not fetch that URL (HTTP ${e.status})`);if(!(/\.zip($|\?)/i.test(t)||n||(e.headers.get(`content-type`)||``).includes(`zip`)))return es(`Only .zip / GitHub-repo pack URLs are supported for now`);let r=await Mm(new File([await e.blob()],(t.split(`/`).pop()||`pack`)+`.zip`));I(_n,!0),zs(`pack:`+r.name),es(`Loaded pack "${r.title}"`)}catch{es(`Could not load the pack (network / CORS â try a direct .zip URL)`)}}function is(e){if(I(nn,!1),no(e))return;e.preventDefault();let t=e.dataTransfer?.files;if(!t?.length)return;let n=A(),r=kZ(n);if(r){as(t,r);return}if(n===`packs`||typeof n==`string`&&n.startsWith(`pack:`)){let e=Array.from(t).find(e=>e.name.toLowerCase().endsWith(`.zip`));e?On(e):es(`Only pack .zip files can be dropped into Packs`);return}if(typeof n==`string`&&n.startsWith(`scene`)){es(`This view is read-only â drop files into a Library folder`);return}let i=[];for(let e of Array.from(t))e.name.toLowerCase().endsWith(`.tp`)?os(e):i.push(e);i.length&&qa(i,n===`prefabs`?null:n,{duplicates:`ask`})}async function as(e,t){let n=0,r=0;for(let i of[...e]){let e=Aa(i.name);if(!e||i.size>26214400){r++;continue}let a=await i.arrayBuffer();ZZ(t.volumeId,{name:i.name,kind:e,hash:await Ia(a),buffer:a,folderId:t.folderId}),n++}n&&es(uo(n,`file`)+` added to the mount â press Save to write it back`),r&&es(uo(r,`file`)+` skipped (unsupported, or over the 25 MB limit)`)}async function os(e){let{importProjectAsFolder:t}=await $(async()=>{let{importProjectAsFolder:e}=await import(`../chunks/D3XMbCQo.js`);return{importProjectAsFolder:e}},[],import.meta.url);await t(await e.arrayBuffer(),{fileName:e.name,parentId:jr()})}async function ss(e){let t=e.currentTarget,n=t?.files?.[0];n&&await os(n),t&&(t.value=``)}function cs(e){return{...e.volumeId?{volumeId:e.volumeId,hash:e.hash,size:e.size}:{},id:e.id??null,kind:e.kind,name:e.name,prefabId:e.prefabId??null,url:e.glbUrl??null,...e.lods?{lods:e.lods}:{},...e.behavior?{behavior:e.behavior}:{}}}function ls(e){let t=cs(e);if(!Q(vi).has(e.id)||Q(vi).size<2)return t;let n=wi().filter(e=>e.kind===`item`).map(e=>cs(e.item)),r=us(),i=n.length>1?{...t,items:n}:{...t};return r.length&&(i.folders=r),i}function us(){return Q(vi).size<2?[]:wi().filter(e=>e.kind===`folder`).map(e=>e.folder.id)}function ds(e){let t={id:e.id};if(!Q(vi).has(e.id)||Q(vi).size<2)return t;let n=us();n.length>1&&(t.folders=n);let r=wi().filter(e=>e.kind===`item`).map(e=>cs(e.item));return r.length&&(t.items=r),t}function fs(e,t){e.dataTransfer?.setData(`application/x-explorer-item`,JSON.stringify(ls(t))),t?.deletedEntry?I(an,!0):I(rn,!0)}function ps(e,t){if(t?.deletedNode){if(t.ghost||!t.row)return e.preventDefault();e.dataTransfer?.setData(`application/x-explorer-folder`,JSON.stringify(ds(t))),I(an,!0);return}e.dataTransfer?.setData(`application/x-explorer-folder`,JSON.stringify(ds(t))),I(rn,!0)}async function ms(e,t){let n=LC(e);if(n===`snapshot`||!e.bytes)return es(`"`+e.name+`" is a snapshot prefab, not a file â re-save it with Save as⦠⸠Prefab (.glb) or (.tpscene) to move it into the Library`);let r=await Wa(e.bytes,IC(e),t);return r?(e.thumbnail&&nee(r.id,{thumbnail:e.thumbnail}),es(`"`+e.name+`" is in the Library as a .`+n),r):es(`Could not store "`+e.name+`"`)}async function hs(e){let t=e.kind===`scene`?`tpscene`:`glb`;
2489if(e.kind!==`scene`&&e.kind!==`object`)return es(`Only 3D objects and scene files can become prefabs (`+e.name+` is `+e.kind+`)`);let n=await Ja(e.id);if(!n)return es(`The bytes for "`+e.name+`" are not on this device`);let r=await n.arrayBuffer(),i=null;try{if(t===`glb`)i=(await xa(r,e.name.split(`.`).pop()?.toLowerCase()??`glb`))?.toJSON()??null;else{let{readSessionZip:t}=await $(async()=>{let{readSessionZip:e}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{readSessionZip:e}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url),n=await t(r),a=new Pn;a.name=e.name.replace(/\.tpscene$/i,``);for(let e of n?.objects??[])try{a.add(new Bn().parse(e))}catch{}i=a.children.length?a.toJSON():null}}catch{i=null}if(!i)return es(`"`+e.name+`" could not be read as a prefab`);let a=await Xde({name:e.name.replace(/\.[^.]+$/,``),element:i,thumbnail:e.thumbnail??void 0,format:t,bytes:r});return a&&es(`"`+a.name+`" is a prefab, still a .`+t),a}async function gs(e,t){let n=to(e);if(I(dn,null),I(rn,!1),!n||!t)return;if(e.preventDefault(),e.stopPropagation(),t.source==="default")return es(`"`+t.title+`" is a built-in pack â create one of your own to fill it`);let r=n.items?.length?n.items:n.type===`item`?[n]:[],i=n.folders?.length?n.folders:n.type===`folder`?[n.id]:[],a=[];for(let e of r){if(e?.prefabId||!e?.id)continue;let t=y().find(t=>t.id===e.id);t&&a.push(t)}for(let e of i){let t=La(e);for(let e of y().filter(e=>t.includes(e.folderId??``)))a.push(e)}if(!a.length)return es(`Drop library files or folders here to add them to this pack`);let o=koe(t.name,a);es(o?o+` file`+(o===1?``:`s`)+` added to "`+t.title+`"`:`Already in "`+t.title+`"`)}async function _s(e){let t=to(e);if(I(dn,null),I(rn,!1),!t)return;e.preventDefault(),e.stopPropagation();let n=(t.items?.length?t.items:t.type===`item`?[t]:[]).filter(e=>e&&!e.prefabId&&e.id).map(e=>y().find(t=>t.id===e.id)).filter(Boolean);if(!n.length)return es(`Drop a 3D object or a scene file here to make a prefab`);for(let e of n)await hs(e)}async function vs(e){let t=to(e);if(I(dn,null),I(on,!1),I(rn,!1),!t)return;e.preventDefault(),e.stopPropagation();{let{hashes:e,nodes:n}=ro(t);if(e.length||n.length)return es(`Already in Deleted â drop it on a Library folder to put it back there`)}let n=t.items?.length?t.items:t.type===`item`?[t]:[],r=t.folders?.length?t.folders:t.type===`folder`?[t.id]:[],i=0,a=0,o=0,s=[];for(let e of n){if(e.prefabId){let t=ae().find(t=>t.id===e.prefabId);t?($a(t),i++):o++;continue}let t=y().find(t=>t.id===e.id);t?s.push(t.id):o++}s.length&&(i+=oC(s));for(let e of r){let t=fC(e);i+=t.files,a++}if(bi([]),Ys(),!i&&!a)return es(o?`Nothing moved â ${uo(o,`card`)} here ${o===1?`is a view`:`are views`} of something else`:`Nothing to delete`);let c=[];i&&c.push(uo(i,`file`)),a&&c.push(uo(a,`folder`)),es(c.join(` and `)+` moved to Deleted`,[{label:`Open Deleted`,action:()=>zs(`deleted`)}])}let ys=t(null),bs=t(!1),xs=t(0),Cs=t(0),ws=0,Ts=0,Ds=0,Os=!1;function ks(e,t){if(e.pointerType===`mouse`)return;Ts=e.clientX,Ds=e.clientY;let n=e.currentTarget,r=e.pointerId,i=ls(t),a=i.items?.length??1,o=a>1?`${t.name} + ${a-1} more`:t.name;clearTimeout(ws),ws=window.setTimeout(()=>{I(ys,{payload:i,label:o},!0),I(bs,!0),I(xs,Ts,!0),I(Cs,Ds,!0);try{n.setPointerCapture?.(r)}catch{}try{navigator.vibrate?.(15)}catch{}},300)}function As(e){if(e.pointerType!==`mouse`){if(!Q(bs)){(Math.abs(e.clientX-Ts)>10||Math.abs(e.clientY-Ds)>10)&&clearTimeout(ws);return}e.preventDefault(),I(xs,e.clientX,!0),I(Cs,e.clientY,!0)}}function js(e){if(clearTimeout(ws),Q(bs)&&Q(ys)){let t=document.elementFromPoint(e.clientX,e.clientY);if(!t?.closest?.(`#explorer-list`)&&!t?.closest?.(`#explorer-window`)){let t=Q(ys).payload,n=e.clientX,r=e.clientY;$(()=>import(`../chunks/MphbKily.js`).then(e=>e.dropExplorerItem(t,n,r)),[],import.meta.url)}Os=!0}I(bs,!1),I(ys,null)}function Ms(e,t){if(Os){Os=!1;return}if(e.shiftKey||e.ctrlKey||e.metaKey){Ci(e,t.id,()=>I(gt,{kind:`item`,item:t},!0));return}bi([t.id]),Fs(t)}function Ns(e,t){if(e.shiftKey||e.ctrlKey||e.metaKey){Ci(e,t.id,()=>Ls(t));return}bi([t.id]),Q(pt)?zs(t.id):Ls(t)}async function Ps(e){let{holdLoadingToast:t}=await $(async()=>{let{holdLoadingToast:e}=await import(`../chunks/MphbKily.js`);return{holdLoadingToast:e}},[],import.meta.url),n=t(String(e.name||`model`));try{let t=await fetch(e.glbUrl);if(!t.ok)return n(),es(`Could not fetch the pack item`);let{placementGroupFor:r}=await $(async()=>{let{placementGroupFor:e}=await import(`../chunks/BgTLrJqP.js`).then(e=>e.o);return{placementGroupFor:e}},__vite__mapDeps([204,1,2,6,9,0,3,4,41,69,44,5,70,20,21,126,100,128,127,129,125,40,130,131,162]),import.meta.url);await zS(new File([await t.blob()],e.name+`.glb`),e.name,`glb`,void 0,void 0,{packRef:Gm(e.glbUrl,{pack:e.packName,item:e.name}),lod:r(e.glbUrl,e.lods),behavior:e.behavior??null}),n()}catch{n(),es(`Could not load the pack item (check the network / CORS)`)}}function Fs(e){if(e.kind===`prefab`){Ya.set(e.id),I(gt,{kind:`item`,item:e},!0);return}if(e.kind===`pack-folder`){zs(`pack:`+e.packName);return}if(e.packEntry){I(gt,{kind:`item`,item:e},!0);return}if(e.remoteScene){Ya.set(null),I(gt,{kind:`item`,item:e},!0);return}if(e.sceneEntry){let t=e.itemId?y().find(t=>
2489t.id===e.itemId):null;t&&Fs(t);return}if(e.volumeItem){Ya.set(null),I(gt,{kind:`item`,item:e},!0);return}Ya.set(e.id),I(gt,{kind:`item`,item:e},!0)}function Ls(e){Ya.set(null),I(gt,{kind:`folder`,folder:e},!0)}function Rs(e){e.kind===`item`?Fs(e.item):Ls(e.folder),Q(ht)?.showSecondary(`props`)}function zs(e){if(I(Nt,``),e===`deletedlog`){Q4.set(!0),Ba.set(`deleted`);return}if(typeof e==`string`&&e.startsWith(`deletedfolder:`)){Ba.set(`deleted:`+e.slice(14));return}Ba.set(e)}let Bs=t(null),Vs=new Set,Hs=!1,Us=!1,Ws=q(()=>{if(!Q(Bs)||!Q(si))return null;let e=Q(si).getBoundingClientRect();return{left:Math.min(Q(Bs).x0,Q(Bs).x1)-e.left+Q(si).scrollLeft,top:Math.min(Q(Bs).y0,Q(Bs).y1)-e.top+Q(si).scrollTop,width:Math.abs(Q(Bs).x1-Q(Bs).x0),height:Math.abs(Q(Bs).y1-Q(Bs).y0)}});function Gs(e){let t=Math.min(e.x0,e.x1),n=Math.max(e.x0,e.x1),r=Math.min(e.y0,e.y1),i=Math.max(e.y0,e.y1),a=[];for(let e of Q(si)?.querySelectorAll(`[data-card-id]`)??[]){let o=e.getBoundingClientRect();o.right>=t&&o.left<=n&&o.bottom>=r&&o.top<=i&&a.push(e.dataset.cardId??``)}
2489return a.filter(Boolean)}function Ks(e){e.pointerType===`mouse`&&e.button===0&&(e.target?.closest(`.explorer-card, .explorer-folder-card, input, button, textarea`)||(e.preventDefault(),Q(si)?.focus(),Vs=e.ctrlKey||e.metaKey?new Set(Q(vi)):new Set,Hs=!1,I(Bs,{x0:e.clientX,y0:e.clientY,x1:e.clientX,y1:e.clientY},!0),window.addEventListener(`pointermove`,qs),window.addEventListener(`pointerup`,Js),window.addEventListener(`pointercancel`,Js)))}function qs(e){if(!Q(Bs))return;let t={...Q(Bs),x1:e.clientX,y1:e.clientY};I(Bs,t,!0),(Math.abs(t.x1-t.x0)>4||Math.abs(t.y1-t.y0)>4)&&(Hs=!0),Hs&&bi([...Vs,...Gs(t)])}function Js(){window.removeEventListener(`pointermove`,qs),window.removeEventListener(`pointerup`,Js),window.removeEventListener(`pointercancel`,Js),Hs&&(Us=!0),I(Bs,null),Hs=!1}function Ys(){I(gt,null),bi([]),Ya.set(null);let e=Q(ht)?.secondaryStatus?.();e?.open&&e.mode===`props`&&!e.pinned&&Q(ht).hideSecondary()}function Xs(e){if(Q(si)?.focus(),!e.target?.closest(`.explorer-card, .explorer-folder-card`)){if(Us){Us=!1;return}Ys()}}async function Zs(e){if(o()?.hash===e.hash){es(`"${e.name}" is the scene you are already in`);return}if(!await xZ(e.name))return;let t=await bQ(Ib(e.name));t&&await Hb(e.hash,``,{private:t===`private`,askModules:!0,freshGame:!0})}async function Qs(e){let t=await BZ(e.volumeId,e.id);if(!t){es(e.name+` is not in the saved project any more`);return}if(e.kind===`scene`){await $s(e,t);return}if(e.kind===`image`){mJ({title:e.name,kind:`image`,itemId:e.id,name:e.name,url:URL.createObjectURL(t),onClose:()=>Q(si)?.focus()});return}if(e.kind===`text`){oJ({title:e.name+` â `+(e.volumeName??`mounted project`),code:await t.text(),onSave:t=>void ec(e,t),onClose:()=>Q(si)?.focus()});return}es(`Copy `+e.name+` into your Library to open it (a `+e.kind+` viewer reads it from there)`)}async function $s(e,t){if(!await xZ(e.name))return;let{readSessionZip:n}=await $(async()=>{let{readSessionZip:e}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{readSessionZip:e}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url),r=null;try{r=await n(await t.arrayBuffer())}catch{r=null}if(!r){es(`"`+e.name+`" could not be read as a scene`);return}await jge(r)}async function ec(e,t){let n=new TextEncoder().encode(t).buffer;QZ(e.volumeId,e.id,{buffer:n,hash:await Ia(n)})}async function tc(e){if(e.volumeItem){await Qs(e);return}if(e.remoteItem){tC(e.hash)?es(`Fetching `+e.name+` from peersâ¦`):es(e.name+` is already here`);return}if(e.kind===`pack-folder`){zs(`pack:`+e.packName);return}if(e.kind===`prefab`){vJ({title:e.name,prefabId:e.prefabId,name:e.name,onClose:()=>Q(si)?.focus()});return}if(e.packEntry&&e.glbUrl){Ps(e);return}if(e.sceneEntry){if(e.kind===`image`&&e.dataUrl)pJ({title:e.name,url:e.dataUrl,onClose:()=>Q(si)?.focus()});else if(e.kind===`text`&&e.nodeId){let t=Ec(t=>t.id===e.nodeId);t&&oJ({title:e.name+` (live script)`,code:t.node.data?.code??``,onSave:n=>nu(e.nodeId,{code:n},t.graphId),onClose:()=>Q(si)?.focus()})}else if(e.kind===`audio`&&e.itemId){let t=y().find(t=>t.id===e.itemId);t&&Fs(t)}return}if(e.kind===`scene`&&!e.packEntry){await Zs(e);return}if(e.kind===`text`){let t=await Ja(e.id);if(!t)return;oJ({title:e.name,code:await t.text(),onSave:t=>Ta(e.id,t),onClose:()=>Q(si)?.focus()})}else if(e.kind===`image`){let t=await Ja(e.id);t&&mJ({title:e.name,kind:`image`,itemId:e.id,name:e.name,url:URL.createObjectURL(t),onClose:()=>Q(si)?.focus()})}else e.kind===`audio`?mJ({title:e.name,kind:`audio`,itemId:e.id,name:e.name,onClose:()=>Q(si)?.focus()}):e.kind===`object`&&!e.packEntry&&mJ({title:e.name,kind:`object`,itemId:e.id,name:e.name,onClose:()=>
2489Q(si)?.focus()})}var nc=uat();Z(`resize`,p,Mt),Z(`dragend`,p,()=>(I(rn,!1),I(an,!1),I(on,!1)));var rc=N(nc),ac=e=>{var t=aat(),n=N(t);We(n,e=>I(xn,e),()=>Q(xn));var i=g(n,2);We(i,e=>I(oa,e),()=>Q(oa));var a=g(i,2),o=e=>{var t=nat(),n=j(t),i=g(n,2);TS(i,{});var a=g(i,2),o=j(a);rz(j(o),{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),H(o);var s=g(o,2);v(s);var c=g(s,2);He(c);var l=g(c,2);Ge(l);var u=g(l,2);Ue(u);var f=g(u,2);Ke(f);var p=g(f,2);Xe(p);var m=g(p,2);H(a),ne(a,e=>Rt?.(e));var h=g(a,2),_=j(h);$e(_),H(h),H(t),O(()=>{r(t,1,`fixed inset-x-0 bottom-0 bg-white p-2 dark:bg-gray-800 ${Q(vt)?``:`hidden`}`),Ze(t,`z-index: var(--z-bottom); height: ${d()??``}px; border-top: 1px solid rgb(55 65 81 / 0.6)`),Ze(h,`height: ${d()-44}px`)}),Z(`dragover`,t,e=>{no(e)||(e.preventDefault(),ln())}),Z(`dragleave`,t,()=>I(nn,!1)),Z(`drop`,t,is),L(`pointerdown`,n,Ct),L(`pointermove`,n,wt),L(`pointerup`,n,Tt),S(s,()=>Q(Nt),e=>I(Nt,e)),L(`click`,m,()=>_t(!1)),Me(3,t,()=>To,()=>({y:300,duration:200})),X(e,t)},s=e=>{var t=iat();let n;var r=j(t),i=j(r),a=j(i);{let e=q(()=>Q(Vt)?``:`mr-1`);rz(a,{size:16,get class(){return Q(e)},"aria-hidden":`true`})}var o=g(a,1,!0);H(i);var s=g(i,2),c=j(s),l=e=>{var t=rat();v(t),S(t,()=>Q(Nt),e=>I(Nt,e)),X(e,t)};G(c,e=>{Q(Bt)||e(l)});var u=g(c,2);He(u);var d=g(u,2);Ge(d);var f=g(d,2);Ue(f);var p=g(f,2);Ke(p);var m=g(p,2);Xe(m),H(s);var h=g(s,2),_=g(h,2);H(r),ne(r,e=>Rt?.(e));var y=g(r,2),b=j(y);$e(b),H(y);var x=g(y,2);H(t),ne(t,(e,t)=>Zh?.(e,t),()=>({key:`explorerWin`,defaultRect:{left:160,top:120}})),ne(t,(e,t)=>Kh?.(e,t),()=>`explorer`),ne(t,(e,t)=>$h?.(e,t),()=>({key:`explorer`,title:`Explorer`,openStore:Is,isOpen:e=>!e,close:()=>Is.set(!0)})),ne(t,(e,t)=>uS?.(e,t),()=>({key:`explorer`})),ne(t,(e,t)=>lq?.(e,t),()=>({key:`explorer`})),O(()=>{n=Ze(t,`z-index: var(--z-window)`,n,{width:`${Q(bt)??``}px`,height:`${Q(xt)??``}px`}),Y(o,Q(Vt)?``:`Explorer`)}),Z(`dragover`,t,e=>{no(e)||(e.preventDefault(),ln())}),Z(`dragleave`,t,()=>I(nn,!1)),Z(`drop`,t,is),L(`click`,h,()=>_t(!0)),L(`click`,_,()=>Is.set(!0)),L(`pointerdown`,x,Dt),L(`pointermove`,x,Ot),L(`pointerup`,x,kt),L(`dblclick`,x,jt),X(e,t)};G(a,e=>{Q(ut)?e(o):e(s,-1)}),L(`change`,n,ss),L(`change`,i,sa),X(e,t)};G(rc,e=>{l()||e(ac)});var oc=g(rc,2),sc=e=>{{let t=q(()=>Q(un).maxHeight??null);xS(e,{get x(){return Q(un).x},get y(){return Q(un).y},get items(){return Q(un).items},get maxHeight(){return Q(t)},$$events:{close:()=>I(un,null)}})}};G(oc,e=>{Q(un)&&e(sc)});var cc=g(oc,2),lc=e=>{var t=oat(),n=f(t,!0);O(()=>{Ze(t,`left: ${Q(xs)??``}px; top: ${Q(Cs)??``}px;`),Y(n,Q(ys).label)}),X(e,t)};G(cc,e=>{Q(bs)&&Q(ys)&&e(lc)});var uc=g(cc,2),fc=t=>{var n=lat(),r=N(n),i=g(r,2),a=j(i),o=e=>{var t=sat();dz(j(t),{size:16,class:`animate-spin`,"aria-hidden":`true`}),W(),H(t),X(e,t)},s=t=>{var n=cat();e(n,()=>Q(Mn),!0),H(n),X(t,n)};G(a,e=>{Q(Nn)?e(o):e(s,-1)});var c=g(a,2),l=f(c);H(i),L(`click`,r,()=>I(jn,!1)),L(`click`,l,()=>I(jn,!1)),X(t,n)};G(uc,e=>{Q(jn)&&e(fc)}),X(n,nc),ue(),Le()}ge([`input`,`keydown`,`click`,`pointerdown`,`pointermove`,`pointerup`,`contextmenu`,`dblclick`,`change`]);var fat=V(`<div class="absolute inset-0 z-10 flex items-center justify-center bg-black/50"><div class="ui-panel w-72 rounded-lg p-4 text-sm shadow-2xl"><p class="mb-3 font-semibold text-gray-100"> </p> <p class="mb-4 text-xs text-gray-400">Your edits will be lost if you don't save them.</p> <div class="flex justify-end gap-2"><button id="text-editor-cancel" class="ui-button-quiet">Cancel</button> <button id="text-editor-discard" class="ui-button-quiet text-red-300">Don't save</button> <button id="text-editor-savenclose" class="ui-button-quiet bg-primary-700 text-white">Save</button></div></div></div>`),pat=V(`<div id="text-editor-window" class="ui-panel fixed flex flex-col overflow-hidden" style="z-index: var(--z-window); width: 620px; height: 440px"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span><!> </span> <span class="flex-1"></span> <button id="text-editor-save" title="Save (Ctrl+S)"><!>Save</button> <button class="ui-button-quiet" title="Close">â</button></div> <div class="min-h-0 flex-1 p-1.5"><!></div> <!></div>`);function mat(e,n){Ce(n,!0);let i=()=>z(aJ,`$textEditorTarget`,a),[a,o]=Ve(),s=t(``),c=t(!1),l=t(!1),u=null;Qe(()=>{let e=i();e&&e!==u&&(u=e,I(s,e.code,!0),I(c,!1),I(l,!1))});function d(){i()?.onSave(Q(s)),I(c,!1)}function p(){I(l,!1),i()?.onClose?.(),aJ.set(null),u=null}function m(){Q(c)?I(l,!0):p()}function h(e){(e.ctrlKey||e.metaKey)&&!e.shiftKey&&kl(e)===`S`?(e.preventDefault(),d()):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Q(l)?I(l,!1):m())}
2489var _=fe(),v=N(_),y=e=>{var t=pat(),n=j(t),a=j(n),o=j(a);wz(o,{size:16,class:`mr-1`,"aria-hidden":`true`});var u=g(o);H(a);var _=g(a,4),v=j(_);dS(v,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),H(_);var y=g(_,2);H(n);var b=g(n,2);S4(j(b),{get value(){return Q(s)},onChange:e=>{I(s,e,!0),I(c,!0)}}),H(b);var x=g(b,2),S=e=>{var t=fat(),n=j(t),r=j(n),a=f(r),o=g(r,4),s=j(o),c=g(s,2),u=g(c,2);H(o),H(n),H(t),O(()=>Y(a,`Save changes to ${i().title??``}?`)),L(`click`,s,()=>I(l,!1)),L(`click`,c,p),L(`click`,u,()=>{d(),p()}),X(e,t)};G(x,e=>{Q(l)&&e(S)}),H(t),ne(t,(e,t)=>Zh?.(e,t),()=>({key:`textEditorWin`,defaultRect:{left:220,top:110}})),ne(t,e=>Kh?.(e)),O(()=>{Y(u,`${i().title??``}${Q(c)?` â`:``}`),r(_,1,`ui-button-quiet ${Q(c)?`bg-primary-700 text-white`:``}`)}),L(`keydown`,t,h),L(`click`,_,d),L(`click`,y,m),X(e,t)};G(v,e=>{i()&&e(y)}),X(e,_),ue(),o()}ge([`keydown`,`click`]);var hat=V(`<option> </option>`),gat=V(`<select id="anim-clip" class="an-clip svelte-1e4i6a2" aria-label="Clip"></select>`),_at=V(`<div class="an-root svelte-1e4i6a2"><div class="tp-tr-strip an-strip svelte-1e4i6a2"><button id="anim-toggle" class="tp-tr-btn tp-tr-play"><!></button> <button id="anim-prev-frame" class="tp-tr-btn" title="Previous frame (,)" aria-label="Previous frame"><!></button> <button id="anim-next-frame" class="tp-tr-btn" title="Next frame (.)" aria-label="Next frame"><!></button> <input id="anim-seek" class="tp-tr-range tp-tr-seek" type="range" min="0" max="1000" step="1" aria-label="Animation position"/> <span id="anim-frames" class="tp-tr-time an-frames svelte-1e4i6a2"> </span> <span class="tp-tr-time an-clock svelte-1e4i6a2" id="anim-clock"> </span> <!></div></div>`);function vat(e,n){Ce(n,!0);let r=J(n,`anim`,3,null),i=t(null),a=t(!1),o=A_e(),s=q(()=>Number(r()?.duration)||0),c=q(()=>!!r()?.playing),l=q(()=>Q(i)??(Number(r()?.time)||0));Qe(()=>{Q(c)&&!Q(a)&&I(i,null)});let d=q(()=>HC(Q(s),o)),p=q(()=>WC(Q(l),Q(s),o)),m=q(()=>Array.isArray(r()?.clips)?r().clips:[]);function h(e){if(!Q(s))return;n.onPlay?.(!1);let t=HC(Q(s),o),r=((WC(Q(l),Q(s),o)-1+e)%t+t)%t,a=Math.min(Q(s),r/o);I(i,a,!0),n.onSeek?.(a)}function y(){n.onPlay?.(!Q(c))}function x(e){h(e)}function S(){return Q(s)>0}function C(e){let t=Number(e.currentTarget.value);I(i,t/1e3*Q(s)),n.onSeek?.(Q(i))}function w(e){let t=Number(e.currentTarget.value);I(i,t/1e3*Q(s)),n.onSeek?.(Q(i)),I(a,!1),Q(c)&&I(i,null)}var T={toggle:y,stepFrame:x,hasClip:S},E=fe(),k=N(E),A=e=>{var t=_at(),i=j(t),y=j(i),x=j(y),S=e=>{hz(e,{size:16,"aria-hidden":`true`})},T=e=>{gz(e,{size:16,"aria-hidden":`true`})};G(x,e=>{Q(c)?e(S):e(T,-1)}),H(y);var E=g(y,2);xz(j(E),{size:13,"aria-hidden":`true`}),H(E);var k=g(E,2);Sz(j(k),{size:13,"aria-hidden":`true`}),H(k);var A=g(k,2);v(A);var ee=g(A,2),M=f(ee),te=g(ee,2),ne=f(te),N=g(te,2),P=e=>{var t=gat();B(t,21,()=>Q(m),Be,(e,t,n)=>{var r=hat(),i=f(r,!0),a={};O(e=>{Y(i,Q(t).name),a!==(a=e)&&(r.value=(r.__value=a)??``)},[()=>String(n)]),X(e,r)}),H(t);var i;_(t),O(e=>{i!==(i=e)&&(t.value=(t.__value=i)??``,D(t,i))},[()=>String(r().index??0)]),L(`change`,t,e=>n.onClip?.(Number(e.currentTarget.value))),X(e,t)};G(N,e=>{Q(m).length>1&&e(P)}),H(i),H(t),O((e,n,r)=>{b(t,`data-playing`,Q(c)),b(y,`title`,Q(c)?`Pause (Space)`:`Play (Space)`),b(y,`aria-label`,Q(c)?`Pause`:`Play`),u(A,e),b(ee,`title`,`Frame ${Q(p)??``} of ${Q(d)??``}, counted at ${o??``} fps`),Y(M,`${Q(p)??``}/${Q(d)??``}`),Y(ne,`${n??``} / ${r??``}`)},[()=>Q(s)?Math.round(Q(l)/Q(s)*1e3):0,()=>JC(Q(l)),()=>JC(Q(s))]),L(`click`,y,()=>n.onPlay?.(!Q(c))),L(`click`,E,()=>h(-1)),L(`click`,k,()=>h(1)),L(`pointerdown`,A,()=>I(a,!0)),L(`input`,A,C),L(`change`,A,w),L(`pointerup`,A,w),X(e,t)};return G(k,e=>{r()&&Q(s)>0&&e(A)}),X(e,E),ue(T)}ge([`click`,`pointerdown`,`input`,`change`,`pointerup`]);var yat=V(`<span id="image-zoom" class="text-xs text-gray-400"> </span> <button class="ui-button-quiet" title="Zoom out">â</button> <button class="ui-button-quiet" title="Zoom in">ï¼</button> <button class="ui-button-quiet" title="Reset">1:1</button>`,1),bat=V(`<p class="pv-note svelte-dbaxvv">Fading is for a window you are using as a reference over the scene â a picture or 2490 a model. There is nothing to see through here.</p>`),xat=V(`<label class="pv-row pv-check svelte-dbaxvv" for="preview-autorotate"><input id="preview-autorotate" class="tp-check" type="checkbox"/> <span class="pv-label pv-grow svelte-dbaxvv" title="Press R in a preview to turn THIS window's rotation on or off">Auto-rotate new previews</span></label> <label class="pv-row pv-check svelte-dbaxvv" for="preview-autoplay"><input id="preview-autoplay" class="tp-check" type="checkbox"/> <span class="pv-label pv-grow svelte-dbaxvv">Auto-play animations</span></label> <label class="pv-row pv-check svelte-dbaxvv" for="preview-stats"><input id="preview-stats" class="tp-check" type="checkbox"/> <span class="pv-label pv-grow svelte-dbaxvv" title="Press I in a preview to toggle this">Show mesh statistics</span></label>
2490`,1),Sat=V(`<div id="preview-settings" class="pv-settings svelte-dbaxvv"><p class="pv-scope svelte-dbaxvv">This window</p> <label for="preview-opacity"><span class="pv-label svelte-dbaxvv">Opacity</span> <input id="preview-opacity" type="range" min="15" max="100" step="5" class="svelte-dbaxvv"/> <span class="pv-value svelte-dbaxvv"> </span></label> <label class="pv-row pv-check svelte-dbaxvv" for="preview-passthrough"><input id="preview-passthrough" class="tp-check" type="checkbox"/> <span class="pv-label pv-grow svelte-dbaxvv">Passthrough</span></label> <!> <p class="pv-note svelte-dbaxvv">Clicks reach the scene underneath; the header stays live so you can still move this 2491 window and switch it back.</p> <p class="pv-scope svelte-dbaxvv">All previews</p> <label class="pv-row pv-check svelte-dbaxvv" for="preview-multi"><input id="preview-multi" class="tp-check" type="checkbox"/> <span class="pv-label pv-grow svelte-dbaxvv">Allow multiple windows</span></label> <p class="pv-note svelte-dbaxvv">Opening another file adds a window instead of re-pointing this one.</p> <!></div>`),Cat=V(`<img class="pointer-events-none absolute left-1/2 top-1/2 max-h-full max-w-full"/>`),wat=V(`<div class="pv-audio svelte-dbaxvv"><div class="pv-audio-art svelte-dbaxvv"><!></div> <!></div>`),Tat=V(`<!> <!>`,1),Eat=V(`<div id="preview-stats-line" class="pv-stats svelte-dbaxvv"> </div>`),Dat=V(`<span class="pv-hint svelte-dbaxvv" aria-hidden="true"><!> </span>`),Oat=V(`<!> <!> <!>`,1),kat=V(`<div class="pv-folder svelte-dbaxvv"><!> <span class="pv-folder-name svelte-dbaxvv"> </span> <button id="preview-enter" class="ui-button-quiet">Open (Enter)</button></div>`),Aat=V(`<div tabindex="-1"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5 svelte-dbaxvv"><button id="preview-prev" class="ui-button-quiet" title="Previous file in this folder (â)" aria-label="Previous file"><!></button> <span id="preview-place" class="pv-place text-xs text-gray-400 svelte-dbaxvv"> </span> <button id="preview-next" class="ui-button-quiet" title="Next file in this folder (â)" aria-label="Next file"><!></button> <button id="preview-up" title="Up one folder (Backspace)" aria-label="Up one folder"><!></button> <span><!> </span> <span class="flex-1"></span> <!> <button id="preview-cog" title="Overlay settings" aria-label="Overlay settings"><!></button> <button class="ui-button-quiet" title="Close">â</button></div> <!> <div id="preview-body" class="pv-body relative min-h-0 flex-1 overflow-hidden svelte-dbaxvv"><!></div></div>`);function jat(e,n){Ce(n,!0);let i=()=>z(cJ,`$openPreviewCog`,_),a=()=>z(sJ,`$previewWindows`,_),o=()=>z(qC,`$previewSiblings`,_),s=()=>z(Ba,`$activeFolder`,_),c=()=>z(Ka,`$explorerFolders`,_),l=()=>z(hJ,`$previewRaise`,_),d=()=>z(YC,`$previewAutoRotate`,_),p=()=>z(UC,`$previewShowStats`,_),m=()=>z(XC,`$previewMultiWindow`,_),h=()=>z(KC,`$previewAutoPlay`,_),[_,y]=Ve(),x=J(n,`winId`,3,0),S=J(n,`index`,3,0),C=t(1),T=t(0),E=t(0),D=t(!1),k=null,A=t(null),ee=q(()=>i()===x()),M=t(null),te=t(null),re=t(!0),ie=t(1),F=t(!1),ae=t(null),oe=t(null),R=t(null),se=t(1e3);function ce(e){let t=()=>{let t=e.clientWidth;t>0&&I(se,t,!0)},n=new ResizeObserver(t);return n.observe(e),t(),{destroy:()=>n.disconnect()}}let le=q(()=>Q(se)<380),de=q(()=>Q(se)<320),pe=q(()=>Q(se)<250),B=q(()=>Q(ie)>=1?`22px`:`6px`),me=q(()=>a().find(e=>e.id===x())??null),V=q(()=>S()===0),he=q(()=>Q(me)?Q(me).kind??`image`:null),ge=q(()=>Q(he)===`image`||Q(he)===`object`),_e=q(()=>String(Q(me)?.itemId??Q(me)?.folderId??``)),ve=q(()=>k_e(o().entries,Q(_e))),ye=q(()=>!!GC(o().entries,Q(_e),-1)),be=q(()=>!!GC(o().entries,Q(_e),1)),xe=q(()=>kZ(s())),Se=q(()=>Q(xe)?Q(xe).folderId?AZ(Q(xe).volumeId,MZ(Q(xe).volumeId).find(e=>e.id===Q(xe).folderId)?.parentId??null):null:typeof s()==`string`&&!s().includes(`:`)?c().find(e=>e.id===s())?.parentId??null:null),we=q(()=>!!Q(xe)?.folderId||typeof s()==`string`&&!s().includes(`:`));Qe(()=>{l(),Q(A)&&K(()=>Q(A).focus?.())}),Qe(()=>{let e=Q(me);e&&e!==k&&(k=e,I(te,null),I(re,K(()=>d()),!0),I(ie,1),I(F,!1),I(ae,null),I(C,1),I(T,0),I(E,0),i()===x()&&cJ.set(null),setTimeout(()=>
2491Q(A)?.focus(),0))});function Te(e){let t=e=>{let t=e.target,n=t?.tagName,r=(t?.getAttribute?.(`type`)||``).toLowerCase(),i=n===`TEXTAREA`||t?.isContentEditable||n===`INPUT`&&r!==`range`&&r!==`checkbox`&&r!==`button`,a=n===`INPUT`&&r===`range`,o=kl(e),s=()=>{e.preventDefault(),e.stopPropagation()};if(e.key===`Escape`)return s(),Fe();if(e.key===` `||e.code===`Space`){if(i)return;s(),Q(he)===`audio`?Q(M)?.toggle?.():Q(he)===`object`&&Q(R)?.toggle?.();return}if(!i){if(Q(he)===`object`&&(e.key===`,`||e.key===`.`)){if(!Q(R)?.hasClip?.())return;s(),Q(R).stepFrame(e.key===`.`?1:-1);return}if(Q(he)===`object`&&o===`R`){s(),I(re,!Q(re));return}if(Q(he)===`object`&&o===`I`){s(),UC.set(!p());return}if(Q(he)===`audio`&&Q(M)?.hasAudio?.()){if(e.key===`,`||e.key===`.`){s(),Q(M).nudge(e.key===`.`?1:-1);return}if(e.key===`ArrowUp`||e.key===`ArrowDown`){s(),Q(M).nudge(e.key===`ArrowUp`?5:-5);return}if(e.key===`Home`)return s(),Q(M).toFraction(0);if(e.key===`End`)return s(),Q(M).toFraction(.999);if(o===`M`)return s(),Q(M).toggleMute();if(o===`L`)return s(),Q(M).toggleLoop();if(/^[0-9]$/.test(o))return s(),Q(M).toFraction(Number(o)/10)}if(!a){if(e.key===`ArrowLeft`)return s(),Ae(-1);if(e.key===`ArrowRight`)return s(),Ae(1);if(e.key===`Enter`){if(Q(he)!==`folder`)return;s(),Me();return}if(e.key===`Backspace`)return s(),void Ne()}}};return e.addEventListener(`keydown`,t,!0),{destroy:()=>e.removeEventListener(`keydown`,t,!0)}}let Ee=q(()=>Q(he)===`image`&&(Q(C)!==1||Q(T)!==0||Q(E)!==0)),De=e=>Math.min(Math.max(e,.1),8);function Oe(e){Q(he)===`image`&&(e.preventDefault(),I(C,De(Q(C)*(e.deltaY>0?.9:1.1)),!0))}async function ke(e){let t=O_e(e);if(!t)return;let n=Q(me)?.onClose;if(Pe(),t===`folder`){fJ(x(),{title:e.folder.name,kind:`folder`,folderId:e.folder.id,url:``,onClose:n});return}let r=e.item,i=``;if(t===`image`){let e=r.dataUrl?null:r.volumeItem?await BZ(r.volumeId,r.id):await Ja(r.id);i=r.dataUrl||(e?URL.createObjectURL(e):``)}fJ(x(),{title:r.name,kind:t,itemId:r.kind===`prefab`?``:r.id,prefabId:r.kind===`prefab`?r.prefabId:``,name:r.name,url:i,onClose:n}),I(C,1),I(T,0),I(E,0)}function Ae(e){let t=GC(o().entries,Q(_e),e);t&&ke(t)}function je(e){return new Promise(t=>{let n=!1,r=e=>{n||(n=!0,queueMicrotask(()=>{i?.(),t(e)}))},i=qC.subscribe(t=>{t?.folderId===e&&r(t.entries??[])});setTimeout(()=>r([]),2e3)})}async function Me(){if(Q(he)!==`folder`||!Q(me)?.folderId)return;let e=Q(me).folderId;Ba.set(e);let t=await je(e),n=GC(t,``,1);n&&ke(n)}async function Ne(){if(!Q(we))return;let e=Q(Se);Ba.set(e);let t=await je(e),n=GC(t,``,1);n&&ke(n)}function Pe(){Q(me)?.url&&String(Q(me).url).startsWith(`blob:`)&&URL.revokeObjectURL(Q(me).url)}function Fe(){Q(me)?.onClose?.(),Pe(),dJ(x()),k=null,U(cJ)===x()&&cJ.set(null)}let Le={image:Qx,audio:QR,object:sS,folder:nS};var Re=fe(),ze=N(Re),Be=e=>{var t=Aat();let n,i;var a=j(t),o=j(a);ez(j(o),{size:14,"aria-hidden":`true`}),H(o);var s=g(o,2);let c;var l=f(s),_=g(s,2);tz(j(_),{size:14,"aria-hidden":`true`}),H(_);var y=g(_,2);let k;SOe(j(y),{size:14,"aria-hidden":`true`}),H(y);var se=g(y,2);let ue;var z=j(se);Ie(z,()=>Q(he),e=>{let t=q(()=>Le[Q(he)??`image`]??Qx);var n=fe(),r=N(n);P(r,()=>Q(t),(e,t)=>{t(e,{size:16,class:`mr-1`,"aria-hidden":`true`})}),X(e,n)});var U=g(z,1,!0);H(se);var _e=g(se,4),xe=e=>{var t=yat(),n=N(t),r=f(n),i=g(n,2),a=g(i,2),o=g(a,2);O(e=>Y(r,`${e??``}%`),[()=>Math.round(Q(C)*100)]),L(`click`,i,()=>I(C,De(Q(C)*.8),!0)),L(`click`,a,()=>I(C,De(Q(C)*1.25),!0)),L(`click`,o,()=>(I(C,1),I(T,0),I(E,0))),X(e,t)};G(_e,e=>{Q(he)===`image`&&!Q(le)&&e(xe)});var K=g(_e,2);bz(j(K),{size:14,"aria-hidden":`true`}),H(K);var Se=g(K,2);H(a),ne(a,e=>ce?.(e));var Ce=g(a,2),J=e=>{var t=Sat(),n=g(j(t),2);let i;var a=g(j(n),2);v(a);var o=g(a,2),s=f(o);H(n);var c=g(n,2),l=j(c);v(l),W(2),H(c);var _=g(c,2),y=e=>{var t=bat();X(e,t)};G(_,e=>{Q(ge)||e(y)});var x=g(_,6),S=j(x);v(S),W(2),H(x);var C=g(x,4),T=e=>{var t=xat(),n=N(t),r=j(n);v(r),W(2),H(n);var i=g(n,2),a=j(i);v(a),W(2),H(i);var o=g(i,2),s=j(o);v(s),W(2),H(o),O(()=>{w(r,d()),w(a,h()),w(s,p())}),L(`change`,r,e=>YC.set(e.currentTarget.checked)),L(`change`,a,e=>KC.set(e.currentTarget.checked)),L(`change`,s,e=>UC.set(e.currentTarget.checked)),X(e,t)};G(C,e=>{Q(he)===`object`&&e(T)}),H(t),O((e,t)=>
2491{i=r(n,1,`pv-row svelte-dbaxvv`,null,i,{"pv-off":!Q(ge)}),a.disabled=!Q(ge),b(a,`title`,Q(ge)?`How strongly the picture is drawn`:`Only for something you can see through â a picture or a model`),u(a,e),Y(s,`${t??``}%`),w(l,Q(F)),w(S,m())},[()=>Math.round(Q(ie)*100),()=>Math.round(Q(ie)*100)]),L(`input`,a,e=>I(ie,j_e(Number(e.currentTarget.value)/100),!0)),L(`change`,l,e=>I(F,e.currentTarget.checked,!0)),L(`change`,S,e=>XC.set(e.currentTarget.checked)),X(e,t)};G(Ce,e=>{Q(ee)&&e(J)});var ke=g(Ce,2);let je;var Pe=j(ke),Re=e=>{var t=Cat();O(()=>{b(t,`src`,Q(me).url),b(t,`alt`,Q(me).title),Ze(t,`transform: translate(-50%, -50%) translate(${Q(T)??``}px, ${Q(E)??``}px) scale(${Q(C)??``}); image-rendering: ${Q(C)>2?`pixelated`:`auto`}`)}),X(e,t)},ze=e=>{var t=wat(),n=j(t);QR(j(n),{size:44,"aria-hidden":`true`}),H(n);var r=g(n,2);{let e=q(()=>Q(me).name??Q(me).title);We(N4(r,{get itemId(){return Q(me).itemId},get name(){return Q(e)}}),e=>I(M,e,!0),()=>Q(M))}H(t),X(e,t)},Be=e=>{var t=Oat(),n=N(t);Ie(n,()=>Q(me).itemId+`|`+(Q(me).prefabId??``),e=>{var t=Tat(),n=N(t);{let e=q(()=>Q(me).itemId??``),t=q(()=>Q(me).prefabId??``),r=q(()=>Q(me).name??``);We(T3(n,{get itemId(){return Q(e)},get prefabId(){return Q(t)},get name(){return Q(r)},get autoSpin(){return Q(re)},get autoPlay(){return h()},onStats:e=>I(te,e,!0),onAnim:e=>I(ae,e,!0),onToggleSpin:()=>I(re,!Q(re))}),e=>I(oe,e,!0),()=>Q(oe))}var r=g(n,2),i=e=>{We(vat(e,{get anim(){return Q(ae)},onPlay:e=>Q(oe)?.setAnimPlaying(e),onSeek:e=>Q(oe)?.seekAnim(e),onClip:e=>Q(oe)?.setAnimClip(e)}),e=>I(R,e,!0),()=>Q(R))};G(r,e=>{Q(ie)>=1&&e(i)}),X(e,t)});var r=g(n,2),i=e=>{var t=Eat(),n=f(t);O((e,t)=>Y(n,`${e??``} tris · ${t??``} verts · ${Q(te).meshes??``} 2492 mesh${Q(te).meshes===1?``:`es`}`),[()=>Q(te).tris.toLocaleString(),()=>Q(te).verts.toLocaleString()]),X(e,t)};G(r,e=>{p()&&Q(te)&&Q(ie)>=1&&e(i)});var a=g(r,2),o=e=>{var t=Dat(),n=j(t);yz(n,{size:12});var r=g(n);H(t),O(()=>Y(r,` ${Q(re)?`Click to stop`:`Click to auto-rotate`} · drag to turn · scroll to zoom`)),X(e,t)};G(a,e=>{!p()&&Q(ie)>=1&&e(o)}),X(e,t)},Ve=e=>{var t=kat(),n=j(t);nS(n,{size:44,"aria-hidden":`true`});var r=g(n,2),i=f(r,!0),a=g(r,2);H(t),O(()=>Y(i,Q(me).title)),L(`click`,a,()=>void Me()),X(e,t)};G(Pe,e=>{Q(he)===`image`?e(Re):Q(he)===`audio`?e(ze,1):Q(he)===`object`?e(Be,2):Q(he)===`folder`&&e(Ve,3)}),H(ke),H(t),We(t,e=>I(A,e),()=>Q(A)),ne(t,(e,t)=>Zh?.(e,t),()=>({key:Q(V)?`imagePreviewWin`:`imagePreviewWin:`+S(),defaultRect:{left:300+S()*28,top:130+S()*28},resizable:!0})),ne(t,e=>Kh?.(e)),ne(t,e=>Te?.(e)),O(e=>{b(t,`id`,Q(V)?`image-preview-window`:`image-preview-window-`+S()),b(t,`data-preview-id`,x()),n=r(t,1,`ui-panel fixed flex flex-col overflow-hidden outline-hidden svelte-dbaxvv`,null,n,{"pv-through":Q(F),"pv-faded":Q(ie)<1}),i=Ze(t,`z-index: var(--z-window); width: 520px; height: 420px`,i,{"--pv-opacity":Q(ie)}),o.disabled=!Q(ye),c=Ze(s,``,c,{"min-width":e}),Y(l,`${(Q(ve).at||`â`)??``}/${Q(ve).of??``}`),_.disabled=!Q(be),k=r(y,1,`ui-button-quiet svelte-dbaxvv`,null,k,{"pv-gone":Q(de)}),y.disabled=!Q(we),ue=r(se,1,`pv-title svelte-dbaxvv`,null,ue,{"pv-gone":Q(pe)}),b(se,`title`,Q(me).title),Y(U,Q(me).title),r(K,1,`ui-button-quiet ${Q(ee)?`pv-cog-on`:``}`,`svelte-dbaxvv`),b(K,`aria-pressed`,Q(ee)),je=Ze(ke,`cursor: ${Q(Ee)?Q(D)?`grabbing`:`grab`:`default`}`,je,{"--pv-reading":Q(B)})},[()=>`${String(Q(ve).of??0).length*2+1}ch`]),L(`click`,o,()=>Ae(-1)),L(`click`,_,()=>Ae(1)),L(`click`,y,()=>void Ne()),L(`click`,K,()=>cJ.set(Q(ee)?null:x())),L(`click`,Se,Fe),Z(`wheel`,ke,Oe),L(`pointerdown`,ke,e=>{Q(Ee)&&(I(D,!0),e.currentTarget.setPointerCapture(e.pointerId))}),L(`pointermove`,ke,e=>{Q(D)&&(I(T,Q(T)+e.movementX),I(E,Q(E)+e.movementY))}),L(`pointerup`,ke,()=>I(D,!1)),X(e,t)};G(ze,e=>{Q(me)&&e(Be)}),X(e,Re),ue(),y()}ge([`click`,`input`,`change`,`pointerdown`,`pointermove`,`pointerup`]);var Mat=V(`<div id="model-preview-stats" class="pointer-events-none absolute right-2 top-2 rounded-sm bg-black/60 px-2 py-1 text-right text-[11px] leading-tight text-gray-200"><div> </div> <div> </div> <div> </div></div>`),Nat=V(`<div id="model-preview-window" tabindex="-1" class="ui-panel fixed flex flex-col overflow-hidden outline-hidden" style="z-index: var(--z-window); width: 560px; height: 460px"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span><!> </span> <span class="flex-1"></span> <button class="ui-button-quiet" title="Close">â</button></div> <div class="relative min-h-0 flex-1 bg-[#0d1117]"><!> <!> <div class="pointer-events-none absolute bottom-2 left-2 text-[10px] text-gray-500">
2492drag to rotate</div></div></div>`);function Pat(e,n){Ce(n,!0);let r=()=>z(gJ,`$modelPreviewTarget`,a),i=()=>z(_J,`$modelPreviewRaise`,a),[a,o]=Ve(),s=`modelPreviewWin`,c=t(null),l=null,u=t(null);function d(){setTimeout(()=>{Yse(s),Jse(s),Q(c)?.focus()},0)}Qe(()=>{let e=r();e&&e!==l&&(l=e,d())}),Qe(()=>{i()>0&&r()&&d()});function p(e){e.key===`Escape`&&(e.preventDefault(),m())}function m(){r()?.onClose?.(),gJ.set(null),l=null}var h=fe(),_=N(h),v=e=>{var t=Nat(),n=j(t),i=j(n),a=j(i);sS(a,{size:16,class:`mr-1`,"aria-hidden":`true`});var o=g(a,1,!0);H(i);var l=g(i,4);H(n);var d=g(n,2),h=j(d);Ie(h,()=>(r().itemId??``)+`|`+(r().prefabId??``),e=>{{let t=q(()=>r().itemId??``),n=q(()=>r().prefabId??``);T3(e,{get itemId(){return Q(t)},get prefabId(){return Q(n)},get name(){return r().name},onStats:e=>I(u,e,!0)})}});var _=g(h,2),v=e=>{var t=Mat(),n=j(t),r=f(n),i=g(n,2),a=f(i),o=g(i,2),s=f(o);H(t),O((e,t)=>{Y(r,`${e??``} tris`),Y(a,`${t??``} verts`),Y(s,`${Q(u).meshes??``} mesh${Q(u).meshes===1?``:`es`}`)},[()=>Q(u).tris.toLocaleString(),()=>Q(u).verts.toLocaleString()]),X(e,t)};G(_,e=>{Q(u)&&e(v)}),W(2),H(d),H(t),We(t,e=>I(c,e),()=>Q(c)),ne(t,(e,t)=>Zh?.(e,t),()=>({key:s,defaultRect:{left:280,top:120}})),ne(t,(e,t)=>Kh?.(e,t),()=>s),O(()=>Y(o,r().title)),L(`keydown`,t,p),L(`click`,l,m),X(e,t)};G(_,e=>{r()&&e(v)}),X(e,h),ue(),o()}ge([`keydown`,`click`]);
2492var Fat=V(`<canvas id="dungeon-minimap" style="z-index: var(--z-hud); image-rendering: pixelated; max-width: 260px; max-height: 220px;"></canvas>`);function Iat(e,n){Ce(n,!0);let i=()=>z(Pi,`$globalScene`,l),a=()=>z(ki,`$isLocked`,l),o=()=>z(Wi,`$playerCam`,l),s=()=>z(Es,`$peers`,l),c=()=>z(as,`$userdata`,l),[l,u]=Ve(),d=t(void 0),f=t(!1),p={key:`#ffc93d`,door:`#39d0ff`,goal:`#f472b6`,spawn:`#4ade80`},m=new hn;function h(e,t,n,r,i){e.fillStyle=i,e.beginPath(),e.arc((n-t.minX)*3,(r-t.minY)*3,3,0,Math.PI*2),e.fill()}function g(){let e=Tf(i());if(I(f,!!(a()&&e)),!Q(f)||!Q(d)||!e)return;let{grid:t,width:n,height:r,floorValue:l}=e;Q(d).width=n*3,Q(d).height=r*3;let u=Q(d).getContext(`2d`);if(!u)return;u.fillStyle=`rgba(10, 12, 16, 0.92)`,u.fillRect(0,0,Q(d).width,Q(d).height),u.fillStyle=`#5c6470`;for(let e=0;e<r;e++)for(let r=0;r<n;r++)t[e*n+r]===l&&u.fillRect(r*3,e*3,3,3);let g=i()?.getObjectByName(`dungeon-module`),_=g?.getObjectByName(`dungeon-key`);_?.visible&&h(u,e,_.position.x,_.position.z,`#ffc93d`);let v=g?.getObjectByName(`dungeon-door`);v&&h(u,e,v.position.x,v.position.z,`#39d0ff`);for(let t of bl(i()))h(u,e,t.x,t.z,p[t.kind]??`#ffffff`);o()&&(o().getWorldPosition(m),h(u,e,m.x,m.z,`#4ade80`));let y=s()?.peer?.id;for(let t of c()??[]){if(!t[0]||t[0]===y)continue;let n=i()?.getObjectByName(t[0]);!n||n.position.y>500||h(u,e,n.position.x,n.position.z,gh(t[0]))}}_e(()=>{let e=setInterval(g,150);return()=>clearInterval(e)});var _=Fat();We(_,e=>I(d,e),()=>Q(d)),O(()=>r(_,1,`fixed bottom-4 left-4 rounded-lg border border-gray-600/70 shadow-lg ${Q(f)?``:`hidden`}`)),X(e,_),ue(),u()}var Lat=V(`<tr class="border-b border-gray-600/30"><td class="py-0.5 pr-1 align-top"><span class="budget-dot mr-1"></span> <span> </span></td><td class="py-0.5 text-right font-mono tabular-nums"> </td><td class="py-0.5 pl-2 text-right text-[10px] text-gray-500 tabular-nums"> </td></tr>`),Rat=V(`<span class="text-gray-400">Objects still arriving</span> <span class="text-right"> </span>`,1),zat=V(`<p class="text-[11px] italic text-gray-500">Nothing sent or received yet.</p>`),Bat=V(`<tr><td class="pr-1"> </td><td class="text-right text-gray-400"> </td><td class="text-right text-gray-400"> </td><td class="text-right"> </td><td class="text-right text-gray-500"> </td></tr>`),Vat=V(`<table id="stats-wire" class="w-full font-mono text-[11px] tabular-nums"><tbody></tbody></table>`),Hat=V(`<div id="stats-window" class="ui-panel fixed flex flex-col overflow-hidden outline-hidden" tabindex="-1" style="z-index: var(--z-window); width: 380px; height: 460px"><div class="ui-panel-header move-handle flex shrink-0 cursor-move select-none items-center gap-2 py-1.5"><!> <span class="flex-1 text-sm font-semibold">Statistics</span> <span id="stats-overall" class="budget-dot"></span> <button class="rounded-sm p-1 hover:brightness-150" title="Re-read now" aria-label="Re-read now"><!></button> <button id="stats-close" class="rounded-sm p-1 hover:brightness-150" title="Close" aria-label="Close statistics"><!></button></div> <div class="min-h-0 flex-1 overflow-y-auto px-2 py-1.5 text-xs"><p class="mb-1.5 text-[11px] text-gray-400">Judged against the <strong> </strong> budget. 2493 Nothing here leaves this device.</p> <table id="stats-budgets" class="w-full"><tbody></tbody></table> <h4 class="mt-2 mb-0.5 text-[11px] font-semibold text-gray-300">Frame</h4> <div id="stats-frame" class="grid grid-cols-2 gap-x-2 font-mono text-[11px] tabular-nums"><span class="text-gray-400">p50 / p95 / p99</span> <span class="text-right"> </span> <span class="text-gray-400">Long tasks (1 min)</span> <span class="text-right"><!></span> <span class="text-gray-400">JS heap</span> <span class="text-right"> </span> <span class="text-gray-400">Meshes / hidden</span> <span class="text-right"> </span> <!></div> <h4 class="mt-2 mb-0.5 text-[11px] font-semibold text-gray-300"> </h4> <!></div></div>`);function Uat(e,t){Ce(t,!0);let n=()=>z(Yi,`$sceneMetrics`,i),r=()=>z(ia,`$statsOpen`,i),[i,a]=Ve(),o=q(()=>n().profile===`vr`?`vr`:`desktop`),s=q(()=>na(n(),Q(o))),c=q(()=>qi(n(),Q(o))),l=q(()=>(n().at,Ji()));function u(e){return e==null||!Number.isFinite(e)?`â`:e>=1e6?(e/1e6).toFixed(2)+`M`:e>=1e3?(e/1e3).toFixed(1)+`k`:e%1==0?String(e):e.toFixed(1)}function d(e){return e==null?`â`:(e/1048576).toFixed(0)+` MB`}var p=fe(),m=N(p),h=e=>{var t=Hat(),r=j(t),i=j(r);iz(i,{size:16,"aria-hidden":`true`});var a=g(i,4),p=g(a,2),m=j(p);Gx(m,{size:14,"aria-hidden":`true`}),H(p);var h=g(p,2),_=j(h);fS(_,{size:16,"aria-hidden":`true`}),H(h),H(r);var v=g(r,2),y=j(v),x=g(j(y)),S=f(x,!0);W(),H(y);
2493var C=g(y,2),w=j(C);B(w,21,()=>Q(s),e=>e.key,(e,t)=>{var n=Lat(),r=j(n),i=j(r),a=g(i,2),o=f(a,!0);H(r);var s=g(r),c=f(s),l=g(s),d=f(l);H(n),O((e,r,s)=>{b(n,`data-budget`,Q(t).key),b(n,`data-tier`,Q(t).tier),b(i,`data-tier`,Q(t).tier),b(a,`title`,Q(t).why),Y(o,Q(t).label),Y(c,`${e??``}${Q(t).unit??``}`),Y(d,`${r??``} / ${s??``}`)},[()=>u(Q(t).value),()=>u(Q(t).green),()=>u(Q(t).amber)]),X(e,n)}),H(w),H(C);var T=g(C,4),E=g(j(T),2),D=f(E),k=g(E,4),A=j(k),ee=e=>{var t=Te();O((e,n)=>Y(t,`${e??``} · worst ${n??``} ms`),[()=>u(n().longTasks),()=>u(n().longestTask)]),X(e,t)},M=e=>{var t=Te(`not available in this browser`);X(e,t)};G(A,e=>{n().longTasksAvailable?e(ee):e(M,-1)}),H(k);var te=g(k,4),P=f(te,!0),re=g(te,4),ie=f(re),F=g(re,2),ae=e=>{var t=Rat(),r=g(N(t),2),i=f(r,!0);O(e=>Y(i,e),[()=>u(n().ingestBacklog)]),X(e,t)};G(F,e=>{n().ingestBacklog&&e(ae)}),H(T);var I=g(T,2),oe=f(I),R=g(I,2),se=e=>{var t=zat();X(e,t)},ce=e=>{var t=Vat(),n=j(t);B(n,21,()=>Q(l).rows.slice(0,10),e=>e.type,(e,t)=>{var n=Bat(),r=j(n),i=f(r,!0),a=g(r),o=f(a),s=g(a),c=f(s),l=g(s),d=f(l),p=g(l),m=f(p,!0);H(n),O((e,r,a,s)=>{b(n,`data-wire`,Q(t).type),Y(i,Q(t).type),Y(o,`${e??``} in`),Y(c,`${r??``} out`),Y(d,`${a??``}/s`),Y(m,s)},[()=>u(Q(t).in),()=>u(Q(t).out),()=>Q(t).perSecond.toFixed(1),()=>Q(t).bytes==null?``:`â`+u(Q(t).bytes)+`B`]),X(e,n)}),H(n),H(t),X(e,t)};G(R,e=>{Q(l).rows.length===0?e(se):e(ce,-1)}),H(v),H(t),ne(t,(e,t)=>Zh?.(e,t),()=>({key:`statsWindow`,defaultRect:{left:120,top:120},resizable:!0})),ne(t,(e,t)=>Kh?.(e,t),()=>`stats`),O((e,t,n,r,i,s,l)=>{b(a,`data-tier`,Q(c)),b(a,`title`,`Scene budget: `+Q(c)),Y(S,Q(o)===`vr`?`VR / mobile`:`desktop`),Y(D,`${e??``} / ${t??``} / ${n??``} ms`),Y(P,r),Y(ie,`${i??``} / ${s??``}`),Y(oe,`Wire, last ${l??``}s`)},[()=>u(n().frameP50),()=>u(n().frameP95),()=>u(n().frameP99),()=>n().heap==null?`not available`:d(n().heap),()=>u(n().meshes),()=>u(n().hidden),()=>Math.round(Q(l).seconds)]),L(`click`,p,()=>{Qi(),ta()}),L(`click`,h,()=>ia.set(!1)),X(e,t)};G(m,e=>{r()&&e(h)}),X(e,p),ue(),a()}ge([`click`]);var Wat=V(`<img id="moment-shot" class="shot svelte-f9lsbq" alt="What the viewport showed"/>`),Gat=V(`<p class="muted svelte-f9lsbq">No picture (nothing to render)</p>`),Kat=V(`<p id="moment-stats" class="muted svelte-f9lsbq"> </p>`),qat=V(`<label class="check svelte-f9lsbq"><input id="moment-send" type="checkbox" class="tp-check"/> <span>Send it to the developers (frame data, module versions and this picture â no account)</span></label>`),Jat=V(`<div id="moment-report" class="moment ui-panel svelte-f9lsbq" role="dialog" aria-label="Report this moment" tabindex="-1"><p class="title svelte-f9lsbq">Report this moment</p> <!> <!> <label class="field svelte-f9lsbq"><span>What happened? (optional)</span> <textarea id="moment-note" rows="3" maxlength="1000" class="svelte-f9lsbq"></textarea></label> <!> <div class="actions svelte-f9lsbq"><button id="moment-cancel" class="btn svelte-f9lsbq">Cancel</button> <button id="moment-save" class="btn primary svelte-f9lsbq"> </button></div></div>`);function Yat(e,n){Ce(n,!0);let r=()=>z(XJ,`$momentDraft`,o),i=()=>z(rw,`$perfReportsOn`,o),a=()=>z(iw,`$perfReportsAvailable`,o),[o,s]=Ve(),l=t(``),u=t(!1),d=t(!1),p=null;Qe(()=>{let e=r();e&&e!==p&&(p=e,I(l,``),I(u,i()&&a(),!0),I(d,!1))});let m=q(()=>r()?F_e(r().doc):null);async function h(e){Q(d)||(I(d,!0),await nY(e?{note:Q(l),send:Q(u)&&a()}:null),I(d,!1))}function _(e){e.key===`Escape`&&(e.stopPropagation(),h(!1))}var y=fe(),x=N(y),C=e=>{var t=Jat(),n=g(j(t),2),i=e=>{var t=Wat();O(()=>b(t,`src`,r().shotUrl)),X(e,t)},o=e=>{var t=Gat();X(e,t)};G(n,e=>{r().shotUrl?e(i):e(o,-1)});var s=g(n,2),p=e=>{var t=Kat(),n=f(t);O(e=>Y(n,`Last ${e??``} s · ${Q(m).frames??``} frames · ${Q(m).fpsP50??`â`??``} fps median · ${Q(m).stalls??``} 2494 stall${Q(m).stalls===1?``:`s`}`),[()=>Math.round(Q(m).durationMs/1e3)]),X(e,t)};G(s,e=>{Q(m)&&e(p)});var y=g(s,2),x=g(j(y),2);ve(x),Fe(x,!0),H(y);var C=g(y,2),w=e=>{var t=qat(),n=j(t);v(n),W(2),H(t),c(n,()=>Q(u),e=>I(u,e)),X(e,t)};G(C,e=>{a()&&e(w)});var T=g(C,2),E=j(T),D=g(E,2),k=f(D,!0);H(T),H(t),O(()=>{E.disabled=Q(d),D.disabled=Q(d),Y(k,Q(u)&&a()?`Save and send`:`Save`)}),L(`keydown`,t,_),S(x,()=>Q(l),e=>I(l,e)),L(`click`,E,()=>h(!1)),L(`click`,D,()=>h(!0)),X(e,t)};G(x,e=>{r()&&e(C)}),X(e,y),ue(),s()}ge([`keydown`,`click`]);var Xat=V(`<p id="profiler-live-empty" class="live-muted italic svelte-ubu3v3">
2494Nobody else is in this room yet. Connect a headset to watch it.</p>`),Zat=V(`<span class="chip svelte-ubu3v3">VR</span>`),Qat=V(`<span class="chip rec svelte-ubu3v3" title="Recording on that device"> </span>`),$at=V(`<button class="live-btn svelte-ubu3v3" data-act="stop">Stop</button>`),eot=V(`<button class="live-btn svelte-ubu3v3" data-act="watch">Watch</button> <button class="live-btn svelte-ubu3v3" data-act="detailed" title="CPU phases + captures (costs that device frame time)">Detailed</button>`,1),tot=V(`<li class="live-peer svelte-ubu3v3"><span class="flex-1 truncate"> </span> <!> <!> <!></li>`),not=V(`· <span> </span>`,1),rot=V(`<span class="mr-1.5"> </span>`),iot=V(`<p class="live-cpu font-mono text-[11px]">CPU <!></p>`),aot=V(`<li class="font-mono text-[11px]"> </li>`),oot=V(`<div class="live-capture svelte-ubu3v3"><p class="live-ink-2 svelte-ubu3v3"> </p> <ol class="svelte-ubu3v3"></ol></div>`),sot=V(`<button class="live-btn svelte-ubu3v3" data-act="capture">Capture now</button>`),cot=V(`<span class="live-saved live-muted svelte-ubu3v3"> </span>`),lot=V(`<section class="live-session svelte-ubu3v3"><header class="flex items-center gap-2"><span class="flex-1 font-semibold"> </span> <span class="live-muted svelte-ubu3v3" title="Measured on this device"> </span></header> <div class="live-nums font-mono tabular-nums svelte-ubu3v3"><span> </span> <span> </span> <span class="svelte-ubu3v3"> </span> <span> </span> <span> </span></div> <canvas class="live-graph svelte-ubu3v3" width="380" height="54" aria-label="Frame time, last 10 seconds"></canvas> <canvas class="live-graph svelte-ubu3v3" width="380" height="40" aria-label="Draw calls, last 10 seconds"></canvas> <p class="live-meta live-muted svelte-ubu3v3"><span class="live-frames"> </span> <span class="live-bw svelte-ubu3v3"> </span> <!> <!></p> <!> <!> <div class="flex flex-wrap gap-1.5 pt-1"><!> <button class="live-btn svelte-ubu3v3" data-act="save">Save recording</button> <button class="live-btn svelte-ubu3v3" data-act="forget">Clear</button> <!></div></section>`),uot=V(`<div id="profiler-live" class="ui-panel tp-themed live-surface fixed flex flex-col overflow-hidden outline-hidden svelte-ubu3v3" tabindex="-1" style="z-index: var(--z-window); width: 420px; height: 520px"><div class="ui-panel-header move-handle flex shrink-0 cursor-move select-none items-center gap-2 py-1.5"><!> <span class="flex-1 text-sm font-semibold">Live profiler</span> <button id="profiler-live-close" class="rounded-sm p-1 hover:brightness-150" title="Close" aria-label="Close live profiler"><!></button></div> <div class="min-h-0 flex-1 overflow-y-auto px-2 py-1.5 text-xs"><p class="live-muted mb-1.5 text-[11px] svelte-ubu3v3">Watch a peer in your room â a headset, usually â and see its frame time and draw calls here as it plays. <strong>Detailed</strong> also asks for CPU phases and per-object captures; it costs that device frame time.</p> <!> <ul id="profiler-live-peers" class="mb-2"></ul> <!></div></div>`);function dot(e,n){Ce(n,!0);let r=()=>z(Xb,`$peerScenes`,u),i=()=>z(Es,`$peers`,u),a=()=>z(as,`$userdata`,u),o=()=>z(si,`$peerHands`,u),s=()=>z(Dve,`$perfLive`,u),c=()=>z(vw,`$profilerLiveOpen`,u),l=()=>z(dw,`$theme`,u),[u,d]=Ve(),p=1e4,m=q(()=>{r();let e=i();return(e?.openedPeers?[...e.openedPeers]:[]).filter(e=>ex(e)).map(e=>{let t=(a()??[]).find(t=>t[0]===e);return{id:e,name:t&&t[1]||e,vr:!!o()?.[e]?.active}})}),h=q(()=>Object.values(s().sessions)),_=t(Ne({}));function v(e){return e==null||!Number.isFinite(e)?`â`:e>=1e6?(e/1e6).toFixed(2)+`M`:e>=1e3?(e/1e3).toFixed(1)+`k`:e%1==0?String(e):e.toFixed(1)}async function y(e){let t=await jve(e);I(_,{...Q(_),[e]:t?`Saved to your recordings`:`Nothing to save yet`},!0)}function x(e,t){let n=t=>{let n=e.getContext(`2d`);if(!n)return;let r=e.width,i=e.height;n.clearRect(0,0,r,i);let a=kve(t.peerId)?.frames??[];if(!a.length)return;let o=a[a.length-1].t-p,s=a.length-1;for(;s>0&&a[s-1].t>o;)s--;let c=t.budget*1.5;for(let e=s;e<a.length;e++){let n=a[e][t.key];n!=null&&n>c&&(c=n)}let l=e=>i-e/c*(i-2)-1,u=getComputedStyle(e);n.strokeStyle=u.getPropertyValue(`--ink-bad`).trim()||`#f87171`,n.setLineDash([4,3]),n.beginPath(),n.moveTo(0,l(t.budget)),n.lineTo(r,l(t.budget)),n.stroke(),n.setLineDash([]),n.strokeStyle=(t.key===`ms`?u.getPropertyValue(`--tp-accent`):u.getPropertyValue(`--ink-good`)).trim()||(t.key===`ms`?`#60a5fa`:`#a7f3d0`),n.lineWidth=1,n.beginPath();let d=!1;for(let e=s;e<a.length;e++){let i=a[e][t.key];if(i==null)continue;let s=(a[e].t-o)/p*r;d?n.lineTo(s,l(i)):n.moveTo(s,l(i)),d=!0}n.stroke()};return n(t),{update:n}}var S=fe(),C=N(S),w=e=>{var t=uot(),n=j(t),r=j(n);Hx(r,{size:16,"aria-hidden":`true`});var i=g(r,4),a=j(i);fS(a,{size:16,"aria-hidden":`true`}),H(i),H(n);var o=g(n,2),c=g(j(o),2),u=e=>{var t=Xat();X(e,t)};G(c,e=>{Q(m).length===0&&e(u)});var d=g(c,2);B(d,21,()=>Q(m),e=>e.id,(e,t)=>{let n=q(()=>s().sessions[Q(t).id]),r=q(()=>Q(n)?.rec??s().recording[Q(t).id]);var i=tot(),a=j(i),o=f(a,!0),c=g(a,2),l=e=>{var t=Zat();X(e,t)};G(c,e=>{(Q(n)?.xr||Q(t).vr)&&e(l)});var u=g(c,2),d=e=>{var t=Qat(),n=f(t);O(()=>Y(n,`â REC${Q(r).mode===`detailed`?` detailed`:``}`)),X(e,t)};G(u,e=>{Q(r)&&e(d)});var p=g(u,2),m=e=>{var n=$at();L(`click`,n,()=>Nve(Q(t).id)),X(e,n)},h=e=>{var n=eot(),r=N(n),i=g(r,2);L(`click`,r,()=>yw(Q(t).id,`light`)),L(`click`,i,()=>yw(Q(t).id,`detailed`)),X(e,n)};G(p,e=>{Q(n)?.watching?e(m):e(h,-1)}),H(i),O(()=>{b(i,`data-peer`,Q(t).id),b(a,`title`,Q(t).id),Y(o,Q(t).name)}),X(e,i)}),H(d);var p=g(d,2);B(p,17,()=>Q(h),e=>e.peerId,(e,t)=>{var n=lot(),r=j(n),i=j(r),a=f(i),o=g(i,2),s=f(o,!0);H(r);var c=g(r,2),u=j(c),d=f(u),p=g(u,2),m=f(p),h=g(p,2),S=f(h),C=g(h,2),w=f(C),T=g(C,2),E=f(T);H(c);var D=g(c,2);ne(D,(e,t)=>x?.(e,t),()=>({peerId:Q(t).peerId,key:`ms`,budget:13.9,frames:Q(t).frames,theme:l()}));var k=g(D,2);ne(k,(e,t)=>x?.(e,t),()=>({peerId:Q(t).peerId,key:`calls`,budget:150,frames:Q(t).frames,theme:l()}));var ee=g(k,2),M=j(ee),te=f(M),P=g(M),re=g(P),ie=f(re),F=g(re,2),ae=e=>{var n=Te();O(()=>Y(n,`· ${Q(t).dropped??``} dropped`)),X(e,n)};G(F,e=>{Q(t).dropped&&e(ae)});var I=g(F,2),oe=e=>{var n=not(),r=g(N(n)),i=f(r,!0);O(()=>{b(r,`title`,Q(t).device),Y(i,Q(t).xr?`in VR`:`not in VR`)}),X(e,n)};G(I,e=>{Q(t).device&&e(oe)}),H(ee);var R=g(ee,2),se=e=>{var n=iot(),r=g(j(n));B(r,17,()=>Object.entries(Q(t).cpu),([e,t])=>e,(e,t)=>{var n=q(()=>A(Q(t),2));let r=()=>Q(n)[0],i=()=>Q(n)[1];var a=rot(),o=f(a);O(()=>Y(o,`${r()??``} ${i()??``}`)),X(e,a)}),H(n),X(e,n)};G(R,e=>{Q(t).cpu&&e(se)});var ce=g(R,2),le=e=>{var n=oot(),r=j(n),i=f(r),a=g(r,2);B(a,21,()=>Q(t).lastCapture.top,Be,(e,t)=>{var n=aot(),r=f(n);O((e,i)=>{b(n,`title`,Q(t).path),Y(r,`${Q(t).name??``} â ${e??``} calls · ${i??``} tris`)},[()=>v(Q(t).calls),()=>v(Q(t).tris)]),X(e,n)}),H(a),H(n),O(e=>Y(i,`Capture at ${e??``} s â ${Q(t).lastCapture.objects??``} objects, who draws most:`),[()=>(Q(t).lastCapture.t/1e3).toFixed(1)]),X(e,n)};G(ce,e=>{Q(t).lastCapture&&e(le)});var ue=g(ce,2),de=j(ue),z=e=>{var n=sot();L(`click`,n,()=>Ave(Q(t).peerId)),X(e,n)};G(de,e=>{Q(t).watching&&e(z)});var fe=g(de,2),pe=g(fe,2),me=g(pe,2),V=e=>{var n=cot(),r=f(n,!0);O(()=>Y(r,Q(_)[Q(t).peerId])),X(e,n)};G(me,e=>{Q(_)[Q(t).peerId]&&e(V)}),H(ue),H(n),O((e,r,i,o,c,l)=>{b(n,`data-peer`,Q(t).peerId),b(n,`data-mode`,Q(t).mode),b(n,`data-watching`,Q(t).watching),Y(a,`${Q(t).name??``}${Q(t).ended?` (left)`:``}`),Y(s,Q(t).watching?Q(t).waiting?`waitingâ¦`:`live`:`stopped`),Y(d,`${e??``} fps`),Y(m,`${r??``} ms`),b(h,`data-tier`,Q(t).latest?.calls!=null&&Q(t).latest.calls>150?`over`:`ok`),Y(S,`${i??``} calls`),Y(w,`${o??``} tris`),Y(E,`Q${c??``}`),Y(te,`${Q(t).frames??``} frames`),Y(P,` · ${Q(t).mode??``} · `),b(re,`data-over`,Q(t).mode===`light`&&Q(t).bytesPerSec>20480),Y(ie,`${l??``} KB/s`),fe.disabled=!Q(t).frames},[()=>v(Q(t).latest?.fps),()=>v(Q(t).latest?.ms),()=>v(Q(t).latest?.calls),()=>v(Q(t).latest?.tris),()=>v(Q(t).latest?.quality),()=>(Q(t).bytesPerSec/1024).toFixed(1)]),L(`click`,fe,()=>y(Q(t).peerId)),L(`click`,pe,()=>Mve(Q(t).peerId)),X(e,n)}),H(o),H(t),ne(t,(e,t)=>Zh?.(e,t),()=>({key:`profilerLiveWindow`,defaultRect:{left:140,top:110},resizable:!0})),ne(t,(e,t)=>Kh?.(e,t),()=>`profilerLive`),L(`click`,i,()=>vw.set(!1)),X(e,t)};G(C,e=>{c()&&e(w)}),X(e,S),ue(),d()}ge([`click`]);var fot=1e4,pot=1e3,mot=3,B3=()=>performance.now(),V3=null,H3=null,U3=null,W3=null,G3=[],K3=0,q3=!1,J3=!1;function hot(){let e=U(xi);if(!e||e.__perfDetailed)return;V3=e,H3=e.render,e.__perfDetailed=!0;try{U3=e.getContext(),W3=U3?.getExtension?.(`EXT_disjoint_timer_query_webgl2`)??null}catch{W3=null}let t=H3;e.render=function(...e){let n=B3();bc.first||(bc.first=n);let r=null;if(W3&&!J3)try{r=U3.createQuery(),U3.beginQuery(W3.TIME_ELAPSED_EXT,r),J3=!0}catch{r=null}try{return t.apply(this,e)}finally{if(r){try{U3.endQuery(W3.TIME_ELAPSED_EXT),G3.push(r)}catch{}J3=!1}let e=B3();bc.acc[4]+=e-n,bc.last=e}}}function got(){let e=V3;if(V3=null,e){delete e.__perfDetailed,H3&&(e.render=H3),H3=null;for(let e of G3)try{U3.deleteQuery(e)}catch{}G3=[]}}function _ot(){if(!W3||!G3.length)return;let e=U3.getParameter(W3.GPU_DISJOINT_EXT);for(;G3.length;){let t=G3[0];if(!U3.getQueryParameter(t,U3.QUERY_RESULT_AVAILABLE))break;G3.shift(),e||(K3+=U3.getQueryParameter(t,U3.QUERY_RESULT)/1e6,q3=!0),U3.deleteQuery(t)}G3.length>
249464&&G3.splice(0,G3.length-64).forEach(e=>U3.deleteQuery(e))}var Y3=new Float32Array(R_e.length);function vot(){let e=bc.acc,t=0;for(let n=0;n<5;n++)Y3[n]=e[n],t+=e[n];let n=bc.first&&bc.last>bc.first?bc.last-bc.first:0;return Y3[5]=Math.max(0,n-t),e.fill(0),bc.first=0,bc.last=0,X3++,Y3}function yot(){if(_ot(),!q3)return null;let e=K3;return K3=0,q3=!1,e}var X3=0;function bot(e){let t=X3+e;return new Promise(n=>{let r=B3(),i=()=>{X3>=t||B3()-r>2e3?n(X3-(t-e)):setTimeout(i,8)};i()})}function xot(e,t,n){if(!t||!(e.isMesh||e.isSkinnedMesh||e.isInstancedMesh))return 0;let r=t.index,i=t.attributes?.position,a=r?r.count:i?i.count:0,o=t.drawRange;o&&(a=Math.min(a,Math.max(0,o.count===1/0?a:o.count))),n&&(a=Math.min(a,n.count));let s=e.isInstancedMesh?e.count:t.isInstancedBufferGeometry?t.instanceCount:1;return Math.floor(a/3)*(Number.isFinite(s)?s:1)}function Sot(e){if(!e)return``;let t=e=>e?.name||e?.type||``;return Array.isArray(e)?e.map(t).join(`+`):t(e)}function Cot(e,t,n){let r=[],i=e.userData?.moduleId??null,a=e,o=!1,s=null;for(;a&&a!==t;){if(a===n){o=!0;break}r.unshift(a.name||a.type),!i&&a.userData?.moduleId&&(i=String(a.userData.moduleId)),s=a,a=a.parent}return!o&&!i&&s&&s!==e&&(i=s.name||null),{path:(o?`Scene/`:``)+r.join(`/`),module:i}}var Z3=!1;async function wot(e=3){let t=U(Pi),n=U(xi);if(!t||Z3)return null;Z3=!0;let r=new Map,i=[],a=0,o=(e,t,n,i,a)=>{let o=e.uuid+(t?`:s`:``),s=r.get(o);return s||r.set(o,s={object:e,shadow:t,calls:0,tris:0,ms:0,material:Sot(i),transparent:!!i?.transparent}),s.calls++,s.tris+=xot(e,n,a),s},s=(e,t,n)=>{let r=Object.prototype.hasOwnProperty.call(e,t),a=e[t];i.push({object:e,key:t,had:r,prev:a}),e[t]=n};t.traverse(e=>{if(!(e.isMesh||e.isLine||e.isPoints||e.isSprite))return;let t=e.onBeforeRender,n=e.onAfterRender,r=null;if(s(e,`onBeforeRender`,function(n,i,s,c,l,u){t.call(e,n,i,s,c,l,u),r=o(e,!1,c,l,u),a=B3()}),s(e,`onAfterRender`,function(t,i,o,s,c,l){r&&(r.ms+=B3()-a),r=null,n.call(e,t,i,o,s,c,l)}),typeof e.onBeforeShadow==`function`){let t=e.onBeforeShadow;s(e,`onBeforeShadow`,function(...n){t.apply(e,n),o(e,!0,n[4],n[5],n[6])})}});let c=0;try{c=await bot(e)}finally{for(let e=i.length-1;e>=0;e--){let{object:t,key:n,had:r,prev:a}=i[e];r?t[n]=a:delete t[n]}Z3=!1}let l=Math.max(1,c),u=U(Ui);return{t:0,frames:l,objects:[...r.values()].map(e=>{let{path:n,module:r}=Cot(e.object,t,u);return{uuid:e.object.uuid,name:e.object.name||e.object.type,path:n,module:r,calls:Math.round(e.calls/l*100)/100,tris:Math.round(e.tris/l),material:e.material,shadow:e.shadow,...e.transparent?{transparent:!0}:{},...e.shadow?{}:{ms:Math.round(e.ms/l*1e3)/1e3}}}).sort((e,t)=>t.calls-e.calls||t.tris-e.tris),memory:{heap:(typeof performance<`u`?performance:null)?.memory?.usedJSHeapSize??null,geometries:n?.info?.memory?.geometries??null,textures:n?.info?.memory?.textures??null,programs:Array.isArray(n?.info?.programs)?n.info.programs.length:null}}}function Tot(){return bc.acc.fill(0),bc.first=0,bc.last=0,bc.on=!0,hot(),K3=0,q3=!1,{gpuTimer:!!W3}}function Eot(){bc.on=!1,got()}function Q3(){q_e({start:Tot,stop:Eot,frameCpu:vot,frameGpu:yot,capture:wot})}function Dot(){return{on:bc.on,wrapped:!!V3,gpuTimer:!!W3,pending:G3.length,capturing:Z3}}var $3=2048,e6=new Map,t6=new Float64Array($3),n6=new Float32Array($3),r6=new Float64Array($3),i6=new Float64Array($3),a6=new Float32Array($3),o6=new Float32Array($3*6),s6=new Uint8Array($3),c6=0,l6=0,u6=[],d6=0,f6=null,p6=[],m6={batches:0,frames:0,bytes:0,captures:0};function Oot(e,t,n,r,i,a){if(c6>=$3){l6++;return}let o=c6++;if(t6[o]=e,n6[o]=t,r6[o]=n,i6[o]=r,a6[o]=i,a){s6[o]=1;for(let e=0;e<6;e++)o6[o*6+e]=a[e]||0}else s6[o]=0}function h6(e,t){let n=U(Es)?.connections?.[e];if(!n)return!1;if(!n.open)return!0;try{return n.send(t),!0}catch{return!1}}function g6(){let e=QC();return e?{id:e.id,mode:e.mode,startedAt:e.startedAt,frames:e.frames}:null}function kot(){let e=Math.min(c6,kC),t=c6-e,n=Array(e),r=!1;for(let i=0;i<e;i++){let e=t+i,a=null;s6[e]&&(r=!0,a=Array.from(o6.subarray(e*6,e*6+6))),n[i]={t:t6[e],ms:n6[e],calls:r6[e],tris:i6[e],quality:a6[e],cpu:a}}let i=l6+t;c6=0,l6=0;let a=u6.length>50?u6.slice(-50):u6;if(u6=[],!e&&!a.length)return;let o=$C().epoch0,s=g6();d6++;let c=EC(n,!1),l=r?EC(n,!0):c;for(let[t,n]of e6){if(!ex(t))continue;let r=n.mode===`detailed`?l:c,u={type:`perflive`,op:`frames`,seq:d6,base:o,...r,rec:s};if(a.length&&(u.ev=a),i&&(u.drop=i),!h6(t,u)){e6.delete(t);continue}m6.batches++,m6.frames+=e}e6.size||_6()}function Aot(){f6||=(c6=0,l6=0,u6=[],tw(Oot),p6.push(K_e(e=>u6.push(e))),p6.push(U_e(e=>{let t={type:`perflive`,op:`capture`,base:$C().epoch0,t:Math.round(nw()*10)/10,cap:DC(e)};for(let[e,n]of e6)n.mode===`detailed`&&ex(e)&&h6(e,t)&&m6.captures++})),setInterval(kot,500))}function _6(){clearInterval(f6),f6=null,tw(null);for(let e of p6)e();p6=[],c6=0}function jot(e,t){if(!ex(e))return;let n=!e6.has(e);if(e6.set(e,{mode:t,since:Date.now()}),Aot(),n){let{epoch0:t}=$C();h6(e,{type:`perflive`,op:`hello`,base:t,meta:H_e(`light`,t),rec:g6()});let n=ew(s_e),r=n.meta.startedAt-t,i=n.frames.slice(-kC).map(e=>({...e,t:e.t+r}));if(i.length){let a=n.events.slice(-50).map(e=>({...e,t:Math.round((e.t+r)*10)/10}));h6(e,{type:`perflive`,op:`frames`,seq:0,base:t,backfill:!0,...EC(i),ev:a,rec:g6()})}}t===`detailed`&&!QC()&&B_e({mode:`detailed`,name:`Detailed (requested by a peer)`})}function v6(e){e6.delete(e),e6.size||_6()}async function Mot(e,t){if(!e6.has(e)||!ex(e))return;
2494let n=e6.get(e).mode===`light`,r=await W_e(Math.max(1,Math.min(10,t||3)));if(!r){h6(e,{type:`perflive`,op:`nocapture`});return}n&&h6(e,{type:`perflive`,op:`capture`,base:$C().epoch0,t:Math.round(nw()*10)/10,cap:DC(r)})}function y6(e,t){t.op===`watch`?jot(e,t.mode===`detailed`?`detailed`:`light`):t.op===`unwatch`?v6(e):t.op===`detail`&&Mot(e,Number(t.frames)||3)}function b6(e){v6(e)}var x6=!1;function S6(){if(x6)return;x6=!0,uee(`perfLive`,()=>e6.size?{watchers:e6.size}:null);let e=null;G_e.subscribe(t=>{let n=t.recording?.id??null;if(n===e)return;e=n;let r=U(Es);try{r?.broadcast?.({type:`perflive`,op:`state`,rec:g6()})}catch{}})}function Not(){return{watchers:[...e6].map(([e,t])=>({id:e,mode:t.mode})),running:!!f6,...m6}}var Pot=new Set([`watch`,`unwatch`,`detail`]),C6=!1;function Fot(){C6||(C6=!0,S6(),c_e({message:(e,t)=>Pot.has(t.op)?y6(e,t):Eve(e,t),gone:e=>{b6(e),Ove(e)}}))}var w6={generated:`2026-10-05`,source:`modules@c33bb07 (origin/dev)`,modules:{avatar:`1.1.0`,car:`1.2.1`,collectible:`1.1.2`,"door-keypad":`1.0.1`,dungeon:`2.4.0`,"dungeon-realms":`2.3.0`,essentials:`1.1.1`,"flow-toolkit":`1.0.0`,football:`1.3.0`,"fps-player":`1.0.0`,health:`1.0.0`,"music-dj":`0.1.1`,"music-fx":`0.2.0`,"music-lab":`0.2.1`,"music-voice":`0.1.1`,piano:`1.1.1`,sabers:`1.0.1`,"tutorial-room":`1.1.0`,untangle:`2.4.0`,waves:`2.3.0`}}.modules??{};function T6(e,t){let n=[];for(let r of e??[]){let e=t?.[r?.id];e&&r?.version&&mb(e,r.version)&&n.push({id:r.id,name:r.name||r.id,installed:String(r.version),expected:String(e)})}return n}var E6=we(vb,e=>T6(e,w6)),D6=Ue([]),O6=`stale-modules`;async function k6(e){D6.update(t=>[...t,e]);try{await db();let t=U(pb).find(t=>t.id===e);if(t)return!!await xb(fb(t));let n=U(vb).find(t=>t.id===e);return n?(await yb(n),!0):!1}finally{D6.update(t=>t.filter(t=>t!==e))}}async function A6(){let e=0;for(let t of U(E6))await k6(t.id)&&e++;return e}var j6=``,Iot=null;function M6(){Iot||=E6.subscribe(e=>{let t=e.map(e=>e.id+`@`+e.installed).join(`,`);if(!e.length){j6&&oc(O6),j6=``;return}if(t===j6)return;j6=t;for(let t of e)xc(`stale-module`,{id:t.id,installed:t.installed,expected:t.expected});let n=e.map(e=>`${e.name} ${e.installed} (this app expects ${e.expected})`).join(`, `);Po(O6,(e.length===1?`An installed module is older than this app expects: `:`Installed modules are older than this app expects: `)+n+`. Old modules can bring back bugs that are already fixed.`,[{label:e.length===1?`Update`:`Update all`,action:()=>{oc(O6),A6()}},{label:`Open Modules`,action:()=>{oc(O6),Oo.set(!0)}}])})}var Lot=V(`<span class="hint svelte-12xwp9d">· scroll to push / pull</span>`),Rot=V(`<div class="reticle-note svelte-12xwp9d"> <!></div>`),zot=V(`<div id="play-reticle-toofar" class="reticle-note svelte-12xwp9d"> </div>`),Bot=V(`<div class="reticle-note svelte-12xwp9d"> </div>`),Vot=V(`<div class="reticle-wrap svelte-12xwp9d" aria-hidden="true"><div id="play-reticle"></div> <!></div>`);function Hot(e,n){Ce(n,!0);let i=()=>z(rk,`$playInteractState`,s),a=()=>z(ki,`$isLocked`,s),o=()=>z(wi,`$isVRMode`,s),[s,c]=Ve(),l=t(Ne(typeof localStorage<`u`&&nt.getItem(`playCarryHintSeen`)===`true`)),u=q(i),d=q(()=>a()&&!o()&&Q(u).mode!==`off`&&!Sl()),p=q(()=>Q(u).mode===`carrying`);Qe(()=>{if(Q(p)&&!Q(l)){I(l,!0);try{nt.setItem(`playCarryHintSeen`,`true`)}catch{}}});var m=fe(),h=N(m),_=e=>{var t=Vot(),n=j(t);let i;var a=g(n,2),o=e=>{var t=Rot(),n=j(t),r=g(n),i=e=>{var t=Lot();X(e,t)};G(r,e=>{Q(l)||e(i)}),H(t),O(e=>Y(n,`${e??``} m `),[()=>Q(u).distance.toFixed(1)]),X(e,t)},s=e=>{var t=zot(),n=f(t,!0);O(()=>Y(n,Q(u).reason??`Too far â get closer`)),X(e,t)},c=e=>{var t=Bot(),n=f(t);O(()=>Y(n,`held by ${Q(u).blocked??``}`)),X(e,t)};G(a,e=>{Q(p)?e(o):Q(u).mode===`toofar`?e(s,1):Q(u).blocked&&e(c,2)}),H(t),O(()=>i=r(n,1,`reticle svelte-12xwp9d`,null,i,{aiming:Q(u).mode===`aiming`,toofar:Q(u).mode===`toofar`,carrying:Q(p)})),X(e,t)};G(h,e=>{Q(d)&&e(_)}),X(e,m),ue(),c()}var Uot=V(`<span class="tle-stick svelte-1j5vmzv"><span class="tle-nub svelte-1j5vmzv"></span></span>`),Wot=V(`<span class="tle-grip svelte-1j5vmzv" title="Drag to resize" aria-hidden="true"></span>`),Got=V(`<div><!> <span class="tle-name svelte-1j5vmzv"> </span> <!></div>`),Kot=V(`<p class="tle-hint svelte-1j5vmzv">This scene has no action buttons of its own â arranging the usual Fire and Jump here sets the layout games start from.</p>`),qot=V(`<div class="tle-row svelte-1j5vmzv"><span class="tle-sel svelte-1j5vmzv" id="touch-layout-selected"> </span> <label class="tle-check svelte-1j5vmzv"><input id="touch-layout-hide" class="tp-check" type="checkbox"/> Hide</label></div> <label class="tle-row tle-slider svelte-1j5vmzv"><span class="svelte-1j5vmzv">Size</span> <input id="touch-layout-size" type="range" step="2" class="svelte-1j5vmzv"/> <span class="tle-num svelte-1j5vmzv"> </span></label> <label class="tle-row tle-slider svelte-1j5vmzv"><span class="svelte-1j5vmzv">Opacity</span> <input id="touch-layout-opacity" type="range" step="0.05" class="svelte-1j5vmzv"/> <span class="tle-num svelte-1j5vmzv"> </span></label> <div class="tle-row svelte-1j5vmzv"><button type="button" class="tle-btn svelte-1j5vmzv" id="touch-layout-default-item">Default place</button></div>`,1),Jot=V(`<p class="tle-hint svelte-1j5vmzv">Drag a control to move it. Select one to resize it (or pinch it with a second finger).</p>`),Yot=V(`<div id="touch-layout-editor" class="tle svelte-1j5vmzv" role="dialog" aria-label="Touch controls layout"><div class="tle-grid svelte-1j5vmzv" aria-hidden="true"></div> <!> <div class="tle-panel svelte-1j5vmzv" data-tour="touch-layout-panel"><div class="tle-row tle-head svelte-1j5vmzv"><strong>Touch controls layout</strong> <span class="tle-seg tp-seg" role="group" aria-label="Save for">
2494<button type="button" id="touch-layout-scope-game" class="tp-seg-btn">This game</button> <button type="button" id="touch-layout-scope-global" class="tp-seg-btn">All games</button></span></div> <!> <!> <div class="tle-row tle-actions svelte-1j5vmzv"><button type="button" class="tle-btn svelte-1j5vmzv" id="touch-layout-reset" data-tour="touch-layout-reset"><!> Reset</button> <span class="tle-spacer svelte-1j5vmzv"></span> <button type="button" class="tle-btn svelte-1j5vmzv" id="touch-layout-cancel"><!> Cancel</button> <button type="button" class="tle-btn tle-primary svelte-1j5vmzv" id="touch-layout-save" data-tour="touch-layout-save"><!> Save</button></div></div></div>`);function Xot(e,n){Ce(n,!0);let i=()=>z(Bl,`$touchTextures`,a),[a,o]=Ve(),s=t(Ne(typeof window>`u`?1280:window.innerWidth)),c=t(Ne(typeof window>`u`?720:window.innerHeight)),l=U(gY),d=l.actions.length===0,p=d?Pl({declared:[{owner:``,actions:[],preset:`shooter`,at:0}]}):l,m=U(Xl),h=t(Ne(U(jl).scope)),_=t(Ne(structuredClone(Rl(p,Kl(U(Ml),m),window.innerWidth,window.innerHeight).items))),y=t(Ne(p.actions[0]?`btn:`+p.actions[0].id:`stick`)),x=t(!1);function S(e){if(e===`stick`)return`Move stick`;let t=p.actions.find(t=>`btn:`+t.id===e);return t?t.label:e}let C=q(()=>[`stick`,...p.actions.map(e=>`btn:`+e.id)].filter(e=>Q(_)[e])),T=q(()=>Q(y)&&Q(_)[Q(y)]?Q(_)[Q(y)]:null),E=(e,t,n)=>Math.min(n,Math.max(t,e));function D(e,t){Q(_)[e]&&(Q(_)[e]={...Q(_)[e],...t},I(x,!0))}let k=new Map,A=null,ee=new Map;function M(e){let t=e.target instanceof Element?e.target:null;if(!t||!t.closest(`#touch-layout-editor`)||t.closest(`.tle-panel`))return;ee.set(e.pointerId,{x:e.clientX,y:e.clientY});let n=t.closest(`[data-edit-grip]`),r=t.closest(`[data-edit-item]`),i=(n??r)?.getAttribute(n?`data-edit-grip`:`data-edit-item`)??null;if(e.preventDefault(),i&&Q(_)[i]){I(y,i,!0);let t=Q(_)[i];k.set(e.pointerId,{key:i,kind:n?`resize`:`move`,sx:e.clientX,sy:e.clientY,ix:t.x,iy:t.y,size:t.size});return}let a=[...k.entries()].find(([,e])=>e.kind===`move`);if(a){let[t,n]=a,r=ee.get(t);if(r){A={key:n.key,a:t,b:e.pointerId,dist:Math.max(10,Math.hypot(e.clientX-r.x,e.clientY-r.y)),size:Q(_)[n.key].size};return}}I(y,null)}function te(e){if(!ee.has(e.pointerId))return;if(ee.set(e.pointerId,{x:e.clientX,y:e.clientY}),A&&(e.pointerId===A.a||e.pointerId===A.b)){let t=ee.get(A.a),n=ee.get(A.b);if(t&&n){let e=Math.hypot(t.x-n.x,t.y-n.y);D(A.key,{size:Math.round(E(A.size*e/A.dist,Hl.min,Hl.max))})}if(e.pointerId===A.b)return}let t=k.get(e.pointerId);if(t){if(t.kind===`resize`){let n=(e.clientX-t.sx+(e.clientY-t.sy))/Math.SQRT2;D(t.key,{size:Math.round(E(t.size+n*2,Hl.min,Hl.max))});return}D(t.key,{x:E(t.ix+(e.clientX-t.sx)/Q(s),0,1),y:E(t.iy+(e.clientY-t.sy)/Q(c),0,1)})}}function ne(e){ee.delete(e.pointerId),k.delete(e.pointerId),A&&(e.pointerId===A.a||e.pointerId===A.b)&&(A=null)}function P(e){e.key===`Escape`&&(e.preventDefault(),e.stopImmediatePropagation(),Ll())}function re(){I(s,window.innerWidth,!0),I(c,window.innerHeight,!0)}_e(()=>(window.addEventListener(`pointerdown`,M,!0),window.addEventListener(`pointermove`,te),window.addEventListener(`pointerup`,ne,!0),window.addEventListener(`pointercancel`,ne,!0),window.addEventListener(`keydown`,P,!0),window.addEventListener(`resize`,re),()=>{window.removeEventListener(`pointerdown`,M,!0),window.removeEventListener(`pointermove`,te),window.removeEventListener(`pointerup`,ne,!0),window.removeEventListener(`pointercancel`,ne,!0),window.removeEventListener(`keydown`,P,!0),window.removeEventListener(`resize`,re)}));function ie(e){if(I(h,e,!0),Il({scope:e}),!Q(x)){let t=U(Ml),n=e===`global`?t.global:Kl(t,m);I(_,structuredClone(Rl(p,n,Q(s),Q(c)).items),!0)}}function F(){zl(Q(h),m);let e=U(Ml),t=Q(h)===`game`?e.global:null;I(_,structuredClone(Rl(p,t,Q(s),Q(c)).items),!0),I(x,!1)}function ae(){hte({v:1,items:K(()=>Ae(Q(_)))},Q(h),m),Ll()}let oe=q(()=>mte(p,Q(s),Q(c)).items);function R(e,t,n){return Math.min(t-n/2-4,Math.max(n/2+4,e*t))}var se=Yot(),ce=g(j(se),2);B(ce,16,()=>Q(C),e=>e,(e,t)=>{let n=q(()=>Q(_)[t]),a=q(()=>p.actions.find(e=>`btn:`+e.id===t));var o=Got();let l,u;var d=j(o),m=e=>{{let t=q(()=>i()[Q(a).id]??null);hY(e,{get action(){return Q(a)},get size(){return Q(n).size},get texture(){return Q(t)},get opacity(){return Q(n).opacity}})}},h=e=>{var t=Uot();let r;O(()=>r=Ze(t,``,r,{opacity:Q(n).opacity})),X(e,t)};G(d,e=>{Q(a)?e(m):e(h,-1)});var v=g(d,2),x=f(v,!0),C=g(v,2),w=e=>{var n=Wot();O(()=>b(n,`data-edit-grip`,t)),X(e,n)};G(C,e=>{Q(y)===t&&e(w)}),H(o),O((e,i,a)=>{l=r(o,1,`tle-item svelte-1j5vmzv`,null,l,{selected:Q(y)===t,"hidden-item":Q(n).hidden}),b(o,`data-edit-item`,t),u=Ze(o,``,u,{left:e,top:i,width:`${Q(n).size??``}px`,height:`${Q(n).size??``}px`}),Y(x,a)},[()=>`${R(Q(n).x,Q(s),Q(n).size)??``}px`,()=>`${R(Q(n).y,Q(c),Q(n).size)??``}px`,()=>S(t)]),X(e,o)});var le=g(ce,2),de=j(le),fe=g(j(de),2),pe=j(fe),me=g(pe,2);H(fe),H(de);var V=g(de,2),he=e=>{var t=Kot();X(e,t)};G(V,e=>{d&&e(he)});var ge=g(V,2),ve=e=>{var t=qot(),n=N(t),r=j(n),i=f(r,!0),a=g(r,2),o=j(a);v(o),W(),H(a),H(n);var s=g(n,2),c=g(j(s),2);
2494v(c);var l=g(c,2),d=f(l);H(s);var p=g(s,2),m=g(j(p),2);v(m);var h=g(m,2),_=f(h);H(p);var x=g(p,2),C=f(x);O((e,t)=>{Y(i,e),w(o,!!Q(T).hidden),b(c,`min`,Hl.min),b(c,`max`,Hl.max),u(c,Q(T).size),Y(d,`${Q(T).size??``}px`),b(m,`min`,Fl.min),b(m,`max`,Fl.max),u(m,Q(T).opacity),Y(_,`${t??``}%`)},[()=>S(Q(y)),()=>Math.round(Q(T).opacity*100)]),L(`change`,o,e=>D(Q(y),{hidden:e.currentTarget.checked})),L(`input`,c,e=>D(Q(y),{size:Number(e.currentTarget.value)})),L(`input`,m,e=>D(Q(y),{opacity:Number(e.currentTarget.value)})),L(`click`,C,()=>Q(y)&&Q(oe)[Q(y)]&&D(Q(y),{...Q(oe)[Q(y)],hidden:!1})),X(e,t)},ye=e=>{var t=Jot();X(e,t)};G(ge,e=>{Q(T)&&Q(y)?e(ve):e(ye,-1)});var be=g(ge,2),xe=j(be),Se=j(xe);OS(Se,{size:14,"aria-hidden":`true`}),W(),H(xe);var we=g(xe,4),Te=j(we);fS(Te,{size:14,"aria-hidden":`true`}),W(),H(we);var Ee=g(we,2);$R(j(Ee),{size:14,"aria-hidden":`true`}),W(),H(Ee),H(be),H(le),H(se),O(()=>{b(pe,`aria-pressed`,Q(h)===`game`),b(me,`aria-pressed`,Q(h)===`global`)}),L(`click`,pe,()=>ie(`game`)),L(`click`,me,()=>ie(`global`)),L(`click`,xe,F),L(`click`,we,()=>Ll()),L(`click`,Ee,ae),X(e,se),ue(),o()}ge([`click`,`change`,`input`]);var Zot=V(`<div class="touch-stick-rest svelte-fwt68m"></div>`),Qot=V(`<div id="touch-move-stick" class="stick-base svelte-fwt68m"><div class="stick-nub svelte-fwt68m"></div></div>`),$ot=V(`<div class="touch-play svelte-fwt68m" aria-hidden="true"><!> <!></div> <button id="play-exit" class="play-exit svelte-fwt68m" aria-label="Exit play" title="Exit play"><!></button>`,1),est=V(`<button type="button" class="touch-btn svelte-fwt68m" data-hud-avoid=""><!></button>`),tst=V(`<div id="touch-actions"></div>`),nst=V(`<!> <!> <!>`,1);function rst(e,n){Ce(n,!0);let i=()=>z(jl,`$touchPrefs`,v),a=()=>z(Nl,`$touchSeen`,v),o=()=>z(ki,`$isLocked`,v),s=()=>z(wi,`$isVRMode`,v),c=()=>z(cte,`$touchLayoutEditorOpen`,v),l=()=>z(gY,`$touchSpec`,v),u=()=>z(Jr,`$playPointerFree`,v),d=()=>z(tb,`$inputClaims`,v),f=()=>z(Ml,`$touchLayouts`,v),p=()=>z(Xl,`$gameId`,v),m=()=>z(xi,`$globalRenderer`,v),h=()=>z(ER,`$touchSticks`,v),_=()=>z(Bl,`$touchTextures`,v),[v,y]=Ve(),x=t(!1),S=t(1280),C=t(720);_e(()=>{I(x,Wr(),!0);let e=()=>{I(S,window.innerWidth,!0),I(C,window.innerHeight,!0)};if(e(),window.addEventListener(`resize`,e),!window.matchMedia)return()=>window.removeEventListener(`resize`,e);let t=window.matchMedia(`(pointer: coarse)`),n=()=>I(x,t.matches,!0);return t.addEventListener(`change`,n),()=>{t.removeEventListener(`change`,n),window.removeEventListener(`resize`,e)}});let w=q(()=>ste(i().visibility,Q(x),a()));Qe(()=>Al.set(Q(w)));let T=q(()=>o()===!0&&!s()),E=q(c),D=q(()=>Q(T)&&Q(w)&&!Q(E)),k=q(l),A=q(()=>Q(D)&&!u()&&!d().includes(`keys`)),ee=q(()=>Q(A)&&Q(k).stick),M=q(()=>Q(A)&&Q(k).look),te=q(()=>Q(w)&&!Q(E)&&!s()&&Q(k).actions.length>0&&(Q(T)?!u():i().showInEdit)),ne=q(()=>Rl(Q(k),Kl(f(),p()),Q(S),Q(C))),P=q(()=>Q(ne).items.stick),re=q(()=>(Q(P)?.size??128)/2),ie=null,F=null,ae=new Map,oe=t(Ne([]));function R(){return m()?.domElement??null}function se(){ae.clear(),I(oe,[],!0),ute({canvas:R()})}function ce(){ie=null,F=null,jR()}Qe(()=>{Q(ee)&&Q(M)||K(()=>{Q(ee)?Q(M)||(F=null,ER.update(e=>({...e,look:null}))):(ie=null,Q(M)?(TR.set({x:0,y:0}),ER.update(e=>({...e,move:null}))):ce())})}),Qe(()=>{Q(te)||K(()=>se())}),Qe(()=>{if(Q(D)&&typeof document<`u`)return document.documentElement.classList.add(`touch-play-on`),()=>document.documentElement.classList.remove(`touch-play-on`)});function le(e){return e instanceof Element&&e.tagName===`CANVAS`}function de(e){if(!(e instanceof Element))return null;let t=e.closest(`[data-touch-btn]`);return t?t.getAttribute(`data-touch-btn`):null}function pe(e){return Q(k).actions.find(t=>t.id===e)??null}function me(e){if(e.__tpTouchAction||(e.pointerType===`touch`&&!a()&&Nl.set(!0),!Q(te)))return;let t=de(e.target);if(!t)return;let n=pe(t);e.preventDefault(),e.stopPropagation(),n&&![...ae.values()].includes(t)&&(ae.set(e.pointerId,t),I(oe,[...Q(oe),t],!0),Vl(n,!0,{canvas:R(),haptics:i().haptics}))}function V(e){if(e.__tpTouchAction||!Q(A)||e.pointerType!==`touch`||!le(e.target))return;let t=Q(P)&&Math.hypot(e.clientX-Q(P).x*Q(S),e.clientY-Q(P).y*Q(C))<=Q(re)*1.25;if(Q(ee)&&(t||e.clientX<window.innerWidth/2)){if(ie)return;let n=t?Q(P).x*Q(S):e.clientX,r=t?Q(P).y*Q(C):e.clientY;ie={id:e.pointerId,ox:n,oy:r},t&&TR.set(MR(e.clientX-n,e.clientY-r,Q(re))),ER.update(t=>({...t,move:{ox:n,oy:r,x:e.clientX,y:e.clientY}}))}else if(Q(M)){if(F)return;F={id:e.pointerId,x:e.clientX,y:e.clientY,t:e.timeStamp,travel:0},ER.update(t=>({...t,look:{x:e.clientX,y:e.clientY}}))}}function he(e){if(ie&&e.pointerId===ie.id){let t=MR(e.clientX-ie.ox,e.clientY-ie.oy,Q(re));TR.set(t);let{ox:n,oy:r}=ie;ER.update(t=>({...t,move:{ox:n,oy:r,x:e.clientX,y:e.clientY}}));return}if(F&&e.pointerId===F.id){let t=e.clientX-F.x,n=e.clientY-F.y;F.x=e.clientX,F.y=e.clientY,F.travel+=Math.hypot(t,n),kR(t,n),ER.update(t=>({...t,look:{x:e.clientX,y:e.clientY}}))}}function ge(e){if(e.__tpTouchAction)return;let t=ae.get(e.pointerId);if(t){ae.delete(e.pointerId),I(oe,Q(oe).filter(e=>e!==t),!0);let n=pe(t);n&&Vl(n,!1,{canvas:R()}),e.preventDefault(),e.stopPropagation();return}if(ie&&e.pointerId===ie.id){ie=null,TR.set({x:0,y:0}),ER.update(e=>({...e,move:null})),e.preventDefault();return}if(F&&e.pointerId===F.id){let t=F.travel>8;F=null,ER.update(e=>({...e,look:null})),t&&e.preventDefault()}}_e(()=>(window.addEventListener(`pointerdown`,me,!0),window.addEventListener(`pointerdown`,V),window.addEventListener(`pointermove`,he),window.addEventListener(`pointerup`,ge,!0),window.addEventListener(`pointercancel`,ge,!0),window.addEventListener(`blur`,se),()=>{window.removeEventListener(`pointerdown`,me,!0),window.removeEventListener(`pointerdown`,V),window.removeEventListener(`pointermove`,he),window.removeEventListener(`pointerup`,ge,!0),window.removeEventListener(`pointercancel`,ge,!0),window.removeEventListener(`blur`,se),ce(),se()}));let U=q(h),W=q(()=>{let e=Q(U).move;return e?MR(e.x-e.ox,e.y-e.oy,Q(re)):{x:0,y:0}});function ve(e,t,n){return Math.min(t-n/2-4,Math.max(n/2+4,e*t))}var ye=nst(),be=N(ye),xe=e=>{var t=$ot(),n=N(t),r=j(n),i=e=>{var t=Zot();let n;O((e,r)=>n=Ze(t,``,n,{left:e,top:r,width:`${Q(P).size??``}px`,height:`${Q(P).size??``}px`,opacity:Q(P).opacity*.7}),[()=>`${ve(Q(P).x,Q(S),Q(P).size)??``}px`,()=>`${ve(Q(P).y,Q(C),Q(P).size)??``}px`]),X(e,t)};G(r,e=>{Q(ee)&&Q(P)&&!Q(P).hidden&&!Q(U).move&&e(i)});var a=g(r,2),o=e=>{var t=Qot();let n;var r=j(t);let i;H(t),O(()=>{n=Ze(t,``,n,{left:`${Q(U).move.ox??``}px`,top:`${Q(U).move.oy??``}px`,width:`${Q(re)*2}px`,height:`${Q(re)*2}px`,opacity:Q(P)?.opacity??1}),i=Ze(r,``,i,{transform:`translate(-50%, -50%) translate(${Q(W).x*Q(re)}px, ${Q(W).y*Q(re)}px)`})}),X(e,t)};G(a,e=>{Q(U).move&&e(o)}),H(n);var s=g(n,2),c=j(s);fS(c,{size:20,"aria-hidden":`true`}),H(s),L(`click`,s,function(...e){qoe?.apply(this,e)}),X(e,t)};G(be,e=>{Q(D)&&e(xe)}
2494);var Se=g(be,2),we=e=>{var t=tst();let n;B(t,21,()=>Q(k).actions,e=>e.id,(e,t)=>{let n=q(()=>Q(ne).items[`btn:`+Q(t).id]);var r=fe(),i=N(r),a=e=>{var r=est();let i;var a=j(r);{let e=q(()=>Q(oe).includes(Q(t).id)),r=q(()=>_()[Q(t).id]??null);hY(a,{get action(){return Q(t)},get size(){return Q(n).size},get pressed(){return Q(e)},get texture(){return Q(r)},get opacity(){return Q(n).opacity}})}H(r),O((e,a,o)=>{b(r,`id`,e),b(r,`data-touch-btn`,Q(t).id),b(r,`aria-label`,Q(t).label),b(r,`title`,Q(t).label),i=Ze(r,``,i,{left:a,top:o,width:`${Q(n).size??``}px`,height:`${Q(n).size??``}px`})},[()=>`touch-btn-`+Q(t).id.replace(/[^\w-]/g,`_`),()=>`${ve(Q(n).x,Q(S),Q(n).size)??``}px`,()=>`${ve(Q(n).y,Q(C),Q(n).size)??``}px`]),X(e,r)};G(i,e=>{Q(n)&&!Q(n).hidden&&e(a)}),X(e,r)}),H(t),O(()=>n=r(t,1,`touch-actions svelte-fwt68m`,null,n,{"in-editor":!Q(T)})),X(e,t)};G(Se,e=>{Q(te)&&e(we)});var Te=g(Se,2),Ee=e=>{Xot(e,{})};G(Te,e=>{Q(E)&&e(Ee)}),X(e,ye),ue(),y()}ge([`click`]);var ist=V(`<span id="draw-spline-count" class="text-xs text-gray-300"> </span> <label class="flex items-center gap-1 text-xs text-gray-300" title="Join the last point back to the first"><input type="checkbox"/> loop</label> <button id="draw-spline-undo" class="rounded-full bg-gray-700 px-2.5 py-0.5 text-xs hover:bg-gray-600" title="Remove the last point (Backspace)">Undo point</button> <button id="draw-spline-finish" class="rounded-full bg-[#22c55e] px-3 py-0.5" title="Turn the points into a spline (Enter)">Finish</button>`,1),ast=V(`<label class="flex items-center gap-1 text-xs text-gray-300" title="Peers watch the line grow while you draw"><input type="checkbox"/> live</label>`),ost=V(`<div id="draw-toolbar" class="fixed left-1/2 top-20 z-40 flex -translate-x-1/2 items-center gap-3 rounded-full bg-gray-800 px-4 py-2 text-sm text-white shadow-xl"><span class="font-semibold"> </span> <div class="flex overflow-hidden rounded-full border border-gray-600 text-xs"><button id="draw-tool-freehand" title="Paint a stroke while you drag">Freehand</button> <button id="draw-tool-spline" title="Click to place control points â the result stays editable">Spline</button></div> <input type="color" title="Stroke color"/> <label class="flex items-center gap-1"><span class="text-xs text-gray-300"> </span> <input type="range" class="w-24 accent-[#ff4000]" min="0.01" max="0.15" step="0.01"/></label> <!> <button class="rounded-full bg-[#ff4000] px-3 py-0.5">Done</button></div>`);function sst(e,t){Ce(t,!0);let n=()=>z(l_,`$drawTool`,d),i=()=>z(c_,`$drawMode`,d),a=()=>z(d_,`$drawColor`,d),o=()=>z(p_,`$drawSize`,d),s=()=>z(Ole,`$splineDraft`,d),c=()=>z(y_,`$splineClosed`,d),l=()=>z(m_,`$liveStreaming`,d),[d,m]=Ve(),h=q(()=>n()===`spline`);function _(e){if(!i())return;let t=e.target;if(!t||t.tagName!==`INPUT`&&t.tagName!==`TEXTAREA`&&!t.isContentEditable){if(e.key===`Escape`){f_();return}Q(h)&&(e.key===`Enter`?(S_(),e.preventDefault()):e.key===`Backspace`&&(v_(),e.preventDefault()))}}function y(e){e!==n()&&(n()===`spline`&&kle(),l_.set(e))}var b=fe();Z(`keydown`,p,_);var x=N(b),S=e=>{var t=ost(),n=j(t),i=f(n,!0),d=g(n,2),p=j(d),m=g(p,2);H(d);var _=g(d,2);v(_);var b=g(_,2),x=j(b),S=f(x,!0),C=g(x,2);v(C),H(b);var T=g(b,2),E=e=>{var t=ist(),n=N(t),r=f(n),i=g(n,2),a=j(i);v(a),W(),H(i);var o=g(i,2),l=g(o,2);O(()=>{Y(r,`${s().length??``} point${s().length===1?``:`s`}`),w(a,c())}),L(`change`,a,e=>y_.set(e.currentTarget.checked)),L(`click`,o,()=>v_()),L(`click`,l,()=>S_()),X(e,t)},D=e=>{var t=ast(),n=j(t);v(n),W(),H(t),O(()=>w(n,l())),L(`change`,n,e=>m_.set(e.currentTarget.checked)),X(e,t)};G(T,e=>{Q(h)?e(E):e(D,-1)});var k=g(T,2);H(t),O(()=>{Y(i,Q(h)?`ã° Spline`:`âï¸ Drawing`),r(p,1,`px-2.5 py-0.5 ${Q(h)?`bg-gray-700 hover:bg-gray-600`:`bg-primary-600 text-white`}`),r(m,1,`px-2.5 py-0.5 ${Q(h)?`bg-primary-600 text-white`:`bg-gray-700 hover:bg-gray-600`}`),u(_,a()),Y(S,Q(h)?`radius`:`size`),u(C,o())}),L(`click`,p,()=>y(`freehand`)),L(`click`,m,()=>y(`spline`)),L(`input`,_,e=>d_.set(e.currentTarget.value)),L(`input`,C,e=>p_.set(+e.currentTarget.value)),L(`click`,k,()=>f_()),X(e,t)};G(x,e=>{i()&&e(S)}),X(e,b),ue(),m()}ge([`click`,`input`,`change`]);var cst=V(`<button id="sculpt-done" class="tbx-hbtn tbx-done" aria-label="Done" title="Finish sculpting (Esc)"><!></button>`),lst=V(`<span> </span>`),ust=V(`<button><!></button>`),dst=V(`<span class="tbx-label">Brush</span> <!> <div class="tbx-row text-xs"><label class="flex items-center gap-1.5">Radius <input id="sculpt-radius" type="range" min="0.5" max="8" step="0.25" class="w-20 accent-[#ff4000]"/> <span class="w-7"> </span></label></div> <div class="tbx-row text-xs"><label class="flex items-center gap-1.5">Strength <input id="sculpt-strength" type="range" min="0.05" max="1" step="0.05" class="w-20 accent-[#ff4000]"/> <span class="w-7"> </span></label></div> <span class="tbx-label">Display</span> <button id="sculpt-gizmo" class="tbx-btn" aria-label="Toggle the move gizmo"><!></button>`,1);function fst(e,t){Ce(t,!1);let n=()=>z(xh,`$sculptObject`,l),i=()=>z(xse,`$sculptMode`,l),a=()=>z(_h,`$sculptOp`,l),o=()=>z(yh,`$sculptRadius`,l),s=()=>z(Sh,`$sculptStrength`,l),c=()=>z(Vi,`$gizmoSuppressed`,l),[l,d]=Ve(),m=[{op:`raise`,label:`Raise`,icon:`raise`,desc:`pull the surface up along its normals`},{op:`lower`,label:`Lower`,icon:`lower`,desc:`push the surface down`},{op:`smooth`,label:`Smooth`,icon:`smooth`,desc:`relax the surface`},{op:`flatten`,label:`Flatten`,icon:`flatten`,desc:`level toward the hit plane`}];function h(e){e.key===`Escape`&&n()&&vh()}R();
2494var _=fe();Z(`keydown`,p,h);var y=N(_),x=e=>{{let t=e=>{var t=cst();$R(j(t),{size:14,"aria-hidden":`true`}),H(t),L(`click`,t,()=>vh()),X(e,t)},n=e=>{var t=lst(),n=f(t);O(e=>Y(n,`${o()??``}m · ${e??``}%`),[()=>Math.round(s()*100)]),X(e,t)},l=ze(()=>i()===`mesh`?`Sculpt mesh`:`Sculpt terrain`);fQ(e,{id:`sculpt-toolbar`,key:`sculptToolbox`,get title(){return Q(l)},actions:t,status:n,children:(e,t)=>{var n=dst(),i=g(N(n),2);B(i,1,()=>m,e=>e.op,(e,t)=>{var n=ust();mQ(j(n),{get name(){return Q(t).icon}}),H(n),O(()=>{b(n,`id`,`sculpt-op-${Q(t).op}`),r(n,1,`tbx-btn ${Q(t).op===a()?`tbx-on bg-primary-600 text-white`:``}`),b(n,`aria-label`,Q(t).label),b(n,`title`,`${Q(t).label} â ${Q(t).desc}`)}),L(`click`,n,()=>_h.set(Q(t).op)),X(e,n)});var l=g(i,2),d=j(l),p=g(j(d));v(p);var h=g(p,2),_=f(h);H(d),H(l);var y=g(l,2),x=j(y),S=g(j(x));v(S);var C=g(S,2),w=f(C,!0);H(x),H(y);var T=g(y,4);Cke(j(T),{size:18,"aria-hidden":`true`}),H(T),O(e=>{u(p,o()),Y(_,`${o()??``}m`),u(S,s()),Y(w,e),b(T,`aria-pressed`,!c()),b(T,`title`,c()?`Show the move gizmo (off to avoid accidental moves)`:`Hide the move gizmo`)},[()=>s().toFixed(2)]),L(`input`,p,e=>yh.set(+e.currentTarget.value)),L(`input`,S,e=>Sh.set(+e.currentTarget.value)),L(`click`,T,()=>vse(c())),X(e,n)},$$slots:{actions:!0,status:!0,default:!0}})}};G(y,e=>{n()&&e(x)}),X(e,_),ue(),d()}ge([`click`,`input`]);var pst=V(`<button id="spline-edit-done" class="tbx-hbtn tbx-done" aria-label="Done" title="Finish (Esc)"><!></button>`),mst=V(`<span> </span>`),hst=V(`<span class="tbx-label">Spline</span> <div class="tbx-row text-xs"><span id="spline-point-count" class="text-gray-400"> </span></div> <div class="tbx-row"><button id="spline-closed" title="Join the last point back to the first">Loop</button></div> <span class="tbx-label">Shape</span> <div class="tbx-row"><!></div> <div class="tbx-row"><!></div> <p class="tbx-row text-[11px] leading-snug text-gray-400">Drag a <span class="text-[#2f81f7]">blue</span> handle to move a point · drag the <span class="text-[#f59e0b]">amber</span> dot above it up/down for thickness · click a <span class="text-gray-300">grey</span> marker to insert a point · right-click a point to delete it.</p>`,1);function gst(e,t){Ce(t,!0);let n=()=>z(wi,`$isVRMode`,c),i=()=>z(nM,`$splineEditObject`,c),a=()=>z(Ui,`$objectsGroup`,c),o=()=>z(rM,`$splineSelectedPoint`,c),s=()=>z(iM,`$splinePointCount`,c),[c,l]=Ve(),u=q(()=>!n()&&!!i()),d=q(()=>(a(),i()?T_(x_(i())):null)),p=q(()=>i()?x_(i())?.name||`Spline`:``),m=q(()=>Q(d)?(Q(d).points[o()]??Q(d).points[0])?.radius??.05:.05);function h(e){i()&&C_(i(),e)}var _=fe(),v=N(_),y=e=>{{let t=e=>{var t=pst();$R(j(t),{size:14,"aria-hidden":`true`}),H(t),L(`click`,t,()=>NM()),X(e,t)},n=e=>{var t=mst(),n=f(t);O(()=>Y(n,`${s()??``} pts · ${Q(d)?.radialSegments??8??``} sides`)),X(e,t)},a=q(()=>`ã° ${Q(p)}`);fQ(e,{id:`spline-edit-toolbar`,key:`splineToolbox`,get title(){return Q(a)},width:200,actions:t,status:n,children:(e,t)=>{var n=hst(),a=g(N(n),2),c=j(a),l=f(c);H(a);var u=g(a,2),p=f(u),_=g(u,4);hq(j(_),{id:`spline-radius-all`,label:`Thickness`,get value(){return Q(m)},step:.002,snap:.01,decimals:3,min:.002,max:50,unit:`length`,title:`Set EVERY control point to this radius`,onchange:h}),H(_);var v=g(_,2),y=j(v);{let e=q(()=>Q(d)?.radialSegments??8);hq(y,{id:`spline-sides`,label:`Sides`,get value(){return Q(e)},step:.25,snap:1,decimals:0,min:3,max:32,title:`Sides around the tube`,onchange:e=>i()&&O_(i(),Math.round(e))})}H(v),W(2),O(()=>{Y(l,`${s()??``} point${s()===1?``:`s`}${o()>=0?` · #${o()+1} selected`:``}`),r(p,1,`tbx-cmd ${Q(d)?.closed?`tbx-on bg-primary-600 text-white`:``}`),b(p,`aria-pressed`,!!Q(d)?.closed)}),L(`click`,p,()=>i()&&D_(i(),!Q(d)?.closed)),X(e,n)},$$slots:{actions:!0,status:!0,default:!0}})}};G(v,e=>{Q(u)&&e(y)}),X(e,_),ue(),l()}ge([`click`]);var _st=V(`<button class="tbx-hbtn" title="Close"><!></button>`),vst=V(`<div class="mod-tbx-mount svelte-1qwvu3z"></div>`);function yst(e,t){Ce(t,!0);let n=()=>z(wl,`$moduleToolboxes`,a),r=()=>z(El,`$openToolboxes`,a),i=()=>z(ki,`$isLocked`,a),[a,o]=Ve(),s=q(()=>n().filter(e=>r().includes(e.id)&&(!i()||e.playMode)));var c=fe(),l=N(c);B(l,17,()=>Q(s),e=>e.id,(e,t)=>{{let n=e=>{var n=_st(),r=j(n);fS(r,{size:14,"aria-hidden":`true`}),H(n),O(()=>b(n,`aria-label`,`Close ${Q(t).title??``}`)),L(`click`,n,()=>ate(Q(t).id)),X(e,n)},r=q(()=>Q(t).key??Q(t).id),i=q(()=>Q(t).width??220),a=q(()=>Q(t).minW??160),o=q(()=>Q(t).defaultRect??{right:12,top:76});fQ(e,{get id(){return Q(t).id},get title(){return Q(t).title},get key(){return Q(r)}
2494,get width(){return Q(i)},get minW(){return Q(a)},get defaultRect(){return Q(o)},actions:n,children:(e,n)=>{var r=vst();ne(r,(e,t)=>po?.(e,t),()=>Q(t).mount),X(e,r)},$$slots:{actions:!0,default:!0}})}}),X(e,c),ue(),o()}ge([`click`]);var bst=je(`<path d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"></path>`),xst=je(`<path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path>`),Sst=V(`<button id="embed-fullscreen" type="button" class="embed-btn svelte-14ej57y"><svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><!></svg></button>`),Cst=V(`<a id="embed-open-link" class="embed-btn embed-link svelte-14ej57y" target="_blank" rel="noopener">Open in theprototype.app â</a>`),wst=V(`<div class="embed-title svelte-14ej57y"> </div>`),Tst=V(`<button id="embed-vr" type="button" class="embed-play embed-vr svelte-14ej57y">Enter VR</button>`),Est=V(`<div id="embed-start" class="embed-start svelte-14ej57y"><!> <div class="embed-actions svelte-14ej57y"><button id="embed-play" type="button" class="embed-play svelte-14ej57y">â¶ Play</button> <!></div> <div class="embed-hint svelte-14ej57y">Click to look around · Esc to pause</div></div>`),Dst=V(`<div id="embed-chrome" class="embed-chrome svelte-14ej57y"><!> <!></div> <!>`,1);function Ost(e,n){Ce(n,!0);let r=()=>z(Ym,`$embedMode`,s),i=()=>z(wi,`$isVRMode`,s),a=()=>z(ki,`$isLocked`,s),o=()=>z(Jm,`$vrSupported`,s),[s,c]=Ve(),l=!Dm||Dm.vrButton,u=Dm?.title||``,d=t(Ne(typeof document<`u`&&!!document.fullscreenElement)),p=typeof document<`u`&&!!document.fullscreenEnabled;function m(){try{document.fullscreenElement?document.exitFullscreen?.():document.documentElement.requestFullscreen?.().catch(()=>{})}catch{}}function h(){if(Dm?.startFullscreen&&p&&!document.fullscreenElement)try{document.documentElement.requestFullscreen?.().catch(()=>{})}catch{}Km({flat:!0})}var _=fe();Z(`fullscreenchange`,te,()=>I(d,!!document.fullscreenElement));var v=N(_),y=e=>{var t=Dst(),n=N(t),r=j(n),i=e=>{var t=Sst(),n=j(t),r=j(n),i=e=>{var t=bst();X(e,t)},a=e=>{var t=xst();X(e,t)};G(r,e=>{Q(d)?e(i):e(a,-1)}),H(n),H(t),O(()=>{b(t,`aria-label`,Q(d)?`Exit fullscreen`:`Fullscreen`),b(t,`title`,Q(d)?`Exit fullscreen`:`Fullscreen`),b(t,`aria-pressed`,Q(d))}),L(`click`,t,m),X(e,t)};G(r,e=>{p&&e(i)});var s=g(r,2),c=e=>{var t=Cst();O(e=>b(t,`href`,e),[()=>Zoe()]),X(e,t)};G(s,e=>{Om||e(c)}),H(n);var _=g(n,2),v=e=>{var t=Est(),n=j(t),r=e=>{var t=wst(),n=f(t,!0);O(()=>Y(n,u)),X(e,t)};G(n,e=>{u&&e(r)});var i=g(n,2),a=j(i),s=g(a,2),c=e=>{var t=Tst();L(`click`,t,()=>Km()),X(e,t)};G(s,e=>{l&&o()&&e(c)}),H(i),W(2),H(t),L(`click`,a,h),X(e,t)};G(_,e=>{a()!==!0&&e(v)}),X(e,t)};G(v,e=>{r()&&!i()&&e(y)}),X(e,_),ue(),c()}ge([`click`]);var N6=`Made with ThePrototype`,kst=/^[A-Za-z0-9_-]{1,64}$/;function Ast(e=``){let t=new URL(`https://theprototype.app/`);return t.searchParams.set(`ref`,`export`),kst.test(String(e))&&t.searchParams.set(`g`,String(e)),t.toString()}var jst=`[data-hud-avoid]`;function Mst(e,t,n,r,i=8){let a=r,o=e.bottom-e.top;for(let r=0;r<8;r++){let r=n-a-o,s={left:e.left,right:e.right,top:r,bottom:n-a},c=t.find(e=>e.right>s.left&&e.left<s.right&&e.bottom>s.top&&e.top<s.bottom);if(!c)return a;a=Math.max(a,n-c.top+i)}return a}function Nst(e=typeof document>`u`?null:document){if(!e)return[];let t=[];for(let n of e.querySelectorAll(jst)){let e=n.getBoundingClientRect();e.width>0&&e.height>0&&t.push({left:e.left,top:e.top,right:e.right,bottom:e.bottom})}return t}var Pst=V(`<a id="made-with-tp" class="made-with-tp svelte-155pch3" target="_blank" rel="noopener"><svg class="mwt-logo svelte-155pch3" viewBox="0 0 400 400" aria-hidden="true"><path fill="currentColor" d="m279.1 1.3c-1.1 0.7-20.9 7.5-44 15.1l-42.1 13.8c-55-17.3-73.9-22.9-77.5-23.7-5.9-1.2-8.2-0.9-23 3.3-9 2.6-22.3 6.5-29.6 8.7-7.2 2.2-13.7 4.5-14.4 5.1-0.8 0.6 2 2.5 6.6 4.5 4.3 1.9 16.7 6.7 27.6 10.6 10.8 3.8 32.1 11.7 47.2 17.4 15.2 5.8 35.8 13.4 45.8 16.9l18.2 6.4c-1.3 79.4-2.2 133.8-2.9 172.1-0.7 38.3-1.3 87.2-1.3 108.7 0 30.7 0.4 39 1.7 38.7 0.9-0.3 13.4-8.1 27.7-17.4 14.4-9.4 26.6-18 27.3-19.3 0.6-1.3 1.7-8 2.4-15.1 0.7-7 1.6-23.2 2.1-35.8l1-23c72.7-145.6 95.4-191.6 97.3-196.1 2.6-6.3 4-13.4 6-30.9 1.4-12.4 2.8-27.2 3.3-32.8l0.7-10.2c-10.7-2.9-25.8-7.1-40.4-11.1-14.6-4-29.1-7.2-32.2-7.2-3 0-6.4 0.6-7.5 1.3z"></path><path class="mwt-accent svelte-155pch3" data-part="leg" d="m40.8 27.8c-1.7 2.4-9.3 13.7-16.8 25.2-7.5 11.5-13.8 21.6-14 22.4-0.2 0.7 6.3 4.6 14.5 8.5 8.1 3.8 23.4 10.9 33.8 15.6 10.5 4.7 29.4 13.1 42.1 18.8l23 10.2c1.3 30.2 2.4 72.9 3.3 114.5 0.8 41.5 1.9 84.9 2.4 96.4l0.8 20.8c7.2 6.1 20.3 15.2 33.9 24.2 13.5 8.9 25.2 15.9 25.9 15.6 0.9-0.4 1.3-15.2 1.3-40.4 0-21.9 0.6-68.7 1.3-104.1 0.7-35.4 1.6-89.5 2.1-120.3l0.8-55.8c-20-7.6-34.1-12.8-44.2-16.5-10.1-3.7-30-11-44-16.4-14.1-5.3-33.5-12.6-43.1-16.3-9.5-3.6-17.9-6.6-18.6-6.6-0.7 0-2.7 1.9-4.5 4.2z"></path><path class="mwt-accent svelte-155pch3" data-part="triangle" d="M304 110c-1.1 0.5-4.9 2.7-8.5 4.9-3.6 2.1-8.8 5.1-11.4 6.5-2.7 1.5-7.4 4.1-10.5 5.8-3.2 1.7-6.1 3.9-6.7 4.9-0.5 1-1.9 1.8-2.9 1.8-1.1 0-2.7 1.7-3.5 3.6-0.8 2.1-1.8 16.4-2.3 32.9-0.8 27.3-0.7 29.2 1.5 29.2 1.3 0 2.7-1 3.2-2.3 0.5-1.2 2.5-4.6 4.4-7.5 2-2.9 9.5-16.2 16.7-29.6 7.2-13.4 15.8-29.8 19.2-36.4 3.3-6.7 6.1-12.8 6.1-13.5 0-0.7-0.8-1.3-1.7-1.2-0.9 0-2.5 0.5-3.6 0.9z"></path></svg> <span class="mwt-text svelte-155pch3"> </span></a>`);function Fst(e,n){Ce(n,!0);let r=()=>z(Ym,`$embedMode`,a),i=()=>z(wi,`$isVRMode`,a),[a,o]=Ve(),s=Ast(Dm?.id||Yoe),c=t(10),l=t(null);_e(()=>{let e=()=>{if(!Q(l))return;let e=Q(l).getBoundingClientRect(),t=window.innerHeight,n={left:e.left,right:e.right,top:t-10-e.height,bottom:t-10};I(c,Mst(n,Nst(),t,10),!0)};e();let t=setInterval(e,500);return window.addEventListener(`resize`,e),()=>{clearInterval(t),window.removeEventListener(`resize`,e)}});var u=fe(),d=N(u),p=e=>{var t=Pst();let n;var r=g(j(t),2),i=f(r,!0);H(t),We(t,e=>I(l,e),()=>Q(l)),O(()=>{b(t,`href`,s),b(t,`aria-label`,N6+` â opens theprototype.app in a new tab`),b(t,`title`,N6),n=Ze(t,``,n,{"--badge-lift":`${Q(c)??``}px`}),Y(i,N6)}),X(e,t)};G(d,e=>{r()&&!i()&&e(p)}),X(e,u),ue(),o()}var P6={phase:`idle`,error:``,modules:[]};function Ist(e,t=3e4){return new Promise((n,r)=>{let i=Date.now(),a=()=>
2494{if(e())return n(!0);if(Date.now()-i>t)return r(Error(`the engine did not start`));setTimeout(a,50)};a()})}async function F6(e){let t=await fetch(moe(e));if(!t.ok)throw Error(e+` â HTTP `+t.status);return t.arrayBuffer()}function Lst(e){try{let t=document.createElement(`div`);t.id=`export-error`,t.setAttribute(`role`,`alert`),t.style.cssText=`position:fixed;left:50%;top:16px;transform:translateX(-50%);z-index:2000;max-width:calc(100vw - 32px);padding:10px 14px;border-radius:10px;font:600 13px/1.4 system-ui,sans-serif;background:rgb(var(--surface-rgb, 17 24 39) / 0.92);color:var(--text, #e5e7eb);border:1px solid var(--icon-danger, #f87171)`,t.textContent=`This game could not start: `+e,document.body.appendChild(t)}catch{}}var I6=!1;async function L6(){if(I6||!Dm)return;I6=!0;let e=Dm;try{if(P6.phase=`engine`,await Ist(()=>U(Ui)&&U(xi)),P6.phase=`modules`,e.modules.length){let{activateModuleZip:t}=await $(async()=>{let{activateModuleZip:e}=await import(`../chunks/Cxv3VV5O.js`).then(e=>e._);return{activateModuleZip:e}},__vite__mapDeps([168,1,2,6,5,3,21,34,19,20,35,24,0,4,23,8,9,10,11,12,13,14,25,36,37,38,39,40,41,7,42,22,43,44,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59,70,75,128,98]),import.meta.url);for(let n of e.modules)await t(await F6(n.file))?P6.modules.push(n.id):console.warn(`export: module `+n.id+` did not register`)}P6.phase=`scene`;let{readSessionZip:t,applySession:n}=await $(async()=>{let{readSessionZip:e,applySession:t}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{readSessionZip:e,applySession:t}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url),r=await t(await F6(e.scene));if(!r)throw Error(`the scene file is unreadable or from a newer app version`);e.title&&(r.name=e.title),await n(r,{backup:!1,replicate:!1,workspace:!1,quiet:!0}),P6.phase=`settings`,await Rst(e),P6.phase=`play`,Km({flat:!0}),P6.phase=`playing`}catch(e){let t=e instanceof Error?e.message:String(e);P6.phase=`failed`,P6.error=t,console.error(`export runtime:`,e),Lst(t)}}async function Rst(e){let{setGameSetting:t}=await $(async()=>{let{setGameSetting:e}=await import(`../chunks/Cz5Vn86C.js`).then(e=>e.s);return{setGameSetting:e}},__vite__mapDeps([26,1,2,3,27]),import.meta.url),{safeStorage:n}=await $(async()=>{let{safeStorage:e}=await import(`../chunks/CvScdOYl.js`).then(e=>e.r);return{safeStorage:e}},__vite__mapDeps([3,1]),import.meta.url),r=`tp:export:`+(e.id||`game`)+`:defaults`;n.getItem(r)||(e.showFps&&t(`showFps`,!0),e.quality!==`auto`&&t(`quality`,e.quality),n.setItem(r,`1`))}var zst=V(`<div class="gl-lost svelte-7wkqip" role="alertdialog" aria-modal="true" aria-labelledby="gl-lost-title"><div class="gl-lost-card svelte-7wkqip"><h2 id="gl-lost-title" class="svelte-7wkqip">The 3D view has stopped</h2> <p class="svelte-7wkqip">The browser took back this page's graphics context. That is usually temporary, and 2495 it often comes back by itself. <strong>Your scene is still here</strong> â it lives 2496 in the page, not on the graphics card â so you can save it right now.</p> <div class="gl-lost-actions svelte-7wkqip"><button class="gl-lost-btn gl-lost-primary svelte-7wkqip">Save scene</button> <button class="gl-lost-btn svelte-7wkqip">Reload</button></div></div></div>`);function Bst(e,t){Ce(t,!1);let n=()=>z(Mi,`$contextLost`,r),[r,i]=Ve(),a=()=>BS(`tpscene`),o=()=>location.reload();R();var s=fe(),c=N(s),l=e=>{var t=zst(),n=j(t),r=g(j(n),4),i=j(r),s=g(i,2);H(r),H(n),H(t),L(`click`,i,a),L(`click`,s,o),X(e,t)};G(c,e=>{n()&&e(l)}),X(e,s),ue(),i()}ge([`click`]);var Vst=V(`<p class="rp-note svelte-1qio7i2"> </p>
2496`),Hst=V(`<div id="render-paused" class="rp-overlay svelte-1qio7i2" role="alertdialog" aria-modal="true" aria-labelledby="rp-title"><div class="rp-card svelte-1qio7i2"><h2 id="rp-title" class="svelte-1qio7i2">Rendering paused</h2> <p class="svelte-1qio7i2">The scene is too heavy for this device â the last frames each took longer than a 2497 quarter of a second, so drawing has stopped to give the window back. <strong>Nothing is lost</strong>, and autosave keeps running while this is open.</p> <!> <div class="rp-actions svelte-1qio7i2"><button id="render-paused-save" class="rp-btn svelte-1qio7i2">Save now</button> <button id="render-paused-reduce" class="rp-btn svelte-1qio7i2" title="Stop drawing the newest objects on THIS device until the scene fits the budget. Peers are unaffected; nothing is deleted.">Reduce</button> <button id="render-paused-resume" class="rp-btn rp-primary svelte-1qio7i2">Resume</button></div></div></div>`);function Ust(e,t){Ce(t,!1);let n=()=>z(la,`$renderPaused`,a),r=()=>z(Mi,`$contextLost`,a),i=()=>z(ca,`$reducedObjects`,a),[a,o]=Ve(),s=()=>BS(`tpscene`);function c(){let e=aa();sa(),es(e?`Set aside the `+e+` newest object`+(e===1?``:`s`)+` on this device only â nothing was deleted, and peers still see them.`:`Nothing to set aside â the scene is already inside the budget. Rendering resumed.`,e?[{label:`Show them again`,action:()=>oa()}]:void 0)}R();var l=fe(),u=N(l),d=e=>{var t=Hst(),n=j(t),r=g(j(n),4),a=e=>{var t=Vst(),n=f(t);O(()=>Y(n,`${i()??``} object${i()===1?` is`:`s are`} already set aside on this device.`)),X(e,t)};G(r,e=>{i()&&e(a)});var o=g(r,2),l=j(o),u=g(l,2),d=g(u,2);H(o),H(n),H(t),L(`click`,l,s),L(`click`,u,c),L(`click`,d,function(...e){sa?.apply(this,e)}),X(e,t)};G(u,e=>{n()&&!r()&&e(d)}),X(e,l),ue(),o()}ge([`click`]);var R6=new WeakSet;function z6(e){e&&e.traverse(e=>{e.isMesh&&!R6.has(e)&&(R6.add(e),e.castShadow=e.userData?.shadow!==!1,e.receiveShadow=!0)})}var B6=!1;function V6(){B6||typeof window>`u`||(B6=!0,Ui.subscribe(e=>z6(e)),z6(U(Ui)))}var H6=null,Wst=5,Gst=400,U6=null;function W6(e,t){if(typeof document>`u`)return null;let n=document.querySelectorAll(`#hud-layer [data-hud-id]`),r=null,i=0;for(let a of n){let n=a;i+=1;let o=n.getBoundingClientRect();if(o.width<=0||o.height<=0||e<o.left||e>o.right||t<o.top||t>o.bottom)continue;let s=Number(getComputedStyle(n).zIndex)||0;r&&(s<r.z||s===r.z&&i<r.i)||(r={id:n.getAttribute(`data-hud-id`)??``,el:n,z:s,i})}return r&&r.id?{id:r.id,el:r.el}:null}function G6(e){let t=H6?.cameraPreview?U(H6.cameraPreview)?.uuid??null:null;for(let n of Ou(t)){let t=gu(n);if(t?.elements.some(t=>t.id===e))return{key:n,screen:t.id}}return null}function K6(){if(U(ki)===!0)return!1;if(U(ju))return!0;let e=H6?.cameraPreview?U(H6.cameraPreview)?.uuid??null:null;return!!(e&&Cu(e))}var q6=WK({snapshot:()=>{if(!U6)return null;let e=(Cu(U6.key)?.screens.find(e=>e.id===U6?.screen))?.elements.find(e=>e.id===U6?.id);return e?{key:U6.key,screen:U6.screen,id:U6.id,el:e,rect:Du(e,window.innerWidth,window.innerHeight)}:null},start:e=>(PC(e.snapshot.key),!0),apply:e=>{let t=e.snapshot,n=t.rect.left+e.dx,r=t.rect.top+e.dy;yu(t.key,t.screen,t.id,hu(t.el,n,r,window.innerWidth,window.innerHeight))},revert:e=>{let t=e.snapshot;yu(t.key,t.screen,t.id,hu(t.el,t.rect.left,t.rect.top,window.innerWidth,window.innerHeight))},end:e=>FC(e.snapshot.key)});function Kst(e){if(e.button!==2||U6||!K6())return;let t=W6(e.clientX,e.clientY);if(!t)return;let n=G6(t.id);n&&(U6={x:e.clientX,y:e.clientY,at:Date.now(),key:n.key,screen:n.screen,id:t.id,dragging:!1,tapped:!1,up:!1,menuSeen:!1},e.stopPropagation(),e.preventDefault())}function qst(e){if(U6){if(!U6.dragging){if(Math.hypot(e.clientX-U6.x,e.clientY-U6.y)<Wst)return;if(U6.dragging=!0,!q6.begin({clientX:U6.x,clientY:U6.y})){U6=null;return}}q6.move(e),e.stopPropagation()}}function Jst(e){if(!U6)return;let t=U6.dragging,n=Date.now()-U6.at<Gst;if(U6.up=!0,U6.tapped=!t&&n,t&&q6.finish(!0),U6.menuSeen){let e={x:U6.x,y:U6.y},t=U6.tapped;U6=null,t&&U(Uo)?.(e.x,e.y)}e.stopPropagation()}function Yst(e){if(!U6)return;if(e.preventDefault(),e.stopPropagation(),!U6.up){U6.menuSeen=!0;return}let t=U6.tapped,n={x:U6.x,y:U6.y};U6=null,t&&U(Uo)?.(n.x,n.y)}function Xst(e){e.key===`Escape`&&U6&&(U6.dragging&&(q6.cancel(),e.preventDefault(),e.stopPropagation()),U6=null)}var J6=!1;function Y6(){J6||typeof window>`u`||(J6=!0,$(()=>import(`../chunks/Dl8xgxdz.js`).then(e=>e.i).then(e=>H6=e),__vite__mapDeps([216,1,2,9,0,3,4,5,6,17,18,10,19,7,20,21,22,23,11,12,13,8,14,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,214,113,114,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,215]),import.meta.url).catch(()=>{}),window.addEventListener(`pointerdown`,Kst,!0),window.addEventListener(`pointermove`,qst,!0),window.addEventListener(`pointerup`,Jst,!0),window.addEventListener(`contextmenu`,Yst,!0),window.addEventListener(`ke
2497ydown`,Xst,!0))}function Zst(){return!!U6?.dragging}function Qst(){return K6()}function $st(e,t){let n=W6(e,t);if(!n)return null;let r=G6(n.id);return r?{id:n.id,...r}:null}var X6=Ue(null),Z6=null,Q6=new hn,$6=new hn,e8=new hn;function t8(e,t,n){e8.set(0,2.2,4.5).applyQuaternion(t.quaternion),$6.copy(t.position).add(e8),e.position.lerp($6,1-.001**n),e.lookAt(t.position)}var ect=[`chase`,`orbit`,`none`,`first`],n8=new rt(0,0,0,`YXZ`);function tct(e,t,n,r){e.position.copy(t.position),e.position.y+=n,n8.set(r,t.rotation.y,0),e.quaternion.setFromEuler(n8)}function nct(e,t={}){Z6&&c8();let n=U(Ui)?.getObjectByProperty(`uuid`,e);if(!n)return es(`Nothing to possess â select an object first`),!1;let r=U(Ci).find(t=>t[1]===e);if(r)return es(`Locked by `+hh(r[0])+` â ask them to release it`),!1;Em(e),cd(e),ab(`keys`),ab(`locomotion`);let i=U(Ki);return Z6={uuid:e,opts:{camera:`chase`,speed:4,turnSpeed:2.5,eyeHeight:1.7,mouseLook:!1,...t},before:{pos:n.position.toArray(),rot:n.rotation.toArray(),scale:n.scale.toArray()},camSave:i?{enabled:i.enabled,target:i.target.clone()}:null,pitch:0,lastSent:0,raf:0,lastTime:performance.now(),offEsc:nb((e,t)=>{e===`down`&&t===`Escape`&&c8()})},(Z6.opts.camera===`chase`||Z6.opts.camera===`first`)&&i&&(i.enabled=!1),Z6.opts.camera===`first`&&Z6.opts.mouseLook&&rct(),X6.set(e),Z6.raf=requestAnimationFrame(l8),!0}var r8=null,i8=!1;function a8(e){if(!Z6||document.pointerLockElement!==r8)return;let t=U(Ui)?.getObjectByProperty(`uuid`,Z6.uuid);t&&(t.rotation.y-=e.movementX*.0025),Z6.pitch=Math.max(-1.45,Math.min(1.45,Z6.pitch-e.movementY*.0025))}function o8(){if(Z6?.opts.mouseLook){if(document.pointerLockElement===r8){i8=!0;return}i8&&c8()}}function rct(){i8=!1,r8=document.body,document.addEventListener(`mousemove`,a8),document.addEventListener(`pointerlockchange`,o8);try{(r8.requestPointerLock?.())?.catch?.(()=>s8())}catch{s8()}}function s8(){Z6&&(Z6.opts.mouseLook=!1),es(`Mouse look needs a click in the page first â steering with A/D instead`)}function ict(){document.removeEventListener(`mousemove`,a8),document.removeEventListener(`pointerlockchange`,o8),r8&&document.pointerLockElement===r8&&document.exitPointerLock?.(),r8=null}function c8(){if(!Z6)return;cancelAnimationFrame(Z6.raf),Z6.offEsc?.(),Z6.opts.camera===`first`&&Z6.opts.mouseLook&&ict(),rb(`keys`),rb(`locomotion`);let{uuid:e,before:t,camSave:n}=Z6,r=U(Ki);if(r&&n){r.enabled=n.enabled;let t=U(Ui)?.getObjectByProperty(`uuid`,e);t&&r.target.copy(t.position)}let i=U(Ui)?.getObjectByProperty(`uuid`,e);if(i){let n={pos:i.position.toArray(),rot:i.rotation.toArray(),scale:i.scale.toArray()};JSON.stringify(t)!==JSON.stringify(n)&&Rf({uuid:e,before:t,after:n});let r=U(Es);r&&r.send({type:`move`,uuid:e,pos:n.pos,rot:n.rot,scale:n.scale})}sd(e),Nne(e),Z6=null,X6.set(null)}function l8(e){if(!Z6)return;let t=U(Ui)?.getObjectByProperty(`uuid`,Z6.uuid);if(!t){c8();return}let n=Math.min((e-Z6.lastTime)/1e3,.1);Z6.lastTime=e;let{codes:r,axes:i}=qpe(),{speed:a,turnSpeed:o,camera:s}=Z6.opts,c=e=>Math.abs(e)>.15?e:0,l=(r.has(`KeyW`)||r.has(`ArrowUp`)?1:0)-(r.has(`KeyS`)||r.has(`ArrowDown`)?1:0)-c(i.ly),u=(r.has(`KeyA`)||r.has(`ArrowLeft`)?1:0)-(r.has(`KeyD`)||r.has(`ArrowRight`)?1:0)-c(i.lx);if(l=Math.max(-1,Math.min(1,l)),u=Math.max(-1,Math.min(1,u)),(l||u)&&(t.rotation.y+=u*o*n,Q6.set(0,0,-1).applyQuaternion(t.quaternion),t.position.addScaledVector(Q6,l*a*n),t.updateMatrix(),e-Z6.lastSent>100)){Z6.lastSent=e;let n=U(Es);n&&n.send({type:`move`,uuid:t.uuid,pos:t.position.toArray(),rot:[t.rotation.x,t.rotation.y,t.rotation.z],scale:t.scale.toArray()})}let d=U(Ki),f=U(yi);s===`chase`&&f?t8(f,t,n):s===`first`&&f?tct(f,t,Z6.opts.eyeHeight,Z6.pitch):s===`orbit`&&d&&d.target.copy(t.position),Z6.raf=requestAnimationFrame(l8)}var u8=Ue(null),d8=null;function act(e){if(d8?.uuid===e)return!0;if(f8(),!U(Ui)?.getObjectByProperty(`uuid`,e))return!1;let t=U(Ki);return d8={uuid:e,camSave:t?{enabled:t.enabled,target:t.target.clone()}:null,lastTime:performance.now(),raf:0},t&&(t.enabled=!1),u8.set(e),d8.raf=requestAnimationFrame(p8),!0}function f8(){if(!d8)return;cancelAnimationFrame(d8.raf);let e=U(Ki);if(e&&d8.camSave){e.enabled=d8.camSave.enabled;let t=U(Ui)?.getObjectByProperty(`uuid`,d8.uuid);t&&e.target.copy(t.position)}d8=null,u8.set(null)}function p8(e){if(!d8)return;let t=U(Ui)?.getObjectByProperty(`uuid`,d8.uuid);if(!t){f8();return}let n=Math.min((e-d8.lastTime)/1e3,.1);d8.lastTime=e;let r=U(yi);r&&t8(r,t,n),d8.raf=requestAnimationFrame(p8)}var m8=!1;function h8(){m8||typeof window>`u`||(m8=!0,wi.subscribe(e=>{e&&c8(),e&&f8()}))}var g8=null;$(()=>import(`../chunks/DaA5bz6U.js`).then(e=>e.u).then(e=>g8=e),__vite__mapDeps([34,1,2,3,5,6,19,21,20,35,24,0,4,23,8,9,10,11,12,13,14,25,36,37,38,39,40,41,7,42,22,43,44,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59]),import.meta.url);var _8={out:`vrpatch-out:`,in:`vrpatch-in:`},v8=`vrknob:`,oct=.25,sct=66,cct=300,lct=.02;function y8(e){let t=e;for(;t;){if(typeof t.name==`string`&&t.name.startsWith(`vrpatch-`))return t;t=t.parent}return null}function b8(e){let t=e;for(;t;){if(typeof t.name==`string`&&t.name.startsWith(v8))return t;t=t.parent}return null}function x8(e){let t=e;for(;t;){if(xv(t))return t;t=t.parent}return null}function S8(e){if(!e||typeof e.name!=`string`)return null;let t=e.name.startsWith(_8.out)?`out`:e.name.startsWith(_8.in)?`in`:null;if(!t)return null;let n=e.name.slice(_8[t].length)||`main`,r=x8(e);if(!r)return null;let i=Sv(r.userData.device.kind)?.ports?.[t]?.find(e=>e.id===n);return{node:e,device:r,uuid:r.uuid,side:t,port:n,kind:i?.kind??`audio`}}function C8(e){if(!e||typeof e.name!=`string`||!e.name.startsWith(v8))return null;let t=e.name.slice(7),n=x8(e);if(!n||!t)return null;let r=Sv(n.userData.device.kind)?.params?.find(e=>e.key===t)??null;return{node:e,device:n,uuid:n.uuid,key:t,param:r}}function w8(e){let t=U(Ui);if(!e||!t)return null;for(let n of e.intersectObject(t,!0)){let e=y8(n.object);if(e)return S8(e)}return null}function T8(e){let t=U(Ui);if(!e||!t)return null;for(let n of e.intersectObject(t,!0)){let e=b8(n.object);if(e)return C8(e)}return null}function E8(e,t){return(e??`audio`)===(t??`audio`)}function D8(e){let t=U(xi)?.xr?.getController(e);if(!t)return null;t.updateWorldMatrix(!0,!1);let n=t.getWorldPosition(new hn),r=new fr().extractRotation(t.matrixWorld),i=new hn(0,0,-1).applyMatrix4(r).normalize(),a=new Wn(n,i);return a.far=5,a}function O8(e){let t=U(xi)?.xr?.getController(e);return t?{position:t.getWorldPosition(new hn),quaternion:t.getWorldQuaternion(new zt),hand:t.userData?.handedness??null}:null}var k8=null,A8=0,j8=null;function uct(){let e=U(Pi);
2497return e?(j8||(j8=new Pn,j8.name=`vr-patch-preview`,e.add(j8)),j8):null}var M8=new hn,N8=new hn;function dct(e,t){let n=e.distanceTo(t);return N8.addVectors(e,t).multiplyScalar(.5),N8.y-=Math.min(.6,.15+n*.2),new Xt(new qn(e.clone(),N8.clone(),t.clone()),20,lct,6,!1)}function fct(e){let t=U(Ui)?.getObjectByProperty(`uuid`,e.from.uuid);if(!t||!xv(t))return null;let n=t.getObjectByName(_8.out+e.from.port)??t,r=Sv(t.userData.device.kind)?.ports?.out?.find(t=>t.id===e.from.port);return{node:n,device:t,uuid:t.uuid,side:`out`,port:e.from.port,kind:r?.kind??`audio`}}function P8(e,t,n={}){if(!e||k8||K8)return!1;let r=uct();if(!r)return!1;let i=e,a=null;if(e.side===`in`){a=Ov(e.uuid).find(t=>t.to.uuid===e.uuid&&t.to.port===e.port)??null;let t=a?fct(a):null;a&&t?(i=t,Ev(a.id,!0)):a=null}let o=new Nt(new ft,new ir({color:Ude[i.kind]??`#94a3b8`,transparent:!0,opacity:.7,roughness:.6}));return o.name=`vr-patch-cable`,o.raycast=()=>{},r.add(o),k8={index:n.index??-1,hand:n.hand??t.hand??null,from:i,picked:a,preview:o,free:t.position.clone()},F8(t),q_(.3,30),!0}function F8(e){k8&&e&&(k8.free.copy(e.position),k8.from.node.getWorldPosition(M8),k8.preview.geometry?.dispose?.(),k8.preview.geometry=dct(M8,k8.free))}function I8(e,t={}){if(!k8||t.index!=null&&k8.index>=0&&t.index!==k8.index)return null;let n=e&&typeof e.intersectObject==`function`?w8(e):e??null,r=k8;return k8=null,A8=Date.now(),r.preview.geometry?.dispose?.(),r.preview.material?.dispose?.(),j8?.remove(r.preview),r.picked&&Ev(r.picked.id,!1),pct(r,n)}function pct(e,t){let n=e.from,r=!!t&&t.side!==n.side&&(t.uuid!==n.uuid||t.port!==n.port)&&E8(n.kind,t.kind);if(e.picked){let i=e.picked;if(!r)return Tv(i.id),q_(.2,30),{unplugged:i.id};if(t.uuid===i.to.uuid&&t.port===i.to.port)return{cable:i.id};Lf(),Tv(i.id);let a=Dv({from:{uuid:n.uuid,port:n.port},to:{uuid:t.uuid,port:t.port},kind:n.kind});return kf(`Re-plug cable`),q_(.4,60),{cable:a}}if(!r)return null;let i=n.side===`out`?n:t,a=n.side===`out`?t:n,o=Dv({from:{uuid:i.uuid,port:i.port},to:{uuid:a.uuid,port:a.port},kind:i.kind});return q_(.4,60),o?{cable:o}:null}var L8=-2,mct=1.6,R8=null;function z8(e,t){e&&(t?(e.userData.__plugScale=e.scale.clone(),e.scale.multiplyScalar(mct)):e.userData.__plugScale&&(e.scale.copy(e.userData.__plugScale),delete e.userData.__plugScale))}function B8(){return!!k8&&k8.index===L8}function hct(){return k8?.picked??null}function V8(e){let t=S8(y8(e));if(!t)return B8()&&H8(),!1;if(k8&&k8.index!==L8)return!1;if(!k8){let e=new hn;return t.node.getWorldPosition(e),P8(t,{position:e,hand:`mouse`},{index:L8,hand:`mouse`})?(R8=t.node,z8(R8,!0),hct()&&es(`Cable held. Click another input to move it, this input again to unplug it, or Escape to put it back.`),!0):!1}return k8.picked&&t.uuid===k8.picked.to.uuid&&t.port===k8.picked.to.port?(z8(R8,!1),R8=null,I8(null,{index:L8}),!0):(z8(R8,!1),R8=null,I8(t,{index:L8}),!0)}function H8(){return B8()?(z8(R8,!1),R8=null,G8(),A8=Date.now(),!0):!1}var U8=new hn,W8=new hn;function gct(){let e=k8;if(!e||e.index!==L8||!g8?.pointerRayNow)return;let t=g8.pointerRayNow();if(!t?.ray)return;e.from.node.getWorldPosition(W8);let n=Math.max(.5,t.ray.origin.distanceTo(W8));t.ray.at(n,U8),F8({position:U8})}function G8(){if(!k8)return;let e=k8;k8=null,e.preview.geometry?.dispose?.(),j8?.remove(e.preview),e.picked&&Ev(e.picked.id,!1)}var K8=null;function _ct(e,t){let n=typeof e?.min==`number`?e.min:0,r=typeof e?.max==`number`?e.max:1,i=typeof e?.step==`number`&&e.step>0?e.step:0,a=Math.max(n,Math.min(r,t));return i&&(a=n+Math.round((a-n)/i)*i),+a.toFixed(6)}function q8(e,t,n={}){if(!e||K8||k8)return!1;let r=bv(e.device);if(!r)return!1;let i=e.param??{min:0,max:1,step:0},a=typeof r.params[e.key]==`number`?r.params[e.key]:i.default??i.min??0;return K8={index:n.index??-1,uuid:e.uuid,key:e.key,param:i,startValue:a,value:a,lastY:t.position.y,before:structuredClone(e.device.userData.device),lastSent:0},q_(.2,20),!0}function J8(e){if(!K8||!e)return;let t=e.position.y-K8.lastY;if(Math.abs(t)<5e-4)return;K8.lastY=e.position.y;let n=typeof K8.param.min==`number`?K8.param.min:0,r=typeof K8.param.max==`number`?K8.param.max:1,i=_ct(K8.param,K8.value+t/oct*(r-n));if(i===K8.value)return;K8.value=i,q_(.15,15);let a=Date.now(),o=a-K8.lastSent>=sct;o&&(K8.lastSent=a),wv(K8.uuid,{[K8.key]:i},{broadcast:o})}function Y8(){if(!K8)return null;let{uuid:e,key:t,value:n,before:r,startValue:i}=K8;return K8=null,A8=Date.now(),Cv(e,{params:{[t]:n}},{before:n===i?void 0:r}),{uuid:e,key:t,value:n}}function X8(){return!!k8||!!K8}function Z8(){return Date.now()-A8<cct}function Q8(e){if(k8||K8)return!1;let t=D8(e),n=O8(e);if(!t||!n)return!1;let r=T8(t);if(r)return q8(r,n,{index:e});let i=w8(t);return i?P8(i,n,{index:e,hand:n.hand}):!1}function $8(e){return K8?K8.index>=0&&K8.index!==e?!1:(Y8(),!0):k8?k8.index>=0&&k8.index!==e?!1:(I8(D8(e),{index:e}),!0):!1}function e5(){if(gct(),U(xi)?.xr?.isPresenting){if(k8){let e=O8(k8.index);e&&F8(e)}if(K8){let e=O8(K8.index);e&&J8(e)}}}var t5=!1;function n5(){t5||typeof window>`u`||(t5=!0,Wh(X8),Hh({start:Q8,end:$8,swallow:Z8}),Uh(e5),$(()=>import(`../chunks/DaA5bz6U.js`).then(e=>e.u).then(e=>{e.moduleClickHandlers.includes(V8)||e.moduleClickHandlers.unshift(V8),e.moduleClickMissHandlers.includes(H8)||e.moduleClickMissHandlers.push(H8)}),__vite__mapDeps([34,1,2,3,5,6,19,21,20,35,24,0,4,23,8,9,10,11,12,13,14,25,36,37,38,39,40,41,7,42,22,43,44,45,46,27,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59]),import.meta.url),window.addEventListener(`ke
2497ydown`,e=>{e.key===`Escape`&&H8()&&e.stopPropagation()},!0))}function vct(){return{holding:k8?{index:k8.index,hand:k8.hand,from:{uuid:k8.from.uuid,port:k8.from.port,side:k8.from.side,kind:k8.from.kind},picked:k8.picked?.id??null,previewVisible:!!k8.preview.parent}:null,knob:K8?{index:K8.index,uuid:K8.uuid,key:K8.key,value:K8.value,startValue:K8.startValue}:null,desktopArmed:B8(),previewRootParent:j8?.parent?.name??null,handledAgo:A8?Date.now()-A8:null}}var r5=`updateToastShown`,yct=9e5;async function i5(){try{if(sessionStorage.getItem(r5))return;let e=await fetch(`/version.json?t=`+Date.now(),{cache:`no-store`});if(!e.ok)return;let t=await e.json();if(!t?.version||t.version===`1.22.0`)return;hoe(),sessionStorage.setItem(r5,`true`),es(`New version `+t.version+` available â reload to update.`,[{label:`Reload`,action:()=>location.reload()}])}catch{}}function bct(){Om||typeof window>`u`||(setInterval(i5,yct),document.addEventListener(`visibilitychange`,()=>{document.hidden||i5()}))}function a5(e){if(!e)return``;if(e.forcePublic)return`the public PeerJS cloud`;let t=e.custom||{},n=t.port&&Number(t.port)!==443?`:`+t.port:``;return String(t.host||``)+n}function o5(e){let t=``;try{t=hh(e)||``}catch{}let n=e.toUpperCase();return t&&t.toLowerCase()!==e?t+` (`+n+`)`:n}function xct(){if(typeof history<`u`&&typeof location<`u`&&location.hash)try{history.replaceState(history.state,``,location.pathname+location.search)}catch{location.hash=``}}async function s5(e){let{peerId:t,srv:n}=bC(e||``),r=String(t||``).trim().toLowerCase();if(!r)return`none`;let i=U(Es);if(!i?.peer)return`none`;if(!i.hasOpened)return`startup`;if(xct(),r===String(i.peer.id||i.myId||``).toLowerCase())return es(`That's your own invite link â send it to somebody else to have them join you.`),`self`;let a=String(U(Vd)||``).toLowerCase(),o=i.openedPeers??new Set;if(r===a||o.has(r))return es(`Already connected to `+o5(r)+`.`),`already`;let s=n?SC(n):null;if(n&&!s)return es(`That invite link names a server this app cannot read (`+n+`).`),`none`;let c=!!s&&!e_e(s,U(xC)),l=o.size>0||!!a,u=async()=>{if(c){if(typeof i.switchServer!=`function`){es(`This link uses another server (`+a5(s)+`) â Settings ⸠Connection to switch.`);return}if(!await i.switchServer(s))return}for(let e of U(ds))e?.[1]===`pending`&&e[0]!==r&&Gv(e[0]);await Kv(r)};if(l){let e=a?o5(a):o.size===1?o5([...o][0]):o.size+` peers`,t=c?` on `+a5(s):``;return es(`You're in a session with `+e+`. Leave it and join `+o5(r)+t+`?`,[{label:`Leave & join`,action:()=>{try{i.leaveSession()}catch{}u()}},{label:`Stay`,action:()=>{}}]),`ask-leave`}return c?(es(`Join `+o5(r)+` on `+a5(s)+`?`,[{label:`Join`,action:()=>u()},{label:`Cancel`,action:()=>{}}]),`ask-server`):(await u(),`dial`)}var c5=!1;function l5(){c5||typeof window>`u`||(c5=!0,window.addEventListener(`hashchange`,()=>{s5(location.hash)}))}var u5=null,d5=null;async function Sct(){[u5,d5]=await Promise.all([$(()=>import(`../chunks/BQPZE1D9.js`).then(e=>e.r),__vite__mapDeps([186,1,2,3,0,4,5,6,113,9,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,187,136]),import.meta.url),$(()=>import(`../chunks/CSw9mI6E.js`).then(e=>e.s),__vite__mapDeps([184,1,2,6,0,3,4,5,100]),import.meta.url)])}async function f5(){if(Om)return;let e=``;try{e=import.meta&&`/cloud-plugin.js`||typeof localStorage<`u`&&nt.getItem(`cloudPluginUrl`)||``}catch{e=``}if(e)try{let t=await $(()=>import(e),[],import.meta.url),n=Number(t.compatibleHooks??(t.default&&t.default.compatibleHooks));if(Number.isFinite(n)&&n>3){es(`Cloud plugin requires a newer app version â running in local mode.`);return}let r=t.register||t.default&&(t.default.register||t.default);if(typeof r!=`function`){es(`Cloud plugin loaded but exports no register() â ignoring.`);return}await Sct(),await r(m5()),console.log(`cloud plugin registered:`,e)}catch(e){console.error(`cloud plugin failed to load:`,e),es(`Cloud plugin failed to load â running in local mode.`)}}var Cct={userHas:e=>({ai:U(Mh).some(t=>t.managedBy!==e),mesh:U(AS).some(t=>t.managedBy!==e)}),seed(e,{ai:t,mesh:n,activate:r,enable:i}={}){if(typeof e!=`string`||!e)throw Error(`aiPresets.seed: a non-empty tag is required`);let a={ai:r?.ai!==!1,mesh:r?.mesh!==!1},o={ai:{id:``,active:!1},mesh:{id:``,active:!1},enabled:{ai:!1,mesh:!1}};return o.ai.id=p5(e,t,a.ai,{list:Mh,active:Ah,add:e=>Ph({...e,preset:`custom`}),update:jh,remove:Oh,setActive:kh}),o.ai.active=!!o.ai.id&&U(Ah)===o.ai.id,i&&o.ai.active&&!U(Eh)&&(Nh(!0),o.enabled.ai=!0),o.mesh.id=p5(e,n,a.mesh,{list:AS,active:NS,add:e=>IS({kind:`comfyui`,...e}),update:FS,remove:LS,setActive:jS}),o.mesh.active=!!o.mesh.id&&U(NS)===o.mesh.id,i&&o.mesh.active&&!U(kS)&&(MS(!0),o.enabled.mesh=!0),o}};function p5(e,t,n,r){let i=U(r.list).find(t=>t.managedBy===e)||null;if(!t||typeof t!=`object`)return i&&r.remove(i.id),``;let a={...t};delete a.id,delete a.managedBy;let o=i?.id||``;if(i)r.update(o,{...a,managedBy:e});else{let t=U(r.active);o=r.add({...a,managedBy:e}),!n&&U(r.active)!==t&&r.setActive(t)}let s=U(r.active);return n&&(!s||s===o)&&r.setActive(o),o}function m5(){return{version:3,setPluginInfo:e=>rf.set(e?{name:String(e.name||`cloud`),version:String(e.version||``)}
2497:null),setCapabilityProvider:mre,setAuthProvider:hre,getAuthProvider:af,appNotice:Bs,setAccountIdentity:e=>vs.set(e||null),getPeers:()=>U(Es),sessionHost:()=>U(Vd),connectToPeer:(e,t)=>Kv(e,t),dialMeta:!0,sendCloud:e=>{let t=U(Es);t&&typeof t.send==`function`&&t.send({type:`cloud`,payload:e})},onCloudMessage:e=>vre(e),mountConnect:e=>sf.set(typeof e==`function`?e:null),mountUsersSection:e=>ef.set(typeof e==`function`?e:null),mountProfile:e=>nf.set(typeof e==`function`?e:null),mountConnectDrawer:e=>tf.set(typeof e==`function`?e:null),setRolesInfo:e=>cf.set(e||null),setScenePresence:e=>of.set(e||null),currentScene:()=>U(Bb)?.name??null,playModes:()=>({mine:jC(),peers:{...U(AC)}}),peerRoster:()=>(U(as)??[]).map(e=>[e[0],e[1]||``]),captureThumbnail:async(e=480)=>{let t=U(xi),n=U(Pi),r=U(yi);if(!t||!n||!r||t.xr?.isPresenting)return null;try{t.render(n,r);let i=t.domElement,a=i.width||e,o=Math.min(1,e/a),s=Math.max(1,Math.round(a*o)),c=Math.max(1,Math.round((i.height||e)*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);return u?(u.drawImage(i,0,0,s,c),await new Promise(e=>l.toBlob(e,`image/jpeg`,.6))):null}catch(e){return console.warn(`thumbnail capture failed`,e),null}},buildSceneBundle:async({assets:e=!0,flow:t=!0,name:n=``}={})=>{let{buildSessionPayload:r,exportSessionZip:i,sessionFileList:a}=await $(async()=>{let{buildSessionPayload:e,exportSessionZip:t,sessionFileList:n}=await import(`../chunks/CFe4PVuz.js`).then(e=>e.A);return{buildSessionPayload:e,exportSessionZip:t,sessionFileList:n}},__vite__mapDeps([124,1,2,6,9,0,3,4,40,5,7,21,13,10,48,14,26,27,55,32,30,31,34,19,20,35,24,23,8,11,12,25,36,37,38,39,41,42,22,43,44,45,46,47,49,50,16,51,52,53,54,28,29,56,33,57,58,59,60,61,62,18,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,125,126,100,127,128,129,130,131,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98]),import.meta.url),o=r(String(n||U(Bb)?.name||`Untitled`)),s=await i(o,{assets:e!==!1,flow:t!==!1,packs:!1}),c=new Blob([s],{type:`application/zip`});return{blob:c,meta:await wct(o,{flow:t!==!1,bytes:c.size,files:a(o)})}},loadRemoteScene:async({sceneUrl:e,title:t=``,slug:n=``,modules:r=[]}={})=>{if(!e)return!1;let{loadRemoteScene:i}=await $(async()=>{let{loadRemoteScene:e}=await import(`../chunks/CMuobrDT.js`).then(e=>e.h);return{loadRemoteScene:e}},__vite__mapDeps([217,1,2,6,0,3,4,5,78,77,67,128,167,7,24,20,21,23,8,9,10,11,12,13,14,25,27,34,19,35,36,37,38,39,40,41,42,22,43,44,45,46,47,48,49,50,16,51,52,53,54,26,28,29,55,31,56,32,30,33,57,58,59,75,165,140,17,18,60,61,62,63,64,65,66,68,69,70,71,72,73,74,76,79,80,81,82,83,84,85,86,87,141,138,166,168,98]),import.meta.url);return i({sceneUrl:String(e),title:String(t||n||`Scene`),slug:String(n||t||`scene`),modules:Array.isArray(r)?r:[]})},camera:{pose:()=>{let e=U(yi),t=U(Ki);return!e||!t||U(wi)?null:{position:e.position.toArray(),target:t.target.toArray(),fov:typeof e.fov==`number`?e.fov:null}},setPose:e=>h5(e),bookmarks:()=>(u5?U(u5.bookmarks):[]).map(e=>({id:String(e.id),name:String(e.name)})),recall:e=>{if(!u5)return!1;let t=U(u5.bookmarks).find(t=>t.id===e);return t?h5({position:t.position,target:t.target,fov:t.lens?.fov??null}):!1}},startPlay:()=>d5?(d5.requestPlay(),!0):!1,stopPlay:()=>{if(!d5)return!1;let e=U(ki)===!0;return d5.exitPlay(),e},mountSidebar:e=>uf.set(typeof e==`function`?e:null),mountPublish:e=>N_e.set(typeof e==`function`?e:null),openPublishExport:e=>ZC(e),setPublishedLink:e=>P_e.set(e&&typeof e==`object`&&typeof e.playUrl==`string`?{id:String(e.id||``),title:String(e.title||``),playUrl:String(e.playUrl),pageUrl:String(e.pageUrl||``)}:null),setCommunityProvider:e=>fre(e),aiPresets:Cct,setMeshJobStatus:e=>lf.set(typeof e==`function`?e:null),toast:es}}function h5(e){let t=U(yi),n=U(Ki);if(!t||!n||U(wi))return!1;let r=e?.position,i=e?.target;if(!Array.isArray(r)||r.length<3||!Array.isArray(i)||i.length<3)return!1;t.position.fromArray(r),n.target.fromArray(i);let a=e?.fov;return typeof a==`number`&&Number.isFinite(a)&&typeof t.fov==`number`&&(t.fov=a,t.updateProjectionMatrix()),n.update(),hi.update(e=>e+1),!0}async function wct(e,t){let n=t.flow?e?.graphs??{}:{},r=Object.values(n).flatMap(e=>
2497Array.isArray(e?.nodes)?e.nodes:[]),{nodeCatalog:i}=await $(async()=>{let{nodeCatalog:e}=await import(`../chunks/CKu0qDqv.js`).then(e=>e.a);return{nodeCatalog:e}},__vite__mapDeps([60,1,2,13,10,8,6,9,0,3,4,5,11,12,14,24,20,21,23,25,28,27,29,26,34,19,35,36,37,38,39,40,41,7,42,22,43,44,45,46,47,48,49,50,16,51,52,53,54,55,31,56,32,30,33,57,58,59,61,62]),import.meta.url),a=new Set([`sound`]);for(let e of i)if(e.group===`Music`)for(let t of e.items)a.add(t.type);return{objectCount:Number(e?.count)||0,hasFlow:r.length>0,hasAudio:!!e?.music||!!e?.patch||r.some(e=>a.has(e?.type)),hasGame:!!e?.game,modules:t.flow&&Array.isArray(e?.modules)?e.modules:[],appVersion:String(e?.appVersion??``),bytes:t.bytes,camera:e?.camera??null,duration:await Tct(e),files:t.files}}async function Tct(e){let t=e?.music?.hash;if(t)try{let{itemByHash:e,itemBlob:n}=await $(async()=>{let{itemByHash:e,itemBlob:t}=await import(`../chunks/DkMAWo2j.js`).then(e=>e.f);return{itemByHash:e,itemBlob:t}},__vite__mapDeps([69,1,2,9,44,5,6,3,70,20,21]),import.meta.url),r=e(t),i=r?await n(r.id):null;if(i){let e=await Ect(i);if(e!=null)return e}}catch{}let n=0;for(let t of Object.values(e?.animations??{}))for(let e of Object.values(t?.clips??{}))n=Math.max(n,Number(e?.duration)||0);return n>0?n:null}function Ect(e){return new Promise(t=>{let n=``,r=e=>{clearTimeout(i),n&&URL.revokeObjectURL(n),t(e)},i=setTimeout(()=>r(null),3e3);try{n=URL.createObjectURL(e);let t=document.createElement(`audio`);t.preload=`metadata`,t.onloadedmetadata=()=>r(Number.isFinite(t.duration)?t.duration:null),t.onerror=()=>r(null),t.src=n}catch{r(null)}})}var Dct=V(`<div class="colocation-badge svelte-9qt42o" role="status" title="Colocated â the scene is pinned 1:1 to your physical room; world-grab moves the shared room anchor"><span class="colocation-dot svelte-9qt42o" aria-hidden="true"></span> <span> </span></div>`);function Oct(e,t){Ce(t,!1);let n=()=>z(mg,`$roomAlignment`,r),[r,i]=Ve();R();var a=fe(),o=N(a),s=e=>{var t=Dct(),r=g(j(t),2),i=f(r,!0);H(t),O(()=>Y(i,n().roomKey??`colocated`)),X(e,t)};G(o,e=>{n()&&e(s)}),X(e,a),ue(),i()}var kct=V(`<div id="game-chip" class="game-chip svelte-18bw9pq"><span class="game-chip-label svelte-18bw9pq">Game · <span class="game-chip-state svelte-18bw9pq"> </span></span> <button id="game-chip-preview" type="button" class="game-chip-icon svelte-18bw9pq"><!></button> <button id="game-chip-test" type="button" class="game-chip-test svelte-18bw9pq" title="Test play: back to the menu, enter Play, start from the Start screen"><!> <span>Test play</span></button></div>`);function Act(e,t){Ce(t,!0);let n=()=>z(Tu,`$hudIsGame`,c),r=()=>z(ki,`$isLocked`,c),i=()=>z(wi,`$isVRMode`,c),a=()=>z(Ym,`$embedMode`,c),o=()=>z(Xc,`$gameState`,c),s=()=>z(ju,`$hudPreviewInViewport`,c),[c,l]=Ve(),u=q(()=>n()&&r()!==!0&&!i()&&!a()),d=q(()=>String(o()?.state??`menu`));var p=fe(),m=N(p),h=e=>{var t=kct(),n=j(t),r=g(j(n)),i=f(r,!0);H(n);var a=g(n,2),o=j(a),c=e=>{Wx(e,{size:14,"aria-hidden":`true`})},l=e=>{aS(e,{size:14,"aria-hidden":`true`})};G(o,e=>{s()?e(c):e(l,-1)}),H(a);var u=g(a,2);gz(j(u),{size:13,"aria-hidden":`true`}),W(2),H(u),H(t),O(()=>{b(t,`data-game-state`,Q(d)),Y(i,Q(d)),b(a,`aria-pressed`,s()),b(a,`aria-label`,s()?`Hide the game screens in the editor`:`Show the game screens in the editor (preview, buttons inert)`),b(a,`title`,s()?`Hide the game screens in the editor`:`Preview the game screens in the editor (buttons inert)`)}),L(`click`,a,()=>ju.update(e=>!e)),L(`click`,u,()=>NC()),X(e,t)};G(m,e=>{Q(u)&&e(h)}),X(e,p),ue(),l()}ge([`click`]);var jct=400,g5=4e3;function Mct(e){let t=String(e??``).trim();return/^#[0-9a-f]{3,8}$/i.test(t)?t:/^[a-z][a-z0-9-]{0,23}$/i.test(t)?t.toLowerCase():``}function Nct(e){let t=String(e??``).trim().toLowerCase();return/^[a-z][a-z0-9-]{0,39}$/.test(t)?t:``}function _5(e){let t=String(e??``).slice(0,g5),n=[],r=!1,i=!1,a=[],o=``,s=()=>{o&&=(n.length<400&&n.push({kind:`text`,text:o,bold:r,italic:i,color:a[a.length-1]??``}),``)},c=0;for(;c<t.length;){let e=t[c];if(e===` 2498`){s(),n.length<400&&n.push({kind:`br`}),c+=1;continue}if(e===`*`&&t[c+1]===`*`){s(),r=!r,c+=2;continue}if(e===`*`){s(),i=!i,c+=1;continue}if(e===`{`){let e=t.indexOf(`}`,c+1);if(e>c){let r=t.slice(c+1,e),i=r.indexOf(`:`),o=(i<0?r:r.slice(0,i)).trim().toLowerCase(),l=i<0?``:r.slice(i+1);if(o===`/color`){s(),a.pop(),c=e+1;continue}if(o===`color`){let t=Mct(l);if(t){s(),a.push(t),c=e+1;continue}}if(o===`icon`){let t=Nct(l);if(t){s(),n.length<400&&n.push({kind:`icon`,name:t,color:a[a.length-1]??``}),c=e+1;continue}}}}o+=e,c+=1}return s(),n}function Pct(e){return _5(e).map(e=>e.kind===`text`?e.text:e.kind===`br`?` 2499`:``).join(``)}var Fct=200,Ict=500,Lct={key:`#ffc93d`,door:`#39d0ff`,goal:`#f472b6`,spawn:`#4ade80`},v5=`#ef562f`,y5=new Or,b5=new hn,x5=new hn;function S5(){return typeof window>`u`||!document?.documentElement?v5:getComputedStyle(document.documentElement).getPropertyValue(`--accent`).trim()||v5}function C5(e,t){let n=String(e??``).trim();return n?!/^[a-z][a-z0-9-]*$/i.test(n)||typeof window>`u`||!document?.documentElement?n:getComputedStyle(document.documentElement).getPropertyValue(`--`+n).trim()||n:t}
2499function w5(e,t,n){return!e||e===t?n||S5():gh(e)}function T5(e,t){return Math.atan2(t,e)}function E5(e){return e?.quaternion?(x5.set(0,0,-1).applyQuaternion(e.quaternion),Math.hypot(x5.x,x5.z)<1e-6?null:T5(x5.x,x5.z)):null}var D5={at:0,self:null,peers:[]};function Rct(){return D5}function O5(e){if(!e)return{x:0,z:0};let t=U(Wi)||U(yi);return t?(t.getWorldPosition(b5),{x:b5.x,z:b5.z}):{x:0,z:0}}function k5(e,t,n=``){let r=e.getContext(`2d`);if(!r)return;let i=e.width,a=e.height;if(!i||!a)return;r.clearRect(0,0,i,a);let o=Math.max(1,Number(t?.range??40)),s=Math.min(i,a)/o,c=O5(t?.follow!==!1),l=e=>i/2+(e-c.x)*s,u=e=>a/2+(e-c.z)*s,d=U(Pi);if(t?.shapes!==!1){let e=(U(Ui)?.children??[]).slice(0,Fct);r.fillStyle=`rgba(148, 163, 184, 0.45)`;for(let t of e){if(!t.visible||(y5.setFromObject(t),y5.isEmpty()))continue;let e=l(y5.min.x),n=l(y5.max.x),i=u(y5.min.z),a=u(y5.max.z);r.fillRect(e,i,Math.max(2,n-e),Math.max(2,a-i))}}let f=(e,t,n,i)=>{r.fillStyle=n,r.beginPath(),r.arc(l(e),u(t),i,0,Math.PI*2),r.fill()},p=(e,t,n,i,a)=>{r.save(),r.translate(l(e),u(t)),r.rotate(a),r.fillStyle=n,r.beginPath(),r.moveTo(i+5,0),r.lineTo(i*.2,-i*1.15),r.lineTo(i*.2,i*1.15),r.closePath(),r.fill(),r.restore()};for(let e of bl(d))f(e.x,e.z,Lct[e.kind]??`#ffffff`,3);if(t?.dots===!1){D5={at:Date.now(),self:null,peers:[]};return}let m=U(Es)?.peer?.id??null,h=C5(n||t?.style?.color,S5()),g=t?.showFacing!==!1,_=[];for(let e of U(as)??[]){let t=e?.[0];if(!t||t===m)continue;let n=d?.getObjectByName(t);if(!n||n.position.y>500)continue;let r=w5(t,m,h),i=g?E5(n):null;i!==null&&p(n.position.x,n.position.z,r,3,i),f(n.position.x,n.position.z,r,3),_.push({id:t,color:r,angle:i,self:!1,x:n.position.x,z:n.position.z})}let v=O5(!0),y=w5(m,m,h),b=U(Wi)||U(yi),x=null;g&&b&&(b.getWorldDirection(x5),x=Math.hypot(x5.x,x5.z)<1e-6?null:T5(x5.x,x5.z)),x!==null&&p(v.x,v.z,y,3.5,x),f(v.x,v.z,y,3.5),D5={at:Date.now(),self:{id:m,color:y,angle:x,self:!0,x:v.x,z:v.z},peers:_}}var zct=V(`<div> </div>`),Bct=V(`<button class="hud-el hud-button svelte-7btpcv"> </button>`),A5=V(`<span class="hud-bar-label svelte-7btpcv"> </span>`),Vct=V(`<div class="hud-el hud-bar svelte-7btpcv"><div></div> <!></div>`),Hct=V(`<div class="hud-el hud-panel svelte-7btpcv"> </div>`),j5=V(`<div class="hud-list-title svelte-7btpcv"> </div>`),Uct=V(`<div class="hud-list-row svelte-7btpcv"> </div>`),Wct=V(`<div class="hud-el hud-list svelte-7btpcv"><!> <!></div>`),Gct=V(`<span></span>`),Kct=V(`<span class="hud-cross-dot svelte-7btpcv"></span>`),qct=V(`<div class="hud-el hud-crosshair svelte-7btpcv" aria-hidden="true"><!> <!></div>`),M5=V(`<span class="hud-in-label svelte-7btpcv"> </span>`),Jct=V(`<div class="hud-el hud-input svelte-7btpcv"><!> <input class="hud-in-range svelte-7btpcv" type="range"/> <span class="hud-in-read svelte-7btpcv"> </span></div>`),Yct=V(`<button><span class="hud-toggle-box svelte-7btpcv" aria-hidden="true"></span> <span class="hud-in-label svelte-7btpcv"> </span></button>`),Xct=V(`<option class="svelte-7btpcv"> </option>`),Zct=V(`<div class="hud-el hud-input svelte-7btpcv"><!> <select class="hud-in-select svelte-7btpcv"></select></div>`),Qct=V(`<div class="hud-el hud-input svelte-7btpcv"><!> <input class="hud-in-text svelte-7btpcv" type="text"/></div>`),N5=V(`<br class="svelte-7btpcv"/>`),P5=V(`<span class="hud-rich-icon svelte-7btpcv"><!></span>`),F5=V(`<span> </span>`),$ct=V(`<div class="hud-el hud-rich svelte-7btpcv"></div>`),elt=V(`<div class="hud-el hud-scroll svelte-7btpcv"><!> <div class="hud-scroll-body svelte-7btpcv"></div></div>`),tlt=V(`<div class="hud-el hud-map svelte-7btpcv"><canvas class="hud-map-canvas svelte-7btpcv"></canvas></div>`),nlt=V(`<span class="hud-debug-row svelte-7btpcv"> </span>`),rlt=V(`<span class="hud-debug-chip svelte-7btpcv"> </span>`),ilt=V(`<span class="hud-debug-row svelte-7btpcv"> <span> </span><!></span>`),alt=V(`<span class="hud-debug-row svelte-7btpcv"> </span> <span class="hud-debug-row svelte-7btpcv"> </span> <span class="hud-debug-row svelte-7btpcv"> </span> <!> <!>`,1),olt=V(`<span class="hud-debug-head svelte-7btpcv"> </span> <!>`,1),slt=V(`<span class="hud-debug-head svelte-7btpcv">debug</span>`),clt=V(`<button class="hud-el hud-debug svelte-7btpcv"><!></button>`),llt=V(`<span><!></span>`),ult=V(`<div class="hud-el hud-iconrow svelte-7btpcv"></div>`),dlt=V(`<span class="hud-radial-label svelte-7btpcv"> </span>`),flt=V(`<div class="hud-el hud-radial svelte-7btpcv"><svg class="hud-radial-svg svelte-7btpcv" viewBox="0 0 100 100" width="100%" height="100%" aria-hidden="true"><circle cx="50" cy="50" fill="none" class="svelte-7btpcv"></circle><circle cx="50" cy="50" fill="none" stroke-linecap="round" class="svelte-7btpcv"></circle></svg> <!></div>`),plt=V(`<span class="hud-hot-num svelte-7btpcv"></span>`),mlt=V(`<div><!> <span class="hud-hot-label svelte-7btpcv"> </span></div>`),hlt=V(`<div class="hud-el hud-hotbar svelte-7btpcv"></div>`),glt=V(`<div class="hud-flash-run svelte-7btpcv"></div>`),_lt=V(`<div class="hud-el hud-flash svelte-7btpcv" aria-hidden="true"><!></div>`),vlt=V(`<div class="hud-el hud-keyhint svelte-7btpcv"><kbd class="hud-kbd svelte-7btpcv"> </kbd> <span class="hud-in-label svelte-7btpcv"> </span></div>`),ylt=V(`<button role="tab"> </button>`),blt=V(`<div class="hud-el hud-tabs svelte-7btpcv" role="tablist"></div>`),xlt=V(`<button> </button>`),Slt=V(`<div class="hud-el hud-confirm svelte-7btpcv"><span class="hud-confirm-q svelte-7btpcv"> </span> <span class="hud-confirm-row svelte-7btpcv"></span></div>`),Clt=V(`<span class="hud-code-error svelte-7btpcv">code error</span>`),wlt=V(`<div class="hud-el hud-custom svelte-7btpcv"><div class="hud-custom-slot svelte-7btpcv"></div> <!></div>`),Tlt=V(`<div class="hud-el hud-modkind svelte-7btpcv"><div class="hud-custom-slot svelte-7btpcv"></div></div>`),Elt=V(`<img class="svelte-7btpcv"/>`),Dlt=V(`<span class="hud-image-wait svelte-7btpcv">waiting for peerâ¦</span>`),Olt=V(`<span class="hud-image-wait svelte-7btpcv">pick an image</span>`),klt=V(`<div class="hud-el hud-image svelte-7btpcv"><!></div>`);function I5(e,n){Ce(n,!0);let i=()=>z(Kte,`$hudValues`,o),a=()=>z(ou,`$moduleHudKinds`,o),[o,s]=Ve(),c=J(n,`runtime`,3,null),l=J(n,`editor`,3,!1),d=J(n,`onpress`,3,void 0),p=q(()=>n.element?.style??{}),m=q(()=>n.element?.kind??`text`);function h(e,t){if(e==null||e===``)return t;let n=String(e);return/^[a-z][a-z0-9-]*$/i.test(n)&&!y.has(n.toLowerCase())?`var(--${n}, ${t})`:n}let y=new Set([`transparent`,`currentcolor`,`inherit`,`none`,`white`,`black`,`red`,`green`,`blue`,`gray`,`grey`,`yellow`,`orange`]),x=q(()=>c()?.text!==void 0&&c()?.text!==null?String(c().text):String(n.element?.label??``)),S=q(()=>Number(c()?.value??n.element?.value??0)),C=q(()=>Number(c()?.min??n.element?.min??0)),w=q(()=>Number(c()?.max??n.element?.max??1)),T=q(()=>Q(w)-Q(C)>1e-9?Math.min(100,Math.max(0,(Q(S)-Q(C))/(Q(w)-Q(C))*100)):0),E=q(()=>Array.isArray(c()?.rows)&&c().rows.length?c().rows:String(n.element?.rowsText??``).split(` 2500`).map(e=>
2500e.trim()).filter(Boolean)),k=q(()=>n.element?.orientation===`vertical`),A=q(()=>i()[n.element?.id]),ee=q(()=>Q(A)===void 0?c()?.value??n.element?.value:Q(A)),M=q(()=>String(c()?.options??n.element?.options??``).split(`,`).map(e=>e.trim()).filter(Boolean)),te=q(()=>!l()&&n.element?.enabled!==!1);function P(e){Q(te)&&vu(n.element.id,e,{shared:!!n.element?.shared})}let re=t(0),ie=hx(()=>I(re,Q(re)+1));Pe(ie);let F=q(()=>Q(m)===`image`?String(n.element?.src??``):``),ae=q(()=>{if(Q(re),!Q(F))return null;let e=gx(Q(F));return e||mx(Q(F)),e}),oe=q(()=>Q(m)===`richtext`||Q(m)===`scrollpanel`?_5(Q(x)):[]),R=t(!1),se=t(!1),ce=t(null),le=0,de=0,pe=0;Qe(()=>{if(Q(m)!==`debug`)return;Q(se)||(I(se,!0),I(R,n.element?.compact===!1));let e=requestAnimationFrame(function t(n){le++,n-de>=1e3&&(pe=Math.round(le*1e3/(n-de||1)),le=0,de=n),e=requestAnimationFrame(t)}),t=()=>{let e=U(Xc),t=U(AC),n=U(as)??[],r=U(Es)?.peer?.id??null,i=U(ane),a=rne();I(ce,{level:U(Bb)?.name??`â`,peerVarNames:a,peerVars:i,state:e.state,round:e.round,elapsed:Math.round(bee()),vars:{...e.vars},moduleLines:Dte(),players:n.map((e,n)=>{let a=e[0]===r||n===0&&!r,o=i[e[0]]??(a?i.me:null);return{id:e[0],name:e[1]||(n===0?`Me`:String(e[0]??``).slice(0,6)),mode:a?jC():t[e[0]]===`playing`?`playing`:`editor`,me:a,pvars:o?Object.entries(o).map(([e,t])=>e+`=`+t).join(` `):``}}),fps:pe},!0)};t();let r=setInterval(t,500);return()=>{clearInterval(r),cancelAnimationFrame(e)}});let me=q(()=>Math.max(1,Math.min(20,Math.round(Number(n.element?.max??n.element?.slots??5))))),V=q(()=>Math.max(0,Math.min(Q(me),Math.round(Number(c()?.value??n.element?.value??0))))),he=q(()=>String(n.element?.labels??``).split(`,`).map(e=>e.trim())),ge=2*Math.PI*42,W=q(()=>Number(c()?.pulse??0)),_e=t(``),ve=q(()=>{if(Q(m)!==`custom`)return null;let e=String(n.element?.code??``);try{return Function(`el`,`runtime`,`container`,e)}catch(e){return{__error:String(e?.message??e)}}}),ye=t(null);Qe(()=>{let e=Q(ye),t=Q(ve);if(e&&t){if(e.replaceChildren(),typeof t!=`function`){I(_e,t.__error??`could not compile`,!0);return}try{t(n.element,c(),e),I(_e,``)}catch(e){I(_e,String(e?.message??e),!0)}}});let be=(e,t)=>Ete(t),xe=q(()=>be(a(),Q(m)));function K(e,t){let n=null,r=t=>{try{n=t?.def?.mount?.(e,t.element,t.runtime)??null}catch(e){console.log(`module HUD element mount failed`,e),n=null}},i=()=>{try{typeof n==`function`?n():n&&typeof n.destroy==`function`&&n.destroy()}catch(e){console.log(`module HUD element cleanup failed`,e)}n=null};return r(t),{update(t){if(n&&typeof n.update==`function`)try{n.update(t.element,t.runtime);return}catch(e){console.log(`module HUD element update failed`,e)}i(),e.replaceChildren(),r(t)},destroy:i}}let Se=t(null);Qe(()=>{let e=Q(Se);if(Q(m)!==`minimap`||!e)return;let t=n.element,r=()=>{let n=Math.max(1,Math.round(e.clientWidth)),r=Math.max(1,Math.round(e.clientHeight));e.width!==n&&(e.width=n),e.height!==r&&(e.height=r),k5(e,t)};r();let i=setInterval(r,500);return()=>clearInterval(i)});let we=q(()=>[`color: ${h(Q(p).color,`#f3f4f6`)}`,`background: ${h(Q(p).bg,`transparent`)}`,Q(p).border?`border: 1px solid ${h(Q(p).border,`rgb(75 85 99 / 0.7)`)}`:`border: 0`,`border-radius: ${Number(Q(p).radius??0)}px`,`padding: ${Number(Q(p).pad??0)}px`,`font-size: ${Number(Q(p).size??14)}px`,`font-weight: ${Number(Q(p).weight??400)}`,Q(p).font?`font-family: ${Q(p).font}`:``,`text-align: ${Q(p).align??`left`}`,`opacity: ${Number(Q(p).opacity??1)*(n.element?.enabled===!1?.45:1)}`].filter(Boolean).join(`; `)),Te=q(()=>Q(we)+`; justify-content: `+(Q(p).align===`center`?`center`:Q(p).align===`right`?`flex-end`:`flex-start`));var Ee=fe(),De=N(Ee),Oe=e=>{var t=zct();let i;var a=f(t,!0);O(()=>{i=r(t,1,`hud-el hud-text svelte-7btpcv`,null,i,{"hud-wrap":n.element?.wrap}),Ze(t,Q(Te)),Y(a,Q(x))}),X(e,t)},ke=e=>{var t=Bct(),r=f(t,!0);O(()=>{Ze(t,Q(we)),t.disabled=n.element?.enabled===!1&&!l(),b(t,`tabindex`,l()?-1:0),Y(r,Q(x))}),L(`click`,t,e=>{l()||n.element?.enabled===!1||(e.stopPropagation(),d()?.(n.element.id))}),X(e,t)},Ae=e=>{var t=Vct(),i=j(t);let a;var o=g(i,2),s=e=>{var t=A5(),n=f(t);O(e=>Y(n,`${e??``}%`),[()=>Math.round(Q(T))]),X(e,t)},c=e=>{var t=A5(),n=f(t,!0);O(()=>Y(n,Q(x))),X(e,t)};G(o,e=>{n.element?.showPercent?e(s):Q(x)&&e(c,1)}),H(t),O(e=>{Ze(t,Q(we)),a=r(i,1,`hud-bar-fill svelte-7btpcv`,null,a,{"hud-bar-fill-v":Q(k)}),Ze(i,`${Q(k)?`height`:`width`}: ${Q(T)??``}%; background: ${e??``}`)},[()=>h(Q(p).color,`var(--accent, #ef562f)`)]),X(e,t)},je=e=>{var t=Hct(),n=f(t,!0);O(()=>{Ze(t,Q(we)),Y(n,Q(x))}),X(e,t)},Me=e=>{var t=Wct(),r=j(t),i=e=>{var t=j5(),n=f(t,!0);O(()=>Y(n,Q(x))),X(e,t)};G(r,e=>{Q(x)&&e(i)});var a=g(r,2);B(a,17,()=>Q(E),Be,(e,t)=>{var r=Uct(),i=f(r,!0);O((e,t)=>
2500{Ze(r,`height: ${e??``}px`),Y(i,t)},[()=>Number(n.element?.rowHeight??18),()=>String(Q(t))]),X(e,r)}),H(t),O(()=>Ze(t,Q(we))),X(e,t)},Ne=e=>{var t=qct(),i=j(t);B(i,16,()=>[`t`,`b`,`l`,`r`],e=>e,(e,t)=>{var i=Gct();O((e,n,a)=>{r(i,1,`hud-cross-arm hud-cross-${t??``}`,`svelte-7btpcv`),Ze(i,`background: ${e??``}; --cw: ${n??``}px; --cg: ${a??``}px`)},[()=>h(Q(p).color,`#f3f4f6`),()=>Number(n.element?.thickness??2),()=>Number(n.element?.gap??4)]),X(e,i)});var a=g(i,2),o=e=>{var t=Kct();O((e,n,r)=>Ze(t,`background: ${e??``}; width: ${n??``}px; height: ${r??``}px`),[()=>h(Q(p).color,`#f3f4f6`),()=>Number(n.element?.thickness??2),()=>Number(n.element?.thickness??2)]),X(e,t)};G(a,e=>{n.element?.dot!==!1&&e(o)}),H(t),O(()=>Ze(t,Q(we))),X(e,t)},Fe=e=>{var t=Jct(),r=j(t),i=e=>{var t=M5(),r=f(t,!0);O(()=>Y(r,n.element.label)),X(e,t)};G(r,e=>{n.element?.label&&e(i)});var a=g(r,2);v(a);var o=g(a,2),s=f(o,!0);H(t),O((e,r)=>{Ze(t,Q(we)),b(a,`min`,n.element?.min??0),b(a,`max`,n.element?.max??100),b(a,`step`,n.element?.step||1),u(a,e),a.disabled=!Q(te),b(a,`tabindex`,l()?-1:0),b(a,`aria-label`,n.element?.label||`slider`),Y(s,r)},[()=>Number(Q(ee)??0),()=>Number(Q(ee)??0)]),L(`input`,a,e=>P(Number(e.currentTarget.value))),X(e,t)},Le=e=>{var t=Yct();let i;var a=g(j(t),2),o=f(a,!0);H(t),O(()=>{i=r(t,1,`hud-el hud-toggle svelte-7btpcv`,null,i,{"hud-toggle-on":!!Q(ee)}),Ze(t,Q(we)),t.disabled=!Q(te),b(t,`tabindex`,l()?-1:0),b(t,`aria-pressed`,!!Q(ee)),Y(o,n.element?.label??``)}),L(`click`,t,e=>{e.stopPropagation(),P(!Q(ee)),Q(te)&&d()?.(n.element.id)}),X(e,t)},Re=e=>{var t=Zct(),r=j(t),i=e=>{var t=M5(),r=f(t,!0);O(()=>Y(r,n.element.label)),X(e,t)};G(r,e=>{n.element?.label&&e(i)});var a=g(r,2);B(a,20,()=>Q(M),e=>e,(e,t)=>{var n=Xct(),r=f(n,!0),i={};O(()=>{Y(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(a);var o;_(a),H(t),O(e=>{Ze(t,Q(we)),a.disabled=!Q(te),b(a,`tabindex`,l()?-1:0),b(a,`aria-label`,n.element?.label||`dropdown`),o!==(o=e)&&(a.value=(a.__value=o)??``,D(a,o))},[()=>String(Q(ee)??``)]),L(`change`,a,e=>P(e.currentTarget.value)),X(e,t)},ze=e=>{var t=Qct(),r=j(t),i=e=>{var t=M5(),r=f(t,!0);O(()=>Y(r,n.element.label)),X(e,t)};G(r,e=>{n.element?.label&&e(i)});var a=g(r,2);v(a),H(t),O(e=>{Ze(t,Q(we)),u(a,e),b(a,`placeholder`,n.element?.placeholder??``),b(a,`maxlength`,n.element?.maxLength??64),a.disabled=!Q(te),b(a,`tabindex`,l()?-1:0),b(a,`aria-label`,n.element?.label||`text field`)},[()=>String(Q(ee)??``)]),L(`change`,a,e=>P(e.currentTarget.value)),X(e,t)},He=e=>{var t=$ct();B(t,21,()=>Q(oe),Be,(e,t)=>{var n=fe(),i=N(n),a=e=>{var t=N5();X(e,t)},o=e=>{var n=P5(),r=j(n);wS(r,{get name(){return Q(t).name},size:14}),H(n),O(e=>Ze(n,e),[()=>Q(t).color?`color: ${h(Q(t).color,`inherit`)}`:``]),X(e,n)},s=e=>{var n=F5();let i;var a=f(n,!0);O(e=>{i=r(n,1,`hud-rich-run svelte-7btpcv`,null,i,{"hud-rich-b":Q(t).bold,"hud-rich-i":Q(t).italic}),Ze(n,e),Y(a,Q(t).text)},[()=>Q(t).color?`color: ${h(Q(t).color,`inherit`)}`:``]),X(e,n)};G(i,e=>{Q(t).kind===`br`?e(a):Q(t).kind===`icon`?e(o,1):e(s,-1)}),X(e,n)}),H(t),O(()=>Ze(t,Q(we))),X(e,t)},Ue=e=>{var t=elt(),i=j(t),a=e=>{var t=j5(),r=f(t,!0);O(()=>Y(r,n.element.title)),X(e,t)};G(i,e=>{n.element?.title&&e(a)});var o=g(i,2);B(o,21,()=>Q(oe),Be,(e,t)=>{var n=fe(),i=N(n),a=e=>{var t=N5();X(e,t)},o=e=>{var n=P5(),r=j(n);wS(r,{get name(){return Q(t).name},size:14}),H(n),O(e=>Ze(n,e),[()=>Q(t).color?`color: ${h(Q(t).color,`inherit`)}`:``]),X(e,n)},s=e=>{var n=F5();let i;var a=f(n,!0);O(e=>{i=r(n,1,`hud-rich-run svelte-7btpcv`,null,i,{"hud-rich-b":Q(t).bold,"hud-rich-i":Q(t).italic}),Ze(n,e),Y(a,Q(t).text)},[()=>Q(t).color?`color: ${h(Q(t).color,`inherit`)}`:``]),X(e,n)};G(i,e=>{Q(t).kind===`br`?e(a):Q(t).kind===`icon`?e(o,1):e(s,-1)}),X(e,n)}),H(o),H(t),O(()=>Ze(t,Q(we))),X(e,t)},Z=e=>{var t=tlt(),n=j(t);We(n,e=>I(Se,e),()=>Q(Se)),H(t),O(()=>Ze(t,Q(we))),X(e,t)},Ge=e=>{var t=clt(),n=j(t),i=e=>{var t=olt(),n=N(t),i=f(n),a=g(n,2),o=e=>{var t=alt(),n=N(t),i=f(n),a=g(n,2),o=f(a),s=g(a,2),c=f(s),l=g(s,2);B(l,17,()=>Q(ce).moduleLines,Be,(e,t)=>{var n=nlt(),r=f(n,!0);O(()=>Y(r,Q(t))),X(e,n)});var u=g(l,2);B(u,17,()=>Q(ce).players,e=>e.id??e.name,(e,t)=>{var n=ilt(),i=j(n),a=g(i);let o;var s=f(a,!0),c=g(a),l=e=>{var n=rlt(),r=f(n,!0);O(()=>Y(r,Q(t).pvars)),X(e,n)};G(c,e=>{Q(t).pvars&&e(l)}
2500),H(n),O(()=>{Y(i,`${Q(t).me?`â `:`â `}${Q(t).name??``}`),o=r(a,1,`hud-debug-chip svelte-7btpcv`,null,o,{"hud-debug-playing":Q(t).mode===`playing`}),Y(s,Q(t).mode)}),X(e,n)}),O((e,t)=>{Y(i,`scene: ${Q(ce).level??``}`),Y(o,`vars: ${e??``}`),Y(c,`player vars: ${t??``}`)},[()=>Object.keys(Q(ce).vars).length?Object.entries(Q(ce).vars).map(([e,t])=>e+`=`+t).join(` `):`â`,()=>Q(ce).peerVarNames.length?Q(ce).peerVarNames.join(`, `):`â`]),X(e,t)};G(a,e=>{Q(R)&&e(o)}),O(()=>Y(i,`${Q(ce).state??``} · r${Q(ce).round??``} · ${Q(ce).elapsed??``}s · ${Q(ce).fps??``}fps`)),X(e,t)},a=e=>{var t=slt();X(e,t)};G(n,e=>{Q(ce)?e(i):e(a,-1)}),H(t),O(()=>{Ze(t,Q(we)),b(t,`tabindex`,l()?-1:0),b(t,`aria-expanded`,Q(R))}),L(`click`,t,e=>{l()||(e.stopPropagation(),I(R,!Q(R)))}),X(e,t)},Ke=e=>{var t=ult();B(t,21,()=>Array(Q(me)),Be,(e,t,i)=>{var a=fe(),o=N(a),s=e=>{var t=llt();let a;var o=j(t);{let e=q(()=>String(n.element?.icon??`heart`)),t=q(()=>Number(Q(p).size??18));wS(o,{get name(){return Q(e)},get size(){return Q(t)}})}H(t),O(()=>a=r(t,1,`hud-icon-slot svelte-7btpcv`,null,a,{"hud-icon-empty":i>=Q(V)})),X(e,t)};G(o,e=>{(i<Q(V)||n.element?.empty!==!1)&&e(s)}),X(e,a)}),H(t),O(()=>Ze(t,Q(we))),X(e,t)},qe=e=>{var t=flt(),r=j(t),i=j(r);b(i,`r`,42);var a=g(i);b(a,`r`,42),b(a,`stroke-dasharray`,ge),H(r);var o=g(r,2),s=e=>{var t=dlt(),n=f(t);O(e=>Y(n,`${e??``}%`),[()=>Math.round(Q(T))]),X(e,t)};G(o,e=>{n.element?.showPercent!==!1&&e(s)}),H(t),O((e,r,o,s)=>{Ze(t,Q(we)),b(i,`stroke`,e),b(i,`stroke-width`,r),b(a,`stroke`,o),b(a,`stroke-width`,s),b(a,`stroke-dashoffset`,ge*(1-Q(T)/100)),b(a,`transform`,n.element?.clockwise===!1?`rotate(-90 50 50) scale(1 -1) translate(0 -100)`:`rotate(-90 50 50)`)},[()=>h(Q(p).bg,`rgb(17 24 39 / 0.55)`),()=>Number(n.element?.thickness??6),()=>h(Q(p).color,`var(--accent, #ef562f)`),()=>Number(n.element?.thickness??6)]),X(e,t)},Je=e=>{var t=hlt();B(t,21,()=>Array(Math.max(1,Math.min(12,Math.round(Number(n.element?.slots??6))))),Be,(e,t,i)=>{var a=mlt();let o;var s=j(a),c=e=>{var t=plt();t.textContent=i+1,X(e,t)};G(s,e=>{n.element?.numbers!==!1&&e(c)});var l=g(s,2),u=f(l,!0);H(a),O(()=>{o=r(a,1,`hud-hot-slot svelte-7btpcv`,null,o,{"hud-hot-on":i===Q(V)}),Y(u,Q(he)[i]??``)}),X(e,a)}),H(t),O(()=>Ze(t,Q(we))),X(e,t)},Ye=e=>{var t=_lt(),r=j(t);Ie(r,()=>Q(W),e=>{var t=fe(),r=N(t),i=e=>{var t=glt();O((e,n,r)=>Ze(t,`background: ${e??``}; --hud-flash-peak: ${n??``}; --hud-flash-fade: ${r??``}s`),[()=>h(Q(p).bg,`#ef4444`),()=>Number(Q(p).opacity??.45),()=>Math.max(.05,Number(n.element?.fade??.45))]),X(e,t)};G(r,e=>{Q(W)>0&&e(i)}),X(e,t)}),H(t),X(e,t)},Xe=e=>{var t=vlt(),r=j(t),i=f(r,!0),a=g(r,2),o=f(a,!0);H(t),O(()=>{Ze(t,Q(we)),Y(i,n.element?.keyName??``),Y(o,Q(x))}),X(e,t)},$e=e=>{var t=blt();B(t,23,()=>Q(M),(e,t)=>e+t,(e,t,n)=>{var i=ylt();let a;var o=f(i,!0);O((e,n)=>{a=r(i,1,`hud-tab svelte-7btpcv`,null,a,{"hud-tab-on":e}),b(i,`aria-selected`,n),i.disabled=!Q(te),b(i,`tabindex`,l()?-1:0),Y(o,Q(t))},[()=>Math.round(Number(Q(ee)??0))===Q(n),()=>Math.round(Number(Q(ee)??0))===Q(n)]),L(`click`,i,e=>{e.stopPropagation(),P(Q(n))}),X(e,i)}),H(t),O(()=>Ze(t,Q(we))),X(e,t)},et=e=>{var t=Slt(),i=j(t),a=f(i,!0),o=g(i,2);B(o,20,()=>Ote(Q(m)),e=>e,(e,t)=>{var i=xlt();let a;var o=f(i,!0);O(()=>{a=r(i,1,`hud-button hud-confirm-btn svelte-7btpcv`,null,a,{"hud-confirm-yes":t===`yes`}),b(i,`data-hud-sub`,n.element.id+`-`+t),i.disabled=!Q(te),b(i,`tabindex`,l()?-1:0),Y(o,n.element?.[t]??t)}),L(`click`,i,e=>{Q(te)&&(e.stopPropagation(),d()?.(n.element.id+`-`+t))}),X(e,i)}),H(o),H(t),O(()=>{Ze(t,Q(we)),Y(a,Q(x))}),X(e,t)},$=e=>{var t=wlt(),n=j(t);We(n,e=>I(ye,e),()=>Q(ye));var r=g(n,2),i=e=>{var t=Clt();O(()=>b(t,`title`,Q(_e))),X(e,t)};G(r,e=>{Q(_e)&&e(i)}),H(t),O(()=>Ze(t,Q(we))),X(e,t)},tt=e=>{var t=Tlt(),r=j(t);ne(r,(e,t)=>K?.(e,t),()=>({def:Q(xe),element:n.element,runtime:c()})),H(t),O(()=>{Ze(t,Q(we)),b(t,`data-hud-module`,Q(xe).moduleId)}),X(e,t)},nt=e=>{var t=klt(),r=j(t),i=e=>{var t=Elt();O(()=>{b(t,`src`,Q(ae)),b(t,`alt`,n.element?.label??``),Ze(t,`object-fit: ${n.element?.fit??`contain`??``}`)}),X(e,t)},a=e=>{var t=Dlt();X(e,t)},o=e=>{var t=Olt();X(e,t)};G(r,e=>{Q(ae)?e(i):Q(F)?e(a,1):l()&&e(o,2)}),H(t),O(()=>Ze(t,Q(we))),X(e,t)};G(De,e=>{Q(m)===`text`||Q(m)===`timer`?e(Oe):Q(m)===`button`?e(ke,1):Q(m)===`bar`?e(Ae,2):Q(m)===`panel`?e(je,3):Q(m)===`list`?e(Me,4):Q(m)===`crosshair`?e(Ne,5):Q(m)===`slider`?e(Fe,6):Q(m)===`toggle`?e(Le,7):Q(m)===`dropdown`?e(Re,8):Q(m)===`textfield`?e(ze,9):Q(m)===`richtext`?e(He,10):Q(m)===`scrollpanel`?e(Ue,11):Q(m)===`minimap`?e(Z,12):Q(m)===`debug`?e(Ge,13):Q(m)===`iconrow`?e(Ke,14):Q(m)===`progressradial`?e(qe,15):Q(m)===`hotbar`?e(Je,16):Q(m)===`damageflash`?e(Ye,17):Q(m)===`keyhint`?e(Xe,18):Q(m)===`tabs`?e($e,19):Q(m)===`confirm`?e(et,20):Q(m)===`custom`?e($,21):Q(xe)?e(tt,22):Q(m)===`image`&&e(nt,23)}),X(e,Ee),ue(),s()}ge([`click`,`input`,`change`]);var Alt=V(`<div class="game-announce-sub svelte-1qaah3g"> </div>`),jlt=V(`<div id="game-announce" class="game-announce svelte-1qaah3g" role="status" aria-l
2500ive="polite"><div class="game-announce-title svelte-1qaah3g"> </div> <!></div>`),Mlt=V(`<div><!></div>`),Nlt=V(`<div id="hud-layer"></div>`),Plt=V(`<!> <!>`,1);function Flt(e,n){Ce(n,!0);let i=()=>z(px,`$cameraPreview`,S),a=()=>z(mc,`$viewportOverrides`,S),o=()=>z(fs,`$hudEditorClose`,S),s=()=>z(ju,`$hudPreviewInViewport`,S),c=()=>z(ki,`$isLocked`,S),l=()=>z(Tu,`$hudIsGame`,S),u=()=>z(Au,`$hudScreenOverride`,S),d=()=>z(wu,`$hudDocs`,S),p=()=>z(Xc,`$gameState`,S),m=()=>z(ou,`$moduleHudKinds`,S),h=()=>z(wi,`$isVRMode`,S),_=()=>z(Lu,`$shellMenu`,S),v=()=>z(Zu,`$gamepadPrefs`,S),y=()=>z(vee,`$gameAnnouncement`,S),x=()=>z(Su,`$hudRuntime`,S),[S,C]=Ve(),w=q(()=>i()?.uuid??null),T=e=>iee(`hud`),E=q(()=>T(a())),D=q(()=>!o()&&!s()),k=q(()=>c()===!0),A=q(()=>!Q(k)&&l()),ee=q(()=>Q(A)&&!s()),M=(e,t,n,r)=>Ou(t).map(e=>({key:e,screen:gu(e)})).filter(e=>!!e.screen),te=q(()=>M(u(),Q(w),d(),p())),ne=(e,t)=>t,P=q(()=>ne(m(),Q(te)).flatMap(e=>(e.screen?.elements??[]).filter(e=>du(e.kind)).map(t=>({...t,__key:e.key})))),re=q(()=>Q(P).filter(e=>cu(e.kind)&&e.enabled!==!1)),ie=q(()=>Q(P).length>0&&!h()&&Q(E)&&!Q(D)&&!Q(ee)),F=q(()=>(Q(te).some(e=>e.screen?.input===`menu`)&&Q(ie)||_().open&&!h())&&Q(k));Qe(()=>(Jr.set(Q(F)),()=>Jr.set(!1)));let ae=t(0),L=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Enter`,`NumpadEnter`,`Space`,`Tab`]);function oe(e){if(!Q(ie)||Q(re).length===0||_().open||!document.pointerLockElement&&e.target?.closest?.(`#hud-layer`)||!Q(k))return;let t=e.target;(!t||t.tagName!==`INPUT`&&t.tagName!==`TEXTAREA`&&t.tagName!==`SELECT`&&!t.isContentEditable)&&e.code!==`Escape`&&(e.code!==`Tab`||document.pointerLockElement)&&L.has(e.code)&&(e.preventDefault(),e.stopImmediatePropagation(),R(e.code===`Enter`||e.code===`NumpadEnter`||e.code===`Space`?`activate`:e.code===`ArrowUp`?`up`:e.code===`ArrowDown`||e.code===`Tab`?`down`:e.code===`ArrowLeft`?`left`:`right`))}function R(e){let t=Q(re)[Q(ae)%Q(re).length];if(e===`activate`){if(!t)return;t.kind===`button`?fd(t.id):t.kind===`toggle`&&(vu(t.id,!mu(t.id,t.value),{shared:!!t.shared}),fd(t.id));return}if((e===`left`||e===`right`)&&t&&(t.kind===`slider`||t.kind===`dropdown`||t.kind===`tabs`)){let n=e===`right`?1:-1;if(t.kind===`tabs`){let e=dd(t.id,t);if(e.length){let r=Math.max(0,Math.round(Number(mu(t.id,t.value??0))));vu(t.id,(r+n+e.length)%e.length,{shared:!!t.shared})}}else if(t.kind===`slider`){let e=Number(t.min??0),r=Number(t.max??100),i=Number(t.step||1),a=Number(mu(t.id,t.value??e)),o=Math.min(r,Math.max(e,a+n*i));vu(t.id,o,{shared:!!t.shared})}else{let e=dd(t.id,t);if(e.length){let r=String(mu(t.id,t.value??e[0])),i=e[(Math.max(0,e.indexOf(r))+n+e.length)%e.length];vu(t.id,i,{shared:!!t.shared})}}return}let n=e===`down`||e===`right`,r=Q(re).length;I(ae,(Q(ae)+(n?1:r-1))%r)}let se={GamepadUp:`up`,GamepadDown:`down`,GamepadLeft:`left`,GamepadRight:`right`,GamepadA:`activate`};function ce(e,t){if(e!==`down`)return;let n=se[t];n&&v().enabled&&Q(ie)&&Q(re).length!==0&&Q(k)&&!_().open&&R(n)}_e(()=>{window.addEventListener(`keydown`,oe,!0);let e=nb(ce);return()=>{window.removeEventListener(`keydown`,oe,!0),e()}}),Qe(()=>{if(Q(ie)&&Q(re).length>0&&!Q(A))return ab(`keys`),()=>rb(`keys`)}),Qe(()=>{Q(re).length&&Q(ae)>=Q(re).length&&I(ae,0)});function le(e){if(e===`center`)return{v:`middle`,h:`center`};let[t,n]=String(e??`top-left`).split(`-`);return{v:t||`top`,h:n||`left`}}function de(e){let{v:t,h:n}=le(e.anchor),r=[`width: ${e.w}px`,`height: ${e.h}px`,`z-index: ${e.z}`];return t===`top`?r.push(`top: ${e.y}px`):t===`bottom`?r.push(`bottom: ${e.y}px`):r.push(`top: 50%`,`--hud-ty: ${e.y}px`),n===`left`?r.push(`left: ${e.x}px`):n===`right`?r.push(`right: ${e.x}px`):r.push(`left: 50%`,`--hud-tx: ${e.x}px`),r.join(`; `)}function pe(e){let{v:t,h:n}=le(e.anchor),r=n===`center`,i=t===`middle`;return!r&&!i?``:`transform: translate(${r?`calc(-50% + var(--hud-tx, 0px))`:`0`}, ${i?`calc(-50% + var(--hud-ty, 0px))`:`0`})`}var me=Plt(),V=N(me),he=e=>{var t=fe(),n=N(t);Ie(n,()=>y().id,e=>{var t=jlt(),n=j(t);let r;var i=f(n,!0),a=g(n,2),o=e=>{var t=Alt(),n=f(t,!0);O(()=>Y(n,y().sub)),X(e,t)};G(a,e=>{y().sub&&e(o)}),H(t),O(()=>{Ze(t,`--announce-ms: ${y().ms??``}ms`),r=Ze(n,``,r,{color:y().color}),Y(i,y().text)}),X(e,t)}),X(e,t)};G(V,e=>{y()&&!h()&&Q(E)&&e(he)});var ge=g(V,2),U=e=>{var t=Nlt();let n;B(t,21,()=>Q(P),e=>e.__key+`:`+e.id,(e,t)=>{var n=Mlt();let i;
2500I5(j(n),{get element(){return Q(t)},get runtime(){return x()[Q(t).id]},get editor(){return Q(A)},get onpress(){return fd}}),H(n),O((e,a,o)=>{i=r(n,1,`hud-slot svelte-1qaah3g`,null,i,{"hud-focused":e}),b(n,`data-hud-id`,Q(t).id),b(n,`data-hud-kind`,Q(t).kind),Ze(n,`${a??``}; ${o??``}`)},[()=>Q(k)&&cu(Q(t).kind)&&Q(re)[Q(ae)%Math.max(1,Q(re).length)]?.id===Q(t).id,()=>de(Q(t)),()=>pe(Q(t))]),X(e,n)}),H(t),O(()=>{n=r(t,1,`hud-layer svelte-1qaah3g`,null,n,{"hud-authoring":!Q(k),"hud-inert":Q(A)}),b(t,`data-authoring`,!Q(k)),b(t,`data-inert`,Q(A))}),X(e,t)};G(ge,e=>{Q(ie)&&e(U)}),X(e,me),ue(),C()}var L5=(e,t=qe)=>{var n=zlt();let i;var a=j(n),o=f(a,!0),s=g(a,2),c=e=>{var n=Ilt();v(n),O(()=>{b(n,`aria-label`,t().label),w(n,!!t().value)}),L(`change`,n,e=>Jl(t().id,e.currentTarget.checked)),X(e,n)},l=e=>{var n=Llt(),r=j(n);v(r);var i=g(r,2),a=f(i,!0);H(n),O(()=>{b(r,`aria-label`,t().label),b(r,`min`,t().min),b(r,`max`,t().max),b(r,`step`,t().step),u(r,t().value),Y(a,t().display)}),L(`input`,r,e=>Jl(t().id,Number(e.currentTarget.value))),X(e,n)},d=e=>{var n=Rlt(),r=j(n);ez(j(r),{size:16,"aria-hidden":`true`}),H(r);var i=g(r,2),a=f(i,!0),o=g(i,2);tz(j(o),{size:16,"aria-hidden":`true`}),H(o),H(n),O(()=>{b(r,`aria-label`,`Previous `+t().label),Y(a,t().display),b(o,`aria-label`,`Next `+t().label)}),L(`click`,r,()=>Mu(t().id,-1)),L(`click`,o,()=>Mu(t().id,1)),X(e,n)};G(s,e=>{t().type===`toggle`?e(c):t().type===`range`?e(l,1):e(d,-1)}),H(n),O(()=>{i=r(n,1,`gs-row svelte-bvuxyl`,null,i,{"gs-row-game":t().game}),b(n,`data-shell-setting`,t().id),Y(o,t().label)}),X(e,n)},Ilt=V(`<input type="checkbox" class="tp-check"/>`),Llt=V(`<span class="gs-range svelte-bvuxyl"><input type="range" class="svelte-bvuxyl"/> <span class="gs-range-value svelte-bvuxyl"> </span></span>`),Rlt=V(`<span class="gs-choice svelte-bvuxyl"><button type="button" class="svelte-bvuxyl"><!></button> <span class="gs-choice-value svelte-bvuxyl"> </span> <button type="button" class="svelte-bvuxyl"><!></button></span>`),zlt=V(`<div><span class="gs-row-label svelte-bvuxyl"> </span> <!></div>`),Blt=V(`<kbd class="svelte-bvuxyl">Esc</kbd>`),Vlt=V(`<button id="game-shell-menu-button" type="button" title="Game menu (Esc)" aria-label="Open the game menu"><!> <span>Menu</span> <!></button>`),Hlt=V(`<button type="button" class="gs-back svelte-bvuxyl" aria-label="Back"><!></button>`),Ult=V(`<button type="button"> </button>`),Wlt=V(`<div class="gs-list svelte-bvuxyl"></div>`),Glt=V(`<button type="button" role="tab"> </button>`),Klt=V(`<div class="gs-tabs svelte-bvuxyl" role="tablist"><span class="gs-tabs-label svelte-bvuxyl"> </span> <!></div>`),qlt=V(`<span class="gs-level-sub svelte-bvuxyl"><!> Locked</span>`),Jlt=V(`<span class="gs-level-sub gs-stars svelte-bvuxyl"></span>`),Ylt=V(`<button type="button"><span class="gs-level-label"> </span> <!></button>`),Xlt=V(`<!> <div class="gs-levels svelte-bvuxyl"></div>`,1),Zlt=V(`<h3 class="gs-group svelte-bvuxyl">In VR</h3> <!>`,1),Qlt=V(`<div class="gs-settings svelte-bvuxyl"><!> <!></div>`),$lt=V(`<p class="svelte-bvuxyl"> </p>`),eut=V(`<hr class="svelte-bvuxyl"/>`),tut=V(`<div class="gs-help svelte-bvuxyl"></div>`),nut=V(`<div id="game-shell-menu" class="gs-backdrop svelte-bvuxyl"><div class="gs-card svelte-bvuxyl" role="dialog"><header class="gs-head svelte-bvuxyl"><!> <div class="gs-titles svelte-bvuxyl"><h2 class="gs-title svelte-bvuxyl"> </h2> <p class="gs-sub svelte-bvuxyl"> </p></div></header> <!></div></div>`),rut=V(`<!> <!>`,1);function iut(e,n){Ce(n,!0);let i=()=>z(ki,`$isLocked`,v),a=()=>z(wi,`$isVRMode`,v),o=()=>z(vi,`$editorMode`,v),s=()=>z(wu,`$hudDocs`,v),c=()=>z(Qte,`$gameLevels`,v),l=()=>z(Lu,`$shellMenu`,v),u=()=>z(Al,`$touchControlsVisible`,v),d=()=>z(Yl,`$gameSettingValues`,v),m=()=>z(_te,`$gameSettingRows`,v),h=()=>z(tne,`$gameHelp`,v),_=()=>z(ene,`$gameDescription`,v),[v,y]=Ve(),x=q(()=>i()===!0),S=(...e)=>zu(),w=q(()=>!a()&&S(i(),o(),s(),c())),T=q(()=>l().open&&Q(w)),E=q(()=>l().page),D=(...e)=>Yte({vr:!1}),k=q(()=>D(c(),u())),A=(...e)=>Nu({vr:!1}),ee=q(()=>A(d(),m())),M=(...e)=>Jte(),te=q(()=>M(d(),m())),ne=(...e)=>Nu({vr:!0}).filter(e=>e.vrOnly),P=q(()=>ne(d())),re=(...e)=>Xte({vr:!1}),ie=q(()=>re(h(),_())),F=(...e)=>Zte(),ae=q(()=>F(_(),d())),oe=t(null);Qe(()=>{Q(T)&&(Q(E),C().then(()=>{(Q(oe)?.querySelector(`[data-shell-focus]`)??Q(oe)?.querySelector(`button, input`))?.focu
2500s({preventScroll:!0})}))});function R(e){if(!Q(T)){e.code===`Escape`&&!Q(x)&&Q(w)&&!e.defaultPrevented&&!se(e)&&(Pu(),e.preventDefault());return}if(!se(e)){if(e.code===`Escape`&&!Q(x)){e.preventDefault(),Q(E)===`main`?Iu():Fu(`back`);return}if(e.code===`Backspace`&&Q(E)!==`main`){e.preventDefault(),Fu(`back`);return}if(e.code===`ArrowDown`||e.code===`ArrowUp`){let t=[...Q(oe)?.querySelectorAll(`button:not([disabled]), input`)??[]];if(!t.length)return;t[(t.indexOf(document.activeElement)+(e.code===`ArrowDown`?1:-1)+t.length)%t.length]?.focus(),e.preventDefault(),e.stopPropagation()}}}function se(e){let t=e.target;return!!t&&(t.tagName===`TEXTAREA`||t.isContentEditable||t.tagName===`INPUT`&&![`range`,`checkbox`,`button`].includes(t.type))}var ce=rut();Z(`keydown`,p,R);var le=N(ce),de=e=>{var t=Vlt();let n;var i=j(t);pke(i,{size:16,"aria-hidden":`true`});var a=g(i,4),o=e=>{var t=Blt();X(e,t)};G(a,e=>{Q(x)&&e(o)}),H(t),O(()=>n=r(t,1,`gs-corner svelte-bvuxyl`,null,n,{"gs-corner-play":Q(x)})),L(`click`,t,()=>Pu()),X(e,t)};G(le,e=>{Q(w)&&!Q(T)&&e(de)});var pe=g(le,2),me=e=>{var t=nut(),n=j(t),i=j(n),a=j(i),o=e=>{var t=Hlt();ez(j(t),{size:18,"aria-hidden":`true`}),H(t),L(`click`,t,()=>Fu(`back`)),X(e,t)};G(a,e=>{Q(E)!==`main`&&e(o)});var s=g(a,2),l=j(s),u=f(l,!0),d=g(l,2),p=f(d,!0);H(s),H(i);var m=g(i,2),h=e=>{var t=Wlt();B(t,21,()=>Q(k),e=>e.id,(e,t)=>{var n=Ult();let i;var a=f(n,!0);O(()=>{i=r(n,1,`gs-item svelte-bvuxyl`,null,i,{"gs-primary":Q(t).id===`resume`,"gs-quiet":Q(t).id===`editor`}),b(n,`data-shell-item`,Q(t).id),b(n,`data-shell-focus`,Q(t).id===`resume`?``:void 0),Y(a,Q(t).label)}),L(`click`,n,()=>Fu(Q(t).id)),X(e,n)}),H(t),X(e,t)},_=e=>{var t=Xlt(),n=N(t);B(n,17,()=>Q(te),e=>e.id,(e,t)=>{var n=Klt(),i=j(n),a=f(i,!0),o=g(i,2);B(o,17,()=>Q(t).options,e=>e.value,(e,n)=>{var i=Glt();let a;var o=f(i,!0);O(()=>{a=r(i,1,`gs-tab svelte-bvuxyl`,null,a,{"gs-tab-on":Q(n).value===Q(t).value}),b(i,`aria-selected`,Q(n).value===Q(t).value),b(i,`data-shell-tab`,Q(t).id+`:`+Q(n).value),Y(o,Q(n).label)}),L(`click`,i,()=>Q(n).value!==Q(t).value&&Jl(Q(t).id,Q(n).value)),X(e,i)}),H(n),O(()=>{b(n,`aria-label`,Q(t).label),b(n,`data-shell-tabs`,Q(t).id),Y(a,Q(t).label)}),X(e,n)});var i=g(n,2);B(i,5,()=>c()?.list??[],e=>e.id,(e,t)=>{var n=Ylt();let i;var a=j(n),o=f(a,!0),s=g(a,2),l=e=>{var t=qlt(),n=j(t);Ux(n,{size:13,"aria-hidden":`true`}),W(),H(t),X(e,t)},u=e=>{var n=Jlt();B(n,21,()=>Array(Q(t).stars),Be,(e,t)=>{Tz(e,{size:13,"aria-hidden":`true`})}),H(n),O(()=>b(n,`aria-label`,Q(t).stars+` stars`)),X(e,n)};G(s,e=>{Q(t).locked?e(l):Q(t).stars&&e(u,1)}),H(n),O(()=>{i=r(n,1,`gs-level svelte-bvuxyl`,null,i,{"gs-level-current":c()?.current===Q(t).id}),b(n,`data-shell-level`,Q(t).id),n.disabled=!!Q(t).locked,b(n,`title`,Q(t).locked?Q(t).label+` (locked)`:Q(t).label),Y(o,Q(t).label)}),L(`click`,n,()=>$te(Q(t).id)),X(e,n)}),H(i),X(e,t)},v=e=>{var t=Qlt(),n=j(t);B(n,17,()=>Q(ee),e=>e.id,(e,t)=>{var n=fe(),r=N(n),i=e=>{L5(e,()=>Q(t))};G(r,e=>{Q(t).vrOnly||e(i)}),X(e,n)});var r=g(n,2),i=e=>{var t=Zlt(),n=g(N(t),2);B(n,17,()=>Q(P),e=>e.id,(e,t)=>{L5(e,()=>Q(t))}),X(e,t)};G(r,e=>{Q(P).length&&e(i)}),H(t),X(e,t)},y=e=>{var t=tut();B(t,21,()=>Q(ie),Be,(e,t)=>{var n=fe(),r=N(n),i=e=>{var n=$lt(),r=f(n,!0);O(()=>Y(r,Q(t))),X(e,n)},a=e=>{var t=eut();X(e,t)};G(r,e=>{Q(t)?e(i):e(a,-1)}),X(e,n)}),H(t),X(e,t)};G(m,e=>{Q(E)===`main`?e(h):Q(E)===`levels`?e(_,1):Q(E)===`settings`?e(v,2):e(y,-1)}),H(n),We(n,e=>I(oe,e),()=>Q(oe)),H(t),O((e,r)=>{b(t,`data-page`,Q(E)),b(n,`aria-label`,e),Y(u,r),Y(p,Q(ae))},[()=>Ru(Q(E)),()=>Ru(Q(E))]),X(e,t)};G(pe,e=>{Q(T)&&e(me)}),X(e,ce),ue(),y()}ge([`change`,`input`,`click`]);var aut=V(`<span id="perf-report-dot" class="report-dot svelte-bjh57d" title="Sending performance reports (Settings ⸠Interface)"></span>`),out=V(`<span> </span>`),sut=V(`<!><span id="fps-calls" class="fps-calls svelte-bjh57d"> </span>`,1),cut=V(`<!><span> </span>`,1),lut=V(`<span class="fps-detail svelte-bjh57d"><!> <!> <!></span>`),uut=V(`<div id="game-fps-counter" aria-live="off"><span class="fps-main svelte-bjh57d"><!> </span> <!></div>`);function dut(e,t){Ce(t,!0);let n=()=>z(ki,`$isLocked`,p),i=()=>z(Yl,`$gameSettingValues`,p),a=()=>z(vi,`$editorMode`,p),o=()=>z(wi,`$isVRMode`,p),s=()=>z(Rv,`$perfStatsShown`,p),c=()=>z(gfe,`$fpsReading`,p),l=()=>z(rw,`$perfReportsOn`,p),u=()=>z(iw,`$perfReportsAvailable`,p),d=()=>z(Y_e,`$perfReportStatus`,p),[p,m]=Ve(),h=q(()=>n()===!0),_=q(()=>!!i().showFps&&(Q(h)||a()===`interact`)),v=q(()=>!o()&&(s()||Q(_))),y=q(()=>hfe(c())),x=q(()=>l()&&u());var S=fe(),C=N(S),w=e=>{var t=uut();let n;var i=j(t),a=j(i),o=e=>{var t=aut();O(()=>b(t,`data-state`,d().state)),X(e,t)};G(a,e=>{Q(x)&&e(o)});var s=g(a,1,!0);H(i);var c=g(i,2),l=e=>{var t=lut(),n=j(t),r=e=>{var t=out(),n=f(t,!0);O(()=>Y(n,Q(y).ms)),X(e,t)};G(n,e=>{Q(y).ms&&e(r)});var i=g(n,2),a=e=>{var t=sut(),n=N(t),r=e=>{var t=Te();t.nodeValue=` · `,X(e,t)};G(n,e=>{Q(y).ms&&e(r)});var i=g(n),a=f(i,!0);O(()=>{b(i,`data-tier`,Q(y).tier),Y(a,Q(y).calls)}),X(e,t)};G(i,e=>{Q(y).calls&&e(a)});var o=g(i,2),s=e=>{var t=cut(),n=N(t),r=e=>{var t=Te();t.nodeValue=` · `,X(e,t)};G(n,e=>{(Q(y).ms||Q(y).calls)&&e(r)});var i=g(n),a=f(i,!0);O(()=>Y(a,Q(y).tris)),X(e,t)};G(o,e=>{Q(y).tris&&e(s)}),H(t),X(e,t)};G(c,e=>{(Q(y).ms||Q(y).calls||Q(y).tris)&&e(l)}
2500),H(t),O(()=>{n=r(t,1,`fps svelte-bjh57d`,null,n,{"fps-play":Q(h)}),b(t,`data-tier`,Q(y).tier),Y(s,Q(y).fps)}),X(e,t)};G(C,e=>{Q(v)&&e(w)}),X(e,S),ue(),m()}var fut=V(`<img alt="" class="svelte-30uflm"/>`),put=V(`<span class="hud-pick-empty svelte-30uflm">ï¼</span>`),mut=V(`<button class="hud-pick-clear svelte-30uflm" title="Remove this image" aria-label="Remove this image"><!></button>`),hut=V(`<div class="hud-pick svelte-30uflm" role="group"><label class="hud-pick-swatch svelte-30uflm" title="Pick an image, or drop one from the Explorer"><!> <input class="hud-pick-file svelte-30uflm" type="file" accept="image/*"/></label> <span class="hud-pick-name svelte-30uflm"><!></span> <!></div>`);function gut(e,n){Ce(n,!0);let r=()=>z(Fa,`$explorerItems`,i),[i,a]=Ve(),o=J(n,`hash`,3,``),s=t(!1),c=t(0),l=hx(()=>I(c,Q(c)+1));Pe(l);let u=q(()=>r()&&o()?ka(o()):null),d=q(()=>{if(Q(c),!o())return null;let e=gx(o());return e||mx(o()),e}),f=q(()=>o()?Q(u)?Q(d)?`ready`:`loading`:`missing`:`empty`);function p(e){n.onpick?.(e),e&&hhe(e)}async function m(e){let t=e.currentTarget,n=t?.files;if(n?.length){I(s,!0);try{let e=await qa([n[0]]);e?.length&&p(e[0].hash)}finally{I(s,!1),t&&(t.value=``)}}}function h(e){e.dataTransfer?.types?.includes(`application/x-explorer-item`)&&e.preventDefault()}function _(e){let t=e.dataTransfer?.getData(`application/x-explorer-item`);if(!t)return;e.preventDefault(),e.stopPropagation();let n=t;try{n=JSON.parse(t)?.id??t}catch{}let i=(r()??[]).find(e=>e?.id===n);i?.kind===`image`&&i.hash&&p(i.hash)}var v=hut(),y=j(v),x=j(y),S=e=>{var t=fut();O(()=>b(t,`src`,Q(u).thumbnail)),X(e,t)},C=e=>{var t=put();X(e,t)};G(x,e=>{Q(u)?.thumbnail?e(S):e(C,-1)});var w=g(x,2);H(y);var T=g(y,2),E=j(T),D=e=>{var t=Te(`importingâ¦`);X(e,t)},k=e=>{var t=Te(`pick or drop`);X(e,t)},A=e=>{var t=Te(`waiting for peerâ¦`);X(e,t)},ee=e=>{var t=Te();O(e=>Y(t,e),[()=>Q(u)?.name??o().slice(0,8)]),X(e,t)};G(E,e=>{Q(s)?e(D):Q(f)===`empty`?e(k,1):Q(f)===`missing`?e(A,2):e(ee,-1)}),H(T);var M=g(T,2),te=e=>{var t=mut(),n=j(t);fS(n,{size:11,"aria-hidden":`true`}),H(t),L(`click`,t,()=>p(``)),X(e,t)};G(M,e=>{o()&&e(te)}),H(v),O(()=>b(v,`data-state`,Q(f))),Z(`dragover`,v,h),Z(`drop`,v,_),L(`change`,w,m),X(e,v),ue(),a()}ge([`change`,`click`]);var _ut=V(`<label class="hud-field svelte-jo3y6z"><span class="svelte-jo3y6z"> </span> <span class="hud-field-ctl svelte-jo3y6z"><input type="checkbox"/></span></label>`),vut=V(`<option> </option>`),yut=V(`<label class="hud-field svelte-jo3y6z"><span class="svelte-jo3y6z"> </span> <select class="hud-input svelte-jo3y6z"></select></label>`),but=V(`<button></button>`),xut=V(`<div class="hud-cp svelte-jo3y6z"><svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper> <p class="hud-cp-head svelte-jo3y6z">Theme tokens</p> <div class="hud-cp-chips svelte-jo3y6z"></div> <p class="hud-cp-note svelte-jo3y6z">A token follows the viewer's theme; a literal is the same colour for everyone.</p> <div class="hud-cp-foot svelte-jo3y6z"><button class="hud-cp-cmd svelte-jo3y6z">clear</button> <button class="hud-cp-cmd svelte-jo3y6z">done</button></div></div>`),Sut=V(`<div class="hud-field svelte-jo3y6z"><span class="svelte-jo3y6z"> </span> <span class="hud-field-ctl svelte-jo3y6z"><button title="Pick a colour, or a theme token"></button> <input class="hud-input svelte-jo3y6z" placeholder="#f3f4f6 or accent"/></span></div> <!>`,1),Cut=V(`<div class="hud-field svelte-jo3y6z"><span class="svelte-jo3y6z"> </span></div> <div class="hud-field hud-field-wide svelte-jo3y6z"><textarea class="hud-input hud-area svelte-jo3y6z" rows="4"></textarea></div>`,1),wut=V(`<div class="hud-field svelte-jo3y6z"><span class="svelte-jo3y6z"> </span> <span class="hud-field-ctl svelte-jo3y6z"><button class="hud-cp-cmd svelte-jo3y6z">Edit codeâ¦</button> <span class="hud-code-len svelte-jo3y6z"> </span></span></div>`),Tut=V(`<div class="hud-field svelte-jo3y6z"><span class="svelte-jo3y6z"> </span></div> <div class="hud-field hud-field-wide svelte-jo3y6z"><!></div>`,1),Eut=V(`<label class="hud-field svelte-jo3y6z"><span class="svelte-jo3y6z"> </span> <input class="hud-input svelte-jo3y6z"/></label>`);function R5(e,n){Ce(n,!0);let i=Jq,a=q(()=>n.field?.label??n.field?.key??``),o=q(()=>(n.field?.step??1)>=1),s=[`accent`,`accent-2`,`text`,`text-2`,`muted`,`surface`,`surface-2`,`border`],c=t(!1),l=t(null),d=t(null),p=t(null),m=q(()=>String(n.value??``)),h=q(()=>Q(m).startsWith(`#`)||Q(m).startsWith(`rgb`)),y=q(()=>Q(m)?Q(h)?Q(m):`var(--${Q(m)}, #888)`:``),x=q(()=>Q(h)&&Q(m).startsWith(`#`)?Q(m):S());function S(){if(typeof window>`u`)return`#f3f4f6`;try{let e=Q(l)&&getComputedStyle(Q(l)).backgroundColor,t=e&&e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(!t)return`#f3f4f6`;let n=e=>Number(e).toString(16).padStart(2,`0`);return`#`+n(t[1])+n(t[2])+n(t[3])}catch{return`#f3f4f6`}}function C(e,t){let n=e=>typeof e==`string`?e.trim().toLowerCase().replace(/^#/,``).slice(0,6):``,r=n(e);
2500return!!r&&r===n(t)}function T(){if(Q(c)){I(c,!1);return}let e=Q(l)?.getBoundingClientRect();if(!e)return;let t=e.top-8,n=window.innerHeight-e.bottom-8;I(p,t>=300||t>=n?{x:Math.min(e.left,window.innerWidth-300),top:null,bottom:window.innerHeight-e.top+6}:{x:Math.min(e.left,window.innerWidth-300),top:e.bottom+6,bottom:null},!0),I(c,!0)}Qe(()=>{if(!Q(c))return;let e=e=>{Q(d)?.contains(e.target)||Q(l)?.contains(e.target)||I(c,!1)},t=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),I(c,!1))};return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`keydown`,t,!0),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`keydown`,t,!0)}});function E(e){return document.body.appendChild(e),{destroy(){e.remove()}}}var k=fe(),A=N(k),ee=e=>{{let t=q(()=>Number(n.value??0)),r=q(()=>n.field.step??1),i=q(()=>Q(o)?0:2),s=q(()=>n.field.min??-1/0),c=q(()=>n.field.max??1/0),l=q(()=>n.field.hint??``);hq(e,{get label(){return Q(a)},get value(){return Q(t)},get step(){return Q(r)},get decimals(){return Q(i)},get min(){return Q(s)},get max(){return Q(c)},get title(){return Q(l)},onchange:e=>n.onchange(Q(o)?Math.round(e):e)})}},M=e=>{var t=_ut(),r=j(t),i=f(r,!0),o=g(r,2),s=j(o);v(s),H(o),H(t),O(()=>{b(t,`title`,n.field.hint??``),Y(i,Q(a)),w(s,!!n.value)}),L(`change`,s,e=>n.onchange(e.currentTarget.checked)),X(e,t)},te=e=>{var t=yut(),r=j(t),i=f(r,!0),o=g(r,2);B(o,20,()=>n.field.options??[],e=>e,(e,t)=>{var n=vut(),r=f(n,!0),i={};O(()=>{Y(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(o);var s;_(o),H(t),O(e=>{b(t,`title`,n.field.hint??``),Y(i,Q(a)),s!==(s=e)&&(o.value=(o.__value=s)??``,D(o,s))},[()=>String(n.value??n.field.options?.[0]??``)]),L(`change`,o,e=>n.onchange(e.currentTarget.value)),X(e,t)},P=e=>{var t=Sut(),o=N(t),h=j(o),_=f(h,!0),S=g(h,2),w=j(S);let D;We(w,e=>I(l,e),()=>Q(l));var k=g(w,2);v(k),H(S),H(o);var A=g(o,2),ee=e=>{var t=xut();let a;var o=j(t);{let e=q(()=>({...qq,wrapper:i}));Ee(o,()=>({"--picker-indicator-size":`18px`,"--cp-bg-color":`#1f2937`,"--cp-border-color":`#353f4e`,"--picker-height":`70px`,"--picker-width":`50px`,"--slider-width":`10px`})),Kq(o.lastChild,{isAlpha:!1,isTextInput:!0,textInputModes:[`hex`,`rgb`,`hsv`],isDialog:!1,get components(){return Q(e)},isOpen:!0,sliderDirection:`horizontal`,get hex(){return Q(x)},onInput:e=>{C(e.hex,Q(x))||n.onchange(e.hex)}}),H(o)}var l=g(o,4);B(l,20,()=>s,e=>e,(e,t)=>{var i=but();let a;O(()=>{a=r(i,1,`hud-cp-chip svelte-jo3y6z`,null,a,{"hud-cp-chip-on":Q(m)===t}),b(i,`data-hud-token`,t),b(i,`title`,t),b(i,`aria-label`,`Use the ${t??``} theme token`),Ze(i,`background: var(--${t??``}, #888)`)}),L(`click`,i,()=>n.onchange(t)),X(e,i)}),H(l);var u=g(l,4),f=j(u),h=g(f,2);H(u),H(t),ne(t,e=>E?.(e)),We(t,e=>I(d,e),()=>Q(d)),O(()=>{b(t,`data-hud-colorpicker`,n.field.key),a=Ze(t,``,a,{left:`${Q(p).x??``}px`,top:Q(p).top===null?null:Q(p).top+`px`,bottom:Q(p).bottom===null?null:Q(p).bottom+`px`})}),L(`click`,f,()=>n.onchange(``)),L(`click`,h,()=>I(c,!1)),X(e,t)};G(A,e=>{Q(c)&&Q(p)&&e(ee)}),O(()=>{b(o,`title`,n.field.hint??`A #hex, an rgb(), or a theme token name like accent`),Y(_,Q(a)),D=r(w,1,`hud-swatch hud-swatch-btn svelte-jo3y6z`,null,D,{"hud-swatch-empty":!Q(m)}),b(w,`data-hud-swatch`,n.field.key),b(w,`aria-label`,`Pick a colour for ${Q(a)??``}`),b(w,`aria-expanded`,Q(c)),Ze(w,`background: ${Q(y)??``}`),u(k,Q(m))}),L(`click`,w,T),L(`change`,k,e=>n.onchange(e.currentTarget.value)),X(e,t)},re=e=>{var t=Cut(),r=N(t),i=j(r),o=f(i,!0);H(r);var s=g(r,2),c=j(s);ve(c),H(s),O(e=>{Y(o,Q(a)),b(c,`data-hud-list`,n.field.key),b(c,`placeholder`,n.field.placeholder??``),b(c,`title`,n.field.hint??``),u(c,e)},[()=>String(n.value??``)]),L(`change`,c,e=>n.onchange(e.currentTarget.value)),L(`keydown`,c,e=>{if(e.key===`Enter`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),e.stopPropagation(),n.onchange(e.currentTarget.value);return}e.key===`Escape`&&e.currentTarget.blur(),e.stopPropagation()}),X(e,t)},ie=e=>{var t=wut(),r=j(t),i=f(r,!0),o=g(r,2),s=j(o),c=g(s,2),l=f(c);H(o),H(t),O(e=>{b(t,`title`,n.field.hint??``),Y(i,Q(a)),b(s,`data-hud-code`,n.field.key),Y(l,`${e??``} chars`)},[()=>String(n.value??``).length]),L(`click`,s,()=>oJ({title:`HUD element code`,code:String(n.value??``),onSave:e=>n.onchange(e)}
2500)),X(e,t)},F=e=>{var t=Tut(),r=N(t),i=j(r),o=f(i,!0);H(r);var s=g(r,2),c=j(s);{let e=q(()=>String(n.value??``));gut(c,{get hash(){return Q(e)},onpick:e=>n.onchange(e)})}H(s),O(()=>Y(o,Q(a))),X(e,t)},ae=e=>{var t=Eut(),r=j(t),i=f(r,!0),o=g(r,2);v(o),H(t),O(e=>{b(t,`title`,n.field.hint??``),Y(i,Q(a)),b(o,`placeholder`,n.field.placeholder??``),u(o,e)},[()=>String(n.value??``)]),L(`change`,o,e=>n.onchange(e.currentTarget.value)),X(e,t)};G(A,e=>{n.field.kind===`number`?e(ee):n.field.kind===`toggle`?e(M,1):n.field.kind===`select`?e(te,2):n.field.kind===`color`?e(P,3):n.field.kind===`list`?e(re,4):n.field.kind===`code`?e(ie,5):n.field.kind===`image`?e(F,6):e(ae,-1)}),X(e,k),ue()}ge([`change`,`click`,`keydown`]);var Dut=V(`<button class="hud-pal-item svelte-lotxeq" draggable="true"><!> <span> </span></button>`),Out=V(`<p class="hud-pal-group svelte-lotxeq"><span class="hud-pal-dot svelte-lotxeq"></span> </p> <!>`,1),kut=V(`<p class="hud-pal-hint svelte-lotxeq"> </p>`),Aut=V(`<div id="hud-palette" class="hud-pal svelte-lotxeq"><input id="hud-palette-filter" class="hud-pal-filter svelte-lotxeq" placeholder="Filter elementsâ¦"/> <p class="hud-pal-hint svelte-lotxeq">Drag onto the board, or click to add it.</p> <!> <!></div>`);function jut(e,n){Ce(n,!0);let r={Display:`#38bdf8`,Input:`#f0abfc`,Layout:`#4ade80`},i=t(``),a=q(()=>fu().map(e=>({...e,items:e.items.filter(t=>!Q(i).trim()||(t.label+` `+t.key+` `+e.group).toLowerCase().includes(Q(i).trim().toLowerCase()))})).filter(e=>e.items.length>0));var o=Aut(),s=j(o);v(s);var c=g(s,4);B(c,17,()=>Q(a),e=>e.group,(e,t)=>{var i=Out(),a=N(i),o=j(a),s=g(o);H(a);var c=g(a,2);B(c,17,()=>Q(t).items,e=>e.key,(e,t)=>{var r=Dut(),i=j(r);wS(i,{get name(){return Q(t).icon},size:13});var a=g(i,2),o=f(a,!0);H(r),O(()=>{b(r,`data-hud-kind`,Q(t).key),b(r,`title`,Q(t).summary),Y(o,Q(t).label)}),Z(`dragstart`,r,e=>e.dataTransfer?.setData(`application/x-hud-kind`,Q(t).key)),L(`click`,r,()=>n.onPick(Q(t).key)),X(e,r)}),O(()=>{Ze(o,`background: ${r[Q(t).group]??`#94a3b8`??``}`),Y(s,` ${Q(t).group??``}`)}),X(e,i)});var l=g(c,2),d=e=>{var t=kut(),n=f(t);O(()=>Y(n,`No element matches â${Q(i)??``}â.`)),X(e,t)};G(l,e=>{Q(a).length||e(d)}),H(o),O(()=>u(s,Q(i))),L(`input`,s,e=>I(i,e.currentTarget.value,!0)),X(e,o),ue()}ge([`input`,`click`]);var z5={text:`hudtext`,bar:`hudbar`,timer:`hudtimer`,list:`hudlist`,iconrow:`hudbar`,progressradial:`hudbar`,hotbar:`hudbar`,richtext:`hudtext`,keyhint:`hudtext`,scrollpanel:`hudtext`,custom:`hudtext`},B5=`hudbutton`,Mut=[`button`,`toggle`],V5=`hudinput`,H5=[B5,V5,`hudset`,`hudtext`,`hudbar`,`hudtimer`,`hudlist`,`hudrows`,`hudscreen`,`leaderboard`],Nut=[`list`],U5=[{key:`start`,label:`Start the game`,group:`Game`,role:`press`,node:`setgamestate`,data:{state:`playing`},handle:`trigger`,hint:`Every peer enters play; a Game Start node decides which camera.`},{key:`pause`,label:`Pause`,group:`Game`,role:`press`,node:`setgamestate`,data:{state:`paused`},handle:`trigger`},{key:`resume`,label:`Resume`,group:`Game`,role:`press`,node:`setgamestate`,data:{state:`playing`},handle:`trigger`},{key:`gameover`,label:`End the game`,group:`Game`,role:`press`,node:`setgamestate`,data:{state:`over`},handle:`trigger`},{key:`menu`,label:`Back to the menu`,group:`Game`,role:`press`,node:`setgamestate`,data:{state:`menu`},handle:`trigger`},{key:`resetgame`,label:`Reset the game`,group:`Game`,role:`press`,node:`setgamestate`,data:{state:`menu`,reset:!0},handle:`trigger`,hint:`Back to the menu AND the round clock to zero â collectibles read un-collected again.`},{key:`setvar`,label:`Set a variable`,group:`Game`,role:`press`,node:`setvariable`,data:{name:`score`,op:`add`,value:1},handle:`trigger`,hint:`Add to, subtract from or set a shared number.`},{key:`savebest`,label:`Save best score`,group:`Game`,role:`press`,node:`storevalue`,data:{key:`best`,mode:`max`},handle:`trigger`,via:{node:`getvariable`,data:{name:`score`},handle:`value`},hint:`Keeps the highest âscoreâ seen on this device (Store Value, max) â each player keeps their own.`},{key:`travel`,label:`Level complete â travel to a level`,group:`Game`,role:`press`,node:`travel`,handle:`trigger`,hint:`Everyone travels together, the game state carries â pick the destination on the Travel card.`},{key:`camera`,label:`Look through a camera`,group:`Camera`,role:`press`,node:`setcamera`,handle:`trigger`,hint:"Moves each peer`s own view â nothing is sent, the press already was."},{key:`showscreen`,label:`Show a HUD screen`,group:`HUD`,role:`press`,node:`hudscreen`,data:{action:`show`},handle:`trigger`},{key:`hidescreen`,label:`Hide a HUD screen`,group:`HUD`,role:`press`,node:`hudscreen`,data:{action:`hide`},handle:`trigger`},{key:`togglescreen`,label:`Toggle a HUD screen`,group:`HUD`,role:`press`,node:`hudscreen`,data:{action:`toggle`},handle:`trigger`},{key:`count`,label:`Count the presses`,group:`Scene`,role:`press`,node:`counter`,data:{step:1,op:`up`},handle:`pulse`,hint:`A Counter you can then show in a HUD Text.`},{key:`playanim`,label:`Play an animation`,group:`Scene`,role:`press`,node:`playanim`,data:{action:`toggle`,speed:1},handle:`trigger`,hint:`Toggle plays the clip and plays it BACKWARDS to close - wire an Object Selector or put it in the objectâs own graph.`}
2500,{key:`sound`,label:`Play a sound`,group:`Scene`,role:`press`,node:`sound`,data:{},handle:`trigger`,hint:`One shot per press (E4 gave sound a trigger input).`},{key:`particles`,label:`Fire particles`,group:`Scene`,role:`press`,node:`particle`,data:{mode:`burst`},handle:`trigger`},{key:`impulse`,label:`Apply an impulse`,group:`Scene`,role:`press`,node:`impulse`,data:{mode:`impulse`,space:`world`},handle:`trigger`,hint:`Needs a running physics sim and a wired target object.`},{key:`resetcounter`,label:`Reset a counter`,group:`Game`,role:`press`,node:`counter`,data:{op:`up`,step:1},handle:`reset`,hint:`Zeroes the counter this press reaches - round 2 starts clean.`},{key:`togglevis`,label:`Toggle an object's visibility`,group:`Scene`,role:`press`,node:``,chain:[{node:`latch`,handle:`toggle`,data:{initial:!0}},{node:`visibility`,handle:`on`},{node:`objectselector`}],hint:`Uses a Latch, so the state persists - press to hide, press to show.`},{key:`showvar`,label:`Show a variable`,group:`Data`,role:`drives`,node:``,via:{node:`getvariable`,data:{name:`score`},handle:`value`},hint:`A shared number â a score, lives, a level.`},{key:`showtime`,label:`Show the round time`,group:`Data`,role:`drives`,node:``,via:{node:`gametime`,data:{read:`remaining`,length:60},handle:`value`},hint:`Derived from the shared start stamp, so every peer agrees.`},{key:`showcount`,label:`Show a counter`,group:`Data`,role:`drives`,node:``,via:{node:`counter`,data:{step:1,op:`up`},handle:`value`},hint:`Wire anything that pulses into the Counter to make it a score.`},{key:`showplain`,label:`Just show text`,group:`Data`,role:`drives`,node:``,hint:`A HUD Text node with no source, so a graph can drive it later.`},{key:`leaderboard`,label:`Show a leaderboard`,group:`Data`,role:`writes`,node:`leaderboard`,data:{variable:`laps`,order:`desc`},hint:`One row per player, from their own per-player variable â derived on every peer, so nothing is sent.`},{key:`readvalue`,label:`Read its value`,group:`Data`,role:`value`,node:``,data:{read:`value`},hint:`A HUD Input node you can wire into anything - a Map Range, a Compare, a variable.`},{key:`readindex`,label:`Read which option`,group:`Data`,role:`value`,node:``,data:{read:`index`},hint:`The position in the option list - what a Switcher wants.`},{key:`readtext`,label:`Read its text`,group:`Data`,role:`value`,node:``,data:{read:`text`},hint:`The typed text, for a name or a room code.`}];function W5(){let e=Tte();return e.length?[...U5,...e]:U5}function G5(e){let t=Mut.includes(e)&&cu(e),n=z5[e],r=Nte(e);return W5().filter(i=>i.role===`press`?t:i.role===`value`?r:i.role===`writes`?Nut.includes(e):!!n)}function K5(e){let t=[];for(let n of G5(e)){let e=t.find(e=>e.group===n.group);e||t.push(e={group:n.group,items:[]}),e.items.push(n)}return t}function q5(){let e=U(Dc)[Fc];return{nodes:e?.nodes??[],edges:e?.edges??[]}}function J5(e,t=null){let n=e?.data??{};switch(e?.type){case`hudrows`:return(n.op===`clear`?`Clear the rows of `:n.op===`set`?`Set the rows of `:`Add a row to `)+(n.element||`an element`);case`setgamestate`:return n.reset?`Reset the game`:`Set game state â `+(n.state??`playing`)+(n.outcome?` (`+n.outcome+`)`:``);case`setcamera`:return`Look through a camera`+(n.camera?``:` (none picked)`);case`setvariable`:return(n.op===`add`?`Add to`:n.op===`subtract`?`Subtract from`:`Set`)+` â`+(n.name??``)+`â`+(n.scope===`player`?` (this playerâs own)`:``);case`peervariable`:return`Player variable â`+(n.name??``)+`â (`+(n.read===`sum`?`everyoneâs total`:n.read===`max`?`the highest`:n.read===`peer`?`one peer`:`mine`)+`)`;case`leaderboard`:return`Leaderboard of â`+(n.variable??``)+`â`;case`hudscreen`:return(n.action??`show`)===`hide`&&!n.screen?`Hide the current screen`:(n.action??`show`)+` screen â`+(n.screen??``)+`â`;case`counter`:return t===`reset`?`Reset counter`:`Count it`;case`playanim`:return`Play animation (`+(n.action??`toggle`)+`)`;case`sound`:return`Play a sound`;case`particle`:return`Fire particles`;case`impulse`:return`Apply an impulse`;case`latch`:return`Latch (persistent on/off)`;case`visibility`:return`Show/hide an object`;case`delay`:return`After `+(n.seconds??1)+`s`;case`sequence`:return`Step sequence`;case`once`:return`Only once`;case`getvariable`:return`Variable â`+(n.name??``)+`â`;case`storevalue`:return`Save â`+(n.key??``)+`â on this device (`+(n.mode??`set`)+`)`;case`storedvalue`:return`Saved â`+(n.key??``)+`â (this device)`;case`gametime`:return`Round time (`+(n.read??`elapsed`)+`)`;case`hudtext`:return`Text`+(n.format&&n.format!==`{v}`?` â`+n.format+`â`:``);case`hudbar`:return`Bar`;case`hudtimer`:return`Timer`;case`hudlist`:return`List`;case`hudinput`:return`Reads its `+(n.read??`value`);case`hudset`:return`Sets it to `+(n.value??0);default:return ed(e?.type)?.label??n.label??String(e?.type??`node`)}}function Y5(e){if(!e)return[];let{nodes:t,edges:n}=q5(),r=[];for(let i of t)if(H5.includes(i.type)&&String(i.data?.element??``)===String(e)){if(i.type===B5||i.type===V5){let e=n.filter(e=>
2500e.source===i.id),a=i.type===V5?`value`:`press`;e.length||r.push({role:a,hudNodeId:i.id,actionNodeId:null,label:a===`value`?`Read, not wired yet`:`Nothing yet`,source:``});for(let n of e){let e=t.find(e=>e.id===n.target);r.push({role:a,hudNodeId:i.id,actionNodeId:e?.id??null,label:e?J5(e,n.targetHandle??null):`a deleted node`,source:``})}}else{let e=n.find(e=>e.target===i.id&&e.targetHandle===`value`),a=e?t.find(t=>t.id===e.source):null;r.push({role:`drives`,hudNodeId:i.id,actionNodeId:a?.id??null,label:J5(i),source:a?J5(a):``})}}return r}function Put(e){return Y5(e).length>0}function X5(){let{nodes:e}=q5(),t=new Set;for(let n of e){if(!H5.includes(n.type))continue;let e=String(n.data?.element??``);e&&t.add(e)}return t}var Z5=0;function Fut(e){return Z5++,`hud-`+e+`-`+Z5.toString(36)+`-`+Math.floor(Math.random()*1e6).toString(36)}function Iut(e,t){let n=ed(e);return{label:n?.label??e,type:e,...n?.defaults??{},...t??{}}}function Q5(e,t,n,r){return{id:Fut(e),type:e,position:{x:t,y:n},data:Iut(e,r),class:`w-[150px]`}}function $5(e,t,n){return{id:`e-`+e.id+`-`+t.id+(n?`.`+n:``),source:e.id,target:t.id,...n?{targetHandle:n}:{}}}function e7(e,t){let n=W5().find(e=>e.key===t);if(!n||!e)return{ok:!1,reason:`unknown action`,nodes:[]};let{nodes:r}=q5(),i=U(Es),a=[],o=[],s=Ree(r,{side:`right`}).x,c=40+Y5(e).length*150;if(n.role===`value`){let t=String(n.data?.read??`value`);if(r.find(n=>n.type===V5&&String(n.data?.element??``)===String(e)&&String(n.data?.read??`value`)===t))return{ok:!1,reason:`that value is already read`,nodes:[]};a.push(Q5(V5,s,c,{element:e,...n.data}))}else if(n.role===`writes`){if(r.find(t=>t.type===n.node&&String(t.data?.element??``)===String(e)))return{ok:!1,reason:`that element already has one`,nodes:[]};a.push(Q5(n.node,s,c,{element:e,...n.data}))}else if(n.role===`press`){let t=r.find(t=>t.type===B5&&String(t.data?.element??``)===String(e));if(t||(t=Q5(B5,s,c,{element:e}),a.push(t)),n.chain?.length){let e=t,r=1;for(let t of n.chain){let n={...t.data??{}};if(t.node===`objectselector`&&!n.selected){let e=U(Kr)[0];e&&(n.selected=e)}let i=Q5(t.node,s+r*220,c,n);a.push(i),o.push($5(e,i,t.handle)),e=i,r++}}else{let e=Q5(n.node,s+220,c,n.data);if(a.push(e),o.push($5(t,e,n.handle)),n.via){let t=Q5(n.via.node,s,c+120,n.via.data);a.push(t),o.push($5(t,e,n.via.handle))}}}else{let t=z5[String(n.role===`drives`?Lut(e):``)]??`hudtext`,i=r.find(n=>n.type===t&&String(n.data?.element??``)===String(e));if(i||(i=Q5(t,s+220,c,{element:e}),a.push(i)),n.via){let e=Q5(n.via.node,s,c,n.via.data);a.push(e),o.push($5(e,i,n.via.handle))}}if(!a.length&&!o.length)return{ok:!1,reason:`already bound`,nodes:[]};for(let e of a)$l(e,Fc),i&&i.send({type:`nodecreate`,node:iu(e),graphId:Fc});for(let e of o)tu(e,Fc),i&&i.send({type:`edgecreate`,edge:eu(e),graphId:Fc});return Qv({op:`create`,graphId:Fc,nodes:a.map(iu),edges:o.map(eu)}),{ok:!0,nodes:a}}var t7=()=>`text`;function n7(e){t7=e}function Lut(e){try{return t7(e)||`text`}catch{return`text`}}function r7(e){let{nodes:t,edges:n}=q5(),r=U(Es),i=[];e.actionNodeId&&i.push(e.actionNodeId),n.filter(t=>(t.source===e.hudNodeId||t.target===e.hudNodeId)&&t.source!==e.actionNodeId&&t.target!==e.actionNodeId).length||i.push(e.hudNodeId);let a=n.filter(e=>i.includes(e.source)||i.includes(e.target)),o=t.filter(e=>i.includes(e.id));return o.length?($(()=>import(`../chunks/y5Xg-5h5.js`).then(e=>e.u).then(e=>{e.deleteFlowEdges(a.map(e=>e.id),Fc),e.deleteFlowNodes(i,Fc)}),__vite__mapDeps([55,1,2,6,5,3,7]),import.meta.url),r&&(r.send({type:`edgedelete`,ids:a.map(e=>e.id),graphId:Fc}),r.send({type:`nodedelete`,ids:i,graphId:Fc})),Qv({op:`delete`,graphId:Fc,nodes:o.map(iu),edges:a.map(eu)}),!0):!1}var Rut=V(`<div class="ha-row svelte-10qmart"><span class="ha-role svelte-10qmart"> </span> <span class="ha-label svelte-10qmart"> </span> <button class="ha-btn svelte-10qmart" title="Show this node in the node editor" aria-label="Show in the node editor"><!></button> <button class="ha-btn ha-danger svelte-10qmart" title="Unbind" aria-label="Unbind"><!></button></div>`),zut=V(`<div class="ha-list svelte-10qmart"></div>`),But=V(`<p class="hud-note"><!></p>`),Vut=V(`<button id="hud-add-action" class="ha-add svelte-10qmart"><!> Add action</button>`),Hut=V(`<p class="hud-note">This kind has no actions of its own. Wire it in the node editor.</p>`),Uut=V(`<p class="hud-sec-head">Actions</p> <!> <!> <!>`,1);function Wut(e,n){Ce(n,!0);let r=()=>z(Dc,`$flowGraphs`,i),[i,a]=Ve(),o=(e,t)=>Y5(e),s=q(()=>
2500n.element?.id?o(n.element.id,r()):[]),c=q(()=>cu(n.element?.kind??``)),l=q(()=>K5(n.element?.kind??``)),u=t(null);function d(e){let t=e.currentTarget.getBoundingClientRect();if(!Q(l).length){es(`This element kind has no actions of its own â wire it in the node editor.`);return}I(u,{x:Math.round(t.left),y:Math.round(t.bottom+4),items:[{header:{title:(n.element?.label||n.element?.id)??`element`}},{label:`Search actionsâ¦`,revealFilter:!0},...Q(l).map(e=>({label:e.group,children:e.items.map(e=>({label:e.label,tooltip:e.hint,action:()=>p(e.key)}))}))]},!0)}function p(e){let t=e7(n.element.id,e);t.ok||es(t.reason===`already bound`?`That is already wired up.`:`Could not add that action.`)}function m(e){r7(e)||es(`Nothing to remove.`)}var h=Uut(),_=g(N(h),2),v=e=>{var t=zut();B(t,23,()=>Q(s),(e,t)=>e.hudNodeId+`:`+(e.actionNodeId??t),(e,t)=>{var n=Rut(),r=j(n),i=f(r,!0),a=g(r,2),o=f(a,!0),s=g(a,2),c=j(s);Jx(c,{size:11,"aria-hidden":`true`}),H(s);var l=g(s,2),u=j(l);SS(u,{size:11,"aria-hidden":`true`}),H(l),H(n),O(()=>{Y(i,Q(t).role===`press`?`On press`:`Driven by`),b(a,`title`,Q(t).label),Y(o,Q(t).role===`drives`&&Q(t).source?Q(t).source:Q(t).label)}),L(`click`,s,()=>fc(Q(t).actionNodeId??Q(t).hudNodeId)),L(`click`,l,()=>m(Q(t))),X(e,n)}),H(t),X(e,t)},y=e=>{var t=But(),n=j(t),r=e=>{var t=Te(`Nothing happens when this is pressed yet.`);X(e,t)},i=e=>{var t=Te(`Nothing drives this element yet â it shows its own text.`);X(e,t)};G(n,e=>{Q(c)?e(r):e(i,-1)}),H(t),X(e,t)};G(_,e=>{Q(s).length?e(v):e(y,-1)});var x=g(_,2),S=e=>{var t=Vut(),n=j(t);rS(n,{size:12,"aria-hidden":`true`}),W(),H(t),L(`click`,t,d),X(e,t)},C=e=>{var t=Hut();X(e,t)};G(x,e=>{Q(l).length?e(S):e(C,-1)});var w=g(x,2),T=e=>{xS(e,{get x(){return Q(u).x},get y(){return Q(u).y},get items(){return Q(u).items},sizeKey:`hud-actions`,onclose:()=>I(u,null)})};G(w,e=>{Q(u)&&e(T)}),X(e,h),ue(),a()}ge([`click`]);var i7=[{key:`align-left`,label:`Align left`,hint:`Left edges meet the leftmost one`,group:`Align`,min:2},{key:`align-hcenter`,label:`Align centres horizontally`,hint:`Centres meet the middle of the selection`,group:`Align`,min:2},{key:`align-right`,label:`Align right`,hint:`Right edges meet the rightmost one`,group:`Align`,min:2},{key:`align-top`,label:`Align top`,hint:`Top edges meet the topmost one`,group:`Align`,min:2},{key:`align-vcenter`,label:`Align centres vertically`,hint:`Centres meet the middle of the selection`,group:`Align`,min:2},{key:`align-bottom`,label:`Align bottom`,hint:`Bottom edges meet the lowest one`,group:`Align`,min:2},{key:`distribute-h`,label:`Distribute horizontally`,hint:`Equal gaps left to right; the outer two stay put`,group:`Arrange`,min:3},{key:`distribute-v`,label:`Distribute vertically`,hint:`Equal gaps top to bottom; the outer two stay put`,group:`Arrange`,min:3},{key:`equalize`,label:`Equalize size`,hint:`Every selected element takes the FIRST one's width and height`,group:`Arrange`,min:2}],a7=i7.reduce((e,t)=>e.includes(t.group)?e:[...e,t.group],[]);function o7(e){return i7.find(t=>t.key===e)??null}var s7=e=>Math.round(e);function c7(e,t){let n=o7(e),r={};if(!n||!Array.isArray(t)||t.length<n.min)return r;let i=t.map(e=>e.rect),a=Math.min(...i.map(e=>e.left)),o=Math.max(...i.map(e=>e.left+e.w)),s=Math.min(...i.map(e=>e.top)),c=Math.max(...i.map(e=>e.top+e.h));function l(e,t){let n={...e.rect,...t};(s7(n.left)!==s7(e.rect.left)||s7(n.top)!==s7(e.rect.top)||s7(n.w)!==s7(e.rect.w)||s7(n.h)!==s7(e.rect.h))&&(r[e.id]={left:s7(n.left),top:s7(n.top),w:s7(n.w),h:s7(n.h)})}switch(n.key){case`align-left`:for(let e of t)l(e,{left:a});break;case`align-hcenter`:{let e=(a+o)/2;for(let n of t)l(n,{left:e-n.rect.w/2});break}case`align-right`:for(let e of t)l(e,{left:o-e.rect.w});break;case`align-top`:for(let e of t)l(e,{top:s});break;case`align-vcenter`:{let e=(s+c)/2;for(let n of t)l(n,{top:e-n.rect.h/2});break}case`align-bottom`:for(let e of t)l(e,{top:c-e.rect.h});break;case`distribute-h`:{let e=[...t].sort((e,t)=>e.rect.left-t.rect.left||(e.id<t.id?-1:1)),n=e.reduce((e,t)=>e+t.rect.w,0),r=(o-a-n)/(e.length-1),i=a;for(let t of e)l(t,{left:i}),i+=t.rect.w+r;break}case`distribute-v`:{let e=[...t].sort((e,t)=>
2500e.rect.top-t.rect.top||(e.id<t.id?-1:1)),n=e.reduce((e,t)=>e+t.rect.h,0),r=(c-s-n)/(e.length-1),i=s;for(let t of e)l(t,{top:i}),i+=t.rect.h+r;break}case`equalize`:{let e=t[0].rect;for(let n of t)l(n,{w:e.w,h:e.h});break}}return r}function l7(e,t){let n=Math.min(t.x0,t.x1),r=Math.max(t.x0,t.x1),i=Math.min(t.y0,t.y1),a=Math.max(t.y0,t.y1);return e.left<r&&e.left+e.w>n&&e.top<a&&e.top+e.h>i}var Gut=V(`<span class="hud-sep svelte-p7bw2d"></span>`),Kut=V(`<!> <button class="hud-btn svelte-p7bw2d"><!></button>`,1),qut=V(`<div class="flex flex-wrap items-center gap-1.5"><button id="hud-tool-select" class="hud-btn svelte-p7bw2d" aria-label="Select tool" title="Select â click an element to pick it, drag it to move it, Shift to add"><!></button> <button id="hud-tool-marquee" class="hud-btn svelte-p7bw2d" aria-label="Multi-select tool" title="Multi-select â drag a box on the board to select everything it touches (Shift adds to the selection)"><!></button> <span class="hud-sep svelte-p7bw2d"></span> <!> <span class="hud-sep svelte-p7bw2d"></span> <button class="hud-btn svelte-p7bw2d" title="Duplicate (Ctrl+D)"><!></button> <button class="hud-btn hud-danger svelte-p7bw2d" title="Delete (Del)"><!></button> <span class="hud-sep svelte-p7bw2d"></span> <label class="hud-check svelte-p7bw2d"><input type="checkbox"/> Snap</label> <span class="flex-1"></span> <button id="hud-preview-toggle" class="hud-btn svelte-p7bw2d"><!></button> <span id="hud-stage-ref" class="hud-hint svelte-p7bw2d"><!> </span> <span class="hud-hint svelte-p7bw2d"> </span></div>`),u7=V(`<option> </option>`),Jut=V(`<label class="hud-showwhile svelte-p7bw2d" title="Show this screen automatically while the game is in this state"><span class="svelte-p7bw2d">while</span> <select class="hud-input svelte-p7bw2d"><option>only when asked</option><!></select></label> <label class="hud-showwhile svelte-p7bw2d" title="Game: the pointer stays locked and this screen is a readout. Menu: while this screen is visible in play mode the pointer is FREED and movement pauses, so the player can click it; hiding it re-locks."><span class="svelte-p7bw2d">input</span> <select class="hud-input svelte-p7bw2d"><option>game</option><option>menu</option></select></label>`,1),Yut=V(`<div><button class="hud-screen-name svelte-p7bw2d"> <span class="hud-hint svelte-p7bw2d"> </span></button> <button class="hud-mini svelte-p7bw2d">â </button> <button class="hud-mini hud-danger svelte-p7bw2d" title="Delete screen">â</button></div> <!>`,1),Xut=V(`<div class="hud-side svelte-p7bw2d"><label class="hud-doc-pick svelte-p7bw2d" title="A camera HUD shows only while you look through that camera"><!> <select id="hud-doc-key" class="hud-input svelte-p7bw2d"><option>Scene HUD</option><!></select></label> <div class="hud-screens svelte-p7bw2d"><!> <button class="hud-add-screen svelte-p7bw2d">ï¼ Screen</button> <p class="hud-note svelte-p7bw2d">A screen shows per PEER: one player can sit on the menu while another plays. â marks 2501 the one everyone starts on â un-star it and nothing shows until a node, a game state 2502 or this peer asks for a screen.</p></div> <div id="hud-screens-resize" style="touch-action: none" title="Drag to resize the screens list"></div> <div class="hud-side-scroll svelte-p7bw2d"><!></div></div>`),Zut=V(`<span class="hud-unknown-tag svelte-p7bw2d"> </span>`),Qut=V(`<span class="hud-wired svelte-p7bw2d" title="Something is wired to this element"></span>`),$ut=V(`<div><!> <!></div>`),edt=V(`<div class="hud-guide hud-guide-v svelte-p7bw2d" data-hud-guide="x"></div>`),tdt=V(`<div class="hud-guide hud-guide-h svelte-p7bw2d" data-hud-guide="y"></div>`),ndt=V(`<div id="hud-marquee" class="hud-marquee svelte-p7bw2d"></div>`),rdt=V(`<div id="hud-drop-cue" class="hud-drop-cue svelte-p7bw2d"></div>`),idt=V(`<div class="hud-size-grip svelte-p7bw2d" title="Drag to resize"></div>`),adt=V(`<div id="hud-board-wrap" class="hud-board-wrap svelte-p7bw2d" tabindex="-1"><div class="hud-board-fit svelte-p7bw2d"><div id="hud-board"><div id="hud-stage" class="hud-stage svelte-p7bw2d"></div> <div id="hud-viewport-ghost"></div> <!> <!> <!> <!> <!></div></div></div>`),odt=V(`<p class="hud-arm svelte-p7bw2d">Click an element on the artboard to bind it. Esc cancels.</p>`),sdt=V(`<p class="hud-note svelte-p7bw2d"> </p> <p class="hud-sec-head svelte-p7bw2d">Snapping</p> <label class="hud-field svelte-p7bw2d" title="Snap to the grid, the stage centre lines and other elements' edges"><span class="svelte-p7bw2d">snap</span> <span class="hud-field-ctl svelte-p7bw2d"><input id="hud-snap-on" type="checkbox"/></span></label> <!> <!> <p class="hud-sec-head svelte-p7bw2d">This HUD</p> <p class="hud-note svelte-p7bw2d" id="hud-doc-readout"> </p> <p class="hud-note svelte-p7bw2d"> </p>`,1),cdt=V(`<p class="hud-note svelte-p7bw2d"> </p>`),ldt=V(`<p class="hud-sec-head svelte-p7bw2d"> </p> <!>`,1),udt=V(`<p class="hud-sec-head svelte-p7bw2d">Style</p> <!>`,1),ddt=V(`<label class="hud-field svelte-p7bw2d"><span class="svelte-p7bw2d">id</span><input class="hud-input svelte-p7bw2d" readonly=""/></label> <label class="hud-field svelte-p7bw2d"><span class="svelte-p7bw2d">kind</span> <select class="hud-input svelte-p7bw2d"><!><!></select></label> <!> <!> <label class="hud-field svelte-p7bw2d"><span class="svelte-p7bw2d">anchor</span> <select class="hud-input svelte-p7bw2d"></select></label> <!> <!> <!> <!> <!> <!> <!> <p class="hud-note svelte-p7bw2d">A colour may be a theme token name (accent, surface) or a literal. Tokens fall back 2503 to a literal, so a custom theme cannot leave it unpainted.</p>`,1),fdt=V(`<div class="flex flex-col gap-1.5 p-2 text-xs"><!> <!></div>`),pdt=V(`<div id="hud-dock"><div class="resize-cue absolute -top-1 left-0 right-0 z-30 h-2 cursor-ns-resize hover:bg-primary-600/30" style="touch-action: none" title="Drag to resize"></div> <!> <div class="flex shrink-0 items-center gap-2 pb-1"><span class="text-xs font-semibold text-gray-200">HUD editor</span> <span class="flex-1"></span> <button class="ui-button-quiet" title="Undock into a floating window">â§</button> <button class="ui-button-quiet" title="Close">â</button></div> <div class="flex min-h-0 flex-1 flex-col"><!></div></div>`),mdt=V(`<div id="hud-window" class="ui-panel fixed flex flex-col overflow-hidden"><div class="ui-panel-header move-handle shrink-0 cursor-move select-none py-1.5"><span>HUD editor</span> <span class="text-[11px] font-normal text-gray-400"> </span> <span class="flex-1"></span> <button class="ui-button-quiet" title="Dock to the bottom">â© Dock</button> <button class="ui-button-quiet" title="Close">â</button></div> <div class="flex min-h-0 flex-1 flex-col"><!></div> <div class="resize-cue absolute bottom-0 right-0 z-10 h-3.5 w-3.5 cursor-se-resize rounded-tl bg-gray-500/40" style="touch-action: none" title="Drag to resize · double-click to reset size"></div></div>`),hdt=V(`<!> <!>`,1);function gdt(e,n){Ce(n,!0);let i=()=>z(Ui,`$objectsGroup`,E),o=()=>z(wu,`$hudDocs`,E),s=()=>z(Ad,`$dockModeArm`,E),c=()=>z(Qh,`$tabGroups`,E),l=()=>z(fs,`$hudEditorClose`,E),d=()=>z(Md,`$dockHeight`,E),m=()=>z(Ld,`$visibleDockKey`,E),h=()=>z(Fd,`$dockMinimized`,E),y=()=>z(bu,`$hudPickArm`,E),x=()=>z(Dc,`$flowGraphDocs`,E),S=()=>z(ju,`$hudPreviewInViewport`,E),C=()=>z(Su,`$hudRuntime`,E),T=()=>z(ou,`$moduleHudKinds`,E),[E,k]=Ve(),A=e=>{We(k4(e,{key:`hud`,primaryLabel:`Screens`,secondaryModes:[{key:`props`,icon:`â`,label:`Properties`}],topbar:e=>{var t=qut(),n=j(t);mz(j(n),{size:14,"aria-hidden":`true`}),H(n);var r=g(n,2);Cz(j(r),{size:14,"aria-hidden":`true`}),H(r);var i=g(r,4);B(i,19,()=>i7,e=>e.key,(e,t,n)=>{let r=q(()=>yt[Q(t).key]);var i=Kut(),a=N(i),o=e=>{var t=Gut();X(e,t)};G(a,e=>{Q(n)>0&&i7[Q(n)-1].group!==Q(t).group&&e(o)});var s=g(a,2),c=j(s);
2503P(c,()=>Q(r),(e,t)=>{t(e,{size:14,"aria-hidden":`true`})}),H(s),O(()=>{b(s,`id`,`hud-arrange-${Q(t).key??``}`),b(s,`data-hud-arrange`,Q(t).key),s.disabled=Q(de).length<Q(t).min,b(s,`aria-label`,Q(t).label),b(s,`title`,`${Q(t).label??``} â ${Q(t).hint??``}${Q(de).length<Q(t).min?` (needs `+Q(t).min+` selected)`:``}`)}),L(`click`,s,()=>_t(Q(t).key)),X(e,i)});var a=g(i,4),o=j(a);oS(o,{size:14,"aria-hidden":`true`}),H(a);var s=g(a,2),c=j(s);SS(c,{size:14,"aria-hidden":`true`}),H(s);var l=g(s,4),u=j(l);v(u),W(),H(l);var d=g(l,4),p=j(d),m=e=>{Wx(e,{size:14,"aria-hidden":`true`})},h=e=>{aS(e,{size:14,"aria-hidden":`true`})};G(p,e=>{S()?e(m):e(h,-1)}),H(d);var _=g(d,2),y=j(_),x=e=>{var t=Te();O(()=>Y(t,`ð· ${(Q(ie).name||`Camera`)??``} ·`)),X(e,t)};G(y,e=>{Q(ie)&&e(x)});var C=g(y);H(_);var T=g(_,2),E=f(T);H(t),O(()=>{b(n,`aria-pressed`,Q(lt)===`select`),b(r,`aria-pressed`,Q(lt)===`marquee`),a.disabled=!Q(de).length,s.disabled=!Q(de).length,w(u,Q(et)),b(d,`aria-pressed`,S()),b(d,`title`,S()?`Hide the HUD in the viewport while editing`:`Also show the HUD in the viewport`),b(_,`title`,`Positions are pixels against this reference stage. Your window is ${Q(He)??``}Ã${Q(Ue)??``}; the dashed outline on the board is its shape.`),Y(C,` ${Q(Pe).w??``}Ã${Q(Pe).h??``}`),Y(E,`${Q(ce).length??``} element${Q(ce).length===1?``:`s`}`)}),L(`click`,n,()=>I(lt,`select`)),L(`click`,r,()=>I(lt,`marquee`)),L(`click`,a,Pt),L(`click`,s,()=>{_u(Q(M),Q(R),Q(de)),me([])}),L(`change`,u,e=>I(et,e.currentTarget.checked,!0)),L(`click`,d,()=>ju.set(!S())),X(e,t)},primary:e=>{var t=Xut(),n=j(t),i=j(n);CS(i,{size:12,"aria-hidden":`true`});var a=g(i,2),o=j(a),s={},c=g(o);B(c,17,()=>Q(re),e=>e.uuid,(e,t)=>{var n=u7(),r=f(n,!0),i={};O(()=>{Y(r,Q(t).name||`Camera`),i!==(i=Q(t).uuid)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(a);var l;_(a),H(n);var u=g(n,2),d=j(u);B(d,17,()=>Q(oe),e=>e.id,(e,t)=>{var n=Yut(),i=N(n);let a;var o=j(i),s=j(o),c=g(s),l=f(c,!0);H(o);var u=g(o,2),d=g(u,2);H(i);var p=g(i,2),m=e=>{var n=Jut(),r=N(n),i=g(j(r),2),a=j(i);a.value=a.__value=``;var o=g(a);B(o,16,()=>$c,e=>e,(e,t)=>{var n=u7(),r=f(n,!0),i={};O(()=>{Y(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(i);var s;_(i),H(r);var c=g(r,2),l=g(j(c),2),u=j(l);u.value=u.__value=`game`;var d=g(u);d.value=d.__value=`menu`,H(l);var p;_(l),H(c),O(()=>{s!==(s=Q(t).showWhile??``)&&(i.value=(i.__value=s)??``,D(i,s)),b(l,`id`,`hud-screen-input-${Q(t).id??``}`),p!==(p=Q(t).input??`game`)&&(l.value=(l.__value=p)??``,D(l,p))}),L(`change`,i,e=>It(Q(t).id,e.currentTarget.value)),L(`change`,l,e=>Ft(Q(t).id,e.currentTarget.value)),X(e,n)};G(p,e=>{Q(t).id===Q(R)&&e(m)}),O(()=>{a=r(i,1,`hud-screen-row svelte-p7bw2d`,null,a,{"hud-screen-on":Q(t).id===Q(R)}),Y(s,`${Q(t).name??``} `),Y(l,Q(t).elements.length),b(u,`data-hud-star`,Q(t).id),b(u,`title`,Q(ae)?.active===Q(t).id?`The default screen everyone starts on â click to un-star it, and then nothing shows until a node, a game state or a peer asks for a screen`:`Make this the default screen everyone starts on`),b(u,`aria-pressed`,Q(ae)?.active===Q(t).id)}),L(`click`,o,()=>{I(R,Q(t).id,!0),me(Q(le)[Q(t).id]??[])}),L(`click`,u,()=>qte(Q(M),Q(ae)?.active===Q(t).id?``:Q(t).id)),L(`click`,d,()=>Rt(Q(t).id)),X(e,n)});var p=g(d,2);W(2),H(u);var m=g(u,2);let h;var v=g(m,2);jut(j(v),{onPick:Ot}),H(v),H(t),O(()=>{s!==(s=`scene`)&&(o.value=(o.__value=s)??``),l!==(l=Q(M))&&(a.value=(a.__value=l)??``,D(a,l)),Ze(u,`max-height: ${Q(J)??``}px`),h=r(m,1,`hud-grip svelte-p7bw2d`,null,h,{"hud-grip-on":Q(De)})}),L(`change`,a,e=>{I(M,e.currentTarget.value,!0),me([])}),L(`click`,p,Lt),L(`pointerdown`,m,ke),L(`pointermove`,m,Ae),L(`pointerup`,m,je),ee(t,`clientHeight`,e=>I(Ee,e)),X(e,t)},main:e=>{var t=adt(),n=j(t),i=j(n);let a;var o=j(i);B(o,21,()=>Q(ce),e=>e.id,(e,t)=>{let n=q(()=>Je(Q(t)));var i=$ut();let a;var o=j(i),s=e=>{I5(e,{get element(){return Q(t)},get runtime(){return C()[Q(t).id]},editor:!0})},c=q(()=>du(Q(t).kind)),l=e=>{var n=Zut(),r=f(n);O(()=>Y(r,`${Q(t).kind??``}?`)),X(e,n)};G(o,e=>{Q(c)?e(s):e(l,-1)});var u=g(o,2),d=e=>{var t=Qut();X(e,t)},p=q(()=>Q(Ct).has(Q(t).id));G(u,e=>{Q(p)&&e(d)}),H(i),O((e,o)=>{a=r(i,1,`hud-item svelte-p7bw2d`,null,a,{"hud-item-on":e,"hud-item-unknown":o}),b(i,`data-hud-item`,Q(t).id),Ze(i,`left: ${Q(n).left??``}px; top: ${Q(n).top??``}px; width: ${Q(n).w??``}px; height: ${Q(n).h??``}px`)},[()=>Q(de).includes(Q(t).id),()=>!du(Q(t).kind)]),L(`dblclick`,i,()=>Bt(Q(t))),L(`pointerdown`,i,e=>ct(e,Q(t))),X(e,i)}),H(o);var s=g(o,2);let c;var l=g(s,2);B(l,17,()=>Q(rt).xs,Be,(e,t)=>{var n=edt();O(()=>Ze(n,`left: ${Q(t)*Q(ze)}px`)),X(e,n)});var u=g(l,2);B(u,17,()=>Q(rt).ys,Be,(e,t)=>{var n=tdt();O(()=>Ze(n,`top: ${Q(t)*Q(ze)}px`)),X(e,n)});var d=g(u,2),p=e=>{var t=ndt();O((e,n,r,i)=>Ze(t,`left: ${e??``}px; top: ${n??``}px; width: ${r??``}px; height: ${i??``}px`),[()=>Math.min(Q(ut).x0,Q(ut).x1)*Q(ze),()=>Math.min(Q(ut).y0,Q(ut).y1)*Q(ze),()=>Math.abs(Q(ut).x1-Q(ut).x0)*Q(ze),()=>Math.abs(Q(ut).y1-Q(ut).y0)*Q(ze)]),X(e,t)};G(d,e=>{Q(ut)&&e(p)});var m=g(d,2),h=e=>{var t=rdt();O(()=>Ze(t,`left: ${Q(kt).x*Q(ze)}px; top: ${Q(kt).y*Q(ze)}px`)),X(e,t)};G(m,e=>{Q(kt)&&e(h)});var _=g(m,2),v=e=>{let t=q(()=>Je(Q(pe))),n=q(()=>Et(Q(t)));var r=idt();O(()=>Ze(r,`left: ${Q(n).left??``}px; top: ${Q(n).top??``}px`)),L(`pointerdown`,r,e=>{e.stopPropagation(),e.button===0&&st.begin(e)}),X(e,r)};G(_,e=>{Q(pe)&&e(v)}),H(i),We(i,e=>I(Ie,e),()=>Q(Ie)),H(n),H(t),ne(t,e=>xt?.(e)),We(t,e=>I(Fe,e),()=>Q(Fe)),O(e=>{a=r(i,1,`hud-board svelte-p7bw2d`,null,a,{"hud-board-drop":!!Q(kt)}),Ze(i,`width: ${Q(Pe).w*Q(ze)}px; height: ${Q(Pe).h*Q(ze)}px`),Ze(o,`width: ${Q(Pe).w??``}px; height: ${Q(Pe).h??``}px; transform: scale(${Q(ze)??``}); --hud-inv: ${1/Q(ze)}`),c=r(s,1,`hud-ghost svelte-p7bw2d`,null,c,{"hud-ghost-same":Q(Ke).same}),b(s,`title`,`Your window is ${Q(He)??``}Ã${Q(Ue)??``} (${e??``}:1); the stage is ${Q(Pe).w??``}Ã${Q(Pe).h??``}`),Ze(s,`left: ${Q(Ke).left*Q(ze)}px; top: ${Q(Ke).top*Q(ze)}px; width: ${Q(Ke).w*Q(ze)}px; height: ${Q(Ke).h*Q(ze)}px`)},[()=>Q(Ge).toFixed(2)]),L(`pointerdown`,t,e=>
2503{e.currentTarget.focus(),e.button===0&&(Q(lt)===`marquee`?pt(e):me([]))}),Z(`dragover`,i,At),Z(`dragleave`,i,jt),Z(`drop`,i,Mt),X(e,t)},secondary:(e,t=qe)=>{var n=fdt(),r=j(n),i=e=>{var t=odt();X(e,t)};G(r,e=>{y()&&e(i)});var a=g(r,2),o=e=>{var t=sdt(),n=N(t),r=f(n,!0),i=g(n,4),a=g(j(i),2),o=j(a);v(o),H(a),H(i);var s=g(i,2);hq(s,{id:`hud-snap-grid`,label:`grid`,get value(){return Q($)},step:1,decimals:0,min:1,max:128,title:`Stage pixels between grid stops`,onchange:e=>I($,Math.max(1,Math.round(e)),!0)});var c=g(s,2);hq(c,{id:`hud-snap-threshold`,label:`pull`,get value(){return Q(tt)},step:1,decimals:0,min:0,max:64,title:`How close an edge has to be before a guide takes it`,onchange:e=>I(tt,Math.max(0,Math.round(e)),!0)});var l=g(c,4),u=f(l),d=g(l,2),p=f(d);O(()=>{Y(r,Q(de).length>1?Q(de).length+` elements selected â drag them together, or pick one to edit.`:`Select an element to edit it.`),w(o,Q(et)),Y(u,`${Q(ie)?`Camera: `+(Q(ie).name||`Camera`):`Scene HUD`} ⸠2504 ${(Q(se)?Q(se).name:`no screen`)??``} · ${Q(ce).length??``} element${Q(ce).length===1?``:`s`}`),Y(p,`Positions are pixels against a ${Q(Pe).w??``}Ã${Q(Pe).h??``} reference. Your window is 2505 ${Q(He)??``}Ã${Q(Ue)??``}${Q(Ke).same?` â the same shape`:`, a different shape`}; the dashed 2506 outline on the board is where that window ends.`)}),L(`change`,o,e=>I(et,e.currentTarget.checked,!0)),X(e,t)},s=e=>{var t=ddt(),n=N(t),r=g(j(n));v(r),H(n);var i=g(n,2),a=g(j(i),2),o=j(a);B(o,17,()=>jte,e=>e.key,(e,t)=>{var n=u7(),r=f(n,!0),i={};O(()=>{Y(r,Q(t).label),i!==(i=Q(t).key)&&(n.value=(n.__value=i)??``)}),X(e,n)});var s=g(o);B(s,1,T,e=>e.kind,(e,t)=>{var n=u7(),r=f(n),i={};O(()=>{Y(r,`${Q(t).label??``} · ${Q(t).moduleName??Q(t).moduleId??``}`),i!==(i=Q(t).kind)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(a);var c;_(a),H(i);var l=g(i,2),d=e=>{var t=cdt(),n=f(t,!0);O(e=>Y(n,e),[()=>lu(Q(pe).kind)?.summary]),X(e,t)},p=q(()=>lu(Q(pe).kind)?.summary);G(l,e=>{Q(p)&&e(d)});var m=g(l,2);Wut(m,{get element(){return Q(pe)}});var h=g(m,2),y=g(j(h),2);B(y,20,()=>Wte,e=>e,(e,t)=>{var n=u7(),r=f(n,!0),i={};O(()=>{Y(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(y);var b;_(y),H(h);var x=g(h,2);hq(x,{label:`x`,get value(){return Q(pe).x},step:1,decimals:0,onchange:e=>zt(`x`,Math.round(e))});var S=g(x,2);hq(S,{label:`y`,get value(){return Q(pe).y},step:1,decimals:0,onchange:e=>zt(`y`,Math.round(e))});var C=g(S,2);hq(C,{label:`w`,get value(){return Q(pe).w},step:1,decimals:0,min:8,onchange:e=>zt(`w`,Math.round(e))});var w=g(C,2);hq(w,{label:`h`,get value(){return Q(pe).h},step:1,decimals:0,min:8,onchange:e=>zt(`h`,Math.round(e))});var E=g(w,2);hq(E,{label:`z`,get value(){return Q(pe).z},step:1,decimals:0,onchange:e=>zt(`z`,Math.round(e))});var k=g(E,2),A=e=>{var t=ldt(),n=N(t),r=f(n,!0),i=g(n,2);B(i,17,()=>su(Q(pe).kind),e=>e.key,(e,t)=>{{let n=q(()=>wt(Q(pe),Q(t).key));R5(e,{get field(){return Q(t)},get value(){return Q(n)},onchange:e=>zt(Q(t).key,e)})}}),O(e=>Y(r,e),[()=>lu(Q(pe).kind)?.label??Q(pe).kind]),X(e,t)},ee=q(()=>su(Q(pe).kind).length);G(k,e=>{Q(ee)&&e(A)});var M=g(k,2),te=e=>{var t=udt(),n=g(N(t),2);B(n,17,()=>uu(Q(pe).kind),e=>e.key,(e,t)=>{{let n=q(()=>Q(pe).style?.[Q(t).key]);R5(e,{get field(){return Q(t)},get value(){return Q(n)},onchange:e=>Ht(Q(t).key,e)})}}),X(e,t)},ne=q(()=>uu(Q(pe).kind).length);G(M,e=>{Q(ne)&&e(te)}),W(2),O(()=>{u(r,Q(pe).id),c!==(c=Q(pe).kind)&&(a.value=(a.__value=c)??``,D(a,c)),b!==(b=Q(pe).anchor)&&(y.value=(y.__value=b)??``,D(y,b))}),L(`change`,a,e=>zt(`kind`,e.currentTarget.value)),L(`change`,y,e=>zt(`anchor`,e.currentTarget.value)),X(e,t)};G(a,e=>{Q(pe)?e(s,-1):e(o)}),H(n),X(e,n)},$$slots:{topbar:!0,primary:!0,main:!0,secondary:!0}}),e=>I(we,e,!0),()=>Q(we))},M=t(Ne(Hte)),te=e=>ox(),re=q(()=>te(i())),ie=q(()=>Q(M)===`scene`?null:Q(re).find(e=>e.uuid===Q(M))??null),F=q(()=>Q(ie)&&ax(ix(Q(ie)).aspect)||16/9),ae=q(()=>o()[Q(M)]?Cu(Q(M)):null),oe=q(()=>Q(ae)?.screens??[]),R=t(``);Qe(()=>{Q(oe).length&&(Q(oe).some(e=>e.id===Q(R))||I(R,Q(ae)?.active??Q(oe)[0].id,!0))});let se=q(()=>Q(oe).find(e=>e.id===Q(R))??null),ce=q(()=>Q(se)?.elements??[]),le=t(Ne({})),de=q(()=>
2506Q(le)[Q(R)]??[]),pe=q(()=>Q(de).length===1?Q(ce).find(e=>e.id===Q(de)[0])??null:null);function me(e){I(le,{...Q(le),[Q(R)]:e},!0),zte.update(t=>({...t,[Q(M)]:e}))}let V=t(!0),he={minW:380,minH:280},ge={w:680,h:480},U=t(680),_e=t(480);if(typeof localStorage<`u`){I(V,nt.getItem(`hudDocked`)!==`false`);let e=Xh(parseInt(nt.getItem(`hudWinW`)??`680`)||680,parseInt(nt.getItem(`hudWinH`)??`480`)||480,he);I(U,e.w,!0),I(_e,e.h,!0)}function ve(e){I(V,e,!0),nt.setItem(`hudDocked`,String(e)),e?jd(`hud`):Nd(`hud`)}Qe(()=>{let e=s();e&&e.key===`hud`&&(Ad.set(null),K(()=>{e.docked!==Q(V)&&ve(e.docked),fs.set(!1)}))});let ye=q(()=>c().find(e=>e.members.includes(`hud`))??null),be=q(()=>Q(ye)?Q(ye).rect.width:Q(U)),xe=q(()=>Q(ye)?Q(ye).rect.height:Q(_e));Qe(()=>(Od(`hud`,!l()&&Q(V),d()),()=>Od(`hud`,!1)));let Se=q(()=>m()===`hud`&&!h());Qe(()=>{if(!l()&&Q(R))return Au.update(e=>({...e,[Q(M)]:Q(R)})),()=>Au.update(e=>({...e,[Q(M)]:null}))});let we=t(null);Qe(()=>{Q(pe)&&K(()=>Q(we)?.showSecondary(`props`))});let Ee=t(0),J=t(Ne(parseInt(typeof localStorage<`u`&&nt.getItem(`hudScreens:h`)||`132`)||132)),De=t(!1),Oe=q(()=>Math.max(56,(Q(Ee)||320)-148));Qe(()=>{let e=Q(Oe);Q(J)>e&&I(J,e,!0)});function ke(e){I(De,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function Ae(e){Q(De)&&I(J,Math.min(Math.max(56,Q(J)+e.movementY),Q(Oe)),!0)}function je(e){if(Q(De)){I(De,!1),e.currentTarget.releasePointerCapture?.(e.pointerId);try{nt.setItem(`hudScreens:h`,String(Q(J)))}catch{}}}let Me=1280,Pe=q(()=>({w:Me,h:Math.round(Me/Q(F))})),Fe=t(null),Ie=t(null),Le=t(640),Re=t(360),ze=q(()=>Math.min(Q(Le)/Q(Pe).w,Q(Re)/Q(Pe).h)||.5),He=t(1280),Ue=t(720),Ge=q(()=>Q(He)/Math.max(1,Q(Ue))),Ke=q(()=>{let e=Q(Ge)>=Q(F)?{w:Q(Pe).w,h:Q(Pe).w/Q(Ge)}:{w:Q(Pe).h*Q(Ge),h:Q(Pe).h};return{left:(Q(Pe).w-e.w)/2,top:(Q(Pe).h-e.h)/2,w:e.w,h:e.h,same:Math.abs(Q(Ge)-Q(F))<.01}});Qe(()=>{if(!Q(Fe)||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{Q(Fe)&&(I(Le,Q(Fe).clientWidth,!0),I(Re,Q(Fe).clientHeight,!0))});return e.observe(Q(Fe)),()=>e.disconnect()});function Je(e){return Du(e,Q(Pe).w,Q(Pe).h)}function Ye(e,t,n){return hu(e,t,n,Q(Pe).w,Q(Pe).h)}let Xe={on:!0,grid:8,threshold:12};function $e(e,t){if(typeof localStorage>`u`)return t;let n=nt.getItem(e),r=n===null?NaN:parseFloat(n);return Number.isFinite(r)?r:t}let et=t(Ne(typeof localStorage>`u`?Xe.on:nt.getItem(`hud:snapOn`)!==`false`)),$=t(Ne(Math.max(1,$e(`hud:snapGrid`,Xe.grid)))),tt=t(Ne(Math.max(0,$e(`hud:snapThreshold`,Xe.threshold))));Qe(()=>{try{nt.setItem(`hud:snapOn`,String(Q(et))),nt.setItem(`hud:snapGrid`,String(Q($))),nt.setItem(`hud:snapThreshold`,String(Q(tt)))}catch{}});let rt=t(Ne({xs:[],ys:[]}));function it(e,t){if(!Q(et))return{value:e,line:null};let n=Math.round(e/Q($))*Q($),r=Math.abs(e-n),i=null;for(let a of t){let t=Math.abs(e-a);t<r&&t<Q(tt)&&(n=a,r=t,i=a)}return{value:n,line:i}}function at(e){let t=[0,Q(Pe).w/2,Q(Pe).w],n=[0,Q(Pe).h/2,Q(Pe).h];for(let r of Q(ce)){if(r.id===e)continue;let i=Je(r);t.push(i.left,i.left+i.w),n.push(i.top,i.top+i.h)}return{xs:t,ys:n}}let ot=WK({snapshot:()=>({ids:Q(de).slice(),rects:Object.fromEntries(Q(ce).filter(e=>Q(de).includes(e.id)).map(e=>[e.id,Je(e)]))}),start:e=>e.snapshot.ids.length?(PC(Q(M)),!0):!1,apply:e=>{let t=at(e.snapshot.ids.length===1?e.snapshot.ids[0]:``),n=[],r=[];for(let i of e.snapshot.ids){let a=Q(ce).find(e=>e.id===i),o=e.snapshot.rects[i];if(!a||!o)continue;let s=it(o.left+e.dx/Q(ze),t.xs),c=it(o.top+e.dy/Q(ze),t.ys);s.line!==null&&n.push(s.line),c.line!==null&&r.push(c.line),yu(Q(M),Q(R),i,Ye(a,s.value,c.value))}I(rt,{xs:[...new Set(n)],ys:[...new Set(r)]},!0)},revert:e=>{for(let t of e.snapshot.ids){let n=Q(ce).find(e=>e.id===t),r=e.snapshot.rects[t];n&&r&&yu(Q(M),Q(R),t,Ye(n,r.left,r.top))}},end:()=>{I(rt,{xs:[],ys:[]},!0),FC(Q(M))}}),st=WK({snapshot:()=>({id:Q(de)[0]??``,rect:Q(pe)?Je(Q(pe)):null}),start:e=>e.snapshot.rect?(PC(Q(M)),!0):!1,apply:e=>{let t=e.snapshot.rect;if(!t)return;let n=at(e.snapshot.id),r=it(t.left+t.w+e.dx/Q(ze),n.xs),i=it(t.top+t.h+e.dy/Q(ze),n.ys),a=Math.max(8,r.value-t.left),o=Math.max(8,i.value-t.top);I(rt,{xs:r.line===null?[]:[r.line],ys:i.line===null?[]:[i.line]},!0),yu(Q(M),Q(R),e.snapshot.id,{w:a,h:o})},revert:e=>{let t=e.snapshot.rect;t&&yu(Q(M),Q(R),e.snapshot.id,{w:t.w,h:t.h})},end:()=>{I(rt,{xs:[],ys:[]},!0),FC(Q(M))}});function ct(e,t){e.button===0&&(e.stopPropagation(),!Bte(t.id)&&
2506(e.shiftKey||e.ctrlKey||e.metaKey?me(Q(de).includes(t.id)?Q(de).filter(e=>e!==t.id):[...Q(de),t.id]):Q(de).includes(t.id)||me([t.id]),ot.begin(e)))}let lt=t(`select`),ut=t(null),dt=!1,ft=!1;function pt(e){e.preventDefault();let t=Dt(e);dt=e.shiftKey||e.ctrlKey||e.metaKey,ft=!1,I(ut,{x0:t.x,y0:t.y,x1:t.x,y1:t.y},!0),window.addEventListener(`pointermove`,mt),window.addEventListener(`pointerup`,ht)}function mt(e){if(!Q(ut))return;let t=Dt(e);(Math.abs(t.x-Q(ut).x0)*Q(ze)>3||Math.abs(t.y-Q(ut).y0)*Q(ze)>3)&&(ft=!0),I(ut,{...Q(ut),x1:t.x,y1:t.y},!0)}function ht(){let e=Q(ut);if(gt(),!e)return;if(!ft){dt||me([]);return}let t=Q(ce).filter(t=>l7(Je(t),e)).map(e=>e.id);me(dt?[...new Set([...Q(de),...t])]:t)}function gt(){I(ut,null),window.removeEventListener(`pointermove`,mt),window.removeEventListener(`pointerup`,ht)}function _t(e){let t=o7(e);if(!t)return;let n=Q(de).map(e=>Q(ce).find(t=>t.id===e)).filter(e=>!!e).map(e=>({id:e.id,el:e,rect:Je(e)}));if(n.length<t.min){es(t.label+` needs `+t.min+` selected elements`);return}let r=c7(e,n);if(!Object.keys(r).length){es(`Nothing to do â they are already arranged that way`);return}PC(Q(M));for(let e of n){let t=r[e.id];if(!t)continue;let n={...e.el,w:t.w,h:t.h};yu(Q(M),Q(R),e.id,{w:t.w,h:t.h,...Ye(n,t.left,t.top)})}FC(Q(M))}function vt(e){return i7.filter(t=>t.group===e).map(e=>({label:e.label,tooltip:e.hint,disabled:Q(de).length<e.min,action:()=>_t(e.key)}))}let yt={"align-left":$De,"align-hcenter":UDe,"align-right":qDe,"align-top":ZDe,"align-vcenter":VDe,"align-bottom":GDe,"distribute-h":YDe,"distribute-v":tOe,equalize:Fke};function bt(e){let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable))return;let n=e.ctrlKey||e.metaKey?10:e.shiftKey?100:1,r={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]};if(e.code===`Escape`){if(e.preventDefault(),e.stopPropagation(),y()){bu.set(null);return}if(Q(ut)){gt();return}ot.active()||st.active()?(ot.cancel(),st.cancel()):me([]);return}if(e.code===`Delete`||e.code===`Backspace`){e.preventDefault(),e.stopPropagation(),Q(de).length&&(_u(Q(M),Q(R),Q(de)),me([]));return}if(e.code===`KeyD`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),e.stopPropagation(),Pt();return}if(e.code===`KeyA`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),e.stopPropagation(),me(Q(ce).map(e=>e.id));return}if(e.code===`Tab`){if(e.preventDefault(),e.stopPropagation(),!Q(ce).length)return;let t=Q(ce).findIndex(e=>e.id===Q(de)[0]);me([Q(ce)[(t+(e.shiftKey?Q(ce).length-1:1))%Q(ce).length].id]);return}let i=r[e.code];if(i&&Q(de).length){e.preventDefault(),e.stopPropagation(),PC(Q(M));for(let e of Q(de)){let t=Q(ce).find(t=>t.id===e);if(!t)continue;let r=Je(t);yu(Q(M),Q(R),e,Ye(t,r.left+i[0]*n,r.top+i[1]*n))}FC(Q(M))}}function xt(e){let t=bt,n=Wt;return e.addEventListener(`keydown`,t,!0),e.addEventListener(`contextmenu`,n),{destroy:()=>{e.removeEventListener(`keydown`,t,!0),e.removeEventListener(`contextmenu`,n)}}}Qe(()=>n7(e=>{let t=Cu(Q(M));for(let n of t?.screens??[]){let t=n.elements.find(t=>t.id===e);if(t)return t.kind}return`text`}));let St=e=>X5(),Ct=q(()=>St(x())),wt=(e,t)=>e?.[t];function Tt(){Q(ae)||pu(Q(M),{})}function Et(e){return{left:Math.min(Math.max(0,(e.left+e.w)*Q(ze)-5),Q(Pe).w*Q(ze)-10),top:Math.min(Math.max(0,(e.top+e.h)*Q(ze)-5),Q(Pe).h*Q(ze)-10)}}function Dt(e){let t=Q(Ie)?.getBoundingClientRect();return t?{x:(e.clientX-t.left)/Q(ze),y:(e.clientY-t.top)/Q(ze)}:{x:Q(Pe).w/2,y:Q(Pe).h/2}}function Ot(e,t){Tt();let n=Q(R)||Cu(Q(M))?.screens[0].id;if(!n)return null;let r=kte(e),i=String(r.anchor??`top-left`),a=t??{x:Q(Pe).w/2,y:Q(Pe).h/2},o=Math.min(Math.max(0,Math.round(a.x-r.w/2)),Math.max(0,Q(Pe).w-r.w)),s=Math.min(Math.max(0,Math.round(a.y-r.h/2)),Math.max(0,Q(Pe).h-r.h)),c=Eu(Q(M),n,{...r,anchor:i,...Ye({...r,anchor:i},o,s)});return I(R,n,!0),me([c.id]),c}let kt=t(null);function At(e){Nt(e)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),I(kt,Dt(e),!0))}function jt(e){Nt(e)&&I(kt,null)}function Mt(e){let t=e.dataTransfer?.getData(`application/x-hud-kind`);I(kt,null),t&&(e.preventDefault(),e.stopPropagation(),Ot(t,Dt(e)))}function Nt(e){return[...e.dataTransfer?.types??[]].includes(`application/x-hud-kind`)}function Pt(){Q(de).length&&me(Q(ce).filter(e=>Q(de).includes(e.id)).map(e=>Eu(Q(M),Q(R),{...e,id:void 0,x:e.x+12,y:e.y+12})).map(e=>e.id))}function Ft(e,t){let n=Cu(Q(M));n&&pu(Q(M),{...n,screens:n.screens.map(n=>
2506n.id===e?{...n,input:t}:n)})}function It(e,t){let n=Cu(Q(M));n&&pu(Q(M),{...n,screens:n.screens.map(n=>n.id===e?{...n,showWhile:t}:n)})}function Lt(){Tt();let e=xu(Q(M),`Screen `+(Q(oe).length+1));I(R,e,!0),me([])}function Rt(e){if(!Pte(Q(M),e)){es(`A HUD always has at least one screen`);return}I(R,Cu(Q(M))?.active??``,!0)}function zt(e,t){Q(pe)&&yu(Q(M),Q(R),Q(pe).id,{[e]:t})}function Bt(e){if(!e||e.kind!==`custom`)return;let t=Q(R);oJ({title:`HUD code · `+e.id,code:String(e.code??``),onSave:n=>yu(Q(M),t,e.id,{code:n})})}function Vt(e){if(!Q(se))return;let t=Q(de).length?Q(ce).filter(e=>Q(de).includes(e.id)):Q(ce);if(t.length){PC(Q(M));for(let n of t){let t=Ate(n.kind,e);Object.keys(t).length&&yu(Q(M),Q(R),n.id,{style:{...n.style??{},...t}})}FC(Q(M)),es((Q(de).length?t.length+` element`+(t.length===1?``:`s`):`This screen`)+` restyled â Ctrl+Z puts it back`)}}function Ht(e,t){Q(pe)&&yu(Q(M),Q(R),Q(pe).id,{style:{...Q(pe).style??{},[e]:t}})}let Ut=t(null);function Wt(e){e.preventDefault(),e.stopPropagation();let t=Dt(e),n=[{label:`Add`,children:fu().map(e=>({label:e.group,children:e.items.map(e=>({label:e.label,tooltip:e.summary,action:()=>Ot(e.key,t)}))}))},{section:` `},...a7.map(e=>({label:e,children:vt(e)})),{section:` `},{label:`Duplicate`,hint:`Ctrl+D`,disabled:!Q(de).length,action:Pt},{label:`Delete`,hint:`Del`,danger:!0,disabled:!Q(de).length,action:()=>{_u(Q(M),Q(R),Q(de)),me([])}},{label:`Select all`,hint:`Ctrl+A`,action:()=>me(Q(ce).map(e=>e.id))},{section:` `},{label:Q(de).length?`Apply style to `+Q(de).length+` selectedâ¦`:`Apply style to this screenâ¦`,children:Mte.map(e=>({label:e.label,hint:e.hint,action:()=>Vt(e.key)}))},{section:` `},{label:Q(et)?`Snapping on`:`Snapping off`,checked:Q(et),action:()=>I(et,!Q(et))}];I(Ut,{x:e.clientX,y:e.clientY,items:n},!0)}let Gt=e=>Math.min(Math.max(e||320,200),Math.round(window.innerHeight*.8)),Kt=t(!1),qt=t(!1);function Jt(e){I(Kt,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function Yt(e){Q(Kt)&&Md.update(t=>Gt(t-e.movementY))}function Xt(e){Q(Kt)&&(I(Kt,!1),e.currentTarget.releasePointerCapture?.(e.pointerId))}function Zt(e){I(qt,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()}function Qt(e){if(!Q(qt))return;let t=Q(ye)?Q(ye).rect.width:Q(U),n=Q(ye)?Q(ye).rect.height:Q(_e),r=Gh(e.currentTarget.parentElement),i=Yh(t+e.movementX,n+e.movementY,r.left,r.top,he);I(U,i.w,!0),I(_e,i.h,!0),ag(`hud`,Q(U),Q(_e))}function $t(e){Q(qt)&&(I(qt,!1),e.currentTarget.releasePointerCapture?.(e.pointerId),en())}function en(){nt.setItem(`hudWinW`,String(Q(U))),nt.setItem(`hudWinH`,String(Q(_e)))}function tn(){let e=Xh(ge.w,ge.h,he);I(U,e.w,!0),I(_e,e.h,!0),ag(`hud`,Q(U),Q(_e)),en()}function nn(){let e=Xh(Q(U),Q(_e),he);(e.w!==Q(U)||e.h!==Q(_e))&&(I(U,e.w,!0),I(_e,e.h,!0),ag(`hud`,Q(U),Q(_e)))}Qe(()=>{l()||K(()=>Tt())});var rn=hdt();Z(`resize`,p,nn);var an=N(rn),on=e=>{var t=fe(),n=N(t),i=e=>{var t=pdt(),n=j(t),i=g(n,2);TS(i,{});var a=g(i,2),o=g(j(a),4),s=g(o,2);H(a);var c=g(a,2),l=j(c);A(l),H(c),H(t),O(()=>{r(t,1,`fixed inset-x-0 bottom-0 flex flex-col bg-white p-2 text-gray-800 dark:bg-gray-800 dark:text-gray-200 ${Q(Se)?``:`hidden`}`),Ze(t,`z-index: var(--z-bottom); height: ${d()??``}px; border-top: 1px solid rgb(55 65 81 / 0.6)`)}),L(`pointerdown`,n,Jt),L(`pointermove`,n,Yt),L(`pointerup`,n,Xt),L(`click`,o,()=>ve(!1)),L(`click`,s,()=>fs.set(!0)),X(e,t)},a=e=>{var t=mdt();let n;var r=j(t),i=g(j(r),2),a=f(i,!0),o=g(i,4),s=g(o,2);H(r);var c=g(r,2),l=j(c);A(l),H(c);var u=g(c,2);H(t),ne(t,(e,t)=>Zh?.(e,t),()=>({key:`hud`,defaultRect:{left:240,top:150}})),ne(t,(e,t)=>Kh?.(e,t),()=>`hud`),ne(t,(e,t)=>$h?.(e,t),()=>({key:`hud`,title:`HUD editor`,openStore:fs,isOpen:e=>!e,close:()=>fs.set(!0)})),ne(t,(e,t)=>uS?.(e,t),()=>({key:`hud`})),O(()=>{n=Ze(t,`z-index: var(--z-window); max-width: 96vw; max-height: 88vh`,n,{width:`${Q(be)??``}px`,height:`${Q(xe)??``}px`}),Y(a,Q(se)?Q(se).name:`no screen`)}),L(`click`,o,()=>ve(!0)),L(`click`,s,()=>fs.set(!0)),L(`pointerdown`,u,Zt),L(`pointermove`,u,Qt),L(`pointerup`,u,$t),L(`dblclick`,u,tn),X(e,t)};G(n,e=>{Q(V)?e(i):e(a,-1)}),X(e,t)};G(an,e=>{l()||e(on)});var sn=g(an,2),cn=e=>{xS(e,{get x(){return Q(Ut).x},get y(){return Q(Ut).y},get items(){return Q(Ut).items},sizeKey:`hud`,onclose:()=>I(Ut,null)})};G(sn,e=>{Q(Ut)&&e(cn)}),a(`innerWidth`,e=>
2506I(He,e,!0)),a(`innerHeight`,e=>I(Ue,e,!0)),X(e,rn),ue(),k()}ge([`click`,`change`,`pointerdown`,`pointermove`,`pointerup`,`dblclick`]);var _dt={id:`hello`,name:`Hello Wave`,version:`1.0.0`,description:`Reference module: a Wave animation node that rocks objects.`,register(e){e.registerNodeGroup({group:`Modules`,items:[{type:`wave`,label:`Wave (hello)`,defaults:{amplitude:.4,speed:2},params:[{key:`amplitude`,kind:`range`,min:0,max:1.5,step:.05},{key:`speed`,kind:`range`,min:.2,max:10,step:.1}]}]}),e.registerEffect(`wave`,(e,t,n,r)=>{let i=n.amplitude??.4,a=n.speed??2;e.rotation.z=t.rot[2]+Math.sin(r*a)*i}),e.registerNodeDefs([{key:`bobble`,name:`Bobble (hello)`,params:[{key:`height`,kind:`range`,min:0,max:2,step:.05},{key:`speed`,kind:`range`,min:.2,max:10,step:.1}],code:`// editable module node (H2): bobs the object up and down 2507const height = data.height ?? 0.5; 2508const speed = data.speed ?? 3; 2509object.position.y = base.pos[1] + Math.abs(Math.sin(time * speed)) * height; 2510`}])}},vdt=V(`<option> </option>`),ydt=V(`<!> <div class="flex w-full flex-col gap-1"><label class="flex flex-col"><span>button object</span> <select class="nodrag"><option>-None-</option><!></select></label> <label class="flex flex-col"><span>mode</span> <select class="nodrag"><option>toggle</option><option>push (springs back)</option></select></label> <label class="flex flex-col"><span class="flex justify-between"><span>height</span><span> </span></span> <input class="nodrag accent-[#ff4000]" type="range" min="-4" max="4" step="0.1"/></label> <div class="flex items-center justify-between"><span class="flex items-center gap-1"><span class="inline-block h-2 w-2 rounded-full"></span> </span> <button class="nodrag rounded-sm bg-[#ff4000] px-2 text-white">Press</button></div></div>`,1);function bdt(e,t){Ce(t,!1);let n=()=>z(Ui,`$objectsGroup`,r),[r,i]=Ve(),a=J(t,`id`,8),o=J(t,`data`,8),c=F([]);d(()=>n(),()=>{I(c,n()?n().children.map(e=>({id:e.uuid,name:e.name||e.type})):[])}),h(),R(),r4(e,{get type(){return s(o()),K(()=>o().type)},children:(e,t)=>{var n=ydt(),r=N(n);f2(r,{type:`source`,get position(){return s(W1),K(()=>W1.Right)}});var i=g(r,2),l=j(i),d=g(j(l),2),p=g(j(d));B(p,1,()=>Q(c),Be,(e,t)=>{var n=vdt(),r=f(n,!0),i={};O(()=>{Y(r,(Q(t),K(()=>Q(t).name))),i!==(i=(Q(t),K(()=>Q(t).id)))&&(n.value=(n.__value=i)??``)}),X(e,n)}),H(d);var m;_(d),H(l);var h=g(l,2),y=g(j(h),2),b=j(y);b.value=b.__value=`toggle`;var x=g(b);x.value=x.__value=`push`,H(y);var S;_(y),H(h);var C=g(h,2),w=j(C),T=g(j(w)),E=f(T,!0);H(w);var k=g(w,2);v(k),H(C);var A=g(C,2),ee=j(A),M=j(ee),te=g(M);H(ee);var ne=g(ee,2);H(A),H(i),O(()=>{m!==(m=(s(o()),K(()=>o().button??`-None-`)))&&(d.value=(d.__value=m)??``,D(d,m)),S!==(S=(s(o()),K(()=>o().mode??`toggle`)))&&(y.value=(y.__value=S)??``,D(y,S)),Y(E,(s(o()),K(()=>o().height??2))),u(k,(s(o()),K(()=>o().height??2))),Ze(M,`background-color: ${s(o()),K(()=>o().pressed?`#22c55e`:`#6b7280`)??``}`),Y(te,` ${s(o()),K(()=>o().pressed?`pressed`:`released`)??``}`)}),Z(`change`,d,e=>nu(a(),{button:e.currentTarget.value})),Z(`change`,y,e=>nu(a(),{mode:e.currentTarget.value})),Z(`input`,k,e=>nu(a(),{height:+e.currentTarget.value})),Z(`click`,ne,()=>d7({id:a(),data:o()})),X(e,n)},$$slots:{default:!0}}),ue(),i()}function d7(e){let t=e.data?.mode===`push`||!e.data?.pressed;nu(e.id,{pressed:t,at:Lee()},e.__graph)}var xdt={id:`button`,name:`Button & door`,version:`1.0.0`,description:`Clickable button/actuator that slides a door object through the graph.`,register(e){e.registerPrimitive(`Button`,()=>{let e=new Ar(.5,.6,.2,24),t=new Ar(.32,.32,.22,24);return t.translate(0,.15,0),ba([e,t])},{label:`Button`,command:`/create Button`}),e.registerNodeGroup({group:`Modules`,items:[{type:`buttontrigger`,label:`Button trigger`,defaults:{button:`-None-`,mode:`toggle`,height:2,pressed:!1,at:0}}]},{buttontrigger:bdt}),e.registerClickHandler(t=>{let n=e.objectsGroup();if(!n)return!1;let r=t;for(;r.parent&&r.parent!==n;)r=r.parent;let i=jc().find(e=>e.type===`buttontrigger`&&e.data?.button===r.uuid);return i?(d7(i),!0):!1}),e.registerEffect(`buttontrigger`,(e,t,n,r)=>{let i=n.height??2,a=Math.max(Math.abs(i)/2,.15),o=n.at??0,s=e=>Math.min(Math.max(e,0),1),c;if(n.pressed){if(c=s((r-o)/a),n.mode===`push`){let e=o+a+1.5;r>=e&&(c=1-s((r-e)/a))}}else c=1-s((r-o)/a);e.position.y=t.pos[1]+i*c}
2510)}},f7=`pong-module`,p7=.9,m7=5,h7=null,g7=null,_7={x:0,z:0,vx:1.6,vz:.9},v7=null,y7=0,b7=0;function x7(){return h7?.scene()?.getObjectByName(f7)??null}function S7(){let e=x7();e&&g7&&(e.userData={...e.userData,...g7,ball:[_7.x,_7.z]})}function C7(e){let t=x7()?.getObjectByName(`pong-score`);if(!t)return;let n=t.userData.canvas,r=n.getContext(`2d`);r.clearRect(0,0,n.width,n.height),r.fillStyle=`#ffffff`,r.font=`bold 72px monospace`,r.textAlign=`center`,r.fillText(e,n.width/2,90),t.material.map.needsUpdate=!0}function w7(e){let t=h7?.scene();if(!t||t.getObjectByName(f7))return;let n=new Pn;n.name=f7;let r=new Nt(new Dr(6.4,.1,4),new ir({color:1332013}));r.position.y=.8200000000000001,n.add(r),[`left`,`right`].forEach(e=>{let t=new Nt(new Dr(.15,.15,.8),new ir({color:e===`left`?3900150:15680580}));t.name=`pong-paddle-`+e,t.userData.pongSide=e,t.position.set(e===`left`?-2.8:2.8,p7,0),n.add(t)});let i=new Nt(new mt(.09,16,12),new ir({color:16436245}));i.name=`pong-ball`,i.position.set(0,p7,0),n.add(i);let a=document.createElement(`canvas`);a.width=256,a.height=128;let o=new _t(new Ut({map:new wr(a),transparent:!0}));o.name=`pong-score`,o.userData.canvas=a,o.scale.set(1.6,.8,1),o.position.set(0,2.1,0),n.add(o),t.add(n),g7={spawnerId:e,paddles:{left:null,right:null},score:[0,0]},_7={x:0,z:0,vx:1.6,vz:.9},v7=null,C7(`0 : 0`),S7()}function T7(){let e=h7?.scene(),t=x7();t&&e.remove(t),g7=null}function E7(e){_7={x:0,z:0,vx:e?-1.6:1.6,vz:(Math.random()<.5?1:-1)*.9}}function Sdt(e){_7.x+=_7.vx*e,_7.z+=_7.vz*e,_7.z>1.7&&(_7.z=1.7,_7.vz=-Math.abs(_7.vz)),_7.z<-1.7&&(_7.z=-1.7,_7.vz=Math.abs(_7.vz));let t=x7();[`left`,`right`].forEach(e=>{let n=t?.getObjectByName(`pong-paddle-`+e);if(!n)return;let r=n.position.x,i=e===`left`?_7.x<r+.2&&_7.x>r-.1:_7.x>r-.2&&_7.x<r+.1,a=e===`left`?_7.vx<0:_7.vx>0;i&&a&&Math.abs(_7.z-n.position.z)<.5&&(_7.vx=-_7.vx*1.03,_7.vz+=(_7.z-n.position.z)*1.2)});let n=null;_7.x>3.3&&(g7.score[0]++,n=`left`,E7(!1)),_7.x<-3.3&&(g7.score[1]++,n=`right`,E7(!0)),n&&((g7.score[0]>=m7||g7.score[1]>=m7)&&(h7.toast(`Pong: `+(g7.score[0]>=m7?`blue`:`red`)+` wins!`),g7.score=[0,0]),C7(g7.score[0]+` : `+g7.score[1]),h7.send({op:`score`,score:g7.score}),S7());let r=performance.now();r-y7>80&&(y7=r,h7.send({op:`ball`,pos:[_7.x,_7.z]}));let i=t?.getObjectByName(`pong-ball`);i&&i.position.set(_7.x,p7,_7.z)}function D7(e,t){let n=x7()?.getObjectByName(`pong-paddle-`+e);n&&(n.position.z=Math.min(Math.max(t,-1.4),1.4))}function Cdt(){let e=h7?.peerId();return!g7||!e?null:g7.paddles.left===e?`left`:g7.paddles.right===e?`right`:null}var O7=new Wn,wdt=new Tr(new hn(0,1,0),-.9),k7=new hn;function Tdt(e){let t=Cdt();if(!t)return;let n=performance.now();if(n-b7<50)return;let r=U(yi);if(!r)return;let i=xl(e.clientX,e.clientY);O7.setFromCamera(new yn(i.x,i.y),r),O7.ray.intersectPlane(wdt,k7)&&(b7=n,D7(t,k7.z),S7(),h7.send({op:`paddle`,side:t,z:k7.z}))}var Edt={id:`pong`,name:`Pong`,version:`1.0.0`,description:`Two-player pong table: claim a paddle, spawner simulates the ball.`,register(e){h7=e,e.onUnload(()=>{g7=null,v7=null}),e.registerInteractiveGroup(f7),e.registerMenu(`Pong: spawn / remove`,()=>{g7?(T7(),e.send({op:`remove`})):(w7(e.peerId()??`me`),e.send({op:`spawn`,spawnerId:e.peerId()}))}),e.registerClickHandler(t=>{let n=t.userData?.pongSide;if(!n||!g7)return!1;let r=e.peerId();return!r||g7.paddles[n]?!0:(g7.paddles[n]=r,S7(),e.toast(`You control the `+n+` paddle â move the mouse over the table`),e.send({op:`claim`,side:n,peerId:r}),!0)}),typeof window<`u`&&e.listen(window,`pointermove`,Tdt),e.registerFrameTask(()=>{if(!g7||g7.spawnerId!==e.peerId())return;let t=performance.now()/1e3;v7??=t;let n=Math.min(t-v7,.05);v7=t,Sdt(n)}),e.onMessage(e=>{if(e.op===`spawn`)w7(e.spawnerId);else if(e.op===`remove`)T7();else if(e.op===`claim`)g7&&(g7.paddles[e.side]=e.peerId,S7());else if(e.op===`paddle`)D7(e.side,e.z);else if(e.op===`ball`){_7.x=e.pos[0],_7.z=e.pos[1];let t=x7()?.getObjectByName(`pong-ball`);t&&t.position.set(_7.x,p7,_7.z),S7()}else e.op===`score`&&g7&&(g7.score=e.score,C7(g7.score[0]+` : `+g7.score[1]),S7())}),e.onSceneClear(()=>T7());let t=as.subscribe(t=>
2510{if(!g7)return;let n=new Set((t??[]).map(e=>e[0]));if(n.add(e.peerId()),g7.spawnerId&&!n.has(g7.spawnerId)&&g7.spawnerId!==e.peerId()){T7();return}[`left`,`right`].forEach(e=>{g7.paddles[e]&&!n.has(g7.paddles[e])&&(g7.paddles[e]=null,S7())})});e.onUnload(t),e.registerStateSync({getState:()=>g7?{...g7,ball:[_7.x,_7.z]}:null,applyState:e=>{e&&(w7(e.spawnerId),g7.paddles=e.paddles,g7.score=e.score,C7(g7.score[0]+` : `+g7.score[1]),e.ball&&(_7.x=e.ball[0],_7.z=e.ball[1]),S7())}})}},Ddt={id:`vrsleeve`,name:`VR Sleeve Palette`,version:`1.0.0`,description:`Experimental VR forearm palette: trigger-drag ghost primitives (or captured prefab slots) off your sleeve to place them. Enable it in Settings > VR.`,register(e){let t=null,n=!1;e.onUnload(()=>{n=!0,t?.()}),$(()=>import(`../chunks/5ONLzIKf.js`).then(e=>e.r).then(e=>{t=e.registerVRSleeve(),n&&t()}),__vite__mapDeps([213,1,2,9,0,3,4,5,6,114,25,43,44,18,10,19,7,20,21,22,23,11,12,13,8,14,24,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,45,46,47,48,49,50,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,117,118,119,120,121,132,130,131,173,88,93,94,89,90,91,92,15,113,115,116,122,123,112,159,160,161,172,104,174,139,140,141,138,175,157,158,135,136,137,176,96,177,154,142,178,156,125,126,100,127,128,129,133,134,162,155,163,143,164,153,144,145,146,147,148,149,150,151,152,179,180,181,107,171,182,183,184,185,186,187,188,189,190]),import.meta.url).catch(e=>console.log(`vrsleeve module failed to load`,e))}},A7={cube:{template:`Piece cube`,label:`cube`,stack:2},plank:{template:`Piece plank`,label:`plank`,stack:2},beam:{template:`Piece beam`,label:`beam`,stack:2},wedge:{template:`Piece wedge`,label:`wedge`,stack:1},barrel:{template:`Piece barrel`,label:`barrel`,stack:1},arch:{template:`Piece arch`,label:`arch`,stack:1},lblock:{template:`Piece L`,label:`L-block`,stack:1},ball:{template:`Piece ball`,label:`ball`,stack:1},base:{template:`Piece base`,label:`heavy base`,stack:1},star:{template:`Piece star`,label:`star`,stack:1}},j7={pad:{object:`Build pad`,footprint:1.9,yard:3.4},pedestal:{object:`Pedestal`,footprint:.75,yard:2.6},wobble:{object:`Wobble plate`,footprint:1.45,yard:2.9}},M7={racks:[`Rack west`,`Rack east`],ledge:[`High ledge`],perch:[`Star perch`]},N7=[{id:1,name:`Stack`,zone:`pad`,supply:[{shape:`cube`,count:6}],goal:{type:`height`,height:1.8},par:{pieces:3,time:45},limit:180,lost:2,intro:`Carry cubes from the racks to the glowing pad and stack them to the ring.`},{id:2,name:`Planks`,zone:`pad`,supply:[{shape:`plank`,count:4},{shape:`beam`,count:2},{shape:`cube`,count:2}],goal:{type:`height`,height:2.2},par:{pieces:5,time:70},limit:180,lost:2,intro:`Long pieces make wide floors. Cross them to build a stable tower.`},{id:3,name:`Climb`,zone:`pad`,supply:[{shape:`cube`,count:5},{shape:`cube`,count:3,rack:`ledge`}],goal:{type:`height`,height:3.6},par:{pieces:6,time:120},limit:240,lost:2,rule:`Above your reach: build steps and climb them. Jump (Space / A) to grab from the ledge.`,intro:`The ring is higher than you can reach. Build a step, climb it â and jump for the ledge.`},{id:4,name:`Wedges`,zone:`pad`,supply:[{shape:`wedge`,count:8},{shape:`cube`,count:2}],goal:{type:`height`,height:2.2},par:{pieces:7,time:100},limit:210,lost:2,rule:`Two wedges face to face make a flat top.`,intro:`Triangles! Pair two wedges into a block before you build on them.`},{id:5,name:`Barrels`,zone:`pad`,supply:[{shape:`barrel`,count:6},{shape:`plank`,count:2}],goal:{type:`height`,height:2.4},par:{pieces:5,time:90},limit:210,lost:2,rule:`Barrels roll â stand them up.`,intro:`Barrels stand on their ends and roll on their sides. Keep them upright.`},{id:6,name:`Arches`,zone:`pad`,supply:[{shape:`arch`,count:3},{shape:`lblock`,count:3},{shape:`plank`,count:2}],goal:{type:`height`,height:2.8},par:{pieces:5,time:110},limit:240,lost:2,intro:`Arches and L-blocks: odd shapes, big gains. Find how they lock together.`},{id:7,name:`Narrow base`,zone:`pedestal`,supply:[{shape:`cube`,count:3},{shape:`plank`,count:3},{shape:`beam`,count:1}],goal:{type:`height`,height:2.6},par:{pieces:4,time:90},limit:210,lost:2,rule:`The pedestal is small â balance every overhang.`,intro:`Build on the little pedestal. Every piece hangs over the edge.`},{id:8,name:`Gusts`,zone:`pad`,supply:[{shape:`cube`,count:4},{shape:`plank`,count:3},{shape:`wedge`,count:2}],goal:{type:`height`,height:3},wind:{first:8,every:9,strength:2},par:{pieces:7,time:120},limit:240,lost:3,rule:`A gust every 9 s â hold the top piece through it, and build wide.`,intro:`The wind is up. A gust every few seconds pushes the top of your tower.`},{id:9,name:`Balls`,zone:`pad`,supply:[{shape:`ball`,count:3},{shape:`wedge`,count:4},{shape:`plank`,count:2},{shape:`cube`,count:2}],goal:{type:`height`,height:2.4},par:{pieces:6,time:140},limit:270,lost:3,rule:`Balls roll off anything flat â cradle them.`,intro:`Hard one. Balls will not sit still: make a cradle for each one.`},{id:10,name:`Wobble`,zone:`wobble`,supply:[{shape:`base`,count:1},{shape:`cube`,count:4},{shape:`plank`,count:2}],goal:{type:`height`,height:2.4},par:{pieces:5,time:100},limit:240,lost:3,rule:`The plate rocks â start with the heavy base.`,intro:`The wobble plate never stops rocking. A heavy base steadies it.`},{id:11,name:`Outline`,zone:`pad`,supply:[{shape:`cube`,count:6},{shape:`plank`,count:2}],goal:{type:`outline`},par:{pieces:6,time:80},limit:180,lost:2,rule:`Fill every cell of the ghost wall.`,intro:`N
2510o ring this time: fill the glowing ghost wall on the pad, every cell.`},{id:12,name:`Summit`,zone:`pad`,supply:[{shape:`base`,count:1},{shape:`cube`,count:3},{shape:`plank`,count:2},{shape:`arch`,count:1},{shape:`lblock`,count:1},{shape:`wedge`,count:2},{shape:`barrel`,count:1},{shape:`star`,count:1,rack:`perch`}],goal:{type:`deliver`,height:3.6},wind:{first:12,every:14,strength:1.3},par:{pieces:9,time:180},limit:360,lost:3,rule:`Fetch the star from the perch and set it on top. Light gusts.`,intro:`The summit: build to 3.6 m and crown it with the star from the perch.`}];function P7(e){let t=Number(e);return N7.find(e=>e.id===t)??null}function Odt(e){let t=Number(e);return N7.some(e=>e.id===t+1)?t+1:null}function F7(e){return(e?.supply??[]).reduce((e,t)=>e+(t.count||0),0)}function I7(e){return e?e.goal?.type===`outline`?1.4:Number(e.goal?.height)||0:0}function L7(e,t){if(!e||!t?.won)return 0;let n=1;return Number(t.pieces)<=e.par.pieces&&n++,Number(t.time)<=e.par.time&&n++,n}function R7(e,t=3){let n=Math.max(0,Math.min(t,Math.round(Number(e)||0)));return`â
`.repeat(n)+`â`.repeat(t-n)}function z7(e){let t=Math.max(0,Math.ceil(Number(e)||0));return Math.floor(t/60)+`:`+String(t%60).padStart(2,`0`)}function B7(e){let t={},n=e&&typeof e==`object`&&e.levels&&typeof e.levels==`object`?e.levels:{};for(let e of N7){let r=n[e.id]??n[String(e.id)];if(!r||typeof r!=`object`)continue;let i=Math.max(0,Math.min(3,Math.round(Number(r.stars)||0)));if(!i)continue;let a=Number(r.time),o=Number(r.pieces);t[String(e.id)]={stars:i,time:Number.isFinite(a)&&a>0?a:0,pieces:Number.isFinite(o)&&o>0?Math.round(o):0}}return{levels:t}}function V7(e,t){let n=Number(t);return P7(n)?n===1||(B7(e).levels[String(n-1)]?.stars??0)>0:!1}function kdt(e){return Object.values(B7(e).levels).reduce((e,t)=>e+t.stars,0)}function Adt(e,t,n){let r=[],i={};for(let a of e?.supply??[]){let e=M7[a.rack??`racks`]??M7.racks,o=n[a.shape];if(!o)continue;let s=A7[a.shape]?.stack??1,c=a.count;for(let n of e){let e=t[n];if(!e||c<=0)continue;let l=e.max[0]-e.min[0],u=e.max[2]-e.min[2],d=u>=l,f=d?l:u,p=d?u:l,m=Math.max(o[0],o[2]),h=Math.min(o[0],o[2]),g=m<=f-.05,_=g?h:m,v=g===(o[0]>=o[2]===d)?0:Math.PI/2;for(;c>0;){let t=i[n]??0;if(t+_>p+1e-6)break;let l=t+_/2,u=Math.min(s,c);for(let t=0;t<u;t++){let n=d?(e.min[0]+e.max[0])/2:e.min[0]+l,i=d?e.min[2]+l:(e.min[2]+e.max[2])/2,s=e.max[1]+o[1]*(t+.5)+.02+t*.02;r.push({shape:a.shape,pos:[H7(n),H7(s),H7(i)],yaw:v})}c-=u,i[n]=t+_+.12}}}return r}function H7(e){return Math.round(e*1e3)/1e3}function U7(e,t){return e.filter(e=>!e.held&&e.speed<.3&&Math.hypot(e.pos[0]-t.center[0],e.pos[2]-t.center[2])<=t.footprint)}function jdt(e,t){let n=t.top??0;for(let r of U7(e,t))r.top>n&&(n=r.top);return n}function Mdt(e,t,n){if(e.held||e.speed>=.3||e.bottom>.9||Math.hypot(e.pos[0]-t.center[0],e.pos[2]-t.center[2])<=t.yard)return!1;for(let t of n)if(e.pos[0]>=t.min[0]&&e.pos[0]<=t.max[0]&&e.pos[2]>=t.min[2]&&e.pos[2]<=t.max[2])return!1;return!0}function Ndt(e){let t=[];for(let n=0;n<2;n++)for(let r=-1;r<=1;r++)t.push([H7(e.center[0]+r*.6),H7((e.top??0)+.3+n*.6),H7(e.center[2])]);return t}function Pdt(e,t){let n=0;for(let r of e)t.some(e=>!e.held&&(e.speed??0)<.3&&r[0]>=e.min[0]-.05&&r[0]<=e.max[0]+.05&&r[1]>=e.min[1]-.05&&r[1]<=e.max[1]+.05&&r[2]>=e.min[2]-.05&&r[2]<=e.max[2]+.05)&&n++;return n}function W7(e,t){let n=e?.wind;return!n||!(t>=n.first)?null:G7(e,Math.floor((t-n.first)/n.every))}function G7(e,t){let n=e.wind,r=(t*2.39996323+e.id*.7)%(Math.PI*2);return{index:t,at:n.first+t*n.every,dir:[H7(Math.cos(r)),0,H7(Math.sin(r))],strength:n.strength}}function Fdt(e){let t=-e[0],n=-e[2],r=(Math.atan2(t,-n)*180/Math.PI+360)%360;return[`north`,`north-east`,`east`,`south-east`,`south`,`south-west`,`west`,`north-west`][Math.round(r/45)%8]}function Idt(e,t,n){let r={holdSince:n?.holdSince??null,peak:n?.peak??0,peakAt:n?.peakAt??0},i=I7(e);if(t.top>r.peak&&(r.peak=t.top,r.peakAt=t.elapsed),t.starLost)return{verdict:`star`,hold:0,memo:r};if(t.lost>e.lost)return{verdict:`lost`,hold:0,memo:r};if(i>0&&r.peak>=i*.6&&t.top<i*.3&&t.elapsed-r.peakAt<=2.5&&!t.anyHeld)return{verdict:`fell`,hold:0,memo:r};let a=!1;if(a=e.goal?.type===`outline`?(t.cells??0)>0&&(t.filled??0)>=(t.cells??0):e.goal?.type===`deliver`?!!t.star?.inTower&&t.star.top>=i:t.top>=i,a&&!t.anyHeld){r.holdSince??=t.elapsed;let e=t.elapsed-r.holdSince;return e>=3?{verdict:`won`,hold:0,memo:r}:{verdict:null,hold:Math.max(1,Math.ceil(3-e)),memo:r}}return r.holdSince=null,t.elapsed>=e.limit?{verdict:`time`,hold:0,memo:r}:{verdict:null,hold:0,memo:r}}
2510function K7(e){return{won:`Level complete!`,time:`Out of time`,fell:`The tower fell`,lost:`Out of pieces`,star:`The star was lost`}[e]??``}var q7={none:0,playing:1,won:2,time:3,fell:4,lost:5,star:6};function J7(e){return Object.keys(q7).find(t=>q7[t]===e)??`none`}var Ldt=`Towers game`,Y7=`Goal ring`,Rdt=`Yard ring`,X7=`Ghost wall`,zdt=3.4,Z7=[0,-9,0],Bdt=.1,Vdt=2.5,Hdt=1.3,Q7={level:`twLevel`,status:`twStatus`,height:`twHeight`,peak:`twPeak`,left:`twLeft`,lost:`twLost`,hold:`twHold`,stars:`twStars`,time:`twTime`,used:`twUsed`,filled:`twFilled`,dealt:`twDealt`},Udt={id:`towers`,name:`Towers`,version:`2.0.0`,description:`The Towers game: twelve levels of stacking with different shapes, limited reach, jumping, wind and a wobbling plate â stars and unlocks saved on this device.`,register(e){let t=null,n=null,r=null,i=null,a=null;Promise.all([$(()=>import(`../chunks/DHWg9jzn.js`).then(e=>e.s),__vite__mapDeps([13,1,2,10]),import.meta.url),$(()=>import(`../chunks/BFaBkNqh.js`).then(e=>e._),__vite__mapDeps([113,1,2,6,9,0,3,4,5,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url),$(()=>import(`../chunks/B3B8hjh_.js`).then(e=>e.v),__vite__mapDeps([157,1,2,6,9,0,3,4,38,39,5,7,48,10,14,32,13,30,31,57,58,18,19,20,21,22,23,11,12,8,24,25,26,27,28,29,33,34,35,36,37,40,41,42,43,44,45,46,47,49,50,16,51,52,53,54,55,56,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,158,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url),$(()=>import(`../chunks/CXukiGwX.js`).then(e=>e.s),__vite__mapDeps([86,1,2,0,3,4,5,6]),import.meta.url),$(()=>import(`../chunks/OHQUSm6n.js`).then(e=>e.s),__vite__mapDeps([2,1]),import.meta.url)]).then(([e,o,s,c,l])=>{t=e,n=o,r=s,i=c,a=l});let o=e.THREE,s=new Map,c=null,l=-1,u=0,d=-1,f=-1,p=-1,m=-1,h=new Map,g=new Map,_=-1,v=-1,y=e.kit,b=()=>B7(y.levels.progress()),x=!1;y.score.useGame(`towers`);let S=()=>e.objectsGroup(),C=e=>S()?.getObjectByName(e)??null,w=()=>!!C(Ldt),T=()=>t&&a?a.get(t.gameState):null,E=(t,n=0)=>{let r=Number(e.game.getVar(t,n));return Number.isFinite(r)?r:n},D=(t,n)=>{E(t,NaN)!==n&&e.game.setVar(t,n)},O=()=>P7(E(Q7.level,0)),k=e=>(e.updateMatrixWorld(!0),new o.Box3().setFromObject(e)),A=e=>{let t=j7[e?.zone]??j7.pad,n=C(t.object);if(!n)return{center:[0,0,0],top:.2,footprint:t.footprint,yard:t.yard};let r=k(n);return{center:[(r.min.x+r.max.x)/2,0,(r.min.z+r.max.z)/2],top:r.max.y,footprint:t.footprint,yard:t.yard}},ee=()=>{let e={};for(let t of Object.values(M7))for(let n of t){let t=C(n);if(!t)continue;let r=k(t);e[n]={min:[r.min.x,r.min.y,r.min.z],max:[r.max.x,r.max.y,r.max.z]}}return e},j=()=>{let e={},t={};for(let[n,r]of Object.entries(A7)){let i=C(r.template);
2510if(!i)continue;e[n]=i;let a=k(i);t[n]=[a.max.x-a.min.x,a.max.y-a.min.y,a.max.z-a.min.z]}return{objects:e,sizes:t}},M=()=>(S()?.children??[]).filter(e=>e.userData?.transient&&/^Piece /.test(String(e.name??``))),te=e=>{let t=String(e.name??``).replace(/ copy$/,``);return Object.keys(A7).find(e=>A7[e].template===t)??`cube`},ne=()=>{if(!r||!a)return!1;if(a.get(r.simulating))return r.isInitiator();if(a.get(r.remoteSimulating))return!1;let t=e.peerId();return!t||[t,...e.peerIds()].filter(Boolean).sort()[0]===t},N=(t,n,r)=>{let i=C(t);i&&(Math.hypot(i.position.x-n[0],i.position.y-n[1],i.position.z-n[2])<.001&&(!r||Math.abs(i.scale.x-r[0])<.001)||e.moveObject(i.uuid,{pos:n,...r?{scale:r}:{}}))},P=e=>{let t=A(e),n=I7(e);e.goal.type===`outline`?(N(Y7,Z7),N(X7,[t.center[0],t.top+.6,t.center[2]])):(N(Y7,[t.center[0],n,t.center[2]]),N(X7,Z7));let r=t.yard/zdt;N(Rdt,[t.center[0],.02,t.center[2]],[r,r,1])},re=n=>{let r=P7(n);if(!r||!t)return!1;if(!V7(b(),n))return e.announce(`Level `+n+` is locked`,{sub:`Earn a star on level `+(n-1)+` first`,ms:2200,color:`#ffb86b`}),!1;ie(r),y.levels.select(String(n)),y.round.configure(0,0,`lose`,2),x=!0;try{y.round.restart()}finally{x=!1}return P(r),!0},ie=e=>{D(Q7.level,e.id),D(Q7.status,q7.playing);for(let e of[Q7.height,Q7.peak,Q7.lost,Q7.hold,Q7.stars,Q7.time,Q7.used,Q7.filled])D(e,0);D(Q7.dealt,-1),D(Q7.left,F7(e))},F=()=>{t&&(D(Q7.status,q7.none),D(Q7.level,0),y.round.toMenu(),ae(),N(Y7,[0,I7(P7(1)),0]),N(X7,Z7))},ae=()=>{if(i&&r)for(let e of M())r.physicsRemoveBody?.(e.uuid),i.removeTransientObject(e.uuid)},I=(t,i)=>{if(!n||!r||!r.isInitiator())return!1;let{objects:a,sizes:o}=j(),s=Adt(t,ee(),o);ae();for(let t of s){let i=a[t.shape];if(!i)continue;let o=k(i),s=[t.pos[0]+i.position.x-(o.min.x+o.max.x)/2,t.pos[1]+i.position.y-(o.min.y+o.max.y)/2,t.pos[2]+i.position.z-(o.min.z+o.max.z)/2],c=n.duplicateObject(i.uuid,{select:!1,history:!1,transient:!0,at:s});c&&(t.yaw&&e.moveObject(c.uuid,{rot:[0,t.yaw,0]}),r.physicsAddBody(c.uuid))}return D(Q7.dealt,i),D(Q7.left,s.length),!0},L=n=>{let a=T(),o=O();if(!a||a.state!==`playing`||!o||E(Q7.status)!==q7.playing||n-u<Bdt)return;u=n,l!==a.round&&(c=null,l=a.round,h.clear());let s=M();if(E(Q7.dealt,-1)!==a.round||s.length===0){r?.isInitiator()&&I(o,a.round);return}if(!r?.isInitiator())return;let p=new Map((r.physicsDebug?.()??[]).map(e=>[e.uuid,e])),m=A(o),g=Object.values(ee()),_=t.gameElapsed(),v=s.map(e=>{let t=k(e),n=p.get(e.uuid),r=n?.linvel;return{object:e,uuid:e.uuid,shape:te(e),pos:[(t.min.x+t.max.x)/2,(t.min.y+t.max.y)/2,(t.min.z+t.max.z)/2],min:[t.min.x,t.min.y,t.min.z],max:[t.max.x,t.max.y,t.max.z],top:t.max.y,bottom:t.min.y,speed:r?Math.hypot(r.x,r.y,r.z):0,held:!!n?.hold,dealtAt:e.userData?.towersSlot??null}}),b=E(Q7.lost),x=!1;for(let e of v){if(!Mdt(e,m,g)){h.delete(e.uuid);continue}let t=h.get(e.uuid)??_;h.set(e.uuid,t),!(_-t<1.2)&&(h.delete(e.uuid),e.shape===`star`?x=!0:b++,r.physicsRemoveBody?.(e.uuid),i.removeTransientObject(e.uuid))}D(Q7.lost,b);let C=v.filter(e=>S()?.getObjectByProperty(`uuid`,e.uuid)),w=jdt(C,m),j=C.some(e=>e.held&&Math.hypot(e.pos[0]-m.center[0],e.pos[2]-m.center[2])<=m.yard),ne=o.goal.type===`outline`?Ndt(m):[],N=ne.length?Pdt(ne,C):0,P=C.find(e=>e.shape===`star`),re=U7(C,m),ie=P?{top:P.top,inTower:re.includes(P)}:null,F=Idt(o,{elapsed:_,top:w,filled:N,cells:ne.length,star:ie,anyHeld:j,lost:b,starLost:x},c);if(c=F.memo,D(Q7.height,Math.round(w*100)),D(Q7.peak,Math.round(F.memo.peak*100)),y.score.set(Math.round(F.memo.peak*100)),D(Q7.hold,F.hold),D(Q7.filled,N),D(Q7.left,C.filter(e=>g.some(t=>e.pos[0]>=t.min[0]&&e.pos[0]<=t.max[0]&&e.pos[2]>=t.min[2]&&e.pos[2]<=t.max[2]&&e.bottom>=t.max[1]-.05)).length),o.wind){f!==a.round&&(f=a.round,d=-1);let t=W7(o,_);if(t&&t.index>d){d=t.index;for(let n of C){if(n.held||n.top<.9)continue;let r=Number(n.object.userData?.physics?.mass)||1,i=t.strength*r*Math.min(1.6,.5+n.top/3);e.physics.applyImpulse(n.uuid,[t.dir[0]*i,.05*i,t.dir[2]*i])}}}F.verdict&&oe(o,F.verdict,{elapsed:_,pieces:re.length})},oe=(e,t,n)=>{let r=t===`won`,i=L7(e,{won:r,time:n.elapsed,pieces:n.pieces});D(Q7.stars,i),D(Q7.time,Math.round(n.elapsed*10)),D(Q7.used,n.pieces),D(Q7.hold,0),D(Q7.status,q7[t]??q7.time),y.levels.complete(r,E(Q7.peak),n.elapsed,String(e.id),{pieces:n.pieces}),r?y.round.win(K7(t)):y.round.lose(K7(t))},R=t=>{let n=E(Q7.level,0),r=/^lvl-(\d+)$/.exec(t);if(r)return re(Number(r[1]));if(t===`retry-btn`||t===`restart-btn`)return n?re(n):!1;if(t===`next-btn`){let t=Odt(n);return t&&V7(b(),t)?re(t):t?(e.announce(`Level `+t+` is locked`,{sub:`Win this level to open it`,ms:2200,color:`#ffb86b`}),!1):(e.announce(`That was the last level`,{sub:`Every level is y
2510ours â try for three stars`,ms:2400,color:`#ffd45e`}),F())}return t===`levels-btn`||t===`quit-btn`?F():!1},se=()=>{let t=ne();for(let n of e.flow.nodes(`hudbutton`)){let r=String(n.data?.element??``);if(!/^(lvl-\d+|next-btn|retry-btn|levels-btn|restart-btn|quit-btn)$/.test(r))continue;let i=e.flow.triggerStamp(n.id),a=Number(i?.stamp)||0;if(!s.has(n.id)){s.set(n.id,a);continue}if(a===s.get(n.id))continue;let o=Number(i?.age??0)<Vdt;s.set(n.id,a);let c=/^lvl-(\d+)$/.exec(r);o&&(c&&!t&&!V7(b(),Number(c[1]))&&e.announce(`Level `+c[1]+` is locked`,{sub:`Earn a star on level `+(Number(c[1])-1)+` first`,ms:2200,color:`#ffb86b`}),t&&R(r))}},ce=n=>{let r=T(),i=O();if(!r||!i)return;let a=E(Q7.status);if(r.state===`playing`&&a===q7.playing&&_!==r.round){_=r.round,v=-1;let t=i.goal.type===`outline`?`Fill the ghost wall`:i.goal.type===`deliver`?`The star on top at `+I7(i).toFixed(1)+` m`:`Tower to `+I7(i).toFixed(1)+` m`;e.announce(`Level `+i.id+` · `+i.name,{sub:t+` â `+i.intro,ms:4200,color:`#ffd45e`}),e.playSound(`whistle`)}if(r.state===`playing`&&i.wind&&t){let n=t.gameElapsed(),a=W7(i,n),o=a?a.index+1:0,s=G7(i,o);if(s.at-n<=Hdt&&p<o+r.round*1e3&&(p=o+r.round*1e3,e.announce(`Gust from the `+Fdt(s.dir)+`!`,{ms:1300,color:`#9ee6ff`})),a&&m<a.index+r.round*1e3){m=a.index+r.round*1e3,e.playSound(`whoosh`);let t=A(i);e.effects.burst([t.center[0]-a.dir[0]*1.5,Math.max(1,E(Q7.height)/100),t.center[2]-a.dir[2]*1.5],{kind:`smoke`,count:48})}}if(r.state===`over`&&v!==r.round&&a>=q7.won){if(v=r.round,a===q7.won){e.playSound(`levelup`),e.hapticPattern(`success`);let t=A(i);e.effects.burst([t.center[0],Math.max(1.2,E(Q7.height)/100),t.center[2]],{kind:`confetti`,count:96})}else e.playSound(`fail`),e.hapticPattern(`fail`)}let o=M(),s=new Set(o.map(e=>e.uuid));for(let[t,i]of g)s.has(t)||(g.delete(t),r.state===`playing`&&n-i.t<1&&(e.effects.burst(i.pos,{kind:`smoke`,count:36}),e.playSound(`pop`,i.pos)));for(let t of o){let i=t.position,a=g.get(t.uuid),o=a?Math.max(.001,n-a.t):0,s=a?(i.y-a.pos[1])/o:0;a&&a.vy<-2.4&&s>-.6&&r.state===`playing`&&e.playSound(`hit`,[i.x,i.y,i.z]),g.set(t.uuid,{pos:[i.x,i.y,i.z],vy:s,t:n})}},le=e=>{let n=String(e?.read??`title`),r=O();if(n===`levelStars`){let t=Number(e?.level)||0;if(!P7(t))return``;let n=b();if(!V7(n,t))return`ð locked`;let r=n.levels[String(t)];return r?R7(r.stars):`âââ`}if(n===`levelName`){let t=P7(Number(e?.level)||0);return t?t.id+` · `+t.name:``}if(n===`menuLine`)return`Stars earned: `+kdt(b())+` / `+N7.length*3;if(!r)return n===`progress`||n===`height`||n===`goal`?0:``;let i=I7(r),a=E(Q7.height)/100;switch(n){case`title`:return`Level `+r.id+` · `+r.name;case`goalText`:return r.goal.type===`outline`?`Ghost wall `+E(Q7.filled)+` / 6 filled`:r.goal.type===`deliver`?`Star on top · `+i.toFixed(1)+` m`:`Goal `+i.toFixed(1)+` m · now `+a.toFixed(1)+` m`;case`goal`:return i;case`height`:return a;case`progress`:return r.goal.type===`outline`?E(Q7.filled)/6:i>0?Math.min(1,a/i):0;case`pieces`:return`Rack `+E(Q7.left)+` · lost `+E(Q7.lost)+`/`+r.lost;case`clock`:{let e=T()?.state===`playing`&&t?t.gameElapsed():0;return z7(r.limit-e)}case`hold`:{let e=E(Q7.hold);return e>0?`Hold steady⦠`+e:``}case`rule`:return r.rule??`Reach is limited to your arm â carry pieces close. Jump: Space / A.`;case`result`:return K7(J7(E(Q7.status)));case`resultStars`:return E(Q7.status)===q7.won?R7(E(Q7.stars)):`âââ`;case`resultLine`:return E(Q7.status)===q7.won?`Time `+z7(E(Q7.time)/10)+` (par `+z7(r.par.time)+`) · `+E(Q7.used)+` pieces (par `+r.par.pieces+`)`:({time:`The clock ran out.`,fell:`It came down â build wider at the bottom.`,lost:`Too many pieces fell outside the yard.`,star:`The star fell outside the yard.`}[J7(E(Q7.status))]??``)+` Best tower `+(E(Q7.peak)/100).toFixed(1)+` m.`;case`bestTower`:{let e=y.score.best();return e>0?`Tallest tower here: `+(e/100).toFixed(1)+` m`:``}case`resultBest`:{let e=b().levels[String(r.id)];return e?`Best on this device: `+R7(e.stars)+` `+z7(e.time):``}default:return``}};e.registerValueNode(`towersinfo`,e=>{let t=le(e);return t===``?` `:t},{vtype:`any`}),e.registerEffect(`towerswobble`,(e,t,n,r)=>{let i=O()?.zone===`wobble`&&T()?.state===`playing`&&Number(n?.amplitude??.07)||0,a=Math.max(1,Number(n?.period??3.4)||3.4),o=t?.rot??[0,0,0];e.rotation.x=o[0]+i*Math.sin(2*Math.PI*r/a),e.rotation.z=o[2]+i*.7*Math.sin(2*Math.PI*r/(a*1.37)+1.1)}),e.registerNodeGroup({group:`Towers`,items:[{type:`towersinfo`,label:`Towers info`,defaults:{read:`title`,level:1},params:[{key:`read`,kind:`select`,options:[`title`,`goalText`,`goal`,`height`,`progress`,`pieces`,`clock`,`hold`,`rule`,`result`,`resultStars`,`resultLine`,`resultBest`,`bestTower`,`levelName`,`levelStars`,`menuLine`]},{key:`level`,kind:`range`,min:1,max:N7.length,step:1}]},{type:`towerswobble`,label:`Towers wobble`,defaults:{amplitude:.07,period:3.4},params:[{key:`amplitude`,kind:`range`,min:0,max:.2,step:.01},{key:`period`,kind:`range`,min:1,max:10,step:.1}]}]});let ue=(e,t)=>
2510t?.stars>0?!e||!(e.stars>0)?t:{...t,stars:Math.max(e.stars,t.stars),time:e.time>0?Math.min(e.time,t.time):t.time,pieces:e.pieces>0?Math.min(e.pieces,t.pieces??0):t.pieces}:e??{...t,stars:0},de=null,z=()=>{w()&&(typeof de==`function`&&de(),de=y.levels.define({id:`towers`,list:N7.map(e=>({id:String(e.id),label:e.id+` · `+e.name})),unlock:`sequential`,stars:(e,t)=>L7(P7(Number(e.id)),{won:t.won,time:t.time,pieces:t.pieces??0}),merge:ue,store:{get:()=>e.storage?.get?.(`progress`,null),set:t=>e.storage?.set?.(`progress`,B7(t))}}))};y.levels.onSelected(e=>{if(e?.game!==`towers`||!w()||!ne())return;let t=Number(e.level);P7(t)&&E(Q7.level,0)!==t&&re(t)}),y.round.onStarted(()=>{if(x||!w()||!ne())return;let e=O();if(!e){y.round.toMenu();return}ie(e),P(e)});let fe=[`Build a tower to the gold ring. Carry pieces from the racks to the glowing zone.`,`You can only grab what is close to your body (about 1.3 m): build steps, climb them, and JUMP (Space / A) to reach higher.`,`A finished tower must hold still for 3 seconds. Pieces left outside the glowing yard are lost.`,`Stars: one for finishing, one for par pieces, one for par time. A star opens the next level.`],pe=null,B=null;e.onMessage(e=>{e?.op===`pick`&&ne()&&re(Number(e.level))});let me=!1,V=e=>{e?(y.rules.set({reach:1.3,jump:1}),me=!0):me&&=(y.rules.clearRules(),!1)},he=!1;e.registerFrameTask(n=>{if(!t||!a)return;let r=w();r!==he&&(he=r,r&&z(),V(r),r&&typeof e.game?.setHelp==`function`&&(pe=e.game.setHelp(fe)),r&&(B=e.input?.actions?.([`grab`],{preset:`explore`})??null),!r&&B&&(B(),B=null),!r&&pe&&(pe(),pe=null),!r&&typeof de==`function`&&(de(),de=null)),r&&(se(),ne()&&L(n),ce(n))}),e.onSceneClear(()=>{pe&&=(pe(),null),B?.(),B=null,typeof de==`function`&&(de(),de=null),me=!1,s.clear(),g.clear(),h.clear(),c=null,_=-1,v=-1,he=!1}),globalThis.__towers={levels:N7,progress:()=>b(),resetProgress:()=>{e.storage?.remove?.(`progress`),y.levels.refresh()},setProgress:t=>(e.storage?.set?.(`progress`,B7(t)),y.levels.refresh(),b()),reloadProgress:()=>b(),authority:ne,pieces:()=>M().map(e=>({uuid:e.uuid,name:e.name,shape:te(e),pos:e.position.toArray()})),info:le,vars:()=>Object.fromEntries(Object.values(Q7).map(t=>[t,e.game.getVar(t,null)])),zone:()=>A(O()),startLevel:re,kit:()=>({round:y.round.state(),level:y.levels.current(),score:y.score.total(),best:y.score.best(),rules:y.rules.current(),table:y.levels.table()}),finishNow:e=>{let n=O();n&&t&&T()?.state===`playing`&&oe(n,e,{elapsed:t.gameElapsed(),pieces:Math.min(n.par.pieces,F7(n))})}}}},Wdt=`Escape game`,$7={drawer:1,key:2,chest:4,crank:8,studyDoor:16,sun:32,note:64,fitted:128,hatch:256,moon:512,levers:1024,star:2048,gate:4096,vault:8192},e9={sun:1,moon:2,star:4},t9=[3,7,1],n9=[`right`,`left`,`middle`],r9=8,i9={flags:`esFlags`,placed:`esPlaced`,d1:`esD1`,d2:`esD2`,d3:`esD3`,lev:`esLev`,turns:`esTurns`,start:`esStart`},a9=[0,$7.drawer|$7.key|$7.chest|$7.crank|$7.studyDoor|$7.sun|$7.note,0];a9[2]=a9[1]|$7.fitted|$7.hatch|$7.moon|$7.levers|$7.star|$7.gate;var o9=.32,s9=[{name:`The Study`,spawn:[-8,0,2.6],yaw:0,hint:`The desk drawer sticks, but it opens. A key opens more than one lock.`},{name:`The Workshop`,spawn:[-2.6,0,0],yaw:-Math.PI/2,hint:`The note says 3 · 7 · 1 for the dials, and RIGHT · LEFT · MIDDLE for the levers. The crank fits the socket by the gate â keep turning it.`},{name:`The Vault`,spawn:[5.4,0,0],yaw:-Math.PI/2,hint:`Each pedestal wants the gem of its colour: gold sun, pale moon, violet star.`}],Gdt=`The note reads: "DIALS 3 · 7 · 1 â LEVERS right, left, middle â the crank lifts the gate."`,c9=60,Kdt={id:`escape`,name:`The Alchemist's Escape`,version:`1.0.0`,description:`The Alchemist's Escape: three rooms of drawers, keys, dials, levers and a crank to twist â find the gems and get out. Best time saved on this device.`,register(e){let t=null,n=null;Promise.all([$(()=>import(`../chunks/DHWg9jzn.js`).then(e=>e.s),__vite__mapDeps([13,1,2,10]),import.meta.url),$(()=>import(`../chunks/OHQUSm6n.js`).then(e=>e.s),__vite__mapDeps([2,1]),import.meta.url)]).then(([e,r])=>{t=e,n=r});let r=e.THREE,i=()=>e.objectsGroup(),a=e=>i()?.getObjectByName(e)??null,o=()=>!!a(Wdt),s=()=>t&&n?n.get(t.gameState):null,c=()=>{let e=s()?.state;return e===`playing`||e===`paused`||e===`over`},l=(t,n=0)=>{let r=Number(e.game.getVar(t,n));return Number.isFinite(r)?r:n}
2510,u=(t,n)=>{l(t,NaN)!==n&&e.game.setVar(t,n)},d=()=>c()?l(i9.flags):0,f=()=>c()?l(i9.placed):0,p=e=>(d()&e)!==0,m=e=>u(i9.flags,l(i9.flags)|e),h=()=>[l(i9.d1),l(i9.d2),l(i9.d3)],g=()=>{let t=String(e.peerId?.()??``);return(e.peerIds?.()??[]).map(String).every(e=>!t||t<=e)},_=()=>{let t=e.playerPosition?.();return Array.isArray(t)?t:null},v=e=>e<-4?0:e<4?1:2,y=(t,n={})=>e.announce?.(t,{ms:2600,color:`#ffd9a0`,...n}),b=(t,n)=>e.playSound?.(t,n),x=e=>{let t=a(e);if(!t)return;let n=new r.Vector3;return t.getWorldPosition(n),[n.x,n.y,n.z]},S=e=>{if(!o()||s()?.state!==`playing`)return!1;switch(e){case`Desk drawer`:return p($7.drawer)?p($7.key)?y(`An empty drawer.`):y(`A brass key lies in the drawer.`):m($7.drawer),!0;case`Brass key`:return p($7.drawer)&&!p($7.key)&&m($7.key),!0;case`Chest lid`:case`Chest body`:return p($7.chest)||(p($7.key)?m($7.chest):(y(`The chest is locked.`,{sub:`There is a small brass keyhole.`}),b(`fail`,x(`Chest body`)))),!0;case`Crank`:return p($7.chest)&&!p($7.crank)&&m($7.crank),!0;case`Old note`:return p($7.note)||m($7.note),y(Gdt,{ms:6500,color:`#f3e3b8`}),b(`pop`,x(`Old note`)),!0;case`Sun gem`:return p($7.sun)||m($7.sun),!0;case`Study door`:return p($7.studyDoor)||(p($7.key)?m($7.studyDoor):(y(`The study door is locked.`,{sub:`Find its key.`}),b(`fail`,x(`Study door`)))),!0;case`Dial 1`:case`Dial 2`:case`Dial 3`:{if(p($7.hatch))return!0;let t=e===`Dial 1`?i9.d1:e===`Dial 2`?i9.d2:i9.d3;u(t,(l(t)+1)%10),b(`click`,x(e));let n=h();return n[0]===t9[0]&&n[1]===t9[1]&&n[2]===t9[2]&&m($7.hatch),!0}case`Moon gem`:return p($7.hatch)&&!p($7.moon)&&m($7.moon),!0;case`Lever left`:case`Lever middle`:case`Lever right`:{if(p($7.levers))return!0;let t=e.slice(6),n=l(i9.lev);return n9[n]===t?(u(i9.lev,n+1),n+1>=n9.length&&m($7.levers)):(u(i9.lev,0),y(`Clunk â the levers spring back.`,{sub:`Wrong order.`,color:`#ffb86b`}),b(`fail`,x(e))),!0}case`Star gem`:return p($7.levers)&&!p($7.star)&&m($7.star),!0;case`Crank socket`:case`Fitted crank`:if(p($7.gate))return!0;if(!p($7.fitted))return p($7.crank)?m($7.fitted):(y(`An empty square socket.`,{sub:`Something with a handle would fit.`}),b(`fail`,x(`Crank socket`))),!0;{let e=l(i9.turns)+1;u(i9.turns,e),e>=r9&&m($7.gate)}return!0;case`Pedestal sun`:case`Pedestal moon`:case`Pedestal star`:{let t=e.slice(9),n=t===`sun`?e9.sun:t===`moon`?e9.moon:e9.star,r=t===`sun`?$7.sun:t===`moon`?$7.moon:$7.star;if(f()&n)return!0;if(!p(r))return y(`This pedestal wants the `+t+` gem.`,{color:`#c7b8ff`}),!0;let i=l(i9.placed)|n;return u(i9.placed,i),i===7&&m($7.vault),!0}case`Workshop gate`:return p($7.gate)||(y(`The iron gate is down.`,{sub:p($7.fitted)?`Keep turning the crank.`:`There is an empty square socket in the wall beside it.`}),b(`fail`,x(`Workshop gate`))),!0;case`Vault door`:return p($7.vault)?E():(y(`The vault door will not move.`,{sub:`Three pedestals wait for three gems.`}),b(`fail`,x(`Vault door`))),!0;case`Hint crystal 1`:case`Hint crystal 2`:case`Hint crystal 3`:return T(Number(e.slice(-1))-1),!0;case`Exit portal`:return p($7.vault)&&E(),!0}return!1},C=[0,0,0],w=0,T=(e=w)=>{let n=t?t.gameElapsed():0,r=Math.ceil(c9-(n-C[e]));if(r>0){y(`The crystal is still gathering lightâ¦`,{sub:`A hint for this room in `+r+` s. Press H then.`,color:`#9ee6ff`}),b(`sparkle`);return}y(`Hint â `+s9[e].name,{sub:s9[e].hint,ms:7e3,color:`#9ee6ff`}),b(`sparkle`)},E=()=>{t&&s()?.state===`playing`&&t.setGameState(`over`,{outcome:`won`})};e.registerClickHandler(e=>{if(!o())return!1;for(let t=e;t&&t!==i();t=t.parent)if(t.name&&S(t.name))return!0;return!1},{modes:[`interact`,`play`]}),e.onInput?.((e,t)=>{o()&&s()?.state===`playing`&&e===`down`&&t===`KeyH`&&T()});let D=new Map,O=e=>{let t=D.get(e.uuid);return t||(t={pos:e.position.clone(),rot:e.rotation.clone()},D.set(e.uuid,t)),t},k=(e,t,n,r)=>{let i=a(e);if(!i)return;let o=O(i),s=Math.min(1,r*6);i.position.x+=(o.pos.x+t[0]-i.position.x)*s,i.position.y+=(o.pos.y+t[1]-i.position.y)*s,i.position.z+=(o.pos.z+t[2]-i.position.z)*s,i.rotation.x+=(o.rot.x+n[0]-i.rotation.x)*s,i.rotation.y+=(o.rot.y+n[1]-i.rotation.y)*s,i.rotation.z+=(o.rot.z+n[2]-i.rotation.z)*s},A=(e,t)=>
2510{let n=a(e);n&&n.visible!==t&&(n.visible=t)},ee=-1,j=0,M=0,te=0,ne=``,N=-1,P=0,re=0,ie=()=>{let t=d(),n=f(),r=c()?l(i9.turns):0,i=c()?l(i9.lev):0;if(ee<0){ee=t,j=n,M=r,te=i;return}let a=e=>(t&e)!==0&&(ee&e)===0;if(a($7.drawer)&&b(`lid`,x(`Desk drawer`)),a($7.key)&&(y(`You take the brass key.`,{color:`#ffd45e`}),b(`coin`)),a($7.chest)&&(y(`Unlocked! The chest creaks open.`,{sub:`A crank and an old note inside.`,color:`#ffd45e`}),b(`lid`,x(`Chest body`)),b(`success`)),a($7.crank)&&(y(`You take the iron crank.`),b(`coin`)),a($7.sun)&&(y(`The sun gem!`,{sub:`1 of 3 gems`,color:`#ffd45e`}),b(`sparkle`),e.effects?.burst?.(x(`Sun gem`)??[0,1,0],{kind:`sparkle`,color:`#ffd45e`})),a($7.studyDoor)&&(y(`Click â the study door unlocks.`,{color:`#ffd45e`}),b(`door`,x(`Study door`))),a($7.hatch)&&(y(`A hatch springs open above the dials!`,{sub:`The moon gem.`,color:`#cfe6ff`}),b(`success`,x(`Dial hatch`))),a($7.moon)&&(y(`The moon gem!`,{sub:`Pale and cold.`,color:`#cfe6ff`}),b(`sparkle`)),a($7.levers)&&(y(`Gears whirr â something rolls into the tray.`,{sub:`The star gem.`,color:`#d6b8ff`}),b(`success`,x(`Star tray`))),a($7.star)&&(y(`The star gem!`,{color:`#d6b8ff`}),b(`sparkle`)),a($7.fitted)&&(y(`The crank fits the socket.`,{sub:`Now TURN it â click again and again.`,color:`#ffd9a0`}),b(`click`,x(`Crank socket`))),r>M&&!(t&$7.gate)&&b(`gate`,x(`Workshop gate`)),a($7.gate)&&(y(`The iron gate is up!`,{sub:`The vault lies beyond.`,color:`#ffd45e`}),b(`levelup`)),i>te&&b(`lever`,x([`Lever right`,`Lever left`,`Lever middle`][i-1])),n!==j)for(let[t,r]of Object.entries(e9))n&r&&!(j&r)&&(b(`success`,x(`Pedestal `+t)),e.effects?.burst?.(x(`Pedestal `+t)??[0,1,0],{kind:`sparkle`}));a($7.vault)&&(y(`The vault door grinds open!`,{sub:`Step through to escape.`,color:`#7dffb0`,ms:4e3}),b(`door`,x(`Vault door`)),e.hapticPattern?.(`success`)),ee=t,j=n,M=r,te=i},F=e=>{let n=d(),r=f(),i=c()?h():[0,0,0],o=c()?l(i9.turns):0,s=c()?l(i9.lev):0,u=(n&$7.levers)!==0;k(`Desk drawer`,[0,0,n&$7.drawer?.38:0],[0,0,0],e),A(`Brass key`,(n&$7.drawer)!==0&&!(n&$7.key)),k(`Brass key`,[0,0,n&$7.drawer?.38:0],[0,0,0],e),k(`Chest lid`,[0,0,0],[n&$7.chest?-1.9:0,0,0],e),A(`Crank`,(n&$7.chest)!==0&&!(n&$7.crank)),A(`Sun gem`,!(n&$7.sun)),k(`Study door`,[0,0,n&$7.studyDoor?1.55:0],[0,0,0],e);for(let t=0;t<3;t++)k(`Dial `+(t+1),[0,0,0],[0,i[t]*Math.PI*2/10,0],e);k(`Dial hatch`,[0,n&$7.hatch?.5:0,0],[0,0,0],e),A(`Moon gem`,(n&$7.hatch)!==0&&!(n&$7.moon)),[`right`,`left`,`middle`].forEach((t,n)=>k(`Lever `+t,[0,0,0],[u||s>n?-1.1:0,0,0],e)),A(`Star gem`,u&&!(n&$7.star)),A(`Fitted crank`,(n&$7.fitted)!==0),k(`Fitted crank`,[0,0,0],[-o*Math.PI/2,0,0],e),k(`Workshop gate`,[0,2.3*Math.min(o,r9)/r9,0],[0,0,0],e);for(let[e,t]of Object.entries(e9))A(`Placed `+e,(r&t)!==0);k(`Vault door`,[0,0,n&$7.vault?-1.55:0],[0,0,0],e),A(`Exit portal`,(n&$7.vault)!==0);let p=t&&c()?t.gameElapsed():0;for(let t=0;t<3;t++){let n=a(`Hint crystal `+(t+1));if(!n)continue;let r=c()&&t===w&&p-C[t]>=c9,i=r?1+.25*Math.sin(p*4):1;n.scale.setScalar(i),n.rotation.y+=e*(r?2:.4)}let m=a(`Room lamp`);if(m){let t=_(),n=[-8,0,8][t?v(Math.min(t[0],11.9)):w];m.position.x+=(n-m.position.x)*Math.min(1,e*3)}},ae=n=>{let r=_();if(!r||s()?.state!==`playing`||e.isPlaying?.()===!1)return;let i=d(),a=r[0],o=1/0;if(i&$7.studyDoor?i&$7.gate?i&$7.vault||(o=11.85):o=3.85:o=-4.15,a>o&&n-re>1){re=n;let t=v(Math.min(a,o-.5));e.setSpawn?.([o-.75,0,Math.max(-.6,Math.min(.6,r[2]))],-Math.PI/2),e.respawnPlayer?.(),e.setSpawn?.(s9[t].spawn,s9[t].yaw),y(`The way is shut.`,{ms:1400,color:`#ffb86b`}),e.hapticPattern?.(`bump`)}i&$7.vault&&a>12.7&&E();let c=v(a);c!==w&&(w=c,C[c]=t?t.gameElapsed():0,e.setSpawn?.(s9[c].spawn,s9[c].yaw),y(s9[c].name,{ms:1800,color:`#f3e3b8`}))},I=e=>{let t=Math.max(0,e);return Math.floor(t/60)+`:`+String(Math.floor(t%60)).padStart(2,`0`)},L=()=>Number(e.storage?.get?.(`best`,0))||0,oe=e=>{let n=d(),r=f();switch(String(e?.read??`room`)){case`room`:return s9[w].name;case`clock`:return I(t?t.gameElapsed():0);case`inventory`:{let e=[];return n&$7.key&&e.push(`Key`),n&$7.crank&&!(n&$7.fitted)&&e.push(`Crank`),n&$7.note&&e.push(`Note`),n&$7.sun&&!(r&e9.sun)&&e.push(`Sun gem`),n&$7.moon&&!(r&e9.moon)&&e.push(`Moon gem`),n&$7.star&&!(r&e9.star)&&e.push(`Star gem`),`Carrying: `+(e.length?e.join(` · `):`nothing`)}case`gems`:return`Gems `+[$7.sun,$7.moon,$7.star].filter(e=>n&e).length+` / 3`;case`goal`:return n&$7.studyDoor?n&$7.gate?n&$7.vault?`The door is open â escape!`:`Place the three gems on their pedestals`:`Open the iron gate · dials `+h().join(` · `)+` · crank `+Math.min(l(i9.turns),r9)+`/8`+(n&$7.note?` â note: `+t9.join(`·`)+`, levers `+n9.map(e=>e[0].toUpperCase()).join(`·`):``):`Find a way out of the study`;case`result`:return`You escaped in `+I(R);case`best`:{let e=L();return e>0?`Best escape on this device: `+I(e):` `}case`menuBest`:{let e=L();return e>0?`Your best escape: `+I(e):`Three rooms. Three gems. One way out.`}}return` `},R=0;e.registerValueNode(`escapeinfo`,e=>
2510{let t=oe(e);return t===``?` `:t},{vtype:`any`}),e.registerNodeGroup({group:`Escape`,items:[{type:`escapeinfo`,label:`Escape info`,defaults:{read:`room`},params:[{key:`read`,kind:`select`,options:[`room`,`clock`,`inventory`,`gems`,`goal`,`result`,`best`,`menuBest`]}]}]});let se=[`You are locked in the alchemist's house. Three rooms, three gems, one way out.`,`Click things to use them (VR: point and pull the trigger). What you pick up is listed at the top.`,`Walk with WASD (VR: stick or teleport). Turn the crank by clicking it again and again.`,`Stuck? Touch the blue hint crystal in each room, or press H â a hint arrives after a minute in a room.`],ce=null,le=null,ue=()=>{for(let e of Object.values(i9))u(e,0)},de=e=>{t&&(z=e,s()?.state===`playing`&&t.setGameState(`menu`),t.setGameState(`playing`))},z=-1,fe=e=>{ue(),u(i9.start,e),!(e<=0)&&(u(i9.flags,a9[e]),e>=2&&(u(i9.d1,t9[0]),u(i9.d2,t9[1]),u(i9.d3,t9[2]),u(i9.lev,3),u(i9.turns,r9)))},pe=null,B=()=>{typeof e.game?.levels==`function`&&(pe=e.game.levels({list:s9.map((e,t)=>({id:String(t+1),label:t+1+` · `+e.name+(t?` (practice)`:``)})),current:String(w+1),onPick:e=>de(Number(e)-1)}))},me=!1,V=0,he=()=>{let t=e.pointerRay?.(),n=a(`Fitted crank`);if(!t||!n||!n.visible)return!1;let r=t.intersectObject(n,!0)[0];return!!r&&r.distance<4},H=e=>{e.button===0&&o()&&s()?.state===`playing`&&p($7.fitted)&&!p($7.gate)&&he()&&(me=!0,V=0)},ge=()=>me=!1;window.addEventListener(`pointerdown`,H,!0),window.addEventListener(`pointerup`,ge,!0),e.onUnload?.(()=>{window.removeEventListener(`pointerdown`,H,!0),window.removeEventListener(`pointerup`,ge,!0)});let U=!1,W=t=>{if(e.isVR?.()){let t=e.input?.()?.vrButtons??{},n=!!(t.rtrigger||t.ltrigger||t.rsqueeze||t.lsqueeze);n&&!U&&p($7.fitted)&&!p($7.gate)&&s()?.state===`playing`&&he()&&(me=!0,V=0),!n&&U&&(me=!1),U=n}if(me){if(p($7.gate)||s()?.state!==`playing`){me=!1;return}V+=t,V>=o9&&(V-=o9,he()?S(`Fitted crank`):me=!1)}},_e=!1;e.registerFrameTask(r=>{if(!t||!n)return;let i=o();if(i!==_e&&(_e=i,i&&typeof e.game?.setHelp==`function`&&(ce=e.game.setHelp(se)),i&&(le=e.input?.actions?.([`interact`,{id:`hint`,label:`Hint`,keys:[`KeyH`]}],{preset:`explore`})??null),!i&&le&&(le(),le=null),!i&&ce&&(ce(),ce=null),i&&e.game?.onRestart?.(()=>g()&&fe(l(i9.start))),i&&B(),!i&&typeof pe==`function`&&(pe(),pe=null)),!i)return;let a=Math.min(.1,Math.max(0,r-P));P=r;
2510let c=s();if(c&&c.state===`playing`&&c.round!==N){N=c.round;let t=Math.max(0,z);z=-1,g()&&fe(t),w=t,C=[0,0,0],ee=-1,e.setSpawn?.(s9[t].spawn,s9[t].yaw,{teleport:t>0}),y(t?s9[t].name+` (practice)`:`The Alchemist's Escape`,{sub:t?`The rooms before it are already open.`:`Find the three gems and get out.`,ms:2400,color:`#ffd45e`}),e.music?.play?.(`dungeon`,{volume:.35})}if(c&&c.state!==ne){if(c.state===`over`&&ne===`playing`&&c.outcome===`won`){R=t.gameElapsed();let n=L();l(i9.start)===0&&(!(n>0)||R<n)&&e.storage?.set?.(`best`,Math.round(R*10)/10),e.music?.stop?.(),b(`cheer`),e.announce?.(`You escaped!`,{sub:`in `+I(R),ms:4e3,color:`#7dffb0`}),e.effects?.burst?.(_()??[13,1.5,0],{kind:`confetti`})}c.state===`menu`&&e.music?.stop?.(),ne=c.state}W(a),F(a),ie(),ae(r)}),e.onSceneClear(()=>{typeof pe==`function`&&(pe(),pe=null),me=!1,ce&&=(ce(),null),le?.(),le=null,D.clear(),_e=!1,ee=-1,N=-1,ne=``}),globalThis.__escape={act:S,flags:()=>d(),placed:()=>f(),info:oe,room:()=>w,best:L,startStage:de,twisting:()=>me,solve:()=>{for(let e of[`Desk drawer`,`Brass key`,`Chest lid`,`Crank`,`Old note`,`Sun gem`,`Study door`])S(e)}}}},qdt=`Marble Maze game`,l9=[0,1.1,-.75],u9=15*Math.PI/180,Jdt=.09,Ydt=2,Xdt=2.5,d9=[{id:1,name:`First roll`,par:25},{id:2,name:`Pits`,par:35},{id:3,name:`Labyrinth`,par:50},{id:4,name:`Gatehouse`,par:60},{id:5,name:`The gauntlet`,par:75}],f9={level:`mmLevel`,status:`mmStatus`,coins:`mmCoins`,falls:`mmFalls`,time:`mmTime`,stars:`mmStars`},p9={none:0,playing:1,won:2},Zdt=[`Tilt the board to roll the marble to the gold ring.`,`Desktop: WASD or the arrow keys tilt the board; or hold the mouse button and drag.`,`VR: grip both handles and twist or tip the board (one hand works too), or tilt with the left stick.`,`A hole sends the marble back to the start and puts the coins back. Gates on mazes 4 and 5 rise and sink â time your run.`,`Stars: one for reaching the goal, one for all three coins, one for beating the par time.`],m9=(e,t,n)=>Math.max(t,Math.min(n,e)),h9=e=>`â
`.repeat(e)+`â`.repeat(Math.max(0,3-e)),g9=e=>{let t=Math.max(0,e);return Math.floor(t/60)+`:`+String(Math.floor(t%60)).padStart(2,`0`)+`.`+Math.floor(t*10%10)},_9=(e,t)=>1+ +(t.coins>=3)+ +(t.time<=(e?.par??0)),Qdt={id:`marble`,name:`Marble Maze`,version:`1.0.0`,description:`The Marble Maze game: tilt the board and roll the marble to the goal â five mazes, holes, coins, gates and stars saved on this device.`,register(e){let t=null,n=null,r=null,i=null;Promise.all([$(()=>import(`../chunks/DHWg9jzn.js`).then(e=>e.s),__vite__mapDeps([13,1,2,10]),import.meta.url),$(()=>import(`../chunks/B3B8hjh_.js`).then(e=>e.v),__vite__mapDeps([157,1,2,6,9,0,3,4,38,39,5,7,48,10,14,32,13,30,31,57,58,18,19,20,21,22,23,11,12,8,24,25,26,27,28,29,33,34,35,36,37,40,41,42,43,44,45,46,47,49,50,16,51,52,53,54,55,56,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,158,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url),$(()=>import(`../chunks/OHQUSm6n.js`).then(e=>e.s),__vite__mapDeps([2,1]),import.meta.url),$(()=>import(`../chunks/BjxZzSo2.js`).then(e=>e.O),__vite__mapDeps([0,1,2,3,4]),import.meta.url)]).then(([e,a,o,s])=>{t=e,n=a,r=o,i=s});let a=e.THREE,o=e.kit;o.score.useGame?.(`marble`);let s=()=>e.objectsGroup(),c=e=>s()?.getObjectByName(e)??null,l=()=>!!c(qdt),u=()=>t&&r?r.get(t.gameState):null,d=(t,n=0)=>{let r=Number(e.game.getVar(t,n));return Number.isFinite(r)?r:n},f=(t,n)=>{d(t,NaN)!==n&&e.game.setVar(t,n)},p=()=>d9.find(e=>e.id===d(f9.level,0))??null,m=()=>d(f9.level,0)||1,h=()=>o.levels.progress?.()??{levels:{}},g=()=>!!e.isVR?.(),_=()=>u()?.state===`playing`&&d(f9.status)===p9.playing,v=()=>{if(!n||!r)return!1;if(r.get(n.simulating))return n.isInitiator();if(r.get(n.remoteSimulating))return!1;let t=e.peerId();return!t||[t,...e.peerIds()].filter(Boolean).sort()[0]===t},y={x:0,z:0},b=null,x={x:0,z:0,at:-1e9},S=0,C=!0,w=null,T=null,E={x:0,z:0},D=t=>e.vrHand?.(t)??null;e.onMessage(e=>{e?.op===`tilt`&&Number.isFinite(e.x)&&Number.isFinite(e.z)&&(x={x:m9(e.x,-u9,u9),z:m9(e.z,-u9,u9),at:performance.now()}),e?.op===`pick`&&v()&&oe(Number(e.level))});let O=(t,n,r)=>typeof e.listen==`function`?e.listen(t,n,r):(t.addEventListener(n,r),()=>t.removeEventListener(n,r));typeof window<`u`&&(O(window,`pointerdown`,e=>{l()&&_()&&!g()&&e.button===0&&e.target instanceof HTMLCanvasElement&&(w={x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY})}),O(window,`pointermove`,e=>{w&&(w.x=e.clientX,w.y=e.clientY)}),O(window,`pointerup`,()=>w=null));let k=t=>{if(b=null,!_()){T=null,w=null;return}let n=e.input?.()??{codes:new Set,axes:{}},r=n.codes??new Set,i=(r.has(`KeyS`)||r.has(`ArrowDown`)?1:0)-(r.has(`KeyW`)||r.has(`ArrowUp`)?1:0),o=(r.has(`KeyA`)||r.has(`ArrowLeft`)?1:0)-(r.has(`KeyD`)||r.has(`ArrowRight`)?1:0),s=Math.min(1,t*6);if(E.x+=(i*u9-E.x)*s,E.z+=(o*u9-E.z)*s,(i||o||Math.abs(E.x)>.002||Math.abs(E.z)>.002)&&(b={x:E.x,z:E.z}),w&&(b={x:m9((w.y-w.y0)/160,-1,1)*u9,z:m9(-(w.x-w.x0)/160,-1,1)*u9}),!g())return;let c=n.axes??{},l=Number(c.lx)||0,u=Number(c.ly)||0;(Math.abs(l)>.15||Math.abs(u)>.15)&&(b={x:u*u9,z:-l*u9});let d=D(`left`),f=D(`right`),p=[d,f].filter(e=>e?.gripped&&e.position&&Math.hypot(e.position[0]-l9[0],e.position[2]-l9[2])<.75&&Math.abs(e.position[1]-l9[1])<.5);if(!p.length){T=null;return}let m=p.map(e=>e===d?`L`:`R`).join(``),h=e=>new a.Quaternion(e.quaternion[0],e.quaternion[1],e.quaternion[2],e.quaternion[3]),v=()=>Math.atan2(f.position[1]-d.position[1],Math.hypot(f.position[0]-d.position[0],f.position[2]-d.position[2]));(!T||T.key!==m)&&(T={key:m,q0:p.map(e=>h(e)),roll0:m===`LR`?v():0,x0:y.x,z0:y.z},e.hapticPattern?.(`tap`,p.length===2?`both`:p[0]===d?`left`:`right`));let x=0,S=0;p.forEach((e,t)=>{let n=h(e).multiply(T.q0[t].clone().invert()),r=new a.Euler().setFromQuaternion(n,`XYZ`);x+=r.x/p.length,S+=r.z/p.length}),m===`LR`&&(S=v()-T.roll0),b={x:m9(T.x0+x,-u9,u9),z:m9(T.z0+S,-u9,u9)}},A=t=>{let n=performance.now(),r={x:0,z:0};b?r={x:m9(b.x,-u9,u9),z:m9(b.z,-u9,u9)}:n-x.at<400&&(r=x);let i=Math.min(1,t*12),a=Ydt*t;y.x+=m9((r.x-y.x)*i,-a,a),y.z+=m9((r.z-y.z)*i,-a,a),b&&n-S>66?(S=n,C=!1,e.send({op:`tilt`,x:+r.x.toFixed(4),z:+r.z.toFixed(4)})):!b&&!C&&(C=!0,e.send({op:`tilt`,x:0,z:0}))},ee=()=>new a.Quaternion().setFromEuler(new a.Euler(y.x,0,y.z,`XYZ`)),j=()=>new a.Matrix4().compose(new a.Vector3(...l9),ee(),new a.Vector3(1,1,1)),M=(e,t)=>{let n=((e/3+t)%1+1)%1,r=e=>e*e*(3-2*e);return n<.4?0:n<.5?r((n-.4)/.1):n<.9?1:1-r((n-.9)/.1)};e.registerEffect(`marbletilt`,(e,t,n,r)=>{if(!l())return;let i=Number(n?.maze)||1;if(i!==m()){let r=n?.gate?t?.pos??[0,-4,0]:[(i-3)*1.2,-4,2];e.position.set(r[0],r[1],r[2]),e.rotation.set(0,0,0),e.visible=!1;return}e.visible=!0;let o=ee(),s=n?.gate?new a.Vector3(Number(n.lx)||0,Jdt/2-M(r,Number(n.phase)||0)*.09999999999999999,Number(n.lz)||0):new a.Vector3(0,0,0);s.applyQuaternion(o),e.position.set(l9[0]+s.x,l9[1]+s.y,l9[2]+s.z),e.quaternion.copy(o)});let te=()=>c(`Maze `+m()),ne=e=>te()?.getObjectByName(e)?.position??null,N=()=>c(`Marble`),P=()=>{let e=N();return e?e.position.clone().applyMatrix4(j().invert()):null},re=e=>new a.Vector3(e.x,e.y,e.z).applyMatrix4(j()),ie=new Map,F={add:e=>ie.set(e,4)},ae=(t=m())=>{let r=N(),i=c(`Maze `+t)?.getObjectByName(`Start `+t)?.position??null;if(!r||!i)return;let a=re({x:i.x,y:.045,z:i.z}),o=n?.holdBody?.(r.uuid);r.position.copy(a),r.quaternion.identity(),r.updateMatrixWorld(),o?F.add(r.uuid):e.moveObject(r.uuid,{pos:[a.x,a.y,a.z]})},I=()=>{n&&r&&!r.get(n.simulating)&&!r.get(n.remoteSimulating)&&n.toggleSimulation?.()},L=0,oe=n=>{if(!d9.find(e=>e.id===n)||!t)return!1;if(!(o.levels.unlocked?.(String(n))??!0))return e.announce(`Maze `+n+` is locked`,{sub:`Finish maze `+(n-1)+` first`,ms:2200,color:`#ffb86b`}),!1;f(f9.level,n),f(f9.status,p9.playing),f(f9.coins,0),f(f9.falls,0),f(f9.time,0),f(f9.stars,0),o.levels.select(String(n)),o.round.configure(0,0,`lose`,2),R=!0;try{o.round.restart()}finally{R=!1}return I(),L=performance.now()+900,ae(n),!0},R=!1,se=()=>{f(f9.status,p9.none),f(f9.level,0),o.round.toMenu(),ae(1)},ce=()=>{let e=p();if(!e||!t)return;let n=t.gameElapsed(),r=le(d(f9.coins)),i=_9(e,{time:n,coins:r});f(f9.stars,i),f(f9.time,Math.round(n*10)),f(f9.status,p9.won),o.levels.complete(!0,r,n,String(e.id),{coins:r,falls:d(f9.falls)}),o.round.win(`Maze cleared!`)},le=e=>{let t=0;for(let n=0;n<3;n++)e&1<<n&&t++;return t},ue=new Map,de=e=>{let t=c(`Maze `+e);
2510if(!t)return[];if(!ue.has(e)||ue.get(e)?.mz!==t){let n=[];n.mz=t;for(let e of t.children){if(!/^Hole \d+\.\d+$/.test(String(e.name)))continue;e.geometry?.computeBoundingBox?.();let t=e.geometry?.boundingBox,r=t?(t.max.x-t.min.x)*e.scale.x:.1;n.push({x:e.position.x,z:e.position.z,half:Math.max(.01,r/2-.012)})}ue.set(e,n)}return ue.get(e)??[]},z=null,fe=()=>{if(!_()){z&&=(F.add(z.uuid),null);return}let e=performance.now();if(z){let t=(e-z.at)/300,n=N();if(n&&t<1){n.position.copy(re({x:z.x,y:.035-t*.12,z:z.z})),n.updateMatrixWorld();return}z=null,ae(),L=e+500;return}let t=P();if(!t)return;if(e<L){ae();return}let r=m();for(let i of de(r))if(Math.abs(t.x-i.x)<i.half&&Math.abs(t.z-i.z)<i.half&&t.y<.06){let t=N();if(t&&n?.holdBody?.(t.uuid)){z={at:e,x:i.x,z:i.z,uuid:t.uuid},f(f9.falls,d(f9.falls)+1),f(f9.coins,0);return}}if(t.y<-.08||Math.abs(t.x)>.7||Math.abs(t.z)>.7){f(f9.falls,d(f9.falls)+1),f(f9.coins,0),ae(),L=e+500;return}let i=m(),a=d(f9.coins);for(let e=0;e<3;e++){if(a&1<<e)continue;let n=ne(`Coin `+i+`.`+(e+1));n&&Math.hypot(t.x-n.x,t.z-n.z)<.055&&t.y<.12&&(a|=1<<e)}f(f9.coins,a);let o=ne(`Goal `+i);o&&Math.hypot(t.x-o.x,t.z-o.z)<.045&&t.y<.08&&ce()},pe=0,B=0,me=0,V=-1,he=()=>{let t=m(),n=te(),r=d(f9.coins);for(let i=0;i<3;i++){let o=n?.getObjectByName(`Coin `+t+`.`+(i+1));if(o&&(o.visible=!(r&1<<i),o.visible&&(o.rotation.y+=.05)),r&1<<i&&!(pe&1<<i)&&o){let t=o.getWorldPosition(new a.Vector3);e.playSound(`coin`,[t.x,t.y,t.z]),e.effects?.burst?.([t.x,t.y,t.z],{kind:`sparkle`,color:`#ffd34d`,count:24}),e.hapticPattern?.(`tap`)}}pe=r;let i=d(f9.falls);i>B&&_()&&(e.playSound(`fail`),e.hapticPattern?.(`fail`),e.announce(`Into the hole!`,{sub:`Back to the start â the coins are back too`,ms:1600,color:`#ff9a7a`})),B=i;let o=d(f9.status);if(o===p9.won&&me!==p9.won){let r=n?.getObjectByName(`Goal `+t)?.getWorldPosition(new a.Vector3);e.playSound(`levelup`),r&&e.effects?.burst?.([r.x,r.y,r.z],{kind:`confetti`,count:60}),e.hapticPattern?.(`success`)}me=o;let s=u();if(s?.state===`playing`&&o===p9.playing&&V!==s.round){V=s.round;let t=p();t&&e.announce(`Maze `+t.id,{sub:t.name+` â roll to the gold ring, par `+g9(t.par),ms:2400,color:`#ffd45e`}),e.playSound(`whistle`),ge()}},H=0,ge=()=>{H=20},U=[l9[0],l9[1]+.72,l9[2]+.62],W=()=>{if(H<=0||(H--,g()||!i||!r))return;let e=r.get(i.playerCam);if(!e?.isObject3D)return;let t=new a.Vector3(...U);e.parent&&(e.parent.updateWorldMatrix(!0,!1),e.parent.worldToLocal(t)),e.position.copy(t);let n=-Math.atan2(U[1]-l9[1],U[2]-l9[2]);e.quaternion.setFromEuler(new a.Euler(n,0,0,`YXZ`)),e.updateMatrixWorld(!0)},_e=new Map,ve=t=>{let n=d(f9.level,0),r=/^lvl-(\d+)$/.exec(t);if(r)return oe(Number(r[1]));if(t===`start-btn`){let e=d9.find(e=>(o.levels.unlocked?.(String(e.id))??!0)&&!((h().levels?.[String(e.id)]?.stars??0)>=3));return oe(e?.id??1)}if(t===`retry-btn`)return oe(n||1);if(t===`next-btn`){let t=d9.find(e=>e.id===n+1);return t?oe(t.id):(e.announce(`That was the last maze`,{sub:`Go back for three stars on every one`,ms:2400,color:`#ffd45e`}),se())}return t===`levels-btn`&&se()},G=()=>{let t=v();for(let n of e.flow.nodes(`hudbutton`)){let r=String(n.data?.element??``);if(!/^(lvl-\d+|start-btn|next-btn|retry-btn|levels-btn)$/.test(r))continue;let i=e.flow.triggerStamp(n.id),a=Number(i?.stamp)||0;if(!_e.has(n.id)){_e.set(n.id,a);continue}if(a===_e.get(n.id))continue;let o=Number(i?.age??0)<Xdt;_e.set(n.id,a),o&&t&&ve(r)}},ye=e=>{let n=String(e?.read??`title`);if(n===`levelStars`){let t=Number(e?.level)||0;if(!(o.levels.unlocked?.(String(t))??!0))return`ð locked`;let n=h().levels?.[String(t)];return n?h9(n.stars??0):`âââ`}if(n===`menuLine`)return`Stars earned: `+d9.reduce((e,t)=>e+(h().levels?.[String(t.id)]?.stars??0),0)+` / `+d9.length*3;let r=p();if(!r)return``;switch(n){case`title`:return`Maze `+r.id+` · `+r.name;case`clock`:return g9(u()?.state===`playing`&&t?t.gameElapsed():d(f9.time)/10)+` / par `+g9(r.par);case`coins`:return`Coins `+le(d(f9.coins))+` / 3`;case`falls`:return d(f9.falls)?`Falls: `+d(f9.falls):` `;case`hint`:return g()?`Grip both handles and twist · left stick tilts`:`WASD / arrows tilt · or hold the mouse and drag`;case`result`:return d(f9.status)===p9.won?`Maze `+r.id+` cleared!`:`Run over`;case`resultStars`:return h9(d(f9.stars));case`resultLine`:return`Time `+g9(d(f9.time)/10)+` (par `+g9(r.par)+`) · coins `+le(d(f9.coins))+`/3 · falls `+d(f9.falls);case`resultBest`:{let e=h().levels?.[String(r.id)];return e?`Best on this device: `+h9(e.stars??0):``}default:return``}};e.registerValueNode(`marbleinfo`,e=>{let t=ye(e);return t===``?` `:t},{vtype:`any`}),e.registerNodeGroup({group:`Marble Maze`,items:[{type:`marbleinfo`,label:`Marble info`,defaults:{read:`title`,level:1},params:[{key:`read`,kind:`select`,options:[`title`,`clock`,`coins`,`falls`,`hint`,`result`,`resultStars`,`resultLine`,`resultBest`,`levelStars`,`menuLine`]},{key:`level`,kind:`range`,min:1,max:d9.length,step:1}]},{type:`marbletilt`,label:`Marble tilt`,defaults:{maze:1,gate:!1,lx:0,lz:0,phase:0},params:[{key:`maze`,kind:`range`,min:1,max:d9.length,step:1}
2510,{key:`phase`,kind:`range`,min:0,max:1,step:.05}]}]});let be=null,xe=()=>{typeof be==`function`&&be(),be=o.levels.define({id:`marble`,list:d9.map(e=>({id:String(e.id),label:e.id+` · `+e.name})),unlock:`sequential`,stars:(e,t)=>_9(d9.find(t=>String(t.id)===String(e.id)),{time:t.time,coins:Number(t.coins??t.score??0)}),store:{get:()=>e.storage?.get?.(`progress`,null),set:t=>e.storage?.set?.(`progress`,t)}})};o.levels.onSelected(e=>{if(e?.game!==`marble`||!l()||!v())return;let t=Number(e.level);d9.some(e=>e.id===t)&&d(f9.level,0)!==t&&oe(t)}),o.round.onStarted(()=>{if(!R&&l()&&v()){if(!p())return o.round.toMenu();f(f9.status,p9.playing),f(f9.coins,0),f(f9.falls,0),L=performance.now()+900,I(),ae()}}),o.rules.onGrabRequest?.(e=>{l()&&/^(Marble|Maze \d|Gate \d)/.test(String(e.name??``))&&e.refuse(`Tilt the board â grip the handles`)});let K=!1,Se=null,Ce=null,we=!1,Te=performance.now();e.registerFrameTask(()=>{if(!t||!r)return;let i=performance.now(),o=Math.min(.1,(i-Te)/1e3);Te=i;let s=l();s!==K&&(K=s,s&&xe(),s&&typeof e.game?.setHelp==`function`&&(Se=e.game.setHelp(Zdt)),s&&(Ce=e.input?.actions?.([],{preset:`custom`,stick:!1,look:!1})??null),!s&&Ce&&(Ce(),Ce=null),s||(Se?.(),Se=null,typeof be==`function`&&be(),be=null));let c=s&&_();if(c!==we&&(we=c,c?(e.claimInput(`keys`),e.claimInput(`locomotion`)):(e.releaseInput?.(`keys`),e.releaseInput?.(`locomotion`))),s){for(let[e,t]of ie)if(z?.uuid!==e){if(t>1){ie.set(e,t-1);continue}n?.releaseBody?.(e,{linvel:new a.Vector3,angvel:new a.Vector3}),ie.delete(e)}k(o),A(o),G(),v()&&fe(),he(),W()}}),e.onSceneClear(()=>{Se?.(),Se=null,Ce?.(),Ce=null,typeof be==`function`&&be(),be=null,_e.clear(),K=!1,V=-1,pe=B=me=0,y.x=y.z=0}),globalThis.__marble={mazes:d9,authority:v,startLevel:oe,toMenu:se,info:ye,tilt:()=>({...y}),eye:()=>i&&r?r.get(i.playerCam)?.getWorldPosition?.(new a.Vector3)?.toArray():null,setHandSource:t=>D=t??(t=>e.vrHand?.(t)??null),setTilt:(e,t)=>x={x:e,z:t,at:performance.now()+1e6},vars:()=>Object.fromEntries(Object.values(f9).map(t=>[t,e.game.getVar(t,null)])),marbleLocal:()=>P()?.toArray()??null,toGoal:()=>{let e=N(),t=ne(`Goal `+m());if(!e||!t)return!1;L=0;let r=re({x:t.x,y:.04,z:t.z}),i=n?.holdBody?.(e.uuid);return e.position.copy(r),i&&F.add(e.uuid),!0},toHole:e=>{let t=N(),r=de(m())[e];if(!t||!r)return!1;L=0;let i=re({x:r.x,y:.04,z:r.z}),a=n?.holdBody?.(t.uuid);return t.position.copy(i),a&&F.add(t.uuid),!0},holes:()=>de(m()).map(e=>({x:e.x,z:e.z,half:e.half})),takeCoins:()=>f(f9.coins,7),setProgress:t=>(e.storage?.set?.(`progress`,t),o.levels.refresh?.(),h()),resetProgress:()=>{e.storage?.remove?.(`progress`),o.levels.refresh?.()}}}},v9=[-12.5,-7.5,-2.5,2.5,7.5,12.5],y9=.1,b9=.06,x9=[{id:1,name:`Straight`,par:2,x:v9[0],cup:[v9[0],y9,-4.5],tip:`A straight warm-up. Drag back from the ball and let go.`},{id:2,name:`The ramp`,par:3,x:v9[1],cup:[v9[1],.6,-5],tip:`Up the ramp to the high green â hit it firmly.`},{id:3,name:`Windmill`,par:3,x:v9[2],cup:[v9[2],y9,-5],tip:`Time your putt between the windmill blades.`},{id:4,name:`Bank shot`,par:3,x:v9[3],cup:[v9[3]+.8,y9,-5],tip:`A wall blocks the middle â bank it off the rail.`},{id:5,name:`Sand trap`,par:3,x:v9[4],cup:[v9[4],y9,-5],tip:`Sand eats speed. Go around it, or hit hard.`,sand:{min:[v9[4]-1.5,-2.6],max:[v9[4]+.6,-1.2]}},{id:6,name:`The hump`,par:3,x:v9[5],cup:[v9[5],y9,-5.2],tip:`Over the hump and through the gate.`}],S9=e=>
2510x9.find(t=>t.id===e)??null,$dt=e=>[e.x,.18,4.4],eft=e=>[e.x,0,6.4],C9=x9.reduce((e,t)=>e+t.par,0);function tft(e,t){return t[1]<-.4||Math.abs(t[0]-e.x)>1.9||t[2]>5.6||t[2]<-6.9}function nft(e,t){let n=e.sand;return!!n&&t[0]>=n.min[0]&&t[0]<=n.max[0]&&t[2]>=n.min[1]&&t[2]<=n.max[1]}function rft(e,t,n){let r=t[0]-e.cup[0],i=t[2]-e.cup[2];return Math.hypot(r,i)<.13&&Math.abs(t[1]-(e.cup[1]+.06))<.2&&n<2.2}function ift(e,t){if(e===1)return`Hole in one!`;let n=e-t;return n<=-2?`Eagle!`:n===-1?`Birdie!`:n===0?`Par`:n===1?`Bogey`:n===2?`Double bogey`:`+`+n}var w9=e=>e===0?`E`:e>0?`+`+e:String(e),aft=e=>Math.min(7,7/2.5*Math.max(0,e)),oft=`Mini golf game`,T9=`Golf ball`,sft=`golf-aim`,cft=2.5,E9={hole:`mgHole`,strokes:`mgStrokes`,phase:`mgPhase`,oob:`mgOob`,sunk:`mgSunk`},D9=e=>`mgS`+e,O9=0,lft=1,k9=2,uft={id:`minigolf`,name:`Mini Golf`,version:`1.0.0`,description:`The Mini Golf game: six holes with a ramp, a windmill, a bank shot, sand and a hump â putt with the mouse or a VR putter.`,register(e){let t=null,n=null,r=null,i=null,a=null;Promise.all([$(()=>import(`../chunks/DHWg9jzn.js`).then(e=>e.s),__vite__mapDeps([13,1,2,10]),import.meta.url),$(()=>import(`../chunks/B3B8hjh_.js`).then(e=>e.v),__vite__mapDeps([157,1,2,6,9,0,3,4,38,39,5,7,48,10,14,32,13,30,31,57,58,18,19,20,21,22,23,11,12,8,24,25,26,27,28,29,33,34,35,36,37,40,41,42,43,44,45,46,47,49,50,16,51,52,53,54,55,56,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,158,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url),$(()=>import(`../chunks/OHQUSm6n.js`).then(e=>e.s),__vite__mapDeps([2,1]),import.meta.url),$(()=>import(`../chunks/BjxZzSo2.js`).then(e=>e.O),__vite__mapDeps([0,1,2,3,4]),import.meta.url),$(()=>import(`../chunks/BWMbMj16.js`).then(e=>e.r),__vite__mapDeps([16,1,2,0,3,4]),import.meta.url)]).then(([e,o,s,c,l])=>{t=e,n=o,r=s,i=c,a=l});let o=e.THREE,s=e.kit,c=()=>e.objectsGroup(),l=e=>c()?.getObjectByName(e)??null,u=()=>!!l(oft),d=()=>t&&r?r.get(t.gameState):null,f=(t,n=0)=>{let r=Number(e.game.getVar(t,n));return Number.isFinite(r)?r:n},p=(t,n)=>{f(t,NaN)!==n&&e.game.setVar(t,n)},m=()=>S9(f(E9.hole,0)),h=()=>d()?.state===`playing`,g=()=>{if(!n||!r)return!1;if(r.get(n.simulating))return n.isInitiator();if(r.get(n.remoteSimulating))return!1;let t=e.peerId();return!t||[t,...e.peerIds()].filter(Boolean).sort()[0]===t},_=()=>!!(n&&r&&r.get(n.simulating)),v=()=>l(T9),y=()=>{let e=v();if(!e)return[0,-10,0];let t=new o.Vector3;return e.getWorldPosition(t),[t.x,t.y,t.z]},b=(t,r={})=>{let i=v();i&&(_()&&n.physicsRemoveBody?.(i.uuid),e.moveObject(i.uuid,{pos:t,rot:[0,0,0]}),_()&&r.body!==!1&&(n.physicsAddBody?.(i.uuid),n.setBodyVelocity?.(i.uuid,[0,0,0],[0,0,0])),w=t.slice(),T=-1)},x=null,S=[0,0,0],C=e=>{let t=v(),r=t&&_()?n.bodyVelocityOf?.(t.uuid):null,i=y();if(x&&e>x.t){let t=e-x.t;S=[(i[0]-x.p[0])/t,(i[1]-x.p[1])/t,(i[2]-x.p[2])/t]}return x={p:i,t:e},r?r.linvel:S},w=[0,0,0],T=-1,E=-1,D=-10,O=-1e9,k=e=>{let t=S9(e);t&&(p(E9.hole,e),p(E9.strokes,0),p(E9.phase,O9),E=-1,b($dt(t)))},A=(e=1)=>{if(t){for(let e of x9)p(D9(e.id),0);p(E9.oob,0),p(E9.sunk,0),s.round.configure(0,0,`lose`,1),ee=!0;try{s.round.restart()}finally{ee=!1}k(S9(e)?e:1)}},ee=!1;e.game?.onRestart?.(()=>{u()&&(g()?A(1):e.send({op:`pick`,hole:1}))}),s.round.onStarted?.(()=>{if(!ee&&u()&&g()){for(let e of x9)p(D9(e.id),0);k(1)}});let j=()=>{p(E9.hole,0),s.round.toMenu()},M=e=>{let t=m();t&&(p(D9(t.id),e),p(E9.phase,k9),p(E9.sunk,f(E9.sunk)+1))},te=()=>{let e=m();if(!e)return;let t=S9(e.id+1);if(t)k(t.id);else{let e=x9.reduce((e,t)=>e+f(D9(t.id)),0);s.score.set?.(e),s.round.win(w9(e-C9)+` · `+e+` strokes`)}},ne=e=>{O=performance.now();let t=v();if(!t||!h()||f(E9.phase)!==O9||!_())return!1;let r=Math.hypot(e[0],e[2]),i=r>7?7/r:1,a=[e[0]*i,0,e[2]*i],o=[a[2]/b9,0,-a[0]/b9];return n.setBodyVelocity(t.uuid,a,o.map(e=>e*.6))},N=t=>{g()?ne(t):e.send({op:`putt`,vel:t})};e.onMessage(e=>{e?.op===`putt`&&Array.isArray(e.vel)&&g()&&ne(e.vel.map(Number)),e?.op===`pick`&&g()&&A(Number(e.hole)||1)});let P=null,re=()=>{typeof e.game?.levels==`function`&&(P=e.game.levels({list:x9.map(e=>({id:String(e.id),label:e.id+` · `+e.name+` (par `+e.par+`)`})),current:String(f(E9.hole,0)||1),onPick:t=>{let n=Number(t)||1;g()?A(n):e.send({op:`pick`,hole:n})}}))},ie=new Map,F=-10,ae=e=>{let t=y();for(let n of c()?.children??[]){if(!/^Putter/.test(String(n.name)))continue;let r=new o.Vector3(0,-.42,0);n.localToWorld(r);let i=[r.x,r.y,r.z],a=ie.get(n.uuid);if(ie.set(n.uuid,{p:i,t:e}),!a||e-F<.6)continue;let s=Math.max(.001,e-a.t),c=[(i[0]-a.p[0])/s,0,(i[2]-a.p[2])/s];Math.hypot(i[0]-t[0],i[1]-t[1],i[2]-t[2])<.16&&Math.hypot(c[0],c[2])>.4&&f(E9.phase)===O9&&(F=e,ne([c[0]*1.1,0,c[2]*1.1]))}},I=t=>{let i=d();if(!i||i.state!==`playing`)return;let a=m();if(!a)return;if(!_()&&!(r&&r.get(n.remoteSimulating))){t-D>2&&(D=t,n.toggleSimulation?.());return}let o=v();if(!o)return;let s=y(),c=C(t),l=Math.hypot(c[0],c[2]),u=f(E9.phase);if(u===k9){E<0&&(E=t),t-E>2.2&&te();return}if(ae(t),u===O9){l>.3&&((performance.now()-O<1e3||l>1)&&p(E9.strokes,f(E9.strokes)+1),p(E9.phase,lft),T=-1);return}if(rft(a,s,l)){b([a.cup[0],a.cup[1]+b9-.05,a.cup[2]],{body:!1}),M(f(E9.strokes)),E=t;return}if(tft(a,s)){p(E9.strokes,f(E9.strokes)+1),p(E9.oob,f(E9.oob)+1),b(w),p(E9.phase,O9);return}nft(a,s)&&l>.05?n.setBodyVelocity(o.uuid,[c[0]*.86,c[1],c[2]*.86],null):l<.45&&l>.02&&n.setBodyVelocity(o.uuid,[c[0]*.96,c[1],c[2]*.96],null),l<.06&&Math.abs(c[1])<.1?(T<0&&(T=t),t-T>.35&&(n.setBodyVelocity(o.uuid,[0,0,0],[0,0,0]),w=s,T=-1,f(E9.strokes)>=8?(e.announce(`Picked up`,{sub:`8 strokes is the most a hole takes`,ms:1800,color:`#ffb86b`}),M(8)):p(E9.phase,O9))):T=-1},L=null,oe=()=>{if(L)return L;L=new o.Group,L.name=sft;let t=new o.MeshBasicMaterial({color:16769126,transparent:!0,opacity:.95,depthTest:!1,toneMapped:!1}),n=new o.Mesh(new o.BoxGeometry(.05,.01,1),t);n.position.z=-.5,n.name=`golf-aim-shaft`;let r=new o.Mesh(new o.ConeGeometry(.1,.22,12),t);return r.rotation.x=-Math.PI/2,r.name=`golf-aim-tip`,L.add(n,r),L.renderOrder=999,L.visible=!1,e.scene().add(L),e.own?.(L),L},R=null,se=()=>{if(!i||!r||!u()||!h()||r.get(i.isVRMode))return!1;let e=r.get(i.isLocked)===!0,t=r.get(i.editorMode)===`interact`;return(e||t)&&f(E9.phase)===O9},ce=(e,t)=>{let n=i&&r?r.get(i.globalCamera):null;if(!n||!a)return null;let s=a.ndcFromClient(e,t),c=new o.Raycaster;return c.setFromCamera(new o.Vector2(s.x,s.y),n),c};e.listen(window,`pointerdown`,e=>{if(e.button!==0||!se()||String(e.target?.tagName)!==`CANVAS`)return;let t=ce(e.clientX,e.clientY);if(!t)return;let n=y();t.ray.distanceToPoint(new o.Vector3(n[0],n[1],n[2]))>.35||(R={rect:null,drag:[0,0,0]},e.stopPropagation(),e.preventDefault())},!0),e.listen(window,`pointermove`,e=>{if(!R)return;let t=ce(e.clientX,e.clientY);if(!t)return;let n=y(),r=new o.Plane(new o.Vector3(0,1,0),-n[1]),i=new o.Vector3;if(!t.ray.intersectPlane(r,i))return;R.drag=[n[0]-i.x,0,n[2]-i.z];let a=Math.hypot(R.drag[0],R.drag[2]),s=oe();if(s.visible=a>.12,s.visible){let e=Math.min(2.5,a);s.position.set(n[0],n[1]+.01,n[2]),s.rotation.set(0,Math.atan2(-R.drag[0],-R.drag[2]),0),s.children[0].scale.z=e,s.children[0].position.z=-e/2,s.children[1].position.z=-e-.1;let t=e/2.5;s.children[0].material.color.setRGB(1,.95-.75*t,.25*(1-t))}e.stopPropagation()},!0),e.listen(window,`pointerup`,e=>{if(!R)return;let t=R.drag;
2510R=null,L&&(L.visible=!1),e.stopPropagation();let n=Math.hypot(t[0],t[2]);if(n<.12)return;let r=aft(n);N([t[0]/n*r,0,t[2]/n*r])},!0),s.rules.onGrabRequest?.(e=>{u()&&(e.name===T9?e.refuse(`Putt the ball â drag back from it and let go`):/^Putter/.test(String(e.name))&&e.hand===`desktop`&&e.refuse(`Drag back from the ball to putt`))});let le=new Map,ue=e=>{if(e===`start-btn`||e===`again-btn`)return A();if(e===`menu-btn`)return j();if(e===`skip-btn`&&h()&&f(E9.phase)!==k9){M(8);return}},de=()=>{let t=g();for(let n of e.flow.nodes(`hudbutton`)){let r=String(n.data?.element??``);if(!/^(start-btn|again-btn|menu-btn|skip-btn)$/.test(r))continue;let i=e.flow.triggerStamp(n.id),a=Number(i?.stamp)||0;if(!le.has(n.id)){le.set(n.id,a);continue}a!==le.get(n.id)&&(le.set(n.id,a),!(Number(i?.age??0)>=cft)&&t&&ue(r))}},z=-1,fe=-1,pe=-1,B=-1,me=-1,V=-1,he=null,H=-10,ge=t=>{let n=y();if(!he||t<=he.t){he={p:n,v:[0,0,0],t};return}let r=t-he.t,i=[(n[0]-he.p[0])/r,0,(n[2]-he.p[2])/r],a=he.v,o=Math.hypot(a[0],a[2]),s=Math.hypot(i[0],i[2]);o>1.2&&s>.2&&s<12&&t-H>.15&&(a[0]*i[0]+a[2]*i[2])/(o*s)<.5&&(H=t,e.playSound(`hit`,n)),he={p:n,v:i,t}},U=t=>{let n=d();if(!n)return;n.state===`playing`&&ge(t);let r=m();if(n.state===`playing`&&r&&(z!==r.id||fe!==n.round)){z=r.id,fe=n.round;let t=eft(r);e.setSpawn?.(t,0,{teleport:!0}),e.announce(`Hole `+r.id+` · `+r.name,{sub:`Par `+r.par+` â `+r.tip,ms:3600,color:`#ffe066`}),e.playSound(`whistle`),pe=f(E9.oob),B=f(E9.sunk),me=f(E9.strokes)}if(n.state!==`playing`||!r)return;let i=f(E9.strokes);if(i>me&&f(E9.oob)===pe&&(e.playSound(`kick`,y()),e.hapticPattern?.(`tap`)),me=i,f(E9.oob)>pe&&(pe=f(E9.oob),e.playSound(`fail`),e.announce(`Out of bounds`,{sub:`+1 stroke â back to your last spot`,ms:1600,color:`#ff8a6b`})),f(E9.sunk)>B){B=f(E9.sunk);
2510let t=f(D9(r.id)),n=t>=8?`Picked up`:ift(t,r.par);e.playSound(t<=r.par?`goal`:`coin`,r.cup),t<=r.par&&e.playSound(`cheer`),e.hapticPattern?.(`success`),e.effects?.burst?.([r.cup[0],r.cup[1]+.3,r.cup[2]],{kind:t<=r.par?`confetti`:`sparkle`,count:t===1?140:70}),e.announce(n,{sub:t+(t===1?` stroke`:` strokes`)+` · par `+r.par,ms:2e3,color:`#7dffb0`})}},W=()=>{let t=d();if(t?.state===`over`&&V!==t.round){V=t.round;let n=x9.reduce((e,t)=>e+f(D9(t.id)),0);if(n>0){let t=Number(e.storage?.get?.(`best`,0))||0;(!t||n<t)&&e.storage?.set?.(`best`,n),e.playSound(`levelup`)}}},_e=t=>{let n=String(t?.read??`title`),r=m(),i=x9.reduce((e,t)=>e+f(D9(t.id)),0),a=x9.filter(e=>f(D9(e.id))>0).reduce((e,t)=>e+t.par,0);switch(n){case`title`:return r?`Hole `+r.id+` of `+x9.length+` · `+r.name:``;case`par`:return r?`Par `+r.par:``;case`strokes`:return r?`Strokes `+f(E9.strokes):``;case`total`:return`Total `+i+` (`+w9(i-a)+`)`;case`tip`:return r?r.tip:``;case`card`:{let e=S9(Number(t?.hole)||0);if(!e)return``;let n=f(D9(e.id));return e.id+`. `+e.name+` â par `+e.par+` â `+(n?n+` (`+w9(n-e.par)+`)`:`â`)}case`result`:return`Course complete!`;case`resultLine`:return i+` strokes · par `+C9+` · `+w9(i-C9);case`best`:{let t=Number(e.storage?.get?.(`best`,0))||0;return t?`Best on this device: `+t+` (`+w9(t-C9)+`)`:`First round on this device`}case`menuBest`:{let t=Number(e.storage?.get?.(`best`,0))||0;return t?`Your best: `+t+` strokes (`+w9(t-C9)+`)`:`Six holes · par `+C9}default:return``}};e.registerValueNode(`golfinfo`,e=>{let t=_e(e);return t===``?` `:t},{vtype:`any`}),e.registerNodeGroup({group:`Mini Golf`,items:[{type:`golfinfo`,label:`Mini golf info`,defaults:{read:`title`,hole:1},params:[{key:`read`,kind:`select`,options:[`title`,`par`,`strokes`,`total`,`tip`,`card`,`result`,`resultLine`,`best`,`menuBest`]},{key:`hole`,kind:`range`,min:1,max:x9.length,step:1}]}]});let ve=[`Sink the ball in as few strokes as you can. Six holes; par is shown for each.`,`Desktop: press on the ball, drag BACK (away from where you want it to go) and let go â the further you drag, the harder the putt. WASD walks.`,`VR: pick up the putter lying beside the tee (grip) and swing it through the ball. Or knock the ball with your hand.`,`Out of bounds costs a stroke and puts the ball back where it last stopped. Eight strokes and the ball is picked up.`],G=null,ye=null,be=!1;e.registerFrameTask(i=>{if(!t||!r||!n)return;let a=u();a!==be&&(be=a,a&&typeof e.game?.setHelp==`function`&&(G=e.game.setHelp(ve)),a&&(ye=e.input?.actions?.([],{preset:`golf`})??null),!a&&ye&&(ye(),ye=null),a&&re(),!a&&G&&(G(),G=null),!a&&typeof P==`function`&&(P(),P=null)),a&&(de(),g()&&I(i),U(i),W())}),e.onSceneClear(()=>{G&&=(G(),null),ye?.(),ye=null,typeof P==`function`&&(P(),P=null),le.clear(),ie.clear(),z=-1,fe=-1,V=-1,be=!1,R=null,L&&(L.visible=!1)}),globalThis.__minigolf={holes:x9,authority:g,info:_e,vars:()=>({...Object.fromEntries(Object.values(E9).map(t=>[t,e.game.getVar(t,null)])),...Object.fromEntries(x9.map(t=>[D9(t.id),e.game.getVar(D9(t.id),null)]))}),ball:()=>({pos:y()}),startRound:A,setupHole:k,putt:N,lob:e=>{let t=v();return!t||!g()||!_()?!1:n.setBodyVelocity(t.uuid,e,null)},puttAtCup:(e=3)=>{let t=m();if(!t)return!1;let n=y(),r=[t.cup[0]-n[0],0,t.cup[2]-n[2]],i=Math.hypot(r[0],r[2])||1;return N([r[0]/i*e,0,r[2]/i*e]),!0}}}},dft=`Sky Run game`,A9=[{id:`1`,name:`Cloud Steps`,par:45},{id:`2`,name:`Spin Cycle`,par:70},{id:`3`,name:`Sky Gauntlet`,par:100}],fft=7,pft=1.7,mft=1.25,hft=1.1,j9=e=>{if(!(e>0))return`0:00.0`;let t=Math.floor(e/60),n=e-t*60;return t+`:`+(n<10?`0`:``)+n.toFixed(1)},gft={id:`skyrun`,name:`Sky Run`,version:`1.0.0`,description:`The Sky Run game: three stages of floating platforms â moving platforms, vanishing tiles, spinners, checkpoints, coins and a finish portal. Best times saved on this device.`,register(e){let t=e.THREE,n=e.kit,r=null;$(()=>import(`../chunks/CZHKtjzS.js`).then(e=>e.r).then(e=>r=e),__vite__mapDeps([84,1,2,6,9,0,3,4,8,5,10,11,12,13,14,48,85]),import.meta.url);let i=new Map,a=null,o=null;$(()=>import(`../chunks/Cz5Vn86C.js`).then(e=>e.s).then(e=>a=e),__vite__mapDeps([26,1,2,3,27]),import.meta.url),$(()=>import(`../chunks/CvScdOYl.js`).then(e=>e.r).then(e=>o=e.safeStorage),__vite__mapDeps([3,1]),import.meta.url);let s=()=>{try{if(!a||!o||e.storage?.get?.(`vignette-defaulted`,!1))return;o.getItem(a.shellKey(a.currentGameId()))||a.setGameSetting(`vignette`,!0),e.storage?.set?.(`vignette-defaulted`,!0)}catch{}},c=null;$(()=>import(`../chunks/D5yrmAF2.js`).then(e=>e.l).then(e=>c=e),__vite__mapDeps([8,1,2,6,9,0,3,4,5,10,11,12,13,14]),import.meta.url);let l=()=>{let t=c?.kitAuthorityId?.();return!t||t===e.peerId?.()},u=()=>e.objectsGroup(),d=e=>u()?.getObjectByName(e)??null,f=()=>!!d(dft),p=e=>(u()?.children??[]).filter(t=>typeof t.name==`string`&&t.name.startsWith(e)),m=()=>{let e=String(n.levels.current?.()??``);return A9.some(t=>t.id===e)?e:`1`},h=()=>String(n.round.phase?.()??`menu`),g=new t.Box3,_=new t.Vector3,v=e=>(e.updateMatrixWorld(!0),g.setFromObject(e).clone()),y=e=>{let t=d(`Sky S`+e+` start`);if(!t)return{pos:[0,10,0],yaw:0};let n=v(t);return{pos:[(n.min.x+n.max.x)/2,n.max.y+.05,n.max.z-1.2],yaw:0,floor:n.max.y}},b={key:``,checkpoint:null,flag:0,coins:0,coinsTotal:0,taken:new Set,finished:0,falls:0,lastHit:-10,result:``,resultLine:``,best:0},x=e=>`best-`+e,S=t=>Number(e.storage?.get?.(x(t),0))||0,C=(t,n=!0)=>{b.checkpoint=null,b.flag=0,b.coins=0,b.finished=0,b.falls=0;for(let e of b.taken){let t=u()?.getObjectByProperty(`uuid`,e);t&&(t.visible=!0)}
2510b.taken.clear(),b.coinsTotal=p(`Sky S`+t+` coin`).length,b.best=S(t);let r=y(t);e.setSpawn(r.pos,r.yaw,{teleport:n})},w=t=>{b.falls++;let n=m(),r=b.checkpoint?{pos:b.checkpoint,yaw:0}:y(n);e.setSpawn(r.pos,r.yaw,{teleport:!0}),e.playSound(`fail`),e.hapticPattern?.(`fail`),e.announce(t,{sub:b.checkpoint?`Back to your checkpoint`:`Back to the start`,ms:1200,color:`#ffb86b`})},T=(e,t)=>{let n=e.geometry;if(!n)return!1;n.boundingBox||n.computeBoundingBox();let r=n.boundingBox;e.updateMatrixWorld(!0);for(let n of[.2,.9,1.5])if(_.set(t[0],t[1]+n,t[2]),e.worldToLocal(_),_.x>r.min.x-.3&&_.x<r.max.x+.3&&_.y>r.min.y-.1&&_.y<r.max.y+.1&&_.z>r.min.z-.3&&_.z<r.max.z+.3)return!0;return!1},E=(e,t,n)=>{t.getWorldPosition(_);let r=e[0]-_.x,i=e[2]-_.z,a=e[1]+.9-_.y;return r*r+i*i<n*n&&Math.abs(a)<1.8},D=t=>{let a=m(),o=h(),s=(n.round.number?.()??0)+`:`+a;if(s!==b.key&&(o===`intro`||o===`playing`)&&(b.key=s,C(a,!0),e.announce(`Stage `+a+` · `+(A9.find(e=>e.id===a)?.name??``),{sub:`Reach the portal. Flags save your spot.`,ms:2600,color:`#ffd45e`})),o!==`playing`||b.finished)return;let c=e.playerPosition();if(!c)return;let l=[c[0],c[1]-pft,c[2]],u=y(a);if(l[1]<(u.floor??u.pos[1])-fft){w(`You fell!`);return}for(let e of p(`Sky S`+a+` slider`)){e.getWorldPosition(_);let t=_.toArray(),n=i.get(e.uuid);if(i.set(e.uuid,t),!n)continue;let a=v(e),o=c[1]-a.max.y;l[0]>a.min.x-.2&&l[0]<a.max.x+.2&&l[2]>a.min.z-.2&&l[2]<a.max.z+.2&&o>.8&&o<2.3&&r?.addWalkCarry?.(t[0]-n[0],t[2]-n[2])}if(t-b.lastHit>1.2){for(let n of p(`Sky S`+a+` spinner`))if(T(n,l)){b.lastHit=t,e.effects?.burst?.([l[0],l[1]+1,l[2]],{kind:`sparks`,count:30}),w(`Bonk!`);return}}let f=p(`Sky S`+a+` flag`);for(let t of f){let n=Number(String(t.name).split(` `).pop())||0;if(n>b.flag&&E(l,t,mft)){b.flag=n,t.getWorldPosition(_);let r=v(t);b.checkpoint=[_.x+1.2,r.min.y+.05,_.z+.8],e.setSpawn(b.checkpoint,0),e.playSound(`ring`),e.hapticPattern?.(`success`),e.effects?.burst?.([_.x,r.max.y,_.z],{kind:`confetti`,count:48}),e.announce(`Checkpoint `+n,{ms:1e3,color:`#7dffb0`})}}for(let t of p(`Sky S`+a+` coin`))!b.taken.has(t.uuid)&&E(l,t,hft)&&(b.taken.add(t.uuid),t.visible=!1,b.coins++,t.getWorldPosition(_),e.playSound(`coin`,_.toArray()),e.hapticPattern?.(`tap`),e.effects?.burst?.(_.toArray(),{kind:`sparkle`,count:24,color:`#ffd45e`}));let g=d(`Sky S`+a+` portal`);g&&E(l,g,1.6)&&O(a)},O=t=>{let r=Math.max(.1,Number(n.round.elapsed?.()??0));
2510b.finished=r;let i=A9.find(e=>e.id===t),a=S(t),o=!(a>0)||r<a;o&&e.storage?.set?.(x(t),+r.toFixed(1)),b.best=S(t);let s=e.peerNames?.()?.[e.peerId?.()]??`You`;b.result=`Stage `+t+` cleared!`,b.resultLine=s+` · `+j9(r)+` · coins `+b.coins+`/`+b.coinsTotal+(o?` · new best!`:``),e.playSound(`levelup`),e.hapticPattern?.(`success`);let c=e.playerPosition();c&&e.effects?.burst?.(c,{kind:`confetti`,count:96}),n.levels.complete(!0,b.coins,r,t,{coins:b.coins,coinsTotal:b.coinsTotal,par:i?.par??60}),n.round.win(s+` reached the portal in `+j9(r))};e.registerEffect(`skyrunmove`,(e,t,n,r)=>{let i=t?.pos??[e.position.x,e.position.y,e.position.z],a=t?.rot??[0,0,0],o=Math.max(.5,Number(n?.period??4)||4),s=((r+(Number(n?.phase)||0))/o%1+1)%1,c=String(n?.kind??`slide`),l=Number(n?.distance??3)||0,u=String(n?.axis??`x`);if(c===`spin`){e.rotation.set(a[0],a[1]+s*Math.PI*2*(Number(n?.dir)<0?-1:1),a[2]);return}if(c===`blink`){let t=s>=.72,n=s>=.55&&!t?Math.sin(r*60)*.05:0;e.position.set(i[0]+n,i[1]-(t?40:0),i[2]),e.visible=!t;return}let d=Math.sin(s*Math.PI*2)*l*.5;e.position.set(i[0]+(u===`x`?d:0),i[1]+(u===`y`?d:0),i[2]+(u===`z`?d:0)),c===`coin`&&(e.rotation.set(a[0],a[1]+r*2.4,a[2]),b.taken.has(e.uuid)&&(e.visible=!1))});let k=e=>{let t=m(),r=A9.find(e=>e.id===t);switch(String(e?.read??`title`)){case`title`:return`Stage `+t+` · `+(r?.name??``);case`clock`:return j9(b.finished||Number(n.round.elapsed?.()??0));case`coins`:return`Coins `+b.coins+` / `+(b.coinsTotal||p(`Sky S`+t+` coin`).length);case`checkpoint`:return b.flag?`Flag `+b.flag:`No flag yet`;case`best`:return b.best>0?`Best `+j9(b.best):`Best â`;case`result`:return b.result||`Round over`;case`resultLine`:return b.resultLine||String(n.round.outcome?.()??``);case`countdown`:{let e=Number(n.round.countdown?.()??0);return h()===`intro`&&e>0?String(e):``}case`stageBest`:{let t=S(String(e?.level??`1`));return t>0?`best `+j9(t):`not cleared yet`}default:return``}};e.registerValueNode(`skyruninfo`,e=>{let t=k(e);return t===``?` `:t},{vtype:`any`}),e.registerNodeGroup({group:`Sky Run`,items:[{type:`skyruninfo`,label:`Sky Run info`,defaults:{read:`title`,level:`1`},params:[{key:`read`,kind:`select`,options:[`title`,`clock`,`coins`,`checkpoint`,`best`,`result`,`resultLine`,`countdown`,`stageBest`]},{key:`level`,kind:`select`,options:[`1`,`2`,`3`]}]},{type:`skyrunmove`,label:`Sky Run mover`,defaults:{kind:`slide`,axis:`x`,distance:3,period:4,phase:0,dir:1},params:[{key:`kind`,kind:`select`,options:[`slide`,`spin`,`blink`,`coin`]},{key:`axis`,kind:`select`,options:[`x`,`y`,`z`]},{key:`distance`,kind:`range`,min:0,max:12,step:.5},{key:`period`,kind:`range`,min:.5,max:20,step:.5},{key:`phase`,kind:`range`,min:0,max:20,step:.1},{key:`dir`,kind:`range`,min:-1,max:1,step:2}]}]});let A=null,ee=()=>{typeof A==`function`&&A(),A=n.levels.define({id:`skyrun`,list:A9.map(e=>({id:e.id,label:e.id+` · `+e.name,par:{time:e.par}})),unlock:`all`,stars:(e,t)=>{if(!t?.won)return 0;let n=A9.find(t=>t.id===String(e.id)),r=1;return(t.coinsTotal??0)>0&&(t.coins??0)>=t.coinsTotal&&r++,n&&t.time>0&&t.time<=n.par&&r++,r},store:{get:()=>e.storage?.get?.(`progress`,null),set:t=>e.storage?.set?.(`progress`,t)}})};n.levels.onSelected?.(e=>{e?.game===`skyrun`&&f()&&l()&&n.round.restart()});let j=[`Run and jump from platform to platform to the glowing portal at the end of the stage.`,`Desktop: WASD to move, Space to jump, mouse to look. Touch: the left stick walks, drag on the right to look, the Jump button jumps. VR: left stick walks, A jumps (turn on the Comfort vignette in Settings if motion bothers you).`,`Touch a flag to save your spot: fall off, or get hit by a spinner, and you start again from the last flag.`,`Tiles that shake are about to vanish â keep moving. Collect every coin and beat the par time for three stars.`],M=null,te=null,ne=!1;e.registerFrameTask(t=>{let r=f();if(r!==ne){if(ne=r,r){ee(),n.rules.set?.({jump:1.3}),n.round.configure?.(3,0,`lose`,2.5),typeof e.game?.setHelp==`function`&&(M=e.game.setHelp(j)),te=e.input?.actions?.([`jump`],{preset:`platformer`})??null;let t=y(m());e.setSpawn(t.pos,t.yaw),s()}else M&&M(),M=null,te&&te(),te=null,typeof A==`function`&&A(),A=null}r&&D(t)}),e.onSceneClear?.(()=>{M&&M(),M=null,te&&te(),te=null,typeof A==`function`&&A(),A=null,b.key=``,b.taken.clear(),ne=!1}),globalThis.__skyrun={stages:A9,run:()=>({...b,taken:[...b.taken]}),startOf:y,info:k,phase:h,stage:m,teleportTo:t=>{let n=d(t);if(!n)return!1;let r=v(n);return e.setSpawn([(r.min.x+r.max.x)/2,r.max.y+.05,(r.min.z+r.max.z)/2],0,{teleport:!0}),!0}}}},M9=[{id:1,name:`Tin cans`,limit:45,intro:`Knock every can down â off the table or over`,cans:[{table:`Table left`,rows:3}],swing:0,swingSpeed:0,popups:0,popTime:0,cart:0,cartSpeed:0},{id:2,name:`Two stacks`,limit:50,intro:`Two pyramids â clear both tables`,cans:[{table:`Table left`,rows:3},{table:`Table right`,rows:3}],swing:0,swingSpeed:0,popups:0,popTime:0,cart:0,cartSpeed:0}
2510,{id:3,name:`Swingers`,limit:45,intro:`Hit the three swinging targets`,cans:[],swing:3,swingSpeed:1.1,popups:0,popTime:0,cart:0,cartSpeed:0},{id:4,name:`Pop-ups`,limit:45,intro:`Hit 6 targets before they drop`,cans:[],swing:0,swingSpeed:0,popups:6,popTime:2.2,cart:0,cartSpeed:0},{id:5,name:`The cart`,limit:60,intro:`Hit the moving cart 3 times and clear the big pyramid`,cans:[{table:`Table right`,rows:4}],swing:2,swingSpeed:1.5,popups:0,popTime:0,cart:3,cartSpeed:.7}],N9=e=>M9.find(t=>t.id===Number(e))??null,P9={r:.105,h:.28},F9=[-.75,-.45,-.15,.15,.45,.75],I9={can:100,swing:250,popup:200,cart:300};function _ft(e,t,n,r){let i=[],a=P9.r*2+.012;for(let o=0;o<e;o++){let s=e-o;for(let e=0;e<s;e++){let c=t+(e-(s-1)/2)*a,l=n+P9.h/2+o*(P9.h+.004)+.003;i.push([+c.toFixed(4),+l.toFixed(4),r])}}return i}var L9=e=>e.cans.reduce((e,t)=>e+t.rows*(t.rows+1)/2,0),vft=e=>L9(e)+e.swing+e.popups+e.cart;function R9(e,t,n){if(!t||!e)return 0;let r=e.limit-n;return r>=e.limit*.5?3:r>=e.limit*.25?2:1}function z9(e){let t=Math.max(0,Math.min(3,Math.round(Number(e)||0)));return`â
`.repeat(t)+`â`.repeat(3-t)}function B9(e){let t=Math.max(0,Math.ceil(Number(e)||0));return Math.floor(t/60)+`:`+String(t%60).padStart(2,`0`)}function V9(e,t){let n=Math.imul((e|0)^2654435769,2246822507)^Math.imul((t|0)+1663821227,3266489909);return n^=n>>>15,n=Math.imul(n,739982445),n^=n>>>12,n>>>0}function H9(e,t,n){if(!e||!e.popups||!(n>0))return{slot:-1,up:[]};let r=Math.floor(n/e.popTime);if(n-r*e.popTime<.4)return{slot:r,up:[]};let i=V9(t,r)%6,a=V9(t+7,r*3+1)%6;return a===i&&(a=(i+3)%6),{slot:r,up:[i,a]}}function yft(e,t,n){let r=1.6*(n||1),i=e*2.1,a=.55*Math.sin(r*t+i);return{x:1.3*Math.sin(a),y:1.3*(1-Math.cos(a)),rz:a}}var bft=(e,t)=>3.2*Math.sin((t||.7)*e),xft=`Target Toss game`,U9=`Ball template`,W9=`Can template`,G9=`Ball shelf`,Sft=2.5,K9={swing:.42,popup:.36,cart:.5},Cft=1.2,wft=1.6,q9=.9,J9=6.5,Tft=16,Y9={stage:`ttStage`,status:`ttStatus`,dealt:`ttDealt`,cans:`ttCans`,swing:`ttSwing`,pops:`ttPops`,popDown:`ttPopDown`,cart:`ttCart`,combo:`ttCombo`,stars:`ttStars`,time:`ttTime`,score:`ttScore`},X9={none:0,playing:1,won:2,lost:3},Z9=[_dt,xdt,Edt,Ddt,Udt,Kdt,Qdt,uft,gft,{id:`targettoss`,name:`Target Toss`,version:`1.0.0`,description:`The Target Toss game: throw balls at tin-can pyramids, swinging targets, pop-ups and a moving cart â five stages, combos, stars saved on this device.`,register(e){let t=null,n=null,r=null,i=null,a=null;Promise.all([$(()=>import(`../chunks/DHWg9jzn.js`).then(e=>e.s),__vite__mapDeps([13,1,2,10]),import.meta.url),$(()=>import(`../chunks/BFaBkNqh.js`).then(e=>e._),__vite__mapDeps([113,1,2,6,9,0,3,4,5,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url),$(()=>import(`../chunks/B3B8hjh_.js`).then(e=>e.v),__vite__mapDeps([157,1,2,6,9,0,3,4,38,39,5,7,48,10,14,32,13,30,31,57,58,18,19,20,21,22,23,11,12,8,24,25,26,27,28,29,33,34,35,36,37,40,41,42,43,44,45,46,47,49,50,16,51,52,53,54,55,56,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,158,112,113,114,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123]),import.meta.url),$(()=>import(`../chunks/CXukiGwX.js`).then(e=>e.s),__vite__mapDeps([86,1,2,0,3,4,5,6]),import.meta.url),$(()=>import(`../chunks/OHQUSm6n.js`).then(e=>e.s),__vite__mapDeps([2,1]),import.meta.url)]).then(([e,o,s,c,l])=>{t=e,n=o,r=s,i=c,a=l});let o=e.THREE,s=e.kit;s.score.useGame(`targettoss`);let c=new Map,l=new Set,u=new Map,d=new Map,f=-99,p=-1,m=-1,h=-1,g=!1,_=0,v=!1,y=()=>e.objectsGroup(),b=e=>y()?.getObjectByName(e)??null,x=()=>!!b(xft),S=(t,n=0)=>{let r=Number(e.game.getVar(t,n));return Number.isFinite(r)?r:n},C=(t,n)=>{S(t,NaN)!==n&&e.game.setVar(t,n)},w=()=>N9(S(Y9.stage,0)),T=()=>String(s.round.phase?.()??``),E=()=>Number(s.round.number?.()??0)||0,D=()=>Number(s.round.elapsed?.()??0)||0,O=()=>performance.now()/1e3,k=e=>(e.updateMatrixWorld(!0),new o.Box3().setFromObject(e)),A=e=>{e.updateMatrixWorld(!0);let t=new o.Vector3().setFromMatrixPosition(e.matrixWorld);return[t.x,t.y,t.z]},ee=e=>(y()?.children??[]).filter(t=>t.userData?.transient&&String(t.name??``).replace(/ copy$/,``)===e),j=()=>ee(U9),M=()=>ee(W9),te=()=>{if(!r||!a)return!1;if(a.get(r.simulating))return r.isInitiator();if(a.get(r.remoteSimulating))return!1;let t=e.peerId();
2510return!t||[t,...e.peerIds()].filter(Boolean).sort()[0]===t},ne=()=>!!(r&&a&&a.get(r.simulating)&&r.isInitiator()),N=()=>{if(i&&r)for(let e of[...j(),...M()])r.physicsRemoveBody?.(e.uuid),i.removeTransientObject(e.uuid)},P=e=>{C(Y9.stage,e.id),C(Y9.status,X9.playing);for(let e of[Y9.swing,Y9.pops,Y9.popDown,Y9.cart,Y9.combo,Y9.stars,Y9.time,Y9.score])C(e,0);C(Y9.cans,L9(e)),C(Y9.dealt,-1),l.clear(),u.clear(),d.clear(),f=-99},re=(n,r=!1)=>{let i=N9(n);if(!i||!t)return!1;if(s.levels.table?.().find(e=>e.id===String(n))?.locked&&!r)return e.announce(`Stage `+n+` is locked`,{sub:`Clear stage `+(n-1)+` first`,ms:2200,color:`#ffb86b`}),!1;P(i),s.levels.select(String(n)),s.round.configure(2,i.limit,`lose`,2),g=!0;try{s.round.restart()}finally{g=!1}return!0},ie=()=>{C(Y9.status,X9.none),C(Y9.stage,0),s.round.toMenu(),N()},F=(e,t)=>{let i=b(e);if(!i||!n||!r)return null;let a=n.duplicateObject(i.uuid,{select:!1,history:!1,transient:!0,at:t});return a&&r.physicsAddBody(a.uuid),a},ae=()=>{let e=b(G9);if(!e)return F9.map(e=>[e,1.12,1.8]);let t=k(e),n=(t.min.x+t.max.x)/2,r=(t.min.z+t.max.z)/2;return F9.map(e=>[n+e,t.max.y+.115,r])},I=(e,t)=>{if(!ne())return!1;N();for(let t of e.cans){let e=b(t.table);if(!e)continue;let n=k(e);for(let e of _ft(t.rows,(n.min.x+n.max.x)/2,n.max.y,(n.min.z+n.max.z)/2))F(W9,e)}for(let e of ae())F(U9,e);return C(Y9.dealt,t),C(Y9.cans,L9(e)),!0},L=(t,n,r,i)=>{let a=D(),o=a-f<=2.5?Math.min(5,S(Y9.combo,0)+1):1;f=a,C(Y9.combo,o);let c=n*o;C(Y9.score,S(Y9.score)+c),s.score.add(c);let l={op:`fx`,kind:i,at:r,pts:c,combo:o};e.send(l),ue(l)},oe=e=>{if(!ne())return;let t=new Map((r.physicsDebug?.()??[]).map(e=>[e.uuid,e])),n=O(),a=e.cans.map(e=>b(e.table)).filter(Boolean).map(e=>k(e)),o=0;for(let e of M()){let t=e.position,n=a.some(e=>t.x>=e.min.x-.02&&t.x<=e.max.x+.02&&t.z>=e.min.z-.02&&t.z<=e.max.z+.02&&t.y>e.max.y),r=e.quaternion,i=1-2*(r.x*r.x+r.z*r.z)>.6;n&&i&&!l.has(e.uuid)?o++:l.has(e.uuid)||(l.add(e.uuid),L(e.uuid,I9.can,[t.x,t.y,t.z],`can`))}C(Y9.cans,o);let s=ae(),c=j(),d=new Set;for(let a of c){let o=a.position,c=t.get(a.uuid),l=c?.linvel,f=l?Math.hypot(l.x,l.y,l.z):0,p=!!c?.hold,m=s.findIndex(e=>Math.hypot(o.x-e[0],o.z-e[2])<.14&&Math.abs(o.y-e[1])<.12);if(m>=0&&d.add(m),f>=Cft&&!p&&ce(e,a,[o.x,o.y,o.z]),m>=0||p){u.delete(a.uuid);continue}o.y<-1.5?u.set(a.uuid,-99):f<.35?u.has(a.uuid)||u.set(a.uuid,n):u.delete(a.uuid);let h=u.get(a.uuid);h!==void 0&&n-h>=wft&&(u.delete(a.uuid),r.physicsRemoveBody?.(a.uuid),i.removeTransientObject(a.uuid))}let f=j().length;for(let e=0;e<s.length&&f<s.length;e++){if(d.has(e))continue;let t=s[e];j().some(e=>Math.hypot(e.position.x-t[0],e.position.y-t[1],e.position.z-t[2])<.24)||(F(U9,t),f++)}R(e)<=0&&le(e,!0)},R=e=>{let t=Math.max(0,e.swing-se(S(Y9.swing)&(1<<e.swing)-1));return S(Y9.cans)+t+Math.max(0,e.popups-S(Y9.pops))+Math.max(0,e.cart-S(Y9.cart))},se=e=>{let t=0;for(let n=e>>>0;n;n>>>=1)t+=n&1;return t},ce=(e,t,n)=>{let r=O(),i=e=>r-(d.get(e)??-99)>.6,a=S(Y9.swing);for(let t=0;t<Math.min(e.swing,3);t++){if(a&1<<t)continue;let e=b(`Swing target `+(t+1));if(!e)continue;let r=A(e);Math.hypot(n[0]-r[0],n[1]-r[1],n[2]-r[2])>K9.swing||(C(Y9.swing,S(Y9.swing)|1<<t),L(`swing`+t,I9.swing,r,`swing`))}if(e.popups&&S(Y9.pops)<e.popups){let{slot:t,up:r}=H9(e,E(),D()),i=S(Y9.popDown),a=Math.floor(i/64)===t?i%64:0;for(let e of r){if(a&1<<e)continue;let r=b(`Popup target `+(e+1));if(!r)continue;let i=A(r);if(!(Math.hypot(n[0]-i[0],n[1]-i[1],n[2]-i[2])>K9.popup)){C(Y9.popDown,t*64+(a|1<<e)),C(Y9.pops,S(Y9.pops)+1),L(`pop`+e,I9.popup,i,`popup`);break}}}if(e.cart&&S(Y9.cart)<e.cart&&i(`cart`)){let e=b(`Cart target`);if(e){let t=A(e);Math.hypot(n[0]-t[0],n[1]-t[1],n[2]-t[2])<=K9.cart&&(d.set(`cart`,r),C(Y9.cart,S(Y9.cart)+1),L(`cart`,I9.cart,t,`cart`))}}},le=(e,t,n=!1)=>
2510{if(S(Y9.status)!==X9.playing)return;let r=D(),i=R9(e,t,r);C(Y9.stars,i),C(Y9.time,Math.round(r*10)),C(Y9.status,t?X9.won:X9.lost),s.levels.complete(t,S(Y9.score),r),!n&&(t?s.round.win(`Stage cleared`):s.round.lose(`Time is up`))},ue=t=>{let n=Array.isArray(t?.at)?t.at:[0,1,0],r=String(t?.kind??`can`);e.effects?.burst?.(n,{kind:r===`can`?`sparks`:`confetti`,count:r===`can`?28:56,color:r===`cart`?`#ffd45e`:``}),e.playSound?.(r===`can`?`hit`:r===`cart`?`coin`:`ring`,n),(Number(t?.combo)||1)>=2&&e.playSound?.(`pop`,n),e.hapticPattern?.(`tap`)};e.onMessage(e=>{x()&&(e?.op===`fx`?ue(e):e?.op===`throw`&&ne()&&z(e))});let de=()=>{let n=w(),r=t&&a?a.get(t.gameState):null,i=T(),o=E();if(n&&(i===`intro`||i===`playing`)&&m!==o&&(m=o,h=-1,e.announce(`Stage `+n.id+` · `+n.name,{sub:n.intro,ms:3600,color:`#ffd45e`}),e.playSound?.(`whistle`)),n&&r?.state===`over`&&h!==o){if(h=o,S(Y9.status)===X9.won){e.playSound?.(`levelup`),e.hapticPattern?.(`success`);let t=b(G9),n=t?A(t):[0,1.5,0];e.effects?.burst?.([n[0],n[1]+1.2,n[2]-3],{kind:`confetti`,count:96})}else e.playSound?.(`fail`),e.hapticPattern?.(`fail`)}},z=e=>{if(!r?.applyThrow)return;let t=e.pos,n=e.dir;if(!Array.isArray(t)||!Array.isArray(n))return;let i=Math.max(J9,Math.min(Tft,Number(e.speed)||J9)),a=new Map((r.physicsDebug?.()??[]).map(e=>[e.uuid,e])),o=ae(),s=j().find(e=>!a.get(e.uuid)?.hold&&o.some(t=>Math.hypot(e.position.x-t[0],e.position.z-t[2])<.16&&Math.abs(e.position.y-t[1])<.15));s&&r.applyThrow({uuid:s.uuid,pos:t,rot:[0,0,0],linvel:[n[0]*i,n[1]*i+.6,n[2]*i],angvel:[0,0,0]})},fe=()=>x()&&e.isPlaying()&&!e.isVR()&&T()===`playing`,pe=()=>{let t=e.pointerRay?.();if(!t)return!1;let n=t.intersectObjects(j(),!0);return n.length>0&&n[0].distance<2.2},B=e=>{let t=e.target;e.button===0&&t?.tagName===`CANVAS`&&fe()&&!pe()&&(v=!0,_=O())},me=e=>{e.button===0&&v&&(v=!1,fe()&&V(Math.min(1,(O()-_)/q9)))},V=t=>{let n=e.pointerRay?.();if(!n)return!1;let r=n.ray.origin,i=n.ray.direction,a={op:`throw`,pos:[r.x+i.x*.45,r.y+i.y*.45-.12,r.z+i.z*.45],dir:[i.x,i.y,i.z],speed:J9+9.5*t};return e.playSound?.(`whoosh`),ne()?z(a):e.send(a),!0};e.listen(window,`mousedown`,B,!0),e.listen(window,`mouseup`,me,!0),e.registerEffect(`tossswing`,(e,t,n,r)=>{let i=w(),a=Math.max(0,(Number(n?.index)||1)-1),o=t?.pos??[0,0,0],s=t?.rot??[0,0,0],c=!!i&&a<i.swing&&!(S(Y9.swing)&1<<a)&&S(Y9.status)===X9.playing,l=yft(a,r,i?.swingSpeed??1);e.position.set(o[0]+l.x,(c?o[1]:o[1]-30)+l.y,o[2]),e.rotation.set(s[0],s[1],s[2]+l.rz)}),e.registerEffect(`tosspopup`,(e,t,n)=>{let r=w(),i=Math.max(0,(Number(n?.index)||1)-1),a=t?.pos??[0,0,0],o=!1;if(r&&r.popups&&S(Y9.status)===X9.playing&&T()===`playing`&&S(Y9.pops)<r.popups){let{slot:e,up:t}=H9(r,E(),D()),n=S(Y9.popDown),a=Math.floor(n/64)===e?n%64:0;o=t.includes(i)&&!(a&1<<i)}e.position.set(a[0],o?a[1]:a[1]-1.1,a[2])}),e.registerEffect(`tosscart`,(e,t,n,r)=>{let i=w(),a=t?.pos??[0,0,0],o=!!i&&i.cart>0&&S(Y9.status)===X9.playing,s=o&&S(Y9.cart)>=i.cart,c=bft(r,i?.cartSpeed||.7);e.position.set(a[0]+c,o?a[1]-(s?.6:0):a[1]-30,a[2])});let he=t=>{let n=String(t?.read??`title`),r=w(),i=s.levels.table?.()??[];if(n===`levelStars`){let e=i.find(e=>e.id===String(Number(t?.level)||0));return e?e.locked?`ð locked`:z9(e.stars):``}if(n===`menuLine`)return`Stars earned: `+i.reduce((e,t)=>e+(t.stars||0),0)+` / `+M9.length*3;if(n===`charge`)return v?Math.min(1,(O()-_)/q9):0;if(n===`hint`)return e.isVR()?`Grip a ball · throw it`:`Hold to charge · release to throw · Esc menu`;if(!r)return n===`progress`?0:``;switch(n){case`title`:return`Stage `+r.id+` · `+r.name;case`targets`:{let e=[],t=L9(r);return t&&e.push(`Cans `+(t-S(Y9.cans))+`/`+t),r.swing&&e.push(`Swingers `+se(S(Y9.swing)&(1<<r.swing)-1)+`/`+r.swing),r.popups&&e.push(`Pop-ups `+S(Y9.pops)+`/`+r.popups),r.cart&&e.push(`Cart `+S(Y9.cart)+`/`+r.cart),e.join(` · `)}case`progress`:{let e=vft(r);return e?1-R(r)/e:0}case`score`:return`Score `+S(Y9.score);case`combo`:{let e=S(Y9.combo);return e>=2&&D()-ge()<=2.5?`Combo x`+e:` `}case`clock`:return B9(Number(s.round.remaining?.()??0));case`result`:return S(Y9.status)===X9.won?`Stage cleared!`:`Time is up`;case`resultStars`:return z9(S(Y9.status)===X9.won?S(Y9.stars):0);case`resultLine`:return S(Y9.status)===X9.won?`Score `+S(Y9.score)+` · time `+B9(S(Y9.time)/10)+` of `+B9(r.limit):`Score `+S(Y9.score)+` · `+R(r)+` target`+(R(r)===1?``:`s`)+` left standing`;
2510case`best`:{let e=Number(s.score.best?.()??0)||0;return e>0?`Best score on this stage: `+e:` `}default:return``}},H={value:0,at:-99},ge=()=>{let e=S(Y9.combo);return e!==H.value&&(H={value:e,at:D()}),H.at};e.registerValueNode(`tossinfo`,e=>{let t=he(e);return t===``?` `:t},{vtype:`any`}),e.registerNodeGroup({group:`Target Toss`,items:[{type:`tossinfo`,label:`Target Toss info`,defaults:{read:`title`,level:1},params:[{key:`read`,kind:`select`,options:[`title`,`targets`,`progress`,`score`,`combo`,`clock`,`charge`,`hint`,`result`,`resultStars`,`resultLine`,`best`,`levelStars`,`menuLine`]},{key:`level`,kind:`range`,min:1,max:M9.length,step:1}]},{type:`tossswing`,label:`Swinging target`,defaults:{index:1},params:[{key:`index`,kind:`range`,min:1,max:3,step:1}]},{type:`tosspopup`,label:`Pop-up target`,defaults:{index:1},params:[{key:`index`,kind:`range`,min:1,max:6,step:1}]},{type:`tosscart`,label:`Moving cart`,defaults:{},params:[]}]});let U=t=>{let n=S(Y9.stage,0),r=/^lvl-(\d+)$/.exec(t);if(r)return re(Number(r[1]));if(t===`retry-btn`||t===`restart-btn`)return n?re(n):!1;if(t===`next-btn`){let t=n+1;return N9(t)?re(t):(e.announce(`That was the last stage`,{sub:`Go back for three stars on each`,ms:2400,color:`#ffd45e`}),ie())}return t===`levels-btn`||t===`quit-btn`?ie():!1},W=()=>{let t=te();for(let n of e.flow.nodes(`hudbutton`)){let r=String(n.data?.element??``);if(!/^(lvl-\d+|next-btn|retry-btn|levels-btn|restart-btn|quit-btn)$/.test(r))continue;let i=e.flow.triggerStamp(n.id),a=Number(i?.stamp)||0;if(!c.has(n.id)){c.set(n.id,a);continue}if(a===c.get(n.id))continue;let o=Number(i?.age??0)<Sft;c.set(n.id,a),o&&t&&U(r)}},_e=null,ve=()=>{typeof _e==`function`&&_e(),_e=s.levels.define({id:`targettoss`,list:M9.map(e=>({id:String(e.id),label:e.id+` · `+e.name})),unlock:`sequential`,stars:(e,t)=>R9(N9(Number(e.id))??M9[0],!!t.won,Number(t.time)||0)})};s.levels.onSelected(e=>{if(e?.game!==`targettoss`||!x()||!te())return;let t=Number(e.level);N9(t)&&S(Y9.stage,0)!==t&&re(t)}),s.round.onStarted(()=>{if(g||!x()||!te())return;let e=w();if(!e)return s.round.toMenu();P(e)});let G=[`Knock down every target before the clock runs out: tin cans (off the table or over), swinging targets, pop-ups and a moving cart.`,`VR: grab a ball from the shelf with the grip and throw it. Desktop: HOLD the mouse to charge, RELEASE to throw (or grab a ball and flick it). Touch: drag to aim, HOLD the Throw button to charge, let go to throw.`,`Hits in quick succession build a COMBO (up to x5). Balls come back to the shelf by themselves.`,`Stars: clear the stage for one, with half the clock left for three. A star opens the next stage.`],ye=null,be=!1,xe=null,K=()=>e.input?.actions?.([{id:`fire`,label:`Throw`,icon:`fire`,onPress:()=>{fe()&&(v=!0,_=O())},onRelease:()=>{v&&(v=!1,fe()&&V(Math.min(1,(O()-_)/q9)))}}],{preset:`toss`})??null,Se=!1,Ce=``,we=[0,0,3.25];e.registerFrameTask(()=>{if(!t||!a)return;let n=x();n!==Se&&(Se=n,n&&ve(),n?(s.rules.set({reach:1.6}),be=!0):be&&=(s.rules.clearRules(),!1),n&&typeof e.game?.setHelp==`function`&&(ye=e.game.setHelp(G)),n&&(xe=K()),!n&&xe&&(xe(),xe=null),!n&&ye&&(ye(),ye=null),!n&&typeof _e==`function`&&(_e(),_e=null));let r=n&&!e.isVR()?`desk`:``;if(r!==Ce&&(Ce=r,e.setSpawn?.(r?we:null,0)),!n)return;W();let i=w(),o=T();if(i&&te()&&S(Y9.status)===X9.playing){let e=E();(o===`intro`||o===`playing`)&&(S(Y9.dealt,-1)!==e||ne()&&j().length===0)?I(i,e):o===`playing`?oe(i):(o===`lost`||o===`results`)&&p!==e&&(p=e,le(i,!1,!0))}de()}),e.onSceneClear(()=>{ye&&=(ye(),null),xe&&=(xe(),null),typeof _e==`function`&&(_e(),_e=null),be=!1,c.clear(),l.clear(),u.clear(),m=-1,h=-1,Se=!1,Ce&&e.setSpawn?.(null),Ce=``}),globalThis.__targetToss={stages:M9,vars:()=>Object.fromEntries(Object.values(Y9).map(t=>[t,e.game.getVar(t,null)])),authority:te,stepping:ne,startStage:re,toMenu:ie,info:he,balls:()=>j().map(e=>({uuid:e.uuid,pos:e.position.toArray()})),cans:()=>M().map(e=>({uuid:e.uuid,pos:e.position.toArray()})),throwNow:V,throwAt:(t,n,r=12)=>{let i=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],a=Math.hypot(i[0],i[1],i[2])||1,o={op:`throw`,pos:t,dir:[i[0]/a,i[1]/a,i[2]/a],speed:r};ne()?z(o):e.send(o)},sweepCans:()=>
2510{if(!ne())return 0;let e=0;for(let t of M())r.applyThrow({uuid:t.uuid,pos:[t.position.x,t.position.y+.05,t.position.z+.6],rot:[0,0,0],linvel:[0,1,3],angvel:[0,0,0]}),e++;return e},shortenClock:e=>s.round.configure(2,e,`lose`,2),finishNow:e=>{let t=w();t&&le(t,e!==!1)}}}}],Eft=V(`<p class="text-sm italic text-gray-500 dark:text-gray-400 svelte-f65ivs">Loading the module listâ¦</p>`),Dft=V(`<p class="text-sm italic text-gray-500 dark:text-gray-400 svelte-f65ivs">The gallery is unavailable right now (offline?) â installs by zip or URL in the 2511 User tab still work.</p>`),Q9=V(`<button> </button>`),Oft=V(`<span class="px-1 text-gray-600 svelte-f65ivs">|</span> <!>`,1),kft=V(`<p id="gallery-filtered-empty" class="text-sm italic text-gray-500 dark:text-gray-400 svelte-f65ivs">Nothing matches that filter.</p>`),Aft=V(`<span class="pl-2 text-xs text-gray-500 svelte-f65ivs"> </span>`),jft=V(`<span class="text-xs text-green-500 svelte-f65ivs">Installed</span>`),Mft=V(`<span class="gal-badge gal-badge-game svelte-f65ivs">game</span>`),Nft=V(`<span class="gal-badge svelte-f65ivs"> </span>`),Pft=V(`<span class="gal-badge gal-badge-scene svelte-f65ivs">+ scene</span>`),Fft=V(`<div class="flex flex-wrap items-center gap-1 pt-1.5 svelte-f65ivs"><!> <!> <!></div>`),Ift=V(`<div><div class="flex items-center justify-between svelte-f65ivs"><div class="svelte-f65ivs"><span class="font-semibold text-gray-900 dark:text-white svelte-f65ivs"> </span> <span class="pl-2 text-xs text-gray-400 svelte-f65ivs"> </span> <!></div> <!></div> <p class="pt-1 text-sm text-gray-500 dark:text-gray-300 svelte-f65ivs"> </p> <!></div>`),Lft=V(`<div id="gallery-filters" class="flex flex-wrap items-center gap-1.5 svelte-f65ivs"><button data-gal-cat="all">All</button> <!> <!></div> <!> <!>`,1),Rft=V(`<div id="module-gallery-tab" class="flex flex-col gap-3 svelte-f65ivs"><p class="text-xs text-yellow-500 svelte-f65ivs">â Modules run unsandboxed in your session â install only sources you trust. 2512 This list comes from github.com/theprototype-app/modules.</p> <!></div>`),$9=V(`<span class="pl-2 text-xs text-yellow-400 svelte-f65ivs">reload to disable</span>`),zft=V(`<!> <!>`,1),Bft=V(`<!>Download as example`,1),Vft=V(`<div class="rounded-lg border border-gray-600 p-3 svelte-f65ivs"><div class="flex items-center justify-between svelte-f65ivs"><div class="svelte-f65ivs"><span class="font-semibold text-gray-900 dark:text-white svelte-f65ivs"> </span> <span class="pl-2 text-xs text-gray-400 svelte-f65ivs"> </span> <!></div> <!></div> <p class="pt-1 text-sm text-gray-500 dark:text-gray-300 svelte-f65ivs"> </p> <div class="flex flex-wrap items-center gap-2 pt-2 svelte-f65ivs"><!> <!></div></div>`),Hft=V(`<div class="flex flex-col gap-3 svelte-f65ivs"><!></div>`),Uft=V(`<span class="block break-all pl-4 text-gray-500 svelte-f65ivs"> </span>`),Wft=V(`<span> </span> <!>`,1),Gft=V(`<span class="text-gray-400 svelte-f65ivs"> </span>`),Kft=V(`<span class="text-gray-500 svelte-f65ivs"> </span>`),qft=V(`<div class="flex items-center justify-between gap-2 py-1 svelte-f65ivs"><span class="text-gray-200 svelte-f65ivs"> <span class="text-gray-400 svelte-f65ivs"> </span></span> <!></div>`),Jft=V(`<div id="stale-modules" class="rounded-lg border border-yellow-500/60 p-3 text-sm svelte-f65ivs"><p class="font-semibold text-yellow-300 svelte-f65ivs">Older than this app expects</p> <p class="pb-1 text-xs text-gray-400 svelte-f65ivs">An installed module never updates itself, and an old one can bring back a bug this version already fixed.</p> <!></div>`),Yft=V(`<span class="text-xs text-gray-400 svelte-f65ivs">Auto</span>`),Xft=V(`<div class="rounded-lg border border-gray-600 p-3 svelte-f65ivs"><div class="flex items-center justify-between svelte-f65ivs"><div class="svelte-f65ivs"><span class="font-semibold text-gray-900 dark:text-white svelte-f65ivs"> </span> <span class="pl-2 text-xs text-gray-400 svelte-f65ivs"> </span> <span class="pl-2 text-xs text-gray-500 svelte-f65ivs"> </span> <!></div> <!></div> <p class="pt-1 text-sm text-gray-500 dark:text-gray-300 svelte-f65ivs"> </p> <div class="flex flex-wrap items-center gap-2 pt-2 svelte-f65ivs"><!> <!> <!></div> <div class="flex items-center gap-2 pt-2 svelte-f65ivs"><input class="flex-1 rounded-sm border border-gray-700 bg-transparent px-2 py-1 text-xs dar
2512k:text-gray-300 svelte-f65ivs" placeholder="Dev URL (serves manifest.json â defaults to the install URL)"/> <!> <div class="shrink-0 svelte-f65ivs" title="Poll the dev URL (~2s) and reload when the code changes"><!></div></div></div>`),Zft=V(`<p class="text-sm italic text-gray-500 dark:text-gray-400 svelte-f65ivs">Nothing installed yet â download a core module above as a starting point 2513 (the entry must be self-contained: no import statements, use api.THREE and 2514 api.assetUrl; see the SDK docs).</p>`),Qft=V(`<div id="user-modules-tab" class="flex flex-col gap-3 svelte-f65ivs"><p class="text-xs text-yellow-500 svelte-f65ivs">â Modules run code inside your session â install only from sources you trust. 2515 Every peer needs the same modules for shared behavior to match.</p> <div class="flex flex-wrap items-center gap-2 svelte-f65ivs"><input id="install-module-url" class="min-w-0 flex-1 basis-full rounded-sm border border-gray-600 bg-transparent px-2 py-1 text-sm sm:min-w-[20rem] sm:basis-auto dark:text-white svelte-f65ivs" placeholder="Module URL â https://raw.githubusercontent.com/user/repo/main/mymodule (or a github.com/â¦/tree/⦠link)"/> <!> <span class="text-xs text-gray-500 svelte-f65ivs">or</span> <!> <input type="file" id="install-module-zip" style="display: none" accept=".zip" class="svelte-f65ivs"/></div> <div id="install-status" class="-mt-1 min-h-[1.25rem] text-xs svelte-f65ivs" aria-live="polite"><!></div> <!> <!> <!></div>`),$ft=V(`<div class="mod-tabs svelte-f65ivs" role="tablist"><button role="tab">Core</button> <button role="tab"> </button> <button role="tab">Browse</button></div> <!>`,1);function ept(e,t){Ce(t,!1);let n=()=>z(Oo,`$modulesOpen`,T),i=()=>z(pb,`$galleryModules`,T),a=()=>z(Pee,`$modulePrimitiveGroups`,T),o=()=>z(E6,`$staleModuleList`,T),c=()=>z(vb,`$userModules`,T),l=()=>z(gb,`$lastInstalled`,T),p=()=>z(nme,`$galleryState`,T),m=()=>z(une,`$loadedModulesChanged`,T),_=()=>z(qu,`$disabledModules`,T),y=()=>z(Nee,`$moduleMenuItems`,T),x=()=>z(hb,`$installStatus`,T),C=()=>z(D6,`$updatingModules`,T),w=()=>z(dme,`$devPolling`,T),[T,E]=Ve(),D=F(),k=F(),A=F(),ee=F(),M=F(),te=F(),ne=F(),P=F(`all`),re=F([]);function ie(e){I(P,e),I(re,[])}function ae(e){I(re,Q(re).includes(e)?Q(re).filter(t=>t!==e):[...Q(re),e])}let L=F(`core`),oe=F(!1),se=F(``),ce=F(``),le=F(!1);async function de(){if(Q(le))return;if(!Q(se).trim()){hb.set({kind:`error`,text:`Paste a module URL first`,detail:`Or use Choose .zip⦠to install a packaged module.`}),document.getElementById(`install-module-url`)?.focus();return}I(le,!0);let e=await xb(Q(se));I(le,!1),e&&I(se,``)}let pe=-1,me=F(!1);function V(e){pe>=0&&e>pe&&(I(me,!0),setTimeout(()=>I(me,!1),1600)),pe=e}function he(e,t){e===`user`&&t&&typeof document<`u`&&setTimeout(()=>{let e=document.getElementById(`user-module-card-`+t);e&&(e.scrollIntoView({block:`center`,behavior:`smooth`}),e.classList.add(`just-installed`),setTimeout(()=>e.classList.remove(`just-installed`),2200),gb.set(null))},60)}async function ge(e){I(ce,e.id),await xb(fb(e)),I(ce,``)}let U=Object.assign({
2515"../../modules/button/ButtonTriggerNode.svelte":()=>$(()=>import(`../chunks/CH-wHLqy.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/button/module.js":()=>$(()=>import(`../chunks/B9w6H2Pr.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/escape/module.js":()=>$(()=>import(`../chunks/BavlsKep.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/hello/module.js":()=>$(()=>import(`../chunks/A-Is9RNm.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/marble/module.js":()=>$(()=>import(`../chunks/CsmNWaNo.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/minigolf/holes.js":()=>$(()=>import(`../chunks/C9qci1Ol.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/minigolf/module.js":()=>$(()=>import(`../chunks/Ckc-eudB.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/pong/module.js":()=>$(()=>import(`../chunks/BVLwNe6c.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/skyrun/module.js":()=>$(()=>import(`../chunks/BGrhBTDU.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/targettoss/module.js":()=>$(()=>import(`../chunks/TNJDAsDz.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/targettoss/stages.js":()=>$(()=>import(`../chunks/_YSWStGz.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/towers/levels.js":()=>$(()=>import(`../chunks/P2wKiBO4.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/towers/module.js":()=>$(()=>import(`../chunks/GImelus7.js`).then(e=>e.default),[],import.meta.url),
2515"../../modules/vrsleeve/module.js":()=>$(()=>import(`../chunks/e9oTNP-y.js`).then(e=>e.default),[],import.meta.url)
2515});async function _e(e){let{zipSync:t,strToU8:n}=await $(async()=>{let{zipSync:e,strToU8:t}=await import(`../chunks/BJRbKqus.js`).then(e=>e.t);return{zipSync:e,strToU8:t}},__vite__mapDeps([98,1]),import.meta.url),r={"manifest.json":n(JSON.stringify({id:e.id,name:e.name,version:e.version,description:e.description??``,entry:`module.js`},null,2))};for(let[t,i]of Object.entries(U)){let a=t.match(/modules\/([^/]+)\/(.+)$/);a&&a[1]===e.id&&(r[a[2]]=n(String(await i())))}let i=new Blob([t(r)],{type:`application/zip`}),a=document.createElement(`a`);a.href=URL.createObjectURL(i),a.download=e.id+`.module.zip`,a.click(),URL.revokeObjectURL(a.href)}d(()=>(n(),js),()=>{n()?jo():n()===!1&&js()}),d(()=>(Q(P),i()),()=>{I(D,Q(P)===`all`?i():i().filter(e=>(e.category??`tool`)===Q(P)))}),d(()=>Q(D),()=>{I(k,cw(Q(D)))}),d(()=>(Q(D),Q(re)),()=>{I(A,Q(D).filter(e=>uw(e,Q(re))))}),d(()=>a(),()=>{I(ee,a().flatMap(e=>e.items).reduce((e,t)=>((e[t.moduleId]??=[]).push(t),e),{}))}),d(()=>n(),()=>{n()||I(oe,!1)}),d(()=>(n(),o(),Q(oe)),()=>{n()&&o().length&&!Q(oe)&&(I(oe,!0),I(L,`user`))}),d(()=>c(),()=>{V(c().length)}),d(()=>(Q(L),l()),()=>{he(Q(L),l())}),d(()=>(Q(se),Sb),()=>{I(M,Q(se).trim()?Sb(Q(se)):``)}),d(()=>(Q(M),c()),()=>{I(te,Q(M)?c().find(e=>e.source===Q(M)):null)}),d(()=>c(),()=>{I(ne,c().reduce((e,t)=>(e[t.id]=t,e),{}))}),h(),R(),co(e,{title:`Modules`,modal:!1,onkeydown:e=>{e.key===`Escape`&&Oo.set(!1)},size:`lg`,outsideclose:!0,class:`tp-modal-frame`,classes:{header:`tp-modal-header`,body:`tp-modal-body flex-1`},get open(){return Se(),n()},set open(e){ke(Oo,e)},children:(e,t)=>{var n=$ft(),a=N(n),l=j(a);let d;var h=g(l,2);let T;var E=f(h),D=g(h,2);let F;H(a);var oe=g(a,2),R=e=>{var t=Rft(),n=g(j(t),2),a=e=>{var t=Eft();X(e,t)},o=e=>{var t=Dft();X(e,t)},c=e=>{var t=Lft(),n=N(t),i=j(n);let a;var o=g(i,2);B(o,1,()=>rme,e=>e,(e,t)=>{var n=Q9();let i;var a=f(n);O(()=>{i=r(n,1,`gal-chip svelte-f65ivs`,null,i,{active:Q(P)===Q(t)}),b(n,`data-gal-cat`,Q(t)),b(n,`aria-pressed`,Q(P)===Q(t)),Y(a,`${Q(t)??``}s`)}),Z(`click`,n,()=>ie(Q(t))),X(e,n)});var c=g(o,2),l=e=>{var t=Oft(),n=g(N(t),2);B(n,1,()=>Q(k),e=>e,(e,t)=>{var n=Q9();let i;var a=f(n,!0);O((e,o)=>{i=r(n,1,`gal-chip gal-chip-tag svelte-f65ivs`,null,i,{active:e}),b(n,`data-gal-tag`,Q(t)),b(n,`aria-pressed`,o),Y(a,Q(t))},[()=>Q(re).includes(Q(t)),()=>(Q(re),Q(t),K(()=>Q(re).includes(Q(t))))]),Z(`click`,n,()=>ae(Q(t))),X(e,n)}),X(e,t)};G(c,e=>{Q(k),K(()=>Q(k).length)&&e(l)}
2515),H(n);var u=g(n,2),d=e=>{var t=kft();X(e,t)};G(u,e=>{Q(A),K(()=>Q(A).length===0)&&e(d)});var p=g(u,2);B(p,1,()=>Q(A),e=>e.id,(e,t)=>{let n=ze(()=>(Q(ne),Q(t),K(()=>Q(ne)[Q(t).id])));var i=Ift();let a;var o=j(i),c=j(o),l=j(c),u=f(l,!0),d=g(l,2),p=f(d),m=g(d,2),h=e=>{var n=Aft(),r=f(n);O(()=>Y(r,`by ${Q(t),K(()=>Q(t).author)??``}`)),X(e,n)};G(m,e=>{Q(t),K(()=>Q(t).author)&&e(h)}),H(c);var _=g(c,2),v=e=>{{let n=ze(()=>(Q(ce),Q(t),K(()=>Q(ce)===Q(t).id||!Q(t).source)));Do(e,{size:`xs`,get disabled(){return Q(n)},onclick:()=>ge(Q(t)),children:(e,n)=>{W();var r=Te();O(()=>Y(r,(Q(ce),Q(t),K(()=>Q(ce)===Q(t).id?`Installingâ¦`:`Install`)))),X(e,r)},$$slots:{default:!0}})}},y=e=>{{let n=ze(()=>(Q(ce),Q(t),K(()=>Q(ce)===Q(t).id)));Do(e,{size:`xs`,color:`alternative`,get disabled(){return Q(n)},onclick:()=>ge(Q(t)),children:(e,n)=>{W();var r=Te();O(()=>Y(r,(Q(ce),Q(t),K(()=>Q(ce)===Q(t).id?`Updatingâ¦`:`Update to v`+Q(t).version)))),X(e,r)},$$slots:{default:!0}})}},x=q(()=>(s(mb),Q(t),s(Q(n)),K(()=>mb(Q(t).version,Q(n).version)))),S=e=>{var t=jft();X(e,t)};G(_,e=>{Q(n)?Q(x)?e(y,1):e(S,-1):e(v)}),H(o);var C=g(o,2),w=f(C,!0),T=g(C,2),E=e=>{var n=Fft(),r=j(n),i=e=>{var n=Mft();O(()=>b(n,`data-gal-badge`,(Q(t),K(()=>Q(t).id)))),X(e,n)};G(r,e=>{Q(t),K(()=>Q(t).category===`game`)&&e(i)});var a=g(r,2);B(a,1,()=>(Q(t),K(()=>Q(t).tags??[])),e=>e,(e,t)=>{var n=Nft(),r=f(n,!0);O(()=>Y(r,Q(t))),X(e,n)});var o=g(a,2),s=e=>{var n=Pft();O(()=>b(n,`title`,(Q(t),K(()=>`Scene: `+Q(t).template)))),X(e,n)};G(o,e=>{Q(t),K(()=>Q(t).template)&&e(s)}),H(n),X(e,n)};G(T,e=>{Q(t),K(()=>Q(t).category===`game`||Q(t).tags?.length)&&e(E)}),H(i),O(e=>{b(i,`id`,(Q(t),K(()=>`gallery-card-`+Q(t).id))),a=r(i,1,`rounded-lg border border-gray-600 p-3 svelte-f65ivs`,null,a,{"opacity-60":e}),Y(u,(Q(t),K(()=>Q(t).name))),Y(p,`v${Q(t),K(()=>Q(t).version)??``}`),Y(w,(Q(t),K(()=>Q(t).description)))},[()=>Q(n)&&!mb(Q(t).version,Q(n).version)]),X(e,i)}),O(()=>{a=r(i,1,`gal-chip svelte-f65ivs`,null,a,{active:Q(P)===`all`}),b(i,`aria-pressed`,Q(P)===`all`)}),Z(`click`,i,()=>ie(`all`)),X(e,t)};G(n,e=>{p()===`loading`?e(a):(i(),K(()=>i().length===0)?e(o,1):e(c,-1))}),H(t),X(e,t)},ue=e=>{var t=Hft(),n=j(t);Ie(n,m,e=>{var t=fe(),n=N(t);B(n,1,()=>Z9,e=>e.id,(e,t)=>{var n=Vft(),r=j(n),i=j(r),a=j(i),o=f(a,!0),c=g(a,2),l=f(c),u=g(c,2),d=e=>{var t=$9();X(e,t)},p=q(()=>(_(),Q(t),s(Ku),K(()=>_().includes(Q(t).id)&&Ku(Q(t).id))));G(u,e=>{Q(p)&&e(d)}),H(i);var m=g(i,2);{let e=ze(()=>(_(),Q(t),K(()=>!_().includes(Q(t).id))));ao(m,{size:`small`,get checked(){return Q(e)},onchange:e=>dne(Q(t),e.target.checked)})}H(r);var h=g(r,2),v=f(h,!0),x=g(h,2),S=j(x),C=e=>{var n=zft(),r=N(n);B(r,1,()=>(y(),Q(t),K(()=>y().filter(e=>e.moduleId===Q(t).id))),Be,(e,t)=>{Do(e,{size:`xs`,get onclick(){return Q(t),K(()=>Q(t).action)},children:(e,n)=>{W();var r=Te();O(()=>Y(r,(Q(t),K(()=>Q(t).label)))),X(e,r)},$$slots:{default:!0}})});var i=g(r,2);B(i,1,()=>(Q(ee),Q(t),K(()=>Q(ee)[Q(t).id]??[])),Be,(e,t)=>{Do(e,{size:`xs`,color:`green`,get title(){return Q(t),K(()=>Q(t).command)},onclick:()=>Gy(Q(t).command),children:(e,n)=>{W();var r=Te();O(()=>Y(r,`+ ${Q(t),K(()=>Q(t).label)??``}`)),X(e,r)},$$slots:{default:!0}})}),X(e,n)},w=q(()=>(s(Ku),Q(t),_(),K(()=>Ku(Q(t).id)&&!_().includes(Q(t).id))));G(S,e=>{Q(w)&&e(C)});var T=g(S,2);Do(T,{size:`xs`,color:`alternative`,onclick:()=>_e(Q(t)),children:(e,t)=>{var n=Bft(),r=N(n);iS(r,{size:16,class:`mr-1`,"aria-hidden":`true`}),W(),X(e,n)},$$slots:{default:!0}}),H(x),H(n),O(()=>{b(n,`id`,(Q(t),K(()=>`module-card-`+Q(t).id))),Y(o,(Q(t),K(()=>Q(t).name))),Y(l,`v${Q(t),K(()=>Q(t).version)??``}`),Y(v,(Q(t),K(()=>Q(t).description??``)))}),X(e,n)}),X(e,t)}),H(t),X(e,t)},z=e=>{var t=Qft(),n=g(j(t),2),i=j(n);v(i);var a=g(i,2);Do(a,{size:`xs`,onclick:de,children:(e,t)=>{W();var n=Te();O(()=>Y(n,Q(le)?`Installingâ¦`:`Install`)),X(e,n)},$$slots:{default:!0}});var l=g(a,4);Do(l,{size:`xs`,color:`alternative`,onclick:()=>document.getElementById(`install-module-zip`).click(),children:(e,t)=>{W();var n=Te(`Choose .zipâ¦`);X(e,n)},$$slots:{default:!0}});var d=g(l,2);H(n);var p=g(n,2),h=j(p),T=e=>{var t=Wft(),n=N(t);let i;var a=f(n),o=g(n,2),s=e=>{var t=Uft(),n=f(t,!0);O(()=>Y(n,(x(),K(()=>x().detail)))),X(e,t)};G(o,e=>{x(),K(()=>x().detail)&&e(s)}),O(()=>{i=r(n,1,`svelte-f65ivs`,null,i,{"text-gray-400":x().kind===`busy`,"text-green-500":x().kind===`ok`,"text-red-400":x().kind===`error`}),Y(a,`${x(),K(()=>x().kind===`busy`?`â³`:x().kind===`ok`?`â`:`â `)??``} 2516 ${x(),K(()=>x().text)??``}`)}),X(e,t)},E=e=>{var t=Gft(),n=f(t);O(()=>Y(n,`Already installed: ${Q(te),K(()=>Q(te).name)??``} v${Q(te),K(()=>Q(te).version)??``} â Install will update it`)),X(e,t)},D=e=>{var t=Kft(),n=f(t);O(()=>Y(n,`Will fetch ${Q(M)??``}/manifest.json`)),X(e,t)},k=q(()=>(Q(se),K(()=>Q(se).trim())));G(h,e=>{x(),K(()=>x().kind!==`idle`)?e(T):Q(te)?e(E,1):Q(k)&&e(D,2)}),H(p);var A=g(p,2),ee=e=>{var t=Jft(),n=g(j(t),4);B(n,1,o,e=>e.id,(e,t)=>{var n=qft(),r=j(n),i=j(r),a=g(i),o=f(a);H(r);var s=g(r,2);{let e=ze(()=>(Q(t),K(()=>`update-stale-`+Q(t).id))),n=ze(()=>(C(),Q(t),K(()=>C().includes(Q(t).id))));Do(s,{size:`xs`,get id(){return Q(e)},get disabled(){return Q(n)},onclick:()=>k6(Q(t).id),children:(e,n)=>{W();var r=Te();O(e=>Y(r,e),[()=>(C(),Q(t),K(()=>
2516C().includes(Q(t).id)?`Updatingâ¦`:`Update`))]),X(e,r)},$$slots:{default:!0}})}H(n),O(()=>{b(n,`data-stale`,(Q(t),K(()=>Q(t).id))),Y(i,`${Q(t),K(()=>Q(t).name)??``} `),Y(o,`v${Q(t),K(()=>Q(t).installed)??``} â v${Q(t),K(()=>Q(t).expected)??``}`)}),X(e,n)}),H(t),X(e,t)};G(A,e=>{o(),K(()=>o().length)&&e(ee)});var ne=g(A,2);Ie(ne,m,e=>{var t=fe(),n=N(t);B(n,1,c,e=>e.id,(e,t)=>{var n=Xft(),r=j(n),i=j(r),a=j(i),o=f(a,!0),c=g(a,2),l=f(c),d=g(c,2),p=f(d,!0),m=g(d,2),h=e=>{var t=$9();X(e,t)},x=q(()=>(_(),Q(t),s(Ku),K(()=>_().includes(Q(t).id)&&Ku(Q(t).id))));G(m,e=>{Q(x)&&e(h)}),H(i);var S=g(i,2);{let e=ze(()=>(Q(t),K(()=>`enable-user-module-`+Q(t).id))),n=ze(()=>(_(),Q(t),K(()=>!_().includes(Q(t).id))));ao(S,{size:`small`,get id(){return Q(e)},get checked(){return Q(n)},onchange:async e=>{e.target.checked?(ke(qu,_().filter(e=>e!==Q(t).id)),await pme(Q(t))):(ke(qu,[...new Set([..._(),Q(t).id])]),Ku(Q(t).id)&&(sne(Q(t).id),es(`"`+Q(t).name+`" disabled`)))}})}H(r);var C=g(r,2),T=f(C,!0),E=g(C,2),D=j(E),k=e=>{var n=fe(),r=N(n);B(r,1,()=>(y(),Q(t),K(()=>y().filter(e=>e.moduleId===Q(t).id))),Be,(e,t)=>{Do(e,{size:`xs`,get onclick(){return Q(t),K(()=>Q(t).action)},children:(e,n)=>{W();var r=Te();O(()=>Y(r,(Q(t),K(()=>Q(t).label)))),X(e,r)},$$slots:{default:!0}})}),X(e,n)},A=q(()=>(s(Ku),Q(t),_(),K(()=>Ku(Q(t).id)&&!_().includes(Q(t).id))));G(D,e=>{Q(A)&&e(k)});var ee=g(D,2),M=e=>{Do(e,{size:`xs`,color:`alternative`,onclick:()=>yb(Q(t)),children:(e,t)=>{W();var n=Te(`Update`);X(e,n)},$$slots:{default:!0}})};G(ee,e=>{Q(t),K(()=>Q(t).source!==`zip`)&&e(M)});var te=g(ee,2);Do(te,{size:`xs`,color:`red`,onclick:()=>_b(Q(t).id),children:(e,t)=>{W();var n=Te(`Remove`);X(e,n)},$$slots:{default:!0}}),H(E);var ne=g(E,2),P=j(ne);v(P);var re=g(P,2);{let e=ze(()=>(Q(t),K(()=>`dev-reload-`+Q(t).id))),n=ze(()=>(s(bb),Q(t),K(()=>!bb(Q(t)))));Do(re,{size:`xs`,color:`alternative`,get id(){return Q(e)},get disabled(){return Q(n)},onclick:()=>ome(Q(t)),children:(e,t)=>{W();var n=Te(`Reload`);X(e,n)},$$slots:{default:!0}})}var ie=g(re,2),F=j(ie);{let e=ze(()=>(Q(t),K(()=>`dev-poll-`+Q(t).id))),n=ze(()=>(w(),Q(t),K(()=>w().includes(Q(t).id))));xo(F,{get id(){return Q(e)},get checked(){return Q(n)},onchange:e=>ume(Q(t),e.currentTarget.checked),children:(e,t)=>{var n=Yft();X(e,n)},$$slots:{default:!0}})}H(ie),H(ne),H(n),O(()=>{b(n,`id`,(Q(t),K(()=>`user-module-card-`+Q(t).id))),Y(o,(Q(t),K(()=>Q(t).name))),Y(l,`v${Q(t),K(()=>Q(t).version)??``}`),Y(p,(Q(t),K(()=>Q(t).source===`zip`?`zip`:`URL`))),Y(T,(Q(t),K(()=>Q(t).description))),b(P,`id`,(Q(t),K(()=>`dev-url-`+Q(t).id))),u(P,(Q(t),K(()=>Q(t).devUrl??(Q(t).source===`zip`?``:Q(t).source))))}),Z(`change`,P,e=>cme(Q(t).id,e.currentTarget.value)),X(e,n)}),X(e,t)});var P=g(ne,2),re=e=>{var t=Zft();X(e,t)};G(P,e=>{c(),K(()=>c().length===0)&&e(re)}),H(t),S(i,()=>Q(se),e=>I(se,e)),Z(`input`,i,()=>lme()),Z(`keydown`,i,e=>{e.key===`Enter`&&de()}),Z(`change`,d,async e=>{let t=e.currentTarget,n=t.files?.[0];n&&await fme(n),t.value=``}),X(e,t)};G(oe,e=>{Q(L)===`browse`?e(R):Q(L)===`core`?e(ue,1):e(z,-1)}),O(()=>{d=r(l,1,`mod-tab svelte-f65ivs`,null,d,{active:Q(L)===`core`}),b(l,`aria-selected`,Q(L)===`core`),T=r(h,1,`mod-tab svelte-f65ivs`,null,T,{active:Q(L)===`user`,pulse:Q(me)}),b(h,`aria-selected`,Q(L)===`user`),Y(E,`User${c(),K(()=>c().length?` (`+c().length+`)`:``)??``}`),F=r(D,1,`mod-tab svelte-f65ivs`,null,F,{active:Q(L)===`browse`}),b(D,`aria-selected`,Q(L)===`browse`)}),Z(`click`,l,()=>I(L,`core`)),Z(`click`,h,()=>I(L,`user`)),Z(`click`,D,()=>{I(L,`browse`),db()}),X(e,n)},$$slots:{default:!0},$$legacy:!0}),ue(),E()}var tpt=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),npt=V(`<div id="helpers-debug-chip" class="pointer-events-none fixed right-4 top-16 rounded-sm bg-amber-500/90 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-black" style="z-index: var(--z-hud)">DEBUG · helpers</div>`),rpt=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <div><!></div>`,1);function ipt(e,t){Ce(t,!1);let n=()=>z(ki,`$isLocked`,u),i=()=>z(Ym,`$embedMode`,u),a=()=>z(Us,`$profilerClose`,u),o=()=>z(sJ,`$previewWindows`,u),s=()=>z(ll,`$helpersInPlay`,u),c=()=>z(M_e,`$publishExportOpen`,u),l=()=>z(Td,`$viewPrefs`,u),[u,d]=Ve();hne(Z9.filter(e=>!U(qu).includes(e.id))),_e(()=>{Wc(),hie(),ra(),V_e(),Q3(),Fot(),J_e(),M6(),_a(),Lle(),lX(),Hc(`scene-budget`,()=>$i()),Hc(`session`,()=>{let e=U(Es),t=U(Ui),n=U(xi),r=0,i=0;return t?.traverse?.(e=>{e!==t&&(r++,e.isMesh&&i++)}),{peerId:e?.peer?.id??null,openConns:e?Object.keys(e.connections??{}).length:0,roster:(U(as)??[]).length,objects:r,meshes:i,render:n?.info?{calls:n.info.render.calls,triangles:n.info.render.triangles,geometries:n.info.memory.geometries,textures:n.info.memory.textures}:null}}),Hc(`storage`,()=>tt()),`serviceWorker`in navigator&&!Om&&navigator.serviceWorker.register(`/sw.js`).catch(()=>{}),typeof location<`u`&&/(^|[#&])safe\b/i.test(location.hash)&&(fee.set({paused:!0,reason:`safe mode`}),Po(`safe-mode`,`Safe mode: the flow runtime is paused, so scripts are not running. Fix the node, then press Resume.`,[{label:`Resume`,action:()=>Mne()}
2516])),Ene(),bte(),fse(),vie(),hde(),V6(),Voe(),Lre(),Kpe(),Y6(),h8(),YR(),sme(),Yue(),wde(),Ase(),oce(),cee(),ppe(),Ode(),Efe(),jde(),n5(),TJ(),Ohe(),bct(),f5(),Om&&L6(),LY(),l5(),Vee(),Lfe(),qae(),bU(),h_e(),ghe(),TU(),u_e(),dce(),mme(),_ve(),Sce(),pZ(),bve(),qne().then(()=>$(()=>import(`../chunks/qxGgLbp0.js`).then(e=>e.o).then(e=>e.foldSceneVersions()),__vite__mapDeps([111,1,2,6,0,3,4,69,9,44,5,70,20,21,10,19,7,13,55,72,73,74,75,76,77,78,67,71,79,112,113,114,45,46,50,47,8,11,12,14,27,48,49,18,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,68,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,124,125,126,100,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98,169]),import.meta.url)),Yge(),Lge(),nt.getItem(`debugStores`)&&Fve()});function f(e){if(e.target?.closest&&(e.target.closest(`#flow-list`)||e.target.closest(`#explorer-list`)||e.target.closest(`#explorer-window`)))return;let t=e.dataTransfer?.getData(`application/x-explorer-item`);if(t){$(()=>import(`../chunks/MphbKily.js`).then(n=>n.dropExplorerItem(JSON.parse(t),e.clientX,e.clientY)),[],import.meta.url);return}let n=[...e.dataTransfer?.files??[]];if(n.length===0)return;let r=[],i=/\.(glb|gltf|obj|stl|fbx)$/,a=/\.(mtl|png|jpe?g|webp|bmp|gif)$/i,o=n.filter(e=>a.test(e.name));n.forEach(e=>{let t=e.name.toLowerCase();i.test(t)?zS(e,e.name.replace(i,``),void 0,void 0,o):t.endsWith(`.json`)?VS(e):o.includes(e)||r.push(e.name)}),r.length>0&&es(`Unsupported: `+r.join(`, `)+`. Supported formats: .glb, .gltf, .obj, .stl, .fbx (models), .json (scene)`)}R();var m=rpt();Z(`dragover`,p,Ke(function(e){Je.call(this,t,e)})),Z(`drop`,p,Ke(f));var h=N(m),_=e=>{var t=tpt(),n=N(t);E9e(n,{});var r=g(n,2);N9e(r,{});var i=g(r,2);Cet(i,{});var s=g(i,2);ltt(s,{});var c=g(s,2);R2(c,{children:(e,t)=>{mnt(e,{})},$$slots:{default:!0}});var l=g(c,2);gdt(l,{});var u=g(l,2);dat(u,{});var d=g(u,2),f=e=>{var t=fe(),n=N(t);oe(n,()=>$(()=>import(`../chunks/_v4rXvbq.js`),__vite__mapDeps([253,1,2,254,3,0,4,5,6,73,74,113,9,114,45,46,50,47,8,10,11,12,13,14,27,48,49,18,19,7,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,16,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,189,190,204,126,100,128,127,129,125,130,131,162,255,256,257,97,98,95,96,201,109,110,111,112,124,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,163,164,165,166,167,168,169,170,102,101,258]),import.meta.url),null,(e,t)=>{Q(t).default(e,{})}),X(e,t)};G(d,e=>{a()||e(f)});var p=g(d,2);mat(p,{});var m=g(p,2);B(m,3,o,e=>e.id,(e,t,n)=>{jat(e,{get winId(){return Q(t).id},get index(){return Q(n)}})}),Pat(g(m,2),{}),X(e,t)};G(h,e=>{!n()&&!i()&&e(_)});var v=g(h,2);EZe(v,{});var y=g(v,2);Ost(y,{});var b=g(y,2);Fst(b,{});var x=g(b,2),S=e=>{var t=npt();X(e,t)};G(x,e=>{n()&&s()&&e(S)});var C=g(x,2);PZe(C,{});var w=g(C,2);Bst(w,{});var T=g(w,2);Ust(T,{});var E=g(T,2);BZe(E,{});var D=g(E,2);sQe(D,{});var k=g(D,2);mQe(k,{});var A=g(k,2);gQe(A,{});var ee=g(A,2);sst(ee,{});var M=g(ee,2);fst(M,{});var te=g(M,2);gst(te,{});var ne=g(te,2);yst(ne,{});var P=g(ne,2);ept(P,{});var re=g(P,2),ie=e=>{var t=fe(),n=N(t);oe(n,()=>$(()=>import(`../chunks/4J7HBFTx.js`),__vite__mapDeps([259,1,254,260,2,256,261,241,3,262,5,6,111,0,4,69,9,44,70,20,21,10,19,7,13,55,72,73,74,75,76,77,78,67,71,79,112,113,114,45,46,50,47,8,11,12,14,27,48,49,18,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,16,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,68,80,81,82,83,84,85,86,17,87,115,116,117,118,119,120,121,122,93,88,94,89,90,91,92,15,123,124,125,126,100,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,98,169,240,263]),import.meta.url),null,(e,t)=>{Q(t).default(e,{})}),X(e,t)};G(re,e=>{c()&&e(ie)});var F=g(re,2);Iat(F,{});var ae=g(F,2);Uat(ae,{});var I=g(ae,2);Yat(I,{});var L=g(I,2);dot(L,{});var se=g(L,2);Hot(se,{});var ce=g(se,2);rst(ce,{});var le=g(ce,2);Oct(le,{});var de=g(le,2);Flt(de,{});var pe=g(de,2);Act(pe,{});var me=g(pe,2);iut(me,{});var V=g(me,2);dut(V,{});var he=g(V,2);let ge;oye(j(he),{get shadows(){return 1},children:(e,t)=>{zDe(e,{})},$$slots:{default:!0}}),H(he),O(()=>ge=r(he,1,`viewport svelte-1n46o8q`,null,ge,{"viewport-inset":l().dockPushesViewport&&!i()})),X(e,m),ue(),d()}var apt=V(`<div class="svelte-1uha8ag"><!></div>`);function opt(e){var t=apt();ipt(j(t),{}),H(t),X(e,t)}export{e5 as $,WMe as $a,YN as $c,jK as $i,hj as $l,BZ as $n,UR as $o,xY as $r,sL as $s,Int as $t,m5 as A,eNe as Aa,rI as Ac,gJ as Ai,bwe as Al,t4 as An,hH as Ao,yX as Ar,WL as As,S6 as At,Uk as Au,x8 as B,kH as Ba,pTe as Bc,aJ as Bi,eN as Bl,TQ as Bn,Wz as Bo,aX as Br,yDe as Bs,O3 as Bt,Pk as Bu,E5 as C,iNe as Ca,kEe as Cc,YRe as Ci,BM as Cl,E4 as Cn,_H as Co,dZ as Cr,vR as Cs,M6 as Ct,FA as Cu,g5 as D,_U as Da,YTe as Dc,dJ as Di,XM as Dl,$2 as Dn,uH as Do,iZ as Dr,hR as Ds,Not as Dt,hCe as Du,jct as E,hU as Ea,YF as Ec,TJ as Ei,IM as El,X2 as En,xH as Eo,pZ as Er,pR as Es,D6 as Et,Hk as Eu,q8 as F,cH as Fa,RTe as Fc,oJ as Fi,FM as Fl,OQ as Fn,CH as Fo,dX as Fr,sR as Fs,Q3 as Ft,Vk as Fu,C8 as G,ZH as Ga,VP as Gc,_q as Gi,Xj as Gl,TKe as Gn,Jz as Go,qHe as Gr,zL as Gs,Rnt as Gt,Bk as Gu,Y8 as H,MH as Ha,rF as Hc,PRe as Hi,eM as Hl,lQ as Hn,Gz as Ho,lX as Hr,tR as Hs,Hnt as Ht,mCe as Hu,G8 as I,cU as Ia,VF as Ic,hJ as Ii,rN as Il,DQ as In,uB as Io,fX as Ir,GL as Is,k3 as It,jk as Iu,S8 as J,fH as Ja,BP as Jc,yq as Ji,Mj as Jl,RZ as Jn,qR as Jo,bY as Jr,hL as Js,Unt as Jt,QO as Ju,b8 as K,NH as Ka,cTe as Kc,gq as Ki,Zj as Kl,I
2516Z as Kn,GR as Ko,WHe as Kr,BL as Ks,Wnt as Kt,Rk as Ku,H8 as L,eU as La,BF as Lc,yJ as Li,vwe as Ll,CQ as Ln,lB as Lo,gX as Lr,ZL as Ls,j3 as Lt,Ak as Lu,s5 as M,bU as Ma,iI as Mc,pJ as Mi,HM as Ml,Q2 as Mn,YV as Mo,vX as Mr,eR as Ms,mot as Mt,nA as Mu,l5 as N,tNe as Na,RF as Nc,vJ as Ni,iM as Nl,aXe as Nn,lH as No,xX as Nr,QL as Ns,fot as Nt,Xk as Nu,Pct as O,vU as Oa,nI as Oc,uJ as Oi,JM as Ol,J2 as On,rU as Oo,pX as Or,mR as Os,y6 as Ot,qk as Ou,P8 as P,$V as Pa,LF as Pc,cJ as Pi,rM as Pl,bQ as Pn,oH as Po,uX as Pr,$L as Ps,Dot as Pt,Wk as Pu,J8 as Q,iH as Qa,qN as Qc,VK as Qi,swe as Ql,ZZ as Qn,BR as Qo,CY as Qr,lL as Qs,P4 as Qt,V8 as R,tU as Ra,HF as Rc,sJ as Ri,nN as Rl,xQ as Rn,fB as Ro,HY as Rr,KL as Rs,D3 as Rt,kk as Ru,Rct as S,TU as Sa,OEe as Sc,SJ as Si,NM as Sl,T4 as Sn,eH as So,fZ as Sr,_R as Ss,T6 as St,DCe as Su,C5 as T,mU as Ta,ZTe as Tc,AJ as Ti,GM as Tl,d6e as Tn,EH as To,sWe as Tr,fR as Ts,k6 as Tt,PA as Tu,E8 as U,QH as Ua,dF as Uc,Zq as Ui,$j as Ul,HZ as Un,RAe as Uo,KHe as Ur,YL as Us,b3 as Ut,rk as Uu,I8 as V,qH as Va,iF as Vc,tJ as Vi,Bj as Vl,uQ as Vn,Uz as Vo,dUe as Vr,uR as Vs,Lnt as Vt,Mk as Vu,T8 as W,PH as Wa,sTe as Wc,nJ as Wi,tM as Wl,OZ as Wn,Zz as Wo,GHe as Wr,lR as Ws,v3 as Wt,zk as Wu,n5 as X,ZMe as Xa,$P as Xc,HK as Xi,zj as Xl,$Z as Xn,WR as Xo,wY as Xr,HEe as Xs,y3 as Xt,y8 as Y,bH as Ya,nF as Yc,UK as Yi,Nj as Yl,zZ as Yn,VR as Yo,AY as Yr,gL as Ys,znt as Yt,pT as Yu,F8 as Z,nH as Za,cN as Zc,BK as Zi,Fj as Zl,LZ as Zn,zR as Zo,SY as Zr,uL as Zs,F4 as Zt,X5 as _,yNe as _a,yI as _c,bze as _i,oN as _l,d3 as _n,XV as _o,zX as _r,CR as _s,V6 as _t,_A as _u,c7 as a,xK as aa,tL as ac,KVe as ai,QN as al,Q4 as an,AH as ao,MZ as ar,LR as as,u8 as at,Aj as au,k5 as b,aNe as ba,VI as bc,jJ as bi,YM as bl,f3 as bn,UMe as bo,HX as br,bDe as bs,w6 as bt,OCe as bu,H5 as c,DK as ca,UI as cc,nY as ci,PN as cl,K4 as cn,SH as co,opt as component,qZ as cr,EDe as cs,X6 as ct,mj as cu,e7 as d,FPe as da,qI as dc,XJ as di,uN as dl,U4 as dn,aH as do,WZ as dr,kR as ds,h8 as dt,VA as du,AK as ea,fL as ec,LY as ei,FN as el,Fnt as en,yH as eo,jZ as er,YR as es,vct as et,gj as eu,Y5 as f,EU as fa,AEe as fc,tY as fi,rP as fl,m3 as fn,iU as fo,GZ as fr,jR as fs,f8 as ft,UA as fu,r7 as g,WU as ga,xI as gc,RJ as gi,iN as gl,o3 as gn,pH as go,JUe as gr,kDe as gs,Y6 as gt,kCe as gu,n7 as h,bNe as ha,bI as hc,LJ as hi,sN as hl,s3 as hn,JV as ho,qUe as hr,ADe as hs,Zst as ht,NCe as hu,o7 as i,OK as ia,iL as ic,oY as ii,KN as il,Z4 as in,XMe as io,XZ as ir,FR as is,Q8 as it,_j as iu,f5 as j,nNe as ja,eI as jc,mJ as ji,nM as jl,e4 as jn,rH as jo,bX as jr,XL as js,pot as jt,Jk as ju,_5 as k,fU as ka,XTe as kc,_J as ki,RM as kl,Y2 as kn,QV as ko,SX as kr,SDe as ks,b6 as kt,Yk as ku,K5 as l,bK as la,HI as lc,QJ as li,lN as ll,J4 as ln,lU as lo,KZ as lr,DDe as ls,c8 as lt,BCe as lu,Put as m,xNe as ma,WI as mc,zJ as mi,dP as ml,r3 as mn,OH as mo,QZ as mr,MR as ms,Qst as mt,NA as mu,a7 as n,LPe as na,_L as nc,gY as ni,oP as nl,l3 as nn,YH as no,YZ as nr,PR as ns,Z8 as nt,pj as nu,l7 as o,IPe as oa,rL as oc,yVe as oi,sP as ol,n3 as on,aU as oo,NZ as or,yR as os,nct as ot,YCe as ou,J5 as p,UU as pa,GI as pc,CVe as pi,pP as pl,c3 as pn,mH as po,PZ as pr,wR as ps,$st as pt,PCe as pu,w8 as q,TH as qa,eF as qc,bq as qi,Rj as ql,wZ as qn,KR as qo,UHe as qr,mL as qs,Gnt as qt,XO as qu,i7 as r,OPe as ra,eL as rc,iY as ri,IN as rl,I4 as rn,nU as ro,JZ as rr,IR as rs,$8 as rt,awe as ru,U5 as s,fK as sa,nL as sc,$J as si,GN as sl,t3 as sn,tH as so,AZ as sr,xR as ss,ect as st,kj as su,Z9 as t,kK as ta,pL as tc,yY as ti,iP as tl,a3 as tn,wH as to,UZ as tr,NR as ts,X8 as tt,cj as tu,G5 as u,PPe as ua,YI as uc,eY as ui,aP as ul,q4 as un,vH as uo,kZ as ur,AR as us,act as ut,VCe as uu,Ict as v,CU as va,vI as vc,xJ as vi,qM as vl,p3 as vn,ZV as vo,BX as vr,TR as vs,P6 as vt,vA as vu,w5 as w,pU as wa,tI as wc,kJ as wi,KM as wl,Z2 as wn,DH as wo,QUe as wr,CDe as ws,A6 as wt,IA as wu,T5 as x,SU as xa,zI as xc,DJ as xi,MM as xl,i3 as xn,sH as xo,cWe as xr,gR as xs,E6 as xt,MA as xu,S5 as y,xU as ya,SI as yc,MJ as yi,VM as yl,u3 as yn,oU as yo,YUe as yr,ER as ys,L6 as yt,FCe as yu,B8 as z,gH as za,zF as zc,fJ as zi,tN as zl,EQ as zn,oB as zo,vUe as zr,qL as zs,A3 as zt,Ok as zu};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.