studiograph 1.2.1 → 1.3.2

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.
Files changed (37) hide show
  1. package/dist/cli/commands/redeploy.js +1 -3
  2. package/dist/cli/commands/redeploy.js.map +1 -1
  3. package/dist/server/routes/graph-api.js +10 -0
  4. package/dist/server/routes/graph-api.js.map +1 -1
  5. package/dist/web/_app/immutable/assets/6.Bm2i7O0j.css +1 -0
  6. package/dist/web/_app/immutable/assets/AppShell.D0rmbdqF.css +1 -0
  7. package/dist/web/_app/immutable/chunks/{DdNsM6oV.js → BHedmkKI.js} +1 -1
  8. package/dist/web/_app/immutable/chunks/{3_5VIr68.js → Bopa-Ask.js} +1 -1
  9. package/dist/web/_app/immutable/chunks/{CQENNNNl.js → C1SF7XfX.js} +1 -1
  10. package/dist/web/_app/immutable/chunks/{DKyztuK9.js → CEkx7wvp.js} +1 -1
  11. package/dist/web/_app/immutable/chunks/{CAXuTUkp.js → COwytaCP.js} +1 -1
  12. package/dist/web/_app/immutable/chunks/{fwnBoL5x.js → DEJSHbC3.js} +1 -1
  13. package/dist/web/_app/immutable/chunks/{F20aIBpJ.js → DTUXhwEY.js} +1 -1
  14. package/dist/web/_app/immutable/chunks/Dml-u95b.js +2 -0
  15. package/dist/web/_app/immutable/chunks/{BButMJ6M.js → DvKVaE7M.js} +1 -1
  16. package/dist/web/_app/immutable/chunks/J4wxg_sP.js +23 -0
  17. package/dist/web/_app/immutable/chunks/{BiubvAUI.js → MbiSz-iW.js} +1 -1
  18. package/dist/web/_app/immutable/chunks/{hHxe9oXh.js → bSAC733J.js} +1 -1
  19. package/dist/web/_app/immutable/entry/{app.BFVUP2fV.js → app.B0KkA_jR.js} +2 -2
  20. package/dist/web/_app/immutable/entry/start.DFSNI2p-.js +1 -0
  21. package/dist/web/_app/immutable/nodes/0.DfbCOBhn.js +2 -0
  22. package/dist/web/_app/immutable/nodes/{1.DwnzyOvm.js → 1.DMtWWiM4.js} +1 -1
  23. package/dist/web/_app/immutable/nodes/{2.FZxrWJeh.js → 2.CgKSJOen.js} +1 -1
  24. package/dist/web/_app/immutable/nodes/{3.CQVWlbKr.js → 3.CVYHBZE3.js} +1 -1
  25. package/dist/web/_app/immutable/nodes/{4.CEh40Z_h.js → 4.CHN1uWec.js} +1 -1
  26. package/dist/web/_app/immutable/nodes/{5.D_QsCLEf.js → 5.B4_87Wva.js} +1 -1
  27. package/dist/web/_app/immutable/nodes/6.CGZ970f8.js +2 -0
  28. package/dist/web/_app/version.json +1 -1
  29. package/dist/web/index.html +12 -12
  30. package/package.json +1 -1
  31. package/dist/web/_app/immutable/assets/6.CeHKR5ZY.css +0 -1
  32. package/dist/web/_app/immutable/assets/AppShell.CJtUfb0N.css +0 -1
  33. package/dist/web/_app/immutable/chunks/CV8ganSj.js +0 -23
  34. package/dist/web/_app/immutable/chunks/YFT1281h.js +0 -2
  35. package/dist/web/_app/immutable/entry/start.BqsXHYP6.js +0 -1
  36. package/dist/web/_app/immutable/nodes/0.DQ5KdeNU.js +0 -1
  37. package/dist/web/_app/immutable/nodes/6.CndEQ0o5.js +0 -2
