studiograph 1.3.44-next.13 → 1.3.44-next.14
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/2.Dp4DXq6m.css +1 -0
- package/dist/web/_app/immutable/assets/4.CF--By4G.css +1 -0
- package/dist/web/_app/immutable/assets/{8.typoxX8e.css → 8.DXc-iTTx.css} +1 -1
- package/dist/web/_app/immutable/chunks/{D6cVys5p.js → 2U5cDetP.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D3QkosGt.js → 4uEV2Hr-.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DYvpKXdA.js → 9rXsO0Bz.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DLWveUsw.js → B4jNhkRC.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CzDsEODJ.js → BBKkjbG3.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Zhai-RNf.js → BKUmpdNY.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D6Lva3KM.js → BSSN_IAc.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BJBX4SKZ.js → BdF6nRVd.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DxfAvVJc.js → BdOJnB5W.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CHat18Z1.js → BnpnuDO4.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Bk8fVkoK.js → BtBweNkk.js} +1 -1
- package/dist/web/_app/immutable/chunks/{MumxzvFg.js → Btdblixo.js} +2 -2
- package/dist/web/_app/immutable/chunks/{D1SfcMkP.js → C9RtA91n.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CcZpH1ju.js → CO5wfegi.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DmbGlfj8.js → CRMZi-rj.js} +1 -1
- package/dist/web/_app/immutable/chunks/{bJHY9GmW.js → CZnFLHZY.js} +1 -1
- package/dist/web/_app/immutable/chunks/{EihZTlx6.js → CiAwDBAJ.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CIhtHHtB.js → CkIXD8Ce.js} +1 -1
- package/dist/web/_app/immutable/chunks/{nvDiOb2E.js → CoRi7XbI.js} +1 -1
- package/dist/web/_app/immutable/chunks/{C6o4-5Jc.js → D94pMxcD.js} +1 -1
- package/dist/web/_app/immutable/chunks/DJQi596I.js +1 -0
- package/dist/web/_app/immutable/chunks/{iZnTs-Zk.js → DNrFMx27.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BEGjic-p.js → DewdtTcU.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Btb43C3I.js → DhsBMOEB.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Z7amP7yh.js → Dp_zRVHI.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DWXBtS4C.js → DpvsjMfA.js} +1 -1
- package/dist/web/_app/immutable/chunks/{xwFtwYnE.js → DvmL5xMZ.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DvO9pXIe.js → Dw0OBYq7.js} +1 -1
- package/dist/web/_app/immutable/chunks/{LMiDqdV2.js → DycWivyI.js} +1 -1
- package/dist/web/_app/immutable/chunks/{C8Y6xIC4.js → OZfYVFGq.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CrUJgkXY.js → faGDeGnG.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BZEMt5cm.js → gawey_BW.js} +1 -1
- package/dist/web/_app/immutable/chunks/{AtgAMDzg.js → ghYWEYsA.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BsdMYUpR.js → oTvbmuuZ.js} +1 -1
- package/dist/web/_app/immutable/chunks/{e913tUZv.js → sZJoCX5N.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BYR-dNJ1.js → xQGK7Vl0.js} +1 -1
- package/dist/web/_app/immutable/entry/app.C6tCpdA8.js +2 -0
- package/dist/web/_app/immutable/entry/start.9qqNLVcM.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.BdgXr-pL.js → 0.CPVrRWk1.js} +2 -2
- package/dist/web/_app/immutable/nodes/{1.TbRWZdMF.js → 1.DaNijLBH.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.BKT_t6uj.js → 10.B2cHwEJ9.js} +1 -1
- package/dist/web/_app/immutable/nodes/2.CnrLCVny.js +84 -0
- package/dist/web/_app/immutable/nodes/{3.BN2A-Xvj.js → 3.Dl2fWmMF.js} +1 -1
- package/dist/web/_app/immutable/nodes/4.BZ22jmQZ.js +11 -0
- package/dist/web/_app/immutable/nodes/{5.bQNmtfyR.js → 5.CDPgfoif.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.pIg7-OuF.js → 6.VxPVIhVs.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.GE6wU3-T.js → 7.yBkC4gYp.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.BdAUYAfR.js → 8.dKj6qu4h.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.BB838-uI.js → 9.DkzOHFmr.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/assets/2.DNpjFx0k.css +0 -1
- package/dist/web/_app/immutable/assets/4.DNq68wHi.css +0 -1
- package/dist/web/_app/immutable/chunks/BvV0_74V.js +0 -1
- package/dist/web/_app/immutable/chunks/eJ_5ITus.js +0 -1
- package/dist/web/_app/immutable/entry/app.6jFeVTd5.js +0 -2
- package/dist/web/_app/immutable/entry/start.Br78T-IN.js +0 -1
- package/dist/web/_app/immutable/nodes/2.BxoTrZf-.js +0 -84
- package/dist/web/_app/immutable/nodes/4.lZR-3hqX.js +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as we,a as i,b as o,s as k,e as T}from"../chunks/
|
|
1
|
+
import{d as we,a as i,b as o,s as k,e as T}from"../chunks/BdF6nRVd.js";import{p as xe,a1 as ze,a2 as Be,a0 as K,b as Ae,a3 as u,c as a,g as r,r as e,a4 as I,t as C,s as Re,n as P,e as Se}from"../chunks/sZJoCX5N.js";import{i as w}from"../chunks/BSSN_IAc.js";import{e as j,i as N}from"../chunks/gawey_BW.js";import{r as Ce}from"../chunks/BKUmpdNY.js";import{b as We,B as X}from"../chunks/9rXsO0Bz.js";import{g as Z}from"../chunks/oTvbmuuZ.js";import{V as Ee}from"../chunks/DewdtTcU.js";import{w as U}from"../chunks/DvmL5xMZ.js";import{n as Le}from"../chunks/CkIXD8Ce.js";import{insightsStore as s}from"../chunks/CO5wfegi.js";import{R as q}from"../chunks/BnpnuDO4.js";import{S as Te,A as $e}from"../chunks/ghYWEYsA.js";var Ie=o('<h2 class="svelte-h7bcrl"> </h2>'),Pe=o('<div class="home-center svelte-h7bcrl"><!></div>'),Ge=o('<button class="suggestion-chip svelte-h7bcrl"> </button>'),Me=o(`<div class="home-center onboarding svelte-h7bcrl"><h2 class="svelte-h7bcrl">What matters most to you?</h2> <p class="onboarding-subtitle svelte-h7bcrl">Tell us what you'd like to see on your home screen, and we'll generate personalized insights from your knowledge graph.</p> <div class="suggestions svelte-h7bcrl"></div> <div class="custom-brief svelte-h7bcrl"><input class="brief-input svelte-h7bcrl" type="text" placeholder="Or describe your own focus..."/> <!></div></div>`),Oe=o('<div class="home-center svelte-h7bcrl"><div class="generating svelte-h7bcrl"><!> <p>Analyzing your knowledge graph...</p></div></div>'),Ve=o('<span class="insights-meta svelte-h7bcrl"> </span>'),je=o("<!> Refresh",1),Ne=o('<button class="action-btn svelte-h7bcrl"> </button>'),Ue=o('<button class="entity-chip svelte-h7bcrl"> </button>'),qe=o('<div class="insight-entities svelte-h7bcrl"></div>'),De=o('<div class="insight-card svelte-h7bcrl"><div class="insight-top svelte-h7bcrl"><span class="pattern-tag svelte-h7bcrl"> </span></div> <h3 class="insight-headline svelte-h7bcrl"> </h3> <p class="insight-detail svelte-h7bcrl"> </p> <!> <!></div>'),Fe=o('<div class="insights-grid svelte-h7bcrl"></div>'),He=o("<p>Failed to generate insights. Check your AI provider configuration.</p>"),Qe=o('<div class="generating svelte-h7bcrl"><!> <p>Analyzing your knowledge graph...</p></div>'),Ye=o("<p>No insights yet. Click Refresh to generate them.</p>"),Je=o('<div class="no-insights svelte-h7bcrl"><!></div>'),Ke=o('<div class="home-insights svelte-h7bcrl"><div class="insights-header svelte-h7bcrl"><div class="insights-title svelte-h7bcrl"><h2 class="svelte-h7bcrl">Your Briefing</h2> <!></div> <div class="insights-actions svelte-h7bcrl"><button class="edit-focus-link svelte-h7bcrl"><!> Edit focus</button> <!></div></div> <!></div>'),Xe=o('<!> <div class="home svelte-h7bcrl"><!></div>',1);function ht(ee,te){xe(te,!0);const ae=ze("chat");Le.showEntity(),Be(()=>{U.nameLoaded&&!s.loaded&&s.load()});const re=I(()=>s.briefLoaded&&s.homeBrief.length>0),D=I(()=>s.insights.length>0),se=["What's at risk across my projects","Which clients need attention","What's due this week for my team","Pipeline and deal progress","What's new since I last checked in","Help me stay on top of decisions and tasks"];let W=Se("");async function ie(t){s.saveBrief(t),await s.generate()}async function F(){r(W).trim()&&(s.saveBrief(r(W).trim()),await s.generate())}function oe(){s.generate()}function ne(t){switch(t){case"risk":return"Risk";case"relationship":return"Relationship";case"opportunity":return"Opportunity";case"quality":return"Graph Quality";case"trend":return"Trend"}}function le(t){if(!t)return"";const n=Date.now()-new Date(t).getTime(),l=Math.floor(n/6e4);if(l<1)return"just now";if(l<60)return`${l}m ago`;const v=Math.floor(l/60);return v<24?`${v}h ago`:`${Math.floor(v/24)}d ago`}function ve(t){Z(`/${t.repo}/${t.type}/${t.id}`)}var H=Xe(),Q=K(H);Ee(Q,{activeView:"entity"});var Y=u(Q,2),ce=a(Y);{var de=t=>{var n=Pe(),l=a(n);{var v=f=>{var x=Ie(),A=a(x);e(x),C(()=>k(A,`Welcome to ${(U.name||"Studiograph")??""}`)),i(f,x)};w(l,f=>{U.nameLoaded&&f(v)})}e(n),i(t,n)},he=t=>{var n=Me(),l=u(a(n),4);j(l,21,()=>se,N,(g,S)=>{var z=Ge(),G=a(z,!0);e(z),C(()=>k(G,r(S))),T("click",z,()=>ie(r(S))),i(g,z)}),e(l);var v=u(l,2),f=a(v);Ce(f);var x=u(f,2);{var A=g=>{X(g,{onclick:F,children:(S,z)=>{$e(S,{size:14})},$$slots:{default:!0}})},R=I(()=>r(W).trim());w(x,g=>{r(R)&&g(A)})}e(v),e(n),T("keydown",f,g=>g.key==="Enter"&&F()),We(f,()=>r(W),g=>Re(W,g)),i(t,n)},pe=t=>{var n=Oe(),l=a(n),v=a(l);q(v,{size:20,class:"animate-spin"}),P(2),e(l),e(n),i(t,n)},ue=t=>{var n=Ke(),l=a(n),v=a(l),f=u(a(v),2);{var x=d=>{var h=Ve(),b=a(h);e(h),C(c=>k(b,`Updated ${c??""}`),[()=>le(s.generatedAt)]),i(d,h)};w(f,d=>{s.generatedAt&&d(x)})}e(v);var A=u(v,2),R=a(A),g=a(R);Te(g,{size:12}),P(),e(R);var S=u(R,2);X(S,{variant:"ghost",size:"sm",onclick:oe,get disabled(){return s.loading},children:(d,h)=>{var b=je(),c=K(b);{let B=I(()=>s.loading?"animate-spin":"");q(c,{size:14,get class(){return r(B)}})}P(),i(d,b)},$$slots:{default:!0}}),e(A),e(l);var z=u(l,2);{var G=d=>{var h=Fe();j(h,21,()=>s.insights,N,(b,c)=>{var B=De(),E=a(B),p=a(E),_=a(p,!0);e(p),e(E);var L=u(E,2),ge=a(L,!0);e(L);var M=u(L,2),_e=a(M,!0);e(M);var J=u(M,2);{var me=m=>{var y=Ne(),O=a(y,!0);e(y),C(()=>k(O,r(c).actions[0])),T("click",y,()=>ae.sendPrompt(r(c).actions[0])),i(m,y)};w(J,m=>{r(c).actions?.[0]&&m(me)})}var be=u(J,2);{var ye=m=>{var y=qe();j(y,21,()=>r(c).entities,N,(O,V)=>{var $=Ue(),ke=a($,!0);e($),C(()=>k(ke,r(V).name||r(V).id)),T("click",$,()=>ve(r(V))),i(O,$)}),e(y),i(m,y)};w(be,m=>{r(c).entities.length>0&&m(ye)})}e(B),C(m=>{k(_,m),k(ge,r(c).headline),k(_e,r(c).detail)},[()=>ne(r(c).pattern)]),i(b,B)}),e(h),i(d,h)},fe=d=>{var h=Je(),b=a(h);{var c=p=>{var _=He();i(p,_)},B=p=>{var _=Qe(),L=a(_);q(L,{size:20,class:"animate-spin"}),P(2),e(_),i(p,_)},E=p=>{var _=Ye();i(p,_)};w(b,p=>{s.error?p(c):s.loading?p(B,1):p(E,!1)})}e(h),i(d,h)};w(z,d=>{r(D)?d(G):d(fe,!1)})}e(n),T("click",R,()=>Z("/settings?tab=preferences")),i(t,n)};w(ce,t=>{s.briefLoaded?r(re)?s.loading&&!r(D)?t(pe,2):t(ue,!1):t(he,1):t(de)})}e(Y),i(ee,H),Ae()}we(["click","keydown"]);export{ht as component};
|
|
@@ -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/C9RtA91n.js","../chunks/CLFba8FK.js","../chunks/Btdblixo.js","../chunks/PPVm8Dsz.js","../chunks/sZJoCX5N.js","../chunks/oTvbmuuZ.js","../chunks/DvmL5xMZ.js","../chunks/OZfYVFGq.js","../chunks/BtBweNkk.js","../chunks/CkIXD8Ce.js","../chunks/BdF6nRVd.js","../chunks/i9c_RUF6.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{h as Ha,w as Nt,k as Ba}from"../chunks/DvmL5xMZ.js";import{_ as tt}from"../chunks/PPVm8Dsz.js";import{d as ua,e as Fe,g as it,a as f,c as He,t as St,s as se,b as O,f as Tt}from"../chunks/BdF6nRVd.js";import{aA as Ya,a7 as Ma,p as dt,e as Se,f as vt,a2 as bt,aE as Za,c as y,a3 as M,r as c,g as e,s as h,b as ft,a0 as we,n as Ye,t as re,a4 as Pe,l as Pt,d as lt,a as ca,m as At,bs as ta,ax as Gt,aP as Ja,a1 as Ga,aD as Qa,aF as Ia}from"../chunks/sZJoCX5N.js";import{i as ve,b as Xt}from"../chunks/BSSN_IAc.js";import{e as qe,i as Be}from"../chunks/gawey_BW.js";import{c as Ne}from"../chunks/4uEV2Hr-.js";import{s as xt,c as Xa}from"../chunks/OZfYVFGq.js";import{p as Qe,l as Rt,a as $a,b as en}from"../chunks/DNrFMx27.js";import{g as Qt,i as tn}from"../chunks/oTvbmuuZ.js";import{A as wa,p as an}from"../chunks/CRMZi-rj.js";import{a as aa,V as nn}from"../chunks/DewdtTcU.js";import{r as qt,a as da,d as la,c as ot}from"../chunks/BKUmpdNY.js";import{b as ja,B as Ge}from"../chunks/9rXsO0Bz.js";import{e as na,f as jt,A as rn}from"../chunks/CdeYcEuU.js";import{T as xa,P as Ca,C as Ea,I as ga,S as sn,a as ra,R as Sa,p as Pa,b as on}from"../chunks/CZnFLHZY.js";import{i as fa}from"../chunks/faGDeGnG.js";import{A as ln,C as Aa}from"../chunks/B4jNhkRC.js";import{T as un,j as cn,r as dn}from"../chunks/2U5cDetP.js";import{C as ka,a as Ra}from"../chunks/DycWivyI.js";import{C as fn}from"../chunks/CoRi7XbI.js";import{g as vn}from"../chunks/CqkleIqs.js";import{n as ya}from"../chunks/CkIXD8Ce.js";import{e as Je,r as hn}from"../chunks/Btdblixo.js";import{chatStore as pn}from"../chunks/Dw0OBYq7.js";import{A as _n,q as mn,r as gn,s as yn,t as wn,u as kn,x as bn}from"../chunks/BdOJnB5W.js";import{a as Ta}from"../chunks/BtBweNkk.js";function xn(Y,t,l){Ya(()=>{var i=Ma(()=>t(Y,l?.())||{});if(i?.destroy)return()=>i.destroy()})}const Cn=async({params:Y,fetch:t})=>{const{repo:l,type:i,id:v}=Y,P=await Ha(l,i,v);return{repo:l,type:i,id:v,entity:P}},Us=Object.freeze(Object.defineProperty({__proto__:null,load:Cn},Symbol.toStringTag,{value:"Module"}));var En=O('<span class="chip svelte-84vb17"> <!></span>'),Sn=O('<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>'),Pn=O('<div class="dropdown svelte-84vb17"></div>'),An=O('<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 Rn(Y,t){dt(t,!0);let l=Qe(t,"multi",3,!1),i=Se(""),v=Se(0),P;const R=Pe(()=>Nt.repos.flatMap(w=>w.entities.map(k=>({id:k.id,title:k.title,entityType:k.entityType,repo:w.name})))),A=Pe(()=>()=>{const w=e(i).toLowerCase().trim();return w?e(R).filter(k=>k.title.toLowerCase().includes(w)||k.id.toLowerCase().includes(w)).slice(0,20):e(R).slice(0,20)}),S=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let u=Se(vt(S));bt(()=>{Za().then(()=>P?.focus())});function T(w){l()?(e(u).includes(w)||h(u,[...e(u),w],!0),h(i,""),h(v,0),P?.focus()):t.onselect(w)}function W(w){h(u,e(u).filter(k=>k!==w),!0)}function x(){e(u).length===S.length&&e(u).every((k,a)=>k===S[a])?t.oncancel():t.onselect(e(u))}function L(w){const k=e(A)();w.key==="ArrowDown"?(w.preventDefault(),h(v,Math.min(e(v)+1,k.length-1),!0)):w.key==="ArrowUp"?(w.preventDefault(),h(v,Math.max(e(v)-1,0),!0)):w.key==="Enter"?(w.preventDefault(),k.length>0?T(k[e(v)].id):l()&&x()):w.key==="Escape"?l()&&e(u).length>0?x():t.oncancel():w.key==="Backspace"&&!e(i)&&l()&&e(u).length>0&&h(u,e(u).slice(0,-1),!0)}var he=An(),B=y(he),ie=y(B);{var Ae=w=>{var k=He(),a=we(k);qe(a,17,()=>e(u),Be,(n,o)=>{var p=En(),C=y(p),N=M(C);Ge(N,{variant:"ghost",size:"icon",class:"chip-remove",onclick:()=>W(e(o)),children:(_e,Re)=>{Ye();var E=St("×");f(_e,E)},$$slots:{default:!0}}),c(p),re(()=>se(C,`${e(o)??""} `)),f(n,p)}),f(w,k)};ve(ie,w=>{l()&&w(Ae)})}var X=M(ie,2);qt(X),Xt(X,w=>P=w,()=>P),c(B);var ee=M(B,2);{var I=w=>{var k=Pn();qe(k,21,()=>e(A)(),Be,(a,n,o)=>{var p=Sn();let C;var N=y(p),_e=y(N,!0);c(N);var Re=M(N,2),E=y(Re),_=y(E,!0);c(E);var m=M(E,2),D=y(m,!0);c(m),c(Re),c(p),re(()=>{C=xt(p,1,"dropdown-item svelte-84vb17",null,C,{highlighted:o===e(v)}),se(_e,e(n).title),se(_,e(n).entityType),se(D,e(n).repo)}),Fe("mousedown",p,oe=>{oe.preventDefault(),T(e(n).id)}),it("mouseenter",p,()=>h(v,o,!0)),f(a,p)}),c(k),f(w,k)},te=Pe(()=>e(A)().length>0);ve(ee,w=>{e(te)&&w(I)})}c(he),Fe("keydown",X,L),it("blur",X,()=>{setTimeout(()=>{l()&&e(u).length>0?x():l()||t.oncancel()},150)}),ja(X,()=>e(i),w=>h(i,w)),f(Y,he),ft()}ua(["keydown","mousedown"]);var Tn=Tt("<title> </title>"),Dn=Tt('<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 sa(Y,t){const l=Rt(t,["children","$$slots","$$events","$$legacy"]),i=Rt(l,["size","title"]);dt(t,!1);const v=At(),P=At();let R=Qe(t,"size",8,16),A=Qe(t,"title",8,void 0);Pt(()=>(lt(l),lt(A())),()=>{h(v,l["aria-label"]||l["aria-labelledby"]||A())}),Pt(()=>(e(v),lt(l)),()=>{h(P,{"aria-hidden":e(v)?void 0:!0,role:e(v)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),ca(),fa();var S=Dn();da(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:R(),height:R(),...e(P),...i}));var u=y(S);{var T=W=>{var x=Tn(),L=y(x,!0);c(x),re(()=>se(L,A())),f(W,x)};ve(u,W=>{A()&&W(T)})}Ye(2),c(S),f(Y,S),ft()}var On=Tt("<title> </title>"),Ln=Tt('<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 ia(Y,t){const l=Rt(t,["children","$$slots","$$events","$$legacy"]),i=Rt(l,["size","title"]);dt(t,!1);const v=At(),P=At();let R=Qe(t,"size",8,16),A=Qe(t,"title",8,void 0);Pt(()=>(lt(l),lt(A())),()=>{h(v,l["aria-label"]||l["aria-labelledby"]||A())}),Pt(()=>(e(v),lt(l)),()=>{h(P,{"aria-hidden":e(v)?void 0:!0,role:e(v)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),ca(),fa();var S=Ln();da(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:R(),height:R(),...e(P),...i}));var u=y(S);{var T=W=>{var x=On(),L=y(x,!0);c(x),re(()=>se(L,A())),f(W,x)};ve(u,W=>{A()&&W(T)})}Ye(2),c(S),f(Y,S),ft()}var zn=Tt("<title> </title>"),Fn=Tt('<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 Ka(Y,t){const l=Rt(t,["children","$$slots","$$events","$$legacy"]),i=Rt(l,["size","title"]);dt(t,!1);const v=At(),P=At();let R=Qe(t,"size",8,16),A=Qe(t,"title",8,void 0);Pt(()=>(lt(l),lt(A())),()=>{h(v,l["aria-label"]||l["aria-labelledby"]||A())}),Pt(()=>(e(v),lt(l)),()=>{h(P,{"aria-hidden":e(v)?void 0:!0,role:e(v)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),ca(),fa();var S=Fn();da(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:R(),height:R(),...e(P),...i}));var u=y(S);{var T=W=>{var x=zn(),L=y(x,!0);c(x),re(()=>se(L,A())),f(W,x)};ve(u,W=>{A()&&W(T)})}Ye(2),c(S),f(Y,S),ft()}var Mn=O('<input class="ip-name-input svelte-x7sio8" type="text"/>'),In=O('<span class="ip-name-text svelte-x7sio8"> </span>'),jn=O("<div><!></div>"),Kn=O('<button class="ip-fields-toggle svelte-x7sio8"><span><!></span> <span class="ip-fields-label svelte-x7sio8">Fields</span> <span class="ip-fields-count svelte-x7sio8"> </span></button>'),Un=O('<span class="ip-etype-ring svelte-x7sio8"></span>'),Nn=O('<span class="ip-menu-check svelte-x7sio8"><!></span>'),qn=O('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),Vn=O('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),Wn=O("<!> <!> <!>",1),Hn=O("<!> <!>",1),Bn=O('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),Yn=O('<span class="ip-status-dot svelte-x7sio8"></span> ',1),Zn=O('<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>'),Jn=O('<span class="ip-cal-wd svelte-x7sio8"> </span>'),Gn=O('<div class="ip-cal-week svelte-x7sio8"></div>'),Qn=O('<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>'),Xn=O('<span class="ip-type-dot svelte-x7sio8"></span> <span> </span>',1),$n=O('<span class="ip-menu-check svelte-x7sio8"><!></span>'),er=O('<span class="ip-type-dot svelte-x7sio8"></span> <span> </span> <!>',1),tr=O("<!> <!>",1),ar=O('<span class="ip-etype-display svelte-x7sio8"> </span>'),nr=O('<span class="ip-badge svelte-x7sio8"> </span>'),rr=O('<div class="ip-wikilink-group svelte-x7sio8"></div>'),sr=O('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),ir=O('<span class="ip-date-text svelte-x7sio8"> </span>'),or=O('<span class="ip-url-link svelte-x7sio8"> </span>'),lr=O('<span class="ip-text-value svelte-x7sio8"> </span>'),ur=O('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),cr=O('<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>'),dr=O("<!> <span>Add field</span>",1),fr=O("<!> <!>",1),vr=O('<div class="inline-properties svelte-x7sio8"><!> <!> <!></div>');function hr(Y,t){dt(t,!0);let l=Qe(t,"editable",3,!1),i=Qe(t,"autofocusKey",3,null),v=Qe(t,"protectedKeys",19,()=>new Set);const P="sg-properties-expanded";let R=Se(vt(typeof localStorage<"u"?localStorage.getItem(P)==="true":!1));function A(){h(R,!e(R)),localStorage.setItem(P,e(R)?"true":"false")}const S=Pe(()=>t.properties.find(d=>d.key==="name")),u=Pe(()=>t.properties.filter(d=>d.key!=="name")),T=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],W=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let x=Se(null),L=Se(!1),he=Se(!1);bt(()=>{i()&&!e(he)&&t.properties.some(d=>d.key===i())&&(h(he,!0),requestAnimationFrame(()=>{h(x,i())})),i()||h(he,!1)});let B=Se(""),ie=Se(void 0);function Ae(d){return d.replace(/[_-]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function X(d){switch(d.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 ee(d){for(const r of Nt.repos){const g=r.entities.find(Z=>Z.id===d);if(g){Qt(`/${r.name}/${g.entityType}/${g.id}`);return}}}function I(d){return typeof d.value=="string"?d.value:d.value[0]}function te(d){return/^https?:\/\//.test(d)}let w=Se(null),k=Se(null);function a(d){e(w)&&(e(w).style.cursor=d?"pointer":"text",e(w).style.textDecoration=d?"underline":"none")}function n(d){try{return new Date(d).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return d}}let o=Se(vt(new Date().getFullYear())),p=Se(vt(new Date().getMonth()));const C=["Su","Mo","Tu","We","Th","Fr","Sa"],N=["January","February","March","April","May","June","July","August","September","October","November","December"];function _e(d,r){const g=new Date(d,r,1).getDay(),Z=new Date(d,r+1,0).getDate(),U=new Date(d,r,0).getDate(),ae=[];let q=[];for(let s=g-1;s>=0;s--){const V=U-s,z=r===0?11:r-1,$=r===0?d-1:d;q.push({day:V,month:z,year:$,outside:!0})}for(let s=1;s<=Z;s++)q.push({day:s,month:r,year:d,outside:!1}),q.length===7&&(ae.push(q),q=[]);if(q.length>0){const s=r===11?0:r+1,V=r===11?d+1:d;let z=1;for(;q.length<7;)q.push({day:z++,month:s,year:V,outside:!0});ae.push(q)}return ae}function Re(d){const r=new Date;return d.day===r.getDate()&&d.month===r.getMonth()&&d.year===r.getFullYear()}function E(d,r){const g=r.slice(0,10).split("-");return d.year===+g[0]&&d.month===+g[1]-1&&d.day===+g[2]}function _(){e(p)===0?(h(p,11),Gt(o,-1)):Gt(p,-1)}function m(){e(p)===11?(h(p,0),Gt(o)):Gt(p)}function D(d){try{const r=d.slice(0,10).split("-");h(o,+r[0]),h(p,+r[1]-1)}catch{const r=new Date;h(o,r.getFullYear(),!0),h(p,r.getMonth(),!0)}}function oe(d){requestAnimationFrame(()=>{d.focus(),d.select()})}function j(d){!l()||d.type==="badge"||d.type==="entity-type"||(d.type==="date"&&D(I(d)),h(x,d.key,!0))}function J(d,r){t.onedit&&t.onedit(d,r),h(x,null)}function b(d,r){const g=`${r.year}-${String(r.month+1).padStart(2,"0")}-${String(r.day).padStart(2,"0")}`;t.onedit&&t.onedit(d,g),h(x,null)}function K(d,r){t.ontypechange&&t.ontypechange(d,r)}function fe(d){h(x,null),t.onremove&&t.onremove(d)}function G(){h(L,!0),h(B,""),requestAnimationFrame(()=>e(ie)?.focus())}function ce(){const d=e(B).trim();d&&t.onadd&&t.onadd(d,""),h(L,!1),h(B,"")}function H(){h(L,!1),h(B,"")}function Q(d){d.key==="Enter"?(d.preventDefault(),ce()):d.key==="Escape"&&H()}var ke=vr();it("click",ta,()=>{h(x,null)}),it("keydown",ta,d=>{e(w)&&(d.key==="Meta"||d.key==="Control")&&a(!0)}),it("keyup",ta,d=>{e(w)&&(d.key==="Meta"||d.key==="Control")&&a(!1)});var F=y(ke);{var be=d=>{const r=Pe(()=>e(x)==="name");var g=jn();let Z;var U=y(g);{var ae=s=>{var V=Mn();qt(V),Ja(V,!0),re(()=>la(V,e(S).value)),Fe("input",V,z=>t.onedit?.(e(S).key,z.currentTarget.value)),Fe("keydown",V,z=>{(z.key==="Enter"||z.key==="Escape")&&(h(x,null),t.onfocuseditor?.())}),f(s,V)},q=s=>{var V=In(),z=y(V,!0);c(V),re(()=>se(z,e(S).value||"Untitled")),f(s,V)};ve(U,s=>{e(r)&&l()?s(ae):s(q,!1)})}c(g),re(()=>Z=xt(g,1,"ip-name-headline svelte-x7sio8",null,Z,{"ip-focused":e(r)})),Fe("click",g,s=>{s.stopPropagation(),l()&&j(e(S))}),f(d,g)};ve(F,d=>{e(S)&&d(be)})}var ye=M(F,2);{var pe=d=>{var r=Kn(),g=y(r);let Z;var U=y(g);ka(U,{size:14}),c(g);var ae=M(g,4),q=y(ae,!0);c(ae),c(r),re(()=>{Z=xt(g,1,"ip-fields-chevron svelte-x7sio8",null,Z,{expanded:e(R)}),se(q,e(u).length)}),Fe("mousedown",r,s=>s.preventDefault()),Fe("click",r,A),f(d,r)};ve(ye,d=>{e(u).length>0&&d(pe)})}var xe=M(ye,2);{var ue=d=>{var r=fr(),g=we(r);qe(g,17,()=>e(u),q=>q.key,(q,s)=>{const V=Pe(()=>e(x)===e(s).key);var z=ur();let $;var Ee=y(z),me=y(Ee);{var Me=ge=>{var De=Un();f(ge,De)},Ie=ge=>{var De=He(),Le=we(De);Ne(Le,()=>Sa,(Ve,$e)=>{$e(Ve,{children:(nt,pt)=>{var et=Hn(),Oe=we(et);Ne(Oe,()=>xa,(ut,_t)=>{_t(ut,{class:"ip-icon-trigger",children:(de,ne)=>{var Ce=He(),le=we(Ce);{var je=Ke=>{aa(Ke,{size:14})},st=Ke=>{sa(Ke,{size:14})},ct=Ke=>{ia(Ke,{size:14})},mt=Ke=>{ra(Ke,{size:14})};ve(le,Ke=>{e(s).type==="date"?Ke(je):e(s).type==="status"?Ke(st,1):e(s).type==="wikilink"?Ke(ct,2):Ke(mt,!1)})}f(de,Ce)},$$slots:{default:!0}})});var rt=M(Oe,2);Ne(rt,()=>Ca,(ut,_t)=>{_t(ut,{children:(de,ne)=>{var Ce=He(),le=we(Ce);Ne(le,()=>Ea,(je,st)=>{st(je,{class:"ip-menu-content",sideOffset:4,align:"start",children:(ct,mt)=>{var Ke=Wn(),Wt=we(Ke);qe(Wt,17,()=>T,Be,(yt,We)=>{var Ct=He(),zt=we(Ct);Ne(zt,()=>ga,(wt,kt)=>{kt(wt,{class:"ip-menu-item",onSelect:()=>K(e(s).key,e(We).type),children:(Et,va)=>{var Ft=qn(),Mt=we(Ft),ha=y(Mt);{var It=Ue=>{ra(Ue,{size:13})},$t=Ue=>{aa(Ue,{size:13})},pa=Ue=>{sa(Ue,{size:13})},_a=Ue=>{ia(Ue,{size:13})};ve(ha,Ue=>{e(We).type==="text"?Ue(It):e(We).type==="date"?Ue($t,1):e(We).type==="status"?Ue(pa,2):e(We).type==="wikilink"&&Ue(_a,3)})}c(Mt);var Bt=M(Mt,2),ma=y(Bt,!0);c(Bt);var ba=M(Bt,2);{var ea=Ue=>{var Ut=Nn(),Yt=y(Ut);Ra(Yt,{size:12}),c(Ut),f(Ue,Ut)};ve(ba,Ue=>{e(s).type===e(We).type&&Ue(ea)})}re(()=>se(ma,e(We).label)),f(Et,Ft)},$$slots:{default:!0}})}),f(yt,Ct)});var gt=M(Wt,2);Ne(gt,()=>sn,(yt,We)=>{We(yt,{class:"ip-menu-sep"})});var Ht=M(gt,2);Ne(Ht,()=>ga,(yt,We)=>{We(yt,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>fe(e(s).key),children:(Ct,zt)=>{var wt=Vn(),kt=we(wt),Et=y(kt);un(Et,{size:13}),c(kt),Ye(2),f(Ct,wt)},$$slots:{default:!0}})}),f(ct,Ke)},$$slots:{default:!0}})}),f(de,Ce)},$$slots:{default:!0}})}),f(nt,et)},$$slots:{default:!0}})}),f(ge,De)},Te=Pe(()=>l()&&e(s).type!=="badge"&&!v().has(e(s).key)),ze=ge=>{var De=He(),Le=we(De);{var Ve=Oe=>{aa(Oe,{size:14})},$e=Oe=>{sa(Oe,{size:14})},nt=Oe=>{ia(Oe,{size:14})},pt=Oe=>{Ka(Oe,{size:14})},et=Oe=>{ra(Oe,{size:14})};ve(Le,Oe=>{e(s).type==="date"?Oe(Ve):e(s).type==="status"?Oe($e,1):e(s).type==="wikilink"?Oe(nt,2):e(s).type==="badge"?Oe(pt,3):Oe(et,!1)})}f(ge,De)};ve(me,ge=>{e(s).type==="entity-type"?ge(Me):e(Te)?ge(Ie,1):e(s).type!=="entity-type"&&ge(ze,2)})}c(Ee);var Xe=M(Ee,2),ht=y(Xe,!0);c(Xe);var Ze=M(Xe,2),at=y(Ze);{var Dt=ge=>{var De=Bn();qt(De),xn(De,Le=>oe?.(Le)),re(Le=>la(De,Le),[()=>I(e(s))]),it("blur",De,Le=>{const Ve=Le.currentTarget.value;Ve!==I(e(s))&&t.onedit?.(e(s).key,Ve),h(x,null)}),Fe("keydown",De,Le=>{if(Le.key==="Enter"){const Ve=Le.currentTarget.value;Ve!==I(e(s))&&t.onedit?.(e(s).key,Ve);const $e=i()===e(s).key;h(x,null),Le.preventDefault(),$e&&t.onfocuseditor?.()}else Le.key==="Escape"&&(Le.currentTarget.value=I(e(s)),h(x,null))}),f(ge,De)},Ot=ge=>{var De=Zn(),Le=y(De),Ve=y(Le);let $e;var nt=M(Ve,2),pt=y(nt,!0);c(nt),c(Le);var et=M(Le,2);qe(et,21,()=>W,Be,(Oe,rt)=>{{let ut=Pe(()=>I(e(s))===e(rt)?"selected":"");Ge(Oe,{variant:"ghost",get class(){return`ip-status-option ${e(ut)??""}`},onclick:()=>J(e(s).key,e(rt)),children:(_t,de)=>{var ne=Yn(),Ce=we(ne);let le;var je=M(Ce);re(st=>{le=ot(Ce,"",le,st),se(je,` ${e(rt)??""}`)},[()=>({background:X(e(rt))})]),f(_t,ne)},$$slots:{default:!0}})}}),c(et),c(De),re((Oe,rt)=>{$e=ot(Ve,"",$e,Oe),se(pt,rt)},[()=>({background:X(I(e(s)))}),()=>I(e(s))]),Fe("click",De,Oe=>Oe.stopPropagation()),f(ge,De)},Lt=ge=>{var De=Qn(),Le=y(De),Ve=y(Le,!0);c(Le);var $e=M(Le,2),nt=y($e),pt=y(nt);Ge(pt,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:_,children:(de,ne)=>{fn(de,{size:14})},$$slots:{default:!0}});var et=M(pt,2),Oe=y(et);c(et);var rt=M(et,2);Ge(rt,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:m,children:(de,ne)=>{ka(de,{size:14})},$$slots:{default:!0}}),c(nt);var ut=M(nt,2);qe(ut,21,()=>C,Be,(de,ne)=>{var Ce=Jn(),le=y(Ce,!0);c(Ce),re(()=>se(le,e(ne))),f(de,Ce)}),c(ut);var _t=M(ut,2);qe(_t,17,()=>_e(e(o),e(p)),Be,(de,ne)=>{var Ce=Gn();qe(Ce,21,()=>e(ne),Be,(le,je)=>{{let st=Pe(()=>e(je).outside?"outside":""),ct=Pe(()=>Re(e(je))?"today":""),mt=Pe(()=>E(e(je),I(e(s)))?"selected":"");Ge(le,{variant:"ghost",get class(){return`ip-cal-day ${e(st)??""} ${e(ct)??""} ${e(mt)??""}`},onclick:()=>b(e(s).key,e(je)),children:(Ke,Wt)=>{Ye();var gt=St();re(()=>se(gt,e(je).day)),f(Ke,gt)},$$slots:{default:!0}})}}),c(Ce),f(de,Ce)}),c($e),c(De),re(de=>{se(Ve,de),se(Oe,`${N[e(p)]??""} ${e(o)??""}`)},[()=>n(I(e(s)))]),Fe("click",De,de=>de.stopPropagation()),f(ge,De)},Kt=ge=>{{let De=Pe(()=>Array.isArray(e(s).value));Rn(ge,{get value(){return e(s).value},get multi(){return e(De)},onselect:Le=>{t.onedit?.(e(s).key,Le),h(x,null)},oncancel:()=>{h(x,null)}})}},Vt=ge=>{var De=He(),Le=we(De);{var Ve=de=>{var ne=He(),Ce=we(ne);Ne(Ce,()=>Sa,(le,je)=>{je(le,{children:(st,ct)=>{var mt=tr(),Ke=we(mt);{let gt=Pe(()=>na(I(e(s))));Ne(Ke,()=>xa,(Ht,yt)=>{yt(Ht,{class:"ip-etype-trigger",get style(){return`--etype-color: ${e(gt)??""}`},onclick:We=>We.stopPropagation(),children:(We,Ct)=>{var zt=Xn(),wt=we(zt);let kt;var Et=M(wt,2),va=y(Et,!0);c(Et),re((Ft,Mt)=>{kt=ot(wt,"",kt,Ft),se(va,Mt)},[()=>({background:na(I(e(s)))}),()=>jt(I(e(s)))]),f(We,zt)},$$slots:{default:!0}})})}var Wt=M(Ke,2);Ne(Wt,()=>Ca,(gt,Ht)=>{Ht(gt,{children:(yt,We)=>{var Ct=He(),zt=we(Ct);Ne(zt,()=>Ea,(wt,kt)=>{kt(wt,{class:"ip-menu-content ip-etype-content",sideOffset:4,align:"start",children:(Et,va)=>{var Ft=He(),Mt=we(Ft);qe(Mt,17,()=>rn,Be,(ha,It)=>{var $t=He(),pa=we($t);Ne(pa,()=>ga,(_a,Bt)=>{Bt(_a,{class:"ip-menu-item",onSelect:()=>{e(It)!==I(e(s))&&t.onentitytypechange?.(e(It))},children:(ma,ba)=>{var ea=er(),Ue=we(ea);let Ut;var Yt=M(Ue,2),Ua=y(Yt,!0);c(Yt);var Na=M(Yt,2);{var qa=Zt=>{var Jt=$n(),Wa=y(Jt);Ra(Wa,{size:12}),c(Jt),f(Zt,Jt)},Va=Pe(()=>I(e(s))===e(It));ve(Na,Zt=>{e(Va)&&Zt(qa)})}re((Zt,Jt)=>{Ut=ot(Ue,"",Ut,Zt),se(Ua,Jt)},[()=>({background:na(e(It))}),()=>jt(e(It))]),f(ma,ea)},$$slots:{default:!0}})}),f(ha,$t)}),f(Et,Ft)},$$slots:{default:!0}})}),f(yt,Ct)},$$slots:{default:!0}})}),f(st,mt)},$$slots:{default:!0}})}),f(de,ne)},$e=de=>{var ne=ar(),Ce=y(ne,!0);c(ne),re(le=>se(Ce,le),[()=>jt(I(e(s)))]),f(de,ne)},nt=de=>{var ne=nr(),Ce=y(ne,!0);c(ne),re(le=>se(Ce,le),[()=>I(e(s))]),f(de,ne)},pt=de=>{var ne=rr();qe(ne,21,()=>Array.isArray(e(s).value)?e(s).value:[e(s).value],Be,(Ce,le)=>{Ge(Ce,{variant:"ghost",class:"ip-wikilink-chip",onclick:je=>{je.stopPropagation(),ee(e(le))},children:(je,st)=>{Ye();var ct=St();re(()=>se(ct,e(le))),f(je,ct)},$$slots:{default:!0}})}),c(ne),f(de,ne)},et=de=>{var ne=sr(),Ce=y(ne);let le;var je=M(Ce,2),st=y(je,!0);c(je),c(ne),re((ct,mt)=>{le=ot(Ce,"",le,ct),se(st,mt)},[()=>({background:X(I(e(s)))}),()=>I(e(s))]),f(de,ne)},Oe=de=>{var ne=ir(),Ce=y(ne,!0);c(ne),re(le=>se(Ce,le),[()=>n(I(e(s)))]),f(de,ne)},rt=de=>{var ne=or(),Ce=y(ne,!0);c(ne),Xt(ne,le=>h(w,le),()=>e(w)),re(le=>se(Ce,le),[()=>I(e(s))]),it("mouseenter",ne,le=>{h(w,le.currentTarget,!0),h(k,e(s),!0),a(le.metaKey||le.ctrlKey)}),Fe("mousemove",ne,le=>a(le.metaKey||le.ctrlKey)),it("mouseleave",ne,le=>{le.currentTarget.style.cursor="text",le.currentTarget.style.textDecoration="none",h(w,null),h(k,null)}),Fe("click",ne,le=>{le.stopPropagation(),le.metaKey||le.ctrlKey?window.open(I(e(s)),"_blank"):j(e(s))}),f(de,ne)},ut=Pe(()=>te(I(e(s)))),_t=de=>{var ne=lr(),Ce=y(ne,!0);c(ne),re(le=>se(Ce,le),[()=>I(e(s))]),f(de,ne)};ve(Le,de=>{e(s).type==="entity-type"&&l()?de(Ve):e(s).type==="entity-type"?de($e,1):e(s).type==="badge"?de(nt,2):e(s).type==="wikilink"?de(pt,3):e(s).type==="status"?de(et,4):e(s).type==="date"?de(Oe,5):e(ut)?de(rt,6):de(_t,!1)})}f(ge,De)};ve(at,ge=>{e(V)&&e(s).type==="text"?ge(Dt):e(V)&&e(s).type==="status"?ge(Ot,1):e(V)&&e(s).type==="date"?ge(Lt,2):e(V)&&e(s).type==="wikilink"?ge(Kt,3):ge(Vt,!1)})}c(Ze),c(z),re(ge=>{$=xt(z,1,"ip-row svelte-x7sio8",null,$,{"ip-focused":e(V)}),se(ht,ge)},[()=>Ae(e(s).key)]),Fe("click",Ee,ge=>ge.stopPropagation()),Fe("click",Ze,ge=>{ge.stopPropagation(),j(e(s))}),f(q,z)});var Z=M(g,2);{var U=q=>{var s=cr(),V=y(s),z=y(V);wa(z,{size:14}),c(V);var $=M(V,2),Ee=y($);qt(Ee),Xt(Ee,me=>h(ie,me),()=>e(ie)),c($),Ye(2),c(s),Fe("keydown",Ee,Q),it("blur",Ee,H),ja(Ee,()=>e(B),me=>h(B,me)),f(q,s)},ae=q=>{Ge(q,{variant:"ghost",class:"ip-add-btn",onclick:s=>{s.stopPropagation(),G()},children:(s,V)=>{var z=dr(),$=we(z);ln($,{size:16}),Ye(2),f(s,z)},$$slots:{default:!0}})};ve(Z,q=>{e(L)?q(U):l()&&q(ae,1)})}f(d,r)};ve(xe,d=>{e(R)&&d(ue)})}c(ke),f(Y,ke),ft()}ua(["click","input","keydown","mousedown","mousemove"]);var pr=O('<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>'),_r=O('<div class="connections-body svelte-16xienp"></div>'),mr=O('<div class="connections-panel svelte-16xienp"><button class="connections-header svelte-16xienp"><span><!></span> <span class="header-label svelte-16xienp">Linked entities</span> <span class="header-count svelte-16xienp"> </span></button> <!></div>');function gr(Y,t){dt(t,!0);const l="sg-linked-entities-expanded";let i=Se(vt(typeof localStorage<"u"?localStorage.getItem(l)!=="true":!0));function v(){h(i,!e(i)),localStorage.setItem(l,e(i)?"false":"true")}const P=Pe(()=>{const T=[],W=t.entityId.toLowerCase();for(const x of Nt.repos)for(const L of x.entities)if(!(L.id===t.entityId&&L.repo===t.entityRepo)){for(const he of L.wikilinks)if(he.replace(/\[\[|\]\]/g,"").trim().toLowerCase()===W){T.push(L);break}}return T});function R(T){Qt(`/${T.repo}/${T.entityType}/${T.id}`)}var A=He(),S=we(A);{var u=T=>{var W=mr(),x=y(W),L=y(x);let he;var B=y(L);ka(B,{size:14}),c(L);var ie=M(L,4),Ae=y(ie,!0);c(ie),c(x);var X=M(x,2);{var ee=I=>{var te=_r();qe(te,21,()=>e(P),Be,(w,k)=>{const a=Pe(()=>na(e(k).entityType));var n=pr(),o=y(n);let p;var C=M(o,2),N=y(C,!0);c(C);var _e=M(C,2),Re=y(_e,!0);c(_e),c(n),re(E=>{p=ot(o,"",p,{background:e(a)}),se(N,e(k).title),se(Re,E)},[()=>jt(e(k).entityType)]),Fe("click",n,()=>R(e(k))),f(w,n)}),c(te),f(I,te)};ve(X,I=>{e(i)||I(ee)})}c(W),re(()=>{he=xt(L,1,"header-chevron svelte-16xienp",null,he,{collapsed:e(i)}),se(Ae,e(P).length)}),Fe("mousedown",x,I=>I.preventDefault()),Fe("click",x,v),f(T,W)};ve(S,T=>{e(P).length>0&&T(u)})}f(Y,A),ft()}ua(["mousedown","click"]);var yr=O('<div class="remote-cursor svelte-ok7wy5"><span class="remote-cursor-label svelte-ok7wy5"> </span></div>'),wr=O('<div class="cursor-overlay svelte-ok7wy5"></div>'),kr=O('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div> <!></div>');function br(Y,t){dt(t,!0);let l=Qe(t,"readonly",3,!0),i=Qe(t,"resetKey",3,0);const v=Ga("theme");let P,R=null,A=null,S=Se(""),u=null,T=Se(vt([])),W=null,x=t.content;function L(ee,I){return ee.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:I?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:I?"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:I})}async function he(){R&&(R.destroy(),R=null),A&&(A.destroy(),A=null),h(T,[],!0);const{EditorState:ee,Transaction:I}=await tt(async()=>{const{EditorState:b,Transaction:K}=await import("../chunks/CX_61fY8.js");return{EditorState:b,Transaction:K}},[],import.meta.url);u=I;const{EditorView:te,keymap:w,ViewPlugin:k}=await tt(async()=>{const{EditorView:b,keymap:K,ViewPlugin:fe}=await import("../chunks/DnL9f0lc.js").then(G=>G.i);return{EditorView:b,keymap:K,ViewPlugin:fe}},__vite__mapDeps([0,1]),import.meta.url),{markdown:a}=await tt(async()=>{const{markdown:b}=await import("../chunks/CscoF-YL.js");return{markdown:b}},__vite__mapDeps([2,1,0,3,4,5]),import.meta.url),{syntaxHighlighting:n,HighlightStyle:o}=await tt(async()=>{const{syntaxHighlighting:b,HighlightStyle:K}=await import("../chunks/D7ZqAKi9.js");return{syntaxHighlighting:b,HighlightStyle:K}},__vite__mapDeps([3,4,1,0]),import.meta.url),{history:p,defaultKeymap:C,historyKeymap:N}=await tt(async()=>{const{history:b,defaultKeymap:K,historyKeymap:fe}=await import("../chunks/CWQRQXxy.js");return{history:b,defaultKeymap:K,historyKeymap:fe}},__vite__mapDeps([6,1,0,3,4]),import.meta.url),{tags:_e}=await tt(async()=>{const{tags:b}=await import("../chunks/C7VoTosa.js").then(K=>K.i);return{tags:b}},[],import.meta.url),{livePreviewPlugin:Re,livePreviewTheme:E}=await tt(async()=>{const{livePreviewPlugin:b,livePreviewTheme:K}=await import("../chunks/B340SUKR.js");return{livePreviewPlugin:b,livePreviewTheme:K}},__vite__mapDeps([7,0,1,3,4]),import.meta.url),_=v.current==="dark",m=L(te,_),D=o.define([{tag:_e.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),oe=[a(),m,n(D),Re,E,te.lineWrapping];l()&&oe.push(ee.readOnly.of(!0));let j=!1;if(t.cursorDocName&&!l())try{let r=function(){if(!R||!F){h(T,[],!0);return}const U=F.awareness,ae=F.ytext,q=ae.doc;if(!q){h(T,[],!0);return}const s=[],V=R.dom.getBoundingClientRect();U.getStates().forEach((z,$)=>{if($===d)return;const Ee=z.cursor;if(!Ee?.head)return;const{name:me="Anonymous",color:Me="#e05050"}=z.user||{};let Ie;try{Ie=Q.createRelativePositionFromJSON(Ee.head)}catch{return}const Te=Q.createAbsolutePositionFromRelativePosition(Ie,q);if(!Te||Te.type!==ae)return;const ze=R.coordsAtPos(Math.min(Te.index,R.state.doc.length));ze&&s.push({id:$,name:me,color:Me,top:ze.top-V.top,left:ze.left-V.left,height:ze.bottom-ze.top})}),h(T,s,!0)},g=function(){W&&cancelAnimationFrame(W),W=requestAnimationFrame(()=>{W=null,r()})},Z=function({added:U,updated:ae,removed:q}){[...U,...ae,...q].some(V=>V!==d)&&g()};const{createCollabSession:b}=await tt(async()=>{const{createCollabSession:U}=await import("../chunks/C9RtA91n.js");return{createCollabSession:U}},__vite__mapDeps([8,9,10,11,12,13,14,15,16,17,18]),import.meta.url),{ySync:K,ySyncFacet:fe,YSyncConfig:G,yUndoManagerKeymap:ce}=await tt(async()=>{const{ySync:U,ySyncFacet:ae,YSyncConfig:q,yUndoManagerKeymap:s}=await import("../chunks/i9c_RUF6.js");return{ySync:U,ySyncFacet:ae,YSyncConfig:q,yUndoManagerKeymap:s}},__vite__mapDeps([19,9,0,1]),import.meta.url),{auth:H}=await tt(async()=>{const{auth:U}=await import("../chunks/BtBweNkk.js").then(ae=>ae.b);return{auth:U}},__vite__mapDeps([16,12,15]),import.meta.url),Q=await tt(()=>import("../chunks/CLFba8FK.js").then(U=>U.A),[],import.meta.url),ke=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",F=b(t.cursorDocName,{name:H.user?.displayName??"Anonymous",color:ke,colorLight:ke+"33"}),be=new Q.UndoManager(F.ytext,{captureTimeout:500}),{yUndoManagerFacet:ye,yUndoManager:pe,YUndoManagerConfig:xe}=await tt(async()=>{const{yUndoManagerFacet:U,yUndoManager:ae,YUndoManagerConfig:q}=await import("../chunks/i9c_RUF6.js");return{yUndoManagerFacet:U,yUndoManager:ae,YUndoManagerConfig:q}},__vite__mapDeps([19,9,0,1]),import.meta.url),ue=new G(F.ytext,F.awareness);oe.push(fe.of(ue),K,ye.of(new xe(be)),pe,w.of(ce)),oe.push(k.define(U=>{function ae(){const q=U.state.selection.main,s=F.ytext,V=Q.createRelativePositionFromTypeIndex(s,q.anchor),z=Q.createRelativePositionFromTypeIndex(s,q.head);F.awareness.setLocalStateField("cursor",{anchor:Q.relativePositionToJSON(V),head:Q.relativePositionToJSON(z)})}return ae(),{update(q){(q.selectionSet||q.docChanged)&&ae()}}}));const d=F.ydoc.clientID;F.awareness.on("change",Z),oe.push(k.define(()=>({update(U){(U.docChanged||U.geometryChanged||U.viewportChanged)&&g()},destroy(){F.awareness.off("change",Z)}}))),A=F,j=!0}catch(b){console.warn("Yjs collab setup failed, falling back to solo editing:",b)}if(!l()&&!j?(oe.push(p({newGroupDelay:500})),oe.push(w.of([...C,...N]))):!l()&&j&&oe.push(w.of(C)),t.onchange)if(j){const b=Date.now();oe.push(te.updateListener.of(K=>{if(K.docChanged&&Date.now()-b>1e3&&K.transactions.some(G=>G.isUserEvent("input")||G.isUserEvent("delete")||G.isUserEvent("move")||G.isUserEvent("undo")||G.isUserEvent("redo"))){const G=K.state.doc.toString();x=G,t.onchange(G)}}))}else oe.push(te.updateListener.of(b=>{if(b.docChanged){const K=b.state.doc.toString();x=K,t.onchange(K)}}));oe.push(te.domEventHandlers({click(b){const K=b.target;if(t.onwikilinkclick){const G=K.closest(".cm-live-wikilink");if(G){b.preventDefault();const ce=G.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return ce&&t.onwikilinkclick(ce),!0}}const fe=K.closest(".cm-live-link");if(fe){const G=fe.getAttribute("data-href");if(G)return b.preventDefault(),window.open(G,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&oe.push(w.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const J=ee.create({doc:j?"":t.content,extensions:oe});R=new te({state:J,parent:P}),x=j?"":t.content,h(S,t.cursorDocName??"",!0)}Qa(()=>{he()}),bt(()=>{t.cursorDocName&&e(S)&&t.cursorDocName!==e(S)&&he()}),bt(()=>{if(i(),R&&!A&&t.content!==x){x=t.content;const ee=P.closest(".document-scroll"),I=ee?.scrollTop??0;R.dispatch({changes:{from:0,to:R.state.doc.length,insert:t.content},...u?{annotations:u.addToHistory.of(!1)}:{}}),ee&&requestAnimationFrame(()=>{ee.scrollTop=I})}}),Ia(()=>{W&&cancelAnimationFrame(W),A?.destroy(),A=null,R?.destroy()});var B=kr(),ie=y(B);Xt(ie,ee=>P=ee,()=>P);var Ae=M(ie,2);{var X=ee=>{var I=wr();qe(I,21,()=>e(T),te=>te.id,(te,w)=>{var k=yr(),a=y(k),n=y(a,!0);c(a),c(k),re(()=>{ot(k,`top: ${e(w).top??""}px; left: ${e(w).left??""}px; height: ${e(w).height??""}px; --cursor-color: ${e(w).color??""};`),ot(a,`background-color: ${e(w).color??""};`),se(n,e(w).name)}),f(te,k)}),c(I),f(ee,I)};ve(Ae,ee=>{e(T).length>0&&ee(X)})}c(B),f(Y,B),ft()}var oa={exports:{}};var xr=oa.exports,Da;function Cr(){return Da||(Da=1,(function(Y,t){((l,i)=>{Y.exports=i()})(xr,function l(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},v,P=!i.document&&!!i.postMessage,R=i.IS_PAPA_WORKER||!1,A={},S=0,u={};function T(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 o=te(n);o.chunkSize=parseInt(o.chunkSize),n.step||n.chunk||(o.chunkSize=null),this._handle=new B(o),(this._handle.streamer=this)._config=o}).call(this,a),this.parseChunk=function(n,o){var p=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<p){let N=this._config.newline;N||(C=this._config.quoteChar||'"',N=this._handle.guessLineEndings(n,C)),n=[...n.split(N).slice(p)].join(N)}this.isFirstChunk&&k(this._config.beforeFirstChunk)&&(C=this._config.beforeFirstChunk(n))!==void 0&&(n=C),this.isFirstChunk=!1,this._halted=!1;var p=this._partialLine+n,C=(this._partialLine="",this._handle.parse(p,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(n=C.meta.cursor,p=(this._finished||(this._partialLine=p.substring(n-this._baseIndex),this._baseIndex=n),C&&C.data&&(this._rowCount+=C.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),R)i.postMessage({results:C,workerId:u.WORKER_ID,finished:p});else if(k(this._config.chunk)&&!o){if(this._config.chunk(C,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=C=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(C.data),this._completeResults.errors=this._completeResults.errors.concat(C.errors),this._completeResults.meta=C.meta),this._completed||!p||!k(this._config.complete)||C&&C.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),p||C&&C.meta.paused||this._nextChunk(),C}this._halted=!0},this._sendError=function(n){k(this._config.error)?this._config.error(n):R&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:n,finished:!1})}}function W(a){var n;(a=a||{}).chunkSize||(a.chunkSize=u.RemoteChunkSize),T.call(this,a),this._nextChunk=P?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(o){this._input=o,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(n=new XMLHttpRequest,this._config.withCredentials&&(n.withCredentials=this._config.withCredentials),P||(n.onload=w(this._chunkLoaded,this),n.onerror=w(this._chunkError,this)),n.open(this._config.downloadRequestBody?"POST":"GET",this._input,!P),this._config.downloadRequestHeaders){var o,p=this._config.downloadRequestHeaders;for(o in p)n.setRequestHeader(o,p[o])}var C;this._config.chunkSize&&(C=this._start+this._config.chunkSize-1,n.setRequestHeader("Range","bytes="+this._start+"-"+C));try{n.send(this._config.downloadRequestBody)}catch(N){this._chunkError(N.message)}P&&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>=(o=>(o=o.getResponseHeader("Content-Range"))!==null?parseInt(o.substring(o.lastIndexOf("/")+1)):-1)(n),this.parseChunk(n.responseText)))},this._chunkError=function(o){o=n.statusText||o,this._sendError(new Error(o))}}function x(a){(a=a||{}).chunkSize||(a.chunkSize=u.LocalChunkSize),T.call(this,a);var n,o,p=typeof FileReader<"u";this.stream=function(C){this._input=C,o=C.slice||C.webkitSlice||C.mozSlice,p?((n=new FileReader).onload=w(this._chunkLoaded,this),n.onerror=w(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 C=this._input,N=(this._config.chunkSize&&(N=Math.min(this._start+this._config.chunkSize,this._input.size),C=o.call(C,this._start,N)),n.readAsText(C,this._config.encoding));p||this._chunkLoaded({target:{result:N}})},this._chunkLoaded=function(C){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(C.target.result)},this._chunkError=function(){this._sendError(n.error)}}function L(a){var n;T.call(this,a=a||{}),this.stream=function(o){return n=o,this._nextChunk()},this._nextChunk=function(){var o,p;if(!this._finished)return o=this._config.chunkSize,n=o?(p=n.substring(0,o),n.substring(o)):(p=n,""),this._finished=!n,this.parseChunk(p)}}function he(a){T.call(this,a=a||{});var n=[],o=!0,p=!1;this.pause=function(){T.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){T.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(C){this._input=C,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){p&&n.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),n.length?this.parseChunk(n.shift()):o=!0},this._streamData=w(function(C){try{n.push(typeof C=="string"?C:C.toString(this._config.encoding)),o&&(o=!1,this._checkIsFinished(),this.parseChunk(n.shift()))}catch(N){this._streamError(N)}},this),this._streamError=w(function(C){this._streamCleanUp(),this._sendError(C)},this),this._streamEnd=w(function(){this._streamCleanUp(),p=!0,this._streamData("")},this),this._streamCleanUp=w(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function B(a){var n,o,p,C,N=Math.pow(2,53),_e=-N,Re=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,E=/^((\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)))$/,_=this,m=0,D=0,oe=!1,j=!1,J=[],b={data:[],errors:[],meta:{}};function K(H){return a.skipEmptyLines==="greedy"?H.join("").trim()==="":H.length===1&&H[0].length===0}function fe(){if(b&&p&&(ce("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),p=!1),a.skipEmptyLines&&(b.data=b.data.filter(function(F){return!K(F)})),G()){let F=function(be,ye){k(a.transformHeader)&&(be=a.transformHeader(be,ye)),J.push(be)};if(b)if(Array.isArray(b.data[0])){for(var H=0;G()&&H<b.data.length;H++)b.data[H].forEach(F);b.data.splice(0,1)}else b.data.forEach(F)}function Q(F,be){for(var ye=a.header?{}:[],pe=0;pe<F.length;pe++){var xe=pe,ue=F[pe],ue=((d,r)=>(g=>(a.dynamicTypingFunction&&a.dynamicTyping[g]===void 0&&(a.dynamicTyping[g]=a.dynamicTypingFunction(g)),(a.dynamicTyping[g]||a.dynamicTyping)===!0))(d)?r==="true"||r==="TRUE"||r!=="false"&&r!=="FALSE"&&((g=>{if(Re.test(g)&&(g=parseFloat(g),_e<g&&g<N))return 1})(r)?parseFloat(r):E.test(r)?new Date(r):r===""?null:r):r)(xe=a.header?pe>=J.length?"__parsed_extra":J[pe]:xe,ue=a.transform?a.transform(ue,xe):ue);xe==="__parsed_extra"?(ye[xe]=ye[xe]||[],ye[xe].push(ue)):ye[xe]=ue}return a.header&&(pe>J.length?ce("FieldMismatch","TooManyFields","Too many fields: expected "+J.length+" fields but parsed "+pe,D+be):pe<J.length&&ce("FieldMismatch","TooFewFields","Too few fields: expected "+J.length+" fields but parsed "+pe,D+be)),ye}var ke;b&&(a.header||a.dynamicTyping||a.transform)&&(ke=1,!b.data.length||Array.isArray(b.data[0])?(b.data=b.data.map(Q),ke=b.data.length):b.data=Q(b.data,0),a.header&&b.meta&&(b.meta.fields=J),D+=ke)}function G(){return a.header&&J.length===0}function ce(H,Q,ke,F){H={type:H,code:Q,message:ke},F!==void 0&&(H.row=F),b.errors.push(H)}k(a.step)&&(C=a.step,a.step=function(H){b=H,G()?fe():(fe(),b.data.length!==0&&(m+=H.data.length,a.preview&&m>a.preview?o.abort():(b.data=b.data[0],C(b,_))))}),this.parse=function(H,Q,ke){var F=a.quoteChar||'"',F=(a.newline||(a.newline=this.guessLineEndings(H,F)),p=!1,a.delimiter?k(a.delimiter)&&(a.delimiter=a.delimiter(H),b.meta.delimiter=a.delimiter):((F=((be,ye,pe,xe,ue)=>{var d,r,g,Z;ue=ue||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var U=0;U<ue.length;U++){for(var ae,q=ue[U],s=0,V=0,z=0,$=(g=void 0,new Ae({comments:xe,delimiter:q,newline:ye,preview:10}).parse(be)),Ee=0;Ee<$.data.length;Ee++)pe&&K($.data[Ee])?z++:(ae=$.data[Ee].length,V+=ae,g===void 0?g=ae:0<ae&&(s+=Math.abs(ae-g),g=ae));0<$.data.length&&(V/=$.data.length-z),(r===void 0||s<=r)&&(Z===void 0||Z<V)&&1.99<V&&(r=s,d=q,Z=V)}return{successful:!!(a.delimiter=d),bestDelimiter:d}})(H,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=F.bestDelimiter:(p=!0,a.delimiter=u.DefaultDelimiter),b.meta.delimiter=a.delimiter),te(a));return a.preview&&a.header&&F.preview++,n=H,o=new Ae(F),b=o.parse(n,Q,ke),fe(),oe?{meta:{paused:!0}}:b||{meta:{paused:!1}}},this.paused=function(){return oe},this.pause=function(){oe=!0,o.abort(),n=k(a.chunk)?"":n.substring(o.getCharIndex())},this.resume=function(){_.streamer._halted?(oe=!1,_.streamer.parseChunk(n,!0)):setTimeout(_.resume,3)},this.aborted=function(){return j},this.abort=function(){j=!0,o.abort(),b.meta.aborted=!0,k(a.complete)&&a.complete(b),n=""},this.guessLineEndings=function(be,F){be=be.substring(0,1048576);var F=new RegExp(ie(F)+"([^]*?)"+ie(F),"gm"),ke=(be=be.replace(F,"")).split("\r"),F=be.split(`
|
|
3
|
+
`),be=1<F.length&&F[0].length<ke[0].length;if(ke.length===1||be)return`
|
|
4
|
+
`;for(var ye=0,pe=0;pe<ke.length;pe++)ke[pe][0]===`
|
|
5
|
+
`&&ye++;return ye>=ke.length/2?`\r
|
|
6
|
+
`:"\r"}}function ie(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ae(a){var n=(a=a||{}).delimiter,o=a.newline,p=a.comments,C=a.step,N=a.preview,_e=a.fastMode,Re=null,E=!1,_=a.quoteChar==null?'"':a.quoteChar,m=_;if(a.escapeChar!==void 0&&(m=a.escapeChar),(typeof n!="string"||-1<u.BAD_DELIMITERS.indexOf(n))&&(n=","),p===n)throw new Error("Comment character same as delimiter");p===!0?p="#":(typeof p!="string"||-1<u.BAD_DELIMITERS.indexOf(p))&&(p=!1),o!==`
|
|
7
|
+
`&&o!=="\r"&&o!==`\r
|
|
8
|
+
`&&(o=`
|
|
9
|
+
`);var D=0,oe=!1;this.parse=function(j,J,b){if(typeof j!="string")throw new Error("Input must be a string");var K=j.length,fe=n.length,G=o.length,ce=p.length,H=k(C),Q=[],ke=[],F=[],be=D=0;if(!j)return s();if(_e||_e!==!1&&j.indexOf(_)===-1){for(var ye=j.split(o),pe=0;pe<ye.length;pe++){if(F=ye[pe],D+=F.length,pe!==ye.length-1)D+=o.length;else if(b)return s();if(!p||F.substring(0,ce)!==p){if(H){if(Q=[],Z(F.split(n)),V(),oe)return s()}else Z(F.split(n));if(N&&N<=pe)return Q=Q.slice(0,N),s(!0)}}return s()}for(var xe=j.indexOf(n,D),ue=j.indexOf(o,D),d=new RegExp(ie(m)+ie(_),"g"),r=j.indexOf(_,D);;)if(j[D]===_)for(r=D,D++;;){if((r=j.indexOf(_,r+1))===-1)return b||ke.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Q.length,index:D}),ae();if(r===K-1)return ae(j.substring(D,r).replace(d,_));if(_===m&&j[r+1]===m)r++;else if(_===m||r===0||j[r-1]!==m){xe!==-1&&xe<r+1&&(xe=j.indexOf(n,r+1));var g=U((ue=ue!==-1&&ue<r+1?j.indexOf(o,r+1):ue)===-1?xe:Math.min(xe,ue));if(j.substr(r+1+g,fe)===n){F.push(j.substring(D,r).replace(d,_)),j[D=r+1+g+fe]!==_&&(r=j.indexOf(_,D)),xe=j.indexOf(n,D),ue=j.indexOf(o,D);break}if(g=U(ue),j.substring(r+1+g,r+1+g+G)===o){if(F.push(j.substring(D,r).replace(d,_)),q(r+1+g+G),xe=j.indexOf(n,D),r=j.indexOf(_,D),H&&(V(),oe))return s();if(N&&Q.length>=N)return s(!0);break}ke.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Q.length,index:D}),r++}}else if(p&&F.length===0&&j.substring(D,D+ce)===p){if(ue===-1)return s();D=ue+G,ue=j.indexOf(o,D),xe=j.indexOf(n,D)}else if(xe!==-1&&(xe<ue||ue===-1))F.push(j.substring(D,xe)),D=xe+fe,xe=j.indexOf(n,D);else{if(ue===-1)break;if(F.push(j.substring(D,ue)),q(ue+G),H&&(V(),oe))return s();if(N&&Q.length>=N)return s(!0)}return ae();function Z(z){Q.push(z),be=D}function U(z){var $=0;return $=z!==-1&&(z=j.substring(r+1,z))&&z.trim()===""?z.length:$}function ae(z){return b||(z===void 0&&(z=j.substring(D)),F.push(z),D=K,Z(F),H&&V()),s()}function q(z){D=z,Z(F),F=[],ue=j.indexOf(o,D)}function s(z){if(a.header&&!J&&Q.length&&!E){var $=Q[0],Ee=Object.create(null),me=new Set($);let Me=!1;for(let Ie=0;Ie<$.length;Ie++){let Te=$[Ie];if(Ee[Te=k(a.transformHeader)?a.transformHeader(Te,Ie):Te]){let ze,Xe=Ee[Te];for(;ze=Te+"_"+Xe,Xe++,me.has(ze););me.add(ze),$[Ie]=ze,Ee[Te]++,Me=!0,(Re=Re===null?{}:Re)[ze]=Te}else Ee[Te]=1,$[Ie]=Te;me.add(Te)}Me&&console.warn("Duplicate headers found and renamed."),E=!0}return{data:Q,errors:ke,meta:{delimiter:n,linebreak:o,aborted:oe,truncated:!!z,cursor:be+(J||0),renamedHeaders:Re}}}function V(){C(s()),Q=[],ke=[]}},this.abort=function(){oe=!0},this.getCharIndex=function(){return D}}function X(a){var n=a.data,o=A[n.workerId],p=!1;if(n.error)o.userError(n.error,n.file);else if(n.results&&n.results.data){var C={abort:function(){p=!0,ee(n.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:I,resume:I};if(k(o.userStep)){for(var N=0;N<n.results.data.length&&(o.userStep({data:n.results.data[N],errors:n.results.errors,meta:n.results.meta},C),!p);N++);delete n.results}else k(o.userChunk)&&(o.userChunk(n.results,C,n.file),delete n.results)}n.finished&&!p&&ee(n.workerId,n.results)}function ee(a,n){var o=A[a];k(o.userComplete)&&o.userComplete(n),o.terminate(),delete A[a]}function I(){throw new Error("Not implemented.")}function te(a){if(typeof a!="object"||a===null)return a;var n,o=Array.isArray(a)?[]:{};for(n in a)o[n]=te(a[n]);return o}function w(a,n){return function(){a.apply(n,arguments)}}function k(a){return typeof a=="function"}return u.parse=function(a,n){var o=(n=n||{}).dynamicTyping||!1;if(k(o)&&(n.dynamicTypingFunction=o,o={}),n.dynamicTyping=o,n.transform=!!k(n.transform)&&n.transform,!n.worker||!u.WORKERS_SUPPORTED)return o=null,u.NODE_STREAM_INPUT,typeof a=="string"?(a=(p=>p.charCodeAt(0)!==65279?p:p.slice(1))(a),o=new(n.download?W:L)(n)):a.readable===!0&&k(a.read)&&k(a.on)?o=new he(n):(i.File&&a instanceof File||a instanceof Object)&&(o=new x(n)),o.stream(a);(o=(()=>{var p;return!!u.WORKERS_SUPPORTED&&(p=(()=>{var C=i.URL||i.webkitURL||null,N=l.toString();return u.BLOB_URL||(u.BLOB_URL=C.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; ","(",N,")();"],{type:"text/javascript"})))})(),(p=new i.Worker(p)).onmessage=X,p.id=S++,A[p.id]=p)})()).userStep=n.step,o.userChunk=n.chunk,o.userComplete=n.complete,o.userError=n.error,n.step=k(n.step),n.chunk=k(n.chunk),n.complete=k(n.complete),n.error=k(n.error),delete n.worker,o.postMessage({input:a,config:n,workerId:o.id})},u.unparse=function(a,n){var o=!1,p=!0,C=",",N=`\r
|
|
10
|
+
`,_e='"',Re=_e+_e,E=!1,_=null,m=!1,D=((()=>{if(typeof n=="object"){if(typeof n.delimiter!="string"||u.BAD_DELIMITERS.filter(function(J){return n.delimiter.indexOf(J)!==-1}).length||(C=n.delimiter),typeof n.quotes!="boolean"&&typeof n.quotes!="function"&&!Array.isArray(n.quotes)||(o=n.quotes),typeof n.skipEmptyLines!="boolean"&&typeof n.skipEmptyLines!="string"||(E=n.skipEmptyLines),typeof n.newline=="string"&&(N=n.newline),typeof n.quoteChar=="string"&&(_e=n.quoteChar),typeof n.header=="boolean"&&(p=n.header),Array.isArray(n.columns)){if(n.columns.length===0)throw new Error("Option columns is empty");_=n.columns}n.escapeChar!==void 0&&(Re=n.escapeChar+_e),n.escapeFormulae instanceof RegExp?m=n.escapeFormulae:typeof n.escapeFormulae=="boolean"&&n.escapeFormulae&&(m=/^[=+\-@\t\r].*$/)}})(),new RegExp(ie(_e),"g"));if(typeof a=="string"&&(a=JSON.parse(a)),Array.isArray(a)){if(!a.length||Array.isArray(a[0]))return oe(null,a,E);if(typeof a[0]=="object")return oe(_||Object.keys(a[0]),a,E)}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||_),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])),oe(a.fields||[],a.data||[],E);throw new Error("Unable to serialize unrecognized input");function oe(J,b,K){var fe="",G=(typeof J=="string"&&(J=JSON.parse(J)),typeof b=="string"&&(b=JSON.parse(b)),Array.isArray(J)&&0<J.length),ce=!Array.isArray(b[0]);if(G&&p){for(var H=0;H<J.length;H++)0<H&&(fe+=C),fe+=j(J[H],H);0<b.length&&(fe+=N)}for(var Q=0;Q<b.length;Q++){var ke=(G?J:b[Q]).length,F=!1,be=G?Object.keys(b[Q]).length===0:b[Q].length===0;if(K&&!G&&(F=K==="greedy"?b[Q].join("").trim()==="":b[Q].length===1&&b[Q][0].length===0),K==="greedy"&&G){for(var ye=[],pe=0;pe<ke;pe++){var xe=ce?J[pe]:pe;ye.push(b[Q][xe])}F=ye.join("").trim()===""}if(!F){for(var ue=0;ue<ke;ue++){0<ue&&!be&&(fe+=C);var d=G&&ce?J[ue]:ue;fe+=j(b[Q][d],ue)}Q<b.length-1&&(!K||0<ke&&!be)&&(fe+=N)}}return fe}function j(J,b){var K,fe;return J==null?"":J.constructor===Date?JSON.stringify(J).slice(1,25):(fe=!1,m&&typeof J=="string"&&m.test(J)&&(J="'"+J,fe=!0),K=J.toString().replace(D,Re),(fe=fe||o===!0||typeof o=="function"&&o(J,b)||Array.isArray(o)&&o[b]||((G,ce)=>{for(var H=0;H<ce.length;H++)if(-1<G.indexOf(ce[H]))return!0;return!1})(K,u.BAD_DELIMITERS)||-1<K.indexOf(C)||K.charAt(0)===" "||K.charAt(K.length-1)===" ")?_e+K+_e:K)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
|
|
11
|
+
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!P&&!!i.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=Ae,u.ParserHandle=B,u.NetworkStreamer=W,u.FileStreamer=x,u.StringStreamer=L,u.ReadableStreamStreamer=he,i.jQuery&&((v=i.jQuery).fn.parse=function(a){var n=a.config||{},o=[];return this.each(function(N){if(!(v(this).prop("tagName").toUpperCase()==="INPUT"&&v(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var _e=0;_e<this.files.length;_e++)o.push({file:this.files[_e],inputElem:this,instanceConfig:v.extend({},n)})}),p(),this;function p(){if(o.length===0)k(a.complete)&&a.complete();else{var N,_e,Re,E,_=o[0];if(k(a.before)){var m=a.before(_.file,_.inputElem);if(typeof m=="object"){if(m.action==="abort")return N="AbortError",_e=_.file,Re=_.inputElem,E=m.reason,void(k(a.error)&&a.error({name:N},_e,Re,E));if(m.action==="skip")return void C();typeof m.config=="object"&&(_.instanceConfig=v.extend(_.instanceConfig,m.config))}else if(m==="skip")return void C()}var D=_.instanceConfig.complete;_.instanceConfig.complete=function(oe){k(D)&&D(oe,_.file,_.inputElem),C()},u.parse(_.file,_.instanceConfig)}}function C(){o.splice(0,1),p()}}),R&&(i.onmessage=function(a){a=a.data,u.WORKER_ID===void 0&&a&&(u.WORKER_ID=a.workerId),typeof a.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(a.input,a.config),finished:!0}):(i.File&&a.input instanceof File||a.input instanceof Object)&&(a=u.parse(a.input,a.config))&&i.postMessage({workerId:u.WORKER_ID,results:a,finished:!0})}),(W.prototype=Object.create(T.prototype)).constructor=W,(x.prototype=Object.create(T.prototype)).constructor=x,(L.prototype=Object.create(L.prototype)).constructor=L,(he.prototype=Object.create(T.prototype)).constructor=he,u})})(oa)),oa.exports}var Er=Cr();const Oa=vn(Er);var Sr=O('<span class="remote-cell-label svelte-63hltt"> </span>'),Pr=O('<th><!> <input class="cell-input header-input svelte-63hltt"/> <!></th>'),Ar=O('<span class="remote-cell-label svelte-63hltt"> </span>'),Rr=O('<td><!> <input class="cell-input svelte-63hltt"/></td>'),Tr=O('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),Dr=O("<!> <span>Add row</span>",1),Or=O('<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 Lr(Y,t){dt(t,!0);let l=Qe(t,"remoteCursors",19,()=>[]),i=Se(vt([])),v=Se(vt([])),P=Se(void 0);function R(E){const _=Oa.parse(E.trim(),{header:!1,skipEmptyLines:!0});_.data.length>0?(h(i,_.data[0],!0),h(v,_.data.slice(1),!0)):(h(i,[],!0),h(v,[],!0))}R(t.content),bt(()=>{R(t.content)});function A(){return Oa.unparse([e(i),...e(v)])}function S(){const E=A();t.onchange?.(E)}function u(E,_,m){e(v)[E][_]=m,h(v,[...e(v)],!0),S()}function T(E,_){e(i)[E]=_,h(i,[...e(i)],!0),S()}function W(){h(v,[...e(v),e(i).map(()=>"")],!0),S(),B(e(v).length-1,0)}function x(E){h(v,e(v).filter((_,m)=>m!==E),!0),S()}function L(){const E=`col${e(i).length+1}`;h(i,[...e(i),E],!0),h(v,e(v).map(_=>[..._,""]),!0),S(),requestAnimationFrame(()=>{const _=e(P)?.querySelector(`thead th:nth-child(${e(i).length+1}) input`);_&&(_.focus(),_.select())})}function he(E){e(i).length<=1||(h(i,e(i).filter((_,m)=>m!==E),!0),h(v,e(v).map(_=>_.filter((m,D)=>D!==E)),!0),S())}function B(E,_){requestAnimationFrame(()=>{if(!e(P))return;let m=null;E<0?m=e(P).querySelector(`thead th:nth-child(${_+2}) input`):m=e(P).querySelector(`tbody tr:nth-child(${E+1}) td:nth-child(${_+2}) input`),m&&(m.focus(),m.select())})}function ie(E,_,m){if(E.key==="Tab"){E.preventDefault(),E.shiftKey?m>0?B(_,m-1):_>0?B(_-1,e(i).length-1):_===0&&B(-1,e(i).length-1):m<e(i).length-1?B(_,m+1):_<e(v).length-1?B(_+1,0):_===e(v).length-1&&W();return}if(E.key==="Enter"){E.preventDefault(),E.shiftKey?_>0?B(_-1,m):B(-1,m):_<e(v).length-1?B(_+1,m):W();return}if(E.key==="Escape"){E.target.blur();return}}function Ae(E,_){if(E.key==="Tab"){E.preventDefault(),E.shiftKey?_>0&&B(-1,_-1):_<e(i).length-1?B(-1,_+1):e(v).length>0&&B(0,0);return}if(E.key==="Enter"){E.preventDefault(),e(v).length>0?B(0,_):W();return}if(E.key==="Escape"){E.target.blur();return}}function X(E,_){return l().find(m=>m.row===E&&m.col===_)}function ee(E,_){t.oncellselect?.(E,_)}function I(E){(E.metaKey||E.ctrlKey)&&E.key==="s"&&(E.preventDefault(),t.onsave?.())}var te=Or(),w=y(te),k=y(w),a=y(k),n=y(a),o=M(y(n));qe(o,17,()=>e(i),Be,(E,_,m)=>{const D=Pe(()=>X(-1,m));var oe=Pr();let j;var J=y(oe);{var b=ce=>{var H=Sr(),Q=y(H,!0);c(H),re(()=>{ot(H,`background-color: ${e(D).color??""}`),se(Q,e(D).name)}),f(ce,H)};ve(J,ce=>{e(D)&&ce(b)})}var K=M(J,2);qt(K);var fe=M(K,2);{var G=ce=>{Ge(ce,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>he(m),children:(H,Q)=>{Aa(H,{size:12})},$$slots:{default:!0}})};ve(fe,ce=>{e(i).length>1&&ce(G)})}c(oe),re(()=>{ot(oe,e(D)?`--rc-color: ${e(D).color}`:""),j=xt(oe,1,"svelte-63hltt",null,j,{"remote-active":!!e(D)}),la(K,e(_))}),Fe("input",K,ce=>T(m,ce.currentTarget.value)),Fe("keydown",K,ce=>Ae(ce,m)),it("focus",K,()=>ee(-1,m)),f(E,oe)});var p=M(o),C=y(p);Ge(C,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:L,children:(E,_)=>{wa(E,{size:14})},$$slots:{default:!0}}),c(p),c(n),c(a);var N=M(a);qe(N,21,()=>e(v),Be,(E,_,m)=>{var D=Tr(),oe=y(D);oe.textContent=m+1;var j=M(oe);qe(j,17,()=>e(_),Be,(K,fe,G)=>{const ce=Pe(()=>X(m,G));var H=Rr();let Q;var ke=y(H);{var F=ye=>{var pe=Ar(),xe=y(pe,!0);c(pe),re(()=>{ot(pe,`background-color: ${e(ce).color??""}`),se(xe,e(ce).name)}),f(ye,pe)};ve(ke,ye=>{e(ce)&&ye(F)})}var be=M(ke,2);qt(be),c(H),re(()=>{ot(H,e(ce)?`--rc-color: ${e(ce).color}`:""),Q=xt(H,1,"svelte-63hltt",null,Q,{"remote-active":!!e(ce)}),la(be,e(fe))}),Fe("input",be,ye=>u(m,G,ye.currentTarget.value)),Fe("keydown",be,ye=>ie(ye,m,G)),it("focus",be,()=>ee(m,G)),f(K,H)});var J=M(j),b=y(J);Ge(b,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>x(m),children:(K,fe)=>{Aa(K,{size:12})},$$slots:{default:!0}}),c(J),c(D),f(E,D)}),c(N),c(k),Xt(k,E=>h(P,E),()=>e(P)),c(w);var _e=M(w,2),Re=y(_e);Ge(Re,{variant:"ghost",class:"add-row-btn",onclick:W,children:(E,_)=>{var m=Dr(),D=we(m);wa(D,{size:14}),Ye(2),f(E,m)},$$slots:{default:!0}}),c(_e),c(te),Fe("keydown",te,I),f(Y,te),ft()}ua(["keydown","input"]);const zr=/^\d{4}-\d{2}-\d{2}/,Fr=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),Mr=new Set(["format"]),Ir=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function jr(Y,t){const l=[];for(const[v,P]of Object.entries(Y)){if(Ir.has(v)||P==null)continue;const R=Kr(v,P);R&&l.push(R)}const i=["entity_type","name","date"];return l.sort((v,P)=>{const R=i.indexOf(v.key),A=i.indexOf(P.key);return R!==-1&&A!==-1?R-A:R!==-1?-1:A!==-1?1:v.key.localeCompare(P.key)}),l}function Kr(Y,t){if(Y==="entity_type")return{key:Y,value:String(t),type:"entity-type"};if(Mr.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 A=t.map(S=>Object.entries(S).map(([T,W])=>`${T}: ${W}`).join(", "));return{key:Y,value:A.join(" | "),type:"text"}}const v=t.map(String),P=v.some(A=>/^\[\[.+?\]\]$/.test(A)),R=v.map(A=>{const S=A.match(/^\[\[(.+?)\]\]$/);return S?S[1]:A});return P||R.every(A=>La(A))?{key:Y,value:R,type:"wikilink"}:{key:Y,value:v.join(", "),type:"text"}}const l=String(t),i=l.match(/^\[\[(.+?)\]\]$/);return i?{key:Y,value:i[1],type:"wikilink"}:zr.test(l)?{key:Y,value:l,type:"date"}:Fr.has(l.toLowerCase())?{key:Y,value:l,type:"status"}:La(l)&&!l.includes(" ")?{key:Y,value:l,type:"wikilink"}:{key:Y,value:l,type:"text"}}function La(Y){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(Y)&&Y.includes("-")}var Ur=Tt("<title> </title>"),Nr=Tt('<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 za(Y,t){const l=Rt(t,["children","$$slots","$$events","$$legacy"]),i=Rt(l,["size","title"]);dt(t,!1);const v=At(),P=At();let R=Qe(t,"size",8,16),A=Qe(t,"title",8,void 0);Pt(()=>(lt(l),lt(A())),()=>{h(v,l["aria-label"]||l["aria-labelledby"]||A())}),Pt(()=>(e(v),lt(l)),()=>{h(P,{"aria-hidden":e(v)?void 0:!0,role:e(v)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),ca(),fa();var S=Nr();da(S,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:R(),height:R(),...e(P),...i}));var u=y(S);{var T=W=>{var x=Ur(),L=y(x,!0);c(x),re(()=>se(L,A())),f(W,x)};ve(u,W=>{A()&&W(T)})}Ye(),c(S),f(Y,S),ft()}class qr{diff(t,l,i={}){let v;typeof i=="function"?(v=i,i={}):"callback"in i&&(v=i.callback);const P=this.castInput(t,i),R=this.castInput(l,i),A=this.removeEmpty(this.tokenize(P,i)),S=this.removeEmpty(this.tokenize(R,i));return this.diffWithOptionsObj(A,S,i,v)}diffWithOptionsObj(t,l,i,v){var P;const R=X=>{if(X=this.postProcess(X,i),v){setTimeout(function(){v(X)},0);return}else return X},A=l.length,S=t.length;let u=1,T=A+S;i.maxEditLength!=null&&(T=Math.min(T,i.maxEditLength));const W=(P=i.timeout)!==null&&P!==void 0?P:1/0,x=Date.now()+W,L=[{oldPos:-1,lastComponent:void 0}];let he=this.extractCommon(L[0],l,t,0,i);if(L[0].oldPos+1>=S&&he+1>=A)return R(this.buildValues(L[0].lastComponent,l,t));let B=-1/0,ie=1/0;const Ae=()=>{for(let X=Math.max(B,-u);X<=Math.min(ie,u);X+=2){let ee;const I=L[X-1],te=L[X+1];I&&(L[X-1]=void 0);let w=!1;if(te){const a=te.oldPos-X;w=te&&0<=a&&a<A}const k=I&&I.oldPos+1<S;if(!w&&!k){L[X]=void 0;continue}if(!k||w&&I.oldPos<te.oldPos?ee=this.addToPath(te,!0,!1,0,i):ee=this.addToPath(I,!1,!0,1,i),he=this.extractCommon(ee,l,t,X,i),ee.oldPos+1>=S&&he+1>=A)return R(this.buildValues(ee.lastComponent,l,t))||!0;L[X]=ee,ee.oldPos+1>=S&&(ie=Math.min(ie,X-1)),he+1>=A&&(B=Math.max(B,X+1))}u++};if(v)(function X(){setTimeout(function(){if(u>T||Date.now()>x)return v(void 0);Ae()||X()},0)})();else for(;u<=T&&Date.now()<=x;){const X=Ae();if(X)return X}}addToPath(t,l,i,v,P){const R=t.lastComponent;return R&&!P.oneChangePerToken&&R.added===l&&R.removed===i?{oldPos:t.oldPos+v,lastComponent:{count:R.count+1,added:l,removed:i,previousComponent:R.previousComponent}}:{oldPos:t.oldPos+v,lastComponent:{count:1,added:l,removed:i,previousComponent:R}}}extractCommon(t,l,i,v,P){const R=l.length,A=i.length;let S=t.oldPos,u=S-v,T=0;for(;u+1<R&&S+1<A&&this.equals(i[S+1],l[u+1],P);)u++,S++,T++,P.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return T&&!P.oneChangePerToken&&(t.lastComponent={count:T,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=S,u}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 v=[];let P;for(;t;)v.push(t),P=t.previousComponent,delete t.previousComponent,t=P;v.reverse();const R=v.length;let A=0,S=0,u=0;for(;A<R;A++){const T=v[A];if(T.removed)T.value=this.join(i.slice(u,u+T.count)),u+=T.count;else{if(!T.added&&this.useLongestToken){let W=l.slice(S,S+T.count);W=W.map(function(x,L){const he=i[u+L];return he.length>x.length?he:x}),T.value=this.join(W)}else T.value=this.join(l.slice(S,S+T.count));S+=T.count,T.added||(u+=T.count)}}return v}}const Fa="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 Vr extends qr{tokenize(t){const l=new RegExp(`(\\r?\\n)|[${Fa}]+|[^\\S\\n\\r]+|[^${Fa}]`,"ug");return t.match(l)||[]}}const Wr=new Vr;function Hr(Y,t,l){return Wr.diff(Y,t,l)}var Br=O('<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>'),Yr=O('<div class="diff-properties svelte-1g4tvol"></div>'),Zr=O('<span class="db-added"> </span>'),Jr=O('<span class="db-removed"> </span>'),Gr=O("<span> </span>"),Qr=O("<span> </span>"),Xr=O('<div class="diff-view svelte-1g4tvol"><!> <div class="diff-body svelte-1g4tvol"><!></div></div>');function $r(Y,t){dt(t,!0);function l(x){if(x==null)return"";if(typeof x!="object")return String(x);const L=x;return String(L.name??L.title??L.label??L.id??JSON.stringify(L))}function i(x){return x==null?"":Array.isArray(x)?x.map(l).join(", "):typeof x=="object"?l(x):String(x)}const v=Pe(()=>t.refreshResult.body_changed&&t.refreshResult.body_diff?Hr(t.refreshResult.body_diff.old,t.refreshResult.body_diff.new):null);var P=Xr(),R=y(P);{var A=x=>{var L=Yr();qe(L,21,()=>t.refreshResult.diffs,Be,(he,B)=>{const ie=Pe(()=>t.properties.find(m=>m.key===e(B).field));var Ae=Br(),X=y(Ae),ee=y(X);{var I=m=>{aa(m,{size:14})},te=m=>{sa(m,{size:14})},w=m=>{ia(m,{size:14})},k=m=>{Ka(m,{size:14})},a=m=>{ra(m,{size:14})};ve(ee,m=>{e(ie)?.type==="date"?m(I):e(ie)?.type==="status"?m(te,1):e(ie)?.type==="wikilink"?m(w,2):e(ie)?.type==="badge"?m(k,3):m(a,!1)})}c(X);var n=M(X,2),o=y(n,!0);c(n);var p=M(n,2),C=y(p),N=y(C),_e=y(N,!0);c(N),c(C);var Re=M(C,2),E=y(Re),_=y(E,!0);c(E),c(Re),c(p),c(Ae),re((m,D)=>{se(o,e(B).field),se(_e,m),se(_,D)},[()=>i(e(B).old_value),()=>i(e(B).new_value)]),f(he,Ae)}),c(L),f(x,L)};ve(R,x=>{t.refreshResult.diffs.length>0&&x(A)})}var S=M(R,2),u=y(S);{var T=x=>{var L=He(),he=we(L);qe(he,17,()=>e(v),Be,(B,ie)=>{var Ae=He(),X=we(Ae);{var ee=w=>{var k=Zr(),a=y(k,!0);c(k),re(()=>se(a,e(ie).value)),f(w,k)},I=w=>{var k=Jr(),a=y(k,!0);c(k),re(()=>se(a,e(ie).value)),f(w,k)},te=w=>{var k=Gr(),a=y(k,!0);c(k),re(()=>se(a,e(ie).value)),f(w,k)};ve(X,w=>{e(ie).added?w(ee):e(ie).removed?w(I,1):w(te,!1)})}f(B,Ae)}),f(x,L)},W=x=>{var L=Qr(),he=y(L,!0);c(L),re(()=>se(he,t.bodyContent)),f(x,L)};ve(u,x=>{e(v)?x(T):x(W,!1)})}c(S),c(P),f(Y,P),ft()}var es=O("<!> ",1),ts=O('<span class="diff-action-title svelte-udj3er">Changes from source</span> <div class="diff-action-buttons svelte-udj3er"><!> <!></div>',1),as=O('<span class="bc-sep svelte-udj3er">/</span>'),ns=O("<!><span> </span>",1),rs=O('<span class="status-text saving svelte-udj3er">Saving...</span>'),ss=O('<span class="status-text error svelte-udj3er"> </span>'),is=O("<!> ",1),os=O('<div class="breadcrumb-path svelte-udj3er"></div> <div class="editor-actions svelte-udj3er"><!> <!> <!></div>',1),ls=O('<div class="refresh-panel svelte-udj3er"><div class="refresh-uptodate svelte-udj3er">Entity is up to date with source.</div></div>'),us=O('<div class="document-scroll svelte-udj3er"><div class="document-well svelte-udj3er"><!> <!> <!></div></div>'),cs=O("<!> <!>",1),ds=O("<!> <!>",1),fs=O("<!> <div><!></div> <!> <!> <!> <!>",1);function Ns(Y,t){dt(t,!0);const l=()=>$a(an,"$page",i),[i,v]=en(),P=Pe(()=>t.data.type==="dataset"||t.data.entity.document?.frontmatter?.entity_type==="dataset"),R=Pe(()=>Nt.getAppForEntityType(t.data.entity.document?.frontmatter?.entity_type??t.data.type)),A=Pe(()=>()=>{const r=t.data.entity.path;if(r){const g=r.lastIndexOf(`/${t.data.repo}/`);if(g>=0)return r.substring(g+1).split("/")}return[t.data.repo,t.data.id,"main.md"]});let S=Se(""),u=Se(vt({})),T=Se(0);const W=Pe(()=>jr(e(u))),x=new Set(["name","date"]);let L=Se(null);bt(()=>{if(l().url.searchParams.has("new")){h(L,"name");const r=new URL(l().url);r.searchParams.delete("new"),history.replaceState({},"",r.pathname)}else h(L,null)});const he=Pe(()=>!!t.data.entity.data?.source_ref);let B=Se(!1),ie=Se(null),Ae=Se(null);async function X(){if(!e(B)){h(B,!0),h(ie,null),h(Ae,null);try{const{result:r}=await dn(t.data.repo,t.data.type,t.data.id);h(ie,r,!0)}catch(r){h(Ae,r.message||"Refresh failed",!0)}finally{h(B,!1)}}}let ee=Se(!1);async function I(){if(!e(ee)){h(ee,!0);try{await cn(t.data.repo,t.data.type,t.data.id),h(ie,null),await tn()}catch(r){h(Ae,r.message||"Apply changes failed",!0)}finally{h(ee,!1)}}}let te=null,w=Se(""),k=!1,a=Se(vt([]));function n(r){o(),tt(async()=>{const{createCollabSession:g}=await import("../chunks/C9RtA91n.js");return{createCollabSession:g}},__vite__mapDeps([8,9,10,11,12,13,14,15,16,17,18]),import.meta.url).then(({createCollabSession:g})=>{const Z=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",U=g(r,{name:Ta.user?.displayName??"Anonymous",color:Z,colorLight:Z+"33"});U.ytext.observe(()=>{const s=U.ytext.toString();s!==e(S)&&(k=!0,h(S,s,!0),requestAnimationFrame(()=>{k=!1}))});const ae=U.ydoc.clientID;function q(){const s=[];U.awareness.getStates().forEach((V,z)=>{if(z===ae)return;const $=V.cell;if($==null||$.row==null||$.col==null)return;const{name:Ee="Anonymous",color:me="#e05050"}=V.user||{};s.push({row:$.row,col:$.col,name:Ee,color:me})}),h(a,s,!0)}U.awareness.on("change",q),te=U,h(w,r,!0)})}function o(){te&&(te.destroy(),te=null,h(w,""),h(a,[],!0))}Ia(()=>o());let p=Se(""),C=Se(0);bt(()=>{const r=`${t.data.repo}/${t.data.type}/${t.data.id}`,g=pn.mutationCount;if(r!==e(p)||g!==e(C)){e(p)&&r!==e(p)&&Je.flush(),h(p,r),h(C,g,!0);const Z=t.data.entity.document?.content??"";h(S,Z.trim()===""?"":Z,!0),h(u,{...t.data.entity.document?.frontmatter??t.data.entity.data??{}},!0),Gt(T),Je.reset();const U=`${t.data.repo}/${t.data.type}/${t.data.id}`;e(P)&&U!==e(w)?n(U):e(P)||o()}}),bt(()=>{const r=t.data.repo,g=t.data.type,Z=t.data.id;Ma(()=>{ya.select(r,g,Z),ya.showEntity()})});function N(r){if(!k){if(h(S,r,!0),te){const g=te.ytext,Z=g.toString();r!==Z&&te.ydoc.transact(()=>{g.delete(0,g.length),g.insert(0,r)})}Je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{content:r})}}function _e(r,g){h(u,{...e(u),[r]:g},!0),Je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(u)})}function Re(r){const{[r]:g,...Z}=e(u);h(u,Z,!0),Je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(u)})}function E(r,g){h(u,{...e(u),[r]:g},!0),Je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(u)})}function _(r,g){Je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(u)})}let m=Se(null);function D(r){r!==t.data.type&&h(m,r,!0)}async function oe(){const r=e(m);if(h(m,null),!!r){Je.reset();try{await Ba(t.data.repo,t.data.type,t.data.id,r),await Nt.refreshEntities(t.data.repo),await Qt(`/${t.data.repo}/${r}/${t.data.id}`,{invalidateAll:!0})}catch(g){console.error("Failed to change entity type:",g)}}}function j(r){for(const g of Nt.repos){const Z=g.entities.find(U=>U.id===r);if(Z){Qt(`/${g.name}/${Z.entityType}/${Z.id}`);return}}hn.showToast(`"${r}" is in a collection you don't have access to`)}bt(()=>(Pa.enter(t.data.repo,t.data.type,t.data.id),()=>Pa.leave()));const J=Pe(()=>e(ie)!==null&&(e(ie).diffs.length>0||e(ie).body_changed));function b(r){(r.metaKey||r.ctrlKey)&&r.key==="s"&&(r.preventDefault(),Je.flush()),r.key==="Escape"&&!(r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement)&&(Je.flush(),ya.deselect(),Qt("/"))}var K=fs();it("keydown",ta,b);var fe=we(K);nn(fe,{activeView:"entity"});var G=M(fe,2);let ce;var H=y(G);{var Q=r=>{var g=ts(),Z=M(we(g),2),U=y(Z);Ge(U,{variant:"outline",size:"default",onclick:()=>h(ie,null),get disabled(){return e(ee)},children:(q,s)=>{Ye();var V=St("Dismiss");f(q,V)},$$slots:{default:!0}});var ae=M(U,2);Ge(ae,{variant:"accent",size:"default",onclick:I,get disabled(){return e(ee)},children:(q,s)=>{var V=es(),z=we(V);{var $=me=>{za(me,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};ve(z,me=>{e(ee)&&me($)})}var Ee=M(z,1,!0);re(()=>se(Ee,e(ee)?"Applying...":"Apply changes")),f(q,V)},$$slots:{default:!0}}),c(Z),f(r,g)},ke=r=>{var g=os(),Z=we(g);qe(Z,21,()=>e(A)(),Be,(me,Me,Ie)=>{var Te=ns(),ze=we(Te);{var Xe=at=>{var Dt=as();f(at,Dt)};ve(ze,at=>{Ie>0&&at(Xe)})}var ht=M(ze),Ze=y(ht,!0);c(ht),re(at=>{xt(ht,1,at,"svelte-udj3er"),se(Ze,e(Me))},[()=>Xa(Ie===e(A)().length-1?"bc-current":"bc-segment")]),f(me,Te)}),c(Z);var U=M(Z,2),ae=y(U);{var q=me=>{var Me=rs();f(me,Me)},s=me=>{var Me=ss(),Ie=y(Me,!0);c(Me),re(()=>se(Ie,Je.error)),f(me,Me)};ve(ae,me=>{Je.saving?me(q):Je.error&&me(s,1)})}var V=M(ae,2);{var z=me=>{Ge(me,{variant:"outline",size:"sm",class:"refresh-btn",onclick:X,get disabled(){return e(B)},children:(Me,Ie)=>{var Te=is(),ze=we(Te);{var Xe=Ze=>{za(Ze,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};ve(ze,Ze=>{e(B)&&Ze(Xe)})}var ht=M(ze,1,!0);re(()=>se(ht,e(B)?"Refreshing...":"Refresh from source")),f(Me,Te)},$$slots:{default:!0}})};ve(V,me=>{e(he)&&Ta.user?.role==="admin"&&me(z)})}var $=M(V,2);{var Ee=me=>{Ge(me,{variant:"link",size:"sm",class:"open-app",get href(){return`/${t.data.repo??""}/${t.data.type??""}/${t.data.id??""}/edit`},children:(Me,Ie)=>{Ye();var Te=St();re(()=>se(Te,`Open in ${e(R).name??""} →`)),f(Me,Te)},$$slots:{default:!0}})};ve($,me=>{e(R)&&me(Ee)})}c(U),f(r,g)};ve(H,r=>{e(J)?r(Q):r(ke,!1)})}c(G);var F=M(G,2);{var be=r=>{var g=ls();f(r,g)};ve(F,r=>{e(ie)&&!e(J)&&r(be)})}var ye=M(F,2);{var pe=r=>{$r(r,{get properties(){return e(W)},get refreshResult(){return e(ie)},get bodyContent(){return e(S)}})},xe=r=>{var g=us(),Z=y(g),U=y(Z);hr(U,{get properties(){return e(W)},editable:!0,get autofocusKey(){return e(L)},get protectedKeys(){return x},onedit:_e,onremove:Re,onadd:E,ontypechange:_,onentitytypechange:D,onfocuseditor:()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>{const z=document.querySelector(".cm-content");if(z){z.focus();const $=window.getSelection();$&&z.firstChild?$.collapse(z.firstChild,0):$&&$.collapse(z,0)}}))}});var ae=M(U,2);{var q=z=>{Lr(z,{get content(){return e(S)},onchange:N,onsave:()=>Je.flush(),oncellselect:($,Ee)=>{te?.awareness.setLocalStateField("cell",{row:$,col:Ee})},get remoteCursors(){return e(a)}})},s=z=>{{let $=Pe(()=>`${t.data.repo}/${t.data.type}/${t.data.id}`);br(z,{get content(){return e(S)},readonly:!1,onchange:N,onsave:()=>Je.flush(),onwikilinkclick:j,get resetKey(){return e(T)},get cursorDocName(){return e($)}})}};ve(ae,z=>{e(P)?z(q):z(s,!1)})}var V=M(ae,2);gr(V,{get entityId(){return t.data.id},get entityRepo(){return t.data.repo}}),c(Z),c(g),f(r,g)};ve(ye,r=>{e(J)?r(pe):r(xe,!1)})}var ue=M(ye,2);{let r=Pe(()=>!!e(Ae));Ne(ue,()=>bn,(g,Z)=>{Z(g,{get open(){return e(r)},onOpenChange:U=>{U||h(Ae,null)},children:(U,ae)=>{var q=He(),s=we(q);Ne(s,()=>_n,(V,z)=>{z(V,{children:($,Ee)=>{var me=ds(),Me=we(me);Ne(Me,()=>mn,(Te,ze)=>{ze(Te,{children:(Xe,ht)=>{var Ze=cs(),at=we(Ze);Ne(at,()=>gn,(Ot,Lt)=>{Lt(Ot,{children:(Kt,Vt)=>{Ye();var ge=St("Refresh failed");f(Kt,ge)},$$slots:{default:!0}})});var Dt=M(at,2);Ne(Dt,()=>yn,(Ot,Lt)=>{Lt(Ot,{children:(Kt,Vt)=>{Ye();var ge=St();re(()=>se(ge,e(Ae))),f(Kt,ge)},$$slots:{default:!0}})}),f(Xe,Ze)},$$slots:{default:!0}})});var Ie=M(Me,2);Ne(Ie,()=>wn,(Te,ze)=>{ze(Te,{children:(Xe,ht)=>{var Ze=He(),at=we(Ze);Ne(at,()=>kn,(Dt,Ot)=>{Ot(Dt,{children:(Lt,Kt)=>{Ye();var Vt=St("OK");f(Lt,Vt)},$$slots:{default:!0}})}),f(Xe,Ze)},$$slots:{default:!0}})}),f($,me)},$$slots:{default:!0}})}),f(U,q)},$$slots:{default:!0}})})}var d=M(ue,2);{let r=Pe(()=>e(m)!==null),g=Pe(()=>`Change this entity from ${jt(t.data.type)} to ${jt(e(m)??"")}? Fields specific to ${jt(t.data.type)} will be removed.`);on(d,{get open(){return e(r)},title:"Change entity type",get message(){return e(g)},confirmLabel:"Change type",onconfirm:oe,oncancel:()=>{h(m,null)}})}re(()=>ce=xt(G,1,"editor-bar svelte-udj3er",null,ce,{"editor-bar-diff":e(J)})),f(Y,K),ft(),v()}export{Ns as component,Us 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/DvmL5xMZ.js";import{a as S,s as Z,b as M,c as ft}from"../chunks/BdF6nRVd.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/sZJoCX5N.js";import{b as X,i as j}from"../chunks/BSSN_IAc.js";import{s as Y}from"../chunks/OZfYVFGq.js";import{g as pt}from"../chunks/oTvbmuuZ.js";import{n as E}from"../chunks/CkIXD8Ce.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/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};
|
|
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/DewdtTcU.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/oTvbmuuZ.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/Dw0OBYq7.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};
|