studiograph 1.3.48-beta.0 → 1.3.48-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/_app/immutable/assets/0.DOumm94J.css +2 -0
- package/dist/web/_app/immutable/assets/2.BftNiAA4.css +1 -0
- package/dist/web/_app/immutable/assets/{4.fGsEpo95.css → 4.BgXzUTTk.css} +1 -1
- package/dist/web/_app/immutable/assets/9.gsF-Ne6_.css +1 -0
- package/dist/web/_app/immutable/assets/AgentOverlay.CpvH9rhf.css +1 -0
- package/dist/web/_app/immutable/assets/ChevronDown.Bz0FjM7b.css +1 -0
- package/dist/web/_app/immutable/assets/StopFilledAlt.CkPrHdPD.css +1 -0
- package/dist/web/_app/immutable/assets/formatting.vV0ne105.css +1 -0
- package/dist/web/_app/immutable/assets/list-columns.BrRrAiZ7.css +1 -0
- package/dist/web/_app/immutable/chunks/0edH8sO82.js +1 -0
- package/dist/web/_app/immutable/chunks/{DRsswX8S.js → 7-y0CE1z.js} +1 -1
- package/dist/web/_app/immutable/chunks/B4cFqqUS.js +3 -0
- package/dist/web/_app/immutable/chunks/B7hznOQp.js +1 -0
- package/dist/web/_app/immutable/chunks/B8-Lm86o2.js +1 -0
- package/dist/web/_app/immutable/chunks/BJReLGMs.js +1 -0
- package/dist/web/_app/immutable/chunks/BKzV82vD2.js +83 -0
- package/dist/web/_app/immutable/chunks/{CiIpSx5n2.js → BLHrJvbG.js} +1 -1
- package/dist/web/_app/immutable/chunks/BUBMGU8t2.js +2 -0
- package/dist/web/_app/immutable/chunks/BYokDzwE.js +1 -0
- package/dist/web/_app/immutable/chunks/B_Avv9jQ2.js +1 -0
- package/dist/web/_app/immutable/chunks/Bbp76jaT2.js +1 -0
- package/dist/web/_app/immutable/chunks/{DmeYl7eL.js → BiJjH5mJ.js} +2 -2
- package/dist/web/_app/immutable/chunks/Bt88HrRx.js +1 -0
- package/dist/web/_app/immutable/chunks/Bu2iU6hh.js +67 -0
- package/dist/web/_app/immutable/chunks/Buih1pxI.js +1 -0
- package/dist/web/_app/immutable/chunks/BwwLJVvR.js +1 -0
- package/dist/web/_app/immutable/chunks/{BuKi0vpu2.js → C0RpyyYZ.js} +1 -1
- package/dist/web/_app/immutable/chunks/C2l-EXsT2.js +1 -0
- package/dist/web/_app/immutable/chunks/C3OdK8z_2.js +1 -0
- package/dist/web/_app/immutable/chunks/CA7O0J_u2.js +1 -0
- package/dist/web/_app/immutable/chunks/CAwjrHdk.js +23 -0
- package/dist/web/_app/immutable/chunks/{D_HVOuHV.js → CUPSJObs.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DBzQ8LyQ2.js → CUoGvuxK2.js} +1 -1
- package/dist/web/_app/immutable/chunks/CWh8aehb.js +1 -0
- package/dist/web/_app/immutable/chunks/{OTTMDMTW.js → CY4XVBP0.js} +1 -1
- package/dist/web/_app/immutable/chunks/CaoriuNq.js +1 -0
- package/dist/web/_app/immutable/chunks/CcsSt9AW2.js +1 -0
- package/dist/web/_app/immutable/chunks/Cd4VfAZC.js +2 -0
- package/dist/web/_app/immutable/chunks/{DlORZqfE.js → CePZ1985.js} +1 -1
- package/dist/web/_app/immutable/chunks/Cei8CKT4.js +1 -0
- package/dist/web/_app/immutable/chunks/CheXrbDk.js +1 -0
- package/dist/web/_app/immutable/chunks/Cl-W0JYt.js +2 -0
- package/dist/web/_app/immutable/chunks/Cna7tYp-.js +1 -0
- package/dist/web/_app/immutable/chunks/Czwe4sGU2.js +3 -0
- package/dist/web/_app/immutable/chunks/{CpLdnbh3.js → D83_Ss42.js} +1 -1
- package/dist/web/_app/immutable/chunks/D9NgbGbO2.js +9 -0
- package/dist/web/_app/immutable/chunks/{By4lVKNC.js → DA-BuZei.js} +1 -1
- package/dist/web/_app/immutable/chunks/DCNJWlho2.js +1 -0
- package/dist/web/_app/immutable/chunks/{ByidpUhu.js → DCtgLRl52.js} +1 -1
- package/dist/web/_app/immutable/chunks/DH0epITQ2.js +1 -0
- package/dist/web/_app/immutable/chunks/DQ_Xokap2.js +1 -0
- package/dist/web/_app/immutable/chunks/DR1K6PIm.js +1 -0
- package/dist/web/_app/immutable/chunks/DU7XA-cL2.js +1 -0
- package/dist/web/_app/immutable/chunks/DZEmjBTb.js +5 -0
- package/dist/web/_app/immutable/chunks/{C9PETsiT.js → DdfvtDOY.js} +1 -1
- package/dist/web/_app/immutable/chunks/DevZTY1l.js +1 -0
- package/dist/web/_app/immutable/chunks/{CPSupDJp2.js → Dj5oP_ik.js} +1 -1
- package/dist/web/_app/immutable/chunks/DjTJ4D_0.js +3 -0
- package/dist/web/_app/immutable/chunks/Dk4TeNwu.js +1 -0
- package/dist/web/_app/immutable/chunks/Do1OCNEG.js +1 -0
- package/dist/web/_app/immutable/chunks/{BkyFvJvz.js → Do6qOOng.js} +1 -1
- package/dist/web/_app/immutable/chunks/DoQwt-f9.js +1 -0
- package/dist/web/_app/immutable/chunks/{BhTmSo4n2.js → Dqg3k9HI2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{3EfPAYzi2.js → DsnqOT222.js} +1 -1
- package/dist/web/_app/immutable/chunks/DvYQu1SV.js +1 -0
- package/dist/web/_app/immutable/chunks/HdjeJPly2.js +1 -0
- package/dist/web/_app/immutable/chunks/JDw4tOUY.js +1 -0
- package/dist/web/_app/immutable/chunks/KBbDg4lS2.js +1 -0
- package/dist/web/_app/immutable/chunks/{Cbaut_us2.js → KQXQLJf32.js} +1 -1
- package/dist/web/_app/immutable/chunks/LGnNalpn2.js +2 -0
- package/dist/web/_app/immutable/chunks/SH5Fg0Xu.js +1 -0
- package/dist/web/_app/immutable/chunks/Shyla9c12.js +2 -0
- package/dist/web/_app/immutable/chunks/{DUwgGBxa.js → VQbAelHN.js} +1 -1
- package/dist/web/_app/immutable/chunks/{ZTiqmKJy2.js → apNT0aug2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D5Hj-MPO2.js → e0ySQvQ6.js} +1 -1
- package/dist/web/_app/immutable/chunks/eNB_sIHC2.js +1 -0
- package/dist/web/_app/immutable/chunks/{e3SY5t2O2.js → h4WWBpcD2.js} +3 -3
- package/dist/web/_app/immutable/chunks/{DZ-YyRVM.js → kLub81jO.js} +1 -1
- package/dist/web/_app/immutable/chunks/kW0z_eo62.js +1 -0
- package/dist/web/_app/immutable/chunks/ss8hcwTT.js +1 -0
- package/dist/web/_app/immutable/chunks/sub7ikQV.js +2 -0
- package/dist/web/_app/immutable/chunks/yWi6xIp8.js +1 -0
- package/dist/web/_app/immutable/entry/app.Bgniax9U.js +2 -0
- package/dist/web/_app/immutable/entry/start.DeD3x0AC.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.C4PMtdx9.js → 0.D7f7eDDY.js} +2 -2
- package/dist/web/_app/immutable/nodes/{1.BwVfPLMn.js → 1.nDAGsQWA.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.Dd4iAQN5.js → 10.DFbhcPKT.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.DPr_SYan.js → 11.CDErrkBt.js} +1 -1
- package/dist/web/_app/immutable/nodes/{11.CJAmEchE.js → 12.QmphOXE2.js} +1 -1
- package/dist/web/_app/immutable/nodes/{12.ChMWXPMk.js → 13.Bq5rDhPs.js} +1 -1
- package/dist/web/_app/immutable/nodes/{13.8vOKq8ue.js → 14.BlcHqgr6.js} +1 -1
- package/dist/web/_app/immutable/nodes/{14.BOSNmj9h.js → 15.COK_-D-x.js} +1 -1
- package/dist/web/_app/immutable/nodes/2.DOsCYNHa.js +109 -0
- package/dist/web/_app/immutable/nodes/3.BgE1sIyr.js +2 -0
- package/dist/web/_app/immutable/nodes/4.DvgaHeI4.js +11 -0
- package/dist/web/_app/immutable/nodes/{5.YwNHOrkt.js → 5.CrjeBZES.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.BSPlYQuq.js → 6.DoHxsiEE.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.DPXzwW0H.js → 7.04fnxKIo.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.Dhpk7w3X.js → 8.D35_cY6C.js} +1 -1
- package/dist/web/_app/immutable/nodes/9.BRionwW6.js +1 -0
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +21 -19
- package/package.json +1 -1
- package/dist/web/_app/immutable/assets/0.DDqq11xY.css +0 -2
- package/dist/web/_app/immutable/assets/2.CGK2ky-K.css +0 -1
- package/dist/web/_app/immutable/assets/AgentOverlay.DqzjAOm4.css +0 -1
- package/dist/web/_app/immutable/assets/Markdown.B4lW7Llh.css +0 -1
- package/dist/web/_app/immutable/assets/StopFilledAlt.clodJdp5.css +0 -1
- package/dist/web/_app/immutable/assets/formatting.B912lpdG.css +0 -1
- package/dist/web/_app/immutable/assets/list-columns.DCMVmy_Q.css +0 -1
- package/dist/web/_app/immutable/chunks/2LgrBrpS2.js +0 -2
- package/dist/web/_app/immutable/chunks/96h3ktuk.js +0 -1
- package/dist/web/_app/immutable/chunks/A6FJA1AF.js +0 -1
- package/dist/web/_app/immutable/chunks/B-FAwCqe2.js +0 -1
- package/dist/web/_app/immutable/chunks/B1KZ7zY32.js +0 -2
- package/dist/web/_app/immutable/chunks/B4gpzeQ2.js +0 -1
- package/dist/web/_app/immutable/chunks/BJ6Z7eAM.js +0 -2
- package/dist/web/_app/immutable/chunks/BM_vIwVC.js +0 -83
- package/dist/web/_app/immutable/chunks/BeuunHPO.js +0 -1
- package/dist/web/_app/immutable/chunks/BikW7mty2.js +0 -1
- package/dist/web/_app/immutable/chunks/Bo5dghSu.js +0 -3
- package/dist/web/_app/immutable/chunks/BpPyho8Y.js +0 -3
- package/dist/web/_app/immutable/chunks/BsuvyNDN2.js +0 -2
- package/dist/web/_app/immutable/chunks/BuuYnIjE.js +0 -1
- package/dist/web/_app/immutable/chunks/ByQGCIwO.js +0 -5
- package/dist/web/_app/immutable/chunks/C5dM5op-.js +0 -1
- package/dist/web/_app/immutable/chunks/C6pVyOEl2.js +0 -1
- package/dist/web/_app/immutable/chunks/C80GKPZ9.js +0 -1
- package/dist/web/_app/immutable/chunks/C94TJqPI.js +0 -1
- package/dist/web/_app/immutable/chunks/CAuAQ81a2.js +0 -1
- package/dist/web/_app/immutable/chunks/CBnzSITi2.js +0 -1
- package/dist/web/_app/immutable/chunks/CC9p2p6w.js +0 -1
- package/dist/web/_app/immutable/chunks/CH-KYFIm.js +0 -64
- package/dist/web/_app/immutable/chunks/CHj8fObQ2.js +0 -9
- package/dist/web/_app/immutable/chunks/CK-UnH-n2.js +0 -1
- package/dist/web/_app/immutable/chunks/CKH5BEAh.js +0 -1
- package/dist/web/_app/immutable/chunks/CokE4L8B2.js +0 -1
- package/dist/web/_app/immutable/chunks/CvDrXJk9.js +0 -1
- package/dist/web/_app/immutable/chunks/D00MFB9_2.js +0 -1
- package/dist/web/_app/immutable/chunks/D6nLEmZy2.js +0 -1
- package/dist/web/_app/immutable/chunks/D71ZlQBM2.js +0 -2
- package/dist/web/_app/immutable/chunks/D9ql9vXU.js +0 -1
- package/dist/web/_app/immutable/chunks/DdLkNvPf.js +0 -23
- package/dist/web/_app/immutable/chunks/DoKMFfJd.js +0 -1
- package/dist/web/_app/immutable/chunks/DpzG2mVI2.js +0 -1
- package/dist/web/_app/immutable/chunks/ItgU4ei5.js +0 -1
- package/dist/web/_app/immutable/chunks/JJDMrjj62.js +0 -1
- package/dist/web/_app/immutable/chunks/RmiWpCin2.js +0 -1
- package/dist/web/_app/immutable/chunks/ahC5WoXX2.js +0 -1
- package/dist/web/_app/immutable/chunks/go8N1nWD2.js +0 -3
- package/dist/web/_app/immutable/chunks/nTAmRNKw2.js +0 -1
- package/dist/web/_app/immutable/chunks/oUTRxd0f.js +0 -1
- package/dist/web/_app/immutable/chunks/s_7BJJYy.js +0 -2
- package/dist/web/_app/immutable/entry/app.CbuUtkoM.js +0 -2
- package/dist/web/_app/immutable/entry/start.DeZyKwOT.js +0 -1
- package/dist/web/_app/immutable/nodes/2.7N4BLwhX.js +0 -109
- package/dist/web/_app/immutable/nodes/3.Cd-tx8Ej.js +0 -2
- package/dist/web/_app/immutable/nodes/4.DtuT-syy.js +0 -14
- /package/dist/web/_app/immutable/assets/{12.DlIf1mKh.css → 13.DlIf1mKh.css} +0 -0
- /package/dist/web/_app/immutable/assets/{13.7d-Q37wc.css → 14.7d-Q37wc.css} +0 -0
- /package/dist/web/_app/immutable/assets/{14.CmLrbzZp.css → 15.CmLrbzZp.css} +0 -0
- /package/dist/web/_app/immutable/chunks/{B15-kvCe2.js → B15-kvCe.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{B6Lt-qaJ2.js → B6Lt-qaJ.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{CDTjuBSm.js → CDTjuBSm2.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{DOmH4G9o.js → DOmH4G9o2.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{DQMWa2t72.js → DQMWa2t7.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{DWygwzcO.js → DWygwzcO2.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{DYXDRmoo.js → DYXDRmoo2.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{DvPuaTCl2.js → DvPuaTCl.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{g09ZrevW.js → g09ZrevW2.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{oBQOivfH2.js → oBQOivfH.js} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DA-BuZei.js","./CYTTTma0.js","./VQbAelHN.js","./CUPSJObs.js","./7-y0CE1z.js","./DoQwt-f9.js","./D83_Ss42.js","./kLub81jO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{B as e,C as t,Ft as n,G as r,Gt as i,Ht as a,I as o,It as s,K as c,Mt as l,Nt as u,O as d,P as f,Pt as p,R as m,S as h,St as g,Tt as ee,U as te,V as _,W as v,Z as y,_ as ne,c as re,ct as b,et as x,f as ie,g as ae,gt as S,ht as C,i as oe,it as se,j as ce,k as w,l as le,lt as ue,mt as T,pt as E,q as D,qt as de,s as O,st as k,t as fe,wt as A,x as pe,xt as j,y as M,yt as N,z as P}from"./CYTTTma0.js";import{i as F,r as I}from"./VQbAelHN.js";import"./xihTtKlq.js";import{A as L,j as R,r as z}from"./CUPSJObs.js";import{i as B,r as V}from"./D83_Ss42.js";import{t as H}from"./DoQwt-f9.js";import{t as me}from"./7-y0CE1z.js";import{i as he}from"./DA-BuZei.js";import"./BYokDzwE.js";import"./BR6jMpLB.js";var ge=Array(12).fill(0),_e=e(`<div class="sonner-loading-bar"></div>`),U=e(`<div><div class="sonner-spinner"></div></div>`);function ve(e,r){n(r,!0);var i=U(),o=E(i);ce(o,23,()=>ge,(e,t)=>`spinner-bar-${t}`,(e,t)=>{m(e,_e())}),a(o),a(i),k(e=>{h(i,1,e),M(i,`data-visible`,r.visible)},[()=>t([`sonner-loading-wrapper`,r.class].filter(Boolean).join(` `))]),m(e,i),p()}function W(...e){return e.filter(Boolean).join(` `)}var ye=typeof document<`u`,G=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function be(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=G,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=ee(e=>{let n=D(t,`focusin`,e),r=D(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?be(this.#e):null}};var xe=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return u(this.#t)}get(){let e=l(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=l(this.#t);return t===void 0?e:t}set(e){return s(this.#t,e)}};function Se(e,t){switch(e){case`post`:b(t);break;case`pre`:ue(t);break}}function K(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;Se(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=x(()=>n(t,o));return o=t,r})}function Ce(e,t,n){let r=se(()=>{let i=!1;K(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});b(()=>r)}function we(e,t,n){K(e,`post`,t,n)}function Te(e,t,n){K(e,`pre`,t,n)}we.pre=Te;function Ee(e,t){Ce(e,`post`,t)}function De(e,t){Ce(e,`pre`,t)}Ee.pre=De;function q(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function Oe(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function ke(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=j(S(o)),u=j(!1),d=j(void 0),f=j(S([])),p=()=>{y(f).forEach(e=>e()),N(f,[],!0)},m=e=>{N(f,[...y(f),e],!0)},h=async(e,n,r=!1)=>{try{N(u,!0),N(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:y(l),refetching:r,onCleanup:m,signal:i.signal});return N(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||N(d,e,!0);return}finally{N(u,!1)}},g=s?q(h,s):c?Oe(h,c):h,ee=Array.isArray(e)?e:[e],te;return r((t,n)=>{a&&te||(te=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return y(l)},get loading(){return y(u)},get error(){return y(d)},mutate:e=>{N(l,e,!0)},refetch:t=>{let n=ee.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function Ae(e,t,n){return ke(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];we(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function je(e,t,n){return ke(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];we.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}Ae.pre=je,new xe(`richColorsContext`);var Me=new xe(`<Toaster/>`),Ne=0,Pe=class{#e=j(S([]));get toasts(){return y(this.#e)}set toasts(e){N(this.#e,e,!0)}#t=j(S([]));get heights(){return y(this.#t)}set heights(e){N(this.#t,e,!0)}#n=e=>{let t=this.toasts.findIndex(t=>t.id===e);return t===-1?null:t};addToast=e=>{ye&&this.toasts.unshift(e)};updateToast=({id:e,data:t,type:n,message:r})=>{let i=this.toasts.findIndex(t=>t.id===e),a=this.toasts[i];this.toasts[i]={...a,...t,id:e,title:r,type:n,updated:!0}};create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id&&e.id?.length>0?e.id:Ne++,i=e.dismissible===void 0?e.dismissable===void 0?!0:e.dismissable:e.dismissible,a=e.type===void 0?`default`:e.type;return x(()=>{this.toasts.find(e=>e.id===r)?this.updateToast({id:r,data:e,type:a,message:t,dismissible:i}):this.addToast({...n,id:r,title:t,dismissible:i,type:a})}),r};dismiss=e=>(x(()=>{if(e===void 0){this.toasts=this.toasts.map(e=>({...e,dismiss:!0}));return}let t=this.toasts.findIndex(t=>t.id===e);this.toasts[t]&&(this.toasts[t]={...this.toasts[t],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}let t=this.#n(e);if(t!==null)return this.toasts.splice(t,1),e};message=(e,t)=>this.create({...t,type:`default`,message:e});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:typeof t.loading==`string`?t.loading:t.loading()}));let r=e instanceof Promise?e:e(),i=n!==void 0;return r.then(e=>{if(typeof e==`object`&&e&&`ok`in e&&typeof e.ok==`boolean`&&!e.ok){i=!1;let t=Fe(e);this.create({id:n,type:`error`,message:t})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?t.success(e):t.success;this.create({id:n,type:`success`,message:r})}}).catch(e=>{if(t.error!==void 0){i=!1;let r=typeof t.error==`function`?t.error(e):t.error;this.create({id:n,type:`error`,message:r})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),n};custom=(e,t)=>{let n=t?.id||Ne++;return this.create({component:e,id:n,...t}),n};removeHeight=e=>{this.heights=this.heights.filter(t=>t.toastId!==e)};setHeight=e=>{let t=this.#n(e.toastId);if(t===null){this.heights.push(e);return}this.heights[t]=e};reset=()=>{this.toasts=[],this.heights=[]}};function Fe(e){return e&&typeof e==`object`&&`status`in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}var J=new Pe;function Ie(e,t){return J.create({message:e,...t})}var Y=class{#e=A(()=>J.toasts.filter(e=>!e.dismiss));get toasts(){return y(this.#e)}},X=Object.assign(Ie,{success:J.success,info:J.info,warning:J.warning,error:J.error,custom:J.custom,message:J.message,promise:J.promise,dismiss:J.dismiss,loading:J.loading,getActiveToasts:()=>J.toasts.filter(e=>!e.dismiss)});function Le(e){return e.label!==void 0}function Re(){let e=j(S(typeof document<`u`?document.hidden:!1));return b(()=>D(document,`visibilitychange`,()=>{N(e,document.hidden,!0)})),{get current(){return y(e)}}}var ze=4e3,Be=14,Ve=45,He=200,Ue=.05,We={toast:``,title:``,description:``,loader:``,closeButton:``,cancelButton:``,actionButton:``,action:``,warning:``,error:``,success:``,default:``,info:``,loading:``};function Ge(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function Ke(e){return 1/(1.5+Math.abs(e)/20)}var qe=e(`<div><!></div>`),Je=e(`<button data-close-button=""><!></button>`),Ye=e(`<div data-icon=""><!> <!></div>`),Xe=e(`<div data-description=""><!></div>`),Ze=e(`<button data-button="" data-cancel=""> </button>`),Qe=e(`<button data-button=""> </button>`),$e=e(`<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>`,1),et=e(`<li aria-atomic="true" data-sonner-toast=""><!> <!></li>`);function tt(e,s){n(s,!0);let l=e=>{var n=P(),r=T(n),i=e=>{var n=qe();w(E(n),()=>s.loadingIcon),a(n),k(e=>{h(n,1,e),M(n,`data-visible`,y(B)===`loading`)},[()=>t(W(y(K)?.loader,s.toast?.classes?.loader,`sonner-loader`))]),m(e,n)},o=e=>{{let t=A(()=>W(y(K)?.loader,s.toast.classes?.loader)),n=A(()=>y(B)===`loading`);ve(e,{get class(){return y(t)},get visible(){return y(n)}})}};f(r,e=>{s.loadingIcon?e(i):e(o,-1)}),m(e,n)},u=O(s,`cancelButtonStyle`,3,``),g=O(s,`actionButtonStyle`,3,``),ee=O(s,`descriptionClass`,3,``),_=O(s,`unstyled`,3,!1),v=O(s,`defaultRichColors`,3,!1);re(s,`$$slots.$$events.$$legacy.toast.index.expanded.invert.position.visibleToasts.expandByDefault.closeButton.interacting.cancelButtonStyle.actionButtonStyle.duration.descriptionClass.classes.unstyled.loadingIcon.successIcon.errorIcon.warningIcon.closeIcon.infoIcon.defaultRichColors.swipeDirections.closeButtonAriaLabel.pauseWhenPageIsHidden`.split(`.`));let ne={...We},ae=j(!1),S=j(!1),se=j(!1),ce=j(!1),ue=j(!1),D=j(0),de=j(0),fe=s.toast.duration||s.duration||ze,F=j(void 0),I=j(null),L=j(null),R=A(()=>s.index===0),z=A(()=>s.index+1<=s.visibleToasts),B=A(()=>s.toast.type),V=A(()=>s.toast.dismissible===void 0?s.toast.dismissable!==!1:s.toast.dismissible!==!1),H=A(()=>s.toast.class||``),me=A(()=>s.toast.descriptionClass||``),he=A(()=>J.heights.findIndex(e=>e.toastId===s.toast.id)||0),ge=A(()=>s.toast.closeButton??s.closeButton),_e=A(()=>s.toast.duration??s.duration??ze),U=null,ye=A(()=>s.position.split(`-`)),G=A(()=>J.heights.reduce((e,t,n)=>n>=y(he)?e:e+t.height,0)),be=Re(),xe=A(()=>s.toast.invert||s.invert),Se=A(()=>y(B)===`loading`),K=A(()=>({...ne,...s.classes})),Ce=A(()=>s.toast.title),we=A(()=>s.toast.description),Te=j(0),Ee=j(0),De=A(()=>Math.round(y(he)*Be+y(G)));b(()=>{y(Ce),y(we);let e;e=s.expanded||s.expandByDefault?1:1-s.index*Ue;let t=x(()=>y(F));if(t===void 0)return;t.style.setProperty(`height`,`auto`);let n=t.offsetHeight,r=t.getBoundingClientRect().height,i=Math.round(r/e+2**-52&100)/100;t.style.removeProperty(`height`);let a;a=Math.abs(i-n)<1?i:n,N(de,a,!0),J.setHeight({toastId:s.toast.id,height:a})});function q(){N(S,!0),N(D,y(De),!0),J.removeHeight(s.toast.id),setTimeout(()=>{J.remove(s.toast.id)},He)}let Oe,ke=A(()=>s.toast.promise&&y(B)===`loading`||s.toast.duration===1/0);function Ae(){N(Te,new Date().getTime(),!0),Oe=setTimeout(()=>{s.toast.onAutoClose?.(s.toast),q()},fe)}function je(){if(y(Ee)<y(Te)){let e=new Date().getTime()-y(Te);fe-=e}N(Ee,new Date().getTime(),!0)}b(()=>{s.toast.updated&&(clearTimeout(Oe),fe=y(_e),y(ke)||Ae())}),b(()=>(y(ke)||(s.expanded||s.interacting||s.pauseWhenPageIsHidden&&be.current?je():Ae()),()=>clearTimeout(Oe))),oe(()=>{N(ae,!0);let e=y(F)?.getBoundingClientRect().height;return N(de,e,!0),J.setHeight({toastId:s.toast.id,height:e}),()=>{J.removeHeight(s.toast.id)}}),b(()=>{s.toast.delete&&x(()=>{q(),s.toast.onDismiss?.(s.toast)})});let Me=e=>{if(y(Se))return;N(D,y(De),!0);let t=e.target;t.setPointerCapture(e.pointerId),t.tagName!==`BUTTON`&&(N(se,!0),U={x:e.clientX,y:e.clientY})},Ne=()=>{if(y(ce)||!y(V))return;U=null;let e=Number(y(F)?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(y(F)?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),n=new Date().getTime()-0,r=y(I)===`x`?e:t,i=Math.abs(r)/n;if(Math.abs(r)>=Ve||i>.11){N(D,y(De),!0),s.toast.onDismiss?.(s.toast),y(I)===`x`?N(L,e>0?`right`:`left`,!0):N(L,t>0?`down`:`up`,!0),q(),N(ce,!0);return}else y(F)?.style.setProperty(`--swipe-amount-x`,`0px`),y(F)?.style.setProperty(`--swipe-amount-y`,`0px`);N(ue,!1),N(se,!1),N(I,null)},Pe=e=>{if(!U||!y(V)||(window.getSelection()?.toString().length??-1)>0)return;let t=e.clientY-U.y,n=e.clientX-U.x,r=s.swipeDirections??Ge(s.position);!y(I)&&(Math.abs(n)>1||Math.abs(t)>1)&&N(I,Math.abs(n)>Math.abs(t)?`x`:`y`,!0);let i={x:0,y:0};if(y(I)===`y`){if(r.includes(`top`)||r.includes(`bottom`))if(r.includes(`top`)&&t<0||r.includes(`bottom`)&&t>0)i.y=t;else{let e=t*Ke(t);i.y=Math.abs(e)<Math.abs(t)?e:t}}else if(y(I)===`x`&&(r.includes(`left`)||r.includes(`right`)))if(r.includes(`left`)&&n<0||r.includes(`right`)&&n>0)i.x=n;else{let e=n*Ke(n);i.x=Math.abs(e)<Math.abs(n)?e:n}(Math.abs(i.x)>0||Math.abs(i.y)>0)&&N(ue,!0),y(F)?.style.setProperty(`--swipe-amount-x`,`${i.x}px`),y(F)?.style.setProperty(`--swipe-amount-y`,`${i.y}px`)},Fe=()=>{N(se,!1),N(I,null),U=null},Ie=A(()=>s.toast.icon?s.toast.icon:y(B)===`success`?s.successIcon:y(B)===`error`?s.errorIcon:y(B)===`warning`?s.warningIcon:y(B)===`info`?s.infoIcon:y(B)===`loading`?s.loadingIcon:null);var Y=et();M(Y,`tabindex`,0);let X;var tt=E(Y),nt=e=>{var n=Je();w(E(n),()=>s.closeIcon??i),a(n),k(e=>{M(n,`aria-label`,s.closeButtonAriaLabel),M(n,`data-disabled`,y(Se)),h(n,1,e)},[()=>t(W(y(K)?.closeButton,s.toast?.classes?.closeButton))]),r(`click`,n,()=>{y(Se)||!y(V)||(q(),s.toast.onDismiss?.(s.toast))}),m(e,n)};f(tt,e=>{y(ge)&&!s.toast.component&&y(B)!==`loading`&&s.closeIcon!==null&&e(nt)});var rt=C(tt,2),it=e=>{let t=A(()=>s.toast.component);var n=P();d(T(n),()=>y(t),(e,t)=>{t(e,le(()=>s.toast.componentProps,{closeToast:q}))}),m(e,n)},at=e=>{var n=$e(),c=T(n),p=e=>{var n=Ye(),r=E(n),o=e=>{var t=P(),n=T(t),r=e=>{var t=P();d(T(t),()=>s.toast.icon,(e,t)=>{t(e,{})}),m(e,t)},i=e=>{l(e)};f(n,e=>{s.toast.icon?e(r):e(i,-1)}),m(e,t)};f(r,e=>{(s.toast.promise||y(B)===`loading`)&&e(o)});var c=C(r,2),u=e=>{var t=P(),n=T(t),r=e=>{var t=P();d(T(t),()=>s.toast.icon,(e,t)=>{t(e,{})}),m(e,t)},a=e=>{var t=P();w(T(t),()=>s.successIcon??i),m(e,t)},o=e=>{var t=P();w(T(t),()=>s.errorIcon??i),m(e,t)},c=e=>{var t=P();w(T(t),()=>s.warningIcon??i),m(e,t)},l=e=>{var t=P();w(T(t),()=>s.infoIcon??i),m(e,t)};f(n,e=>{s.toast.icon?e(r):y(B)===`success`?e(a,1):y(B)===`error`?e(o,2):y(B)===`warning`?e(c,3):y(B)===`info`&&e(l,4)}),m(e,t)};f(c,e=>{s.toast.type!==`loading`&&e(u)}),a(n),k(e=>h(n,1,e),[()=>t(W(y(K)?.icon,s.toast?.classes?.icon))]),m(e,n)};f(c,e=>{(y(B)||s.toast.icon||s.toast.promise)&&s.toast.icon!==null&&(y(Ie)!==null||s.toast.icon)&&e(p)});var _=C(c,2),v=E(_),ne=E(v),re=e=>{var t=P(),n=T(t),r=e=>{let t=A(()=>s.toast.title);var n=P();d(T(n),()=>y(t),(e,t)=>{t(e,le(()=>s.toast.componentProps))}),m(e,n)},i=e=>{var t=te();k(()=>o(t,s.toast.title)),m(e,t)};f(n,e=>{typeof s.toast.title==`string`?e(i,-1):e(r)}),m(e,t)};f(ne,e=>{s.toast.title&&e(re)}),a(v);var b=C(v,2),x=e=>{var n=Xe(),r=E(n),i=e=>{let t=A(()=>s.toast.description);var n=P();d(T(n),()=>y(t),(e,t)=>{t(e,le(()=>s.toast.componentProps))}),m(e,n)},c=e=>{var t=te();k(()=>o(t,s.toast.description)),m(e,t)};f(r,e=>{typeof s.toast.description==`string`?e(c,-1):e(i)}),a(n),k(e=>h(n,1,e),[()=>t(W(ee(),y(me),y(K)?.description,s.toast.classes?.description))]),m(e,n)};f(b,e=>{s.toast.description&&e(x)}),a(_);var ie=C(_,2),ae=e=>{var n=P(),i=T(n),c=e=>{var t=P();d(T(t),()=>s.toast.cancel,(e,t)=>{t(e,{})}),m(e,t)},l=e=>{var n=Ze(),i=E(n,!0);a(n),k(e=>{pe(n,s.toast.cancelButtonStyle??u()),h(n,1,e),o(i,s.toast.cancel.label)},[()=>t(W(y(K)?.cancelButton,s.toast?.classes?.cancelButton))]),r(`click`,n,e=>{Le(s.toast.cancel)&&y(V)&&(s.toast.cancel?.onClick?.(e),q())}),m(e,n)},p=A(()=>Le(s.toast.cancel));f(i,e=>{typeof s.toast.cancel==`function`?e(c):y(p)&&e(l,1)}),m(e,n)};f(ie,e=>{s.toast.cancel&&e(ae)});var S=C(ie,2),oe=e=>{var n=P(),i=T(n),c=e=>{var t=P();d(T(t),()=>s.toast.action,(e,t)=>{t(e,{})}),m(e,t)},l=e=>{var n=Qe(),i=E(n,!0);a(n),k(e=>{pe(n,s.toast.actionButtonStyle??g()),h(n,1,e),o(i,s.toast.action.label)},[()=>t(W(y(K)?.actionButton,s.toast?.classes?.actionButton))]),r(`click`,n,e=>{Le(s.toast.action)&&(s.toast.action?.onClick(e),!e.defaultPrevented&&q())}),m(e,n)},u=A(()=>Le(s.toast.action));f(i,e=>{typeof s.toast.action==`function`?e(c):y(u)&&e(l,1)}),m(e,n)};f(S,e=>{s.toast.action&&e(oe)}),k((e,t)=>{h(_,1,e),h(v,1,t)},[()=>t(W(y(K)?.content,s.toast?.classes?.content)),()=>t(W(y(K)?.title,s.toast?.classes?.title))]),m(e,n)};f(rt,e=>{s.toast.component?e(it):e(at,-1)}),a(Y),ie(Y,e=>N(F,e),()=>y(F)),k((e,t,n)=>{h(Y,1,e),M(Y,`aria-live`,s.toast.important?`assertive`:`polite`),M(Y,`data-rich-colors`,s.toast.richColors??v()),M(Y,`data-styled`,!(s.toast.component||s.toast.unstyled||_())),M(Y,`data-mounted`,y(ae)),M(Y,`data-promise`,t),M(Y,`data-swiped`,y(ue)),M(Y,`data-removed`,y(S)),M(Y,`data-visible`,y(z)),M(Y,`data-y-position`,y(ye)[0]),M(Y,`data-x-position`,y(ye)[1]),M(Y,`data-index`,s.index),M(Y,`data-front`,y(R)),M(Y,`data-swiping`,y(se)),M(Y,`data-dismissible`,y(V)),M(Y,`data-type`,y(B)),M(Y,`data-invert`,y(xe)),M(Y,`data-swipe-out`,y(ce)),M(Y,`data-swipe-direction`,y(L)),M(Y,`data-expanded`,n),X=pe(Y,`${s.style} ${s.toast.style}`,X,{"--index":s.index,"--toasts-before":s.index,"--z-index":J.toasts.length-s.index,"--offset":`${y(S)?y(D):y(De)}px`,"--initial-height":s.expandByDefault?`auto`:`${y(de)}px`})},[()=>t(W(s.class,y(H),y(K)?.toast,s.toast?.classes?.toast,y(K)?.[y(B)],s.toast?.classes?.[y(B)])),()=>!!s.toast.promise,()=>!!(s.expanded||s.expandByDefault&&y(ae))]),r(`pointermove`,Y,Pe),r(`pointerup`,Y,Ne),r(`pointerdown`,Y,Me),c(`dragend`,Y,Fe),m(e,Y),p()}v([`pointermove`,`pointerup`,`pointerdown`,`click`]);var nt=_(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>`);function rt(e){m(e,nt())}var it=_(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`);function at(e){m(e,it())}var ot=_(`<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>`);function st(e){m(e,ot())}var ct=_(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>`);function lt(e){m(e,ct())}var ut=_(`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>`);function dt(e){m(e,ut())}var ft=3,pt=`24px`,mt=`16px`,ht=4e3,gt=356,_t=14,vt=`dark`,yt=`light`;function bt(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?mt:pt;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{let r=e[t];r===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof r==`number`?`${r}px`:r}):o(a)}),n}var xt=e(`<ol></ol>`),St=e(`<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-1xbpph3"><!></section>`);function Ct(e,t){n(t,!0);function r(e){return e===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?vt:yt:e}let o=O(t,`invert`,3,!1),s=O(t,`position`,3,`bottom-right`),c=O(t,`hotkey`,19,()=>[`altKey`,`KeyT`]),l=O(t,`expand`,3,!1),u=O(t,`closeButton`,3,!1),d=O(t,`offset`,3,pt),h=O(t,`mobileOffset`,3,mt),g=O(t,`theme`,3,`light`),ee=O(t,`richColors`,3,!1),te=O(t,`duration`,3,ht),_=O(t,`visibleToasts`,3,ft),v=O(t,`toastOptions`,19,()=>({})),C=O(t,`dir`,7,`auto`),se=O(t,`gap`,3,_t),le=O(t,`pauseWhenPageIsHidden`,3,!1),ue=O(t,`containerAriaLabel`,3,`Notifications`),de=O(t,`closeButtonAriaLabel`,3,`Close toast`),fe=re(t,`$$slots.$$events.$$legacy.invert.position.hotkey.expand.closeButton.offset.mobileOffset.theme.richColors.duration.visibleToasts.toastOptions.dir.gap.pauseWhenPageIsHidden.loadingIcon.successIcon.errorIcon.warningIcon.closeIcon.infoIcon.containerAriaLabel.class.closeButtonAriaLabel.onblur.onfocus.onmouseenter.onmousemove.onmouseleave.ondragend.onpointerdown.onpointerup`.split(`.`));function pe(){if(C()!==`auto`)return C();if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?(x(()=>C(window.getComputedStyle(document.documentElement).direction??`ltr`)),C()):(x(()=>C(e)),e)}let F=A(()=>Array.from(new Set([s(),...J.toasts.filter(e=>e.position).map(e=>e.position)].filter(Boolean)))),I=j(!1),L=j(!1),R=j(S(r(g()))),z=j(void 0),B=j(null),V=j(!1),H=A(()=>c().join(`+`).replace(/Key/g,``).replace(/Digit/g,``));b(()=>{J.toasts.length<=1&&N(I,!1)}),b(()=>{let e=J.toasts.filter(e=>e.dismiss&&!e.delete);e.length>0&&(J.toasts=J.toasts.map(t=>e.find(e=>e.id===t.id)?{...t,delete:!0}:t))}),b(()=>()=>{y(z)&&y(B)&&(y(B).focus({preventScroll:!0}),N(B,null),N(V,!1))}),oe(()=>(J.reset(),D(document,`keydown`,e=>{c().every(t=>e[t]||e.code===t)&&(N(I,!0),y(z)?.focus()),e.code===`Escape`&&(document.activeElement===y(z)||y(z)?.contains(document.activeElement))&&N(I,!1)}))),b(()=>{if(g()!==`system`&&N(R,g()),typeof window<`u`){g()===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(R,vt):N(R,yt));let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=({matches:e})=>{g()===`system`&&N(R,e?vt:yt,!0)};`addEventListener`in e?e.addEventListener(`change`,t):e.addListener(t)}});let me=e=>{t.onblur?.(e),y(V)&&!e.currentTarget.contains(e.relatedTarget)&&(N(V,!1),y(B)&&(y(B).focus({preventScroll:!0}),N(B,null)))},he=e=>{t.onfocus?.(e),!(e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`)&&(y(V)||(N(V,!0),N(B,e.relatedTarget,!0)))},ge=e=>{t.onpointerdown?.(e),!(e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`)&&N(L,!0)},_e=e=>{t.onmouseenter?.(e),N(I,!0)},U=e=>{t.onmouseleave?.(e),y(L)||N(I,!1)},ve=e=>{t.onmousemove?.(e),N(I,!0)},W=e=>{t.ondragend?.(e),N(I,!1)},ye=e=>{t.onpointerup?.(e),N(L,!1)};Me.set(new Y);var G=St();M(G,`tabindex`,-1);var be=E(G),xe=e=>{var n=P();ce(T(n),18,()=>y(F),e=>e,(e,n,r,s)=>{let c=A(()=>{let[e,t]=n.split(`-`);return{y:e,x:t}}),p=A(()=>bt(d(),h()));var g=xt();ne(g,e=>({tabindex:-1,dir:e,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":y(R),"data-y-position":y(c).y,"data-x-position":y(c).x,style:t.style,onblur:me,onfocus:he,onmouseenter:_e,onmousemove:ve,onmouseleave:U,ondragend:W,onpointerdown:ge,onpointerup:ye,...fe,[ae]:{"--front-toast-height":`${J.heights[0]?.height}px`,"--width":`${gt}px`,"--gap":`${se()}px`,"--offset-top":y(p)[`--offset-top`],"--offset-right":y(p)[`--offset-right`],"--offset-bottom":y(p)[`--offset-bottom`],"--offset-left":y(p)[`--offset-left`],"--mobile-offset-top":y(p)[`--mobile-offset-top`],"--mobile-offset-right":y(p)[`--mobile-offset-right`],"--mobile-offset-bottom":y(p)[`--mobile-offset-bottom`],"--mobile-offset-left":y(p)[`--mobile-offset-left`]}}),[()=>pe()],void 0,void 0,`svelte-1xbpph3`),ce(g,23,()=>J.toasts.filter(e=>!e.position&&y(r)===0||e.position===n),e=>e.id,(e,r,a,s)=>{{let s=e=>{var n=P(),r=T(n),a=e=>{var n=P();w(T(n),()=>t.successIcon??i),m(e,n)},o=e=>{rt(e,{})};f(r,e=>{t.successIcon?e(a):t.successIcon!==null&&e(o,1)}),m(e,n)},c=e=>{var n=P(),r=T(n),a=e=>{var n=P();w(T(n),()=>t.errorIcon??i),m(e,n)},o=e=>{at(e,{})};f(r,e=>{t.errorIcon?e(a):t.errorIcon!==null&&e(o,1)}),m(e,n)},d=e=>{var n=P(),r=T(n),a=e=>{var n=P();w(T(n),()=>t.warningIcon??i),m(e,n)},o=e=>{st(e,{})};f(r,e=>{t.warningIcon?e(a):t.warningIcon!==null&&e(o,1)}),m(e,n)},p=e=>{var n=P(),r=T(n),a=e=>{var n=P();w(T(n),()=>t.infoIcon??i),m(e,n)},o=e=>{lt(e,{})};f(r,e=>{t.infoIcon?e(a):t.infoIcon!==null&&e(o,1)}),m(e,n)},h=e=>{var n=P(),r=T(n),a=e=>{var n=P();w(T(n),()=>t.closeIcon??i),m(e,n)},o=e=>{dt(e,{})};f(r,e=>{t.closeIcon?e(a):t.closeIcon!==null&&e(o,1)}),m(e,n)},g=A(()=>v()?.duration??te()),ne=A(()=>v()?.class??``),re=A(()=>v()?.descriptionClass||``),b=A(()=>v()?.style??``),x=A(()=>v().classes||{}),ie=A(()=>v().unstyled??!1),ae=A(()=>v()?.cancelButtonStyle??``),S=A(()=>v()?.actionButtonStyle??``),C=A(()=>v()?.closeButtonAriaLabel??de());tt(e,{get index(){return y(a)},get toast(){return y(r)},get defaultRichColors(){return ee()},get duration(){return y(g)},get class(){return y(ne)},get descriptionClass(){return y(re)},get invert(){return o()},get visibleToasts(){return _()},get closeButton(){return u()},get interacting(){return y(L)},get position(){return n},get style(){return y(b)},get classes(){return y(x)},get unstyled(){return y(ie)},get cancelButtonStyle(){return y(ae)},get actionButtonStyle(){return y(S)},get closeButtonAriaLabel(){return y(C)},get expandByDefault(){return l()},get expanded(){return y(I)},get pauseWhenPageIsHidden(){return le()},get loadingIcon(){return t.loadingIcon},successIcon:s,errorIcon:c,warningIcon:d,infoIcon:p,closeIcon:h,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),a(g),ie(g,e=>N(z,e),()=>y(z)),k(()=>g.dir=g.dir),m(e,g)}),m(e,n)};f(be,e=>{J.toasts.length>0&&e(xe)}),a(G),k(()=>M(G,`aria-label`,`${ue()??``} ${y(H)??``}`)),m(e,G),p()}var wt=de({toast:()=>X}),Tt=800;async function Et(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Dt(e,t,n){return`${e}/${t}/${n}`}function Ot(){let e=j(!1),t=j(null),n=j(null),r=j(null),i=null,a=null,o=!1,s=new Map;function c(e,t,n,r){i&&i.repo===e&&i.type===t&&i.id===n?(r.data!==void 0&&(i.payload.data=r.data),r.content!==void 0&&(i.payload.content=r.content)):i={repo:e,type:t,id:n,payload:{...r}},l()}function l(){a&&clearTimeout(a),a=setTimeout(u,Tt)}async function u(){if(a=null,!o&&i){let{repo:a,type:c,id:l,payload:d}=i;i=null,o=!0,N(e,!0),N(n,null);let f=Dt(a,c,l),p=d.content===void 0?void 0:s.get(f);try{let e=await L(a,c,l,d,{baseBodyHash:p});if(N(t,new Date,!0),d.content!==void 0){let t=e.document?.content??d.content;s.set(f,await Et(t))}if(y(r)?.entityKey===f&&(N(r,null),X.dismiss(`conflict:${f}`)),d.data?.name){let e=B.repos.find(e=>e.name===a)?.entities.find(e=>e.id===l);e&&(e.title=d.data.name)}}catch(e){let t=e.status??e.statusCode;if(t===412&&e.body?.code===`STALE_BODY_HASH`&&d.content!==void 0){let t=await Et(d.content),o=e.body.currentBodyHash;t===o?(s.set(f,o),i={repo:a,type:c,id:l,payload:d},N(n,null)):(N(r,{entityKey:f,currentBodyHash:o},!0),N(n,`Conflict: another writer modified this entity. Reload to continue.`),X.error(`Another writer modified this entry while you were editing.`,{id:`conflict:${f}`,duration:1/0,action:{label:`Reload`,onClick:()=>{window.location.reload()}}}))}else N(n,e.message??`Save failed`,!0),(!t||t>=500)&&(i={repo:a,type:c,id:l,payload:d})}finally{N(e,!1),o=!1,i&&u()}}}function d(){return a&&=(clearTimeout(a),null),i?u():Promise.resolve()}async function f(r,i,a,o){N(e,!0),N(n,null);try{let e=await L(r,i,a,o);return N(t,new Date,!0),e}catch(e){return N(n,e.message??`Save failed`,!0),null}finally{N(e,!1)}}function p(){N(n,null),N(t,null),i=null,y(r)&&(X.dismiss(`conflict:${y(r).entityKey}`),N(r,null)),a&&=(clearTimeout(a),null)}async function m(e,t,n,r){let i=Dt(e,t,n);s.set(i,await Et(r))}function h(e,t,n){s.delete(Dt(e,t,n))}return{get saving(){return y(e)},get lastSaved(){return y(t)},get error(){return y(n)},get hasPending(){return!!(i||o)},get conflict(){return y(r)},scheduleAutoSave:c,flush:d,saveEntity:f,setBaseBodyHash:m,clearBaseBodyHash:h,reset:p}}var kt=Ot(),Z=j(`idle`),At=j(!1),jt=j(null),Mt=j(null),Q=j(null),Nt=j(``),Pt=j(null),Ft=j(0),It=null,Lt=j(19877),Rt=null,zt={get state(){return y(Z)},get isElectron(){return y(At)},get activeEntityId(){return y(jt)},get activeRepo(){return y(Mt)},get meetingTitle(){return y(Nt)},get platform(){return y(Pt)},get elapsedSeconds(){return y(Ft)},get recordingStartTime(){return y(Q)},handleElectronReady(e){N(At,!0),e?.port&&N(Lt,e.port,!0)},async handleRecordingStarted(e){if(N(At,!0),y(Z)===`processing`&&this.reset(),y(Z)!==`idle`)return;let t=e.repo||await Jt()||B.repos[0]?.name||null;if(!t){X.error(`No folder configured. Set one in Connectors → Meeting Capture.`);return}N(Nt,e.meetingTitle||``,!0),N(Pt,e.platform||null,!0),N(Mt,t,!0),N(Q,new Date,!0),N(Z,`recording`),N(Ft,0),It=setInterval(()=>{g(Ft)},1e3);let n=Wt(y(Nt)||`Meeting`,y(Q));try{let r=y(Q).toISOString();await z(t,`event`,n,{entity_type:`event`,entity_id:n,type:`meeting`,name:y(Nt)||`Meeting ${Gt(y(Q))}`,date:he(y(Q)),created_at:r,updated_at:r,created_by:`desktop`,updated_by:`desktop`,attendees:(e.attendees||[]).filter(e=>!e.isSelf).map(e=>`[[${Ut(e.name)}]]`),tags:[`auto-transcribed`,e.platform].filter(Boolean)},``),N(jt,n,!0),I(`/${t}/event/${n}`),Vt({type:`sg:entity-created`,repo:t,entityType:`event`,entityId:n},`*`)}catch(e){console.error(`[Meeting] Failed to create entity:`,e),N(Z,`idle`),Ht()}},handleRecordingStopped(e){y(Z)!==`recording`&&y(Z)!==`stopping`||Bt()},startRecording(){y(At)&&Vt({type:`sg:start-recording`},`*`)},stopRecording(){y(Z)===`recording`&&Bt()},reset(){N(Z,`idle`),N(jt,null),N(Mt,null),N(Q,null),N(Nt,``),N(Pt,null),N(Ft,0),Ht()},handleEntityUpdated(e,t,n){y(Z)===`processing`&&t===`event`&&(e!==y(Mt)||n!==y(jt)||this.reset())},registerEditorContentProvider(e,t,n){e!==y(Mt)||t!==y(jt)||(Rt=n)},unregisterEditorContentProvider(){Rt=null}};function Bt(){let e=Kt();N(Z,`processing`),Ht(),fetch(`http://127.0.0.1:${y(Lt)}/stop`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({entityId:y(jt),memo:e})}).catch(()=>{}),X(`Processing meeting notes…`,{description:`Your notes will be ready in a moment.`,duration:5e3})}function Vt(e,t){let{type:n,...r}=e;window.sgBridge?.send(n,r)}function Ht(){It&&=(clearInterval(It),null)}function Ut(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)}function Wt(e,t){let n=he(t),r=t.toTimeString().slice(0,8).replace(/:/g,``);return`${n}-${Ut(e||`meeting`)}-${r}`}function Gt(e){return e.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function Kt(){if(Rt)try{let e=Rt();if(typeof e==`string`)return e}catch{}return qt()}function qt(){let e=document.querySelector(`.cm-content`);if(e){let t=e.querySelectorAll(`.cm-line`);return t.length>0?Array.from(t).map(e=>e.textContent||``).join(`
|
|
3
|
+
`):e.textContent||``}let t=document.querySelector(`.entity-editor textarea`);return t?t.value:``}async function Jt(){try{let e=await R(`/api/preferences/settings`);if(e.default_meeting_folder)return e.default_meeting_folder}catch{}return null}function Yt(e){return B.repos.find(t=>t.name===e)?.displayName??V(e)}var $=null,Xt=null,Zt=null,Qt=null,$t=null,en=[],tn=null,nn=[],rn=[],an=null,on=1e3,sn=j(!1),cn=j(null),ln={},un={};function dn(e){let t=me.user?.displayName;if(e.type===`sync_progress`){let t=ln[e.repo];if(t){let n=e.message.trim(),r=n.match(/^Syncing from source:\s*(.+)$/i);r&&(un[e.repo]=`Syncing ${r[1].trim()}…`);let i=un[e.repo]??`Syncing ${e.repo}…`;X.loading(i,{id:t,description:n,duration:36e5})}return}if(e.type===`entity_change`){for(let t of rn)try{t(e)}catch{}if(e.entityType===`_folder`){B.repos.some(t=>t.name===e.repo)?B.refreshRepoAfterFolderMutation(e.repo):B.ensureFolderInSidebar(e.repo);return}if(t&&e.actor===t&&e.source===`api`&&!e.agent){B.refreshEntities(e.repo);return}B.refreshEntities(e.repo),zt.handleEntityUpdated(e.repo,e.entityType,e.entityId),H.selectedRepo===e.repo&&H.selectedType===e.entityType&&H.selectedId===e.entityId&&(kt.hasPending?X(`${e.actor} also saved changes to this entity`):F());return}if(e.type===`session_commit`){if(t&&e.actor===t){N(cn,e.timestamp,!0);return}let n=e.entities.length;X(n===1?`${e.actor} updated ${e.entities[0]}`:`${e.actor} updated ${n} entries in ${e.repo}`),B.refreshEntities(e.repo);return}if(e.type===`sync_complete`){if(!ln[e.repo]){let t=e.created+e.updated+e.deleted,n=t===0?`Sync complete · no changes in ${e.repo}`:`Sync complete · ${t} ${t===1?`entity`:`entities`} from ${e.source}`;X.success(n)}B.refreshEntities(e.repo);return}if(e.type===`folder_created`){X(`${e.actor} created folder ${Yt(e.repo)}`),B.ensureFolderInSidebar(e.repo);return}if(e.type===`folder_deleted`){X(`${e.actor} deleted folder ${Yt(e.repo)}`);return}if(e.type===`repo_sync`){t&&e.actor===t&&e.source===`api`||X(`${e.actor} pushed to ${e.repo}`),B.refreshRepoAfterFolderMutation(e.repo);return}if(e.type===`presence`){Xt?.(e);return}if(e.type===`agent_activity`){Zt?.(e);return}if(e.type===`online`){Qt?.(e);return}if(e.type===`user_mention`){$t?.(e);return}if(e.type===`comment_created`||e.type===`comment_updated`||e.type===`comment_resolved`||e.type===`comment_reopened`||e.type===`comment_deleted`){for(let t of en)t(e);return}if(e.type===`comment_agent_thinking`){tn?.(e);return}if(e.type===`state_cleared`){Promise.all([fe(()=>import(`./DA-BuZei.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),fe(()=>import(`./kLub81jO.js`).then(e=>e.n),__vite__mapDeps([7,1,3,2]),import.meta.url)]).then(([t,n])=>{t.chatStore.wipeLocal(),e.target===`all`&&n.insightsStore.load()});return}if(e.type===`access_granted`){B.ensureFolderInSidebar(e.repo);return}if(e.type===`access_revoked`){H.selectedRepo===e.repo&&H.deselect(),B.onFolderAccessRevoked(e.repo);return}}function fn(){if(typeof window>`u`||$&&($.readyState===WebSocket.OPEN||$.readyState===WebSocket.CONNECTING))return;let e=`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws`;$=new WebSocket(e),$.binaryType=`arraybuffer`,$.onopen=()=>{N(sn,!0),on=1e3,B.refreshAll();for(let e of nn)e()},$.onmessage=e=>{if(!(e.data instanceof ArrayBuffer))try{let t=JSON.parse(e.data);if(t?.type===`ping`){$?.send(JSON.stringify({type:`pong`}));return}if(t?.type===`server_version`&&typeof t.version==`string`){_n(t.version);return}let n=t;n.type&&n.type!==`toast`&&dn(n)}catch{}},$.onclose=()=>{N(sn,!1),$=null,an=setTimeout(()=>{on=Math.min(on*2,1e4),fn()},on)},$.onerror=()=>{}}function pn(){an&&=(clearTimeout(an),null),$&&=($.close(),null),N(sn,!1)}function mn(e,t=4e3){X(e,{duration:t})}var hn=j(!1),gn={get value(){return y(hn)}};function _n(e){!e||e===`1.3.48-beta.1`||y(hn)||N(hn,!0)}function vn(e,t){let n=crypto.randomUUID();return t?.loading?X.loading(e,{id:n,duration:36e5}):X(e,{id:n}),n}function yn(e,t,n){if(n?.loading){X.loading(t,{id:e});return}/failed|error/i.test(t)?X.error(t,{id:e,duration:n?.duration??6e3}):X.success(t,{id:e,duration:n?.duration??4e3})}function bn(e){let t=crypto.randomUUID();ln[e]=t,X.loading(`Syncing ${e}…`,{id:t,duration:36e5})}function xn(e,t,n){let r=ln[e];r&&(delete ln[e],delete un[e],n?X.error(t,{id:r,duration:6e3}):X.success(t,{id:r,duration:4e3}))}function Sn(e){Xt=e}function Cn(e){Zt=e}function wn(e){Qt=e}function Tn(e){$t=e}function En(e){return en.push(e),()=>{let t=en.indexOf(e);t!==-1&&en.splice(t,1)}}function Dn(e){tn=e}function On(e){nn.push(e)}function kn(e){return rn.push(e),()=>{let t=rn.indexOf(e);t!==-1&&rn.splice(t,1)}}function An(e){$?.readyState===WebSocket.OPEN&&$.send(JSON.stringify(e))}var jn={get connected(){return y(sn)},get lastAutoSaved(){return y(cn)},get ws(){return $},connect:fn,disconnect:pn,showToast:mn,showPersistentToast:vn,updateToast:yn,startSyncToast:bn,finishSyncToast:xn,send:An,setPresenceHandler:Sn,setAgentActivityHandler:Cn,setOnlineHandler:wn,setUserMentionHandler:Tn,addCommentHandler:En,setCommentAgentThinkingHandler:Dn,addConnectHandler:On,addEntityChangeHandler:kn};export{wt as a,kt as i,gn as n,Ct as o,zt as r,X as s,jn as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"../nodes/4.DvgaHeI4.js";export{e as commentExtension};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Z as e,gt as t,qt as n,xt as r,yt as i}from"./CYTTTma0.js";import{j as a}from"./CUPSJObs.js";import{t as o}from"./B4cFqqUS.js";var s=n({AGENT_AVATAR_COLOR:()=>l,userColors:()=>m}),c=[`#FE3C3C`,`#C06A6A`,`#CC7013`,`#AB8630`,`#5A9A08`,`#369770`,`#289795`,`#4289C4`,`#718599`,`#7C7CD9`,`#B267F3`,`#B269C0`,`#DC6CD4`],l=`#7C7CD9`,u=r(t({}));async function d(){try{let{colors:e}=await a(`/api/auth/colors`);i(u,e,!0)}catch{}}function f(t,n){if(n===`agent`)return l;let r=e(u)[String(t)];if(r)return r;let i=typeof t==`number`?t:parseInt(String(t),10),a=(Number.isFinite(i)?i:p(String(t)))%c.length;return c[Math.abs(a)]}function p(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}d(),o.addConnectHandler(()=>d());var m={getColor:f,load:d,get colors(){return e(u)}};export{s as n,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{qt as e}from"./CYTTTma0.js";import{p as t}from"./DvPuaTCl.js";import{a as n}from"./C0RpyyYZ.js";var r=e({commentSelectionPopup:()=>o,requestCommentEffect:()=>i}),i=t.define(),a=180;function o(e){let t=e.debounceMs??a;return n.define(n=>{let r=null,a=null,o=null,s=null;function c(){if(r)return r;let e=document.createElement(`button`);return e.type=`button`,e.className=`sg-comment-selection-btn`,e.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="14" height="14" fill="currentColor" aria-hidden="true"><path d="M17.74 30 16 29l4-7h6a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h9v2H6a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4h20a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4h-4.84Z"/></svg><span>Comment</span>`,e.setAttribute(`aria-label`,`Add comment to selection`),e.style.position=`absolute`,e.style.zIndex=`40`,e.style.visibility=`hidden`,e.addEventListener(`mousedown`,e=>{e.preventDefault(),l()}),n.scrollDOM.appendChild(e),r=e,e}function l(){let t=n.state.selection.main,r=t.empty?o:{from:t.from,to:t.to};r&&e.onCommentRequested(r),s=r,u()}function u(){r&&(r.style.visibility=`hidden`),o=null}function d(e,t){let r=n.coordsAtPos(t);if(!r)return;let i=n.scrollDOM.getBoundingClientRect(),a=c();a.style.visibility=`visible`;let s=r.bottom-i.top+n.scrollDOM.scrollTop+6,l=Math.max(8,r.left-i.left+n.scrollDOM.scrollLeft);a.style.top=`${s}px`,a.style.left=`${l}px`,o={from:e,to:t}}function f(e){if(a&&clearTimeout(a),e.state.selection.main.empty){u(),s=null;return}a=setTimeout(()=>{a=null;let e=n.state.selection.main;if(e.empty){u(),s=null;return}s&&e.from===s.from&&e.to===s.to||(s=null,d(e.from,e.to))},t)}return{update(e){if(e.transactions.some(e=>e.effects.some(e=>e.is(i)))){l();return}(e.selectionSet||e.docChanged||e.viewportChanged||e.geometryChanged)&&f(e)},destroy(){a&&clearTimeout(a),r?.remove(),r=null}}})}export{i as n,r as t};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import{A as e,G as t,K as n,L as r,M as i,P as a,Z as o,d as s,dt as c,f as l,p as u,rt as d,s as f,t as p,ut as m,x as h}from"./BlyFGPFV.js";import{M as g,O as _,_ as v,i as y,j as ee,r as te,s as b,t as ne,u as re,w as ie}from"./CSUrYOis.js";import{n as x,t as S}from"./g09ZrevW2.js";import{t as ae}from"./DYXDRmoo2.js";import{t as oe}from"./DWygwzcO2.js";import{t as se}from"./CDTjuBSm2.js";var C=(e=>(e[e.Low=0]=`Low`,e[e.Normal=1]=`Normal`,e[e.High=2]=`High`,e))(C||{});function w(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function T(e){return e.split(`?`)[0].split(`#`)[0]}function ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function le(e,t,n){return e.replace(new RegExp(ce(t),`g`),n)}function ue(e,t){let n=``,r=0,i=-1,a=0,o=-1;for(let s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){let e=n.lastIndexOf(`/`);if(e!==n.length-1){e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}var E={toPosix(e){return le(e,`\\`,`/`)},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},isBlobUrl(e){return e.startsWith(`blob:`)},hasProtocol(e){return/^[^/:]+:/.test(this.toPosix(e))},getProtocol(e){w(e),e=this.toPosix(e);let t=/^file:\/\/\//.exec(e);if(t)return t[0];let n=/^[^/:]+:\/{0,2}/.exec(e);return n?n[0]:``},toAbsolute(t,n,r){if(w(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;let i=T(this.toPosix(n??e.get().getBaseUrl())),a=T(this.toPosix(r??this.rootname(i)));return t=this.toPosix(t),t.startsWith(`/`)?E.join(a,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize(e){if(w(e),e.length===0)return`.`;if(this.isDataUrl(e)||this.isBlobUrl(e))return e;e=this.toPosix(e);let t=``,n=e.startsWith(`/`);this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));let r=e.endsWith(`/`);return e=ue(e,!1),e.length>0&&r&&(e+=`/`),n?`/${e}`:t+e},isAbsolute(e){return w(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith(`/`)},join(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];if(w(r),r.length>0)if(t===void 0)t=r;else{let i=e[n-1]??``;this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${r}`:t+=`/${r}`}}return t===void 0?`.`:this.normalize(t)},dirname(e){if(w(e),e.length===0)return`.`;e=this.toPosix(e);let t=e.charCodeAt(0),n=t===47,r=-1,i=!0,a=this.getProtocol(e),o=e;e=e.slice(a.length);for(let n=e.length-1;n>=1;--n)if(t=e.charCodeAt(n),t===47){if(!i){r=n;break}}else i=!1;return r===-1?n?`/`:this.isUrl(o)?a+e:a:n&&r===1?`//`:a+e.slice(0,r)},rootname(e){w(e),e=this.toPosix(e);let t=``;if(t=e.startsWith(`/`)?`/`:this.getProtocol(e),this.isUrl(e)){let n=e.indexOf(`/`,t.length);t=n===-1?e:e.slice(0,n),t.endsWith(`/`)||(t+=`/`)}return t},basename(e,t){w(e),t&&w(t),e=T(this.toPosix(e));let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){w(e),e=T(this.toPosix(e));let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},parse(e){w(e);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;e=T(this.toPosix(e));let n=e.charCodeAt(0),r=this.isAbsolute(e),i;t.root=this.rootname(e),i=r||this.hasProtocol(e)?1:0;let a=-1,o=0,s=-1,c=!0,l=e.length-1,u=0;for(;l>=i;--l){if(n=e.charCodeAt(l),n===47){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),n===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(o===0&&r?t.base=t.name=e.slice(1,s):t.base=t.name=e.slice(o,s)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s)),t.ext=e.slice(a,s)),t.dir=this.dirname(e),t},sep:`/`,delimiter:`:`,joinExtensions:[`.html`]};function D(e,t,n,r,i){let a=t[n];for(let o=0;o<a.length;o++){let s=a[o];n<t.length-1?D(e.replace(r[n],s),t,n+1,r,i):i.push(e.replace(r[n],s))}}function de(e){let t=e.match(/\{(.*?)\}/g),n=[];if(t){let r=[];t.forEach(e=>{let t=e.substring(1,e.length-1).split(`,`);r.push(t)}),D(e,r,0,t,n)}else n.push(e);return n}var O=e=>!Array.isArray(e),k=class{constructor(){this._defaultBundleIdentifierOptions={connector:`-`,createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,``)},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle(`foo`,this._createBundleAssetId(`foo`,`bar`))!==`bar`)throw Error(`[Resolver] GenerateBundleAssetId are not working correctly`)}prefer(...e){e.forEach(e=>{this._preferredOrder.push(e),e.priority||=Object.keys(e.params)}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e==`string`)this._defaultSearchParams=e;else{let t=e;this._defaultSearchParams=Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join(`&`)}}getAlias(e){let{alias:t,src:n}=e;return x(t||n,e=>typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.src??e):e?.src?e.src:e,!0)}removeAlias(e,t){this._assetMap[e]&&(t&&t!==this._resolverHash[e]||(delete this._resolverHash[e],delete this._assetMap[e]))}addManifest(e){this._manifest&&o(`[Resolver] Manifest already exists, this will be overwritten`),this._manifest=e,e.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(e,t){let n=[],r=t;Array.isArray(t)||(r=Object.entries(t).map(([e,t])=>typeof t==`string`||Array.isArray(t)?{alias:e,src:t}:{alias:e,...t})),r.forEach(t=>{let r=t.src,i=t.alias,a;if(typeof i==`string`){let t=this._createBundleAssetId(e,i);n.push(t),a=[i,t]}else{let t=i.map(t=>this._createBundleAssetId(e,t));n.push(...t),a=[...i,...t]}this.add({...t,alias:a,src:r})}),this._bundles[e]=n}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let n=e=>{this.hasKey(e)&&o(`[Resolver] already has key: ${e} overwriting`)};x(t).forEach(e=>{let{src:t}=e,{data:r,format:i,loadParser:a,parser:o}=e,s=x(t).map(e=>typeof e==`string`?de(e):Array.isArray(e)?e:[e]),c=this.getAlias(e);Array.isArray(c)?c.forEach(n):n(c);let l=[],u=e=>({src:e,...this._parsers.find(t=>t.test(e))?.parse(e)});s.forEach(t=>{t.forEach(t=>{let n={};if(typeof t==`object`?(r=t.data??r,i=t.format??i,(t.loadParser||t.parser)&&(a=t.loadParser??a,o=t.parser??o),n={...u(t.src),...t}):n=u(t),!c)throw Error(`[Resolver] alias is undefined for this asset: ${n.src}`);n=this._buildResolvedAsset(n,{aliases:c,data:r,format:i,loadParser:a,parser:o,progressSize:e.progressSize}),l.push(n)})}),c.forEach(e=>{this._assetMap[e]=l})})}resolveBundle(e){let t=O(e);e=x(e);let n={};return e.forEach(e=>{let t=this._bundles[e];if(t){let r=this.resolve(t),i={};for(let t in r){let n=r[t];i[this._extractAssetIdFromBundle(e,t)]=n}n[e]=i}}),t?n[e[0]]:n}resolveUrl(e){let t=this.resolve(e);if(typeof e!=`string`){let e={};for(let n in t)e[n]=t[n].src;return e}return t.src}resolve(e){let t=O(e);e=x(e);let n={};return e.forEach(e=>{if(!this._resolverHash[e])if(this._assetMap[e]){let t=this._assetMap[e],n=this._getPreferredOrder(t);n?.priority.forEach(e=>{n.params[e].forEach(n=>{let r=t.filter(t=>t[e]?t[e]===n:!1);r.length&&(t=r)})}),this._resolverHash[e]=t[0]}else this._resolverHash[e]=this._buildResolvedAsset({alias:[e],src:e},{});n[e]=this._resolverHash[e]}),t?n[e[0]]:n}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let n=e[t],r=this._preferredOrder.find(e=>e.params.format.includes(n.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){return this._defaultSearchParams?`${e}${/\?/.test(e)?`&`:`?`}${this._defaultSearchParams}`:e}_buildResolvedAsset(e,t){let{aliases:n,data:r,loadParser:i,parser:a,format:o,progressSize:s}=t;return(this._basePath||this._rootPath)&&(e.src=E.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=n??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=i??e.loadParser,e.parser=a??e.parser,e.format=o??e.format??fe(e.src),s!==void 0&&(e.progressSize=s),e}};k.RETINA_PREFIX=/@([0-9\.]+)x/;function fe(e){return e.split(`.`).pop().split(`?`).shift().split(`#`).shift()}var A=(e,t)=>{let n=t.split(`?`)[1];return n&&(e+=`?${n}`),e},j=class e{constructor(e,t){this.linkedSheets=[];let n=e;e?.source instanceof r&&(n={texture:e,data:t});let{texture:a,data:o,cachePrefix:s=``}=n;this.cachePrefix=s,this._texture=a instanceof i?a:null,this.textureSource=a.source,this.textures={},this.animations={},this.data=o;let c=parseFloat(o.meta.scale);c?(this.resolution=c,a.source.resolution=this.resolution):this.resolution=a.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=e.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,r=!1){let a=t,o=r?1/0:e.BATCH_SIZE;for(;a-t<o&&a<this._frameKeys.length;){let e=this._frameKeys[a],t=this._frames[e],r=t.frame;if(r){let a=null,o=null,s=t.trimmed!==!1&&t.sourceSize?t.sourceSize:t.frame,c=new n(0,0,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution);a=t.rotated?new n(Math.floor(r.x)/this.resolution,Math.floor(r.y)/this.resolution,Math.floor(r.h)/this.resolution,Math.floor(r.w)/this.resolution):new n(Math.floor(r.x)/this.resolution,Math.floor(r.y)/this.resolution,Math.floor(r.w)/this.resolution,Math.floor(r.h)/this.resolution),t.trimmed!==!1&&t.spriteSourceSize&&(o=new n(Math.floor(t.spriteSourceSize.x)/this.resolution,Math.floor(t.spriteSourceSize.y)/this.resolution,Math.floor(r.w)/this.resolution,Math.floor(r.h)/this.resolution)),this.textures[e]=new i({source:this.textureSource,frame:a,orig:c,trim:o,rotate:t.rotated?2:0,defaultAnchor:t.anchor,defaultBorders:t.borders,label:e.toString()})}a++}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let n=0;n<e[t].length;n++){let r=e[t][n];this.animations[t].push(this.textures[r])}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*e.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*e.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){for(let e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};j.BATCH_SIZE=1e3;var M=j,pe=[`jpg`,`png`,`jpeg`,`avif`,`webp`,`basis`,`etc2`,`bc7`,`bc6h`,`bc5`,`bc4`,`bc3`,`bc2`,`bc1`,`eac`,`astc`];function N(e,t,n){let r={};if(e.forEach(e=>{r[e]=t}),Object.keys(t.textures).forEach(e=>{r[`${t.cachePrefix}${e}`]=t.textures[e]}),!n){let n=E.dirname(e[0]);t.linkedSheets.forEach((e,i)=>{let a=N([`${n}/${t.data.meta.related_multi_packs[i]}`],e,!0);Object.assign(r,a)})}return r}var P={extension:m.Asset,cache:{test:e=>e instanceof M,getCacheableAssets:(e,t)=>N(e,t,!1)},resolver:{extension:{type:m.ResolveParser,name:`resolveSpritesheet`},test:e=>{let t=e.split(`?`)[0].split(`.`),n=t.pop(),r=t.pop();return n===`json`&&pe.includes(r)},parse:e=>{let t=e.split(`.`);return{resolution:parseFloat(k.RETINA_PREFIX.exec(e)?.[1]??`1`),format:t[t.length-2],src:e}}},loader:{name:`spritesheetLoader`,id:`spritesheet`,extension:{type:m.LoadParser,priority:C.Normal,name:`spritesheetLoader`},async testParse(e,t){return E.extname(t.src).toLowerCase()===`.json`&&!!e.frames},async parse(e,t,n){let{texture:r,imageFilename:a,textureOptions:o,cachePrefix:s}=t?.data??{},c=E.dirname(t.src);c&&c.lastIndexOf(`/`)!==c.length-1&&(c+=`/`);let l;if(r instanceof i)l=r;else{let r=A(c+(a??e.meta.image),t.src);l=(await n.load([{src:r,data:o}]))[r]}let u=new M({texture:l.source,data:e,cachePrefix:s});await u.parse();let d=e?.meta?.related_multi_packs;if(Array.isArray(d)){let e=[];for(let r of d){if(typeof r!=`string`)continue;let i=c+r;t.data?.ignoreMultiPack||(i=A(i,t.src),e.push(n.load({src:i,data:{textureOptions:o,ignoreMultiPack:!0}})))}let r=await Promise.all(e);u.linkedSheets=r,r.forEach(e=>{e.linkedSheets=[u].concat(u.linkedSheets.filter(t=>t!==e))})}return u},async unload(e,t,n){await n.unload(e.textureSource._sourceOrigin),e.destroy(!1)}}};c.add(P);var me=new t;function F(e,t,n){let r=me;e.measurable=!0,_(e,n,r),t.addBoundsMask(r),e.measurable=!1}function I(e,t,n){let r=ee.get();e.measurable=!0;let i=g.get().identity();ie(e,r,L(e,n,i)),e.measurable=!1,t.addBoundsMask(r),g.return(i),ee.return(r)}function L(e,t,n){return e?(e!==t&&(L(e.parent,t,n),e.updateLocalTransform(),n.append(e.localTransform)),n):(o(`Mask bounds, renderable is not inside the root container`),n)}var R=class{constructor(e){this.priority=0,this.inverse=!1,this.channel=`red`,this.pipe=`alphaMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof y),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,t){this.inverse||F(this.mask,e,t)}addLocalBounds(e,t){I(this.mask,e,t)}containsPoint(e,t){let n=this.mask;return t(n,e)}destroy(){this.reset()}static test(e){return e instanceof y}};R.extension=m.MaskEffect;var z=class{constructor(e){this.priority=0,this.pipe=`colorMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e==`number`}};z.extension=m.MaskEffect;var B=class{constructor(e){this.priority=0,this.pipe=`stencilMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,t){F(this.mask,e,t)}addLocalBounds(e,t){I(this.mask,e,t)}containsPoint(e,t){let n=this.mask;return t(n,e)}destroy(){this.reset()}static test(e){return e instanceof re}};B.extension=m.MaskEffect;var V;async function H(){return V??=(async()=>{let t=e.get().createCanvas(1,1).getContext(`webgl`);if(!t)return`premultiply-alpha-on-upload`;let n=await new Promise(e=>{let t=document.createElement(`video`);t.onloadeddata=()=>e(t),t.onerror=()=>e(null),t.autoplay=!1,t.crossOrigin=`anonymous`,t.preload=`auto`,t.src=`data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=`,t.load()});if(!n)return`premultiply-alpha-on-upload`;let r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);let i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n);let a=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,a),t.deleteFramebuffer(i),t.deleteTexture(r),t.getExtension(`WEBGL_lose_context`)?.loseContext(),a[0]<=a[3]?`premultiplied-alpha`:`premultiply-alpha-on-upload`})(),V}var U=class e extends r{constructor(t){super(t),this.isReady=!1,this.uploadMethodId=`video`,t={...e.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??`premultiply-alpha-on-upload`,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),this._onLoadedMetadata=this._onLoadedMetadata.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=b.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener(`play`,this._onPlayStart),e.addEventListener(`pause`,this._onPlayStop),e.addEventListener(`seeked`,this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener(`canplay`,this._onCanPlay),e.addEventListener(`canplaythrough`,this._onCanPlayThrough),e.addEventListener(`error`,this._onError,!0)),this.isValid||e.addEventListener(`loadedmetadata`,this._onLoadedMetadata),this.alphaMode=await H(),this._load=new Promise((n,r)=>{this.isValid?n(this):(this._resolve=n,this._reject=r,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener(`error`,this._onError,!0),this.emit(`error`,e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onLoadedMetadata(){this.isValid&&this._mediaReady()}_onCanPlay(){this.resource.removeEventListener(`canplay`,this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener(`canplaythrough`,this._onCanPlayThrough),this._preloadTimeout&&=(clearTimeout(this._preloadTimeout),void 0),this._mediaReady()}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&this.isValid&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener(`play`,this._onPlayStart),e.removeEventListener(`pause`,this._onPlayStop),e.removeEventListener(`seeked`,this._onSeeked),e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlayThrough),e.removeEventListener(`loadedmetadata`,this._onLoadedMetadata),e.removeEventListener(`error`,this._onError,!0),e.pause(),e.src=``,e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(b.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(b.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(b.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};U.extension=m.TextureSource,U.defaultOptions={...r.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},U.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`};var W=U,G=[];c.handleByList(m.TextureSource,G);function he(e={}){return K(e)}function K(e={}){let t=e&&e.resource,n=t?e.resource:e,r=t?e:{resource:e};for(let e=0;e<G.length;e++){let t=G[e];if(t.test(n))return new t(r)}throw Error(`Could not find a source type for resource: ${r.resource}`)}function q(e={},t=!1){let n=e&&e.resource,r=n?e.resource:e,a=n?e:{resource:e};if(!t&&S.has(r))return S.get(r);let o=new i({source:K(a)});return o.on(`destroy`,()=>{S.has(r)&&S.remove(r)}),t||S.set(r,o),o}function J(e,t=!1){return typeof e==`string`?S.get(e):e instanceof r?new i({source:e}):q(e,t)}i.from=J,r.from=K,c.add(R,z,B,W,ae,te,a);var Y=new d;function X(e,t){t.clear();let n=t.matrix;for(let n=0;n<e.length;n++){let r=e[n];if(r.globalDisplayStatus<7)continue;let i=r.renderGroup??r.parentRenderGroup;i?.isCachedAsTexture?t.matrix=Y.copyFrom(i.textureOffsetInverseTransform).append(r.worldTransform):i?._parentCacheAsTextureRenderGroup?t.matrix=Y.copyFrom(i._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(r.groupTransform):t.matrix=r.worldTransform,t.addBounds(r.bounds)}return t.matrix=n,t}var ge=new t;function _e(e,t,n,r,i=!1){let a=ge;a.minX=0,a.minY=0,a.maxX=e.width/r|0,a.maxY=e.height/r|0;let o=v.getOptimalTexture(a.width,a.height,r,!1,i);return o.source.uploadMethodId=`image`,o.source.resource=e,o.source.alphaMode=`premultiply-alpha-on-upload`,o.frame.width=t/r,o.frame.height=n/r,o.source.emit(`update`,o.source),o.updateUvs(),o}function Z(e){return typeof e.getCanvasFilterString==`function`}var ve=class{constructor(){this.skip=!1,this.useClip=!1,this.filters=null,this.container=null,this.bounds=new t,this.cssFilterString=``}},ye=class{constructor(e){this._filterStack=[],this._filterStackIndex=0,this._savedStates=[],this._alphaMultiplier=1,this._warnedFilterTypes=new Set,this.renderer=e}push(e){let t=this._pushFilterFrame(),n=e.filterEffect.filters;if(t.skip=!1,t.useClip=!1,t.filters=n,t.container=e.container,t.cssFilterString=``,n.every(e=>!e.enabled)){t.skip=!0;return}let r=[];for(let e of n){if(!e.enabled)continue;if(!Z(e)){this._warnUnsupportedFilter(e);continue}let t=e.getCanvasFilterString();if(t===null){this._warnUnsupportedFilter(e);continue}t&&r.push(t)}if(r.length===0){t.skip=!0;return}t.cssFilterString=r.join(` `),this._calculateFilterArea(e,t.bounds),t.useClip=!!e.filterEffect.filterArea;let i=this.renderer.canvasContext.activeContext,a=i.filter||`none`;if(this._savedStates.push({filter:a,alphaMultiplier:this._alphaMultiplier}),t.useClip&&Number.isFinite(t.bounds.width)&&Number.isFinite(t.bounds.height)&&t.bounds.width>0&&t.bounds.height>0){let e=this.renderer.canvasContext.activeResolution||1;i.save(),i.setTransform(1,0,0,1,0,0),i.beginPath(),i.rect(t.bounds.x*e,t.bounds.y*e,t.bounds.width*e,t.bounds.height*e),i.clip()}else t.useClip=!1;t.cssFilterString&&(i.filter=a===`none`?t.cssFilterString:`${a} ${t.cssFilterString}`)}pop(){let e=this._popFilterFrame();if(e.skip)return;let t=this._savedStates.pop();if(!t)return;let n=this.renderer.canvasContext.activeContext;e.useClip?n.restore():n.filter=t.filter,this._alphaMultiplier=t.alphaMultiplier}generateFilteredTexture({texture:e,filters:t}){if(!t?.length||t.every(e=>!e.enabled))return e;let n=[];for(let e of t){if(!e.enabled)continue;if(!Z(e)){this._warnUnsupportedFilter(e);continue}let t=e.getCanvasFilterString();if(t===null){this._warnUnsupportedFilter(e);continue}t&&n.push(t)}if(n.length===0)return e;let r=oe.getCanvasSource(e);if(!r)return e;let i=e.frame,a=e.source._resolution??e.source.resolution??1,o=i.width,s=i.height,{canvas:c,context:l}=se.getOptimalCanvasAndContext(o,s,a);l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,c.width,c.height),n.length&&(l.filter=n.join(` `));let u=i.x*a,d=i.y*a,f=o*a,p=s*a;return l.drawImage(r,u,d,f,p,0,0,f,p),l.filter=`none`,l.globalAlpha=1,_e(c,o,s,a)}_calculateFilterArea(e,t){if(e.renderables?X(e.renderables,t):e.filterEffect.filterArea?(t.clear(),t.addRect(e.filterEffect.filterArea),t.applyMatrix(e.container.worldTransform)):e.container.getFastGlobalBounds(!0,t),e.container){let n=(e.container.renderGroup||e.container.parentRenderGroup)?.cacheToLocalTransform;n&&t.applyMatrix(n)}}_warnUnsupportedFilter(e){let t=e?.constructor?.name||`Filter`;this._warnedFilterTypes.has(t)||(this._warnedFilterTypes.add(t),console.warn(`CanvasRenderer: filter "${t}" is not supported in Canvas2D and will be skipped.`))}get alphaMultiplier(){return this._alphaMultiplier}_pushFilterFrame(){let e=this._filterStack[this._filterStackIndex];return e||=this._filterStack[this._filterStackIndex]=new ve,this._filterStackIndex++,e}_popFilterFrame(){return this._filterStackIndex<=0?this._filterStack[0]:(this._filterStackIndex--,this._filterStack[this._filterStackIndex])}destroy(){this._filterStack=null,this._savedStates=null,this._warnedFilterTypes=null,this._alphaMultiplier=1}};ye.extension={type:[m.CanvasSystem],name:`filter`};var be=class{constructor(e){this._renderer=e}push(e,t,n){this._renderer.renderPipes.batch.break(n),n.add({renderPipeId:`filter`,canBundle:!1,action:`pushFilter`,container:t,filterEffect:e})}pop(e,t,n){this._renderer.renderPipes.batch.break(n),n.add({renderPipeId:`filter`,action:`popFilter`,canBundle:!1})}execute(e){e.action===`pushFilter`?this._renderer.filter.push(e):e.action===`popFilter`&&this._renderer.filter.pop()}destroy(){this._renderer=null}};be.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:`filter`};var xe=`in vec2 aPosition;
|
|
2
|
+
out vec2 vTextureCoord;
|
|
3
|
+
|
|
4
|
+
uniform vec4 uInputSize;
|
|
5
|
+
uniform vec4 uOutputFrame;
|
|
6
|
+
uniform vec4 uOutputTexture;
|
|
7
|
+
|
|
8
|
+
vec4 filterVertexPosition( void )
|
|
9
|
+
{
|
|
10
|
+
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
11
|
+
|
|
12
|
+
position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
|
|
13
|
+
position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;
|
|
14
|
+
|
|
15
|
+
return vec4(position, 0.0, 1.0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
vec2 filterTextureCoord( void )
|
|
19
|
+
{
|
|
20
|
+
return aPosition * (uOutputFrame.zw * uInputSize.zw);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
void main(void)
|
|
24
|
+
{
|
|
25
|
+
gl_Position = filterVertexPosition();
|
|
26
|
+
vTextureCoord = filterTextureCoord();
|
|
27
|
+
}
|
|
28
|
+
`,Se=`in vec2 vTextureCoord;
|
|
29
|
+
out vec4 finalColor;
|
|
30
|
+
uniform sampler2D uTexture;
|
|
31
|
+
void main() {
|
|
32
|
+
finalColor = texture(uTexture, vTextureCoord);
|
|
33
|
+
}
|
|
34
|
+
`,Q=`struct GlobalFilterUniforms {
|
|
35
|
+
uInputSize: vec4<f32>,
|
|
36
|
+
uInputPixel: vec4<f32>,
|
|
37
|
+
uInputClamp: vec4<f32>,
|
|
38
|
+
uOutputFrame: vec4<f32>,
|
|
39
|
+
uGlobalFrame: vec4<f32>,
|
|
40
|
+
uOutputTexture: vec4<f32>,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
@group(0) @binding(0) var <uniform> gfu: GlobalFilterUniforms;
|
|
44
|
+
@group(0) @binding(1) var uTexture: texture_2d<f32>;
|
|
45
|
+
@group(0) @binding(2) var uSampler: sampler;
|
|
46
|
+
|
|
47
|
+
struct VSOutput {
|
|
48
|
+
@builtin(position) position: vec4<f32>,
|
|
49
|
+
@location(0) uv: vec2<f32>
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
fn filterVertexPosition(aPosition: vec2<f32>) -> vec4<f32>
|
|
53
|
+
{
|
|
54
|
+
var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;
|
|
55
|
+
|
|
56
|
+
position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;
|
|
57
|
+
position.y = position.y * (2.0 * gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;
|
|
58
|
+
|
|
59
|
+
return vec4(position, 0.0, 1.0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
fn filterTextureCoord(aPosition: vec2<f32>) -> vec2<f32>
|
|
63
|
+
{
|
|
64
|
+
return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@vertex
|
|
68
|
+
fn mainVertex(
|
|
69
|
+
@location(0) aPosition: vec2<f32>,
|
|
70
|
+
) -> VSOutput {
|
|
71
|
+
return VSOutput(
|
|
72
|
+
filterVertexPosition(aPosition),
|
|
73
|
+
filterTextureCoord(aPosition)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@fragment
|
|
78
|
+
fn mainFragment(
|
|
79
|
+
@location(0) uv: vec2<f32>,
|
|
80
|
+
) -> @location(0) vec4<f32> {
|
|
81
|
+
return textureSample(uTexture, uSampler, uv);
|
|
82
|
+
}
|
|
83
|
+
`,Ce=class extends ne{constructor(){let e=u.from({vertex:{source:Q,entryPoint:`mainVertex`},fragment:{source:Q,entryPoint:`mainFragment`},name:`passthrough-filter`}),t=h.from({vertex:xe,fragment:Se,name:`passthrough-filter`});super({gpuProgram:e,glProgram:t})}},we=new p({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:`float32x2`,stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),Te=class{constructor(){this.skip=!1,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new t,this.container=null,this.blendRequired=!1,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0},this.firstEnabledIndex=-1,this.lastEnabledIndex=-1}},$=class{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new f({uInputSize:{value:new Float32Array(4),type:`vec4<f32>`},uInputPixel:{value:new Float32Array(4),type:`vec4<f32>`},uInputClamp:{value:new Float32Array(4),type:`vec4<f32>`},uOutputFrame:{value:new Float32Array(4),type:`vec4<f32>`},uGlobalFrame:{value:new Float32Array(4),type:`vec4<f32>`},uOutputTexture:{value:new Float32Array(4),type:`vec4<f32>`}}),this._globalFilterBindGroup=new l({}),this.renderer=e}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){let t=this.renderer,n=e.filterEffect.filters,r=this._pushFilterData();r.skip=!1,r.filters=n,r.container=e.container,r.outputRenderSurface=t.renderTarget.renderSurface;let i=t.renderTarget.renderTarget.colorTexture.source,a=i.resolution,o=i.antialias;if(n.every(e=>!e.enabled)){r.skip=!0;return}let s=r.bounds;if(this._calculateFilterArea(e,s),this._calculateFilterBounds(r,t.renderTarget.rootViewPort,o,a,1),r.skip)return;let c=this._getPreviousFilterData(),l=this._findFilterResolution(a),u=0,d=0;c&&(u=c.bounds.minX,d=c.bounds.minY),this._calculateGlobalFrame(r,u,d,l,i.width,i.height),this._setupFilterTextures(r,s,t,c)}generateFilteredTexture({texture:e,filters:t}){let n=this._pushFilterData();this._activeFilterData=n,n.skip=!1,n.filters=t;let r=e.source,a=r.resolution,o=r.antialias;if(t.every(e=>!e.enabled))return n.skip=!0,e;let s=n.bounds;if(s.addRect(e.frame),this._calculateFilterBounds(n,s.rectangle,o,a,0),n.skip)return e;let c=a;this._calculateGlobalFrame(n,0,0,c,r.width,r.height),n.outputRenderSurface=v.getOptimalTexture(s.width,s.height,n.resolution,n.antialias),n.backTexture=i.EMPTY,n.inputTexture=e,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(n,!0);let l=n.outputRenderSurface;return l.source.alphaMode=`premultiplied-alpha`,l}pop(){let e=this.renderer,t=this._popFilterData();t.skip||(e.globalUniforms.pop(),e.renderTarget.finishRenderPass(),this._activeFilterData=t,this._applyFiltersToTexture(t,!1),t.blendRequired&&v.returnTexture(t.backTexture),v.returnTexture(t.inputTexture))}getBackTexture(e,t,n){let r=e.colorTexture.source._resolution,i=v.getOptimalTexture(t.width,t.height,r,!1),a=t.minX,o=t.minY;n&&(a-=n.minX,o-=n.minY),a=Math.floor(a*r),o=Math.floor(o*r);let s=Math.ceil(t.width*r),c=Math.ceil(t.height*r);return this.renderer.renderTarget.copyToTexture(e,i,{x:a,y:o},{width:s,height:c},{x:0,y:0}),i}applyFilter(e,t,n,r){let i=this.renderer,a=this._activeFilterData,o=a.outputRenderSurface===n,s=i.renderTarget.rootRenderTarget.colorTexture.source._resolution,c=this._findFilterResolution(s),l=0,u=0;if(o){let e=this._findPreviousFilterOffset();l=e.x,u=e.y}this._updateFilterUniforms(t,n,a,l,u,c,o,r);let d=e.enabled?e:this._getPassthroughFilter();this._setupBindGroupsAndRender(d,t,i)}calculateSpriteMatrix(e,t){let n=this._activeFilterData,r=e.set(n.inputTexture._source.width,0,0,n.inputTexture._source.height,n.bounds.minX,n.bounds.minY),i=t.worldTransform.copyTo(d.shared),a=t.renderGroup||t.parentRenderGroup;return a&&a.cacheToLocalTransform&&i.prepend(a.cacheToLocalTransform),i.invert(),r.prepend(i),r.scale(1/t.texture.orig.width,1/t.texture.orig.height),r.translate(t.anchor.x,t.anchor.y),r}destroy(){this._passthroughFilter?.destroy(!0),this._passthroughFilter=null}_getPassthroughFilter(){return this._passthroughFilter??=new Ce,this._passthroughFilter}_setupBindGroupsAndRender(e,t,n){if(n.renderPipes.uniformBatch){let e=n.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(e,0)}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,n.encoder.draw({geometry:we,shader:e,state:e._state,topology:`triangle-list`}),n.type===s.WEBGL&&n.renderTarget.finishRenderPass()}_setupFilterTextures(e,t,n,r){if(e.backTexture=i.EMPTY,e.inputTexture=v.getOptimalTexture(t.width,t.height,e.resolution,e.antialias),e.blendRequired){n.renderTarget.finishRenderPass();let i=n.renderTarget.getRenderTarget(e.outputRenderSurface);e.backTexture=this.getBackTexture(i,t,r?.bounds)}n.renderTarget.bind(e.inputTexture,!0),n.globalUniforms.push({offset:t})}_calculateGlobalFrame(e,t,n,r,i,a){let o=e.globalFrame;o.x=t*r,o.y=n*r,o.width=i*r,o.height=a*r}_updateFilterUniforms(e,t,n,r,a,o,s,c){let l=this._filterGlobalUniforms.uniforms,u=l.uOutputFrame,d=l.uInputSize,f=l.uInputPixel,p=l.uInputClamp,m=l.uGlobalFrame,h=l.uOutputTexture;s?(u[0]=n.bounds.minX-r,u[1]=n.bounds.minY-a):(u[0]=0,u[1]=0),u[2]=e.frame.width,u[3]=e.frame.height,d[0]=e.source.width,d[1]=e.source.height,d[2]=1/d[0],d[3]=1/d[1],f[0]=e.source.pixelWidth,f[1]=e.source.pixelHeight,f[2]=1/f[0],f[3]=1/f[1],p[0]=.5*f[2],p[1]=.5*f[3],p[2]=e.frame.width*d[2]-.5*f[2],p[3]=e.frame.height*d[3]-.5*f[3];let g=this.renderer.renderTarget.rootRenderTarget.colorTexture;m[0]=r*o,m[1]=a*o,m[2]=g.source.width*o,m[3]=g.source.height*o,t instanceof i&&(t.source.resource=null);let _=this.renderer.renderTarget.getRenderTarget(t);this.renderer.renderTarget.bind(t,!!c),t instanceof i?(h[0]=t.frame.width,h[1]=t.frame.height):(h[0]=_.width,h[1]=_.height),h[2]=_.isRoot?-1:1,this._filterGlobalUniforms.update()}_findFilterResolution(e){let t=this._filterStackIndex-1;for(;t>0&&this._filterStack[t].skip;)--t;return t>0&&this._filterStack[t].inputTexture?this._filterStack[t].inputTexture.source._resolution:e}_findPreviousFilterOffset(){let e=0,t=0,n=this._filterStackIndex;for(;n>0;){n--;let r=this._filterStack[n];if(!r.skip){e=r.bounds.minX,t=r.bounds.minY;break}}return{x:e,y:t}}_calculateFilterArea(e,t){if(e.renderables?X(e.renderables,t):e.filterEffect.filterArea?(t.clear(),t.addRect(e.filterEffect.filterArea),t.applyMatrix(e.container.worldTransform)):e.container.getFastGlobalBounds(!0,t),e.container){let n=(e.container.renderGroup||e.container.parentRenderGroup).cacheToLocalTransform;n&&t.applyMatrix(n)}}_applyFiltersToTexture(e,t){let n=e.inputTexture,r=e.bounds,i=e.filters,a=e.firstEnabledIndex,o=e.lastEnabledIndex;if(this._globalFilterBindGroup.setResource(n.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),a===o)i[a].apply(this,n,e.outputRenderSurface,t);else{let n=e.inputTexture,s=v.getOptimalTexture(r.width,r.height,n.source._resolution,!1),c=s;for(let e=a;e<o;e++){let t=i[e];if(!t.enabled)continue;t.apply(this,n,c,!0);let r=n;n=c,c=r}i[o].apply(this,n,e.outputRenderSurface,t),v.returnTexture(s)}}_calculateFilterBounds(e,t,n,r,i){let a=this.renderer,s=e.bounds,c=e.filters,l=1/0,u=0,d=!0,f=!1,p=!1,m=!0,h=-1,g=-1;for(let e=0;e<c.length;e++){let t=c[e];if(t.enabled){if(h===-1&&(h=e),g=e,l=Math.min(l,t.resolution===`inherit`?r:t.resolution),u+=t.padding,t.antialias===`off`?d=!1:t.antialias===`inherit`&&(d&&=n),t.clipToViewport||(m=!1),!(t.compatibleRenderers&a.type)){p=!1;break}if(t.blendRequired&&!(a.backBuffer?.useBackBuffer??!0)){o("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),p=!1;break}p=!0,f||=t.blendRequired}}if(!p){e.skip=!0;return}if(m&&s.fitBounds(0,t.width/r,0,t.height/r),s.scale(l).ceil().scale(1/l).pad((u|0)*i),!s.isPositive){e.skip=!0;return}e.antialias=d,e.resolution=l,e.blendRequired=f,e.firstEnabledIndex=h,e.lastEnabledIndex=g}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let e,t=this._filterStackIndex-1;for(;t>0&&(t--,e=this._filterStack[t],e.skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||=this._filterStack[this._filterStackIndex]=new Te,this._filterStackIndex++,e}};$.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:`filter`};export{A as C,de as D,O as E,E as O,M as S,fe as T,z as _,xe as a,F as b,Z as c,he as d,q as f,B as g,H as h,Se as i,C as k,_e as l,W as m,Ce as n,be as o,J as p,Q as r,ye as s,$ as t,X as u,R as v,k as w,P as x,I as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./CYTTTma0.js";import{t as e}from"./
|
|
1
|
+
import"./CYTTTma0.js";import{t as e}from"./B4cFqqUS.js";import{C as t,D as n,E as r,M as i,O as a,S as o,T as s,_ as c,b as l,d as u,k as d,r as f,t as p,u as m,v as h,w as g,x as _,y as v}from"./BQULA6er.js";var y=3e4,b=class extends i{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=h();this.getLocalState()!==null&&3e4/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&x(this,t,`timeout`)},d(y/10)),e.on(`destroy`,()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit(`destroy`,[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:h()});let a=[],o=[],s=[],l=[];e===null?l.push(t):i==null?e!=null&&a.push(t):(o.push(t),c(i,e)||s.push(t)),(a.length>0||s.length>0||l.length>0)&&this.emit(`change`,[{added:a,updated:s,removed:l},`local`]),this.emit(`update`,[{added:a,updated:o,removed:l},`local`])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},x=(e,t,n)=>{let r=[];for(let n=0;n<t.length;n++){let i=t[n];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){let t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:h()})}r.push(i)}}r.length>0&&(e.emit(`change`,[{added:[],updated:[],removed:r},n]),e.emit(`update`,[{added:[],updated:[],removed:r},n]))},S=(e,i,a=e.states)=>{let o=i.length,c=t();n(c,o);for(let t=0;t<o;t++){let o=i[t],s=a.get(o)||null,l=e.meta.get(o).clock;n(c,o),n(c,l),r(c,JSON.stringify(s))}return s(c)},C=(e,t,n)=>{let r=v(t),i=h(),a=[],o=[],s=[],u=[],d=_(r);for(let t=0;t<d;t++){let t=_(r),n=_(r),d=JSON.parse(l(r)),f=e.meta.get(t),p=e.states.get(t),m=f===void 0?0:f.clock;(m<n||m===n&&d===null&&e.states.has(t))&&(d===null?t===e.clientID&&e.getLocalState()!=null?n++:e.states.delete(t):e.states.set(t,d),e.meta.set(t,{clock:n,lastUpdated:i}),f===void 0&&d!==null?a.push(t):f!==void 0&&d===null?u.push(t):d!==null&&(c(d,p)||s.push(t),o.push(t)))}(a.length>0||s.length>0||u.length>0)&&e.emit(`change`,[{added:a,updated:s,removed:u},n]),(a.length>0||o.length>0||u.length>0)&&e.emit(`update`,[{added:a,updated:o,removed:u},n])},w=(e,t)=>{n(e,0),a(e,u(t))},T=(e,t,r)=>{n(e,1),a(e,m(t,r))},E=(e,t,n)=>T(t,n,o(e)),D=(e,t,n,r)=>{try{f(t,o(e),n)}catch(e){r?.(e),console.error(`Caught error while handling a Yjs update`,e)}},O=(e,t)=>{n(e,2),a(e,t)},k=D,A=(e,t,n,r,i)=>{let a=_(e);switch(a){case 0:E(e,t,n);break;case 1:D(e,n,r,i);break;case 2:k(e,n,r,i);break;default:throw Error(`Unknown message type`)}return a},j=0,M=1,N=2,P=3e4;function F(e,t,n){let r=new TextEncoder().encode(e),i=new ArrayBuffer(2+r.length+1+n.length);return new DataView(i).setUint16(0,r.length),new Uint8Array(i,2,r.length).set(r),new Uint8Array(i)[2+r.length]=t,new Uint8Array(i,2+r.length+1).set(n),i}function I(e){if(e.byteLength<3)return null;let t=new DataView(e).getUint16(0);return e.byteLength<2+t+1?null:{docName:new TextDecoder().decode(new Uint8Array(e,2,t)),msgType:new Uint8Array(e)[2+t],payload:new Uint8Array(e,2+t+1)}}function L(n,r,i){let a=new p,o=a.getText(`content`),c=new b(a);c.setLocalStateField(`user`,{name:r.name,color:r.color,colorLight:r.colorLight??r.color+`33`});let l=null,u=!1,d=!1,f=null,m=!1,h=new Map;function _(){if(!d&&f!==null&&o.length===f){d=!0,H.synced=!0;try{i?.onSync?.()}catch{}}}function y(){return e.ws??null}function T(e,t){let r=y();!r||r.readyState!==WebSocket.OPEN||r.send(F(n,e,t))}function E(){let e=t();w(e,a),T(j,s(e))}function D(e){T(M,S(c,e??[a.clientID]))}function k(e,n){if(e===j){let e=v(n),r=t();A(e,r,a,`ws-server`),g(r)>0&&T(j,s(r)),_()}else e===M&&C(c,n,`ws-server`)}function L(e){if(e.length<9)return;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=e[0].toString(16).padStart(2,`0`)+e[1].toString(16).padStart(2,`0`)+e[2].toString(16).padStart(2,`0`)+e[3].toString(16).padStart(2,`0`),r=t.getUint16(4),i=t.getUint16(6),a=e[8],o=e.slice(9),s=Date.now();for(let[e,t]of h)t.expiresAt<s&&h.delete(e);let c=h.get(n);if(!c){if(i===0)return;c={total:i,origMsgType:a,received:Array(i),receivedCount:0,expiresAt:s+P},h.set(n,c)}if(r>=c.total||c.received[r]||(c.received[r]=o,c.receivedCount++,c.receivedCount!==c.total))return;h.delete(n);let l=0;for(let e of c.received)l+=e?.length??0;let u=new Uint8Array(l),d=0;for(let e of c.received){if(!e)return;u.set(e,d),d+=e.length}k(c.origMsgType,u)}function R(e){if(u)return;if(typeof e.data==`string`){try{let t=JSON.parse(e.data);t?.docName===n&&(t.type===`doc_ready`&&typeof t.expectedLength==`number`?(f=t.expectedLength,_()):t.type===`collab:joined`&&!m&&(m=!0,E(),D()))}catch{}return}let t=e.data instanceof ArrayBuffer?e.data:null;if(!t)return;let r=I(t);!r||r.docName!==n||(r.msgType===N?L(r.payload):k(r.msgType,r.payload))}function z(e,n){if(u||n===`ws-server`||!m)return;let r=t();O(r,e),T(j,s(r))}function B({added:e,updated:t,removed:n},r){u||r===`ws-server`||m&&D(e.concat(t,n))}function V(){if(u)return;let e=y();!e||e.readyState!==WebSocket.OPEN||(m=!1,l&&e.removeEventListener(`message`,l),l=R,e.addEventListener(`message`,l),e.send(JSON.stringify({type:`collab:join`,docName:n})))}let H={ydoc:a,ytext:o,awareness:c,synced:!1,destroy:U};a.on(`update`,z),c.on(`update`,B),V(),e.addConnectHandler(V);function U(){if(u)return;u=!0,x(c,[a.clientID],`local`),D([a.clientID]);let e=y();e&&e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:`collab:leave`,docName:n})),l&&e&&(e.removeEventListener(`message`,l),l=null),a.off(`update`,z),c.off(`update`,B),c.destroy(),a.destroy(),h.clear()}return H}export{L as createCollabSession};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./B4cFqqUS.js","./CYTTTma0.js","./VQbAelHN.js","./CUPSJObs.js","./BYokDzwE.js","./xihTtKlq.js","./BR6jMpLB.js","./7-y0CE1z.js","./DA-BuZei.js","./DoQwt-f9.js","./D83_Ss42.js","../assets/realtime.DDCWxn3B.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{B as e,Ft as t,Ht as n,I as r,M as i,O as a,P as o,Pt as s,R as c,U as l,Vt as u,Z as d,ct as f,gt as p,ht as m,j as h,mt as g,pt as _,qt as v,st as y,t as b,wt as x,x as S,xt as C,yt as w,z as T}from"./CYTTTma0.js";import"./xihTtKlq.js";import{j as E}from"./CUPSJObs.js";import{s as D}from"./7-y0CE1z.js";import{a as ee,c as O,i as te,l as k,n as A,r as ne,t as re,u as ie}from"./Cei8CKT4.js";import{t as j}from"./DAXW5iLp.js";import"./0iDDDyaZ.js";import{t as M}from"./B8-Lm86o2.js";import{t as N}from"./DVcy5Pp82.js";import{t as P}from"./DiMQob8p.js";function F(){return E(`/api/permissions/folders`)}function I(){typeof window>`u`||window.dispatchEvent(new CustomEvent(`sg:folder-membership-changed`))}async function L(e,t,n=`editor`){let r=await E(`/api/permissions/grant`,{method:`POST`,body:JSON.stringify({userId:e,folder:t,role:n})});return I(),r}async function R(e,t){let n=await E(`/api/permissions/revoke`,{method:`POST`,body:JSON.stringify({userId:e,folder:t})});return I(),n}var z=v({default:()=>G}),ae=e(`<div class="fm-hint svelte-vz89pt">Loading…</div>`),oe=e(`<div class="fm-row fm-confirm svelte-vz89pt"><!> <span class="fm-confirm-text svelte-vz89pt"> </span> <div class="fm-actions svelte-vz89pt"><!> <!></div></div>`),se=e(` <!>`,1),ce=e(`<span class="role-check"><!></span>`),B=e(`<span>Admin</span> <!>`,1),V=e(`<span class="role-check"><!></span>`),H=e(`<span>Editor</span> <!>`,1),U=e(`<!> <!>`,1),W=e(`<!> <!>`,1),le=e(`<span class="fm-role-label svelte-vz89pt"> </span>`),ue=e(`<span class="fm-trash-placeholder svelte-vz89pt" aria-hidden="true"></span>`),de=e(`<div class="fm-row svelte-vz89pt"><span class="fm-avatar svelte-vz89pt"> </span> <span class="fm-name svelte-vz89pt"> </span> <span class="fm-flex svelte-vz89pt"></span> <!> <!></div>`),fe=e(`<div class="fm-row fm-candidate svelte-vz89pt"><span class="fm-avatar svelte-vz89pt"> </span> <span class="fm-name fm-name-muted svelte-vz89pt"> </span> <span class="fm-flex svelte-vz89pt"></span> <!></div>`),pe=e(`<div class="fm-sublabel svelte-vz89pt">Add members</div> <!>`,1),me=e(`<!> <!>`,1),he=e(`<div class="folder-members svelte-vz89pt"><div class="fm-header svelte-vz89pt"><span class="fm-label svelte-vz89pt">Members</span></div> <!></div>`);function G(e,v){t(v,!0);let E=v.initialMembers!==void 0&&v.initialUsers!==void 0,I=C(p(v.initialMembers?[...v.initialMembers]:[])),z=C(p(v.initialUsers?[...v.initialUsers]:[])),G=C(!E),K=C(null),q=C(!1);f(()=>{E||ge(v.folder)});async function ge(e){w(G,!0);try{let[{users:t},n]=await Promise.all([D(),F()]);w(z,t,!0),w(I,n.find(t=>t.folder===e)?.members??[],!0)}finally{w(G,!1)}}let J=x(()=>{let e=new Set(d(I).map(e=>e.user.id));return d(z).filter(t=>!e.has(t.id))}),_e=x(()=>d(I).filter(e=>e.role===`admin`).length);function Y(e){return v.canEdit?!(e.role===`admin`&&d(_e)===1):!1}function X(e){w(I,e,!0),v.onMembersChanged?.(e)}async function Z(e){let{toast:t}=await b(async()=>{let{toast:e}=await import(`./B4cFqqUS.js`).then(e=>e.a);return{toast:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);t.error(e)}async function Q(e,t){let n=d(I).find(t=>t.user.id===e);if(!n||n.role===t)return;let r=n.role;X(d(I).map(n=>n.user.id===e?{...n,role:t}:n));try{await L(e,v.folder,t)}catch(t){X(d(I).map(t=>t.user.id===e?{...t,role:r}:t)),Z(t.message||`Failed to update role`)}}async function ve(e){X([...d(I),{user:e,role:`editor`}].sort((e,t)=>e.user.displayName.localeCompare(t.user.displayName)));try{await L(e.id,v.folder,`editor`)}catch(t){X(d(I).filter(t=>t.user.id!==e.id)),Z(t.message||`Failed to add member`)}}async function ye(){if(!d(K))return;w(q,!0);let e=d(K),t=d(I);X(d(I).filter(t=>t.user.id!==e.id)),w(K,null);try{await R(e.id,v.folder)}catch(e){X(t),Z(e.message||`Failed to remove member`)}finally{w(q,!1)}}var $=he(),be=m(_($),2),xe=e=>{c(e,ae())},Se=e=>{var t=me(),s=g(t);h(s,17,()=>d(I),i,(e,t)=>{let i=x(()=>M.getColor(d(t).user.id));var s=T(),f=g(s),p=e=>{var i=oe(),a=_(i);P(a,{size:16});var o=m(a,2),s=_(o);n(o);var f=m(o,2),p=_(f);j(p,{variant:`ghost`,onclick:()=>{w(K,null)},get disabled(){return d(q)},children:(e,t)=>{u(),c(e,l(`Cancel`))},$$slots:{default:!0}}),j(m(p,2),{variant:`destructive`,onclick:ye,get disabled(){return d(q)},children:(e,t)=>{u(),c(e,l(`Remove`))},$$slots:{default:!0}}),n(f),n(i),y(()=>r(s,`Remove ${d(t).user.displayName??``}?`)),c(e,i)},h=e=>{var s=de(),l=_(s);let f;var p=_(l,!0);n(l);var h=m(l,2),v=_(h,!0);n(h);var b=m(h,4),C=e=>{var i=T();a(g(i),()=>te,(e,i)=>{i(e,{children:(e,i)=>{var s=W(),l=g(s);a(l,()=>ee,(e,n)=>{n(e,{class:`role-chip`,"aria-label":`Change role`,children:(e,n)=>{u();var i=se(),a=g(i);re(m(a),{size:10}),y(()=>r(a,`${d(t).role===`admin`?`Admin`:`Editor`} `)),c(e,i)},$$slots:{default:!0}})}),a(m(l,2),()=>ne,(e,r)=>{r(e,{children:(e,r)=>{var i=T();a(g(i),()=>k,(e,r)=>{r(e,{align:`start`,children:(e,r)=>{var i=U(),s=g(i);a(s,()=>O,(e,r)=>{r(e,{onSelect:()=>Q(d(t).user.id,`admin`),children:(e,r)=>{var i=B(),a=m(g(i),2),s=e=>{var t=ce();A(_(t),{size:14}),n(t),c(e,t)};o(a,e=>{d(t).role===`admin`&&e(s)}),c(e,i)},$$slots:{default:!0}})}),a(m(s,2),()=>O,(e,r)=>{r(e,{onSelect:()=>Q(d(t).user.id,`editor`),children:(e,r)=>{var i=H(),a=m(g(i),2),s=e=>{var t=V();A(_(t),{size:14}),n(t),c(e,t)};o(a,e=>{d(t).role===`editor`&&e(s)}),c(e,i)},$$slots:{default:!0}})}),c(e,i)},$$slots:{default:!0}})}),c(e,i)},$$slots:{default:!0}})}),c(e,s)},$$slots:{default:!0}})}),c(e,i)},E=x(()=>Y(d(t))),D=e=>{var i=le(),a=_(i,!0);n(i),y(()=>r(a,d(t).role===`admin`?`Admin`:`Editor`)),c(e,i)};o(b,e=>{d(E)?e(C):e(D,-1)});var M=m(b,2),N=e=>{j(e,{variant:`ghost`,size:`icon`,class:`icon-danger`,title:`Remove`,onclick:()=>{w(K,d(t).user,!0)},children:(e,t)=>{ie(e,{})},$$slots:{default:!0}})},P=x(()=>Y(d(t))),F=e=>{c(e,ue())};o(M,e=>{d(P)?e(N):e(F,-1)}),n(s),y(e=>{f=S(l,``,f,{background:d(i)||void 0}),r(p,e),r(v,d(t).user.displayName)},[()=>(d(t).user.displayName||d(t).user.email)[0].toUpperCase()]),c(e,s)};o(f,e=>{d(K)?.id===d(t).user.id?e(p):e(h,-1)}),c(e,s)});var f=m(s,2),p=e=>{var t=pe();h(m(g(t),2),17,()=>d(J),i,(e,t)=>{let i=x(()=>M.getColor(d(t).id));var a=fe(),o=_(a);let s;var l=_(o,!0);n(o);var u=m(o,2),f=_(u,!0);n(u),j(m(u,4),{variant:`ghost`,size:`icon`,title:`Add as editor`,onclick:()=>ve(d(t)),children:(e,t)=>{N(e,{})},$$slots:{default:!0}}),n(a),y(e=>{s=S(o,``,s,{background:d(i)||void 0}),r(l,e),r(f,d(t).displayName)},[()=>(d(t).displayName||d(t).email)[0].toUpperCase()]),c(e,a)}),c(e,t)};o(f,e=>{v.canEdit&&d(J).length>0&&e(p)}),c(e,t)};o(be,e=>{d(G)?e(xe):e(Se,-1)}),n($),c(e,$),s()}export{R as a,L as i,z as n,F as r,G as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Z as e,_t as t,bt as n,tt as r,xt as i,yt as a}from"./CYTTTma0.js";var o=class extends Map{#e=new Map;#t=i(0);#n=i(0);#r=r||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return r===this.#r?i(e):n(e)}has(t){var n=this.#e,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),n.set(t,r);else return e(this.#t),!1;return e(r),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(t){var n=this.#e,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),n.set(t,r);else{e(this.#t);return}return e(r),super.get(t)}set(e,n){var r=this.#e,i=r.get(e),o=super.get(e),s=super.set(e,n),c=this.#t;if(i===void 0)i=this.#i(0),r.set(e,i),a(this.#n,super.size),t(c);else if(o!==n){t(i);var l=c.reactions===null?null:new Set(c.reactions);(l===null||!i.reactions?.every(e=>l.has(e)))&&t(c)}return s}delete(e){var n=this.#e,r=n.get(e),i=super.delete(e);return r!==void 0&&(n.delete(e),a(r,-1)),i&&(a(this.#n,super.size),t(this.#t)),i}clear(){if(super.size!==0){super.clear();var e=this.#e;a(this.#n,0);for(var n of e.values())a(n,-1);t(this.#t),e.clear()}}#a(){e(this.#t);var t=this.#e;if(this.#n.v!==t.size){for(var n of super.keys())if(!t.has(n)){var r=this.#i(0);t.set(n,r)}}for([,r]of this.#e)e(r)}keys(){return e(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return e(this.#n),super.size}};export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,Ft as t,G as n,Ht as r,I as i,P as a,Pt as o,R as s,S as c,U as l,V as u,Vt as d,W as f,X as p,Z as m,_ as h,at as g,d as _,o as v,ot as y,pt as b,s as x,st as S,vt as C,wt as w,x as T,xt as E,y as D,yt as O}from"./CYTTTma0.js";import"./xihTtKlq.js";import{j as k}from"./CUPSJObs.js";import"./BR6jMpLB.js";import{t as A}from"./B8-Lm86o2.js";import{o as j}from"./Czwe4sGU2.js";var M=u(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0 C12 7.5 7.5 12 0 12 C7.5 12 12 16.5 12 24 C12 16.5 16.5 12 24 12 C16.5 12 12 7.5 12 0 Z"></path></svg>`);function N(e,t){let n=x(t,`size`,3,16);var r=M();S(()=>{D(r,`width`,n()),D(r,`height`,n()),D(r,`aria-hidden`,t.title?void 0:!0),D(r,`role`,t.title?`img`:void 0),D(r,`aria-label`,t.title)}),s(e,r)}var P=e(`<span><!></span>`);function F(e,n){t(n,!0);let u=x(n,`agent`,3,!1),d=x(n,`size`,3,`md`),f=x(n,`class`,3,``),p=w(()=>{if(n.userId!==void 0&&n.userId!==null)return A.getColor(n.userId);if(u())return`var(--color-agent)`}),h=w(()=>n.text??(n.name?.[0]??`?`).toUpperCase()),g=w(()=>d()===`sm`?9:11);var _=P();let v,y;var C=b(_),E=e=>{N(e,{get size(){return m(g)}})},O=e=>{var t=l();S(()=>i(t,m(h))),s(e,t)};a(C,e=>{u()?e(E):e(O,-1)}),r(_),S(()=>{v=c(_,1,`sg-avatar sg-avatar-${d()??``} ${f()??``}`,`svelte-8w5802`,v,{"sg-avatar-agent":u()}),D(_,`title`,n.title),y=T(_,``,y,{background:m(p)})}),s(e,_),o()}var I=e(`<div></div>`);function L(e,r){t(r,!0);let i=E(!1),a=0;function l(e){e.preventDefault(),O(i,!0),a=e.clientX,r.onresizestart?.(),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,window.addEventListener(`mousemove`,u),window.addEventListener(`mouseup`,d)}function u(e){let t=r.side===`right`?e.clientX-a:a-e.clientX;a=e.clientX,r.onresize(t)}function d(){O(i,!1),document.body.style.cursor=``,document.body.style.userSelect=``,window.removeEventListener(`mousemove`,u),window.removeEventListener(`mouseup`,d)}var f=I();let p;S(()=>p=c(f,1,`resize-handle svelte-tfh9g9`,null,p,{left:r.side===`left`,right:r.side===`right`,active:m(i)})),n(`mousedown`,f,l),n(`dblclick`,f,function(...e){r.ondblclick?.apply(this,e)}),s(e,f),o()}f([`mousedown`,`dblclick`]);async function R(e){return k(`/api/notifications${e?.unreadOnly?`?unreadOnly=true`:``}`)}async function z(e){await k(`/api/notifications/${e}/read`,{method:`POST`})}async function B(){await k(`/api/notifications/read-all`,{method:`POST`})}async function V(){let{users:e}=await k(`/api/auth/users`);return e}function H(e,t,n={}){let{typographic:r=!0}=n,i=new Set([`agent`]);for(let e of t)i.add(e);return(r?j(e):e).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/\n/g,`<br>`).replace(/@([a-z0-9_-]+)/gi,(e,t)=>i.has(t.toLowerCase())?`<span class="sg-mention">${e}</span>`:e)}function U(e,t){let n=new Set([`agent`]);for(let e of t)n.add(e);let r=0;return e.replace(/(<[^>]+>)|([^<]+)/g,(e,t,i)=>t?(/^<(code|pre|a)[\s/>]/i.test(t)?r++:/^<\/(code|pre|a)>/i.test(t)&&(r=Math.max(0,r-1)),t):!i||r>0?i??``:i.replace(/@([a-z0-9_-]+)/gi,(e,t)=>n.has(t.toLowerCase())?`<span class="sg-mention">${e}</span>`:e))}var W=u(`<title> </title>`),G=u(`<svg><!><path d="M24,6H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path></svg>`);function K(e,n){let c=v(n,[`children`,`$$slots`,`$$events`,`$$legacy`]),l=v(c,[`size`,`title`]);t(n,!1);let u=C(),f=C(),w=x(n,`size`,8,16),T=x(n,`title`,8,void 0);g(()=>(p(c),p(T())),()=>{O(u,c[`aria-label`]||c[`aria-labelledby`]||T())}),g(()=>(m(u),p(c)),()=>{O(f,{"aria-hidden":m(u)?void 0:!0,role:m(u)?`img`:void 0,focusable:Number(c.tabindex)===0?!0:void 0})}),y(),_();var E=G();h(E,()=>({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`,width:w(),height:w(),...m(f),...l}));var D=b(E),k=e=>{var t=W(),n=b(t,!0);r(t),S(()=>i(n,T())),s(e,t)};a(D,e=>{T()&&e(k)}),d(),r(E),s(e,E),o()}export{R as a,L as c,V as i,F as l,U as n,B as o,H as r,z as s,K as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{WebGPURenderer as e}from"./h4WWBpcD2.js";export{e as WebGPURenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./
|
|
2
|
-
import{B as e,Ft as t,G as n,Ht as r,I as i,K as a,M as o,Mt as s,P as c,Pt as l,R as u,S as d,St as f,W as p,Z as m,ct as h,f as g,ht as _,i as v,j as ee,m as y,pt as b,r as te,s as ne,st as re,t as ie,v as ae,wt as x,x as oe,xt as S,yt as C}from"./CYTTTma0.js";import{r as se}from"./DUwgGBxa.js";import"./xihTtKlq.js";import"./D_HVOuHV.js";import{a as ce,r as w}from"./zl16E4yc2.js";function le(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return T(this.cover(t,n),t,n,e)}function T(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function ue(e){var t,n,r=e.length,i,a,o=Array(r),s=Array(r),c=1/0,l=1/0,u=-1/0,d=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(a=+this._y.call(null,t))||(o[n]=i,s[n]=a,i<c&&(c=i),i>u&&(u=i),a<l&&(l=a),a>d&&(d=a));if(c>u||l>d)return this;for(this.cover(c,l).cover(u,d),n=0;n<r;++n)T(this,o[n],s[n],e[n]);return this}function E(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n||1,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t<r)<<1|e<n,c=[,,,,],c[l]=s,s=c,o*=2,l){case 0:i=n+o,a=r+o;break;case 1:n=i-o,a=r+o;break;case 2:i=n+o,r=a-o;break;case 3:n=i-o,r=a-o;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function de(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function fe(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function D(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function pe(e,t,n){var r,i=this._x0,a=this._y0,o,s,c,l,u=this._x1,d=this._y1,f=[],p=this._root,m,h;for(p&&f.push(new D(p,i,a,u,d)),n==null?n=1/0:(i=e-n,a=t-n,u=e+n,d=t+n,n*=n);m=f.pop();)if(!(!(p=m.node)||(o=m.x0)>u||(s=m.y0)>d||(c=m.x1)<i||(l=m.y1)<a))if(p.length){var g=(o+c)/2,_=(s+l)/2;f.push(new D(p[3],g,_,c,l),new D(p[2],o,_,g,l),new D(p[1],g,s,c,_),new D(p[0],o,s,g,_)),(h=(t>=_)<<1|e>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=m)}else{var v=e-+this._x.call(null,p.data),ee=t-+this._y.call(null,p.data),y=v*v+ee*ee;if(y<n){var b=Math.sqrt(n=y);i=e-b,a=t-b,u=e+b,d=t+b,r=p.data}}return r}function me(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function he(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function O(){return this._root}function ge(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function _e(e){var t=[],n,r=this._root,i,a,o,s,c;for(r&&t.push(new D(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&r.length){var l=(a+s)/2,u=(o+c)/2;(i=r[3])&&t.push(new D(i,l,u,s,c)),(i=r[2])&&t.push(new D(i,a,u,l,c)),(i=r[1])&&t.push(new D(i,l,o,s,u)),(i=r[0])&&t.push(new D(i,a,o,l,u))}return this}function ve(e){var t=[],n=[],r;for(this._root&&t.push(new D(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,c=r.x1,l=r.y1,u=(o+c)/2,d=(s+l)/2;(a=i[0])&&t.push(new D(a,o,s,u,d)),(a=i[1])&&t.push(new D(a,u,s,c,d)),(a=i[2])&&t.push(new D(a,o,d,u,l)),(a=i[3])&&t.push(new D(a,u,d,c,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function ye(e){return e[0]}function be(e){return arguments.length?(this._x=e,this):this._x}function xe(e){return e[1]}function Se(e){return arguments.length?(this._y=e,this):this._y}function Ce(e,t,n){var r=new k(t??ye,n??xe,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function k(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function A(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var j=Ce.prototype=k.prototype;j.copy=function(){var e=new k(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=A(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=A(r));return e},j.add=le,j.addAll=ue,j.cover=E,j.data=de,j.extent=fe,j.find=pe,j.remove=me,j.removeAll=he,j.root=O,j.size=ge,j.visit=_e,j.visitAfter=ve,j.x=be,j.y=Se;function M(e){return function(){return e}}function N(e){return(e()-.5)*1e-6}function we(e){return e.x+e.vx}function P(e){return e.y+e.vy}function Te(e){var t,n,r,i=1,a=1;typeof e!=`function`&&(e=M(e==null?1:+e));function o(){for(var e,o=t.length,c,l,u,d,f,p,m=0;m<a;++m)for(c=Ce(t,we,P).visitAfter(s),e=0;e<o;++e)l=t[e],f=n[l.index],p=f*f,u=l.x+l.vx,d=l.y+l.vy,c.visit(h);function h(e,t,n,a,o){var s=e.data,c=e.r,m=f+c;if(s){if(s.index>l.index){var h=u-s.x-s.vx,g=d-s.y-s.vy,_=h*h+g*g;_<m*m&&(h===0&&(h=N(r),_+=h*h),g===0&&(g=N(r),_+=g*g),_=(m-(_=Math.sqrt(_)))/_*i,l.vx+=(h*=_)*(m=(c*=c)/(p+c)),l.vy+=(g*=_)*m,s.vx-=h*(m=1-m),s.vy-=g*m)}return}return t>u+m||a<u-m||n>d+m||o<d-m}}function s(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function c(){if(t){var r,i=t.length,a;for(n=Array(i),r=0;r<i;++r)a=t[r],n[a.index]=+e(a,r,t)}}return o.initialize=function(e,n){t=e,r=n,c()},o.iterations=function(e){return arguments.length?(a=+e,o):a},o.strength=function(e){return arguments.length?(i=+e,o):i},o.radius=function(t){return arguments.length?(e=typeof t==`function`?t:M(+t),c(),o):e},o}function F(e){return e.index}function I(e,t){var n=e.get(t);if(!n)throw Error(`node not found: `+t);return n}function Ee(e){var t=F,n=d,r,i=M(30),a,o,s,c,l,u=1;e??=[];function d(e){return 1/Math.min(s[e.source.index],s[e.target.index])}function f(t){for(var n=0,i=e.length;n<u;++n)for(var o=0,s,d,f,p,m,h,g;o<i;++o)s=e[o],d=s.source,f=s.target,p=f.x+f.vx-d.x-d.vx||N(l),m=f.y+f.vy-d.y-d.vy||N(l),h=Math.sqrt(p*p+m*m),h=(h-a[o])/h*t*r[o],p*=h,m*=h,f.vx-=p*(g=c[o]),f.vy-=m*g,d.vx+=p*(g=1-g),d.vy+=m*g}function p(){if(o){var n,i=o.length,l=e.length,u=new Map(o.map((e,n)=>[t(e,n,o),e])),d;for(n=0,s=Array(i);n<l;++n)d=e[n],d.index=n,typeof d.source!=`object`&&(d.source=I(u,d.source)),typeof d.target!=`object`&&(d.target=I(u,d.target)),s[d.source.index]=(s[d.source.index]||0)+1,s[d.target.index]=(s[d.target.index]||0)+1;for(n=0,c=Array(l);n<l;++n)d=e[n],c[n]=s[d.source.index]/(s[d.source.index]+s[d.target.index]);r=Array(l),m(),a=Array(l),h()}}function m(){if(o)for(var t=0,i=e.length;t<i;++t)r[t]=+n(e[t],t,e)}function h(){if(o)for(var t=0,n=e.length;t<n;++t)a[t]=+i(e[t],t,e)}return f.initialize=function(e,t){o=e,l=t,p()},f.links=function(t){return arguments.length?(e=t,p(),f):e},f.id=function(e){return arguments.length?(t=e,f):t},f.iterations=function(e){return arguments.length?(u=+e,f):u},f.strength=function(e){return arguments.length?(n=typeof e==`function`?e:M(+e),m(),f):n},f.distance=function(e){return arguments.length?(i=typeof e==`function`?e:M(+e),h(),f):i},f}var L={value:()=>{}};function R(){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 z(n)}function z(e){this._=e}function De(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}})}z.prototype=R.prototype={constructor:z,on:function(e,t){var n=this._,r=De(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Oe(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]=ke(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ke(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 z(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 Oe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ke(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=L,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var B=0,V=0,Ae=0,je=1e3,H,U,W=0,G=0,K=0,q=typeof performance==`object`&&performance.now?performance:Date,J=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Y(){return G||=(J(X),q.now()+K)}function X(){G=0}function Z(){this._call=this._time=this._next=null}Z.prototype=Me.prototype={constructor:Z,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Y():+n)+(t==null?0:+t),!this._next&&U!==this&&(U?U._next=this:H=this,U=this),this._call=e,this._time=n,Le()},stop:function(){this._call&&(this._call=null,this._time=1/0,Le())}};function Me(e,t,n){var r=new Z;return r.restart(e,t,n),r}function Ne(){Y(),++B;for(var e=H,t;e;)(t=G-e._time)>=0&&e._call.call(void 0,t),e=e._next;--B}function Pe(){G=(W=q.now())+K,B=V=0;try{Ne()}finally{B=0,Ie(),G=0}}function Fe(){var e=q.now(),t=e-W;t>je&&(K-=t,W=e)}function Ie(){for(var e,t=H,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:H=n);U=e,Le(r)}function Le(e){B||(V&&=clearTimeout(V),e-G>24?(e<1/0&&(V=setTimeout(Pe,e-q.now()-K)),Ae&&=clearInterval(Ae)):(Ae||=(W=q.now(),setInterval(Fe,je)),B=1,J(Pe)))}var Q=1664525,Re=1013904223,ze=4294967296;function Be(){let e=1;return()=>(e=(Q*e+Re)%ze)/ze}function Ve(e){return e.x}function He(e){return e.y}var Ue=10,We=Math.PI*(3-Math.sqrt(5));function Ge(e){var t,n=1,r=.001,i=1-r**(1/300),a=0,o=.6,s=new Map,c=Me(d),l=R(`tick`,`end`),u=Be();e??=[];function d(){f(),l.call(`tick`,t),n<r&&(c.stop(),l.call(`end`,t))}function f(r){var c,l=e.length,u;r===void 0&&(r=1);for(var d=0;d<r;++d)for(n+=(a-n)*i,s.forEach(function(e){e(n)}),c=0;c<l;++c)u=e[c],u.fx==null?u.x+=u.vx*=o:(u.x=u.fx,u.vx=0),u.fy==null?u.y+=u.vy*=o:(u.y=u.fy,u.vy=0);return t}function p(){for(var t=0,n=e.length,r;t<n;++t){if(r=e[t],r.index=t,r.fx!=null&&(r.x=r.fx),r.fy!=null&&(r.y=r.fy),isNaN(r.x)||isNaN(r.y)){var i=Ue*Math.sqrt(.5+t),a=t*We;r.x=i*Math.cos(a),r.y=i*Math.sin(a)}(isNaN(r.vx)||isNaN(r.vy))&&(r.vx=r.vy=0)}}function m(t){return t.initialize&&t.initialize(e,u),t}return p(),t={tick:f,restart:function(){return c.restart(d),t},stop:function(){return c.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),s.forEach(m),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(r=+e,t):r},alphaDecay:function(e){return arguments.length?(i=+e,t):+i},alphaTarget:function(e){return arguments.length?(a=+e,t):a},velocityDecay:function(e){return arguments.length?(o=1-e,t):1-o},randomSource:function(e){return arguments.length?(u=e,s.forEach(m),t):u},force:function(e,n){return arguments.length>1?(n==null?s.delete(e):s.set(e,m(n)),t):s.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i<a;++i)l=e[i],o=t-l.x,s=n-l.y,c=o*o+s*s,c<r&&(u=l,r=c);return u},on:function(e,n){return arguments.length>1?(l.on(e,n),t):l.on(e)}}}function Ke(){var e,t,n,r,i=M(-30),a,o=1,s=1/0,c=.81;function l(n){var i,a=e.length,o=Ce(e,Ve,He).visitAfter(d);for(r=n,i=0;i<a;++i)t=e[i],o.visit(f)}function u(){if(e){var t,n=e.length,r;for(a=Array(n),t=0;t<n;++t)r=e[t],a[r.index]=+i(r,t,e)}}function d(e){var t=0,n,r,i=0,o,s,c;if(e.length){for(o=s=c=0;c<4;++c)(n=e[c])&&(r=Math.abs(n.value))&&(t+=n.value,i+=r,o+=r*n.x,s+=r*n.y);e.x=o/i,e.y=s/i}else{n=e,n.x=n.data.x,n.y=n.data.y;do t+=a[n.data.index];while(n=n.next)}e.value=t}function f(e,i,l,u){if(!e.value)return!0;var d=e.x-t.x,f=e.y-t.y,p=u-i,m=d*d+f*f;if(p*p/c<m)return m<s&&(d===0&&(d=N(n),m+=d*d),f===0&&(f=N(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)),t.vx+=d*e.value*r/m,t.vy+=f*e.value*r/m),!0;if(!(e.length||m>=s)){(e.data!==t||e.next)&&(d===0&&(d=N(n),m+=d*d),f===0&&(f=N(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)));do e.data!==t&&(p=a[e.data.index]*r/m,t.vx+=d*p,t.vy+=f*p);while(e=e.next)}}return l.initialize=function(t,r){e=t,n=r,u()},l.strength=function(e){return arguments.length?(i=typeof e==`function`?e:M(+e),u(),l):i},l.distanceMin=function(e){return arguments.length?(o=e*e,l):Math.sqrt(o)},l.distanceMax=function(e){return arguments.length?(s=e*e,l):Math.sqrt(s)},l.theta=function(e){return arguments.length?(c=e*e,l):Math.sqrt(c)},l}function qe(e){var t=M(.1),n,r,i;typeof e!=`function`&&(e=M(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vx+=(i[t]-o.x)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:M(+e),o(),a):t},a.x=function(t){return arguments.length?(e=typeof t==`function`?t:M(+t),o(),a):e},a}function Je(e){var t=M(.1),n,r,i;typeof e!=`function`&&(e=M(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vy+=(i[t]-o.y)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:M(+e),o(),a):t},a.y=function(t){return arguments.length?(e=typeof t==`function`?t:M(+t),o(),a):e},a}var Ye=e(`<div class="debug-panel svelte-1i33fky"><label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="5" max="1000" step="5" class="svelte-1i33fky"/></label> <label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="0.5" max="5" step="0.1" class="svelte-1i33fky"/></label> <label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="30" max="500" step="10" class="svelte-1i33fky"/></label> <label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="0.01" max="0.5" step="0.01" class="svelte-1i33fky"/></label> <label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="-3000" max="-100" step="50" class="svelte-1i33fky"/></label> <label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="10" max="100" step="5" class="svelte-1i33fky"/></label> <div class="debug-actions svelte-1i33fky"><button class="svelte-1i33fky">Regenerate</button> <button class="svelte-1i33fky">Copy params</button></div></div>`),Xe=e(`<div><span class="legend-dot svelte-1i33fky"></span> <span class="legend-label svelte-1i33fky"> </span> <span class="legend-count svelte-1i33fky"> </span></div>`),Ze=e(`<div class="graph-view svelte-1i33fky"><div class="canvas-wrap svelte-1i33fky"><!> <div class="legend-panel svelte-1i33fky"></div></div></div>`);function Qe(e,p){t(p,!0);let le=ne(p,`sidebarHoveredId`,3,null),T=ne(p,`highlightedIds`,3,null),ue=typeof window<`u`&&new URLSearchParams(window.location.search).get(`debug`)===`graph`,E=S(500),de=S(1.8),fe=S(100),D=S(.1),pe=S(-750),me=S(50),he=S(0),O=x(()=>{if(!ue)return p.graphData;m(he);let e=[`project`,`person`,`organization`,`event`,`task`,`document`,`note`,`service`,`case-study`,`deal`,`reference`,`deliverable`,`position`,`skill`,`deck`,`publication`],t=Array.from({length:m(E)},(t,n)=>({id:`sim-${n}`,type:e[n%e.length],repo:`folder-${n%5}`})),n=[],r=Math.floor(m(E)*m(de));for(let e=0;e<r;e++){let e=Math.floor(Math.random()*m(E)),t=Math.floor(Math.random()*m(E));t===e&&(t=(e+1)%m(E)),n.push({source:`sim-${e}`,target:`sim-${t}`})}return{nodes:t,edges:n}}),ge=x(()=>ue?{linkDist:m(fe),centerStr:m(D),chargeStr:m(pe),collideR:m(me)}:null);function _e(e){return p.nameMap?.get(e)??e.replace(/-/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}let ve=s(`theme`),ye=x(()=>ve.current===`light`?{default:14211288,dim:15263976,conn:8947848,labelText:1710623}:{default:2763306,dim:1315860,conn:6710886,labelText:15592943}),be=x(()=>ve.current===`light`?16316666:592139),xe=.75;h(()=>{ve.current,X&&(X.style.fill=m(ye).labelText,X.style.stroke={color:m(be),width:5});let e=m(et);for(let t of j)w(t.type)===$e&&(t.color=e);Q()}),h(()=>{T(),Q()});function Se(e){return{linkDist:100,centerStr:.1,chargeStr:-750,collideR:50}}let Ce=!1;h(()=>{let e=m(O);if(m(ge),!Z||!W||!q)return;if(!Ce){Ce=!0;return}let t=new Map;for(let n of e.edges)t.set(n.source,(t.get(n.source)??0)+1),t.set(n.target,(t.get(n.target)??0)+1);let n=new Map;for(let e of j)n.set(e.id,{x:e.x,y:e.y});let r=3600*e.nodes.length,i=Math.sqrt(r),a=Math.max(0,...t.values()),o=e.nodes.map(e=>{let r=t.get(e.id)??0,o=n.get(e.id);return{id:e.id,type:e.type,repo:e.repo,color:w(e.type)===$e?m(et):w(e.type),weight:r,x:o?.x??(Math.random()-.5)*i,y:o?.y??(Math.random()-.5)*i,vx:0,vy:0,r:Me(r,a)}}),s=new Map;for(let e of o)s.set(e.id,e);let c=new Set(Y.keys()),l=new Set(e.nodes.map(e=>e.id));for(let e of c)if(!l.has(e)){let t=Y.get(e);t&&(t.parent===J?J.removeChild(t):q.removeChild(t),t.destroy()),Y.delete(e)}let u=null;if(Y.size>0&&(u=Y.values().next().value?.texture),!u){let e=document.createElement(`canvas`);e.width=100,e.height=100;let t=e.getContext(`2d`);t.beginPath(),t.arc(50,50,48,0,Math.PI*2),t.fillStyle=`#ffffff`,t.fill(),u=Z.Texture.from(e)}for(let e of o){let t=Y.get(e.id);t||(t=new Z.Sprite(u),t.anchor.set(.5),q.addChild(t),Y.set(e.id,t)),t.tint=Re(e.color)}j=o,A?.stop();let d=e.edges.map(e=>({source:e.source,target:e.target})),f=m(ge)??Se(j.length),p=Ee(d).id(e=>e.id).distance(f.linkDist);A=Ge(j).force(`link`,p).force(`charge`,Ke().strength(f.chargeStr).distanceMin(30)).force(`x`,qe(0).strength(f.centerStr)).force(`y`,Je(0).strength(f.centerStr)).force(`collide`,Te().radius(f.collideR).strength(.5)).velocityDecay(.4).alpha(.3).on(`tick`,()=>{Ae||Le(),Q()}),M=p.links(),L=null,Ie(),Q()}),h(()=>{let e=le();if(e){let t=j.find(t=>t.id===e)??null;L=t,Ie(),U=+!!t}else R||(U=0);Q()});let k,A=null,j=[],M=[],N=!1,we=0,P=0,F=0,I=1,L=null,R=null,z=S(!1),De=0,Oe=0,ke=0,B=0,V=new Set,Ae=!1,je=S(null),H=0,U=0,W=null,G=null,K=null,q=null,J=null,Y=new Map,X=null,Z=null;function Me(e,t){return 5}function Ne(e,t){let n=k.getBoundingClientRect();return{x:(e-n.left-P)/I,y:(t-n.top-F)/I}}function Pe(e,t){for(let n=j.length-1;n>=0;n--){let r=j[n],i=e-r.x,a=t-r.y,o=(r.r*1.5+4)/I;if(i*i+a*a<=o*o)return r}return null}let Fe=new Set;function Ie(){let e=L??null;if(q&&J)for(let e of Fe){let t=Y.get(e);t&&t.parent===J&&(J.removeChild(t),q.addChild(t))}if(V.clear(),Fe.clear(),e){V.add(e.id);for(let t of M)t.source.id===e.id&&V.add(t.target.id),t.target.id===e.id&&V.add(t.source.id);if(Fe=new Set(V),q&&J)for(let e of V){let t=Y.get(e);t&&t.parent===q&&(q.removeChild(t),J.addChild(t))}}}function Le(){if(j.length===0||!k)return;let e=1/0,t=-1/0,n=1/0,r=-1/0,i=0;for(let a of j)a.x<e&&(e=a.x),a.x>t&&(t=a.x),a.y<n&&(n=a.y),a.y>r&&(r=a.y),a.r>i&&(i=a.r);let a=k.clientWidth,o=k.clientHeight,s=t-e,c=r-n,l=(60+i)*2;I=s>0&&c>0?Math.min((a-l)/s,(o-l)/c,3):s>0?Math.min((a-l)/s,3):c>0?Math.min((o-l)/c,3):1,P=a/2-(e+t)/2*I,F=o/2-(n+r)/2*I,Q()}function Q(){N=!0,we=0}function Re(e){return parseInt(e.replace(`#`,``),16)}function ze(e,t,n){let r=(e>>16&255)+n*((t>>16&255)-(e>>16&255)),i=(e>>8&255)+n*((t>>8&255)-(e>>8&255)),a=(e&255)+n*((t&255)-(e&255));return Math.round(r)<<16|Math.round(i)<<8|Math.round(a)}function Be(){if(!Z||!G||!K)return;G.clear(),K.clear();let e=L,t=e!==null,n=H,r=m(je),i=T(),a=m(ye).default,o=m(ye).dim,s=m(ye).conn;for(let c=0;c<M.length;c++){let l=M[c],u=l.source.x*I+P,d=l.source.y*I+F,f=l.target.x*I+P,p=l.target.y*I+F,m=t&&n>.01&&(l.source===e||l.target===e)&&V.has(l.source.id)&&V.has(l.target.id),h=a;t&&n>.01?h=m?ze(a,s,n):ze(a,o,n):r===null?i!==null&&(h=o):h=o;let g=m?K:G;g.setStrokeStyle({width:1,color:h}),g.moveTo(u,d),g.lineTo(f,p),g.stroke()}}function Ve(){if(!Z)return;let e=L,t=e!==null,n=H,r=m(je),i=T();for(let a of j){let o=Y.get(a.id);if(!o)continue;let s=a.x*I+P,c=a.y*I+F;o.position.set(s,c),o.scale.set(a.r/50),o.alpha=1;let l=Re(a.color);{let s=a===e,c=t&&V.has(a.id),u=r!==null&&(r===`other`?w(a.type)===$e:a.type===r);if(s&&n>.01)o.tint=l;else if(c)o.tint=l;else if(r!==null)o.tint=u?l:ze(l,m(be),xe);else if(i!==null){let e=i.has(a.id)?n*xe:xe;o.tint=ze(l,m(be),e)}else o.tint=ze(l,m(be),n*xe)}}if(e&&n>.01&&X){let t=e.x*I+P,r=e.y*I+F;X.text=_e(e.id),X.style.fontSize=14,X.position.set(t,r+e.r+8),X.alpha=n,X.visible=!0}else X&&(X.visible=!1)}let He=!1;function Ue(e){if(e.button!==0)return;He=!1;let t=Ne(e.clientX,e.clientY),n=Pe(t.x,t.y);n?(R=n,Ae=!0,n.fx=n.x,n.fy=n.y,A?.alphaTarget(.3).restart(),Q()):(C(z,!0),De=e.clientX,Oe=e.clientY,ke=P,B=F),k.setPointerCapture(e.pointerId),window.addEventListener(`pointerup`,Qe,{once:!0})}function We(e){if(R){He=!0;let t=Ne(e.clientX,e.clientY);R.fx=t.x,R.fy=t.y,Q()}else if(m(z))He=!0,P=ke+(e.clientX-De),F=B+(e.clientY-Oe),Q();else{let t=Ne(e.clientX,e.clientY),n=Pe(t.x,t.y);n?n===L?U!==1&&(U=1,k.style.cursor=`pointer`,Q()):(L&&(H=.15),L=n,Ie(),U=1,k.style.cursor=`pointer`,Q()):U!==0&&(U=0,k.style.cursor=`grab`,Q())}}function Qe(e){if(!R&&!m(z))return;window.removeEventListener(`pointerup`,Qe);let t=He;if(R){let e=R;R.fx=null,R.fy=null,A?.alphaTarget(0),R=null,U=0,Q(),t||se(`/${e.repo}/${e.type}/${e.id}`)}else m(z)&&C(z,!1);try{k.releasePointerCapture(e.pointerId)}catch{}}let $e=`#5c5c66`,et=x(()=>ve.current===`light`?`#b0b0b8`:$e),tt=x(()=>{let e=new Map;for(let t of m(O).nodes)e.set(t.type,(e.get(t.type)??0)+1);let t=[],n=0;for(let[r,i]of e){let e=w(r);e===$e?n+=i:t.push({name:r,color:e,count:i})}return t.sort((e,t)=>t.count-e.count),n>0&&t.push({name:`other`,color:m(et),count:n}),t});v(async()=>{Z=await ie(()=>import(`./e3SY5t2O2.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url),W=new Z.Application,await W.init({antialias:!0,resolution:window.devicePixelRatio||1,autoDensity:!0,backgroundAlpha:0,resizeTo:k}),k.insertBefore(W.canvas,k.firstChild),W.canvas.style.position=`absolute`,W.canvas.style.inset=`0`,G=new Z.Graphics,W.stage.addChild(G),q=new Z.Container,W.stage.addChild(q),K=new Z.Graphics,W.stage.addChild(K),J=new Z.Container,W.stage.addChild(J);let e=document.createElement(`canvas`);e.width=100,e.height=100;let t=e.getContext(`2d`);t.beginPath(),t.arc(50,50,48,0,Math.PI*2),t.fillStyle=`#ffffff`,t.fill();let n=Z.Texture.from(e),r=new Map;for(let e of m(O).edges)r.set(e.source,(r.get(e.source)??0)+1),r.set(e.target,(r.get(e.target)??0)+1);let i=new Map,a=m(O).nodes.length,o=3600*a,s=Math.sqrt(o),c=Math.max(0,...r.values());j=m(O).nodes.map(e=>{let t=r.get(e.id)??0,n={id:e.id,type:e.type,repo:e.repo,color:w(e.type)===$e?m(et):w(e.type),weight:t,x:(Math.random()-.5)*s,y:(Math.random()-.5)*s,vx:0,vy:0,r:Me(t,c)};return i.set(e.id,n),n});for(let e of j){let t=new Z.Sprite(n);t.anchor.set(.5),t.tint=Re(e.color),q.addChild(t),Y.set(e.id,t)}X=new Z.Text({text:``,style:{fontFamily:`IBM Plex Sans, system-ui, sans-serif`,fontWeight:`400`,fontSize:12,fill:m(ye).labelText,align:`center`,stroke:{color:m(be),width:5}}}),X.anchor.set(.5,0),X.visible=!1,W.stage.addChild(X);let l=m(O).edges.map(e=>({source:e.source,target:e.target})),u=m(ge)??Se(a),d=Ee(l).id(e=>e.id).distance(u.linkDist);A=Ge(j).force(`link`,d).force(`charge`,Ke().strength(u.chargeStr).distanceMin(30)).force(`x`,qe(0).strength(u.centerStr)).force(`y`,Je(0).strength(u.centerStr)).force(`collide`,Te().radius(u.collideR).strength(.5)).velocityDecay(.4).alpha(1).on(`tick`,()=>{Ae||Le(),Q()}),M=d.links();let f=0;W.ticker.add(()=>{let e=performance.now(),t=f?Math.min((e-f)/1e3,.05):.016;f=e,H<U?(H=Math.min(U,H+4*t),N=!0):H>U&&(H=Math.max(U,H-4*t),N=!0),H===0&&U===0&&L&&!R&&(L=null,Ie(),N=!0),(N||we<120)&&(Be(),Ve(),N=!1,we++)});let p=new ResizeObserver(()=>{W.renderer.resize(k.clientWidth,k.clientHeight),Le()});p.observe(k),nt=p,Ce=!0});let nt=null;te(()=>{nt?.disconnect(),A?.stop(),W&&=(W.destroy(!0,{children:!0}),null)});var rt=Ze(),$=b(rt);let it;var at=b($),ot=e=>{var t=Ye(),a=b(t),o=b(a),s=b(o);r(o);var c=_(o);ae(c),r(a);var l=_(a,2),d=b(l),p=b(d);r(d);var h=_(d);ae(h),r(l);var g=_(l,2),v=b(g),ee=b(v);r(v);var te=_(v);ae(te),r(g);var ne=_(g,2),ie=b(ne),x=b(ie);r(ie);var oe=_(ie);ae(oe),r(ne);var S=_(ne,2),se=b(S),ce=b(se);r(se);var w=_(se);ae(w),r(S);var le=_(S,2),T=b(le),ue=b(T);r(T);var O=_(T);ae(O),r(le);var ge=_(le,2),_e=b(ge),ve=_(_e,2);r(ge),r(t),re((e,t)=>{i(s,`Nodes: ${m(E)??``}`),i(p,`Edges/node: ${e??``}`),i(ee,`Link dist: ${m(fe)??``}`),i(x,`Center: ${t??``}`),i(ce,`Charge: ${m(pe)??``}`),i(ue,`Collide R: ${m(me)??``}`)},[()=>m(de).toFixed(1),()=>m(D).toFixed(2)]),n(`pointerdown`,t,e=>e.stopPropagation()),y(c,()=>m(E),e=>C(E,e)),y(h,()=>m(de),e=>C(de,e)),y(te,()=>m(fe),e=>C(fe,e)),y(oe,()=>m(D),e=>C(D,e)),y(w,()=>m(pe),e=>C(pe,e)),y(O,()=>m(me),e=>C(me,e)),n(`click`,_e,()=>{f(he)}),n(`click`,ve,()=>{let e=`forceParams(${m(E)}) = { linkDist: ${m(fe)}, centerStr: ${m(D)}, chargeStr: ${m(pe)}, collideR: ${m(me)} }`;navigator.clipboard.writeText(e)}),u(e,t)};c(at,e=>{ue&&e(ot)});var st=_(at,2);ee(st,21,()=>m(tt),o,(e,t)=>{var n=Xe();let o;var s=b(n);let c;var l=_(s,2),f=b(l,!0);r(l);var p=_(l,2),h=b(p,!0);r(p),r(n),re(e=>{o=d(n,1,`legend-item svelte-1i33fky`,null,o,{"legend-item-active":m(je)===m(t).name}),c=oe(s,``,c,{background:m(t).color}),i(f,e),i(h,m(t).count)},[()=>ce(m(t).name)]),a(`mouseenter`,n,()=>{C(je,m(t).name,!0),Q()}),a(`mouseleave`,n,()=>{C(je,null),Q()}),u(e,n)}),r(st),r($),g($,e=>k=e,()=>k),r(rt),re(()=>it=oe($,``,it,{cursor:m(z)?`grabbing`:`grab`})),n(`pointerdown`,$,Ue),n(`pointermove`,$,We),n(`pointerup`,$,Qe),n(`pointerdown`,st,e=>e.stopPropagation()),u(e,rt),l()}p([`pointerdown`,`pointermove`,`pointerup`,`click`]);export{Qe as t};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./h4WWBpcD2.js","./CYTTTma0.js","./BlyFGPFV.js","./BQW-EDgP2.js","./DOmH4G9o2.js","./CSUrYOis.js","./0edH8sO82.js","./DvJSCDuZ2.js","./DYXDRmoo2.js","./g09ZrevW2.js","./BKzV82vD2.js","./DWygwzcO2.js","./CDTjuBSm2.js","./7Bu427my2.js","./CCLR-AJL2.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{B as e,Ft as t,G as n,Ht as r,I as i,K as a,M as o,Mt as s,P as c,Pt as l,R as u,S as d,St as f,W as p,Z as m,ct as h,f as g,ht as _,i as v,j as ee,m as y,pt as b,r as te,s as ne,st as re,t as ie,v as ae,wt as x,x as oe,xt as S,yt as C}from"./CYTTTma0.js";import{r as se}from"./VQbAelHN.js";import"./xihTtKlq.js";import"./CUPSJObs.js";import{a as ce,r as w}from"./zl16E4yc2.js";function le(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return T(this.cover(t,n),t,n,e)}function T(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function ue(e){var t,n,r=e.length,i,a,o=Array(r),s=Array(r),c=1/0,l=1/0,u=-1/0,d=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(a=+this._y.call(null,t))||(o[n]=i,s[n]=a,i<c&&(c=i),i>u&&(u=i),a<l&&(l=a),a>d&&(d=a));if(c>u||l>d)return this;for(this.cover(c,l).cover(u,d),n=0;n<r;++n)T(this,o[n],s[n],e[n]);return this}function E(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n||1,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t<r)<<1|e<n,c=[,,,,],c[l]=s,s=c,o*=2,l){case 0:i=n+o,a=r+o;break;case 1:n=i-o,a=r+o;break;case 2:i=n+o,r=a-o;break;case 3:n=i-o,r=a-o;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function de(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function fe(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function D(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function pe(e,t,n){var r,i=this._x0,a=this._y0,o,s,c,l,u=this._x1,d=this._y1,f=[],p=this._root,m,h;for(p&&f.push(new D(p,i,a,u,d)),n==null?n=1/0:(i=e-n,a=t-n,u=e+n,d=t+n,n*=n);m=f.pop();)if(!(!(p=m.node)||(o=m.x0)>u||(s=m.y0)>d||(c=m.x1)<i||(l=m.y1)<a))if(p.length){var g=(o+c)/2,_=(s+l)/2;f.push(new D(p[3],g,_,c,l),new D(p[2],o,_,g,l),new D(p[1],g,s,c,_),new D(p[0],o,s,g,_)),(h=(t>=_)<<1|e>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=m)}else{var v=e-+this._x.call(null,p.data),ee=t-+this._y.call(null,p.data),y=v*v+ee*ee;if(y<n){var b=Math.sqrt(n=y);i=e-b,a=t-b,u=e+b,d=t+b,r=p.data}}return r}function me(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function he(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function O(){return this._root}function ge(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function _e(e){var t=[],n,r=this._root,i,a,o,s,c;for(r&&t.push(new D(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&r.length){var l=(a+s)/2,u=(o+c)/2;(i=r[3])&&t.push(new D(i,l,u,s,c)),(i=r[2])&&t.push(new D(i,a,u,l,c)),(i=r[1])&&t.push(new D(i,l,o,s,u)),(i=r[0])&&t.push(new D(i,a,o,l,u))}return this}function ve(e){var t=[],n=[],r;for(this._root&&t.push(new D(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,c=r.x1,l=r.y1,u=(o+c)/2,d=(s+l)/2;(a=i[0])&&t.push(new D(a,o,s,u,d)),(a=i[1])&&t.push(new D(a,u,s,c,d)),(a=i[2])&&t.push(new D(a,o,d,u,l)),(a=i[3])&&t.push(new D(a,u,d,c,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function ye(e){return e[0]}function be(e){return arguments.length?(this._x=e,this):this._x}function xe(e){return e[1]}function Se(e){return arguments.length?(this._y=e,this):this._y}function Ce(e,t,n){var r=new k(t??ye,n??xe,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function k(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function A(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var j=Ce.prototype=k.prototype;j.copy=function(){var e=new k(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=A(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=A(r));return e},j.add=le,j.addAll=ue,j.cover=E,j.data=de,j.extent=fe,j.find=pe,j.remove=me,j.removeAll=he,j.root=O,j.size=ge,j.visit=_e,j.visitAfter=ve,j.x=be,j.y=Se;function M(e){return function(){return e}}function N(e){return(e()-.5)*1e-6}function we(e){return e.x+e.vx}function P(e){return e.y+e.vy}function Te(e){var t,n,r,i=1,a=1;typeof e!=`function`&&(e=M(e==null?1:+e));function o(){for(var e,o=t.length,c,l,u,d,f,p,m=0;m<a;++m)for(c=Ce(t,we,P).visitAfter(s),e=0;e<o;++e)l=t[e],f=n[l.index],p=f*f,u=l.x+l.vx,d=l.y+l.vy,c.visit(h);function h(e,t,n,a,o){var s=e.data,c=e.r,m=f+c;if(s){if(s.index>l.index){var h=u-s.x-s.vx,g=d-s.y-s.vy,_=h*h+g*g;_<m*m&&(h===0&&(h=N(r),_+=h*h),g===0&&(g=N(r),_+=g*g),_=(m-(_=Math.sqrt(_)))/_*i,l.vx+=(h*=_)*(m=(c*=c)/(p+c)),l.vy+=(g*=_)*m,s.vx-=h*(m=1-m),s.vy-=g*m)}return}return t>u+m||a<u-m||n>d+m||o<d-m}}function s(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function c(){if(t){var r,i=t.length,a;for(n=Array(i),r=0;r<i;++r)a=t[r],n[a.index]=+e(a,r,t)}}return o.initialize=function(e,n){t=e,r=n,c()},o.iterations=function(e){return arguments.length?(a=+e,o):a},o.strength=function(e){return arguments.length?(i=+e,o):i},o.radius=function(t){return arguments.length?(e=typeof t==`function`?t:M(+t),c(),o):e},o}function F(e){return e.index}function I(e,t){var n=e.get(t);if(!n)throw Error(`node not found: `+t);return n}function Ee(e){var t=F,n=d,r,i=M(30),a,o,s,c,l,u=1;e??=[];function d(e){return 1/Math.min(s[e.source.index],s[e.target.index])}function f(t){for(var n=0,i=e.length;n<u;++n)for(var o=0,s,d,f,p,m,h,g;o<i;++o)s=e[o],d=s.source,f=s.target,p=f.x+f.vx-d.x-d.vx||N(l),m=f.y+f.vy-d.y-d.vy||N(l),h=Math.sqrt(p*p+m*m),h=(h-a[o])/h*t*r[o],p*=h,m*=h,f.vx-=p*(g=c[o]),f.vy-=m*g,d.vx+=p*(g=1-g),d.vy+=m*g}function p(){if(o){var n,i=o.length,l=e.length,u=new Map(o.map((e,n)=>[t(e,n,o),e])),d;for(n=0,s=Array(i);n<l;++n)d=e[n],d.index=n,typeof d.source!=`object`&&(d.source=I(u,d.source)),typeof d.target!=`object`&&(d.target=I(u,d.target)),s[d.source.index]=(s[d.source.index]||0)+1,s[d.target.index]=(s[d.target.index]||0)+1;for(n=0,c=Array(l);n<l;++n)d=e[n],c[n]=s[d.source.index]/(s[d.source.index]+s[d.target.index]);r=Array(l),m(),a=Array(l),h()}}function m(){if(o)for(var t=0,i=e.length;t<i;++t)r[t]=+n(e[t],t,e)}function h(){if(o)for(var t=0,n=e.length;t<n;++t)a[t]=+i(e[t],t,e)}return f.initialize=function(e,t){o=e,l=t,p()},f.links=function(t){return arguments.length?(e=t,p(),f):e},f.id=function(e){return arguments.length?(t=e,f):t},f.iterations=function(e){return arguments.length?(u=+e,f):u},f.strength=function(e){return arguments.length?(n=typeof e==`function`?e:M(+e),m(),f):n},f.distance=function(e){return arguments.length?(i=typeof e==`function`?e:M(+e),h(),f):i},f}var L={value:()=>{}};function R(){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 z(n)}function z(e){this._=e}function De(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}})}z.prototype=R.prototype={constructor:z,on:function(e,t){var n=this._,r=De(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Oe(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]=ke(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ke(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 z(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 Oe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ke(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=L,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var B=0,V=0,Ae=0,je=1e3,H,U,W=0,G=0,K=0,q=typeof performance==`object`&&performance.now?performance:Date,J=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Y(){return G||=(J(X),q.now()+K)}function X(){G=0}function Z(){this._call=this._time=this._next=null}Z.prototype=Me.prototype={constructor:Z,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Y():+n)+(t==null?0:+t),!this._next&&U!==this&&(U?U._next=this:H=this,U=this),this._call=e,this._time=n,Le()},stop:function(){this._call&&(this._call=null,this._time=1/0,Le())}};function Me(e,t,n){var r=new Z;return r.restart(e,t,n),r}function Ne(){Y(),++B;for(var e=H,t;e;)(t=G-e._time)>=0&&e._call.call(void 0,t),e=e._next;--B}function Pe(){G=(W=q.now())+K,B=V=0;try{Ne()}finally{B=0,Ie(),G=0}}function Fe(){var e=q.now(),t=e-W;t>je&&(K-=t,W=e)}function Ie(){for(var e,t=H,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:H=n);U=e,Le(r)}function Le(e){B||(V&&=clearTimeout(V),e-G>24?(e<1/0&&(V=setTimeout(Pe,e-q.now()-K)),Ae&&=clearInterval(Ae)):(Ae||=(W=q.now(),setInterval(Fe,je)),B=1,J(Pe)))}var Q=1664525,Re=1013904223,ze=4294967296;function Be(){let e=1;return()=>(e=(Q*e+Re)%ze)/ze}function Ve(e){return e.x}function He(e){return e.y}var Ue=10,We=Math.PI*(3-Math.sqrt(5));function Ge(e){var t,n=1,r=.001,i=1-r**(1/300),a=0,o=.6,s=new Map,c=Me(d),l=R(`tick`,`end`),u=Be();e??=[];function d(){f(),l.call(`tick`,t),n<r&&(c.stop(),l.call(`end`,t))}function f(r){var c,l=e.length,u;r===void 0&&(r=1);for(var d=0;d<r;++d)for(n+=(a-n)*i,s.forEach(function(e){e(n)}),c=0;c<l;++c)u=e[c],u.fx==null?u.x+=u.vx*=o:(u.x=u.fx,u.vx=0),u.fy==null?u.y+=u.vy*=o:(u.y=u.fy,u.vy=0);return t}function p(){for(var t=0,n=e.length,r;t<n;++t){if(r=e[t],r.index=t,r.fx!=null&&(r.x=r.fx),r.fy!=null&&(r.y=r.fy),isNaN(r.x)||isNaN(r.y)){var i=Ue*Math.sqrt(.5+t),a=t*We;r.x=i*Math.cos(a),r.y=i*Math.sin(a)}(isNaN(r.vx)||isNaN(r.vy))&&(r.vx=r.vy=0)}}function m(t){return t.initialize&&t.initialize(e,u),t}return p(),t={tick:f,restart:function(){return c.restart(d),t},stop:function(){return c.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),s.forEach(m),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(r=+e,t):r},alphaDecay:function(e){return arguments.length?(i=+e,t):+i},alphaTarget:function(e){return arguments.length?(a=+e,t):a},velocityDecay:function(e){return arguments.length?(o=1-e,t):1-o},randomSource:function(e){return arguments.length?(u=e,s.forEach(m),t):u},force:function(e,n){return arguments.length>1?(n==null?s.delete(e):s.set(e,m(n)),t):s.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i<a;++i)l=e[i],o=t-l.x,s=n-l.y,c=o*o+s*s,c<r&&(u=l,r=c);return u},on:function(e,n){return arguments.length>1?(l.on(e,n),t):l.on(e)}}}function Ke(){var e,t,n,r,i=M(-30),a,o=1,s=1/0,c=.81;function l(n){var i,a=e.length,o=Ce(e,Ve,He).visitAfter(d);for(r=n,i=0;i<a;++i)t=e[i],o.visit(f)}function u(){if(e){var t,n=e.length,r;for(a=Array(n),t=0;t<n;++t)r=e[t],a[r.index]=+i(r,t,e)}}function d(e){var t=0,n,r,i=0,o,s,c;if(e.length){for(o=s=c=0;c<4;++c)(n=e[c])&&(r=Math.abs(n.value))&&(t+=n.value,i+=r,o+=r*n.x,s+=r*n.y);e.x=o/i,e.y=s/i}else{n=e,n.x=n.data.x,n.y=n.data.y;do t+=a[n.data.index];while(n=n.next)}e.value=t}function f(e,i,l,u){if(!e.value)return!0;var d=e.x-t.x,f=e.y-t.y,p=u-i,m=d*d+f*f;if(p*p/c<m)return m<s&&(d===0&&(d=N(n),m+=d*d),f===0&&(f=N(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)),t.vx+=d*e.value*r/m,t.vy+=f*e.value*r/m),!0;if(!(e.length||m>=s)){(e.data!==t||e.next)&&(d===0&&(d=N(n),m+=d*d),f===0&&(f=N(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)));do e.data!==t&&(p=a[e.data.index]*r/m,t.vx+=d*p,t.vy+=f*p);while(e=e.next)}}return l.initialize=function(t,r){e=t,n=r,u()},l.strength=function(e){return arguments.length?(i=typeof e==`function`?e:M(+e),u(),l):i},l.distanceMin=function(e){return arguments.length?(o=e*e,l):Math.sqrt(o)},l.distanceMax=function(e){return arguments.length?(s=e*e,l):Math.sqrt(s)},l.theta=function(e){return arguments.length?(c=e*e,l):Math.sqrt(c)},l}function qe(e){var t=M(.1),n,r,i;typeof e!=`function`&&(e=M(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vx+=(i[t]-o.x)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:M(+e),o(),a):t},a.x=function(t){return arguments.length?(e=typeof t==`function`?t:M(+t),o(),a):e},a}function Je(e){var t=M(.1),n,r,i;typeof e!=`function`&&(e=M(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vy+=(i[t]-o.y)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:M(+e),o(),a):t},a.y=function(t){return arguments.length?(e=typeof t==`function`?t:M(+t),o(),a):e},a}var Ye=e(`<div class="debug-panel svelte-1i33fky"><label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="5" max="1000" step="5" class="svelte-1i33fky"/></label> <label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="0.5" max="5" step="0.1" class="svelte-1i33fky"/></label> <label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="30" max="500" step="10" class="svelte-1i33fky"/></label> <label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="0.01" max="0.5" step="0.01" class="svelte-1i33fky"/></label> <label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="-3000" max="-100" step="50" class="svelte-1i33fky"/></label> <label class="svelte-1i33fky"><span class="svelte-1i33fky"> </span><input type="range" min="10" max="100" step="5" class="svelte-1i33fky"/></label> <div class="debug-actions svelte-1i33fky"><button class="svelte-1i33fky">Regenerate</button> <button class="svelte-1i33fky">Copy params</button></div></div>`),Xe=e(`<div><span class="legend-dot svelte-1i33fky"></span> <span class="legend-label svelte-1i33fky"> </span> <span class="legend-count svelte-1i33fky"> </span></div>`),Ze=e(`<div class="graph-view svelte-1i33fky"><div class="canvas-wrap svelte-1i33fky"><!> <div class="legend-panel svelte-1i33fky"></div></div></div>`);function Qe(e,p){t(p,!0);let le=ne(p,`sidebarHoveredId`,3,null),T=ne(p,`highlightedIds`,3,null),ue=typeof window<`u`&&new URLSearchParams(window.location.search).get(`debug`)===`graph`,E=S(500),de=S(1.8),fe=S(100),D=S(.1),pe=S(-750),me=S(50),he=S(0),O=x(()=>{if(!ue)return p.graphData;m(he);let e=[`project`,`person`,`organization`,`event`,`task`,`document`,`note`,`service`,`case-study`,`deal`,`reference`,`deliverable`,`position`,`skill`,`deck`,`publication`],t=Array.from({length:m(E)},(t,n)=>({id:`sim-${n}`,type:e[n%e.length],repo:`folder-${n%5}`})),n=[],r=Math.floor(m(E)*m(de));for(let e=0;e<r;e++){let e=Math.floor(Math.random()*m(E)),t=Math.floor(Math.random()*m(E));t===e&&(t=(e+1)%m(E)),n.push({source:`sim-${e}`,target:`sim-${t}`})}return{nodes:t,edges:n}}),ge=x(()=>ue?{linkDist:m(fe),centerStr:m(D),chargeStr:m(pe),collideR:m(me)}:null);function _e(e){return p.nameMap?.get(e)??e.replace(/-/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}let ve=s(`theme`),ye=x(()=>ve.current===`light`?{default:14211288,dim:15263976,conn:8947848,labelText:1710623}:{default:2763306,dim:1315860,conn:6710886,labelText:15592943}),be=x(()=>ve.current===`light`?16316666:592139),xe=.75;h(()=>{ve.current,X&&(X.style.fill=m(ye).labelText,X.style.stroke={color:m(be),width:5});let e=m(et);for(let t of j)w(t.type)===$e&&(t.color=e);Q()}),h(()=>{T(),Q()});function Se(e){return{linkDist:100,centerStr:.1,chargeStr:-750,collideR:50}}let Ce=!1;h(()=>{let e=m(O);if(m(ge),!Z||!W||!q)return;if(!Ce){Ce=!0;return}let t=new Map;for(let n of e.edges)t.set(n.source,(t.get(n.source)??0)+1),t.set(n.target,(t.get(n.target)??0)+1);let n=new Map;for(let e of j)n.set(e.id,{x:e.x,y:e.y});let r=3600*e.nodes.length,i=Math.sqrt(r),a=Math.max(0,...t.values()),o=e.nodes.map(e=>{let r=t.get(e.id)??0,o=n.get(e.id);return{id:e.id,type:e.type,repo:e.repo,color:w(e.type)===$e?m(et):w(e.type),weight:r,x:o?.x??(Math.random()-.5)*i,y:o?.y??(Math.random()-.5)*i,vx:0,vy:0,r:Me(r,a)}}),s=new Map;for(let e of o)s.set(e.id,e);let c=new Set(Y.keys()),l=new Set(e.nodes.map(e=>e.id));for(let e of c)if(!l.has(e)){let t=Y.get(e);t&&(t.parent===J?J.removeChild(t):q.removeChild(t),t.destroy()),Y.delete(e)}let u=null;if(Y.size>0&&(u=Y.values().next().value?.texture),!u){let e=document.createElement(`canvas`);e.width=100,e.height=100;let t=e.getContext(`2d`);t.beginPath(),t.arc(50,50,48,0,Math.PI*2),t.fillStyle=`#ffffff`,t.fill(),u=Z.Texture.from(e)}for(let e of o){let t=Y.get(e.id);t||(t=new Z.Sprite(u),t.anchor.set(.5),q.addChild(t),Y.set(e.id,t)),t.tint=Re(e.color)}j=o,A?.stop();let d=e.edges.map(e=>({source:e.source,target:e.target})),f=m(ge)??Se(j.length),p=Ee(d).id(e=>e.id).distance(f.linkDist);A=Ge(j).force(`link`,p).force(`charge`,Ke().strength(f.chargeStr).distanceMin(30)).force(`x`,qe(0).strength(f.centerStr)).force(`y`,Je(0).strength(f.centerStr)).force(`collide`,Te().radius(f.collideR).strength(.5)).velocityDecay(.4).alpha(.3).on(`tick`,()=>{Ae||Le(),Q()}),M=p.links(),L=null,Ie(),Q()}),h(()=>{let e=le();if(e){let t=j.find(t=>t.id===e)??null;L=t,Ie(),U=+!!t}else R||(U=0);Q()});let k,A=null,j=[],M=[],N=!1,we=0,P=0,F=0,I=1,L=null,R=null,z=S(!1),De=0,Oe=0,ke=0,B=0,V=new Set,Ae=!1,je=S(null),H=0,U=0,W=null,G=null,K=null,q=null,J=null,Y=new Map,X=null,Z=null;function Me(e,t){return 5}function Ne(e,t){let n=k.getBoundingClientRect();return{x:(e-n.left-P)/I,y:(t-n.top-F)/I}}function Pe(e,t){for(let n=j.length-1;n>=0;n--){let r=j[n],i=e-r.x,a=t-r.y,o=(r.r*1.5+4)/I;if(i*i+a*a<=o*o)return r}return null}let Fe=new Set;function Ie(){let e=L??null;if(q&&J)for(let e of Fe){let t=Y.get(e);t&&t.parent===J&&(J.removeChild(t),q.addChild(t))}if(V.clear(),Fe.clear(),e){V.add(e.id);for(let t of M)t.source.id===e.id&&V.add(t.target.id),t.target.id===e.id&&V.add(t.source.id);if(Fe=new Set(V),q&&J)for(let e of V){let t=Y.get(e);t&&t.parent===q&&(q.removeChild(t),J.addChild(t))}}}function Le(){if(j.length===0||!k)return;let e=1/0,t=-1/0,n=1/0,r=-1/0,i=0;for(let a of j)a.x<e&&(e=a.x),a.x>t&&(t=a.x),a.y<n&&(n=a.y),a.y>r&&(r=a.y),a.r>i&&(i=a.r);let a=k.clientWidth,o=k.clientHeight,s=t-e,c=r-n,l=(60+i)*2;I=s>0&&c>0?Math.min((a-l)/s,(o-l)/c,3):s>0?Math.min((a-l)/s,3):c>0?Math.min((o-l)/c,3):1,P=a/2-(e+t)/2*I,F=o/2-(n+r)/2*I,Q()}function Q(){N=!0,we=0}function Re(e){return parseInt(e.replace(`#`,``),16)}function ze(e,t,n){let r=(e>>16&255)+n*((t>>16&255)-(e>>16&255)),i=(e>>8&255)+n*((t>>8&255)-(e>>8&255)),a=(e&255)+n*((t&255)-(e&255));return Math.round(r)<<16|Math.round(i)<<8|Math.round(a)}function Be(){if(!Z||!G||!K)return;G.clear(),K.clear();let e=L,t=e!==null,n=H,r=m(je),i=T(),a=m(ye).default,o=m(ye).dim,s=m(ye).conn;for(let c=0;c<M.length;c++){let l=M[c],u=l.source.x*I+P,d=l.source.y*I+F,f=l.target.x*I+P,p=l.target.y*I+F,m=t&&n>.01&&(l.source===e||l.target===e)&&V.has(l.source.id)&&V.has(l.target.id),h=a;t&&n>.01?h=m?ze(a,s,n):ze(a,o,n):r===null?i!==null&&(h=o):h=o;let g=m?K:G;g.setStrokeStyle({width:1,color:h}),g.moveTo(u,d),g.lineTo(f,p),g.stroke()}}function Ve(){if(!Z)return;let e=L,t=e!==null,n=H,r=m(je),i=T();for(let a of j){let o=Y.get(a.id);if(!o)continue;let s=a.x*I+P,c=a.y*I+F;o.position.set(s,c),o.scale.set(a.r/50),o.alpha=1;let l=Re(a.color);{let s=a===e,c=t&&V.has(a.id),u=r!==null&&(r===`other`?w(a.type)===$e:a.type===r);if(s&&n>.01)o.tint=l;else if(c)o.tint=l;else if(r!==null)o.tint=u?l:ze(l,m(be),xe);else if(i!==null){let e=i.has(a.id)?n*xe:xe;o.tint=ze(l,m(be),e)}else o.tint=ze(l,m(be),n*xe)}}if(e&&n>.01&&X){let t=e.x*I+P,r=e.y*I+F;X.text=_e(e.id),X.style.fontSize=14,X.position.set(t,r+e.r+8),X.alpha=n,X.visible=!0}else X&&(X.visible=!1)}let He=!1;function Ue(e){if(e.button!==0)return;He=!1;let t=Ne(e.clientX,e.clientY),n=Pe(t.x,t.y);n?(R=n,Ae=!0,n.fx=n.x,n.fy=n.y,A?.alphaTarget(.3).restart(),Q()):(C(z,!0),De=e.clientX,Oe=e.clientY,ke=P,B=F),k.setPointerCapture(e.pointerId),window.addEventListener(`pointerup`,Qe,{once:!0})}function We(e){if(R){He=!0;let t=Ne(e.clientX,e.clientY);R.fx=t.x,R.fy=t.y,Q()}else if(m(z))He=!0,P=ke+(e.clientX-De),F=B+(e.clientY-Oe),Q();else{let t=Ne(e.clientX,e.clientY),n=Pe(t.x,t.y);n?n===L?U!==1&&(U=1,k.style.cursor=`pointer`,Q()):(L&&(H=.15),L=n,Ie(),U=1,k.style.cursor=`pointer`,Q()):U!==0&&(U=0,k.style.cursor=`grab`,Q())}}function Qe(e){if(!R&&!m(z))return;window.removeEventListener(`pointerup`,Qe);let t=He;if(R){let e=R;R.fx=null,R.fy=null,A?.alphaTarget(0),R=null,U=0,Q(),t||se(`/${e.repo}/${e.type}/${e.id}`)}else m(z)&&C(z,!1);try{k.releasePointerCapture(e.pointerId)}catch{}}let $e=`#5c5c66`,et=x(()=>ve.current===`light`?`#b0b0b8`:$e),tt=x(()=>{let e=new Map;for(let t of m(O).nodes)e.set(t.type,(e.get(t.type)??0)+1);let t=[],n=0;for(let[r,i]of e){let e=w(r);e===$e?n+=i:t.push({name:r,color:e,count:i})}return t.sort((e,t)=>t.count-e.count),n>0&&t.push({name:`other`,color:m(et),count:n}),t});v(async()=>{Z=await ie(()=>import(`./h4WWBpcD2.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url),W=new Z.Application,await W.init({antialias:!0,resolution:window.devicePixelRatio||1,autoDensity:!0,backgroundAlpha:0,resizeTo:k}),k.insertBefore(W.canvas,k.firstChild),W.canvas.style.position=`absolute`,W.canvas.style.inset=`0`,G=new Z.Graphics,W.stage.addChild(G),q=new Z.Container,W.stage.addChild(q),K=new Z.Graphics,W.stage.addChild(K),J=new Z.Container,W.stage.addChild(J);let e=document.createElement(`canvas`);e.width=100,e.height=100;let t=e.getContext(`2d`);t.beginPath(),t.arc(50,50,48,0,Math.PI*2),t.fillStyle=`#ffffff`,t.fill();let n=Z.Texture.from(e),r=new Map;for(let e of m(O).edges)r.set(e.source,(r.get(e.source)??0)+1),r.set(e.target,(r.get(e.target)??0)+1);let i=new Map,a=m(O).nodes.length,o=3600*a,s=Math.sqrt(o),c=Math.max(0,...r.values());j=m(O).nodes.map(e=>{let t=r.get(e.id)??0,n={id:e.id,type:e.type,repo:e.repo,color:w(e.type)===$e?m(et):w(e.type),weight:t,x:(Math.random()-.5)*s,y:(Math.random()-.5)*s,vx:0,vy:0,r:Me(t,c)};return i.set(e.id,n),n});for(let e of j){let t=new Z.Sprite(n);t.anchor.set(.5),t.tint=Re(e.color),q.addChild(t),Y.set(e.id,t)}X=new Z.Text({text:``,style:{fontFamily:`IBM Plex Sans, system-ui, sans-serif`,fontWeight:`400`,fontSize:12,fill:m(ye).labelText,align:`center`,stroke:{color:m(be),width:5}}}),X.anchor.set(.5,0),X.visible=!1,W.stage.addChild(X);let l=m(O).edges.map(e=>({source:e.source,target:e.target})),u=m(ge)??Se(a),d=Ee(l).id(e=>e.id).distance(u.linkDist);A=Ge(j).force(`link`,d).force(`charge`,Ke().strength(u.chargeStr).distanceMin(30)).force(`x`,qe(0).strength(u.centerStr)).force(`y`,Je(0).strength(u.centerStr)).force(`collide`,Te().radius(u.collideR).strength(.5)).velocityDecay(.4).alpha(1).on(`tick`,()=>{Ae||Le(),Q()}),M=d.links();let f=0;W.ticker.add(()=>{let e=performance.now(),t=f?Math.min((e-f)/1e3,.05):.016;f=e,H<U?(H=Math.min(U,H+4*t),N=!0):H>U&&(H=Math.max(U,H-4*t),N=!0),H===0&&U===0&&L&&!R&&(L=null,Ie(),N=!0),(N||we<120)&&(Be(),Ve(),N=!1,we++)});let p=new ResizeObserver(()=>{W.renderer.resize(k.clientWidth,k.clientHeight),Le()});p.observe(k),nt=p,Ce=!0});let nt=null;te(()=>{nt?.disconnect(),A?.stop(),W&&=(W.destroy(!0,{children:!0}),null)});var rt=Ze(),$=b(rt);let it;var at=b($),ot=e=>{var t=Ye(),a=b(t),o=b(a),s=b(o);r(o);var c=_(o);ae(c),r(a);var l=_(a,2),d=b(l),p=b(d);r(d);var h=_(d);ae(h),r(l);var g=_(l,2),v=b(g),ee=b(v);r(v);var te=_(v);ae(te),r(g);var ne=_(g,2),ie=b(ne),x=b(ie);r(ie);var oe=_(ie);ae(oe),r(ne);var S=_(ne,2),se=b(S),ce=b(se);r(se);var w=_(se);ae(w),r(S);var le=_(S,2),T=b(le),ue=b(T);r(T);var O=_(T);ae(O),r(le);var ge=_(le,2),_e=b(ge),ve=_(_e,2);r(ge),r(t),re((e,t)=>{i(s,`Nodes: ${m(E)??``}`),i(p,`Edges/node: ${e??``}`),i(ee,`Link dist: ${m(fe)??``}`),i(x,`Center: ${t??``}`),i(ce,`Charge: ${m(pe)??``}`),i(ue,`Collide R: ${m(me)??``}`)},[()=>m(de).toFixed(1),()=>m(D).toFixed(2)]),n(`pointerdown`,t,e=>e.stopPropagation()),y(c,()=>m(E),e=>C(E,e)),y(h,()=>m(de),e=>C(de,e)),y(te,()=>m(fe),e=>C(fe,e)),y(oe,()=>m(D),e=>C(D,e)),y(w,()=>m(pe),e=>C(pe,e)),y(O,()=>m(me),e=>C(me,e)),n(`click`,_e,()=>{f(he)}),n(`click`,ve,()=>{let e=`forceParams(${m(E)}) = { linkDist: ${m(fe)}, centerStr: ${m(D)}, chargeStr: ${m(pe)}, collideR: ${m(me)} }`;navigator.clipboard.writeText(e)}),u(e,t)};c(at,e=>{ue&&e(ot)});var st=_(at,2);ee(st,21,()=>m(tt),o,(e,t)=>{var n=Xe();let o;var s=b(n);let c;var l=_(s,2),f=b(l,!0);r(l);var p=_(l,2),h=b(p,!0);r(p),r(n),re(e=>{o=d(n,1,`legend-item svelte-1i33fky`,null,o,{"legend-item-active":m(je)===m(t).name}),c=oe(s,``,c,{background:m(t).color}),i(f,e),i(h,m(t).count)},[()=>ce(m(t).name)]),a(`mouseenter`,n,()=>{C(je,m(t).name,!0),Q()}),a(`mouseleave`,n,()=>{C(je,null),Q()}),u(e,n)}),r(st),r($),g($,e=>k=e,()=>k),r(rt),re(()=>it=oe($,``,it,{cursor:m(z)?`grabbing`:`grab`})),n(`pointerdown`,$,Ue),n(`pointermove`,$,We),n(`pointerup`,$,Qe),n(`pointerdown`,st,e=>e.stopPropagation()),u(e,rt),l()}p([`pointerdown`,`pointermove`,`pointerup`,`click`]);export{Qe as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,Ft as t,Gt as n,H as r,Ht as i,P as a,Pt as o,R as s,Z as c,_ as l,c as u,k as d,l as f,mt as p,pt as m,q as h,s as g,wt as _,xt as v,yt as y,z as b}from"./CYTTTma0.js";import"./xihTtKlq.js";import"./BYokDzwE.js";import{A as x,D as S,P as C,R as w,St as T,T as E,_t as D,at as O,ct as k,et as A,gt as j,j as M,k as N,lt as P,ot as F,rt as I,st as L,vt as R}from"./DZEmjBTb.js";import{_ as z,g as B,h as V,m as H,p as U}from"./Cei8CKT4.js";function W(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]??[0,0],[c,l]=t[o]??[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function G(e,t){return e[0]>=t.left&&e[0]<=t.right&&e[1]>=t.top&&e[1]<=t.bottom}function K(e,t){let n=e.left+e.width/2,r=e.top+e.height/2,i=t.left+t.width/2,a=t.top+t.height/2,o=i-n,s=a-r;return Math.abs(o)>Math.abs(s)?o>0?`right`:`left`:s>0?`bottom`:`top`}var ee=class{#e;#t;#n;#r=null;#i=null;#a=[];#o=null;#s=null;#c=null;#l(){this.#s!==null&&(cancelAnimationFrame(this.#s),this.#s=null)}#u(){this.#l(),this.#s=requestAnimationFrame(()=>{this.#s=null,!(!this.#r||!this.#i)&&(this.#m(),this.#e.onPointerExit())})}#d(){this.#c!==null&&(clearTimeout(this.#c),this.#c=null)}#f(){this.#n!==null&&(this.#d(),this.#c=window.setTimeout(()=>{this.#c=null,!(!this.#r||!this.#i)&&(this.#m(),this.#e.onPointerExit())},this.#n))}constructor(e){this.#e=e,this.#t=e.buffer??1;let t=e.transitIntentTimeout;this.#n=typeof t==`number`&&t>0?t:null,j([e.triggerNode,e.contentNode,e.enabled],([e,t,n])=>{if(!e||!t||!n){this.#o=null,this.#m();return}return this.#o&&this.#o!==e&&this.#m(),this.#o=e,[h(P(e),`pointermove`,n=>{this.#p([n.clientX,n.clientY],e,t)}),h(e,`pointerleave`,e=>{let n=e.relatedTarget;if(C(n)&&t.contains(n))return;let r=this.#e.ignoredTargets?.()??[];C(n)&&r.some(e=>e===n||e.contains(n))||(this.#a=C(n)&&r.length>0?r.filter(e=>n.contains(e)):[],this.#r=[e.clientX,e.clientY],this.#i=`content`,this.#u())}),h(e,`pointerenter`,()=>{this.#m()}),h(t,`pointerenter`,()=>{this.#m()}),h(t,`pointerleave`,t=>{let n=t.relatedTarget;C(n)&&e.contains(n)||(this.#r=[t.clientX,t.clientY],this.#i=`trigger`,this.#u())})].reduce((e,t)=>()=>{e(),t()},()=>{})})}#p(e,t,n){if(!this.#r||!this.#i)return;this.#l(),this.#f();let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();if(this.#i===`content`&&G(e,i)){this.#m();return}if(this.#i===`trigger`&&G(e,r)){this.#m();return}if(this.#i===`content`&&this.#a.length>0)for(let t of this.#a){let n=t.getBoundingClientRect();if(G(e,n))return;let i=K(r,n),a=this.#h(r,n,i);if(a&&W(e,a))return}let a=K(r,i),o=this.#h(r,i,a);if(o&&W(e,o))return;let s=this.#i===`content`?i:r;W(e,this.#g(this.#r,s,a,this.#i))||(this.#m(),this.#e.onPointerExit())}#m(){this.#r=null,this.#i=null,this.#a=[],this.#l(),this.#d()}#h(e,t,n){let r=this.#t;switch(n){case`top`:return[[Math.min(e.left,t.left)-r,e.top],[Math.min(e.left,t.left)-r,t.bottom],[Math.max(e.right,t.right)+r,t.bottom],[Math.max(e.right,t.right)+r,e.top]];case`bottom`:return[[Math.min(e.left,t.left)-r,e.bottom],[Math.min(e.left,t.left)-r,t.top],[Math.max(e.right,t.right)+r,t.top],[Math.max(e.right,t.right)+r,e.bottom]];case`left`:return[[e.left,Math.min(e.top,t.top)-r],[t.right,Math.min(e.top,t.top)-r],[t.right,Math.max(e.bottom,t.bottom)+r],[e.left,Math.max(e.bottom,t.bottom)+r]];case`right`:return[[e.right,Math.min(e.top,t.top)-r],[t.left,Math.min(e.top,t.top)-r],[t.left,Math.max(e.bottom,t.bottom)+r],[e.right,Math.max(e.bottom,t.bottom)+r]]}}#g(e,t,n,r){let i=this.#t*4,[a,o]=e;switch(r===`trigger`?this.#_(n):n){case`top`:return[[a-i,o+i],[a+i,o+i],[t.right+i,t.bottom],[t.right+i,t.top],[t.left-i,t.top],[t.left-i,t.bottom]];case`bottom`:return[[a-i,o-i],[a+i,o-i],[t.right+i,t.top],[t.right+i,t.bottom],[t.left-i,t.bottom],[t.left-i,t.top]];case`left`:return[[a+i,o-i],[a+i,o+i],[t.right,t.bottom+i],[t.left,t.bottom+i],[t.left,t.top-i],[t.right,t.top-i]];case`right`:return[[a-i,o-i],[a-i,o+i],[t.left,t.bottom+i],[t.right,t.bottom+i],[t.right,t.top-i],[t.left,t.top-i]]}}#_(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`}}},q=I({component:`popover`,parts:[`root`,`trigger`,`content`,`close`,`overlay`]}),J=new D(`Popover.Root`),Y=class e{static create(t){return J.set(new e(t))}opts;#e=v(null);get contentNode(){return c(this.#e)}set contentNode(e){y(this.#e,e,!0)}contentPresence;#t=v(null);get triggerNode(){return c(this.#t)}set triggerNode(e){y(this.#t,e,!0)}#n=v(null);get overlayNode(){return c(this.#n)}set overlayNode(e){y(this.#n,e,!0)}overlayPresence;#r=v(!1);get openedViaHover(){return c(this.#r)}set openedViaHover(e){y(this.#r,e,!0)}#i=v(!1);get hasInteractedWithContent(){return c(this.#i)}set hasInteractedWithContent(e){y(this.#i,e,!0)}#a=v(!1);get hoverCooldown(){return c(this.#a)}set hoverCooldown(e){y(this.#a,e,!0)}#o=v(0);get closeDelay(){return c(this.#o)}set closeDelay(e){y(this.#o,e,!0)}#s=null;#c=null;constructor(e){this.opts=e,this.contentPresence=new M({ref:T(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new M({ref:T(()=>this.overlayNode),open:this.opts.open}),j(()=>this.opts.open.current,e=>{e||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#l())})}setDomContext(e){this.#c=e}#l(){this.#s!==null&&this.#c&&(this.#c.clearTimeout(this.#s),this.#s=null)}toggleOpen(){this.#l(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#l(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#l(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#l(),this.closeDelay<=0?this.opts.open.current=!1:this.#c&&(this.#s=this.#c.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#s=null},this.closeDelay))))}cancelDelayedClose(){this.#l()}markInteraction(){this.hasInteractedWithContent=!0,this.#l()}},X=class e{static create(t){return new e(t,J.get())}opts;root;attachment;domContext;#e=null;#t=null;#n=v(!1);constructor(e,t){this.opts=e,this.root=t,this.attachment=L(this.opts.ref,e=>this.root.triggerNode=e),this.domContext=new k(e.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),j(()=>this.opts.closeDelay.current,e=>{this.root.closeDelay=e})}#r(){this.#e!==null&&(this.domContext.clearTimeout(this.#e),this.#e=null)}#i(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#a(){this.#r(),this.#i()}onpointerenter(e){if(this.opts.disabled.current||!this.opts.openOnHover.current||w(e)||(y(this.#n,!0),this.#i(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;let t=this.opts.openDelay.current;t<=0?this.root.handleHoverOpen():this.#e=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#e=null},t)}onpointerleave(e){this.opts.disabled.current||this.opts.openOnHover.current&&(w(e)||(y(this.#n,!1),this.#r(),this.root.hoverCooldown=!1))}onclick(e){if(!this.opts.disabled.current&&e.button===0){if(this.#a(),c(this.#n)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}c(this.#n)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(e){this.opts.disabled.current||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.#a(),this.root.toggleOpen())}#o(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#s=_(()=>({id:this.opts.id.current,"aria-haspopup":`dialog`,"aria-expanded":A(this.root.opts.open.current),"data-state":O(this.root.opts.open.current),"aria-controls":this.#o(),[q.trigger]:``,disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return c(this.#s)}set props(e){y(this.#s,e)}},Z=class e{static create(t){return new e(t,J.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=L(this.opts.ref,e=>this.root.contentNode=e),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new ee({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(e){this.root.markInteraction()}onfocusin(e){let t=e.target;C(t)&&E(t)&&this.root.markInteraction()}onpointerenter(e){w(e)||this.root.cancelDelayedClose()}onpointerleave(e){w(e)}onInteractOutside=e=>{if(this.opts.onInteractOutside.current(e),e.defaultPrevented||!C(e.target))return;let t=e.target.closest(q.selector(`trigger`));if(!(t&&t===this.root.triggerNode)){if(this.opts.customAnchor.current){if(C(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(e.target))return}else if(typeof this.opts.customAnchor.current==`string`){let t=document.querySelector(this.opts.customAnchor.current);if(t&&t.contains(e.target))return}}this.root.handleClose()}};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#e=_(()=>({open:this.root.opts.open.current}));get snippetProps(){return c(this.#e)}set snippetProps(e){y(this.#e,e)}#t=_(()=>({id:this.opts.id.current,tabindex:-1,"data-state":O(this.root.opts.open.current),...F(this.root.contentPresence.transitionStatus),[q.content]:``,style:{pointerEvents:`auto`,contain:`layout style`},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return c(this.#t)}set props(e){y(this.#t,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}},Q=e(`<div><div><!></div></div>`),te=e(`<div><div><!></div></div>`);function $(e,h){let v=r();t(h,!0);let y=g(h,`ref`,15,null),S=g(h,`id`,19,()=>N(v)),C=g(h,`forceMount`,3,!1),w=g(h,`onOpenAutoFocus`,3,x),E=g(h,`onCloseAutoFocus`,3,x),D=g(h,`onEscapeKeydown`,3,x),O=g(h,`onInteractOutside`,3,x),k=g(h,`trapFocus`,3,!0),A=g(h,`preventScroll`,3,!1),j=g(h,`customAnchor`,3,null),M=u(h,[`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`forceMount`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`customAnchor`,`style`]),P=Z.create({id:T(()=>S()),ref:T(()=>y(),e=>y(e)),onInteractOutside:T(()=>O()),onEscapeKeydown:T(()=>D()),customAnchor:T(()=>j())}),F=_(()=>R(M,P.props)),I=_(()=>k()&&P.shouldTrapFocus);function L(e){P.shouldTrapFocus||e.preventDefault(),w()(e)}var B=b(),V=p(B),W=e=>{U(e,f(()=>c(F),()=>P.popperProps,{get ref(){return P.opts.ref},get enabled(){return P.root.opts.open.current},get id(){return S()},get trapFocus(){return c(I)},get preventScroll(){return A()},loop:!0,forceMount:!0,get customAnchor(){return j()},onOpenAutoFocus:L,get onCloseAutoFocus(){return E()},get shouldRender(){return P.shouldRender},popper:(e,t)=>{let r=()=>t?.().props,o=()=>t?.().wrapperProps,u=_(()=>R(r(),{style:z(`popover`)},{style:h.style}));var f=b(),g=p(f),v=e=>{var t=b(),n=p(t);{let e=_(()=>({props:c(u),wrapperProps:o(),...P.snippetProps}));d(n,()=>h.child,()=>c(e))}s(e,t)},y=e=>{var t=Q();l(t,()=>({...o()}));var r=m(t);l(r,()=>({...c(u)})),d(m(r),()=>h.children??n),i(r),i(t),s(e,t)};a(g,e=>{h.child?e(v):e(y,-1)}),s(e,f)},$$slots:{popper:!0}}))},G=e=>{H(e,f(()=>c(F),()=>P.popperProps,{get ref(){return P.opts.ref},get open(){return P.root.opts.open.current},get id(){return S()},get trapFocus(){return c(I)},get preventScroll(){return A()},loop:!0,forceMount:!1,get customAnchor(){return j()},onOpenAutoFocus:L,get onCloseAutoFocus(){return E()},get shouldRender(){return P.shouldRender},popper:(e,t)=>{let r=()=>t?.().props,o=()=>t?.().wrapperProps,u=_(()=>R(r(),{style:z(`popover`)},{style:h.style}));var f=b(),g=p(f),v=e=>{var t=b(),n=p(t);{let e=_(()=>({props:c(u),wrapperProps:o(),...P.snippetProps}));d(n,()=>h.child,()=>c(e))}s(e,t)},y=e=>{var t=te();l(t,()=>({...o()}));var r=m(t);l(r,()=>({...c(u)})),d(m(r),()=>h.children??n),i(r),i(t),s(e,t)};a(g,e=>{h.child?e(v):e(y,-1)}),s(e,f)},$$slots:{popper:!0}}))};a(V,e=>{C()?e(W):C()||e(G,1)}),s(e,B),o()}var ne=e(`<button><!></button>`);function re(e,f){let h=r();t(f,!0);let v=g(f,`id`,19,()=>N(h)),y=g(f,`ref`,15,null),x=g(f,`type`,3,`button`),S=g(f,`disabled`,3,!1),C=g(f,`openOnHover`,3,!1),w=g(f,`openDelay`,3,700),E=g(f,`closeDelay`,3,300),D=u(f,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`type`,`disabled`,`openOnHover`,`openDelay`,`closeDelay`]),O=X.create({id:T(()=>v()),ref:T(()=>y(),e=>y(e)),disabled:T(()=>!!S()),openOnHover:T(()=>C()),openDelay:T(()=>w()),closeDelay:T(()=>E())}),k=_(()=>R(D,O.props,{type:x()}));V(e,{get id(){return v()},get ref(){return O.opts.ref},children:(e,t)=>{var r=b(),o=p(r),u=e=>{var t=b();d(p(t),()=>f.child,()=>({props:c(k)})),s(e,t)},h=e=>{var t=ne();l(t,()=>({...c(k)})),d(m(t),()=>f.children??n),i(t),s(e,t)};a(o,e=>{f.child?e(u):e(h,-1)}),s(e,r)},$$slots:{default:!0}}),o()}function ie(e,r){t(r,!0);let i=g(r,`open`,15,!1),a=g(r,`onOpenChange`,3,x),c=g(r,`onOpenChangeComplete`,3,x);Y.create({open:T(()=>i(),e=>{i(e),a()(e)}),onOpenChangeComplete:T(()=>c())}),B(e,{children:(e,t)=>{var i=b();d(p(i),()=>r.children??n),s(e,i)},$$slots:{default:!0}}),o()}var ae=ie,oe=re,se=$,ce=S;export{oe as i,ce as n,ae as r,se as t};
|