@@ -1,2 +0,0 @@
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{i as Te,b as De,j as ee,w as ne}from"../chunks/YFT1281h.js";import{g as Se,j as Tt,a as Vt,f as Wt,e as ie}from"../chunks/hHxe9oXh.js";import{n as he,o as de,A as xt,F as D,Y as mt,S as Ee,bc as ze,x as re,q as ge,t as st,u as zt,w as it,T as Dt,P as oe}from"../chunks/fwnBoL5x.js";import{p as St,b as Pe,i as ke}from"../chunks/BButMJ6M.js";import{c as wt,e as Fe,i as Re,n as Ht,A as Oe}from"../chunks/CV8ganSj.js";import{V as je,c as Ge,C as Le}from"../chunks/DdNsM6oV.js";import{_ as Xe}from"../chunks/PPVm8Dsz.js";import{s as ae}from"../chunks/BiubvAUI.js";import{g as Ye}from"../chunks/DKyztuK9.js";function He(){return Te("/api/graph")}const Ve=async()=>({graphData:await He()}),Hn=Object.freeze(Object.defineProperty({__proto__:null,load:Ve},Symbol.toStringTag,{value:"Module"}));function Ue(t,e){var n,i=1;t==null&&(t=0),e==null&&(e=0);function r(){var o,c=n.length,d,w=0,a=0;for(o=0;o<c;++o)d=n[o],w+=d.x,a+=d.y;for(w=(w/c-t)*i,a=(a/c-e)*i,o=0;o<c;++o)d=n[o],d.x-=w,d.y-=a}return r.initialize=function(o){n=o},r.x=function(o){return arguments.length?(t=+o,r):t},r.y=function(o){return arguments.length?(e=+o,r):e},r.strength=function(o){return arguments.length?(i=+o,r):i},r}function Be(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return pe(this.cover(e,n),e,n,t)}function pe(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,o=t._root,c={data:i},d=t._x0,w=t._y0,a=t._x1,y=t._y1,_,x,l,b,f,s,u,g;if(!o)return t._root=c,t;for(;o.length;)if((f=e>=(_=(d+a)/2))?d=_:a=_,(s=n>=(x=(w+y)/2))?w=x:y=x,r=o,!(o=o[u=s<<1|f]))return r[u]=c,t;if(l=+t._x.call(null,o.data),b=+t._y.call(null,o.data),e===l&&n===b)return c.next=o,r?r[u]=c:t._root=c,t;do r=r?r[u]=new Array(4):t._root=new Array(4),(f=e>=(_=(d+a)/2))?d=_:a=_,(s=n>=(x=(w+y)/2))?w=x:y=x;while((u=s<<1|f)===(g=(b>=x)<<1|l>=_));return r[g]=o,r[u]=c,t}function We(t){var e,n,i=t.length,r,o,c=new Array(i),d=new Array(i),w=1/0,a=1/0,y=-1/0,_=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(o=+this._y.call(null,e))||(c[n]=r,d[n]=o,r<w&&(w=r),r>y&&(y=r),o<a&&(a=o),o>_&&(_=o));if(w>y||a>_)return this;for(this.cover(w,a).cover(y,_),n=0;n<i;++n)pe(this,c[n],d[n],t[n]);return this}function Qe(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,o=(i=Math.floor(e))+1;else{for(var c=r-n||1,d=this._root,w,a;n>t||t>=r||i>e||e>=o;)switch(a=(e<i)<<1|t<n,w=new Array(4),w[a]=d,d=w,c*=2,a){case 0:r=n+c,o=i+c;break;case 1:n=r-c,o=i+c;break;case 2:r=n+c,i=o-c;break;case 3:n=r-c,i=o-c;break}this._root&&this._root.length&&(this._root=d)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this}function Ke(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function Je(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 B(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function Ze(t,e,n){var i,r=this._x0,o=this._y0,c,d,w,a,y=this._x1,_=this._y1,x=[],l=this._root,b,f;for(l&&x.push(new B(l,r,o,y,_)),n==null?n=1/0:(r=t-n,o=e-n,y=t+n,_=e+n,n*=n);b=x.pop();)if(!(!(l=b.node)||(c=b.x0)>y||(d=b.y0)>_||(w=b.x1)<r||(a=b.y1)<o))if(l.length){var s=(c+w)/2,u=(d+a)/2;x.push(new B(l[3],s,u,w,a),new B(l[2],c,u,s,a),new B(l[1],s,d,w,u),new B(l[0],c,d,s,u)),(f=(e>=u)<<1|t>=s)&&(b=x[x.length-1],x[x.length-1]=x[x.length-1-f],x[x.length-1-f]=b)}else{var g=t-+this._x.call(null,l.data),M=e-+this._y.call(null,l.data),p=g*g+M*M;if(p<n){var I=Math.sqrt(n=p);r=t-I,o=e-I,y=t+I,_=e+I,i=l.data}}return i}function qe(t){if(isNaN(y=+this._x.call(null,t))||isNaN(_=+this._y.call(null,t)))return this;var e,n=this._root,i,r,o,c=this._x0,d=this._y0,w=this._x1,a=this._y1,y,_,x,l,b,f,s,u;if(!n)return this;if(n.length)for(;;){if((b=y>=(x=(c+w)/2))?c=x:w=x,(f=_>=(l=(d+a)/2))?d=l:a=l,e=n,!(n=n[s=f<<1|b]))return this;if(!n.length)break;(e[s+1&3]||e[s+2&3]||e[s+3&3])&&(i=e,u=s)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,r?(o?r.next=o:delete r.next,this):e?(o?e[s]=o: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[u]=n:this._root=n),this):(this._root=o,this)}function $e(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function tn(){return this._root}function en(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function nn(t){var e=[],n,i=this._root,r,o,c,d,w;for(i&&e.push(new B(i,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(i=n.node,o=n.x0,c=n.y0,d=n.x1,w=n.y1)&&i.length){var a=(o+d)/2,y=(c+w)/2;(r=i[3])&&e.push(new B(r,a,y,d,w)),(r=i[2])&&e.push(new B(r,o,y,a,w)),(r=i[1])&&e.push(new B(r,a,c,d,y)),(r=i[0])&&e.push(new B(r,o,c,a,y))}return this}function rn(t){var e=[],n=[],i;for(this._root&&e.push(new B(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var r=i.node;if(r.length){var o,c=i.x0,d=i.y0,w=i.x1,a=i.y1,y=(c+w)/2,_=(d+a)/2;(o=r[0])&&e.push(new B(o,c,d,y,_)),(o=r[1])&&e.push(new B(o,y,d,w,_)),(o=r[2])&&e.push(new B(o,c,_,y,a)),(o=r[3])&&e.push(new B(o,y,_,w,a))}n.push(i)}for(;i=n.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function on(t){return t[0]}function an(t){return arguments.length?(this._x=t,this):this._x}function sn(t){return t[1]}function ln(t){return arguments.length?(this._y=t,this):this._y}function Qt(t,e,n){var i=new Kt(e??on,n??sn,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function Kt(t,e,n,i,r,o){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function se(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var W=Qt.prototype=Kt.prototype;W.copy=function(){var t=new Kt(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=se(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]=se(i));return t};W.add=Be;W.addAll=We;W.cover=Qe;W.data=Ke;W.extent=Je;W.find=Ze;W.remove=qe;W.removeAll=$e;W.root=tn;W.size=en;W.visit=nn;W.visitAfter=rn;W.x=an;W.y=ln;function lt(t){return function(){return t}}function rt(t){return(t()-.5)*1e-6}function fn(t){return t.x+t.vx}function cn(t){return t.y+t.vy}function un(t){var e,n,i,r=1,o=1;typeof t!="function"&&(t=lt(t==null?1:+t));function c(){for(var a,y=e.length,_,x,l,b,f,s,u=0;u<o;++u)for(_=Qt(e,fn,cn).visitAfter(d),a=0;a<y;++a)x=e[a],f=n[x.index],s=f*f,l=x.x+x.vx,b=x.y+x.vy,_.visit(g);function g(M,p,I,k,G){var F=M.data,Q=M.r,R=f+Q;if(F){if(F.index>x.index){var L=l-F.x-F.vx,tt=b-F.y-F.vy,H=L*L+tt*tt;H<R*R&&(L===0&&(L=rt(i),H+=L*L),tt===0&&(tt=rt(i),H+=tt*tt),H=(R-(H=Math.sqrt(H)))/H*r,x.vx+=(L*=H)*(R=(Q*=Q)/(s+Q)),x.vy+=(tt*=H)*R,F.vx-=L*(R=1-R),F.vy-=tt*R)}return}return p>l+R||k<l-R||I>b+R||G<b-R}}function d(a){if(a.data)return a.r=n[a.data.index];for(var y=a.r=0;y<4;++y)a[y]&&a[y].r>a.r&&(a.r=a[y].r)}function w(){if(e){var a,y=e.length,_;for(n=new Array(y),a=0;a<y;++a)_=e[a],n[_.index]=+t(_,a,e)}}return c.initialize=function(a,y){e=a,i=y,w()},c.iterations=function(a){return arguments.length?(o=+a,c):o},c.strength=function(a){return arguments.length?(r=+a,c):r},c.radius=function(a){return arguments.length?(t=typeof a=="function"?a:lt(+a),w(),c):t},c}function hn(t){return t.index}function le(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function dn(t){var e=hn,n=_,i,r=lt(30),o,c,d,w,a,y=1;t==null&&(t=[]);function _(s){return 1/Math.min(d[s.source.index],d[s.target.index])}function x(s){for(var u=0,g=t.length;u<y;++u)for(var M=0,p,I,k,G,F,Q,R;M<g;++M)p=t[M],I=p.source,k=p.target,G=k.x+k.vx-I.x-I.vx||rt(a),F=k.y+k.vy-I.y-I.vy||rt(a),Q=Math.sqrt(G*G+F*F),Q=(Q-o[M])/Q*s*i[M],G*=Q,F*=Q,k.vx-=G*(R=w[M]),k.vy-=F*R,I.vx+=G*(R=1-R),I.vy+=F*R}function l(){if(c){var s,u=c.length,g=t.length,M=new Map(c.map((I,k)=>[e(I,k,c),I])),p;for(s=0,d=new Array(u);s<g;++s)p=t[s],p.index=s,typeof p.source!="object"&&(p.source=le(M,p.source)),typeof p.target!="object"&&(p.target=le(M,p.target)),d[p.source.index]=(d[p.source.index]||0)+1,d[p.target.index]=(d[p.target.index]||0)+1;for(s=0,w=new Array(g);s<g;++s)p=t[s],w[s]=d[p.source.index]/(d[p.source.index]+d[p.target.index]);i=new Array(g),b(),o=new Array(g),f()}}function b(){if(c)for(var s=0,u=t.length;s<u;++s)i[s]=+n(t[s],s,t)}function f(){if(c)for(var s=0,u=t.length;s<u;++s)o[s]=+r(t[s],s,t)}return x.initialize=function(s,u){c=s,a=u,l()},x.links=function(s){return arguments.length?(t=s,l(),x):t},x.id=function(s){return arguments.length?(e=s,x):e},x.iterations=function(s){return arguments.length?(y=+s,x):y},x.strength=function(s){return arguments.length?(n=typeof s=="function"?s:lt(+s),b(),x):n},x.distance=function(s){return arguments.length?(r=typeof s=="function"?s:lt(+s),f(),x):r},x}var gn={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 Et(n)}function Et(t){this._=t}function pn(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}})}Et.prototype=ve.prototype={constructor:Et,on:function(t,e){var n=this._,i=pn(t+"",n),r,o=-1,c=i.length;if(arguments.length<2){for(;++o<c;)if((r=(t=i[o]).type)&&(r=vn(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<c;)if(r=(t=i[o]).type)n[r]=fe(n[r],t.name,e);else if(e==null)for(r in n)n[r]=fe(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 Et(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,o;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],i=0,r=o.length;i<r;++i)o[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,o=i.length;r<o;++r)i[r].value.apply(e,n)}};function vn(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function fe(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=gn,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var dt=0,Mt=0,_t=0,ye=1e3,Pt,bt,kt=0,ft=0,Ft=0,It=typeof performance=="object"&&performance.now?performance:Date,xe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function we(){return ft||(xe(yn),ft=It.now()+Ft)}function yn(){ft=0}function Ut(){this._call=this._time=this._next=null}Ut.prototype=_e.prototype={constructor:Ut,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?we():+n)+(e==null?0:+e),!this._next&&bt!==this&&(bt?bt._next=this:Pt=this,bt=this),this._call=t,this._time=n,Bt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bt())}};function _e(t,e,n){var i=new Ut;return i.restart(t,e,n),i}function xn(){we(),++dt;for(var t=Pt,e;t;)(e=ft-t._time)>=0&&t._call.call(void 0,e),t=t._next;--dt}function ce(){ft=(kt=It.now())+Ft,dt=Mt=0;try{xn()}finally{dt=0,_n(),ft=0}}function wn(){var t=It.now(),e=t-kt;e>ye&&(Ft-=e,kt=t)}function _n(){for(var t,e=Pt,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:Pt=n);bt=t,Bt(i)}function Bt(t){if(!dt){Mt&&(Mt=clearTimeout(Mt));var e=t-ft;e>24?(t<1/0&&(Mt=setTimeout(ce,t-It.now()-Ft)),_t&&(_t=clearInterval(_t))):(_t||(kt=It.now(),_t=setInterval(wn,ye)),dt=1,xe(ce))}}const mn=1664525,Mn=1013904223,ue=4294967296;function bn(){let t=1;return()=>(t=(mn*t+Mn)%ue)/ue}function In(t){return t.x}function Cn(t){return t.y}var Nn=10,An=Math.PI*(3-Math.sqrt(5));function Tn(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,c=.6,d=new Map,w=_e(_),a=ve("tick","end"),y=bn();t==null&&(t=[]);function _(){x(),a.call("tick",e),n<i&&(w.stop(),a.call("end",e))}function x(f){var s,u=t.length,g;f===void 0&&(f=1);for(var M=0;M<f;++M)for(n+=(o-n)*r,d.forEach(function(p){p(n)}),s=0;s<u;++s)g=t[s],g.fx==null?g.x+=g.vx*=c:(g.x=g.fx,g.vx=0),g.fy==null?g.y+=g.vy*=c:(g.y=g.fy,g.vy=0);return e}function l(){for(var f=0,s=t.length,u;f<s;++f){if(u=t[f],u.index=f,u.fx!=null&&(u.x=u.fx),u.fy!=null&&(u.y=u.fy),isNaN(u.x)||isNaN(u.y)){var g=Nn*Math.sqrt(.5+f),M=f*An;u.x=g*Math.cos(M),u.y=g*Math.sin(M)}(isNaN(u.vx)||isNaN(u.vy))&&(u.vx=u.vy=0)}}function b(f){return f.initialize&&f.initialize(t,y),f}return l(),e={tick:x,restart:function(){return w.restart(_),e},stop:function(){return w.stop(),e},nodes:function(f){return arguments.length?(t=f,l(),d.forEach(b),e):t},alpha:function(f){return arguments.length?(n=+f,e):n},alphaMin:function(f){return arguments.length?(i=+f,e):i},alphaDecay:function(f){return arguments.length?(r=+f,e):+r},alphaTarget:function(f){return arguments.length?(o=+f,e):o},velocityDecay:function(f){return arguments.length?(c=1-f,e):1-c},randomSource:function(f){return arguments.length?(y=f,d.forEach(b),e):y},force:function(f,s){return arguments.length>1?(s==null?d.delete(f):d.set(f,b(s)),e):d.get(f)},find:function(f,s,u){var g=0,M=t.length,p,I,k,G,F;for(u==null?u=1/0:u*=u,g=0;g<M;++g)G=t[g],p=f-G.x,I=s-G.y,k=p*p+I*I,k<u&&(F=G,u=k);return F},on:function(f,s){return arguments.length>1?(a.on(f,s),e):a.on(f)}}}function Dn(){var t,e,n,i,r=lt(-30),o,c=1,d=1/0,w=.81;function a(l){var b,f=t.length,s=Qt(t,In,Cn).visitAfter(_);for(i=l,b=0;b<f;++b)e=t[b],s.visit(x)}function y(){if(t){var l,b=t.length,f;for(o=new Array(b),l=0;l<b;++l)f=t[l],o[f.index]=+r(f,l,t)}}function _(l){var b=0,f,s,u=0,g,M,p;if(l.length){for(g=M=p=0;p<4;++p)(f=l[p])&&(s=Math.abs(f.value))&&(b+=f.value,u+=s,g+=s*f.x,M+=s*f.y);l.x=g/u,l.y=M/u}else{f=l,f.x=f.data.x,f.y=f.data.y;do b+=o[f.data.index];while(f=f.next)}l.value=b}function x(l,b,f,s){if(!l.value)return!0;var u=l.x-e.x,g=l.y-e.y,M=s-b,p=u*u+g*g;if(M*M/w<p)return p<d&&(u===0&&(u=rt(n),p+=u*u),g===0&&(g=rt(n),p+=g*g),p<c&&(p=Math.sqrt(c*p)),e.vx+=u*l.value*i/p,e.vy+=g*l.value*i/p),!0;if(l.length||p>=d)return;(l.data!==e||l.next)&&(u===0&&(u=rt(n),p+=u*u),g===0&&(g=rt(n),p+=g*g),p<c&&(p=Math.sqrt(c*p)));do l.data!==e&&(M=o[l.data.index]*i/p,e.vx+=u*M,e.vy+=g*M);while(l=l.next)}return a.initialize=function(l,b){t=l,n=b,y()},a.strength=function(l){return arguments.length?(r=typeof l=="function"?l:lt(+l),y(),a):r},a.distanceMin=function(l){return arguments.length?(c=l*l,a):Math.sqrt(c)},a.distanceMax=function(l){return arguments.length?(d=l*l,a):Math.sqrt(d)},a.theta=function(l){return arguments.length?(w=l*l,a):Math.sqrt(w)},a}var Sn=Wt('<div><span class="legend-dot svelte-1i33fky"></span> <span class="legend-label svelte-1i33fky"> </span> <span class="legend-count svelte-1i33fky"> </span></div>'),En=Wt('<div class="graph-view svelte-1i33fky"><div class="canvas-wrap svelte-1i33fky"><div class="legend-panel svelte-1i33fky"></div></div></div>');function zn(t,e){he(e,!0);let n=St(e,"selectedEntityId",3,null),i=St(e,"filteredIds",3,null),r=St(e,"sidebarHoveredId",3,null),o=St(e,"highlightedIds",3,null);function c(h){return e.nameMap?.get(h)??h.replace(/-/g," ").replace(/\b\w/g,m=>m.toUpperCase())}const d=de("theme"),w=mt(()=>d.current==="light"?{default:14211288,dim:15263976,conn:12632256,labelText:1710623}:{default:2763306,dim:1315860,conn:4210752,labelText:15592943}),a=mt(()=>d.current==="light"?16316666:592139),y=.75;xt(()=>{d.current,K&&(K.style.fill=D(w).labelText);const h=D(Lt);for(const m of l)wt(m.type)===vt&&(m.color=h);X()}),xt(()=>{i(),X()}),xt(()=>{o(),X()}),xt(()=>{n(),X()}),xt(()=>{const h=r();if(h){const m=l.find(v=>v.id===h)??null;p=m,Ot(),J=m?1:0}else I||(J=0);X()});let _,x=null,l=[],b=[],f=!1,s=0,u=0,g=0,M=1,p=null,I=null,k=oe(!1),G=0,F=0,Q=0,R=0,L=new Set,tt=!1,H=oe(null),nt=0,J=0;const Jt=4;let V=null,gt=null,pt=null,Ct=null,Zt=new Map,q=null,K=null,$=null;function me(h){return Math.max(2,Math.min(2*Math.sqrt(h+1),10))}function Rt(h,m){const v=_.getBoundingClientRect();return{x:(h-v.left-u)/M,y:(m-v.top-g)/M}}function qt(h,m){for(let v=l.length-1;v>=0;v--){const C=l[v],S=h-C.x,P=m-C.y,E=(C.r*1.5+4)/M;if(S*S+P*P<=E*E)return C}return null}function Ot(){const h=p??null;if(L.clear(),!!h){L.add(h.id);for(const m of b)m.source.id===h.id&&L.add(m.target.id),m.target.id===h.id&&L.add(m.source.id)}}function $t(){if(l.length===0||!_)return;let h=1/0,m=-1/0,v=1/0,C=-1/0,S=0;for(const z of l)z.x<h&&(h=z.x),z.x>m&&(m=z.x),z.y<v&&(v=z.y),z.y>C&&(C=z.y),z.r>S&&(S=z.r);const P=_.clientWidth,E=_.clientHeight,O=m-h,U=C-v;if(O===0||U===0)return;const et=(60+S)*2;M=Math.min((P-et)/O,(E-et)/U,3),u=P/2-(h+m)/2*M,g=E/2-(v+C)/2*M,X()}function X(){f=!0,s=0}function jt(h){return parseInt(h.replace("#",""),16)}function ot(h,m,v){const C=(h>>16&255)+v*((m>>16&255)-(h>>16&255)),S=(h>>8&255)+v*((m>>8&255)-(h>>8&255)),P=(h&255)+v*((m&255)-(h&255));return Math.round(C)<<16|Math.round(S)<<8|Math.round(P)}function Me(){if(!$||!gt||!pt)return;gt.clear(),pt.clear();const m=p!==null,v=nt,C=D(H),S=o(),P=i(),E=D(w).default,O=D(w).dim,U=D(w).conn;for(let et=0;et<b.length;et++){const z=b[et],ct=z.source.x*M+u,A=z.source.y*M+g,N=z.target.x*M+u,yt=z.target.y*M+g,ut=m&&v>.01&&L.has(z.source.id)&&L.has(z.target.id);let j=E;m&&v>.01?j=ut?ot(E,U,v):ot(E,O,v):(C!==null||S!==null||P!==null)&&(j=O);const Z=ut?pt:gt;Z.setStrokeStyle({width:1,color:j,alpha:1}),Z.moveTo(ct,A),Z.lineTo(N,yt),Z.stroke()}}function be(){if(!$)return;const h=p,m=h!==null,v=nt,C=D(H),S=o(),P=i(),E=!h&&n()?l.find(A=>A.id===n())??null:null,O=new Set;if(E){O.add(E.id);for(const A of b)A.source.id===E.id&&O.add(A.target.id),A.target.id===E.id&&O.add(A.source.id)}for(const A of l){const N=Zt.get(A.id);if(!N)continue;const yt=A.x*M+u,ut=A.y*M+g;N.position.set(yt,ut),N.scale.set(A.r/50),N.alpha=1;const j=jt(A.color);if(E&&!h){const Z=O.has(A.id);N.tint=Z?j:ot(j,D(a),y),N.zIndex=A===E?2:Z?1:0}else{const Z=A===h,At=m&&L.has(A.id),T=C!==null&&(C==="other"?wt(A.type)===vt:A.type===C);if(Z&&v>.01)N.tint=j,N.scale.set(A.r*(1+v*.4)/50),N.zIndex=2;else if(At)N.tint=j,N.zIndex=1;else if(C!==null)N.tint=T?j:ot(j,D(a),y),N.zIndex=T?1:0;else if(S!==null){const Y=S.has(A.id),ht=Y?v*y:y;N.tint=ot(j,D(a),ht),N.zIndex=Y?1:0}else if(P!==null){const Y=P.has(A.id),ht=Y?v*y:y;N.tint=ot(j,D(a),ht),N.zIndex=Y?1:0}else N.tint=ot(j,D(a),v*y),N.zIndex=0}}const U=h??E,et=h?v>.01:!!E;if(U&&et&&q){q.visible=!0;const A=U.x*M+u,N=U.y*M+g;q.position.set(A,N),q.scale.set(U.r*5/64),q.alpha=h?v*.25:.25,q.tint=jt(U.color)}else q&&(q.visible=!1);const z=h??E,ct=h?v>.01:!!E;if(z&&ct&&K){const A=z.x*M+u,N=z.y*M+g;K.text=c(z.id),K.style.fontSize=12,K.position.set(A,N+z.r+8),K.alpha=h?v:1,K.visible=!0}else K&&(K.visible=!1)}let Nt=!1;function Ie(h){if(h.button!==0)return;Nt=!1;const m=Rt(h.clientX,h.clientY),v=qt(m.x,m.y);v?(I=v,tt=!0,v.fx=v.x,v.fy=v.y,x?.alphaTarget(.3).restart(),X()):(Dt(k,!0),G=h.clientX,F=h.clientY,Q=u,R=g),_.setPointerCapture(h.pointerId),window.addEventListener("pointerup",Gt,{once:!0})}function Ce(h){if(I){Nt=!0;const m=Rt(h.clientX,h.clientY);I.fx=m.x,I.fy=m.y,X()}else if(D(k))Nt=!0,u=Q+(h.clientX-G),g=R+(h.clientY-F),X();else{const m=Rt(h.clientX,h.clientY),v=qt(m.x,m.y);v?v!==p?(p&&(nt=.15),p=v,Ot(),J=1,_.style.cursor="pointer",X()):J!==1&&(J=1,_.style.cursor="pointer",X()):J!==0&&(J=0,_.style.cursor="grab",X())}}function Gt(h){if(!I&&!D(k))return;window.removeEventListener("pointerup",Gt);const m=Nt;if(I){const v=I;I.fx=null,I.fy=null,x?.alphaTarget(0),I=null,J=0,X(),m||Ye(`/${v.repo}/${v.type}/${v.id}`)}else D(k)&&Dt(k,!1);try{_.releasePointerCapture(h.pointerId)}catch{}}const vt="#5c5c66",Ne="#b0b0b8",Lt=mt(()=>d.current==="light"?Ne:vt),Ae=mt(()=>{const h=new Map;for(const C of e.graphData.nodes)h.set(C.type,(h.get(C.type)??0)+1);const m=[];let v=0;for(const[C,S]of h){const P=wt(C);P===vt?v+=S:m.push({name:C,color:P,count:S})}return m.sort((C,S)=>S.count-C.count),v>0&&m.push({name:"other",color:D(Lt),count:v}),m});Ee(async()=>{$=await Xe(()=>import("../chunks/BB_5th5W.js"),__vite__mapDeps([0,1,2]),import.meta.url),V=new $.Application,await V.init({antialias:!0,resolution:window.devicePixelRatio||1,autoDensity:!0,backgroundAlpha:0,resizeTo:_}),_.insertBefore(V.canvas,_.firstChild),V.canvas.style.position="absolute",V.canvas.style.inset="0",gt=new $.Graphics,V.stage.addChild(gt),pt=new $.Graphics,V.stage.addChild(pt),Ct=new $.Container,Ct.sortableChildren=!0,V.stage.addChild(Ct);const h=document.createElement("canvas");h.width=128,h.height=128;const m=h.getContext("2d"),v=m.createRadialGradient(64,64,0,64,64,64);v.addColorStop(0,"rgba(255,255,255,0.5)"),v.addColorStop(1,"rgba(255,255,255,0)"),m.fillStyle=v,m.fillRect(0,0,128,128);const C=$.Texture.from(h);q=new $.Sprite(C),q.anchor.set(.5),q.visible=!1,V.stage.addChild(q);const S=document.createElement("canvas");S.width=100,S.height=100;const P=S.getContext("2d");P.beginPath(),P.arc(50,50,48,0,Math.PI*2),P.fillStyle="#ffffff",P.fill();const E=$.Texture.from(S),O=new Map;for(const T of e.graphData.edges)O.set(T.source,(O.get(T.source)??0)+1),O.set(T.target,(O.get(T.target)??0)+1);const U=new Map,z=3600*e.graphData.nodes.length,ct=Math.sqrt(z);l=e.graphData.nodes.map(T=>{const Y=O.get(T.id)??0,ht={id:T.id,type:T.type,repo:T.repo,color:wt(T.type)===vt?D(Lt):wt(T.type),weight:Y,x:(Math.random()-.5)*ct,y:(Math.random()-.5)*ct,vx:0,vy:0,r:me(Y)};return U.set(T.id,ht),ht});for(const T of l){const Y=new $.Sprite(E);Y.anchor.set(.5),Y.tint=jt(T.color),Ct.addChild(Y),Zt.set(T.id,Y)}K=new $.Text({text:"",style:{fontFamily:"Inter, system-ui, sans-serif",fontWeight:"500",fontSize:12,fill:D(w).labelText,align:"center"}}),K.anchor.set(.5,0),K.visible=!1,V.stage.addChild(K);const A=e.graphData.edges.map(T=>({source:T.source,target:T.target})),N=l.length,yt=N>200?-3e3:N>50?-2e3:-1e3,ut=N>200?400:N>50?300:250,j=dn(A).id(T=>T.id).distance(ut);x=Tn(l).force("link",j).force("charge",Dn().strength(yt).distanceMin(40).distanceMax(2e3)).force("center",Ue(0,0).strength(.03)).force("collide",un().radius(T=>T.r*4+20).strength(.7).iterations(2)).velocityDecay(.4).alpha(1).on("tick",()=>{tt||$t(),X()}),b=j.links();let Z=0;V.ticker.add(()=>{const T=performance.now(),Y=Z?Math.min((T-Z)/1e3,.05):.016;Z=T,nt<J?(nt=Math.min(J,nt+Jt*Y),f=!0):nt>J&&(nt=Math.max(J,nt-Jt*Y),f=!0),nt===0&&J===0&&p&&!I&&(p=null,Ot(),f=!0),(f||s<120)&&(Me(),be(),f=!1,s++)});const At=new ResizeObserver(()=>{V.renderer.resize(_.clientWidth,_.clientHeight),$t()});return At.observe(_),()=>{At.disconnect()}}),ze(()=>{x?.stop(),V&&(V.destroy(!0,{children:!0}),V=null)});var Xt=En(),at=st(Xt);let te;var Yt=st(at);Fe(Yt,21,()=>D(Ae),Re,(h,m)=>{var v=Sn();let C;var S=st(v);let P;var E=zt(S,2),O=st(E,!0);it(E);var U=zt(E,2),et=st(U,!0);it(U),it(v),re(()=>{C=De(v,1,"legend-item svelte-1i33fky",null,C,{"legend-item-active":D(H)===D(m).name}),P=ee(S,"",P,{background:D(m).color}),ae(O,D(m).name),ae(et,D(m).count)}),ie("mouseenter",v,()=>{Dt(H,D(m).name,!0),X()}),ie("mouseleave",v,()=>{Dt(H,null),X()}),Vt(h,v)}),it(Yt),it(at),Pe(at,h=>_=h,()=>_),it(Xt),re(()=>te=ee(at,"",te,{cursor:D(k)?"grabbing":"grab"})),Tt("pointerdown",at,Ie),Tt("pointermove",at,Ce),Tt("pointerup",at,Gt),Tt("pointerdown",Yt,h=>h.stopPropagation()),Vt(t,Xt),ge()}Se(["pointerdown","pointermove","pointerup"]);var Pn=Wt('<div class="content-row svelte-315y67"><div class="graph-area svelte-315y67"><!> <!></div> <!></div>');function Vn(t,e){he(e,!0);const n=de("chat");Ht.showGraph();const i=mt(()=>{const r=new Map;for(const o of ne.repos)for(const c of o.entities)r.set(c.id,c.title);return r});Oe(t,{children:(r,o)=>{var c=Pn(),d=st(c),w=st(d);je(w,{activeView:"graph"});var a=zt(w,2);zn(a,{get graphData(){return e.data.graphData},get selectedEntityId(){return Ht.selectedId},get nameMap(){return D(i)},get filteredIds(){return ne.filteredIds},get sidebarHoveredId(){return Ht.hoveredEntityId},get highlightedIds(){return Ge.highlightedIds}}),it(d);var y=zt(d,2);{var _=x=>{Le(x,{})};ke(y,x=>{n.open&&x(_)})}it(c),Vt(r,c)},$$slots:{default:!0}}),ge()}export{Vn as component,Hn as universal};