signetai 0.121.1 → 0.121.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.
- package/dashboard/_app/immutable/chunks/{BUdzHJoW.js → -ObNjLrE.js} +1 -1
- package/dashboard/_app/immutable/chunks/{Dq_5mFt6.js → 0yv_DgqE.js} +1 -1
- package/dashboard/_app/immutable/chunks/{D0ni0I9j.js → B0VPSN50.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BZ0X1L9k.js → B3HbBOMJ.js} +1 -1
- package/dashboard/_app/immutable/chunks/{DUy6FYxw.js → B4Xeajb4.js} +1 -1
- package/dashboard/_app/immutable/chunks/{B0O3Mbaa.js → B4zc4BqK.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BDbxWU80.js → BKjxf4x0.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BqjTVp3z.js → BLyBakfa.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BjvTjZqN.js → BTZyYm3S.js} +1 -1
- package/dashboard/_app/immutable/chunks/{1hzKC_cJ.js → BUsnvrjt.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BZv3woJ7.js → Bc8KH6lx.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BU0jJ4QA.js → BinDeEsR.js} +1 -1
- package/dashboard/_app/immutable/chunks/{CC1eaaAA.js → BlfVMmjo.js} +1 -1
- package/dashboard/_app/immutable/chunks/{tUTrvbAJ.js → C4uyLIdG.js} +1 -1
- package/dashboard/_app/immutable/chunks/{CpwUoVbG.js → C5lmBjrn.js} +1 -1
- package/dashboard/_app/immutable/chunks/{DEnfxIad.js → C9vDb0Ah.js} +1 -1
- package/dashboard/_app/immutable/chunks/{DJ2i1KHJ.js → CDVm4vQX.js} +1 -1
- package/dashboard/_app/immutable/chunks/{Cd_Uf1D5.js → CDtndjCb.js} +1 -1
- package/dashboard/_app/immutable/chunks/{DZ5v6TZY.js → CSlnB5UO.js} +1 -1
- package/dashboard/_app/immutable/chunks/{CGFr-Fbg.js → CYqqyqga.js} +1 -1
- package/dashboard/_app/immutable/chunks/{9797OvyS.js → CYtxvC89.js} +2 -2
- package/dashboard/_app/immutable/chunks/{BEKCoYgH.js → CgNCtfwx.js} +1 -1
- package/dashboard/_app/immutable/chunks/{CehloxnP.js → CpS7sDIh.js} +1 -1
- package/dashboard/_app/immutable/chunks/{DFVoJ7iC.js → Ct7xY6Hm.js} +3 -3
- package/dashboard/_app/immutable/chunks/{BIKssNLG.js → CtD0DKRp.js} +1 -1
- package/dashboard/_app/immutable/chunks/{lyOiIX0O.js → Cv1DaC8d.js} +1 -1
- package/dashboard/_app/immutable/chunks/{29g6OP0Q.js → CvnLLGm6.js} +2 -2
- package/dashboard/_app/immutable/chunks/{BCZff2tD.js → D5WnLd_c.js} +1 -1
- package/dashboard/_app/immutable/chunks/{bBDERGgh.js → D8cmZfN1.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BC1l29nP.js → DEYJx1_B.js} +1 -1
- package/dashboard/_app/immutable/chunks/{e_ORDl0W.js → DINn2DxC.js} +1 -1
- package/dashboard/_app/immutable/chunks/{CKxMkp9g.js → DMBJnINp.js} +1 -1
- package/dashboard/_app/immutable/chunks/{CYlYZqlf.js → DNoLATmu.js} +1 -1
- package/dashboard/_app/immutable/chunks/{C0MPJLZW.js → DVl4v1fc.js} +1 -1
- package/dashboard/_app/immutable/chunks/{CTMHbcpX.js → DXXYabRp.js} +1 -1
- package/dashboard/_app/immutable/chunks/{C7Vib3hZ.js → DYRquuPr.js} +1 -1
- package/dashboard/_app/immutable/chunks/{CupfQpcf.js → DZ0_HzUH.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BAMeiJIR.js → Dc4Cldyl.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BIgkFi8Y.js → DcSXYje8.js} +1 -1
- package/dashboard/_app/immutable/chunks/{DC1q8Qmf.js → Dk3TlmN9.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BDgC4dkR.js → DsMeQ-JS.js} +1 -1
- package/dashboard/_app/immutable/chunks/{lwELHDGp.js → DuMCtXhj.js} +1 -1
- package/dashboard/_app/immutable/chunks/{CApDKY0G.js → FQvxlFN7.js} +1 -1
- package/dashboard/_app/immutable/chunks/{BZSwXBfw.js → Und-skHC.js} +1 -1
- package/dashboard/_app/immutable/chunks/{D8RWhxRu.js → XUcCNRdv.js} +1 -1
- package/dashboard/_app/immutable/chunks/jQWARqdw.js +1 -0
- package/dashboard/_app/immutable/chunks/{zbW8Z43k.js → keB_7abO.js} +1 -1
- package/dashboard/_app/immutable/chunks/{Bf0x0qSt.js → uhTs4M45.js} +1 -1
- package/dashboard/_app/immutable/entry/{app.DfqG8p8q.js → app.9qPIDpNW.js} +2 -2
- package/dashboard/_app/immutable/entry/start.C_unIixc.js +1 -0
- package/dashboard/_app/immutable/nodes/{1.BuXRUjPS.js → 1.DMFWRn3B.js} +1 -1
- package/dashboard/_app/immutable/nodes/2.DNU1Kd9n.js +1 -0
- package/dashboard/_app/version.json +1 -1
- package/dashboard/index.html +6 -6
- package/dist/cli.js +111 -111
- package/package.json +1 -1
- package/skills/dreaming/SKILL.md +1 -0
- package/dashboard/_app/immutable/chunks/BMByhrGh.js +0 -1
- package/dashboard/_app/immutable/entry/start.Cfb-dCy3.js +0 -1
- package/dashboard/_app/immutable/nodes/2.Dmlt3o80.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as wt,g as $t,c as Fe,f as M,h as T,ai as Jt,s as Ht,i as e,b as r,d as kt,r as Ot,u as G,Q as Rt,v,w as x,x as m,y as b,z as p,t as o,k as E,j as c,l as d,L as Bt,o as ve,A as Ke,m as f,F as Ut,a as Qt,n as Xt,G as Yt,$ as Zt,J as at,P as er,aj as tr}from"./C0do9GyP.js";import{c as Wt,aa as rr,ab as ar,ac as sr,ad as or,B as Me,ae as nr,af as ir,ag as lr,ah as dr,a5 as l,ai as Ft,aj as ft,G as qt,ak as cr,al as vr,am as ur,n as At,an as gr,h as fr,i as pr,ao as jt,ap as mr,a2 as xr}from"./
|
|
1
|
+
import{p as wt,g as $t,c as Fe,f as M,h as T,ai as Jt,s as Ht,i as e,b as r,d as kt,r as Ot,u as G,Q as Rt,v,w as x,x as m,y as b,z as p,t as o,k as E,j as c,l as d,L as Bt,o as ve,A as Ke,m as f,F as Ut,a as Qt,n as Xt,G as Yt,$ as Zt,J as at,P as er,aj as tr}from"./C0do9GyP.js";import{c as Wt,aa as rr,ab as ar,ac as sr,ad as or,B as Me,ae as nr,af as ir,ag as lr,ah as dr,a5 as l,ai as Ft,aj as ft,G as qt,ak as cr,al as vr,am as ur,n as At,an as gr,h as fr,i as pr,ao as jt,ap as mr,a2 as xr}from"./Ct7xY6Hm.js";import{P as _r}from"./C7g2_hao.js";import{T as hr}from"./DaCh9nrQ.js";import{I as st}from"./C4uyLIdG.js";import{L as Be,T as Et}from"./CpS7sDIh.js";import{S as Gt,a as Vt,b as Kt,c as pt}from"./DMBJnINp.js";import{S as Lt}from"./CYqqyqga.js";import{B as Te}from"./FQvxlFN7.js";import{C as br,a as yr}from"./B3HbBOMJ.js";import{C as Mt,a as Nt}from"./DVl4v1fc.js";import{C as zt}from"./Bc8KH6lx.js";import{b as $r,P as wr,a as kr}from"./D5WnLd_c.js";function Pr(Je,_){wt(_,!0);let A=$t(_,"ref",15,null),be=$t(_,"data-slot",3,"separator"),B=Ot(_,["$$slots","$$events","$$legacy","ref","class","data-slot"]);var X=Fe(),ee=M(X);{let ke=G(()=>Wt("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:min-h-full data-[orientation=vertical]:w-px",_.class));T(ee,()=>Jt,(se,oe)=>{oe(se,Ht({get"data-slot"(){return be()},get class(){return e(ke)}},()=>B,{get ref(){return A()},set ref(De){A(De)}}))})}r(Je,X),kt()}var Sr=f("<!> <!>",1),Ir=f("<!> <!> <!>",1),Cr=f("<!> <!>",1),Tr=f('<div class="flex flex-col gap-1"><!> <!></div>'),Dr=f('Reason for change <span class="text-[var(--sig-accent)]">*</span>',1),Ar=f('<div class="flex flex-col gap-1"><!> <!></div> <div class="grid grid-cols-2 gap-3"><div class="flex flex-col gap-1"><!> <!></div> <div class="flex flex-col gap-1"><!> <!></div></div> <!> <div class="flex flex-col gap-1"><!> <!></div> <div class="flex items-center justify-between"><!> <!></div> <div class="flex flex-col gap-1"><!> <!></div>',1),Er=f('<span class="px-1.5 py-px border border-[var(--sig-border-strong)]"> </span>'),Mr=f(`This memory is <strong>pinned</strong>. Deleting it requires
|
|
2
2
|
force, which removes it permanently from search results.`,1),Nr=f('<div class="flex items-center gap-2"><!> <!></div>'),zr=f('Reason for deletion <span class="text-[var(--sig-accent)]">*</span>',1),Fr=f(`<div class="flex flex-col gap-2 p-3 border border-[var(--sig-border-strong)]
|
|
3
3
|
bg-[var(--sig-surface-raised)]"><p class="m-0 text-[var(--sig-text-bright)] text-[11px]
|
|
4
4
|
leading-[1.5] whitespace-pre-wrap break-words"> </p> <div class="flex flex-wrap gap-1 text-[9px]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as wn,o as v,e as Ie,Q as ne,v as n,j as l,G as hr,i as e,t as d,k as j,l as i,b as u,d as Sn,u as Q,D as fn,M as Y,L as Ar,m as b,N as Mn,g as cr,y as F,B as xt,f as be,w as gr,O as Bt,z as h,A as Mt,J as kt,c as pr,q as No,$ as Fo,h as Yt,X as Jt,af as Br,I as dr,ag as oa,U as un,ah as Po}from"./C0do9GyP.js";import{$ as Co,G as gn,n as sa,a0 as Lo,a1 as ia,a2 as Do,a3 as la,a4 as Ao,a5 as Ro,h as Oo,i as Yo,a6 as pn,a7 as Xo,a8 as jo,a9 as Ho,t as Mr}from"./DFVoJ7iC.js";import{P as Go}from"./C7g2_hao.js";import{T as zo}from"./DaCh9nrQ.js";import{C as Pr,a as Cr,b as Lr}from"./Byc4SxzP.js";import{w as kr,s as Bo}from"./5h3BgpLU.js";import{f as da,a as ca,b as ua,c as ga,e as pa,g as va}from"./qiR1fnXB.js";import{C as Dr}from"./zbW8Z43k.js";const Wr=600,Wo=5e3,fa="signet-embeddings-graph-physics",Ir={centerForce:.28,repelForce:-260,linkForce:.12,linkDistance:92},xn={"claude-code":"#5eada4",clawdbot:"#a78bfa",daemon:"#22c55e","signet-daemon":"#22c55e",openclaw:"#facc15","openclaw-memory":"#facc15",opencode:"#60a5fa",user:"#ef4444",manual:"#f472b6",unknown:"#737373"},xa=3600*1e3,qo=24*xa,ba=7*qo,ma=900*1e3,ha=6*xa;function bn(y){const o=(f,S,p)=>Math.min(p,Math.max(S,f));return{centerForce:o(y.centerForce,0,1),repelForce:o(y.repelForce,-600,-10),linkForce:o(y.linkForce,.01,1),linkDistance:o(y.linkDistance,12,280)}}function kn(y){const o=Number.parseInt(y.slice(1),16);return[o>>16&255,o>>8&255,o&255]}function ya(y,o){const[f,S,p]=kn(xn[y??"unknown"]??xn.unknown);return`rgba(${f}, ${S}, ${p}, ${o})`}function _a(y){if(!y)return null;const o=new Date(y).getTime();return Number.isNaN(o)?null:o}function Ko(y,o){const f=_a(y);if(f===null)return .22;const S=Math.max(0,o-f);return S<=ma?1:S<=ha?.76:S<=ba?.52:.22}function In(y){return y>=.95?"minutes":y>=.7?"hours":y>=.45?"week":"older"}function wa(y,o){const f=In(y);return f==="minutes"?`rgba(255, 176, 74, ${o})`:f==="hours"?`rgba(168, 34, 98, ${o})`:f==="week"?`rgba(76, 34, 122, ${o})`:`rgba(118, 111, 102, ${o})`}function Uo(y,o){if(o===null)return!1;const f=_a(y);return f===null?!1:f>o}function yr(y){const o=y.content??y.text??"";return o.length>160?`${o.slice(0,160)}...`:o}function Vo(y){const o=y.sourceType??"memory",f=y.sourceId??y.id;return`${o}:${f}`}function Jo(y,o,f,S,p,_){const U=f!==null&&!f.has(y),q=f!==null&&!f.has(o);if(U||q)return"rgba(120, 120, 120, 0.12)";if(_){const V=p.has(y),pe=p.has(o);return V&&pe?"rgba(220, 220, 220, 0.72)":"rgba(90, 90, 90, 0.08)"}return S.get(y)||S.get(o)?"rgba(200, 200, 200, 0.6)":"rgba(180, 180, 180, 0.4)"}const Kr={person:"#eab308",project:"#06b6d4",system:"#a855f7",tool:"#10b981",concept:"#f43f5e",skill:"#f59e0b",task:"#64748b",unknown:"#737373"};function mn(y){return Kr[y.toLowerCase()]??Kr.unknown}function qr(y,o){const f=mn(y),[S,p,_]=kn(f);return`rgba(${S}, ${p}, ${_}, ${o})`}function Qo(y,o){const f=.8+o*1.2;switch(y){case"uses":case"requires":return{color:"rgba(180, 180, 200, 0.35)",width:f,dash:[]};case"owned_by":return{color:"rgba(160, 160, 180, 0.25)",width:f+.4,dash:[]};case"blocks":return{color:"rgba(220, 100, 100, 0.4)",width:f,dash:[4,3]};case"informs":return{color:"rgba(100, 160, 220, 0.35)",width:f,dash:[2,3]};default:return{color:"rgba(150, 150, 160, 0.3)",width:f,dash:[]}}}function Zo(y){return 5+Math.min(y,1)*3}function $o(y){return 3+Math.min(y,1)}function es(y){const o=y.aspects.length+y.aspects.reduce((f,S)=>f+S.attributes.length*.5,0);return 10+Math.min(o,24)*.5}function ts(y){switch(y){case"entity":return-200;case"aspect":return-40;case"attribute":return-15;case"memory":return-5;default:return-5}}function Sa(y,o){const[f,S,p]=kn(y);return`rgba(${f}, ${S}, ${p}, ${o})`}const rs=[.85],ns=[.3,.5,.7,.75,.9],hn={};for(const[y,o]of Object.entries(xn)){const f={};for(const S of rs)f[S]=Sa(o,S);hn[y]=f}const yn={};for(const[y,o]of Object.entries(Kr)){const f={};for(const S of ns)f[S]=Sa(o,S);yn[y]=f}function _n(y,o){const S=hn[y??"unknown"]?.[o]??hn.unknown?.[o];return S||ya(y,o)}function mr(y,o){const f=y.toLowerCase(),S=yn[f]?.[o]??yn.unknown?.[o];return S||qr(y,o)}const as={minutes:{.9:"rgba(255, 176, 74, 0.9)",1:"rgba(255, 176, 74, 1)"},hours:{.9:"rgba(168, 34, 98, 0.9)",1:"rgba(168, 34, 98, 1)"},week:{.9:"rgba(76, 34, 122, 0.9)",1:"rgba(76, 34, 122, 1)"},older:{.9:"rgba(118, 111, 102, 0.9)",1:"rgba(118, 111, 102, 1)"}};function os(y,o){const f=In(y),S=as[f]?.[o];return S||wa(y,o)}function Ma(y){if(!y)return 0;const o=new Date(y).getTime();return Number.isNaN(o)?0:o}function ss(y,o){if(y===0)return .22;const f=Math.max(0,o-y);return f<=ma?1:f<=ha?.76:f<=ba?.52:.22}class is{fills;constructor(o,f,S,p,_,U,q,V,pe,ot){const ae=new Array(o.length);for(let Ae=0;Ae<o.length;Ae++){const Re=o[Ae];if(Re.nodeType&&Re.nodeType!=="memory"){ae[Ae]="";continue}ae[Ae]=this.compute(Re,f,S,p,_,U,q,V,pe,ot)}this.fills=ae}compute(o,f,S,p,_,U,q,V,pe,ot){const ae=o.data.id,Ae=p.get(ae)??null,Re=S!==null&&!S.has(ae),st=_.has(ae),Oe=q&&!U.has(ae);if(f===ae)return"rgba(255, 255, 255, 0.95)";if(Oe)return Re?"rgba(80, 80, 80, 0.08)":"rgba(95, 95, 95, 0.15)";if(Ae==="similar")return V==="none"?Re?"rgba(160, 170, 185, 0.3)":"rgba(198, 210, 228, 0.84)":Re?"rgba(129, 180, 255, 0.35)":"rgba(129, 180, 255, 0.9)";if(Ae==="dissimilar")return V==="none"?Re?"rgba(165, 150, 150, 0.28)":"rgba(208, 190, 190, 0.8)":Re?"rgba(255, 146, 146, 0.35)":"rgba(255, 146, 146, 0.9)";if(st)return Re?"rgba(220, 220, 220, 0.42)":"rgba(235, 235, 235, 0.95)";if(Re)return"rgba(120, 120, 120, 0.2)";if(V==="none")return"rgba(168, 168, 168, 0.82)";if(V==="newness"){const Je=o.createdMs??Ma(o.data.createdAt),Pt=ss(Je,pe);if(In(Pt)==="older"){const It=o.data.who??"unknown";if(ot!==null&&ot.has(It))return _n(It,.85)}return os(Pt,.9)}return _n(o.data.who,.85)}}const or=50;class ls{minX=-100;maxX=100;minY=-100;maxY=100;cells=new Map;cols=1;offsetX=0;offsetY=0;rebuild(o){if(this.cells.clear(),o.length===0){this.minX=-100,this.maxX=100,this.minY=-100,this.maxY=100,this.cols=1;return}let f=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,p=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(const q of o)q.x<f&&(f=q.x),q.x>S&&(S=q.x),q.y<p&&(p=q.y),q.y>_&&(_=q.y);const U=or;this.minX=f-U,this.maxX=S+U,this.minY=p-U,this.maxY=_+U,this.offsetX=this.minX,this.offsetY=this.minY,this.cols=Math.max(1,Math.ceil((this.maxX-this.minX)/or));for(const q of o){const V=Math.floor((q.x-this.offsetX)/or),ot=Math.floor((q.y-this.offsetY)/or)*this.cols+V,ae=this.cells.get(ot);ae?ae.push(q):this.cells.set(ot,[q])}}query(o,f,S){const p=S+or*.5,_=Math.floor((o-p-this.offsetX)/or),U=Math.floor((o+p-this.offsetX)/or),q=Math.floor((f-p-this.offsetY)/or),V=Math.floor((f+p-this.offsetY)/or),pe=Math.ceil((this.maxY-this.minY)/or),ot=[];for(let ae=Math.max(0,q);ae<=V&&ae<pe;ae++)for(let Ae=Math.max(0,_);Ae<=Math.min(this.cols-1,U);Ae++){const Re=this.cells.get(ae*this.cols+Ae);if(Re)for(const st of Re)ot.push(st)}return ot}}function vn(y,o,f,S){y.beginPath();for(let p=0;p<6;p++){const _=Math.PI/3*p-Math.PI/6,U=o+S*Math.cos(_),q=f+S*Math.sin(_);p===0?y.moveTo(U,q):y.lineTo(U,q)}y.closePath()}var ds=b('<canvas class="minimap svelte-reb91a" aria-label="Graph navigation minimap"></canvas>'),cs=b('<div class="canvas-wrapper svelte-reb91a"><canvas class="main-canvas svelte-reb91a"></canvas> <!></div>');function us(y,o){wn(o,!0);let f=v(null),S=0,p=0,_=.15,U=!1,q=!1,V=!1,pe=null,ot=0,ae=0,Ae=0,Re=0;const st=4;let Oe=null,Je=0,Pt=null,It=!1,tr=0,Te=!0,Qt=null,bt=!1,Wt=new Map;const mt=new ls;let Xt=!0,jt=null,ht=[],G=[],Z=[],ue=0,ze=0,dt=!1;const xe=160,Ye=120,Be=50;let Ze=v(null),Xe=!0,$e=0;const ct=4;let Ct=v(Ie({minX:-100,maxX:100,minY:-100,maxY:100}));const me=Q(()=>o.nodes.length>Be);let Ue=!1;function ve(){if(Te=!0,Xe=!0,!Je){const s=e(f)?.getContext("2d");s&&(Je=requestAnimationFrame(I=>$(s,I)))}}const ut=12e3,ie=8e3,Ee=5e3;function ye(){S=0,p=0,_=.15,bt=!1,je=!1}let je=!1;function it(s){const I=Wt.get(s);I&&(S=I.x,p=I.y,_=Math.max(_,1.6),bt=!0)}function Tt(s,I,B=o.graphPhysics){Oe?.stop(),je=!1;const de=bn(B);Oe=da(s).force("link",ca(I).distance(de.linkDistance).strength(de.linkForce)).force("charge",ua().strength(de.repelForce)).force("x",ga(0).strength(de.centerForce)).force("y",pa(0).strength(de.centerForce)).force("collide",va().radius(H=>H.radius+2)).alphaDecay(.04).on("tick",()=>{Xt=!0,jt=null,ve()}).on("end",()=>{bt||gt()})}function yt(s,I){Oe?.stop(),je=!1;const B=ca(I).distance(H=>{const _e=H.source,ge=H.target;return H.edgeType==="dependency"?120:_e.nodeType==="entity"&&ge.nodeType==="aspect"?50:_e.nodeType==="aspect"&&ge.nodeType==="attribute"?30:_e.nodeType==="attribute"&&ge.nodeType==="memory"?20:50}).strength(H=>{if(H.edgeType==="dependency")return .05;const _e=H.source,ge=H.target;return _e.nodeType==="entity"&&ge.nodeType==="aspect"?.3:_e.nodeType==="aspect"&&ge.nodeType==="attribute"?.4:_e.nodeType==="attribute"&&ge.nodeType==="memory"?.5:.3}),de=ua().strength(H=>ts(H.nodeType));Oe=da(s).force("link",B).force("charge",de).force("x",ga(0).strength(.03)).force("y",pa(0).strength(.03)).force("collide",va().radius(H=>H.radius+2)).alphaDecay(.04).on("tick",()=>{Xt=!0,jt=null,ve()}).on("end",()=>{bt||gt()})}function Lt(s){Oe&&(Tt(o.nodes,o.edges,s),ve())}function fe(){Oe?.stop(),Oe=null}function He(s=!1){lt(),!s&&!bt&&o.nodes.length>0&>(),It||(window.addEventListener("resize",lt),It=!0),_t(),Te=!0;const I=e(f)?.getContext("2d");I&&(cancelAnimationFrame(Je),$(I,0))}function We(){Te=!0;const s=e(f)?.getContext("2d");s&&(cancelAnimationFrame(Je),$(s,0))}function Dt(){cancelAnimationFrame(Je)}function lt(){if(!e(f))return;let s=e(f).parentElement;for(;s&&getComputedStyle(s).display==="contents";)s=s.parentElement;const I=s?.getBoundingClientRect();!I||I.width===0||(e(f).width=I.width,e(f).height=I.height,!bt&&je&>(),ve())}function gt(){if(!e(f))return;if(o.nodes.length===0){S=0,p=0,_=.15;return}const s=Ht(),I=Math.max(s.maxX-s.minX,1),B=Math.max(s.maxY-s.minY,1),de=Math.max(e(f).width,1),H=Math.max(e(f).height,1),_e=Math.min(de/I,H/B)*.92;S=(s.minX+s.maxX)/2,p=(s.minY+s.maxY)/2,_=Math.max(.08,_e),je=!0}function et(s,I){if(!e(f))return[0,0];const B=e(f).getBoundingClientRect(),de=B.width/2,H=B.height/2;return[(s-B.left-de)/_+S,(I-B.top-H)/_+p]}function tt(s,I){Xt&&(mt.rebuild(o.nodes),Xt=!1);const B=mt.query(s,I,28),de=["entity","aspect","attribute","memory",void 0];for(const H of de)for(let _e=B.length-1;_e>=0;_e--){const ge=B[_e];if(ge.nodeType!==H)continue;const se=ge.x-s,qe=ge.y-I,P=ge.radius+(H==="entity"?6:H==="aspect"?5:4);if(se*se+qe*qe<=P*P)return ge}return null}function Ht(){return o.nodes.length===0?{minX:-100,maxX:100,minY:-100,maxY:100}:Xt?(mt.rebuild(o.nodes),Xt=!1,{minX:mt.minX,maxX:mt.maxX,minY:mt.minY,maxY:mt.maxY}):{minX:mt.minX,maxX:mt.maxX,minY:mt.minY,maxY:mt.maxY}}ne(()=>{o.nodes.length>0&&(Wt=new Map(o.nodes.map(s=>[s.data.id,s])),Xt=!0,jt=null,n(Ct,Ht(),!0),Xe=!0)});function $t(){if(!e(Ze)||!e(f))return;const s=e(Ze).getContext("2d");if(!s)return;const{minX:I,maxX:B,minY:de,maxY:H}=e(Ct),_e=B-I,ge=H-de;s.fillStyle="#050505",s.fillRect(0,0,xe,Ye);const se=(xe-8)/_e,qe=(Ye-8)/ge,P=Math.min(se,qe),Ke=(xe-_e*P)/2,x=(Ye-ge*P)/2;s.fillStyle="rgba(140, 140, 150, 0.5)";for(const sr of o.nodes){const Rr=Ke+(sr.x-I)*P,Or=x+(sr.y-de)*P;s.fillRect(Rr-.5,Or-.5,1,1)}const K=e(f).width/_,W=e(f).height/_,C=S-K/2,O=p-W/2;let X=Ke+(C-I)*P,we=x+(O-de)*P,Nt=K*P,Ut=W*P;const vt=2;X=Math.max(vt,Math.min(xe-vt-1,X)),we=Math.max(vt,Math.min(Ye-vt-1,we)),Nt=Math.max(2,Math.min(xe-X-vt,Nt)),Ut=Math.max(2,Math.min(Ye-we-vt,Ut)),s.strokeStyle="rgba(255, 255, 255, 0.75)",s.lineWidth=1.5,s.strokeRect(X,we,Nt,Ut),s.fillStyle="rgba(255, 255, 255, 0.03)",s.fillRect(X,we,Nt,Ut)}function E(s){if(!e(Ze))return null;const I=e(Ze).getBoundingClientRect(),B=s.clientX-I.left,de=s.clientY-I.top,{minX:H,maxX:_e,minY:ge,maxY:se}=e(Ct),qe=_e-H,P=se-ge,Ke=(xe-8)/qe,x=(Ye-8)/P,K=Math.min(Ke,x),W=(xe-qe*K)/2,C=(Ye-P*K)/2,O=H+(B-W)/K,X=ge+(de-C)/K;return[O,X]}function oe(s){s.preventDefault(),s.stopPropagation(),Ue=!0,qt(s)}function Ge(s){Ue&&qt(s)}function qt(s){const I=E(s);if(!I)return;const[B,de]=I;if(S=B,p=de,Xe=!0,Te=!0,!Je){const H=e(f)?.getContext("2d");H&&(Je=requestAnimationFrame(_e=>$(H,_e)))}}function Et(){Ue=!1}function $(s,I){if(!e(f))return;const B=Oe?.alpha?.()??0;if(!(B>.001)&&!Te){Je=0;return}Te=!1;const H=o.edges.length>14e3||o.nodes.length>2200,_e=B>0&&B<.05,ge=H||_e?33:16;if(I>0&&I-tr<ge){Je=requestAnimationFrame(x=>$(s,x));return}if(tr=I,dt){dt=!1;const[x,K]=et(ue,ze),W=tt(x,K),C=W?.data.id??null;C!==Qt&&(Qt=C,o.onhovernode(W?.data??null)),e(f)&&(e(f).style.cursor=W?"pointer":"grab")}const se=e(f).width,qe=e(f).height;s.fillStyle="#050505",s.fillRect(0,0,se,qe),s.save(),s.translate(se/2,qe/2),s.scale(_,_),s.translate(-S,-p);const P=o.graphSelected?.id??null;jt||(jt=new is(o.nodes,P,o.embeddingFilterIds,o.relationLookup,o.pinnedIds,o.lensIds,o.clusterLensMode,o.colorMode,o.nowMs,o.sourceFocusSources));const Ke=_>=1.4?ut:_>=.8?ie:Ee;if(ht.length>0){const x=Math.max(1,Math.ceil(ht.length/Ke));s.beginPath();for(let K=0;K<ht.length;K+=x){const W=ht[K],C=W.source,O=W.target;typeof C=="number"||typeof O=="number"||!C||!O||(s.moveTo(C.x,C.y),s.lineTo(O.x,O.y))}s.strokeStyle="rgba(255, 255, 255, 0.03)",s.lineWidth=.4/_,s.stroke()}if(G.length>0){const x=Math.max(1,Math.ceil(G.length/Ke)),K=new Map;for(let W=0;W<G.length;W+=x){const C=G[W],O=C.source,X=C.target;if(typeof O=="number"||typeof X=="number"||!O||!X)continue;const we=Jo(O.data.id,X.data.id,o.embeddingFilterIds,o.relationLookup,o.lensIds,o.clusterLensMode),Nt=K.get(we);Nt?Nt.push([O.x,O.y,X.x,X.y]):K.set(we,[[O.x,O.y,X.x,X.y]])}s.lineWidth=.8/_;for(const[W,C]of K){s.beginPath();for(const[O,X,we,Nt]of C)s.moveTo(O,X),s.lineTo(we,Nt);s.strokeStyle=W,s.stroke()}}if(Z.length>0){const x=Math.max(1,Math.floor(Ke/4)),K=Math.max(1,Math.ceil(Z.length/x));for(let W=0;W<Z.length;W+=K){const C=Z[W],O=C.source,X=C.target;if(typeof O=="number"||typeof X=="number"||!O||!X)continue;const we=Qo(C.dependencyType??"",C.strength??.5);s.beginPath(),we.dash.length>0&&s.setLineDash(we.dash.map(Nt=>Nt/_)),s.moveTo(O.x,O.y),s.lineTo(X.x,X.y),s.strokeStyle=we.color,s.lineWidth=we.width/_,s.stroke(),we.dash.length>0&&s.setLineDash([])}}{const x=new Map,K=[],W=[];let C=null;for(let O=0;O<o.nodes.length;O++){const X=o.nodes[O];if(X.nodeType!=="memory"&&X.nodeType!==void 0)continue;const we=jt.fills[O],Nt=x.get(we);Nt?Nt.push(X):x.set(we,[X]),o.colorMode!=="none"&&o.showNewSinceLastSeen&&Uo(X.data.createdAt,o.lastSeenMs)&&K.push(X),o.pinnedIds.has(X.data.id)&&W.push(X),P===X.data.id&&(C=X)}for(const[O,X]of x){s.beginPath();for(const we of X)s.moveTo(we.x+we.radius,we.y),s.arc(we.x,we.y,we.radius,0,Math.PI*2);s.fillStyle=O,s.fill()}if(K.length>0){s.beginPath();for(const O of K)s.moveTo(O.x+O.radius+2.2,O.y),s.arc(O.x,O.y,O.radius+2.2,0,Math.PI*2);s.strokeStyle="rgba(246, 194, 107, 0.85)",s.lineWidth=1.1/_,s.stroke()}if(W.length>0){s.strokeStyle="rgba(240, 240, 240, 0.8)",s.lineWidth=1.2/_;for(const O of W){const X=(O.radius+2.5)*2;s.strokeRect(O.x-X/2,O.y-X/2,X,X)}}C&&(s.beginPath(),s.arc(C.x,C.y,C.radius+3,0,Math.PI*2),s.strokeStyle="rgba(255, 255, 255, 0.95)",s.lineWidth=1.5/_,s.stroke())}for(const x of o.nodes){if(x.nodeType!=="attribute")continue;const K=x.data.who??"unknown";s.beginPath(),s.arc(x.x,x.y,x.radius,0,Math.PI*2),s.fillStyle=mr(K,.3),s.fill(),s.strokeStyle=mr(K,.5),s.lineWidth=.6/_,s.stroke(),P===x.data.id&&(s.beginPath(),s.arc(x.x,x.y,x.radius+3,0,Math.PI*2),s.strokeStyle="rgba(255, 255, 255, 0.95)",s.lineWidth=1.5/_,s.stroke())}for(const x of o.nodes){if(x.nodeType!=="aspect")continue;const K=x.data.who??"unknown";if(s.beginPath(),s.arc(x.x,x.y,x.radius,0,Math.PI*2),s.fillStyle=mr(K,.5),s.fill(),s.strokeStyle=mr(K,.75),s.lineWidth=.8/_,s.stroke(),P===x.data.id&&(s.beginPath(),s.arc(x.x,x.y,x.radius+3,0,Math.PI*2),s.strokeStyle="rgba(255, 255, 255, 0.95)",s.lineWidth=1.5/_,s.stroke()),o.graphHovered&&x.data.id===o.graphHovered.id||P===x.data.id){const W=Math.max(7,9/_);s.font=`${W}px var(--font-mono)`,s.fillStyle="rgba(210, 210, 210, 0.85)",s.textAlign="center",s.fillText(x.aspectData?.name??"",x.x,x.y+x.radius+W+1/_),s.textAlign="start"}}for(const x of o.nodes){if(x.nodeType!=="entity")continue;const K=x.entityData?.entityType??"unknown";s.save(),s.shadowColor=mr(K,.5),s.shadowBlur=12/_,vn(s,x.x,x.y,x.radius),s.fillStyle=mr(K,.7),s.fill(),s.restore(),vn(s,x.x,x.y,x.radius),s.strokeStyle=mr(K,.9),s.lineWidth=1.2/_,s.stroke(),P===x.data.id&&(vn(s,x.x,x.y,x.radius+4),s.strokeStyle="rgba(255, 255, 255, 0.95)",s.lineWidth=1.5/_,s.stroke());const W=Math.max(8,10/_);s.font=`bold ${W}px var(--font-mono)`,s.fillStyle="rgba(230, 230, 230, 0.9)",s.textAlign="center",s.fillText(x.entityData?.name??"",x.x,x.y+x.radius+W+2/_),s.textAlign="start"}if(o.graphHovered){const x=Wt.get(o.graphHovered.id);if(x&&x.nodeType!=="entity"&&x.nodeType!=="aspect"){const K=x.nodeType==="attribute"?x.attributeData?.content??yr(o.graphHovered):yr(o.graphHovered),W=9/_;s.font=`${W}px var(--font-mono)`,s.fillStyle="rgba(220, 220, 220, 0.9)",s.textAlign="left";const C=80;s.fillText(K.length>C?`${K.slice(0,C)}...`:K,x.x+x.radius+5/_,x.y+W*.35),s.textAlign="start"}}s.restore(),e(me)&&($e++,(Xe||$e>=ct)&&($t(),Xe=!1,$e=0)),Je=requestAnimationFrame(x=>$(s,x))}function _t(){if(!e(f))return;Pt&&(Pt(),Pt=null);const s=e(f),I=se=>{const[qe,P]=et(se.clientX,se.clientY),Ke=tt(qe,P);V=!1,Ke?(q=!0,pe=Ke,ot=se.clientX,ae=se.clientY):(U=!0,ot=se.clientX,ae=se.clientY,Ae=S,Re=p)},B=se=>{if(q&&pe){const qe=se.clientX-ot,P=se.clientY-ae;if(!V&&qe*qe+P*P<st*st)return;V||(V=!0,bt=!0,pe.fx=pe.x,pe.fy=pe.y,Oe?.alphaTarget(.3).restart());const[Ke,x]=et(se.clientX,se.clientY);pe.fx=Ke,pe.fy=x,ve();return}if(U){bt=!0,S=Ae-(se.clientX-ot)/_,p=Re-(se.clientY-ae)/_,ve();return}ue=se.clientX,ze=se.clientY,dt=!0,ve()},de=()=>{if(q&&pe){V&&(pe.fx=null,pe.fy=null,Oe?.alphaTarget(0)),pe=null,q=!1,ve();return}U=!1},H=()=>{U=!1,Qt!==null&&(Qt=null,o.onhovernode(null))},_e=se=>{if(V)return;const[qe,P]=et(se.clientX,se.clientY),Ke=tt(qe,P);o.onselectnode(Ke?.data??null)},ge=se=>{se.preventDefault(),bt=!0;const qe=se.deltaY>0?.9:1.1,P=Math.max(.1,Math.min(5,_*qe)),Ke=s.getBoundingClientRect(),x=Ke.width/2,K=Ke.height/2,W=se.clientX-Ke.left-x,C=se.clientY-Ke.top-K,O=W/_+S,X=C/_+p;_=P,S=O-W/_,p=X-C/_,ve()};s.addEventListener("pointerdown",I),s.addEventListener("pointermove",B),s.addEventListener("pointerup",de),s.addEventListener("pointerleave",H),s.addEventListener("click",_e),s.addEventListener("wheel",ge,{passive:!1}),Pt=()=>{s.removeEventListener("pointerdown",I),s.removeEventListener("pointermove",B),s.removeEventListener("pointerup",de),s.removeEventListener("pointerleave",H),s.removeEventListener("click",_e),s.removeEventListener("wheel",ge)}}ne(()=>{o.graphSelected,o.graphHovered,o.embeddingFilterIds,o.relationLookup,o.pinnedIds,o.lensIds,o.clusterLensMode,jt=null,ve()}),ne(()=>{const s=o.edges,I=[],B=[],de=[];for(const H of s)H.edgeType==="hierarchy"?I.push(H):H.edgeType==="dependency"?de.push(H):B.push(H);ht=I,G=B,Z=de}),ne(()=>()=>{Oe?.stop(),Oe=null,Pt&&(Pt(),Pt=null),It&&(window.removeEventListener("resize",lt),It=!1),cancelAnimationFrame(Je)});var rr={resetCamera:ye,focusNode:it,startSimulation:Tt,startKnowledgeGraphSimulation:yt,updatePhysics:Lt,stopSimulation:fe,startRendering:He,resumeRendering:We,stopRendering:Dt,requestRedraw:ve},nr=cs(),ar=l(nr);hr(ar,s=>n(f,s),()=>e(f));var Kt=d(ar,2);{var pt=s=>{var I=ds();fn(I,"width",xe),fn(I,"height",Ye),hr(I,B=>n(Ze,B),()=>e(Ze)),Y("mousedown",I,oe),Y("mousemove",I,Ge),Y("mouseup",I,Et),Ar("mouseleave",I,Et),u(s,I)};j(Kt,s=>{e(me)&&s(pt)})}return i(nr),u(y,nr),Sn(rr)}Mn(["mousedown","mousemove","mouseup"]);var gs=b('<button class="text-[11px] text-[var(--sig-accent)] bg-transparent border-none cursor-pointer p-0 hover:underline">Clear</button>'),ps=b('<span class="font-mono text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),vs=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),fs=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase"> </div> <div class="flex flex-col gap-2"></div>',1),xs=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),bs=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Dependencies</div> <div class="flex flex-col gap-2"></div>',1),ms=b('<div class="flex flex-wrap gap-[6px]"><span class="font-mono text-[10px] border px-[7px] py-[2px]"> </span> <!></div> <div class="font-mono text-[14px] text-[var(--sig-text-bright)] font-bold"> </div> <div class="grid grid-cols-3 gap-1 text-[10px] font-mono text-[var(--sig-text-muted)]"><div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>aspects</div></div> <div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>attributes</div></div> <div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>deps</div></div></div> <div class="flex gap-2"><button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!> <!>',1),hs=b('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-text-muted)] uppercase">Parent entity</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),ys=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),_s=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase"> </div> <div class="flex flex-col gap-2"></div>',1),ws=b('<div class="flex flex-wrap gap-[6px]"><span class="font-mono text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]">aspect</span> <span class="font-mono text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span></div> <div class="font-mono text-[14px] text-[var(--sig-text-bright)] font-bold"> </div> <!> <div class="flex gap-2"><button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!>',1),Ss=b('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-text-muted)] uppercase">Parent entity</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),Ms=b('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-text-muted)] uppercase">Parent aspect</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),ks=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Linked memory</div> <button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>',1),Is=b('<div class="flex flex-wrap gap-[6px]"><span class="font-mono text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span> <span class="font-mono text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span></div> <p class="m-0 text-[13px] leading-[1.55] text-[var(--sig-text-bright)] whitespace-pre-wrap break-words"> </p> <!> <!> <div class="flex gap-2"><button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!>',1),Ts=b('<span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span>'),Es=b('<span class="font-mono text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),Ns=b('<span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span>'),Fs=b('<div class="flex flex-wrap gap-[6px]"></div>'),Ps=b('<div class="border border-dashed border-[var(--sig-danger)] p-2 text-[11px] text-[var(--sig-danger)] leading-[1.5]"> </div>'),Cs=b('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">No related memories in this view.</div>'),Ls=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Ds=b('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">Finding similar memories...</div>'),As=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap">global</span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Rs=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Global similar</div> <div class="flex flex-col gap-2"></div>',1),Os=b('<div class="flex flex-wrap gap-[6px]"><span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span> <!> <span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span> <!></div> <div class="font-mono text-[10px] text-[var(--sig-accent)] border border-[var(--sig-border-strong)] px-[7px] py-[5px] bg-transparent break-all"> </div> <p class="m-0 text-[13px] leading-[1.55] text-[var(--sig-text-bright)] whitespace-pre-wrap break-words"> </p> <!> <div class="flex gap-2"><button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed">Center</button> <button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed"> </button> <button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed"> </button></div> <!> <div class="self-start flex border border-[var(--sig-border-strong)] overflow-hidden"><button>Similar</button> <button>Dissimilar</button></div> <div class="flex flex-col gap-2"><!></div> <!>',1),Ys=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Xs=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Search matches</div> <div class="flex flex-col gap-2"></div>',1),js=b('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">Select a node to inspect content, source metadata, and similar or dissimilar neighbors.</div> <!>',1),Hs=b('<aside><div class="flex items-center justify-between gap-2"><span class="font-mono text-[11px] tracking-[0.06em] uppercase text-[var(--sig-text)]">Inspector</span> <!></div> <!></aside>');function Gs(y,o){wn(o,!0);let f=cr(o,"containerClass",3,""),S=cr(o,"selectedNodeType",3,void 0),p=cr(o,"selectedEntityData",3,null),_=cr(o,"selectedAspectData",3,null),U=cr(o,"selectedAttributeData",3,null),q=cr(o,"parentEntityId",3,null),V=cr(o,"parentAspectId",3,null),pe=cr(o,"constellationOverlay",3,null);const ot=Q(()=>S()==="entity"&&p()!==null),ae=Q(()=>S()==="aspect"&&_()!==null),Ae=Q(()=>S()==="attribute"&&U()!==null),Re=Q(()=>{if(!p()||!pe())return[];const G=p().id;return pe().dependencies.filter(Z=>Z.sourceEntityId===G||Z.targetEntityId===G)}),st=Q(()=>!q()||!pe()?null:pe().entities.find(G=>G.id===q())??null),Oe=Q(()=>!V()||!e(st)?null:e(st).aspects.find(G=>G.id===V())??null);function Je(G){return pe()?pe().entities.find(ue=>ue.id===G)?.name??G:G}function Pt(G){return o.embeddingById.get(G)??null}var It=Hs(),tr=l(It),Te=d(l(tr),2);{var Qt=G=>{var Z=gs();Y("click",Z,function(...ue){o.onclearselection?.apply(this,ue)}),u(G,Z)};j(Te,G=>{o.graphSelected&&G(Qt)})}i(tr);var bt=d(tr,2);{var Wt=G=>{var Z=ms(),ue=be(Z),ze=l(ue),dt=l(ze,!0);i(ze);var xe=d(ze,2);{var Ye=fe=>{var He=ps();u(fe,He)};j(xe,fe=>{p().pinned&&fe(Ye)})}i(ue);var Be=d(ue,2),Ze=l(Be,!0);i(Be);var Xe=d(Be,2),$e=l(Xe),ct=l($e),Ct=l(ct,!0);i(ct),gr(2),i($e);var me=d($e,2),Ue=l(me),ve=l(Ue,!0);i(Ue),gr(2),i(me);var ut=d(me,2),ie=l(ut),Ee=l(ie,!0);i(ie),gr(2),i(ut),i(Xe);var ye=d(Xe,2),je=l(ye);i(ye);var it=d(ye,2);{var Tt=fe=>{var He=fs(),We=be(He),Dt=l(We);i(We);var lt=d(We,2);Mt(lt,21,()=>p().aspects,kt,(gt,et)=>{var tt=vs(),Ht=l(tt),$t=l(Ht);i(Ht);var E=d(Ht,2),oe=l(E,!0);i(E),i(tt),F(Ge=>{h($t,`w${Ge??""}%`),h(oe,e(et).name)},[()=>Math.round(e(et).weight*100)]),Y("click",tt,()=>o.onselectembedding(`aspect:${e(et).id}`)),u(gt,tt)}),i(lt),F(()=>h(Dt,`Aspects (${p().aspects.length??""})`)),u(fe,He)};j(it,fe=>{p().aspects.length>0&&fe(Tt)})}var yt=d(it,2);{var Lt=fe=>{var He=bs(),We=d(be(He),2);Mt(We,21,()=>e(Re),kt,(Dt,lt)=>{const gt=Q(()=>e(lt).sourceEntityId===p().id),et=Q(()=>e(gt)?e(lt).targetEntityId:e(lt).sourceEntityId);var tt=xs(),Ht=l(tt),$t=l(Ht);i(Ht);var E=d(Ht,2),oe=l(E,!0);i(E),i(tt),F(Ge=>{h($t,`${e(gt)?"->":"<-"} ${e(lt).dependencyType??""}`),h(oe,Ge)},[()=>Je(e(et))]),Y("click",tt,()=>o.onselectembedding(`entity:${e(et)}`)),u(Dt,tt)}),i(We),u(fe,He)};j(yt,fe=>{e(Re).length>0&&fe(Lt)})}F((fe,He)=>{Bt(ze,fe),h(dt,p().entityType),h(Ze,p().name),h(Ct,p().aspects.length),h(ve,He),h(Ee,e(Re).length)},[()=>`color: ${mn(p().entityType)}; border-color: ${mn(p().entityType)}; background: rgba(255,255,255,0.04);`,()=>p().aspects.reduce((fe,He)=>fe+He.attributes.length,0)]),Y("click",je,function(...fe){o.onfocusembedding?.apply(this,fe)}),u(G,Z)},mt=G=>{var Z=ws(),ue=be(Z),ze=d(l(ue),2),dt=l(ze);i(ze),i(ue);var xe=d(ue,2),Ye=l(xe,!0);i(xe);var Be=d(xe,2);{var Ze=me=>{var Ue=hs(),ve=d(l(Ue),2),ut=l(ve,!0);i(ve),i(Ue),F(()=>h(ut,e(st).name)),Y("click",Ue,()=>e(st)&&o.onselectembedding(`entity:${e(st).id}`)),u(me,Ue)};j(Be,me=>{e(st)&&me(Ze)})}var Xe=d(Be,2),$e=l(Xe);i(Xe);var ct=d(Xe,2);{var Ct=me=>{var Ue=_s(),ve=be(Ue),ut=l(ve);i(ve);var ie=d(ve,2);Mt(ie,21,()=>_().attributes,kt,(Ee,ye)=>{var je=ys(),it=l(je),Tt=l(it,!0);i(it);var yt=d(it,2),Lt=l(yt,!0);i(yt),i(je),F(()=>{h(Tt,e(ye).kind),h(Lt,e(ye).content)}),Y("click",je,()=>o.onselectembedding(`attr:${e(ye).id}`)),u(Ee,je)}),i(ie),F(()=>h(ut,`Attributes (${_().attributes.length??""})`)),u(me,Ue)};j(ct,me=>{_().attributes.length>0&&me(Ct)})}F(me=>{h(dt,`weight ${me??""}%`),h(Ye,_().name)},[()=>Math.round(_().weight*100)]),Y("click",$e,function(...me){o.onfocusembedding?.apply(this,me)}),u(G,Z)},Xt=G=>{var Z=Is(),ue=be(Z),ze=l(ue),dt=l(ze,!0);i(ze);var xe=d(ze,2),Ye=l(xe);i(xe),i(ue);var Be=d(ue,2),Ze=l(Be,!0);i(Be);var Xe=d(Be,2);{var $e=ie=>{var Ee=Ss(),ye=d(l(Ee),2),je=l(ye,!0);i(ye),i(Ee),F(()=>h(je,e(st).name)),Y("click",Ee,()=>e(st)&&o.onselectembedding(`entity:${e(st).id}`)),u(ie,Ee)};j(Xe,ie=>{e(st)&&ie($e)})}var ct=d(Xe,2);{var Ct=ie=>{var Ee=Ms(),ye=d(l(Ee),2),je=l(ye,!0);i(ye),i(Ee),F(()=>h(je,e(Oe).name)),Y("click",Ee,()=>e(Oe)&&o.onselectembedding(`aspect:${e(Oe).id}`)),u(ie,Ee)};j(ct,ie=>{e(Oe)&&ie(Ct)})}var me=d(ct,2),Ue=l(me);i(me);var ve=d(me,2);{var ut=ie=>{const Ee=Q(()=>o.embeddingById.get(U().memoryId));var ye=pr(),je=be(ye);{var it=Tt=>{var yt=ks(),Lt=d(be(yt),2),fe=l(Lt),He=l(fe,!0);i(fe);var We=d(fe,2),Dt=l(We,!0);i(We),i(Lt),F(lt=>{h(He,e(Ee).who??"memory"),h(Dt,lt)},[()=>yr(e(Ee))]),Y("click",Lt,()=>e(Ee)&&o.onselectembedding(e(Ee).id)),u(Tt,yt)};j(je,Tt=>{e(Ee)&&Tt(it)})}u(ie,ye)};j(ve,ie=>{U().memoryId&&ie(ut)})}F(ie=>{h(dt,U().kind),h(Ye,`importance ${ie??""}%`),h(Ze,U().content)},[()=>Math.round(U().importance*100)]),Y("click",Ue,function(...ie){o.onfocusembedding?.apply(this,ie)}),u(G,Z)},jt=G=>{var Z=Os(),ue=be(Z),ze=l(ue),dt=l(ze,!0);i(ze);var xe=d(ze,2);{var Ye=E=>{var oe=Ts(),Ge=l(oe,!0);i(oe),F(()=>h(Ge,o.graphSelected.type)),u(E,oe)};j(xe,E=>{o.graphSelected.type&&E(Ye)})}var Be=d(xe,2),Ze=l(Be);i(Be);var Xe=d(Be,2);{var $e=E=>{var oe=Es();u(E,oe)};j(Xe,E=>{o.graphSelected.pinned&&E($e)})}i(ue);var ct=d(ue,2),Ct=l(ct,!0);i(ct);var me=d(ct,2),Ue=l(me,!0);i(me);var ve=d(me,2);{var ut=E=>{var oe=Fs();Mt(oe,21,()=>o.graphSelected.tags.slice(0,8),kt,(Ge,qt)=>{var Et=Ns(),$=l(Et);i(Et),F(()=>h($,`#${e(qt)??""}`)),u(Ge,Et)}),i(oe),u(E,oe)};j(ve,E=>{o.graphSelected.tags?.length&&E(ut)})}var ie=d(ve,2),Ee=l(ie),ye=d(Ee,2),je=l(ye,!0);i(ye);var it=d(ye,2),Tt=l(it,!0);i(it),i(ie);var yt=d(ie,2);{var Lt=E=>{var oe=Ps(),Ge=l(oe,!0);i(oe),F(()=>h(Ge,o.pinError)),u(E,oe)};j(yt,E=>{o.pinError&&E(Lt)})}var fe=d(yt,2),He=l(fe),We=d(He,2);i(fe);var Dt=d(fe,2),lt=l(Dt);{var gt=E=>{var oe=Cs();u(E,oe)},et=E=>{var oe=pr(),Ge=be(oe);Mt(Ge,17,()=>o.activeNeighbors,kt,(qt,Et)=>{const $=Q(()=>Pt(e(Et).id));var _t=pr(),rr=be(_t);{var nr=ar=>{var Kt=Ls(),pt=l(Kt),s=l(pt,!0);i(pt);var I=d(pt,2),B=l(I,!0);i(I),i(Kt),F((de,H)=>{h(s,de),h(B,H)},[()=>Math.round(e(Et).score*1e3)/1e3,()=>yr(e($))]),Y("click",Kt,()=>o.onselectembedding(e($).id)),u(ar,Kt)};j(rr,ar=>{e($)&&ar(nr)})}u(qt,_t)}),u(E,oe)};j(lt,E=>{o.activeNeighbors.length===0?E(gt):E(et,-1)})}i(Dt);var tt=d(Dt,2);{var Ht=E=>{var oe=Ds();u(E,oe)},$t=E=>{var oe=Rs(),Ge=d(be(oe),2);Mt(Ge,21,()=>o.globalSimilar,kt,(qt,Et)=>{var $=As(),_t=d(l($),2),rr=l(_t,!0);i(_t),i($),F(()=>h(rr,e(Et).content)),Y("click",$,()=>o.onopenglobalsimilar(e(Et))),u(qt,$)}),i(Ge),u(E,oe)};j(tt,E=>{o.loadingGlobalSimilar?E(Ht):o.globalSimilar.length>0&&E($t,1)})}F((E,oe)=>{h(dt,o.graphSelected.who??"unknown"),h(Ze,`importance ${E??""}%`),h(Ct,oe),h(Ue,o.graphSelected.content??o.graphSelected.text??"(No content preview available)"),ye.disabled=o.pinBusy,h(je,o.pinBusy?"Saving...":o.graphSelected.pinned?"Unpin":"Pin"),it.disabled=o.loadingGlobalSimilar,h(Tt,o.loadingGlobalSimilar?"Loading...":"Global similar"),xt(He,1,`px-2 py-0.5 text-[10px] font-medium font-mono bg-transparent border-none cursor-pointer tracking-[0.04em] hover:text-[var(--sig-text)] hover:bg-[var(--sig-surface-raised)] ${o.relationMode==="similar"?"text-[var(--sig-text-bright)] bg-[var(--sig-surface-raised)]":"text-[var(--sig-text-muted)]"}`),xt(We,1,`px-2 py-0.5 text-[10px] font-medium font-mono bg-transparent border-none cursor-pointer tracking-[0.04em] hover:text-[var(--sig-text)] hover:bg-[var(--sig-surface-raised)] ${o.relationMode==="dissimilar"?"text-[var(--sig-text-bright)] bg-[var(--sig-surface-raised)]":"text-[var(--sig-text-muted)]"}`)},[()=>Math.round((o.graphSelected.importance??0)*100),()=>Vo(o.graphSelected)]),Y("click",Ee,function(...E){o.onfocusembedding?.apply(this,E)}),Y("click",ye,function(...E){o.onpintoggle?.apply(this,E)}),Y("click",it,function(...E){o.onloadglobalsimilar?.apply(this,E)}),Y("click",He,()=>o.onsetrelationmode("similar")),Y("click",We,()=>o.onsetrelationmode("dissimilar")),u(G,Z)},ht=G=>{var Z=js(),ue=d(be(Z),2);{var ze=dt=>{var xe=Xs(),Ye=d(be(xe),2);Mt(Ye,21,()=>o.embeddingSearchMatches,kt,(Be,Ze)=>{var Xe=Ys(),$e=l(Xe),ct=l($e,!0);i($e);var Ct=d($e,2),me=l(Ct,!0);i(Ct),i(Xe),F(Ue=>{h(ct,e(Ze).who),h(me,Ue)},[()=>yr(e(Ze))]),Y("click",Xe,()=>o.onselectembedding(e(Ze).id)),u(Be,Xe)}),i(Ye),u(dt,xe)};j(ue,dt=>{o.embeddingSearch&&o.embeddingSearchMatches.length>0&&dt(ze)})}u(G,Z)};j(bt,G=>{e(ot)&&p()?G(Wt):e(ae)&&_()?G(mt,1):e(Ae)&&U()?G(Xt,2):o.graphSelected?G(jt,3):G(ht,-1)})}i(It),F(()=>xt(It,1,`flex flex-col gap-3 p-3 overflow-y-auto ${f()}`)),u(y,It),Sn()}Mn(["click"]);var zs=b('<div class="absolute right-3 z-[9] pointer-events-none"><button type="button" class="pointer-events-auto px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] bg-[rgba(5,5,5,0.74)] hover:bg-[var(--sig-text-bright)] hover:text-[var(--sig-bg)]"> </button></div>'),Bs=b('<span class="text-[#c4a24a]"> </span>'),Ws=b('<div class="mt-0.5 font-mono text-[9px] text-[var(--sig-text-muted)] leading-[1.3]"> </div>'),qs=b('<div class="mt-1"><div class="flex items-center justify-between font-mono text-[9px] text-[var(--sig-text-muted)]"><span> </span> <span> </span></div> <div class="mt-1 h-[5px] border border-[rgba(255,255,255,0.2)] bg-[rgba(255,255,255,0.05)]"><div class="h-full bg-[#c4a24a]"></div></div> <div class="mt-1 font-mono text-[9px] text-[var(--sig-text-muted)]"> </div></div>'),Ks=b('<div class="mb-2 border border-[rgba(255,255,255,0.14)] bg-[rgba(255,255,255,0.03)] px-1.5 py-1.5"><div class="font-mono text-[9px] text-[var(--sig-text)] leading-[1.3]"> </div> <!> <!></div>'),Us=b('<button type="button" class="mt-1 font-mono text-[9px] text-[#c4a24a] hover:text-[var(--sig-text-bright)] underline underline-offset-2 disabled:opacity-40 disabled:no-underline"> </button>'),Vs=b('<div class="flex items-start gap-1.5 px-1.5 py-1 border border-[rgba(255,255,255,0.1)] bg-[rgba(255,255,255,0.02)]"><span class="inline-block w-[6px] h-[6px] rounded-full shrink-0 mt-[4px]"></span> <div class="flex-1 min-w-0"><div class="flex items-center justify-between gap-2"><span class="font-mono text-[10px] text-[var(--sig-text)]"> </span> <span class="font-mono text-[9px] text-[var(--sig-text-muted)] uppercase"> </span></div> <div class="font-mono text-[9px] text-[var(--sig-text-muted)] leading-[1.3] mt-0.5"> </div> <!></div></div>'),Js=b('<div class="mt-1 border border-[rgba(255,255,255,0.22)] bg-[rgba(5,5,5,0.92)] px-2 py-2 w-[320px]"><div class="flex items-center justify-between mb-2"><span class="font-mono text-[10px] text-[var(--sig-text-muted)] uppercase tracking-[0.06em]">Constellation Health</span> <span class="font-mono text-[10px] text-[var(--sig-text-muted)]"> </span></div> <!> <div class="space-y-1"></div></div>'),Qs=b('<div class="absolute top-2 right-3 z-[8] pointer-events-none"><div class="pointer-events-auto"><button type="button" class="flex items-center gap-1.5 px-2 py-[4px] font-mono text-[10px] uppercase border border-[rgba(255,255,255,0.22)] bg-[rgba(5,5,5,0.75)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"><span class="inline-block w-[7px] h-[7px] rounded-full shrink-0"></span> <span class="text-[var(--sig-text-muted)]"> </span> <!></button> <!></div></div>'),Zs=b("<span>Legend</span> <!>",1),$s=b("<span> </span>"),ei=b('<div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-[var(--sig-text-muted)] mb-1.5"><span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last few minutes</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last few hours</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last week</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>older</span></div> <div class="flex flex-wrap gap-1 mb-1.5"></div>',1),ti=b('<span><span class="inline-block w-[6px] h-[6px] rounded-full"></span> </span>'),ri=b('<div class="flex flex-wrap gap-1 mb-1.5"></div>'),ni=b('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1.5">No color applied - all nodes are shown in gray.</div>'),ai=b('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Outline</span> = new since last seen</div>'),oi=b('<span class="h-5 inline-flex items-center gap-1 px-1.5 py-0 font-mono text-[10px] text-[var(--sig-text-muted)] border border-[rgba(255,255,255,0.14)] bg-transparent"><span class="inline-block w-[8px] h-[8px]"></span> </span>'),si=b('<div class="mt-2 pt-2 border-t border-[rgba(255,255,255,0.1)]"><div class="text-[10px] font-mono uppercase tracking-[0.06em] text-[var(--sig-text-muted)] mb-1">Knowledge Graph</div> <div class="flex flex-wrap gap-1 mb-1.5"></div> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] space-y-0.5"><div><span class="text-[var(--sig-text)]">Hexagon</span> = entity (large, labeled)</div> <div><span class="text-[var(--sig-text)]">Circle</span> = aspect (medium, orbits entity)</div> <div><span class="text-[var(--sig-text)]">Small dot</span> = attribute (orbits aspect)</div> <div><span class="text-[var(--sig-text)]">Tiny dot</span> = linked memory (leaf node)</div> <div><span class="text-[var(--sig-text)]">Faint lines</span> = parent-child hierarchy</div> <div><span class="text-[var(--sig-text)]">Styled line</span> = entity dependency</div></div></div>'),ii=b('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Color</span> </div> <!> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Radius</span> = importance</div> <div class="flex items-center gap-2 text-[10px] text-[var(--sig-text-muted)] mb-1.5"><span class="inline-block w-[6px] h-[6px] rounded-full border border-[rgba(255,255,255,0.24)]"></span> <span class="inline-block w-[9px] h-[9px] rounded-full border border-[rgba(255,255,255,0.28)]"></span> <span class="inline-block w-[12px] h-[12px] rounded-full border border-[rgba(255,255,255,0.32)]"></span> <span>low to high</span></div> <!> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35]"><span class="text-[var(--sig-text)]">Relation highlight</span> = selected node neighborhood emphasis</div> <!>',1),li=b("<!> <!>",1),di=b('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p> </p></div>'),ci=b('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p class="text-[var(--sig-danger)]"> </p></div>'),ui=b('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p>No memories found</p></div>'),gi=b('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p>Loading...</p></div>'),pi=b('<span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.04)]"> </span>'),vi=b('<span class="font-mono text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),fi=b('<span class="font-mono text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.08)]">locked</span>'),xi=b('<div class="grid grid-cols-[1fr_auto] items-start gap-2 border border-[rgba(255,255,255,0.14)] bg-[rgba(255,255,255,0.02)] px-1.5 py-1"><span class="text-[10px] leading-[1.35] text-[var(--sig-text)] line-clamp-1"> </span> <span class="text-[10px] text-[var(--sig-text-muted)]"> </span></div>'),bi=b('<div class="mt-2 pt-2 border-t border-[rgba(255,255,255,0.14)]"><div class="font-mono text-[10px] text-[var(--sig-text-muted)] uppercase tracking-[0.06em] mb-1">Local neighbors</div> <div class="space-y-1"></div></div>'),mi=b('<div class="z-[9] w-[320px] pointer-events-none border border-[rgba(255,255,255,0.26)] bg-[rgba(5,5,5,0.92)] px-2 py-2" style="position:absolute;top:0;left:0;will-change:transform"><div class="flex items-center gap-1.5 flex-wrap mb-1.5"><span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.04)]"> </span> <!> <!> <!></div> <div class="font-mono text-[10px] text-[var(--sig-text-muted)] mb-1.5"> </div> <p class="m-0 text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-3"> </p> <div class="mt-1 text-[10px] text-[var(--sig-text-muted)]"> </div> <!></div>'),hi=b('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-text-muted)] font-mono text-[11px]"> </span></div>'),yi=b('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-danger)] font-mono text-[11px]"> </span></div>'),_i=b('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-text-muted)] font-mono text-[11px]"> </span></div>'),wi=b("<span>View Controls</span> <!>",1),Si=b('<span class="font-mono text-[10px] text-[var(--sig-text-muted)] border border-[var(--sig-border)] px-2 py-1"> </span>'),Mi=b('<div class="p-2 space-y-2 border-t border-[var(--sig-border)]"><div class="flex items-center gap-2"><input type="text" class="flex-1 font-mono text-[11px] text-[var(--sig-text-bright)] bg-[var(--sig-surface)] border border-[var(--sig-border-strong)] px-[9px] py-[6px] outline-none" placeholder="Search constellation"/> <!></div> <div class="text-[10px] font-mono text-[var(--sig-text-muted)]"> </div> <div class="flex flex-wrap gap-1"><button>Pinned</button> <button>Neighborhood</button> <button>Lens</button> <button class="px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"> </button></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5"><div class="font-mono text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Color Mode</div> <div class="flex flex-wrap gap-1"><button>Newness</button> <button>Source</button> <button>None</button></div></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5"><div class="font-mono text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Overlays</div> <div class="flex flex-wrap gap-1"><button>New since last seen</button> <button> </button></div></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5" style="accent-color: var(--sig-highlight);"><div class="font-mono text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Graph Physics</div> <label class="block"><div class="flex items-center justify-between text-[10px] font-mono text-[var(--sig-text-muted)]"><span>center force</span> <span> </span></div> <input type="range" min="0" max="1" step="0.01"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-mono text-[var(--sig-text-muted)]"><span>repel force</span> <span> </span></div> <input type="range" min="-600" max="-10" step="5"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-mono text-[var(--sig-text-muted)]"><span>link force</span> <span> </span></div> <input type="range" min="0.01" max="1" step="0.01"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-mono text-[var(--sig-text-muted)]"><span>link distance</span> <span> </span></div> <input type="range" min="12" max="280" step="1"/></label> <button type="button" class="px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]">Physics Reset</button></div></div>'),ki=b("<!> <!>",1),Ii=b("<span>Presets</span> <!>",1),Ti=b("<button> </button>"),Ei=b('<div class="inline-flex items-center border border-[var(--sig-border-strong)]"><button> </button> <button class="px-1.5 py-[2px] font-mono text-[10px] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]">×</button></div>'),Ni=b('<div class="p-2 border-t border-[var(--sig-border)] flex flex-wrap gap-1"><!> <!> <button class="px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"> </button></div>'),Fi=b("<!> <!>",1),Pi=b("<span>Sources</span> <!>",1),Ci=b('<span class="text-[10px] text-[var(--sig-text-muted)]">No sources</span>'),Li=b("<button> </button>"),Di=b('<div class="p-2 border-t border-[var(--sig-border)] flex flex-wrap gap-1"><!></div>'),Ai=b("<!> <!>",1),Ri=b("<span>Advanced</span> <!>",1),Oi=b('<div class="flex items-center gap-1 flex-wrap"><input type="date" class="font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <input type="date" class="font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/></div>'),Yi=b('<span class="text-[10px] text-[var(--sig-text-muted)] font-mono">none</span>'),Xi=b("<button> </button>"),ji=b("<button> </button>"),Hi=b('<div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-mono">Type</span> <!></div>'),Gi=b("<button> </button>"),zi=b('<div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-mono">Source type</span> <!></div>'),Bi=b('<div class="p-2 border-t border-[var(--sig-border)] space-y-2"><div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-mono">Window</span> <input type="number" min="0" max="100000" class="w-[70px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <span class="text-[10px] text-[var(--sig-text-muted)] font-mono">to</span> <input type="number" min="1" max="100000" class="w-[70px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <select class="font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"><option>time: all</option><option>time: 24h</option><option>time: 7d</option><option>time: 30d</option><option>time: 90d</option><option>time: custom</option></select></div> <!> <div class="flex items-center gap-1 flex-wrap"><select class="font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"><option>pins: all</option><option>pins: pinned</option><option>pins: unpinned</option></select> <input type="text" class="w-[140px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="server query"/> <input type="text" class="w-[110px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="tags csv"/> <input type="text" class="w-[60px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="imp>"/> <input type="text" class="w-[60px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="imp<"/></div> <div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-mono">Harness</span> <!></div> <!> <!></div>'),Wi=b("<!> <!>",1),qi=b('<div class="flex flex-col flex-1 min-h-0 overflow-hidden"><!> <div class="flex flex-1 min-h-0 bg-[#050505] max-lg:flex-col"><div class="flex-1 relative overflow-hidden bg-[#050505]" role="presentation"><!> <!> <div class="absolute left-3 top-3 bottom-3 z-[8] pointer-events-none flex flex-col justify-end items-start max-w-[220px]"><!></div> <!> <div class="absolute left-[14px] z-[6] font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.08em] uppercase pointer-events-none" aria-hidden="true">:: ○ ○ 01 10 11 // latent topology</div> <div class="absolute inset-0 pointer-events-none z-[5]" aria-hidden="true"><span class="absolute top-[10px] left-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:1px 0 0 1px"></span> <span class="absolute top-[10px] right-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:1px 1px 0 0"></span> <span class="absolute bottom-[10px] left-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:0 0 1px 1px"></span> <span class="absolute bottom-[10px] right-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:0 1px 1px 0"></span></div> <!> <div><!></div> <div><!></div></div> <div class="w-[360px] min-w-[320px] border-l border-[var(--sig-border)] bg-[var(--sig-surface)] flex flex-col min-h-0 max-lg:w-full max-lg:min-w-0 max-lg:max-h-[48%] max-lg:border-l-0 max-lg:border-t max-lg:border-t-[var(--sig-border)]"><div class="p-3 border-b border-[var(--sig-border)] space-y-2 overflow-y-auto"><!> <!> <!> <!></div> <!></div></div></div>');function tl(y,o){wn(o,!0);let f=cr(o,"embedded",3,!1),S=v(!1),p=v(null),_=v(null),U=v(""),q=v(""),V=v(Ie([])),pe=v(0),ot=v(!1),ae=v(!1),Ae=v(""),Re=v(""),st=0,Oe=v(Ie([])),Je,Pt=v(null),It=v(null),tr=v(null),Te=v(Ie(new Set)),Qt=v(Ie([])),bt=v(!1),Wt=v(!0),mt=v(Ie(new Set)),Xt=v(!1),jt=v(""),ht=v(!0),G=v(Ie(new Set)),Z=v("focus"),ue=v(Ie([])),ze=v(!1),dt=v(!1),xe=v(!0),Ye=v(!1),Be=v(!0);const Ze=["daemon","user","opencode"],Xe=new Set(Ze),$e="signet-constellation-color-mode-session",ct="signet-constellation-new-since-session",Ct="signet-constellation-color-mode",me="signet-constellation-new-since",Ue="signet-constellation-last-seen";let ve=v(0),ut=v(Ie(Wr)),ie=v("all"),Ee=v(Ie(Date.now())),ye=v(""),je=v(""),it=v(""),Tt=v(""),yt=v("all"),Lt=v(""),fe=v(""),He=v(Ie([])),We=v(Ie(new Set)),Dt=v(Ie([])),lt=v(Ie([])),gt=v(Ie(new Set)),et=v(Ie(new Set)),tt=v(""),Ht=0,$t=v("similar"),E=v(Ie([])),oe=v(Ie([])),Ge=v(Ie([])),qt=v(!1),Et=v(Ie([])),$=v("source"),_t=v(!1),rr=v(null),nr=v(null),ar=v(!1),Kt=v(Ie(Date.now())),pt=v(Ie([])),s=v(Ie([])),I=v(Ie([])),B=v(!1),de=v(null),H=v(!1);const _e="signet-constellation-entity-overlay";let ge=v("2d"),se=v(Ie([])),qe=0,P=v(Ie(Ir)),Ke=v(!1),x=v(Ie(new Map)),K=v(Ie(new Map)),W=v(Ie(new Map)),C=v(null),O=v(null),X=v(null),we=0,Nt=0,Ut=null,vt=v(null),sr=v(null),Rr=v(null),Or=v(!1),Tn=v(!1),ur=v(null),Ur=v(!1),_r=v(!1),Vr,ir=v(null),lr=v(null),At=v(null),Yr;No(()=>{n(xe,kr.embeddings.controlsOpen,!0),n(Ye,kr.embeddings.presetsOpen,!0),n(Be,kr.embeddings.sourcesOpen,!0)});function ka(t){if(sa.activeTab!=="embeddings"||t.defaultPrevented)return;const r=t.target,a=r instanceof HTMLElement&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.tagName==="SELECT"||r.isContentEditable),c=r instanceof HTMLElement&&r.getAttribute("data-memory-tab")==="embeddings";if(t.key==="ArrowDown"&&c){t.preventDefault(),e(xe)?Je?.focus():(n(xe,!0),un().then(()=>Je?.focus()));return}if(t.key==="ArrowUp"&&r===Je){t.preventDefault();const g=document.querySelector('[data-memory-tab="embeddings"]');g?g.focus():Je?.blur();return}}async function Tr(){n(ur,await Lo(),!0)}function Ia(t){const r=t.match(/cooldown active,\s*(\d+)ms remaining/i);if(!r?.[1])return null;const a=Number.parseInt(r[1],10);return Number.isFinite(a)&&a>=0?a:null}function En(t){const r=Math.ceil(t/1e3);if(r<60)return`${r}s`;const a=Math.floor(r/60),c=r%60;return c>0?`${a}m ${c}s`:`${a}m`}function Ta(t){const r=t.match(/([\d,]+)\s+memories?\s+missing\s+embeddings/i);if(!r?.[1])return null;const a=Number.parseInt(r[1].replaceAll(",",""),10);return Number.isFinite(a)&&a>=0?a:null}function Er(){Yr&&(clearInterval(Yr),Yr=void 0)}function Ea(t){const r=Math.max(1,Math.floor(t/1e3));if(r<60)return`${r}s`;const a=Math.floor(r/60),c=r%60;return c>0?`${a}m ${c}s`:`${a}m`}function Nn(t){Er();const r=Date.now();let a=t,c=!1,g=0;n(ir,"Re-embedding in progress"),n(lr,t===null?"Collecting progress...":`${t.toLocaleString()} missing at start`,!0),n(At,null);const M=async()=>{if(!c){c=!0;try{const m=await pn(),T=Ea(Date.now()-r);if(n(ir,`Re-embedding in progress (${T})`),m){a===null&&(a=m.unembedded);const w=Math.max(0,a??m.unembedded),L=Math.max(0,w-m.unembedded),le=w>0?Math.min(100,L/w*100):100;n(At,{baseline:w,completed:L,remaining:m.unembedded,percent:le,coverage:m.coverage},!0),n(lr,a===null?`${m.unembedded.toLocaleString()} still missing (${m.coverage} coverage)`:`${L.toLocaleString()} completed, ${m.unembedded.toLocaleString()} remaining (${m.coverage} coverage)`,!0)}g%2===0&&await Tr(),g++}finally{c=!1}}};M(),Yr=setInterval(()=>{M()},3e3)}async function Na(t){if(e(_r))return;n(_r,!0);const r=t.name==="coverage"||t.name==="null-vectors";if(r||(n(ir,`Running ${t.name} repair...`),n(lr,null),n(At,null)),r){const a=Ta(t.message);if(a!==null)Nn(a);else{const c=await pn();Nn(c?.unembedded??null)}}try{let a;if(t.name==="orphaned-embeddings")a=await Xo();else if(t.name==="vec-table-sync")a=await jo();else if(t.name==="coverage"||t.name==="null-vectors")a=await Ho();else{Mr(`Repair action not wired for ${t.name}`,"warning");return}if(!a.success){if(Er(),a.status===429){const c=Ia(a.message);c!==null?(n(ir,"Repair blocked by cooldown"),n(lr,`Try again in ${En(c)}.`),Mr(`Repair on cooldown. Try again in ${En(c)}.`,"warning",4500)):(n(ir,"Repair blocked by policy"),n(lr,a.message,!0),Mr(`Repair temporarily blocked: ${a.message}`,"warning",5e3)),await Tr();return}n(ir,"Repair failed"),n(lr,a.message,!0),n(At,null),Mr(`Repair failed: ${a.message}`,"error",5e3);return}if(Er(),n(ir,"Repair completed"),n(lr,a.message,!0),r){const c=await pn();if(c&&e(At)){const g=e(At).baseline,M=Math.max(0,g-c.unembedded);n(At,{baseline:g,completed:M,remaining:c.unembedded,percent:g>0?Math.min(100,M/g*100):100,coverage:c.coverage},!0)}}a.affected>0?Mr(a.message,"success",4500):Mr(a.message,"info",4500),await Tr(),r&&a.affected>0&&await en()}finally{Er(),n(_r,!1)}}function Fa(t){return t==="healthy"?"#4a7a5e":t==="degraded"?"#c4a24a":"#8a4a48"}function Pa(t){return t==="ok"?"#4a7a5e":t==="warn"?"#c4a24a":"#8a4a48"}ne(()=>(Tr(),Vr=setInterval(Tr,6e4),()=>{Er(),Vr&&clearInterval(Vr)}));let Jr=!1;function Xr(){Jr||(Jr=!0,queueMicrotask(()=>{Jr=!1,e(ge)==="3d"&&e(sr)?.refreshAppearance()}))}function Ca(t){return{id:t.id,content:t.content,who:t.who,importance:t.importance,type:t.type,tags:t.tags,pinned:t.pinned??!1,sourceType:t.sourceType,sourceId:t.sourceId,createdAt:t.createdAt}}function La(t){if(!t)return"-";const r=new Date(t);return Number.isNaN(r.getTime())?"-":r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function jr(t,r){const a=new Date(e(Kt)-t).toISOString();return wa(Ko(a,e(Kt)),r)}function Qr(){const t=Number.isFinite(e(ve))?Math.max(0,Math.trunc(e(ve))):0,r=Number.isFinite(e(ut))?Math.max(1,Math.trunc(e(ut))):Wr,a=Math.max(t+1,Math.min(r,t+Wo));return{offset:t,limit:a-t}}function Zr(){const{offset:t,limit:r}=Qr();n(ve,t,!0),n(ut,t+r)}function Fn(t,r){const a=t.trim();if(!a)return;const c=r?"T23:59:59.999":"T00:00:00.000",g=new Date(`${a}${c}`);if(!Number.isNaN(g.getTime()))return g.toISOString()}function Pn(t){const r=t.trim();if(!r)return;const a=Number.parseFloat(r);if(Number.isFinite(a))return Math.min(1,Math.max(0,a))}function Hr(t,r){const a=t.currentTarget;if(!(a instanceof HTMLInputElement))return r;const c=Number.parseFloat(a.value);return Number.isFinite(c)?c:r}function Nr(t){n(P,bn({...e(P),...t}),!0)}function Da(t,r){if(t==="all"||t==="custom")return;const a=t==="24h"?1440*60*1e3:t==="7d"?10080*60*1e3:t==="30d"?720*60*60*1e3:2160*60*60*1e3;return new Date(r-a).toISOString()}function Cn(){const{offset:t,limit:r}=Qr(),a={offset:t,limit:r},c=e(it).trim();c.length>0&&(a.q=c);const g=[...e(We)];g.length>0&&(a.who=g);const M=[...e(gt)];M.length>0&&(a.types=M);const m=[...e(et)];m.length>0&&(a.sourceTypes=m);const T=e(Tt).split(",").map(N=>N.trim()).filter(N=>N.length>0);T.length>0&&(a.tags=T),e(yt)==="pinned"&&(a.pinned=!0),e(yt)==="unpinned"&&(a.pinned=!1);let w,L;e(ie)==="custom"?(w=Fn(e(ye),!1),L=Fn(e(je),!0)):w=Da(e(ie),e(Ee)),w&&(a.since=w),L&&(a.until=L);let le=Pn(e(Lt)),k=Pn(e(fe));if(typeof le=="number"&&typeof k=="number"&&le>k){const N=le;le=k,k=N}return typeof le=="number"&&(a.importanceMin=le),typeof k=="number"&&(a.importanceMax=k),a}function Ln(t){return JSON.stringify({offset:t.offset??0,limit:t.limit??Wr,q:t.q??"",who:[...t.who??[]].sort(),types:[...t.types??[]].sort(),sourceTypes:[...t.sourceTypes??[]].sort(),tags:[...t.tags??[]].sort(),pinned:t.pinned??"all",since:t.since??"",until:t.until??"",importanceMin:typeof t.importanceMin=="number"?t.importanceMin:"",importanceMax:typeof t.importanceMax=="number"?t.importanceMax:""})}function Aa(t){let r=null;for(const a of t)if(a!==null){if(r===null){r=new Set(a);continue}if(r.size<=a.size)for(const c of r)a.has(c)||r.delete(c);else{const c=new Set;for(const g of a)r.has(g)&&c.add(g);r=c}}return r}function Ra(t,r){const a=e(V).findIndex(M=>M.id===t);if(a<0)return;const c=r(e(V)[a]);e(V)[a]=c,n(V,e(V),!0),e(x).set(t,c),n(x,e(x),!0);const g=e(pt).findIndex(M=>M.data.id===t);g>=0&&(e(pt)[g]={...e(pt)[g],data:c},n(pt,e(pt),!0)),e(p)?.id===t&&n(p,c,!0),e(_)?.id===t&&n(_,c,!0)}function Oa(t){const r=new Set(e(Te));r.has(t)?r.delete(t):r.add(t),n(Te,r,!0)}function Ya(t){const r=new Set(e(We));r.has(t)?r.delete(t):r.add(t),n(We,r,!0)}function Xa(t){const r=new Set(e(gt));r.has(t)?r.delete(t):r.add(t),n(gt,r,!0)}function ja(t){const r=new Set(e(et));r.has(t)?r.delete(t):r.add(t),n(et,r,!0)}function Ha(){n(ve,0),n(ut,Wr,!0),n(ie,"all"),n(ye,""),n(je,""),n(it,""),n(Tt,""),n(yt,"all"),n(Lt,""),n(fe,""),n(We,new Set,!0),n(gt,new Set,!0),n(et,new Set,!0),Zr()}function Ga(){n(bt,!e(bt)),n(Z,"custom-live")}function Dn(){if(e(p))return e(p);if(e(Gt))return n(p,e(Gt),!0),e(Gt);const t=e(V)[0]??null;return t&&n(p,t,!0),t}function za(){!e(Wt)&&!Dn()||(n(Wt,!e(Wt)),n(Z,"custom-live"))}function Ba(){!e(ht)&&!Dn()||(n(ht,!e(ht)),n(Z,"custom-live"))}function Wa(t){Oa(t),n(Z,"custom-live")}function An(){if(!e(X)||!Ut)return;const t=Math.max(12,Ut.width-334),r=Math.max(12,Ut.height-170),a=Math.min(Math.max(12,we+14),t),c=Math.min(Math.max(12,Nt+14),r);e(X).style.transform=`translate3d(${a}px, ${c}px, 0)`}function qa(t){Ut&&(we=t.clientX-Ut.left,Nt=t.clientY-Ut.top,An())}function Rn(t){e(C)||!t&&!e(_)||t&&e(_)&&t.id===e(_).id||n(_,t,!0)}function Ka(){e(p)||e(_)&&n(C,e(_).id,!0)}function On(){n(C,null)}function Yn(t){return typeof t=="number"?e(I)[t]??null:t?.data.id??null}const Xn="signet-embeddings-filter-presets",Ua=[{id:"all",name:"All",search:"",sources:[],pinnedOnly:!1,neighborhoodOnly:!1,clusterLensMode:!1},{id:"pinned",name:"Pinned",search:"",sources:[],pinnedOnly:!0,neighborhoodOnly:!1,clusterLensMode:!1},{id:"focus",name:"Focus",search:"",sources:[],pinnedOnly:!1,neighborhoodOnly:!0,clusterLensMode:!0}];function Va(t,r){return{id:r,name:t,search:e(Ae),sources:[...e(Te)],pinnedOnly:e(bt),neighborhoodOnly:e(Wt),clusterLensMode:e(ht)}}function jn(t){n(Ae,t.search,!0),n(Te,new Set(t.sources),!0),n(bt,t.pinnedOnly,!0),n(Wt,t.neighborhoodOnly,!0),n(ht,t.clusterLensMode,!0),n(Z,t.id,!0)}function Ja(){if(typeof window>"u")return;const t=e(p)?`Cluster: ${e(p).who??"source"}`:"Custom preset",a=window.prompt("Preset name",t)?.trim();if(!a)return;const c=`custom-${Date.now()}`,g=Va(a,c);n(ue,[g,...e(ue)].slice(0,8),!0),n(Z,c)}function Qa(t){n(ue,e(ue).filter(r=>r.id!==t),!0),e(Z)===t&&n(Z,"all")}async function Hn(){if(e(ae))return;n(ae,!0),n(q,""),n(U,"Loading projection...");const t=++qe,r=Cn(),a=Ln(r);try{let c=await ia(2,r),g=0;const M=30;for(;c.status==="computing";){if(t!==qe)return;if(g++,g>=M){n(q,"Projection timed out after 60s. Try refreshing."),n(tt,a,!0);return}n(U,"Computing layout..."),await new Promise(A=>setTimeout(A,2e3)),c=await ia(2,r)}if(c.status==="error"){n(q,c.message??"Projection computation failed",!0),n(tt,a,!0);return}if(t!==qe)return;const m=c.nodes??[];if(n(V,m.map(Ca),!0),n(pe,c.total??m.length,!0),n(ot,!!(c.hasMore??(c.count??m.length)<(c.total??m.length)),!0),n(tt,a,!0),n(x,new Map(e(V).map(A=>[A.id,A])),!0),m.length===0){n(U,"");return}let T=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY;for(const A of m)A.x<T&&(T=A.x),A.x>w&&(w=A.x),A.y<L&&(L=A.y),A.y>le&&(le=A.y);const k=w-T||1,N=le-L||1,D=560;if(n(pt,m.map((A,te)=>({x:((A.x-T)/k-.5)*D,y:((A.y-L)/N-.5)*D,radius:2.3+(A.importance??.5)*2.8,color:_n(A.who,.85),data:e(V)[te],createdMs:Ma(A.createdAt)})),!0),n(I,e(V).map(A=>A.id),!0),n(s,(c.edges??[]).map(([A,te])=>({source:A,target:te,edgeType:"knn"})),!0),e(B)&&await Za(),n(U,""),await un(),t!==qe)return;e(B)?(e(vt)?.startKnowledgeGraphSimulation(e(pt),e(s)),e(vt)?.startRendering(!0)):(e(vt)?.startSimulation(e(pt),e(s),e(P)),e(vt)?.startRendering())}catch(c){n(q,c.message||"Failed to load projection",!0),n(U,""),n(tt,a,!0)}}async function Za(){n(H,!0);try{const t=await Do(o.agentId);if(!t){n(de,null);return}n(de,t,!0);const r=new Map;for(const w of e(pt))r.set(w.data.id,w);const a=[],c=[],g=[],M=new Map,m=new Map,T=400;for(const w of t.entities){const L=`entity:${w.id}`,le=es(w),k=(Math.random()-.5)*T,N=(Math.random()-.5)*T,D={id:L,content:w.name,who:w.entityType,importance:.9,pinned:w.pinned,tags:[],createdAt:void 0},A=a.length;m.set(w.id,A),a.push({x:k,y:N,radius:le,color:qr(w.entityType,.7),data:D,nodeType:"entity",entityData:w}),g.push(L),M.set(L,D);for(const te of w.aspects){const Pe=`aspect:${te.id}`,Ce=Zo(te.weight),Se={id:Pe,content:te.name,who:w.entityType,importance:te.weight,pinned:!1,tags:[],createdAt:void 0},R=a.length;a.push({x:k+(Math.random()-.5)*80,y:N+(Math.random()-.5)*80,radius:Ce,color:qr(w.entityType,.5),data:Se,nodeType:"aspect",aspectData:te,parentEntityId:w.id}),g.push(Pe),M.set(Pe,Se),c.push({source:A,target:R,edgeType:"hierarchy"});for(const z of te.attributes){const re=`attr:${z.id}`,ee=$o(z.importance),Me={id:re,content:z.content,who:w.entityType,importance:z.importance,pinned:!1,tags:[],createdAt:void 0},he=a.length;if(a.push({x:a[R].x+(Math.random()-.5)*40,y:a[R].y+(Math.random()-.5)*40,radius:ee,color:qr(w.entityType,.3),data:Me,nodeType:"attribute",attributeData:z,parentEntityId:w.id,parentAspectId:te.id}),g.push(re),M.set(re,Me),c.push({source:R,target:he,edgeType:"hierarchy"}),z.memoryId){const ce=r.get(z.memoryId);if(ce){const Le=a.length;a.push({x:a[he].x+(Math.random()-.5)*25,y:a[he].y+(Math.random()-.5)*25,radius:2,color:ce.color,data:ce.data,nodeType:"memory"}),g.push(ce.data.id),M.set(ce.data.id,ce.data),c.push({source:he,target:Le,edgeType:"hierarchy"})}}}}}if(a.length>3e3){const w=new Map;let L=0;for(let k=0;k<a.length;k++)a[k].nodeType!=="memory"&&(w.set(k,L),a[L]=a[k],g[L]=g[k],L++);a.length=L,g.length=L;let le=0;for(const k of c){const N=w.get(k.source),D=w.get(k.target);N!==void 0&&D!==void 0&&(c[le]={...k,source:N,target:D},le++)}c.length=le,M.clear();for(const k of a)M.set(k.data.id,k.data)}for(const w of t.dependencies){const L=m.get(w.sourceEntityId),le=m.get(w.targetEntityId);L!==void 0&&le!==void 0&&c.push({source:L,target:le,edgeType:"dependency",dependencyType:w.dependencyType,strength:w.strength})}n(pt,a,!0),n(I,g,!0),n(s,c,!0),n(x,M,!0)}finally{n(H,!1)}}async function $a(t){if(!t){n(E,[],!0),n(oe,[],!0),n(Ge,[],!0),n(W,new Map,!0);return}const r=await la(t.id,10);n(E,r.map(a=>({id:a.id,score:a.score??0,kind:"similar"})),!0),n(oe,[],!0),n(Ge,e(E),!0),n(W,new Map(e(E).map(a=>[a.id,a.kind])),!0)}function eo(){n(p,null),n(_,null),n(C,null),n(Et,[],!0),n(jt,"")}function $r(t){const r=e(x).get(t)??null;r&&(n(C,null),n(p,r,!0))}function to(t){if(e(ge)==="2d"){e(vt)?.focusNode(t);return}e(sr)?.focusNode(t)}async function ro(){if(!e(p)||e(Xt))return;n(Xt,!0),n(jt,"");const t=e(p).id,r=!(e(p).pinned??!1),a=await Ao(t,r);if(!a.success){n(jt,a.error??"Failed to update pin state",!0),n(Xt,!1);return}Ra(t,c=>({...c,pinned:r})),e(ge)==="3d"&&e(sr)?.refreshAppearance(),n(Xt,!1)}async function no(){if(e(p)){n(qt,!0);try{n(Et,await la(e(p).id,10,Ro.filterType||void 0),!0)}finally{n(qt,!1)}}}async function en(){n(ae,!1),n(U,""),n(q,""),n(se,[],!0),n(p,null),n(_,null),n(C,null),n(Et,[],!0),n(qt,!1),n(x,new Map,!0),n(W,new Map,!0),n(E,[],!0),n(oe,[],!0),n(Ge,[],!0),n(V,[],!0),n(pe,0),n(ot,!1),n(pt,[],!0),n(s,[],!0),n(I,[],!0),n(jt,""),e(vt)?.stopSimulation(),e(vt)?.stopRendering(),e(vt)?.resetCamera(),e(sr)?.destroy(),n(ge,"2d"),await un(),Hn()}ne(()=>{const t=e(V),r=new Set,a=new Map,c=new Map,g=new Map,M=new Map;for(const m of t){m.pinned&&r.add(m.id);const T=m.who??"unknown";a.set(T,(a.get(T)??0)+1),typeof m.type=="string"&&m.type.length>0&&c.set(m.type,(c.get(m.type)??0)+1);const w=m.sourceType??"memory";g.set(w,(g.get(w)??0)+1),M.set(m.id,[m.content,m.text??"",m.who??"",m.type??"",m.sourceType??"",m.sourceId??"",...m.tags??[]].join(" ").toLowerCase())}if(n(mt,r,!0),n(K,M,!0),n(Qt,[...a.entries()].sort((m,T)=>T[1]-m[1]||m[0].localeCompare(T[0])).map(([m,T])=>({who:m,count:T})),!0),n(Dt,[...c.entries()].sort((m,T)=>T[1]-m[1]||m[0].localeCompare(T[0])).map(([m,T])=>({value:m,count:T})),!0),n(lt,[...g.entries()].sort((m,T)=>T[1]-m[1]||m[0].localeCompare(T[0])).map(([m,T])=>({value:m,count:T})),!0),e(Te).size>0){const m=new Set([...e(Te)].filter(T=>a.has(T)));m.size!==e(Te).size&&n(Te,m,!0)}}),ne(()=>{let t=!1;return(async()=>{const r=await Co();t||n(He,r.filter(a=>a.trim().length>0),!0)})(),()=>{t=!0}}),ne(()=>{if(e(We).size===0||e(He).length===0)return;const t=new Set(e(He)),r=new Set([...e(We)].filter(a=>t.has(a)));r.size!==e(We).size&&n(We,r,!0)}),ne(()=>{const t=e(ie);t==="all"||t==="custom"||n(Ee,Date.now(),!0)}),ne(()=>{const t=e(Ae);if(!t.trim()){clearTimeout(st),n(Re,""),n(It,null),n(Oe,[],!0);return}const r=window.setTimeout(()=>{n(Re,t,!0)},180);return st=r,()=>clearTimeout(r)}),ne(()=>{const t=e(Re).trim().toLowerCase(),r=e(V);if(!t){n(It,null),n(Oe,[],!0);return}const a=new Set,c=[];for(const g of r){const M=e(K).get(g.id);M&&M.includes(t)&&(a.add(g.id),c.push(g))}if(e(B))for(const[g,M]of e(x)){if(a.has(g))continue;[M.content,M.who??"",...M.tags??[]].join(" ").toLowerCase().includes(t)&&(a.add(g),c.push(M))}n(It,a,!0),n(Oe,c.slice(0,50),!0)}),ne(()=>{const t=e(Te);if(t.size===0){n(tr,null);return}n(tr,new Set(e(V).filter(r=>t.has(r.who??"unknown")).map(r=>r.id)),!0)}),ne(()=>{if(!(typeof window>"u"||e(ze))){try{const t=window.localStorage.getItem(Xn);if(t){const r=JSON.parse(t);if(Array.isArray(r)){const a=r.filter(c=>{if(typeof c!="object"||c===null)return!1;const g=c;return typeof g.id=="string"&&typeof g.name=="string"&&typeof g.search=="string"&&Array.isArray(g.sources)&&typeof g.pinnedOnly=="boolean"&&typeof g.neighborhoodOnly=="boolean"&&typeof g.clusterLensMode=="boolean"});n(ue,a.slice(0,8),!0)}}}catch{n(ue,[],!0)}n(ze,!0)}}),ne(()=>{typeof window>"u"||!e(ze)||window.localStorage.setItem(Xn,JSON.stringify(e(ue)))}),ne(()=>{if(!(typeof window>"u"||e(Ke)))try{const t=window.localStorage.getItem(fa);if(t){const r=JSON.parse(t);if(typeof r=="object"&&r!==null){const a=r;n(P,bn({centerForce:typeof a.centerForce=="number"?a.centerForce:Ir.centerForce,repelForce:typeof a.repelForce=="number"?a.repelForce:Ir.repelForce,linkForce:typeof a.linkForce=="number"?a.linkForce:Ir.linkForce,linkDistance:typeof a.linkDistance=="number"?a.linkDistance:Ir.linkDistance}),!0)}}}finally{n(Ke,!0)}}),ne(()=>{typeof window>"u"||!e(Ke)||window.localStorage.setItem(fa,JSON.stringify(e(P)))}),ne(()=>{if(!(typeof window>"u"||e(ar))){try{const t=window.sessionStorage.getItem($e);(t==="source"||t==="newness"||t==="none")&&n($,t,!0),window.sessionStorage.getItem(ct)==="true"&&n(_t,!0)}catch{}try{const t=window.localStorage.getItem(Ue);if(t){const r=Number.parseInt(t,10);Number.isNaN(r)||n(rr,r,!0)}}catch{}try{window.localStorage.removeItem(Ct),window.localStorage.removeItem(me)}catch{}n(ar,!0)}}),ne(()=>{if(!(typeof window>"u"||!e(ar))){try{e($)==="source"?window.sessionStorage.removeItem($e):window.sessionStorage.setItem($e,e($))}catch{}try{e(_t)&&e($)!=="none"?window.sessionStorage.setItem(ct,"true"):window.sessionStorage.removeItem(ct)}catch{}try{e(nr)!==null&&window.localStorage.setItem(Ue,String(e(nr)))}catch{}}}),ne(()=>{if(!(typeof window>"u"))try{window.sessionStorage.getItem(_e)==="true"&&n(B,!0)}catch{}}),ne(()=>{if(!(typeof window>"u"))try{e(B)?window.sessionStorage.setItem(_e,"true"):window.sessionStorage.removeItem(_e)}catch{}}),ne(()=>{if(typeof window>"u")return;const t=window.setInterval(()=>{n(Kt,Date.now(),!0)},6e4);return()=>window.clearInterval(t)}),ne(()=>{const t=new Set;if(e(ht)){const r=e(p)??e(Gt);if(r){t.add(r.id);const a=e(p)!==null?e(Ge):e(Gr);for(const c of a)t.add(c.id)}}n(G,t,!0)}),ne(()=>{e(ht),e(G),Xr()}),ne(()=>{e($),e(_t),e(Kt),e(rr),e(ge)==="2d"&&e(vt)?.requestRedraw(),Xr()}),ne(()=>{!e(ae)||typeof window>"u"||e(nr)===null&&n(nr,Date.now(),!0)}),ne(()=>{e(P),e(ae)&&e(ge)==="2d"&&e(vt)?.updatePhysics(e(P))});const ao=Q(()=>Ln(Cn()));ne(()=>{const t=e(ao);if(!e(ae)||e(U).length>0||t===e(tt))return;clearTimeout(Ht);const r=window.setTimeout(()=>{en()},220);return Ht=r,()=>clearTimeout(r)}),ne(()=>{const t=e(bt)===!0?new Set(e(mt)):null,r=e(p)??e(Gt),a=e(p)?e(Ge):e(Gr),c=e(Wt)===!0&&r?new Set([r.id,...a.map(g=>g.id)]):null;n(Pt,Aa([e(It),e(tr),t,c]),!0),Xr()}),ne(()=>{$a(e(p))}),ne(()=>{const t=e($t),r=e(E),a=e(oe);n(Ge,t==="similar"?r:a,!0),n(W,new Map(e(Ge).map(c=>[c.id,c.kind])),!0),Xr()});const Gt=Q(()=>e(C)?e(x).get(e(C))??null:e(_)),Gn=Q(Qr),oo=Q(()=>{e(I);const t=e(s),r=new Map;for(const a of t){const c=Yn(a.source),g=Yn(a.target);if(!c||!g||c===g)continue;const M=r.get(c)??new Map;M.set(g,(M.get(g)??0)+1),r.set(c,M);const m=r.get(g)??new Map;m.set(c,(m.get(c)??0)+1),r.set(g,m)}return r}),Gr=Q(()=>{const t=e(Gt);if(!t)return[];const r=e(oo).get(t.id);if(!r||r.size===0)return[];const a=[...r.entries()].sort((g,M)=>M[1]-g[1]).slice(0,6),c=a[0]?.[1]??1;return a.map(([g,M])=>({id:g,score:M/c,kind:"similar"}))}),so=Q(()=>new Map(e(Gr).map(t=>[t.id,"similar"]))),zn=Q(()=>e(p)?e(W):e(so)),wr=Q(()=>{const t=e(p);return t?e(pt).find(r=>r.data.id===t.id)??null:null}),tn=Q(()=>e(p)?[]:e(Gr)),Bn=Q(()=>{const t=new Map(e(Qt).map(c=>[c.who,c])),r=Ze.map(c=>t.get(c)).filter(c=>!!c),a=e(Qt).filter(c=>!Xe.has(c.who));return[...r,...a].slice(0,8)});ne(()=>{e(p)&&e(C)&&n(C,null)}),ne(()=>{const t=e(C);t&&(e(x).has(t)||n(C,null))}),ne(()=>{const t=e(O);if(!t)return;Ut=t.getBoundingClientRect();const r=new ResizeObserver(()=>{Ut=t.getBoundingClientRect()});return r.observe(t),()=>r.disconnect()}),ne(()=>{e(X)&&An()}),ne(()=>{if(typeof window>"u")return;const t=r=>{if(r.key==="Shift"){Ka();return}r.key==="Escape"&&On()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}}),ne(()=>{if(!e(O))return;const t=new IntersectionObserver(r=>{r[0].isIntersecting&&!e(ae)&&!e(Tn)&&(n(Tn,!0),Hn())},{threshold:.1});return t.observe(e(O)),()=>t.disconnect()}),ne(()=>{kr.embeddings.controlsOpen=e(xe),kr.embeddings.presetsOpen=e(Ye),kr.embeddings.sourcesOpen=e(Be),Bo()});var rn=qi();Ar("keydown",Fo,ka);var Wn=l(rn);{var io=t=>{Go(t,{title:"Constellation",children:(r,a)=>{zo(r,{group:"memory",get tabs(){return Yo},get activeTab(){return sa.activeTab},onselect:(c,g)=>Oo(g)})}})};j(Wn,t=>{f()||t(io)})}var qn=d(Wn,2),Sr=l(qn),Kn=l(Sr);{var lo=t=>{var r=zs();Bt(r,"",{},{top:"52px"});var a=l(r),c=l(a);i(a),i(r),F(()=>h(c,`${gn.Unlock} preview`)),Y("click",a,On),u(t,r)};j(Kn,t=>{e(C)&&t(lo)})}var Un=d(Kn,2);{var co=t=>{var r=Qs(),a=l(r),c=l(a),g=l(c),M=d(g),m=d(M),T=l(m);i(m);var w=d(m,2);{var L=N=>{var D=Bs(),A=l(D);i(D),F(te=>h(A,`${te??""}%`),[()=>Math.round(e(At).percent)]),u(N,D)};j(w,N=>{e(_r)&&e(At)&&N(L)})}i(c);var le=d(c,2);{var k=N=>{var D=Js(),A=l(D),te=d(l(A),2),Pe=l(te);i(te),i(A);var Ce=d(A,2);{var Se=z=>{var re=Ks(),ee=l(re),Me=l(ee,!0);i(ee);var he=d(ee,2);{var ce=Ne=>{var ke=Ws(),Fe=l(ke,!0);i(ke),F(()=>h(Fe,e(lr))),u(Ne,ke)};j(he,Ne=>{e(lr)&&Ne(ce)})}var Le=d(he,2);{var Ve=Ne=>{var ke=qs(),Fe=l(ke),rt=l(Fe),wt=l(rt);i(rt);var ft=d(rt,2),Qe=l(ft);i(ft),i(Fe);var De=d(Fe,2),St=l(De);i(De);var Zt=d(De,2),vr=l(Zt);i(Zt),i(ke),F((fr,xr,J,nt,Vt)=>{h(wt,`${fr??""} / ${xr??""}`),h(Qe,`${J??""}%`),Bt(St,nt),h(vr,`${Vt??""} remaining · ${e(At).coverage??""} coverage`)},[()=>e(At).completed.toLocaleString(),()=>e(At).baseline.toLocaleString(),()=>Math.round(e(At).percent),()=>`width:${Math.max(0,Math.min(100,e(At).percent))}%`,()=>e(At).remaining.toLocaleString()]),u(Ne,ke)};j(Le,Ne=>{e(At)&&Ne(Ve)})}i(re),F(()=>h(Me,e(ir))),u(z,re)};j(Ce,z=>{e(ir)&&z(Se)})}var R=d(Ce,2);Mt(R,21,()=>e(ur).checks,kt,(z,re)=>{var ee=Vs(),Me=l(ee),he=d(Me,2),ce=l(he),Le=l(ce),Ve=l(Le,!0);i(Le);var Ne=d(Le,2),ke=l(Ne,!0);i(Ne),i(ce);var Fe=d(ce,2),rt=l(Fe,!0);i(Fe);var wt=d(Fe,2);{var ft=Qe=>{var De=Us(),St=l(De,!0);i(De),F(()=>{De.disabled=e(_r),h(St,e(_r)?"running...":e(re).fix)}),Y("click",De,()=>Na(e(re))),u(Qe,De)};j(wt,Qe=>{e(re).fix&&e(re).status!=="ok"&&Qe(ft)})}i(he),i(ee),F(Qe=>{Bt(Me,`background:${Qe??""}`),h(Ve,e(re).name),h(ke,e(re).status),h(rt,e(re).message)},[()=>Pa(e(re).status)]),u(z,ee)}),i(R),i(D),F(()=>h(Pe,`${e(ur).config.provider??""}/${e(ur).config.model??""}`)),u(N,D)};j(le,N=>{e(Ur)&&N(k)})}i(a),i(r),F((N,D)=>{Bt(g,`background:${N??""}`),h(M,` ${e(ur).status??""} `),h(T,`${D??""}%`)},[()=>Fa(e(ur).status),()=>Math.round(e(ur).score*100)]),Y("click",c,()=>n(Ur,!e(Ur))),u(t,r)};j(Un,t=>{e(ur)&&t(co)})}var nn=d(Un,2),uo=l(nn);Yt(uo,()=>Lr,(t,r)=>{r(t,{class:"pointer-events-auto flex min-w-[180px] max-h-full flex-col-reverse",get open(){return e(S)},set open(a){n(S,a,!0)},children:(a,c)=>{var g=li(),M=be(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center gap-2 px-3 py-1.5 min-w-[180px] border border-[var(--sig-border)] text-[10px] font-mono uppercase tracking-[0.06em] text-[var(--sig-text-muted)] bg-transparent",get"aria-expanded"(){return e(S)},children:(L,le)=>{var k=Zs(),N=d(be(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(S)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var m=d(M,2);Yt(m,()=>Cr,(T,w)=>{w(T,{class:"min-h-0 max-h-[min(40vh,24rem)] overflow-y-auto border border-[var(--sig-border)] bg-[rgba(5,5,5,0.88)] px-3 py-2",children:(L,le)=>{var k=ii(),N=be(k),D=d(l(N));i(N);var A=d(N,2);{var te=ee=>{var Me=ei(),he=be(Me),ce=l(he),Le=l(ce);gr(),i(ce);var Ve=d(ce,2),Ne=l(Ve);gr(),i(Ve);var ke=d(Ve,2),Fe=l(ke);gr(),i(ke);var rt=d(ke,2),wt=l(rt);gr(),i(rt),i(he);var ft=d(he,2);Mt(ft,21,()=>e(Bn),kt,(Qe,De)=>{var St=$s(),Zt=l(St);i(St),F(vr=>{xt(St,1,`h-5 inline-flex items-center gap-1 px-1.5 py-0 font-mono text-[10px] border border-[rgba(255,255,255,0.14)] ${vr??""}`),h(Zt,`${e(De).who??""} ${e(De).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(De).who)?"bg-[rgba(255,255,255,0.08)] text-[var(--sig-text-bright)]":"bg-transparent text-[var(--sig-text-muted)]"]),u(Qe,St)}),i(ft),F((Qe,De,St,Zt)=>{Bt(Le,Qe),Bt(Ne,De),Bt(Fe,St),Bt(wt,Zt)},[()=>`background:${jr(3e5,.95)}`,()=>`background:${jr(108e5,.9)}`,()=>`background:${jr(2592e5,.85)}`,()=>`background:${jr(2592e6,.85)}`]),u(ee,Me)},Pe=ee=>{var Me=ri();Mt(Me,21,()=>e(Bn),kt,(he,ce)=>{var Le=ti(),Ve=l(Le),Ne=d(Ve);i(Le),F((ke,Fe)=>{xt(Le,1,`h-5 inline-flex items-center gap-1 px-1.5 py-0 font-mono text-[10px] border border-[rgba(255,255,255,0.14)] ${ke??""}`),Bt(Ve,Fe),h(Ne,` ${e(ce).who??""} ${e(ce).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(ce).who)?"bg-[rgba(255,255,255,0.08)] text-[var(--sig-text-bright)]":"bg-transparent text-[var(--sig-text-muted)]",()=>`background:${ya(e(ce).who,1)}`]),u(he,Le)}),i(Me),u(ee,Me)},Ce=ee=>{var Me=ni();u(ee,Me)};j(A,ee=>{e($)==="newness"?ee(te):e($)==="source"?ee(Pe,1):ee(Ce,-1)})}var Se=d(A,6);{var R=ee=>{var Me=ai();u(ee,Me)};j(Se,ee=>{e(_t)&&e($)!=="none"&&ee(R)})}var z=d(Se,4);{var re=ee=>{var Me=si(),he=d(l(Me),2);Mt(he,21,()=>Object.entries(Kr),kt,(ce,Le)=>{var Ve=Q(()=>Po(e(Le),2));let Ne=()=>e(Ve)[0],ke=()=>e(Ve)[1];var Fe=pr(),rt=be(Fe);{var wt=ft=>{var Qe=oi(),De=l(Qe),St=d(De);i(Qe),F(()=>{Bt(De,`background:${ke()}; clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);`),h(St,` ${Ne()??""}`)}),u(ft,Qe)};j(rt,ft=>{Ne()!=="unknown"&&ft(wt)})}u(ce,Fe)}),i(he),gr(2),i(Me),u(ee,Me)};j(z,ee=>{e(B)&&ee(re)})}F(()=>h(D,` = ${e($)==="none"?"off":e($)==="newness"?"by recency":"by source"}`)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})}),i(nn);var Vn=d(nn,2);{var go=t=>{var r=di(),a=l(r),c=l(a,!0);i(a),i(r),F(()=>h(c,e(U))),u(t,r)},po=t=>{var r=ci(),a=l(r),c=l(a,!0);i(a),i(r),F(()=>h(c,e(q))),u(t,r)},vo=t=>{var r=ui();u(t,r)},fo=t=>{var r=gi();u(t,r)};j(Vn,t=>{e(U)?t(go):e(q)?t(po,1):e(ae)&&e(V).length===0?t(vo,2):e(ae)||t(fo,3)})}var Jn=d(Vn,2);Bt(Jn,"",{},{top:"20px"});var Qn=d(Jn,4);{var xo=t=>{var r=mi(),a=l(r),c=l(a),g=l(c,!0);i(c);var M=d(c,2);{var m=R=>{var z=pi(),re=l(z,!0);i(z),F(()=>h(re,e(Gt).type)),u(R,z)};j(M,R=>{e(Gt).type&&R(m)})}var T=d(M,2);{var w=R=>{var z=vi();u(R,z)};j(T,R=>{e(Gt).pinned&&R(w)})}var L=d(T,2);{var le=R=>{var z=fi();u(R,z)};j(L,R=>{e(C)&&R(le)})}i(a);var k=d(a,2),N=l(k);i(k);var D=d(k,2),A=l(D,!0);i(D);var te=d(D,2),Pe=l(te,!0);i(te);var Ce=d(te,2);{var Se=R=>{var z=bi(),re=d(l(z),2);Mt(re,21,()=>e(tn),kt,(ee,Me)=>{const he=Q(()=>e(x).get(e(Me).id));var ce=pr(),Le=be(ce);{var Ve=Ne=>{var ke=xi(),Fe=l(ke),rt=l(Fe,!0);i(Fe);var wt=d(Fe,2),ft=l(wt);i(wt),i(ke),F((Qe,De)=>{h(rt,Qe),h(ft,`${De??""}%`)},[()=>yr(e(he)),()=>Math.round(e(Me).score*100)]),u(Ne,ke)};j(Le,Ne=>{e(he)&&Ne(Ve)})}u(ee,ce)}),i(re),i(z),u(R,z)};j(Ce,R=>{e(tn).length>0&&R(Se)})}i(r),hr(r,R=>n(X,R),()=>e(X)),F((R,z,re)=>{h(g,e(Gt).who??"unknown"),h(N,`importance ${R??""}% · ${z??""} · linked ${e(tn).length??""}`),h(A,re),h(Pe,e(C)?"ESC or Unlock Preview button":"Hold Shift to lock preview")},[()=>Math.round((e(Gt).importance??0)*100),()=>La(e(Gt).createdAt),()=>yr(e(Gt))]),u(t,r)};j(Qn,t=>{e(Gt)&&t(xo)})}var zr=d(Qn,2);let Zn;var bo=l(zr);{var mo=t=>{{let r=Q(()=>e(ht)&&e(G).size>0),a=Q(()=>e(Te).size>0?e(Te):null);hr(us(t,{get nodes(){return e(pt)},get edges(){return e(s)},get graphPhysics(){return e(P)},get graphSelected(){return e(p)},get graphHovered(){return e(Gt)},get embeddingFilterIds(){return e(Pt)},get relationLookup(){return e(zn)},get pinnedIds(){return e(mt)},get lensIds(){return e(G)},get clusterLensMode(){return e(r)},get colorMode(){return e($)},get nowMs(){return e(Kt)},get showNewSinceLastSeen(){return e(_t)},get lastSeenMs(){return e(rr)},get sourceFocusSources(){return e(a)},onselectnode:c=>{c?$r(c.id):n(p,null)},onhovernode:Rn}),c=>n(vt,c,!0),()=>e(vt))}},ho=t=>{var r=hi(),a=l(r),c=l(a,!0);i(a),i(r),F(()=>h(c,e(U))),u(t,r)},yo=t=>{var r=yi(),a=l(r),c=l(a,!0);i(a),i(r),F(()=>h(c,e(q))),u(t,r)};j(bo,t=>{e(ae)?t(mo):e(U)?t(ho,1):e(q)&&t(yo,2)})}i(zr);var an=d(zr,2);let $n;var _o=l(an);{var wo=t=>{var r=pr(),a=be(r);{let c=Q(()=>e(ht)&&e(G).size>0),g=Q(()=>e(Te).size>0?e(Te):null);Yt(a,()=>e(Rr),(M,m)=>{hr(m(M,{get embeddings(){return e(V)},get projected3d(){return e(se)},get graphSelected(){return e(p)},get embeddingFilterIds(){return e(Pt)},get relationLookup(){return e(zn)},get pinnedIds(){return e(mt)},get lensIds(){return e(G)},get clusterLensMode(){return e(c)},get embeddingById(){return e(x)},get colorMode(){return e($)},get nowMs(){return e(Kt)},get showNewSinceLastSeen(){return e(_t)},get lastSeenMs(){return e(rr)},get sourceFocusSources(){return e(g)},onselectnode:T=>{T?$r(T.id):n(p,null)},onhovernode:Rn}),T=>n(sr,T,!0),()=>e(sr))})}u(t,r)},So=t=>{var r=_i(),a=l(r),c=l(a,!0);i(a),i(r),F(()=>h(c,e(U)||"Loading 3D...")),u(t,r)};j(_o,t=>{e(Rr)&&!e(Or)?t(wo):e(Or)&&t(So,1)})}i(an),i(Sr),hr(Sr,t=>n(O,t),()=>e(O));var ea=d(Sr,2),on=l(ea),ta=l(on);Yt(ta,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(xe)},set open(a){n(xe,a,!0)},children:(a,c)=>{var g=ki(),M=be(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-mono text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=wi(),N=d(be(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(xe)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var m=d(M,2);Yt(m,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Mi(),N=l(k),D=l(N);Jt(D),hr(D,Ft=>Je=Ft,()=>Je);var A=d(D,2);{var te=Ft=>{var Fr=Si(),cn=l(Fr,!0);i(Fr),F(()=>h(cn,e(Oe).length)),u(Ft,Fr)};j(A,Ft=>{e(Ae)&&Ft(te)})}i(N);var Pe=d(N,2),Ce=l(Pe);i(Pe);var Se=d(Pe,2),R=l(Se),z=d(R,2),re=d(z,2),ee=d(re,2),Me=l(ee,!0);i(ee),i(Se);var he=d(Se,2),ce=d(l(he),2),Le=l(ce),Ve=d(Le,2),Ne=d(Ve,2);i(ce),i(he);var ke=d(he,2),Fe=d(l(ke),2),rt=l(Fe),wt=d(rt,2),ft=l(wt,!0);i(wt),i(Fe),i(ke);var Qe=d(ke,2),De=d(l(Qe),2),St=l(De),Zt=d(l(St),2),vr=l(Zt,!0);i(Zt),i(St);var fr=d(St,2);Jt(fr),i(De);var xr=d(De,2),J=l(xr),nt=d(l(J),2),Vt=l(nt,!0);i(nt),i(J);var Rt=d(J,2);Jt(Rt),i(xr);var at=d(xr,2),zt=l(at),Ot=d(l(zt),2),br=l(Ot,!0);i(Ot),i(zt);var er=d(zt,2);Jt(er),i(at);var sn=d(at,2),ln=l(sn),aa=d(l(ln),2),Io=l(aa,!0);i(aa),i(ln);var dn=d(ln,2);Jt(dn),i(sn);var To=d(sn,2);i(Qe),i(k),F((Ft,Fr,cn,Eo)=>{h(Ce,`Window ${e(Gn).offset+1}-${e(Gn).offset+e(V).length} / ${e(pe)??""}`),xt(R,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(bt)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),xt(z,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(Wt)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),xt(re,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(ht)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(Me,gn.Reset),xt(Le,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="newness"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),xt(Ve,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="source"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),xt(Ne,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="none"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),xt(rt,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(_t)&&e($)!=="none"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"} ${e($)==="none"?"opacity-60 cursor-not-allowed":""}`),rt.disabled=e($)==="none",xt(wt,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(B)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(ft,e(H)?"Loading...":"Entities"),h(vr,Ft),Br(fr,e(P).centerForce),h(Vt,Fr),Br(Rt,e(P).repelForce),h(br,cn),Br(er,e(P).linkForce),h(Io,Eo),Br(dn,e(P).linkDistance)},[()=>e(P).centerForce.toFixed(2),()=>Math.round(e(P).repelForce),()=>e(P).linkForce.toFixed(2),()=>Math.round(e(P).linkDistance)]),Y("input",D,()=>n(Z,"custom-live")),dr(D,()=>e(Ae),Ft=>n(Ae,Ft)),Y("click",R,Ga),Y("click",z,za),Y("click",re,Ba),Y("click",ee,Ha),Y("click",Le,()=>n($,"newness")),Y("click",Ve,()=>n($,"source")),Y("click",Ne,()=>{n($,"none"),n(_t,!1)}),Y("click",rt,()=>n(_t,!e(_t))),Y("click",wt,()=>{n(B,!e(B)),e(ae)&&en()}),Y("input",fr,Ft=>Nr({centerForce:Hr(Ft,e(P).centerForce)})),Y("input",Rt,Ft=>Nr({repelForce:Hr(Ft,e(P).repelForce)})),Y("input",er,Ft=>Nr({linkForce:Hr(Ft,e(P).linkForce)})),Y("input",dn,Ft=>Nr({linkDistance:Hr(Ft,e(P).linkDistance)})),Y("click",To,()=>Nr(Ir)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var ra=d(ta,2);Yt(ra,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(Ye)},set open(a){n(Ye,a,!0)},children:(a,c)=>{var g=Fi(),M=be(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-mono text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Ii(),N=d(be(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(Ye)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var m=d(M,2);Yt(m,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Ni(),N=l(k);Mt(N,17,()=>Ua,kt,(Pe,Ce)=>{var Se=Ti(),R=l(Se,!0);i(Se),F(()=>{xt(Se,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(Z)===e(Ce).id?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(R,e(Ce).name)}),Y("click",Se,()=>jn(e(Ce))),u(Pe,Se)});var D=d(N,2);Mt(D,17,()=>e(ue),kt,(Pe,Ce)=>{var Se=Ei(),R=l(Se),z=l(R,!0);i(R);var re=d(R,2);i(Se),F(()=>{xt(R,1,`px-2 py-[2px] font-mono text-[10px] ${e(Z)===e(Ce).id?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(z,e(Ce).name),fn(re,"aria-label",`Delete ${e(Ce).name} preset`)}),Y("click",R,()=>jn(e(Ce))),Y("click",re,()=>Qa(e(Ce).id)),u(Pe,Se)});var A=d(D,2),te=l(A,!0);i(A),i(k),F(()=>h(te,gn.Save)),Y("click",A,Ja),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var na=d(ra,2);Yt(na,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(Be)},set open(a){n(Be,a,!0)},children:(a,c)=>{var g=Ai(),M=be(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-mono text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Pi(),N=d(be(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(Be)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var m=d(M,2);Yt(m,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Di(),N=l(k);{var D=te=>{var Pe=Ci();u(te,Pe)},A=te=>{var Pe=pr(),Ce=be(Pe);Mt(Ce,17,()=>e(Qt),kt,(Se,R)=>{var z=Li(),re=l(z);i(z),F(ee=>{xt(z,1,`px-2 py-[2px] font-mono text-[10px] border border-[var(--sig-border-strong)] ${ee??""}`),h(re,`${e(R).who??""} ${e(R).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(R).who)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",z,()=>Wa(e(R).who)),u(Se,z)}),u(te,Pe)};j(N,te=>{e(Qt).length===0?te(D):te(A,-1)})}i(k),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var Mo=d(na,2);Yt(Mo,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(dt)},set open(a){n(dt,a,!0)},children:(a,c)=>{var g=Wi(),M=be(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-mono text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Ri(),N=d(be(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(dt)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var m=d(M,2);Yt(m,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Bi(),N=l(k),D=d(l(N),2);Jt(D);var A=d(D,4);Jt(A);var te=d(A,2),Pe=l(te);Pe.value=Pe.__value="all";var Ce=d(Pe);Ce.value=Ce.__value="24h";var Se=d(Ce);Se.value=Se.__value="7d";var R=d(Se);R.value=R.__value="30d";var z=d(R);z.value=z.__value="90d";var re=d(z);re.value=re.__value="custom",i(te),i(N);var ee=d(N,2);{var Me=J=>{var nt=Oi(),Vt=l(nt);Jt(Vt);var Rt=d(Vt,2);Jt(Rt),i(nt),dr(Vt,()=>e(ye),at=>n(ye,at)),dr(Rt,()=>e(je),at=>n(je,at)),u(J,nt)};j(ee,J=>{e(ie)==="custom"&&J(Me)})}var he=d(ee,2),ce=l(he),Le=l(ce);Le.value=Le.__value="all";var Ve=d(Le);Ve.value=Ve.__value="pinned";var Ne=d(Ve);Ne.value=Ne.__value="unpinned",i(ce);var ke=d(ce,2);Jt(ke);var Fe=d(ke,2);Jt(Fe);var rt=d(Fe,2);Jt(rt);var wt=d(rt,2);Jt(wt),i(he);var ft=d(he,2),Qe=d(l(ft),2);{var De=J=>{var nt=Yi();u(J,nt)},St=J=>{var nt=pr(),Vt=be(nt);Mt(Vt,17,()=>e(He),kt,(Rt,at)=>{var zt=Xi(),Ot=l(zt,!0);i(zt),F(br=>{xt(zt,1,`px-2 py-[2px] font-mono text-[10px] border border-[var(--sig-border-strong)] ${br??""}`),h(Ot,e(at))},[()=>e(We).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",zt,()=>Ya(e(at))),u(Rt,zt)}),u(J,nt)};j(Qe,J=>{e(He).length===0?J(De):J(St,-1)})}i(ft);var Zt=d(ft,2);{var vr=J=>{var nt=Hi(),Vt=d(l(nt),2);Mt(Vt,17,()=>[...new Set([...e(gt),...e(Dt).map(Rt=>Rt.value)])],kt,(Rt,at)=>{const zt=Q(()=>e(Dt).find(er=>er.value===e(at))?.count??0);var Ot=ji(),br=l(Ot);i(Ot),F(er=>{xt(Ot,1,`px-2 py-[2px] font-mono text-[10px] border border-[var(--sig-border-strong)] ${er??""}`),h(br,`${e(at)??""}${e(zt)>0?` ${e(zt)}`:""}`)},[()=>e(gt).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",Ot,()=>Xa(e(at))),u(Rt,Ot)}),i(nt),u(J,nt)};j(Zt,J=>{(e(Dt).length>0||e(gt).size>0)&&J(vr)})}var fr=d(Zt,2);{var xr=J=>{var nt=zi(),Vt=d(l(nt),2);Mt(Vt,17,()=>[...new Set([...e(et),...e(lt).map(Rt=>Rt.value)])],kt,(Rt,at)=>{const zt=Q(()=>e(lt).find(er=>er.value===e(at))?.count??0);var Ot=Gi(),br=l(Ot);i(Ot),F(er=>{xt(Ot,1,`px-2 py-[2px] font-mono text-[10px] border border-[var(--sig-border-strong)] ${er??""}`),h(br,`${e(at)??""}${e(zt)>0?` ${e(zt)}`:""}`)},[()=>e(et).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",Ot,()=>ja(e(at))),u(Rt,Ot)}),i(nt),u(J,nt)};j(fr,J=>{(e(lt).length>0||e(et).size>0)&&J(xr)})}i(k),Ar("blur",D,Zr),dr(D,()=>e(ve),J=>n(ve,J)),Ar("blur",A,Zr),dr(A,()=>e(ut),J=>n(ut,J)),oa(te,()=>e(ie),J=>n(ie,J)),oa(ce,()=>e(yt),J=>n(yt,J)),dr(ke,()=>e(it),J=>n(it,J)),dr(Fe,()=>e(Tt),J=>n(Tt,J)),dr(rt,()=>e(Lt),J=>n(Lt,J)),dr(wt,()=>e(fe),J=>n(fe,J)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})}),i(on);var ko=d(on,2);{let t=Q(()=>e(wr)?.nodeType??void 0),r=Q(()=>e(wr)?.entityData??null),a=Q(()=>e(wr)?.aspectData??null),c=Q(()=>e(wr)?.attributeData??null),g=Q(()=>e(wr)?.parentEntityId??null),M=Q(()=>e(wr)?.parentAspectId??null);Gs(ko,{containerClass:"flex-1 min-h-0 w-full min-w-0 border-l-0 border-t-0 max-lg:max-h-none",get graphSelected(){return e(p)},get embeddings(){return e(V)},get embeddingById(){return e(x)},get activeNeighbors(){return e(Ge)},get relationMode(){return e($t)},get loadingGlobalSimilar(){return e(qt)},get globalSimilar(){return e(Et)},get embeddingSearchMatches(){return e(Oe)},get embeddingSearch(){return e(Ae)},get pinBusy(){return e(Xt)},get pinError(){return e(jt)},get selectedNodeType(){return e(t)},get selectedEntityData(){return e(r)},get selectedAspectData(){return e(a)},get selectedAttributeData(){return e(c)},get parentEntityId(){return e(g)},get parentAspectId(){return e(M)},get constellationOverlay(){return e(de)},onselectembedding:$r,onclearselection:eo,onloadglobalsimilar:no,get onopenglobalsimilar(){return o.onopenglobalsimilar},onsetrelationmode:m=>n($t,m,!0),onfocusembedding:()=>e(p)&&to(e(p).id),onpintoggle:ro})}i(ea),i(qn),i(rn),F(()=>{Zn=Bt(zr,"",Zn,{display:e(ge)==="2d"?"contents":"none"}),$n=Bt(an,"",$n,{display:e(ge)==="3d"?"contents":"none"})}),Y("mousemove",Sr,qa),Ar("mouseleave",Sr,()=>{e(C)||n(_,null)}),u(y,rn),Sn()}Mn(["mousemove","click","input"]);export{tl as default};
|
|
1
|
+
import{p as wn,o as v,e as Ie,Q as ne,v as n,j as l,G as hr,i as e,t as d,k as j,l as i,b as u,d as Sn,u as Q,D as fn,M as Y,L as Ar,m as b,N as Mn,g as cr,y as F,B as xt,f as be,w as gr,O as Bt,z as h,A as Mt,J as kt,c as pr,q as No,$ as Fo,h as Yt,X as Jt,af as Br,I as dr,ag as oa,U as un,ah as Po}from"./C0do9GyP.js";import{$ as Co,G as gn,n as sa,a0 as Lo,a1 as ia,a2 as Do,a3 as la,a4 as Ao,a5 as Ro,h as Oo,i as Yo,a6 as pn,a7 as Xo,a8 as jo,a9 as Ho,t as Mr}from"./Ct7xY6Hm.js";import{P as Go}from"./C7g2_hao.js";import{T as zo}from"./DaCh9nrQ.js";import{C as Pr,a as Cr,b as Lr}from"./Byc4SxzP.js";import{w as kr,s as Bo}from"./5h3BgpLU.js";import{f as da,a as ca,b as ua,c as ga,e as pa,g as va}from"./qiR1fnXB.js";import{C as Dr}from"./keB_7abO.js";const Wr=600,Wo=5e3,fa="signet-embeddings-graph-physics",Ir={centerForce:.28,repelForce:-260,linkForce:.12,linkDistance:92},xn={"claude-code":"#5eada4",clawdbot:"#a78bfa",daemon:"#22c55e","signet-daemon":"#22c55e",openclaw:"#facc15","openclaw-memory":"#facc15",opencode:"#60a5fa",user:"#ef4444",manual:"#f472b6",unknown:"#737373"},xa=3600*1e3,qo=24*xa,ba=7*qo,ma=900*1e3,ha=6*xa;function bn(y){const o=(f,S,p)=>Math.min(p,Math.max(S,f));return{centerForce:o(y.centerForce,0,1),repelForce:o(y.repelForce,-600,-10),linkForce:o(y.linkForce,.01,1),linkDistance:o(y.linkDistance,12,280)}}function kn(y){const o=Number.parseInt(y.slice(1),16);return[o>>16&255,o>>8&255,o&255]}function ya(y,o){const[f,S,p]=kn(xn[y??"unknown"]??xn.unknown);return`rgba(${f}, ${S}, ${p}, ${o})`}function _a(y){if(!y)return null;const o=new Date(y).getTime();return Number.isNaN(o)?null:o}function Ko(y,o){const f=_a(y);if(f===null)return .22;const S=Math.max(0,o-f);return S<=ma?1:S<=ha?.76:S<=ba?.52:.22}function In(y){return y>=.95?"minutes":y>=.7?"hours":y>=.45?"week":"older"}function wa(y,o){const f=In(y);return f==="minutes"?`rgba(255, 176, 74, ${o})`:f==="hours"?`rgba(168, 34, 98, ${o})`:f==="week"?`rgba(76, 34, 122, ${o})`:`rgba(118, 111, 102, ${o})`}function Uo(y,o){if(o===null)return!1;const f=_a(y);return f===null?!1:f>o}function yr(y){const o=y.content??y.text??"";return o.length>160?`${o.slice(0,160)}...`:o}function Vo(y){const o=y.sourceType??"memory",f=y.sourceId??y.id;return`${o}:${f}`}function Jo(y,o,f,S,p,_){const U=f!==null&&!f.has(y),q=f!==null&&!f.has(o);if(U||q)return"rgba(120, 120, 120, 0.12)";if(_){const V=p.has(y),pe=p.has(o);return V&&pe?"rgba(220, 220, 220, 0.72)":"rgba(90, 90, 90, 0.08)"}return S.get(y)||S.get(o)?"rgba(200, 200, 200, 0.6)":"rgba(180, 180, 180, 0.4)"}const Kr={person:"#eab308",project:"#06b6d4",system:"#a855f7",tool:"#10b981",concept:"#f43f5e",skill:"#f59e0b",task:"#64748b",unknown:"#737373"};function mn(y){return Kr[y.toLowerCase()]??Kr.unknown}function qr(y,o){const f=mn(y),[S,p,_]=kn(f);return`rgba(${S}, ${p}, ${_}, ${o})`}function Qo(y,o){const f=.8+o*1.2;switch(y){case"uses":case"requires":return{color:"rgba(180, 180, 200, 0.35)",width:f,dash:[]};case"owned_by":return{color:"rgba(160, 160, 180, 0.25)",width:f+.4,dash:[]};case"blocks":return{color:"rgba(220, 100, 100, 0.4)",width:f,dash:[4,3]};case"informs":return{color:"rgba(100, 160, 220, 0.35)",width:f,dash:[2,3]};default:return{color:"rgba(150, 150, 160, 0.3)",width:f,dash:[]}}}function Zo(y){return 5+Math.min(y,1)*3}function $o(y){return 3+Math.min(y,1)}function es(y){const o=y.aspects.length+y.aspects.reduce((f,S)=>f+S.attributes.length*.5,0);return 10+Math.min(o,24)*.5}function ts(y){switch(y){case"entity":return-200;case"aspect":return-40;case"attribute":return-15;case"memory":return-5;default:return-5}}function Sa(y,o){const[f,S,p]=kn(y);return`rgba(${f}, ${S}, ${p}, ${o})`}const rs=[.85],ns=[.3,.5,.7,.75,.9],hn={};for(const[y,o]of Object.entries(xn)){const f={};for(const S of rs)f[S]=Sa(o,S);hn[y]=f}const yn={};for(const[y,o]of Object.entries(Kr)){const f={};for(const S of ns)f[S]=Sa(o,S);yn[y]=f}function _n(y,o){const S=hn[y??"unknown"]?.[o]??hn.unknown?.[o];return S||ya(y,o)}function mr(y,o){const f=y.toLowerCase(),S=yn[f]?.[o]??yn.unknown?.[o];return S||qr(y,o)}const as={minutes:{.9:"rgba(255, 176, 74, 0.9)",1:"rgba(255, 176, 74, 1)"},hours:{.9:"rgba(168, 34, 98, 0.9)",1:"rgba(168, 34, 98, 1)"},week:{.9:"rgba(76, 34, 122, 0.9)",1:"rgba(76, 34, 122, 1)"},older:{.9:"rgba(118, 111, 102, 0.9)",1:"rgba(118, 111, 102, 1)"}};function os(y,o){const f=In(y),S=as[f]?.[o];return S||wa(y,o)}function Ma(y){if(!y)return 0;const o=new Date(y).getTime();return Number.isNaN(o)?0:o}function ss(y,o){if(y===0)return .22;const f=Math.max(0,o-y);return f<=ma?1:f<=ha?.76:f<=ba?.52:.22}class is{fills;constructor(o,f,S,p,_,U,q,V,pe,ot){const ae=new Array(o.length);for(let Ae=0;Ae<o.length;Ae++){const Re=o[Ae];if(Re.nodeType&&Re.nodeType!=="memory"){ae[Ae]="";continue}ae[Ae]=this.compute(Re,f,S,p,_,U,q,V,pe,ot)}this.fills=ae}compute(o,f,S,p,_,U,q,V,pe,ot){const ae=o.data.id,Ae=p.get(ae)??null,Re=S!==null&&!S.has(ae),st=_.has(ae),Oe=q&&!U.has(ae);if(f===ae)return"rgba(255, 255, 255, 0.95)";if(Oe)return Re?"rgba(80, 80, 80, 0.08)":"rgba(95, 95, 95, 0.15)";if(Ae==="similar")return V==="none"?Re?"rgba(160, 170, 185, 0.3)":"rgba(198, 210, 228, 0.84)":Re?"rgba(129, 180, 255, 0.35)":"rgba(129, 180, 255, 0.9)";if(Ae==="dissimilar")return V==="none"?Re?"rgba(165, 150, 150, 0.28)":"rgba(208, 190, 190, 0.8)":Re?"rgba(255, 146, 146, 0.35)":"rgba(255, 146, 146, 0.9)";if(st)return Re?"rgba(220, 220, 220, 0.42)":"rgba(235, 235, 235, 0.95)";if(Re)return"rgba(120, 120, 120, 0.2)";if(V==="none")return"rgba(168, 168, 168, 0.82)";if(V==="newness"){const Je=o.createdMs??Ma(o.data.createdAt),Pt=ss(Je,pe);if(In(Pt)==="older"){const It=o.data.who??"unknown";if(ot!==null&&ot.has(It))return _n(It,.85)}return os(Pt,.9)}return _n(o.data.who,.85)}}const or=50;class ls{minX=-100;maxX=100;minY=-100;maxY=100;cells=new Map;cols=1;offsetX=0;offsetY=0;rebuild(o){if(this.cells.clear(),o.length===0){this.minX=-100,this.maxX=100,this.minY=-100,this.maxY=100,this.cols=1;return}let f=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,p=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(const q of o)q.x<f&&(f=q.x),q.x>S&&(S=q.x),q.y<p&&(p=q.y),q.y>_&&(_=q.y);const U=or;this.minX=f-U,this.maxX=S+U,this.minY=p-U,this.maxY=_+U,this.offsetX=this.minX,this.offsetY=this.minY,this.cols=Math.max(1,Math.ceil((this.maxX-this.minX)/or));for(const q of o){const V=Math.floor((q.x-this.offsetX)/or),ot=Math.floor((q.y-this.offsetY)/or)*this.cols+V,ae=this.cells.get(ot);ae?ae.push(q):this.cells.set(ot,[q])}}query(o,f,S){const p=S+or*.5,_=Math.floor((o-p-this.offsetX)/or),U=Math.floor((o+p-this.offsetX)/or),q=Math.floor((f-p-this.offsetY)/or),V=Math.floor((f+p-this.offsetY)/or),pe=Math.ceil((this.maxY-this.minY)/or),ot=[];for(let ae=Math.max(0,q);ae<=V&&ae<pe;ae++)for(let Ae=Math.max(0,_);Ae<=Math.min(this.cols-1,U);Ae++){const Re=this.cells.get(ae*this.cols+Ae);if(Re)for(const st of Re)ot.push(st)}return ot}}function vn(y,o,f,S){y.beginPath();for(let p=0;p<6;p++){const _=Math.PI/3*p-Math.PI/6,U=o+S*Math.cos(_),q=f+S*Math.sin(_);p===0?y.moveTo(U,q):y.lineTo(U,q)}y.closePath()}var ds=b('<canvas class="minimap svelte-reb91a" aria-label="Graph navigation minimap"></canvas>'),cs=b('<div class="canvas-wrapper svelte-reb91a"><canvas class="main-canvas svelte-reb91a"></canvas> <!></div>');function us(y,o){wn(o,!0);let f=v(null),S=0,p=0,_=.15,U=!1,q=!1,V=!1,pe=null,ot=0,ae=0,Ae=0,Re=0;const st=4;let Oe=null,Je=0,Pt=null,It=!1,tr=0,Te=!0,Qt=null,bt=!1,Wt=new Map;const mt=new ls;let Xt=!0,jt=null,ht=[],G=[],Z=[],ue=0,ze=0,dt=!1;const xe=160,Ye=120,Be=50;let Ze=v(null),Xe=!0,$e=0;const ct=4;let Ct=v(Ie({minX:-100,maxX:100,minY:-100,maxY:100}));const me=Q(()=>o.nodes.length>Be);let Ue=!1;function ve(){if(Te=!0,Xe=!0,!Je){const s=e(f)?.getContext("2d");s&&(Je=requestAnimationFrame(I=>$(s,I)))}}const ut=12e3,ie=8e3,Ee=5e3;function ye(){S=0,p=0,_=.15,bt=!1,je=!1}let je=!1;function it(s){const I=Wt.get(s);I&&(S=I.x,p=I.y,_=Math.max(_,1.6),bt=!0)}function Tt(s,I,B=o.graphPhysics){Oe?.stop(),je=!1;const de=bn(B);Oe=da(s).force("link",ca(I).distance(de.linkDistance).strength(de.linkForce)).force("charge",ua().strength(de.repelForce)).force("x",ga(0).strength(de.centerForce)).force("y",pa(0).strength(de.centerForce)).force("collide",va().radius(H=>H.radius+2)).alphaDecay(.04).on("tick",()=>{Xt=!0,jt=null,ve()}).on("end",()=>{bt||gt()})}function yt(s,I){Oe?.stop(),je=!1;const B=ca(I).distance(H=>{const _e=H.source,ge=H.target;return H.edgeType==="dependency"?120:_e.nodeType==="entity"&&ge.nodeType==="aspect"?50:_e.nodeType==="aspect"&&ge.nodeType==="attribute"?30:_e.nodeType==="attribute"&&ge.nodeType==="memory"?20:50}).strength(H=>{if(H.edgeType==="dependency")return .05;const _e=H.source,ge=H.target;return _e.nodeType==="entity"&&ge.nodeType==="aspect"?.3:_e.nodeType==="aspect"&&ge.nodeType==="attribute"?.4:_e.nodeType==="attribute"&&ge.nodeType==="memory"?.5:.3}),de=ua().strength(H=>ts(H.nodeType));Oe=da(s).force("link",B).force("charge",de).force("x",ga(0).strength(.03)).force("y",pa(0).strength(.03)).force("collide",va().radius(H=>H.radius+2)).alphaDecay(.04).on("tick",()=>{Xt=!0,jt=null,ve()}).on("end",()=>{bt||gt()})}function Lt(s){Oe&&(Tt(o.nodes,o.edges,s),ve())}function fe(){Oe?.stop(),Oe=null}function He(s=!1){lt(),!s&&!bt&&o.nodes.length>0&>(),It||(window.addEventListener("resize",lt),It=!0),_t(),Te=!0;const I=e(f)?.getContext("2d");I&&(cancelAnimationFrame(Je),$(I,0))}function We(){Te=!0;const s=e(f)?.getContext("2d");s&&(cancelAnimationFrame(Je),$(s,0))}function Dt(){cancelAnimationFrame(Je)}function lt(){if(!e(f))return;let s=e(f).parentElement;for(;s&&getComputedStyle(s).display==="contents";)s=s.parentElement;const I=s?.getBoundingClientRect();!I||I.width===0||(e(f).width=I.width,e(f).height=I.height,!bt&&je&>(),ve())}function gt(){if(!e(f))return;if(o.nodes.length===0){S=0,p=0,_=.15;return}const s=Ht(),I=Math.max(s.maxX-s.minX,1),B=Math.max(s.maxY-s.minY,1),de=Math.max(e(f).width,1),H=Math.max(e(f).height,1),_e=Math.min(de/I,H/B)*.92;S=(s.minX+s.maxX)/2,p=(s.minY+s.maxY)/2,_=Math.max(.08,_e),je=!0}function et(s,I){if(!e(f))return[0,0];const B=e(f).getBoundingClientRect(),de=B.width/2,H=B.height/2;return[(s-B.left-de)/_+S,(I-B.top-H)/_+p]}function tt(s,I){Xt&&(mt.rebuild(o.nodes),Xt=!1);const B=mt.query(s,I,28),de=["entity","aspect","attribute","memory",void 0];for(const H of de)for(let _e=B.length-1;_e>=0;_e--){const ge=B[_e];if(ge.nodeType!==H)continue;const se=ge.x-s,qe=ge.y-I,P=ge.radius+(H==="entity"?6:H==="aspect"?5:4);if(se*se+qe*qe<=P*P)return ge}return null}function Ht(){return o.nodes.length===0?{minX:-100,maxX:100,minY:-100,maxY:100}:Xt?(mt.rebuild(o.nodes),Xt=!1,{minX:mt.minX,maxX:mt.maxX,minY:mt.minY,maxY:mt.maxY}):{minX:mt.minX,maxX:mt.maxX,minY:mt.minY,maxY:mt.maxY}}ne(()=>{o.nodes.length>0&&(Wt=new Map(o.nodes.map(s=>[s.data.id,s])),Xt=!0,jt=null,n(Ct,Ht(),!0),Xe=!0)});function $t(){if(!e(Ze)||!e(f))return;const s=e(Ze).getContext("2d");if(!s)return;const{minX:I,maxX:B,minY:de,maxY:H}=e(Ct),_e=B-I,ge=H-de;s.fillStyle="#050505",s.fillRect(0,0,xe,Ye);const se=(xe-8)/_e,qe=(Ye-8)/ge,P=Math.min(se,qe),Ke=(xe-_e*P)/2,x=(Ye-ge*P)/2;s.fillStyle="rgba(140, 140, 150, 0.5)";for(const sr of o.nodes){const Rr=Ke+(sr.x-I)*P,Or=x+(sr.y-de)*P;s.fillRect(Rr-.5,Or-.5,1,1)}const K=e(f).width/_,W=e(f).height/_,C=S-K/2,O=p-W/2;let X=Ke+(C-I)*P,we=x+(O-de)*P,Nt=K*P,Ut=W*P;const vt=2;X=Math.max(vt,Math.min(xe-vt-1,X)),we=Math.max(vt,Math.min(Ye-vt-1,we)),Nt=Math.max(2,Math.min(xe-X-vt,Nt)),Ut=Math.max(2,Math.min(Ye-we-vt,Ut)),s.strokeStyle="rgba(255, 255, 255, 0.75)",s.lineWidth=1.5,s.strokeRect(X,we,Nt,Ut),s.fillStyle="rgba(255, 255, 255, 0.03)",s.fillRect(X,we,Nt,Ut)}function E(s){if(!e(Ze))return null;const I=e(Ze).getBoundingClientRect(),B=s.clientX-I.left,de=s.clientY-I.top,{minX:H,maxX:_e,minY:ge,maxY:se}=e(Ct),qe=_e-H,P=se-ge,Ke=(xe-8)/qe,x=(Ye-8)/P,K=Math.min(Ke,x),W=(xe-qe*K)/2,C=(Ye-P*K)/2,O=H+(B-W)/K,X=ge+(de-C)/K;return[O,X]}function oe(s){s.preventDefault(),s.stopPropagation(),Ue=!0,qt(s)}function Ge(s){Ue&&qt(s)}function qt(s){const I=E(s);if(!I)return;const[B,de]=I;if(S=B,p=de,Xe=!0,Te=!0,!Je){const H=e(f)?.getContext("2d");H&&(Je=requestAnimationFrame(_e=>$(H,_e)))}}function Et(){Ue=!1}function $(s,I){if(!e(f))return;const B=Oe?.alpha?.()??0;if(!(B>.001)&&!Te){Je=0;return}Te=!1;const H=o.edges.length>14e3||o.nodes.length>2200,_e=B>0&&B<.05,ge=H||_e?33:16;if(I>0&&I-tr<ge){Je=requestAnimationFrame(x=>$(s,x));return}if(tr=I,dt){dt=!1;const[x,K]=et(ue,ze),W=tt(x,K),C=W?.data.id??null;C!==Qt&&(Qt=C,o.onhovernode(W?.data??null)),e(f)&&(e(f).style.cursor=W?"pointer":"grab")}const se=e(f).width,qe=e(f).height;s.fillStyle="#050505",s.fillRect(0,0,se,qe),s.save(),s.translate(se/2,qe/2),s.scale(_,_),s.translate(-S,-p);const P=o.graphSelected?.id??null;jt||(jt=new is(o.nodes,P,o.embeddingFilterIds,o.relationLookup,o.pinnedIds,o.lensIds,o.clusterLensMode,o.colorMode,o.nowMs,o.sourceFocusSources));const Ke=_>=1.4?ut:_>=.8?ie:Ee;if(ht.length>0){const x=Math.max(1,Math.ceil(ht.length/Ke));s.beginPath();for(let K=0;K<ht.length;K+=x){const W=ht[K],C=W.source,O=W.target;typeof C=="number"||typeof O=="number"||!C||!O||(s.moveTo(C.x,C.y),s.lineTo(O.x,O.y))}s.strokeStyle="rgba(255, 255, 255, 0.03)",s.lineWidth=.4/_,s.stroke()}if(G.length>0){const x=Math.max(1,Math.ceil(G.length/Ke)),K=new Map;for(let W=0;W<G.length;W+=x){const C=G[W],O=C.source,X=C.target;if(typeof O=="number"||typeof X=="number"||!O||!X)continue;const we=Jo(O.data.id,X.data.id,o.embeddingFilterIds,o.relationLookup,o.lensIds,o.clusterLensMode),Nt=K.get(we);Nt?Nt.push([O.x,O.y,X.x,X.y]):K.set(we,[[O.x,O.y,X.x,X.y]])}s.lineWidth=.8/_;for(const[W,C]of K){s.beginPath();for(const[O,X,we,Nt]of C)s.moveTo(O,X),s.lineTo(we,Nt);s.strokeStyle=W,s.stroke()}}if(Z.length>0){const x=Math.max(1,Math.floor(Ke/4)),K=Math.max(1,Math.ceil(Z.length/x));for(let W=0;W<Z.length;W+=K){const C=Z[W],O=C.source,X=C.target;if(typeof O=="number"||typeof X=="number"||!O||!X)continue;const we=Qo(C.dependencyType??"",C.strength??.5);s.beginPath(),we.dash.length>0&&s.setLineDash(we.dash.map(Nt=>Nt/_)),s.moveTo(O.x,O.y),s.lineTo(X.x,X.y),s.strokeStyle=we.color,s.lineWidth=we.width/_,s.stroke(),we.dash.length>0&&s.setLineDash([])}}{const x=new Map,K=[],W=[];let C=null;for(let O=0;O<o.nodes.length;O++){const X=o.nodes[O];if(X.nodeType!=="memory"&&X.nodeType!==void 0)continue;const we=jt.fills[O],Nt=x.get(we);Nt?Nt.push(X):x.set(we,[X]),o.colorMode!=="none"&&o.showNewSinceLastSeen&&Uo(X.data.createdAt,o.lastSeenMs)&&K.push(X),o.pinnedIds.has(X.data.id)&&W.push(X),P===X.data.id&&(C=X)}for(const[O,X]of x){s.beginPath();for(const we of X)s.moveTo(we.x+we.radius,we.y),s.arc(we.x,we.y,we.radius,0,Math.PI*2);s.fillStyle=O,s.fill()}if(K.length>0){s.beginPath();for(const O of K)s.moveTo(O.x+O.radius+2.2,O.y),s.arc(O.x,O.y,O.radius+2.2,0,Math.PI*2);s.strokeStyle="rgba(246, 194, 107, 0.85)",s.lineWidth=1.1/_,s.stroke()}if(W.length>0){s.strokeStyle="rgba(240, 240, 240, 0.8)",s.lineWidth=1.2/_;for(const O of W){const X=(O.radius+2.5)*2;s.strokeRect(O.x-X/2,O.y-X/2,X,X)}}C&&(s.beginPath(),s.arc(C.x,C.y,C.radius+3,0,Math.PI*2),s.strokeStyle="rgba(255, 255, 255, 0.95)",s.lineWidth=1.5/_,s.stroke())}for(const x of o.nodes){if(x.nodeType!=="attribute")continue;const K=x.data.who??"unknown";s.beginPath(),s.arc(x.x,x.y,x.radius,0,Math.PI*2),s.fillStyle=mr(K,.3),s.fill(),s.strokeStyle=mr(K,.5),s.lineWidth=.6/_,s.stroke(),P===x.data.id&&(s.beginPath(),s.arc(x.x,x.y,x.radius+3,0,Math.PI*2),s.strokeStyle="rgba(255, 255, 255, 0.95)",s.lineWidth=1.5/_,s.stroke())}for(const x of o.nodes){if(x.nodeType!=="aspect")continue;const K=x.data.who??"unknown";if(s.beginPath(),s.arc(x.x,x.y,x.radius,0,Math.PI*2),s.fillStyle=mr(K,.5),s.fill(),s.strokeStyle=mr(K,.75),s.lineWidth=.8/_,s.stroke(),P===x.data.id&&(s.beginPath(),s.arc(x.x,x.y,x.radius+3,0,Math.PI*2),s.strokeStyle="rgba(255, 255, 255, 0.95)",s.lineWidth=1.5/_,s.stroke()),o.graphHovered&&x.data.id===o.graphHovered.id||P===x.data.id){const W=Math.max(7,9/_);s.font=`${W}px var(--font-mono)`,s.fillStyle="rgba(210, 210, 210, 0.85)",s.textAlign="center",s.fillText(x.aspectData?.name??"",x.x,x.y+x.radius+W+1/_),s.textAlign="start"}}for(const x of o.nodes){if(x.nodeType!=="entity")continue;const K=x.entityData?.entityType??"unknown";s.save(),s.shadowColor=mr(K,.5),s.shadowBlur=12/_,vn(s,x.x,x.y,x.radius),s.fillStyle=mr(K,.7),s.fill(),s.restore(),vn(s,x.x,x.y,x.radius),s.strokeStyle=mr(K,.9),s.lineWidth=1.2/_,s.stroke(),P===x.data.id&&(vn(s,x.x,x.y,x.radius+4),s.strokeStyle="rgba(255, 255, 255, 0.95)",s.lineWidth=1.5/_,s.stroke());const W=Math.max(8,10/_);s.font=`bold ${W}px var(--font-mono)`,s.fillStyle="rgba(230, 230, 230, 0.9)",s.textAlign="center",s.fillText(x.entityData?.name??"",x.x,x.y+x.radius+W+2/_),s.textAlign="start"}if(o.graphHovered){const x=Wt.get(o.graphHovered.id);if(x&&x.nodeType!=="entity"&&x.nodeType!=="aspect"){const K=x.nodeType==="attribute"?x.attributeData?.content??yr(o.graphHovered):yr(o.graphHovered),W=9/_;s.font=`${W}px var(--font-mono)`,s.fillStyle="rgba(220, 220, 220, 0.9)",s.textAlign="left";const C=80;s.fillText(K.length>C?`${K.slice(0,C)}...`:K,x.x+x.radius+5/_,x.y+W*.35),s.textAlign="start"}}s.restore(),e(me)&&($e++,(Xe||$e>=ct)&&($t(),Xe=!1,$e=0)),Je=requestAnimationFrame(x=>$(s,x))}function _t(){if(!e(f))return;Pt&&(Pt(),Pt=null);const s=e(f),I=se=>{const[qe,P]=et(se.clientX,se.clientY),Ke=tt(qe,P);V=!1,Ke?(q=!0,pe=Ke,ot=se.clientX,ae=se.clientY):(U=!0,ot=se.clientX,ae=se.clientY,Ae=S,Re=p)},B=se=>{if(q&&pe){const qe=se.clientX-ot,P=se.clientY-ae;if(!V&&qe*qe+P*P<st*st)return;V||(V=!0,bt=!0,pe.fx=pe.x,pe.fy=pe.y,Oe?.alphaTarget(.3).restart());const[Ke,x]=et(se.clientX,se.clientY);pe.fx=Ke,pe.fy=x,ve();return}if(U){bt=!0,S=Ae-(se.clientX-ot)/_,p=Re-(se.clientY-ae)/_,ve();return}ue=se.clientX,ze=se.clientY,dt=!0,ve()},de=()=>{if(q&&pe){V&&(pe.fx=null,pe.fy=null,Oe?.alphaTarget(0)),pe=null,q=!1,ve();return}U=!1},H=()=>{U=!1,Qt!==null&&(Qt=null,o.onhovernode(null))},_e=se=>{if(V)return;const[qe,P]=et(se.clientX,se.clientY),Ke=tt(qe,P);o.onselectnode(Ke?.data??null)},ge=se=>{se.preventDefault(),bt=!0;const qe=se.deltaY>0?.9:1.1,P=Math.max(.1,Math.min(5,_*qe)),Ke=s.getBoundingClientRect(),x=Ke.width/2,K=Ke.height/2,W=se.clientX-Ke.left-x,C=se.clientY-Ke.top-K,O=W/_+S,X=C/_+p;_=P,S=O-W/_,p=X-C/_,ve()};s.addEventListener("pointerdown",I),s.addEventListener("pointermove",B),s.addEventListener("pointerup",de),s.addEventListener("pointerleave",H),s.addEventListener("click",_e),s.addEventListener("wheel",ge,{passive:!1}),Pt=()=>{s.removeEventListener("pointerdown",I),s.removeEventListener("pointermove",B),s.removeEventListener("pointerup",de),s.removeEventListener("pointerleave",H),s.removeEventListener("click",_e),s.removeEventListener("wheel",ge)}}ne(()=>{o.graphSelected,o.graphHovered,o.embeddingFilterIds,o.relationLookup,o.pinnedIds,o.lensIds,o.clusterLensMode,jt=null,ve()}),ne(()=>{const s=o.edges,I=[],B=[],de=[];for(const H of s)H.edgeType==="hierarchy"?I.push(H):H.edgeType==="dependency"?de.push(H):B.push(H);ht=I,G=B,Z=de}),ne(()=>()=>{Oe?.stop(),Oe=null,Pt&&(Pt(),Pt=null),It&&(window.removeEventListener("resize",lt),It=!1),cancelAnimationFrame(Je)});var rr={resetCamera:ye,focusNode:it,startSimulation:Tt,startKnowledgeGraphSimulation:yt,updatePhysics:Lt,stopSimulation:fe,startRendering:He,resumeRendering:We,stopRendering:Dt,requestRedraw:ve},nr=cs(),ar=l(nr);hr(ar,s=>n(f,s),()=>e(f));var Kt=d(ar,2);{var pt=s=>{var I=ds();fn(I,"width",xe),fn(I,"height",Ye),hr(I,B=>n(Ze,B),()=>e(Ze)),Y("mousedown",I,oe),Y("mousemove",I,Ge),Y("mouseup",I,Et),Ar("mouseleave",I,Et),u(s,I)};j(Kt,s=>{e(me)&&s(pt)})}return i(nr),u(y,nr),Sn(rr)}Mn(["mousedown","mousemove","mouseup"]);var gs=b('<button class="text-[11px] text-[var(--sig-accent)] bg-transparent border-none cursor-pointer p-0 hover:underline">Clear</button>'),ps=b('<span class="font-mono text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),vs=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),fs=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase"> </div> <div class="flex flex-col gap-2"></div>',1),xs=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),bs=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Dependencies</div> <div class="flex flex-col gap-2"></div>',1),ms=b('<div class="flex flex-wrap gap-[6px]"><span class="font-mono text-[10px] border px-[7px] py-[2px]"> </span> <!></div> <div class="font-mono text-[14px] text-[var(--sig-text-bright)] font-bold"> </div> <div class="grid grid-cols-3 gap-1 text-[10px] font-mono text-[var(--sig-text-muted)]"><div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>aspects</div></div> <div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>attributes</div></div> <div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>deps</div></div></div> <div class="flex gap-2"><button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!> <!>',1),hs=b('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-text-muted)] uppercase">Parent entity</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),ys=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),_s=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase"> </div> <div class="flex flex-col gap-2"></div>',1),ws=b('<div class="flex flex-wrap gap-[6px]"><span class="font-mono text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]">aspect</span> <span class="font-mono text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span></div> <div class="font-mono text-[14px] text-[var(--sig-text-bright)] font-bold"> </div> <!> <div class="flex gap-2"><button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!>',1),Ss=b('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-text-muted)] uppercase">Parent entity</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),Ms=b('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-text-muted)] uppercase">Parent aspect</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),ks=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Linked memory</div> <button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>',1),Is=b('<div class="flex flex-wrap gap-[6px]"><span class="font-mono text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span> <span class="font-mono text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span></div> <p class="m-0 text-[13px] leading-[1.55] text-[var(--sig-text-bright)] whitespace-pre-wrap break-words"> </p> <!> <!> <div class="flex gap-2"><button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!>',1),Ts=b('<span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span>'),Es=b('<span class="font-mono text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),Ns=b('<span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span>'),Fs=b('<div class="flex flex-wrap gap-[6px]"></div>'),Ps=b('<div class="border border-dashed border-[var(--sig-danger)] p-2 text-[11px] text-[var(--sig-danger)] leading-[1.5]"> </div>'),Cs=b('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">No related memories in this view.</div>'),Ls=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Ds=b('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">Finding similar memories...</div>'),As=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap">global</span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Rs=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Global similar</div> <div class="flex flex-col gap-2"></div>',1),Os=b('<div class="flex flex-wrap gap-[6px]"><span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span> <!> <span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span> <!></div> <div class="font-mono text-[10px] text-[var(--sig-accent)] border border-[var(--sig-border-strong)] px-[7px] py-[5px] bg-transparent break-all"> </div> <p class="m-0 text-[13px] leading-[1.55] text-[var(--sig-text-bright)] whitespace-pre-wrap break-words"> </p> <!> <div class="flex gap-2"><button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed">Center</button> <button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed"> </button> <button class="px-3 py-1 font-mono text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed"> </button></div> <!> <div class="self-start flex border border-[var(--sig-border-strong)] overflow-hidden"><button>Similar</button> <button>Dissimilar</button></div> <div class="flex flex-col gap-2"><!></div> <!>',1),Ys=b('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-mono text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Xs=b('<div class="font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Search matches</div> <div class="flex flex-col gap-2"></div>',1),js=b('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">Select a node to inspect content, source metadata, and similar or dissimilar neighbors.</div> <!>',1),Hs=b('<aside><div class="flex items-center justify-between gap-2"><span class="font-mono text-[11px] tracking-[0.06em] uppercase text-[var(--sig-text)]">Inspector</span> <!></div> <!></aside>');function Gs(y,o){wn(o,!0);let f=cr(o,"containerClass",3,""),S=cr(o,"selectedNodeType",3,void 0),p=cr(o,"selectedEntityData",3,null),_=cr(o,"selectedAspectData",3,null),U=cr(o,"selectedAttributeData",3,null),q=cr(o,"parentEntityId",3,null),V=cr(o,"parentAspectId",3,null),pe=cr(o,"constellationOverlay",3,null);const ot=Q(()=>S()==="entity"&&p()!==null),ae=Q(()=>S()==="aspect"&&_()!==null),Ae=Q(()=>S()==="attribute"&&U()!==null),Re=Q(()=>{if(!p()||!pe())return[];const G=p().id;return pe().dependencies.filter(Z=>Z.sourceEntityId===G||Z.targetEntityId===G)}),st=Q(()=>!q()||!pe()?null:pe().entities.find(G=>G.id===q())??null),Oe=Q(()=>!V()||!e(st)?null:e(st).aspects.find(G=>G.id===V())??null);function Je(G){return pe()?pe().entities.find(ue=>ue.id===G)?.name??G:G}function Pt(G){return o.embeddingById.get(G)??null}var It=Hs(),tr=l(It),Te=d(l(tr),2);{var Qt=G=>{var Z=gs();Y("click",Z,function(...ue){o.onclearselection?.apply(this,ue)}),u(G,Z)};j(Te,G=>{o.graphSelected&&G(Qt)})}i(tr);var bt=d(tr,2);{var Wt=G=>{var Z=ms(),ue=be(Z),ze=l(ue),dt=l(ze,!0);i(ze);var xe=d(ze,2);{var Ye=fe=>{var He=ps();u(fe,He)};j(xe,fe=>{p().pinned&&fe(Ye)})}i(ue);var Be=d(ue,2),Ze=l(Be,!0);i(Be);var Xe=d(Be,2),$e=l(Xe),ct=l($e),Ct=l(ct,!0);i(ct),gr(2),i($e);var me=d($e,2),Ue=l(me),ve=l(Ue,!0);i(Ue),gr(2),i(me);var ut=d(me,2),ie=l(ut),Ee=l(ie,!0);i(ie),gr(2),i(ut),i(Xe);var ye=d(Xe,2),je=l(ye);i(ye);var it=d(ye,2);{var Tt=fe=>{var He=fs(),We=be(He),Dt=l(We);i(We);var lt=d(We,2);Mt(lt,21,()=>p().aspects,kt,(gt,et)=>{var tt=vs(),Ht=l(tt),$t=l(Ht);i(Ht);var E=d(Ht,2),oe=l(E,!0);i(E),i(tt),F(Ge=>{h($t,`w${Ge??""}%`),h(oe,e(et).name)},[()=>Math.round(e(et).weight*100)]),Y("click",tt,()=>o.onselectembedding(`aspect:${e(et).id}`)),u(gt,tt)}),i(lt),F(()=>h(Dt,`Aspects (${p().aspects.length??""})`)),u(fe,He)};j(it,fe=>{p().aspects.length>0&&fe(Tt)})}var yt=d(it,2);{var Lt=fe=>{var He=bs(),We=d(be(He),2);Mt(We,21,()=>e(Re),kt,(Dt,lt)=>{const gt=Q(()=>e(lt).sourceEntityId===p().id),et=Q(()=>e(gt)?e(lt).targetEntityId:e(lt).sourceEntityId);var tt=xs(),Ht=l(tt),$t=l(Ht);i(Ht);var E=d(Ht,2),oe=l(E,!0);i(E),i(tt),F(Ge=>{h($t,`${e(gt)?"->":"<-"} ${e(lt).dependencyType??""}`),h(oe,Ge)},[()=>Je(e(et))]),Y("click",tt,()=>o.onselectembedding(`entity:${e(et)}`)),u(Dt,tt)}),i(We),u(fe,He)};j(yt,fe=>{e(Re).length>0&&fe(Lt)})}F((fe,He)=>{Bt(ze,fe),h(dt,p().entityType),h(Ze,p().name),h(Ct,p().aspects.length),h(ve,He),h(Ee,e(Re).length)},[()=>`color: ${mn(p().entityType)}; border-color: ${mn(p().entityType)}; background: rgba(255,255,255,0.04);`,()=>p().aspects.reduce((fe,He)=>fe+He.attributes.length,0)]),Y("click",je,function(...fe){o.onfocusembedding?.apply(this,fe)}),u(G,Z)},mt=G=>{var Z=ws(),ue=be(Z),ze=d(l(ue),2),dt=l(ze);i(ze),i(ue);var xe=d(ue,2),Ye=l(xe,!0);i(xe);var Be=d(xe,2);{var Ze=me=>{var Ue=hs(),ve=d(l(Ue),2),ut=l(ve,!0);i(ve),i(Ue),F(()=>h(ut,e(st).name)),Y("click",Ue,()=>e(st)&&o.onselectembedding(`entity:${e(st).id}`)),u(me,Ue)};j(Be,me=>{e(st)&&me(Ze)})}var Xe=d(Be,2),$e=l(Xe);i(Xe);var ct=d(Xe,2);{var Ct=me=>{var Ue=_s(),ve=be(Ue),ut=l(ve);i(ve);var ie=d(ve,2);Mt(ie,21,()=>_().attributes,kt,(Ee,ye)=>{var je=ys(),it=l(je),Tt=l(it,!0);i(it);var yt=d(it,2),Lt=l(yt,!0);i(yt),i(je),F(()=>{h(Tt,e(ye).kind),h(Lt,e(ye).content)}),Y("click",je,()=>o.onselectembedding(`attr:${e(ye).id}`)),u(Ee,je)}),i(ie),F(()=>h(ut,`Attributes (${_().attributes.length??""})`)),u(me,Ue)};j(ct,me=>{_().attributes.length>0&&me(Ct)})}F(me=>{h(dt,`weight ${me??""}%`),h(Ye,_().name)},[()=>Math.round(_().weight*100)]),Y("click",$e,function(...me){o.onfocusembedding?.apply(this,me)}),u(G,Z)},Xt=G=>{var Z=Is(),ue=be(Z),ze=l(ue),dt=l(ze,!0);i(ze);var xe=d(ze,2),Ye=l(xe);i(xe),i(ue);var Be=d(ue,2),Ze=l(Be,!0);i(Be);var Xe=d(Be,2);{var $e=ie=>{var Ee=Ss(),ye=d(l(Ee),2),je=l(ye,!0);i(ye),i(Ee),F(()=>h(je,e(st).name)),Y("click",Ee,()=>e(st)&&o.onselectembedding(`entity:${e(st).id}`)),u(ie,Ee)};j(Xe,ie=>{e(st)&&ie($e)})}var ct=d(Xe,2);{var Ct=ie=>{var Ee=Ms(),ye=d(l(Ee),2),je=l(ye,!0);i(ye),i(Ee),F(()=>h(je,e(Oe).name)),Y("click",Ee,()=>e(Oe)&&o.onselectembedding(`aspect:${e(Oe).id}`)),u(ie,Ee)};j(ct,ie=>{e(Oe)&&ie(Ct)})}var me=d(ct,2),Ue=l(me);i(me);var ve=d(me,2);{var ut=ie=>{const Ee=Q(()=>o.embeddingById.get(U().memoryId));var ye=pr(),je=be(ye);{var it=Tt=>{var yt=ks(),Lt=d(be(yt),2),fe=l(Lt),He=l(fe,!0);i(fe);var We=d(fe,2),Dt=l(We,!0);i(We),i(Lt),F(lt=>{h(He,e(Ee).who??"memory"),h(Dt,lt)},[()=>yr(e(Ee))]),Y("click",Lt,()=>e(Ee)&&o.onselectembedding(e(Ee).id)),u(Tt,yt)};j(je,Tt=>{e(Ee)&&Tt(it)})}u(ie,ye)};j(ve,ie=>{U().memoryId&&ie(ut)})}F(ie=>{h(dt,U().kind),h(Ye,`importance ${ie??""}%`),h(Ze,U().content)},[()=>Math.round(U().importance*100)]),Y("click",Ue,function(...ie){o.onfocusembedding?.apply(this,ie)}),u(G,Z)},jt=G=>{var Z=Os(),ue=be(Z),ze=l(ue),dt=l(ze,!0);i(ze);var xe=d(ze,2);{var Ye=E=>{var oe=Ts(),Ge=l(oe,!0);i(oe),F(()=>h(Ge,o.graphSelected.type)),u(E,oe)};j(xe,E=>{o.graphSelected.type&&E(Ye)})}var Be=d(xe,2),Ze=l(Be);i(Be);var Xe=d(Be,2);{var $e=E=>{var oe=Es();u(E,oe)};j(Xe,E=>{o.graphSelected.pinned&&E($e)})}i(ue);var ct=d(ue,2),Ct=l(ct,!0);i(ct);var me=d(ct,2),Ue=l(me,!0);i(me);var ve=d(me,2);{var ut=E=>{var oe=Fs();Mt(oe,21,()=>o.graphSelected.tags.slice(0,8),kt,(Ge,qt)=>{var Et=Ns(),$=l(Et);i(Et),F(()=>h($,`#${e(qt)??""}`)),u(Ge,Et)}),i(oe),u(E,oe)};j(ve,E=>{o.graphSelected.tags?.length&&E(ut)})}var ie=d(ve,2),Ee=l(ie),ye=d(Ee,2),je=l(ye,!0);i(ye);var it=d(ye,2),Tt=l(it,!0);i(it),i(ie);var yt=d(ie,2);{var Lt=E=>{var oe=Ps(),Ge=l(oe,!0);i(oe),F(()=>h(Ge,o.pinError)),u(E,oe)};j(yt,E=>{o.pinError&&E(Lt)})}var fe=d(yt,2),He=l(fe),We=d(He,2);i(fe);var Dt=d(fe,2),lt=l(Dt);{var gt=E=>{var oe=Cs();u(E,oe)},et=E=>{var oe=pr(),Ge=be(oe);Mt(Ge,17,()=>o.activeNeighbors,kt,(qt,Et)=>{const $=Q(()=>Pt(e(Et).id));var _t=pr(),rr=be(_t);{var nr=ar=>{var Kt=Ls(),pt=l(Kt),s=l(pt,!0);i(pt);var I=d(pt,2),B=l(I,!0);i(I),i(Kt),F((de,H)=>{h(s,de),h(B,H)},[()=>Math.round(e(Et).score*1e3)/1e3,()=>yr(e($))]),Y("click",Kt,()=>o.onselectembedding(e($).id)),u(ar,Kt)};j(rr,ar=>{e($)&&ar(nr)})}u(qt,_t)}),u(E,oe)};j(lt,E=>{o.activeNeighbors.length===0?E(gt):E(et,-1)})}i(Dt);var tt=d(Dt,2);{var Ht=E=>{var oe=Ds();u(E,oe)},$t=E=>{var oe=Rs(),Ge=d(be(oe),2);Mt(Ge,21,()=>o.globalSimilar,kt,(qt,Et)=>{var $=As(),_t=d(l($),2),rr=l(_t,!0);i(_t),i($),F(()=>h(rr,e(Et).content)),Y("click",$,()=>o.onopenglobalsimilar(e(Et))),u(qt,$)}),i(Ge),u(E,oe)};j(tt,E=>{o.loadingGlobalSimilar?E(Ht):o.globalSimilar.length>0&&E($t,1)})}F((E,oe)=>{h(dt,o.graphSelected.who??"unknown"),h(Ze,`importance ${E??""}%`),h(Ct,oe),h(Ue,o.graphSelected.content??o.graphSelected.text??"(No content preview available)"),ye.disabled=o.pinBusy,h(je,o.pinBusy?"Saving...":o.graphSelected.pinned?"Unpin":"Pin"),it.disabled=o.loadingGlobalSimilar,h(Tt,o.loadingGlobalSimilar?"Loading...":"Global similar"),xt(He,1,`px-2 py-0.5 text-[10px] font-medium font-mono bg-transparent border-none cursor-pointer tracking-[0.04em] hover:text-[var(--sig-text)] hover:bg-[var(--sig-surface-raised)] ${o.relationMode==="similar"?"text-[var(--sig-text-bright)] bg-[var(--sig-surface-raised)]":"text-[var(--sig-text-muted)]"}`),xt(We,1,`px-2 py-0.5 text-[10px] font-medium font-mono bg-transparent border-none cursor-pointer tracking-[0.04em] hover:text-[var(--sig-text)] hover:bg-[var(--sig-surface-raised)] ${o.relationMode==="dissimilar"?"text-[var(--sig-text-bright)] bg-[var(--sig-surface-raised)]":"text-[var(--sig-text-muted)]"}`)},[()=>Math.round((o.graphSelected.importance??0)*100),()=>Vo(o.graphSelected)]),Y("click",Ee,function(...E){o.onfocusembedding?.apply(this,E)}),Y("click",ye,function(...E){o.onpintoggle?.apply(this,E)}),Y("click",it,function(...E){o.onloadglobalsimilar?.apply(this,E)}),Y("click",He,()=>o.onsetrelationmode("similar")),Y("click",We,()=>o.onsetrelationmode("dissimilar")),u(G,Z)},ht=G=>{var Z=js(),ue=d(be(Z),2);{var ze=dt=>{var xe=Xs(),Ye=d(be(xe),2);Mt(Ye,21,()=>o.embeddingSearchMatches,kt,(Be,Ze)=>{var Xe=Ys(),$e=l(Xe),ct=l($e,!0);i($e);var Ct=d($e,2),me=l(Ct,!0);i(Ct),i(Xe),F(Ue=>{h(ct,e(Ze).who),h(me,Ue)},[()=>yr(e(Ze))]),Y("click",Xe,()=>o.onselectembedding(e(Ze).id)),u(Be,Xe)}),i(Ye),u(dt,xe)};j(ue,dt=>{o.embeddingSearch&&o.embeddingSearchMatches.length>0&&dt(ze)})}u(G,Z)};j(bt,G=>{e(ot)&&p()?G(Wt):e(ae)&&_()?G(mt,1):e(Ae)&&U()?G(Xt,2):o.graphSelected?G(jt,3):G(ht,-1)})}i(It),F(()=>xt(It,1,`flex flex-col gap-3 p-3 overflow-y-auto ${f()}`)),u(y,It),Sn()}Mn(["click"]);var zs=b('<div class="absolute right-3 z-[9] pointer-events-none"><button type="button" class="pointer-events-auto px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] bg-[rgba(5,5,5,0.74)] hover:bg-[var(--sig-text-bright)] hover:text-[var(--sig-bg)]"> </button></div>'),Bs=b('<span class="text-[#c4a24a]"> </span>'),Ws=b('<div class="mt-0.5 font-mono text-[9px] text-[var(--sig-text-muted)] leading-[1.3]"> </div>'),qs=b('<div class="mt-1"><div class="flex items-center justify-between font-mono text-[9px] text-[var(--sig-text-muted)]"><span> </span> <span> </span></div> <div class="mt-1 h-[5px] border border-[rgba(255,255,255,0.2)] bg-[rgba(255,255,255,0.05)]"><div class="h-full bg-[#c4a24a]"></div></div> <div class="mt-1 font-mono text-[9px] text-[var(--sig-text-muted)]"> </div></div>'),Ks=b('<div class="mb-2 border border-[rgba(255,255,255,0.14)] bg-[rgba(255,255,255,0.03)] px-1.5 py-1.5"><div class="font-mono text-[9px] text-[var(--sig-text)] leading-[1.3]"> </div> <!> <!></div>'),Us=b('<button type="button" class="mt-1 font-mono text-[9px] text-[#c4a24a] hover:text-[var(--sig-text-bright)] underline underline-offset-2 disabled:opacity-40 disabled:no-underline"> </button>'),Vs=b('<div class="flex items-start gap-1.5 px-1.5 py-1 border border-[rgba(255,255,255,0.1)] bg-[rgba(255,255,255,0.02)]"><span class="inline-block w-[6px] h-[6px] rounded-full shrink-0 mt-[4px]"></span> <div class="flex-1 min-w-0"><div class="flex items-center justify-between gap-2"><span class="font-mono text-[10px] text-[var(--sig-text)]"> </span> <span class="font-mono text-[9px] text-[var(--sig-text-muted)] uppercase"> </span></div> <div class="font-mono text-[9px] text-[var(--sig-text-muted)] leading-[1.3] mt-0.5"> </div> <!></div></div>'),Js=b('<div class="mt-1 border border-[rgba(255,255,255,0.22)] bg-[rgba(5,5,5,0.92)] px-2 py-2 w-[320px]"><div class="flex items-center justify-between mb-2"><span class="font-mono text-[10px] text-[var(--sig-text-muted)] uppercase tracking-[0.06em]">Constellation Health</span> <span class="font-mono text-[10px] text-[var(--sig-text-muted)]"> </span></div> <!> <div class="space-y-1"></div></div>'),Qs=b('<div class="absolute top-2 right-3 z-[8] pointer-events-none"><div class="pointer-events-auto"><button type="button" class="flex items-center gap-1.5 px-2 py-[4px] font-mono text-[10px] uppercase border border-[rgba(255,255,255,0.22)] bg-[rgba(5,5,5,0.75)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"><span class="inline-block w-[7px] h-[7px] rounded-full shrink-0"></span> <span class="text-[var(--sig-text-muted)]"> </span> <!></button> <!></div></div>'),Zs=b("<span>Legend</span> <!>",1),$s=b("<span> </span>"),ei=b('<div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-[var(--sig-text-muted)] mb-1.5"><span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last few minutes</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last few hours</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last week</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>older</span></div> <div class="flex flex-wrap gap-1 mb-1.5"></div>',1),ti=b('<span><span class="inline-block w-[6px] h-[6px] rounded-full"></span> </span>'),ri=b('<div class="flex flex-wrap gap-1 mb-1.5"></div>'),ni=b('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1.5">No color applied - all nodes are shown in gray.</div>'),ai=b('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Outline</span> = new since last seen</div>'),oi=b('<span class="h-5 inline-flex items-center gap-1 px-1.5 py-0 font-mono text-[10px] text-[var(--sig-text-muted)] border border-[rgba(255,255,255,0.14)] bg-transparent"><span class="inline-block w-[8px] h-[8px]"></span> </span>'),si=b('<div class="mt-2 pt-2 border-t border-[rgba(255,255,255,0.1)]"><div class="text-[10px] font-mono uppercase tracking-[0.06em] text-[var(--sig-text-muted)] mb-1">Knowledge Graph</div> <div class="flex flex-wrap gap-1 mb-1.5"></div> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] space-y-0.5"><div><span class="text-[var(--sig-text)]">Hexagon</span> = entity (large, labeled)</div> <div><span class="text-[var(--sig-text)]">Circle</span> = aspect (medium, orbits entity)</div> <div><span class="text-[var(--sig-text)]">Small dot</span> = attribute (orbits aspect)</div> <div><span class="text-[var(--sig-text)]">Tiny dot</span> = linked memory (leaf node)</div> <div><span class="text-[var(--sig-text)]">Faint lines</span> = parent-child hierarchy</div> <div><span class="text-[var(--sig-text)]">Styled line</span> = entity dependency</div></div></div>'),ii=b('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Color</span> </div> <!> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Radius</span> = importance</div> <div class="flex items-center gap-2 text-[10px] text-[var(--sig-text-muted)] mb-1.5"><span class="inline-block w-[6px] h-[6px] rounded-full border border-[rgba(255,255,255,0.24)]"></span> <span class="inline-block w-[9px] h-[9px] rounded-full border border-[rgba(255,255,255,0.28)]"></span> <span class="inline-block w-[12px] h-[12px] rounded-full border border-[rgba(255,255,255,0.32)]"></span> <span>low to high</span></div> <!> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35]"><span class="text-[var(--sig-text)]">Relation highlight</span> = selected node neighborhood emphasis</div> <!>',1),li=b("<!> <!>",1),di=b('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p> </p></div>'),ci=b('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p class="text-[var(--sig-danger)]"> </p></div>'),ui=b('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p>No memories found</p></div>'),gi=b('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p>Loading...</p></div>'),pi=b('<span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.04)]"> </span>'),vi=b('<span class="font-mono text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),fi=b('<span class="font-mono text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.08)]">locked</span>'),xi=b('<div class="grid grid-cols-[1fr_auto] items-start gap-2 border border-[rgba(255,255,255,0.14)] bg-[rgba(255,255,255,0.02)] px-1.5 py-1"><span class="text-[10px] leading-[1.35] text-[var(--sig-text)] line-clamp-1"> </span> <span class="text-[10px] text-[var(--sig-text-muted)]"> </span></div>'),bi=b('<div class="mt-2 pt-2 border-t border-[rgba(255,255,255,0.14)]"><div class="font-mono text-[10px] text-[var(--sig-text-muted)] uppercase tracking-[0.06em] mb-1">Local neighbors</div> <div class="space-y-1"></div></div>'),mi=b('<div class="z-[9] w-[320px] pointer-events-none border border-[rgba(255,255,255,0.26)] bg-[rgba(5,5,5,0.92)] px-2 py-2" style="position:absolute;top:0;left:0;will-change:transform"><div class="flex items-center gap-1.5 flex-wrap mb-1.5"><span class="font-mono text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.04)]"> </span> <!> <!> <!></div> <div class="font-mono text-[10px] text-[var(--sig-text-muted)] mb-1.5"> </div> <p class="m-0 text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-3"> </p> <div class="mt-1 text-[10px] text-[var(--sig-text-muted)]"> </div> <!></div>'),hi=b('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-text-muted)] font-mono text-[11px]"> </span></div>'),yi=b('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-danger)] font-mono text-[11px]"> </span></div>'),_i=b('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-text-muted)] font-mono text-[11px]"> </span></div>'),wi=b("<span>View Controls</span> <!>",1),Si=b('<span class="font-mono text-[10px] text-[var(--sig-text-muted)] border border-[var(--sig-border)] px-2 py-1"> </span>'),Mi=b('<div class="p-2 space-y-2 border-t border-[var(--sig-border)]"><div class="flex items-center gap-2"><input type="text" class="flex-1 font-mono text-[11px] text-[var(--sig-text-bright)] bg-[var(--sig-surface)] border border-[var(--sig-border-strong)] px-[9px] py-[6px] outline-none" placeholder="Search constellation"/> <!></div> <div class="text-[10px] font-mono text-[var(--sig-text-muted)]"> </div> <div class="flex flex-wrap gap-1"><button>Pinned</button> <button>Neighborhood</button> <button>Lens</button> <button class="px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"> </button></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5"><div class="font-mono text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Color Mode</div> <div class="flex flex-wrap gap-1"><button>Newness</button> <button>Source</button> <button>None</button></div></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5"><div class="font-mono text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Overlays</div> <div class="flex flex-wrap gap-1"><button>New since last seen</button> <button> </button></div></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5" style="accent-color: var(--sig-highlight);"><div class="font-mono text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Graph Physics</div> <label class="block"><div class="flex items-center justify-between text-[10px] font-mono text-[var(--sig-text-muted)]"><span>center force</span> <span> </span></div> <input type="range" min="0" max="1" step="0.01"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-mono text-[var(--sig-text-muted)]"><span>repel force</span> <span> </span></div> <input type="range" min="-600" max="-10" step="5"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-mono text-[var(--sig-text-muted)]"><span>link force</span> <span> </span></div> <input type="range" min="0.01" max="1" step="0.01"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-mono text-[var(--sig-text-muted)]"><span>link distance</span> <span> </span></div> <input type="range" min="12" max="280" step="1"/></label> <button type="button" class="px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]">Physics Reset</button></div></div>'),ki=b("<!> <!>",1),Ii=b("<span>Presets</span> <!>",1),Ti=b("<button> </button>"),Ei=b('<div class="inline-flex items-center border border-[var(--sig-border-strong)]"><button> </button> <button class="px-1.5 py-[2px] font-mono text-[10px] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]">×</button></div>'),Ni=b('<div class="p-2 border-t border-[var(--sig-border)] flex flex-wrap gap-1"><!> <!> <button class="px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"> </button></div>'),Fi=b("<!> <!>",1),Pi=b("<span>Sources</span> <!>",1),Ci=b('<span class="text-[10px] text-[var(--sig-text-muted)]">No sources</span>'),Li=b("<button> </button>"),Di=b('<div class="p-2 border-t border-[var(--sig-border)] flex flex-wrap gap-1"><!></div>'),Ai=b("<!> <!>",1),Ri=b("<span>Advanced</span> <!>",1),Oi=b('<div class="flex items-center gap-1 flex-wrap"><input type="date" class="font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <input type="date" class="font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/></div>'),Yi=b('<span class="text-[10px] text-[var(--sig-text-muted)] font-mono">none</span>'),Xi=b("<button> </button>"),ji=b("<button> </button>"),Hi=b('<div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-mono">Type</span> <!></div>'),Gi=b("<button> </button>"),zi=b('<div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-mono">Source type</span> <!></div>'),Bi=b('<div class="p-2 border-t border-[var(--sig-border)] space-y-2"><div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-mono">Window</span> <input type="number" min="0" max="100000" class="w-[70px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <span class="text-[10px] text-[var(--sig-text-muted)] font-mono">to</span> <input type="number" min="1" max="100000" class="w-[70px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <select class="font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"><option>time: all</option><option>time: 24h</option><option>time: 7d</option><option>time: 30d</option><option>time: 90d</option><option>time: custom</option></select></div> <!> <div class="flex items-center gap-1 flex-wrap"><select class="font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"><option>pins: all</option><option>pins: pinned</option><option>pins: unpinned</option></select> <input type="text" class="w-[140px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="server query"/> <input type="text" class="w-[110px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="tags csv"/> <input type="text" class="w-[60px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="imp>"/> <input type="text" class="w-[60px] font-mono text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="imp<"/></div> <div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-mono">Harness</span> <!></div> <!> <!></div>'),Wi=b("<!> <!>",1),qi=b('<div class="flex flex-col flex-1 min-h-0 overflow-hidden"><!> <div class="flex flex-1 min-h-0 bg-[#050505] max-lg:flex-col"><div class="flex-1 relative overflow-hidden bg-[#050505]" role="presentation"><!> <!> <div class="absolute left-3 top-3 bottom-3 z-[8] pointer-events-none flex flex-col justify-end items-start max-w-[220px]"><!></div> <!> <div class="absolute left-[14px] z-[6] font-mono text-[10px] text-[var(--sig-text-muted)] tracking-[0.08em] uppercase pointer-events-none" aria-hidden="true">:: ○ ○ 01 10 11 // latent topology</div> <div class="absolute inset-0 pointer-events-none z-[5]" aria-hidden="true"><span class="absolute top-[10px] left-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:1px 0 0 1px"></span> <span class="absolute top-[10px] right-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:1px 1px 0 0"></span> <span class="absolute bottom-[10px] left-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:0 0 1px 1px"></span> <span class="absolute bottom-[10px] right-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:0 1px 1px 0"></span></div> <!> <div><!></div> <div><!></div></div> <div class="w-[360px] min-w-[320px] border-l border-[var(--sig-border)] bg-[var(--sig-surface)] flex flex-col min-h-0 max-lg:w-full max-lg:min-w-0 max-lg:max-h-[48%] max-lg:border-l-0 max-lg:border-t max-lg:border-t-[var(--sig-border)]"><div class="p-3 border-b border-[var(--sig-border)] space-y-2 overflow-y-auto"><!> <!> <!> <!></div> <!></div></div></div>');function tl(y,o){wn(o,!0);let f=cr(o,"embedded",3,!1),S=v(!1),p=v(null),_=v(null),U=v(""),q=v(""),V=v(Ie([])),pe=v(0),ot=v(!1),ae=v(!1),Ae=v(""),Re=v(""),st=0,Oe=v(Ie([])),Je,Pt=v(null),It=v(null),tr=v(null),Te=v(Ie(new Set)),Qt=v(Ie([])),bt=v(!1),Wt=v(!0),mt=v(Ie(new Set)),Xt=v(!1),jt=v(""),ht=v(!0),G=v(Ie(new Set)),Z=v("focus"),ue=v(Ie([])),ze=v(!1),dt=v(!1),xe=v(!0),Ye=v(!1),Be=v(!0);const Ze=["daemon","user","opencode"],Xe=new Set(Ze),$e="signet-constellation-color-mode-session",ct="signet-constellation-new-since-session",Ct="signet-constellation-color-mode",me="signet-constellation-new-since",Ue="signet-constellation-last-seen";let ve=v(0),ut=v(Ie(Wr)),ie=v("all"),Ee=v(Ie(Date.now())),ye=v(""),je=v(""),it=v(""),Tt=v(""),yt=v("all"),Lt=v(""),fe=v(""),He=v(Ie([])),We=v(Ie(new Set)),Dt=v(Ie([])),lt=v(Ie([])),gt=v(Ie(new Set)),et=v(Ie(new Set)),tt=v(""),Ht=0,$t=v("similar"),E=v(Ie([])),oe=v(Ie([])),Ge=v(Ie([])),qt=v(!1),Et=v(Ie([])),$=v("source"),_t=v(!1),rr=v(null),nr=v(null),ar=v(!1),Kt=v(Ie(Date.now())),pt=v(Ie([])),s=v(Ie([])),I=v(Ie([])),B=v(!1),de=v(null),H=v(!1);const _e="signet-constellation-entity-overlay";let ge=v("2d"),se=v(Ie([])),qe=0,P=v(Ie(Ir)),Ke=v(!1),x=v(Ie(new Map)),K=v(Ie(new Map)),W=v(Ie(new Map)),C=v(null),O=v(null),X=v(null),we=0,Nt=0,Ut=null,vt=v(null),sr=v(null),Rr=v(null),Or=v(!1),Tn=v(!1),ur=v(null),Ur=v(!1),_r=v(!1),Vr,ir=v(null),lr=v(null),At=v(null),Yr;No(()=>{n(xe,kr.embeddings.controlsOpen,!0),n(Ye,kr.embeddings.presetsOpen,!0),n(Be,kr.embeddings.sourcesOpen,!0)});function ka(t){if(sa.activeTab!=="embeddings"||t.defaultPrevented)return;const r=t.target,a=r instanceof HTMLElement&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.tagName==="SELECT"||r.isContentEditable),c=r instanceof HTMLElement&&r.getAttribute("data-memory-tab")==="embeddings";if(t.key==="ArrowDown"&&c){t.preventDefault(),e(xe)?Je?.focus():(n(xe,!0),un().then(()=>Je?.focus()));return}if(t.key==="ArrowUp"&&r===Je){t.preventDefault();const g=document.querySelector('[data-memory-tab="embeddings"]');g?g.focus():Je?.blur();return}}async function Tr(){n(ur,await Lo(),!0)}function Ia(t){const r=t.match(/cooldown active,\s*(\d+)ms remaining/i);if(!r?.[1])return null;const a=Number.parseInt(r[1],10);return Number.isFinite(a)&&a>=0?a:null}function En(t){const r=Math.ceil(t/1e3);if(r<60)return`${r}s`;const a=Math.floor(r/60),c=r%60;return c>0?`${a}m ${c}s`:`${a}m`}function Ta(t){const r=t.match(/([\d,]+)\s+memories?\s+missing\s+embeddings/i);if(!r?.[1])return null;const a=Number.parseInt(r[1].replaceAll(",",""),10);return Number.isFinite(a)&&a>=0?a:null}function Er(){Yr&&(clearInterval(Yr),Yr=void 0)}function Ea(t){const r=Math.max(1,Math.floor(t/1e3));if(r<60)return`${r}s`;const a=Math.floor(r/60),c=r%60;return c>0?`${a}m ${c}s`:`${a}m`}function Nn(t){Er();const r=Date.now();let a=t,c=!1,g=0;n(ir,"Re-embedding in progress"),n(lr,t===null?"Collecting progress...":`${t.toLocaleString()} missing at start`,!0),n(At,null);const M=async()=>{if(!c){c=!0;try{const m=await pn(),T=Ea(Date.now()-r);if(n(ir,`Re-embedding in progress (${T})`),m){a===null&&(a=m.unembedded);const w=Math.max(0,a??m.unembedded),L=Math.max(0,w-m.unembedded),le=w>0?Math.min(100,L/w*100):100;n(At,{baseline:w,completed:L,remaining:m.unembedded,percent:le,coverage:m.coverage},!0),n(lr,a===null?`${m.unembedded.toLocaleString()} still missing (${m.coverage} coverage)`:`${L.toLocaleString()} completed, ${m.unembedded.toLocaleString()} remaining (${m.coverage} coverage)`,!0)}g%2===0&&await Tr(),g++}finally{c=!1}}};M(),Yr=setInterval(()=>{M()},3e3)}async function Na(t){if(e(_r))return;n(_r,!0);const r=t.name==="coverage"||t.name==="null-vectors";if(r||(n(ir,`Running ${t.name} repair...`),n(lr,null),n(At,null)),r){const a=Ta(t.message);if(a!==null)Nn(a);else{const c=await pn();Nn(c?.unembedded??null)}}try{let a;if(t.name==="orphaned-embeddings")a=await Xo();else if(t.name==="vec-table-sync")a=await jo();else if(t.name==="coverage"||t.name==="null-vectors")a=await Ho();else{Mr(`Repair action not wired for ${t.name}`,"warning");return}if(!a.success){if(Er(),a.status===429){const c=Ia(a.message);c!==null?(n(ir,"Repair blocked by cooldown"),n(lr,`Try again in ${En(c)}.`),Mr(`Repair on cooldown. Try again in ${En(c)}.`,"warning",4500)):(n(ir,"Repair blocked by policy"),n(lr,a.message,!0),Mr(`Repair temporarily blocked: ${a.message}`,"warning",5e3)),await Tr();return}n(ir,"Repair failed"),n(lr,a.message,!0),n(At,null),Mr(`Repair failed: ${a.message}`,"error",5e3);return}if(Er(),n(ir,"Repair completed"),n(lr,a.message,!0),r){const c=await pn();if(c&&e(At)){const g=e(At).baseline,M=Math.max(0,g-c.unembedded);n(At,{baseline:g,completed:M,remaining:c.unembedded,percent:g>0?Math.min(100,M/g*100):100,coverage:c.coverage},!0)}}a.affected>0?Mr(a.message,"success",4500):Mr(a.message,"info",4500),await Tr(),r&&a.affected>0&&await en()}finally{Er(),n(_r,!1)}}function Fa(t){return t==="healthy"?"#4a7a5e":t==="degraded"?"#c4a24a":"#8a4a48"}function Pa(t){return t==="ok"?"#4a7a5e":t==="warn"?"#c4a24a":"#8a4a48"}ne(()=>(Tr(),Vr=setInterval(Tr,6e4),()=>{Er(),Vr&&clearInterval(Vr)}));let Jr=!1;function Xr(){Jr||(Jr=!0,queueMicrotask(()=>{Jr=!1,e(ge)==="3d"&&e(sr)?.refreshAppearance()}))}function Ca(t){return{id:t.id,content:t.content,who:t.who,importance:t.importance,type:t.type,tags:t.tags,pinned:t.pinned??!1,sourceType:t.sourceType,sourceId:t.sourceId,createdAt:t.createdAt}}function La(t){if(!t)return"-";const r=new Date(t);return Number.isNaN(r.getTime())?"-":r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function jr(t,r){const a=new Date(e(Kt)-t).toISOString();return wa(Ko(a,e(Kt)),r)}function Qr(){const t=Number.isFinite(e(ve))?Math.max(0,Math.trunc(e(ve))):0,r=Number.isFinite(e(ut))?Math.max(1,Math.trunc(e(ut))):Wr,a=Math.max(t+1,Math.min(r,t+Wo));return{offset:t,limit:a-t}}function Zr(){const{offset:t,limit:r}=Qr();n(ve,t,!0),n(ut,t+r)}function Fn(t,r){const a=t.trim();if(!a)return;const c=r?"T23:59:59.999":"T00:00:00.000",g=new Date(`${a}${c}`);if(!Number.isNaN(g.getTime()))return g.toISOString()}function Pn(t){const r=t.trim();if(!r)return;const a=Number.parseFloat(r);if(Number.isFinite(a))return Math.min(1,Math.max(0,a))}function Hr(t,r){const a=t.currentTarget;if(!(a instanceof HTMLInputElement))return r;const c=Number.parseFloat(a.value);return Number.isFinite(c)?c:r}function Nr(t){n(P,bn({...e(P),...t}),!0)}function Da(t,r){if(t==="all"||t==="custom")return;const a=t==="24h"?1440*60*1e3:t==="7d"?10080*60*1e3:t==="30d"?720*60*60*1e3:2160*60*60*1e3;return new Date(r-a).toISOString()}function Cn(){const{offset:t,limit:r}=Qr(),a={offset:t,limit:r},c=e(it).trim();c.length>0&&(a.q=c);const g=[...e(We)];g.length>0&&(a.who=g);const M=[...e(gt)];M.length>0&&(a.types=M);const m=[...e(et)];m.length>0&&(a.sourceTypes=m);const T=e(Tt).split(",").map(N=>N.trim()).filter(N=>N.length>0);T.length>0&&(a.tags=T),e(yt)==="pinned"&&(a.pinned=!0),e(yt)==="unpinned"&&(a.pinned=!1);let w,L;e(ie)==="custom"?(w=Fn(e(ye),!1),L=Fn(e(je),!0)):w=Da(e(ie),e(Ee)),w&&(a.since=w),L&&(a.until=L);let le=Pn(e(Lt)),k=Pn(e(fe));if(typeof le=="number"&&typeof k=="number"&&le>k){const N=le;le=k,k=N}return typeof le=="number"&&(a.importanceMin=le),typeof k=="number"&&(a.importanceMax=k),a}function Ln(t){return JSON.stringify({offset:t.offset??0,limit:t.limit??Wr,q:t.q??"",who:[...t.who??[]].sort(),types:[...t.types??[]].sort(),sourceTypes:[...t.sourceTypes??[]].sort(),tags:[...t.tags??[]].sort(),pinned:t.pinned??"all",since:t.since??"",until:t.until??"",importanceMin:typeof t.importanceMin=="number"?t.importanceMin:"",importanceMax:typeof t.importanceMax=="number"?t.importanceMax:""})}function Aa(t){let r=null;for(const a of t)if(a!==null){if(r===null){r=new Set(a);continue}if(r.size<=a.size)for(const c of r)a.has(c)||r.delete(c);else{const c=new Set;for(const g of a)r.has(g)&&c.add(g);r=c}}return r}function Ra(t,r){const a=e(V).findIndex(M=>M.id===t);if(a<0)return;const c=r(e(V)[a]);e(V)[a]=c,n(V,e(V),!0),e(x).set(t,c),n(x,e(x),!0);const g=e(pt).findIndex(M=>M.data.id===t);g>=0&&(e(pt)[g]={...e(pt)[g],data:c},n(pt,e(pt),!0)),e(p)?.id===t&&n(p,c,!0),e(_)?.id===t&&n(_,c,!0)}function Oa(t){const r=new Set(e(Te));r.has(t)?r.delete(t):r.add(t),n(Te,r,!0)}function Ya(t){const r=new Set(e(We));r.has(t)?r.delete(t):r.add(t),n(We,r,!0)}function Xa(t){const r=new Set(e(gt));r.has(t)?r.delete(t):r.add(t),n(gt,r,!0)}function ja(t){const r=new Set(e(et));r.has(t)?r.delete(t):r.add(t),n(et,r,!0)}function Ha(){n(ve,0),n(ut,Wr,!0),n(ie,"all"),n(ye,""),n(je,""),n(it,""),n(Tt,""),n(yt,"all"),n(Lt,""),n(fe,""),n(We,new Set,!0),n(gt,new Set,!0),n(et,new Set,!0),Zr()}function Ga(){n(bt,!e(bt)),n(Z,"custom-live")}function Dn(){if(e(p))return e(p);if(e(Gt))return n(p,e(Gt),!0),e(Gt);const t=e(V)[0]??null;return t&&n(p,t,!0),t}function za(){!e(Wt)&&!Dn()||(n(Wt,!e(Wt)),n(Z,"custom-live"))}function Ba(){!e(ht)&&!Dn()||(n(ht,!e(ht)),n(Z,"custom-live"))}function Wa(t){Oa(t),n(Z,"custom-live")}function An(){if(!e(X)||!Ut)return;const t=Math.max(12,Ut.width-334),r=Math.max(12,Ut.height-170),a=Math.min(Math.max(12,we+14),t),c=Math.min(Math.max(12,Nt+14),r);e(X).style.transform=`translate3d(${a}px, ${c}px, 0)`}function qa(t){Ut&&(we=t.clientX-Ut.left,Nt=t.clientY-Ut.top,An())}function Rn(t){e(C)||!t&&!e(_)||t&&e(_)&&t.id===e(_).id||n(_,t,!0)}function Ka(){e(p)||e(_)&&n(C,e(_).id,!0)}function On(){n(C,null)}function Yn(t){return typeof t=="number"?e(I)[t]??null:t?.data.id??null}const Xn="signet-embeddings-filter-presets",Ua=[{id:"all",name:"All",search:"",sources:[],pinnedOnly:!1,neighborhoodOnly:!1,clusterLensMode:!1},{id:"pinned",name:"Pinned",search:"",sources:[],pinnedOnly:!0,neighborhoodOnly:!1,clusterLensMode:!1},{id:"focus",name:"Focus",search:"",sources:[],pinnedOnly:!1,neighborhoodOnly:!0,clusterLensMode:!0}];function Va(t,r){return{id:r,name:t,search:e(Ae),sources:[...e(Te)],pinnedOnly:e(bt),neighborhoodOnly:e(Wt),clusterLensMode:e(ht)}}function jn(t){n(Ae,t.search,!0),n(Te,new Set(t.sources),!0),n(bt,t.pinnedOnly,!0),n(Wt,t.neighborhoodOnly,!0),n(ht,t.clusterLensMode,!0),n(Z,t.id,!0)}function Ja(){if(typeof window>"u")return;const t=e(p)?`Cluster: ${e(p).who??"source"}`:"Custom preset",a=window.prompt("Preset name",t)?.trim();if(!a)return;const c=`custom-${Date.now()}`,g=Va(a,c);n(ue,[g,...e(ue)].slice(0,8),!0),n(Z,c)}function Qa(t){n(ue,e(ue).filter(r=>r.id!==t),!0),e(Z)===t&&n(Z,"all")}async function Hn(){if(e(ae))return;n(ae,!0),n(q,""),n(U,"Loading projection...");const t=++qe,r=Cn(),a=Ln(r);try{let c=await ia(2,r),g=0;const M=30;for(;c.status==="computing";){if(t!==qe)return;if(g++,g>=M){n(q,"Projection timed out after 60s. Try refreshing."),n(tt,a,!0);return}n(U,"Computing layout..."),await new Promise(A=>setTimeout(A,2e3)),c=await ia(2,r)}if(c.status==="error"){n(q,c.message??"Projection computation failed",!0),n(tt,a,!0);return}if(t!==qe)return;const m=c.nodes??[];if(n(V,m.map(Ca),!0),n(pe,c.total??m.length,!0),n(ot,!!(c.hasMore??(c.count??m.length)<(c.total??m.length)),!0),n(tt,a,!0),n(x,new Map(e(V).map(A=>[A.id,A])),!0),m.length===0){n(U,"");return}let T=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY;for(const A of m)A.x<T&&(T=A.x),A.x>w&&(w=A.x),A.y<L&&(L=A.y),A.y>le&&(le=A.y);const k=w-T||1,N=le-L||1,D=560;if(n(pt,m.map((A,te)=>({x:((A.x-T)/k-.5)*D,y:((A.y-L)/N-.5)*D,radius:2.3+(A.importance??.5)*2.8,color:_n(A.who,.85),data:e(V)[te],createdMs:Ma(A.createdAt)})),!0),n(I,e(V).map(A=>A.id),!0),n(s,(c.edges??[]).map(([A,te])=>({source:A,target:te,edgeType:"knn"})),!0),e(B)&&await Za(),n(U,""),await un(),t!==qe)return;e(B)?(e(vt)?.startKnowledgeGraphSimulation(e(pt),e(s)),e(vt)?.startRendering(!0)):(e(vt)?.startSimulation(e(pt),e(s),e(P)),e(vt)?.startRendering())}catch(c){n(q,c.message||"Failed to load projection",!0),n(U,""),n(tt,a,!0)}}async function Za(){n(H,!0);try{const t=await Do(o.agentId);if(!t){n(de,null);return}n(de,t,!0);const r=new Map;for(const w of e(pt))r.set(w.data.id,w);const a=[],c=[],g=[],M=new Map,m=new Map,T=400;for(const w of t.entities){const L=`entity:${w.id}`,le=es(w),k=(Math.random()-.5)*T,N=(Math.random()-.5)*T,D={id:L,content:w.name,who:w.entityType,importance:.9,pinned:w.pinned,tags:[],createdAt:void 0},A=a.length;m.set(w.id,A),a.push({x:k,y:N,radius:le,color:qr(w.entityType,.7),data:D,nodeType:"entity",entityData:w}),g.push(L),M.set(L,D);for(const te of w.aspects){const Pe=`aspect:${te.id}`,Ce=Zo(te.weight),Se={id:Pe,content:te.name,who:w.entityType,importance:te.weight,pinned:!1,tags:[],createdAt:void 0},R=a.length;a.push({x:k+(Math.random()-.5)*80,y:N+(Math.random()-.5)*80,radius:Ce,color:qr(w.entityType,.5),data:Se,nodeType:"aspect",aspectData:te,parentEntityId:w.id}),g.push(Pe),M.set(Pe,Se),c.push({source:A,target:R,edgeType:"hierarchy"});for(const z of te.attributes){const re=`attr:${z.id}`,ee=$o(z.importance),Me={id:re,content:z.content,who:w.entityType,importance:z.importance,pinned:!1,tags:[],createdAt:void 0},he=a.length;if(a.push({x:a[R].x+(Math.random()-.5)*40,y:a[R].y+(Math.random()-.5)*40,radius:ee,color:qr(w.entityType,.3),data:Me,nodeType:"attribute",attributeData:z,parentEntityId:w.id,parentAspectId:te.id}),g.push(re),M.set(re,Me),c.push({source:R,target:he,edgeType:"hierarchy"}),z.memoryId){const ce=r.get(z.memoryId);if(ce){const Le=a.length;a.push({x:a[he].x+(Math.random()-.5)*25,y:a[he].y+(Math.random()-.5)*25,radius:2,color:ce.color,data:ce.data,nodeType:"memory"}),g.push(ce.data.id),M.set(ce.data.id,ce.data),c.push({source:he,target:Le,edgeType:"hierarchy"})}}}}}if(a.length>3e3){const w=new Map;let L=0;for(let k=0;k<a.length;k++)a[k].nodeType!=="memory"&&(w.set(k,L),a[L]=a[k],g[L]=g[k],L++);a.length=L,g.length=L;let le=0;for(const k of c){const N=w.get(k.source),D=w.get(k.target);N!==void 0&&D!==void 0&&(c[le]={...k,source:N,target:D},le++)}c.length=le,M.clear();for(const k of a)M.set(k.data.id,k.data)}for(const w of t.dependencies){const L=m.get(w.sourceEntityId),le=m.get(w.targetEntityId);L!==void 0&&le!==void 0&&c.push({source:L,target:le,edgeType:"dependency",dependencyType:w.dependencyType,strength:w.strength})}n(pt,a,!0),n(I,g,!0),n(s,c,!0),n(x,M,!0)}finally{n(H,!1)}}async function $a(t){if(!t){n(E,[],!0),n(oe,[],!0),n(Ge,[],!0),n(W,new Map,!0);return}const r=await la(t.id,10);n(E,r.map(a=>({id:a.id,score:a.score??0,kind:"similar"})),!0),n(oe,[],!0),n(Ge,e(E),!0),n(W,new Map(e(E).map(a=>[a.id,a.kind])),!0)}function eo(){n(p,null),n(_,null),n(C,null),n(Et,[],!0),n(jt,"")}function $r(t){const r=e(x).get(t)??null;r&&(n(C,null),n(p,r,!0))}function to(t){if(e(ge)==="2d"){e(vt)?.focusNode(t);return}e(sr)?.focusNode(t)}async function ro(){if(!e(p)||e(Xt))return;n(Xt,!0),n(jt,"");const t=e(p).id,r=!(e(p).pinned??!1),a=await Ao(t,r);if(!a.success){n(jt,a.error??"Failed to update pin state",!0),n(Xt,!1);return}Ra(t,c=>({...c,pinned:r})),e(ge)==="3d"&&e(sr)?.refreshAppearance(),n(Xt,!1)}async function no(){if(e(p)){n(qt,!0);try{n(Et,await la(e(p).id,10,Ro.filterType||void 0),!0)}finally{n(qt,!1)}}}async function en(){n(ae,!1),n(U,""),n(q,""),n(se,[],!0),n(p,null),n(_,null),n(C,null),n(Et,[],!0),n(qt,!1),n(x,new Map,!0),n(W,new Map,!0),n(E,[],!0),n(oe,[],!0),n(Ge,[],!0),n(V,[],!0),n(pe,0),n(ot,!1),n(pt,[],!0),n(s,[],!0),n(I,[],!0),n(jt,""),e(vt)?.stopSimulation(),e(vt)?.stopRendering(),e(vt)?.resetCamera(),e(sr)?.destroy(),n(ge,"2d"),await un(),Hn()}ne(()=>{const t=e(V),r=new Set,a=new Map,c=new Map,g=new Map,M=new Map;for(const m of t){m.pinned&&r.add(m.id);const T=m.who??"unknown";a.set(T,(a.get(T)??0)+1),typeof m.type=="string"&&m.type.length>0&&c.set(m.type,(c.get(m.type)??0)+1);const w=m.sourceType??"memory";g.set(w,(g.get(w)??0)+1),M.set(m.id,[m.content,m.text??"",m.who??"",m.type??"",m.sourceType??"",m.sourceId??"",...m.tags??[]].join(" ").toLowerCase())}if(n(mt,r,!0),n(K,M,!0),n(Qt,[...a.entries()].sort((m,T)=>T[1]-m[1]||m[0].localeCompare(T[0])).map(([m,T])=>({who:m,count:T})),!0),n(Dt,[...c.entries()].sort((m,T)=>T[1]-m[1]||m[0].localeCompare(T[0])).map(([m,T])=>({value:m,count:T})),!0),n(lt,[...g.entries()].sort((m,T)=>T[1]-m[1]||m[0].localeCompare(T[0])).map(([m,T])=>({value:m,count:T})),!0),e(Te).size>0){const m=new Set([...e(Te)].filter(T=>a.has(T)));m.size!==e(Te).size&&n(Te,m,!0)}}),ne(()=>{let t=!1;return(async()=>{const r=await Co();t||n(He,r.filter(a=>a.trim().length>0),!0)})(),()=>{t=!0}}),ne(()=>{if(e(We).size===0||e(He).length===0)return;const t=new Set(e(He)),r=new Set([...e(We)].filter(a=>t.has(a)));r.size!==e(We).size&&n(We,r,!0)}),ne(()=>{const t=e(ie);t==="all"||t==="custom"||n(Ee,Date.now(),!0)}),ne(()=>{const t=e(Ae);if(!t.trim()){clearTimeout(st),n(Re,""),n(It,null),n(Oe,[],!0);return}const r=window.setTimeout(()=>{n(Re,t,!0)},180);return st=r,()=>clearTimeout(r)}),ne(()=>{const t=e(Re).trim().toLowerCase(),r=e(V);if(!t){n(It,null),n(Oe,[],!0);return}const a=new Set,c=[];for(const g of r){const M=e(K).get(g.id);M&&M.includes(t)&&(a.add(g.id),c.push(g))}if(e(B))for(const[g,M]of e(x)){if(a.has(g))continue;[M.content,M.who??"",...M.tags??[]].join(" ").toLowerCase().includes(t)&&(a.add(g),c.push(M))}n(It,a,!0),n(Oe,c.slice(0,50),!0)}),ne(()=>{const t=e(Te);if(t.size===0){n(tr,null);return}n(tr,new Set(e(V).filter(r=>t.has(r.who??"unknown")).map(r=>r.id)),!0)}),ne(()=>{if(!(typeof window>"u"||e(ze))){try{const t=window.localStorage.getItem(Xn);if(t){const r=JSON.parse(t);if(Array.isArray(r)){const a=r.filter(c=>{if(typeof c!="object"||c===null)return!1;const g=c;return typeof g.id=="string"&&typeof g.name=="string"&&typeof g.search=="string"&&Array.isArray(g.sources)&&typeof g.pinnedOnly=="boolean"&&typeof g.neighborhoodOnly=="boolean"&&typeof g.clusterLensMode=="boolean"});n(ue,a.slice(0,8),!0)}}}catch{n(ue,[],!0)}n(ze,!0)}}),ne(()=>{typeof window>"u"||!e(ze)||window.localStorage.setItem(Xn,JSON.stringify(e(ue)))}),ne(()=>{if(!(typeof window>"u"||e(Ke)))try{const t=window.localStorage.getItem(fa);if(t){const r=JSON.parse(t);if(typeof r=="object"&&r!==null){const a=r;n(P,bn({centerForce:typeof a.centerForce=="number"?a.centerForce:Ir.centerForce,repelForce:typeof a.repelForce=="number"?a.repelForce:Ir.repelForce,linkForce:typeof a.linkForce=="number"?a.linkForce:Ir.linkForce,linkDistance:typeof a.linkDistance=="number"?a.linkDistance:Ir.linkDistance}),!0)}}}finally{n(Ke,!0)}}),ne(()=>{typeof window>"u"||!e(Ke)||window.localStorage.setItem(fa,JSON.stringify(e(P)))}),ne(()=>{if(!(typeof window>"u"||e(ar))){try{const t=window.sessionStorage.getItem($e);(t==="source"||t==="newness"||t==="none")&&n($,t,!0),window.sessionStorage.getItem(ct)==="true"&&n(_t,!0)}catch{}try{const t=window.localStorage.getItem(Ue);if(t){const r=Number.parseInt(t,10);Number.isNaN(r)||n(rr,r,!0)}}catch{}try{window.localStorage.removeItem(Ct),window.localStorage.removeItem(me)}catch{}n(ar,!0)}}),ne(()=>{if(!(typeof window>"u"||!e(ar))){try{e($)==="source"?window.sessionStorage.removeItem($e):window.sessionStorage.setItem($e,e($))}catch{}try{e(_t)&&e($)!=="none"?window.sessionStorage.setItem(ct,"true"):window.sessionStorage.removeItem(ct)}catch{}try{e(nr)!==null&&window.localStorage.setItem(Ue,String(e(nr)))}catch{}}}),ne(()=>{if(!(typeof window>"u"))try{window.sessionStorage.getItem(_e)==="true"&&n(B,!0)}catch{}}),ne(()=>{if(!(typeof window>"u"))try{e(B)?window.sessionStorage.setItem(_e,"true"):window.sessionStorage.removeItem(_e)}catch{}}),ne(()=>{if(typeof window>"u")return;const t=window.setInterval(()=>{n(Kt,Date.now(),!0)},6e4);return()=>window.clearInterval(t)}),ne(()=>{const t=new Set;if(e(ht)){const r=e(p)??e(Gt);if(r){t.add(r.id);const a=e(p)!==null?e(Ge):e(Gr);for(const c of a)t.add(c.id)}}n(G,t,!0)}),ne(()=>{e(ht),e(G),Xr()}),ne(()=>{e($),e(_t),e(Kt),e(rr),e(ge)==="2d"&&e(vt)?.requestRedraw(),Xr()}),ne(()=>{!e(ae)||typeof window>"u"||e(nr)===null&&n(nr,Date.now(),!0)}),ne(()=>{e(P),e(ae)&&e(ge)==="2d"&&e(vt)?.updatePhysics(e(P))});const ao=Q(()=>Ln(Cn()));ne(()=>{const t=e(ao);if(!e(ae)||e(U).length>0||t===e(tt))return;clearTimeout(Ht);const r=window.setTimeout(()=>{en()},220);return Ht=r,()=>clearTimeout(r)}),ne(()=>{const t=e(bt)===!0?new Set(e(mt)):null,r=e(p)??e(Gt),a=e(p)?e(Ge):e(Gr),c=e(Wt)===!0&&r?new Set([r.id,...a.map(g=>g.id)]):null;n(Pt,Aa([e(It),e(tr),t,c]),!0),Xr()}),ne(()=>{$a(e(p))}),ne(()=>{const t=e($t),r=e(E),a=e(oe);n(Ge,t==="similar"?r:a,!0),n(W,new Map(e(Ge).map(c=>[c.id,c.kind])),!0),Xr()});const Gt=Q(()=>e(C)?e(x).get(e(C))??null:e(_)),Gn=Q(Qr),oo=Q(()=>{e(I);const t=e(s),r=new Map;for(const a of t){const c=Yn(a.source),g=Yn(a.target);if(!c||!g||c===g)continue;const M=r.get(c)??new Map;M.set(g,(M.get(g)??0)+1),r.set(c,M);const m=r.get(g)??new Map;m.set(c,(m.get(c)??0)+1),r.set(g,m)}return r}),Gr=Q(()=>{const t=e(Gt);if(!t)return[];const r=e(oo).get(t.id);if(!r||r.size===0)return[];const a=[...r.entries()].sort((g,M)=>M[1]-g[1]).slice(0,6),c=a[0]?.[1]??1;return a.map(([g,M])=>({id:g,score:M/c,kind:"similar"}))}),so=Q(()=>new Map(e(Gr).map(t=>[t.id,"similar"]))),zn=Q(()=>e(p)?e(W):e(so)),wr=Q(()=>{const t=e(p);return t?e(pt).find(r=>r.data.id===t.id)??null:null}),tn=Q(()=>e(p)?[]:e(Gr)),Bn=Q(()=>{const t=new Map(e(Qt).map(c=>[c.who,c])),r=Ze.map(c=>t.get(c)).filter(c=>!!c),a=e(Qt).filter(c=>!Xe.has(c.who));return[...r,...a].slice(0,8)});ne(()=>{e(p)&&e(C)&&n(C,null)}),ne(()=>{const t=e(C);t&&(e(x).has(t)||n(C,null))}),ne(()=>{const t=e(O);if(!t)return;Ut=t.getBoundingClientRect();const r=new ResizeObserver(()=>{Ut=t.getBoundingClientRect()});return r.observe(t),()=>r.disconnect()}),ne(()=>{e(X)&&An()}),ne(()=>{if(typeof window>"u")return;const t=r=>{if(r.key==="Shift"){Ka();return}r.key==="Escape"&&On()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}}),ne(()=>{if(!e(O))return;const t=new IntersectionObserver(r=>{r[0].isIntersecting&&!e(ae)&&!e(Tn)&&(n(Tn,!0),Hn())},{threshold:.1});return t.observe(e(O)),()=>t.disconnect()}),ne(()=>{kr.embeddings.controlsOpen=e(xe),kr.embeddings.presetsOpen=e(Ye),kr.embeddings.sourcesOpen=e(Be),Bo()});var rn=qi();Ar("keydown",Fo,ka);var Wn=l(rn);{var io=t=>{Go(t,{title:"Constellation",children:(r,a)=>{zo(r,{group:"memory",get tabs(){return Yo},get activeTab(){return sa.activeTab},onselect:(c,g)=>Oo(g)})}})};j(Wn,t=>{f()||t(io)})}var qn=d(Wn,2),Sr=l(qn),Kn=l(Sr);{var lo=t=>{var r=zs();Bt(r,"",{},{top:"52px"});var a=l(r),c=l(a);i(a),i(r),F(()=>h(c,`${gn.Unlock} preview`)),Y("click",a,On),u(t,r)};j(Kn,t=>{e(C)&&t(lo)})}var Un=d(Kn,2);{var co=t=>{var r=Qs(),a=l(r),c=l(a),g=l(c),M=d(g),m=d(M),T=l(m);i(m);var w=d(m,2);{var L=N=>{var D=Bs(),A=l(D);i(D),F(te=>h(A,`${te??""}%`),[()=>Math.round(e(At).percent)]),u(N,D)};j(w,N=>{e(_r)&&e(At)&&N(L)})}i(c);var le=d(c,2);{var k=N=>{var D=Js(),A=l(D),te=d(l(A),2),Pe=l(te);i(te),i(A);var Ce=d(A,2);{var Se=z=>{var re=Ks(),ee=l(re),Me=l(ee,!0);i(ee);var he=d(ee,2);{var ce=Ne=>{var ke=Ws(),Fe=l(ke,!0);i(ke),F(()=>h(Fe,e(lr))),u(Ne,ke)};j(he,Ne=>{e(lr)&&Ne(ce)})}var Le=d(he,2);{var Ve=Ne=>{var ke=qs(),Fe=l(ke),rt=l(Fe),wt=l(rt);i(rt);var ft=d(rt,2),Qe=l(ft);i(ft),i(Fe);var De=d(Fe,2),St=l(De);i(De);var Zt=d(De,2),vr=l(Zt);i(Zt),i(ke),F((fr,xr,J,nt,Vt)=>{h(wt,`${fr??""} / ${xr??""}`),h(Qe,`${J??""}%`),Bt(St,nt),h(vr,`${Vt??""} remaining · ${e(At).coverage??""} coverage`)},[()=>e(At).completed.toLocaleString(),()=>e(At).baseline.toLocaleString(),()=>Math.round(e(At).percent),()=>`width:${Math.max(0,Math.min(100,e(At).percent))}%`,()=>e(At).remaining.toLocaleString()]),u(Ne,ke)};j(Le,Ne=>{e(At)&&Ne(Ve)})}i(re),F(()=>h(Me,e(ir))),u(z,re)};j(Ce,z=>{e(ir)&&z(Se)})}var R=d(Ce,2);Mt(R,21,()=>e(ur).checks,kt,(z,re)=>{var ee=Vs(),Me=l(ee),he=d(Me,2),ce=l(he),Le=l(ce),Ve=l(Le,!0);i(Le);var Ne=d(Le,2),ke=l(Ne,!0);i(Ne),i(ce);var Fe=d(ce,2),rt=l(Fe,!0);i(Fe);var wt=d(Fe,2);{var ft=Qe=>{var De=Us(),St=l(De,!0);i(De),F(()=>{De.disabled=e(_r),h(St,e(_r)?"running...":e(re).fix)}),Y("click",De,()=>Na(e(re))),u(Qe,De)};j(wt,Qe=>{e(re).fix&&e(re).status!=="ok"&&Qe(ft)})}i(he),i(ee),F(Qe=>{Bt(Me,`background:${Qe??""}`),h(Ve,e(re).name),h(ke,e(re).status),h(rt,e(re).message)},[()=>Pa(e(re).status)]),u(z,ee)}),i(R),i(D),F(()=>h(Pe,`${e(ur).config.provider??""}/${e(ur).config.model??""}`)),u(N,D)};j(le,N=>{e(Ur)&&N(k)})}i(a),i(r),F((N,D)=>{Bt(g,`background:${N??""}`),h(M,` ${e(ur).status??""} `),h(T,`${D??""}%`)},[()=>Fa(e(ur).status),()=>Math.round(e(ur).score*100)]),Y("click",c,()=>n(Ur,!e(Ur))),u(t,r)};j(Un,t=>{e(ur)&&t(co)})}var nn=d(Un,2),uo=l(nn);Yt(uo,()=>Lr,(t,r)=>{r(t,{class:"pointer-events-auto flex min-w-[180px] max-h-full flex-col-reverse",get open(){return e(S)},set open(a){n(S,a,!0)},children:(a,c)=>{var g=li(),M=be(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center gap-2 px-3 py-1.5 min-w-[180px] border border-[var(--sig-border)] text-[10px] font-mono uppercase tracking-[0.06em] text-[var(--sig-text-muted)] bg-transparent",get"aria-expanded"(){return e(S)},children:(L,le)=>{var k=Zs(),N=d(be(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(S)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var m=d(M,2);Yt(m,()=>Cr,(T,w)=>{w(T,{class:"min-h-0 max-h-[min(40vh,24rem)] overflow-y-auto border border-[var(--sig-border)] bg-[rgba(5,5,5,0.88)] px-3 py-2",children:(L,le)=>{var k=ii(),N=be(k),D=d(l(N));i(N);var A=d(N,2);{var te=ee=>{var Me=ei(),he=be(Me),ce=l(he),Le=l(ce);gr(),i(ce);var Ve=d(ce,2),Ne=l(Ve);gr(),i(Ve);var ke=d(Ve,2),Fe=l(ke);gr(),i(ke);var rt=d(ke,2),wt=l(rt);gr(),i(rt),i(he);var ft=d(he,2);Mt(ft,21,()=>e(Bn),kt,(Qe,De)=>{var St=$s(),Zt=l(St);i(St),F(vr=>{xt(St,1,`h-5 inline-flex items-center gap-1 px-1.5 py-0 font-mono text-[10px] border border-[rgba(255,255,255,0.14)] ${vr??""}`),h(Zt,`${e(De).who??""} ${e(De).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(De).who)?"bg-[rgba(255,255,255,0.08)] text-[var(--sig-text-bright)]":"bg-transparent text-[var(--sig-text-muted)]"]),u(Qe,St)}),i(ft),F((Qe,De,St,Zt)=>{Bt(Le,Qe),Bt(Ne,De),Bt(Fe,St),Bt(wt,Zt)},[()=>`background:${jr(3e5,.95)}`,()=>`background:${jr(108e5,.9)}`,()=>`background:${jr(2592e5,.85)}`,()=>`background:${jr(2592e6,.85)}`]),u(ee,Me)},Pe=ee=>{var Me=ri();Mt(Me,21,()=>e(Bn),kt,(he,ce)=>{var Le=ti(),Ve=l(Le),Ne=d(Ve);i(Le),F((ke,Fe)=>{xt(Le,1,`h-5 inline-flex items-center gap-1 px-1.5 py-0 font-mono text-[10px] border border-[rgba(255,255,255,0.14)] ${ke??""}`),Bt(Ve,Fe),h(Ne,` ${e(ce).who??""} ${e(ce).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(ce).who)?"bg-[rgba(255,255,255,0.08)] text-[var(--sig-text-bright)]":"bg-transparent text-[var(--sig-text-muted)]",()=>`background:${ya(e(ce).who,1)}`]),u(he,Le)}),i(Me),u(ee,Me)},Ce=ee=>{var Me=ni();u(ee,Me)};j(A,ee=>{e($)==="newness"?ee(te):e($)==="source"?ee(Pe,1):ee(Ce,-1)})}var Se=d(A,6);{var R=ee=>{var Me=ai();u(ee,Me)};j(Se,ee=>{e(_t)&&e($)!=="none"&&ee(R)})}var z=d(Se,4);{var re=ee=>{var Me=si(),he=d(l(Me),2);Mt(he,21,()=>Object.entries(Kr),kt,(ce,Le)=>{var Ve=Q(()=>Po(e(Le),2));let Ne=()=>e(Ve)[0],ke=()=>e(Ve)[1];var Fe=pr(),rt=be(Fe);{var wt=ft=>{var Qe=oi(),De=l(Qe),St=d(De);i(Qe),F(()=>{Bt(De,`background:${ke()}; clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);`),h(St,` ${Ne()??""}`)}),u(ft,Qe)};j(rt,ft=>{Ne()!=="unknown"&&ft(wt)})}u(ce,Fe)}),i(he),gr(2),i(Me),u(ee,Me)};j(z,ee=>{e(B)&&ee(re)})}F(()=>h(D,` = ${e($)==="none"?"off":e($)==="newness"?"by recency":"by source"}`)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})}),i(nn);var Vn=d(nn,2);{var go=t=>{var r=di(),a=l(r),c=l(a,!0);i(a),i(r),F(()=>h(c,e(U))),u(t,r)},po=t=>{var r=ci(),a=l(r),c=l(a,!0);i(a),i(r),F(()=>h(c,e(q))),u(t,r)},vo=t=>{var r=ui();u(t,r)},fo=t=>{var r=gi();u(t,r)};j(Vn,t=>{e(U)?t(go):e(q)?t(po,1):e(ae)&&e(V).length===0?t(vo,2):e(ae)||t(fo,3)})}var Jn=d(Vn,2);Bt(Jn,"",{},{top:"20px"});var Qn=d(Jn,4);{var xo=t=>{var r=mi(),a=l(r),c=l(a),g=l(c,!0);i(c);var M=d(c,2);{var m=R=>{var z=pi(),re=l(z,!0);i(z),F(()=>h(re,e(Gt).type)),u(R,z)};j(M,R=>{e(Gt).type&&R(m)})}var T=d(M,2);{var w=R=>{var z=vi();u(R,z)};j(T,R=>{e(Gt).pinned&&R(w)})}var L=d(T,2);{var le=R=>{var z=fi();u(R,z)};j(L,R=>{e(C)&&R(le)})}i(a);var k=d(a,2),N=l(k);i(k);var D=d(k,2),A=l(D,!0);i(D);var te=d(D,2),Pe=l(te,!0);i(te);var Ce=d(te,2);{var Se=R=>{var z=bi(),re=d(l(z),2);Mt(re,21,()=>e(tn),kt,(ee,Me)=>{const he=Q(()=>e(x).get(e(Me).id));var ce=pr(),Le=be(ce);{var Ve=Ne=>{var ke=xi(),Fe=l(ke),rt=l(Fe,!0);i(Fe);var wt=d(Fe,2),ft=l(wt);i(wt),i(ke),F((Qe,De)=>{h(rt,Qe),h(ft,`${De??""}%`)},[()=>yr(e(he)),()=>Math.round(e(Me).score*100)]),u(Ne,ke)};j(Le,Ne=>{e(he)&&Ne(Ve)})}u(ee,ce)}),i(re),i(z),u(R,z)};j(Ce,R=>{e(tn).length>0&&R(Se)})}i(r),hr(r,R=>n(X,R),()=>e(X)),F((R,z,re)=>{h(g,e(Gt).who??"unknown"),h(N,`importance ${R??""}% · ${z??""} · linked ${e(tn).length??""}`),h(A,re),h(Pe,e(C)?"ESC or Unlock Preview button":"Hold Shift to lock preview")},[()=>Math.round((e(Gt).importance??0)*100),()=>La(e(Gt).createdAt),()=>yr(e(Gt))]),u(t,r)};j(Qn,t=>{e(Gt)&&t(xo)})}var zr=d(Qn,2);let Zn;var bo=l(zr);{var mo=t=>{{let r=Q(()=>e(ht)&&e(G).size>0),a=Q(()=>e(Te).size>0?e(Te):null);hr(us(t,{get nodes(){return e(pt)},get edges(){return e(s)},get graphPhysics(){return e(P)},get graphSelected(){return e(p)},get graphHovered(){return e(Gt)},get embeddingFilterIds(){return e(Pt)},get relationLookup(){return e(zn)},get pinnedIds(){return e(mt)},get lensIds(){return e(G)},get clusterLensMode(){return e(r)},get colorMode(){return e($)},get nowMs(){return e(Kt)},get showNewSinceLastSeen(){return e(_t)},get lastSeenMs(){return e(rr)},get sourceFocusSources(){return e(a)},onselectnode:c=>{c?$r(c.id):n(p,null)},onhovernode:Rn}),c=>n(vt,c,!0),()=>e(vt))}},ho=t=>{var r=hi(),a=l(r),c=l(a,!0);i(a),i(r),F(()=>h(c,e(U))),u(t,r)},yo=t=>{var r=yi(),a=l(r),c=l(a,!0);i(a),i(r),F(()=>h(c,e(q))),u(t,r)};j(bo,t=>{e(ae)?t(mo):e(U)?t(ho,1):e(q)&&t(yo,2)})}i(zr);var an=d(zr,2);let $n;var _o=l(an);{var wo=t=>{var r=pr(),a=be(r);{let c=Q(()=>e(ht)&&e(G).size>0),g=Q(()=>e(Te).size>0?e(Te):null);Yt(a,()=>e(Rr),(M,m)=>{hr(m(M,{get embeddings(){return e(V)},get projected3d(){return e(se)},get graphSelected(){return e(p)},get embeddingFilterIds(){return e(Pt)},get relationLookup(){return e(zn)},get pinnedIds(){return e(mt)},get lensIds(){return e(G)},get clusterLensMode(){return e(c)},get embeddingById(){return e(x)},get colorMode(){return e($)},get nowMs(){return e(Kt)},get showNewSinceLastSeen(){return e(_t)},get lastSeenMs(){return e(rr)},get sourceFocusSources(){return e(g)},onselectnode:T=>{T?$r(T.id):n(p,null)},onhovernode:Rn}),T=>n(sr,T,!0),()=>e(sr))})}u(t,r)},So=t=>{var r=_i(),a=l(r),c=l(a,!0);i(a),i(r),F(()=>h(c,e(U)||"Loading 3D...")),u(t,r)};j(_o,t=>{e(Rr)&&!e(Or)?t(wo):e(Or)&&t(So,1)})}i(an),i(Sr),hr(Sr,t=>n(O,t),()=>e(O));var ea=d(Sr,2),on=l(ea),ta=l(on);Yt(ta,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(xe)},set open(a){n(xe,a,!0)},children:(a,c)=>{var g=ki(),M=be(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-mono text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=wi(),N=d(be(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(xe)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var m=d(M,2);Yt(m,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Mi(),N=l(k),D=l(N);Jt(D),hr(D,Ft=>Je=Ft,()=>Je);var A=d(D,2);{var te=Ft=>{var Fr=Si(),cn=l(Fr,!0);i(Fr),F(()=>h(cn,e(Oe).length)),u(Ft,Fr)};j(A,Ft=>{e(Ae)&&Ft(te)})}i(N);var Pe=d(N,2),Ce=l(Pe);i(Pe);var Se=d(Pe,2),R=l(Se),z=d(R,2),re=d(z,2),ee=d(re,2),Me=l(ee,!0);i(ee),i(Se);var he=d(Se,2),ce=d(l(he),2),Le=l(ce),Ve=d(Le,2),Ne=d(Ve,2);i(ce),i(he);var ke=d(he,2),Fe=d(l(ke),2),rt=l(Fe),wt=d(rt,2),ft=l(wt,!0);i(wt),i(Fe),i(ke);var Qe=d(ke,2),De=d(l(Qe),2),St=l(De),Zt=d(l(St),2),vr=l(Zt,!0);i(Zt),i(St);var fr=d(St,2);Jt(fr),i(De);var xr=d(De,2),J=l(xr),nt=d(l(J),2),Vt=l(nt,!0);i(nt),i(J);var Rt=d(J,2);Jt(Rt),i(xr);var at=d(xr,2),zt=l(at),Ot=d(l(zt),2),br=l(Ot,!0);i(Ot),i(zt);var er=d(zt,2);Jt(er),i(at);var sn=d(at,2),ln=l(sn),aa=d(l(ln),2),Io=l(aa,!0);i(aa),i(ln);var dn=d(ln,2);Jt(dn),i(sn);var To=d(sn,2);i(Qe),i(k),F((Ft,Fr,cn,Eo)=>{h(Ce,`Window ${e(Gn).offset+1}-${e(Gn).offset+e(V).length} / ${e(pe)??""}`),xt(R,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(bt)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),xt(z,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(Wt)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),xt(re,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(ht)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(Me,gn.Reset),xt(Le,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="newness"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),xt(Ve,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="source"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),xt(Ne,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="none"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),xt(rt,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(_t)&&e($)!=="none"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"} ${e($)==="none"?"opacity-60 cursor-not-allowed":""}`),rt.disabled=e($)==="none",xt(wt,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(B)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(ft,e(H)?"Loading...":"Entities"),h(vr,Ft),Br(fr,e(P).centerForce),h(Vt,Fr),Br(Rt,e(P).repelForce),h(br,cn),Br(er,e(P).linkForce),h(Io,Eo),Br(dn,e(P).linkDistance)},[()=>e(P).centerForce.toFixed(2),()=>Math.round(e(P).repelForce),()=>e(P).linkForce.toFixed(2),()=>Math.round(e(P).linkDistance)]),Y("input",D,()=>n(Z,"custom-live")),dr(D,()=>e(Ae),Ft=>n(Ae,Ft)),Y("click",R,Ga),Y("click",z,za),Y("click",re,Ba),Y("click",ee,Ha),Y("click",Le,()=>n($,"newness")),Y("click",Ve,()=>n($,"source")),Y("click",Ne,()=>{n($,"none"),n(_t,!1)}),Y("click",rt,()=>n(_t,!e(_t))),Y("click",wt,()=>{n(B,!e(B)),e(ae)&&en()}),Y("input",fr,Ft=>Nr({centerForce:Hr(Ft,e(P).centerForce)})),Y("input",Rt,Ft=>Nr({repelForce:Hr(Ft,e(P).repelForce)})),Y("input",er,Ft=>Nr({linkForce:Hr(Ft,e(P).linkForce)})),Y("input",dn,Ft=>Nr({linkDistance:Hr(Ft,e(P).linkDistance)})),Y("click",To,()=>Nr(Ir)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var ra=d(ta,2);Yt(ra,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(Ye)},set open(a){n(Ye,a,!0)},children:(a,c)=>{var g=Fi(),M=be(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-mono text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Ii(),N=d(be(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(Ye)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var m=d(M,2);Yt(m,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Ni(),N=l(k);Mt(N,17,()=>Ua,kt,(Pe,Ce)=>{var Se=Ti(),R=l(Se,!0);i(Se),F(()=>{xt(Se,1,`px-2 py-[2px] font-mono text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(Z)===e(Ce).id?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(R,e(Ce).name)}),Y("click",Se,()=>jn(e(Ce))),u(Pe,Se)});var D=d(N,2);Mt(D,17,()=>e(ue),kt,(Pe,Ce)=>{var Se=Ei(),R=l(Se),z=l(R,!0);i(R);var re=d(R,2);i(Se),F(()=>{xt(R,1,`px-2 py-[2px] font-mono text-[10px] ${e(Z)===e(Ce).id?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(z,e(Ce).name),fn(re,"aria-label",`Delete ${e(Ce).name} preset`)}),Y("click",R,()=>jn(e(Ce))),Y("click",re,()=>Qa(e(Ce).id)),u(Pe,Se)});var A=d(D,2),te=l(A,!0);i(A),i(k),F(()=>h(te,gn.Save)),Y("click",A,Ja),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var na=d(ra,2);Yt(na,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(Be)},set open(a){n(Be,a,!0)},children:(a,c)=>{var g=Ai(),M=be(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-mono text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Pi(),N=d(be(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(Be)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var m=d(M,2);Yt(m,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Di(),N=l(k);{var D=te=>{var Pe=Ci();u(te,Pe)},A=te=>{var Pe=pr(),Ce=be(Pe);Mt(Ce,17,()=>e(Qt),kt,(Se,R)=>{var z=Li(),re=l(z);i(z),F(ee=>{xt(z,1,`px-2 py-[2px] font-mono text-[10px] border border-[var(--sig-border-strong)] ${ee??""}`),h(re,`${e(R).who??""} ${e(R).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(R).who)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",z,()=>Wa(e(R).who)),u(Se,z)}),u(te,Pe)};j(N,te=>{e(Qt).length===0?te(D):te(A,-1)})}i(k),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var Mo=d(na,2);Yt(Mo,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(dt)},set open(a){n(dt,a,!0)},children:(a,c)=>{var g=Wi(),M=be(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-mono text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Ri(),N=d(be(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(dt)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var m=d(M,2);Yt(m,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Bi(),N=l(k),D=d(l(N),2);Jt(D);var A=d(D,4);Jt(A);var te=d(A,2),Pe=l(te);Pe.value=Pe.__value="all";var Ce=d(Pe);Ce.value=Ce.__value="24h";var Se=d(Ce);Se.value=Se.__value="7d";var R=d(Se);R.value=R.__value="30d";var z=d(R);z.value=z.__value="90d";var re=d(z);re.value=re.__value="custom",i(te),i(N);var ee=d(N,2);{var Me=J=>{var nt=Oi(),Vt=l(nt);Jt(Vt);var Rt=d(Vt,2);Jt(Rt),i(nt),dr(Vt,()=>e(ye),at=>n(ye,at)),dr(Rt,()=>e(je),at=>n(je,at)),u(J,nt)};j(ee,J=>{e(ie)==="custom"&&J(Me)})}var he=d(ee,2),ce=l(he),Le=l(ce);Le.value=Le.__value="all";var Ve=d(Le);Ve.value=Ve.__value="pinned";var Ne=d(Ve);Ne.value=Ne.__value="unpinned",i(ce);var ke=d(ce,2);Jt(ke);var Fe=d(ke,2);Jt(Fe);var rt=d(Fe,2);Jt(rt);var wt=d(rt,2);Jt(wt),i(he);var ft=d(he,2),Qe=d(l(ft),2);{var De=J=>{var nt=Yi();u(J,nt)},St=J=>{var nt=pr(),Vt=be(nt);Mt(Vt,17,()=>e(He),kt,(Rt,at)=>{var zt=Xi(),Ot=l(zt,!0);i(zt),F(br=>{xt(zt,1,`px-2 py-[2px] font-mono text-[10px] border border-[var(--sig-border-strong)] ${br??""}`),h(Ot,e(at))},[()=>e(We).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",zt,()=>Ya(e(at))),u(Rt,zt)}),u(J,nt)};j(Qe,J=>{e(He).length===0?J(De):J(St,-1)})}i(ft);var Zt=d(ft,2);{var vr=J=>{var nt=Hi(),Vt=d(l(nt),2);Mt(Vt,17,()=>[...new Set([...e(gt),...e(Dt).map(Rt=>Rt.value)])],kt,(Rt,at)=>{const zt=Q(()=>e(Dt).find(er=>er.value===e(at))?.count??0);var Ot=ji(),br=l(Ot);i(Ot),F(er=>{xt(Ot,1,`px-2 py-[2px] font-mono text-[10px] border border-[var(--sig-border-strong)] ${er??""}`),h(br,`${e(at)??""}${e(zt)>0?` ${e(zt)}`:""}`)},[()=>e(gt).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",Ot,()=>Xa(e(at))),u(Rt,Ot)}),i(nt),u(J,nt)};j(Zt,J=>{(e(Dt).length>0||e(gt).size>0)&&J(vr)})}var fr=d(Zt,2);{var xr=J=>{var nt=zi(),Vt=d(l(nt),2);Mt(Vt,17,()=>[...new Set([...e(et),...e(lt).map(Rt=>Rt.value)])],kt,(Rt,at)=>{const zt=Q(()=>e(lt).find(er=>er.value===e(at))?.count??0);var Ot=Gi(),br=l(Ot);i(Ot),F(er=>{xt(Ot,1,`px-2 py-[2px] font-mono text-[10px] border border-[var(--sig-border-strong)] ${er??""}`),h(br,`${e(at)??""}${e(zt)>0?` ${e(zt)}`:""}`)},[()=>e(et).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",Ot,()=>ja(e(at))),u(Rt,Ot)}),i(nt),u(J,nt)};j(fr,J=>{(e(lt).length>0||e(et).size>0)&&J(xr)})}i(k),Ar("blur",D,Zr),dr(D,()=>e(ve),J=>n(ve,J)),Ar("blur",A,Zr),dr(A,()=>e(ut),J=>n(ut,J)),oa(te,()=>e(ie),J=>n(ie,J)),oa(ce,()=>e(yt),J=>n(yt,J)),dr(ke,()=>e(it),J=>n(it,J)),dr(Fe,()=>e(Tt),J=>n(Tt,J)),dr(rt,()=>e(Lt),J=>n(Lt,J)),dr(wt,()=>e(fe),J=>n(fe,J)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})}),i(on);var ko=d(on,2);{let t=Q(()=>e(wr)?.nodeType??void 0),r=Q(()=>e(wr)?.entityData??null),a=Q(()=>e(wr)?.aspectData??null),c=Q(()=>e(wr)?.attributeData??null),g=Q(()=>e(wr)?.parentEntityId??null),M=Q(()=>e(wr)?.parentAspectId??null);Gs(ko,{containerClass:"flex-1 min-h-0 w-full min-w-0 border-l-0 border-t-0 max-lg:max-h-none",get graphSelected(){return e(p)},get embeddings(){return e(V)},get embeddingById(){return e(x)},get activeNeighbors(){return e(Ge)},get relationMode(){return e($t)},get loadingGlobalSimilar(){return e(qt)},get globalSimilar(){return e(Et)},get embeddingSearchMatches(){return e(Oe)},get embeddingSearch(){return e(Ae)},get pinBusy(){return e(Xt)},get pinError(){return e(jt)},get selectedNodeType(){return e(t)},get selectedEntityData(){return e(r)},get selectedAspectData(){return e(a)},get selectedAttributeData(){return e(c)},get parentEntityId(){return e(g)},get parentAspectId(){return e(M)},get constellationOverlay(){return e(de)},onselectembedding:$r,onclearselection:eo,onloadglobalsimilar:no,get onopenglobalsimilar(){return o.onopenglobalsimilar},onsetrelationmode:m=>n($t,m,!0),onfocusembedding:()=>e(p)&&to(e(p).id),onpintoggle:ro})}i(ea),i(qn),i(rn),F(()=>{Zn=Bt(zr,"",Zn,{display:e(ge)==="2d"?"contents":"none"}),$n=Bt(an,"",$n,{display:e(ge)==="3d"?"contents":"none"})}),Y("mousemove",Sr,qa),Ar("mouseleave",Sr,()=>{e(C)||n(_,null)}),u(y,rn),Sn()}Mn(["mousemove","click","input"]);export{tl as default};
|