local-operator-ui 0.34.37 → 0.34.38

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.
@@ -1,4 +1,4 @@
1
- import{r as o,j as e,c as z}from"./index-D_Ya8nt7.js";import{bO as Ue,aO as ct,bF as dt,bP as ut,aF as ze,u as qe,a6 as Ne,a7 as Q,aM as $e,aN as mt,bQ as ht,aw as oe,b9 as pt,bR as xt,av as Me,aT as X,aU as he,bf as gt,bS as ft,aS as bt,bT as yt,bH as ke,aP as Ce,a as jt,bK as kt,aZ as vt,ba as wt,az as Nt,ay as Ct,aL as Ae,ag as Be,b8 as _t,aY as St}from"./conversation-input-sync-DeCSVDem.js";import{P as It}from"./page-header-cUi3kof4.js";import{c as te,D as He,k as We,B as P,l as Ve,o as W,q as Ke,S as Qe,f as M,I as Ye,p as Dt,R as xe,L as ie,r as Fe,X as Ge,U as Pt,V as Tt,W as Et,A as pe,g as fe,h as ne,s as Lt,t as Ot,u as Rt,v as Ut,w as be,Y as zt,Z as qt,b as $t,d as Mt}from"./error-boundary-sr-ahxTS.js";import{aw as At,ax as Ze,ay as ve,az as we,aA as Bt,aB as Pe,aC as Ht,aD as Wt,an as Je,aE as J,aF as ee,aG as Vt,aH as Kt,aI as Qt,aJ as Yt,aK as ye,aL as Ft,au as Gt,aM as Zt,b as _e,aN as Xe,aO as et,aP as Jt,aQ as tt,aq as Xt,aR as ea,aS as Te}from"./index-D5IE_EgY.js";import{N as ta}from"./notebook-pen-DG_DgpzX.js";import{c as aa,p as sa,u as na}from"./ui-preferences-store-DApxrOwj.js";import{w as ia,i as oa,b as ra,x as la,y as ca,z as da,p as Ee,P as Le}from"./use-memberships-query-DdlKnrP8.js";import{u as ua,p as ma,a as ha,b as pa}from"./org-surface-gate-CPSbPHbt.js";import{R as Oe}from"./radient-auth-buttons-De0E7l-6.js";import"./console-mirror-D_HrghW0.js";/**
1
+ import{r as o,j as e,c as z}from"./index-D_Ya8nt7.js";import{bO as Ue,aO as ct,bF as dt,bP as ut,aF as ze,u as qe,a6 as Ne,a7 as Q,aM as $e,aN as mt,bQ as ht,aw as oe,b9 as pt,bR as xt,av as Me,aT as X,aU as he,bf as gt,bS as ft,aS as bt,bT as yt,bH as ke,aP as Ce,a as jt,bK as kt,aZ as vt,ba as wt,az as Nt,ay as Ct,aL as Ae,ag as Be,b8 as _t,aY as St}from"./conversation-input-sync-DeCSVDem.js";import{P as It}from"./page-header-cUi3kof4.js";import{c as te,D as He,k as We,B as P,l as Ve,o as W,q as Ke,S as Qe,f as M,I as Ye,p as Dt,R as xe,L as ie,r as Fe,X as Ge,U as Pt,V as Tt,W as Et,A as pe,g as fe,h as ne,s as Lt,t as Ot,u as Rt,v as Ut,w as be,Y as zt,Z as qt,b as $t,d as Mt}from"./error-boundary-sr-ahxTS.js";import{aw as At,ax as Ze,ay as ve,az as we,aA as Bt,aB as Pe,aC as Ht,aD as Wt,an as Je,aE as J,aF as ee,aG as Vt,aH as Kt,aI as Qt,aJ as Yt,aK as ye,aL as Ft,au as Gt,aM as Zt,b as _e,aN as Xe,aO as et,aP as Jt,aQ as tt,aq as Xt,aR as ea,aS as Te}from"./index-CpQRStsc.js";import{N as ta}from"./notebook-pen-DG_DgpzX.js";import{c as aa,p as sa,u as na}from"./ui-preferences-store-DApxrOwj.js";import{w as ia,i as oa,b as ra,x as la,y as ca,z as da,p as Ee,P as Le}from"./use-memberships-query-DdlKnrP8.js";import{u as ua,p as ma,a as ha,b as pa}from"./org-surface-gate-CPSbPHbt.js";import{R as Oe}from"./radient-auth-buttons-zXDJkEGk.js";import"./console-mirror-D_HrghW0.js";/**
2
2
  * @license lucide-react v0.507.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as x,j as t,c as _}from"./index-D_Ya8nt7.js";import{aV as ze,aW as je,aX as Je,aY as He,a as Qe,aZ as ge,ag as Ce,a_ as et}from"./conversation-input-sync-DeCSVDem.js";import{P as tt}from"./page-header-cUi3kof4.js";import{B as U,A as pe,j as st,a as ae,D as nt,k as at,l as it,m as rt,n as Se,o as Me,e as De}from"./error-boundary-sr-ahxTS.js";import{i as oe,d as lt,e as ot,f as dt,g as ct,h as ut,j as mt,k as ht,l as pt,m as xt,n as ft,o as gt,p as bt,N as vt,q as Ne,r as kt,s as de,D as wt,t as jt,u as Nt,v as ye,w as we,R as yt,x as ce,y as Be,z as Fe,C as It,E as he,F as be,G as Ct,H as St,I as xe,J as Ae,K as Mt,L as Dt,M as ve,O as At,Q as Ye,T as Et,U as Ue,V as _t,W as Rt,X as $t,Y as Lt,Z as Pt,_ as Tt,$ as Ot,a0 as Wt,a1 as zt,a2 as Ht,a3 as Bt,a4 as Ft,a5 as Yt,a6 as Ut,a7 as qt,a8 as Gt,a9 as Vt,aa as Kt,ab as Xt,ac as le,ad as Zt}from"./index-D5IE_EgY.js";import"./ui-preferences-store-DApxrOwj.js";import"./console-mirror-D_HrghW0.js";function Jt(e){return e==="failed"?"text-danger":oe(e)?"text-ink-muted":"text-ink-dim"}function Qt(e){return e==="failed"?"Abandon":"Stop"}function es(e){switch(e){case"requested":return[{term:"Signing",text:"Approving signs with this machine's operator key; the system may ask for it."}];case"approved":return[{term:"Next",text:"An agent runs the install and connect."},{term:"Stop",text:"Stopping now denies the request; nothing has run yet."}];case"connecting":return[{term:"Stop",text:"Stopping now denies the request; the runner stops at its next step."}];case"failed":return[{term:"After a stop",text:"The runner stopped before it finished. Abandoning denies the request; a retry re-enters the same record instead."}];default:return[]}}const ts=({rows:e,error:s,pending:i,refusal:a,onDecide:o,onRetry:c,nowSeconds:h,networkNames:r})=>{const g=i!==null,v=x.useMemo(()=>e.filter(f=>oe(f.state)),[e]),N=x.useMemo(()=>e.filter(f=>!oe(f.state)),[e]),[y,I]=x.useState(!1),l=N.some(f=>f.state==="failed"),d=N.filter(f=>f.state==="failed").length,p=a!==null&&e.some(f=>f.approvalId===a.approvalId&&(oe(f.state)||y));return v.length===0&&N.length===0&&!s&&!a?null:t.jsxs("section",{"aria-label":"Approvals","data-tour-tag":"mesh-approvals-tray",className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(lt,{"aria-hidden":"true",className:"size-4 text-ink-muted"}),t.jsx("h2",{className:"text-body-sm text-ink",children:"Approvals"}),v.length>0&&t.jsx("span",{className:"text-meta text-ink-dim",children:v.length===1?"1 waiting":`${v.length} waiting`})]}),s&&t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("p",{className:"min-w-0 flex-1 text-meta text-ink-muted",children:s}),t.jsx(U,{variant:"secondary",size:"sm",onClick:c,children:"Ask again"})]}),v.length>0&&t.jsx("ul",{className:"flex flex-col divide-y divide-hairline",children:v.map(f=>t.jsx(Ee,{row:f,pending:i?.approvalId===f.approvalId?i:null,busy:g,refusal:a?.approvalId===f.approvalId?a:null,onDecide:o,nowSeconds:h,networkNames:r},f.approvalId))}),a&&!p&&t.jsx(qe,{refusal:a}),N.length>0&&t.jsx(ze,{open:y,onOpenChange:I,chevronClassName:"text-ink-dim",className:_(v.length>0&&"border-hairline border-t pt-3"),summary:t.jsxs("span",{className:"flex items-center gap-1.5 text-meta text-ink-muted",children:["Settled approvals",t.jsxs("span",{className:"text-ink-dim",children:["(",N.length,")"]}),l&&t.jsx("span",{"aria-hidden":"true",className:"size-1.5 rounded-full bg-danger"}),d>0&&t.jsxs("span",{className:"text-danger",children:[d," failed"]})]}),children:t.jsx("ul",{className:"flex flex-col divide-y divide-hairline","data-tour-tag":"mesh-approvals-records",children:N.map(f=>t.jsx(Ee,{row:f,pending:i?.approvalId===f.approvalId?i:null,busy:g,refusal:a?.approvalId===f.approvalId?a:null,onDecide:o,nowSeconds:h,networkNames:r},f.approvalId))})})]})},Ee=({row:e,pending:s,busy:i,refusal:a,onDecide:o,nowSeconds:c,networkNames:h})=>{const r=oe(e.state),g=ot(e),v=dt(e,h),N=ct(e,h),y=ut(e),I=mt(e),l=ht(e),d=pt(e.expiresAt,c),p=es(e.state),f=xt(e.state),w=ft(e.state);return t.jsxs("li",{className:"flex flex-col gap-2 py-3 first:pt-0 last:pb-0","data-tour-tag":"mesh-approval-card",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:_("text-meta",Jt(e.state)),children:gt(e.state)}),t.jsx("div",{className:"grow"}),r&&d&&t.jsx("span",{className:"text-meta text-ink-dim",children:d})]}),t.jsx("p",{className:"text-body-sm text-ink","data-tour-tag":"mesh-approval-summary",children:r?v:g}),e.state==="failed"&&t.jsx("p",{className:"text-meta text-ink-muted","data-tour-tag":"mesh-approval-stopped-note",children:"The runner stopped before it finished. It stays retryable until its window closes; Abandon denies the request."}),(f||w)&&t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f&&t.jsx(U,{variant:"primary",size:"sm",disabled:i,onClick:()=>o(e.approvalId,"approve"),"data-tour-tag":"mesh-approval-approve",children:"Approve"}),w&&t.jsx(U,{variant:"ghost",size:"sm",disabled:i,onClick:()=>o(e.approvalId,"deny"),"data-tour-tag":r?"mesh-approval-deny":"mesh-approval-stop",children:r?"Deny":Qt(e.state)}),s&&t.jsx("span",{className:"text-meta text-ink-dim",children:s.decision==="approve"?"Waiting for the signing prompt…":"Writing the decision…"})]}),t.jsxs(ze,{chevronClassName:"text-ink-dim",summary:t.jsx("span",{className:"text-meta",children:"Details"}),children:[N.length>0&&t.jsx("dl",{className:"grid grid-cols-[max-content_1fr] gap-x-4 gap-y-0.5 text-meta text-ink-dim","data-tour-tag":"mesh-approval-consequences",children:N.map(m=>t.jsxs(x.Fragment,{children:[t.jsx("dt",{className:"text-ink-muted",children:m.term}),t.jsx("dd",{children:m.consequence})]},m.term))}),(y||I)&&t.jsxs("p",{className:"text-meta text-ink-muted",children:[y&&t.jsx("span",{children:y}),y&&I&&t.jsx("span",{children:" · "}),I&&t.jsx("span",{className:"font-mono",children:I})]}),l&&t.jsx("p",{className:"text-meta text-ink-dim",children:l}),p.length>0&&t.jsx("dl",{className:"grid grid-cols-[max-content_1fr] gap-x-4 gap-y-0.5 text-meta","data-tour-tag":"mesh-approval-consequence",children:p.map(m=>t.jsxs(x.Fragment,{children:[t.jsx("dt",{className:"text-ink-muted",children:m.term}),t.jsx("dd",{className:"text-ink-muted",children:m.text})]},m.term))})]}),a&&t.jsx(qe,{refusal:a})]})},qe=({refusal:e})=>t.jsx(pe,{variant:"warning",className:"text-meta","data-tour-tag":"mesh-approval-refusal",children:t.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[t.jsx("span",{className:"min-w-0 flex-1",children:e.sentence}),t.jsx("span",{className:"shrink-0 font-mono text-ink-dim",children:e.code})]})}),ss=4,fe={kind:"idle"};function ns(e){switch(e.kind){case"dragging":case"settling":return e.payload.session.id;case"pressing":return null;default:return null}}function Q(e,s){switch(s.kind){case"press":return e.kind!=="idle"?e:{kind:"pressing",payload:s.payload,originX:s.x,originY:s.y,pointerId:s.pointerId};case"move":return e.kind==="pressing"?Math.max(Math.abs(s.x-e.originX),Math.abs(s.y-e.originY))<ss?e:{kind:"dragging",payload:e.payload,x:s.x,y:s.y,target:s.target,pointerId:e.pointerId}:e.kind==="dragging"?{...e,x:s.x,y:s.y,target:s.target}:e;case"release":return e.kind==="dragging"?{kind:"settling",payload:e.payload,target:e.target}:e.kind==="pressing"?fe:e;case"cancel":case"settled":return fe;default:return e}}const as=({edges:e,geometry:s,selectedDeviceId:i})=>t.jsx("svg",{"aria-hidden":"true",className:"pointer-events-none absolute top-0 left-0 overflow-visible",width:s.bounds.width,height:s.bounds.height,children:e.map(a=>{const o=s.networks.get(a.networkId),c=s.devices.get(a.deviceId);if(!o||!c)return null;const h=i!==null&&a.deviceId===i;return t.jsx("path",{"data-mesh-edge":a.key,d:bt(o,c),fill:"none",strokeWidth:h?2:1.5,strokeDasharray:a.active?void 0:"4 4",className:h?"stroke-ink":"stroke-ink-dim"},a.key)})}),is={self:"border-l-hairline",reached:"border-l-hairline",unanswered:"border-l-warning","not-attempted":"border-l-hairline",unknown:"border-l-hairline"};function rs(e){return e.suspect?"border-l-danger":is[de(e)]}const ls={self:"ring-2 ring-accent",reachable:null,unreachable:null,suspect:null},os={accept:"border-accent bg-accent-wash",refuse:"border-warning"};function ds(e,s,i){return[e.label,Fe(e,s),i].filter(Boolean).join(", ")}function ee(e){return e.name.trim()||e.id.slice(-6)}function Ge(e,s,i){if(i!=="reached"&&i!=="self"){const a=ce(i);return e.unreachable_reason?`${a} (${e.unreachable_reason})`:a}return e.live_state.trim()?e.live_state.trim():e.locality==="local"?"on this device":`on ${s}`}const cs={resting:"border-l-2 border-l-hairline",attention:"border-l-2 border-l-warning"},us=({network:e,x:s,y:i,refused:a})=>t.jsxs("li",{"data-mesh-network":e.id,"data-mesh-network-refused":a?"true":void 0,className:_("absolute flex items-center gap-2 rounded-md border bg-elevated px-3",a?"border-warning":"border-hairline"),style:{left:s,top:i,width:Ne,height:vt},children:[t.jsx(je,{"aria-hidden":"true",className:"size-4 shrink-0 text-ink-muted"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-body-sm text-ink",children:e.label}),t.jsxs("span",{title:`epoch ${e.epoch}`,className:"block truncate text-meta text-ink-dim",children:[e.memberCount," ",e.memberCount===1?"device":"devices",e.revokedCount>0?` · ${e.revokedCount} revoked`:""]})]})]}),ms=({device:e,x:s,y:i,nowSeconds:a,selected:o,sessions:c,sessionTotal:h,dropState:r,movingSessionId:g,draggedSessionId:v,onOpen:N,onChipPointerDown:y,onChipClick:I,onShowAllSessions:l})=>{const{activity:d}=kt(e,c.rows),p=d==="working",f=ds(e,a,p?"working":null),w=de(e);return t.jsxs("li",{"data-mesh-device":e.id,"data-mesh-state":e.state,"data-mesh-drop":r??void 0,"aria-current":o?"true":void 0,className:_("absolute flex flex-col rounded-md border border-l-4 border-control bg-elevated","hover:bg-row-hover",o&&"border-y-ink border-r-ink bg-row-selected",rs(e),ls[e.state],r&&os[r]),style:{left:s,top:i,width:Ne,height:wt},children:[t.jsxs("button",{type:"button","data-mesh-device-open":e.id,"data-mesh-reach":w,"aria-label":f,title:Nt(e),onClick:()=>N(e.id),className:_("flex w-full flex-col justify-between rounded-t-[5px] px-3 pt-2 pb-2 text-left","cursor-pointer","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-[-2px]"),style:{height:jt},children:[t.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[t.jsx(Je,{"aria-hidden":"true",className:"size-4 shrink-0 text-ink-muted"}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-ink",children:e.label}),e.suspect&&t.jsx(ye,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-danger"})]}),t.jsxs("span",{className:"flex w-full min-w-0 items-baseline gap-1",children:[t.jsx("span",{className:"w-3 shrink-0 font-mono text-body-sm text-ink tabular-nums",children:e.sessionCount??"–"}),t.jsx("span",{className:_("min-w-0 truncate text-meta",e.sessionCount===null?"text-ink-dim":"text-ink-muted"),children:we(e.sessionCount)})]}),t.jsxs("span",{"data-mesh-state-line":"",className:"flex w-full min-w-0 items-baseline gap-1.5 text-meta",children:[t.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-ink-dim",children:yt[w]}),t.jsx("span",{className:_("shrink-0",Be[w]),children:ce(w)}),p&&t.jsx("span",{"data-mesh-working":"",className:"shrink-0 text-info",children:"working"}),e.memberships.length>1&&t.jsxs("span",{className:"min-w-0 truncate text-ink-dim",children:["· ",e.memberships.length," networks"]})]})]}),t.jsxs("ul",{"aria-label":`Conversations on ${e.label}`,className:_("m-0 flex h-6 list-none items-center gap-1 overflow-hidden px-3",r==="accept"&&"opacity-40"),children:[c.shown.map(m=>t.jsx(hs,{session:m,ownerLabel:e.label,ownerReach:w,ownerReachable:e.reachable,moving:g===m.id,dragging:v===m.id,onPointerDown:y,onClick:()=>I(m)},m.id)),c.hidden>0&&t.jsx("li",{className:"shrink-0",children:t.jsxs("button",{type:"button","data-mesh-more":e.id,onClick:()=>l(e.id),className:_("flex min-h-6 items-center rounded-sm px-1.5 text-meta text-ink-dim","hover:bg-row-hover hover:text-ink","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"),title:`Showing ${c.shown.length} of ${h} conversations`,"aria-label":`Show all ${h} conversations`,children:["+",c.hidden]})})]})]})},hs=({session:e,ownerLabel:s,ownerReach:i,ownerReachable:a,moving:o,dragging:c,onPointerDown:h,onClick:r})=>{const g=Ge(e,s,i);return o?t.jsx("li",{role:"status","data-mesh-session":e.id,"data-mesh-moving":"true",children:t.jsx("span",{className:"flex min-h-6 items-center rounded-sm bg-sunken px-1.5 text-meta text-ink-muted",children:"moving…"})}):t.jsx("li",{className:"min-w-0 flex-1","data-mesh-session-item":e.id,"data-mesh-dragging":c?"true":void 0,children:t.jsx("button",{type:"button","data-mesh-session":e.id,style:{touchAction:"none"},title:`${ee(e)} · ${g}`,"aria-label":`${ee(e)}, ${g}. Opens ${s}.`,onPointerDown:v=>h(v,e),onClick:()=>r(e),className:_("flex min-h-6 w-full max-w-32 items-center rounded-sm border border-hairline bg-surface px-1.5 text-left text-meta text-ink-muted","cursor-grab active:cursor-grabbing","hover:text-ink",cs[It(e,a)],c&&"opacity-60","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"),children:t.jsx("span",{className:"min-w-0 flex-1 truncate",children:ee(e)})})})};function _e(e){const s=e.trim();if(!s)return null;if(s.startsWith("[")){const a=s.indexOf("]");if(a<=1)return null;const o=s.slice(1,a),c=s.slice(a+1);if(!c)return{host:o,port:null};if(!c.startsWith(":"))return null;const h=Number(c.slice(1));return{host:o,port:Number.isInteger(h)?h:null}}const i=s.lastIndexOf(":");if(i>0){const a=s.slice(i+1);if(/^\d+$/.test(a))return{host:s.slice(0,i),port:Number(a)}}return{host:s,port:null}}function Re(e){const s=e.trim().split(".");if(s.length!==4)return null;for(const i of s)if(!/^\d{1,3}$/.test(i)||Number(i)>255)return null;return`${s[0]}.${s[1]}.${s[2]}`}function ps(e){return`${e}.x`}function xs(e){const s=new Map;for(const a of e.values())for(const o of a)s.set(o,(s.get(o)??0)+1);const i=new Set;for(const[a,o]of s)o>1&&i.add(a);return i}function ke(e){return new Set(e.endpoints.map(s=>s.trim()).filter(Boolean))}function fs(e,s){const i=e.filter(l=>l.id!==s),a=e.find(l=>l.id===s)??null,o=new Map;for(const l of e)o.set(l.id,ke(l));const c=xs(o),h=new Set;for(const l of a?ke(a):[]){if(c.has(l))continue;const d=_e(l),p=d?Re(d.host):null;p&&h.add(p)}const r=l=>{const d=new Set;for(const p of ke(l)){if(c.has(p))continue;const f=_e(p),w=f?Re(f.host):null;w&&d.add(w)}return d},g=new Map,v=new Map;for(const l of i){const d=gs(l);if(d){g.set(d,[...g.get(d)??[],l.id]);continue}for(const p of r(l))v.set(p,[...v.get(p)??[],l.id])}const N=new Map(e.map((l,d)=>[l.id,d])),y=l=>[...l].sort((d,p)=>(N.get(d)??0)-(N.get(p)??0)),I=[];for(const[l,d]of g)I.push({prefix:l,tier:"declared",deviceIds:y(d),words:"declared"});for(const[l,d]of v)h.has(l)?I.push({prefix:l,tier:"shared",deviceIds:y(d),words:"shared with this device"}):d.length>1&&I.push({prefix:l,tier:"probable",deviceIds:y(d),words:"same prefix"});return I.sort((l,d)=>l.tier.localeCompare(d.tier)||l.prefix.localeCompare(d.prefix))}function gs(e){for(const s of e.memberships){const i=s.scope.trim();if(i)return i}return""}const $e={declared:0,shared:1,probable:2};function bs(e,s){const i=new Map;for(const o of e){let c=null;for(const r of o.deviceIds){const g=s.get(r);g!==void 0&&(c===null||g<c.slot)&&(c={id:r,slot:g})}if(c===null)continue;const h=i.get(c.id);h===void 0?i.set(c.id,{slot:c.slot,groups:[o]}):h.groups.push(o)}const a=o=>{let c=-1;for(const h of o.deviceIds){const r=s.get(h);r!==void 0&&r>c&&(c=r)}return c};return[...i.entries()].sort((o,c)=>o[1].slot-c[1].slot).map(([o,c])=>({deviceId:o,groups:c.groups.sort((h,r)=>a(r)-a(h)||$e[h.tier]-$e[r.tier]||h.prefix.localeCompare(r.prefix))}))}function vs(e){return new Map(e.map(s=>[s.deviceId,s.groups.length]))}function ks(e){return`${e.tier==="declared"?e.prefix:ps(e.prefix)} · ${e.words}`}const Le=(e,s)=>e.deviceIds.map(i=>s.devices.get(i)).filter(i=>i!==void 0),ws=({stacks:e,geometry:s})=>t.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute top-0 left-0",children:e.map(i=>{const a=i.groups.length,o=new Array(a).fill(0);let c=null;for(let r=a-1;r>=0;r-=1){const g=Le(i.groups[r],s),v=(g.length===0?0:Math.max(...g.map(N=>N.y+N.height)))+he;c=c===null?v:Math.max(v,c+be),o[r]=c}const h=s.devices.get(i.deviceId);return i.groups.map((r,g)=>{const v=Le(r,s);if(v.length===0)return null;const N=a-1-g,y=Math.min(...v.map(w=>w.x)),I=Math.max(...v.map(w=>w.x)),d=(h?.y??Math.min(...v.map(w=>w.y)))-he-Ct*N,p=r.tier==="declared",f=ks(r);return t.jsx("div",{"data-mesh-scope":`${r.tier}:${r.prefix}`,"data-mesh-scope-level":g,className:_("absolute rounded-lg",r.tier==="probable"?"border border-dashed border-hairline-strong":"border border-control"),style:{left:y-he-be*N,top:d,width:I+Ne-y+(he+be*N)*2,height:o[g]-d},children:t.jsx("span",{"data-mesh-scope-label":"",className:_("absolute bottom-full left-1 mb-0.5 whitespace-nowrap text-meta",r.tier==="probable"?"text-ink-dim":"text-ink-muted",p&&"font-medium"),children:f})},`${r.tier}:${r.prefix}`)})})}),Pe=48,Te=1.25,js=.0015,Ns=({graph:e,slots:s,nowSeconds:i,selectedDeviceId:a,sessions:o,sessionTotals:c,movingSessionId:h,canMove:r,onOpenDevice:g,onAskMove:v,onDropRefused:N,onShowAllSessions:y,summaryId:I})=>{const l=x.useRef(null),[d,p]=x.useState({width:0,height:0,clipWidth:0,clipHeight:0,left:0,top:0}),[f,w]=x.useState({k:1,tx:0,ty:0}),m=x.useRef(!1),S=x.useRef(!1),D=x.useRef(null),P=x.useMemo(()=>fs(e.devices,e.selfDeviceId),[e.devices,e.selfDeviceId]),C=x.useMemo(()=>bs(P,s.devices),[P,s]),M=x.useMemo(()=>St(s,vs(C)),[s,C]),B=x.useMemo(()=>({selfDeviceId:e.selfDeviceId,devices:new Map(e.devices.map(n=>[n.id,n])),networks:new Map(e.networks.map(n=>[n.id,n]))}),[e]),[j,W]=x.useState(fe),te=x.useRef({kind:"ground"}),z=x.useCallback((n,u)=>{const b=document.elementFromPoint(n,u),E=b?.closest("[data-mesh-device]");if(E){const G=E.getAttribute("data-mesh-device");if(G)return{kind:"device",deviceId:G}}const O=b?.closest("[data-mesh-network]");if(O){const G=O.getAttribute("data-mesh-network");if(G)return{kind:"network",networkId:G}}return{kind:"ground"}},[]),L=x.useMemo(()=>j.kind!=="dragging"&&j.kind!=="settling"?null:xe(j.payload,j.target,B),[j,B]),se=x.useCallback(n=>{if(!L)return null;if(L.kind==="plan"){const u=j.kind==="dragging"||j.kind==="settling"?j.target:null;return u&&u.kind==="device"&&u.deviceId===n?"accept":null}if(L.kind==="refused"){const u=j.kind==="dragging"||j.kind==="settling"?j.target:null;return u&&u.kind==="device"&&u.deviceId===n?"refuse":null}return null},[L,j]),ne=x.useCallback((n,u)=>{if(!r||n.button!==0)return;S.current=!1;const b=u.locality==="local"?e.selfDeviceId??"":u.owner_device,E=B.devices.get(b),O={session:u,ownerDeviceId:b,ownerLabel:E?.label??u.owner_device_name};try{n.currentTarget.setPointerCapture(n.pointerId)}catch{}W(G=>Q(G,{kind:"press",payload:O,x:n.clientX,y:n.clientY,pointerId:n.pointerId}))},[r,B,e.selfDeviceId]),ie=n=>{if(j.kind==="pressing"||j.kind==="dragging"){const u=z(n.clientX,n.clientY);te.current=u,W(b=>Q(b,{kind:"move",x:n.clientX,y:n.clientY,target:u}));return}ue(n)},re=n=>{if(J(n),j.kind!=="pressing"&&j.kind!=="dragging")return;if(j.kind==="pressing"){W(b=>Q(b,{kind:"cancel"}));return}const u=xe(j.payload,j.target,B);S.current=!0,W(b=>Q(b,{kind:"release"})),u.kind==="plan"?v({plan:u.plan,alternatives:u.alternatives,risky:u.risky}):u.kind==="refused"&&N({code:u.code,sentence:u.sentence,remedy:u.remedy,plan:u.plan??null}),W(b=>Q(b,{kind:"settled"}))};x.useEffect(()=>()=>W(fe),[]);const Z=x.useCallback(()=>{w(Ae(M.bounds,d))},[M.bounds,d]);x.useEffect(()=>{const n=l.current;if(!n)return;const u=()=>{const E=n.getBoundingClientRect();p({width:E.width,height:E.height,clipWidth:n.clientWidth,clipHeight:n.clientHeight,left:E.left,top:E.top})};u();const b=new ResizeObserver(u);return b.observe(n),()=>b.disconnect()},[]),x.useEffect(()=>{m.current||d.width<=0||d.height<=0||(m.current=!0,w(Ae(M.bounds,d)))},[d,M.bounds]),x.useEffect(()=>{const n=D.current;if(D.current={width:d.width,height:d.height},!n||!m.current||d.width<=0||d.height<=0||d.width>=n.width&&d.height>=n.height||!a)return;const u=M.devices.get(a);u&&w(b=>{const E={width:d.clipWidth,height:d.clipHeight},O=Math.max(0,Math.min(E.width-M.bounds.width*b.k,E.height-M.bounds.height*b.k));return Mt(b,u,E,Math.min(At,O))})},[d,a,M]);const F=j.kind==="dragging"?{x:j.x-d.left+12,y:j.y-d.top+12}:{x:0,y:0},K=L?Dt(L):null,k=x.useRef(null),A=x.useRef(null),$=x.useRef(null),T=x.useRef(null),R=x.useCallback(()=>{$.current=null;const n=k.current,u=A.current;if(k.current=null,A.current=null,n){const b=T.current;if(!b)return;w({k:b.transform.k,tx:b.transform.tx+(n.x-b.x),ty:b.transform.ty+(n.y-b.y)});return}u&&w(b=>ve(b,{x:u.x,y:u.y},b.k*Math.exp(-u.deltaY*js)))},[]),Y=x.useCallback(()=>{$.current===null&&($.current=requestAnimationFrame(R))},[R]);x.useEffect(()=>()=>{$.current!==null&&cancelAnimationFrame($.current)},[]);const q=n=>{!(n.target===n.currentTarget)&&n.button!==1||n.button!==0&&n.button!==1||(T.current={x:n.clientX,y:n.clientY,transform:f},n.currentTarget.setPointerCapture(n.pointerId),n.preventDefault())},ue=n=>{T.current&&(k.current={x:n.clientX,y:n.clientY},Y())},J=n=>{T.current&&(T.current=null,k.current=null,n.currentTarget.hasPointerCapture(n.pointerId)&&n.currentTarget.releasePointerCapture(n.pointerId))},X=x.useCallback(n=>{if(n.deltaY===0)return;n.preventDefault();const u=n.currentTarget.getBoundingClientRect();A.current={x:n.clientX-u.left,y:n.clientY-u.top,deltaY:n.deltaY},Y()},[Y]);x.useEffect(()=>{const n=l.current;if(n)return n.addEventListener("wheel",X,{passive:!1}),()=>n.removeEventListener("wheel",X)},[X]);const me=n=>{const u=n.shiftKey?Pe*4:Pe;switch(n.key){case"Escape":if(j.kind!=="pressing"&&j.kind!=="dragging")return;n.preventDefault(),j.kind==="dragging"&&(S.current=!0),W(b=>Q(b,{kind:"cancel"}));return;case"0":n.preventDefault(),Z();return;case"+":case"=":n.preventDefault(),w(b=>ve(b,{x:d.width/2,y:d.height/2},b.k*Te));return;case"-":case"_":n.preventDefault(),w(b=>ve(b,{x:d.width/2,y:d.height/2},b.k/Te));return;case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":{n.preventDefault();const b=n.key==="ArrowLeft"?u:n.key==="ArrowRight"?-u:0,E=n.key==="ArrowUp"?u:n.key==="ArrowDown"?-u:0;w(O=>({...O,tx:O.tx+b,ty:O.ty+E}));return}}};return t.jsxs("div",{ref:l,"data-mesh-canvas":"",role:"group","aria-labelledby":I,tabIndex:0,onPointerDown:q,onPointerMove:ie,onPointerUp:re,onPointerCancel:n=>{j.kind==="dragging"&&(S.current=!0),W(u=>Q(u,{kind:"cancel"})),J(n)},"data-mesh-gesture":j.kind,onKeyDown:me,onDoubleClick:n=>{n.target===n.currentTarget&&Z()},className:_("relative min-h-0 flex-1 overflow-hidden rounded-lg border border-hairline bg-sunken","[touch-action:none]","cursor-grab active:cursor-grabbing","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-[-2px]"),children:[t.jsx("div",{"data-mesh-ground":"","aria-hidden":"true",className:"mesh-ground pointer-events-none absolute inset-0",style:{backgroundPosition:`${f.tx}px ${f.ty}px`}}),t.jsxs("div",{"data-mesh-world":"",className:"absolute top-0 left-0",style:{transform:`translate3d(${f.tx}px, ${f.ty}px, 0) scale(${f.k})`,transformOrigin:"0 0",width:M.bounds.width,height:M.bounds.height},children:[t.jsx(ws,{stacks:C,geometry:M}),t.jsx(as,{edges:e.edges,geometry:M,selectedDeviceId:a}),t.jsx("ul",{"aria-label":"Networks",className:"m-0 list-none p-0",children:e.networks.map(n=>{const u=M.networks.get(n.id);return u?t.jsx(us,{network:n,x:u.x,y:u.y,refused:L?.kind==="refused"&&j.kind==="dragging"&&j.target.kind==="network"&&j.target.networkId===n.id},n.id):null})}),t.jsx("ul",{"aria-label":"Devices",className:"m-0 list-none p-0",children:e.devices.map(n=>{const u=M.devices.get(n.id);return u?t.jsx(ms,{device:n,x:u.x,y:u.y,nowSeconds:i,selected:n.id===a,sessions:o.get(n.id)??{rows:[],shown:[],hidden:0},sessionTotal:c.get(n.id)??n.sessionCount??0,dropState:se(n.id),movingSessionId:h,draggedSessionId:ns(j),onOpen:g,onChipPointerDown:ne,onChipClick:()=>{if(S.current){S.current=!1;return}g(n.id)},onShowAllSessions:y},n.id):null})})]}),j.kind==="dragging"&&t.jsx("div",{"data-mesh-ghost":"","aria-hidden":"true",className:"pointer-events-none absolute z-10 max-w-40 truncate rounded-sm border border-ink-dim bg-surface px-1.5 py-0.5 text-meta text-ink",style:{left:F.x,top:F.y},children:j.payload.session.name||"untitled"}),j.kind==="dragging"&&K&&t.jsx("div",{"data-mesh-indicator":"",className:_("pointer-events-none absolute z-10 rounded-sm border bg-surface px-2 py-1 text-meta",L?.kind==="refused"?"border-warning text-warning":"border-control text-ink"),style:{left:F.x,maxWidth:Math.max(160,d.width-F.x-12),...F.y>d.height*.6?{bottom:Math.max(12,d.height-F.y+8)}:{top:F.y+24}},children:K})]})};function ys(e,s,i,a){const o=i.locality==="local"?s:i.owner_device,c=[];for(const h of e)if(h.id!==o){if(h.id===s){c.push({deviceId:h.id,label:a,verb:"Recall to this device",keepVerb:"Copy here, leave it there"});continue}c.push({deviceId:h.id,label:h.label,verb:`Move to ${h.label}`,keepVerb:`Copy to ${h.label}`})}return c}function Is(e,s,i){return ys(e.devices,e.selfDeviceId,s,i)}function Ve(e,s,i){const a=Is(e,s,i),o={selfDeviceId:e.selfDeviceId,devices:new Map(e.devices.map(r=>[r.id,r])),networks:new Map(e.networks.map(r=>[r.id,r]))},c=s.locality==="local"?e.selfDeviceId??"":s.owner_device,h=o.devices.get(c);return a.map(r=>{const g=xe({session:s,ownerDeviceId:c,ownerLabel:h?.label??s.owner_device_name},{kind:"device",deviceId:r.deviceId},o);return{...r,refused:g.kind==="refused"&&g.code!=="busy"?g.sentence:null}})}const Ke=({session:e,destinations:s,disabled:i,onChoose:a,onOpenChange:o,trigger:c,triggerLabel:h})=>t.jsxs(nt,{onOpenChange:o,children:[t.jsx(at,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":h,"data-mesh-session-menu":e.id,disabled:i||s.length===0,className:"rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2 disabled:text-ink-disabled",children:c})}),t.jsxs(it,{align:"start",className:"min-w-56",children:[t.jsx(rt,{children:ee(e)}),t.jsx(Se,{}),s.map(r=>t.jsx(Me,{"data-mesh-move-to":r.deviceId,disabled:!!r.refused,title:r.refused??void 0,onSelect:()=>a(r,!1),children:r.verb},r.deviceId)),t.jsx(Se,{}),s.map(r=>t.jsx(Me,{"data-mesh-copy-to":r.deviceId,disabled:!!r.refused,title:r.refused??void 0,onSelect:()=>a(r,!0),children:r.keepVerb},`keep-${r.deviceId}`))]})]}),Cs=({device:e,sessions:s,sessionTotal:i,nowSeconds:a,destinationsFor:o,movingSessionId:c,canMove:h,canInvite:r,onClose:g,onMove:v,onShowInList:N,onInvite:y,onRemoveMember:I})=>{const l=de(e);x.useEffect(()=>{const m=S=>{S.key!=="Escape"||S.defaultPrevented||S.target?.closest('[role="menu"],[role="dialog"]')||(document.querySelector(`[data-mesh-device-open="${e.id}"]`)?.focus(),g())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[e.id,g]);const d=e.memberships.every(m=>!m.active),p=e.sessionCount===null?we(null):`${e.sessionCount} ${we(e.sessionCount)}`,f=e.suspect?Ye:[d?"revoked membership":p,ce(l)].filter(Boolean).join(" · "),w=i>s.rows.length?`${s.rows.length} of ${i}`:`${s.rows.length}`;return t.jsxs("aside",{"aria-label":`${e.label} details`,"data-mesh-panel":e.id,className:"flex w-80 shrink-0 flex-col gap-3 overflow-y-auto rounded-md border border-hairline bg-surface p-4",children:[t.jsxs("header",{className:"flex flex-col gap-1",children:[t.jsx(U,{size:"sm",variant:"ghost",className:"w-fit self-end","data-mesh-panel-close":"",onClick:g,children:"Close"}),t.jsx("h2",{className:"text-body-sm text-ink",children:e.label}),t.jsxs("p",{className:"flex items-center gap-1.5 text-meta text-ink-muted",children:[e.suspect&&t.jsx(ye,{"aria-hidden":"true",className:"size-3.5 text-danger"}),!e.suspect&&l==="unanswered"&&t.jsx(st,{"aria-hidden":"true",className:"size-3.5 text-warning"}),f]})]}),t.jsx(ae,{}),t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-meta text-ink-dim",children:"Memberships"}),t.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:e.memberships.map(m=>t.jsxs("li",{className:"flex flex-col gap-1",children:[t.jsxs("span",{className:"flex items-center gap-2 text-body-sm text-ink",children:[t.jsx(je,{"aria-hidden":"true",className:"size-3.5 text-ink-muted"}),m.networkName]}),t.jsxs("span",{className:"text-meta text-ink-dim",children:[m.role||"member",m.capabilities.length>0?` · ${m.capabilities.join(", ")}`:"",m.active?"":" · revoked"]}),r&&m.active&&t.jsxs(U,{size:"sm",variant:"ghost",className:"w-fit","data-mesh-remove-member":`${m.networkId}:${e.id}`,onClick:()=>I(e,m.networkId),children:["Remove from ",m.networkName,"…"]})]},m.networkId))}),r&&t.jsx(U,{size:"sm",variant:"secondary",className:"w-fit","data-mesh-invite":e.id,onClick:()=>y(e),children:"Invite to a network…"})]}),t.jsx(ae,{}),t.jsxs("section",{className:"flex shrink-0 flex-col gap-2",children:[t.jsxs("h3",{className:"text-meta text-ink-dim",children:["Conversations ",t.jsxs("span",{className:"text-ink-disabled",children:["(",w,")"]})]}),s.rows.length===0?t.jsx("p",{className:"text-meta text-ink-dim",children:e.sessionCount===null?"This device did not report its conversations.":"No conversations here."}):t.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0",children:s.rows.map(m=>t.jsxs("li",{"data-mesh-panel-session":m.id,className:_("flex items-center gap-2 rounded-sm px-2 py-1","border border-hairline bg-elevated",c===m.id&&"border-control"),children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-ink",title:ee(m),children:ee(m)}),t.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:Ge(m,e.label,de(e))}),c===m.id?t.jsx("span",{className:"shrink-0 text-meta text-ink-muted",children:"moving…"}):t.jsx(Ke,{session:m,destinations:o(m),disabled:!h,onChoose:(S,D)=>v(m,S,D),trigger:t.jsx(He,{"aria-hidden":"true",className:"size-4"}),triggerLabel:`Move ${ee(m)}`})]},m.id))})]}),t.jsx(ae,{}),t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-meta text-ink-dim",children:"Network addresses"}),e.endpoints.length===0?t.jsx("p",{className:"text-meta text-ink-dim",children:"No address published."}):t.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0",children:e.endpoints.map(m=>t.jsxs("li",{className:"flex items-baseline justify-between gap-2",children:[t.jsx("span",{className:"min-w-0 truncate font-mono text-body-sm text-ink",children:m}),t.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:"advertised"})]},m))})]}),t.jsx(ae,{}),t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-meta text-ink-dim",children:"Status"}),t.jsxs("dl",{className:"m-0 flex flex-col gap-1",children:[t.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t.jsx("dt",{className:"text-meta text-ink-dim",children:"Reach"}),t.jsx("dd",{className:"m-0 text-body-sm text-ink",children:ce(l)})]}),t.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t.jsx("dt",{className:"text-meta text-ink-dim",children:"Last status frame"}),t.jsx("dd",{className:"m-0 text-body-sm text-ink",children:e.lastSeenAt===null?"never":Et(a-e.lastSeenAt)})]})]}),e.reason&&t.jsx("p",{className:"text-meta text-warning",children:e.reason})]}),t.jsx(ae,{}),t.jsx(U,{size:"sm",variant:"ghost",className:"w-fit","data-mesh-show-in-list":e.id,onClick:()=>N(e.id),children:"Show in list"})]})},Ss=["name","chats","state"],Ms={name:"Name",chats:"Conversations",state:"State"},Oe={suspect:0,unreachable:1,self:2,reachable:3};function Ds(e,s){const i=[...e];switch(s){case"chats":return i.sort((a,o)=>(o.sessionCount??-1)-(a.sessionCount??-1)||a.label.localeCompare(o.label)),i;case"state":return i.sort((a,o)=>Oe[a.state]-Oe[o.state]||a.label.localeCompare(o.label)),i;default:return i.sort((a,o)=>a.label.localeCompare(o.label))}}const We=8;function As(e,s){if(e.locality==="local")return e.live_state||"here";const i=e.owner_device_name||s,a=e.live_state?` · ${e.live_state}`:"";return e.reachable?`on ${i}${a}`:`on ${i} (not answering)`}const Es=({graph:e,nowSeconds:s,selectedDeviceId:i,sessions:a,selfLabel:o,canMove:c,onSelect:h,onMove:r,onInvite:g,onRemove:v})=>{const[N,y]=x.useState("name"),I=x.useMemo(()=>e.networks.map(l=>({network:l,members:Ds(e.devices.filter(d=>d.memberships.some(p=>p.networkId===l.id)),N)})),[e,N]);return t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pr-1",children:[t.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[t.jsx("legend",{className:"sr-only",children:"Sort devices by"}),t.jsx("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:Ss.map(l=>t.jsx("button",{type:"button","aria-pressed":N===l,onClick:()=>y(l),className:_("h-6 rounded-sm px-3 text-body-sm text-ink-muted transition-colors duration-fast ease-out-quart","hover:text-ink","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",N===l&&"bg-surface text-ink"),children:Ms[l]},l))})]}),I.map(({network:l,members:d})=>t.jsxs("section",{"data-mesh-network-group":l.id,className:"flex flex-col gap-2",children:[t.jsxs("h2",{className:"flex flex-wrap items-baseline gap-2 text-body-sm text-ink",title:`epoch ${l.epoch}`,children:[l.label,t.jsxs("span",{className:"text-meta text-ink-dim",children:[l.trust," · ",l.memberCount," ",l.memberCount===1?"device":"devices",l.revokedCount>0?` · ${l.revokedCount} revoked`:""]})]}),t.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0",children:d.map(p=>{const f=p.memberships.find(C=>C.networkId===l.id),w=p.id===i,m=a.get(p.id),S=m?.rows??[],D=m?Ue(m,p.sessionCount):p.sessionCount??0,P=de(p);return t.jsxs("li",{"data-mesh-device-row":p.id,"data-mesh-state":p.state,"aria-current":w?"true":void 0,className:_("flex flex-col gap-1 rounded-md px-3 py-2","border border-hairline bg-surface",w&&"border-ink bg-row-selected"),children:[t.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[t.jsx("button",{type:"button","data-mesh-device-open":p.id,onClick:()=>h(p.id),className:_("min-w-0 flex-1 truncate text-left text-body-sm text-ink","hover:text-ink-muted","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"),children:p.label}),t.jsxs("span",{className:_("flex shrink-0 items-center gap-1 text-meta",Be[P]),"data-mesh-reach":P,children:[p.suspect&&t.jsx(ye,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-danger"}),p.suspect?ce(P):Fe(p,s),p.suspect&&t.jsx("span",{className:"shrink-0 rounded-sm border border-danger px-1 text-danger",children:Ye})]}),t.jsxs("span",{className:"shrink-0 text-meta text-ink-dim",children:[f?.role?`${f.role} · `:"",f&&!f.active?"revoked":"member"]})]}),S.length>0?t.jsxs(t.Fragment,{children:[t.jsx(ae,{className:"my-1"}),t.jsx("ul",{className:"m-0 flex list-none flex-col gap-0.5 p-0",children:S.slice(0,We).map(C=>t.jsxs("li",{"data-mesh-row-session":C.id,className:"flex items-center gap-2 py-0.5",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-meta text-ink-muted",children:C.name||C.id}),t.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:As(C,o)}),t.jsx(Ke,{session:C,destinations:Ve(e,C,o),disabled:!c,onChoose:(M,B)=>r(C,M,B),trigger:t.jsx(He,{"aria-hidden":"true",className:"size-3.5"}),triggerLabel:`Move ${C.name||C.id}`})]},C.id))}),D>S.slice(0,We).length&&t.jsx("button",{type:"button",onClick:()=>h(p.id),className:"w-fit text-meta text-ink-dim hover:text-ink",children:`show all ${D} in the panel`})]}):t.jsx("span",{className:"text-meta text-ink-dim",children:D===0?"no conversations":D===1?"1 conversation":`${D} conversations`}),(f?.active||p.state!=="self")&&t.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[t.jsx(U,{size:"sm",variant:"ghost","data-mesh-invite":p.id,onClick:()=>g({deviceId:p.id,deviceLabel:p.label}),children:"Invite to a network…"}),f?.active&&t.jsxs(U,{size:"sm",variant:"ghost","data-mesh-remove-member":`${l.id}:${p.id}`,onClick:()=>v({networkId:l.id,networkLabel:l.label,deviceId:p.id,deviceLabel:p.label}),children:["Remove from ",l.label,"…"]})]})]},p.id)})})]},l.id)),e.unmatchedPeers.length>0&&t.jsxs("p",{className:"text-meta text-warning",children:[e.unmatchedPeers.length," ",e.unmatchedPeers.length===1?"device":"devices"," answered the peer read but is in no network this app can name."]})]})},_s=["canvas","list"],Rs={canvas:"Canvas",list:"List"},$s=({state:e,graph:s,nowSeconds:i,checking:a,staleError:o,onRetry:c,approvals:h,sessions:r,sessionError:g,selfLabel:v,movingSessionId:N,canMove:y,pendingMove:I,onAskMove:l,onDropRefused:d,onChooseMove:p,onCancelMove:f,moveBusy:w,moveReport:m,onDismissReport:S,onWaitForIdle:D,onUndoCopy:P,invite:C,onOpenInvite:M,onInvite:B,onCloseInvite:j,inviteBusy:W,inviteReceipt:te,inviteRefusal:z,remove:L,onOpenRemove:se,onRemove:ne,onCloseRemove:ie,removeBusy:re,removeRefusal:Z,removed:F})=>{const[K,k]=x.useState("canvas"),[A,$]=x.useState(null),T=s?_t(s):"",R="mesh-summary",Y=Rt(s),q=$t(s,r,s?.selfDeviceId??null),ue=x.useMemo(()=>{const n=new Map;for(const u of s?.devices??[]){const b=q.byDevice.get(u.id);n.set(u.id,b?Ue(b,u.sessionCount):u.sessionCount??0)}return n},[s,q]),J=x.useCallback(n=>{$(n)},[]),X=s?s.devices.find(n=>n.id===A)??null:null,me=x.useCallback((n,u,b)=>{if(!s)return null;const E={selfDeviceId:s.selfDeviceId,devices:new Map(s.devices.map(V=>[V.id,V])),networks:new Map(s.networks.map(V=>[V.id,V]))},O=n.locality==="local"?s.selfDeviceId??"":n.owner_device,G=E.devices.get(O),H=xe({session:n,ownerDeviceId:O,ownerLabel:G?.label??n.owner_device_name},{kind:"device",deviceId:u.deviceId},E);if(H.kind==="refused")return d({code:H.code,sentence:H.sentence,remedy:H.remedy,plan:H.plan??null}),null;if(H.kind==="none")return null;const Ie=b?H.alternatives.find(V=>V.keep)??H.plan:H.plan,Xe=[H.plan,...H.alternatives].filter(V=>V.keep!==Ie.keep),Ze={plan:Ie,alternatives:Xe,risky:H.risky};l(Ze)},[s,l,d]);return t.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-6 overflow-y-auto p-6",children:[t.jsx(tt,{title:"Mesh",icon:je,subtitle:"Devices this app is paired with, and the networks that hold them.",children:t.jsxs("div",{className:"flex items-center gap-4",children:[a&&t.jsx("output",{className:"text-meta text-ink-dim",children:"checking…"}),(e.kind==="ready"||e.kind==="loading")&&t.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[t.jsx("legend",{className:"sr-only",children:"Presentation"}),t.jsx("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:_s.map(n=>t.jsx("button",{type:"button","aria-pressed":K===n,disabled:e.kind!=="ready",onClick:()=>k(n),className:_("h-6 rounded-sm px-3 text-body-sm text-ink-muted transition-colors duration-fast ease-out-quart","hover:text-ink","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2","disabled:text-ink-dim disabled:hover:text-ink-dim",K===n&&"bg-surface text-ink"),children:Rs[n]},n))})]})]})}),t.jsx(ts,{rows:h.rows,error:h.error,pending:h.pending,refusal:h.decisionRefusal,onDecide:h.onDecide,onRetry:h.onRetry,nowSeconds:h.nowSeconds,networkNames:new Map((s?.networks??[]).map(n=>[n.id,n.label]))}),e.kind==="loading"&&t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[t.jsx(De,{className:"h-4 w-64"}),t.jsx(De,{className:"min-h-40 w-full flex-1"})]}),e.kind==="error"&&t.jsxs(pe,{variant:"warning",className:"flex-col items-start gap-2",children:[t.jsx("p",{children:e.message}),t.jsx(U,{variant:"secondary",size:"sm",onClick:c,className:"w-fit",children:"Ask again"})]}),e.kind==="empty"&&t.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center rounded-lg border border-hairline bg-surface p-6",children:t.jsxs("div",{className:"flex flex-col items-start gap-3",children:[t.jsx("h2",{className:"text-heading text-ink",children:"No network on this device"}),t.jsx("p",{className:"max-w-140 text-body-sm text-ink-muted",children:"This device is not in any network, so there is no mesh to draw. Create one on this machine:"}),t.jsx("code",{className:"rounded-sm bg-sunken px-2 py-1 font-mono text-meta text-ink",children:"lop network init <name>"}),t.jsx("p",{className:"text-meta text-ink-dim",children:"A network appears here once this device has joined one."})]})}),e.kind==="ready"&&s&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex min-h-[22rem] flex-1 gap-4",children:[t.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3",children:[t.jsx("p",{id:R,className:"text-meta text-ink-muted","data-mesh-summary":"",children:T}),o&&t.jsx(pe,{variant:"warning",children:t.jsx("p",{children:o})}),g&&t.jsx(pe,{variant:"warning",children:t.jsx("p",{children:g})}),m&&t.jsx(Lt,{receipt:m.kind==="moved"?{verb:m.verb,detail:m.detail,undo:m.undo}:null,refusal:m.kind==="refused"?m.refusal:null,canWait:m.kind==="refused"&&m.plan!==null,onWait:D,onRecheck:c,onUndo:P,onDismiss:S,pending:w}),K==="canvas"?t.jsx(Ns,{graph:s,slots:Y,nowSeconds:i,selectedDeviceId:A,sessions:q.byDevice,sessionTotals:ue,movingSessionId:N,canMove:y,onOpenDevice:J,onAskMove:l,onDropRefused:d,onShowAllSessions:J,summaryId:R}):t.jsx(Es,{graph:s,nowSeconds:i,selectedDeviceId:A,sessions:q.byDevice,selfLabel:v,canMove:y,onSelect:J,onMove:me,onInvite:M,onRemove:se})]}),X&&t.jsx(Cs,{device:X,sessions:q.byDevice.get(X.id)??{rows:[],shown:[],hidden:0},sessionTotal:ue.get(X.id)??0,nowSeconds:i,canMove:y,canInvite:e.kind==="ready",movingSessionId:N,destinationsFor:n=>Ve(s,n,v),onClose:()=>$(null),onMove:me,onInvite:n=>M({deviceId:n.id,deviceLabel:n.label}),onRemoveMember:(n,u)=>{const b=s.networks.find(E=>E.id===u);se({networkId:u,networkLabel:b?.label??u,deviceId:n.id,deviceLabel:n.label})},onShowInList:n=>{J(n),k("list")}})]})}),t.jsx(Pt,{open:I!==null,plan:I?.plan??Ls,alternatives:I?.alternatives??[],risky:I?.risky??!1,busy:w,onCancel:f,onChoose:p}),C&&t.jsx(Tt,{open:C.open,options:C.options,deviceId:C.deviceId,deviceLabel:C.deviceLabel,onClose:j,onInvite:B,pending:W,receipt:te,refusal:z}),L&&t.jsx(Ot,{open:L.open,networkLabel:L.networkLabel,deviceLabel:L.deviceLabel,onClose:ie,onConfirm:ne,pending:re,refusal:Z,removed:F})]})},Ls={sessionId:"",to:"",keep:!1,verb:"",waitS:0,lost:null},Ys=()=>{const e=Qe(),s=ge(e.data,"peers")==="enabled",i=ge(e.data,"session_transfer")==="enabled",a=Wt(s),o=zt(s),c=Ht(s,{poll:!1,stamp:()=>Ce.getState().beginAnswer()}),h=x.useMemo(()=>({peers:a,networks:o}),[a,o]),r=Bt(h),g=Ft(h),v=Yt(),N=ge(e.data,"approvals")==="enabled",y=Ut(s&&N,{poll:!1}),I=qt(),l=I.isError?{approvalId:I.variables?.approvalId??null,...Gt(I.error)}:null,d=x.useMemo(()=>Math.floor((y.dataUpdatedAt||Date.now())/1e3),[y.dataUpdatedAt]),p=Ce(k=>k.settlePlacement),f=Vt(),w=Kt(),[m,S]=x.useState(null),[D,P]=x.useState(null),[C,M]=x.useState(null),[B,j]=x.useState(null),[W,te]=x.useState(null),[z,L]=x.useState(null),[se,ne]=x.useState(null),ie=x.useMemo(()=>{const k=Math.max(a.dataUpdatedAt,o.dataUpdatedAt);return Math.floor((k||Date.now())/1e3)},[a.dataUpdatedAt,o.dataUpdatedAt]),re=x.useCallback(()=>{a.refetch(),o.refetch(),c.refetch()},[a,o,c]),Z=x.useCallback((k,A)=>{S(null);const $={sessionId:k.sessionId,to:k.to,keep:k.keep,waitS:A??k.waitS};v.mutate($,{onSuccess:T=>{if(T.kind==="moved"){const{receipt:R}=T;p(k.sessionId,R);const Y=R.locality==="local"?"this device":g?.devices.find(q=>q.id===R.owner_device)?.label??R.owner_device;P({kind:"moved",verb:R.mode==="keep"?"Copied":"Moved",detail:R.mode==="keep"?`${Y} holds a copy as ${R.new_session_id.slice(-6)}; the original is still here.`:`${Y} holds it now${R.source_retired?"; the copy here is gone":""}.`,undo:R.mode==="keep"?{sessionId:R.new_session_id,to:"local",keep:!1,verb:`Bring the copy back from ${Y}`,waitS:0,lost:Xt(Y,"this device")}:null});return}P({kind:"refused",refusal:T.refusal,plan:k})},onError:()=>{P({kind:"refused",refusal:{code:"move_failed",sentence:"The move could not be sent. Nothing here changed; the list has been read again.",status:null,unconfirmed:!1},plan:k})}})},[g,v,p]),F=x.useMemo(()=>{if(!g)return[];const k=C?.deviceId,A=k?g.devices.find($=>$.id===k):void 0;return g.networks.filter($=>{if(!A)return!0;const T=A.memberships.find(R=>R.networkId===$.id);return!T||!T.active}).map($=>({id:$.id,label:$.label}))},[g,C]);if(!s)return t.jsx(et,{to:"/chat",replace:!0});const K=r.kind==="ready"?a.error?le(a.error):o.error?le(o.error):null:null;return t.jsx($s,{state:r,graph:g,nowSeconds:ie,checking:a.isFetching||o.isFetching,staleError:K,onRetry:re,approvals:{rows:y.data??[],error:y.isError?Zt(y.error):null,pending:I.isPending?I.variables??null:null,decisionRefusal:l,onDecide:(k,A)=>I.mutate({approvalId:k,decision:A}),onRetry:()=>void y.refetch(),nowSeconds:d},sessions:c.data?.rows??[],movingSessionId:v.isPending?v.variables?.sessionId??null:null,sessionError:c.isError?le(c.error):null,selfLabel:g?.devices.find(k=>k.state==="self")?.label??"this device",canMove:i,pendingMove:m,onAskMove:S,onDropRefused:k=>P({kind:"refused",refusal:{code:k.code,sentence:k.sentence,status:null,unconfirmed:!1},plan:k.plan}),onChooseMove:k=>Z(k),onCancelMove:()=>S(null),moveBusy:v.isPending,moveReport:D,onDismissReport:()=>P(null),onWaitForIdle:()=>{D?.kind!=="refused"||!D.plan||Z(D.plan,Ps)},onUndoCopy:()=>{D?.kind!=="moved"||!D.undo||S({plan:D.undo,alternatives:[],risky:!1})},invite:C===null?null:{open:!0,deviceId:C.deviceId,deviceLabel:C.deviceLabel,options:F},onOpenInvite:k=>{j(null),te(null),M(k)},onInvite:k=>{f.mutate(k,{onSuccess:A=>j(A),onError:A=>te({code:"invite_refused",sentence:le(A),status:null,unconfirmed:!1})})},onCloseInvite:()=>M(null),inviteBusy:f.isPending,inviteReceipt:B,inviteRefusal:W,remove:z===null?null:{open:!0,networkId:z.networkId,networkLabel:z.networkLabel,deviceId:z.deviceId,deviceLabel:z.deviceLabel},onOpenRemove:k=>{ne(null),L(k)},onRemove:k=>{z&&w.mutate({networkId:z.networkId,deviceId:z.deviceId,confirm:k},{onSuccess:A=>ne(A)})},onCloseRemove:()=>L(null),removeBusy:w.isPending,removeRefusal:w.isError?{code:"remove_refused",sentence:le(w.error),status:null,unconfirmed:!1}:null,removed:se})},Ps=300;export{Ys as MeshPage,$s as MeshSurface,Ys as default};
1
+ import{r as x,j as t,c as _}from"./index-D_Ya8nt7.js";import{aV as ze,aW as je,aX as Je,aY as He,a as Qe,aZ as ge,ag as Ce,a_ as et}from"./conversation-input-sync-DeCSVDem.js";import{P as tt}from"./page-header-cUi3kof4.js";import{B as U,A as pe,j as st,a as ae,D as nt,k as at,l as it,m as rt,n as Se,o as Me,e as De}from"./error-boundary-sr-ahxTS.js";import{i as oe,d as lt,e as ot,f as dt,g as ct,h as ut,j as mt,k as ht,l as pt,m as xt,n as ft,o as gt,p as bt,N as vt,q as Ne,r as kt,s as de,D as wt,t as jt,u as Nt,v as ye,w as we,R as yt,x as ce,y as Be,z as Fe,C as It,E as he,F as be,G as Ct,H as St,I as xe,J as Ae,K as Mt,L as Dt,M as ve,O as At,Q as Ye,T as Et,U as Ue,V as _t,W as Rt,X as $t,Y as Lt,Z as Pt,_ as Tt,$ as Ot,a0 as Wt,a1 as zt,a2 as Ht,a3 as Bt,a4 as Ft,a5 as Yt,a6 as Ut,a7 as qt,a8 as Gt,a9 as Vt,aa as Kt,ab as Xt,ac as le,ad as Zt}from"./index-CpQRStsc.js";import"./ui-preferences-store-DApxrOwj.js";import"./console-mirror-D_HrghW0.js";function Jt(e){return e==="failed"?"text-danger":oe(e)?"text-ink-muted":"text-ink-dim"}function Qt(e){return e==="failed"?"Abandon":"Stop"}function es(e){switch(e){case"requested":return[{term:"Signing",text:"Approving signs with this machine's operator key; the system may ask for it."}];case"approved":return[{term:"Next",text:"An agent runs the install and connect."},{term:"Stop",text:"Stopping now denies the request; nothing has run yet."}];case"connecting":return[{term:"Stop",text:"Stopping now denies the request; the runner stops at its next step."}];case"failed":return[{term:"After a stop",text:"The runner stopped before it finished. Abandoning denies the request; a retry re-enters the same record instead."}];default:return[]}}const ts=({rows:e,error:s,pending:i,refusal:a,onDecide:o,onRetry:c,nowSeconds:h,networkNames:r})=>{const g=i!==null,v=x.useMemo(()=>e.filter(f=>oe(f.state)),[e]),N=x.useMemo(()=>e.filter(f=>!oe(f.state)),[e]),[y,I]=x.useState(!1),l=N.some(f=>f.state==="failed"),d=N.filter(f=>f.state==="failed").length,p=a!==null&&e.some(f=>f.approvalId===a.approvalId&&(oe(f.state)||y));return v.length===0&&N.length===0&&!s&&!a?null:t.jsxs("section",{"aria-label":"Approvals","data-tour-tag":"mesh-approvals-tray",className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(lt,{"aria-hidden":"true",className:"size-4 text-ink-muted"}),t.jsx("h2",{className:"text-body-sm text-ink",children:"Approvals"}),v.length>0&&t.jsx("span",{className:"text-meta text-ink-dim",children:v.length===1?"1 waiting":`${v.length} waiting`})]}),s&&t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("p",{className:"min-w-0 flex-1 text-meta text-ink-muted",children:s}),t.jsx(U,{variant:"secondary",size:"sm",onClick:c,children:"Ask again"})]}),v.length>0&&t.jsx("ul",{className:"flex flex-col divide-y divide-hairline",children:v.map(f=>t.jsx(Ee,{row:f,pending:i?.approvalId===f.approvalId?i:null,busy:g,refusal:a?.approvalId===f.approvalId?a:null,onDecide:o,nowSeconds:h,networkNames:r},f.approvalId))}),a&&!p&&t.jsx(qe,{refusal:a}),N.length>0&&t.jsx(ze,{open:y,onOpenChange:I,chevronClassName:"text-ink-dim",className:_(v.length>0&&"border-hairline border-t pt-3"),summary:t.jsxs("span",{className:"flex items-center gap-1.5 text-meta text-ink-muted",children:["Settled approvals",t.jsxs("span",{className:"text-ink-dim",children:["(",N.length,")"]}),l&&t.jsx("span",{"aria-hidden":"true",className:"size-1.5 rounded-full bg-danger"}),d>0&&t.jsxs("span",{className:"text-danger",children:[d," failed"]})]}),children:t.jsx("ul",{className:"flex flex-col divide-y divide-hairline","data-tour-tag":"mesh-approvals-records",children:N.map(f=>t.jsx(Ee,{row:f,pending:i?.approvalId===f.approvalId?i:null,busy:g,refusal:a?.approvalId===f.approvalId?a:null,onDecide:o,nowSeconds:h,networkNames:r},f.approvalId))})})]})},Ee=({row:e,pending:s,busy:i,refusal:a,onDecide:o,nowSeconds:c,networkNames:h})=>{const r=oe(e.state),g=ot(e),v=dt(e,h),N=ct(e,h),y=ut(e),I=mt(e),l=ht(e),d=pt(e.expiresAt,c),p=es(e.state),f=xt(e.state),w=ft(e.state);return t.jsxs("li",{className:"flex flex-col gap-2 py-3 first:pt-0 last:pb-0","data-tour-tag":"mesh-approval-card",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:_("text-meta",Jt(e.state)),children:gt(e.state)}),t.jsx("div",{className:"grow"}),r&&d&&t.jsx("span",{className:"text-meta text-ink-dim",children:d})]}),t.jsx("p",{className:"text-body-sm text-ink","data-tour-tag":"mesh-approval-summary",children:r?v:g}),e.state==="failed"&&t.jsx("p",{className:"text-meta text-ink-muted","data-tour-tag":"mesh-approval-stopped-note",children:"The runner stopped before it finished. It stays retryable until its window closes; Abandon denies the request."}),(f||w)&&t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f&&t.jsx(U,{variant:"primary",size:"sm",disabled:i,onClick:()=>o(e.approvalId,"approve"),"data-tour-tag":"mesh-approval-approve",children:"Approve"}),w&&t.jsx(U,{variant:"ghost",size:"sm",disabled:i,onClick:()=>o(e.approvalId,"deny"),"data-tour-tag":r?"mesh-approval-deny":"mesh-approval-stop",children:r?"Deny":Qt(e.state)}),s&&t.jsx("span",{className:"text-meta text-ink-dim",children:s.decision==="approve"?"Waiting for the signing prompt…":"Writing the decision…"})]}),t.jsxs(ze,{chevronClassName:"text-ink-dim",summary:t.jsx("span",{className:"text-meta",children:"Details"}),children:[N.length>0&&t.jsx("dl",{className:"grid grid-cols-[max-content_1fr] gap-x-4 gap-y-0.5 text-meta text-ink-dim","data-tour-tag":"mesh-approval-consequences",children:N.map(m=>t.jsxs(x.Fragment,{children:[t.jsx("dt",{className:"text-ink-muted",children:m.term}),t.jsx("dd",{children:m.consequence})]},m.term))}),(y||I)&&t.jsxs("p",{className:"text-meta text-ink-muted",children:[y&&t.jsx("span",{children:y}),y&&I&&t.jsx("span",{children:" · "}),I&&t.jsx("span",{className:"font-mono",children:I})]}),l&&t.jsx("p",{className:"text-meta text-ink-dim",children:l}),p.length>0&&t.jsx("dl",{className:"grid grid-cols-[max-content_1fr] gap-x-4 gap-y-0.5 text-meta","data-tour-tag":"mesh-approval-consequence",children:p.map(m=>t.jsxs(x.Fragment,{children:[t.jsx("dt",{className:"text-ink-muted",children:m.term}),t.jsx("dd",{className:"text-ink-muted",children:m.text})]},m.term))})]}),a&&t.jsx(qe,{refusal:a})]})},qe=({refusal:e})=>t.jsx(pe,{variant:"warning",className:"text-meta","data-tour-tag":"mesh-approval-refusal",children:t.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[t.jsx("span",{className:"min-w-0 flex-1",children:e.sentence}),t.jsx("span",{className:"shrink-0 font-mono text-ink-dim",children:e.code})]})}),ss=4,fe={kind:"idle"};function ns(e){switch(e.kind){case"dragging":case"settling":return e.payload.session.id;case"pressing":return null;default:return null}}function Q(e,s){switch(s.kind){case"press":return e.kind!=="idle"?e:{kind:"pressing",payload:s.payload,originX:s.x,originY:s.y,pointerId:s.pointerId};case"move":return e.kind==="pressing"?Math.max(Math.abs(s.x-e.originX),Math.abs(s.y-e.originY))<ss?e:{kind:"dragging",payload:e.payload,x:s.x,y:s.y,target:s.target,pointerId:e.pointerId}:e.kind==="dragging"?{...e,x:s.x,y:s.y,target:s.target}:e;case"release":return e.kind==="dragging"?{kind:"settling",payload:e.payload,target:e.target}:e.kind==="pressing"?fe:e;case"cancel":case"settled":return fe;default:return e}}const as=({edges:e,geometry:s,selectedDeviceId:i})=>t.jsx("svg",{"aria-hidden":"true",className:"pointer-events-none absolute top-0 left-0 overflow-visible",width:s.bounds.width,height:s.bounds.height,children:e.map(a=>{const o=s.networks.get(a.networkId),c=s.devices.get(a.deviceId);if(!o||!c)return null;const h=i!==null&&a.deviceId===i;return t.jsx("path",{"data-mesh-edge":a.key,d:bt(o,c),fill:"none",strokeWidth:h?2:1.5,strokeDasharray:a.active?void 0:"4 4",className:h?"stroke-ink":"stroke-ink-dim"},a.key)})}),is={self:"border-l-hairline",reached:"border-l-hairline",unanswered:"border-l-warning","not-attempted":"border-l-hairline",unknown:"border-l-hairline"};function rs(e){return e.suspect?"border-l-danger":is[de(e)]}const ls={self:"ring-2 ring-accent",reachable:null,unreachable:null,suspect:null},os={accept:"border-accent bg-accent-wash",refuse:"border-warning"};function ds(e,s,i){return[e.label,Fe(e,s),i].filter(Boolean).join(", ")}function ee(e){return e.name.trim()||e.id.slice(-6)}function Ge(e,s,i){if(i!=="reached"&&i!=="self"){const a=ce(i);return e.unreachable_reason?`${a} (${e.unreachable_reason})`:a}return e.live_state.trim()?e.live_state.trim():e.locality==="local"?"on this device":`on ${s}`}const cs={resting:"border-l-2 border-l-hairline",attention:"border-l-2 border-l-warning"},us=({network:e,x:s,y:i,refused:a})=>t.jsxs("li",{"data-mesh-network":e.id,"data-mesh-network-refused":a?"true":void 0,className:_("absolute flex items-center gap-2 rounded-md border bg-elevated px-3",a?"border-warning":"border-hairline"),style:{left:s,top:i,width:Ne,height:vt},children:[t.jsx(je,{"aria-hidden":"true",className:"size-4 shrink-0 text-ink-muted"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-body-sm text-ink",children:e.label}),t.jsxs("span",{title:`epoch ${e.epoch}`,className:"block truncate text-meta text-ink-dim",children:[e.memberCount," ",e.memberCount===1?"device":"devices",e.revokedCount>0?` · ${e.revokedCount} revoked`:""]})]})]}),ms=({device:e,x:s,y:i,nowSeconds:a,selected:o,sessions:c,sessionTotal:h,dropState:r,movingSessionId:g,draggedSessionId:v,onOpen:N,onChipPointerDown:y,onChipClick:I,onShowAllSessions:l})=>{const{activity:d}=kt(e,c.rows),p=d==="working",f=ds(e,a,p?"working":null),w=de(e);return t.jsxs("li",{"data-mesh-device":e.id,"data-mesh-state":e.state,"data-mesh-drop":r??void 0,"aria-current":o?"true":void 0,className:_("absolute flex flex-col rounded-md border border-l-4 border-control bg-elevated","hover:bg-row-hover",o&&"border-y-ink border-r-ink bg-row-selected",rs(e),ls[e.state],r&&os[r]),style:{left:s,top:i,width:Ne,height:wt},children:[t.jsxs("button",{type:"button","data-mesh-device-open":e.id,"data-mesh-reach":w,"aria-label":f,title:Nt(e),onClick:()=>N(e.id),className:_("flex w-full flex-col justify-between rounded-t-[5px] px-3 pt-2 pb-2 text-left","cursor-pointer","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-[-2px]"),style:{height:jt},children:[t.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[t.jsx(Je,{"aria-hidden":"true",className:"size-4 shrink-0 text-ink-muted"}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-ink",children:e.label}),e.suspect&&t.jsx(ye,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-danger"})]}),t.jsxs("span",{className:"flex w-full min-w-0 items-baseline gap-1",children:[t.jsx("span",{className:"w-3 shrink-0 font-mono text-body-sm text-ink tabular-nums",children:e.sessionCount??"–"}),t.jsx("span",{className:_("min-w-0 truncate text-meta",e.sessionCount===null?"text-ink-dim":"text-ink-muted"),children:we(e.sessionCount)})]}),t.jsxs("span",{"data-mesh-state-line":"",className:"flex w-full min-w-0 items-baseline gap-1.5 text-meta",children:[t.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-ink-dim",children:yt[w]}),t.jsx("span",{className:_("shrink-0",Be[w]),children:ce(w)}),p&&t.jsx("span",{"data-mesh-working":"",className:"shrink-0 text-info",children:"working"}),e.memberships.length>1&&t.jsxs("span",{className:"min-w-0 truncate text-ink-dim",children:["· ",e.memberships.length," networks"]})]})]}),t.jsxs("ul",{"aria-label":`Conversations on ${e.label}`,className:_("m-0 flex h-6 list-none items-center gap-1 overflow-hidden px-3",r==="accept"&&"opacity-40"),children:[c.shown.map(m=>t.jsx(hs,{session:m,ownerLabel:e.label,ownerReach:w,ownerReachable:e.reachable,moving:g===m.id,dragging:v===m.id,onPointerDown:y,onClick:()=>I(m)},m.id)),c.hidden>0&&t.jsx("li",{className:"shrink-0",children:t.jsxs("button",{type:"button","data-mesh-more":e.id,onClick:()=>l(e.id),className:_("flex min-h-6 items-center rounded-sm px-1.5 text-meta text-ink-dim","hover:bg-row-hover hover:text-ink","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"),title:`Showing ${c.shown.length} of ${h} conversations`,"aria-label":`Show all ${h} conversations`,children:["+",c.hidden]})})]})]})},hs=({session:e,ownerLabel:s,ownerReach:i,ownerReachable:a,moving:o,dragging:c,onPointerDown:h,onClick:r})=>{const g=Ge(e,s,i);return o?t.jsx("li",{role:"status","data-mesh-session":e.id,"data-mesh-moving":"true",children:t.jsx("span",{className:"flex min-h-6 items-center rounded-sm bg-sunken px-1.5 text-meta text-ink-muted",children:"moving…"})}):t.jsx("li",{className:"min-w-0 flex-1","data-mesh-session-item":e.id,"data-mesh-dragging":c?"true":void 0,children:t.jsx("button",{type:"button","data-mesh-session":e.id,style:{touchAction:"none"},title:`${ee(e)} · ${g}`,"aria-label":`${ee(e)}, ${g}. Opens ${s}.`,onPointerDown:v=>h(v,e),onClick:()=>r(e),className:_("flex min-h-6 w-full max-w-32 items-center rounded-sm border border-hairline bg-surface px-1.5 text-left text-meta text-ink-muted","cursor-grab active:cursor-grabbing","hover:text-ink",cs[It(e,a)],c&&"opacity-60","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"),children:t.jsx("span",{className:"min-w-0 flex-1 truncate",children:ee(e)})})})};function _e(e){const s=e.trim();if(!s)return null;if(s.startsWith("[")){const a=s.indexOf("]");if(a<=1)return null;const o=s.slice(1,a),c=s.slice(a+1);if(!c)return{host:o,port:null};if(!c.startsWith(":"))return null;const h=Number(c.slice(1));return{host:o,port:Number.isInteger(h)?h:null}}const i=s.lastIndexOf(":");if(i>0){const a=s.slice(i+1);if(/^\d+$/.test(a))return{host:s.slice(0,i),port:Number(a)}}return{host:s,port:null}}function Re(e){const s=e.trim().split(".");if(s.length!==4)return null;for(const i of s)if(!/^\d{1,3}$/.test(i)||Number(i)>255)return null;return`${s[0]}.${s[1]}.${s[2]}`}function ps(e){return`${e}.x`}function xs(e){const s=new Map;for(const a of e.values())for(const o of a)s.set(o,(s.get(o)??0)+1);const i=new Set;for(const[a,o]of s)o>1&&i.add(a);return i}function ke(e){return new Set(e.endpoints.map(s=>s.trim()).filter(Boolean))}function fs(e,s){const i=e.filter(l=>l.id!==s),a=e.find(l=>l.id===s)??null,o=new Map;for(const l of e)o.set(l.id,ke(l));const c=xs(o),h=new Set;for(const l of a?ke(a):[]){if(c.has(l))continue;const d=_e(l),p=d?Re(d.host):null;p&&h.add(p)}const r=l=>{const d=new Set;for(const p of ke(l)){if(c.has(p))continue;const f=_e(p),w=f?Re(f.host):null;w&&d.add(w)}return d},g=new Map,v=new Map;for(const l of i){const d=gs(l);if(d){g.set(d,[...g.get(d)??[],l.id]);continue}for(const p of r(l))v.set(p,[...v.get(p)??[],l.id])}const N=new Map(e.map((l,d)=>[l.id,d])),y=l=>[...l].sort((d,p)=>(N.get(d)??0)-(N.get(p)??0)),I=[];for(const[l,d]of g)I.push({prefix:l,tier:"declared",deviceIds:y(d),words:"declared"});for(const[l,d]of v)h.has(l)?I.push({prefix:l,tier:"shared",deviceIds:y(d),words:"shared with this device"}):d.length>1&&I.push({prefix:l,tier:"probable",deviceIds:y(d),words:"same prefix"});return I.sort((l,d)=>l.tier.localeCompare(d.tier)||l.prefix.localeCompare(d.prefix))}function gs(e){for(const s of e.memberships){const i=s.scope.trim();if(i)return i}return""}const $e={declared:0,shared:1,probable:2};function bs(e,s){const i=new Map;for(const o of e){let c=null;for(const r of o.deviceIds){const g=s.get(r);g!==void 0&&(c===null||g<c.slot)&&(c={id:r,slot:g})}if(c===null)continue;const h=i.get(c.id);h===void 0?i.set(c.id,{slot:c.slot,groups:[o]}):h.groups.push(o)}const a=o=>{let c=-1;for(const h of o.deviceIds){const r=s.get(h);r!==void 0&&r>c&&(c=r)}return c};return[...i.entries()].sort((o,c)=>o[1].slot-c[1].slot).map(([o,c])=>({deviceId:o,groups:c.groups.sort((h,r)=>a(r)-a(h)||$e[h.tier]-$e[r.tier]||h.prefix.localeCompare(r.prefix))}))}function vs(e){return new Map(e.map(s=>[s.deviceId,s.groups.length]))}function ks(e){return`${e.tier==="declared"?e.prefix:ps(e.prefix)} · ${e.words}`}const Le=(e,s)=>e.deviceIds.map(i=>s.devices.get(i)).filter(i=>i!==void 0),ws=({stacks:e,geometry:s})=>t.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute top-0 left-0",children:e.map(i=>{const a=i.groups.length,o=new Array(a).fill(0);let c=null;for(let r=a-1;r>=0;r-=1){const g=Le(i.groups[r],s),v=(g.length===0?0:Math.max(...g.map(N=>N.y+N.height)))+he;c=c===null?v:Math.max(v,c+be),o[r]=c}const h=s.devices.get(i.deviceId);return i.groups.map((r,g)=>{const v=Le(r,s);if(v.length===0)return null;const N=a-1-g,y=Math.min(...v.map(w=>w.x)),I=Math.max(...v.map(w=>w.x)),d=(h?.y??Math.min(...v.map(w=>w.y)))-he-Ct*N,p=r.tier==="declared",f=ks(r);return t.jsx("div",{"data-mesh-scope":`${r.tier}:${r.prefix}`,"data-mesh-scope-level":g,className:_("absolute rounded-lg",r.tier==="probable"?"border border-dashed border-hairline-strong":"border border-control"),style:{left:y-he-be*N,top:d,width:I+Ne-y+(he+be*N)*2,height:o[g]-d},children:t.jsx("span",{"data-mesh-scope-label":"",className:_("absolute bottom-full left-1 mb-0.5 whitespace-nowrap text-meta",r.tier==="probable"?"text-ink-dim":"text-ink-muted",p&&"font-medium"),children:f})},`${r.tier}:${r.prefix}`)})})}),Pe=48,Te=1.25,js=.0015,Ns=({graph:e,slots:s,nowSeconds:i,selectedDeviceId:a,sessions:o,sessionTotals:c,movingSessionId:h,canMove:r,onOpenDevice:g,onAskMove:v,onDropRefused:N,onShowAllSessions:y,summaryId:I})=>{const l=x.useRef(null),[d,p]=x.useState({width:0,height:0,clipWidth:0,clipHeight:0,left:0,top:0}),[f,w]=x.useState({k:1,tx:0,ty:0}),m=x.useRef(!1),S=x.useRef(!1),D=x.useRef(null),P=x.useMemo(()=>fs(e.devices,e.selfDeviceId),[e.devices,e.selfDeviceId]),C=x.useMemo(()=>bs(P,s.devices),[P,s]),M=x.useMemo(()=>St(s,vs(C)),[s,C]),B=x.useMemo(()=>({selfDeviceId:e.selfDeviceId,devices:new Map(e.devices.map(n=>[n.id,n])),networks:new Map(e.networks.map(n=>[n.id,n]))}),[e]),[j,W]=x.useState(fe),te=x.useRef({kind:"ground"}),z=x.useCallback((n,u)=>{const b=document.elementFromPoint(n,u),E=b?.closest("[data-mesh-device]");if(E){const G=E.getAttribute("data-mesh-device");if(G)return{kind:"device",deviceId:G}}const O=b?.closest("[data-mesh-network]");if(O){const G=O.getAttribute("data-mesh-network");if(G)return{kind:"network",networkId:G}}return{kind:"ground"}},[]),L=x.useMemo(()=>j.kind!=="dragging"&&j.kind!=="settling"?null:xe(j.payload,j.target,B),[j,B]),se=x.useCallback(n=>{if(!L)return null;if(L.kind==="plan"){const u=j.kind==="dragging"||j.kind==="settling"?j.target:null;return u&&u.kind==="device"&&u.deviceId===n?"accept":null}if(L.kind==="refused"){const u=j.kind==="dragging"||j.kind==="settling"?j.target:null;return u&&u.kind==="device"&&u.deviceId===n?"refuse":null}return null},[L,j]),ne=x.useCallback((n,u)=>{if(!r||n.button!==0)return;S.current=!1;const b=u.locality==="local"?e.selfDeviceId??"":u.owner_device,E=B.devices.get(b),O={session:u,ownerDeviceId:b,ownerLabel:E?.label??u.owner_device_name};try{n.currentTarget.setPointerCapture(n.pointerId)}catch{}W(G=>Q(G,{kind:"press",payload:O,x:n.clientX,y:n.clientY,pointerId:n.pointerId}))},[r,B,e.selfDeviceId]),ie=n=>{if(j.kind==="pressing"||j.kind==="dragging"){const u=z(n.clientX,n.clientY);te.current=u,W(b=>Q(b,{kind:"move",x:n.clientX,y:n.clientY,target:u}));return}ue(n)},re=n=>{if(J(n),j.kind!=="pressing"&&j.kind!=="dragging")return;if(j.kind==="pressing"){W(b=>Q(b,{kind:"cancel"}));return}const u=xe(j.payload,j.target,B);S.current=!0,W(b=>Q(b,{kind:"release"})),u.kind==="plan"?v({plan:u.plan,alternatives:u.alternatives,risky:u.risky}):u.kind==="refused"&&N({code:u.code,sentence:u.sentence,remedy:u.remedy,plan:u.plan??null}),W(b=>Q(b,{kind:"settled"}))};x.useEffect(()=>()=>W(fe),[]);const Z=x.useCallback(()=>{w(Ae(M.bounds,d))},[M.bounds,d]);x.useEffect(()=>{const n=l.current;if(!n)return;const u=()=>{const E=n.getBoundingClientRect();p({width:E.width,height:E.height,clipWidth:n.clientWidth,clipHeight:n.clientHeight,left:E.left,top:E.top})};u();const b=new ResizeObserver(u);return b.observe(n),()=>b.disconnect()},[]),x.useEffect(()=>{m.current||d.width<=0||d.height<=0||(m.current=!0,w(Ae(M.bounds,d)))},[d,M.bounds]),x.useEffect(()=>{const n=D.current;if(D.current={width:d.width,height:d.height},!n||!m.current||d.width<=0||d.height<=0||d.width>=n.width&&d.height>=n.height||!a)return;const u=M.devices.get(a);u&&w(b=>{const E={width:d.clipWidth,height:d.clipHeight},O=Math.max(0,Math.min(E.width-M.bounds.width*b.k,E.height-M.bounds.height*b.k));return Mt(b,u,E,Math.min(At,O))})},[d,a,M]);const F=j.kind==="dragging"?{x:j.x-d.left+12,y:j.y-d.top+12}:{x:0,y:0},K=L?Dt(L):null,k=x.useRef(null),A=x.useRef(null),$=x.useRef(null),T=x.useRef(null),R=x.useCallback(()=>{$.current=null;const n=k.current,u=A.current;if(k.current=null,A.current=null,n){const b=T.current;if(!b)return;w({k:b.transform.k,tx:b.transform.tx+(n.x-b.x),ty:b.transform.ty+(n.y-b.y)});return}u&&w(b=>ve(b,{x:u.x,y:u.y},b.k*Math.exp(-u.deltaY*js)))},[]),Y=x.useCallback(()=>{$.current===null&&($.current=requestAnimationFrame(R))},[R]);x.useEffect(()=>()=>{$.current!==null&&cancelAnimationFrame($.current)},[]);const q=n=>{!(n.target===n.currentTarget)&&n.button!==1||n.button!==0&&n.button!==1||(T.current={x:n.clientX,y:n.clientY,transform:f},n.currentTarget.setPointerCapture(n.pointerId),n.preventDefault())},ue=n=>{T.current&&(k.current={x:n.clientX,y:n.clientY},Y())},J=n=>{T.current&&(T.current=null,k.current=null,n.currentTarget.hasPointerCapture(n.pointerId)&&n.currentTarget.releasePointerCapture(n.pointerId))},X=x.useCallback(n=>{if(n.deltaY===0)return;n.preventDefault();const u=n.currentTarget.getBoundingClientRect();A.current={x:n.clientX-u.left,y:n.clientY-u.top,deltaY:n.deltaY},Y()},[Y]);x.useEffect(()=>{const n=l.current;if(n)return n.addEventListener("wheel",X,{passive:!1}),()=>n.removeEventListener("wheel",X)},[X]);const me=n=>{const u=n.shiftKey?Pe*4:Pe;switch(n.key){case"Escape":if(j.kind!=="pressing"&&j.kind!=="dragging")return;n.preventDefault(),j.kind==="dragging"&&(S.current=!0),W(b=>Q(b,{kind:"cancel"}));return;case"0":n.preventDefault(),Z();return;case"+":case"=":n.preventDefault(),w(b=>ve(b,{x:d.width/2,y:d.height/2},b.k*Te));return;case"-":case"_":n.preventDefault(),w(b=>ve(b,{x:d.width/2,y:d.height/2},b.k/Te));return;case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":{n.preventDefault();const b=n.key==="ArrowLeft"?u:n.key==="ArrowRight"?-u:0,E=n.key==="ArrowUp"?u:n.key==="ArrowDown"?-u:0;w(O=>({...O,tx:O.tx+b,ty:O.ty+E}));return}}};return t.jsxs("div",{ref:l,"data-mesh-canvas":"",role:"group","aria-labelledby":I,tabIndex:0,onPointerDown:q,onPointerMove:ie,onPointerUp:re,onPointerCancel:n=>{j.kind==="dragging"&&(S.current=!0),W(u=>Q(u,{kind:"cancel"})),J(n)},"data-mesh-gesture":j.kind,onKeyDown:me,onDoubleClick:n=>{n.target===n.currentTarget&&Z()},className:_("relative min-h-0 flex-1 overflow-hidden rounded-lg border border-hairline bg-sunken","[touch-action:none]","cursor-grab active:cursor-grabbing","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-[-2px]"),children:[t.jsx("div",{"data-mesh-ground":"","aria-hidden":"true",className:"mesh-ground pointer-events-none absolute inset-0",style:{backgroundPosition:`${f.tx}px ${f.ty}px`}}),t.jsxs("div",{"data-mesh-world":"",className:"absolute top-0 left-0",style:{transform:`translate3d(${f.tx}px, ${f.ty}px, 0) scale(${f.k})`,transformOrigin:"0 0",width:M.bounds.width,height:M.bounds.height},children:[t.jsx(ws,{stacks:C,geometry:M}),t.jsx(as,{edges:e.edges,geometry:M,selectedDeviceId:a}),t.jsx("ul",{"aria-label":"Networks",className:"m-0 list-none p-0",children:e.networks.map(n=>{const u=M.networks.get(n.id);return u?t.jsx(us,{network:n,x:u.x,y:u.y,refused:L?.kind==="refused"&&j.kind==="dragging"&&j.target.kind==="network"&&j.target.networkId===n.id},n.id):null})}),t.jsx("ul",{"aria-label":"Devices",className:"m-0 list-none p-0",children:e.devices.map(n=>{const u=M.devices.get(n.id);return u?t.jsx(ms,{device:n,x:u.x,y:u.y,nowSeconds:i,selected:n.id===a,sessions:o.get(n.id)??{rows:[],shown:[],hidden:0},sessionTotal:c.get(n.id)??n.sessionCount??0,dropState:se(n.id),movingSessionId:h,draggedSessionId:ns(j),onOpen:g,onChipPointerDown:ne,onChipClick:()=>{if(S.current){S.current=!1;return}g(n.id)},onShowAllSessions:y},n.id):null})})]}),j.kind==="dragging"&&t.jsx("div",{"data-mesh-ghost":"","aria-hidden":"true",className:"pointer-events-none absolute z-10 max-w-40 truncate rounded-sm border border-ink-dim bg-surface px-1.5 py-0.5 text-meta text-ink",style:{left:F.x,top:F.y},children:j.payload.session.name||"untitled"}),j.kind==="dragging"&&K&&t.jsx("div",{"data-mesh-indicator":"",className:_("pointer-events-none absolute z-10 rounded-sm border bg-surface px-2 py-1 text-meta",L?.kind==="refused"?"border-warning text-warning":"border-control text-ink"),style:{left:F.x,maxWidth:Math.max(160,d.width-F.x-12),...F.y>d.height*.6?{bottom:Math.max(12,d.height-F.y+8)}:{top:F.y+24}},children:K})]})};function ys(e,s,i,a){const o=i.locality==="local"?s:i.owner_device,c=[];for(const h of e)if(h.id!==o){if(h.id===s){c.push({deviceId:h.id,label:a,verb:"Recall to this device",keepVerb:"Copy here, leave it there"});continue}c.push({deviceId:h.id,label:h.label,verb:`Move to ${h.label}`,keepVerb:`Copy to ${h.label}`})}return c}function Is(e,s,i){return ys(e.devices,e.selfDeviceId,s,i)}function Ve(e,s,i){const a=Is(e,s,i),o={selfDeviceId:e.selfDeviceId,devices:new Map(e.devices.map(r=>[r.id,r])),networks:new Map(e.networks.map(r=>[r.id,r]))},c=s.locality==="local"?e.selfDeviceId??"":s.owner_device,h=o.devices.get(c);return a.map(r=>{const g=xe({session:s,ownerDeviceId:c,ownerLabel:h?.label??s.owner_device_name},{kind:"device",deviceId:r.deviceId},o);return{...r,refused:g.kind==="refused"&&g.code!=="busy"?g.sentence:null}})}const Ke=({session:e,destinations:s,disabled:i,onChoose:a,onOpenChange:o,trigger:c,triggerLabel:h})=>t.jsxs(nt,{onOpenChange:o,children:[t.jsx(at,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":h,"data-mesh-session-menu":e.id,disabled:i||s.length===0,className:"rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2 disabled:text-ink-disabled",children:c})}),t.jsxs(it,{align:"start",className:"min-w-56",children:[t.jsx(rt,{children:ee(e)}),t.jsx(Se,{}),s.map(r=>t.jsx(Me,{"data-mesh-move-to":r.deviceId,disabled:!!r.refused,title:r.refused??void 0,onSelect:()=>a(r,!1),children:r.verb},r.deviceId)),t.jsx(Se,{}),s.map(r=>t.jsx(Me,{"data-mesh-copy-to":r.deviceId,disabled:!!r.refused,title:r.refused??void 0,onSelect:()=>a(r,!0),children:r.keepVerb},`keep-${r.deviceId}`))]})]}),Cs=({device:e,sessions:s,sessionTotal:i,nowSeconds:a,destinationsFor:o,movingSessionId:c,canMove:h,canInvite:r,onClose:g,onMove:v,onShowInList:N,onInvite:y,onRemoveMember:I})=>{const l=de(e);x.useEffect(()=>{const m=S=>{S.key!=="Escape"||S.defaultPrevented||S.target?.closest('[role="menu"],[role="dialog"]')||(document.querySelector(`[data-mesh-device-open="${e.id}"]`)?.focus(),g())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[e.id,g]);const d=e.memberships.every(m=>!m.active),p=e.sessionCount===null?we(null):`${e.sessionCount} ${we(e.sessionCount)}`,f=e.suspect?Ye:[d?"revoked membership":p,ce(l)].filter(Boolean).join(" · "),w=i>s.rows.length?`${s.rows.length} of ${i}`:`${s.rows.length}`;return t.jsxs("aside",{"aria-label":`${e.label} details`,"data-mesh-panel":e.id,className:"flex w-80 shrink-0 flex-col gap-3 overflow-y-auto rounded-md border border-hairline bg-surface p-4",children:[t.jsxs("header",{className:"flex flex-col gap-1",children:[t.jsx(U,{size:"sm",variant:"ghost",className:"w-fit self-end","data-mesh-panel-close":"",onClick:g,children:"Close"}),t.jsx("h2",{className:"text-body-sm text-ink",children:e.label}),t.jsxs("p",{className:"flex items-center gap-1.5 text-meta text-ink-muted",children:[e.suspect&&t.jsx(ye,{"aria-hidden":"true",className:"size-3.5 text-danger"}),!e.suspect&&l==="unanswered"&&t.jsx(st,{"aria-hidden":"true",className:"size-3.5 text-warning"}),f]})]}),t.jsx(ae,{}),t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-meta text-ink-dim",children:"Memberships"}),t.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:e.memberships.map(m=>t.jsxs("li",{className:"flex flex-col gap-1",children:[t.jsxs("span",{className:"flex items-center gap-2 text-body-sm text-ink",children:[t.jsx(je,{"aria-hidden":"true",className:"size-3.5 text-ink-muted"}),m.networkName]}),t.jsxs("span",{className:"text-meta text-ink-dim",children:[m.role||"member",m.capabilities.length>0?` · ${m.capabilities.join(", ")}`:"",m.active?"":" · revoked"]}),r&&m.active&&t.jsxs(U,{size:"sm",variant:"ghost",className:"w-fit","data-mesh-remove-member":`${m.networkId}:${e.id}`,onClick:()=>I(e,m.networkId),children:["Remove from ",m.networkName,"…"]})]},m.networkId))}),r&&t.jsx(U,{size:"sm",variant:"secondary",className:"w-fit","data-mesh-invite":e.id,onClick:()=>y(e),children:"Invite to a network…"})]}),t.jsx(ae,{}),t.jsxs("section",{className:"flex shrink-0 flex-col gap-2",children:[t.jsxs("h3",{className:"text-meta text-ink-dim",children:["Conversations ",t.jsxs("span",{className:"text-ink-disabled",children:["(",w,")"]})]}),s.rows.length===0?t.jsx("p",{className:"text-meta text-ink-dim",children:e.sessionCount===null?"This device did not report its conversations.":"No conversations here."}):t.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0",children:s.rows.map(m=>t.jsxs("li",{"data-mesh-panel-session":m.id,className:_("flex items-center gap-2 rounded-sm px-2 py-1","border border-hairline bg-elevated",c===m.id&&"border-control"),children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-ink",title:ee(m),children:ee(m)}),t.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:Ge(m,e.label,de(e))}),c===m.id?t.jsx("span",{className:"shrink-0 text-meta text-ink-muted",children:"moving…"}):t.jsx(Ke,{session:m,destinations:o(m),disabled:!h,onChoose:(S,D)=>v(m,S,D),trigger:t.jsx(He,{"aria-hidden":"true",className:"size-4"}),triggerLabel:`Move ${ee(m)}`})]},m.id))})]}),t.jsx(ae,{}),t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-meta text-ink-dim",children:"Network addresses"}),e.endpoints.length===0?t.jsx("p",{className:"text-meta text-ink-dim",children:"No address published."}):t.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0",children:e.endpoints.map(m=>t.jsxs("li",{className:"flex items-baseline justify-between gap-2",children:[t.jsx("span",{className:"min-w-0 truncate font-mono text-body-sm text-ink",children:m}),t.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:"advertised"})]},m))})]}),t.jsx(ae,{}),t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-meta text-ink-dim",children:"Status"}),t.jsxs("dl",{className:"m-0 flex flex-col gap-1",children:[t.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t.jsx("dt",{className:"text-meta text-ink-dim",children:"Reach"}),t.jsx("dd",{className:"m-0 text-body-sm text-ink",children:ce(l)})]}),t.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t.jsx("dt",{className:"text-meta text-ink-dim",children:"Last status frame"}),t.jsx("dd",{className:"m-0 text-body-sm text-ink",children:e.lastSeenAt===null?"never":Et(a-e.lastSeenAt)})]})]}),e.reason&&t.jsx("p",{className:"text-meta text-warning",children:e.reason})]}),t.jsx(ae,{}),t.jsx(U,{size:"sm",variant:"ghost",className:"w-fit","data-mesh-show-in-list":e.id,onClick:()=>N(e.id),children:"Show in list"})]})},Ss=["name","chats","state"],Ms={name:"Name",chats:"Conversations",state:"State"},Oe={suspect:0,unreachable:1,self:2,reachable:3};function Ds(e,s){const i=[...e];switch(s){case"chats":return i.sort((a,o)=>(o.sessionCount??-1)-(a.sessionCount??-1)||a.label.localeCompare(o.label)),i;case"state":return i.sort((a,o)=>Oe[a.state]-Oe[o.state]||a.label.localeCompare(o.label)),i;default:return i.sort((a,o)=>a.label.localeCompare(o.label))}}const We=8;function As(e,s){if(e.locality==="local")return e.live_state||"here";const i=e.owner_device_name||s,a=e.live_state?` · ${e.live_state}`:"";return e.reachable?`on ${i}${a}`:`on ${i} (not answering)`}const Es=({graph:e,nowSeconds:s,selectedDeviceId:i,sessions:a,selfLabel:o,canMove:c,onSelect:h,onMove:r,onInvite:g,onRemove:v})=>{const[N,y]=x.useState("name"),I=x.useMemo(()=>e.networks.map(l=>({network:l,members:Ds(e.devices.filter(d=>d.memberships.some(p=>p.networkId===l.id)),N)})),[e,N]);return t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pr-1",children:[t.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[t.jsx("legend",{className:"sr-only",children:"Sort devices by"}),t.jsx("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:Ss.map(l=>t.jsx("button",{type:"button","aria-pressed":N===l,onClick:()=>y(l),className:_("h-6 rounded-sm px-3 text-body-sm text-ink-muted transition-colors duration-fast ease-out-quart","hover:text-ink","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",N===l&&"bg-surface text-ink"),children:Ms[l]},l))})]}),I.map(({network:l,members:d})=>t.jsxs("section",{"data-mesh-network-group":l.id,className:"flex flex-col gap-2",children:[t.jsxs("h2",{className:"flex flex-wrap items-baseline gap-2 text-body-sm text-ink",title:`epoch ${l.epoch}`,children:[l.label,t.jsxs("span",{className:"text-meta text-ink-dim",children:[l.trust," · ",l.memberCount," ",l.memberCount===1?"device":"devices",l.revokedCount>0?` · ${l.revokedCount} revoked`:""]})]}),t.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0",children:d.map(p=>{const f=p.memberships.find(C=>C.networkId===l.id),w=p.id===i,m=a.get(p.id),S=m?.rows??[],D=m?Ue(m,p.sessionCount):p.sessionCount??0,P=de(p);return t.jsxs("li",{"data-mesh-device-row":p.id,"data-mesh-state":p.state,"aria-current":w?"true":void 0,className:_("flex flex-col gap-1 rounded-md px-3 py-2","border border-hairline bg-surface",w&&"border-ink bg-row-selected"),children:[t.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[t.jsx("button",{type:"button","data-mesh-device-open":p.id,onClick:()=>h(p.id),className:_("min-w-0 flex-1 truncate text-left text-body-sm text-ink","hover:text-ink-muted","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"),children:p.label}),t.jsxs("span",{className:_("flex shrink-0 items-center gap-1 text-meta",Be[P]),"data-mesh-reach":P,children:[p.suspect&&t.jsx(ye,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-danger"}),p.suspect?ce(P):Fe(p,s),p.suspect&&t.jsx("span",{className:"shrink-0 rounded-sm border border-danger px-1 text-danger",children:Ye})]}),t.jsxs("span",{className:"shrink-0 text-meta text-ink-dim",children:[f?.role?`${f.role} · `:"",f&&!f.active?"revoked":"member"]})]}),S.length>0?t.jsxs(t.Fragment,{children:[t.jsx(ae,{className:"my-1"}),t.jsx("ul",{className:"m-0 flex list-none flex-col gap-0.5 p-0",children:S.slice(0,We).map(C=>t.jsxs("li",{"data-mesh-row-session":C.id,className:"flex items-center gap-2 py-0.5",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-meta text-ink-muted",children:C.name||C.id}),t.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:As(C,o)}),t.jsx(Ke,{session:C,destinations:Ve(e,C,o),disabled:!c,onChoose:(M,B)=>r(C,M,B),trigger:t.jsx(He,{"aria-hidden":"true",className:"size-3.5"}),triggerLabel:`Move ${C.name||C.id}`})]},C.id))}),D>S.slice(0,We).length&&t.jsx("button",{type:"button",onClick:()=>h(p.id),className:"w-fit text-meta text-ink-dim hover:text-ink",children:`show all ${D} in the panel`})]}):t.jsx("span",{className:"text-meta text-ink-dim",children:D===0?"no conversations":D===1?"1 conversation":`${D} conversations`}),(f?.active||p.state!=="self")&&t.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[t.jsx(U,{size:"sm",variant:"ghost","data-mesh-invite":p.id,onClick:()=>g({deviceId:p.id,deviceLabel:p.label}),children:"Invite to a network…"}),f?.active&&t.jsxs(U,{size:"sm",variant:"ghost","data-mesh-remove-member":`${l.id}:${p.id}`,onClick:()=>v({networkId:l.id,networkLabel:l.label,deviceId:p.id,deviceLabel:p.label}),children:["Remove from ",l.label,"…"]})]})]},p.id)})})]},l.id)),e.unmatchedPeers.length>0&&t.jsxs("p",{className:"text-meta text-warning",children:[e.unmatchedPeers.length," ",e.unmatchedPeers.length===1?"device":"devices"," answered the peer read but is in no network this app can name."]})]})},_s=["canvas","list"],Rs={canvas:"Canvas",list:"List"},$s=({state:e,graph:s,nowSeconds:i,checking:a,staleError:o,onRetry:c,approvals:h,sessions:r,sessionError:g,selfLabel:v,movingSessionId:N,canMove:y,pendingMove:I,onAskMove:l,onDropRefused:d,onChooseMove:p,onCancelMove:f,moveBusy:w,moveReport:m,onDismissReport:S,onWaitForIdle:D,onUndoCopy:P,invite:C,onOpenInvite:M,onInvite:B,onCloseInvite:j,inviteBusy:W,inviteReceipt:te,inviteRefusal:z,remove:L,onOpenRemove:se,onRemove:ne,onCloseRemove:ie,removeBusy:re,removeRefusal:Z,removed:F})=>{const[K,k]=x.useState("canvas"),[A,$]=x.useState(null),T=s?_t(s):"",R="mesh-summary",Y=Rt(s),q=$t(s,r,s?.selfDeviceId??null),ue=x.useMemo(()=>{const n=new Map;for(const u of s?.devices??[]){const b=q.byDevice.get(u.id);n.set(u.id,b?Ue(b,u.sessionCount):u.sessionCount??0)}return n},[s,q]),J=x.useCallback(n=>{$(n)},[]),X=s?s.devices.find(n=>n.id===A)??null:null,me=x.useCallback((n,u,b)=>{if(!s)return null;const E={selfDeviceId:s.selfDeviceId,devices:new Map(s.devices.map(V=>[V.id,V])),networks:new Map(s.networks.map(V=>[V.id,V]))},O=n.locality==="local"?s.selfDeviceId??"":n.owner_device,G=E.devices.get(O),H=xe({session:n,ownerDeviceId:O,ownerLabel:G?.label??n.owner_device_name},{kind:"device",deviceId:u.deviceId},E);if(H.kind==="refused")return d({code:H.code,sentence:H.sentence,remedy:H.remedy,plan:H.plan??null}),null;if(H.kind==="none")return null;const Ie=b?H.alternatives.find(V=>V.keep)??H.plan:H.plan,Xe=[H.plan,...H.alternatives].filter(V=>V.keep!==Ie.keep),Ze={plan:Ie,alternatives:Xe,risky:H.risky};l(Ze)},[s,l,d]);return t.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-6 overflow-y-auto p-6",children:[t.jsx(tt,{title:"Mesh",icon:je,subtitle:"Devices this app is paired with, and the networks that hold them.",children:t.jsxs("div",{className:"flex items-center gap-4",children:[a&&t.jsx("output",{className:"text-meta text-ink-dim",children:"checking…"}),(e.kind==="ready"||e.kind==="loading")&&t.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[t.jsx("legend",{className:"sr-only",children:"Presentation"}),t.jsx("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:_s.map(n=>t.jsx("button",{type:"button","aria-pressed":K===n,disabled:e.kind!=="ready",onClick:()=>k(n),className:_("h-6 rounded-sm px-3 text-body-sm text-ink-muted transition-colors duration-fast ease-out-quart","hover:text-ink","focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2","disabled:text-ink-dim disabled:hover:text-ink-dim",K===n&&"bg-surface text-ink"),children:Rs[n]},n))})]})]})}),t.jsx(ts,{rows:h.rows,error:h.error,pending:h.pending,refusal:h.decisionRefusal,onDecide:h.onDecide,onRetry:h.onRetry,nowSeconds:h.nowSeconds,networkNames:new Map((s?.networks??[]).map(n=>[n.id,n.label]))}),e.kind==="loading"&&t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[t.jsx(De,{className:"h-4 w-64"}),t.jsx(De,{className:"min-h-40 w-full flex-1"})]}),e.kind==="error"&&t.jsxs(pe,{variant:"warning",className:"flex-col items-start gap-2",children:[t.jsx("p",{children:e.message}),t.jsx(U,{variant:"secondary",size:"sm",onClick:c,className:"w-fit",children:"Ask again"})]}),e.kind==="empty"&&t.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center rounded-lg border border-hairline bg-surface p-6",children:t.jsxs("div",{className:"flex flex-col items-start gap-3",children:[t.jsx("h2",{className:"text-heading text-ink",children:"No network on this device"}),t.jsx("p",{className:"max-w-140 text-body-sm text-ink-muted",children:"This device is not in any network, so there is no mesh to draw. Create one on this machine:"}),t.jsx("code",{className:"rounded-sm bg-sunken px-2 py-1 font-mono text-meta text-ink",children:"lop network init <name>"}),t.jsx("p",{className:"text-meta text-ink-dim",children:"A network appears here once this device has joined one."})]})}),e.kind==="ready"&&s&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex min-h-[22rem] flex-1 gap-4",children:[t.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3",children:[t.jsx("p",{id:R,className:"text-meta text-ink-muted","data-mesh-summary":"",children:T}),o&&t.jsx(pe,{variant:"warning",children:t.jsx("p",{children:o})}),g&&t.jsx(pe,{variant:"warning",children:t.jsx("p",{children:g})}),m&&t.jsx(Lt,{receipt:m.kind==="moved"?{verb:m.verb,detail:m.detail,undo:m.undo}:null,refusal:m.kind==="refused"?m.refusal:null,canWait:m.kind==="refused"&&m.plan!==null,onWait:D,onRecheck:c,onUndo:P,onDismiss:S,pending:w}),K==="canvas"?t.jsx(Ns,{graph:s,slots:Y,nowSeconds:i,selectedDeviceId:A,sessions:q.byDevice,sessionTotals:ue,movingSessionId:N,canMove:y,onOpenDevice:J,onAskMove:l,onDropRefused:d,onShowAllSessions:J,summaryId:R}):t.jsx(Es,{graph:s,nowSeconds:i,selectedDeviceId:A,sessions:q.byDevice,selfLabel:v,canMove:y,onSelect:J,onMove:me,onInvite:M,onRemove:se})]}),X&&t.jsx(Cs,{device:X,sessions:q.byDevice.get(X.id)??{rows:[],shown:[],hidden:0},sessionTotal:ue.get(X.id)??0,nowSeconds:i,canMove:y,canInvite:e.kind==="ready",movingSessionId:N,destinationsFor:n=>Ve(s,n,v),onClose:()=>$(null),onMove:me,onInvite:n=>M({deviceId:n.id,deviceLabel:n.label}),onRemoveMember:(n,u)=>{const b=s.networks.find(E=>E.id===u);se({networkId:u,networkLabel:b?.label??u,deviceId:n.id,deviceLabel:n.label})},onShowInList:n=>{J(n),k("list")}})]})}),t.jsx(Pt,{open:I!==null,plan:I?.plan??Ls,alternatives:I?.alternatives??[],risky:I?.risky??!1,busy:w,onCancel:f,onChoose:p}),C&&t.jsx(Tt,{open:C.open,options:C.options,deviceId:C.deviceId,deviceLabel:C.deviceLabel,onClose:j,onInvite:B,pending:W,receipt:te,refusal:z}),L&&t.jsx(Ot,{open:L.open,networkLabel:L.networkLabel,deviceLabel:L.deviceLabel,onClose:ie,onConfirm:ne,pending:re,refusal:Z,removed:F})]})},Ls={sessionId:"",to:"",keep:!1,verb:"",waitS:0,lost:null},Ys=()=>{const e=Qe(),s=ge(e.data,"peers")==="enabled",i=ge(e.data,"session_transfer")==="enabled",a=Wt(s),o=zt(s),c=Ht(s,{poll:!1,stamp:()=>Ce.getState().beginAnswer()}),h=x.useMemo(()=>({peers:a,networks:o}),[a,o]),r=Bt(h),g=Ft(h),v=Yt(),N=ge(e.data,"approvals")==="enabled",y=Ut(s&&N,{poll:!1}),I=qt(),l=I.isError?{approvalId:I.variables?.approvalId??null,...Gt(I.error)}:null,d=x.useMemo(()=>Math.floor((y.dataUpdatedAt||Date.now())/1e3),[y.dataUpdatedAt]),p=Ce(k=>k.settlePlacement),f=Vt(),w=Kt(),[m,S]=x.useState(null),[D,P]=x.useState(null),[C,M]=x.useState(null),[B,j]=x.useState(null),[W,te]=x.useState(null),[z,L]=x.useState(null),[se,ne]=x.useState(null),ie=x.useMemo(()=>{const k=Math.max(a.dataUpdatedAt,o.dataUpdatedAt);return Math.floor((k||Date.now())/1e3)},[a.dataUpdatedAt,o.dataUpdatedAt]),re=x.useCallback(()=>{a.refetch(),o.refetch(),c.refetch()},[a,o,c]),Z=x.useCallback((k,A)=>{S(null);const $={sessionId:k.sessionId,to:k.to,keep:k.keep,waitS:A??k.waitS};v.mutate($,{onSuccess:T=>{if(T.kind==="moved"){const{receipt:R}=T;p(k.sessionId,R);const Y=R.locality==="local"?"this device":g?.devices.find(q=>q.id===R.owner_device)?.label??R.owner_device;P({kind:"moved",verb:R.mode==="keep"?"Copied":"Moved",detail:R.mode==="keep"?`${Y} holds a copy as ${R.new_session_id.slice(-6)}; the original is still here.`:`${Y} holds it now${R.source_retired?"; the copy here is gone":""}.`,undo:R.mode==="keep"?{sessionId:R.new_session_id,to:"local",keep:!1,verb:`Bring the copy back from ${Y}`,waitS:0,lost:Xt(Y,"this device")}:null});return}P({kind:"refused",refusal:T.refusal,plan:k})},onError:()=>{P({kind:"refused",refusal:{code:"move_failed",sentence:"The move could not be sent. Nothing here changed; the list has been read again.",status:null,unconfirmed:!1},plan:k})}})},[g,v,p]),F=x.useMemo(()=>{if(!g)return[];const k=C?.deviceId,A=k?g.devices.find($=>$.id===k):void 0;return g.networks.filter($=>{if(!A)return!0;const T=A.memberships.find(R=>R.networkId===$.id);return!T||!T.active}).map($=>({id:$.id,label:$.label}))},[g,C]);if(!s)return t.jsx(et,{to:"/chat",replace:!0});const K=r.kind==="ready"?a.error?le(a.error):o.error?le(o.error):null:null;return t.jsx($s,{state:r,graph:g,nowSeconds:ie,checking:a.isFetching||o.isFetching,staleError:K,onRetry:re,approvals:{rows:y.data??[],error:y.isError?Zt(y.error):null,pending:I.isPending?I.variables??null:null,decisionRefusal:l,onDecide:(k,A)=>I.mutate({approvalId:k,decision:A}),onRetry:()=>void y.refetch(),nowSeconds:d},sessions:c.data?.rows??[],movingSessionId:v.isPending?v.variables?.sessionId??null:null,sessionError:c.isError?le(c.error):null,selfLabel:g?.devices.find(k=>k.state==="self")?.label??"this device",canMove:i,pendingMove:m,onAskMove:S,onDropRefused:k=>P({kind:"refused",refusal:{code:k.code,sentence:k.sentence,status:null,unconfirmed:!1},plan:k.plan}),onChooseMove:k=>Z(k),onCancelMove:()=>S(null),moveBusy:v.isPending,moveReport:D,onDismissReport:()=>P(null),onWaitForIdle:()=>{D?.kind!=="refused"||!D.plan||Z(D.plan,Ps)},onUndoCopy:()=>{D?.kind!=="moved"||!D.undo||S({plan:D.undo,alternatives:[],risky:!1})},invite:C===null?null:{open:!0,deviceId:C.deviceId,deviceLabel:C.deviceLabel,options:F},onOpenInvite:k=>{j(null),te(null),M(k)},onInvite:k=>{f.mutate(k,{onSuccess:A=>j(A),onError:A=>te({code:"invite_refused",sentence:le(A),status:null,unconfirmed:!1})})},onCloseInvite:()=>M(null),inviteBusy:f.isPending,inviteReceipt:B,inviteRefusal:W,remove:z===null?null:{open:!0,networkId:z.networkId,networkLabel:z.networkLabel,deviceId:z.deviceId,deviceLabel:z.deviceLabel},onOpenRemove:k=>{ne(null),L(k)},onRemove:k=>{z&&w.mutate({networkId:z.networkId,deviceId:z.deviceId,confirm:k},{onSuccess:A=>ne(A)})},onCloseRemove:()=>L(null),removeBusy:w.isPending,removeRefusal:w.isError?{code:"remove_refused",sentence:le(w.error),status:null,unconfirmed:!1}:null,removed:se})},Ps=300;export{Ys as MeshPage,$s as MeshSurface,Ys as default};
@@ -1,4 +1,4 @@
1
- import{r as d,j as t,c as $}from"./index-D_Ya8nt7.js";import{bU as _a,bV as Yt,bW as Ca,bX as gn,u as bn,bY as Ea,bZ as Ra,b_ as Da,b$ as Aa,c0 as Oa,c1 as $a,c2 as Cs,c3 as Es,c4 as Pa,c5 as Ma,aF as os,aM as Oe,d as ce,c6 as Ia,aG as ls,c7 as La,c8 as Fa,c9 as qa,ca as Ua,cb as Ue,cc as Ba,T as Et,cd as Rs,ce as Ds,cf as As,bG as Ya,aN as ve,cg as za,ch as $e,a as Ge,b as fe,aY as Ha,aP as Rt,av as ct,aT as Be,ci as Wa,cj as Ka,ck as Ga,cl as Va,cm as Qa,aV as jn,aU as yt,cn as zt,a$ as Xa,aq as Ja,ag as vt,bb as Za,ba as er,b7 as Os,co as tr,cp as sr,cq as nr,cr as ar,cs as rr,ct as ir,cu as yn,aO as or,aw as le,af as lr,aa as cr,ab as dr,ad as ur,ae as mr,ah as fr,an as hr,cv as pr,cw as vn,bf as xr,cx as gr,ap as br,aQ as jr,aZ as yr}from"./conversation-input-sync-DeCSVDem.js";import{P as $s}from"./page-header-cUi3kof4.js";import{c as Ve,s as Ye,f as cs,t as ze,u as He,v as We,w as Te,B as U,D as kn,k as wn,S as ke,l as Nn,o as st,_ as vr,$ as kr,a0 as wr,a1 as Nr,a2 as Sr,n as Tr,r as pe,U as ds,a3 as us,W as ms,I as ne,X as Dt,C as fs,T as Sn,L as ie,y as Tn,Y as _n,A as Ht,M as _r,N as Cr,O as Er,P as Rr,e as Le}from"./error-boundary-sr-ahxTS.js";import{aN as Cn,aT as Dr,aU as En,aV as Ar,ax as Or,an as rt,aW as $r,A as Ps,aX as Ms,aY as Pr}from"./index-D5IE_EgY.js";import{u as Mr}from"./use-session-snapshot-CW8M_OHU.js";import"./ui-preferences-store-DApxrOwj.js";import"./console-mirror-D_HrghW0.js";function Is(e,s){return e.filter(n=>!s.includes(n))}function Ir(e,s,n){const a=e.slice(0);return a[s]=n,a}var Lr=class extends _a{#n;#e;#a;#r;#t;#s;#i;#o;#l=[];constructor(e,s,n){super(),this.#n=e,this.#r=n,this.#a=[],this.#t=[],this.#e=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(e=>{e.subscribe(s=>{this.#m(e,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(e=>{e.destroy()})}setQueries(e,s){this.#a=e,this.#r=s,Yt.batch(()=>{const n=this.#t,a=this.#u(this.#a);this.#l=a,a.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const r=a.map(o=>o.observer),i=r.map(o=>o.getCurrentResult()),l=r.some((o,c)=>o!==n[c]);n.length===r.length&&!l||(this.#t=r,this.#e=i,this.hasListeners()&&(Is(n,r).forEach(o=>{o.destroy()}),Is(r,n).forEach(o=>{o.subscribe(c=>{this.#m(o,c)})}),this.#f()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(e=>e.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(e,s){const n=this.#u(e),a=n.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[a,r=>this.#d(r??a,s),()=>this.#c(a,n)]}#c(e,s){return s.map((n,a)=>{const r=e[a];return n.defaultedQueryOptions.notifyOnChangeProps?r:n.observer.trackResult(r,i=>{s.forEach(l=>{l.observer.trackProp(i)})})})}#d(e,s){return s?((!this.#s||this.#e!==this.#o||s!==this.#i)&&(this.#i=s,this.#o=this.#e,this.#s=Ca(this.#s,s(e))),this.#s):e}#u(e){const s=new Map(this.#t.map(a=>[a.options.queryHash,a])),n=[];return e.forEach(a=>{const r=this.#n.defaultQueryOptions(a),i=s.get(r.queryHash);i?n.push({defaultedQueryOptions:r,observer:i}):n.push({defaultedQueryOptions:r,observer:new gn(this.#n,r)})}),n}#m(e,s){const n=this.#t.indexOf(e);n!==-1&&(this.#e=Ir(this.#e,n,s),this.#f())}#f(){if(this.hasListeners()){const e=this.#s,s=this.#c(this.#e,this.#l),n=this.#d(s,this.#r?.combine);e!==n&&Yt.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}};function Fr({queries:e,...s},n){const a=bn(n),r=Ea(),i=Ra(),l=d.useMemo(()=>e.map(v=>{const g=a.defaultQueryOptions(v);return g._optimisticResults=r?"isRestoring":"optimistic",g}),[e,a,r]);l.forEach(v=>{Da(v),Aa(v,i)}),Oa(i);const[o]=d.useState(()=>new Lr(a,l,s)),[c,m,u]=o.getOptimisticResult(l,s.combine),h=!r&&s.subscribed!==!1;d.useSyncExternalStore(d.useCallback(v=>h?o.subscribe(Yt.batchCalls(v)):$a,[o,h]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),d.useEffect(()=>{o.setQueries(l,s)},[l,s,o]);const f=c.some((v,g)=>Cs(l[g],v))?c.flatMap((v,g)=>{const x=l[g];if(x){const y=new gn(a,x);if(Cs(x,v))return Es(x,y,i);Pa(v,r)&&Es(x,y,i)}return[]}):[];if(f.length>0)throw Promise.all(f);const j=c.find((v,g)=>{const x=l[g];return x&&Ma({result:v,errorResetBoundary:i,throwOnError:x.throwOnError,query:a.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(j?.error)throw j.error;return m(u())}/**
1
+ import{r as d,j as t,c as $}from"./index-D_Ya8nt7.js";import{bU as _a,bV as Yt,bW as Ca,bX as gn,u as bn,bY as Ea,bZ as Ra,b_ as Da,b$ as Aa,c0 as Oa,c1 as $a,c2 as Cs,c3 as Es,c4 as Pa,c5 as Ma,aF as os,aM as Oe,d as ce,c6 as Ia,aG as ls,c7 as La,c8 as Fa,c9 as qa,ca as Ua,cb as Ue,cc as Ba,T as Et,cd as Rs,ce as Ds,cf as As,bG as Ya,aN as ve,cg as za,ch as $e,a as Ge,b as fe,aY as Ha,aP as Rt,av as ct,aT as Be,ci as Wa,cj as Ka,ck as Ga,cl as Va,cm as Qa,aV as jn,aU as yt,cn as zt,a$ as Xa,aq as Ja,ag as vt,bb as Za,ba as er,b7 as Os,co as tr,cp as sr,cq as nr,cr as ar,cs as rr,ct as ir,cu as yn,aO as or,aw as le,af as lr,aa as cr,ab as dr,ad as ur,ae as mr,ah as fr,an as hr,cv as pr,cw as vn,bf as xr,cx as gr,ap as br,aQ as jr,aZ as yr}from"./conversation-input-sync-DeCSVDem.js";import{P as $s}from"./page-header-cUi3kof4.js";import{c as Ve,s as Ye,f as cs,t as ze,u as He,v as We,w as Te,B as U,D as kn,k as wn,S as ke,l as Nn,o as st,_ as vr,$ as kr,a0 as wr,a1 as Nr,a2 as Sr,n as Tr,r as pe,U as ds,a3 as us,W as ms,I as ne,X as Dt,C as fs,T as Sn,L as ie,y as Tn,Y as _n,A as Ht,M as _r,N as Cr,O as Er,P as Rr,e as Le}from"./error-boundary-sr-ahxTS.js";import{aN as Cn,aT as Dr,aU as En,aV as Ar,ax as Or,an as rt,aW as $r,A as Ps,aX as Ms,aY as Pr}from"./index-CpQRStsc.js";import{u as Mr}from"./use-session-snapshot-CW8M_OHU.js";import"./ui-preferences-store-DApxrOwj.js";import"./console-mirror-D_HrghW0.js";function Is(e,s){return e.filter(n=>!s.includes(n))}function Ir(e,s,n){const a=e.slice(0);return a[s]=n,a}var Lr=class extends _a{#n;#e;#a;#r;#t;#s;#i;#o;#l=[];constructor(e,s,n){super(),this.#n=e,this.#r=n,this.#a=[],this.#t=[],this.#e=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(e=>{e.subscribe(s=>{this.#m(e,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(e=>{e.destroy()})}setQueries(e,s){this.#a=e,this.#r=s,Yt.batch(()=>{const n=this.#t,a=this.#u(this.#a);this.#l=a,a.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const r=a.map(o=>o.observer),i=r.map(o=>o.getCurrentResult()),l=r.some((o,c)=>o!==n[c]);n.length===r.length&&!l||(this.#t=r,this.#e=i,this.hasListeners()&&(Is(n,r).forEach(o=>{o.destroy()}),Is(r,n).forEach(o=>{o.subscribe(c=>{this.#m(o,c)})}),this.#f()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(e=>e.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(e,s){const n=this.#u(e),a=n.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[a,r=>this.#d(r??a,s),()=>this.#c(a,n)]}#c(e,s){return s.map((n,a)=>{const r=e[a];return n.defaultedQueryOptions.notifyOnChangeProps?r:n.observer.trackResult(r,i=>{s.forEach(l=>{l.observer.trackProp(i)})})})}#d(e,s){return s?((!this.#s||this.#e!==this.#o||s!==this.#i)&&(this.#i=s,this.#o=this.#e,this.#s=Ca(this.#s,s(e))),this.#s):e}#u(e){const s=new Map(this.#t.map(a=>[a.options.queryHash,a])),n=[];return e.forEach(a=>{const r=this.#n.defaultQueryOptions(a),i=s.get(r.queryHash);i?n.push({defaultedQueryOptions:r,observer:i}):n.push({defaultedQueryOptions:r,observer:new gn(this.#n,r)})}),n}#m(e,s){const n=this.#t.indexOf(e);n!==-1&&(this.#e=Ir(this.#e,n,s),this.#f())}#f(){if(this.hasListeners()){const e=this.#s,s=this.#c(this.#e,this.#l),n=this.#d(s,this.#r?.combine);e!==n&&Yt.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}};function Fr({queries:e,...s},n){const a=bn(n),r=Ea(),i=Ra(),l=d.useMemo(()=>e.map(v=>{const g=a.defaultQueryOptions(v);return g._optimisticResults=r?"isRestoring":"optimistic",g}),[e,a,r]);l.forEach(v=>{Da(v),Aa(v,i)}),Oa(i);const[o]=d.useState(()=>new Lr(a,l,s)),[c,m,u]=o.getOptimisticResult(l,s.combine),h=!r&&s.subscribed!==!1;d.useSyncExternalStore(d.useCallback(v=>h?o.subscribe(Yt.batchCalls(v)):$a,[o,h]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),d.useEffect(()=>{o.setQueries(l,s)},[l,s,o]);const f=c.some((v,g)=>Cs(l[g],v))?c.flatMap((v,g)=>{const x=l[g];if(x){const y=new gn(a,x);if(Cs(x,v))return Es(x,y,i);Pa(v,r)&&Es(x,y,i)}return[]}):[];if(f.length>0)throw Promise.all(f);const j=c.find((v,g)=>{const x=l[g];return x&&Ma({result:v,errorResetBoundary:i,throwOnError:x.throwOnError,query:a.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(j?.error)throw j.error;return m(u())}/**
2
2
  * @license lucide-react v0.507.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e}from"./index-D_Ya8nt7.js";import{P as m}from"./index-D5IE_EgY.js";import{u as p,a as x,b,c as h,r as v}from"./conversation-input-sync-DeCSVDem.js";import{A as d,S as f}from"./error-boundary-sr-ahxTS.js";const g="radient",D=({onSignInSuccess:o,onAfterCredentialUpdate:c,titleText:i="Sign in to Radient",descriptionText:n="Connect your Radient account to use Radient services."})=>{const l=p(),t=x(),a=b(t.data,"auth"),s=h(a),r=s.data?.find(u=>u.id===g);return t.isSuccess&&!a?e.jsx(d,{variant:"warning",children:"Signing in needs a newer Local Operator backend. Update the backend and restart the app."}):s.isLoading||t.isLoading?e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(f,{size:"md",label:"Loading sign-in options"})}):r?e.jsxs("div",{className:"mx-auto w-full max-w-md",children:[i&&e.jsx("p",{className:"mb-2 text-center text-heading text-ink",children:i}),n&&e.jsx("p",{className:"mb-6 text-center text-body-sm text-ink-muted",children:n}),e.jsx(m,{provider:r,onConnected:()=>{l.invalidateQueries({queryKey:v.all}),c?.(),o?.()}})]}):e.jsx(d,{variant:"warning",children:"Radient is not available from this backend's provider registry."})};export{D as R};
1
+ import{j as e}from"./index-D_Ya8nt7.js";import{P as m}from"./index-CpQRStsc.js";import{u as p,a as x,b,c as h,r as v}from"./conversation-input-sync-DeCSVDem.js";import{A as d,S as f}from"./error-boundary-sr-ahxTS.js";const g="radient",D=({onSignInSuccess:o,onAfterCredentialUpdate:c,titleText:i="Sign in to Radient",descriptionText:n="Connect your Radient account to use Radient services."})=>{const l=p(),t=x(),a=b(t.data,"auth"),s=h(a),r=s.data?.find(u=>u.id===g);return t.isSuccess&&!a?e.jsx(d,{variant:"warning",children:"Signing in needs a newer Local Operator backend. Update the backend and restart the app."}):s.isLoading||t.isLoading?e.jsx("div",{className:"flex h-24 items-center justify-center",children:e.jsx(f,{size:"md",label:"Loading sign-in options"})}):r?e.jsxs("div",{className:"mx-auto w-full max-w-md",children:[i&&e.jsx("p",{className:"mb-2 text-center text-heading text-ink",children:i}),n&&e.jsx("p",{className:"mb-6 text-center text-body-sm text-ink-muted",children:n}),e.jsx(m,{provider:r,onConnected:()=>{l.invalidateQueries({queryKey:v.all}),c?.(),o?.()}})]}):e.jsx(d,{variant:"warning",children:"Radient is not available from this backend's provider registry."})};export{D as R};
@@ -1,4 +1,4 @@
1
- import{r as p,h as ki,j as u,i as Mi,k as fu,s as _s,f as Qr,e as ae,l as mu,b as Mt,m as le,n as Ie,o as Us,p as Di,q as Xr,c as je}from"./index-D_Ya8nt7.js";import{be as hu,bf as gu,bg as Zr,bh as bu,bi as yu,bj as Ti,bk as vu,bl as xu,bm as wu,bn as Ii,bo as Cu,bp as Ri,bq as Dt,br as go,bs as Jr,bt as Su,bu as wt,bv as bo,bw as Ei,bx as Oi,by as Pu,aP as ku,bz as Mu,S as Du,bA as Tu,a as Fi,bB as Iu,bC as Ni,bD as Ru,bE as Eu,bF as Ou,bG as Fu,bH as Nu,bI as Au,bJ as $u,bK as Lu,an as Ir,bL as Ys,bM as ju,bN as Lo,bO as Vu,bP as Bu,bQ as zu,bR as Hu,bS as Wu,bT as _u,bU as Uu,ao as Yu,bV as qu,bW as Ku,bX as Gu,bY as Qu,aY as Xu,bZ as Zu,b_ as Ju,b$ as ed,aB as td,c0 as nd,c1 as od,c2 as rd}from"./index-D5IE_EgY.js";import{a7 as er,aF as Ai,u as es,aM as $i,dL as ts,dM as D,dN as sd,aT as Li,aU as ji,av as Vi,aw as Sn,aO as ad,bH as id,ag as Bi,dO as ld,aN as Pn,aV as cd,aP as ud,a as dd,b as pd}from"./conversation-input-sync-DeCSVDem.js";import{P as fd}from"./page-header-cUi3kof4.js";import{a6 as Io,a7 as md,f as qt,B as bt,S as ns,R as qs,L as gt,T as zi,I as Ho,s as bn,t as yn,u as vn,v as xn,w as Je,x as Rr,U as hd,V as gd,p as bd,W as yd,e as vd,X as xd,A as Ks}from"./error-boundary-sr-ahxTS.js";import{s as Er,g as wd,b as Wo,c as Hi,d as Wi,e as Cd,l as Or,h as Sd,w as Gs,j as Pd,i as Jn,f as kd,k as Md}from"./format-CZUObkkr.js";import{a as tr,p as Qs}from"./parseISO-CZfAC2_J.js";import{t as we,c as st,m as _i,a as Ui,n as nr,g as os,k as Dd,b as Yi,f as qi}from"./en-US-BcB1DWxG.js";import"./ui-preferences-store-DApxrOwj.js";import"./console-mirror-D_HrghW0.js";var Td=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Id=hu(function(e){return Td.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Rd=Id,Ed=function(t){return t!=="theme"},Xs=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Rd:Ed},Zs=function(t,n,o){var r;if(n){var s=n.shouldForwardProp;r=t.__emotion_forwardProp&&s?function(a){return t.__emotion_forwardProp(a)&&s(a)}:s}return typeof r!="function"&&o&&(r=t.__emotion_forwardProp),r},Od=function(t){var n=t.cache,o=t.serialized,r=t.isStringTag;return vu(n,o,r),xu(function(){return wu(n,o,r)}),null},Fd=function e(t,n){var o=t.__emotion_real===t,r=o&&t.__emotion_base||t,s,a;n!==void 0&&(s=n.label,a=n.target);var i=Zs(t,n,o),l=i||Xs(r),c=!l("as");return function(){var d=arguments,m=o&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(s!==void 0&&m.push("label:"+s+";"),d[0]==null||d[0].raw===void 0)m.push.apply(m,d);else{var y=d[0];m.push(y[0]);for(var g=d.length,h=1;h<g;h++)m.push(d[h],y[h])}var v=gu(function(f,b,C){var w=c&&f.as||r,x="",P=[],k=f;if(f.theme==null){k={};for(var S in f)k[S]=f[S];k.theme=p.useContext(bu)}typeof f.className=="string"?x=yu(b.registered,P,f.className):f.className!=null&&(x=f.className+" ");var R=Ti(m.concat(P),b.registered,k);x+=b.key+"-"+R.name,a!==void 0&&(x+=" "+a);var E=c&&i===void 0?Xs(w):l,F={};for(var L in f)c&&L==="as"||E(L)&&(F[L]=f[L]);return F.className=x,C&&(F.ref=C),p.createElement(p.Fragment,null,p.createElement(Od,{cache:b,serialized:R,isStringTag:typeof w=="string"}),p.createElement(w,F))});return v.displayName=s!==void 0?s:"Styled("+(typeof r=="string"?r:r.displayName||r.name||"Component")+")",v.defaultProps=t.defaultProps,v.__emotion_real=v,v.__emotion_base=r,v.__emotion_styles=m,v.__emotion_forwardProp=i,Object.defineProperty(v,"toString",{value:function(){return"."+a}}),v.withComponent=function(f,b){var C=e(f,Zr({},n,b,{shouldForwardProp:Zs(v,b,!0)}));return C.apply(void 0,m)},v}},Nd=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Fr=Fd.bind(null);Nd.forEach(function(e){Fr[e]=Fr(e)});/**
1
+ import{r as p,h as ki,j as u,i as Mi,k as fu,s as _s,f as Qr,e as ae,l as mu,b as Mt,m as le,n as Ie,o as Us,p as Di,q as Xr,c as je}from"./index-D_Ya8nt7.js";import{be as hu,bf as gu,bg as Zr,bh as bu,bi as yu,bj as Ti,bk as vu,bl as xu,bm as wu,bn as Ii,bo as Cu,bp as Ri,bq as Dt,br as go,bs as Jr,bt as Su,bu as wt,bv as bo,bw as Ei,bx as Oi,by as Pu,aP as ku,bz as Mu,S as Du,bA as Tu,a as Fi,bB as Iu,bC as Ni,bD as Ru,bE as Eu,bF as Ou,bG as Fu,bH as Nu,bI as Au,bJ as $u,bK as Lu,an as Ir,bL as Ys,bM as ju,bN as Lo,bO as Vu,bP as Bu,bQ as zu,bR as Hu,bS as Wu,bT as _u,bU as Uu,ao as Yu,bV as qu,bW as Ku,bX as Gu,bY as Qu,aY as Xu,bZ as Zu,b_ as Ju,b$ as ed,aB as td,c0 as nd,c1 as od,c2 as rd}from"./index-CpQRStsc.js";import{a7 as er,aF as Ai,u as es,aM as $i,dL as ts,dM as D,dN as sd,aT as Li,aU as ji,av as Vi,aw as Sn,aO as ad,bH as id,ag as Bi,dO as ld,aN as Pn,aV as cd,aP as ud,a as dd,b as pd}from"./conversation-input-sync-DeCSVDem.js";import{P as fd}from"./page-header-cUi3kof4.js";import{a6 as Io,a7 as md,f as qt,B as bt,S as ns,R as qs,L as gt,T as zi,I as Ho,s as bn,t as yn,u as vn,v as xn,w as Je,x as Rr,U as hd,V as gd,p as bd,W as yd,e as vd,X as xd,A as Ks}from"./error-boundary-sr-ahxTS.js";import{s as Er,g as wd,b as Wo,c as Hi,d as Wi,e as Cd,l as Or,h as Sd,w as Gs,j as Pd,i as Jn,f as kd,k as Md}from"./format-CZUObkkr.js";import{a as tr,p as Qs}from"./parseISO-CZfAC2_J.js";import{t as we,c as st,m as _i,a as Ui,n as nr,g as os,k as Dd,b as Yi,f as qi}from"./en-US-BcB1DWxG.js";import"./ui-preferences-store-DApxrOwj.js";import"./console-mirror-D_HrghW0.js";var Td=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Id=hu(function(e){return Td.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Rd=Id,Ed=function(t){return t!=="theme"},Xs=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Rd:Ed},Zs=function(t,n,o){var r;if(n){var s=n.shouldForwardProp;r=t.__emotion_forwardProp&&s?function(a){return t.__emotion_forwardProp(a)&&s(a)}:s}return typeof r!="function"&&o&&(r=t.__emotion_forwardProp),r},Od=function(t){var n=t.cache,o=t.serialized,r=t.isStringTag;return vu(n,o,r),xu(function(){return wu(n,o,r)}),null},Fd=function e(t,n){var o=t.__emotion_real===t,r=o&&t.__emotion_base||t,s,a;n!==void 0&&(s=n.label,a=n.target);var i=Zs(t,n,o),l=i||Xs(r),c=!l("as");return function(){var d=arguments,m=o&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(s!==void 0&&m.push("label:"+s+";"),d[0]==null||d[0].raw===void 0)m.push.apply(m,d);else{var y=d[0];m.push(y[0]);for(var g=d.length,h=1;h<g;h++)m.push(d[h],y[h])}var v=gu(function(f,b,C){var w=c&&f.as||r,x="",P=[],k=f;if(f.theme==null){k={};for(var S in f)k[S]=f[S];k.theme=p.useContext(bu)}typeof f.className=="string"?x=yu(b.registered,P,f.className):f.className!=null&&(x=f.className+" ");var R=Ti(m.concat(P),b.registered,k);x+=b.key+"-"+R.name,a!==void 0&&(x+=" "+a);var E=c&&i===void 0?Xs(w):l,F={};for(var L in f)c&&L==="as"||E(L)&&(F[L]=f[L]);return F.className=x,C&&(F.ref=C),p.createElement(p.Fragment,null,p.createElement(Od,{cache:b,serialized:R,isStringTag:typeof w=="string"}),p.createElement(w,F))});return v.displayName=s!==void 0?s:"Styled("+(typeof r=="string"?r:r.displayName||r.name||"Component")+")",v.defaultProps=t.defaultProps,v.__emotion_real=v,v.__emotion_base=r,v.__emotion_styles=m,v.__emotion_forwardProp=i,Object.defineProperty(v,"toString",{value:function(){return"."+a}}),v.withComponent=function(f,b){var C=e(f,Zr({},n,b,{shouldForwardProp:Zs(v,b,!0)}));return C.apply(void 0,m)},v}},Nd=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Fr=Fd.bind(null);Nd.forEach(function(e){Fr[e]=Fr(e)});/**
2
2
  * @mui/styled-engine v6.4.11
3
3
  *
4
4
  * @license MIT
@@ -1,4 +1,4 @@
1
- import{r as i,j as t,c as ce,t as Un}from"./index-D_Ya8nt7.js";import{cy as lt,cz as Pn,cA as Tt,cB as xe,bP as zn,aF as be,a6 as nn,a7 as vt,aw as sn,u as an,aM as Kn,aN as Bn,cC as Hn,cD as Vn,cE as Gn,cF as qn,cG as on,cH as bt,a4 as rn,cI as He,cJ as Yn,aR as Wn,cK as Et,a2 as Zn,cL as Qn,cM as Jn,cN as Xn,cO as es,T as jt,cP as ts,cQ as ns,av as cn,aT as dt,aU as ut,cR as ss,aY as as,cS as os,ce as mt,a as ln,b as It,ag as qe,cT as rs,cU as is,cV as cs,d as ke,cW as ht,cX as ls,cY as ds,cZ as us,aP as ms,bf as hs,c_ as dn,c$ as fs,d0 as ps,d1 as gs,aL as ys,d2 as un,aS as mn,d3 as hn,d4 as xs,d5 as ks,d6 as vs,d7 as bs,d8 as js,d9 as ws,da as _s,db as Ns,aG as Ss,bK as fn,aZ as Cs,a$ as Ms,dc as Oe,dd as ft,de as Lt,df as As,dg as Rs,dh as Ts,di as Es,dj as pn,dk as Is,b8 as Ls,bS as Os,bR as Fs,dl as Ds,dm as $s,dn as Us,dp as Ot,dq as Ps,dr as zs,ds as Ks}from"./conversation-input-sync-DeCSVDem.js";import{K as Bs,u as ve,e as Hs,a as Vs,b as Gs,T as qs,d as gn}from"./ui-preferences-store-DApxrOwj.js";import{aZ as yn,a_ as Ys,a$ as Ws,b0 as te,aJ as Je,aK as re,b1 as Zs,an as Ft,b2 as Qs,b3 as Ve,S as Js,aI as Xs,b4 as ea,b5 as ta,b6 as na,b7 as sa,b8 as aa,b9 as oa,ay as Dt,ba as ra,at as ia,aF as $t,bb as ca,aG as la,aH as da,bc as ua,bd as ma}from"./index-D5IE_EgY.js";import{P as ha}from"./page-header-cUi3kof4.js";import{c as w,B as $,S as le,x as fa,s as pa,t as ga,u as ya,v as xa,w as ka,f as Ue,R as Qe,L as fe,I as Me,N as pt,O as gt,P as De,a4 as Ut,T as xn,Y as va,D as ba,k as ja,l as wa,n as _a,o as Pt,j as Na,A as ne,r as Sa,E as Ca,a5 as Ma,Z as Aa,C as Ra,e as kn}from"./error-boundary-sr-ahxTS.js";import{R as Ta}from"./radient-auth-buttons-De0E7l-6.js";import{N as Ea}from"./notebook-pen-DG_DgpzX.js";import{B as Ia}from"./book-open-McoghV-V.js";import{a as La,p as at}from"./parseISO-CZfAC2_J.js";import{i as Oa,a as Ce,f as Fa}from"./format-CZUObkkr.js";import{t as Da}from"./en-US-BcB1DWxG.js";import"./console-mirror-D_HrghW0.js";/**
1
+ import{r as i,j as t,c as ce,t as Un}from"./index-D_Ya8nt7.js";import{cy as lt,cz as Pn,cA as Tt,cB as xe,bP as zn,aF as be,a6 as nn,a7 as vt,aw as sn,u as an,aM as Kn,aN as Bn,cC as Hn,cD as Vn,cE as Gn,cF as qn,cG as on,cH as bt,a4 as rn,cI as He,cJ as Yn,aR as Wn,cK as Et,a2 as Zn,cL as Qn,cM as Jn,cN as Xn,cO as es,T as jt,cP as ts,cQ as ns,av as cn,aT as dt,aU as ut,cR as ss,aY as as,cS as os,ce as mt,a as ln,b as It,ag as qe,cT as rs,cU as is,cV as cs,d as ke,cW as ht,cX as ls,cY as ds,cZ as us,aP as ms,bf as hs,c_ as dn,c$ as fs,d0 as ps,d1 as gs,aL as ys,d2 as un,aS as mn,d3 as hn,d4 as xs,d5 as ks,d6 as vs,d7 as bs,d8 as js,d9 as ws,da as _s,db as Ns,aG as Ss,bK as fn,aZ as Cs,a$ as Ms,dc as Oe,dd as ft,de as Lt,df as As,dg as Rs,dh as Ts,di as Es,dj as pn,dk as Is,b8 as Ls,bS as Os,bR as Fs,dl as Ds,dm as $s,dn as Us,dp as Ot,dq as Ps,dr as zs,ds as Ks}from"./conversation-input-sync-DeCSVDem.js";import{K as Bs,u as ve,e as Hs,a as Vs,b as Gs,T as qs,d as gn}from"./ui-preferences-store-DApxrOwj.js";import{aZ as yn,a_ as Ys,a$ as Ws,b0 as te,aJ as Je,aK as re,b1 as Zs,an as Ft,b2 as Qs,b3 as Ve,S as Js,aI as Xs,b4 as ea,b5 as ta,b6 as na,b7 as sa,b8 as aa,b9 as oa,ay as Dt,ba as ra,at as ia,aF as $t,bb as ca,aG as la,aH as da,bc as ua,bd as ma}from"./index-CpQRStsc.js";import{P as ha}from"./page-header-cUi3kof4.js";import{c as w,B as $,S as le,x as fa,s as pa,t as ga,u as ya,v as xa,w as ka,f as Ue,R as Qe,L as fe,I as Me,N as pt,O as gt,P as De,a4 as Ut,T as xn,Y as va,D as ba,k as ja,l as wa,n as _a,o as Pt,j as Na,A as ne,r as Sa,E as Ca,a5 as Ma,Z as Aa,C as Ra,e as kn}from"./error-boundary-sr-ahxTS.js";import{R as Ta}from"./radient-auth-buttons-zXDJkEGk.js";import{N as Ea}from"./notebook-pen-DG_DgpzX.js";import{B as Ia}from"./book-open-McoghV-V.js";import{a as La,p as at}from"./parseISO-CZfAC2_J.js";import{i as Oa,a as Ce,f as Fa}from"./format-CZUObkkr.js";import{t as Da}from"./en-US-BcB1DWxG.js";import"./console-mirror-D_HrghW0.js";/**
2
2
  * @license lucide-react v0.507.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as l,r as F}from"./error-boundary-sr-ahxTS.js";import{t as j,c as K,n as U,b as _,g as Q,f as P,h as S,i as z,j as N,a as v}from"./en-US-BcB1DWxG.js";import{j as r,c as g,r as V}from"./index-D_Ya8nt7.js";import{bM as I,be as L,bN as B,aL as w,aF as Y,u as k,aM as b,aP as Z,aN as C,bG as G,ag as W,a7 as D,bH as X}from"./conversation-input-sync-DeCSVDem.js";import{at as J,au as ee,av as O}from"./index-D5IE_EgY.js";import{B as te}from"./book-open-McoghV-V.js";import{n as ae,o as ne,q as se,r as oe,s as ie,t as re,v as ce}from"./use-memberships-query-DdlKnrP8.js";/**
1
+ import{c as l,r as F}from"./error-boundary-sr-ahxTS.js";import{t as j,c as K,n as U,b as _,g as Q,f as P,h as S,i as z,j as N,a as v}from"./en-US-BcB1DWxG.js";import{j as r,c as g,r as V}from"./index-D_Ya8nt7.js";import{bM as I,be as L,bN as B,aL as w,aF as Y,u as k,aM as b,aP as Z,aN as C,bG as G,ag as W,a7 as D,bH as X}from"./conversation-input-sync-DeCSVDem.js";import{at as J,au as ee,av as O}from"./index-CpQRStsc.js";import{B as te}from"./book-open-McoghV-V.js";import{n as ae,o as ne,q as se,r as oe,s as ie,t as re,v as ce}from"./use-memberships-query-DdlKnrP8.js";/**
2
2
  * @license lucide-react v0.507.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -41,7 +41,7 @@
41
41
  <meta http-equiv="Content-Security-Policy"
42
42
  content="default-src 'self'; connect-src 'self' http://localhost:1111 http://127.0.0.1:1111 http://localhost:8080 http://127.0.0.1:8080 https://api.radienthq.com https://us.i.posthog.com https://login.microsoftonline.com https://accounts.google.com; script-src 'self' https://us-assets.i.posthog.com https://accounts.google.com https://login.microsoftonline.com; style-src 'self' 'unsafe-inline' data:; img-src 'self' data: blob: http://localhost:1111 http://127.0.0.1:1111; media-src 'self' blob: http://localhost:1111 http://127.0.0.1:1111; font-src 'self' data:; frame-src 'self' data: blob: lo-supplement: http://localhost:1111 http://127.0.0.1:1111 https://accounts.google.com https://login.microsoftonline.com" />
43
43
  <meta http-equiv="Cross-Origin-Opener-Policy" content="same-origin-allow-popups" />
44
- <script type="module" crossorigin src="./assets/index-D5IE_EgY.js"></script>
44
+ <script type="module" crossorigin src="./assets/index-CpQRStsc.js"></script>
45
45
  <link rel="modulepreload" crossorigin href="./assets/index-D_Ya8nt7.js">
46
46
  <link rel="modulepreload" crossorigin href="./assets/ui-preferences-store-DApxrOwj.js">
47
47
  <link rel="modulepreload" crossorigin href="./assets/error-boundary-sr-ahxTS.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "local-operator-ui",
3
- "version": "0.34.37",
3
+ "version": "0.34.38",
4
4
  "productName": "Local Operator",
5
5
  "description": "User interface for AI agent assistants that run Python code safely on your device through an intuitive chat interface. Supports local and cloud LLM models with built-in security features.",
6
6
  "main": "./out/main/index.js",