@rivet-dev/agentos 0.4.3 → 0.4.9

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
- var M=Object.defineProperty;var Q=(s,t,n)=>t in s?M(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n;var C=(s,t,n)=>Q(s,typeof t!="symbol"?t+"":t,n);import{u as D,r as b,p as $,j as e,q as L,C as K,d as q,S as F,g as V,a as I}from"./index-CMgGagyE.js";import{c as z,Q as H,d as G,P as A,e as X,a as y,V as Y}from"./vm-status-badges-QaK7sEZ4.js";import{b as U}from"./hooks-B_kCGlJx.js";function B(s,t){return z({...s,enabled:!0,suspense:!0,throwOnError:G,placeholderData:void 0},H)}function g(s){return s.process?`${s.process.generation}:tracked:${s.process.pid}`:`${s.generation}:guest:${s.pid}`}const J=8;async function W(s,t,n,o){const l=[];let a=n,c=!1,x=!1,v;for(let j=0;j<J;j++){o==null||o.throwIfAborted();const i=await s(a);if(o==null||o.throwIfAborted(),BigInt(i.generation)!==BigInt(t))throw new Error("Process replay returned a different VM generation");if(i.events.length>A.maxEvents)throw new Error("Process replay exceeded the requested event page limit");let u=a,r=0;const d=[];for(const p of i.events){if(p.sequence<0||typeof p.sequence=="number"&&!Number.isSafeInteger(p.sequence)||u!==void 0&&p.sequence<=u)throw new Error("Process replay returned out-of-order sequences");x||(x=BigInt(p.sequence)>BigInt(u??-1)+1n),u=p.sequence;const N=X(p.data);if(r+=N.byteLength,r>A.maxBytes)throw new Error("Process replay exceeded the requested byte page limit");d.push({...p,data:N})}const m=i.nextCursor??void 0;if(m!==void 0&&(m<0||typeof m=="number"&&!Number.isSafeInteger(m))||i.hasMore&&i.events.length===0||i.events.length>0&&m===void 0||m!==void 0&&BigInt(m)!==BigInt(u??-1)&&!(i.truncated&&!i.hasMore&&BigInt(m)>BigInt(u??-1)))throw new Error("Process replay did not advance its cursor");if(l.push(...d),a=m??a,x||(x=i.truncated),v=i.end??v,c=i.hasMore,!c)break}return{events:l,nextCursor:a,hasMore:c,truncated:x,end:v}}class Z{constructor(){C(this,"streams",{stdout:new TextDecoder,stderr:new TextDecoder});C(this,"sequence")}decode(t){return this.sequence!==void 0&&BigInt(t.sequence)!==BigInt(this.sequence)+1n&&this.reset(),this.sequence=t.sequence,this.streams[t.stream].decode(t.data,{stream:!0})}reset(){this.streams={stdout:new TextDecoder,stderr:new TextDecoder},this.sequence=void 0}finish(){return this.streams.stdout.decode()+this.streams.stderr.decode()}}function R(s){return s?new Date(s).toLocaleTimeString():"—"}function P(s,t=0,n=[]){const o=[...s].sort((l,a)=>+(a.status==="running")-+(l.status==="running")||a.startTime-l.startTime);for(const l of o){const{children:a,...c}=l;n.push({...c,args:c.args??[],depth:t}),P(a??[],t+1,n)}return n}function O(s){if(!s.process)throw new Error("This guest process has no actor process handle");return s.process}const ee=64e3;function te(s,t){const n=t==null?void 0:t.generation,o=t==null?void 0:t.pid,[l,a]=b.useState(""),[c,x]=b.useState(null),[v,j]=b.useState(!1);return b.useEffect(()=>{if(n===void 0||o===void 0)return;let i=!1,u=!1,r,d=!1;const m=new AbortController,p=new Z,N=async()=>{if(!(u||i)){u=!0;try{const f=await W(y.processOutputReader(n,o),n,r,m.signal);if(i)return;f.truncated&&j(!0),r=f.nextCursor??r;let E=f.events.map(S=>p.decode(S)).join("");const T=f.truncated?`
1
+ var M=Object.defineProperty;var Q=(s,t,n)=>t in s?M(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n;var C=(s,t,n)=>Q(s,typeof t!="symbol"?t+"":t,n);import{u as D,r as b,p as $,j as e,q as L,C as K,d as q,S as F,g as V,a as I}from"./index-UFq5tVw_.js";import{c as z,Q as H,d as G,P as A,e as X,a as y,V as Y}from"./vm-status-badges-BzRIP4lN.js";import{b as U}from"./hooks-cSr2w3ti.js";function B(s,t){return z({...s,enabled:!0,suspense:!0,throwOnError:G,placeholderData:void 0},H)}function g(s){return s.process?`${s.process.generation}:tracked:${s.process.pid}`:`${s.generation}:guest:${s.pid}`}const J=8;async function W(s,t,n,o){const l=[];let a=n,c=!1,x=!1,v;for(let j=0;j<J;j++){o==null||o.throwIfAborted();const i=await s(a);if(o==null||o.throwIfAborted(),BigInt(i.generation)!==BigInt(t))throw new Error("Process replay returned a different VM generation");if(i.events.length>A.maxEvents)throw new Error("Process replay exceeded the requested event page limit");let u=a,r=0;const d=[];for(const p of i.events){if(p.sequence<0||typeof p.sequence=="number"&&!Number.isSafeInteger(p.sequence)||u!==void 0&&p.sequence<=u)throw new Error("Process replay returned out-of-order sequences");x||(x=BigInt(p.sequence)>BigInt(u??-1)+1n),u=p.sequence;const N=X(p.data);if(r+=N.byteLength,r>A.maxBytes)throw new Error("Process replay exceeded the requested byte page limit");d.push({...p,data:N})}const m=i.nextCursor??void 0;if(m!==void 0&&(m<0||typeof m=="number"&&!Number.isSafeInteger(m))||i.hasMore&&i.events.length===0||i.events.length>0&&m===void 0||m!==void 0&&BigInt(m)!==BigInt(u??-1)&&!(i.truncated&&!i.hasMore&&BigInt(m)>BigInt(u??-1)))throw new Error("Process replay did not advance its cursor");if(l.push(...d),a=m??a,x||(x=i.truncated),v=i.end??v,c=i.hasMore,!c)break}return{events:l,nextCursor:a,hasMore:c,truncated:x,end:v}}class Z{constructor(){C(this,"streams",{stdout:new TextDecoder,stderr:new TextDecoder});C(this,"sequence")}decode(t){return this.sequence!==void 0&&BigInt(t.sequence)!==BigInt(this.sequence)+1n&&this.reset(),this.sequence=t.sequence,this.streams[t.stream].decode(t.data,{stream:!0})}reset(){this.streams={stdout:new TextDecoder,stderr:new TextDecoder},this.sequence=void 0}finish(){return this.streams.stdout.decode()+this.streams.stderr.decode()}}function R(s){return s?new Date(s).toLocaleTimeString():"—"}function P(s,t=0,n=[]){const o=[...s].sort((l,a)=>+(a.status==="running")-+(l.status==="running")||a.startTime-l.startTime);for(const l of o){const{children:a,...c}=l;n.push({...c,args:c.args??[],depth:t}),P(a??[],t+1,n)}return n}function O(s){if(!s.process)throw new Error("This guest process has no actor process handle");return s.process}const ee=64e3;function te(s,t){const n=t==null?void 0:t.generation,o=t==null?void 0:t.pid,[l,a]=b.useState(""),[c,x]=b.useState(null),[v,j]=b.useState(!1);return b.useEffect(()=>{if(n===void 0||o===void 0)return;let i=!1,u=!1,r,d=!1;const m=new AbortController,p=new Z,N=async()=>{if(!(u||i)){u=!0;try{const f=await W(y.processOutputReader(n,o),n,r,m.signal);if(i)return;f.truncated&&j(!0),r=f.nextCursor??r;let E=f.events.map(S=>p.decode(S)).join("");const T=f.truncated?`
2
2
  [earlier output was truncated]
3
3
  `:"",w=!f.hasMore&&f.end&&!d?`
4
4
  [exited ${f.end.exitCode}]`:"";w&&(E+=p.finish()),w&&(d=!0),(E||T||w)&&a(S=>(S+T+E+w).slice(-ee)),x(null)}catch(f){i||x(f)}finally{u=!1}}};N();const k=window.setInterval(()=>void N(),2e3);return()=>{i=!0,m.abort(),window.clearInterval(k)}},[s,n,o]),{output:l,error:c,historyTruncated:v}}function h({label:s,value:t}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-muted-foreground/70",children:s}),e.jsx("div",{className:"truncate font-mono",title:t,children:t})]})}function se({actorId:s,p:t,onStop:n,onKill:o,actionError:l}){const a=te(s,t.process),{armed:c,confirm:x}=U({resetKey:g(t)});return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3 text-xs",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 sm:grid-cols-4",children:[e.jsx(h,{label:"ppid",value:t.ppid?String(t.ppid):"—"}),e.jsx(h,{label:"cwd",value:t.cwd||"—"}),e.jsx(h,{label:"driver",value:t.driver||"—"}),e.jsx(h,{label:"exit code",value:t.exitCode==null?"—":String(t.exitCode)}),e.jsx(h,{label:"args",value:t.args.join(" ")||"—"}),e.jsx(h,{label:"first seen",value:R(t.startTime)}),e.jsx(h,{label:"exit observed",value:t.exitTime==null?"—":V(t.exitTime)}),e.jsx(h,{label:"group / session",value:`${t.pgid} / ${t.sid}`})]}),t.status==="running"&&t.process?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>x("stop",n),className:"rounded border px-2 py-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:c==="stop"?"Confirm stop?":"Stop"}),e.jsx("button",{type:"button",onClick:()=>x("kill",o),className:"rounded border border-destructive/40 px-2 py-0.5 text-destructive transition-colors hover:bg-destructive/10",children:c==="kill"?"Confirm kill?":"Kill"})]}):null,t.process?null:e.jsx("div",{className:"text-muted-foreground/60",children:"Control and output replay are available only for processes started through this actor."}),l?e.jsx(I,{error:l,className:"p-0"}):null,a.error?e.jsx(I,{error:a.error,className:"p-0"}):null,a.historyTruncated?e.jsx("div",{className:"text-muted-foreground",children:"Some earlier output is no longer available."}):null,a.output?e.jsxs("div",{children:[e.jsx("div",{className:"mb-1 text-muted-foreground/70",children:"Output (replay, latest 64,000 characters)"}),e.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded bg-muted/50 p-2 font-mono text-[11px] leading-relaxed",children:a.output})]}):t.process?e.jsx("div",{className:"text-muted-foreground/60",children:"No captured output for this process."}):null]})}function re(s){const{data:t}=B(y.processTreeQueryOptions(s)),n=P(t);return{running:n.filter(o=>o.status==="running").length,total:n.length}}function _({actorId:s}){const{data:t}=B(y.processTreeQueryOptions(s)),n=D(),[o,l]=b.useState(null),[a,c]=b.useState(null),x=P(t),j=$().useEvent;j("processExit",r=>{const d=r;!d||typeof d.pid!="number"||n.invalidateQueries({queryKey:y.processTreeQueryOptions(s).queryKey})});const i=()=>n.invalidateQueries({queryKey:y.processTreeQueryOptions(s).queryKey}),u=async r=>{c(null);try{await r(),await i()}catch(d){c(d)}};return x.length===0?e.jsx("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"No processes in the VM."}):e.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"sticky top-0 bg-secondary text-[11px] text-muted-foreground",children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"w-8 px-3 py-2","aria-label":"Expand"}),e.jsx("th",{className:"w-16 px-2 py-2 text-left font-medium",children:"PID"}),e.jsx("th",{className:"px-2 py-2 text-left font-medium",children:"Command"}),e.jsx("th",{className:"w-28 px-2 py-2 text-left font-medium",children:"First seen"}),e.jsx("th",{className:"w-28 px-2 py-2 text-left font-medium",children:"Status"})]})}),e.jsx("tbody",{children:x.map(r=>e.jsxs(L.Fragment,{children:[e.jsxs("tr",{onClick:()=>l(d=>d===g(r)?null:g(r)),className:q("cursor-pointer border-b border-foreground/[0.06] hover:bg-muted/50",o===g(r)&&"bg-muted/40",r.status==="exited"&&"opacity-50"),children:[e.jsx("td",{className:"px-3 py-1.5",children:e.jsx(K,{className:q("size-3 text-muted-foreground/60 transition-transform",o===g(r)&&"rotate-90")})}),e.jsx("td",{className:"px-2 py-1.5 font-mono",children:r.pid}),e.jsx("td",{className:"px-2 py-1.5 font-mono text-xs",children:e.jsxs("span",{style:{paddingLeft:`${r.depth*14}px`},children:[r.depth>0?e.jsx("span",{className:"text-muted-foreground/40",children:"└ "}):null,r.command,r.args.length>0?e.jsxs("span",{className:"text-muted-foreground/60",children:[" ",r.args.join(" ")]}):null]})}),e.jsx("td",{className:"px-2 py-1.5 font-mono text-xs text-muted-foreground",children:R(r.startTime)}),e.jsx("td",{className:"px-2 py-1.5",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs",children:[e.jsx(F,{color:r.status==="running"?"green":"muted"}),r.status]})})]}),o===g(r)?e.jsx("tr",{className:"border-b border-foreground/[0.06] bg-muted/20",children:e.jsx("td",{colSpan:5,children:e.jsx(se,{actorId:s,p:r,onStop:()=>void u(()=>{const d=O(r);return y.stopProcess(d.generation,d.pid)}),onKill:()=>void u(()=>{const d=O(r);return y.killProcess(d.generation,d.pid)}),actionError:a},`${s}:${g(r)}`)})}):null]},g(r)))})]})})}function ne({actorId:s}){return e.jsxs("div",{className:"relative h-full min-h-0 overflow-auto p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("h1",{className:"text-sm font-semibold",children:"Processes"}),e.jsx("span",{className:"ml-auto"}),e.jsx(Y,{actorId:s})]}),e.jsx("div",{className:"overflow-hidden rounded-lg border bg-secondary",children:e.jsx(_,{actorId:s})})]})}const le=Object.freeze(Object.defineProperty({__proto__:null,ProcessTable:_,ProcessesTabConnected:ne,useProcessCounts:re},Symbol.toStringTag,{value:"Module"}));export{_ as P,B as a,le as p,re as u};
@@ -1 +1 @@
1
- import{r as i,k as Le,j as S,o as je,d as Me}from"./index-CMgGagyE.js";var Ie=Object.defineProperty,re=(t,e)=>Ie(t,"name",{value:e,configurable:!0});function Z(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}re(Z,"setRef");function ie(...t){return e=>{let r=!1;const o=t.map(n=>{const c=Z(n,e);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let n=0;n<o.length;n++){const c=o[n];typeof c=="function"?c():Z(t[n],null)}}}}re(ie,"composeRefs");function O(...t){return i.useCallback(ie(...t),t)}re(O,"useComposedRefs");var We=Object.defineProperty,E=(t,e)=>We(t,"name",{value:e,configurable:!0});function ae(t){const e=i.forwardRef((r,o)=>{let{children:n,...c}=r,l=null,a=!1;const s=[];G(n)&&typeof X=="function"&&(n=X(n._payload)),i.Children.forEach(n,m=>{var h;if(fe(m)){a=!0;const p=m;let v="child"in p.props?p.props.child:p.props.children;G(v)&&typeof X=="function"&&(v=X(v._payload)),l=Ue(p,v),s.push((h=l==null?void 0:l.props)==null?void 0:h.children)}else s.push(m)}),l?l=i.cloneElement(l,void 0,s):!a&&i.Children.count(n)===1&&i.isValidElement(n)&&(l=n);const u=l?de(l):void 0,f=O(o,u);if(!l){if(n||n===0)throw new Error(a?Fe(t):ze(t));return n}const d=ue(c,l.props??{});return l.type!==i.Fragment&&(d.ref=o?f:u),i.cloneElement(l,d)});return e.displayName=`${t}.Slot`,e}E(ae,"createSlot");var se=Symbol.for("radix.slottable");function $e(t){const e=E(r=>"child"in r?r.children(r.child):r.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=se,e}E($e,"createSlottable");var Ue=E((t,e)=>{if("child"in t.props){const r=t.props.child;return i.isValidElement(r)?i.cloneElement(r,void 0,t.props.children(r.props.children)):null}return i.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function ue(t,e){const r={...e};for(const o in e){const n=t[o],c=e[o];/^on[A-Z]/.test(o)?n&&c?r[o]=(...a)=>{const s=c(...a);return n(...a),s}:n&&(r[o]=n):o==="style"?r[o]={...n,...c}:o==="className"&&(r[o]=[n,c].filter(Boolean).join(" "))}return{...t,...r}}E(ue,"mergeProps");function de(t){var o,n;let e=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}E(de,"getElementRef");function fe(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===se}E(fe,"isSlottable");var Ve=Symbol.for("react.lazy");function G(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Ve&&"_payload"in t&&he(t._payload)}E(G,"isLazyComponent");function he(t){return typeof t=="object"&&t!==null&&"then"in t}E(he,"isPromiseLike");var ze=E(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Fe=E(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),X=Le[" use ".trim().toString()],He=Object.defineProperty,Ye=(t,e)=>He(t,"name",{value:e,configurable:!0}),ke=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$=ke.reduce((t,e)=>{const r=ae(`Primitive.${e}`),o=i.forwardRef((n,c)=>{const{asChild:l,...a}=n,s=l?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(s,{...a,ref:c})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{});function Xe(t,e){t&&je.flushSync(()=>t.dispatchEvent(e))}Ye(Xe,"dispatchDiscreteCustomEvent");var J=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},Be=Object.defineProperty,R=(t,e)=>Be(t,"name",{value:e,configurable:!0});function pe(t,e){return i.useReducer((r,o)=>e[r][o]??r,t)}R(pe,"useStateMachine");var B=R(t=>{const{present:e,children:r}=t,o=me(e),n=typeof r=="function"?r({present:o.isPresent}):i.Children.only(r),c=Se(o.ref,be(n));return typeof r=="function"||o.isPresent?i.cloneElement(n,{ref:c}):null},"Presence");function me(t){const[e,r]=i.useState(),o=i.useRef(null),n=i.useRef(t),c=i.useRef("none"),l=i.useRef(void 0),a=t?"mounted":"unmounted",[s,u]=pe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{s==="mounted"?(c.current=l.current??L(o.current),l.current=void 0):c.current="none"},[s]),J(()=>{const f=o.current,d=n.current;if(d!==t){const h=c.current,p=L(f);t?(l.current=p,u("MOUNT")):p==="none"||(f==null?void 0:f.display)==="none"?u("UNMOUNT"):u(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),n.current=t}},[t,u]),J(()=>{if(e){let f;const d=e.ownerDocument.defaultView??window,m=R(p=>{const g=L(o.current).includes(CSS.escape(p.animationName));if(p.target===e&&g&&(u("ANIMATION_END"),!n.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",f=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),h=R(p=>{p.target===e&&(c.current=L(o.current))},"handleAnimationStart");return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{d.clearTimeout(f),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:i.useCallback(f=>{if(f){const d=getComputedStyle(f);o.current=d,l.current=L(d)}else o.current=null;r(f)},[])}}R(me,"usePresence");function K(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}R(K,"setRef");function Se(...t){const e=i.useRef(t);return e.current=t,i.useCallback(r=>{const o=e.current;let n=!1;const c=o.map(l=>{const a=K(l,r);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let l=0;l<c.length;l++){const a=c[l];typeof a=="function"?a():K(o[l],null)}}},[])}R(Se,"useStableComposedRefs");function L(t){return(t==null?void 0:t.animationName)||"none"}R(L,"getAnimationName");function be(t){var o,n;let e=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}R(be,"getElementRef");var qe=Object.defineProperty,P=(t,e)=>qe(t,"name",{value:e,configurable:!0});function Ze(t,e){const r=i.createContext(e);r.displayName=t+"Context";const o=P(c=>{const{children:l,...a}=c,s=i.useMemo(()=>a,Object.values(a));return S.jsx(r.Provider,{value:s,children:l})},"Provider");o.displayName=t+"Provider";function n(c,l={}){const{optional:a=!1}=l,s=i.useContext(r);if(s)return s;if(e!==void 0)return e;if(!a)throw new Error(`\`${c}\` must be used within \`${t}\``)}return P(n,"useContext"),[o,n]}P(Ze,"createContext");function ve(t,e=[]){let r=[];function o(c,l){const a=i.createContext(l);a.displayName=c+"Context";const s=r.length;r=[...r,l];const u=P(d=>{var x;const{scope:m,children:h,...p}=d,v=((x=m==null?void 0:m[t])==null?void 0:x[s])||a,g=i.useMemo(()=>p,Object.values(p));return S.jsx(v.Provider,{value:g,children:h})},"Provider");u.displayName=c+"Provider";function f(d,m,h={}){var x;const{optional:p=!1}=h,v=((x=m==null?void 0:m[t])==null?void 0:x[s])||a,g=i.useContext(v);if(g)return g;if(l!==void 0)return l;if(!p)throw new Error(`\`${d}\` must be used within \`${c}\``)}return P(f,"useContext"),[u,f]}P(o,"createContext");const n=P(()=>{const c=r.map(l=>i.createContext(l));return P(function(a){const s=(a==null?void 0:a[t])||c;return i.useMemo(()=>({[`__scope${t}`]:{...a,[t]:s}}),[a,s])},"useScope")},"createScope");return n.scopeName=t,[o,we(n,...e)]}P(ve,"createContextScope");function we(...t){const e=t[0];if(t.length===1)return e;const r=P(()=>{const o=t.map(n=>({useScope:n(),scopeName:n.scopeName}));return P(function(c){const l=o.reduce((a,{useScope:s,scopeName:u})=>{const d=s(c)[`__scope${u}`];return{...a,...d}},{});return i.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])},"useComposedScopes")},"createScope");return r.scopeName=e.scopeName,r}P(we,"composeContextScopes");var Ge=Object.defineProperty,Je=(t,e)=>Ge(t,"name",{value:e,configurable:!0});function _(t){const e=i.useRef(t);return i.useEffect(()=>{e.current=t}),i.useMemo(()=>(...r)=>{var o;return(o=e.current)==null?void 0:o.call(e,...r)},[])}Je(_,"useCallbackRef");var Ke=Object.defineProperty,Qe=(t,e)=>Ke(t,"name",{value:e,configurable:!0}),et=i.createContext(void 0);function ge(t){const e=i.useContext(et);return t||e||"ltr"}Qe(ge,"useDirection");var tt=Object.defineProperty,rt=(t,e)=>tt(t,"name",{value:e,configurable:!0});function Pe(t,[e,r]){return Math.min(r,Math.max(e,t))}rt(Pe,"clamp");var ot=Object.defineProperty,j=(t,e)=>ot(t,"name",{value:e,configurable:!0}),Ce=!!(typeof window<"u"&&window.document&&window.document.createElement);function T(t,e,{checkForDefaultPrevented:r=!0}={}){return j(function(n){if(t==null||t(n),r===!1||!n||!n.defaultPrevented)return e==null?void 0:e(n)},"handleEvent")}j(T,"composeEventHandlers");function nt(t){var e;if(!Ce)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}j(nt,"getOwnerWindow");function Q(t){if(!Ce)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}j(Q,"getOwnerDocument");function xe(t,e=!1){const{activeElement:r}=Q(t);if(!(r!=null&&r.nodeName))return null;if(Ae(r)&&r.contentDocument)return xe(r.contentDocument.body,e);if(e){const o=r.getAttribute("aria-activedescendant");if(o){const n=Q(r).getElementById(o);if(n)return n}}return r}j(xe,"getActiveElement");function Ae(t){return t.tagName==="IFRAME"}j(Ae,"isFrame");var lt=Object.defineProperty,b=(t,e)=>lt(t,"name",{value:e,configurable:!0});function Ee(t,e){return i.useReducer((r,o)=>e[r][o]??r,t)}b(Ee,"useStateMachine");var Re="ScrollArea",[ye,_t]=ve(Re),[ct,C]=ye(Re),it=i.forwardRef(b(function(e,r){const{__scopeScrollArea:o,type:n="hover",dir:c,scrollHideDelay:l=600,...a}=e,[s,u]=i.useState(null),[f,d]=i.useState(null),[m,h]=i.useState(null),[p,v]=i.useState(null),[g,x]=i.useState(null),[N,z]=i.useState(0),[q,F]=i.useState(0),[H,M]=i.useState(!1),[Y,I]=i.useState(!1),w=O(r,u),A=ge(c);return S.jsx(ct,{scope:o,type:n,dir:A,scrollHideDelay:l,scrollArea:s,viewport:f,onViewportChange:d,content:m,onContentChange:h,scrollbarX:p,onScrollbarXChange:v,scrollbarXEnabled:H,onScrollbarXEnabledChange:M,scrollbarY:g,onScrollbarYChange:x,scrollbarYEnabled:Y,onScrollbarYEnabledChange:I,onCornerWidthChange:z,onCornerHeightChange:F,children:S.jsx($.div,{dir:A,...a,ref:w,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":q+"px",...e.style}})})},"ScrollArea")),at="ScrollAreaViewport",st=i.forwardRef(b(function(e,r){const{__scopeScrollArea:o,children:n,nonce:c,...l}=e,a=C(at,o),s=i.useRef(null),u=O(r,s,a.onViewportChange);return S.jsxs(S.Fragment,{children:[S.jsx(ut,{nonce:c}),S.jsx($.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:S.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})},"ScrollAreaViewport")),ut=i.memo(b(function({nonce:e}){return S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e})},"ScrollAreaViewportStyle"),(t,e)=>t.nonce===e.nonce),y="ScrollAreaScrollbar",dt=i.forwardRef(b(function(e,r){const{forceMount:o,...n}=e,c=C(y,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:a}=c,s=e.orientation==="horizontal";return i.useEffect(()=>(s?l(!0):a(!0),()=>{s?l(!1):a(!1)}),[s,l,a]),c.type==="hover"?S.jsx(ft,{...n,ref:r,forceMount:o}):c.type==="scroll"?S.jsx(ht,{...n,ref:r,forceMount:o}):c.type==="auto"?S.jsx(_e,{...n,ref:r,forceMount:o}):c.type==="always"?S.jsx(oe,{...n,ref:r,"data-state":"visible"}):null},"ScrollAreaScrollbar")),ft=i.forwardRef(b(function(e,r){const{forceMount:o,...n}=e,c=C(y,e.__scopeScrollArea),[l,a]=i.useState(!1);return i.useEffect(()=>{const s=c.scrollArea;let u=0;if(s){const f=b(()=>{window.clearTimeout(u),a(!0)},"handlePointerEnter"),d=b(()=>{u=window.setTimeout(()=>a(!1),c.scrollHideDelay)},"handlePointerLeave");return s.addEventListener("pointerenter",f),s.addEventListener("pointerleave",d),()=>{window.clearTimeout(u),s.removeEventListener("pointerenter",f),s.removeEventListener("pointerleave",d)}}},[c.scrollArea,c.scrollHideDelay]),S.jsx(B,{present:o||l,children:S.jsx(_e,{"data-state":l?"visible":"hidden",...n,ref:r})})},"ScrollAreaScrollbarHover")),ht=i.forwardRef(b(function(e,r){const{forceMount:o,...n}=e,c=C(y,e.__scopeScrollArea),l=e.orientation==="horizontal",a=V(()=>u("SCROLL_END"),100),[s,u]=Ee("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return i.useEffect(()=>{if(s==="idle"){const f=window.setTimeout(()=>u("HIDE"),c.scrollHideDelay);return()=>window.clearTimeout(f)}},[s,c.scrollHideDelay,u]),i.useEffect(()=>{const f=c.viewport,d=l?"scrollLeft":"scrollTop";if(f){let m=f[d];const h=b(()=>{const p=f[d];m!==p&&(u("SCROLL"),a()),m=p},"handleScroll");return f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[c.viewport,l,u,a]),S.jsx(B,{present:o||s!=="hidden",children:S.jsx(oe,{"data-state":s==="hidden"?"hidden":"visible",...n,ref:r,onPointerEnter:T(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:T(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),_e=i.forwardRef(b(function(e,r){const o=C(y,e.__scopeScrollArea),{forceMount:n,...c}=e,[l,a]=i.useState(!1),s=e.orientation==="horizontal",u=V(()=>{if(o.viewport){const f=o.viewport.offsetWidth<o.viewport.scrollWidth,d=o.viewport.offsetHeight<o.viewport.scrollHeight;a(s?f:d)}},10);return D(o.viewport,u),D(o.content,u),S.jsx(B,{present:n||l,children:S.jsx(oe,{"data-state":l?"visible":"hidden",...c,ref:r})})},"ScrollAreaScrollbarAuto")),oe=i.forwardRef(b(function(e,r){const{orientation:o="vertical",...n}=e,c=C(y,e.__scopeScrollArea),l=i.useRef(null),a=i.useRef(0),[s,u]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=ne(s.viewport,s.content),d={...n,sizes:s,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:b(h=>l.current=h,"onThumbChange"),onThumbPointerUp:b(()=>a.current=0,"onThumbPointerUp"),onThumbPointerDown:b(h=>a.current=h,"onThumbPointerDown")};function m(h,p){return De(h,a.current,s,p)}return b(m,"getScrollPosition"),o==="horizontal"?S.jsx(pt,{...d,ref:r,onThumbPositionChange:()=>{if(c.viewport&&l.current){const h=c.viewport.scrollLeft,p=te(h,s,c.dir);l.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{c.viewport&&(c.viewport.scrollLeft=h)},onDragScroll:h=>{c.viewport&&(c.viewport.scrollLeft=m(h,c.dir))}}):o==="vertical"?S.jsx(mt,{...d,ref:r,onThumbPositionChange:()=>{if(c.viewport&&l.current){const h=c.viewport.scrollTop,p=te(h,s);l.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{c.viewport&&(c.viewport.scrollTop=h)},onDragScroll:h=>{c.viewport&&(c.viewport.scrollTop=m(h))}}):null},"ScrollAreaScrollbarVisible")),pt=i.forwardRef(b(function(e,r){const{sizes:o,onSizesChange:n,...c}=e,l=C(y,e.__scopeScrollArea),[a,s]=i.useState(),u=i.useRef(null),f=O(r,u,l.onScrollbarXChange);return i.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),S.jsx(Oe,{"data-orientation":"horizontal",...c,ref:f,sizes:o,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":U(o)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,m)=>{if(l.viewport){const h=l.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),ce(h,m)&&d.preventDefault()}},onResize:()=>{u.current&&l.viewport&&a&&n({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:W(a.paddingLeft),paddingEnd:W(a.paddingRight)}})}})},"ScrollAreaScrollbarX")),mt=i.forwardRef(b(function(e,r){const{sizes:o,onSizesChange:n,...c}=e,l=C(y,e.__scopeScrollArea),[a,s]=i.useState(),u=i.useRef(null),f=O(r,u,l.onScrollbarYChange);return i.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),S.jsx(Oe,{"data-orientation":"vertical",...c,ref:f,sizes:o,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":U(o)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,m)=>{if(l.viewport){const h=l.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),ce(h,m)&&d.preventDefault()}},onResize:()=>{u.current&&l.viewport&&a&&n({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:W(a.paddingTop),paddingEnd:W(a.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[St,Te]=ye(y),Oe=i.forwardRef(b(function(e,r){const{__scopeScrollArea:o,sizes:n,hasThumb:c,onThumbChange:l,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:d,onResize:m,...h}=e,p=C(y,o),[v,g]=i.useState(null),x=O(r,g),N=i.useRef(null),z=i.useRef(""),q=p.viewport,F=n.content-n.viewport,H=_(d),M=_(u),Y=V(m,10);function I(w){if(N.current){const A=w.clientX-N.current.left,k=w.clientY-N.current.top;f({x:A,y:k})}}return b(I,"handleDragScroll"),i.useEffect(()=>{const w=b(A=>{const k=A.target;(v==null?void 0:v.contains(k))&&H(A,F)},"handleWheel");return document.addEventListener("wheel",w,{passive:!1}),()=>document.removeEventListener("wheel",w,{passive:!1})},[q,v,F,H]),i.useEffect(M,[n,M]),D(v,Y),D(p.content,Y),S.jsx(St,{scope:o,scrollbar:v,hasThumb:c,onThumbChange:_(l),onThumbPointerUp:_(a),onThumbPositionChange:M,onThumbPointerDown:_(s),children:S.jsx($.div,{...h,ref:x,style:{position:"absolute",...h.style},onPointerDown:T(e.onPointerDown,w=>{w.button===0&&(w.target.setPointerCapture(w.pointerId),N.current=v.getBoundingClientRect(),z.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),I(w))}),onPointerMove:T(e.onPointerMove,I),onPointerUp:T(e.onPointerUp,w=>{const A=w.target;A.hasPointerCapture(w.pointerId)&&A.releasePointerCapture(w.pointerId),document.body.style.webkitUserSelect=z.current,p.viewport&&(p.viewport.style.scrollBehavior=""),N.current=null})})})},"ScrollAreaScrollbarImpl")),ee="ScrollAreaThumb",bt=i.forwardRef(b(function(e,r){const{forceMount:o,...n}=e,c=Te(ee,e.__scopeScrollArea);return S.jsx(B,{present:o||c.hasThumb,children:S.jsx(vt,{ref:r,...n})})},"ScrollAreaThumb")),vt=i.forwardRef(b(function(e,r){const{__scopeScrollArea:o,style:n,...c}=e,l=C(ee,o),a=Te(ee,o),{onThumbPositionChange:s}=a,u=O(r,a.onThumbChange),f=i.useRef(void 0),d=V(()=>{f.current&&(f.current(),f.current=void 0)},100);return i.useEffect(()=>{const m=l.viewport;if(m){const h=b(()=>{if(d(),!f.current){const p=Pt(m,s);f.current=p,s()}},"handleScroll");return s(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[l.viewport,d,s]),S.jsx($.div,{"data-state":a.hasThumb?"visible":"hidden",...c,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:T(e.onPointerDownCapture,m=>{const p=m.target.getBoundingClientRect(),v=m.clientX-p.left,g=m.clientY-p.top;a.onThumbPointerDown({x:v,y:g})}),onPointerUp:T(e.onPointerUp,a.onThumbPointerUp)})},"ScrollAreaThumbImpl")),Ne="ScrollAreaCorner",wt=i.forwardRef(b(function(e,r){const o=C(Ne,e.__scopeScrollArea),n=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&n?S.jsx(gt,{...e,ref:r}):null},"ScrollAreaCorner")),gt=i.forwardRef(b(function(e,r){const{__scopeScrollArea:o,...n}=e,c=C(Ne,o),[l,a]=i.useState(0),[s,u]=i.useState(0),f=!!(l&&s),{onCornerWidthChange:d,onCornerHeightChange:m}=c;return D(c.scrollbarX,()=>{var p;const h=((p=c.scrollbarX)==null?void 0:p.offsetHeight)||0;c.onCornerHeightChange(h),u(h)}),D(c.scrollbarY,()=>{var p;const h=((p=c.scrollbarY)==null?void 0:p.offsetWidth)||0;c.onCornerWidthChange(h),a(h)}),i.useEffect(()=>()=>{d(0),m(0)},[d,m]),f?S.jsx($.div,{...n,ref:r,style:{width:l,height:s,position:"absolute",right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null},"ScrollAreaCornerImpl"));function W(t){return t?parseInt(t,10):0}b(W,"toInt");function ne(t,e){const r=t/e;return isNaN(r)?0:r}b(ne,"getThumbRatio");function U(t){const e=ne(t.viewport,t.content),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=(t.scrollbar.size-r)*e;return Math.max(o,18)}b(U,"getThumbSize");function De(t,e,r,o="ltr"){const n=U(r),c=n/2,l=e||c,a=n-l,s=r.scrollbar.paddingStart+l,u=r.scrollbar.size-r.scrollbar.paddingEnd-a,f=r.content-r.viewport,d=o==="ltr"?[0,f]:[f*-1,0];return le([s,u],d)(t)}b(De,"getScrollPositionFromPointer");function te(t,e,r="ltr"){const o=U(e),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,c=e.scrollbar.size-n,l=e.content-e.viewport,a=c-o,s=r==="ltr"?[0,l]:[l*-1,0],u=Pe(t,s);return le([0,l],[0,a])(u)}b(te,"getThumbOffsetFromScroll");function le(t,e){return r=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const o=(e[1]-e[0])/(t[1]-t[0]);return e[0]+o*(r-t[0])}}b(le,"linearScale");function ce(t,e){return t>0&&t<e}b(ce,"isScrollingWithinScrollbarBounds");var Pt=b((t,e=()=>{})=>{let r={left:t.scrollLeft,top:t.scrollTop},o=0;return b(function n(){const c={left:t.scrollLeft,top:t.scrollTop},l=r.left!==c.left,a=r.top!==c.top;(l||a)&&e(),r=c,o=window.requestAnimationFrame(n)},"loop")(),()=>window.cancelAnimationFrame(o)},"addUnlinkedScrollListener");function V(t,e){const r=_(t),o=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),i.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(r,e)},[r,e])}b(V,"useDebounceCallback");function D(t,e){const r=_(e);J(()=>{let o=0;if(t){const n=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(r)});return n.observe(t),()=>{window.cancelAnimationFrame(o),n.unobserve(t)}}},[t,r])}b(D,"useResizeObserver");var Ct=it,xt=st,At=wt;const Et=i.forwardRef(({className:t,children:e,...r},o)=>S.jsxs(Ct,{ref:o,className:Me("relative overflow-hidden",t),type:"auto",...r,children:[S.jsx(xt,{className:"h-full w-full rounded-[inherit] [&>div]:!block",children:e}),S.jsx(dt,{orientation:"vertical",className:"flex h-full w-2.5 touch-none select-none border-l border-l-transparent p-[1px] transition-colors",children:S.jsx(bt,{className:"relative flex-1 rounded-full bg-border"})}),S.jsx(At,{})]}));Et.displayName="ScrollArea";export{$ as P,Et as S,B as a,O as b,T as c,ve as d,J as u};
1
+ import{r as i,k as Le,j as S,o as je,d as Me}from"./index-UFq5tVw_.js";var Ie=Object.defineProperty,re=(t,e)=>Ie(t,"name",{value:e,configurable:!0});function Z(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}re(Z,"setRef");function ie(...t){return e=>{let r=!1;const o=t.map(n=>{const c=Z(n,e);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let n=0;n<o.length;n++){const c=o[n];typeof c=="function"?c():Z(t[n],null)}}}}re(ie,"composeRefs");function O(...t){return i.useCallback(ie(...t),t)}re(O,"useComposedRefs");var We=Object.defineProperty,E=(t,e)=>We(t,"name",{value:e,configurable:!0});function ae(t){const e=i.forwardRef((r,o)=>{let{children:n,...c}=r,l=null,a=!1;const s=[];G(n)&&typeof X=="function"&&(n=X(n._payload)),i.Children.forEach(n,m=>{var h;if(fe(m)){a=!0;const p=m;let v="child"in p.props?p.props.child:p.props.children;G(v)&&typeof X=="function"&&(v=X(v._payload)),l=Ue(p,v),s.push((h=l==null?void 0:l.props)==null?void 0:h.children)}else s.push(m)}),l?l=i.cloneElement(l,void 0,s):!a&&i.Children.count(n)===1&&i.isValidElement(n)&&(l=n);const u=l?de(l):void 0,f=O(o,u);if(!l){if(n||n===0)throw new Error(a?Fe(t):ze(t));return n}const d=ue(c,l.props??{});return l.type!==i.Fragment&&(d.ref=o?f:u),i.cloneElement(l,d)});return e.displayName=`${t}.Slot`,e}E(ae,"createSlot");var se=Symbol.for("radix.slottable");function $e(t){const e=E(r=>"child"in r?r.children(r.child):r.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=se,e}E($e,"createSlottable");var Ue=E((t,e)=>{if("child"in t.props){const r=t.props.child;return i.isValidElement(r)?i.cloneElement(r,void 0,t.props.children(r.props.children)):null}return i.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function ue(t,e){const r={...e};for(const o in e){const n=t[o],c=e[o];/^on[A-Z]/.test(o)?n&&c?r[o]=(...a)=>{const s=c(...a);return n(...a),s}:n&&(r[o]=n):o==="style"?r[o]={...n,...c}:o==="className"&&(r[o]=[n,c].filter(Boolean).join(" "))}return{...t,...r}}E(ue,"mergeProps");function de(t){var o,n;let e=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}E(de,"getElementRef");function fe(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===se}E(fe,"isSlottable");var Ve=Symbol.for("react.lazy");function G(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Ve&&"_payload"in t&&he(t._payload)}E(G,"isLazyComponent");function he(t){return typeof t=="object"&&t!==null&&"then"in t}E(he,"isPromiseLike");var ze=E(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Fe=E(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),X=Le[" use ".trim().toString()],He=Object.defineProperty,Ye=(t,e)=>He(t,"name",{value:e,configurable:!0}),ke=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$=ke.reduce((t,e)=>{const r=ae(`Primitive.${e}`),o=i.forwardRef((n,c)=>{const{asChild:l,...a}=n,s=l?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(s,{...a,ref:c})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{});function Xe(t,e){t&&je.flushSync(()=>t.dispatchEvent(e))}Ye(Xe,"dispatchDiscreteCustomEvent");var J=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},Be=Object.defineProperty,R=(t,e)=>Be(t,"name",{value:e,configurable:!0});function pe(t,e){return i.useReducer((r,o)=>e[r][o]??r,t)}R(pe,"useStateMachine");var B=R(t=>{const{present:e,children:r}=t,o=me(e),n=typeof r=="function"?r({present:o.isPresent}):i.Children.only(r),c=Se(o.ref,be(n));return typeof r=="function"||o.isPresent?i.cloneElement(n,{ref:c}):null},"Presence");function me(t){const[e,r]=i.useState(),o=i.useRef(null),n=i.useRef(t),c=i.useRef("none"),l=i.useRef(void 0),a=t?"mounted":"unmounted",[s,u]=pe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{s==="mounted"?(c.current=l.current??L(o.current),l.current=void 0):c.current="none"},[s]),J(()=>{const f=o.current,d=n.current;if(d!==t){const h=c.current,p=L(f);t?(l.current=p,u("MOUNT")):p==="none"||(f==null?void 0:f.display)==="none"?u("UNMOUNT"):u(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),n.current=t}},[t,u]),J(()=>{if(e){let f;const d=e.ownerDocument.defaultView??window,m=R(p=>{const g=L(o.current).includes(CSS.escape(p.animationName));if(p.target===e&&g&&(u("ANIMATION_END"),!n.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",f=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),h=R(p=>{p.target===e&&(c.current=L(o.current))},"handleAnimationStart");return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{d.clearTimeout(f),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:i.useCallback(f=>{if(f){const d=getComputedStyle(f);o.current=d,l.current=L(d)}else o.current=null;r(f)},[])}}R(me,"usePresence");function K(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}R(K,"setRef");function Se(...t){const e=i.useRef(t);return e.current=t,i.useCallback(r=>{const o=e.current;let n=!1;const c=o.map(l=>{const a=K(l,r);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let l=0;l<c.length;l++){const a=c[l];typeof a=="function"?a():K(o[l],null)}}},[])}R(Se,"useStableComposedRefs");function L(t){return(t==null?void 0:t.animationName)||"none"}R(L,"getAnimationName");function be(t){var o,n;let e=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}R(be,"getElementRef");var qe=Object.defineProperty,P=(t,e)=>qe(t,"name",{value:e,configurable:!0});function Ze(t,e){const r=i.createContext(e);r.displayName=t+"Context";const o=P(c=>{const{children:l,...a}=c,s=i.useMemo(()=>a,Object.values(a));return S.jsx(r.Provider,{value:s,children:l})},"Provider");o.displayName=t+"Provider";function n(c,l={}){const{optional:a=!1}=l,s=i.useContext(r);if(s)return s;if(e!==void 0)return e;if(!a)throw new Error(`\`${c}\` must be used within \`${t}\``)}return P(n,"useContext"),[o,n]}P(Ze,"createContext");function ve(t,e=[]){let r=[];function o(c,l){const a=i.createContext(l);a.displayName=c+"Context";const s=r.length;r=[...r,l];const u=P(d=>{var x;const{scope:m,children:h,...p}=d,v=((x=m==null?void 0:m[t])==null?void 0:x[s])||a,g=i.useMemo(()=>p,Object.values(p));return S.jsx(v.Provider,{value:g,children:h})},"Provider");u.displayName=c+"Provider";function f(d,m,h={}){var x;const{optional:p=!1}=h,v=((x=m==null?void 0:m[t])==null?void 0:x[s])||a,g=i.useContext(v);if(g)return g;if(l!==void 0)return l;if(!p)throw new Error(`\`${d}\` must be used within \`${c}\``)}return P(f,"useContext"),[u,f]}P(o,"createContext");const n=P(()=>{const c=r.map(l=>i.createContext(l));return P(function(a){const s=(a==null?void 0:a[t])||c;return i.useMemo(()=>({[`__scope${t}`]:{...a,[t]:s}}),[a,s])},"useScope")},"createScope");return n.scopeName=t,[o,we(n,...e)]}P(ve,"createContextScope");function we(...t){const e=t[0];if(t.length===1)return e;const r=P(()=>{const o=t.map(n=>({useScope:n(),scopeName:n.scopeName}));return P(function(c){const l=o.reduce((a,{useScope:s,scopeName:u})=>{const d=s(c)[`__scope${u}`];return{...a,...d}},{});return i.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])},"useComposedScopes")},"createScope");return r.scopeName=e.scopeName,r}P(we,"composeContextScopes");var Ge=Object.defineProperty,Je=(t,e)=>Ge(t,"name",{value:e,configurable:!0});function _(t){const e=i.useRef(t);return i.useEffect(()=>{e.current=t}),i.useMemo(()=>(...r)=>{var o;return(o=e.current)==null?void 0:o.call(e,...r)},[])}Je(_,"useCallbackRef");var Ke=Object.defineProperty,Qe=(t,e)=>Ke(t,"name",{value:e,configurable:!0}),et=i.createContext(void 0);function ge(t){const e=i.useContext(et);return t||e||"ltr"}Qe(ge,"useDirection");var tt=Object.defineProperty,rt=(t,e)=>tt(t,"name",{value:e,configurable:!0});function Pe(t,[e,r]){return Math.min(r,Math.max(e,t))}rt(Pe,"clamp");var ot=Object.defineProperty,j=(t,e)=>ot(t,"name",{value:e,configurable:!0}),Ce=!!(typeof window<"u"&&window.document&&window.document.createElement);function T(t,e,{checkForDefaultPrevented:r=!0}={}){return j(function(n){if(t==null||t(n),r===!1||!n||!n.defaultPrevented)return e==null?void 0:e(n)},"handleEvent")}j(T,"composeEventHandlers");function nt(t){var e;if(!Ce)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}j(nt,"getOwnerWindow");function Q(t){if(!Ce)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}j(Q,"getOwnerDocument");function xe(t,e=!1){const{activeElement:r}=Q(t);if(!(r!=null&&r.nodeName))return null;if(Ae(r)&&r.contentDocument)return xe(r.contentDocument.body,e);if(e){const o=r.getAttribute("aria-activedescendant");if(o){const n=Q(r).getElementById(o);if(n)return n}}return r}j(xe,"getActiveElement");function Ae(t){return t.tagName==="IFRAME"}j(Ae,"isFrame");var lt=Object.defineProperty,b=(t,e)=>lt(t,"name",{value:e,configurable:!0});function Ee(t,e){return i.useReducer((r,o)=>e[r][o]??r,t)}b(Ee,"useStateMachine");var Re="ScrollArea",[ye,_t]=ve(Re),[ct,C]=ye(Re),it=i.forwardRef(b(function(e,r){const{__scopeScrollArea:o,type:n="hover",dir:c,scrollHideDelay:l=600,...a}=e,[s,u]=i.useState(null),[f,d]=i.useState(null),[m,h]=i.useState(null),[p,v]=i.useState(null),[g,x]=i.useState(null),[N,z]=i.useState(0),[q,F]=i.useState(0),[H,M]=i.useState(!1),[Y,I]=i.useState(!1),w=O(r,u),A=ge(c);return S.jsx(ct,{scope:o,type:n,dir:A,scrollHideDelay:l,scrollArea:s,viewport:f,onViewportChange:d,content:m,onContentChange:h,scrollbarX:p,onScrollbarXChange:v,scrollbarXEnabled:H,onScrollbarXEnabledChange:M,scrollbarY:g,onScrollbarYChange:x,scrollbarYEnabled:Y,onScrollbarYEnabledChange:I,onCornerWidthChange:z,onCornerHeightChange:F,children:S.jsx($.div,{dir:A,...a,ref:w,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":q+"px",...e.style}})})},"ScrollArea")),at="ScrollAreaViewport",st=i.forwardRef(b(function(e,r){const{__scopeScrollArea:o,children:n,nonce:c,...l}=e,a=C(at,o),s=i.useRef(null),u=O(r,s,a.onViewportChange);return S.jsxs(S.Fragment,{children:[S.jsx(ut,{nonce:c}),S.jsx($.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:S.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})},"ScrollAreaViewport")),ut=i.memo(b(function({nonce:e}){return S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e})},"ScrollAreaViewportStyle"),(t,e)=>t.nonce===e.nonce),y="ScrollAreaScrollbar",dt=i.forwardRef(b(function(e,r){const{forceMount:o,...n}=e,c=C(y,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:a}=c,s=e.orientation==="horizontal";return i.useEffect(()=>(s?l(!0):a(!0),()=>{s?l(!1):a(!1)}),[s,l,a]),c.type==="hover"?S.jsx(ft,{...n,ref:r,forceMount:o}):c.type==="scroll"?S.jsx(ht,{...n,ref:r,forceMount:o}):c.type==="auto"?S.jsx(_e,{...n,ref:r,forceMount:o}):c.type==="always"?S.jsx(oe,{...n,ref:r,"data-state":"visible"}):null},"ScrollAreaScrollbar")),ft=i.forwardRef(b(function(e,r){const{forceMount:o,...n}=e,c=C(y,e.__scopeScrollArea),[l,a]=i.useState(!1);return i.useEffect(()=>{const s=c.scrollArea;let u=0;if(s){const f=b(()=>{window.clearTimeout(u),a(!0)},"handlePointerEnter"),d=b(()=>{u=window.setTimeout(()=>a(!1),c.scrollHideDelay)},"handlePointerLeave");return s.addEventListener("pointerenter",f),s.addEventListener("pointerleave",d),()=>{window.clearTimeout(u),s.removeEventListener("pointerenter",f),s.removeEventListener("pointerleave",d)}}},[c.scrollArea,c.scrollHideDelay]),S.jsx(B,{present:o||l,children:S.jsx(_e,{"data-state":l?"visible":"hidden",...n,ref:r})})},"ScrollAreaScrollbarHover")),ht=i.forwardRef(b(function(e,r){const{forceMount:o,...n}=e,c=C(y,e.__scopeScrollArea),l=e.orientation==="horizontal",a=V(()=>u("SCROLL_END"),100),[s,u]=Ee("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return i.useEffect(()=>{if(s==="idle"){const f=window.setTimeout(()=>u("HIDE"),c.scrollHideDelay);return()=>window.clearTimeout(f)}},[s,c.scrollHideDelay,u]),i.useEffect(()=>{const f=c.viewport,d=l?"scrollLeft":"scrollTop";if(f){let m=f[d];const h=b(()=>{const p=f[d];m!==p&&(u("SCROLL"),a()),m=p},"handleScroll");return f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[c.viewport,l,u,a]),S.jsx(B,{present:o||s!=="hidden",children:S.jsx(oe,{"data-state":s==="hidden"?"hidden":"visible",...n,ref:r,onPointerEnter:T(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:T(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),_e=i.forwardRef(b(function(e,r){const o=C(y,e.__scopeScrollArea),{forceMount:n,...c}=e,[l,a]=i.useState(!1),s=e.orientation==="horizontal",u=V(()=>{if(o.viewport){const f=o.viewport.offsetWidth<o.viewport.scrollWidth,d=o.viewport.offsetHeight<o.viewport.scrollHeight;a(s?f:d)}},10);return D(o.viewport,u),D(o.content,u),S.jsx(B,{present:n||l,children:S.jsx(oe,{"data-state":l?"visible":"hidden",...c,ref:r})})},"ScrollAreaScrollbarAuto")),oe=i.forwardRef(b(function(e,r){const{orientation:o="vertical",...n}=e,c=C(y,e.__scopeScrollArea),l=i.useRef(null),a=i.useRef(0),[s,u]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=ne(s.viewport,s.content),d={...n,sizes:s,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:b(h=>l.current=h,"onThumbChange"),onThumbPointerUp:b(()=>a.current=0,"onThumbPointerUp"),onThumbPointerDown:b(h=>a.current=h,"onThumbPointerDown")};function m(h,p){return De(h,a.current,s,p)}return b(m,"getScrollPosition"),o==="horizontal"?S.jsx(pt,{...d,ref:r,onThumbPositionChange:()=>{if(c.viewport&&l.current){const h=c.viewport.scrollLeft,p=te(h,s,c.dir);l.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{c.viewport&&(c.viewport.scrollLeft=h)},onDragScroll:h=>{c.viewport&&(c.viewport.scrollLeft=m(h,c.dir))}}):o==="vertical"?S.jsx(mt,{...d,ref:r,onThumbPositionChange:()=>{if(c.viewport&&l.current){const h=c.viewport.scrollTop,p=te(h,s);l.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{c.viewport&&(c.viewport.scrollTop=h)},onDragScroll:h=>{c.viewport&&(c.viewport.scrollTop=m(h))}}):null},"ScrollAreaScrollbarVisible")),pt=i.forwardRef(b(function(e,r){const{sizes:o,onSizesChange:n,...c}=e,l=C(y,e.__scopeScrollArea),[a,s]=i.useState(),u=i.useRef(null),f=O(r,u,l.onScrollbarXChange);return i.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),S.jsx(Oe,{"data-orientation":"horizontal",...c,ref:f,sizes:o,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":U(o)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,m)=>{if(l.viewport){const h=l.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),ce(h,m)&&d.preventDefault()}},onResize:()=>{u.current&&l.viewport&&a&&n({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:W(a.paddingLeft),paddingEnd:W(a.paddingRight)}})}})},"ScrollAreaScrollbarX")),mt=i.forwardRef(b(function(e,r){const{sizes:o,onSizesChange:n,...c}=e,l=C(y,e.__scopeScrollArea),[a,s]=i.useState(),u=i.useRef(null),f=O(r,u,l.onScrollbarYChange);return i.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),S.jsx(Oe,{"data-orientation":"vertical",...c,ref:f,sizes:o,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":U(o)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,m)=>{if(l.viewport){const h=l.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),ce(h,m)&&d.preventDefault()}},onResize:()=>{u.current&&l.viewport&&a&&n({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:W(a.paddingTop),paddingEnd:W(a.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[St,Te]=ye(y),Oe=i.forwardRef(b(function(e,r){const{__scopeScrollArea:o,sizes:n,hasThumb:c,onThumbChange:l,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:d,onResize:m,...h}=e,p=C(y,o),[v,g]=i.useState(null),x=O(r,g),N=i.useRef(null),z=i.useRef(""),q=p.viewport,F=n.content-n.viewport,H=_(d),M=_(u),Y=V(m,10);function I(w){if(N.current){const A=w.clientX-N.current.left,k=w.clientY-N.current.top;f({x:A,y:k})}}return b(I,"handleDragScroll"),i.useEffect(()=>{const w=b(A=>{const k=A.target;(v==null?void 0:v.contains(k))&&H(A,F)},"handleWheel");return document.addEventListener("wheel",w,{passive:!1}),()=>document.removeEventListener("wheel",w,{passive:!1})},[q,v,F,H]),i.useEffect(M,[n,M]),D(v,Y),D(p.content,Y),S.jsx(St,{scope:o,scrollbar:v,hasThumb:c,onThumbChange:_(l),onThumbPointerUp:_(a),onThumbPositionChange:M,onThumbPointerDown:_(s),children:S.jsx($.div,{...h,ref:x,style:{position:"absolute",...h.style},onPointerDown:T(e.onPointerDown,w=>{w.button===0&&(w.target.setPointerCapture(w.pointerId),N.current=v.getBoundingClientRect(),z.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),I(w))}),onPointerMove:T(e.onPointerMove,I),onPointerUp:T(e.onPointerUp,w=>{const A=w.target;A.hasPointerCapture(w.pointerId)&&A.releasePointerCapture(w.pointerId),document.body.style.webkitUserSelect=z.current,p.viewport&&(p.viewport.style.scrollBehavior=""),N.current=null})})})},"ScrollAreaScrollbarImpl")),ee="ScrollAreaThumb",bt=i.forwardRef(b(function(e,r){const{forceMount:o,...n}=e,c=Te(ee,e.__scopeScrollArea);return S.jsx(B,{present:o||c.hasThumb,children:S.jsx(vt,{ref:r,...n})})},"ScrollAreaThumb")),vt=i.forwardRef(b(function(e,r){const{__scopeScrollArea:o,style:n,...c}=e,l=C(ee,o),a=Te(ee,o),{onThumbPositionChange:s}=a,u=O(r,a.onThumbChange),f=i.useRef(void 0),d=V(()=>{f.current&&(f.current(),f.current=void 0)},100);return i.useEffect(()=>{const m=l.viewport;if(m){const h=b(()=>{if(d(),!f.current){const p=Pt(m,s);f.current=p,s()}},"handleScroll");return s(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[l.viewport,d,s]),S.jsx($.div,{"data-state":a.hasThumb?"visible":"hidden",...c,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:T(e.onPointerDownCapture,m=>{const p=m.target.getBoundingClientRect(),v=m.clientX-p.left,g=m.clientY-p.top;a.onThumbPointerDown({x:v,y:g})}),onPointerUp:T(e.onPointerUp,a.onThumbPointerUp)})},"ScrollAreaThumbImpl")),Ne="ScrollAreaCorner",wt=i.forwardRef(b(function(e,r){const o=C(Ne,e.__scopeScrollArea),n=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&n?S.jsx(gt,{...e,ref:r}):null},"ScrollAreaCorner")),gt=i.forwardRef(b(function(e,r){const{__scopeScrollArea:o,...n}=e,c=C(Ne,o),[l,a]=i.useState(0),[s,u]=i.useState(0),f=!!(l&&s),{onCornerWidthChange:d,onCornerHeightChange:m}=c;return D(c.scrollbarX,()=>{var p;const h=((p=c.scrollbarX)==null?void 0:p.offsetHeight)||0;c.onCornerHeightChange(h),u(h)}),D(c.scrollbarY,()=>{var p;const h=((p=c.scrollbarY)==null?void 0:p.offsetWidth)||0;c.onCornerWidthChange(h),a(h)}),i.useEffect(()=>()=>{d(0),m(0)},[d,m]),f?S.jsx($.div,{...n,ref:r,style:{width:l,height:s,position:"absolute",right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null},"ScrollAreaCornerImpl"));function W(t){return t?parseInt(t,10):0}b(W,"toInt");function ne(t,e){const r=t/e;return isNaN(r)?0:r}b(ne,"getThumbRatio");function U(t){const e=ne(t.viewport,t.content),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=(t.scrollbar.size-r)*e;return Math.max(o,18)}b(U,"getThumbSize");function De(t,e,r,o="ltr"){const n=U(r),c=n/2,l=e||c,a=n-l,s=r.scrollbar.paddingStart+l,u=r.scrollbar.size-r.scrollbar.paddingEnd-a,f=r.content-r.viewport,d=o==="ltr"?[0,f]:[f*-1,0];return le([s,u],d)(t)}b(De,"getScrollPositionFromPointer");function te(t,e,r="ltr"){const o=U(e),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,c=e.scrollbar.size-n,l=e.content-e.viewport,a=c-o,s=r==="ltr"?[0,l]:[l*-1,0],u=Pe(t,s);return le([0,l],[0,a])(u)}b(te,"getThumbOffsetFromScroll");function le(t,e){return r=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const o=(e[1]-e[0])/(t[1]-t[0]);return e[0]+o*(r-t[0])}}b(le,"linearScale");function ce(t,e){return t>0&&t<e}b(ce,"isScrollingWithinScrollbarBounds");var Pt=b((t,e=()=>{})=>{let r={left:t.scrollLeft,top:t.scrollTop},o=0;return b(function n(){const c={left:t.scrollLeft,top:t.scrollTop},l=r.left!==c.left,a=r.top!==c.top;(l||a)&&e(),r=c,o=window.requestAnimationFrame(n)},"loop")(),()=>window.cancelAnimationFrame(o)},"addUnlinkedScrollListener");function V(t,e){const r=_(t),o=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),i.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(r,e)},[r,e])}b(V,"useDebounceCallback");function D(t,e){const r=_(e);J(()=>{let o=0;if(t){const n=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(r)});return n.observe(t),()=>{window.cancelAnimationFrame(o),n.unobserve(t)}}},[t,r])}b(D,"useResizeObserver");var Ct=it,xt=st,At=wt;const Et=i.forwardRef(({className:t,children:e,...r},o)=>S.jsxs(Ct,{ref:o,className:Me("relative overflow-hidden",t),type:"auto",...r,children:[S.jsx(xt,{className:"h-full w-full rounded-[inherit] [&>div]:!block",children:e}),S.jsx(dt,{orientation:"vertical",className:"flex h-full w-2.5 touch-none select-none border-l border-l-transparent p-[1px] transition-colors",children:S.jsx(bt,{className:"relative flex-1 rounded-full bg-border"})}),S.jsx(At,{})]}));Et.displayName="ScrollArea";export{$ as P,Et as S,B as a,O as b,T as c,ve as d,J as u};
@@ -1 +1 @@
1
- import{i as e0,j as e,d as E,r as i,k,l as O,u as t0,a as S,m as z,C as s0,n as n0}from"./index-CMgGagyE.js";import{u as V,h as Q,V as r0,a as P}from"./vm-status-badges-QaK7sEZ4.js";import{u as o0,P as a0,a as K}from"./processes-C3xk9hpI.js";import{u as M}from"./useMutation-B4fxUbt-.js";import{u as _,P as A,c as l0,a as c0,b as i0,d as d0,S as u0}from"./scroll-area-DKdlhVEr.js";import"./hooks-B_kCGlJx.js";const F=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,$=e0,m0=(t,s)=>n=>{var o;if((s==null?void 0:s.variants)==null)return $(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:l}=s,c=Object.keys(r).map(u=>{const m=n==null?void 0:n[u],f=l==null?void 0:l[u];if(m===null)return null;const x=F(m)||F(f);return r[u][x]}),a=n&&Object.entries(n).reduce((u,m)=>{let[f,x]=m;return x===void 0||(u[f]=x),u},{}),d=s==null||(o=s.compoundVariants)===null||o===void 0?void 0:o.reduce((u,m)=>{let{class:f,className:x,...p}=m;return Object.entries(p).every(v=>{let[j,g]=v;return Array.isArray(g)?g.includes({...l,...a}[j]):{...l,...a}[j]===g})?[...u,f,x]:u},[]);return $(t,c,d,n==null?void 0:n.class,n==null?void 0:n.className)},f0=m0("inline-flex items-center tracking-normal rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors whitespace-nowrap max-w-full overflow-hidden truncate",{variants:{variant:{secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-foreground"}},defaultVariants:{variant:"secondary"}});function U({className:t,variant:s,...n}){return e.jsx("div",{className:E(f0({variant:s}),t),...n})}var x0=Object.defineProperty,g0=(t,s)=>x0(t,"name",{value:s,configurable:!0}),D=k[" useEffectEvent ".trim().toString()],I=k[" useInsertionEffect ".trim().toString()];function G(t){if(typeof D=="function")return D(t);const s=i.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof I=="function"?I(()=>{s.current=t}):_(()=>{s.current=t}),i.useMemo(()=>(...n)=>{var o;return(o=s.current)==null?void 0:o.call(s,...n)},[])}g0(G,"useEffectEvent");var p0=Object.defineProperty,w=(t,s)=>p0(t,"name",{value:s,configurable:!0}),h0=k[" useInsertionEffect ".trim().toString()]||_;function Z({prop:t,defaultProp:s,onChange:n=w(()=>{},"onChange"),caller:o}){const[r,l,c]=J({defaultProp:s,onChange:n}),a=t!==void 0,d=a?t:r,u=i.useCallback(m=>{var f;if(a){const x=W(m)?m(t):m;x!==t&&((f=c.current)==null||f.call(c,x))}else l(m)},[a,t,l,c]);return[d,u]}w(Z,"useControllableState");function J({defaultProp:t,onChange:s}){const[n,o]=i.useState(t),r=i.useRef(n),l=i.useRef(s);return h0(()=>{l.current=s},[s]),i.useEffect(()=>{var c;r.current!==n&&((c=l.current)==null||c.call(l,n),r.current=n)},[n,r]),[n,o,l]}w(J,"useUncontrolledState");function W(t){return typeof t=="function"}w(W,"isFunction");var H=Symbol("RADIX:SYNC_STATE");function v0(t,s,n,o){const{prop:r,defaultProp:l,onChange:c,caller:a}=s,d=r!==void 0,u=G(c),m=[{...n,state:l}];o&&m.push(o);const[f,x]=i.useReducer((g,C)=>{if(C.type===H)return{...g,state:C.state};const b=t(g,C);return d&&!Object.is(b.state,g.state)&&u(b.state),b},...m),p=f.state,v=i.useRef(p);i.useEffect(()=>{v.current!==p&&(v.current=p,d||u(p))},[p,v,d]);const j=i.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return i.useEffect(()=>{d&&!Object.is(r,f.state)&&x({type:H,state:r})},[r,f.state,d]),[j,x]}w(v0,"useControllableStateReducer");var b0=Object.defineProperty,j0=(t,s)=>b0(t,"name",{value:s,configurable:!0}),C0=k[" useId ".trim().toString()]||(()=>{}),y0=0;function X(t){const[s,n]=i.useState(C0());return _(()=>{t||n(o=>o??String(y0++))},[t]),t||(s?`radix-${s}`:"")}j0(X,"useId");var w0=Object.defineProperty,N=(t,s)=>w0(t,"name",{value:s,configurable:!0}),T="Collapsible",[N0,ae]=d0(T),[S0,B]=N0(T),P0=i.forwardRef(N(function(s,n){const{__scopeCollapsible:o,open:r,defaultOpen:l,disabled:c,onOpenChange:a,...d}=s,[u,m]=Z({prop:r,defaultProp:l??!1,onChange:a,caller:T});return e.jsx(S0,{scope:o,disabled:c,contentId:X(),open:u,onOpenToggle:i.useCallback(()=>m(f=>!f),[m]),children:e.jsx(A.div,{"data-state":R(u),"data-disabled":c?"":void 0,...d,ref:n})})},"Collapsible")),k0="CollapsibleTrigger",_0=i.forwardRef(N(function(s,n){const{__scopeCollapsible:o,...r}=s,l=B(k0,o);return e.jsx(A.button,{type:"button","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open||!1,"data-state":R(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...r,ref:n,onClick:l0(s.onClick,l.onOpenToggle)})},"CollapsibleTrigger")),Y="CollapsibleContent",R0=i.forwardRef(N(function(s,n){const{forceMount:o,...r}=s,l=B(Y,s.__scopeCollapsible);return e.jsx(c0,{present:o||l.open,children:({present:c})=>e.jsx(E0,{...r,ref:n,present:c})})},"CollapsibleContent")),E0=i.forwardRef(N(function(s,n){const{__scopeCollapsible:o,present:r,children:l,...c}=s,a=B(Y,o),[d,u]=i.useState(r),m=i.useRef(null),f=i0(n,m),x=i.useRef(0),p=x.current,v=i.useRef(0),j=v.current,g=a.open||d,C=i.useRef(g),b=i.useRef(void 0);return i.useEffect(()=>{const h=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(h)},[]),_(()=>{const h=m.current;if(h){b.current=b.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const L=h.getBoundingClientRect();x.current=L.height,v.current=L.width,C.current||(h.style.transitionDuration=b.current.transitionDuration,h.style.animationName=b.current.animationName),u(r)}},[a.open,r]),e.jsx(A.div,{"data-state":R(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!g,...c,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...s.style},children:g&&l})},"CollapsibleContentImpl"));function R(t){return t?"open":"closed"}N(R,"getState");var O0=P0;const V0=O0,M0=_0,A0=R0,T0="data:image/svg+xml,%3csvg%20width='100'%20height='100'%20viewBox='0%200%20100%20100'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2212_248)'%3e%3cpath%20d='M0%200H100V100H0V0Z'%20fill='%23F03603'/%3e%3cpath%20d='M36%2072.2222V27.7778H51.2381C57.5873%2027.7778%2062.6667%2032.8571%2062.6667%2039.2063V41.746C62.6667%2044.6667%2061.5873%2047.3968%2059.7461%2049.3651C62.2858%2051.4603%2063.9366%2054.6349%2063.9366%2058.254V60.7936C63.9366%2067.1428%2058.8572%2072.2222%2052.508%2072.2222H36ZM42.3493%2065.873H52.508C55.3651%2065.873%2057.5873%2063.6508%2057.5873%2060.7936V58.254C57.5873%2055.3968%2055.3651%2053.1746%2052.508%2053.1746H42.3493V65.873ZM42.3493%2046.8254H51.2381C54.0953%2046.8254%2056.3175%2044.6032%2056.3175%2041.746V39.2063C56.3175%2036.3492%2054.0953%2034.127%2051.2381%2034.127H42.3493V46.8254Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2212_248'%3e%3crect%20width='100'%20height='100'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",B0=""+new URL("coreutils-CQXb6ysD.svg",import.meta.url).href,L0="data:image/svg+xml,%3csvg%20fill='%23073551'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ecurl%3c/title%3e%3cpath%20d='M.803%2014.8169c0-.5342.433-.9665.9665-.9665.5335%200%20.9665.4323.9665.9665%200%20.5335-.433.9657-.9665.9657-.5335%200-.9666-.4322-.9666-.9657m2.736%200c0-.1963-.0532-.376-.1119-.5525-.2344-.7024-.876-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0708C.6149%2013.2865%200%2013.9646%200%2014.817c0%20.9764.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.793%201.7694-1.7694m-1.7694-7.149c.5335%200%20.9665.433.9665.9665%200%20.5335-.433.9665-.9665.9665-.5343%200-.9666-.433-.9666-.9665%200-.5335.4323-.9665.9666-.9665m0%202.7359c.9772%200%201.7694-.7923%201.7694-1.7694%200-.1956-.0532-.376-.1119-.5525-.2344-.7024-.8767-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0716C.6149%207.104%200%207.782%200%208.6344c0%20.9771.7923%201.7694%201.7695%201.7694m13.221-5.694c-.5342%200-.9665-.433-.9665-.9664a.966.966%200%2001.9666-.9665c.5335%200%20.9658.4322.9658.9665%200%20.5334-.4323.9664-.9658.9664m-9.6%2016.5133c-.5335%200-.9666-.433-.9666-.9665%200-.5342.433-.9665.9666-.9665a.966.966%200%2001.9665.9665c0%20.5335-.4323.9665-.9665.9665m9.6-19.2491c-.978%200-1.7695.7922-1.7695%201.7694%200%20.2085.0525.4025.1187.5882L5.039%2018.5581c-.803.1681-1.4179.8462-1.4179%201.6985%200%20.9772.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.7922%201.7694-1.7694%200-.1963-.0525-.3759-.111-.5525l8.3427-14.2728c.7778-.1865%201.3683-.8531%201.3683-1.688%200-.977-.793-1.7693-1.7694-1.7693m7.24%202.7359c-.5343%200-.9666-.433-.9666-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9666.4322.9666.9665%200%20.5334-.433.9665-.9666.9665M12.6313%2021.223c-.5343%200-.9665-.433-.9665-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9658.4323.9658.9665%200%20.5335-.4323.9665-.9658.9665M22.2305%201.974c-.9772%200-1.7694.7922-1.7694%201.7694%200%20.2085.0525.4025.1187.5882l-8.3009%2014.2265c-.8021.1681-1.417.8462-1.417%201.6985%200%20.9772.7922%201.7694%201.7694%201.7694.9764%200%201.7687-.7922%201.7687-1.7694%200-.1963-.0525-.3759-.1111-.5525l8.3427-14.2728C23.4094%205.2448%2024%204.5782%2024%203.7433c0-.977-.7923-1.7693-1.7695-1.7693'/%3e%3c/svg%3e",z0="data:image/svg+xml,%3csvg%20fill='%23FFF000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",F0="data:image/svg+xml,%3csvg%20fill='%23F03C2E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGit%3c/title%3e%3cpath%20d='M13.09%2023.549a1.54%201.54%200%200%201-2.18%200L.451%2013.089a1.54%201.54%200%200%201%200-2.179l7.191-7.19%202.733%202.733a1.85%201.85%200%200%200%20.964%202.326v6.66a1.849%201.849%200%201%200%201.54%200V8.957l2.508%202.508a1.85%201.85%200%201%200%201.09-1.09l-2.634-2.634a1.85%201.85%200%200%200-2.378-2.377L8.73%202.63%2010.91.451a1.54%201.54%200%200%201%202.179%200l10.459%2010.46a1.54%201.54%200%200%201%200%202.179z'/%3e%3c/svg%3e",$0="data:image/svg+xml,%3csvg%20width='400'%20height='220'%20version='1.0'%20viewBox='0%200%20400%20220'%20xmlns='http://www.w3.org/2000/svg'%3e%3cstyle%3e@media%20(prefers-color-scheme:dark){g[fill]{filter:invert(1);stroke:none}}%3c/style%3e%3cg%20transform='scale(.1)'%20stroke='%23fff'%20stroke-width='10'%3e%3cg%20fill='%23444'%3e%3ccircle%20cx='220'%20cy='1570'%20r='190'/%3e%3cpath%20d='m1330%20312c-30%2041-698%201492-710%201528s25%2066%20100%20101c77%2036%20102%2034%20124%203s701-1477%20716-1525c15-47-20-73-84-104s-116-44-146-3z'/%3e%3c/g%3e%3cg%20fill='%23111'%3e%3ccircle%20cx='2410'%20cy='200'%20r='190'/%3e%3cpath%20d='m1830%20655c0%20129%200%20130%2070%20130h360v423c0%20246-5%20474-10%20506-19%20112-88%20176-190%20176-59%200-120-27-147-66-51-73-65-84-99-84-31%200-40%208-104%2093-84%20111-86%20129-32%20189%20227%20252%20692%20187%20836-118%2053-112%2056-153%2056-795v-514c0-64-30-100-100-100h-490c-149%200-150%200-150%20160zM2867%201233c30%20302%20250%20499%20438%20527%20144%2019%20244%200%20375-90v410c0%2081%200%20100%20150%20100%20136%200%20150-20%20150-150v-1420c0-99-19-100-150-100s-139%2015-139%2082c-103-89-351-149-523-49s-342%20278-301%20690zm803-107c0%20292-105%20356-237%20356-178%200-249-147-273-296-27-168%2025-420%20262-420%20171%200%20248%2089%20248%20360z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",q="data:image/svg+xml,%3csvg%20fill='%235FA04E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eNode.js%3c/title%3e%3cpath%20d='M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383%20c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076%20c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0%20L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392%20c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021%20c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921%20c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603%20v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z%20M19.099,13.993%20c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233%20c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081%20c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833%20c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402%20c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253%20c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z'/%3e%3c/svg%3e",D0="data:image/svg+xml,%3csvg%20fill='%233776AB'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ePython%3c/title%3e%3cpath%20d='M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02%201.27.05zm-6.3%201.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09%203.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14%201.04.05%201.23-.06%201.23-.16%201.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01%202.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47%2014.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z'/%3e%3c/svg%3e",I0="data:image/svg+xml,%3csvg%20fill='%23003B57'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",H0={coreutils:"dark:brightness-[1.8]",curl:"dark:brightness-[2.6]",sqlite3:"dark:brightness-[2.6]",duckdb:"dark:invert",jq:"dark:invert"},q0={browserbase:T0,coreutils:B0,curl:L0,duckdb:z0,git:F0,jq:$0,node:q,nodejs:q,python:D0,sqlite3:I0};function Q0({bundle:t}){const[s,n]=i.useState(!1),o=t.binaries.length>0,r=q0[t.slug];return e.jsxs(V0,{open:s,onOpenChange:n,className:"border-none",children:[e.jsxs(M0,{className:"flex w-full items-center gap-2 px-4 py-3 text-left transition-colors hover:bg-muted/50",disabled:!o,children:[e.jsx(s0,{className:E("size-3 shrink-0 text-muted-foreground transition-transform",s&&"rotate-90",!o&&"opacity-0")}),e.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded border bg-white/90 dark:bg-muted/60",children:r?e.jsx("img",{src:r,alt:"",className:E("size-4",H0[t.slug])}):e.jsx("span",{className:"text-[11px] font-medium text-black/60 dark:text-muted-foreground",children:t.slug.charAt(0)})}),e.jsx("span",{className:"flex-1 truncate font-mono text-sm",children:t.name}),o?e.jsxs("span",{className:"text-[11px] tabular-nums text-muted-foreground/70",children:[t.binaries.length," cmd",t.binaries.length===1?"":"s"]}):null,e.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:t.version}),e.jsx(U,{variant:t.source==="user"?"outline":"secondary",children:t.source})]}),o?e.jsx(A0,{children:e.jsx("div",{className:"flex flex-wrap gap-1.5 px-4 pb-3 pl-9",children:t.binaries.map(l=>e.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-muted-foreground",children:l},l))})}):null]})}const K0=t=>typeof t>"u"||t===null||Object.keys(t).length===0;function U0({mounts:t}){return e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"text-[11px] text-muted-foreground",children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"px-4 py-2 text-left font-medium",children:"Path"}),e.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Kind"}),e.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Access"}),e.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Config"})]})}),e.jsx("tbody",{children:t.map(s=>e.jsxs("tr",{className:"border-b border-foreground/[0.06] align-top last:border-0 hover:bg-muted/50",children:[e.jsx("td",{className:"px-4 py-2 font-mono text-xs",children:s.path}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(U,{variant:"secondary",className:"font-mono",children:s.kind})}),e.jsx("td",{className:"px-3 py-2 text-xs text-muted-foreground",children:s.readOnly?"read-only":"read-write"}),e.jsx("td",{className:"px-3 py-2",children:K0(s.config)?e.jsx("span",{className:"text-muted-foreground/60",children:"—"}):e.jsxs("div",{className:"group relative max-w-[20rem]",children:[e.jsx("code",{className:"block overflow-x-auto whitespace-nowrap rounded bg-muted/30 py-1.5 pl-2 pr-7 font-mono text-xs text-muted-foreground",children:JSON.stringify(s.config)}),e.jsx(n0,{value:JSON.stringify(s.config,null,2),className:"absolute right-1 top-1 bg-background/70 backdrop-blur-sm"})]})})]},s.path))})]})}function G0(){const[t,s]=i.useState("3000"),[n,o]=i.useState([]),r=M({mutationFn:async a=>{const d=Number.parseInt(a,10);if(!Number.isInteger(d)||d<1||d>65535)throw new Error(`Not a valid port: ${a}`);return P.createSignedPreviewUrl(d,900)},onSuccess:a=>o(d=>[...d.filter(u=>u.token!==a.token),a])}),l=M({mutationFn:async a=>(await P.expireSignedPreviewUrl(a.token),a),onSuccess:a=>o(d=>d.filter(u=>u.token!==a.token))}),c=r.error??l.error;return e.jsxs("div",{className:"text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-muted-foreground",htmlFor:"agentos-preview-port",children:"Port"}),e.jsx("input",{id:"agentos-preview-port",value:t,onChange:a=>s(a.target.value),onKeyDown:a=>a.key==="Enter"&&r.mutate(t),inputMode:"numeric",className:"w-20 rounded border bg-background px-2 py-1 font-mono focus:outline-none"}),e.jsx("button",{type:"button",disabled:r.isPending,onClick:()=>r.mutate(t),className:"rounded-md border px-2.5 py-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40",children:r.isPending?"Creating…":"Create preview link"}),e.jsx("span",{className:"text-muted-foreground/60",children:"Signed URL to an HTTP server on that port, valid 15 minutes. Boots the VM if asleep."})]}),c?e.jsx(S,{error:c,className:"py-2"}):null,n.length>0?e.jsx("div",{className:"mt-2 flex flex-col gap-1",children:n.map(a=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("a",{href:a.path,target:"_blank",rel:"noreferrer",className:"truncate font-mono text-primary hover:underline",children:["port ",a.port,": ",a.path]}),e.jsxs("span",{className:"text-muted-foreground/60",children:["expires ",new Date(a.expiresAt).toLocaleTimeString()]}),e.jsx("button",{type:"button",onClick:()=>l.mutate(a),className:"rounded border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:"Revoke"})]},a.token))}):null]})}function y({title:t,right:s,children:n}){return e.jsxs("section",{className:"rounded-xl border bg-secondary p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold",children:t}),e.jsx("span",{className:"ml-auto"}),s]}),n]})}function le({actorId:t}){var n;const s=V(Q(t));return e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsx("div",{className:"mx-auto w-full max-w-4xl shrink-0 px-4 pt-4",children:e.jsx(Y0,{actorId:t})}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(O,{children:e.jsx(Z0,{actorId:t})},String((n=s.data)==null?void 0:n.generation))})]})}function Z0({actorId:t}){const s=o0(t),n=o=>e.jsx("span",{className:"text-xs text-muted-foreground",children:o});return e.jsxs("div",{className:"relative h-full min-h-0",children:[e.jsx("div",{className:"absolute right-3 top-2 z-10",children:e.jsx(r0,{actorId:t})}),e.jsx(u0,{className:"h-full min-h-0",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-4 px-4 py-4",children:[e.jsx(y,{title:"Processes",right:n(`${s.running} of ${s.total} running`),children:e.jsx("div",{className:"overflow-hidden rounded-lg border",children:e.jsx(a0,{actorId:t})})}),e.jsx(O,{children:e.jsx(J0,{actorId:t})}),e.jsx(O,{children:e.jsx(X0,{actorId:t})}),e.jsx(y,{title:"Preview links",children:e.jsx(G0,{})})]})})]})}function J0({actorId:t}){const s=K(P.softwareQueryOptions(t));return e.jsx(y,{title:"Software",right:e.jsx("span",{className:"text-xs text-muted-foreground",children:s.data.length}),children:s.data.length===0?e.jsx("div",{className:"text-sm text-muted-foreground",children:"No software bundles installed."}):e.jsx("div",{className:"divide-y overflow-hidden rounded-lg border",children:s.data.map(n=>e.jsx(Q0,{bundle:n},n.name))})})}const W0="agentos_packages";function X0({actorId:t}){const s=K(P.mountsQueryOptions(t)),n=s.data.filter(r=>r.kind!==W0),o=s.data.length-n.length;return e.jsxs(y,{title:"Mounts",right:e.jsx("span",{className:"text-xs text-muted-foreground",children:n.length}),children:[n.length===0?e.jsx("div",{className:"text-sm text-muted-foreground",children:"No mounts configured on this actor."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:e.jsx(U0,{mounts:n})}),o>0&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Plus ",o," read-only mounts under /opt/agentos for installed software."]})]})}function Y0({actorId:t}){const s=t0(),n=V(Q(t)),o=V({queryKey:["agentOS",t,"config"],queryFn:()=>z("v1.config.get",c=>c.v1.config.get({})),refetchInterval:5e3}),r=M({mutationFn:()=>z("v1.vm.restart",c=>c.v1.vm.restart({})),onSuccess:()=>s.invalidateQueries({queryKey:["agentOS",t]})}),l=c=>JSON.stringify(c,(a,d)=>typeof d=="bigint"?d.toString():d,2);return e.jsxs(y,{title:"VM status and configuration",right:e.jsx("button",{type:"button",className:"rounded border px-2 py-1 text-xs hover:bg-muted disabled:opacity-50",disabled:r.isPending,onClick:()=>r.mutate(),children:r.isPending?"Restarting…":"Restart VM"}),children:[n.error?e.jsx(S,{error:n.error}):null,o.error?e.jsx(S,{error:o.error}):null,r.error?e.jsx(S,{error:r.error}):null,n.data?e.jsxs("div",{className:"mb-3 text-xs",children:[e.jsx("span",{className:"font-medium",children:n.data.lifecycle}),e.jsxs("span",{className:"ml-2 text-muted-foreground",children:["Generation ",String(n.data.generation)," · Config ",n.data.configState]}),n.data.issues.map((c,a)=>e.jsxs("p",{className:"mt-1 text-destructive",children:[c.code,": ",c.message]},`${c.code}-${a}`))]}):null,o.data?e.jsxs("details",{children:[e.jsxs("summary",{className:"cursor-pointer text-xs",children:["Desired config, revision ",String(o.data.revision)]}),e.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded bg-muted p-3 text-xs",children:l(o.data.desired)})]}):null]})}export{le as SystemTabConnected};
1
+ import{i as e0,j as e,d as E,r as i,k,l as O,u as t0,a as S,m as z,C as s0,n as n0}from"./index-UFq5tVw_.js";import{u as V,h as Q,V as r0,a as P}from"./vm-status-badges-BzRIP4lN.js";import{u as o0,P as a0,a as K}from"./processes-DERROp1u.js";import{u as M}from"./useMutation-5EZ20Lg8.js";import{u as _,P as A,c as l0,a as c0,b as i0,d as d0,S as u0}from"./scroll-area-BlieIIFq.js";import"./hooks-cSr2w3ti.js";const F=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,$=e0,m0=(t,s)=>n=>{var o;if((s==null?void 0:s.variants)==null)return $(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:l}=s,c=Object.keys(r).map(u=>{const m=n==null?void 0:n[u],f=l==null?void 0:l[u];if(m===null)return null;const x=F(m)||F(f);return r[u][x]}),a=n&&Object.entries(n).reduce((u,m)=>{let[f,x]=m;return x===void 0||(u[f]=x),u},{}),d=s==null||(o=s.compoundVariants)===null||o===void 0?void 0:o.reduce((u,m)=>{let{class:f,className:x,...p}=m;return Object.entries(p).every(v=>{let[j,g]=v;return Array.isArray(g)?g.includes({...l,...a}[j]):{...l,...a}[j]===g})?[...u,f,x]:u},[]);return $(t,c,d,n==null?void 0:n.class,n==null?void 0:n.className)},f0=m0("inline-flex items-center tracking-normal rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors whitespace-nowrap max-w-full overflow-hidden truncate",{variants:{variant:{secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-foreground"}},defaultVariants:{variant:"secondary"}});function U({className:t,variant:s,...n}){return e.jsx("div",{className:E(f0({variant:s}),t),...n})}var x0=Object.defineProperty,g0=(t,s)=>x0(t,"name",{value:s,configurable:!0}),D=k[" useEffectEvent ".trim().toString()],I=k[" useInsertionEffect ".trim().toString()];function G(t){if(typeof D=="function")return D(t);const s=i.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof I=="function"?I(()=>{s.current=t}):_(()=>{s.current=t}),i.useMemo(()=>(...n)=>{var o;return(o=s.current)==null?void 0:o.call(s,...n)},[])}g0(G,"useEffectEvent");var p0=Object.defineProperty,w=(t,s)=>p0(t,"name",{value:s,configurable:!0}),h0=k[" useInsertionEffect ".trim().toString()]||_;function Z({prop:t,defaultProp:s,onChange:n=w(()=>{},"onChange"),caller:o}){const[r,l,c]=J({defaultProp:s,onChange:n}),a=t!==void 0,d=a?t:r,u=i.useCallback(m=>{var f;if(a){const x=W(m)?m(t):m;x!==t&&((f=c.current)==null||f.call(c,x))}else l(m)},[a,t,l,c]);return[d,u]}w(Z,"useControllableState");function J({defaultProp:t,onChange:s}){const[n,o]=i.useState(t),r=i.useRef(n),l=i.useRef(s);return h0(()=>{l.current=s},[s]),i.useEffect(()=>{var c;r.current!==n&&((c=l.current)==null||c.call(l,n),r.current=n)},[n,r]),[n,o,l]}w(J,"useUncontrolledState");function W(t){return typeof t=="function"}w(W,"isFunction");var H=Symbol("RADIX:SYNC_STATE");function v0(t,s,n,o){const{prop:r,defaultProp:l,onChange:c,caller:a}=s,d=r!==void 0,u=G(c),m=[{...n,state:l}];o&&m.push(o);const[f,x]=i.useReducer((g,C)=>{if(C.type===H)return{...g,state:C.state};const b=t(g,C);return d&&!Object.is(b.state,g.state)&&u(b.state),b},...m),p=f.state,v=i.useRef(p);i.useEffect(()=>{v.current!==p&&(v.current=p,d||u(p))},[p,v,d]);const j=i.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return i.useEffect(()=>{d&&!Object.is(r,f.state)&&x({type:H,state:r})},[r,f.state,d]),[j,x]}w(v0,"useControllableStateReducer");var b0=Object.defineProperty,j0=(t,s)=>b0(t,"name",{value:s,configurable:!0}),C0=k[" useId ".trim().toString()]||(()=>{}),y0=0;function X(t){const[s,n]=i.useState(C0());return _(()=>{t||n(o=>o??String(y0++))},[t]),t||(s?`radix-${s}`:"")}j0(X,"useId");var w0=Object.defineProperty,N=(t,s)=>w0(t,"name",{value:s,configurable:!0}),T="Collapsible",[N0,ae]=d0(T),[S0,B]=N0(T),P0=i.forwardRef(N(function(s,n){const{__scopeCollapsible:o,open:r,defaultOpen:l,disabled:c,onOpenChange:a,...d}=s,[u,m]=Z({prop:r,defaultProp:l??!1,onChange:a,caller:T});return e.jsx(S0,{scope:o,disabled:c,contentId:X(),open:u,onOpenToggle:i.useCallback(()=>m(f=>!f),[m]),children:e.jsx(A.div,{"data-state":R(u),"data-disabled":c?"":void 0,...d,ref:n})})},"Collapsible")),k0="CollapsibleTrigger",_0=i.forwardRef(N(function(s,n){const{__scopeCollapsible:o,...r}=s,l=B(k0,o);return e.jsx(A.button,{type:"button","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open||!1,"data-state":R(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...r,ref:n,onClick:l0(s.onClick,l.onOpenToggle)})},"CollapsibleTrigger")),Y="CollapsibleContent",R0=i.forwardRef(N(function(s,n){const{forceMount:o,...r}=s,l=B(Y,s.__scopeCollapsible);return e.jsx(c0,{present:o||l.open,children:({present:c})=>e.jsx(E0,{...r,ref:n,present:c})})},"CollapsibleContent")),E0=i.forwardRef(N(function(s,n){const{__scopeCollapsible:o,present:r,children:l,...c}=s,a=B(Y,o),[d,u]=i.useState(r),m=i.useRef(null),f=i0(n,m),x=i.useRef(0),p=x.current,v=i.useRef(0),j=v.current,g=a.open||d,C=i.useRef(g),b=i.useRef(void 0);return i.useEffect(()=>{const h=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(h)},[]),_(()=>{const h=m.current;if(h){b.current=b.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const L=h.getBoundingClientRect();x.current=L.height,v.current=L.width,C.current||(h.style.transitionDuration=b.current.transitionDuration,h.style.animationName=b.current.animationName),u(r)}},[a.open,r]),e.jsx(A.div,{"data-state":R(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!g,...c,ref:f,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...s.style},children:g&&l})},"CollapsibleContentImpl"));function R(t){return t?"open":"closed"}N(R,"getState");var O0=P0;const V0=O0,M0=_0,A0=R0,T0="data:image/svg+xml,%3csvg%20width='100'%20height='100'%20viewBox='0%200%20100%20100'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2212_248)'%3e%3cpath%20d='M0%200H100V100H0V0Z'%20fill='%23F03603'/%3e%3cpath%20d='M36%2072.2222V27.7778H51.2381C57.5873%2027.7778%2062.6667%2032.8571%2062.6667%2039.2063V41.746C62.6667%2044.6667%2061.5873%2047.3968%2059.7461%2049.3651C62.2858%2051.4603%2063.9366%2054.6349%2063.9366%2058.254V60.7936C63.9366%2067.1428%2058.8572%2072.2222%2052.508%2072.2222H36ZM42.3493%2065.873H52.508C55.3651%2065.873%2057.5873%2063.6508%2057.5873%2060.7936V58.254C57.5873%2055.3968%2055.3651%2053.1746%2052.508%2053.1746H42.3493V65.873ZM42.3493%2046.8254H51.2381C54.0953%2046.8254%2056.3175%2044.6032%2056.3175%2041.746V39.2063C56.3175%2036.3492%2054.0953%2034.127%2051.2381%2034.127H42.3493V46.8254Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2212_248'%3e%3crect%20width='100'%20height='100'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",B0=""+new URL("coreutils-CQXb6ysD.svg",import.meta.url).href,L0="data:image/svg+xml,%3csvg%20fill='%23073551'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ecurl%3c/title%3e%3cpath%20d='M.803%2014.8169c0-.5342.433-.9665.9665-.9665.5335%200%20.9665.4323.9665.9665%200%20.5335-.433.9657-.9665.9657-.5335%200-.9666-.4322-.9666-.9657m2.736%200c0-.1963-.0532-.376-.1119-.5525-.2344-.7024-.876-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0708C.6149%2013.2865%200%2013.9646%200%2014.817c0%20.9764.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.793%201.7694-1.7694m-1.7694-7.149c.5335%200%20.9665.433.9665.9665%200%20.5335-.433.9665-.9665.9665-.5343%200-.9666-.433-.9666-.9665%200-.5335.4323-.9665.9666-.9665m0%202.7359c.9772%200%201.7694-.7923%201.7694-1.7694%200-.1956-.0532-.376-.1119-.5525-.2344-.7024-.8767-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0716C.6149%207.104%200%207.782%200%208.6344c0%20.9771.7923%201.7694%201.7695%201.7694m13.221-5.694c-.5342%200-.9665-.433-.9665-.9664a.966.966%200%2001.9666-.9665c.5335%200%20.9658.4322.9658.9665%200%20.5334-.4323.9664-.9658.9664m-9.6%2016.5133c-.5335%200-.9666-.433-.9666-.9665%200-.5342.433-.9665.9666-.9665a.966.966%200%2001.9665.9665c0%20.5335-.4323.9665-.9665.9665m9.6-19.2491c-.978%200-1.7695.7922-1.7695%201.7694%200%20.2085.0525.4025.1187.5882L5.039%2018.5581c-.803.1681-1.4179.8462-1.4179%201.6985%200%20.9772.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.7922%201.7694-1.7694%200-.1963-.0525-.3759-.111-.5525l8.3427-14.2728c.7778-.1865%201.3683-.8531%201.3683-1.688%200-.977-.793-1.7693-1.7694-1.7693m7.24%202.7359c-.5343%200-.9666-.433-.9666-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9666.4322.9666.9665%200%20.5334-.433.9665-.9666.9665M12.6313%2021.223c-.5343%200-.9665-.433-.9665-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9658.4323.9658.9665%200%20.5335-.4323.9665-.9658.9665M22.2305%201.974c-.9772%200-1.7694.7922-1.7694%201.7694%200%20.2085.0525.4025.1187.5882l-8.3009%2014.2265c-.8021.1681-1.417.8462-1.417%201.6985%200%20.9772.7922%201.7694%201.7694%201.7694.9764%200%201.7687-.7922%201.7687-1.7694%200-.1963-.0525-.3759-.1111-.5525l8.3427-14.2728C23.4094%205.2448%2024%204.5782%2024%203.7433c0-.977-.7923-1.7693-1.7695-1.7693'/%3e%3c/svg%3e",z0="data:image/svg+xml,%3csvg%20fill='%23FFF000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",F0="data:image/svg+xml,%3csvg%20fill='%23F03C2E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGit%3c/title%3e%3cpath%20d='M13.09%2023.549a1.54%201.54%200%200%201-2.18%200L.451%2013.089a1.54%201.54%200%200%201%200-2.179l7.191-7.19%202.733%202.733a1.85%201.85%200%200%200%20.964%202.326v6.66a1.849%201.849%200%201%200%201.54%200V8.957l2.508%202.508a1.85%201.85%200%201%200%201.09-1.09l-2.634-2.634a1.85%201.85%200%200%200-2.378-2.377L8.73%202.63%2010.91.451a1.54%201.54%200%200%201%202.179%200l10.459%2010.46a1.54%201.54%200%200%201%200%202.179z'/%3e%3c/svg%3e",$0="data:image/svg+xml,%3csvg%20width='400'%20height='220'%20version='1.0'%20viewBox='0%200%20400%20220'%20xmlns='http://www.w3.org/2000/svg'%3e%3cstyle%3e@media%20(prefers-color-scheme:dark){g[fill]{filter:invert(1);stroke:none}}%3c/style%3e%3cg%20transform='scale(.1)'%20stroke='%23fff'%20stroke-width='10'%3e%3cg%20fill='%23444'%3e%3ccircle%20cx='220'%20cy='1570'%20r='190'/%3e%3cpath%20d='m1330%20312c-30%2041-698%201492-710%201528s25%2066%20100%20101c77%2036%20102%2034%20124%203s701-1477%20716-1525c15-47-20-73-84-104s-116-44-146-3z'/%3e%3c/g%3e%3cg%20fill='%23111'%3e%3ccircle%20cx='2410'%20cy='200'%20r='190'/%3e%3cpath%20d='m1830%20655c0%20129%200%20130%2070%20130h360v423c0%20246-5%20474-10%20506-19%20112-88%20176-190%20176-59%200-120-27-147-66-51-73-65-84-99-84-31%200-40%208-104%2093-84%20111-86%20129-32%20189%20227%20252%20692%20187%20836-118%2053-112%2056-153%2056-795v-514c0-64-30-100-100-100h-490c-149%200-150%200-150%20160zM2867%201233c30%20302%20250%20499%20438%20527%20144%2019%20244%200%20375-90v410c0%2081%200%20100%20150%20100%20136%200%20150-20%20150-150v-1420c0-99-19-100-150-100s-139%2015-139%2082c-103-89-351-149-523-49s-342%20278-301%20690zm803-107c0%20292-105%20356-237%20356-178%200-249-147-273-296-27-168%2025-420%20262-420%20171%200%20248%2089%20248%20360z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",q="data:image/svg+xml,%3csvg%20fill='%235FA04E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eNode.js%3c/title%3e%3cpath%20d='M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383%20c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076%20c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0%20L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392%20c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021%20c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921%20c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603%20v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z%20M19.099,13.993%20c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233%20c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081%20c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833%20c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402%20c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253%20c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z'/%3e%3c/svg%3e",D0="data:image/svg+xml,%3csvg%20fill='%233776AB'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ePython%3c/title%3e%3cpath%20d='M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02%201.27.05zm-6.3%201.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09%203.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14%201.04.05%201.23-.06%201.23-.16%201.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01%202.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47%2014.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z'/%3e%3c/svg%3e",I0="data:image/svg+xml,%3csvg%20fill='%23003B57'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",H0={coreutils:"dark:brightness-[1.8]",curl:"dark:brightness-[2.6]",sqlite3:"dark:brightness-[2.6]",duckdb:"dark:invert",jq:"dark:invert"},q0={browserbase:T0,coreutils:B0,curl:L0,duckdb:z0,git:F0,jq:$0,node:q,nodejs:q,python:D0,sqlite3:I0};function Q0({bundle:t}){const[s,n]=i.useState(!1),o=t.binaries.length>0,r=q0[t.slug];return e.jsxs(V0,{open:s,onOpenChange:n,className:"border-none",children:[e.jsxs(M0,{className:"flex w-full items-center gap-2 px-4 py-3 text-left transition-colors hover:bg-muted/50",disabled:!o,children:[e.jsx(s0,{className:E("size-3 shrink-0 text-muted-foreground transition-transform",s&&"rotate-90",!o&&"opacity-0")}),e.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded border bg-white/90 dark:bg-muted/60",children:r?e.jsx("img",{src:r,alt:"",className:E("size-4",H0[t.slug])}):e.jsx("span",{className:"text-[11px] font-medium text-black/60 dark:text-muted-foreground",children:t.slug.charAt(0)})}),e.jsx("span",{className:"flex-1 truncate font-mono text-sm",children:t.name}),o?e.jsxs("span",{className:"text-[11px] tabular-nums text-muted-foreground/70",children:[t.binaries.length," cmd",t.binaries.length===1?"":"s"]}):null,e.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:t.version}),e.jsx(U,{variant:t.source==="user"?"outline":"secondary",children:t.source})]}),o?e.jsx(A0,{children:e.jsx("div",{className:"flex flex-wrap gap-1.5 px-4 pb-3 pl-9",children:t.binaries.map(l=>e.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-muted-foreground",children:l},l))})}):null]})}const K0=t=>typeof t>"u"||t===null||Object.keys(t).length===0;function U0({mounts:t}){return e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"text-[11px] text-muted-foreground",children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"px-4 py-2 text-left font-medium",children:"Path"}),e.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Kind"}),e.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Access"}),e.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"Config"})]})}),e.jsx("tbody",{children:t.map(s=>e.jsxs("tr",{className:"border-b border-foreground/[0.06] align-top last:border-0 hover:bg-muted/50",children:[e.jsx("td",{className:"px-4 py-2 font-mono text-xs",children:s.path}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(U,{variant:"secondary",className:"font-mono",children:s.kind})}),e.jsx("td",{className:"px-3 py-2 text-xs text-muted-foreground",children:s.readOnly?"read-only":"read-write"}),e.jsx("td",{className:"px-3 py-2",children:K0(s.config)?e.jsx("span",{className:"text-muted-foreground/60",children:"—"}):e.jsxs("div",{className:"group relative max-w-[20rem]",children:[e.jsx("code",{className:"block overflow-x-auto whitespace-nowrap rounded bg-muted/30 py-1.5 pl-2 pr-7 font-mono text-xs text-muted-foreground",children:JSON.stringify(s.config)}),e.jsx(n0,{value:JSON.stringify(s.config,null,2),className:"absolute right-1 top-1 bg-background/70 backdrop-blur-sm"})]})})]},s.path))})]})}function G0(){const[t,s]=i.useState("3000"),[n,o]=i.useState([]),r=M({mutationFn:async a=>{const d=Number.parseInt(a,10);if(!Number.isInteger(d)||d<1||d>65535)throw new Error(`Not a valid port: ${a}`);return P.createSignedPreviewUrl(d,900)},onSuccess:a=>o(d=>[...d.filter(u=>u.token!==a.token),a])}),l=M({mutationFn:async a=>(await P.expireSignedPreviewUrl(a.token),a),onSuccess:a=>o(d=>d.filter(u=>u.token!==a.token))}),c=r.error??l.error;return e.jsxs("div",{className:"text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-muted-foreground",htmlFor:"agentos-preview-port",children:"Port"}),e.jsx("input",{id:"agentos-preview-port",value:t,onChange:a=>s(a.target.value),onKeyDown:a=>a.key==="Enter"&&r.mutate(t),inputMode:"numeric",className:"w-20 rounded border bg-background px-2 py-1 font-mono focus:outline-none"}),e.jsx("button",{type:"button",disabled:r.isPending,onClick:()=>r.mutate(t),className:"rounded-md border px-2.5 py-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40",children:r.isPending?"Creating…":"Create preview link"}),e.jsx("span",{className:"text-muted-foreground/60",children:"Signed URL to an HTTP server on that port, valid 15 minutes. Boots the VM if asleep."})]}),c?e.jsx(S,{error:c,className:"py-2"}):null,n.length>0?e.jsx("div",{className:"mt-2 flex flex-col gap-1",children:n.map(a=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("a",{href:a.path,target:"_blank",rel:"noreferrer",className:"truncate font-mono text-primary hover:underline",children:["port ",a.port,": ",a.path]}),e.jsxs("span",{className:"text-muted-foreground/60",children:["expires ",new Date(a.expiresAt).toLocaleTimeString()]}),e.jsx("button",{type:"button",onClick:()=>l.mutate(a),className:"rounded border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:"Revoke"})]},a.token))}):null]})}function y({title:t,right:s,children:n}){return e.jsxs("section",{className:"rounded-xl border bg-secondary p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold",children:t}),e.jsx("span",{className:"ml-auto"}),s]}),n]})}function le({actorId:t}){var n;const s=V(Q(t));return e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsx("div",{className:"mx-auto w-full max-w-4xl shrink-0 px-4 pt-4",children:e.jsx(Y0,{actorId:t})}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(O,{children:e.jsx(Z0,{actorId:t})},String((n=s.data)==null?void 0:n.generation))})]})}function Z0({actorId:t}){const s=o0(t),n=o=>e.jsx("span",{className:"text-xs text-muted-foreground",children:o});return e.jsxs("div",{className:"relative h-full min-h-0",children:[e.jsx("div",{className:"absolute right-3 top-2 z-10",children:e.jsx(r0,{actorId:t})}),e.jsx(u0,{className:"h-full min-h-0",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-4 px-4 py-4",children:[e.jsx(y,{title:"Processes",right:n(`${s.running} of ${s.total} running`),children:e.jsx("div",{className:"overflow-hidden rounded-lg border",children:e.jsx(a0,{actorId:t})})}),e.jsx(O,{children:e.jsx(J0,{actorId:t})}),e.jsx(O,{children:e.jsx(X0,{actorId:t})}),e.jsx(y,{title:"Preview links",children:e.jsx(G0,{})})]})})]})}function J0({actorId:t}){const s=K(P.softwareQueryOptions(t));return e.jsx(y,{title:"Software",right:e.jsx("span",{className:"text-xs text-muted-foreground",children:s.data.length}),children:s.data.length===0?e.jsx("div",{className:"text-sm text-muted-foreground",children:"No software bundles installed."}):e.jsx("div",{className:"divide-y overflow-hidden rounded-lg border",children:s.data.map(n=>e.jsx(Q0,{bundle:n},n.name))})})}const W0="agentos_packages";function X0({actorId:t}){const s=K(P.mountsQueryOptions(t)),n=s.data.filter(r=>r.kind!==W0),o=s.data.length-n.length;return e.jsxs(y,{title:"Mounts",right:e.jsx("span",{className:"text-xs text-muted-foreground",children:n.length}),children:[n.length===0?e.jsx("div",{className:"text-sm text-muted-foreground",children:"No mounts configured on this actor."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:e.jsx(U0,{mounts:n})}),o>0&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Plus ",o," read-only mounts under /opt/agentos for installed software."]})]})}function Y0({actorId:t}){const s=t0(),n=V(Q(t)),o=V({queryKey:["agentOS",t,"config"],queryFn:()=>z("v1.config.get",c=>c.v1.config.get({})),refetchInterval:5e3}),r=M({mutationFn:()=>z("v1.vm.restart",c=>c.v1.vm.restart({})),onSuccess:()=>s.invalidateQueries({queryKey:["agentOS",t]})}),l=c=>JSON.stringify(c,(a,d)=>typeof d=="bigint"?d.toString():d,2);return e.jsxs(y,{title:"VM status and configuration",right:e.jsx("button",{type:"button",className:"rounded border px-2 py-1 text-xs hover:bg-muted disabled:opacity-50",disabled:r.isPending,onClick:()=>r.mutate(),children:r.isPending?"Restarting…":"Restart VM"}),children:[n.error?e.jsx(S,{error:n.error}):null,o.error?e.jsx(S,{error:o.error}):null,r.error?e.jsx(S,{error:r.error}):null,n.data?e.jsxs("div",{className:"mb-3 text-xs",children:[e.jsx("span",{className:"font-medium",children:n.data.lifecycle}),e.jsxs("span",{className:"ml-2 text-muted-foreground",children:["Generation ",String(n.data.generation)," · Config ",n.data.configState]}),n.data.issues.map((c,a)=>e.jsxs("p",{className:"mt-1 text-destructive",children:[c.code,": ",c.message]},`${c.code}-${a}`))]}):null,o.data?e.jsxs("details",{children:[e.jsxs("summary",{className:"cursor-pointer text-xs",children:["Desired config, revision ",String(o.data.revision)]}),e.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded bg-muted p-3 text-xs",children:l(o.data.desired)})]}):null]})}export{le as SystemTabConnected};