studiograph 1.3.44-next.12 → 1.3.44-next.13
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/{4.CjSyz-ka.css → 4.DNq68wHi.css} +1 -1
- package/dist/web/_app/immutable/chunks/{ghYWEYsA.js → AtgAMDzg.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CjNv-xfA.js → BEGjic-p.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BdF6nRVd.js → BJBX4SKZ.js} +1 -1
- package/dist/web/_app/immutable/chunks/{SezKq9uq.js → BYR-dNJ1.js} +1 -1
- package/dist/web/_app/immutable/chunks/{gawey_BW.js → BZEMt5cm.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BtBweNkk.js → Bk8fVkoK.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CULlunSW.js → BsdMYUpR.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DhsBMOEB.js → Btb43C3I.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DNUv-Uzw.js → BvV0_74V.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D94pMxcD.js → C6o4-5Jc.js} +1 -1
- package/dist/web/_app/immutable/chunks/{OZfYVFGq.js → C8Y6xIC4.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BnpnuDO4.js → CHat18Z1.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CkIXD8Ce.js → CIhtHHtB.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CO5wfegi.js → CcZpH1ju.js} +1 -1
- package/dist/web/_app/immutable/chunks/{faGDeGnG.js → CrUJgkXY.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DWhD9HmY.js → CzDsEODJ.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DKpxka9y.js → D1SfcMkP.js} +1 -1
- package/dist/web/_app/immutable/chunks/{4uEV2Hr-.js → D3QkosGt.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BSSN_IAc.js → D6Lva3KM.js} +1 -1
- package/dist/web/_app/immutable/chunks/{2U5cDetP.js → D6cVys5p.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B4jNhkRC.js → DLWveUsw.js} +1 -1
- package/dist/web/_app/immutable/chunks/{VY_jCQSj.js → DWXBtS4C.js} +1 -1
- package/dist/web/_app/immutable/chunks/{9rXsO0Bz.js → DYvpKXdA.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CMI65_Ir.js → DmbGlfj8.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Mvm7cCyj.js → DvO9pXIe.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BdOJnB5W.js → DxfAvVJc.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CiAwDBAJ.js → EihZTlx6.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DycWivyI.js → LMiDqdV2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BoNse1V-.js → MumxzvFg.js} +2 -2
- package/dist/web/_app/immutable/chunks/{Dp_zRVHI.js → Z7amP7yh.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BKUmpdNY.js → Zhai-RNf.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CTfMb0oB.js → bJHY9GmW.js} +1 -1
- package/dist/web/_app/immutable/chunks/{sZJoCX5N.js → e913tUZv.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DGKjST9y.js → eJ_5ITus.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DNrFMx27.js → iZnTs-Zk.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CoRi7XbI.js → nvDiOb2E.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DvmL5xMZ.js → xwFtwYnE.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.BiO88JKH.js → app.6jFeVTd5.js} +2 -2
- package/dist/web/_app/immutable/entry/start.Br78T-IN.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.-Fq-P-fg.js → 0.BdgXr-pL.js} +2 -2
- package/dist/web/_app/immutable/nodes/{1.Bj94GCTw.js → 1.TbRWZdMF.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.B1JUjZcN.js → 10.BKT_t6uj.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.DbJJGTYK.js → 2.BxoTrZf-.js} +2 -2
- package/dist/web/_app/immutable/nodes/{3.BStU0zpq.js → 3.BN2A-Xvj.js} +1 -1
- package/dist/web/_app/immutable/nodes/4.lZR-3hqX.js +11 -0
- package/dist/web/_app/immutable/nodes/{5.DcYhXUvQ.js → 5.bQNmtfyR.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.BxPKkt5p.js → 6.pIg7-OuF.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.i-KdHiwM.js → 7.GE6wU3-T.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.yX2RINiS.js → 8.BdAUYAfR.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.D4pcpEFX.js → 9.BB838-uI.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +11 -11
- package/package.json +1 -1
- package/dist/web/_app/immutable/entry/start.CeMi0H2l.js +0 -1
- package/dist/web/_app/immutable/nodes/4.--9JZZZj.js +0 -11
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DnL9f0lc.js","../chunks/CX_61fY8.js","../chunks/CscoF-YL.js","../chunks/D7ZqAKi9.js","../chunks/C7VoTosa.js","../chunks/CrdV0ttd.js","../chunks/CWQRQXxy.js","../chunks/B340SUKR.js","../chunks/D1SfcMkP.js","../chunks/CLFba8FK.js","../chunks/MumxzvFg.js","../chunks/PPVm8Dsz.js","../chunks/e913tUZv.js","../chunks/BsdMYUpR.js","../chunks/xwFtwYnE.js","../chunks/C8Y6xIC4.js","../chunks/Bk8fVkoK.js","../chunks/CIhtHHtB.js","../chunks/BJBX4SKZ.js","../chunks/i9c_RUF6.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{h as Ra,w as xt,k as Ta}from"../chunks/xwFtwYnE.js";import{_ as Xe}from"../chunks/PPVm8Dsz.js";import{d as Bt,e as qe,g as ft,a as p,c as We,t as dt,s as ie,b as j,f as mt}from"../chunks/BJBX4SKZ.js";import{aA as Da,a7 as ma,p as nt,e as Oe,f as ht,a2 as ut,aE as Oa,c as _,a3 as I,r as d,g as e,s as y,b as rt,a0 as Se,n as Be,t as ce,a4 as Pe,l as pt,d as et,a as Ht,m as _t,bt as ya,ax as Lt,a1 as La,aD as za,aF as wa}from"../chunks/e913tUZv.js";import{i as ye,b as Yt}from"../chunks/D6Lva3KM.js";import{e as Ne,i as Ve}from"../chunks/BZEMt5cm.js";import{c as Ue}from"../chunks/D3QkosGt.js";import{s as Ct,c as Fa}from"../chunks/C8Y6xIC4.js";import{p as Je,l as gt,a as Ma,b as Ia}from"../chunks/iZnTs-Zk.js";import{g as zt,i as ja}from"../chunks/BsdMYUpR.js";import{A as Wt,p as Ka}from"../chunks/DmbGlfj8.js";import{a as Kt,V as Ua}from"../chunks/BEGjic-p.js";import{r as Mt,a as Zt,c as Qe,d as na,b as Na}from"../chunks/Zhai-RNf.js";import{b as ka,B as Ze}from"../chunks/DYvpKXdA.js";import{e as Ft,f as vt,A as qa}from"../chunks/CdeYcEuU.js";import{T as sa,P as ia,C as oa,I as ta,S as Va,a as Ut,R as la,p as ca,b as Wa}from"../chunks/bJHY9GmW.js";import{i as Jt}from"../chunks/CrUJgkXY.js";import{T as Ba,j as Ha,r as Ya}from"../chunks/D6cVys5p.js";import{a as ua,C as ba}from"../chunks/LMiDqdV2.js";import{C as Za}from"../chunks/nvDiOb2E.js";import{g as Ja}from"../chunks/CqkleIqs.js";import{C as da}from"../chunks/DLWveUsw.js";import{n as aa}from"../chunks/CIhtHHtB.js";import{e as Ye,r as Qa}from"../chunks/MumxzvFg.js";import{chatStore as Ga}from"../chunks/DvO9pXIe.js";import{A as Xa,q as $a,r as en,s as tn,t as an,u as nn,x as rn}from"../chunks/DxfAvVJc.js";import{a as fa}from"../chunks/Bk8fVkoK.js";function sn(Y,t,l){Da(()=>{var i=ma(()=>t(Y,l?.())||{});if(i?.destroy)return()=>i.destroy()})}const on=async({params:Y,fetch:t})=>{const{repo:l,type:i,id:f}=Y,R=await Ra(l,i,f);return{repo:l,type:i,id:f,entity:R}},ks=Object.freeze(Object.defineProperty({__proto__:null,load:on},Symbol.toStringTag,{value:"Module"}));var ln=j('<span class="chip svelte-84vb17"> <!></span>'),cn=j('<div><span class="entity-title svelte-84vb17"> </span> <span class="entity-meta svelte-84vb17"><span class="entity-type-badge svelte-84vb17"> </span> <span class="entity-repo svelte-84vb17"> </span></span></div>'),un=j('<div class="dropdown svelte-84vb17"></div>'),dn=j('<div class="autocomplete svelte-84vb17"><div class="input-row svelte-84vb17"><!> <input class="ac-input svelte-84vb17" type="text" placeholder="Search entities..."/></div> <!></div>');function fn(Y,t){nt(t,!0);let l=Je(t,"multi",3,!1),i=Oe(""),f=Oe(0),R;const O=Pe(()=>xt.repos.flatMap(C=>C.entities.map(x=>({id:x.id,title:x.title,entityType:x.entityType,repo:C.name})))),b=Pe(()=>()=>{const C=e(i).toLowerCase().trim();return C?e(O).filter(x=>x.title.toLowerCase().includes(C)||x.id.toLowerCase().includes(C)).slice(0,20):e(O).slice(0,20)}),E=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let c=Oe(ht(E));ut(()=>{Oa().then(()=>R?.focus())});function S(C){l()?(e(c).includes(C)||y(c,[...e(c),C],!0),y(i,""),y(f,0),R?.focus()):t.onselect(C)}function N(C){y(c,e(c).filter(x=>x!==C),!0)}function A(){e(c).length===E.length&&e(c).every((x,a)=>x===E[a])?t.oncancel():t.onselect(e(c))}function M(C){const x=e(b)();C.key==="ArrowDown"?(C.preventDefault(),y(f,Math.min(e(f)+1,x.length-1),!0)):C.key==="ArrowUp"?(C.preventDefault(),y(f,Math.max(e(f)-1,0),!0)):C.key==="Enter"?(C.preventDefault(),x.length>0?S(x[e(f)].id):l()&&A()):C.key==="Escape"?l()&&e(c).length>0?A():t.oncancel():C.key==="Backspace"&&!e(i)&&l()&&e(c).length>0&&y(c,e(c).slice(0,-1),!0)}var we=dn(),L=_(we),ue=_(L);{var Re=C=>{var x=We(),a=Se(x);Ne(a,17,()=>e(c),Ve,(n,s)=>{var g=ln(),k=_(g),q=I(k);Ze(q,{variant:"ghost",size:"icon",class:"chip-remove",onclick:()=>N(e(s)),children:(oe,Te)=>{Be();var w=dt("×");p(oe,w)},$$slots:{default:!0}}),d(g),ce(()=>ie(k,`${e(s)??""} `)),p(n,g)}),p(C,x)};ye(ue,C=>{l()&&C(Re)})}var Z=I(ue,2);Mt(Z),Yt(Z,C=>R=C,()=>R),d(L);var B=I(L,2);{var ke=C=>{var x=un();Ne(x,21,()=>e(b)(),Ve,(a,n,s)=>{var g=cn();let k;var q=_(g),oe=_(q,!0);d(q);var Te=I(q,2),w=_(Te),v=_(w,!0);d(w);var h=I(w,2),P=_(h,!0);d(h),d(Te),d(g),ce(()=>{k=Ct(g,1,"dropdown-item svelte-84vb17",null,k,{highlighted:s===e(f)}),ie(oe,e(n).title),ie(v,e(n).entityType),ie(P,e(n).repo)}),qe("mousedown",g,G=>{G.preventDefault(),S(e(n).id)}),ft("mouseenter",g,()=>y(f,s,!0)),p(a,g)}),d(x),p(C,x)},re=Pe(()=>e(b)().length>0);ye(B,C=>{e(re)&&C(ke)})}d(we),qe("keydown",Z,M),ft("blur",Z,()=>{setTimeout(()=>{l()&&e(c).length>0?A():l()||t.oncancel()},150)}),ka(Z,()=>e(i),C=>y(i,C)),p(Y,we),rt()}Bt(["keydown","mousedown"]);var vn=mt("<title> </title>"),hn=mt('<svg><!><circle cx="16" cy="16" r="10"></circle><path d="M16,30A14,14,0,1,1,30,16,14.0158,14.0158,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12.0137,12.0137,0,0,0,16,4Z"></path></svg>');function Nt(Y,t){const l=gt(t,["children","$$slots","$$events","$$legacy"]),i=gt(l,["size","title"]);nt(t,!1);const f=_t(),R=_t();let O=Je(t,"size",8,16),b=Je(t,"title",8,void 0);pt(()=>(et(l),et(b())),()=>{y(f,l["aria-label"]||l["aria-labelledby"]||b())}),pt(()=>(e(f),et(l)),()=>{y(R,{"aria-hidden":e(f)?void 0:!0,role:e(f)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),Ht(),Jt();var E=hn();Zt(E,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:O(),height:O(),...e(R),...i}));var c=_(E);{var S=N=>{var A=vn(),M=_(A,!0);d(A),ce(()=>ie(M,b())),p(N,A)};ye(c,N=>{b()&&N(S)})}Be(2),d(E),p(Y,E),rt()}var pn=mt("<title> </title>"),_n=mt('<svg><!><path d="M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"></path><path d="M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"></path></svg>');function qt(Y,t){const l=gt(t,["children","$$slots","$$events","$$legacy"]),i=gt(l,["size","title"]);nt(t,!1);const f=_t(),R=_t();let O=Je(t,"size",8,16),b=Je(t,"title",8,void 0);pt(()=>(et(l),et(b())),()=>{y(f,l["aria-label"]||l["aria-labelledby"]||b())}),pt(()=>(e(f),et(l)),()=>{y(R,{"aria-hidden":e(f)?void 0:!0,role:e(f)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),Ht(),Jt();var E=_n();Zt(E,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:O(),height:O(),...e(R),...i}));var c=_(E);{var S=N=>{var A=pn(),M=_(A,!0);d(A),ce(()=>ie(M,b())),p(N,A)};ye(c,N=>{b()&&N(S)})}Be(2),d(E),p(Y,E),rt()}var gn=mt("<title> </title>"),mn=mt('<svg><!><path d="M10,14a4,4,0,1,1,4-4A4.0045,4.0045,0,0,1,10,14Zm0-6a2,2,0,1,0,1.998,2.0044A2.002,2.002,0,0,0,10,8Z"></path><path d="M16.6436,29.4145,2.5858,15.3555A2,2,0,0,1,2,13.9414V4A2,2,0,0,1,4,2h9.9413a2,2,0,0,1,1.4142.5858L29.4144,16.6436a2.0005,2.0005,0,0,1,0,2.8285l-9.9424,9.9425a2.0008,2.0008,0,0,1-2.8285,0ZM4,4v9.9417L18.0578,28,28,18.0579,13.9416,4Z"></path></svg>');function xa(Y,t){const l=gt(t,["children","$$slots","$$events","$$legacy"]),i=gt(l,["size","title"]);nt(t,!1);const f=_t(),R=_t();let O=Je(t,"size",8,16),b=Je(t,"title",8,void 0);pt(()=>(et(l),et(b())),()=>{y(f,l["aria-label"]||l["aria-labelledby"]||b())}),pt(()=>(e(f),et(l)),()=>{y(R,{"aria-hidden":e(f)?void 0:!0,role:e(f)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),Ht(),Jt();var E=mn();Zt(E,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:O(),height:O(),...e(R),...i}));var c=_(E);{var S=N=>{var A=gn(),M=_(A,!0);d(A),ce(()=>ie(M,b())),p(N,A)};ye(c,N=>{b()&&N(S)})}Be(2),d(E),p(Y,E),rt()}var yn=j('<span class="ip-type-dot svelte-x7sio8"></span>'),wn=j('<span class="ip-menu-check svelte-x7sio8"><!></span>'),kn=j('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),bn=j('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),xn=j("<!> <!> <!>",1),Cn=j("<!> <!>",1),En=j('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),Sn=j('<span class="ip-status-dot svelte-x7sio8"></span> ',1),An=j('<div class="ip-status-wrap svelte-x7sio8"><div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div> <div class="ip-status-dropdown svelte-x7sio8"></div></div>'),Pn=j('<span class="ip-cal-wd svelte-x7sio8"> </span>'),Rn=j('<div class="ip-cal-week svelte-x7sio8"></div>'),Tn=j('<div class="ip-cal-wrap svelte-x7sio8"><span class="ip-date-text svelte-x7sio8"> </span> <div class="ip-cal-dropdown svelte-x7sio8"><div class="ip-cal-header svelte-x7sio8"><!> <span class="ip-cal-title svelte-x7sio8"> </span> <!></div> <div class="ip-cal-weekdays svelte-x7sio8"></div> <!></div></div>'),Dn=j('<span class="ip-type-dot svelte-x7sio8"></span> <span> </span>',1),On=j('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Ln=j('<span class="ip-type-dot svelte-x7sio8"></span> <span> </span> <!>',1),zn=j("<!> <!>",1),Fn=j('<span class="ip-etype-display svelte-x7sio8"> </span>'),Mn=j('<span class="ip-badge svelte-x7sio8"> </span>'),In=j('<div class="ip-wikilink-group svelte-x7sio8"></div>'),jn=j('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),Kn=j('<span class="ip-date-text svelte-x7sio8"> </span>'),Un=j('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),Nn=j('<span class="ip-text-value svelte-x7sio8"> </span>'),qn=j('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),Vn=j('<div class="ip-row ip-add-row svelte-x7sio8"><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"><input class="ip-add-key-input svelte-x7sio8" type="text" placeholder="Field name"/></div> <div class="ip-value svelte-x7sio8"></div></div>'),Wn=j("<!> <span>Add field</span>",1),Bn=j('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function Hn(Y,t){nt(t,!0);let l=Je(t,"editable",3,!1),i=Je(t,"autofocusKey",3,null),f=Je(t,"protectedKeys",19,()=>new Set);const R=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],O=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let b=Oe(null),E=Oe(!1),c=Oe(!1);ut(()=>{i()&&!e(c)&&t.properties.some(u=>u.key===i())&&(y(c,!0),requestAnimationFrame(()=>{y(b,i())})),i()||y(c,!1)});let S=Oe(""),N=Oe(void 0);function A(u){return u.replace(/[_-]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function M(u){switch(u.toLowerCase()){case"active":case"current":case"won":return"#3ecf8e";case"in-progress":case"open":return"#f0c246";case"inactive":case"lost":case"closed":case"former":return"#e54d4d";default:return"#5c5c66"}}function we(u){for(const r of xt.repos){const z=r.entities.find(le=>le.id===u);if(z){zt(`/${r.name}/${z.entityType}/${z.id}`);return}}}function L(u){return typeof u.value=="string"?u.value:u.value[0]}function ue(u){return/^https?:\/\//.test(u)}function Re(u){try{return new Date(u).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return u}}let Z=Oe(ht(new Date().getFullYear())),B=Oe(ht(new Date().getMonth()));const ke=["Su","Mo","Tu","We","Th","Fr","Sa"],re=["January","February","March","April","May","June","July","August","September","October","November","December"];function C(u,r){const z=new Date(u,r,1).getDay(),le=new Date(u,r+1,0).getDate(),T=new Date(u,r,0).getDate(),ae=[];let ee=[];for(let te=z-1;te>=0;te--){const pe=T-te,se=r===0?11:r-1,Ie=r===0?u-1:u;ee.push({day:pe,month:se,year:Ie,outside:!0})}for(let te=1;te<=le;te++)ee.push({day:te,month:r,year:u,outside:!1}),ee.length===7&&(ae.push(ee),ee=[]);if(ee.length>0){const te=r===11?0:r+1,pe=r===11?u+1:u;let se=1;for(;ee.length<7;)ee.push({day:se++,month:te,year:pe,outside:!0});ae.push(ee)}return ae}function x(u){const r=new Date;return u.day===r.getDate()&&u.month===r.getMonth()&&u.year===r.getFullYear()}function a(u,r){const z=r.slice(0,10).split("-");return u.year===+z[0]&&u.month===+z[1]-1&&u.day===+z[2]}function n(){e(B)===0?(y(B,11),Lt(Z,-1)):Lt(B,-1)}function s(){e(B)===11?(y(B,0),Lt(Z)):Lt(B)}function g(u){try{const r=u.slice(0,10).split("-");y(Z,+r[0]),y(B,+r[1]-1)}catch{const r=new Date;y(Z,r.getFullYear(),!0),y(B,r.getMonth(),!0)}}function k(u){requestAnimationFrame(()=>{u.focus(),u.select()})}function q(u){!l()||u.type==="badge"||u.type==="entity-type"||(u.type==="date"&&g(L(u)),y(b,u.key,!0))}function oe(u,r){t.onedit&&t.onedit(u,r),y(b,null)}function Te(u,r){const z=`${r.year}-${String(r.month+1).padStart(2,"0")}-${String(r.day).padStart(2,"0")}`;t.onedit&&t.onedit(u,z),y(b,null)}function w(u,r){t.ontypechange&&t.ontypechange(u,r)}function v(u){y(b,null),t.onremove&&t.onremove(u)}function h(){y(E,!0),y(S,""),requestAnimationFrame(()=>e(N)?.focus())}function P(){const u=e(S).trim();u&&t.onadd&&t.onadd(u,""),y(E,!1),y(S,"")}function G(){y(E,!1),y(S,"")}function K(u){u.key==="Enter"?(u.preventDefault(),P()):u.key==="Escape"&&G()}var W=Bn();ft("click",ya,()=>{y(b,null)});var m=_(W);Ne(m,17,()=>t.properties,u=>u.key,(u,r)=>{const z=Pe(()=>e(b)===e(r).key);var le=qn();let T;var ae=_(le),ee=_(ae);{var te=F=>{var H=yn();let U;ce(_e=>U=Qe(H,"",U,_e),[()=>({background:Ft(L(e(r)))})]),p(F,H)},pe=F=>{var H=We(),U=Se(H);Ue(U,()=>la,(_e,Ae)=>{Ae(_e,{children:(he,De)=>{var ze=Cn(),be=Se(ze);Ue(be,()=>sa,(Me,He)=>{He(Me,{class:"ip-icon-trigger",children:(ne,$)=>{var ge=We(),Ee=Se(ge);{var Le=je=>{Kt(je,{size:14})},$e=je=>{Nt(je,{size:14})},tt=je=>{qt(je,{size:14})},it=je=>{Ut(je,{size:14})};ye(Ee,je=>{e(r).type==="date"?je(Le):e(r).type==="status"?je($e,1):e(r).type==="wikilink"?je(tt,2):je(it,!1)})}p(ne,ge)},$$slots:{default:!0}})});var Fe=I(be,2);Ue(Fe,()=>ia,(Me,He)=>{He(Me,{children:(ne,$)=>{var ge=We(),Ee=Se(ge);Ue(Ee,()=>oa,(Le,$e)=>{$e(Le,{class:"ip-menu-content",sideOffset:4,align:"start",children:(tt,it)=>{var je=xn(),St=Se(je);Ne(St,17,()=>R,Ve,(at,Ge)=>{var st=We(),yt=Se(st);Ue(yt,()=>ta,(lt,ct)=>{ct(lt,{class:"ip-menu-item",onSelect:()=>w(e(r).key,e(Ge).type),children:(wt,Qt)=>{var kt=kn(),Pt=Se(kt),Gt=_(Pt);{var bt=Ke=>{Ut(Ke,{size:13})},It=Ke=>{Kt(Ke,{size:13})},Xt=Ke=>{Nt(Ke,{size:13})},$t=Ke=>{qt(Ke,{size:13})};ye(Gt,Ke=>{e(Ge).type==="text"?Ke(bt):e(Ge).type==="date"?Ke(It,1):e(Ge).type==="status"?Ke(Xt,2):e(Ge).type==="wikilink"&&Ke($t,3)})}d(Pt);var Rt=I(Pt,2),ea=_(Rt,!0);d(Rt);var ra=I(Rt,2);{var jt=Ke=>{var Et=wn(),Tt=_(Et);ua(Tt,{size:12}),d(Et),p(Ke,Et)};ye(ra,Ke=>{e(r).type===e(Ge).type&&Ke(jt)})}ce(()=>ie(ea,e(Ge).label)),p(wt,kt)},$$slots:{default:!0}})}),p(at,st)});var ot=I(St,2);Ue(ot,()=>Va,(at,Ge)=>{Ge(at,{class:"ip-menu-sep"})});var At=I(ot,2);Ue(At,()=>ta,(at,Ge)=>{Ge(at,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>v(e(r).key),children:(st,yt)=>{var lt=bn(),ct=Se(lt),wt=_(ct);Ba(wt,{size:13}),d(ct),Be(2),p(st,lt)},$$slots:{default:!0}})}),p(tt,je)},$$slots:{default:!0}})}),p(ne,ge)},$$slots:{default:!0}})}),p(he,ze)},$$slots:{default:!0}})}),p(F,H)},se=Pe(()=>l()&&e(r).type!=="badge"&&!f().has(e(r).key)),Ie=F=>{var H=We(),U=Se(H);{var _e=be=>{Kt(be,{size:14})},Ae=be=>{Nt(be,{size:14})},he=be=>{qt(be,{size:14})},De=be=>{xa(be,{size:14})},ze=be=>{Ut(be,{size:14})};ye(U,be=>{e(r).type==="date"?be(_e):e(r).type==="status"?be(Ae,1):e(r).type==="wikilink"?be(he,2):e(r).type==="badge"?be(De,3):be(ze,!1)})}p(F,H)};ye(ee,F=>{e(r).type==="entity-type"?F(te):e(se)?F(pe,1):e(r).type!=="entity-type"&&F(Ie,2)})}d(ae);var o=I(ae,2),D=_(o,!0);d(o);var de=I(o,2),Q=_(de);{var me=F=>{var H=En();Mt(H),sn(H,U=>k?.(U)),ce(U=>na(H,U),[()=>L(e(r))]),ft("blur",H,U=>{const _e=U.currentTarget.value;_e!==L(e(r))&&t.onedit?.(e(r).key,_e),y(b,null)}),qe("keydown",H,U=>{if(U.key==="Enter"){const _e=U.currentTarget.value;_e!==L(e(r))&&t.onedit?.(e(r).key,_e);const Ae=i()===e(r).key;y(b,null),U.preventDefault(),Ae&&t.onfocuseditor?.()}else U.key==="Escape"&&(U.currentTarget.value=L(e(r)),y(b,null))}),p(F,H)},xe=F=>{var H=An(),U=_(H),_e=_(U);let Ae;var he=I(_e,2),De=_(he,!0);d(he),d(U);var ze=I(U,2);Ne(ze,21,()=>O,Ve,(be,Fe)=>{{let Me=Pe(()=>L(e(r))===e(Fe)?"selected":"");Ze(be,{variant:"ghost",get class(){return`ip-status-option ${e(Me)??""}`},onclick:()=>oe(e(r).key,e(Fe)),children:(He,ne)=>{var $=Sn(),ge=Se($);let Ee;var Le=I(ge);ce($e=>{Ee=Qe(ge,"",Ee,$e),ie(Le,` ${e(Fe)??""}`)},[()=>({background:M(e(Fe))})]),p(He,$)},$$slots:{default:!0}})}}),d(ze),d(H),ce((be,Fe)=>{Ae=Qe(_e,"",Ae,be),ie(De,Fe)},[()=>({background:M(L(e(r)))}),()=>L(e(r))]),qe("click",H,be=>be.stopPropagation()),p(F,H)},fe=F=>{var H=Tn(),U=_(H),_e=_(U,!0);d(U);var Ae=I(U,2),he=_(Ae),De=_(he);Ze(De,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:n,children:(ne,$)=>{Za(ne,{size:14})},$$slots:{default:!0}});var ze=I(De,2),be=_(ze);d(ze);var Fe=I(ze,2);Ze(Fe,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:s,children:(ne,$)=>{ba(ne,{size:14})},$$slots:{default:!0}}),d(he);var Me=I(he,2);Ne(Me,21,()=>ke,Ve,(ne,$)=>{var ge=Pn(),Ee=_(ge,!0);d(ge),ce(()=>ie(Ee,e($))),p(ne,ge)}),d(Me);var He=I(Me,2);Ne(He,17,()=>C(e(Z),e(B)),Ve,(ne,$)=>{var ge=Rn();Ne(ge,21,()=>e($),Ve,(Ee,Le)=>{{let $e=Pe(()=>e(Le).outside?"outside":""),tt=Pe(()=>x(e(Le))?"today":""),it=Pe(()=>a(e(Le),L(e(r)))?"selected":"");Ze(Ee,{variant:"ghost",get class(){return`ip-cal-day ${e($e)??""} ${e(tt)??""} ${e(it)??""}`},onclick:()=>Te(e(r).key,e(Le)),children:(je,St)=>{Be();var ot=dt();ce(()=>ie(ot,e(Le).day)),p(je,ot)},$$slots:{default:!0}})}}),d(ge),p(ne,ge)}),d(Ae),d(H),ce(ne=>{ie(_e,ne),ie(be,`${re[e(B)]??""} ${e(Z)??""}`)},[()=>Re(L(e(r)))]),qe("click",H,ne=>ne.stopPropagation()),p(F,H)},Ce=F=>{{let H=Pe(()=>Array.isArray(e(r).value));fn(F,{get value(){return e(r).value},get multi(){return e(H)},onselect:U=>{t.onedit?.(e(r).key,U),y(b,null)},oncancel:()=>{y(b,null)}})}},X=F=>{var H=We(),U=Se(H);{var _e=ne=>{var $=We(),ge=Se($);Ue(ge,()=>la,(Ee,Le)=>{Le(Ee,{children:($e,tt)=>{var it=zn(),je=Se(it);Ue(je,()=>sa,(ot,At)=>{At(ot,{class:"ip-etype-trigger",onclick:at=>at.stopPropagation(),children:(at,Ge)=>{var st=Dn(),yt=Se(st);let lt;var ct=I(yt,2),wt=_(ct,!0);d(ct),ce((Qt,kt)=>{lt=Qe(yt,"",lt,Qt),ie(wt,kt)},[()=>({background:Ft(L(e(r)))}),()=>vt(L(e(r)))]),p(at,st)},$$slots:{default:!0}})});var St=I(je,2);Ue(St,()=>ia,(ot,At)=>{At(ot,{children:(at,Ge)=>{var st=We(),yt=Se(st);Ue(yt,()=>oa,(lt,ct)=>{ct(lt,{class:"ip-menu-content ip-etype-content",sideOffset:4,align:"start",children:(wt,Qt)=>{var kt=We(),Pt=Se(kt);Ne(Pt,17,()=>qa,Ve,(Gt,bt)=>{var It=We(),Xt=Se(It);Ue(Xt,()=>ta,($t,Rt)=>{Rt($t,{class:"ip-menu-item",onSelect:()=>{e(bt)!==L(e(r))&&t.onentitytypechange?.(e(bt))},children:(ea,ra)=>{var jt=Ln(),Ke=Se(jt);let Et;var Tt=I(Ke,2),Ca=_(Tt,!0);d(Tt);var Ea=I(Tt,2);{var Sa=Dt=>{var Ot=On(),Pa=_(Ot);ua(Pa,{size:12}),d(Ot),p(Dt,Ot)},Aa=Pe(()=>L(e(r))===e(bt));ye(Ea,Dt=>{e(Aa)&&Dt(Sa)})}ce((Dt,Ot)=>{Et=Qe(Ke,"",Et,Dt),ie(Ca,Ot)},[()=>({background:Ft(e(bt))}),()=>vt(e(bt))]),p(ea,jt)},$$slots:{default:!0}})}),p(Gt,It)}),p(wt,kt)},$$slots:{default:!0}})}),p(at,st)},$$slots:{default:!0}})}),p($e,it)},$$slots:{default:!0}})}),p(ne,$)},Ae=ne=>{var $=Fn(),ge=_($,!0);d($),ce(Ee=>ie(ge,Ee),[()=>vt(L(e(r)))]),p(ne,$)},he=ne=>{var $=Mn(),ge=_($,!0);d($),ce(Ee=>ie(ge,Ee),[()=>L(e(r))]),p(ne,$)},De=ne=>{var $=In();Ne($,21,()=>Array.isArray(e(r).value)?e(r).value:[e(r).value],Ve,(ge,Ee)=>{Ze(ge,{variant:"ghost",class:"ip-wikilink-chip",onclick:Le=>{Le.stopPropagation(),we(e(Ee))},children:(Le,$e)=>{Be();var tt=dt();ce(()=>ie(tt,e(Ee))),p(Le,tt)},$$slots:{default:!0}})}),d($),p(ne,$)},ze=ne=>{var $=jn(),ge=_($);let Ee;var Le=I(ge,2),$e=_(Le,!0);d(Le),d($),ce((tt,it)=>{Ee=Qe(ge,"",Ee,tt),ie($e,it)},[()=>({background:M(L(e(r)))}),()=>L(e(r))]),p(ne,$)},be=ne=>{var $=Kn(),ge=_($,!0);d($),ce(Ee=>ie(ge,Ee),[()=>Re(L(e(r)))]),p(ne,$)},Fe=ne=>{var $=Un(),ge=_($,!0);d($),ce((Ee,Le)=>{Na($,"href",Ee),ie(ge,Le)},[()=>L(e(r)),()=>L(e(r))]),qe("click",$,Ee=>Ee.stopPropagation()),p(ne,$)},Me=Pe(()=>ue(L(e(r)))),He=ne=>{var $=Nn(),ge=_($,!0);d($),ce(Ee=>ie(ge,Ee),[()=>L(e(r))]),p(ne,$)};ye(U,ne=>{e(r).type==="entity-type"&&l()?ne(_e):e(r).type==="entity-type"?ne(Ae,1):e(r).type==="badge"?ne(he,2):e(r).type==="wikilink"?ne(De,3):e(r).type==="status"?ne(ze,4):e(r).type==="date"?ne(be,5):e(Me)?ne(Fe,6):ne(He,!1)})}p(F,H)};ye(Q,F=>{e(z)&&e(r).type==="text"?F(me):e(z)&&e(r).type==="status"?F(xe,1):e(z)&&e(r).type==="date"?F(fe,2):e(z)&&e(r).type==="wikilink"?F(Ce,3):F(X,!1)})}d(de),d(le),ce(F=>{T=Ct(le,1,"ip-row svelte-x7sio8",null,T,{"ip-focused":e(z)}),ie(D,F)},[()=>A(e(r).key)]),qe("click",ae,F=>F.stopPropagation()),qe("click",de,F=>{F.stopPropagation(),q(e(r))}),p(u,le)});var V=I(m,2);{var ve=u=>{var r=Vn(),z=_(r),le=_(z);Wt(le,{size:14}),d(z);var T=I(z,2),ae=_(T);Mt(ae),Yt(ae,ee=>y(N,ee),()=>e(N)),d(T),Be(2),d(r),qe("keydown",ae,K),ft("blur",ae,G),ka(ae,()=>e(S),ee=>y(S,ee)),p(u,r)},J=u=>{Ze(u,{variant:"ghost",class:"ip-add-btn",onclick:r=>{r.stopPropagation(),h()},children:(r,z)=>{var le=Wn(),T=Se(le);Wt(T,{size:14}),Be(2),p(r,le)},$$slots:{default:!0}})};ye(V,u=>{e(E)?u(ve):l()&&u(J,1)})}d(W),p(Y,W),rt()}Bt(["click","keydown"]);var Yn=j('<button class="connection-chip svelte-16xienp"><span class="chip-dot svelte-16xienp"></span> <span class="chip-name svelte-16xienp"> </span> <span class="chip-type svelte-16xienp"> </span></button>'),Zn=j('<div class="connection-group svelte-16xienp"><span class="group-label svelte-16xienp">Linked from</span> <div class="connection-chips svelte-16xienp"></div></div>'),Jn=j('<button class="connection-chip svelte-16xienp"><span class="chip-dot svelte-16xienp"></span> <span class="chip-name svelte-16xienp"> </span> <span class="chip-type svelte-16xienp"> </span></button>'),Qn=j('<div class="connection-group svelte-16xienp"><span class="group-label svelte-16xienp">Links to</span> <div class="connection-chips svelte-16xienp"></div></div>'),Gn=j('<div class="connections-body svelte-16xienp"><!> <!></div>'),Xn=j('<div class="connections-panel svelte-16xienp"><button class="connections-header svelte-16xienp"><span><!></span> <span class="header-label svelte-16xienp">Connections</span> <span class="header-count svelte-16xienp"> </span></button> <!></div>');function $n(Y,t){nt(t,!0);let l=Oe(!1);const i=Pe(()=>{const S=new Set(t.wikilinks.map(A=>A.replace(/\[\[|\]\]/g,"").trim().toLowerCase()));if(S.size===0)return[];const N=[];for(const A of xt.repos)for(const M of A.entities)S.has(M.id.toLowerCase())&&N.push(M);return N}),f=Pe(()=>{const S=[],N=t.entityId.toLowerCase();for(const A of xt.repos)for(const M of A.entities)if(!(M.id===t.entityId&&M.repo===t.entityRepo)){for(const we of M.wikilinks)if(we.replace(/\[\[|\]\]/g,"").trim().toLowerCase()===N){S.push(M);break}}return S}),R=Pe(()=>e(i).length+e(f).length);function O(S){zt(`/${S.repo}/${S.entityType}/${S.id}`)}var b=We(),E=Se(b);{var c=S=>{var N=Xn(),A=_(N),M=_(A);let we;var L=_(M);ba(L,{size:14}),d(M);var ue=I(M,4),Re=_(ue,!0);d(ue),d(A);var Z=I(A,2);{var B=ke=>{var re=Gn(),C=_(re);{var x=s=>{var g=Zn(),k=I(_(g),2);Ne(k,21,()=>e(f),Ve,(q,oe)=>{const Te=Pe(()=>Ft(e(oe).entityType));var w=Yn(),v=_(w);let h;var P=I(v,2),G=_(P,!0);d(P);var K=I(P,2),W=_(K,!0);d(K),d(w),ce(m=>{h=Qe(v,"",h,{background:e(Te)}),ie(G,e(oe).title),ie(W,m)},[()=>vt(e(oe).entityType)]),qe("click",w,()=>O(e(oe))),p(q,w)}),d(k),d(g),p(s,g)};ye(C,s=>{e(f).length>0&&s(x)})}var a=I(C,2);{var n=s=>{var g=Qn(),k=I(_(g),2);Ne(k,21,()=>e(i),Ve,(q,oe)=>{const Te=Pe(()=>Ft(e(oe).entityType));var w=Jn(),v=_(w);let h;var P=I(v,2),G=_(P,!0);d(P);var K=I(P,2),W=_(K,!0);d(K),d(w),ce(m=>{h=Qe(v,"",h,{background:e(Te)}),ie(G,e(oe).title),ie(W,m)},[()=>vt(e(oe).entityType)]),qe("click",w,()=>O(e(oe))),p(q,w)}),d(k),d(g),p(s,g)};ye(a,s=>{e(i).length>0&&s(n)})}d(re),p(ke,re)};ye(Z,ke=>{e(l)||ke(B)})}d(N),ce(()=>{we=Ct(M,1,"header-chevron svelte-16xienp",null,we,{collapsed:e(l)}),ie(Re,e(R))}),qe("click",A,()=>y(l,!e(l))),p(S,N)};ye(E,S=>{e(R)>0&&S(c)})}p(Y,b),rt()}Bt(["click"]);var er=j('<div class="remote-cursor svelte-ok7wy5"><span class="remote-cursor-label svelte-ok7wy5"> </span></div>'),tr=j('<div class="cursor-overlay svelte-ok7wy5"></div>'),ar=j('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div> <!></div>');function nr(Y,t){nt(t,!0);let l=Je(t,"readonly",3,!0),i=Je(t,"resetKey",3,0);const f=La("theme");let R,O=null,b=null,E=Oe(""),c=null,S=Oe(ht([])),N=null,A=t.content;function M(B,ke){return B.theme({"&":{backgroundColor:"transparent",color:"var(--color-text-primary)",fontSize:"15px",fontFamily:"var(--font-sans)"},".cm-content":{padding:"32px 40px",fontFamily:"var(--font-sans)",caretColor:"var(--color-accent)",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:ke?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:ke?"rgba(110,110,232,0.3)":"rgba(110,110,232,0.2)"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-line":{padding:"0"},".cm-header-1":{fontSize:"22px",fontWeight:"600"},".cm-header-2":{fontSize:"16px",fontWeight:"600"},".cm-header-3":{fontSize:"15px",fontWeight:"600"},".cm-formatting":{color:"var(--color-text-tertiary)",opacity:"0.5"},".cm-link":{color:"var(--color-link)",textDecoration:"none"}},{dark:ke})}async function we(){O&&(O.destroy(),O=null),b&&(b.destroy(),b=null),y(S,[],!0);const{EditorState:B,Transaction:ke}=await Xe(async()=>{const{EditorState:m,Transaction:V}=await import("../chunks/CX_61fY8.js");return{EditorState:m,Transaction:V}},[],import.meta.url);c=ke;const{EditorView:re,keymap:C,ViewPlugin:x}=await Xe(async()=>{const{EditorView:m,keymap:V,ViewPlugin:ve}=await import("../chunks/DnL9f0lc.js").then(J=>J.i);return{EditorView:m,keymap:V,ViewPlugin:ve}},__vite__mapDeps([0,1]),import.meta.url),{markdown:a}=await Xe(async()=>{const{markdown:m}=await import("../chunks/CscoF-YL.js");return{markdown:m}},__vite__mapDeps([2,1,0,3,4,5]),import.meta.url),{syntaxHighlighting:n,HighlightStyle:s}=await Xe(async()=>{const{syntaxHighlighting:m,HighlightStyle:V}=await import("../chunks/D7ZqAKi9.js");return{syntaxHighlighting:m,HighlightStyle:V}},__vite__mapDeps([3,4,1,0]),import.meta.url),{history:g,defaultKeymap:k,historyKeymap:q}=await Xe(async()=>{const{history:m,defaultKeymap:V,historyKeymap:ve}=await import("../chunks/CWQRQXxy.js");return{history:m,defaultKeymap:V,historyKeymap:ve}},__vite__mapDeps([6,1,0,3,4]),import.meta.url),{tags:oe}=await Xe(async()=>{const{tags:m}=await import("../chunks/C7VoTosa.js").then(V=>V.i);return{tags:m}},[],import.meta.url),{livePreviewPlugin:Te,livePreviewTheme:w}=await Xe(async()=>{const{livePreviewPlugin:m,livePreviewTheme:V}=await import("../chunks/B340SUKR.js");return{livePreviewPlugin:m,livePreviewTheme:V}},__vite__mapDeps([7,0,1,3,4]),import.meta.url),v=f.current==="dark",h=M(re,v),P=s.define([{tag:oe.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),G=[a(),h,n(P),Te,w,re.lineWrapping];l()&&G.push(B.readOnly.of(!0));let K=!1;if(t.cursorDocName&&!l())try{let o=function(){if(!O||!T){y(S,[],!0);return}const Q=T.awareness,me=T.ytext,xe=me.doc;if(!xe){y(S,[],!0);return}const fe=[],Ce=O.dom.getBoundingClientRect();Q.getStates().forEach((X,F)=>{if(F===Ie)return;const H=X.cursor;if(!H?.head)return;const{name:U="Anonymous",color:_e="#e05050"}=X.user||{};let Ae;try{Ae=z.createRelativePositionFromJSON(H.head)}catch{return}const he=z.createAbsolutePositionFromRelativePosition(Ae,xe);if(!he||he.type!==me)return;const De=O.coordsAtPos(Math.min(he.index,O.state.doc.length));De&&fe.push({id:F,name:U,color:_e,top:De.top-Ce.top,left:De.left-Ce.left,height:De.bottom-De.top})}),y(S,fe,!0)},D=function(){N&&cancelAnimationFrame(N),N=requestAnimationFrame(()=>{N=null,o()})},de=function({added:Q,updated:me,removed:xe}){[...Q,...me,...xe].some(Ce=>Ce!==Ie)&&D()};const{createCollabSession:m}=await Xe(async()=>{const{createCollabSession:Q}=await import("../chunks/D1SfcMkP.js");return{createCollabSession:Q}},__vite__mapDeps([8,9,10,11,12,13,14,15,16,17,18]),import.meta.url),{ySync:V,ySyncFacet:ve,YSyncConfig:J,yUndoManagerKeymap:u}=await Xe(async()=>{const{ySync:Q,ySyncFacet:me,YSyncConfig:xe,yUndoManagerKeymap:fe}=await import("../chunks/i9c_RUF6.js");return{ySync:Q,ySyncFacet:me,YSyncConfig:xe,yUndoManagerKeymap:fe}},__vite__mapDeps([19,9,0,1]),import.meta.url),{auth:r}=await Xe(async()=>{const{auth:Q}=await import("../chunks/Bk8fVkoK.js").then(me=>me.b);return{auth:Q}},__vite__mapDeps([16,12,15]),import.meta.url),z=await Xe(()=>import("../chunks/CLFba8FK.js").then(Q=>Q.A),[],import.meta.url),le=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",T=m(t.cursorDocName,{name:r.user?.displayName??"Anonymous",color:le,colorLight:le+"33"}),ae=new z.UndoManager(T.ytext,{captureTimeout:500}),{yUndoManagerFacet:ee,yUndoManager:te,YUndoManagerConfig:pe}=await Xe(async()=>{const{yUndoManagerFacet:Q,yUndoManager:me,YUndoManagerConfig:xe}=await import("../chunks/i9c_RUF6.js");return{yUndoManagerFacet:Q,yUndoManager:me,YUndoManagerConfig:xe}},__vite__mapDeps([19,9,0,1]),import.meta.url),se=new J(T.ytext,T.awareness);G.push(ve.of(se),V,ee.of(new pe(ae)),te,C.of(u)),G.push(x.define(Q=>{function me(){const xe=Q.state.selection.main,fe=T.ytext,Ce=z.createRelativePositionFromTypeIndex(fe,xe.anchor),X=z.createRelativePositionFromTypeIndex(fe,xe.head);T.awareness.setLocalStateField("cursor",{anchor:z.relativePositionToJSON(Ce),head:z.relativePositionToJSON(X)})}return me(),{update(xe){(xe.selectionSet||xe.docChanged)&&me()}}}));const Ie=T.ydoc.clientID;T.awareness.on("change",de),G.push(x.define(()=>({update(Q){(Q.docChanged||Q.geometryChanged||Q.viewportChanged)&&D()},destroy(){T.awareness.off("change",de)}}))),b=T,K=!0}catch(m){console.warn("Yjs collab setup failed, falling back to solo editing:",m)}if(!l()&&!K?(G.push(g({newGroupDelay:500})),G.push(C.of([...k,...q]))):!l()&&K&&G.push(C.of(k)),t.onchange)if(K){const m=Date.now();G.push(re.updateListener.of(V=>{if(V.docChanged&&Date.now()-m>1e3&&V.transactions.some(J=>J.isUserEvent("input")||J.isUserEvent("delete")||J.isUserEvent("move")||J.isUserEvent("undo")||J.isUserEvent("redo"))){const J=V.state.doc.toString();A=J,t.onchange(J)}}))}else G.push(re.updateListener.of(m=>{if(m.docChanged){const V=m.state.doc.toString();A=V,t.onchange(V)}}));G.push(re.domEventHandlers({click(m){const V=m.target;if(t.onwikilinkclick){const J=V.closest(".cm-live-wikilink");if(J){m.preventDefault();const u=J.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return u&&t.onwikilinkclick(u),!0}}const ve=V.closest(".cm-live-link");if(ve){const J=ve.getAttribute("data-href");if(J)return m.preventDefault(),window.open(J,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&G.push(C.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const W=B.create({doc:K?"":t.content,extensions:G});O=new re({state:W,parent:R}),A=K?"":t.content,y(E,t.cursorDocName??"",!0)}za(()=>{we()}),ut(()=>{t.cursorDocName&&e(E)&&t.cursorDocName!==e(E)&&we()}),ut(()=>{if(i(),O&&!b&&t.content!==A){A=t.content;const B=R.closest(".document-scroll"),ke=B?.scrollTop??0;O.dispatch({changes:{from:0,to:O.state.doc.length,insert:t.content},...c?{annotations:c.addToHistory.of(!1)}:{}}),B&&requestAnimationFrame(()=>{B.scrollTop=ke})}}),wa(()=>{N&&cancelAnimationFrame(N),b?.destroy(),b=null,O?.destroy()});var L=ar(),ue=_(L);Yt(ue,B=>R=B,()=>R);var Re=I(ue,2);{var Z=B=>{var ke=tr();Ne(ke,21,()=>e(S),re=>re.id,(re,C)=>{var x=er(),a=_(x),n=_(a,!0);d(a),d(x),ce(()=>{Qe(x,`top: ${e(C).top??""}px; left: ${e(C).left??""}px; height: ${e(C).height??""}px; --cursor-color: ${e(C).color??""};`),Qe(a,`background-color: ${e(C).color??""};`),ie(n,e(C).name)}),p(re,x)}),d(ke),p(B,ke)};ye(Re,B=>{e(S).length>0&&B(Z)})}d(L),p(Y,L),rt()}var Vt={exports:{}};var rr=Vt.exports,va;function sr(){return va||(va=1,(function(Y,t){((l,i)=>{Y.exports=i()})(rr,function l(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},f,R=!i.document&&!!i.postMessage,O=i.IS_PAPA_WORKER||!1,b={},E=0,c={};function S(a){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(n){var s=re(n);s.chunkSize=parseInt(s.chunkSize),n.step||n.chunk||(s.chunkSize=null),this._handle=new L(s),(this._handle.streamer=this)._config=s}).call(this,a),this.parseChunk=function(n,s){var g=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<g){let q=this._config.newline;q||(k=this._config.quoteChar||'"',q=this._handle.guessLineEndings(n,k)),n=[...n.split(q).slice(g)].join(q)}this.isFirstChunk&&x(this._config.beforeFirstChunk)&&(k=this._config.beforeFirstChunk(n))!==void 0&&(n=k),this.isFirstChunk=!1,this._halted=!1;var g=this._partialLine+n,k=(this._partialLine="",this._handle.parse(g,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(n=k.meta.cursor,g=(this._finished||(this._partialLine=g.substring(n-this._baseIndex),this._baseIndex=n),k&&k.data&&(this._rowCount+=k.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),O)i.postMessage({results:k,workerId:c.WORKER_ID,finished:g});else if(x(this._config.chunk)&&!s){if(this._config.chunk(k,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=k=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(k.data),this._completeResults.errors=this._completeResults.errors.concat(k.errors),this._completeResults.meta=k.meta),this._completed||!g||!x(this._config.complete)||k&&k.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),g||k&&k.meta.paused||this._nextChunk(),k}this._halted=!0},this._sendError=function(n){x(this._config.error)?this._config.error(n):O&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:n,finished:!1})}}function N(a){var n;(a=a||{}).chunkSize||(a.chunkSize=c.RemoteChunkSize),S.call(this,a),this._nextChunk=R?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(s){this._input=s,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(n=new XMLHttpRequest,this._config.withCredentials&&(n.withCredentials=this._config.withCredentials),R||(n.onload=C(this._chunkLoaded,this),n.onerror=C(this._chunkError,this)),n.open(this._config.downloadRequestBody?"POST":"GET",this._input,!R),this._config.downloadRequestHeaders){var s,g=this._config.downloadRequestHeaders;for(s in g)n.setRequestHeader(s,g[s])}var k;this._config.chunkSize&&(k=this._start+this._config.chunkSize-1,n.setRequestHeader("Range","bytes="+this._start+"-"+k));try{n.send(this._config.downloadRequestBody)}catch(q){this._chunkError(q.message)}R&&n.status===0&&this._chunkError()}},this._chunkLoaded=function(){n.readyState===4&&(n.status<200||400<=n.status?this._chunkError():(this._start+=this._config.chunkSize||n.responseText.length,this._finished=!this._config.chunkSize||this._start>=(s=>(s=s.getResponseHeader("Content-Range"))!==null?parseInt(s.substring(s.lastIndexOf("/")+1)):-1)(n),this.parseChunk(n.responseText)))},this._chunkError=function(s){s=n.statusText||s,this._sendError(new Error(s))}}function A(a){(a=a||{}).chunkSize||(a.chunkSize=c.LocalChunkSize),S.call(this,a);var n,s,g=typeof FileReader<"u";this.stream=function(k){this._input=k,s=k.slice||k.webkitSlice||k.mozSlice,g?((n=new FileReader).onload=C(this._chunkLoaded,this),n.onerror=C(this._chunkError,this)):n=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var k=this._input,q=(this._config.chunkSize&&(q=Math.min(this._start+this._config.chunkSize,this._input.size),k=s.call(k,this._start,q)),n.readAsText(k,this._config.encoding));g||this._chunkLoaded({target:{result:q}})},this._chunkLoaded=function(k){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(k.target.result)},this._chunkError=function(){this._sendError(n.error)}}function M(a){var n;S.call(this,a=a||{}),this.stream=function(s){return n=s,this._nextChunk()},this._nextChunk=function(){var s,g;if(!this._finished)return s=this._config.chunkSize,n=s?(g=n.substring(0,s),n.substring(s)):(g=n,""),this._finished=!n,this.parseChunk(g)}}function we(a){S.call(this,a=a||{});var n=[],s=!0,g=!1;this.pause=function(){S.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){S.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(k){this._input=k,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){g&&n.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),n.length?this.parseChunk(n.shift()):s=!0},this._streamData=C(function(k){try{n.push(typeof k=="string"?k:k.toString(this._config.encoding)),s&&(s=!1,this._checkIsFinished(),this.parseChunk(n.shift()))}catch(q){this._streamError(q)}},this),this._streamError=C(function(k){this._streamCleanUp(),this._sendError(k)},this),this._streamEnd=C(function(){this._streamCleanUp(),g=!0,this._streamData("")},this),this._streamCleanUp=C(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function L(a){var n,s,g,k,q=Math.pow(2,53),oe=-q,Te=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,w=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,v=this,h=0,P=0,G=!1,K=!1,W=[],m={data:[],errors:[],meta:{}};function V(r){return a.skipEmptyLines==="greedy"?r.join("").trim()==="":r.length===1&&r[0].length===0}function ve(){if(m&&g&&(u("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),g=!1),a.skipEmptyLines&&(m.data=m.data.filter(function(T){return!V(T)})),J()){let T=function(ae,ee){x(a.transformHeader)&&(ae=a.transformHeader(ae,ee)),W.push(ae)};if(m)if(Array.isArray(m.data[0])){for(var r=0;J()&&r<m.data.length;r++)m.data[r].forEach(T);m.data.splice(0,1)}else m.data.forEach(T)}function z(T,ae){for(var ee=a.header?{}:[],te=0;te<T.length;te++){var pe=te,se=T[te],se=((Ie,o)=>(D=>(a.dynamicTypingFunction&&a.dynamicTyping[D]===void 0&&(a.dynamicTyping[D]=a.dynamicTypingFunction(D)),(a.dynamicTyping[D]||a.dynamicTyping)===!0))(Ie)?o==="true"||o==="TRUE"||o!=="false"&&o!=="FALSE"&&((D=>{if(Te.test(D)&&(D=parseFloat(D),oe<D&&D<q))return 1})(o)?parseFloat(o):w.test(o)?new Date(o):o===""?null:o):o)(pe=a.header?te>=W.length?"__parsed_extra":W[te]:pe,se=a.transform?a.transform(se,pe):se);pe==="__parsed_extra"?(ee[pe]=ee[pe]||[],ee[pe].push(se)):ee[pe]=se}return a.header&&(te>W.length?u("FieldMismatch","TooManyFields","Too many fields: expected "+W.length+" fields but parsed "+te,P+ae):te<W.length&&u("FieldMismatch","TooFewFields","Too few fields: expected "+W.length+" fields but parsed "+te,P+ae)),ee}var le;m&&(a.header||a.dynamicTyping||a.transform)&&(le=1,!m.data.length||Array.isArray(m.data[0])?(m.data=m.data.map(z),le=m.data.length):m.data=z(m.data,0),a.header&&m.meta&&(m.meta.fields=W),P+=le)}function J(){return a.header&&W.length===0}function u(r,z,le,T){r={type:r,code:z,message:le},T!==void 0&&(r.row=T),m.errors.push(r)}x(a.step)&&(k=a.step,a.step=function(r){m=r,J()?ve():(ve(),m.data.length!==0&&(h+=r.data.length,a.preview&&h>a.preview?s.abort():(m.data=m.data[0],k(m,v))))}),this.parse=function(r,z,le){var T=a.quoteChar||'"',T=(a.newline||(a.newline=this.guessLineEndings(r,T)),g=!1,a.delimiter?x(a.delimiter)&&(a.delimiter=a.delimiter(r),m.meta.delimiter=a.delimiter):((T=((ae,ee,te,pe,se)=>{var Ie,o,D,de;se=se||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var Q=0;Q<se.length;Q++){for(var me,xe=se[Q],fe=0,Ce=0,X=0,F=(D=void 0,new Re({comments:pe,delimiter:xe,newline:ee,preview:10}).parse(ae)),H=0;H<F.data.length;H++)te&&V(F.data[H])?X++:(me=F.data[H].length,Ce+=me,D===void 0?D=me:0<me&&(fe+=Math.abs(me-D),D=me));0<F.data.length&&(Ce/=F.data.length-X),(o===void 0||fe<=o)&&(de===void 0||de<Ce)&&1.99<Ce&&(o=fe,Ie=xe,de=Ce)}return{successful:!!(a.delimiter=Ie),bestDelimiter:Ie}})(r,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=T.bestDelimiter:(g=!0,a.delimiter=c.DefaultDelimiter),m.meta.delimiter=a.delimiter),re(a));return a.preview&&a.header&&T.preview++,n=r,s=new Re(T),m=s.parse(n,z,le),ve(),G?{meta:{paused:!0}}:m||{meta:{paused:!1}}},this.paused=function(){return G},this.pause=function(){G=!0,s.abort(),n=x(a.chunk)?"":n.substring(s.getCharIndex())},this.resume=function(){v.streamer._halted?(G=!1,v.streamer.parseChunk(n,!0)):setTimeout(v.resume,3)},this.aborted=function(){return K},this.abort=function(){K=!0,s.abort(),m.meta.aborted=!0,x(a.complete)&&a.complete(m),n=""},this.guessLineEndings=function(ae,T){ae=ae.substring(0,1048576);var T=new RegExp(ue(T)+"([^]*?)"+ue(T),"gm"),le=(ae=ae.replace(T,"")).split("\r"),T=ae.split(`
|
|
3
|
+
`),ae=1<T.length&&T[0].length<le[0].length;if(le.length===1||ae)return`
|
|
4
|
+
`;for(var ee=0,te=0;te<le.length;te++)le[te][0]===`
|
|
5
|
+
`&&ee++;return ee>=le.length/2?`\r
|
|
6
|
+
`:"\r"}}function ue(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Re(a){var n=(a=a||{}).delimiter,s=a.newline,g=a.comments,k=a.step,q=a.preview,oe=a.fastMode,Te=null,w=!1,v=a.quoteChar==null?'"':a.quoteChar,h=v;if(a.escapeChar!==void 0&&(h=a.escapeChar),(typeof n!="string"||-1<c.BAD_DELIMITERS.indexOf(n))&&(n=","),g===n)throw new Error("Comment character same as delimiter");g===!0?g="#":(typeof g!="string"||-1<c.BAD_DELIMITERS.indexOf(g))&&(g=!1),s!==`
|
|
7
|
+
`&&s!=="\r"&&s!==`\r
|
|
8
|
+
`&&(s=`
|
|
9
|
+
`);var P=0,G=!1;this.parse=function(K,W,m){if(typeof K!="string")throw new Error("Input must be a string");var V=K.length,ve=n.length,J=s.length,u=g.length,r=x(k),z=[],le=[],T=[],ae=P=0;if(!K)return fe();if(oe||oe!==!1&&K.indexOf(v)===-1){for(var ee=K.split(s),te=0;te<ee.length;te++){if(T=ee[te],P+=T.length,te!==ee.length-1)P+=s.length;else if(m)return fe();if(!g||T.substring(0,u)!==g){if(r){if(z=[],de(T.split(n)),Ce(),G)return fe()}else de(T.split(n));if(q&&q<=te)return z=z.slice(0,q),fe(!0)}}return fe()}for(var pe=K.indexOf(n,P),se=K.indexOf(s,P),Ie=new RegExp(ue(h)+ue(v),"g"),o=K.indexOf(v,P);;)if(K[P]===v)for(o=P,P++;;){if((o=K.indexOf(v,o+1))===-1)return m||le.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:z.length,index:P}),me();if(o===V-1)return me(K.substring(P,o).replace(Ie,v));if(v===h&&K[o+1]===h)o++;else if(v===h||o===0||K[o-1]!==h){pe!==-1&&pe<o+1&&(pe=K.indexOf(n,o+1));var D=Q((se=se!==-1&&se<o+1?K.indexOf(s,o+1):se)===-1?pe:Math.min(pe,se));if(K.substr(o+1+D,ve)===n){T.push(K.substring(P,o).replace(Ie,v)),K[P=o+1+D+ve]!==v&&(o=K.indexOf(v,P)),pe=K.indexOf(n,P),se=K.indexOf(s,P);break}if(D=Q(se),K.substring(o+1+D,o+1+D+J)===s){if(T.push(K.substring(P,o).replace(Ie,v)),xe(o+1+D+J),pe=K.indexOf(n,P),o=K.indexOf(v,P),r&&(Ce(),G))return fe();if(q&&z.length>=q)return fe(!0);break}le.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:z.length,index:P}),o++}}else if(g&&T.length===0&&K.substring(P,P+u)===g){if(se===-1)return fe();P=se+J,se=K.indexOf(s,P),pe=K.indexOf(n,P)}else if(pe!==-1&&(pe<se||se===-1))T.push(K.substring(P,pe)),P=pe+ve,pe=K.indexOf(n,P);else{if(se===-1)break;if(T.push(K.substring(P,se)),xe(se+J),r&&(Ce(),G))return fe();if(q&&z.length>=q)return fe(!0)}return me();function de(X){z.push(X),ae=P}function Q(X){var F=0;return F=X!==-1&&(X=K.substring(o+1,X))&&X.trim()===""?X.length:F}function me(X){return m||(X===void 0&&(X=K.substring(P)),T.push(X),P=V,de(T),r&&Ce()),fe()}function xe(X){P=X,de(T),T=[],se=K.indexOf(s,P)}function fe(X){if(a.header&&!W&&z.length&&!w){var F=z[0],H=Object.create(null),U=new Set(F);let _e=!1;for(let Ae=0;Ae<F.length;Ae++){let he=F[Ae];if(H[he=x(a.transformHeader)?a.transformHeader(he,Ae):he]){let De,ze=H[he];for(;De=he+"_"+ze,ze++,U.has(De););U.add(De),F[Ae]=De,H[he]++,_e=!0,(Te=Te===null?{}:Te)[De]=he}else H[he]=1,F[Ae]=he;U.add(he)}_e&&console.warn("Duplicate headers found and renamed."),w=!0}return{data:z,errors:le,meta:{delimiter:n,linebreak:s,aborted:G,truncated:!!X,cursor:ae+(W||0),renamedHeaders:Te}}}function Ce(){k(fe()),z=[],le=[]}},this.abort=function(){G=!0},this.getCharIndex=function(){return P}}function Z(a){var n=a.data,s=b[n.workerId],g=!1;if(n.error)s.userError(n.error,n.file);else if(n.results&&n.results.data){var k={abort:function(){g=!0,B(n.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:ke,resume:ke};if(x(s.userStep)){for(var q=0;q<n.results.data.length&&(s.userStep({data:n.results.data[q],errors:n.results.errors,meta:n.results.meta},k),!g);q++);delete n.results}else x(s.userChunk)&&(s.userChunk(n.results,k,n.file),delete n.results)}n.finished&&!g&&B(n.workerId,n.results)}function B(a,n){var s=b[a];x(s.userComplete)&&s.userComplete(n),s.terminate(),delete b[a]}function ke(){throw new Error("Not implemented.")}function re(a){if(typeof a!="object"||a===null)return a;var n,s=Array.isArray(a)?[]:{};for(n in a)s[n]=re(a[n]);return s}function C(a,n){return function(){a.apply(n,arguments)}}function x(a){return typeof a=="function"}return c.parse=function(a,n){var s=(n=n||{}).dynamicTyping||!1;if(x(s)&&(n.dynamicTypingFunction=s,s={}),n.dynamicTyping=s,n.transform=!!x(n.transform)&&n.transform,!n.worker||!c.WORKERS_SUPPORTED)return s=null,c.NODE_STREAM_INPUT,typeof a=="string"?(a=(g=>g.charCodeAt(0)!==65279?g:g.slice(1))(a),s=new(n.download?N:M)(n)):a.readable===!0&&x(a.read)&&x(a.on)?s=new we(n):(i.File&&a instanceof File||a instanceof Object)&&(s=new A(n)),s.stream(a);(s=(()=>{var g;return!!c.WORKERS_SUPPORTED&&(g=(()=>{var k=i.URL||i.webkitURL||null,q=l.toString();return c.BLOB_URL||(c.BLOB_URL=k.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",q,")();"],{type:"text/javascript"})))})(),(g=new i.Worker(g)).onmessage=Z,g.id=E++,b[g.id]=g)})()).userStep=n.step,s.userChunk=n.chunk,s.userComplete=n.complete,s.userError=n.error,n.step=x(n.step),n.chunk=x(n.chunk),n.complete=x(n.complete),n.error=x(n.error),delete n.worker,s.postMessage({input:a,config:n,workerId:s.id})},c.unparse=function(a,n){var s=!1,g=!0,k=",",q=`\r
|
|
10
|
+
`,oe='"',Te=oe+oe,w=!1,v=null,h=!1,P=((()=>{if(typeof n=="object"){if(typeof n.delimiter!="string"||c.BAD_DELIMITERS.filter(function(W){return n.delimiter.indexOf(W)!==-1}).length||(k=n.delimiter),typeof n.quotes!="boolean"&&typeof n.quotes!="function"&&!Array.isArray(n.quotes)||(s=n.quotes),typeof n.skipEmptyLines!="boolean"&&typeof n.skipEmptyLines!="string"||(w=n.skipEmptyLines),typeof n.newline=="string"&&(q=n.newline),typeof n.quoteChar=="string"&&(oe=n.quoteChar),typeof n.header=="boolean"&&(g=n.header),Array.isArray(n.columns)){if(n.columns.length===0)throw new Error("Option columns is empty");v=n.columns}n.escapeChar!==void 0&&(Te=n.escapeChar+oe),n.escapeFormulae instanceof RegExp?h=n.escapeFormulae:typeof n.escapeFormulae=="boolean"&&n.escapeFormulae&&(h=/^[=+\-@\t\r].*$/)}})(),new RegExp(ue(oe),"g"));if(typeof a=="string"&&(a=JSON.parse(a)),Array.isArray(a)){if(!a.length||Array.isArray(a[0]))return G(null,a,w);if(typeof a[0]=="object")return G(v||Object.keys(a[0]),a,w)}else if(typeof a=="object")return typeof a.data=="string"&&(a.data=JSON.parse(a.data)),Array.isArray(a.data)&&(a.fields||(a.fields=a.meta&&a.meta.fields||v),a.fields||(a.fields=Array.isArray(a.data[0])?a.fields:typeof a.data[0]=="object"?Object.keys(a.data[0]):[]),Array.isArray(a.data[0])||typeof a.data[0]=="object"||(a.data=[a.data])),G(a.fields||[],a.data||[],w);throw new Error("Unable to serialize unrecognized input");function G(W,m,V){var ve="",J=(typeof W=="string"&&(W=JSON.parse(W)),typeof m=="string"&&(m=JSON.parse(m)),Array.isArray(W)&&0<W.length),u=!Array.isArray(m[0]);if(J&&g){for(var r=0;r<W.length;r++)0<r&&(ve+=k),ve+=K(W[r],r);0<m.length&&(ve+=q)}for(var z=0;z<m.length;z++){var le=(J?W:m[z]).length,T=!1,ae=J?Object.keys(m[z]).length===0:m[z].length===0;if(V&&!J&&(T=V==="greedy"?m[z].join("").trim()==="":m[z].length===1&&m[z][0].length===0),V==="greedy"&&J){for(var ee=[],te=0;te<le;te++){var pe=u?W[te]:te;ee.push(m[z][pe])}T=ee.join("").trim()===""}if(!T){for(var se=0;se<le;se++){0<se&&!ae&&(ve+=k);var Ie=J&&u?W[se]:se;ve+=K(m[z][Ie],se)}z<m.length-1&&(!V||0<le&&!ae)&&(ve+=q)}}return ve}function K(W,m){var V,ve;return W==null?"":W.constructor===Date?JSON.stringify(W).slice(1,25):(ve=!1,h&&typeof W=="string"&&h.test(W)&&(W="'"+W,ve=!0),V=W.toString().replace(P,Te),(ve=ve||s===!0||typeof s=="function"&&s(W,m)||Array.isArray(s)&&s[m]||((J,u)=>{for(var r=0;r<u.length;r++)if(-1<J.indexOf(u[r]))return!0;return!1})(V,c.BAD_DELIMITERS)||-1<V.indexOf(k)||V.charAt(0)===" "||V.charAt(V.length-1)===" ")?oe+V+oe:V)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
|
|
11
|
+
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!R&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=Re,c.ParserHandle=L,c.NetworkStreamer=N,c.FileStreamer=A,c.StringStreamer=M,c.ReadableStreamStreamer=we,i.jQuery&&((f=i.jQuery).fn.parse=function(a){var n=a.config||{},s=[];return this.each(function(q){if(!(f(this).prop("tagName").toUpperCase()==="INPUT"&&f(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var oe=0;oe<this.files.length;oe++)s.push({file:this.files[oe],inputElem:this,instanceConfig:f.extend({},n)})}),g(),this;function g(){if(s.length===0)x(a.complete)&&a.complete();else{var q,oe,Te,w,v=s[0];if(x(a.before)){var h=a.before(v.file,v.inputElem);if(typeof h=="object"){if(h.action==="abort")return q="AbortError",oe=v.file,Te=v.inputElem,w=h.reason,void(x(a.error)&&a.error({name:q},oe,Te,w));if(h.action==="skip")return void k();typeof h.config=="object"&&(v.instanceConfig=f.extend(v.instanceConfig,h.config))}else if(h==="skip")return void k()}var P=v.instanceConfig.complete;v.instanceConfig.complete=function(G){x(P)&&P(G,v.file,v.inputElem),k()},c.parse(v.file,v.instanceConfig)}}function k(){s.splice(0,1),g()}}),O&&(i.onmessage=function(a){a=a.data,c.WORKER_ID===void 0&&a&&(c.WORKER_ID=a.workerId),typeof a.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(a.input,a.config),finished:!0}):(i.File&&a.input instanceof File||a.input instanceof Object)&&(a=c.parse(a.input,a.config))&&i.postMessage({workerId:c.WORKER_ID,results:a,finished:!0})}),(N.prototype=Object.create(S.prototype)).constructor=N,(A.prototype=Object.create(S.prototype)).constructor=A,(M.prototype=Object.create(M.prototype)).constructor=M,(we.prototype=Object.create(S.prototype)).constructor=we,c})})(Vt)),Vt.exports}var ir=sr();const ha=Ja(ir);var or=j('<span class="remote-cell-label svelte-63hltt"> </span>'),lr=j('<th><!> <input class="cell-input header-input svelte-63hltt"/> <!></th>'),cr=j('<span class="remote-cell-label svelte-63hltt"> </span>'),ur=j('<td><!> <input class="cell-input svelte-63hltt"/></td>'),dr=j('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),fr=j("<!> <span>Add row</span>",1),vr=j('<div class="csv-editor svelte-63hltt"><div class="table-scroll svelte-63hltt"><table class="svelte-63hltt"><thead><tr class="svelte-63hltt"><th class="row-num svelte-63hltt"></th><!><th class="col-add svelte-63hltt"><!></th></tr></thead><tbody></tbody></table></div> <div class="csv-footer svelte-63hltt"><!></div></div>');function hr(Y,t){nt(t,!0);let l=Je(t,"remoteCursors",19,()=>[]),i=Oe(ht([])),f=Oe(ht([])),R=Oe(void 0);function O(w){const v=ha.parse(w.trim(),{header:!1,skipEmptyLines:!0});v.data.length>0?(y(i,v.data[0],!0),y(f,v.data.slice(1),!0)):(y(i,[],!0),y(f,[],!0))}O(t.content),ut(()=>{O(t.content)});function b(){return ha.unparse([e(i),...e(f)])}function E(){const w=b();t.onchange?.(w)}function c(w,v,h){e(f)[w][v]=h,y(f,[...e(f)],!0),E()}function S(w,v){e(i)[w]=v,y(i,[...e(i)],!0),E()}function N(){y(f,[...e(f),e(i).map(()=>"")],!0),E(),L(e(f).length-1,0)}function A(w){y(f,e(f).filter((v,h)=>h!==w),!0),E()}function M(){const w=`col${e(i).length+1}`;y(i,[...e(i),w],!0),y(f,e(f).map(v=>[...v,""]),!0),E(),requestAnimationFrame(()=>{const v=e(R)?.querySelector(`thead th:nth-child(${e(i).length+1}) input`);v&&(v.focus(),v.select())})}function we(w){e(i).length<=1||(y(i,e(i).filter((v,h)=>h!==w),!0),y(f,e(f).map(v=>v.filter((h,P)=>P!==w)),!0),E())}function L(w,v){requestAnimationFrame(()=>{if(!e(R))return;let h=null;w<0?h=e(R).querySelector(`thead th:nth-child(${v+2}) input`):h=e(R).querySelector(`tbody tr:nth-child(${w+1}) td:nth-child(${v+2}) input`),h&&(h.focus(),h.select())})}function ue(w,v,h){if(w.key==="Tab"){w.preventDefault(),w.shiftKey?h>0?L(v,h-1):v>0?L(v-1,e(i).length-1):v===0&&L(-1,e(i).length-1):h<e(i).length-1?L(v,h+1):v<e(f).length-1?L(v+1,0):v===e(f).length-1&&N();return}if(w.key==="Enter"){w.preventDefault(),w.shiftKey?v>0?L(v-1,h):L(-1,h):v<e(f).length-1?L(v+1,h):N();return}if(w.key==="Escape"){w.target.blur();return}}function Re(w,v){if(w.key==="Tab"){w.preventDefault(),w.shiftKey?v>0&&L(-1,v-1):v<e(i).length-1?L(-1,v+1):e(f).length>0&&L(0,0);return}if(w.key==="Enter"){w.preventDefault(),e(f).length>0?L(0,v):N();return}if(w.key==="Escape"){w.target.blur();return}}function Z(w,v){return l().find(h=>h.row===w&&h.col===v)}function B(w,v){t.oncellselect?.(w,v)}function ke(w){(w.metaKey||w.ctrlKey)&&w.key==="s"&&(w.preventDefault(),t.onsave?.())}var re=vr(),C=_(re),x=_(C),a=_(x),n=_(a),s=I(_(n));Ne(s,17,()=>e(i),Ve,(w,v,h)=>{const P=Pe(()=>Z(-1,h));var G=lr();let K;var W=_(G);{var m=u=>{var r=or(),z=_(r,!0);d(r),ce(()=>{Qe(r,`background-color: ${e(P).color??""}`),ie(z,e(P).name)}),p(u,r)};ye(W,u=>{e(P)&&u(m)})}var V=I(W,2);Mt(V);var ve=I(V,2);{var J=u=>{Ze(u,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>we(h),children:(r,z)=>{da(r,{size:12})},$$slots:{default:!0}})};ye(ve,u=>{e(i).length>1&&u(J)})}d(G),ce(()=>{Qe(G,e(P)?`--rc-color: ${e(P).color}`:""),K=Ct(G,1,"svelte-63hltt",null,K,{"remote-active":!!e(P)}),na(V,e(v))}),qe("input",V,u=>S(h,u.currentTarget.value)),qe("keydown",V,u=>Re(u,h)),ft("focus",V,()=>B(-1,h)),p(w,G)});var g=I(s),k=_(g);Ze(k,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:M,children:(w,v)=>{Wt(w,{size:14})},$$slots:{default:!0}}),d(g),d(n),d(a);var q=I(a);Ne(q,21,()=>e(f),Ve,(w,v,h)=>{var P=dr(),G=_(P);G.textContent=h+1;var K=I(G);Ne(K,17,()=>e(v),Ve,(V,ve,J)=>{const u=Pe(()=>Z(h,J));var r=ur();let z;var le=_(r);{var T=ee=>{var te=cr(),pe=_(te,!0);d(te),ce(()=>{Qe(te,`background-color: ${e(u).color??""}`),ie(pe,e(u).name)}),p(ee,te)};ye(le,ee=>{e(u)&&ee(T)})}var ae=I(le,2);Mt(ae),d(r),ce(()=>{Qe(r,e(u)?`--rc-color: ${e(u).color}`:""),z=Ct(r,1,"svelte-63hltt",null,z,{"remote-active":!!e(u)}),na(ae,e(ve))}),qe("input",ae,ee=>c(h,J,ee.currentTarget.value)),qe("keydown",ae,ee=>ue(ee,h,J)),ft("focus",ae,()=>B(h,J)),p(V,r)});var W=I(K),m=_(W);Ze(m,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>A(h),children:(V,ve)=>{da(V,{size:12})},$$slots:{default:!0}}),d(W),d(P),p(w,P)}),d(q),d(x),Yt(x,w=>y(R,w),()=>e(R)),d(C);var oe=I(C,2),Te=_(oe);Ze(Te,{variant:"ghost",class:"add-row-btn",onclick:N,children:(w,v)=>{var h=fr(),P=Se(h);Wt(P,{size:14}),Be(2),p(w,h)},$$slots:{default:!0}}),d(oe),d(re),qe("keydown",re,ke),p(Y,re),rt()}Bt(["keydown","input"]);const pr=/^\d{4}-\d{2}-\d{2}/,_r=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),gr=new Set(["format"]),mr=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function yr(Y,t){const l=[];for(const[f,R]of Object.entries(Y)){if(mr.has(f)||R==null)continue;const O=wr(f,R);O&&l.push(O)}const i=["entity_type","name","date"];return l.sort((f,R)=>{const O=i.indexOf(f.key),b=i.indexOf(R.key);return O!==-1&&b!==-1?O-b:O!==-1?-1:b!==-1?1:f.key.localeCompare(R.key)}),l}function wr(Y,t){if(Y==="entity_type")return{key:Y,value:String(t),type:"entity-type"};if(gr.has(Y))return{key:Y,value:String(t).toUpperCase(),type:"badge"};if(Y==="status")return{key:Y,value:String(t),type:"status"};if(Array.isArray(t)){if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){const b=t.map(E=>Object.entries(E).map(([S,N])=>`${S}: ${N}`).join(", "));return{key:Y,value:b.join(" | "),type:"text"}}const f=t.map(String),R=f.some(b=>/^\[\[.+?\]\]$/.test(b)),O=f.map(b=>{const E=b.match(/^\[\[(.+?)\]\]$/);return E?E[1]:b});return R||O.every(b=>pa(b))?{key:Y,value:O,type:"wikilink"}:{key:Y,value:f.join(", "),type:"text"}}const l=String(t),i=l.match(/^\[\[(.+?)\]\]$/);return i?{key:Y,value:i[1],type:"wikilink"}:pr.test(l)?{key:Y,value:l,type:"date"}:_r.has(l.toLowerCase())?{key:Y,value:l,type:"status"}:pa(l)&&!l.includes(" ")?{key:Y,value:l,type:"wikilink"}:{key:Y,value:l,type:"text"}}function pa(Y){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(Y)&&Y.includes("-")}var kr=mt("<title> </title>"),br=mt('<svg><!><path d="M16,2A14,14,0,1,0,30,16,14.0158,14.0158,0,0,0,16,2Zm0,26A12,12,0,0,1,16,4V16l8.4812,8.4814A11.9625,11.9625,0,0,1,16,28Z"></path></svg>');function _a(Y,t){const l=gt(t,["children","$$slots","$$events","$$legacy"]),i=gt(l,["size","title"]);nt(t,!1);const f=_t(),R=_t();let O=Je(t,"size",8,16),b=Je(t,"title",8,void 0);pt(()=>(et(l),et(b())),()=>{y(f,l["aria-label"]||l["aria-labelledby"]||b())}),pt(()=>(e(f),et(l)),()=>{y(R,{"aria-hidden":e(f)?void 0:!0,role:e(f)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),Ht(),Jt();var E=br();Zt(E,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:O(),height:O(),...e(R),...i}));var c=_(E);{var S=N=>{var A=kr(),M=_(A,!0);d(A),ce(()=>ie(M,b())),p(N,A)};ye(c,N=>{b()&&N(S)})}Be(),d(E),p(Y,E),rt()}class xr{diff(t,l,i={}){let f;typeof i=="function"?(f=i,i={}):"callback"in i&&(f=i.callback);const R=this.castInput(t,i),O=this.castInput(l,i),b=this.removeEmpty(this.tokenize(R,i)),E=this.removeEmpty(this.tokenize(O,i));return this.diffWithOptionsObj(b,E,i,f)}diffWithOptionsObj(t,l,i,f){var R;const O=Z=>{if(Z=this.postProcess(Z,i),f){setTimeout(function(){f(Z)},0);return}else return Z},b=l.length,E=t.length;let c=1,S=b+E;i.maxEditLength!=null&&(S=Math.min(S,i.maxEditLength));const N=(R=i.timeout)!==null&&R!==void 0?R:1/0,A=Date.now()+N,M=[{oldPos:-1,lastComponent:void 0}];let we=this.extractCommon(M[0],l,t,0,i);if(M[0].oldPos+1>=E&&we+1>=b)return O(this.buildValues(M[0].lastComponent,l,t));let L=-1/0,ue=1/0;const Re=()=>{for(let Z=Math.max(L,-c);Z<=Math.min(ue,c);Z+=2){let B;const ke=M[Z-1],re=M[Z+1];ke&&(M[Z-1]=void 0);let C=!1;if(re){const a=re.oldPos-Z;C=re&&0<=a&&a<b}const x=ke&&ke.oldPos+1<E;if(!C&&!x){M[Z]=void 0;continue}if(!x||C&&ke.oldPos<re.oldPos?B=this.addToPath(re,!0,!1,0,i):B=this.addToPath(ke,!1,!0,1,i),we=this.extractCommon(B,l,t,Z,i),B.oldPos+1>=E&&we+1>=b)return O(this.buildValues(B.lastComponent,l,t))||!0;M[Z]=B,B.oldPos+1>=E&&(ue=Math.min(ue,Z-1)),we+1>=b&&(L=Math.max(L,Z+1))}c++};if(f)(function Z(){setTimeout(function(){if(c>S||Date.now()>A)return f(void 0);Re()||Z()},0)})();else for(;c<=S&&Date.now()<=A;){const Z=Re();if(Z)return Z}}addToPath(t,l,i,f,R){const O=t.lastComponent;return O&&!R.oneChangePerToken&&O.added===l&&O.removed===i?{oldPos:t.oldPos+f,lastComponent:{count:O.count+1,added:l,removed:i,previousComponent:O.previousComponent}}:{oldPos:t.oldPos+f,lastComponent:{count:1,added:l,removed:i,previousComponent:O}}}extractCommon(t,l,i,f,R){const O=l.length,b=i.length;let E=t.oldPos,c=E-f,S=0;for(;c+1<O&&E+1<b&&this.equals(i[E+1],l[c+1],R);)c++,E++,S++,R.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return S&&!R.oneChangePerToken&&(t.lastComponent={count:S,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=E,c}equals(t,l,i){return i.comparator?i.comparator(t,l):t===l||!!i.ignoreCase&&t.toLowerCase()===l.toLowerCase()}removeEmpty(t){const l=[];for(let i=0;i<t.length;i++)t[i]&&l.push(t[i]);return l}castInput(t,l){return t}tokenize(t,l){return Array.from(t)}join(t){return t.join("")}postProcess(t,l){return t}get useLongestToken(){return!1}buildValues(t,l,i){const f=[];let R;for(;t;)f.push(t),R=t.previousComponent,delete t.previousComponent,t=R;f.reverse();const O=f.length;let b=0,E=0,c=0;for(;b<O;b++){const S=f[b];if(S.removed)S.value=this.join(i.slice(c,c+S.count)),c+=S.count;else{if(!S.added&&this.useLongestToken){let N=l.slice(E,E+S.count);N=N.map(function(A,M){const we=i[c+M];return we.length>A.length?we:A}),S.value=this.join(N)}else S.value=this.join(l.slice(E,E+S.count));E+=S.count,S.added||(c+=S.count)}}return f}}const ga="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Cr extends xr{tokenize(t){const l=new RegExp(`(\\r?\\n)|[${ga}]+|[^\\S\\n\\r]+|[^${ga}]`,"ug");return t.match(l)||[]}}const Er=new Cr;function Sr(Y,t,l){return Er.diff(Y,t,l)}var Ar=j('<div class="dp-row svelte-1g4tvol"><div class="dp-icon svelte-1g4tvol"><!></div> <div class="dp-key svelte-1g4tvol"> </div> <div class="dp-value svelte-1g4tvol"><div class="dp-diff-old svelte-1g4tvol"><span> </span></div> <div class="dp-diff-new svelte-1g4tvol"><span> </span></div></div></div>'),Pr=j('<div class="diff-properties svelte-1g4tvol"></div>'),Rr=j('<span class="db-added"> </span>'),Tr=j('<span class="db-removed"> </span>'),Dr=j("<span> </span>"),Or=j("<span> </span>"),Lr=j('<div class="diff-view svelte-1g4tvol"><!> <div class="diff-body svelte-1g4tvol"><!></div></div>');function zr(Y,t){nt(t,!0);function l(A){if(A==null)return"";if(typeof A!="object")return String(A);const M=A;return String(M.name??M.title??M.label??M.id??JSON.stringify(M))}function i(A){return A==null?"":Array.isArray(A)?A.map(l).join(", "):typeof A=="object"?l(A):String(A)}const f=Pe(()=>t.refreshResult.body_changed&&t.refreshResult.body_diff?Sr(t.refreshResult.body_diff.old,t.refreshResult.body_diff.new):null);var R=Lr(),O=_(R);{var b=A=>{var M=Pr();Ne(M,21,()=>t.refreshResult.diffs,Ve,(we,L)=>{const ue=Pe(()=>t.properties.find(h=>h.key===e(L).field));var Re=Ar(),Z=_(Re),B=_(Z);{var ke=h=>{Kt(h,{size:14})},re=h=>{Nt(h,{size:14})},C=h=>{qt(h,{size:14})},x=h=>{xa(h,{size:14})},a=h=>{Ut(h,{size:14})};ye(B,h=>{e(ue)?.type==="date"?h(ke):e(ue)?.type==="status"?h(re,1):e(ue)?.type==="wikilink"?h(C,2):e(ue)?.type==="badge"?h(x,3):h(a,!1)})}d(Z);var n=I(Z,2),s=_(n,!0);d(n);var g=I(n,2),k=_(g),q=_(k),oe=_(q,!0);d(q),d(k);var Te=I(k,2),w=_(Te),v=_(w,!0);d(w),d(Te),d(g),d(Re),ce((h,P)=>{ie(s,e(L).field),ie(oe,h),ie(v,P)},[()=>i(e(L).old_value),()=>i(e(L).new_value)]),p(we,Re)}),d(M),p(A,M)};ye(O,A=>{t.refreshResult.diffs.length>0&&A(b)})}var E=I(O,2),c=_(E);{var S=A=>{var M=We(),we=Se(M);Ne(we,17,()=>e(f),Ve,(L,ue)=>{var Re=We(),Z=Se(Re);{var B=C=>{var x=Rr(),a=_(x,!0);d(x),ce(()=>ie(a,e(ue).value)),p(C,x)},ke=C=>{var x=Tr(),a=_(x,!0);d(x),ce(()=>ie(a,e(ue).value)),p(C,x)},re=C=>{var x=Dr(),a=_(x,!0);d(x),ce(()=>ie(a,e(ue).value)),p(C,x)};ye(Z,C=>{e(ue).added?C(B):e(ue).removed?C(ke,1):C(re,!1)})}p(L,Re)}),p(A,M)},N=A=>{var M=Or(),we=_(M,!0);d(M),ce(()=>ie(we,t.bodyContent)),p(A,M)};ye(c,A=>{e(f)?A(S):A(N,!1)})}d(E),d(R),p(Y,R),rt()}var Fr=j("<!> ",1),Mr=j('<span class="diff-action-title svelte-udj3er">Changes from source</span> <div class="diff-action-buttons svelte-udj3er"><!> <!></div>',1),Ir=j('<span class="bc-sep svelte-udj3er">/</span>'),jr=j("<!><span> </span>",1),Kr=j('<span class="status-text saving svelte-udj3er">Saving...</span>'),Ur=j('<span class="status-text error svelte-udj3er"> </span>'),Nr=j("<!> ",1),qr=j('<div class="breadcrumb-path svelte-udj3er"></div> <div class="editor-actions svelte-udj3er"><!> <!> <!></div>',1),Vr=j('<div class="refresh-panel svelte-udj3er"><div class="refresh-uptodate svelte-udj3er">Entity is up to date with source.</div></div>'),Wr=j('<div class="document-scroll svelte-udj3er"><div class="document-well svelte-udj3er"><!> <!> <!></div></div>'),Br=j("<!> <!>",1),Hr=j("<!> <!>",1),Yr=j("<!> <div><!></div> <!> <!> <!> <!>",1);function bs(Y,t){nt(t,!0);const l=()=>Ma(Ka,"$page",i),[i,f]=Ia(),R=Pe(()=>t.data.type==="dataset"||t.data.entity.document?.frontmatter?.entity_type==="dataset"),O=Pe(()=>xt.getAppForEntityType(t.data.entity.document?.frontmatter?.entity_type??t.data.type)),b=Pe(()=>()=>{const o=t.data.entity.path;if(o){const D=o.lastIndexOf(`/${t.data.repo}/`);if(D>=0)return o.substring(D+1).split("/")}return[t.data.repo,t.data.id,"main.md"]});let E=Oe(""),c=Oe(ht({})),S=Oe(0);const N=Pe(()=>yr(e(c))),A=new Set(["name","date"]);let M=Oe(null);ut(()=>{if(l().url.searchParams.has("new")){y(M,"name");const o=new URL(l().url);o.searchParams.delete("new"),history.replaceState({},"",o.pathname)}else y(M,null)});const we=Pe(()=>!!t.data.entity.data?.source_ref);let L=Oe(!1),ue=Oe(null),Re=Oe(null);async function Z(){if(!e(L)){y(L,!0),y(ue,null),y(Re,null);try{const{result:o}=await Ya(t.data.repo,t.data.type,t.data.id);y(ue,o,!0)}catch(o){y(Re,o.message||"Refresh failed",!0)}finally{y(L,!1)}}}let B=Oe(!1);async function ke(){if(!e(B)){y(B,!0);try{await Ha(t.data.repo,t.data.type,t.data.id),y(ue,null),await ja()}catch(o){y(Re,o.message||"Apply changes failed",!0)}finally{y(B,!1)}}}let re=null,C=Oe(""),x=!1,a=Oe(ht([]));function n(o){s(),Xe(async()=>{const{createCollabSession:D}=await import("../chunks/D1SfcMkP.js");return{createCollabSession:D}},__vite__mapDeps([8,9,10,11,12,13,14,15,16,17,18]),import.meta.url).then(({createCollabSession:D})=>{const de=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",Q=D(o,{name:fa.user?.displayName??"Anonymous",color:de,colorLight:de+"33"});Q.ytext.observe(()=>{const fe=Q.ytext.toString();fe!==e(E)&&(x=!0,y(E,fe,!0),requestAnimationFrame(()=>{x=!1}))});const me=Q.ydoc.clientID;function xe(){const fe=[];Q.awareness.getStates().forEach((Ce,X)=>{if(X===me)return;const F=Ce.cell;if(F==null||F.row==null||F.col==null)return;const{name:H="Anonymous",color:U="#e05050"}=Ce.user||{};fe.push({row:F.row,col:F.col,name:H,color:U})}),y(a,fe,!0)}Q.awareness.on("change",xe),re=Q,y(C,o,!0)})}function s(){re&&(re.destroy(),re=null,y(C,""),y(a,[],!0))}wa(()=>s());let g=Oe(""),k=Oe(0);ut(()=>{const o=`${t.data.repo}/${t.data.type}/${t.data.id}`,D=Ga.mutationCount;if(o!==e(g)||D!==e(k)){e(g)&&o!==e(g)&&Ye.flush(),y(g,o),y(k,D,!0),y(E,t.data.entity.document?.content??"",!0),y(c,{...t.data.entity.document?.frontmatter??t.data.entity.data??{}},!0),Lt(S),Ye.reset();const de=`${t.data.repo}/${t.data.type}/${t.data.id}`;e(R)&&de!==e(C)?n(de):e(R)||s()}}),ut(()=>{const o=t.data.repo,D=t.data.type,de=t.data.id;ma(()=>{aa.select(o,D,de),aa.showEntity()})});function q(o){if(!x){if(y(E,o,!0),re){const D=re.ytext,de=D.toString();o!==de&&re.ydoc.transact(()=>{D.delete(0,D.length),D.insert(0,o)})}Ye.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{content:o})}}function oe(o,D){y(c,{...e(c),[o]:D},!0),Ye.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(c)})}function Te(o){const{[o]:D,...de}=e(c);y(c,de,!0),Ye.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(c)})}function w(o,D){y(c,{...e(c),[o]:D},!0),Ye.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(c)})}function v(o,D){Ye.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(c)})}let h=Oe(null);function P(o){o!==t.data.type&&y(h,o,!0)}async function G(){const o=e(h);if(y(h,null),!!o){Ye.reset();try{await Ta(t.data.repo,t.data.type,t.data.id,o),await xt.refreshEntities(t.data.repo),await zt(`/${t.data.repo}/${o}/${t.data.id}`,{invalidateAll:!0})}catch(D){console.error("Failed to change entity type:",D)}}}function K(o){for(const D of xt.repos){const de=D.entities.find(Q=>Q.id===o);if(de){zt(`/${D.name}/${de.entityType}/${de.id}`);return}}Qa.showToast(`"${o}" is in a collection you don't have access to`)}ut(()=>(ca.enter(t.data.repo,t.data.type,t.data.id),()=>ca.leave()));const W=Pe(()=>e(ue)!==null&&(e(ue).diffs.length>0||e(ue).body_changed));function m(o){(o.metaKey||o.ctrlKey)&&o.key==="s"&&(o.preventDefault(),Ye.flush()),o.key==="Escape"&&!(o.target instanceof HTMLInputElement||o.target instanceof HTMLTextAreaElement)&&(Ye.flush(),aa.deselect(),zt("/"))}var V=Yr();ft("keydown",ya,m);var ve=Se(V);Ua(ve,{activeView:"entity"});var J=I(ve,2);let u;var r=_(J);{var z=o=>{var D=Mr(),de=I(Se(D),2),Q=_(de);Ze(Q,{variant:"outline",size:"default",onclick:()=>y(ue,null),get disabled(){return e(B)},children:(xe,fe)=>{Be();var Ce=dt("Dismiss");p(xe,Ce)},$$slots:{default:!0}});var me=I(Q,2);Ze(me,{variant:"accent",size:"default",onclick:ke,get disabled(){return e(B)},children:(xe,fe)=>{var Ce=Fr(),X=Se(Ce);{var F=U=>{_a(U,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};ye(X,U=>{e(B)&&U(F)})}var H=I(X,1,!0);ce(()=>ie(H,e(B)?"Applying...":"Apply changes")),p(xe,Ce)},$$slots:{default:!0}}),d(de),p(o,D)},le=o=>{var D=qr(),de=Se(D);Ne(de,21,()=>e(b)(),Ve,(U,_e,Ae)=>{var he=jr(),De=Se(he);{var ze=Me=>{var He=Ir();p(Me,He)};ye(De,Me=>{Ae>0&&Me(ze)})}var be=I(De),Fe=_(be,!0);d(be),ce(Me=>{Ct(be,1,Me,"svelte-udj3er"),ie(Fe,e(_e))},[()=>Fa(Ae===e(b)().length-1?"bc-current":"bc-segment")]),p(U,he)}),d(de);var Q=I(de,2),me=_(Q);{var xe=U=>{var _e=Kr();p(U,_e)},fe=U=>{var _e=Ur(),Ae=_(_e,!0);d(_e),ce(()=>ie(Ae,Ye.error)),p(U,_e)};ye(me,U=>{Ye.saving?U(xe):Ye.error&&U(fe,1)})}var Ce=I(me,2);{var X=U=>{Ze(U,{variant:"outline",size:"sm",class:"refresh-btn",onclick:Z,get disabled(){return e(L)},children:(_e,Ae)=>{var he=Nr(),De=Se(he);{var ze=Fe=>{_a(Fe,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};ye(De,Fe=>{e(L)&&Fe(ze)})}var be=I(De,1,!0);ce(()=>ie(be,e(L)?"Refreshing...":"Refresh from source")),p(_e,he)},$$slots:{default:!0}})};ye(Ce,U=>{e(we)&&fa.user?.role==="admin"&&U(X)})}var F=I(Ce,2);{var H=U=>{Ze(U,{variant:"link",size:"sm",class:"open-app",get href(){return`/${t.data.repo??""}/${t.data.type??""}/${t.data.id??""}/edit`},children:(_e,Ae)=>{Be();var he=dt();ce(()=>ie(he,`Open in ${e(O).name??""} →`)),p(_e,he)},$$slots:{default:!0}})};ye(F,U=>{e(O)&&U(H)})}d(Q),p(o,D)};ye(r,o=>{e(W)?o(z):o(le,!1)})}d(J);var T=I(J,2);{var ae=o=>{var D=Vr();p(o,D)};ye(T,o=>{e(ue)&&!e(W)&&o(ae)})}var ee=I(T,2);{var te=o=>{zr(o,{get properties(){return e(N)},get refreshResult(){return e(ue)},get bodyContent(){return e(E)}})},pe=o=>{var D=Wr(),de=_(D),Q=_(de);Hn(Q,{get properties(){return e(N)},editable:!0,get autofocusKey(){return e(M)},get protectedKeys(){return A},onedit:oe,onremove:Te,onadd:w,ontypechange:v,onentitytypechange:P,onfocuseditor:()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>{const X=document.querySelector(".cm-content");if(X){X.focus();const F=window.getSelection();F&&X.firstChild?F.collapse(X.firstChild,0):F&&F.collapse(X,0)}}))}});var me=I(Q,2);{var xe=X=>{hr(X,{get content(){return e(E)},onchange:q,onsave:()=>Ye.flush(),oncellselect:(F,H)=>{re?.awareness.setLocalStateField("cell",{row:F,col:H})},get remoteCursors(){return e(a)}})},fe=X=>{{let F=Pe(()=>`${t.data.repo}/${t.data.type}/${t.data.id}`);nr(X,{get content(){return e(E)},readonly:!1,onchange:q,onsave:()=>Ye.flush(),onwikilinkclick:K,get resetKey(){return e(S)},get cursorDocName(){return e(F)}})}};ye(me,X=>{e(R)?X(xe):X(fe,!1)})}var Ce=I(me,2);{let X=Pe(()=>t.data.entity.document?.wikilinks??[]);$n(Ce,{get entityId(){return t.data.id},get entityRepo(){return t.data.repo},get entityType(){return t.data.type},get wikilinks(){return e(X)}})}d(de),d(D),p(o,D)};ye(ee,o=>{e(W)?o(te):o(pe,!1)})}var se=I(ee,2);{let o=Pe(()=>!!e(Re));Ue(se,()=>rn,(D,de)=>{de(D,{get open(){return e(o)},onOpenChange:Q=>{Q||y(Re,null)},children:(Q,me)=>{var xe=We(),fe=Se(xe);Ue(fe,()=>Xa,(Ce,X)=>{X(Ce,{children:(F,H)=>{var U=Hr(),_e=Se(U);Ue(_e,()=>$a,(he,De)=>{De(he,{children:(ze,be)=>{var Fe=Br(),Me=Se(Fe);Ue(Me,()=>en,(ne,$)=>{$(ne,{children:(ge,Ee)=>{Be();var Le=dt("Refresh failed");p(ge,Le)},$$slots:{default:!0}})});var He=I(Me,2);Ue(He,()=>tn,(ne,$)=>{$(ne,{children:(ge,Ee)=>{Be();var Le=dt();ce(()=>ie(Le,e(Re))),p(ge,Le)},$$slots:{default:!0}})}),p(ze,Fe)},$$slots:{default:!0}})});var Ae=I(_e,2);Ue(Ae,()=>an,(he,De)=>{De(he,{children:(ze,be)=>{var Fe=We(),Me=Se(Fe);Ue(Me,()=>nn,(He,ne)=>{ne(He,{children:($,ge)=>{Be();var Ee=dt("OK");p($,Ee)},$$slots:{default:!0}})}),p(ze,Fe)},$$slots:{default:!0}})}),p(F,U)},$$slots:{default:!0}})}),p(Q,xe)},$$slots:{default:!0}})})}var Ie=I(se,2);{let o=Pe(()=>e(h)!==null),D=Pe(()=>`Change this entity from ${vt(t.data.type)} to ${vt(e(h)??"")}? Fields specific to ${vt(t.data.type)} will be removed.`);Wa(Ie,{get open(){return e(o)},title:"Change entity type",get message(){return e(D)},confirmLabel:"Change type",onconfirm:G,oncancel:()=>{y(h,null)}})}ce(()=>u=Ct(J,1,"editor-bar svelte-udj3er",null,u,{"editor-bar-diff":e(W)})),p(Y,V),rt(),f()}export{bs as component,ks as universal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as lt,w as ut}from"../chunks/
|
|
1
|
+
import{h as lt,w as ut}from"../chunks/xwFtwYnE.js";import{a as S,s as Z,b as M,c as ft}from"../chunks/BJBX4SKZ.js";import{p as $,a2 as tt,aD as mt,c as F,a3 as T,g as m,r as I,t as O,b as et,e as Q,s as k,aF as ht,a0 as vt,a4 as yt}from"../chunks/e913tUZv.js";import{b as X,i as j}from"../chunks/D6Lva3KM.js";import{s as Y}from"../chunks/C8Y6xIC4.js";import{g as pt}from"../chunks/BsdMYUpR.js";import{n as E}from"../chunks/CIhtHHtB.js";const bt=async({params:b})=>{const{repo:o,type:l,id:s}=b,u=await lt(o,l,s);return{repo:o,type:l,id:s,entity:u}},Tt=Object.freeze(Object.defineProperty({__proto__:null,load:bt},Symbol.toStringTag,{value:"Module"}));var gt=M('<div class="loading-indicator svelte-1fltv0h">Loading editor...</div>'),wt=M('<div class="error-indicator svelte-1fltv0h"> </div>'),_t=M('<div><div class="header-mount svelte-1fltv0h"></div> <!> <!> <div></div></div>');function kt(b,o){$(o,!0);let l,s,u=Q(!0),h=Q(null),y=[],d=[],v=[],g={},x=[],p=null,w=null,_=0;function q(){const e=window.StudioChrome,i=document.querySelector(".sg-chrome-overflow-menu");if(i&&(i.innerHTML=""),e&&(e.clearViewAction(),e.clearSaveHandlers()),w&&(w.el.removeEventListener("click",w.handler,!0),w=null),e){e.unmountHeader();for(const{event:r,fn:c}of v)e.off(r,c)}v=[];for(const r of y)r.remove();y=[];for(const r of d)r.remove();d=[],p&&(p.remove(),p=null);for(const[r,c]of Object.entries(g))c===void 0?document.body.removeAttribute(r):document.body.setAttribute(r,c);g={};for(const r of x)document.body.classList.remove(r);x=[],s&&(s.innerHTML="")}async function B(){const e=++_;k(u,!0),k(h,null),q();try{const i=`${o.appMountPath}/edit/${encodeURIComponent(o.repo)}/${encodeURIComponent(o.entityId)}`,r=await fetch(i);if(!r.ok)throw new Error(`Failed to load editor: ${r.status}`);if(e!==_)return;const c=await r.text(),H=new DOMParser().parseFromString(c,"text/html"),at=H.querySelectorAll('link[rel="stylesheet"]');for(const t of at){if(t.href.includes("chrome.css"))continue;let n=t.getAttribute("href")||"";n&&!n.startsWith("http")&&!n.startsWith("/")&&(n=`${o.appMountPath}/${n}`);const a=document.createElement("link");a.rel="stylesheet",a.href=n,document.head.appendChild(a),y.push(a)}const it=H.querySelectorAll("head style");for(const t of it){const n=document.createElement("style");n.textContent=t.textContent,document.head.appendChild(n),y.push(n)}p=document.createElement("style"),p.textContent=`
|
|
2
2
|
body.sg-chrome-active { height: auto !important; }
|
|
3
3
|
body.sg-chrome-active > :not(.sg-chrome-header):not(.sg-chrome-footer) { overflow: visible !important; }
|
|
4
4
|
`,document.head.appendChild(p);const C=H.body;for(const t of Array.from(C.attributes))t.name.startsWith("data-")&&(g[t.name]=document.body.getAttribute(t.name)??void 0,document.body.setAttribute(t.name,t.value));const st=Array.from(C.classList);for(const t of st)t!=="sg-chrome-active"&&(document.body.classList.contains(t)||(document.body.classList.add(t),x.push(t)));const ct=C.querySelectorAll("script"),K=[],N=[];for(const t of ct){if(t.src){const n=t.getAttribute("src")||"";if(n.includes("chrome.js"))continue;let a=n;a&&!a.startsWith("http")&&!a.startsWith("/")&&(a=`${o.appMountPath}/${a}`),K.push(a)}else t.textContent&&N.push(t.textContent);t.remove()}s.innerHTML=C.innerHTML;const f=window.StudioChrome;if(f){f.updateBreadcrumb(o.repo,o.entityId),f.mountHeader(l);const t=document.body.dataset.sgViewUrl,n=document.body.dataset.sgViewLabel;t?f.setViewAction(t,n):f.clearViewAction();const a=l.querySelector(".sg-chrome-back");if(a){const G=J=>{J.preventDefault(),J.stopPropagation(),pt(`/${o.repo}/${o.entityType}/${o.entityId}`)};a.addEventListener("click",G,!0),w={el:a,handler:G}}}let L=null;f&&(L=f.on,f.on=function(t,n){v.push({event:t,fn:n}),L.call(this,t,n)});const dt=`?_v=${Date.now()}`;for(const t of K){if(e!==_)return;await ot(t+dt)}for(const t of N){if(e!==_)return;const n=document.createElement("script");n.textContent=t,document.body.appendChild(n),d.push(n)}f&&L&&(f.on=L),k(u,!1)}catch(i){if(e!==_)return;k(h,i.message||"Failed to load editor",!0),k(u,!1)}}function ot(e){return new Promise((i,r)=>{const c=document.createElement("script");c.src=e,c.onload=()=>i(),c.onerror=()=>r(new Error(`Failed to load script: ${e}`)),document.body.appendChild(c),d.push(c)})}let P="";tt(()=>{const e=`${o.appMountPath}|${o.repo}|${o.entityId}`;P&&P!==e&&s&&B(),P=e}),mt(()=>(B(),q));var A=_t();let D;var V=F(A);X(V,e=>l=e,()=>l);var W=T(V,2);{var nt=e=>{var i=gt();S(e,i)};j(W,e=>{m(u)&&e(nt)})}var U=T(W,2);{var rt=e=>{var i=wt(),r=F(i,!0);I(i),O(()=>Z(r,m(h))),S(e,i)};j(U,e=>{m(h)&&e(rt)})}var R=T(U,2);let z;X(R,e=>s=e,()=>s),I(A),O(()=>{D=Y(A,1,"editor-frame svelte-1fltv0h",null,D,{loading:m(u)}),z=Y(R,1,"editor-container svelte-1fltv0h",null,z,{hidden:m(u)||!!m(h)})}),S(b,A),et()}var St=M('<div class="no-editor svelte-1406f3k"> </div>');function Ft(b,o){$(o,!0);const l=yt(()=>ut.getAppForEntityType(o.data.type));tt(()=>{E.select(o.data.repo,o.data.type,o.data.id),E.showEntity(),E.hideSidebar=!0}),ht(()=>{E.hideSidebar=!1});var s=ft(),u=vt(s);{var h=d=>{kt(d,{get appMountPath(){return m(l).mountPath},get repo(){return o.data.repo},get entityId(){return o.data.id},get entityType(){return o.data.type}})},y=d=>{var v=St(),g=F(v);I(v),O(()=>Z(g,`No app editor available for entity type "${o.data.type??""}"`)),S(d,v)};j(u,d=>{m(l)?d(h):d(y,!1)})}S(b,s),et()}export{Ft as component,Tt as universal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BB_5th5W.js","../chunks/PPVm8Dsz.js","../chunks/CqkleIqs.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{d as Ae,e as Tt,a as ht,b as Dt,s as It,g as le,f as $t,c as Qe}from"../chunks/BdF6nRVd.js";import{p as Ft,a1 as Je,a2 as St,g,a4 as nt,aD as Ne,aF as qe,t as yt,b as Bt,c as at,s as q,e as pt,r as it,a3 as gt,l as Ut,d as Pt,a as ze,n as Se,m as Zt,a0 as ke,bu as $e}from"../chunks/sZJoCX5N.js";import{V as tn}from"../chunks/CjNv-xfA.js";import{_ as en}from"../chunks/PPVm8Dsz.js";import{e as ce,i as fe}from"../chunks/gawey_BW.js";import{s as nn}from"../chunks/OZfYVFGq.js";import{c as kt,a as Pe}from"../chunks/BKUmpdNY.js";import{b as Ee,i as Kt}from"../chunks/BSSN_IAc.js";import{p as mt,l as Qt}from"../chunks/DNrFMx27.js";import{g as rn}from"../chunks/CULlunSW.js";import{e as Mt}from"../chunks/CdeYcEuU.js";import{B as on}from"../chunks/9rXsO0Bz.js";import{i as Re}from"../chunks/faGDeGnG.js";import{n as se}from"../chunks/CkIXD8Ce.js";import{w as Wt}from"../chunks/DvmL5xMZ.js";import{chatStore as an}from"../chunks/Mvm7cCyj.js";function sn(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Le(this.cover(e,n),e,n,t)}function Le(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a=t._root,c={data:i},o=t._x0,u=t._y0,l=t._x1,f=t._y1,C,d,v,b,p,s,h,x;if(!a)return t._root=c,t;for(;a.length;)if((p=e>=(C=(o+l)/2))?o=C:l=C,(s=n>=(d=(u+f)/2))?u=d:f=d,r=a,!(a=a[h=s<<1|p]))return r[h]=c,t;if(v=+t._x.call(null,a.data),b=+t._y.call(null,a.data),e===v&&n===b)return c.next=a,r?r[h]=c:t._root=c,t;do r=r?r[h]=new Array(4):t._root=new Array(4),(p=e>=(C=(o+l)/2))?o=C:l=C,(s=n>=(d=(u+f)/2))?u=d:f=d;while((h=s<<1|p)===(x=(b>=d)<<1|v>=C));return r[x]=a,r[h]=c,t}function ln(t){var e,n,i=t.length,r,a,c=new Array(i),o=new Array(i),u=1/0,l=1/0,f=-1/0,C=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(a=+this._y.call(null,e))||(c[n]=r,o[n]=a,r<u&&(u=r),r>f&&(f=r),a<l&&(l=a),a>C&&(C=a));if(u>f||l>C)return this;for(this.cover(u,l).cover(f,C),n=0;n<i;++n)Le(this,c[n],o[n],t[n]);return this}function cn(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var c=r-n||1,o=this._root,u,l;n>t||t>=r||i>e||e>=a;)switch(l=(e<i)<<1|t<n,u=new Array(4),u[l]=o,o=u,c*=2,l){case 0:r=n+c,a=i+c;break;case 1:n=r-c,a=i+c;break;case 2:r=n+c,i=a-c;break;case 3:n=r-c,i=a-c;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this}function fn(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function un(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function st(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function hn(t,e,n){var i,r=this._x0,a=this._y0,c,o,u,l,f=this._x1,C=this._y1,d=[],v=this._root,b,p;for(v&&d.push(new st(v,r,a,f,C)),n==null?n=1/0:(r=t-n,a=e-n,f=t+n,C=e+n,n*=n);b=d.pop();)if(!(!(v=b.node)||(c=b.x0)>f||(o=b.y0)>C||(u=b.x1)<r||(l=b.y1)<a))if(v.length){var s=(c+u)/2,h=(o+l)/2;d.push(new st(v[3],s,h,u,l),new st(v[2],c,h,s,l),new st(v[1],s,o,u,h),new st(v[0],c,o,s,h)),(p=(e>=h)<<1|t>=s)&&(b=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=b)}else{var x=t-+this._x.call(null,v.data),D=e-+this._y.call(null,v.data),m=x*x+D*D;if(m<n){var N=Math.sqrt(n=m);r=t-N,a=e-N,f=t+N,C=e+N,i=v.data}}return i}function dn(t){if(isNaN(f=+this._x.call(null,t))||isNaN(C=+this._y.call(null,t)))return this;var e,n=this._root,i,r,a,c=this._x0,o=this._y0,u=this._x1,l=this._y1,f,C,d,v,b,p,s,h;if(!n)return this;if(n.length)for(;;){if((b=f>=(d=(c+u)/2))?c=d:u=d,(p=C>=(v=(o+l)/2))?o=v:l=v,e=n,!(n=n[s=p<<1|b]))return this;if(!n.length)break;(e[s+1&3]||e[s+2&3]||e[s+3&3])&&(i=e,h=s)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,r?(a?r.next=a:delete r.next,this):e?(a?e[s]=a:delete e[s],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(i?i[h]=n:this._root=n),this):(this._root=a,this)}function gn(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function vn(){return this._root}function pn(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function yn(t){var e=[],n,i=this._root,r,a,c,o,u;for(i&&e.push(new st(i,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(i=n.node,a=n.x0,c=n.y0,o=n.x1,u=n.y1)&&i.length){var l=(a+o)/2,f=(c+u)/2;(r=i[3])&&e.push(new st(r,l,f,o,u)),(r=i[2])&&e.push(new st(r,a,f,l,u)),(r=i[1])&&e.push(new st(r,l,c,o,f)),(r=i[0])&&e.push(new st(r,a,c,l,f))}return this}function mn(t){var e=[],n=[],i;for(this._root&&e.push(new st(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var r=i.node;if(r.length){var a,c=i.x0,o=i.y0,u=i.x1,l=i.y1,f=(c+u)/2,C=(o+l)/2;(a=r[0])&&e.push(new st(a,c,o,f,C)),(a=r[1])&&e.push(new st(a,f,o,u,C)),(a=r[2])&&e.push(new st(a,c,C,f,l)),(a=r[3])&&e.push(new st(a,f,C,u,l))}n.push(i)}for(;i=n.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function xn(t){return t[0]}function wn(t){return arguments.length?(this._x=t,this):this._x}function _n(t){return t[1]}function bn(t){return arguments.length?(this._y=t,this):this._y}function de(t,e,n){var i=new ge(e??xn,n??_n,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function ge(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function ye(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var ct=de.prototype=ge.prototype;ct.copy=function(){var t=new ge(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,i;if(!e)return t;if(!e.length)return t._root=ye(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var r=0;r<4;++r)(i=e.source[r])&&(i.length?n.push({source:i,target:e.target[r]=new Array(4)}):e.target[r]=ye(i));return t};ct.add=sn;ct.addAll=ln;ct.cover=cn;ct.data=fn;ct.extent=un;ct.find=hn;ct.remove=dn;ct.removeAll=gn;ct.root=vn;ct.size=pn;ct.visit=yn;ct.visitAfter=mn;ct.x=wn;ct.y=bn;function lt(t){return function(){return t}}function xt(t){return(t()-.5)*1e-6}function Mn(t){return t.x+t.vx}function Tn(t){return t.y+t.vy}function me(t){var e,n,i,r=1,a=1;typeof t!="function"&&(t=lt(t==null?1:+t));function c(){for(var l,f=e.length,C,d,v,b,p,s,h=0;h<a;++h)for(C=de(e,Mn,Tn).visitAfter(o),l=0;l<f;++l)d=e[l],p=n[d.index],s=p*p,v=d.x+d.vx,b=d.y+d.vy,C.visit(x);function x(D,m,N,S,W){var B=D.data,$=D.r,G=p+$;if(B){if(B.index>d.index){var ft=v-B.x-B.vx,Q=b-B.y-B.vy,ot=ft*ft+Q*Q;ot<G*G&&(ft===0&&(ft=xt(i),ot+=ft*ft),Q===0&&(Q=xt(i),ot+=Q*Q),ot=(G-(ot=Math.sqrt(ot)))/ot*r,d.vx+=(ft*=ot)*(G=($*=$)/(s+$)),d.vy+=(Q*=ot)*G,B.vx-=ft*(G=1-G),B.vy-=Q*G)}return}return m>v+G||S<v-G||N>b+G||W<b-G}}function o(l){if(l.data)return l.r=n[l.data.index];for(var f=l.r=0;f<4;++f)l[f]&&l[f].r>l.r&&(l.r=l[f].r)}function u(){if(e){var l,f=e.length,C;for(n=new Array(f),l=0;l<f;++l)C=e[l],n[C.index]=+t(C,l,e)}}return c.initialize=function(l,f){e=l,i=f,u()},c.iterations=function(l){return arguments.length?(a=+l,c):a},c.strength=function(l){return arguments.length?(r=+l,c):r},c.radius=function(l){return arguments.length?(t=typeof l=="function"?l:lt(+l),u(),c):t},c}function In(t){return t.index}function xe(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function we(t){var e=In,n=C,i,r=lt(30),a,c,o,u,l,f=1;t==null&&(t=[]);function C(s){return 1/Math.min(o[s.source.index],o[s.target.index])}function d(s){for(var h=0,x=t.length;h<f;++h)for(var D=0,m,N,S,W,B,$,G;D<x;++D)m=t[D],N=m.source,S=m.target,W=S.x+S.vx-N.x-N.vx||xt(l),B=S.y+S.vy-N.y-N.vy||xt(l),$=Math.sqrt(W*W+B*B),$=($-a[D])/$*s*i[D],W*=$,B*=$,S.vx-=W*(G=u[D]),S.vy-=B*G,N.vx+=W*(G=1-G),N.vy+=B*G}function v(){if(c){var s,h=c.length,x=t.length,D=new Map(c.map((N,S)=>[e(N,S,c),N])),m;for(s=0,o=new Array(h);s<x;++s)m=t[s],m.index=s,typeof m.source!="object"&&(m.source=xe(D,m.source)),typeof m.target!="object"&&(m.target=xe(D,m.target)),o[m.source.index]=(o[m.source.index]||0)+1,o[m.target.index]=(o[m.target.index]||0)+1;for(s=0,u=new Array(x);s<x;++s)m=t[s],u[s]=o[m.source.index]/(o[m.source.index]+o[m.target.index]);i=new Array(x),b(),a=new Array(x),p()}}function b(){if(c)for(var s=0,h=t.length;s<h;++s)i[s]=+n(t[s],s,t)}function p(){if(c)for(var s=0,h=t.length;s<h;++s)a[s]=+r(t[s],s,t)}return d.initialize=function(s,h){c=s,l=h,v()},d.links=function(s){return arguments.length?(t=s,v(),d):t},d.id=function(s){return arguments.length?(e=s,d):e},d.iterations=function(s){return arguments.length?(f=+s,d):f},d.strength=function(s){return arguments.length?(n=typeof s=="function"?s:lt(+s),b(),d):n},d.distance=function(s){return arguments.length?(r=typeof s=="function"?s:lt(+s),p(),d):r},d}var Cn={value:()=>{}};function Ve(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new jt(n)}function jt(t){this._=t}function Dn(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}jt.prototype=Ve.prototype={constructor:jt,on:function(t,e){var n=this._,i=Dn(t+"",n),r,a=-1,c=i.length;if(arguments.length<2){for(;++a<c;)if((r=(t=i[a]).type)&&(r=An(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<c;)if(r=(t=i[a]).type)n[r]=_e(n[r],t.name,e);else if(e==null)for(r in n)n[r]=_e(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new jt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,a;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],i=0,r=a.length;i<r;++i)a[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};function An(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function _e(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Cn,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var Et=0,Lt=0,Rt=0,Xe=1e3,Jt,Vt,qt=0,Ct=0,te=0,Xt=typeof performance=="object"&&performance.now?performance:Date,Fe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Be(){return Ct||(Fe(Nn),Ct=Xt.now()+te)}function Nn(){Ct=0}function ue(){this._call=this._time=this._next=null}ue.prototype=Oe.prototype={constructor:ue,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Be():+n)+(e==null?0:+e),!this._next&&Vt!==this&&(Vt?Vt._next=this:Jt=this,Vt=this),this._call=t,this._time=n,he()},stop:function(){this._call&&(this._call=null,this._time=1/0,he())}};function Oe(t,e,n){var i=new ue;return i.restart(t,e,n),i}function zn(){Be(),++Et;for(var t=Jt,e;t;)(e=Ct-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Et}function be(){Ct=(qt=Xt.now())+te,Et=Lt=0;try{zn()}finally{Et=0,kn(),Ct=0}}function Sn(){var t=Xt.now(),e=t-qt;e>Xe&&(te-=e,qt=t)}function kn(){for(var t,e=Jt,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Jt=n);Vt=t,he(i)}function he(t){if(!Et){Lt&&(Lt=clearTimeout(Lt));var e=t-Ct;e>24?(t<1/0&&(Lt=setTimeout(be,t-Xt.now()-te)),Rt&&(Rt=clearInterval(Rt))):(Rt||(qt=Xt.now(),Rt=setInterval(Sn,Xe)),Et=1,Fe(be))}}const Pn=1664525,En=1013904223,Me=4294967296;function Rn(){let t=1;return()=>(t=(Pn*t+En)%Me)/Me}function Ln(t){return t.x}function Vn(t){return t.y}var Xn=10,Fn=Math.PI*(3-Math.sqrt(5));function Te(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),a=0,c=.6,o=new Map,u=Oe(C),l=Ve("tick","end"),f=Rn();t==null&&(t=[]);function C(){d(),l.call("tick",e),n<i&&(u.stop(),l.call("end",e))}function d(p){var s,h=t.length,x;p===void 0&&(p=1);for(var D=0;D<p;++D)for(n+=(a-n)*r,o.forEach(function(m){m(n)}),s=0;s<h;++s)x=t[s],x.fx==null?x.x+=x.vx*=c:(x.x=x.fx,x.vx=0),x.fy==null?x.y+=x.vy*=c:(x.y=x.fy,x.vy=0);return e}function v(){for(var p=0,s=t.length,h;p<s;++p){if(h=t[p],h.index=p,h.fx!=null&&(h.x=h.fx),h.fy!=null&&(h.y=h.fy),isNaN(h.x)||isNaN(h.y)){var x=Xn*Math.sqrt(.5+p),D=p*Fn;h.x=x*Math.cos(D),h.y=x*Math.sin(D)}(isNaN(h.vx)||isNaN(h.vy))&&(h.vx=h.vy=0)}}function b(p){return p.initialize&&p.initialize(t,f),p}return v(),e={tick:d,restart:function(){return u.restart(C),e},stop:function(){return u.stop(),e},nodes:function(p){return arguments.length?(t=p,v(),o.forEach(b),e):t},alpha:function(p){return arguments.length?(n=+p,e):n},alphaMin:function(p){return arguments.length?(i=+p,e):i},alphaDecay:function(p){return arguments.length?(r=+p,e):+r},alphaTarget:function(p){return arguments.length?(a=+p,e):a},velocityDecay:function(p){return arguments.length?(c=1-p,e):1-c},randomSource:function(p){return arguments.length?(f=p,o.forEach(b),e):f},force:function(p,s){return arguments.length>1?(s==null?o.delete(p):o.set(p,b(s)),e):o.get(p)},find:function(p,s,h){var x=0,D=t.length,m,N,S,W,B;for(h==null?h=1/0:h*=h,x=0;x<D;++x)W=t[x],m=p-W.x,N=s-W.y,S=m*m+N*N,S<h&&(B=W,h=S);return B},on:function(p,s){return arguments.length>1?(l.on(p,s),e):l.on(p)}}}function Ie(){var t,e,n,i,r=lt(-30),a,c=1,o=1/0,u=.81;function l(v){var b,p=t.length,s=de(t,Ln,Vn).visitAfter(C);for(i=v,b=0;b<p;++b)e=t[b],s.visit(d)}function f(){if(t){var v,b=t.length,p;for(a=new Array(b),v=0;v<b;++v)p=t[v],a[p.index]=+r(p,v,t)}}function C(v){var b=0,p,s,h=0,x,D,m;if(v.length){for(x=D=m=0;m<4;++m)(p=v[m])&&(s=Math.abs(p.value))&&(b+=p.value,h+=s,x+=s*p.x,D+=s*p.y);v.x=x/h,v.y=D/h}else{p=v,p.x=p.data.x,p.y=p.data.y;do b+=a[p.data.index];while(p=p.next)}v.value=b}function d(v,b,p,s){if(!v.value)return!0;var h=v.x-e.x,x=v.y-e.y,D=s-b,m=h*h+x*x;if(D*D/u<m)return m<o&&(h===0&&(h=xt(n),m+=h*h),x===0&&(x=xt(n),m+=x*x),m<c&&(m=Math.sqrt(c*m)),e.vx+=h*v.value*i/m,e.vy+=x*v.value*i/m),!0;if(v.length||m>=o)return;(v.data!==e||v.next)&&(h===0&&(h=xt(n),m+=h*h),x===0&&(x=xt(n),m+=x*x),m<c&&(m=Math.sqrt(c*m)));do v.data!==e&&(D=a[v.data.index]*i/m,e.vx+=h*D,e.vy+=x*D);while(v=v.next)}return l.initialize=function(v,b){t=v,n=b,f()},l.strength=function(v){return arguments.length?(r=typeof v=="function"?v:lt(+v),f(),l):r},l.distanceMin=function(v){return arguments.length?(c=v*v,l):Math.sqrt(c)},l.distanceMax=function(v){return arguments.length?(o=v*v,l):Math.sqrt(o)},l.theta=function(v){return arguments.length?(u=v*v,l):Math.sqrt(u)},l}function Ce(t){var e=lt(.1),n,i,r;typeof t!="function"&&(t=lt(t==null?0:+t));function a(o){for(var u=0,l=n.length,f;u<l;++u)f=n[u],f.vx+=(r[u]-f.x)*i[u]*o}function c(){if(n){var o,u=n.length;for(i=new Array(u),r=new Array(u),o=0;o<u;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return a.initialize=function(o){n=o,c()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:lt(+o),c(),a):e},a.x=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),c(),a):t},a}function De(t){var e=lt(.1),n,i,r;typeof t!="function"&&(t=lt(t==null?0:+t));function a(o){for(var u=0,l=n.length,f;u<l;++u)f=n[u],f.vy+=(r[u]-f.y)*i[u]*o}function c(){if(n){var o,u=n.length;for(i=new Array(u),r=new Array(u),o=0;o<u;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return a.initialize=function(o){n=o,c()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:lt(+o),c(),a):e},a.y=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),c(),a):t},a}var Bn=Dt('<div><span class="legend-dot svelte-1i33fky"></span> <span class="legend-label svelte-1i33fky"> </span> <span class="legend-count svelte-1i33fky"> </span></div>'),On=Dt('<div class="graph-view svelte-1i33fky"><div class="canvas-wrap svelte-1i33fky"><div class="legend-panel svelte-1i33fky"></div></div></div>');function Yn(t,e){Ft(e,!0);let n=mt(e,"selectedEntityId",3,null),i=mt(e,"filteredIds",3,null),r=mt(e,"sidebarHoveredId",3,null),a=mt(e,"highlightedIds",3,null);function c(y){return e.nameMap?.get(y)??y.replace(/-/g," ").replace(/\b\w/g,w=>w.toUpperCase())}const o=Je("theme"),u=nt(()=>o.current==="light"?{default:14211288,dim:15263976,conn:12632256,labelText:1710623}:{default:2763306,dim:1315860,conn:4210752,labelText:15592943}),l=nt(()=>o.current==="light"?16316666:592139),f=.75;St(()=>{o.current,K&&(K.style.fill=g(u).labelText);const y=g(Gt);for(const w of b)Mt(w.type)===Nt&&(w.color=y);et()}),St(()=>{i(),et()}),St(()=>{a(),et()}),St(()=>{n(),et()});let C=!1;St(()=>{const y=e.graphData;if(!tt||!A||!R)return;if(!C){C=!0;return}const w=new Map;for(const T of y.edges)w.set(T.source,(w.get(T.source)??0)+1),w.set(T.target,(w.get(T.target)??0)+1);const _=new Map;for(const T of b)_.set(T.id,{x:T.x,y:T.y});const O=3600*y.nodes.length,Y=Math.sqrt(O),F=y.nodes.map(T=>{const H=w.get(T.id)??0,dt=_.get(T.id);return{id:T.id,type:T.type,repo:T.repo,color:Mt(T.type)===Nt?g(Gt):Mt(T.type),weight:H,x:dt?.x??(Math.random()-.5)*Y,y:dt?.y??(Math.random()-.5)*Y,vx:0,vy:0,r:At(H)}}),Z=new Map;for(const T of F)Z.set(T.id,T);const rt=new Set(L.keys()),ut=new Set(y.nodes.map(T=>T.id));for(const T of rt)if(!ut.has(T)){const H=L.get(T);H&&(R.removeChild(H),H.destroy()),L.delete(T)}let X=null;if(L.size>0&&(X=L.values().next().value?.texture),!X){const T=document.createElement("canvas");T.width=100,T.height=100;const H=T.getContext("2d");H.beginPath(),H.arc(50,50,48,0,Math.PI*2),H.fillStyle="#ffffff",H.fill(),X=tt.Texture.from(T)}for(const T of F){let H=L.get(T.id);H||(H=new tt.Sprite(X),H.anchor.set(.5),R.addChild(H),L.set(T.id,H)),H.tint=Yt(T.color)}b=F,v?.stop();const vt=y.edges.map(T=>({source:T.source,target:T.target})),V=we(vt).id(T=>T.id).distance(250);v=Te(b).force("link",V).force("charge",Ie().strength(-1e3).distanceMin(30)).force("x",Ce(0).strength(.1)).force("y",De(0).strength(.1)).force("collide",me().radius(60).strength(.5)).velocityDecay(.4).alpha(.3).on("tick",()=>{ot||ne(),et()}),p=V.links(),N=null,Ot(),et()}),St(()=>{const y=r();if(y){const w=b.find(_=>_.id===y)??null;N=w,Ot(),M=w?1:0}else S||(M=0);et()});let d,v=null,b=[],p=[],s=!1,h=0,x=0,D=0,m=1,N=null,S=null,W=pt(!1),B=0,$=0,G=0,ft=0,Q=new Set,ot=!1,wt=pt(null),I=0,M=0;const E=4;let A=null,k=null,j=null,R=null,L=new Map,U=null,K=null,tt=null;function At(y){return Math.max(3,Math.min(Math.sqrt(y+1)+2,10))}function ee(y,w){const _=d.getBoundingClientRect();return{x:(y-_.left-x)/m,y:(w-_.top-D)/m}}function ve(y,w){for(let _=b.length-1;_>=0;_--){const P=b[_],O=y-P.x,Y=w-P.y,F=(P.r*1.5+4)/m;if(O*O+Y*Y<=F*F)return P}return null}function Ot(){const y=N??null;if(Q.clear(),!!y){Q.add(y.id);for(const w of p)w.source.id===y.id&&Q.add(w.target.id),w.target.id===y.id&&Q.add(w.source.id);if(R){const w=L.get(y.id);w&&R.setChildIndex(w,R.children.length-1)}}}function ne(){if(b.length===0||!d)return;let y=1/0,w=-1/0,_=1/0,P=-1/0,O=0;for(const X of b)X.x<y&&(y=X.x),X.x>w&&(w=X.x),X.y<_&&(_=X.y),X.y>P&&(P=X.y),X.r>O&&(O=X.r);const Y=d.clientWidth,F=d.clientHeight,Z=w-y,rt=P-_;if(Z===0||rt===0)return;const ut=(60+O)*2;m=Math.min((Y-ut)/Z,(F-ut)/rt,3),x=Y/2-(y+w)/2*m,D=F/2-(_+P)/2*m,et()}function et(){s=!0,h=0}function Yt(y){return parseInt(y.replace("#",""),16)}function _t(y,w,_){const P=(y>>16&255)+_*((w>>16&255)-(y>>16&255)),O=(y>>8&255)+_*((w>>8&255)-(y>>8&255)),Y=(y&255)+_*((w&255)-(y&255));return Math.round(P)<<16|Math.round(O)<<8|Math.round(Y)}function Ye(){if(!tt||!k||!j)return;k.clear(),j.clear();const w=N!==null,_=I,P=g(wt),O=a(),Y=i(),F=g(u).default,Z=g(u).dim,rt=g(u).conn;for(let ut=0;ut<p.length;ut++){const X=p[ut],vt=X.source.x*m+x,V=X.source.y*m+D,T=X.target.x*m+x,H=X.target.y*m+D,dt=w&&_>.01&&Q.has(X.source.id)&&Q.has(X.target.id);let z=F;w&&_>.01?z=dt?_t(F,rt,_):_t(F,Z,_):(P!==null||O!==null||Y!==null)&&(z=Z);const J=dt?j:k,zt=dt?1:.2;J.setStrokeStyle({width:1,color:z,alpha:zt}),J.moveTo(vt,V),J.lineTo(T,H),J.stroke()}}function He(){if(!tt)return;const y=N,w=y!==null,_=I,P=g(wt),O=a(),Y=i(),F=!y&&n()?b.find(V=>V.id===n())??null:null,Z=new Set;if(F){Z.add(F.id);for(const V of p)V.source.id===F.id&&Z.add(V.target.id),V.target.id===F.id&&Z.add(V.source.id)}for(const V of b){const T=L.get(V.id);if(!T)continue;const H=V.x*m+x,dt=V.y*m+D;T.position.set(H,dt),T.scale.set(V.r/50),T.alpha=1;const z=Yt(V.color);if(F&&!y){const J=Z.has(V.id);T.tint=J?z:_t(z,g(l),f)}else{const J=V===y,zt=w&&Q.has(V.id),Ze=P!==null&&(P==="other"?Mt(V.type)===Nt:V.type===P);if(J&&_>.01)T.tint=z,T.scale.set(V.r*(1+_*.4)/50);else if(zt)T.tint=z;else if(P!==null)T.tint=Ze?z:_t(z,g(l),f);else if(O!==null){const ae=O.has(V.id)?_*f:f;T.tint=_t(z,g(l),ae)}else if(Y!==null){const ae=Y.has(V.id)?_*f:f;T.tint=_t(z,g(l),ae)}else T.tint=_t(z,g(l),_*f)}}const rt=y??F,ut=y?_>.01:!!F;if(rt&&ut&&U){U.visible=!0;const V=rt.x*m+x,T=rt.y*m+D;U.position.set(V,T),U.scale.set(rt.r*5/64),U.alpha=y?_*.25:.25,U.tint=Yt(rt.color)}else U&&(U.visible=!1);const X=y??F,vt=y?_>.01:!!F;if(X&&vt&&K){const V=X.x*m+x,T=X.y*m+D;K.text=c(X.id),K.style.fontSize=12,K.position.set(V,T+X.r+8),K.alpha=y?_:1,K.visible=!0}else K&&(K.visible=!1)}let Ht=!1;function Ge(y){if(y.button!==0)return;Ht=!1;const w=ee(y.clientX,y.clientY),_=ve(w.x,w.y);_?(S=_,ot=!0,_.fx=_.x,_.fy=_.y,v?.alphaTarget(.3).restart(),et()):(q(W,!0),B=y.clientX,$=y.clientY,G=x,ft=D),d.setPointerCapture(y.pointerId),window.addEventListener("pointerup",ie,{once:!0})}function We(y){if(S){Ht=!0;const w=ee(y.clientX,y.clientY);S.fx=w.x,S.fy=w.y,et()}else if(g(W))Ht=!0,x=G+(y.clientX-B),D=ft+(y.clientY-$),et();else{const w=ee(y.clientX,y.clientY),_=ve(w.x,w.y);_?_!==N?(N&&(I=.15),N=_,Ot(),M=1,d.style.cursor="pointer",et()):M!==1&&(M=1,d.style.cursor="pointer",et()):M!==0&&(M=0,d.style.cursor="grab",et())}}function ie(y){if(!S&&!g(W))return;window.removeEventListener("pointerup",ie);const w=Ht;if(S){const _=S;S.fx=null,S.fy=null,v?.alphaTarget(0),S=null,M=0,et(),w||rn(`/${_.repo}/${_.type}/${_.id}`)}else g(W)&&q(W,!1);try{d.releasePointerCapture(y.pointerId)}catch{}}const Nt="#5c5c66",je="#b0b0b8",Gt=nt(()=>o.current==="light"?je:Nt),Ue=nt(()=>{const y=new Map;for(const P of e.graphData.nodes)y.set(P.type,(y.get(P.type)??0)+1);const w=[];let _=0;for(const[P,O]of y){const Y=Mt(P);Y===Nt?_+=O:w.push({name:P,color:Y,count:O})}return w.sort((P,O)=>O.count-P.count),_>0&&w.push({name:"other",color:g(Gt),count:_}),w});Ne(async()=>{tt=await en(()=>import("../chunks/BB_5th5W.js"),__vite__mapDeps([0,1,2]),import.meta.url),A=new tt.Application,await A.init({antialias:!0,resolution:window.devicePixelRatio||1,autoDensity:!0,backgroundAlpha:0,resizeTo:d}),d.insertBefore(A.canvas,d.firstChild),A.canvas.style.position="absolute",A.canvas.style.inset="0",k=new tt.Graphics,A.stage.addChild(k),j=new tt.Graphics,A.stage.addChild(j),R=new tt.Container,A.stage.addChild(R);const y=document.createElement("canvas");y.width=128,y.height=128;const w=y.getContext("2d"),_=w.createRadialGradient(64,64,0,64,64,64);_.addColorStop(0,"rgba(255,255,255,0.5)"),_.addColorStop(1,"rgba(255,255,255,0)"),w.fillStyle=_,w.fillRect(0,0,128,128);const P=tt.Texture.from(y);U=new tt.Sprite(P),U.anchor.set(.5),U.visible=!1,A.stage.addChild(U);const O=document.createElement("canvas");O.width=100,O.height=100;const Y=O.getContext("2d");Y.beginPath(),Y.arc(50,50,48,0,Math.PI*2),Y.fillStyle="#ffffff",Y.fill();const F=tt.Texture.from(O),Z=new Map;for(const z of e.graphData.edges)Z.set(z.source,(Z.get(z.source)??0)+1),Z.set(z.target,(Z.get(z.target)??0)+1);const rt=new Map,X=3600*e.graphData.nodes.length,vt=Math.sqrt(X);b=e.graphData.nodes.map(z=>{const J=Z.get(z.id)??0,zt={id:z.id,type:z.type,repo:z.repo,color:Mt(z.type)===Nt?g(Gt):Mt(z.type),weight:J,x:(Math.random()-.5)*vt,y:(Math.random()-.5)*vt,vx:0,vy:0,r:At(J)};return rt.set(z.id,zt),zt});for(const z of b){const J=new tt.Sprite(F);J.anchor.set(.5),J.tint=Yt(z.color),R.addChild(J),L.set(z.id,J)}K=new tt.Text({text:"",style:{fontFamily:"Inter, system-ui, sans-serif",fontWeight:"500",fontSize:12,fill:g(u).labelText,align:"center"}}),K.anchor.set(.5,0),K.visible=!1,A.stage.addChild(K);const V=e.graphData.edges.map(z=>({source:z.source,target:z.target})),T=we(V).id(z=>z.id).distance(250);v=Te(b).force("link",T).force("charge",Ie().strength(-1e3).distanceMin(30)).force("x",Ce(0).strength(.1)).force("y",De(0).strength(.1)).force("collide",me().radius(60).strength(.5)).velocityDecay(.4).alpha(1).on("tick",()=>{ot||ne(),et()}),p=T.links();let H=0;A.ticker.add(()=>{const z=performance.now(),J=H?Math.min((z-H)/1e3,.05):.016;H=z,I<M?(I=Math.min(M,I+E*J),s=!0):I>M&&(I=Math.max(M,I-E*J),s=!0),I===0&&M===0&&N&&!S&&(N=null,Ot(),s=!0),(s||h<120)&&(Ye(),He(),s=!1,h++)});const dt=new ResizeObserver(()=>{A.renderer.resize(d.clientWidth,d.clientHeight),ne()});return dt.observe(d),()=>{dt.disconnect()}}),qe(()=>{v?.stop(),A&&(A.destroy(!0,{children:!0}),A=null)});var re=On(),bt=at(re);let pe;var oe=at(bt);ce(oe,21,()=>g(Ue),fe,(y,w)=>{var _=Bn();let P;var O=at(_);let Y;var F=gt(O,2),Z=at(F,!0);it(F);var rt=gt(F,2),ut=at(rt,!0);it(rt),it(_),yt(()=>{P=nn(_,1,"legend-item svelte-1i33fky",null,P,{"legend-item-active":g(wt)===g(w).name}),Y=kt(O,"",Y,{background:g(w).color}),It(Z,g(w).name),It(ut,g(w).count)}),le("mouseenter",_,()=>{q(wt,g(w).name,!0),et()}),le("mouseleave",_,()=>{q(wt,null),et()}),ht(y,_)}),it(oe),it(bt),Ee(bt,y=>d=y,()=>d),it(re),yt(()=>pe=kt(bt,"",pe,{cursor:g(W)?"grabbing":"grab"})),Tt("pointerdown",bt,Ge),Tt("pointermove",bt,We),Tt("pointerup",bt,ie),Tt("pointerdown",oe,y=>y.stopPropagation()),ht(t,re),Bt()}Ae(["pointerdown","pointermove","pointerup"]);var Hn=$t("<title> </title>"),Gn=$t('<svg><!><path d="M7,28a1,1,0,0,1-1-1V5a1,1,0,0,1,1.4819-.8763l20,11a1,1,0,0,1,0,1.7525l-20,11A1.0005,1.0005,0,0,1,7,28ZM8,6.6909V25.3088L24.9248,16Z"></path></svg>');function Wn(t,e){const n=Qt(e,["children","$$slots","$$events","$$legacy"]),i=Qt(n,["size","title"]);Ft(e,!1);const r=Zt(),a=Zt();let c=mt(e,"size",8,16),o=mt(e,"title",8,void 0);Ut(()=>(Pt(n),Pt(o())),()=>{q(r,n["aria-label"]||n["aria-labelledby"]||o())}),Ut(()=>(g(r),Pt(n)),()=>{q(a,{"aria-hidden":g(r)?void 0:!0,role:g(r)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),ze(),Re();var u=Gn();Pe(u,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:c(),height:c(),...g(a),...i}));var l=at(u);{var f=C=>{var d=Hn(),v=at(d,!0);it(d),yt(()=>It(v,o())),ht(C,d)};Kt(l,C=>{o()&&C(f)})}Se(),it(u),ht(t,u),Bt()}var jn=$t("<title> </title>"),Un=$t('<svg><!><path d="M12,8V24H8V8h4m0-2H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path><path d="M24,8V24H20V8h4m0-2H20a2,2,0,0,0-2,2V24a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path></svg>');function Zn(t,e){const n=Qt(e,["children","$$slots","$$events","$$legacy"]),i=Qt(n,["size","title"]);Ft(e,!1);const r=Zt(),a=Zt();let c=mt(e,"size",8,16),o=mt(e,"title",8,void 0);Ut(()=>(Pt(n),Pt(o())),()=>{q(r,n["aria-label"]||n["aria-labelledby"]||o())}),Ut(()=>(g(r),Pt(n)),()=>{q(a,{"aria-hidden":g(r)?void 0:!0,role:g(r)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),ze(),Re();var u=Un();Pe(u,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:c(),height:c(),...g(a),...i}));var l=at(u);{var f=C=>{var d=jn(),v=at(d,!0);it(d),yt(()=>It(v,o())),ht(C,d)};Kt(l,C=>{o()&&C(f)})}Se(2),it(u),ht(t,u),Bt()}var Kn=Dt('<div class="density-bar svelte-lzvab"></div>'),Qn=Dt('<span class="date-label svelte-lzvab"> </span>'),Jn=Dt('<div class="timeline-tooltip svelte-lzvab"><div class="tooltip-date svelte-lzvab"> </div> <div class="tooltip-count svelte-lzvab"> </div></div>'),qn=Dt('<div class="timeline-bar svelte-lzvab"><!> <div class="timeline-track svelte-lzvab"><div class="track-line svelte-lzvab"></div> <div class="density-bars svelte-lzvab"></div> <div class="playhead svelte-lzvab"></div> <div class="date-labels svelte-lzvab"></div> <!></div></div>');function $n(t,e){Ft(e,!0);let n=pt(null),i=pt(0),r=pt(!1),a=pt(!1),c=pt(null),o=null;const u=nt(()=>{let I=1/0,M=-1/0;for(const E of e.entities){const A=E.createdAt?new Date(E.createdAt).getTime():0;A>0&&A<I&&(I=A),A>M&&(M=A)}return I===1/0&&(I=Date.now()),M===-1/0&&(M=Date.now()),{min:I,max:M}}),l=nt(()=>{let{min:I,max:M}=g(u);return M-I<864e5&&(I-=864e5*15,M+=864e5*15),{min:new Date(I),max:new Date(M)}}),f=nt(()=>{const M=g(l).min.getTime(),E=g(l).max.getTime(),A=new Map;for(const k of e.entities){const j=k.createdAt?new Date(k.createdAt).getTime():0;if(j<=0)continue;const R=Math.floor((j-M)/864e5),L=M+R*864e5,U=A.get(L)??[];U.push(k),A.set(L,U)}return{map:A,minTime:M,maxTime:E,dayMs:864e5}}),C=nt(()=>{let I=0;for(const M of g(f).map.values())M.length>I&&(I=M.length);return Math.max(1,I)}),d=nt(()=>{const{minTime:I,maxTime:M}=g(f),E=M-I,A=[],k=Math.max(4,Math.min(8,Math.floor(g(i)/100))),j=E/k;for(let R=0;R<=k;R++){const L=I+R*j,K=new Date(L).toLocaleDateString("en-US",{month:"short",day:"numeric"});A.push({label:K,x:R/k})}return A}),v=nt(()=>{const{minTime:I,maxTime:M}=g(f),E=M-I;if(E<=0)return .5;const A=e.currentDate?e.currentDate.getTime():g(u).max,k=Math.max(g(u).min,Math.min(g(u).max,A));return Math.max(0,Math.min(1,(k-I)/E))});function b(I){if(!g(n))return new Date;const M=g(n).getBoundingClientRect(),E=40,k=M.width-E-12,j=Math.max(0,Math.min(1,(I-M.left-E)/k)),{minTime:R,maxTime:L}=g(f),U=R+j*(L-R);return new Date(Math.max(g(u).min,Math.min(g(u).max,U)))}function p(I){q(r,!0),N();const M=b(I.clientX);e.onDateChange(M),I.target.setPointerCapture(I.pointerId)}function s(I){if(g(r)&&e.onDateChange(b(I.clientX)),!g(n))return;const M=g(n).getBoundingClientRect(),E=40,k=M.width-E-12,j=(I.clientX-M.left-E)/k;if(j<0||j>1){q(c,null);return}const{minTime:R,dayMs:L,map:U}=g(f),K=R+j*(g(f).maxTime-R),tt=R+Math.floor((K-R)/L)*L,At=U.get(tt);At&&At.length>0?q(c,{date:new Date(tt),count:At.length,x:I.clientX-M.left},!0):q(c,null)}function h(){q(r,!1)}function x(){q(c,null)}function D(){g(a)?N():m()}function m(){q(a,!0);const{min:I,max:M}=g(u),A=(M-I)/200;let k=e.currentDate?.getTime()??I;k>=M&&(k=I),o=setInterval(()=>{if(k+=A,k>=M){e.onDateChange(null),N();return}e.onDateChange(new Date(k))},50)}function N(){q(a,!1),o&&(clearInterval(o),o=null)}Ne(()=>{if(g(n)){const I=new ResizeObserver(M=>{q(i,M[0]?.contentRect.width??0,!0)});return I.observe(g(n)),()=>I.disconnect()}});var S=qn(),W=at(S);{let I=nt(()=>g(a)?"Pause":"Play");on(W,{variant:"ghost",size:"icon",class:"play-btn",onclick:D,get title(){return g(I)},children:(M,E)=>{var A=Qe(),k=ke(A);{var j=L=>{Zn(L,{size:14})},R=L=>{Wn(L,{size:14})};Kt(k,L=>{g(a)?L(j):L(R,!1)})}ht(M,A)},$$slots:{default:!0}})}var B=gt(W,2),$=gt(at(B),2);ce($,21,()=>Array.from(g(f).map.entries()),fe,(I,M)=>{var E=nt(()=>$e(g(M),2));let A=()=>g(E)[0],k=()=>g(E)[1];const j=nt(()=>(A()-g(f).minTime)/(g(f).maxTime-g(f).minTime)),R=nt(()=>k().length/g(C)),L=nt(()=>.05+.95*g(R)*g(R));var U=Kn();let K;yt(()=>K=kt(U,"",K,{left:`${g(j)*100}%`,opacity:g(L)})),ht(I,U)}),it($);var G=gt($,2);let ft;var Q=gt(G,2);ce(Q,21,()=>g(d),fe,(I,M)=>{var E=Qn();let A;var k=at(E,!0);it(E),yt(()=>{A=kt(E,"",A,{left:`${g(M).x*100}%`}),It(k,g(M).label)}),ht(I,E)}),it(Q);var ot=gt(Q,2);{var wt=I=>{var M=Jn();let E;var A=at(M),k=at(A,!0);it(A);var j=gt(A,2),R=at(j);it(j),it(M),yt(L=>{E=kt(M,"",E,{left:`${g(c).x??""}px`}),It(k,L),It(R,`${g(c).count??""} ${g(c).count===1?"entity":"entities"}`)},[()=>g(c).date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]),ht(I,M)};Kt(ot,I=>{g(c)&&!g(r)&&I(wt)})}it(B),it(S),Ee(S,I=>q(n,I),()=>g(n)),yt(()=>ft=kt(G,"",ft,{left:`${g(v)*100}%`})),Tt("pointerdown",B,p),Tt("pointermove",B,s),Tt("pointerup",B,h),le("pointerleave",B,x),ht(t,S),Bt()}Ae(["pointerdown","pointermove","pointerup"]);var ti=Dt("<!> <!> <!>",1);function yi(t,e){Ft(e,!0),se.showGraph();let n=pt(null);const i=nt(()=>{const f=new Map;for(const C of Wt.repos)for(const d of C.entities)f.set(d.id,d.title);return f}),r=nt(()=>{const f=[];for(const C of Wt.repos)for(const d of C.entities)d.id.toLowerCase().startsWith("readme")||f.push(d);return f}),a=nt(()=>{const f=[],C=[],d=new Set,v=new Set,b=g(n)?.getTime()??1/0;for(const s of Wt.repos)for(const h of s.entities){if(h.id.toLowerCase().startsWith("readme")||d.has(h.id)||(h.createdAt?new Date(h.createdAt).getTime():0)>b)continue;d.add(h.id),f.push({id:h.id,type:h.entityType,repo:s.name});const D=h.wikilinks??[];for(const m of D){const N=h.id<m?`${h.id}|${m}`:`${m}|${h.id}`;!v.has(N)&&h.id!==m&&(v.add(N),C.push({source:h.id,target:m}))}}const p=C.filter(s=>d.has(s.source)&&d.has(s.target));return{nodes:f,edges:p}});var c=ti(),o=ke(c);tn(o,{activeView:"graph"});var u=gt(o,2);Yn(u,{get graphData(){return g(a)},get selectedEntityId(){return se.selectedId},get nameMap(){return g(i)},get filteredIds(){return Wt.filteredIds},get sidebarHoveredId(){return se.hoveredEntityId},get highlightedIds(){return an.highlightedIds}});var l=gt(u,2);$n(l,{get entities(){return g(r)},get currentDate(){return g(n)},onDateChange:f=>{q(n,f,!0)}}),ht(t,c),Bt()}export{yi as component};
|
|
2
|
+
import{d as Ae,e as Tt,a as ht,b as Dt,s as It,g as le,f as $t,c as Qe}from"../chunks/BJBX4SKZ.js";import{p as Ft,a1 as Je,a2 as St,g,a4 as nt,aD as Ne,aF as qe,t as yt,b as Bt,c as at,s as q,e as pt,r as it,a3 as gt,l as Ut,d as Pt,a as ze,n as Se,m as Zt,a0 as ke,bu as $e}from"../chunks/e913tUZv.js";import{V as tn}from"../chunks/BEGjic-p.js";import{_ as en}from"../chunks/PPVm8Dsz.js";import{e as ce,i as fe}from"../chunks/BZEMt5cm.js";import{s as nn}from"../chunks/C8Y6xIC4.js";import{c as kt,a as Pe}from"../chunks/Zhai-RNf.js";import{b as Ee,i as Kt}from"../chunks/D6Lva3KM.js";import{p as mt,l as Qt}from"../chunks/iZnTs-Zk.js";import{g as rn}from"../chunks/BsdMYUpR.js";import{e as Mt}from"../chunks/CdeYcEuU.js";import{B as on}from"../chunks/DYvpKXdA.js";import{i as Re}from"../chunks/CrUJgkXY.js";import{n as se}from"../chunks/CIhtHHtB.js";import{w as Wt}from"../chunks/xwFtwYnE.js";import{chatStore as an}from"../chunks/DvO9pXIe.js";function sn(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Le(this.cover(e,n),e,n,t)}function Le(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a=t._root,c={data:i},o=t._x0,u=t._y0,l=t._x1,f=t._y1,C,d,v,b,p,s,h,x;if(!a)return t._root=c,t;for(;a.length;)if((p=e>=(C=(o+l)/2))?o=C:l=C,(s=n>=(d=(u+f)/2))?u=d:f=d,r=a,!(a=a[h=s<<1|p]))return r[h]=c,t;if(v=+t._x.call(null,a.data),b=+t._y.call(null,a.data),e===v&&n===b)return c.next=a,r?r[h]=c:t._root=c,t;do r=r?r[h]=new Array(4):t._root=new Array(4),(p=e>=(C=(o+l)/2))?o=C:l=C,(s=n>=(d=(u+f)/2))?u=d:f=d;while((h=s<<1|p)===(x=(b>=d)<<1|v>=C));return r[x]=a,r[h]=c,t}function ln(t){var e,n,i=t.length,r,a,c=new Array(i),o=new Array(i),u=1/0,l=1/0,f=-1/0,C=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(a=+this._y.call(null,e))||(c[n]=r,o[n]=a,r<u&&(u=r),r>f&&(f=r),a<l&&(l=a),a>C&&(C=a));if(u>f||l>C)return this;for(this.cover(u,l).cover(f,C),n=0;n<i;++n)Le(this,c[n],o[n],t[n]);return this}function cn(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var c=r-n||1,o=this._root,u,l;n>t||t>=r||i>e||e>=a;)switch(l=(e<i)<<1|t<n,u=new Array(4),u[l]=o,o=u,c*=2,l){case 0:r=n+c,a=i+c;break;case 1:n=r-c,a=i+c;break;case 2:r=n+c,i=a-c;break;case 3:n=r-c,i=a-c;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this}function fn(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function un(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function st(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function hn(t,e,n){var i,r=this._x0,a=this._y0,c,o,u,l,f=this._x1,C=this._y1,d=[],v=this._root,b,p;for(v&&d.push(new st(v,r,a,f,C)),n==null?n=1/0:(r=t-n,a=e-n,f=t+n,C=e+n,n*=n);b=d.pop();)if(!(!(v=b.node)||(c=b.x0)>f||(o=b.y0)>C||(u=b.x1)<r||(l=b.y1)<a))if(v.length){var s=(c+u)/2,h=(o+l)/2;d.push(new st(v[3],s,h,u,l),new st(v[2],c,h,s,l),new st(v[1],s,o,u,h),new st(v[0],c,o,s,h)),(p=(e>=h)<<1|t>=s)&&(b=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=b)}else{var x=t-+this._x.call(null,v.data),D=e-+this._y.call(null,v.data),m=x*x+D*D;if(m<n){var N=Math.sqrt(n=m);r=t-N,a=e-N,f=t+N,C=e+N,i=v.data}}return i}function dn(t){if(isNaN(f=+this._x.call(null,t))||isNaN(C=+this._y.call(null,t)))return this;var e,n=this._root,i,r,a,c=this._x0,o=this._y0,u=this._x1,l=this._y1,f,C,d,v,b,p,s,h;if(!n)return this;if(n.length)for(;;){if((b=f>=(d=(c+u)/2))?c=d:u=d,(p=C>=(v=(o+l)/2))?o=v:l=v,e=n,!(n=n[s=p<<1|b]))return this;if(!n.length)break;(e[s+1&3]||e[s+2&3]||e[s+3&3])&&(i=e,h=s)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,r?(a?r.next=a:delete r.next,this):e?(a?e[s]=a:delete e[s],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(i?i[h]=n:this._root=n),this):(this._root=a,this)}function gn(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function vn(){return this._root}function pn(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function yn(t){var e=[],n,i=this._root,r,a,c,o,u;for(i&&e.push(new st(i,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(i=n.node,a=n.x0,c=n.y0,o=n.x1,u=n.y1)&&i.length){var l=(a+o)/2,f=(c+u)/2;(r=i[3])&&e.push(new st(r,l,f,o,u)),(r=i[2])&&e.push(new st(r,a,f,l,u)),(r=i[1])&&e.push(new st(r,l,c,o,f)),(r=i[0])&&e.push(new st(r,a,c,l,f))}return this}function mn(t){var e=[],n=[],i;for(this._root&&e.push(new st(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var r=i.node;if(r.length){var a,c=i.x0,o=i.y0,u=i.x1,l=i.y1,f=(c+u)/2,C=(o+l)/2;(a=r[0])&&e.push(new st(a,c,o,f,C)),(a=r[1])&&e.push(new st(a,f,o,u,C)),(a=r[2])&&e.push(new st(a,c,C,f,l)),(a=r[3])&&e.push(new st(a,f,C,u,l))}n.push(i)}for(;i=n.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function xn(t){return t[0]}function wn(t){return arguments.length?(this._x=t,this):this._x}function _n(t){return t[1]}function bn(t){return arguments.length?(this._y=t,this):this._y}function de(t,e,n){var i=new ge(e??xn,n??_n,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function ge(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function ye(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var ct=de.prototype=ge.prototype;ct.copy=function(){var t=new ge(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,i;if(!e)return t;if(!e.length)return t._root=ye(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var r=0;r<4;++r)(i=e.source[r])&&(i.length?n.push({source:i,target:e.target[r]=new Array(4)}):e.target[r]=ye(i));return t};ct.add=sn;ct.addAll=ln;ct.cover=cn;ct.data=fn;ct.extent=un;ct.find=hn;ct.remove=dn;ct.removeAll=gn;ct.root=vn;ct.size=pn;ct.visit=yn;ct.visitAfter=mn;ct.x=wn;ct.y=bn;function lt(t){return function(){return t}}function xt(t){return(t()-.5)*1e-6}function Mn(t){return t.x+t.vx}function Tn(t){return t.y+t.vy}function me(t){var e,n,i,r=1,a=1;typeof t!="function"&&(t=lt(t==null?1:+t));function c(){for(var l,f=e.length,C,d,v,b,p,s,h=0;h<a;++h)for(C=de(e,Mn,Tn).visitAfter(o),l=0;l<f;++l)d=e[l],p=n[d.index],s=p*p,v=d.x+d.vx,b=d.y+d.vy,C.visit(x);function x(D,m,N,S,W){var B=D.data,$=D.r,G=p+$;if(B){if(B.index>d.index){var ft=v-B.x-B.vx,Q=b-B.y-B.vy,ot=ft*ft+Q*Q;ot<G*G&&(ft===0&&(ft=xt(i),ot+=ft*ft),Q===0&&(Q=xt(i),ot+=Q*Q),ot=(G-(ot=Math.sqrt(ot)))/ot*r,d.vx+=(ft*=ot)*(G=($*=$)/(s+$)),d.vy+=(Q*=ot)*G,B.vx-=ft*(G=1-G),B.vy-=Q*G)}return}return m>v+G||S<v-G||N>b+G||W<b-G}}function o(l){if(l.data)return l.r=n[l.data.index];for(var f=l.r=0;f<4;++f)l[f]&&l[f].r>l.r&&(l.r=l[f].r)}function u(){if(e){var l,f=e.length,C;for(n=new Array(f),l=0;l<f;++l)C=e[l],n[C.index]=+t(C,l,e)}}return c.initialize=function(l,f){e=l,i=f,u()},c.iterations=function(l){return arguments.length?(a=+l,c):a},c.strength=function(l){return arguments.length?(r=+l,c):r},c.radius=function(l){return arguments.length?(t=typeof l=="function"?l:lt(+l),u(),c):t},c}function In(t){return t.index}function xe(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function we(t){var e=In,n=C,i,r=lt(30),a,c,o,u,l,f=1;t==null&&(t=[]);function C(s){return 1/Math.min(o[s.source.index],o[s.target.index])}function d(s){for(var h=0,x=t.length;h<f;++h)for(var D=0,m,N,S,W,B,$,G;D<x;++D)m=t[D],N=m.source,S=m.target,W=S.x+S.vx-N.x-N.vx||xt(l),B=S.y+S.vy-N.y-N.vy||xt(l),$=Math.sqrt(W*W+B*B),$=($-a[D])/$*s*i[D],W*=$,B*=$,S.vx-=W*(G=u[D]),S.vy-=B*G,N.vx+=W*(G=1-G),N.vy+=B*G}function v(){if(c){var s,h=c.length,x=t.length,D=new Map(c.map((N,S)=>[e(N,S,c),N])),m;for(s=0,o=new Array(h);s<x;++s)m=t[s],m.index=s,typeof m.source!="object"&&(m.source=xe(D,m.source)),typeof m.target!="object"&&(m.target=xe(D,m.target)),o[m.source.index]=(o[m.source.index]||0)+1,o[m.target.index]=(o[m.target.index]||0)+1;for(s=0,u=new Array(x);s<x;++s)m=t[s],u[s]=o[m.source.index]/(o[m.source.index]+o[m.target.index]);i=new Array(x),b(),a=new Array(x),p()}}function b(){if(c)for(var s=0,h=t.length;s<h;++s)i[s]=+n(t[s],s,t)}function p(){if(c)for(var s=0,h=t.length;s<h;++s)a[s]=+r(t[s],s,t)}return d.initialize=function(s,h){c=s,l=h,v()},d.links=function(s){return arguments.length?(t=s,v(),d):t},d.id=function(s){return arguments.length?(e=s,d):e},d.iterations=function(s){return arguments.length?(f=+s,d):f},d.strength=function(s){return arguments.length?(n=typeof s=="function"?s:lt(+s),b(),d):n},d.distance=function(s){return arguments.length?(r=typeof s=="function"?s:lt(+s),p(),d):r},d}var Cn={value:()=>{}};function Ve(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new jt(n)}function jt(t){this._=t}function Dn(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}jt.prototype=Ve.prototype={constructor:jt,on:function(t,e){var n=this._,i=Dn(t+"",n),r,a=-1,c=i.length;if(arguments.length<2){for(;++a<c;)if((r=(t=i[a]).type)&&(r=An(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<c;)if(r=(t=i[a]).type)n[r]=_e(n[r],t.name,e);else if(e==null)for(r in n)n[r]=_e(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new jt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,a;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],i=0,r=a.length;i<r;++i)a[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};function An(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function _e(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Cn,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var Et=0,Lt=0,Rt=0,Xe=1e3,Jt,Vt,qt=0,Ct=0,te=0,Xt=typeof performance=="object"&&performance.now?performance:Date,Fe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Be(){return Ct||(Fe(Nn),Ct=Xt.now()+te)}function Nn(){Ct=0}function ue(){this._call=this._time=this._next=null}ue.prototype=Oe.prototype={constructor:ue,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Be():+n)+(e==null?0:+e),!this._next&&Vt!==this&&(Vt?Vt._next=this:Jt=this,Vt=this),this._call=t,this._time=n,he()},stop:function(){this._call&&(this._call=null,this._time=1/0,he())}};function Oe(t,e,n){var i=new ue;return i.restart(t,e,n),i}function zn(){Be(),++Et;for(var t=Jt,e;t;)(e=Ct-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Et}function be(){Ct=(qt=Xt.now())+te,Et=Lt=0;try{zn()}finally{Et=0,kn(),Ct=0}}function Sn(){var t=Xt.now(),e=t-qt;e>Xe&&(te-=e,qt=t)}function kn(){for(var t,e=Jt,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Jt=n);Vt=t,he(i)}function he(t){if(!Et){Lt&&(Lt=clearTimeout(Lt));var e=t-Ct;e>24?(t<1/0&&(Lt=setTimeout(be,t-Xt.now()-te)),Rt&&(Rt=clearInterval(Rt))):(Rt||(qt=Xt.now(),Rt=setInterval(Sn,Xe)),Et=1,Fe(be))}}const Pn=1664525,En=1013904223,Me=4294967296;function Rn(){let t=1;return()=>(t=(Pn*t+En)%Me)/Me}function Ln(t){return t.x}function Vn(t){return t.y}var Xn=10,Fn=Math.PI*(3-Math.sqrt(5));function Te(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),a=0,c=.6,o=new Map,u=Oe(C),l=Ve("tick","end"),f=Rn();t==null&&(t=[]);function C(){d(),l.call("tick",e),n<i&&(u.stop(),l.call("end",e))}function d(p){var s,h=t.length,x;p===void 0&&(p=1);for(var D=0;D<p;++D)for(n+=(a-n)*r,o.forEach(function(m){m(n)}),s=0;s<h;++s)x=t[s],x.fx==null?x.x+=x.vx*=c:(x.x=x.fx,x.vx=0),x.fy==null?x.y+=x.vy*=c:(x.y=x.fy,x.vy=0);return e}function v(){for(var p=0,s=t.length,h;p<s;++p){if(h=t[p],h.index=p,h.fx!=null&&(h.x=h.fx),h.fy!=null&&(h.y=h.fy),isNaN(h.x)||isNaN(h.y)){var x=Xn*Math.sqrt(.5+p),D=p*Fn;h.x=x*Math.cos(D),h.y=x*Math.sin(D)}(isNaN(h.vx)||isNaN(h.vy))&&(h.vx=h.vy=0)}}function b(p){return p.initialize&&p.initialize(t,f),p}return v(),e={tick:d,restart:function(){return u.restart(C),e},stop:function(){return u.stop(),e},nodes:function(p){return arguments.length?(t=p,v(),o.forEach(b),e):t},alpha:function(p){return arguments.length?(n=+p,e):n},alphaMin:function(p){return arguments.length?(i=+p,e):i},alphaDecay:function(p){return arguments.length?(r=+p,e):+r},alphaTarget:function(p){return arguments.length?(a=+p,e):a},velocityDecay:function(p){return arguments.length?(c=1-p,e):1-c},randomSource:function(p){return arguments.length?(f=p,o.forEach(b),e):f},force:function(p,s){return arguments.length>1?(s==null?o.delete(p):o.set(p,b(s)),e):o.get(p)},find:function(p,s,h){var x=0,D=t.length,m,N,S,W,B;for(h==null?h=1/0:h*=h,x=0;x<D;++x)W=t[x],m=p-W.x,N=s-W.y,S=m*m+N*N,S<h&&(B=W,h=S);return B},on:function(p,s){return arguments.length>1?(l.on(p,s),e):l.on(p)}}}function Ie(){var t,e,n,i,r=lt(-30),a,c=1,o=1/0,u=.81;function l(v){var b,p=t.length,s=de(t,Ln,Vn).visitAfter(C);for(i=v,b=0;b<p;++b)e=t[b],s.visit(d)}function f(){if(t){var v,b=t.length,p;for(a=new Array(b),v=0;v<b;++v)p=t[v],a[p.index]=+r(p,v,t)}}function C(v){var b=0,p,s,h=0,x,D,m;if(v.length){for(x=D=m=0;m<4;++m)(p=v[m])&&(s=Math.abs(p.value))&&(b+=p.value,h+=s,x+=s*p.x,D+=s*p.y);v.x=x/h,v.y=D/h}else{p=v,p.x=p.data.x,p.y=p.data.y;do b+=a[p.data.index];while(p=p.next)}v.value=b}function d(v,b,p,s){if(!v.value)return!0;var h=v.x-e.x,x=v.y-e.y,D=s-b,m=h*h+x*x;if(D*D/u<m)return m<o&&(h===0&&(h=xt(n),m+=h*h),x===0&&(x=xt(n),m+=x*x),m<c&&(m=Math.sqrt(c*m)),e.vx+=h*v.value*i/m,e.vy+=x*v.value*i/m),!0;if(v.length||m>=o)return;(v.data!==e||v.next)&&(h===0&&(h=xt(n),m+=h*h),x===0&&(x=xt(n),m+=x*x),m<c&&(m=Math.sqrt(c*m)));do v.data!==e&&(D=a[v.data.index]*i/m,e.vx+=h*D,e.vy+=x*D);while(v=v.next)}return l.initialize=function(v,b){t=v,n=b,f()},l.strength=function(v){return arguments.length?(r=typeof v=="function"?v:lt(+v),f(),l):r},l.distanceMin=function(v){return arguments.length?(c=v*v,l):Math.sqrt(c)},l.distanceMax=function(v){return arguments.length?(o=v*v,l):Math.sqrt(o)},l.theta=function(v){return arguments.length?(u=v*v,l):Math.sqrt(u)},l}function Ce(t){var e=lt(.1),n,i,r;typeof t!="function"&&(t=lt(t==null?0:+t));function a(o){for(var u=0,l=n.length,f;u<l;++u)f=n[u],f.vx+=(r[u]-f.x)*i[u]*o}function c(){if(n){var o,u=n.length;for(i=new Array(u),r=new Array(u),o=0;o<u;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return a.initialize=function(o){n=o,c()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:lt(+o),c(),a):e},a.x=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),c(),a):t},a}function De(t){var e=lt(.1),n,i,r;typeof t!="function"&&(t=lt(t==null?0:+t));function a(o){for(var u=0,l=n.length,f;u<l;++u)f=n[u],f.vy+=(r[u]-f.y)*i[u]*o}function c(){if(n){var o,u=n.length;for(i=new Array(u),r=new Array(u),o=0;o<u;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return a.initialize=function(o){n=o,c()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:lt(+o),c(),a):e},a.y=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),c(),a):t},a}var Bn=Dt('<div><span class="legend-dot svelte-1i33fky"></span> <span class="legend-label svelte-1i33fky"> </span> <span class="legend-count svelte-1i33fky"> </span></div>'),On=Dt('<div class="graph-view svelte-1i33fky"><div class="canvas-wrap svelte-1i33fky"><div class="legend-panel svelte-1i33fky"></div></div></div>');function Yn(t,e){Ft(e,!0);let n=mt(e,"selectedEntityId",3,null),i=mt(e,"filteredIds",3,null),r=mt(e,"sidebarHoveredId",3,null),a=mt(e,"highlightedIds",3,null);function c(y){return e.nameMap?.get(y)??y.replace(/-/g," ").replace(/\b\w/g,w=>w.toUpperCase())}const o=Je("theme"),u=nt(()=>o.current==="light"?{default:14211288,dim:15263976,conn:12632256,labelText:1710623}:{default:2763306,dim:1315860,conn:4210752,labelText:15592943}),l=nt(()=>o.current==="light"?16316666:592139),f=.75;St(()=>{o.current,K&&(K.style.fill=g(u).labelText);const y=g(Gt);for(const w of b)Mt(w.type)===Nt&&(w.color=y);et()}),St(()=>{i(),et()}),St(()=>{a(),et()}),St(()=>{n(),et()});let C=!1;St(()=>{const y=e.graphData;if(!tt||!A||!R)return;if(!C){C=!0;return}const w=new Map;for(const T of y.edges)w.set(T.source,(w.get(T.source)??0)+1),w.set(T.target,(w.get(T.target)??0)+1);const _=new Map;for(const T of b)_.set(T.id,{x:T.x,y:T.y});const O=3600*y.nodes.length,Y=Math.sqrt(O),F=y.nodes.map(T=>{const H=w.get(T.id)??0,dt=_.get(T.id);return{id:T.id,type:T.type,repo:T.repo,color:Mt(T.type)===Nt?g(Gt):Mt(T.type),weight:H,x:dt?.x??(Math.random()-.5)*Y,y:dt?.y??(Math.random()-.5)*Y,vx:0,vy:0,r:At(H)}}),Z=new Map;for(const T of F)Z.set(T.id,T);const rt=new Set(L.keys()),ut=new Set(y.nodes.map(T=>T.id));for(const T of rt)if(!ut.has(T)){const H=L.get(T);H&&(R.removeChild(H),H.destroy()),L.delete(T)}let X=null;if(L.size>0&&(X=L.values().next().value?.texture),!X){const T=document.createElement("canvas");T.width=100,T.height=100;const H=T.getContext("2d");H.beginPath(),H.arc(50,50,48,0,Math.PI*2),H.fillStyle="#ffffff",H.fill(),X=tt.Texture.from(T)}for(const T of F){let H=L.get(T.id);H||(H=new tt.Sprite(X),H.anchor.set(.5),R.addChild(H),L.set(T.id,H)),H.tint=Yt(T.color)}b=F,v?.stop();const vt=y.edges.map(T=>({source:T.source,target:T.target})),V=we(vt).id(T=>T.id).distance(250);v=Te(b).force("link",V).force("charge",Ie().strength(-1e3).distanceMin(30)).force("x",Ce(0).strength(.1)).force("y",De(0).strength(.1)).force("collide",me().radius(60).strength(.5)).velocityDecay(.4).alpha(.3).on("tick",()=>{ot||ne(),et()}),p=V.links(),N=null,Ot(),et()}),St(()=>{const y=r();if(y){const w=b.find(_=>_.id===y)??null;N=w,Ot(),M=w?1:0}else S||(M=0);et()});let d,v=null,b=[],p=[],s=!1,h=0,x=0,D=0,m=1,N=null,S=null,W=pt(!1),B=0,$=0,G=0,ft=0,Q=new Set,ot=!1,wt=pt(null),I=0,M=0;const E=4;let A=null,k=null,j=null,R=null,L=new Map,U=null,K=null,tt=null;function At(y){return Math.max(3,Math.min(Math.sqrt(y+1)+2,10))}function ee(y,w){const _=d.getBoundingClientRect();return{x:(y-_.left-x)/m,y:(w-_.top-D)/m}}function ve(y,w){for(let _=b.length-1;_>=0;_--){const P=b[_],O=y-P.x,Y=w-P.y,F=(P.r*1.5+4)/m;if(O*O+Y*Y<=F*F)return P}return null}function Ot(){const y=N??null;if(Q.clear(),!!y){Q.add(y.id);for(const w of p)w.source.id===y.id&&Q.add(w.target.id),w.target.id===y.id&&Q.add(w.source.id);if(R){const w=L.get(y.id);w&&R.setChildIndex(w,R.children.length-1)}}}function ne(){if(b.length===0||!d)return;let y=1/0,w=-1/0,_=1/0,P=-1/0,O=0;for(const X of b)X.x<y&&(y=X.x),X.x>w&&(w=X.x),X.y<_&&(_=X.y),X.y>P&&(P=X.y),X.r>O&&(O=X.r);const Y=d.clientWidth,F=d.clientHeight,Z=w-y,rt=P-_;if(Z===0||rt===0)return;const ut=(60+O)*2;m=Math.min((Y-ut)/Z,(F-ut)/rt,3),x=Y/2-(y+w)/2*m,D=F/2-(_+P)/2*m,et()}function et(){s=!0,h=0}function Yt(y){return parseInt(y.replace("#",""),16)}function _t(y,w,_){const P=(y>>16&255)+_*((w>>16&255)-(y>>16&255)),O=(y>>8&255)+_*((w>>8&255)-(y>>8&255)),Y=(y&255)+_*((w&255)-(y&255));return Math.round(P)<<16|Math.round(O)<<8|Math.round(Y)}function Ye(){if(!tt||!k||!j)return;k.clear(),j.clear();const w=N!==null,_=I,P=g(wt),O=a(),Y=i(),F=g(u).default,Z=g(u).dim,rt=g(u).conn;for(let ut=0;ut<p.length;ut++){const X=p[ut],vt=X.source.x*m+x,V=X.source.y*m+D,T=X.target.x*m+x,H=X.target.y*m+D,dt=w&&_>.01&&Q.has(X.source.id)&&Q.has(X.target.id);let z=F;w&&_>.01?z=dt?_t(F,rt,_):_t(F,Z,_):(P!==null||O!==null||Y!==null)&&(z=Z);const J=dt?j:k,zt=dt?1:.2;J.setStrokeStyle({width:1,color:z,alpha:zt}),J.moveTo(vt,V),J.lineTo(T,H),J.stroke()}}function He(){if(!tt)return;const y=N,w=y!==null,_=I,P=g(wt),O=a(),Y=i(),F=!y&&n()?b.find(V=>V.id===n())??null:null,Z=new Set;if(F){Z.add(F.id);for(const V of p)V.source.id===F.id&&Z.add(V.target.id),V.target.id===F.id&&Z.add(V.source.id)}for(const V of b){const T=L.get(V.id);if(!T)continue;const H=V.x*m+x,dt=V.y*m+D;T.position.set(H,dt),T.scale.set(V.r/50),T.alpha=1;const z=Yt(V.color);if(F&&!y){const J=Z.has(V.id);T.tint=J?z:_t(z,g(l),f)}else{const J=V===y,zt=w&&Q.has(V.id),Ze=P!==null&&(P==="other"?Mt(V.type)===Nt:V.type===P);if(J&&_>.01)T.tint=z,T.scale.set(V.r*(1+_*.4)/50);else if(zt)T.tint=z;else if(P!==null)T.tint=Ze?z:_t(z,g(l),f);else if(O!==null){const ae=O.has(V.id)?_*f:f;T.tint=_t(z,g(l),ae)}else if(Y!==null){const ae=Y.has(V.id)?_*f:f;T.tint=_t(z,g(l),ae)}else T.tint=_t(z,g(l),_*f)}}const rt=y??F,ut=y?_>.01:!!F;if(rt&&ut&&U){U.visible=!0;const V=rt.x*m+x,T=rt.y*m+D;U.position.set(V,T),U.scale.set(rt.r*5/64),U.alpha=y?_*.25:.25,U.tint=Yt(rt.color)}else U&&(U.visible=!1);const X=y??F,vt=y?_>.01:!!F;if(X&&vt&&K){const V=X.x*m+x,T=X.y*m+D;K.text=c(X.id),K.style.fontSize=12,K.position.set(V,T+X.r+8),K.alpha=y?_:1,K.visible=!0}else K&&(K.visible=!1)}let Ht=!1;function Ge(y){if(y.button!==0)return;Ht=!1;const w=ee(y.clientX,y.clientY),_=ve(w.x,w.y);_?(S=_,ot=!0,_.fx=_.x,_.fy=_.y,v?.alphaTarget(.3).restart(),et()):(q(W,!0),B=y.clientX,$=y.clientY,G=x,ft=D),d.setPointerCapture(y.pointerId),window.addEventListener("pointerup",ie,{once:!0})}function We(y){if(S){Ht=!0;const w=ee(y.clientX,y.clientY);S.fx=w.x,S.fy=w.y,et()}else if(g(W))Ht=!0,x=G+(y.clientX-B),D=ft+(y.clientY-$),et();else{const w=ee(y.clientX,y.clientY),_=ve(w.x,w.y);_?_!==N?(N&&(I=.15),N=_,Ot(),M=1,d.style.cursor="pointer",et()):M!==1&&(M=1,d.style.cursor="pointer",et()):M!==0&&(M=0,d.style.cursor="grab",et())}}function ie(y){if(!S&&!g(W))return;window.removeEventListener("pointerup",ie);const w=Ht;if(S){const _=S;S.fx=null,S.fy=null,v?.alphaTarget(0),S=null,M=0,et(),w||rn(`/${_.repo}/${_.type}/${_.id}`)}else g(W)&&q(W,!1);try{d.releasePointerCapture(y.pointerId)}catch{}}const Nt="#5c5c66",je="#b0b0b8",Gt=nt(()=>o.current==="light"?je:Nt),Ue=nt(()=>{const y=new Map;for(const P of e.graphData.nodes)y.set(P.type,(y.get(P.type)??0)+1);const w=[];let _=0;for(const[P,O]of y){const Y=Mt(P);Y===Nt?_+=O:w.push({name:P,color:Y,count:O})}return w.sort((P,O)=>O.count-P.count),_>0&&w.push({name:"other",color:g(Gt),count:_}),w});Ne(async()=>{tt=await en(()=>import("../chunks/BB_5th5W.js"),__vite__mapDeps([0,1,2]),import.meta.url),A=new tt.Application,await A.init({antialias:!0,resolution:window.devicePixelRatio||1,autoDensity:!0,backgroundAlpha:0,resizeTo:d}),d.insertBefore(A.canvas,d.firstChild),A.canvas.style.position="absolute",A.canvas.style.inset="0",k=new tt.Graphics,A.stage.addChild(k),j=new tt.Graphics,A.stage.addChild(j),R=new tt.Container,A.stage.addChild(R);const y=document.createElement("canvas");y.width=128,y.height=128;const w=y.getContext("2d"),_=w.createRadialGradient(64,64,0,64,64,64);_.addColorStop(0,"rgba(255,255,255,0.5)"),_.addColorStop(1,"rgba(255,255,255,0)"),w.fillStyle=_,w.fillRect(0,0,128,128);const P=tt.Texture.from(y);U=new tt.Sprite(P),U.anchor.set(.5),U.visible=!1,A.stage.addChild(U);const O=document.createElement("canvas");O.width=100,O.height=100;const Y=O.getContext("2d");Y.beginPath(),Y.arc(50,50,48,0,Math.PI*2),Y.fillStyle="#ffffff",Y.fill();const F=tt.Texture.from(O),Z=new Map;for(const z of e.graphData.edges)Z.set(z.source,(Z.get(z.source)??0)+1),Z.set(z.target,(Z.get(z.target)??0)+1);const rt=new Map,X=3600*e.graphData.nodes.length,vt=Math.sqrt(X);b=e.graphData.nodes.map(z=>{const J=Z.get(z.id)??0,zt={id:z.id,type:z.type,repo:z.repo,color:Mt(z.type)===Nt?g(Gt):Mt(z.type),weight:J,x:(Math.random()-.5)*vt,y:(Math.random()-.5)*vt,vx:0,vy:0,r:At(J)};return rt.set(z.id,zt),zt});for(const z of b){const J=new tt.Sprite(F);J.anchor.set(.5),J.tint=Yt(z.color),R.addChild(J),L.set(z.id,J)}K=new tt.Text({text:"",style:{fontFamily:"Inter, system-ui, sans-serif",fontWeight:"500",fontSize:12,fill:g(u).labelText,align:"center"}}),K.anchor.set(.5,0),K.visible=!1,A.stage.addChild(K);const V=e.graphData.edges.map(z=>({source:z.source,target:z.target})),T=we(V).id(z=>z.id).distance(250);v=Te(b).force("link",T).force("charge",Ie().strength(-1e3).distanceMin(30)).force("x",Ce(0).strength(.1)).force("y",De(0).strength(.1)).force("collide",me().radius(60).strength(.5)).velocityDecay(.4).alpha(1).on("tick",()=>{ot||ne(),et()}),p=T.links();let H=0;A.ticker.add(()=>{const z=performance.now(),J=H?Math.min((z-H)/1e3,.05):.016;H=z,I<M?(I=Math.min(M,I+E*J),s=!0):I>M&&(I=Math.max(M,I-E*J),s=!0),I===0&&M===0&&N&&!S&&(N=null,Ot(),s=!0),(s||h<120)&&(Ye(),He(),s=!1,h++)});const dt=new ResizeObserver(()=>{A.renderer.resize(d.clientWidth,d.clientHeight),ne()});return dt.observe(d),()=>{dt.disconnect()}}),qe(()=>{v?.stop(),A&&(A.destroy(!0,{children:!0}),A=null)});var re=On(),bt=at(re);let pe;var oe=at(bt);ce(oe,21,()=>g(Ue),fe,(y,w)=>{var _=Bn();let P;var O=at(_);let Y;var F=gt(O,2),Z=at(F,!0);it(F);var rt=gt(F,2),ut=at(rt,!0);it(rt),it(_),yt(()=>{P=nn(_,1,"legend-item svelte-1i33fky",null,P,{"legend-item-active":g(wt)===g(w).name}),Y=kt(O,"",Y,{background:g(w).color}),It(Z,g(w).name),It(ut,g(w).count)}),le("mouseenter",_,()=>{q(wt,g(w).name,!0),et()}),le("mouseleave",_,()=>{q(wt,null),et()}),ht(y,_)}),it(oe),it(bt),Ee(bt,y=>d=y,()=>d),it(re),yt(()=>pe=kt(bt,"",pe,{cursor:g(W)?"grabbing":"grab"})),Tt("pointerdown",bt,Ge),Tt("pointermove",bt,We),Tt("pointerup",bt,ie),Tt("pointerdown",oe,y=>y.stopPropagation()),ht(t,re),Bt()}Ae(["pointerdown","pointermove","pointerup"]);var Hn=$t("<title> </title>"),Gn=$t('<svg><!><path d="M7,28a1,1,0,0,1-1-1V5a1,1,0,0,1,1.4819-.8763l20,11a1,1,0,0,1,0,1.7525l-20,11A1.0005,1.0005,0,0,1,7,28ZM8,6.6909V25.3088L24.9248,16Z"></path></svg>');function Wn(t,e){const n=Qt(e,["children","$$slots","$$events","$$legacy"]),i=Qt(n,["size","title"]);Ft(e,!1);const r=Zt(),a=Zt();let c=mt(e,"size",8,16),o=mt(e,"title",8,void 0);Ut(()=>(Pt(n),Pt(o())),()=>{q(r,n["aria-label"]||n["aria-labelledby"]||o())}),Ut(()=>(g(r),Pt(n)),()=>{q(a,{"aria-hidden":g(r)?void 0:!0,role:g(r)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),ze(),Re();var u=Gn();Pe(u,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:c(),height:c(),...g(a),...i}));var l=at(u);{var f=C=>{var d=Hn(),v=at(d,!0);it(d),yt(()=>It(v,o())),ht(C,d)};Kt(l,C=>{o()&&C(f)})}Se(),it(u),ht(t,u),Bt()}var jn=$t("<title> </title>"),Un=$t('<svg><!><path d="M12,8V24H8V8h4m0-2H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path><path d="M24,8V24H20V8h4m0-2H20a2,2,0,0,0-2,2V24a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path></svg>');function Zn(t,e){const n=Qt(e,["children","$$slots","$$events","$$legacy"]),i=Qt(n,["size","title"]);Ft(e,!1);const r=Zt(),a=Zt();let c=mt(e,"size",8,16),o=mt(e,"title",8,void 0);Ut(()=>(Pt(n),Pt(o())),()=>{q(r,n["aria-label"]||n["aria-labelledby"]||o())}),Ut(()=>(g(r),Pt(n)),()=>{q(a,{"aria-hidden":g(r)?void 0:!0,role:g(r)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),ze(),Re();var u=Un();Pe(u,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:c(),height:c(),...g(a),...i}));var l=at(u);{var f=C=>{var d=jn(),v=at(d,!0);it(d),yt(()=>It(v,o())),ht(C,d)};Kt(l,C=>{o()&&C(f)})}Se(2),it(u),ht(t,u),Bt()}var Kn=Dt('<div class="density-bar svelte-lzvab"></div>'),Qn=Dt('<span class="date-label svelte-lzvab"> </span>'),Jn=Dt('<div class="timeline-tooltip svelte-lzvab"><div class="tooltip-date svelte-lzvab"> </div> <div class="tooltip-count svelte-lzvab"> </div></div>'),qn=Dt('<div class="timeline-bar svelte-lzvab"><!> <div class="timeline-track svelte-lzvab"><div class="track-line svelte-lzvab"></div> <div class="density-bars svelte-lzvab"></div> <div class="playhead svelte-lzvab"></div> <div class="date-labels svelte-lzvab"></div> <!></div></div>');function $n(t,e){Ft(e,!0);let n=pt(null),i=pt(0),r=pt(!1),a=pt(!1),c=pt(null),o=null;const u=nt(()=>{let I=1/0,M=-1/0;for(const E of e.entities){const A=E.createdAt?new Date(E.createdAt).getTime():0;A>0&&A<I&&(I=A),A>M&&(M=A)}return I===1/0&&(I=Date.now()),M===-1/0&&(M=Date.now()),{min:I,max:M}}),l=nt(()=>{let{min:I,max:M}=g(u);return M-I<864e5&&(I-=864e5*15,M+=864e5*15),{min:new Date(I),max:new Date(M)}}),f=nt(()=>{const M=g(l).min.getTime(),E=g(l).max.getTime(),A=new Map;for(const k of e.entities){const j=k.createdAt?new Date(k.createdAt).getTime():0;if(j<=0)continue;const R=Math.floor((j-M)/864e5),L=M+R*864e5,U=A.get(L)??[];U.push(k),A.set(L,U)}return{map:A,minTime:M,maxTime:E,dayMs:864e5}}),C=nt(()=>{let I=0;for(const M of g(f).map.values())M.length>I&&(I=M.length);return Math.max(1,I)}),d=nt(()=>{const{minTime:I,maxTime:M}=g(f),E=M-I,A=[],k=Math.max(4,Math.min(8,Math.floor(g(i)/100))),j=E/k;for(let R=0;R<=k;R++){const L=I+R*j,K=new Date(L).toLocaleDateString("en-US",{month:"short",day:"numeric"});A.push({label:K,x:R/k})}return A}),v=nt(()=>{const{minTime:I,maxTime:M}=g(f),E=M-I;if(E<=0)return .5;const A=e.currentDate?e.currentDate.getTime():g(u).max,k=Math.max(g(u).min,Math.min(g(u).max,A));return Math.max(0,Math.min(1,(k-I)/E))});function b(I){if(!g(n))return new Date;const M=g(n).getBoundingClientRect(),E=40,k=M.width-E-12,j=Math.max(0,Math.min(1,(I-M.left-E)/k)),{minTime:R,maxTime:L}=g(f),U=R+j*(L-R);return new Date(Math.max(g(u).min,Math.min(g(u).max,U)))}function p(I){q(r,!0),N();const M=b(I.clientX);e.onDateChange(M),I.target.setPointerCapture(I.pointerId)}function s(I){if(g(r)&&e.onDateChange(b(I.clientX)),!g(n))return;const M=g(n).getBoundingClientRect(),E=40,k=M.width-E-12,j=(I.clientX-M.left-E)/k;if(j<0||j>1){q(c,null);return}const{minTime:R,dayMs:L,map:U}=g(f),K=R+j*(g(f).maxTime-R),tt=R+Math.floor((K-R)/L)*L,At=U.get(tt);At&&At.length>0?q(c,{date:new Date(tt),count:At.length,x:I.clientX-M.left},!0):q(c,null)}function h(){q(r,!1)}function x(){q(c,null)}function D(){g(a)?N():m()}function m(){q(a,!0);const{min:I,max:M}=g(u),A=(M-I)/200;let k=e.currentDate?.getTime()??I;k>=M&&(k=I),o=setInterval(()=>{if(k+=A,k>=M){e.onDateChange(null),N();return}e.onDateChange(new Date(k))},50)}function N(){q(a,!1),o&&(clearInterval(o),o=null)}Ne(()=>{if(g(n)){const I=new ResizeObserver(M=>{q(i,M[0]?.contentRect.width??0,!0)});return I.observe(g(n)),()=>I.disconnect()}});var S=qn(),W=at(S);{let I=nt(()=>g(a)?"Pause":"Play");on(W,{variant:"ghost",size:"icon",class:"play-btn",onclick:D,get title(){return g(I)},children:(M,E)=>{var A=Qe(),k=ke(A);{var j=L=>{Zn(L,{size:14})},R=L=>{Wn(L,{size:14})};Kt(k,L=>{g(a)?L(j):L(R,!1)})}ht(M,A)},$$slots:{default:!0}})}var B=gt(W,2),$=gt(at(B),2);ce($,21,()=>Array.from(g(f).map.entries()),fe,(I,M)=>{var E=nt(()=>$e(g(M),2));let A=()=>g(E)[0],k=()=>g(E)[1];const j=nt(()=>(A()-g(f).minTime)/(g(f).maxTime-g(f).minTime)),R=nt(()=>k().length/g(C)),L=nt(()=>.05+.95*g(R)*g(R));var U=Kn();let K;yt(()=>K=kt(U,"",K,{left:`${g(j)*100}%`,opacity:g(L)})),ht(I,U)}),it($);var G=gt($,2);let ft;var Q=gt(G,2);ce(Q,21,()=>g(d),fe,(I,M)=>{var E=Qn();let A;var k=at(E,!0);it(E),yt(()=>{A=kt(E,"",A,{left:`${g(M).x*100}%`}),It(k,g(M).label)}),ht(I,E)}),it(Q);var ot=gt(Q,2);{var wt=I=>{var M=Jn();let E;var A=at(M),k=at(A,!0);it(A);var j=gt(A,2),R=at(j);it(j),it(M),yt(L=>{E=kt(M,"",E,{left:`${g(c).x??""}px`}),It(k,L),It(R,`${g(c).count??""} ${g(c).count===1?"entity":"entities"}`)},[()=>g(c).date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]),ht(I,M)};Kt(ot,I=>{g(c)&&!g(r)&&I(wt)})}it(B),it(S),Ee(S,I=>q(n,I),()=>g(n)),yt(()=>ft=kt(G,"",ft,{left:`${g(v)*100}%`})),Tt("pointerdown",B,p),Tt("pointermove",B,s),Tt("pointerup",B,h),le("pointerleave",B,x),ht(t,S),Bt()}Ae(["pointerdown","pointermove","pointerup"]);var ti=Dt("<!> <!> <!>",1);function yi(t,e){Ft(e,!0),se.showGraph();let n=pt(null);const i=nt(()=>{const f=new Map;for(const C of Wt.repos)for(const d of C.entities)f.set(d.id,d.title);return f}),r=nt(()=>{const f=[];for(const C of Wt.repos)for(const d of C.entities)d.id.toLowerCase().startsWith("readme")||f.push(d);return f}),a=nt(()=>{const f=[],C=[],d=new Set,v=new Set,b=g(n)?.getTime()??1/0;for(const s of Wt.repos)for(const h of s.entities){if(h.id.toLowerCase().startsWith("readme")||d.has(h.id)||(h.createdAt?new Date(h.createdAt).getTime():0)>b)continue;d.add(h.id),f.push({id:h.id,type:h.entityType,repo:s.name});const D=h.wikilinks??[];for(const m of D){const N=h.id<m?`${h.id}|${m}`:`${m}|${h.id}`;!v.has(N)&&h.id!==m&&(v.add(N),C.push({source:h.id,target:m}))}}const p=C.filter(s=>d.has(s.source)&&d.has(s.target));return{nodes:f,edges:p}});var c=ti(),o=ke(c);tn(o,{activeView:"graph"});var u=gt(o,2);Yn(u,{get graphData(){return g(a)},get selectedEntityId(){return se.selectedId},get nameMap(){return g(i)},get filteredIds(){return Wt.filteredIds},get sidebarHoveredId(){return se.hoveredEntityId},get highlightedIds(){return an.highlightedIds}});var l=gt(u,2);$n(l,{get entities(){return g(r)},get currentDate(){return g(n)},onDateChange:f=>{q(n,f,!0)}}),ht(t,c),Bt()}export{yi as component};
|