@townco/gui-template 0.1.38 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons-gyxX6Wmy.js +1 -0
- package/dist/assets/index-Cm4MNrdW.css +1 -0
- package/dist/assets/index-DBa1bubT.js +6 -0
- package/dist/index.html +3 -3
- package/package.json +4 -4
- package/src/App.tsx +4 -2
- package/dist/assets/icons-xaawVwTw.js +0 -1
- package/dist/assets/index-B4v5omig.js +0 -6
- package/dist/assets/index-DJ8SdHco.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s}from"./react-BxIc-aOD.js";const _=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,t,c)=>c?c.toUpperCase():t.toLowerCase()),h=o=>{const a=m(o);return a.charAt(0).toUpperCase()+a.slice(1)},i=(...o)=>o.filter((a,t,c)=>!!a&&a.trim()!==""&&c.indexOf(a)===t).join(" ").trim(),u=o=>{for(const a in o)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const M=s.forwardRef(({color:o="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:c,className:r="",children:n,iconNode:l,...d},p)=>s.createElement("svg",{ref:p,...v,width:a,height:a,stroke:o,strokeWidth:c?Number(t)*24/Number(a):t,className:i("lucide",r),...!n&&!u(d)&&{"aria-hidden":"true"},...d},[...l.map(([y,k])=>s.createElement(y,k)),...Array.isArray(n)?n:[n]]));const e=(o,a)=>{const t=s.forwardRef(({className:c,...r},n)=>s.createElement(M,{ref:n,iconNode:a,className:i(`lucide-${_(h(o))}`,`lucide-${o}`,c),...r}));return t.displayName=h(o),t};const g=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],a1=e("arrow-down",g);const w=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],o1=e("arrow-up",w);const x=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t1=e("check",x);const $=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],c1=e("chevron-down",$);const N=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],n1=e("chevron-right",N);const f=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],s1=e("chevron-up",f);const C=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],r1=e("chevrons-up-down",C);const b=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],d1=e("circle-check",b);const j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],h1=e("circle",j);const A=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],i1=e("cloud",A);const q=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],l1=e("code",q);const z=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],p1=e("database",z);const H=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],y1=e("ellipsis-vertical",H);const L=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],k1=e("file-code",L);const V=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],_1=e("file-text",V);const S=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],m1=e("folder-open",S);const E=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],u1=e("folder",E);const P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],v1=e("globe",P);const D=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],M1=e("link-2",D);const F=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],g1=e("link",F);const U=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w1=e("loader-circle",U);const R=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],x1=e("mic",R);const W=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],$1=e("moon",W);const Z=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],N1=e("panel-right",Z);const B=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],f1=e("paperclip",B);const G=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],C1=e("search",G);const I=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],b1=e("settings",I);const O=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],j1=e("sparkles",O);const K=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],A1=e("square-check-big",K);const T=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],q1=e("square-pen",T);const X=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],z1=e("square-slash",X);const J=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],H1=e("sun",J);const Q=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],L1=e("wrench",Q);const Y=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],V1=e("x",Y);export{a1 as A,n1 as C,p1 as D,y1 as E,m1 as F,v1 as G,M1 as L,x1 as M,f1 as P,z1 as S,L1 as W,V1 as X,t1 as a,h1 as b,u1 as c,k1 as d,c1 as e,d1 as f,A1 as g,_1 as h,j1 as i,b1 as j,l1 as k,o1 as l,N1 as m,s1 as n,q1 as o,C1 as p,i1 as q,g1 as r,w1 as s,r1 as t,H1 as u,$1 as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-gray-500:oklch(55.1% .027 264.364);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-400:oklch(70.5% .015 286.067);--color-neutral-50:oklch(98.5% 0 0);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--radius:.5rem;--max-width-prose:477px;--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-primary-hover:var(--primary-hover);--color-secondary:var(--secondary);--color-secondary-foreground:var(--secondary-foreground);--color-secondary-hover:var(--secondary-hover);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-accent-hover:var(--accent-hover);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-destructive-hover:var(--destructive-hover);--color-border:var(--border);--color-border-dark:var(--border-dark);--color-input:var(--input);--color-input-background:var(--input-background);--color-ring:var(--ring);--color-text-primary:var(--text-primary);--color-text-secondary:var(--text-secondary);--color-text-tertiary:var(--text-tertiary);--max-width-chat:720px;--max-width-prompt-container:393px;--letter-spacing-tight:-.48px;--letter-spacing-heading:-.4px;--letter-spacing-uppercase:1.12px;--font-size-heading-1:3rem;--line-height-heading-1:1;--font-size-heading-2:1.875rem;--line-height-heading-2:1;--font-size-heading-3:1.5rem;--line-height-heading-3:1.2;--font-size-heading-4:1.25rem;--line-height-heading-4:1.2;--font-size-heading-5:1rem;--line-height-heading-5:1.2;--font-size-subheading:1.25rem;--line-height-subheading:1.5;--font-size-label:.875rem;--line-height-label:1.5;--font-size-paragraph:1rem;--line-height-paragraph:1.5;--font-size-paragraph-sm:.875rem;--line-height-paragraph-sm:1.5;--font-size-paragraph-mini:.75rem;--line-height-paragraph-mini:1.5;--font-size-caption:.75rem;--line-height-caption:1.5;--font-size-code:.875rem;--line-height-code:1.5;--letter-spacing-wide:.07em}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground)}button{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing)*0)}.right-4{right:calc(var(--spacing)*4)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-50{z-index:50}.z-\[100\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.my-2{margin-block:calc(var(--spacing)*2)}.my-4{margin-block:calc(var(--spacing)*4)}.my-6{margin-block:calc(var(--spacing)*6)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-auto{margin-right:auto}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.-ml-3{margin-left:calc(var(--spacing)*-3)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-full{width:100%;height:100%}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-16{height:calc(var(--spacing)*16)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[6lh\]{max-height:6lh}.min-h-\[44px\]{min-height:44px}.min-h-\[80px\]{min-height:80px}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-10{width:calc(var(--spacing)*10)}.w-40{width:calc(var(--spacing)*40)}.w-64{width:calc(var(--spacing)*64)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\[80\%\]{max-width:80%}.max-w-\[90\%\]{max-width:90%}.max-w-\[200px\]{max-width:200px}.max-w-chat{max-width:var(--max-width-chat)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-prompt-container{max-width:var(--max-width-prompt-container)}.max-w-prose{max-width:var(--max-width-prose)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-0{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-outside{list-style-position:outside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-\[4px\]{gap:4px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:var(--radius)}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[3px\]{border-radius:3px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[border-bottom-width\:0\.5px\]{border-bottom-width:.5px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-\[primary\]{border-color:primary}.border-border{border-color:var(--color-border)}.border-border-dark{border-color:var(--color-border-dark)}.border-border\/50{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.border-destructive,.border-destructive\/20{border-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/20{border-color:color-mix(in oklab,var(--color-destructive)20%,transparent)}}.border-green-500{border-color:var(--color-green-500)}.border-input{border-color:var(--color-input)}.bg-accent{background-color:var(--color-accent)}.bg-background{background-color:var(--color-background)}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-destructive,.bg-destructive\/10{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--color-destructive)10%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-green-500{background-color:var(--color-green-500)}.bg-input-background{background-color:var(--color-input-background)}.bg-muted,.bg-muted\/50{background-color:var(--color-muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--color-muted)50%,transparent)}}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-red-500{background-color:var(--color-red-500)}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-linear-to-t{--tw-gradient-position:to top}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-t{--tw-gradient-position:to top in oklab}}.bg-linear-to-t{background-image:linear-gradient(var(--tw-gradient-stops))}.from-background{--tw-gradient-from:var(--color-background);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-3{padding-right:calc(var(--spacing)*3)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1\.5{padding-bottom:calc(var(--spacing)*1.5)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-8{padding-bottom:calc(var(--spacing)*8)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-16{padding-left:calc(var(--spacing)*16)}.text-center{text-align:center}.text-end{text-align:end}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-\[var\(--font-family\)\]{--tw-font-weight:var(--font-family);font-weight:var(--font-family)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--font-size\)\]{color:var(--font-size)}.text-card-foreground{color:var(--color-card-foreground)}.text-destructive{color:var(--color-destructive)}.text-destructive-foreground{color:var(--color-destructive-foreground)}.text-foreground{color:var(--color-foreground)}.text-green-500{color:var(--color-green-500)}.text-muted-foreground,.text-muted-foreground\/70{color:var(--color-muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/70{color:color-mix(in oklab,var(--color-muted-foreground)70%,transparent)}}.text-neutral-100{color:var(--color-neutral-100)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.text-text-tertiary{color:var(--color-text-tertiary)}.text-zinc-400{color:var(--color-zinc-400)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.decoration-2{text-decoration-thickness:2px}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.accent-\[primary\]{accent-color:primary}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow-\[0_4px_16px_0_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/item\:opacity-100:is(:where(.group\/item):hover *){opacity:1}}.group-\[\.toast\]\:bg-muted:is(:where(.group).toast *){background-color:var(--color-muted)}.group-\[\.toast\]\:bg-primary:is(:where(.group).toast *){background-color:var(--color-primary)}.group-\[\.toast\]\:text-muted-foreground:is(:where(.group).toast *){color:var(--color-muted-foreground)}.group-\[\.toast\]\:text-primary-foreground:is(:where(.group).toast *){color:var(--color-primary-foreground)}.group-\[\.toaster\]\:border-border:is(:where(.group).toaster *){border-color:var(--color-border)}.group-\[\.toaster\]\:bg-background:is(:where(.group).toaster *){background-color:var(--color-background)}.group-\[\.toaster\]\:text-foreground:is(:where(.group).toaster *){color:var(--color-foreground)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing)*1)}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}@media(hover:hover){.hover\:border-border\/80:hover{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.hover\:border-border\/80:hover{border-color:color-mix(in oklab,var(--color-border)80%,transparent)}}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-accent-hover:hover{background-color:var(--color-accent-hover)}.hover\:bg-background:hover{background-color:var(--color-background)}.hover\:bg-card:hover,.hover\:bg-card\/80:hover{background-color:var(--color-card)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/80:hover{background-color:color-mix(in oklab,var(--color-card)80%,transparent)}}.hover\:bg-card\/90:hover{background-color:var(--color-card)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/90:hover{background-color:color-mix(in oklab,var(--color-card)90%,transparent)}}.hover\:bg-destructive-hover:hover{background-color:var(--color-destructive-hover)}.hover\:bg-muted:hover{background-color:var(--color-muted)}.hover\:bg-primary-hover:hover{background-color:var(--color-primary-hover)}.hover\:bg-secondary-hover:hover{background-color:var(--color-secondary-hover)}.hover\:bg-secondary\/80:hover{background-color:var(--color-secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary)80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:text-foreground:hover{color:var(--color-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-sm:hover{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:bg-muted:focus{background-color:var(--color-muted)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.focus\:text-destructive:focus{color:var(--color-destructive)}.focus\:text-foreground:focus{color:var(--color-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-border-dark:focus-visible{--tw-ring-color:var(--color-border-dark)}.focus-visible\:ring-destructive:focus-visible{--tw-ring-color:var(--color-destructive)}.focus-visible\:ring-green-500:focus-visible{--tw-ring-color:var(--color-green-500)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing)*1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--color-background)}.data-\[state\=active\]\:bg-muted[data-state=active]{background-color:var(--color-muted)}.data-\[state\=active\]\:bg-transparent[data-state=active]{background-color:#0000}.data-\[state\=active\]\:bg-zinc-100[data-state=active]{background-color:var(--color-zinc-100)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--color-foreground)}.data-\[state\=active\]\:opacity-100[data-state=active]{opacity:1}.data-\[state\=active\]\:shadow-none[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=inactive\]\:text-muted-foreground[data-state=inactive]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:bg-muted[data-state=open]{background-color:var(--color-muted)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}@media(min-width:40rem){.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:block{display:block}}@media(min-width:64rem){.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:p-0{padding:calc(var(--spacing)*0)}}@media(min-width:80rem){.xl\:block{display:block}}@media(min-width:96rem){.\32xl\:block{display:block}}@media(prefers-color-scheme:dark){.dark\:scale-0{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x)var(--tw-scale-y)}.dark\:scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.dark\:-rotate-90{rotate:-90deg}.dark\:rotate-0{rotate:none}.dark\:bg-transparent{background-color:#0000}.dark\:text-green-400{color:var(--color-green-400)}.dark\:text-red-400{color:var(--color-red-400)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.text-heading-1{font-size:var(--font-size-heading-1);line-height:var(--line-height-heading-1);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-heading-2{font-size:var(--font-size-heading-2);line-height:var(--line-height-heading-2);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-heading-3{font-size:var(--font-size-heading-3);line-height:var(--line-height-heading-3);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-heading-4{font-size:var(--font-size-heading-4);line-height:var(--line-height-heading-4);letter-spacing:var(--letter-spacing-heading);font-weight:600}.text-heading-5{font-size:var(--font-size-heading-5);line-height:var(--line-height-heading-5);letter-spacing:var(--letter-spacing-heading);font-weight:600}.text-subheading{font-size:var(--font-size-subheading);line-height:var(--line-height-subheading);font-weight:400}.text-label{font-size:var(--font-size-label);line-height:var(--line-height-label);letter-spacing:var(--letter-spacing-uppercase);text-transform:uppercase;font-weight:500}.text-paragraph{font-size:var(--font-size-paragraph);line-height:var(--line-height-paragraph);font-weight:400}.text-paragraph-medium{font-size:var(--font-size-paragraph);line-height:var(--line-height-paragraph);font-weight:500}.text-paragraph-sm{font-size:var(--font-size-paragraph-sm);line-height:var(--line-height-paragraph-sm);font-weight:400}.text-paragraph-sm-medium{font-size:var(--font-size-paragraph-sm);line-height:var(--line-height-paragraph-sm);letter-spacing:var(--letter-spacing-wide);font-weight:500}.text-paragraph-mini{font-size:var(--font-size-paragraph-mini);line-height:var(--line-height-paragraph-mini);font-weight:400}.text-paragraph-mini-medium{font-size:var(--font-size-paragraph-mini);line-height:var(--line-height-paragraph-mini);font-weight:500}.text-caption{font-size:var(--font-size-caption);line-height:var(--line-height-caption);font-weight:400}.text-code{font-size:var(--font-size-code);line-height:var(--line-height-code);font-family:monospace}}:root{--background:var(--color-white);--foreground:var(--color-neutral-950);--card:var(--color-white);--card-foreground:var(--color-neutral-950);--popover:var(--color-white);--popover-foreground:var(--color-neutral-950);--primary:var(--color-neutral-900);--primary-foreground:var(--color-neutral-50);--primary-hover:var(--color-neutral-700);--secondary:var(--color-neutral-100);--secondary-foreground:var(--color-neutral-900);--secondary-hover:var(--color-neutral-50);--muted:var(--color-neutral-50);--muted-foreground:var(--color-neutral-500);--accent:var(--color-neutral-100);--accent-foreground:var(--color-neutral-900);--accent-hover:var(--color-neutral-50);--destructive:var(--color-red-500);--destructive-foreground:var(--color-neutral-50);--destructive-hover:var(--color-red-600);--border:var(--color-neutral-200);--border-dark:var(--color-neutral-300);--border-focus:var(--color-neutral-400);--border-error:var(--color-red-500);--input:var(--color-neutral-200);--input-background:var(--color-white);--ring:var(--color-neutral-900);--text-primary:var(--color-neutral-900);--text-secondary:var(--color-neutral-600);--text-tertiary:var(--color-neutral-500)}.dark{--background:var(--color-neutral-950);--foreground:var(--color-neutral-50);--card:var(--color-neutral-950);--card-foreground:var(--color-neutral-50);--popover:var(--color-neutral-950);--popover-foreground:var(--color-neutral-50);--primary:var(--color-neutral-50);--primary-foreground:var(--color-neutral-900);--primary-hover:var(--color-neutral-200);--secondary:var(--color-neutral-800);--secondary-foreground:var(--color-neutral-50);--secondary-hover:var(--color-neutral-700);--muted:var(--color-neutral-800);--muted-foreground:var(--color-neutral-400);--accent:var(--color-neutral-800);--accent-foreground:var(--color-neutral-50);--accent-hover:var(--color-neutral-700);--destructive:var(--color-red-900);--destructive-foreground:var(--color-neutral-50);--destructive-hover:var(--color-red-800);--border:var(--color-neutral-800);--border-dark:var(--color-neutral-700);--border-focus:var(--color-neutral-600);--border-error:var(--color-red-500);--input:var(--color-neutral-800);--input-background:var(--color-neutral-950);--ring:var(--color-neutral-300);--text-primary:var(--color-neutral-50);--text-secondary:var(--color-neutral-400);--text-tertiary:var(--color-neutral-500)}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes exit{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes slideDownAndFade{0%{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideLeftAndFade{0%{opacity:0;transform:translate(2px)}to{opacity:1;transform:translate(0)}}@keyframes slideUpAndFade{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideRightAndFade{0%{opacity:0;transform:translate(-2px)}to{opacity:1;transform:translate(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{r as l,j as t,P as js,e as Ns,f as Ss,M as Cs,h as ks,b as Ts}from"./react-BxIc-aOD.js";import{P as Ie,a as Is}from"./acp-sdk-CrD5QpoU.js";import{L as $,M as E,N as M,O as v,P as ze,Q as _,R as A,S as z,T as F,U as Es,W as te,X as de,Y as Rs,Z as Ms,$ as As,a0 as Us,a1 as Q,a2 as Ds,a3 as Ee}from"./vendor-CDPxlbZ6.js";import{S as se,a as Fe,b as Oe,P as Ps,C as Be,I as $e,c as He,d as We,R as Ve,L as qe,e as Qe,f as _s,T as Ls,g as Ge,h as Ke,i as Je,j as zs,k as Xe,l as Fs,m as Os,n as Bs,O as Ye,o as $s,p as Ze,q as Hs,r as et,D as tt,s as st,t as nt,u as Ws,v as ot,w as rt,x as Vs,y as at,V as qs,z as it,A as lt,B as Qs,E as Gs,F as ct}from"./radix-BwF8w229.js";import{C as be,S as Ks,P as Js,M as Xs,A as Ys,a as dt,b as ye,F as Zs,c as en,d as tn,E as sn,e as ne,f as ut,g as we,h as ve,D as pt,L as ft,i as Re,j as nn,k as on,l as rn,m as an,n as mt,X as ln,W as ht,o as cn,p as dn,q as un,r as pn,G as fn,s as gt,t as mn,u as hn,v as gn}from"./icons-gyxX6Wmy.js";import{r as xn}from"./markdown-PIOGdvNw.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const d of i.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var bn={};const ae=typeof process<"u"&&process.versions?.node;let yn,wn=0;const vn=new Set;function jn(s){for(const e of vn)e(s)}const Me={trace:0,debug:1,info:2,warn:3,error:4,fatal:5};class Nn{service;minLevel;logFilePath;logsDir;writeQueue=[];isWriting=!1;enableConsoleOutput;constructor(e,n="debug"){this.service=e,this.minLevel=n,typeof process<"u"&&(this.minLevel="info"),this.enableConsoleOutput=typeof process<"u"&&bn?.TOWN_LOG_CONSOLE==="true"||!1}setupFileLogging(){}async writeToFile(e){if(!(!this.logFilePath||!ae)&&(this.writeQueue.push(e),!this.isWriting)){for(this.isWriting=!0;this.writeQueue.length>0;){const o=`${this.writeQueue.splice(0,this.writeQueue.length).join(`
|
|
2
|
+
`)}
|
|
3
|
+
`;try{await require("node:fs").promises.appendFile(this.logFilePath,o,"utf-8")}catch{}}this.isWriting=!1}}shouldLog(e){return Me[e]>=Me[this.minLevel]}log(e,n,o){if(!this.shouldLog(e))return;const a={id:`log_${++wn}`,timestamp:new Date().toISOString(),level:e,service:this.service,message:n,...o&&{metadata:o}};if(jn(a),ae&&this.logFilePath,ae&&this.logFilePath){const i={timestamp:a.timestamp,level:a.level,service:a.service,message:a.message,...a.metadata&&{metadata:a.metadata}};this.writeToFile(JSON.stringify(i)).catch(()=>{})}if(ae&&this.enableConsoleOutput){const i=a.timestamp,d=a.level.toUpperCase().padEnd(5),c=`[${this.service}]`,p=a.metadata?` ${JSON.stringify(a.metadata)}`:"";console.log(`${i} ${d} ${c} ${a.message}${p}`)}}trace(e,n){this.log("trace",e,n)}debug(e,n){this.log("debug",e,n)}info(e,n){this.log("info",e,n)}warn(e,n){this.log("warn",e,n)}error(e,n){this.log("error",e,n)}fatal(e,n){this.log("fatal",e,n)}}function H(s,e="debug"){return new Nn(s,e)}const k=H("http-transport");class Sn{connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;messageQueue=[];currentSessionId=null;chunkResolvers=[];streamComplete=!1;sseAbortController=null;reconnectAttempts=0;maxReconnectAttempts=5;reconnectDelay=1e3;reconnecting=!1;abortController=null;options;isReceivingMessages=!1;isInReplayMode=!1;constructor(e){this.options={...e,baseUrl:e.baseUrl.replace(/\/$/,"")}}async connect(){if(!this.connected)try{this.abortController=new AbortController;const e={protocolVersion:Ie,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},n=await this.sendRpcRequest("initialize",e);k.info("ACP connection initialized",{initResponse:n});const o={cwd:"/",mcpServers:[]},a=await this.sendRpcRequest("session/new",o);this.currentSessionId=a.sessionId,k.info("Session created",{sessionId:this.currentSessionId}),await this.connectSSE(),this.connected=!0,this.reconnectAttempts=0}catch(e){this.connected=!1;const n=e instanceof Error?e:new Error(String(e));throw this.notifyError(n),n}}async loadSession(e){this.connected&&(k.warn("Transport already connected, disconnecting first",{sessionId:e}),await this.disconnect());try{this.abortController=new AbortController;const n={protocolVersion:Ie,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}};k.info("Loading session - initializing connection",{sessionId:e});const o=await this.sendRpcRequest("initialize",n);if(!o.agentCapabilities?.loadSession)throw k.error("Agent does not support loading sessions",{capabilities:o.agentCapabilities}),new Error("Agent does not support loading sessions");k.info("ACP connection initialized, loading session",{sessionId:e,capabilities:o.agentCapabilities}),this.isInReplayMode=!0,this.currentSessionId=e,await this.connectSSE();const a={sessionId:e,cwd:"/",mcpServers:[]};k.info("Sending session/load request",{loadRequest:a});const i=await this.sendRpcRequest("session/load",a);k.info("Session loaded successfully",{sessionId:this.currentSessionId,loadResponse:i}),this.connected=!0,this.reconnectAttempts=0}catch(n){this.connected=!1;const o=n instanceof Error?n:new Error(String(n));throw k.error("Failed to load session",{sessionId:e,error:o.message,stack:o.stack}),this.notifyError(o),o}}async disconnect(){if(this.connected)try{this.abortController&&(this.abortController.abort(),this.abortController=null),this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.connected=!1,this.currentSessionId=null,this.messageQueue=[],this.chunkResolvers=[],this.streamComplete=!1,this.reconnecting=!1,this.reconnectAttempts=0}catch(e){const n=e instanceof Error?e:new Error(String(e));throw this.notifyError(n),n}}async send(e){if(!this.connected||!this.currentSessionId)throw new Error("Transport not connected");this.isInReplayMode&&(k.info("Exiting replay mode - user sent a message"),this.isInReplayMode=!1);try{this.streamComplete=!1,this.messageQueue=[];const n=e.content.filter(d=>d.type==="text").map(d=>d.text).join(`
|
|
4
|
+
`),o={sessionId:this.currentSessionId,prompt:[{type:"text",text:n}]},a=await this.sendRpcRequest("session/prompt",o);k.debug("Prompt sent",{promptResponse:a}),this.streamComplete=!0;const i=this.chunkResolvers.shift();i?i({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}):this.messageQueue.push({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0})}catch(n){this.streamComplete=!0;const o=n instanceof Error?n:new Error(String(n));throw this.notifyError(o),o}}async*receive(){this.isReceivingMessages=!0;try{for(;!this.streamComplete;)if(this.messageQueue.length>0){const e=this.messageQueue.shift();if(e&&(yield e,e.isComplete))return}else{const e=await new Promise(n=>{this.chunkResolvers.push(n)});if(e.isComplete){yield e;return}else yield e}for(;this.messageQueue.length>0;){const e=this.messageQueue.shift();e&&(yield e)}yield{id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}}finally{this.isReceivingMessages=!1}}isConnected(){return this.connected}onSessionUpdate(e){return this.sessionUpdateCallbacks.add(e),()=>{this.sessionUpdateCallbacks.delete(e)}}onError(e){return this.errorCallbacks.add(e),()=>{this.errorCallbacks.delete(e)}}async sendRpcRequest(e,n){const a={jsonrpc:"2.0",id:this.generateRequestId(),method:e,params:n};k.debug("Sending RPC request",{method:e,params:n,request:a});const i={"Content-Type":"application/json",...this.options.headers},d=this.options.timeout??600*1e3,c=new AbortController,p=setTimeout(()=>c.abort(),d);try{const r=await fetch(`${this.options.baseUrl}/rpc`,{method:"POST",headers:i,body:JSON.stringify(a),signal:c.signal});if(clearTimeout(p),!r.ok){const f=await r.text();throw new Error(`HTTP ${r.status}: ${f}`)}const u=await r.json();if(u.error)throw new Error(`ACP error: ${u.error.message||JSON.stringify(u.error)}`);return u.result||u}catch(r){throw clearTimeout(p),r instanceof Error&&r.name==="AbortError"?new Error(`Request timeout after ${d}ms`):r}}async connectSSE(){if(!this.currentSessionId)throw new Error("Cannot connect SSE without a session ID");const e=`${this.options.baseUrl}/events`,n={"X-Session-ID":this.currentSessionId,...this.options.headers};this.sseAbortController=new AbortController;try{const o=await fetch(e,{method:"GET",headers:n,signal:this.sseAbortController.signal});if(!o.ok)throw new Error(`SSE connection failed: HTTP ${o.status}`);if(!o.body)throw new Error("Response body is null");k.debug("SSE connection opened"),this.reconnectAttempts=0,this.reconnectDelay=1e3;const a=o.body.getReader(),i=new TextDecoder;let d="";(async()=>{try{for(;;){const{done:c,value:p}=await a.read();if(c){k.debug("SSE stream closed by server"),this.connected&&await this.handleSSEDisconnect();break}d+=i.decode(p,{stream:!0});const r=d.split(`
|
|
5
|
+
`);d=r.pop()||"";let u={event:"message",data:""};for(const f of r)f.startsWith("event:")?u.event=f.substring(6).trim():f.startsWith("data:")?u.data=f.substring(5).trim():f===""&&(u.event==="message"&&u.data&&this.handleSSEMessage(u.data),u={event:"message",data:""})}}catch(c){if(c instanceof Error&&c.name==="AbortError"){k.debug("SSE stream aborted");return}k.error("Error reading SSE stream",{error:c}),this.connected&&!this.reconnecting&&await this.handleSSEDisconnect()}})()}catch(o){throw k.error("SSE connection error",{error:o}),o}}async handleSSEDisconnect(){if(this.reconnecting||!this.connected)return;if(this.reconnecting=!0,this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.reconnectAttempts>=this.maxReconnectAttempts){const n=new Error(`SSE reconnection failed after ${this.maxReconnectAttempts} attempts`);this.notifyError(n),this.connected=!1,this.reconnecting=!1;return}this.reconnectAttempts++;const e=Math.min(this.reconnectDelay*2**(this.reconnectAttempts-1),32e3);k.debug("SSE reconnecting",{delay:e,attempt:this.reconnectAttempts,maxAttempts:this.maxReconnectAttempts}),await new Promise(n=>setTimeout(n,e));try{await this.connectSSE(),k.info("SSE reconnected successfully"),this.reconnecting=!1}catch(n){k.error("SSE reconnection failed",{error:n}),this.reconnecting=!1}}handleSSEMessage(e){try{const n=JSON.parse(e);k.debug("Received SSE message",{message:n});const o=Is.safeParse(n);if(!o.success){k.error("Invalid ACP message from SSE",{issues:o.error.issues});return}const a=o.data;k.debug("Parsed ACP message",{method:"method"in a?a.method:"(no method)"}),"method"in a&&a.method==="session/update"&&(k.debug("Received session/update notification"),"params"in a&&a.params&&(k.debug("Calling handleSessionNotification",{params:a.params}),this.handleSessionNotification(a.params)))}catch(n){k.error("Error parsing SSE message",{error:n}),this.notifyError(n instanceof Error?n:new Error(String(n)))}}handleSessionNotification(e){k.debug("handleSessionNotification called",{params:e});const o=e.update,a=this.currentSessionId||e.sessionId;if(k.debug("Update session type",{sessionUpdate:o?.sessionUpdate}),o?.sessionUpdate==="tool_call"){k.debug("Tool call notification",{tokenUsage:o.tokenUsage});const i=o._meta&&typeof o._meta=="object"&&"messageId"in o._meta?String(o._meta.messageId):void 0,d=o._meta&&typeof o._meta=="object"&&"prettyName"in o._meta?String(o._meta.prettyName):void 0,c=o._meta&&typeof o._meta=="object"&&"icon"in o._meta?String(o._meta.icon):void 0,p={id:o.toolCallId??"",title:o.title??"",prettyName:d,icon:c,kind:o.kind||"other",status:o.status||"pending",locations:o.locations,rawInput:o.rawInput,tokenUsage:o.tokenUsage,content:o.content?.map(u=>{if(typeof u!="object"||u===null)return{type:"text",text:""};const f=u;if(f.type==="content"&&typeof f.content=="object"&&f.content!==null){const m=f.content;if(m.type==="text")return{type:"content",content:{type:"text",text:typeof m.text=="string"?m.text:""}}}return f.type==="text"?{type:"text",text:typeof f.text=="string"?f.text:""}:f.type==="diff"?{type:"diff",path:typeof f.path=="string"?f.path:"",oldText:typeof f.oldText=="string"?f.oldText:"",newText:typeof f.newText=="string"?f.newText:"",line:typeof f.line=="number"?f.line:null}:f.type==="terminal"?{type:"terminal",terminalId:typeof f.terminalId=="string"?f.terminalId:""}:{type:"text",text:""}}),startedAt:Date.now()},r={type:"tool_call",sessionId:a,status:"active",toolCall:p,messageId:i};this.notifySessionUpdate(r)}else if(o?.sessionUpdate==="tool_call_update"){const i=o._meta&&typeof o._meta=="object"&&"messageId"in o._meta?String(o._meta.messageId):void 0,d={id:o.toolCallId??"",status:o.status,locations:o.locations,rawOutput:o.rawOutput,tokenUsage:o.tokenUsage,content:o.content?.map(p=>{if(typeof p!="object"||p===null)return{type:"text",text:""};const r=p;if(r.type==="content"&&typeof r.content=="object"&&r.content!==null){const u=r.content;if(u.type==="text")return{type:"content",content:{type:"text",text:typeof u.text=="string"?u.text:""}}}return r.type==="text"?{type:"text",text:typeof r.text=="string"?r.text:""}:r.type==="diff"?{type:"diff",path:typeof r.path=="string"?r.path:"",oldText:typeof r.oldText=="string"?r.oldText:"",newText:typeof r.newText=="string"?r.newText:"",line:typeof r.line=="number"?r.line:null}:r.type==="terminal"?{type:"terminal",terminalId:typeof r.terminalId=="string"?r.terminalId:""}:{type:"text",text:""}}),error:o.error,completedAt:o.status==="completed"||o.status==="failed"?Date.now():void 0},c={type:"tool_call_update",sessionId:a,status:"active",toolCallUpdate:d,messageId:i};k.debug("Notifying tool_call_update session update",{sessionUpdate:c}),this.notifySessionUpdate(c)}else if(o&&"sessionUpdate"in o&&o.sessionUpdate==="tool_output"){const i=o,d=i._meta&&typeof i._meta=="object"&&"messageId"in i._meta?String(i._meta.messageId):void 0,c={id:i.toolCallId??"",rawOutput:i.rawOutput,content:i.content?.map(r=>{if(typeof r!="object"||r===null)return{type:"text",text:""};const u=r;if(u.type==="content"&&typeof u.content=="object"&&u.content!==null){const f=u.content;if(f.type==="text")return{type:"content",content:{type:"text",text:typeof f.text=="string"?f.text:""}}}return u.type==="text"?{type:"text",text:typeof u.text=="string"?u.text:""}:u.type==="diff"?{type:"diff",path:typeof u.path=="string"?u.path:"",oldText:typeof u.oldText=="string"?u.oldText:"",newText:typeof u.newText=="string"?u.newText:"",line:typeof u.line=="number"?u.line:null}:u.type==="terminal"?{type:"terminal",terminalId:typeof u.terminalId=="string"?u.terminalId:""}:{type:"text",text:""}})},p={type:"tool_call_update",sessionId:a,status:"active",toolCallUpdate:c,messageId:d};k.debug("Notifying tool_output as tool_call_update",{sessionUpdate:p}),this.notifySessionUpdate(p)}else if(o?.sessionUpdate==="agent_message_chunk"){const i=o._meta&&typeof o._meta=="object"&&"isReplay"in o._meta&&o._meta.isReplay===!0;if(this.isInReplayMode&&!i)return;const d={type:"generic",sessionId:a,status:"active"},c=o._meta&&typeof o._meta=="object"&&"tokenUsage"in o._meta?o._meta.tokenUsage:void 0,p=o.content;if(p&&typeof p=="object"){const r=p;let u=null;if(r.type==="text"&&typeof r.text=="string"&&(u={id:e.sessionId,role:"assistant",contentDelta:{type:"text",text:r.text},tokenUsage:c,isComplete:!1}),u&&!i){const f=this.chunkResolvers.shift();f?f(u):this.messageQueue.push(u)}if(u&&typeof r.text=="string"&&(i||!this.isReceivingMessages)){const f={type:"generic",sessionId:a,status:"active",message:{id:`msg_${Date.now()}_assistant`,role:"assistant",content:[{type:"text",text:r.text}],timestamp:new Date().toISOString()}};this.notifySessionUpdate(f)}}i||this.notifySessionUpdate(d)}else if(o?.sessionUpdate==="user_message_chunk"){k.debug("Received user_message_chunk",{update:o});const i=o.content;if(i&&typeof i=="object"){const d=i;if(d.type==="text"&&typeof d.text=="string"){const c={type:"generic",sessionId:a,status:"active",message:{id:`msg_${Date.now()}_user`,role:"user",content:[{type:"text",text:d.text}],timestamp:new Date().toISOString()}};k.debug("Notifying session update for user message"),this.notifySessionUpdate(c)}}}else{const i={type:"generic",sessionId:a,status:"active"};this.notifySessionUpdate(i)}}generateRequestId(){return`req-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}notifySessionUpdate(e){for(const n of this.sessionUpdateCallbacks)try{n(e)}catch(o){k.error("Error in session update callback",{error:o})}}notifyError(e){for(const n of this.errorCallbacks)try{n(e)}catch(o){k.error("Error in error callback",{error:o})}}}class Cn{constructor(){throw new Error("StdioTransport is not available in the browser. Use HttpTransport or WebSocketTransport instead.")}async connect(){throw new Error("StdioTransport not available in browser")}async disconnect(){}async send(){throw new Error("StdioTransport not available in browser")}async*receive(){throw new Error("StdioTransport not available in browser")}isConnected(){return!1}onSessionUpdate(){return()=>{}}onError(){return()=>{}}}class kn{ws=null;connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;constructor(e){}async connect(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async disconnect(){this.ws&&(this.ws.close(),this.ws=null),this.connected=!1}async send(e){throw!this.connected||!this.ws?new Error("Transport not connected"):new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async*receive(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}isConnected(){return this.connected}onSessionUpdate(e){return this.sessionUpdateCallbacks.add(e),()=>{this.sessionUpdateCallbacks.delete(e)}}onError(e){return this.errorCallbacks.add(e),()=>{this.errorCallbacks.delete(e)}}}const xe=H("acp-client","debug");class Tn{config;transport;sessions=new Map;currentSessionId=null;sessionUpdateHandlers=new Set;errorHandlers=new Set;constructor(e){this.config=e,this.transport=this.createTransport(),this.setupTransportListeners(),e.autoConnect&&this.connect().catch(n=>{xe.error("Failed to auto-connect",{error:n instanceof Error?n.message:String(n)})})}async connect(){await this.transport.connect()}async disconnect(){await this.transport.disconnect(),this.currentSessionId=null}isConnected(){return this.transport.isConnected()}async startSession(e){const n="currentSessionId"in this.transport?this.transport.currentSessionId:void 0;if(n){const d=new Date().toISOString(),c={id:n,status:"connected",config:e?{...e,agentPath:e.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:d}};return this.sessions.set(n,c),this.currentSessionId=n,n}const o=this.generateSessionId(),a=new Date().toISOString(),i={id:o,status:"connecting",config:e?{...e,agentPath:e.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:a}};return this.sessions.set(o,i),this.currentSessionId=o,this.updateSessionStatus(o,"connected"),o}async loadSession(e,n){if(!this.transport.loadSession)throw new Error("Transport does not support loading sessions");const o=new Date().toISOString(),a={id:e,status:"connecting",config:n?{...n,agentPath:n.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:o}};return this.sessions.set(e,a),this.currentSessionId=e,await this.transport.loadSession(e),this.updateSessionStatus(e,"connected"),e}async sendMessage(e,n){const o=n||this.currentSessionId;if(!o)throw new Error("No active session. Start a session first.");if(!this.transport.isConnected())throw new Error("Transport not connected");const a=this.sessions.get(o);if(!a)throw new Error(`Session ${o} not found`);const i={id:this.generateMessageId(),role:"user",content:[{type:"text",text:e}],timestamp:new Date().toISOString()};a.messages.push(i),this.updateSessionStatus(o,"active"),await this.transport.send(i)}async*receiveMessages(){if(!this.transport.isConnected())throw new Error("Transport not connected");yield*this.transport.receive()}getSession(e){return this.sessions.get(e)}getCurrentSession(){return this.currentSessionId?this.sessions.get(this.currentSessionId):void 0}getAllSessions(){return Array.from(this.sessions.values())}onSessionUpdate(e){return this.sessionUpdateHandlers.add(e),()=>{this.sessionUpdateHandlers.delete(e)}}onError(e){return this.errorHandlers.add(e),()=>{this.errorHandlers.delete(e)}}createTransport(){switch(this.config.type){case"stdio":return new Cn(this.config.options);case"http":return new Sn(this.config.options);case"websocket":return new kn(this.config.options);default:throw new Error(`Unknown transport type: ${this.config.type}`)}}setupTransportListeners(){this.transport.onSessionUpdate(e=>{this.handleSessionUpdate(e)}),this.transport.onError(e=>{this.handleError(e)})}handleSessionUpdate(e){if(e.sessionId){const n=this.sessions.get(e.sessionId);n&&(e.status&&(n.status=e.status),e.message&&n.messages.push(e.message),e.error&&(n.error=e.error))}for(const n of this.sessionUpdateHandlers)try{n(e)}catch(o){xe.error("Error in session update handler",{error:o instanceof Error?o.message:String(o)})}}handleError(e){for(const n of this.errorHandlers)try{n(e)}catch(o){xe.error("Error in error handler",{error:o instanceof Error?o.message:String(o)})}}updateSessionStatus(e,n){const o=this.sessions.get(e);o&&(o.status=n,this.handleSessionUpdate({sessionId:e,status:n}))}generateSessionId(){return`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}generateMessageId(){return`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}}const J=H("acp-client-hook");function In(s){const[e,n]=l.useState(null),[o,a]=l.useState(null),[i,d]=l.useState(null);return l.useEffect(()=>{const p=new URLSearchParams(window.location.search).get("session");p&&(J.info("Session ID found in URL",{sessionId:p}),d(p));try{J.info("Initializing ACP client",{serverUrl:s.serverUrl});const r=new Tn({type:"http",options:{baseUrl:s.serverUrl}});return n(r),J.info("ACP client initialized successfully"),()=>{J.debug("Disconnecting ACP client"),r.disconnect().catch(u=>{J.error("Failed to disconnect ACP client",{error:u instanceof Error?u.message:String(u)})})}}catch(r){const u=r instanceof Error?r.message:"Failed to initialize ACP client";a(u),J.error("Failed to initialize ACP client",{error:r instanceof Error?r.message:String(r),stack:r instanceof Error?r.stack:void 0});return}},[s.serverUrl]),{client:e,error:o,sessionId:i}}const xt=$(["pending","in_progress","completed","failed"]),En=$(["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"]),bt=E({path:v(),line:M().nullable().optional()}),je=E({inputTokens:M().optional(),outputTokens:M().optional(),totalTokens:M().optional()}),yt=ze("type",[E({type:_("content"),content:E({type:_("text"),text:v()})}),E({type:_("text"),text:v()}),E({type:_("diff"),path:v(),oldText:v(),newText:v(),line:M().nullable().optional()}),E({type:_("terminal"),terminalId:v()})]),wt=E({id:v(),title:v(),prettyName:v().optional(),icon:v().optional(),kind:En,status:xt,contentPosition:M().optional(),locations:A(bt).optional(),rawInput:z(v(),F()).optional(),rawOutput:z(v(),F()).optional(),content:A(yt).optional(),error:v().optional(),startedAt:M().optional(),completedAt:M().optional(),tokenUsage:je.optional()}),Rn=E({id:v(),status:xt.optional(),locations:A(bt).optional(),rawOutput:z(v(),F()).optional(),content:A(yt).optional(),error:v().optional(),completedAt:M().optional(),tokenUsage:je.optional()});function Ae(s,e){return{...s,status:e.status??s.status,locations:e.locations??s.locations,rawOutput:e.rawOutput??s.rawOutput,content:e.content?[...s.content??[],...e.content]:s.content,error:e.error??s.error,completedAt:e.completedAt??s.completedAt,tokenUsage:e.tokenUsage??s.tokenUsage}}const X=H("chat-store","debug"),T=Es(s=>({connectionStatus:"disconnected",sessionId:null,error:null,messages:[],isStreaming:!1,streamingStartTime:null,toolCalls:{},totalBilled:{inputTokens:0,outputTokens:0,totalTokens:0},currentContext:{inputTokens:0,outputTokens:0,totalTokens:0},currentModel:"claude-sonnet-4-5-20250929",tokenDisplayMode:"context",logs:[],activeTab:"chat",input:{value:"",isSubmitting:!1,attachedFiles:[]},setConnectionStatus:e=>s({connectionStatus:e}),setSessionId:e=>s({sessionId:e}),setError:e=>s({error:e}),addMessage:e=>s(n=>({messages:[...n.messages,e]})),updateMessage:(e,n)=>s(o=>{const a=o.messages.find(r=>r.id===e);let i=o.totalBilled,d=o.currentContext,c=n;if(n.tokenUsage){const r=a?.tokenUsage;X.debug("updateMessage: incoming tokenUsage",{incoming:n.tokenUsage,existing:r});const u={inputTokens:Math.max(n.tokenUsage.inputTokens??0,r?.inputTokens??0),outputTokens:Math.max(n.tokenUsage.outputTokens??0,r?.outputTokens??0),totalTokens:Math.max(n.tokenUsage.inputTokens??0,r?.inputTokens??0)+Math.max(n.tokenUsage.outputTokens??0,r?.outputTokens??0)};X.debug("updateMessage: merged tokenUsage",{merged:u}),c={...n,tokenUsage:u};const f=u.inputTokens-(r?.inputTokens??0),m=u.outputTokens-(r?.outputTokens??0),w=u.totalTokens-(r?.totalTokens??0);i={inputTokens:o.totalBilled.inputTokens+f,outputTokens:o.totalBilled.outputTokens+m,totalTokens:o.totalBilled.totalTokens+w},d={inputTokens:u.inputTokens,outputTokens:o.currentContext.outputTokens+m,totalTokens:u.totalTokens}}const p=o.messages.map(r=>r.id===e?{...r,...c}:r);if(n.tokenUsage&&c.tokenUsage){const r=a?.tokenUsage,u=c.tokenUsage,f=(u.inputTokens??0)-(r?.inputTokens??0),m=(u.outputTokens??0)-(r?.outputTokens??0),w=(u.totalTokens??0)-(r?.totalTokens??0),g=p.filter(y=>y.tokenUsage).map(y=>({id:y.id,role:y.role,tokens:y.tokenUsage})),x=p.reduce((y,j)=>({inputTokens:y.inputTokens+(j.tokenUsage?.inputTokens??0),outputTokens:y.outputTokens+(j.tokenUsage?.outputTokens??0),totalTokens:y.totalTokens+(j.tokenUsage?.totalTokens??0)}),{inputTokens:0,outputTokens:0,totalTokens:0}),b=x.inputTokens===i.inputTokens&&x.outputTokens===i.outputTokens&&x.totalTokens===i.totalTokens;X.debug("updateMessage: tokenUsage update",{messageId:e,updates:n.tokenUsage,existing:r,messageMax:u,delta:{inputDelta:f,outputDelta:m,totalDelta:w},totalBilled:i,currentContext:d,actualSum:x,billedCorrect:b?"✅":"❌",messageCount:p.length,messagesWithTokens:g.length,breakdown:g})}return{messages:p,totalBilled:i,currentContext:d}}),clearMessages:()=>s({messages:[]}),setIsStreaming:e=>s({isStreaming:e}),setStreamingStartTime:e=>s({streamingStartTime:e}),addToolCall:(e,n)=>s(o=>({toolCalls:{...o.toolCalls,[e]:[...o.toolCalls[e]||[],n]}})),addToolCallToCurrentMessage:e=>s(n=>{const o=n.messages.findLastIndex(p=>p.role==="assistant");if(o===-1){X.debug("No assistant message found, creating one for tool call at position 0");const p={id:`msg_${Date.now()}_assistant`,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!1,toolCalls:[{...e,contentPosition:0}]};return{messages:[...n.messages,p]}}const a=[...n.messages],i=a[o];if(!i)return n;const d=i.content.length,c={...e,contentPosition:d};return a[o]={...i,toolCalls:[...i.toolCalls||[],c]},{messages:a}}),updateToolCallInCurrentMessage:e=>s(n=>{const o=n.messages.findLastIndex(u=>u.role==="assistant");if(o===-1)return X.warn("No assistant message found to update tool call in"),n;const a=[...n.messages],i=a[o];if(!i)return n;const d=i.toolCalls||[],c=d.findIndex(u=>u.id===e.id);if(c===-1)return X.warn(`Tool call ${e.id} not found in message`),n;const p=d[c];if(!p)return n;const r=[...d];return r[c]=Ae(p,e),a[o]={...i,toolCalls:r},{messages:a}}),updateToolCall:(e,n)=>s(o=>{const a=o.toolCalls[e]||[],i=a.findIndex(p=>p.id===n.id);if(i===-1)return o;const d=a[i];if(!d)return o;const c=[...a];return c[i]=Ae(d,n),{toolCalls:{...o.toolCalls,[e]:c}}}),setInputValue:e=>s(n=>({input:{...n.input,value:e}})),setInputSubmitting:e=>s(n=>({input:{...n.input,isSubmitting:e}})),addFileAttachment:e=>s(n=>({input:{...n.input,attachedFiles:[...n.input.attachedFiles,e]}})),removeFileAttachment:e=>s(n=>({input:{...n.input,attachedFiles:n.input.attachedFiles.filter((o,a)=>a!==e)}})),clearInput:()=>s(e=>({input:{value:"",isSubmitting:!1,attachedFiles:[]}})),addTokenUsage:e=>s(n=>({totalBilled:{inputTokens:n.totalBilled.inputTokens+(e.inputTokens??0),outputTokens:n.totalBilled.outputTokens+(e.outputTokens??0),totalTokens:n.totalBilled.totalTokens+(e.totalTokens??0)},currentContext:{inputTokens:e.inputTokens??n.currentContext.inputTokens,outputTokens:n.currentContext.outputTokens+(e.outputTokens??0),totalTokens:(e.inputTokens??n.currentContext.inputTokens)+(n.currentContext.outputTokens+(e.outputTokens??0))}})),setCurrentModel:e=>s({currentModel:e}),resetTokens:()=>s({totalBilled:{inputTokens:0,outputTokens:0,totalTokens:0},currentContext:{inputTokens:0,outputTokens:0,totalTokens:0}}),cycleTokenDisplayMode:()=>s(e=>{const n=["context","input","output"],a=(n.indexOf(e.tokenDisplayMode)+1)%n.length,i=n[a];return i?{tokenDisplayMode:i}:e}),addLog:e=>s(n=>({logs:[...n.logs,e]})),clearLogs:()=>s({logs:[]}),setActiveTab:e=>s({activeTab:e})})),Y=H("use-chat-messages","debug");function vt(s,e){const n=T(f=>f.messages),o=T(f=>f.isStreaming),a=T(f=>f.sessionId),i=T(f=>f.setIsStreaming),d=T(f=>f.setStreamingStartTime),c=T(f=>f.addMessage),p=T(f=>f.updateMessage),r=T(f=>f.setError),u=l.useCallback(async f=>{if(!s){Y.error("No client available"),r("No client available");return}let m=a;if(!m){Y.info("Creating new session before sending first message");const g=await e();if(!g){Y.error("Failed to create session"),r("Failed to create session");return}m=g,Y.info("Session created successfully",{sessionId:g})}const w=`msg_${Date.now()}_assistant`;try{const g=Date.now();i(!0),d(g);const x={id:`msg_${Date.now()}_user`,role:"user",content:f,timestamp:new Date().toISOString(),isStreaming:!1};c(x);const b={id:w,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!0,streamingStartTime:g};c(b);const y=s.receiveMessages();s.sendMessage(f,m).catch(C=>{const I=C instanceof Error?C.message:String(C);r(I),i(!1),d(null)});let j="",S=!1;for await(const C of y)if(C.tokenUsage&&Y.debug("chunk.tokenUsage",{tokenUsage:C.tokenUsage}),C.isComplete){p(w,{content:j,isStreaming:!1,streamingStartTime:void 0,...C.tokenUsage?{tokenUsage:C.tokenUsage}:{}}),i(!1),d(null),S=!0;break}else C.contentDelta.type==="text"&&(j+=C.contentDelta.text,p(w,{content:j,...C.tokenUsage?{tokenUsage:C.tokenUsage}:{}}),await new Promise(I=>setTimeout(I,16)));S||(Y.warn("Stream ended without isComplete flag"),p(w,{isStreaming:!1,streamingStartTime:void 0}),i(!1),d(null))}catch(g){const x=g instanceof Error?g.message:String(g);r(x),i(!1),d(null),p(w,{isStreaming:!1,streamingStartTime:void 0})}},[s,a,e,c,p,i,d,r]);return{messages:n,isStreaming:o,sendMessage:u}}const Mn=H("use-chat-input","debug");function An(s,e){const n=T(m=>m.input),o=T(m=>m.setInputValue),a=T(m=>m.setInputSubmitting),i=T(m=>m.addFileAttachment),d=T(m=>m.removeFileAttachment),{sendMessage:c}=vt(s,e),p=l.useCallback(m=>{o(m)},[o]),r=l.useCallback(async()=>{if(!n.value.trim()||n.isSubmitting)return;const m=n.value;o(""),a(!0);try{await c(m)}catch(w){Mn.error("Failed to send message",{error:w instanceof Error?w.message:String(w)})}finally{a(!1)}},[n,o,a,c]),u=l.useCallback(m=>{i(m)},[i]),f=l.useCallback(m=>{d(m)},[d]);return{value:n.value,isSubmitting:n.isSubmitting,attachedFiles:n.attachedFiles,onChange:p,onSubmit:r,onAttachFile:u,onRemoveFile:f}}const W=H("use-chat-session","debug");function Un(s,e){const n=T(g=>g.connectionStatus),o=T(g=>g.sessionId),a=T(g=>g.setConnectionStatus),i=T(g=>g.setSessionId),d=T(g=>g.setError),c=T(g=>g.clearMessages),p=T(g=>g.resetTokens),r=T(g=>g.addMessage);l.useEffect(()=>s?s.onSessionUpdate(x=>{if(x.message&&(W.debug("Session update with message",{message:x.message}),x.message.role!=="tool")){const b=x.message.content.map(S=>S.type==="text"?S.text:"").join(""),y=T.getState().messages,j=y[y.length-1];if(x.message.role==="assistant"&&j?.role==="assistant"&&j.content===""&&b)W.debug("Appending text to existing assistant message"),T.getState().updateMessage(j.id,{content:j.content+b});else{const S={id:x.message.id,role:x.message.role,content:b,timestamp:x.message.timestamp,isStreaming:!1};r(S)}}}):void 0,[s,r]);const u=l.useCallback(async()=>{if(!s){d("No client available");return}try{a("connecting"),d(null),await s.connect(),a("connected")}catch(g){W.error("Failed to connect",{error:g instanceof Error?g.message:String(g)});const x=g instanceof Error?g.message:String(g);d(x),a("error")}},[s,a,d]),f=l.useCallback(async g=>{if(!s){d("No client available");return}try{a("connecting"),d(null);const x=await s.loadSession(g);i(x),a("connected"),p(),W.info("Session loaded successfully",{sessionId:x})}catch(x){W.warn("Failed to load session, creating new one instead",{sessionId:g,error:x instanceof Error?x.message:String(x)});try{await u();const b=await s.startSession();if(i(b),c(),p(),typeof window<"u"){const y=new URL(window.location.href);y.searchParams.set("session",b),window.history.replaceState({},"",y.toString())}W.info("Created new session after failed load",{sessionId:b})}catch(b){const y=b instanceof Error?b.message:String(b);d(`Failed to load or create session: ${y}`),a("error")}}},[s,a,i,d,c,p,u]),m=l.useCallback(async()=>{if(!s)return d("No client available"),null;try{const g=await s.startSession();if(i(g),c(),p(),typeof window<"u"){const x=new URL(window.location.href);x.searchParams.set("session",g),window.history.pushState({},"",x.toString())}return g}catch(g){const x=g instanceof Error?g.message:String(g);return d(x),null}},[s,i,d,c,p]),w=l.useCallback(async()=>{if(s)try{await s.disconnect(),a("disconnected"),i(null)}catch(g){const x=g instanceof Error?g.message:String(g);d(x)}},[s,a,i,d]);return l.useEffect(()=>{!s||n!=="disconnected"||(e?(W.info("Loading initial session from URL",{sessionId:e}),f(e)):u())},[s,n,e,u,f]),{connectionStatus:n,sessionId:o,connect:u,loadSession:f,startSession:m,disconnect:w}}function Dn(s){const e=T(d=>d.toolCalls),n=T(d=>d.addToolCall),o=T(d=>d.updateToolCall),a=T(d=>d.addToolCallToCurrentMessage),i=T(d=>d.updateToolCallInCurrentMessage);return l.useEffect(()=>{if(!s)return;const d=s.onSessionUpdate(c=>{c.type==="tool_call"?(n(c.sessionId,c.toolCall),a(c.toolCall)):c.type==="tool_call_update"&&(o(c.sessionId,c.toolCallUpdate),i(c.toolCallUpdate))});return()=>{d()}},[s,n,o,a,i]),{toolCalls:e,getToolCallsForSession:d=>{const c=e[d];return c&&c.length>0?c:Object.values(e).flat()}}}const Pn=E({id:v(),role:$(["user","assistant","system"]),content:v(),timestamp:de(),isStreaming:te().default(!1),streamingStartTime:M().optional(),metadata:z(v(),F()).optional(),toolCalls:A(wt).optional(),tokenUsage:je.optional()}),_n=E({value:v(),isSubmitting:te(),attachedFiles:A(E({name:v(),path:v(),size:M(),mimeType:v()}))});E({sessionId:v().nullable(),isConnected:te(),isStreaming:te(),messages:A(Pn),input:_n,error:v().nullable()});$(["disconnected","connecting","connected","error"]);const Ln=E({name:v(),description:v().optional(),parameters:z(v(),F()).optional()}),zn=E({name:v(),description:v(),parameters:z(v(),F()),required:A(v()).optional()}),Fn=E({name:v(),version:v().optional(),description:v().optional(),author:v().optional(),capabilities:A(Ln).optional(),tools:A(zn).optional(),supportedFormats:A(v()).optional()}),On=$(["initializing","ready","busy","error","terminated"]);E({status:On,info:Fn.optional(),pid:M().optional(),error:v().optional(),uptime:M().optional()});const jt=$(["user","assistant","system","tool"]),Bn=$(["text","image","file","tool_call","tool_result"]),oe=E({type:Bn}),$n=oe.extend({type:_("text"),text:v()}),Hn=oe.extend({type:_("image"),url:v().url().optional(),data:v().optional(),mimeType:v().optional()}),Wn=oe.extend({type:_("file"),name:v(),path:v().optional(),url:v().url().optional(),mimeType:v(),size:M().optional()}),Vn=oe.extend({type:_("tool_call"),id:v(),name:v(),arguments:z(v(),F())}),qn=oe.extend({type:_("tool_result"),callId:v(),result:F(),error:v().optional()}),Nt=ze("type",[$n,Hn,Wn,Vn,qn]),St=E({id:v(),role:jt,content:A(Nt),timestamp:de(),metadata:z(v(),F()).optional()});E({id:v(),role:jt,contentDelta:Nt,isComplete:te(),tokenUsage:E({inputTokens:M().optional(),outputTokens:M().optional(),totalTokens:M().optional()}).optional()});const Ct=$(["idle","connecting","connected","active","streaming","error","disconnected"]),Qn=E({agentPath:v(),agentArgs:A(v()).optional(),environment:z(v(),v()).optional(),workingDirectory:v().optional(),timeout:M().optional()}),Gn=E({agentName:v().optional(),agentVersion:v().optional(),capabilities:A(v()).optional(),startedAt:de(),lastActivityAt:de().optional()});E({id:v(),status:Ct,config:Qn,metadata:Gn.optional(),messages:A(St),error:v().optional()});const ue=E({sessionId:v(),status:Ct.optional(),message:St.optional(),error:v().optional()}),Kn=ue.extend({type:_("tool_call"),toolCall:wt,messageId:v().optional()}),Jn=ue.extend({type:_("tool_call_update"),toolCallUpdate:Rn,messageId:v().optional()}),Xn=ue.extend({type:_("tool_output"),toolOutput:E({id:v(),content:A(Rs()).optional(),rawOutput:z(v(),F()).optional()}),messageId:v().optional()}),Yn=ue.extend({type:_("generic").optional()});Ms([Kn,Jn,Xn,Yn]);const Zn=[{id:"folder-1",name:"Item 1",type:"folder",children:[{id:"file-1-1",name:"Item 2",type:"file",extension:"tsx"},{id:"file-1-2",name:"Item 3",type:"file",extension:"ts"},{id:"file-1-3",name:"Item 4",type:"file",extension:"json"},{id:"file-1-4",name:"Item 5",type:"file",extension:"md"}]},{id:"folder-2",name:"Description 1",type:"folder",children:[{id:"file-2-1",name:"Description 2",type:"file",extension:"tsx"},{id:"file-2-2",name:"Description 3",type:"file",extension:"ts"},{id:"file-2-3",name:"Description 4",type:"file",extension:"json"},{id:"file-2-4",name:"Description 5",type:"file",extension:"md"}]},{id:"folder-3",name:"financial-docs",type:"folder",children:[]}];class eo{data;constructor(e=Zn){this.data=e}async getRootItems(){return Promise.resolve(this.data)}async getItemChildren(e){const n=a=>{for(const i of a){if(i.id===e)return i;if(i.children){const d=n(i.children);if(d)return d}}},o=n(this.data);return Promise.resolve(o?.children||[])}async getItemDetails(e){const n=a=>{for(const i of a){if(i.id===e)return i;if(i.children){const d=n(i.children);if(d)return d}}},o=n(this.data);if(!o)throw new Error(`Item with id ${e} not found`);return Promise.resolve(o)}}const to=[{id:"1",title:"Boeing Scores Early Wins at Dubai Airshow",url:"https://www.reuters.com/business/aerospace-defense/boeing-scores-early-wins-dubai-airshow-2024-11-17",snippet:"DUBAI, Nov 17 (Reuters) - Boeing (BA.N), opens new tab took centre stage at day one of the Dubai Airshow on Monday, booking a $38 billion order from host carrier Emirates and clinching more deals with African carriers, while China displayed its C919 in the Middle East for the first time.",sourceName:"Reuters",favicon:"https://www.reuters.com/favicon.ico"},{id:"2",title:"Boeing's Sustainable Aviation Goals Take Flight",url:"https://www.forbes.com/boeing-sustainability",snippet:"SEATTLE, Nov 18 (Reuters) - Boeing is making headway towards its sustainability targets, unveiling plans for a new eco-friendly aircraft design aimed at reducing emissions by 50% by 2030.",sourceName:"Forbes"},{id:"3",title:"Boeing Faces Increased Competition in Global Aviation Market",url:"https://www.reuters.com/business/aerospace-defense/boeing-competition-2024-11-19",snippet:"CHICAGO, Nov 19 (Reuters) - As the global aviation industry rebounds post-pandemic, Boeing is grappling with intensified competition from rival manufacturers, particularly in the Asian market.",sourceName:"Reuters",favicon:"https://www.reuters.com/favicon.ico"},{id:"4",title:"Boeing's Starliner Successfully Completes Orbital Test Flight",url:"https://www.theverge.com/boeing-starliner",snippet:"NASA, Nov 20 (Reuters) - Boeing's CST-100 Starliner spacecraft achieves a significant milestone, successfully completing its orbital test flight, paving the way for future crewed missions to the International Space Station.",sourceName:"The Verge"}],so=[{id:"todo-1",text:"Review filesystem implementation",status:"completed"},{id:"todo-2",text:"Add overflow menu actions",status:"in_progress"},{id:"todo-3",text:"Connect to real filesystem API",status:"pending"},{id:"todo-4",text:"Implement drag and drop support",status:"pending"},{id:"todo-5",text:"Add file preview functionality",status:"pending"}];function h(...s){return As(Us(s))}const no=Q("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-paragraph-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-hover",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive-hover",outline:"border border-input bg-background hover:bg-accent-hover hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary-hover",ghost:"hover:bg-accent-hover hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),G=l.forwardRef(({className:s,variant:e,size:n,asChild:o=!1,...a},i)=>{const d=o?se:"button";return t.jsx(d,{className:h(no({variant:e,size:n,className:s})),ref:i,...a})});G.displayName="Button";const oo=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:h("rounded-lg border bg-card text-card-foreground shadow-sm",s),...e}));oo.displayName="Card";const ro=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:h("flex flex-col space-y-1.5 p-6",s),...e}));ro.displayName="CardHeader";const ao=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:h("text-2xl font-semibold leading-none tracking-tight",s),...e}));ao.displayName="CardTitle";const io=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:h("text-sm text-muted-foreground",s),...e}));io.displayName="CardDescription";const lo=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:h("p-6 pt-0",s),...e}));lo.displayName="CardContent";const co=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:h("flex items-center p-6 pt-0",s),...e}));co.displayName="CardFooter";const kt=l.forwardRef(({title:s,description:e,guideUrl:n,guideText:o="Guide",suggestedPrompts:a=[],onPromptClick:i,onGuideClick:d,onOpenFiles:c,onPromptHover:p,onPromptLeave:r,className:u,...f},m)=>{const w=b=>{i?.(b)},g=()=>{n&&window.open(n,"_blank","noopener,noreferrer"),d?.()},x=[];for(let b=0;b<a.length;b+=2)x.push(a.slice(b,b+2));return t.jsxs("div",{ref:m,className:h("flex flex-col items-start",u),...f,children:[t.jsx("h3",{className:"text-heading-4 text-text-primary mb-6",children:s}),t.jsx("p",{className:"text-subheading text-text-secondary max-w-prose mb-6",children:e}),c&&t.jsxs("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1 py-1.5 pr-3 -ml-3 pl-3 rounded-lg hover:bg-accent transition-colors mb-6",children:[t.jsx("span",{className:"text-paragraph-sm-medium text-foreground tracking-wide leading-none",children:"View Files"}),t.jsx(be,{className:"size-4 text-foreground shrink-0"})]}),(n||d)&&t.jsxs("button",{type:"button",onClick:g,className:"inline-flex items-center gap-1 py-1.5 pr-3 -ml-3 pl-3 rounded-lg hover:bg-accent transition-colors",children:[t.jsx("span",{className:"text-paragraph-sm-medium text-foreground tracking-wide leading-none",children:o}),t.jsx(be,{className:"size-4 text-foreground shrink-0"})]}),a.length>0&&t.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-prompt-container",children:[t.jsx("p",{className:"text-label text-text-tertiary",children:"Suggested Prompts"}),t.jsx("div",{className:"flex flex-col gap-2.5",children:x.map(b=>t.jsx("div",{className:"flex gap-2.5 items-center",children:b.map(y=>t.jsx("button",{type:"button",onClick:()=>w(y),onMouseEnter:()=>p?.(y),onMouseLeave:()=>r?.(),className:"flex-1 flex items-start gap-2 p-3 bg-secondary hover:bg-secondary/80 rounded-2xl transition-colors min-w-0",children:t.jsx("span",{className:"text-paragraph font-normal leading-normal text-text-tertiary truncate",children:y})},y))},b.join("-")))})]})]})});kt.displayName="ChatEmptyState";const Tt=l.createContext(void 0),Ne=()=>{const s=l.useContext(Tt);if(!s)throw new Error("ChatHeader components must be used within ChatHeader.Root");return s},It=l.forwardRef(({defaultExpanded:s=!1,expanded:e,onExpandedChange:n,className:o,children:a,...i},d)=>{const[c,p]=l.useState(s),r=e??c,u=l.useCallback(g=>{p(g),n?.(g)},[n]),f=l.Children.toArray(a),m=f.find(g=>l.isValidElement(g)&&typeof g.type=="function"&&g.type.displayName==="ChatHeader.ExpandablePanel"),w=f.filter(g=>g!==m);return t.jsxs(Tt.Provider,{value:{isExpanded:r,setIsExpanded:u},children:[t.jsx("div",{ref:d,className:h("flex items-center justify-between px-6 py-4",o),...i,children:w}),m]})});It.displayName="ChatHeader.Root";const uo=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("h1",{ref:o,className:h("m-0 text-subheading font-semibold",s),...n,children:e}));uo.displayName="ChatHeader.Title";const po=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:h("flex items-center gap-3",s),...n,children:e}));po.displayName="ChatHeader.Actions";const fo=s=>{switch(s){case"connected":return"bg-green-500";case"connecting":return"bg-yellow-500";case"error":return"bg-red-500";default:return"bg-gray-500"}},mo=s=>{switch(s){case"connected":return"Connected";case"connecting":return"Connecting...";case"error":return"Connection Error";default:return"No Server"}},ho=l.forwardRef(({status:s,statusText:e,className:n,...o},a)=>{const i=e??mo(s),d=fo(s);return t.jsxs("div",{ref:a,className:h("flex items-center gap-2",n),...o,children:[t.jsx("div",{className:h("h-2 w-2 rounded-full",d)}),t.jsx("span",{className:"text-paragraph-sm text-muted-foreground",children:i})]})});ho.displayName="ChatHeader.StatusIndicator";const go=l.forwardRef(({icon:s,className:e,children:n,onClick:o,...a},i)=>{const{isExpanded:d,setIsExpanded:c}=Ne(),p=r=>{c(!d),o?.(r)};return t.jsxs("button",{ref:i,type:"button",onClick:p,className:h("rounded p-1 transition-colors hover:bg-background lg:hidden",e),"aria-label":d?"Collapse header":"Expand header",...a,children:[s&&t.jsx("div",{className:h("transition-transform duration-200",d&&"rotate-180"),children:s}),n]})});go.displayName="ChatHeader.Toggle";const Et=l.forwardRef(({className:s,children:e,...n},o)=>{const{isExpanded:a}=Ne();return a?t.jsx("div",{ref:o,className:h("absolute top-full left-0 right-0 z-50 border-b border-border bg-card px-6 py-4 shadow-lg lg:hidden",s),...n,children:e}):null});Et.displayName="ChatHeader.ExpandablePanel";const Rt=l.forwardRef(({commands:s=[],showCommandMenu:e,commandMenuQuery:n,selectedMenuIndex:o,setSelectedMenuIndex:a,setMenuItemCount:i,triggerCounter:d,onChange:c,className:p,...r},u)=>{const f=l.useCallback((w,g)=>{const x=w.toLowerCase(),b=g.toLowerCase();if(!g)return 1;if(x.includes(b))return 1-b.length/x.length;let y=0;for(let j=0;j<x.length&&y<b.length;j++)x[j]===b[y]&&y++;return y===b.length?.5-y/x.length:0},[]),m=l.useMemo(()=>s.map(w=>({...w,score:Math.max(f(w.label,n),w.description?f(w.description,n):0)})).filter(w=>w.score>0).sort((w,g)=>g.score-w.score),[s,n,f]);return l.useEffect(()=>{i(m.length)},[m.length,i]),l.useEffect(()=>{a(0)},[a]),l.useEffect(()=>{d>0&&m[o]&&(m[o].onSelect(),c(""))},[d,m,o,c]),!e||m.length===0?null:t.jsxs("div",{ref:u,className:h("absolute bottom-full left-0 z-50 mb-2 w-full max-w-md","rounded-md border border-border bg-card p-2 shadow-lg",p),...r,children:[t.jsx("div",{className:"text-caption font-semibold text-muted-foreground px-2 py-1",children:"Commands"}),t.jsx("div",{className:"max-h-64 overflow-y-auto",children:m.map((w,g)=>t.jsxs("button",{type:"button",onClick:()=>w.onSelect(),className:h("w-full rounded-sm px-2 py-2 text-left text-paragraph-sm transition-colors","flex items-start gap-2","hover:bg-muted",g===o&&"bg-muted"),children:[w.icon&&t.jsx("span",{className:"shrink-0 mt-0.5",children:w.icon}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium",children:w.label}),w.description&&t.jsx("div",{className:"text-caption text-muted-foreground truncate",children:w.description})]})]},w.id))})]})});Rt.displayName="ChatInputCommandMenu";const Mt=l.createContext(void 0),pe=()=>{const s=l.useContext(Mt);if(!s)throw new Error("ChatInput components must be used within ChatInput.Root");return s},At=l.forwardRef(({client:s,startSession:e,value:n,onChange:o,onSubmit:a,disabled:i=!1,isSubmitting:d,submitOnEnter:c=!0,className:p,children:r,...u},f)=>{const m=l.useRef(null),w=l.useCallback(async()=>Promise.resolve(null),[]),g=An(s??null,e??w),x=T(D=>D.isStreaming),b=s&&e,y=b?g.value:n||"",j=b?g.onChange:o||(()=>{}),S=b?g.onSubmit:a||(async()=>{}),C=b?g.isSubmitting||x:d||!1,[I,U]=l.useState(!1),[N,R]=l.useState(""),[P,K]=l.useState(0),[B,ms]=l.useState(0),[hs,gs]=l.useState(0),xs=l.useCallback(()=>{gs(D=>D+1)},[]),bs=async D=>{D.preventDefault(),y.trim()&&!C&&!i&&(await S(),setTimeout(()=>{m.current?.focus()},0))},ys=D=>{const O=D.target;!(O.tagName==="BUTTON"||O.tagName==="INPUT"||O.tagName==="TEXTAREA"||O.closest("button"))&&m.current&&m.current.focus()},ws=D=>{const O=D.target;!(O.tagName==="BUTTON"||O.tagName==="INPUT"||O.tagName==="TEXTAREA"||O.closest("button"))&&D.key===" "&&(D.preventDefault(),m.current&&m.current.focus())};return l.useEffect(()=>{const D=document.querySelector('textarea[name="chat-input"]');D&&m.current!==D&&(m.current=D)},[]),l.useEffect(()=>{!y&&m.current&&(m.current.style.height="auto",m.current.style.overflowY="hidden")},[y]),t.jsx(Mt.Provider,{value:{value:y,onChange:j,onSubmit:S,disabled:i,isSubmitting:C,submitOnEnter:c,showCommandMenu:I,setShowCommandMenu:U,commandMenuQuery:N,setCommandMenuQuery:R,selectedMenuIndex:P,setSelectedMenuIndex:K,menuItemCount:B,setMenuItemCount:ms,triggerMenuSelect:xs,triggerCounter:hs},children:t.jsx("form",{ref:f,onSubmit:bs,onClick:ys,onKeyDown:ws,className:h("relative w-full divide-y rounded-xl border bg-background shadow-md",p),...u,children:r})})});At.displayName="ChatInput.Root";const Ut=l.forwardRef(({asChild:s=!1,className:e,onKeyDown:n,children:o,...a},i)=>{const{value:d,onChange:c,onSubmit:p,disabled:r,isSubmitting:u,submitOnEnter:f,showCommandMenu:m,setShowCommandMenu:w,setCommandMenuQuery:g,setSelectedMenuIndex:x,menuItemCount:b,triggerMenuSelect:y}=pe(),j=l.useRef(null),U={ref:l.useCallback(N=>{j.current=N,typeof i=="function"?i(N):i&&(i.current=N)},[i]),name:"chat-input",value:d,onChange:N=>{const R=N.target.value;if(c(R),R.startsWith("/")&&!R.includes(`
|
|
6
|
+
`)){w(!0);const B=R.slice(1);g(B)}else w(!1),g("");const P=j.current;if(!P)return;P.style.height="auto";const K=Math.min(P.scrollHeight,164);P.style.height=`${K}px`,P.scrollHeight>164?P.style.overflowY="auto":P.style.overflowY="hidden"},onKeyDown:N=>{if(m&&b>0){if(N.key==="ArrowDown"){N.preventDefault(),x(R=>(R+1)%b);return}else if(N.key==="ArrowUp"){N.preventDefault(),x(R=>(R-1+b)%b);return}else if(N.key==="Enter"&&!N.shiftKey){N.preventDefault(),y();return}else if(N.key==="Escape"){N.preventDefault(),w(!1),g("");return}}f&&N.key==="Enter"&&!N.shiftKey&&(d.trim()&&!u&&!r?(N.preventDefault(),p()):(u||r)&&N.preventDefault()),n?.(N)},disabled:r,...a};return s&&l.isValidElement(o)?l.cloneElement(o,U):t.jsx("textarea",{...U,rows:1,className:h("w-full resize-none rounded-none border-none p-4 shadow-none","outline-none ring-0 max-h-[6lh] min-h-[44px]","bg-transparent dark:bg-transparent focus-visible:ring-0","text-paragraph-sm placeholder:text-muted-foreground","disabled:cursor-not-allowed disabled:opacity-50",e)})});Ut.displayName="ChatInput.Field";const Dt=l.forwardRef(({asChild:s=!1,className:e,disabled:n,children:o,...a},i)=>{const{value:d,disabled:c,isSubmitting:p}=pe(),r=n||c||p||!d.trim(),u=s?se:G;return t.jsx(u,{ref:i,type:"submit",disabled:r,variant:s?void 0:"default",size:"icon",className:h(!s&&"gap-1.5 rounded-full",e),...a,children:o})});Dt.displayName="ChatInput.Submit";const Pt=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:h("flex items-center justify-between p-2",s),...n,children:e}));Pt.displayName="ChatInput.Toolbar";const _t=l.forwardRef(({asChild:s=!1,className:e,children:n,onClick:o,...a},i)=>{const{value:d,onChange:c,setShowCommandMenu:p,setCommandMenuQuery:r}=pe(),u=m=>{d.startsWith("/")||(c("/"),p(!0),r("")),o?.(m)},f=s?se:G;return t.jsx(f,{ref:i,type:"button",variant:"ghost",size:"icon",className:h("rounded-full",e),onClick:u,...a,children:n||t.jsx(Ks,{className:"size-4"})})});_t.displayName="ChatInput.Actions";const Lt=l.forwardRef(({asChild:s=!1,className:e,children:n,...o},a)=>{const i=s?se:G;return t.jsx(i,{ref:a,type:"button",variant:"ghost",size:"icon",className:h("rounded-full",e),...o,children:n||t.jsx(Js,{className:"size-4"})})});Lt.displayName="ChatInput.Attachment";const zt=l.forwardRef(({asChild:s=!1,className:e,children:n,...o},a)=>{const i=s?se:G;return t.jsx(i,{ref:a,type:"button",variant:"ghost",size:"icon",className:h("rounded-full",e),...o,children:n||t.jsx(Xs,{className:"size-4"})})});zt.displayName="ChatInput.VoiceInput";const Ft=l.forwardRef(({commands:s=[],className:e,onChange:n,...o},a)=>{const{showCommandMenu:i,commandMenuQuery:d,selectedMenuIndex:c,setSelectedMenuIndex:p,setMenuItemCount:r,triggerCounter:u,onChange:f}=pe();return t.jsx(Rt,{ref:a,commands:s,showCommandMenu:i,commandMenuQuery:d,selectedMenuIndex:c,setSelectedMenuIndex:p,setMenuItemCount:r,triggerCounter:u,onChange:f,className:e,...o})});Ft.displayName="ChatInput.CommandMenu";const xo=({className:s,...e})=>t.jsx(js,{className:h("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",s),...e}),Ot=({className:s,...e})=>t.jsx(Ns,{className:h(s),...e}),bo=({withHandle:s,className:e,...n})=>t.jsx(Ss,{className:h("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...n,children:s&&t.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-2.5 w-2.5",children:[t.jsx("title",{children:"Resize Handle"}),t.jsx("circle",{cx:"9",cy:"12",r:"1"}),t.jsx("circle",{cx:"9",cy:"5",r:"1"}),t.jsx("circle",{cx:"9",cy:"19",r:"1"}),t.jsx("circle",{cx:"15",cy:"12",r:"1"}),t.jsx("circle",{cx:"15",cy:"5",r:"1"}),t.jsx("circle",{cx:"15",cy:"19",r:"1"})]})})}),yo=({...s})=>t.jsx(Ds,{position:"top-center",className:"toaster group",style:{"--top-offset":"16px","--width:":"calc(100% - 2 * var(--top-offset))",position:"absolute",zIndex:5,top:"var(--top-offset)",left:"50%",transform:"translateX(-50%)",width:"calc(100% - 2 * var(--top-offset))",maxWidth:"480px"},offset:0,toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...s}),Bt=l.createContext(void 0),re=()=>{const s=l.useContext(Bt);if(!s)throw new Error("ChatLayout components must be used within ChatLayout.Root");return s},$t=l.forwardRef(({defaultSidebarOpen:s=!1,defaultPanelSize:e="hidden",defaultActiveTab:n="todo",className:o,children:a,...i},d)=>{const[c,p]=l.useState(s),[r,u]=l.useState(e),[f,m]=l.useState(n);return t.jsx(Bt.Provider,{value:{sidebarOpen:c,setSidebarOpen:p,panelSize:r,setPanelSize:u,activeTab:f,setActiveTab:m},children:t.jsx("div",{ref:d,className:h("flex h-screen flex-row bg-background text-foreground",o),...i,children:t.jsx(xo,{direction:"horizontal",className:"flex-1",children:a})})})});$t.displayName="ChatLayout.Root";const wo=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:h("relative z-10 border-b border-border bg-card shrink-0",s),...n,children:e}));wo.displayName="ChatLayout.Header";const Ht=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx(Ot,{defaultSize:75,minSize:50,children:t.jsx("div",{ref:o,className:h("flex flex-1 flex-col overflow-hidden h-full",s),...n,children:e})}));Ht.displayName="ChatLayout.Main";const Wt=l.forwardRef(({showToaster:s=!0,className:e,children:n,...o},a)=>t.jsxs("div",{ref:a,className:h("relative flex flex-1 flex-col overflow-hidden",e),...o,children:[n,s&&t.jsx(yo,{})]}));Wt.displayName="ChatLayout.Body";const Vt=l.forwardRef(({className:s,children:e,onScrollChange:n,showScrollToBottom:o=!0,...a},i)=>{const[d,c]=l.useState(!1),p=l.useRef(null),r=l.useRef(!0),u=l.useRef(!1);l.useImperativeHandle(i,()=>p.current);const f=l.useCallback(()=>{const b=p.current;if(!b)return!1;const{scrollTop:y,scrollHeight:j,clientHeight:S}=b,I=j-y-S<100;return c(!I&&o),n?.(I),I},[n,o]),m=l.useCallback(()=>{if(u.current)return;const b=f();r.current=b},[f]),w=l.useCallback((b=!0)=>{const y=p.current;y&&(u.current=!0,r.current=!0,y.scrollTo({top:y.scrollHeight,behavior:b?"smooth":"auto"}),setTimeout(()=>{u.current=!1},b?300:0))},[]);l.useEffect(()=>{p.current&&(r.current&&!u.current&&requestAnimationFrame(()=>{w(!1)}),u.current||f())},[e,w,f]),l.useEffect(()=>{if(!u.current){const b=f();r.current=b}},[f]);const g=l.useCallback(()=>{u.current=!1;const b=p.current;if(!b)return;const{scrollTop:y,scrollHeight:j,clientHeight:S}=b;j-y-S>=100&&(r.current=!1)},[]),x=l.useCallback(b=>{["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(b.key)&&(u.current=!1,requestAnimationFrame(()=>{const j=p.current;if(!j)return;const{scrollTop:S,scrollHeight:C,clientHeight:I}=j,U=C-S-I;r.current=U<100}))},[]);return t.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[t.jsx("div",{ref:p,className:h("h-full overflow-y-auto flex flex-col",s),onScroll:m,onWheel:g,onTouchStart:g,onKeyDown:x,tabIndex:0,...a,children:t.jsx("div",{className:"mx-auto max-w-chat flex-1 w-full flex flex-col",children:e})}),d&&t.jsx("button",{type:"button",onClick:()=>w(!0),className:h("absolute bottom-4 left-1/2 -translate-x-1/2 z-10","flex items-center justify-center p-2 rounded-full","bg-card border border-border shadow-lg","text-foreground","hover:bg-accent hover:text-accent-foreground","transition-all duration-200 ease-in-out","animate-in fade-in slide-in-from-bottom-2"),"aria-label":"Scroll to bottom",children:t.jsx(Ys,{className:"size-4"})})]})});Vt.displayName="ChatLayout.Messages";const qt=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:h("bg-linear-to-t from-background to-transparent px-4 pb-4",s),...n,children:t.jsx("div",{className:"mx-auto max-w-chat",children:e})}));qt.displayName="ChatLayout.Footer";const vo=l.forwardRef(({className:s,children:e,...n},o)=>{const{sidebarOpen:a}=re();return a?t.jsx("div",{ref:o,className:h("border-r border-border bg-card w-64 overflow-y-auto",s),...n,children:e}):null});vo.displayName="ChatLayout.Sidebar";const Qt=l.forwardRef(({breakpoint:s="lg",className:e,children:n,...o},a)=>{const{panelSize:i}=re(),[d,c]=l.useState(25);return l.useEffect(()=>{const p=()=>{const u=400/window.innerWidth*100;c(Math.max(u,25))};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[]),i==="hidden"?null:t.jsxs(t.Fragment,{children:[t.jsx(bo,{withHandle:!0,className:"group-hover:opacity-100 opacity-0 transition-opacity"}),t.jsx(Ot,{defaultSize:25,minSize:d,maxSize:35,className:"group",children:t.jsx("div",{ref:a,className:h("hidden h-full border-l border-border bg-card overflow-y-auto transition-all duration-300",s==="md"&&"md:block",s==="lg"&&"lg:block",s==="xl"&&"xl:block",s==="2xl"&&"2xl:block",e),...o,children:n})})]})});Qt.displayName="ChatLayout.Aside";const Gt=_s,Kt=Ls,jo=l.forwardRef(({className:s,inset:e,children:n,...o},a)=>t.jsxs(Fe,{ref:a,className:h("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-paragraph-sm outline-none","focus:bg-muted data-[state=open]:bg-muted",e&&"pl-8",s),...o,children:[n,t.jsx(be,{className:"ml-auto h-4 w-4"})]}));jo.displayName=Fe.displayName;const No=l.forwardRef(({className:s,...e},n)=>t.jsx(Oe,{ref:n,className:h("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",s),...e}));No.displayName=Oe.displayName;const Se=l.forwardRef(({className:s,sideOffset:e=4,...n},o)=>t.jsx(Ps,{children:t.jsx(Be,{ref:o,sideOffset:e,className:h("z-50 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-0.5 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",s),...n})}));Se.displayName=Be.displayName;const q=l.forwardRef(({className:s,inset:e,...n},o)=>t.jsx($e,{ref:o,className:h("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-paragraph-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",s),...n}));q.displayName=$e.displayName;const So=l.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(He,{ref:o,className:h("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(We,{children:t.jsx(dt,{className:"h-4 w-4"})})}),e]}));So.displayName=He.displayName;const Co=l.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Ve,{ref:o,className:h("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(We,{children:t.jsx(ye,{className:"h-2 w-2 fill-current"})})}),e]}));Co.displayName=Ve.displayName;const ko=l.forwardRef(({className:s,inset:e,...n},o)=>t.jsx(qe,{ref:o,className:h("px-2 py-1.5 text-paragraph-sm font-semibold",e&&"pl-8",s),...n}));ko.displayName=qe.displayName;const Jt=l.forwardRef(({className:s,...e},n)=>t.jsx(Qe,{ref:n,className:h("-mx-1 my-1 h-px bg-border",s),...e}));Jt.displayName=Qe.displayName;function Xt({item:s,level:e=0,onSelect:n,selectedId:o,isDropTarget:a=!1,onDownload:i,onRename:d,onDelete:c}){const[p,r]=l.useState(!0),u=o===s.id,f=()=>{s.type==="folder"&&r(!p)},m=()=>{n?.(s),s.type==="folder"&&f()},w=x=>{x.key==="Enter"||x.key===" "?(x.preventDefault(),m()):x.key==="ArrowRight"&&s.type==="folder"&&!p?(x.preventDefault(),r(!0)):x.key==="ArrowLeft"&&s.type==="folder"&&p&&(x.preventDefault(),r(!1))},g=()=>e===0?"p-2":e===1?"pl-8 pr-2 py-2":"pl-16 pr-2 py-2";return t.jsxs("div",{className:"flex flex-col w-full",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":s.type==="folder"?p:void 0,className:h("group/item flex items-center gap-2 rounded-md cursor-pointer transition-colors text-paragraph-sm",g(),"hover:bg-accent-hover","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",u&&"bg-accent",a&&["bg-accent","border border-dashed border-border-dark"]),onClick:m,onKeyDown:w,children:[t.jsx("div",{className:"shrink-0 size-4 flex items-center justify-center text-foreground",children:s.type==="folder"?p?t.jsx(Zs,{className:"size-4"}):t.jsx(en,{className:"size-4"}):t.jsx(tn,{className:"size-4"})}),t.jsx("p",{className:"flex-1 text-foreground whitespace-nowrap overflow-hidden text-ellipsis",children:s.name}),t.jsxs(Gt,{children:[t.jsx(Kt,{asChild:!0,children:t.jsx("button",{className:h("shrink-0 size-4 transition-opacity text-muted-foreground hover:text-foreground","opacity-0 group-hover/item:opacity-100","data-[state=open]:opacity-100"),onClick:x=>{x.stopPropagation()},"aria-label":"More options",type:"button",tabIndex:-1,children:t.jsx(sn,{className:"size-4"})})}),t.jsxs(Se,{align:"end",side:"bottom",sideOffset:5,alignOffset:0,collisionPadding:8,className:"w-40 z-[100]",onClick:x=>x.stopPropagation(),children:[i&&t.jsx(q,{onClick:x=>{x.stopPropagation(),i(s)},children:"Download"}),d&&t.jsx(q,{onClick:x=>{x.stopPropagation(),d(s)},children:"Rename"}),(i||d)&&c&&t.jsx(Jt,{}),c&&t.jsx(q,{className:"text-destructive focus:text-destructive focus:bg-muted",onClick:x=>{x.stopPropagation(),c(s)},children:t.jsx("span",{className:"text-paragraph-sm",children:"Delete"})})]})]}),s.type==="folder"&&t.jsx("div",{className:"shrink-0 size-4 flex items-center justify-center text-muted-foreground",children:t.jsx(ne,{className:h("size-4 transition-transform",!p&&"-rotate-90")})})]}),s.type==="folder"&&p&&s.children&&t.jsx("div",{className:"flex flex-col",children:s.children.map(x=>t.jsx(Xt,{item:x,level:e+1,...n&&{onSelect:n},...o&&{selectedId:o},...i&&{onDownload:i},...d&&{onRename:d},...c&&{onDelete:c}},x.id))})]})}const To=new eo;function Io({className:s,provider:e=To,onItemSelect:n,onDownload:o,onRename:a,onDelete:i}){const[d,c]=l.useState([]),[p,r]=l.useState(),[u,f]=l.useState(!0),[m,w]=l.useState();l.useEffect(()=>{(async()=>{try{f(!0);const b=await e.getRootItems();c(b),w(void 0)}catch(b){w(b instanceof Error?b.message:"Failed to load items")}finally{f(!1)}})()},[e]);const g=x=>{r(x.id),n?.(x)};return u?t.jsx("div",{className:h("",s),children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):m?t.jsx("div",{className:h("",s),children:t.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",m]})}):t.jsx("div",{className:h("flex flex-col",s),children:d.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No items found"}):d.map(x=>t.jsx(Xt,{item:x,onSelect:g,...p&&{selectedId:p},...o&&{onDownload:o},...a&&{onRename:a},...i&&{onDelete:i}},x.id))})}const Yt=l.forwardRef(({source:s,isSelected:e,className:n,...o},a)=>t.jsxs("button",{ref:a,type:"button",className:h("group flex w-full text-left gap-2 items-start p-2 rounded-md cursor-pointer transition-colors text-paragraph-sm","hover:bg-accent-hover","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",e&&"bg-accent",n),onClick:()=>window.open(s.url,"_blank"),...o,children:[t.jsx("div",{className:"shrink-0 flex items-center h-5",children:t.jsx("div",{className:"relative rounded-[3px] size-4 overflow-hidden bg-muted",children:s.favicon?t.jsx("img",{alt:s.sourceName,className:"size-full object-cover",src:s.favicon}):t.jsx("div",{className:"size-full bg-muted"})})}),t.jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[t.jsxs("div",{className:"text-paragraph-sm text-foreground",children:[t.jsx("span",{className:"font-medium",children:s.sourceName}),t.jsxs("span",{className:"text-muted-foreground",children:[" · ",s.title]})]}),t.jsx("p",{className:"text-paragraph-sm text-muted-foreground line-clamp-3",children:s.snippet})]})]}));Yt.displayName="SourceListItem";const Zt=l.forwardRef(({todo:s,className:e,...n},o)=>{const a=s.status==="completed";return t.jsxs("div",{ref:o,className:h("group flex items-center gap-2 p-2 rounded-md cursor-pointer transition-colors text-paragraph-sm","hover:bg-accent-hover","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",!1,e),role:"button",tabIndex:0,...n,children:[t.jsx("div",{className:"shrink-0 size-4 flex items-center justify-center text-foreground",children:a?t.jsx(ut,{className:"size-4 text-muted-foreground"}):t.jsx(ye,{className:"size-4 text-foreground"})}),t.jsx("p",{className:h("flex-1 text-foreground",a&&"line-through text-muted-foreground",s.status==="in_progress"&&"font-medium"),children:s.text})]})});Zt.displayName="TodoListItem";const Ce=l.forwardRef(({client:s,todos:e,className:n,...o},a)=>{const i=e||[];return t.jsx("div",{ref:a,className:h("space-y-2 max-h-64 overflow-y-auto",n),...o,children:i.length===0?t.jsx("p",{className:"text-paragraph-sm text-foreground opacity-60 italic",children:"No tasks yet."}):i.map(d=>t.jsx(Zt,{todo:d},d.id))})});Ce.displayName="TodoList";const fe=l.forwardRef(({todos:s,className:e,...n},o)=>{const a=s&&s.length>0?s:so;return t.jsx("div",{ref:o,className:h("space-y-2",e),...n,children:t.jsx(Ce,{todos:a})})});fe.displayName="TodoTabContent";const me=l.forwardRef(({files:s=[],provider:e,onFileSelect:n,className:o,...a},i)=>{const d=l.useCallback(r=>{console.log("Download:",r.name)},[]),c=l.useCallback(r=>{console.log("Rename:",r.name)},[]),p=l.useCallback(r=>{console.log("Delete:",r.name)},[]);return t.jsx("div",{ref:i,className:h("h-full",o),...a,children:t.jsx(Io,{...e&&{provider:e},onItemSelect:r=>{r.type==="file"&&n&&n(r.path||r.name)},onDownload:d,onRename:c,onDelete:p,className:"h-full"})})});me.displayName="FilesTabContent";const he=l.forwardRef(({sources:s,className:e,...n},o)=>{const a=s&&s.length>0?s:to;return t.jsx("div",{ref:o,className:h("space-y-2",e),...n,children:a.map(i=>t.jsx(Yt,{source:i},i.id))})});he.displayName="SourcesTabContent";const Eo=l.forwardRef(({data:s,className:e,...n},o)=>t.jsxs("div",{ref:o,className:h("space-y-4",e),...n,children:[t.jsx("h3",{className:"font-semibold text-subheading",children:"Database"}),t.jsxs("div",{className:"text-paragraph-sm text-muted-foreground",children:[t.jsx("p",{children:"Database viewer - panel automatically expanded to large size"}),t.jsxs("div",{className:"mt-4 p-4 border border-border rounded",children:[t.jsx("p",{children:"Your large data table would go here"}),s&&typeof s=="object"?t.jsx("pre",{className:"mt-2 text-caption overflow-auto",children:JSON.stringify(s,null,2)}):null]})]})]}));Eo.displayName="DatabaseTabContent";const ke=zs,Z=l.forwardRef(({className:s,...e},n)=>t.jsx(Ge,{ref:n,className:h("inline-flex h-10 items-center rounded-md bg-muted p-1 text-muted-foreground gap-1",s),...e}));Z.displayName=Ge.displayName;const ee=l.forwardRef(({className:s,...e},n)=>t.jsx(Ke,{ref:n,className:h("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-paragraph-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...e}));ee.displayName=Ke.displayName;const L=l.forwardRef(({className:s,...e},n)=>t.jsx(Je,{ref:n,className:h("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...e}));L.displayName=Je.displayName;const Ro=l.forwardRef(({client:s,todos:e,variant:n="animated",showIcons:o=!1,visibleTabs:a=["todo","files","database"],className:i,...d},c)=>{const p=e||[],[r,u]=l.useState(a[0]||"todo"),f=l.useRef(null),m=l.useRef(null);l.useEffect(()=>{const b=setTimeout(()=>{const y=f.current;if(r&&y){const j=m.current;if(j){const S=y.getBoundingClientRect(),C=j.getBoundingClientRect(),I=C.left-S.left,U=C.width,N=I/S.width*100,R=100-(I+U)/S.width*100;y.style.clipPath=`inset(0 ${R.toFixed(2)}% 0 ${N.toFixed(2)}% round 999px)`}}},0);return()=>clearTimeout(b)},[r]);const g=[{id:"todo",label:n==="pills"?"To-do":"To-Do List",icon:we},{id:"files",label:"Files",icon:ve},{id:"database",label:"Database",icon:pt},{id:"sources",label:"Sources",icon:ft}].filter(x=>a.includes(x.id));return t.jsx("div",{ref:c,className:h("select-none",i),...d,children:t.jsxs(ke,{value:r,onValueChange:u,className:"w-full",children:[n==="pills"?t.jsx(Z,{className:h("w-full justify-start bg-transparent p-0 h-auto","gap-1"),children:g.map(x=>{const b=x.icon;return t.jsxs(ee,{value:x.id,className:h("gap-2 px-3 py-1.5 rounded-lg text-paragraph-sm font-medium","data-[state=active]:bg-zinc-100 data-[state=active]:text-foreground","data-[state=inactive]:text-muted-foreground"),children:[o&&b&&t.jsx(b,{className:"size-4"}),x.label]},x.id)})}):t.jsxs("div",{className:"relative mb-4 border-border",children:[t.jsx(Z,{className:"bg-transparent p-0 h-auto rounded-none w-full border-none",children:g.map(x=>t.jsx(ee,{value:x.id,className:"px-3 py-1 text-paragraph-sm font-medium rounded-none text-foreground opacity-60 data-[state=active]:opacity-100 data-[state=active]:bg-transparent data-[state=active]:shadow-none",children:x.label},x.id))}),t.jsx("div",{ref:f,className:"absolute top-0 left-0 w-full overflow-hidden z-10 pointer-events-none",style:{clipPath:"inset(0 100% 0 0% round 999px)",transition:"clip-path 0.25s ease-out"},children:t.jsx(Z,{className:"bg-secondary p-0 h-auto rounded-none w-full border-none",children:g.map(x=>t.jsx(ee,{value:x.id,ref:r===x.id?m:null,className:"px-3 py-1 text-paragraph-sm font-medium rounded-none text-primary bg-transparent data-[state=active]:shadow-none shadow-none",tabIndex:-1,children:x.label},x.id))})})]}),t.jsx(L,{value:"todo",className:n==="pills"?"mt-0":"",children:n==="pills"?t.jsx(fe,{todos:p}):t.jsx(Ce,{todos:p})}),t.jsx(L,{value:"files",className:n==="pills"?"mt-0":"",children:t.jsx(me,{})}),t.jsx(L,{value:"database",className:n==="pills"?"mt-0":"",children:t.jsx("div",{className:"text-paragraph-sm text-foreground opacity-60 italic",children:"Database tab coming soon..."})}),t.jsx(L,{value:"sources",className:n==="pills"?"mt-0":"",children:t.jsx(he,{})})]})})});Ro.displayName="ChatSecondaryPanel";const Mo=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:h("flex h-full flex-col",s),...n,children:e}));Mo.displayName="ChatSidebar.Root";const Ao=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:h("border-b border-border px-4 py-3",s),...n,children:e}));Ao.displayName="ChatSidebar.Header";const Uo=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:h("flex-1 overflow-y-auto p-4",s),...n,children:e}));Uo.displayName="ChatSidebar.Content";const Do=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:h("border-t border-border px-4 py-3",s),...n,children:e}));Do.displayName="ChatSidebar.Footer";const Po=l.forwardRef(({children:s,className:e,...n},o)=>{const[a,i]=l.useState(s),[d,c]=l.useState(!1),p=l.useRef(s),r=l.useRef(!0);return l.useEffect(()=>{if(r.current){r.current=!1,p.current=s;return}if(p.current===s)return;c(!0);const u=setTimeout(()=>{i(s),p.current=s,requestAnimationFrame(()=>{c(!1)})},150);return()=>{clearTimeout(u)}},[s]),t.jsx("span",{ref:o,className:h("text-sm text-foreground opacity-60 transition-opacity duration-300",d?"opacity-0":"opacity-60",e),...n,children:a})});Po.displayName="ChatStatus";const le=128e3,Ue={"claude-sonnet-4-5-20250929":2e5,"claude-sonnet-4-20250514":2e5,"claude-3-5-sonnet-20241022":2e5,"claude-3-5-sonnet-20240620":2e5,"claude-3-opus-20240229":2e5,"claude-3-sonnet-20240229":2e5,"claude-3-haiku-20240307":2e5,"gpt-4-turbo":128e3,"gpt-4-turbo-preview":128e3,"gpt-4-0125-preview":128e3,"gpt-4-1106-preview":128e3,"gpt-4":8192,"gpt-4-32k":32768,"gpt-3.5-turbo":16385,"gpt-3.5-turbo-16k":16385,default:le};function _o(s){if(!s)return le;if(s in Ue)return Ue[s]??le;const e=s.toLowerCase();return e.includes("claude")?2e5:e.includes("gpt-4-turbo")?128e3:e.includes("gpt-4-32k")?32768:e.includes("gpt-4")?8192:e.includes("gpt-3.5")?16385:le}function es(s,e){const n=_o(e);return s/n*100}function Lo(s,e,n=1){return`${es(s,e).toFixed(n)}%`}const V=H("gui");function zo({children:s}){const{setPanelSize:e,setActiveTab:n}=re(),o=()=>{e("small"),n("files")};return t.jsx(t.Fragment,{children:s({openFiles:o})})}function Fo(){const{activeTab:s,setActiveTab:e}=re();return t.jsxs(ke,{value:s,onValueChange:n=>e(n),className:"flex flex-col h-full",children:[t.jsx("div",{className:h("border-b border-border bg-card","px-6 py-2 h-16","flex items-center","[border-bottom-width:0.5px]"),children:t.jsx(Te,{showIcons:!0,visibleTabs:["todo","files","sources"],variant:"compact"})}),t.jsx(L,{value:"todo",className:"flex-1 p-4 mt-0",children:t.jsx(fe,{})}),t.jsx(L,{value:"files",className:"flex-1 p-4 mt-0",children:t.jsx(me,{})}),t.jsx(L,{value:"sources",className:"flex-1 p-4 mt-0",children:t.jsx(he,{})})]})}function Oo({agentName:s,showHeader:e}){const{isExpanded:n,setIsExpanded:o}=Ne();return t.jsxs("div",{className:"flex lg:hidden items-center flex-1",children:[e&&t.jsx("div",{className:"flex items-center gap-2 flex-1",children:t.jsx("h1",{className:"text-heading-4 text-foreground",children:s})}),!e&&t.jsx("div",{className:"flex-1"}),t.jsx(ps,{}),t.jsx(ge,{"aria-label":"Toggle menu",onClick:()=>o(!n),children:t.jsx(mt,{className:h("size-4 text-muted-foreground transition-transform duration-200",n?"":"rotate-180")})})]})}function Bo({agentName:s,todos:e,sources:n,showHeader:o}){const{panelSize:a,setPanelSize:i}=re();return t.jsxs(It,{className:h("border-b border-border bg-card relative lg:p-0","[border-bottom-width:0.5px]"),children:[t.jsxs("div",{className:"hidden lg:flex items-center w-full h-16 py-5 pl-6 pr-4",children:[o&&t.jsx("div",{className:"flex items-center gap-2 flex-1",children:t.jsx("h1",{className:"text-heading-4 text-foreground",children:s})}),!o&&t.jsx("div",{className:"flex-1"}),t.jsx(ps,{}),t.jsx(ge,{"aria-label":"Toggle sidebar",onClick:()=>{i(a==="hidden"?"small":"hidden")},children:t.jsx(an,{className:"size-4 text-muted-foreground"})})]}),t.jsx(Oo,{agentName:s,showHeader:o}),t.jsx(Et,{className:h("pt-6 pb-8 px-6","border-b border-border bg-card","shadow-[0_4px_16px_0_rgba(0,0,0,0.04)]","[border-bottom-width:0.5px]"),children:t.jsxs(ke,{defaultValue:"todo",className:"w-full",children:[t.jsx(Te,{showIcons:!0,visibleTabs:["todo","files","sources"],variant:"default"}),t.jsx(L,{value:"todo",className:"mt-4",children:t.jsx(fe,{todos:e})}),t.jsx(L,{value:"files",className:"mt-4",children:t.jsx(me,{})}),t.jsx(L,{value:"sources",className:"mt-4",children:t.jsx(he,{sources:n})})]})})]})}function $o({client:s,initialSessionId:e,error:n}){const{connectionStatus:o,connect:a,sessionId:i,startSession:d}=Un(s,e),{messages:c,sendMessage:p}=vt(s,d);Dn(s);const r=T(N=>N.error),u=T(N=>N.currentModel),[f,m]=l.useState("Agent"),[w,g]=l.useState(typeof window<"u"?window.innerWidth>=1024:!0),[x,b]=l.useState("Type a message or / for commands...");l.useEffect(()=>{V.debug("Connection status changed",{status:o}),o==="error"&&r&&V.error("Connection error occurred",{error:r})},[o,r]),l.useEffect(()=>{if(s&&i){const N=s.getCurrentSession();N?.metadata?.agentName&&m(N.metadata.agentName)}},[s,i]),l.useEffect(()=>{const N=window.matchMedia("(min-width: 1024px)"),R=P=>{g(P.matches)};return g(N.matches),N.addEventListener("change",R),()=>{N.removeEventListener("change",R)}},[]);const y=N=>{b(N)},j=()=>{b("Type a message or / for commands...")};if(n)return t.jsx("div",{className:"flex items-center justify-center h-screen bg-background",children:t.jsxs("div",{className:"text-center p-8 max-w-md",children:[t.jsx("h1",{className:"text-2xl font-bold text-destructive mb-4",children:"Initialization Error"}),t.jsx("p",{className:"text-foreground mb-4",children:n}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to initialize the ACP client. Check the console for details."})]})});const S=[],C=[{id:"1",title:"Boeing Scores Early Wins at Dubai Airshow",sourceName:"Reuters",url:"https://www.reuters.com/markets/companies/BA.N",snippet:"DUBAI, Nov 17 (Reuters) - Boeing (BA.N), opens new tab took centre stage at day one of the Dubai Airshow on Monday, booking a $38 billion order from host carrier Emirates and clinching more deals with African carriers, while China displayed its C919 in the Middle East for the first time.",favicon:"https://www.google.com/s2/favicons?domain=reuters.com&sz=32"},{id:"2",title:"Boeing's Sustainable Aviation Goals Take Flight",sourceName:"Forbes",url:"https://www.forbes.com",snippet:"SEATTLE, Nov 18 (Reuters) - Boeing is making headway towards its sustainability targets, unveiling plans for a new eco-friendly aircraft design aimed at reducing emissions by 50% by 2030.",favicon:"https://www.google.com/s2/favicons?domain=forbes.com&sz=32"},{id:"3",title:"Boeing Faces Increased Competition in Global Aviation Market",sourceName:"Reuters",url:"https://www.reuters.com",snippet:"CHICAGO, Nov 19 (Reuters) - As the global aviation industry rebounds post-pandemic, Boeing is grappling with intensified competition from rival manufacturers, particularly in the Asian market.",favicon:"https://www.google.com/s2/favicons?domain=reuters.com&sz=32"},{id:"4",title:"Boeing's Starliner Successfully Completes Orbital Test Flight",sourceName:"The Verge",url:"https://www.theverge.com",snippet:"NASA, Nov 20 (Reuters) - Boeing's CST-100 Starliner spacecraft achieves a significant milestone, successfully completing its orbital test flight, paving the way for future crewed missions to the International Space Station.",favicon:"https://www.google.com/s2/favicons?domain=theverge.com&sz=32"}],I=c.slice().reverse().find(N=>N.role==="assistant"&&N.tokenUsage)?.tokenUsage,U=[{id:"model-sonnet",label:"Use Sonnet 4.5",description:"Switch to Claude Sonnet 4.5 model",icon:t.jsx(Re,{className:"h-4 w-4"}),category:"model",onSelect:()=>{V.info("User selected Sonnet 4.5 model")}},{id:"model-opus",label:"Use Opus",description:"Switch to Claude Opus model",icon:t.jsx(Re,{className:"h-4 w-4"}),category:"model",onSelect:()=>{V.info("User selected Opus model")}},{id:"settings",label:"Open Settings",description:"Configure chat preferences",icon:t.jsx(nn,{className:"h-4 w-4"}),category:"action",onSelect:()=>{V.info("User opened settings")}},{id:"code-mode",label:"Code Mode",description:"Enable code-focused responses",icon:t.jsx(on,{className:"h-4 w-4"}),category:"mode",onSelect:()=>{V.info("User enabled code mode")}}];return t.jsxs($t,{defaultPanelSize:"hidden",defaultActiveTab:"todo",children:[t.jsxs(Ht,{children:[t.jsx(Bo,{agentName:f,todos:S,sources:C,showHeader:c.length>0}),o==="error"&&r&&t.jsx("div",{className:"border-b border-destructive/20 bg-destructive/10 px-6 py-4",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("h3",{className:"mb-1 text-paragraph-sm font-semibold text-destructive",children:"Connection Error"}),t.jsx("p",{className:"whitespace-pre-line text-paragraph-sm text-foreground",children:r})]}),t.jsx("button",{type:"button",onClick:a,className:"rounded-lg bg-destructive px-4 py-2 text-paragraph-sm font-medium text-destructive-foreground transition-colors hover:bg-destructive-hover",children:"Retry"})]})}),t.jsxs(Wt,{children:[t.jsx(Vt,{children:c.length===0?t.jsx(zo,{children:({openFiles:N})=>t.jsx("div",{className:"flex flex-1 items-center px-4",children:t.jsx(kt,{title:f,description:"This agent can help you with your tasks. Start a conversation by typing a message below.",suggestedPrompts:["Search the web for the latest news on top tech company earnings, produce a summary for each company, and then a macro trend analysis of the tech industry. Use your todo list","Explain how this works","Create a new feature","Review my changes"],onPromptClick:R=>{p(R),b("Type a message or / for commands..."),V.info("Prompt clicked",{prompt:R})},onPromptHover:y,onPromptLeave:j,onOpenFiles:N})})}):t.jsx("div",{className:"flex flex-col px-4",children:c.map((N,R)=>{const P=R===0,K=P?null:c[R-1];let B="mt-2";return P?B="mt-2":N.role==="user"?B=(K?.role==="user","mt-4"):N.role==="assistant"&&(B=K?.role==="assistant"?"mt-2":"mt-6"),t.jsx(os,{message:N,className:B,isLastMessage:R===c.length-1,children:t.jsx(ls,{message:N,thinkingDisplayStyle:"collapsible"})},N.id)})})}),t.jsx(qt,{children:t.jsxs(At,{client:s,startSession:d,children:[t.jsx(Ft,{commands:U}),t.jsx(Ut,{placeholder:x,autoFocus:!0}),t.jsxs(Pt,{children:[t.jsxs("div",{className:"flex items-baseline gap-1",children:[t.jsx(_t,{}),t.jsx(Lt,{}),I&&t.jsx(ss,{percentage:es(I.totalTokens??0,u??void 0),tokens:I.totalTokens??0,formattedPercentage:Lo(I.totalTokens??0,u??void 0)})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(zt,{}),t.jsx(Dt,{children:t.jsx(rn,{className:"size-4"})})]})]})]})})]})]}),w&&t.jsx(Qt,{breakpoint:"lg",children:t.jsx(Fo,{})})]})}const Ho=Fs,Wo=Os,Vo=Bs,ts=l.forwardRef(({className:s,sideOffset:e=4,...n},o)=>t.jsx(Xe,{ref:o,sideOffset:e,className:h("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...n}));ts.displayName=Xe.displayName;const ss=l.forwardRef(({percentage:s,tokens:e,formattedPercentage:n,className:o,...a},i)=>{const d=Math.min(100,Math.max(0,s)),c=16,p=2,r=(c-p)/2,u=c/2,f=2*Math.PI*r,m=f-d/100*f;return t.jsx(Ho,{children:t.jsxs(Wo,{children:[t.jsx(Vo,{asChild:!0,children:t.jsx(G,{ref:i,type:"button",variant:"ghost",size:"icon",className:h("rounded-full cursor-default",o),...a,children:t.jsxs("svg",{width:c,height:c,viewBox:`0 0 ${c} ${c}`,className:"transform -rotate-90",children:[t.jsx("circle",{cx:u,cy:u,r,stroke:"currentColor",strokeWidth:p,fill:"transparent",className:"opacity-20"}),t.jsx("circle",{cx:u,cy:u,r,stroke:"currentColor",strokeWidth:p,fill:"transparent",strokeDasharray:f,strokeDashoffset:m,strokeLinecap:"round",className:"transition-all duration-300 ease-in-out"})]})})}),t.jsx(ts,{side:"top",align:"center",children:t.jsxs("p",{children:["Context: ",n," (",e.toLocaleString()," tokens)"]})})]})})});ss.displayName="ContextUsageButton";const qo=l.forwardRef(({autoScroll:s=!0,isStreaming:e=!1,scrollBehavior:n="smooth",scrollThreshold:o=100,showScrollButton:a=!0,scrollButton:i,className:d,children:c,...p},r)=>{const u=l.useRef(null),[f,m]=l.useState(!0),[w,g]=l.useState(!1),x=l.useRef(0);l.useImperativeHandle(r,()=>{if(!u.current)throw new Error("Container ref not initialized");return u.current});const b=l.useCallback(()=>{const j=u.current;if(!j)return;const{scrollTop:S,scrollHeight:C,clientHeight:I}=j,N=C-S-I<o;m(N),g(!N&&a),x.current=S},[o,a]),y=l.useCallback((j=n)=>{const S=u.current;S&&S.scrollTo({top:S.scrollHeight,behavior:j})},[n]);return l.useEffect(()=>{!s||!u.current||(e&&f?y("auto"):!e&&f&&y())},[s,e,f,y]),l.useEffect(()=>{const j=u.current;if(!j)return;const S=()=>{b()};return j.addEventListener("scroll",S,{passive:!0}),b(),()=>{j.removeEventListener("scroll",S)}},[b]),l.useEffect(()=>{const j=u.current;if(!j)return;const S=new ResizeObserver(()=>{f&&s&&y("auto")});return S.observe(j),()=>{S.disconnect()}},[f,s,y]),t.jsxs("div",{className:"relative flex-1",children:[t.jsx("div",{ref:u,className:h("h-full overflow-y-auto overflow-x-hidden","scrollbar-thin scrollbar-thumb-[border] scrollbar-track-transparent",d),...p,children:t.jsx("div",{className:"flex flex-col gap-4 px-4 py-4",children:c})}),w&&t.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10",children:i||t.jsxs("button",{type:"button",onClick:()=>y(),className:"px-4 py-2 rounded-full bg-card border border-border shadow-lg hover:shadow-xl hover:bg-card/90 transition-all text-sm font-medium text-foreground flex items-center gap-2","aria-label":"Scroll to bottom",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Down arrow",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})}),"Scroll to bottom"]})})]})});qo.displayName="Conversation";const Qo=$s,ns=l.forwardRef(({className:s,...e},n)=>t.jsx(Ye,{ref:n,className:h("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...e}));ns.displayName=Ye.displayName;const Go=l.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Qo,{children:[t.jsx(ns,{}),t.jsxs(Ze,{ref:o,className:h("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...n,children:[e,t.jsxs(Hs,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(ln,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Go.displayName=Ze.displayName;const Ko=l.forwardRef(({className:s,...e},n)=>t.jsx(et,{ref:n,className:h("text-subheading font-semibold leading-none tracking-tight",s),...e}));Ko.displayName=et.displayName;const Jo=l.forwardRef(({className:s,...e},n)=>t.jsx(tt,{ref:n,className:h("text-paragraph-sm text-muted-foreground",s),...e}));Jo.displayName=tt.displayName;const ge=l.forwardRef(({className:s,...e},n)=>t.jsx(G,{ref:n,variant:"ghost",size:"icon",className:h("rounded-full",s),...e}));ge.displayName="IconButton";const Xo=Q("flex h-10 w-full rounded-md border bg-input-background px-3 py-2 text-paragraph-sm ring-offset-background file:border-0 file:bg-transparent file:text-paragraph-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),Yo=l.forwardRef(({className:s,type:e,variant:n,...o},a)=>t.jsx("input",{type:e,className:h(Xo({variant:n,className:s})),ref:a,...o}));Yo.displayName="Input";const Zo=l.forwardRef(({className:s,...e},n)=>t.jsx(st,{ref:n,className:h("text-label font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...e}));Zo.displayName=st.displayName;const er=Q("flex animate-fadeIn",{variants:{role:{user:"max-w-[80%] self-end ml-auto mr-2",assistant:"self-start mr-auto",system:"self-start mr-auto max-w-full"},layout:{default:"",full:"max-w-full",compact:"max-w-[90%]"}},defaultVariants:{role:"assistant",layout:"default"}}),os=l.forwardRef(({message:s,role:e,layout:n,className:o,children:a,messageId:i,autoScroll:d,isLastMessage:c=!1,...p},r)=>{const u=s?s.role:e||"assistant",f=s?s.id:i,m=l.useRef(null),[w,g]=l.useState(void 0);return l.useImperativeHandle(r,()=>m.current),l.useEffect(()=>{if(!c||u!=="assistant"){g(void 0);return}const x=()=>{const y=m.current;if(!y)return;let j=y.parentElement;for(;j&&!j.classList.contains("overflow-y-auto");)j=j.parentElement;if(!j)return;const S=y.previousElementSibling;if(!S||S.getAttribute("aria-label")!=="user message"){g(void 0);return}const C=j.clientHeight,I=S.offsetHeight,N=Math.max(0,C-I-32);g(N)};x();const b=new ResizeObserver(x);if(m.current){b.observe(m.current);let y=m.current.parentElement;for(;y&&!y.classList.contains("overflow-y-auto");)y=y.parentElement;y&&b.observe(y)}return()=>b.disconnect()},[c,u]),l.useEffect(()=>{if((d!==void 0?d:u==="user")&&m.current){const b=setTimeout(()=>{m.current?.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},50);return()=>clearTimeout(b)}},[u,d]),t.jsx("article",{ref:m,"aria-label":`${u} message`,"data-message-id":f,className:h(er({role:u,layout:n}),o),style:{minHeight:w!==void 0?`${w}px`:void 0},...p,children:a})});os.displayName="Message";const De=Q("mb-3 rounded-lg bg-card border border-border transition-all",{variants:{variant:{default:"opacity-70",subtle:"opacity-50",prominent:"opacity-90 shadow-sm"}},defaultVariants:{variant:"default"}}),tr=Q("w-4 h-4 text-foreground opacity-60 transition-transform duration-200",{variants:{expanded:{true:"rotate-180",false:""}},defaultVariants:{expanded:!1}}),rs=l.forwardRef(({content:s,isStreaming:e=!1,mode:n="collapsible",defaultExpanded:o=!1,autoExpand:a=!1,autoCollapse:i=!0,autoCollapseDelay:d=2e3,label:c="Thinking",variant:p,className:r},u)=>{const[f,m]=l.useState(n==="inline"?!0:o),[w,g]=l.useState(!1);return l.useEffect(()=>{if(i&&!e&&s&&n==="collapsible"){const x=setTimeout(()=>{g(!0),m(!1)},d);return()=>clearTimeout(x)}},[e,s,i,d,n]),l.useEffect(()=>{a&&e&&n==="collapsible"&&!w&&m(!0)},[a,e,n,w]),!s&&!e?null:n==="inline"?t.jsxs("div",{ref:u,className:h(De({variant:p}),"p-3",r),children:[t.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[t.jsx("span",{className:"text-caption font-medium text-foreground opacity-60 uppercase tracking-wide",children:c}),e&&t.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse"})]}),t.jsxs("div",{className:"text-paragraph-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,e&&s&&t.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})]}):t.jsxs("div",{ref:u,className:h("mb-3",r),children:[t.jsxs("button",{type:"button",onClick:()=>{m(!f),g(!1)},className:"w-full flex items-center justify-between p-2.5 rounded-lg bg-card border border-border hover:bg-card/80 hover:shadow-sm transition-all text-left","aria-expanded":f,"aria-label":`${f?"Collapse":"Expand"} reasoning`,children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[t.jsx("span",{className:"text-caption font-medium text-foreground opacity-60 uppercase tracking-wide shrink-0",children:c}),e&&t.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse shrink-0"}),!f&&s&&t.jsxs("span",{className:"text-caption text-foreground opacity-50 truncate",children:[s.substring(0,60),s.length>60&&"..."]})]}),t.jsx(ne,{className:tr({expanded:f}),"aria-hidden":"true"})]}),f&&t.jsx("div",{className:h(De({variant:p}),"mt-2 p-3 animate-fadeIn"),children:t.jsxs("div",{className:"text-paragraph-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,e&&s&&t.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})})]})});rs.displayName="Reasoning";const ce=l.forwardRef(({content:s,isStreaming:e=!1,showEmpty:n=!0,emptyMessage:o="",className:a,...i},d)=>{if(!s&&e&&n)return t.jsx("div",{ref:d,className:h("opacity-70 italic text-paragraph-sm",a),...i,children:o});if(!s)return null;const c={table:({node:p,...r})=>t.jsx("div",{className:"overflow-x-auto my-4",children:t.jsx("table",{className:"min-w-full border-collapse border border-border rounded-md",...r})}),thead:({node:p,...r})=>t.jsx("thead",{className:"bg-card border-b border-border",...r}),tbody:({node:p,...r})=>t.jsx("tbody",{...r}),tr:({node:p,...r})=>t.jsx("tr",{className:"border-b border-border hover:bg-card transition-colors",...r}),th:({node:p,...r})=>t.jsx("th",{className:"px-4 py-2 text-left font-semibold text-foreground border-r border-border last:border-r-0",...r}),td:({node:p,...r})=>t.jsx("td",{className:"px-4 py-2 text-foreground border-r border-border last:border-r-0",...r}),input:({node:p,checked:r,...u})=>u.type==="checkbox"?t.jsx("input",{type:"checkbox",checked:r||!1,disabled:!0,readOnly:!0,className:"mr-2 w-4 h-4 accent-[primary] cursor-not-allowed",...u}):t.jsx("input",{...u}),code:({node:p,...r})=>r.className?.includes("language-")?t.jsx("code",{className:"block p-4 bg-card border border-border rounded-md overflow-x-auto text-code text-foreground shadow-sm",...r}):t.jsx("code",{className:"px-1.5 py-0.5 bg-card border border-border rounded text-code text-foreground",...r}),pre:({node:p,...r})=>t.jsx("pre",{className:"my-4 rounded-lg",...r}),h1:({node:p,...r})=>t.jsx("h1",{className:"text-heading-3 mt-6 mb-4 text-foreground border-b border-border pb-2",...r}),h2:({node:p,...r})=>t.jsx("h2",{className:"text-subheading mt-5 mb-3 text-foreground border-b border-border/50 pb-1.5",...r}),h3:({node:p,...r})=>t.jsx("h3",{className:"text-subheading mt-4 mb-2 text-foreground",...r}),h4:({node:p,...r})=>t.jsx("h4",{className:"text-paragraph-sm font-semibold mt-3 mb-2 text-foreground",...r}),ul:({node:p,...r})=>{const u=p?.children?.some(f=>typeof f=="object"&&f!==null&&"type"in f&&f.type==="element"&&"tagName"in f&&f.tagName==="li"&&"children"in f&&Array.isArray(f.children)&&f.children.some(m=>typeof m=="object"&&m!==null&&"type"in m&&m.type==="element"&&"tagName"in m&&m.tagName==="input"&&"properties"in m&&typeof m.properties=="object"&&m.properties!==null&&"type"in m.properties&&m.properties.type==="checkbox"));return t.jsx("ul",{className:h("my-2 space-y-1 text-foreground",u?"list-none space-y-2":"list-disc list-outside pl-4"),...r})},ol:({node:p,...r})=>t.jsx("ol",{className:"list-decimal list-outside pl-4 my-2 space-y-1 text-foreground",...r}),li:({node:p,...r})=>{const u=p?.children?.some(f=>typeof f=="object"&&f!==null&&"type"in f&&f.type==="element"&&"tagName"in f&&f.tagName==="input"&&"properties"in f&&typeof f.properties=="object"&&f.properties!==null&&"type"in f.properties&&f.properties.type==="checkbox");return t.jsx("li",{className:h(u?"flex items-start gap-2":""),...r})},a:({node:p,...r})=>t.jsx("a",{className:"text-primary hover:underline decoration-2 underline-offset-2 transition-all",target:"_blank",rel:"noopener noreferrer",...r}),p:({node:p,...r})=>t.jsx("p",{className:"mb-2 text-foreground leading-relaxed",...r}),blockquote:({node:p,...r})=>t.jsx("blockquote",{className:"border-l-4 border-[primary] pl-4 italic my-4 text-foreground bg-card py-2 rounded-r-md shadow-sm",...r}),hr:({node:p,...r})=>t.jsx("hr",{className:"my-6 border-t border-border opacity-50",...r})};return t.jsx("div",{ref:d,className:h("markdown-content prose prose-sm max-w-none dark:prose-invert",a),...i,children:t.jsx(Cs,{remarkPlugins:[xn],components:c,children:s})})});ce.displayName="Response";const sr={theme:"system",setTheme:()=>null,resolvedTheme:"light"},as=l.createContext(sr);function nr({children:s,defaultTheme:e="system",storageKey:n="vite-ui-theme"}){const[o,a]=l.useState(()=>localStorage.getItem(n)||e),[i,d]=l.useState("light");l.useEffect(()=>{const p=window.document.documentElement;if(p.classList.remove("light","dark"),o==="system"){const r=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";p.classList.add(r),d(r);return}p.classList.add(o),d(o)},[o]);const c={theme:o,setTheme:p=>{localStorage.setItem(n,p),a(p)},resolvedTheme:i};return t.jsx(as.Provider,{value:c,children:s})}const is=()=>{const s=l.useContext(as);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},Pe={Globe:fn,Link:pn,Cloud:un,CheckSquare:we,Search:dn,FileText:ve,Edit:cn,Wrench:ht};function _e({toolCall:s}){const[e,n]=l.useState(!1),{resolvedTheme:o}=is(),a=s.icon&&Pe[s.icon]?Pe[s.icon]:ht,i=s.prettyName||s.title,d={fontSize:"11px",backgroundColor:"transparent",fontFamily:"inherit","--w-rjv-color":o==="dark"?"#fafafa":"#09090b","--w-rjv-key-string":o==="dark"?"#fafafa":"#09090b","--w-rjv-background-color":"transparent","--w-rjv-line-color":o==="dark"?"#27272a":"#e4e4e7","--w-rjv-arrow-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-edit-color":o==="dark"?"#fafafa":"#09090b","--w-rjv-info-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-update-color":o==="dark"?"#fafafa":"#09090b","--w-rjv-copied-color":o==="dark"?"#fafafa":"#09090b","--w-rjv-copied-success-color":o==="dark"?"#22c55e":"#16a34a","--w-rjv-curlybraces-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-colon-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-brackets-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-quotes-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-quotes-string-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-type-string-color":o==="dark"?"#22c55e":"#16a34a","--w-rjv-type-int-color":o==="dark"?"#f59e0b":"#d97706","--w-rjv-type-float-color":o==="dark"?"#f59e0b":"#d97706","--w-rjv-type-bigint-color":o==="dark"?"#f59e0b":"#d97706","--w-rjv-type-boolean-color":o==="dark"?"#3b82f6":"#2563eb","--w-rjv-type-date-color":o==="dark"?"#ec4899":"#db2777","--w-rjv-type-url-color":o==="dark"?"#3b82f6":"#2563eb","--w-rjv-type-null-color":o==="dark"?"#ef4444":"#dc2626","--w-rjv-type-nan-color":o==="dark"?"#ef4444":"#dc2626","--w-rjv-type-undefined-color":o==="dark"?"#ef4444":"#dc2626"};return t.jsxs("div",{className:"flex flex-col my-4",children:[t.jsx("button",{type:"button",className:"flex items-center gap-2 cursor-pointer bg-transparent border-none p-0 text-left group w-fit",onClick:()=>n(!e),"aria-expanded":e,children:t.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[t.jsx("div",{className:"text-muted-foreground",children:t.jsx(a,{className:"h-3 w-3"})}),t.jsx("span",{className:"text-paragraph-sm text-muted-foreground",children:i}),t.jsx(ne,{className:`h-3 w-3 text-muted-foreground/70 transition-transform duration-200 ${e?"rotate-180":""}`})]})}),e&&t.jsxs("div",{className:"mt-2 text-sm border border-border rounded-lg bg-card overflow-hidden w-full",children:[s.locations&&s.locations.length>0&&t.jsxs("div",{className:"p-3 border-b border-border",children:[t.jsx("div",{className:"text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans",children:"Files"}),t.jsx("ul",{className:"space-y-1",children:s.locations.map(c=>t.jsxs("li",{className:"font-mono text-[11px] text-foreground bg-muted px-1.5 py-0.5 rounded w-fit",children:[c.path,c.line!==null&&c.line!==void 0&&`:${c.line}`]},`${c.path}:${c.line??""}`))})]}),s.rawInput&&Object.keys(s.rawInput).length>0&&t.jsxs("div",{className:"p-3 border-b border-border",children:[t.jsx("div",{className:"text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans",children:"Input"}),t.jsx("div",{className:"text-[11px] font-mono text-foreground",children:t.jsx(Ee,{value:s.rawInput,collapsed:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:d})})]}),s.content&&s.content.length>0||s.error?t.jsxs("div",{className:"p-3 border-b border-border last:border-0",children:[t.jsx("div",{className:"text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans",children:"Output"}),t.jsxs("div",{className:"space-y-2 text-[11px] text-foreground",children:[s.content?.map((c,p)=>{const r=()=>c.type==="diff"&&"path"in c?`diff-${c.path}-${p}`:c.type==="terminal"&&"terminalId"in c?`terminal-${c.terminalId}`:c.type==="text"&&"text"in c?`text-${c.text.substring(0,20)}-${p}`:c.type==="content"&&"content"in c?`content-${c.content.text?.substring(0,20)}-${p}`:`block-${p}`,u=(f,m)=>{try{const w=JSON.parse(f);if(typeof w=="object"&&w!==null)return t.jsx("div",{className:"text-[11px]",children:t.jsx(Ee,{value:w,collapsed:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:d})},m)}catch{}return t.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-foreground overflow-x-auto",children:f},m)};if(c.type==="content"&&"content"in c){const f=c.content;if(f.type==="text"&&f.text)return u(f.text,r())}return c.type==="text"&&"text"in c?u(c.text,r()):c.type==="diff"&&"path"in c&&"oldText"in c&&"newText"in c?t.jsxs("div",{className:"border border-border rounded bg-card",children:[t.jsxs("div",{className:"bg-muted px-2 py-1 text-[10px] font-mono text-muted-foreground border-b border-border",children:[c.path,"line"in c&&c.line!==null&&c.line!==void 0&&`:${c.line}`]}),t.jsxs("div",{className:"p-2 font-mono text-[11px]",children:[t.jsxs("div",{className:"text-red-500 dark:text-red-400",children:["- ",c.oldText]}),t.jsxs("div",{className:"text-green-500 dark:text-green-400",children:["+ ",c.newText]})]})]},r()):c.type==="terminal"&&"terminalId"in c?t.jsxs("div",{className:"bg-neutral-900 text-neutral-100 p-2 rounded text-[11px] font-mono",children:["Terminal: ",c.terminalId]},r()):null}),s.error&&t.jsxs("div",{className:"text-destructive font-mono text-[11px] mt-2",children:["Error: ",s.error]})]})]}):null,(s.tokenUsage||s.startedAt)&&t.jsxs("div",{className:"p-2 bg-muted/50 border-t border-border flex flex-wrap gap-4 text-[10px] text-muted-foreground font-sans",children:[s.tokenUsage&&t.jsxs("div",{className:"flex gap-3",children:[s.tokenUsage.inputTokens!==void 0&&t.jsxs("div",{children:[t.jsx("span",{className:"uppercase tracking-wide font-semibold mr-1",children:"Input:"}),s.tokenUsage.inputTokens.toLocaleString()]}),s.tokenUsage.outputTokens!==void 0&&t.jsxs("div",{children:[t.jsx("span",{className:"uppercase tracking-wide font-semibold mr-1",children:"Output:"}),s.tokenUsage.outputTokens.toLocaleString()]}),s.tokenUsage.totalTokens!==void 0&&t.jsxs("div",{children:[t.jsx("span",{className:"uppercase tracking-wide font-semibold mr-1",children:"Total:"}),s.tokenUsage.totalTokens.toLocaleString()]})]}),s.startedAt&&t.jsxs("div",{className:"flex gap-3 ml-auto",children:[t.jsxs("span",{children:["Started: ",new Date(s.startedAt).toLocaleTimeString()]}),s.completedAt&&t.jsxs("span",{children:["Completed:"," ",new Date(s.completedAt).toLocaleTimeString()," (",Math.round((s.completedAt-s.startedAt)/1e3),"s)"]})]})]})]})]})}const ie=["Thinking","Pensando","Pensant","Denkend","Pensando","考えている","생각 중","思考中","Размышляя","Düşünüyor","Myślący","Tänkande","Pensando","Ajatellen","Σκεπτόμενος","חושב","सोच रहा है","Berpikir"],Le=["...","·..",".·.","..·",".·.","·.."];function or({startTime:s}){const[e,n]=l.useState(0),[o,a]=l.useState(()=>ie[Math.floor(Math.random()*ie.length)]),[i,d]=l.useState(0);l.useEffect(()=>{const r=setInterval(()=>{const f=Date.now()-s;n(f)},100);return()=>clearInterval(r)},[s]),l.useEffect(()=>{const r=setInterval(()=>{const u=Math.floor(Math.random()*ie.length);a(ie[u])},1500);return()=>clearInterval(r)},[]),l.useEffect(()=>{const r=setInterval(()=>{d(u=>(u+1)%Le.length)},100);return()=>clearInterval(r)},[]);const c=(e/1e3).toFixed(1),p=Le[i];return t.jsxs("span",{className:"text-muted-foreground text-paragraph-sm",children:[o,p," ",c,"s"]})}const rr=Q("w-full rounded-2xl text-[var(--font-size)] font-[var(--font-family)] leading-relaxed break-words transition-colors",{variants:{role:{user:"bg-secondary text-foreground px-4 py-4 text-paragraph",assistant:"text-foreground text-paragraph-sm",system:"bg-card border border-border text-foreground opacity-80 text-caption px-4 py-3"},variant:{default:"",outline:"border border-border",ghost:"bg-transparent"}},defaultVariants:{role:"assistant",variant:"default"}}),ls=l.forwardRef(({role:s,variant:e,isStreaming:n,message:o,thinkingDisplayStyle:a="collapsible",className:i,children:d,...c},p)=>{const r=T(g=>g.streamingStartTime);T(g=>g.currentModel);const u=o&&!d,f=u?o.role:s||"assistant",m=u?o.isStreaming:n;let w=d;if(u){const g=o.metadata?.thinking,x=!!g,b=o.isStreaming&&!o.content&&o.role==="assistant";w=t.jsxs(t.Fragment,{children:[o.role==="assistant"&&x&&t.jsx(rs,{content:g,isStreaming:o.isStreaming,mode:a,autoCollapse:!0}),b&&r&&t.jsxs("div",{className:"flex items-center gap-2 opacity-50",children:[t.jsx(gt,{className:"size-4 animate-spin text-muted-foreground"}),t.jsx(or,{startTime:r})]}),o.role==="assistant"?(()=>{const y=(o.toolCalls||[]).slice().sort((C,I)=>(C.contentPosition??1/0)-(I.contentPosition??1/0));if(y.length===0||!y.some(C=>C.contentPosition!==void 0))return t.jsxs(t.Fragment,{children:[y.length>0&&t.jsx("div",{className:"flex flex-col gap-2 mb-1",children:y.map(C=>t.jsx(_e,{toolCall:C},C.id))}),t.jsx(ce,{content:o.content,isStreaming:o.isStreaming,showEmpty:!1})]});const j=[];let S=0;if(y.forEach(C=>{const I=C.contentPosition??o.content.length;if(I>S){const U=o.content.slice(S,I);U&&j.push(t.jsx(ce,{content:U,isStreaming:!1,showEmpty:!1},`text-before-${C.id}`))}j.push(t.jsx("div",{children:t.jsx(_e,{toolCall:C})},`tool-${C.id}`)),S=I}),S<o.content.length){const C=o.content.slice(S);C&&j.push(t.jsx(ce,{content:C,isStreaming:o.isStreaming,showEmpty:!1},"text-end"))}return t.jsx(t.Fragment,{children:j})})():t.jsx("div",{className:"whitespace-pre-wrap",children:o.content})]})}return t.jsx("div",{ref:p,className:h(rr({role:f,variant:e}),m&&"animate-pulse-subtle",i),...c,children:w})});ls.displayName="MessageContent";const Te=l.forwardRef(({showIcons:s=!0,visibleTabs:e=["todo","files"],variant:n="default",className:o,...a},i)=>{const c=[{id:"todo",label:"To-do",icon:we},{id:"files",label:"Files",icon:ve},{id:"database",label:"Database",icon:pt},{id:"sources",label:"Sources",icon:ft}].filter(r=>e.includes(r.id)),p=n==="compact"?"gap-[4px]":"gap-3";return t.jsx(Z,{ref:i,className:h("w-full justify-start bg-transparent p-0 h-auto",p,o),...a,children:c.map(r=>{const u=r.icon;return t.jsxs(ee,{value:r.id,className:h("gap-2 px-3 py-1.5 rounded-lg text-paragraph-sm font-medium","data-[state=active]:bg-muted data-[state=active]:text-foreground","data-[state=inactive]:text-muted-foreground hover:text-foreground transition-colors"),children:[s&&u&&t.jsx(u,{className:"size-4"}),r.label]},r.id)})})});Te.displayName="PanelTabsHeader";const ar=l.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(nt,{ref:o,className:h("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-paragraph-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...n,children:[e,t.jsx(Ws,{asChild:!0,children:t.jsx(mn,{className:"h-4 w-4 opacity-50"})})]}));ar.displayName=nt.displayName;const cs=l.forwardRef(({className:s,...e},n)=>t.jsx(ot,{ref:n,className:h("flex cursor-default items-center justify-center py-1",s),...e,children:t.jsx(mt,{className:"h-4 w-4"})}));cs.displayName=ot.displayName;const ds=l.forwardRef(({className:s,...e},n)=>t.jsx(rt,{ref:n,className:h("flex cursor-default items-center justify-center py-1",s),...e,children:t.jsx(ne,{className:"h-4 w-4"})}));ds.displayName=rt.displayName;const ir=l.forwardRef(({className:s,children:e,position:n="popper",...o},a)=>t.jsx(Vs,{children:t.jsxs(at,{ref:a,className:h("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...o,children:[t.jsx(cs,{}),t.jsx(qs,{className:h("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),t.jsx(ds,{})]})}));ir.displayName=at.displayName;const lr=l.forwardRef(({className:s,...e},n)=>t.jsx(it,{ref:n,className:h("py-1.5 pl-8 pr-2 text-paragraph-sm font-semibold",s),...e}));lr.displayName=it.displayName;const cr=l.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(lt,{ref:o,className:h("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Qs,{children:t.jsx(dt,{className:"h-4 w-4"})})}),t.jsx(Gs,{children:e})]}));cr.displayName=lt.displayName;const dr=l.forwardRef(({className:s,...e},n)=>t.jsx(ct,{ref:n,className:h("-mx-1 my-1 h-px bg-muted",s),...e}));dr.displayName=ct.displayName;const us=l.forwardRef(({task:s,collapsible:e=!0,defaultExpanded:n=!1,onTaskClick:o,className:a,...i},d)=>{const[c,p]=l.useState(n),r=!!(s.details||s.files&&s.files.length>0),u={pending:ye,in_progress:gt,completed:ut}[s.status],f=()=>{switch(s.status){case"completed":return"text-green-500";case"in_progress":return"text-primary";default:return"text-foreground opacity-40"}},m=()=>{r&&e&&p(!c),o?.(s)};return t.jsxs("div",{ref:d,className:h("rounded-lg border border-border bg-card transition-all","hover:shadow-sm hover:border-border/80",a),...i,children:[t.jsxs("button",{type:"button",onClick:m,className:h("w-full flex items-center gap-3 px-3 py-2.5 text-left",r&&e&&"cursor-pointer"),disabled:!r&&!e,children:[t.jsx(u,{className:h("w-4 h-4 shrink-0",f(),s.status==="in_progress"&&"animate-spin")}),t.jsx("span",{className:h("flex-1 text-paragraph-sm font-[var(--font-family)]",s.status==="completed"&&"line-through opacity-60",s.status==="in_progress"&&"font-medium"),children:s.text}),r&&e&&t.jsx(ne,{className:h("w-4 h-4 text-foreground opacity-50 transition-transform duration-200 shrink-0",c&&"rotate-180"),"aria-hidden":"true"})]}),r&&c&&t.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-border/50 animate-fadeIn",children:[s.details&&t.jsx("p",{className:"text-paragraph-sm text-foreground opacity-80 leading-relaxed mb-2",children:s.details}),s.files&&s.files.length>0&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("span",{className:"text-caption font-medium text-foreground opacity-60 uppercase tracking-wide",children:"Files:"}),t.jsx("div",{className:"space-y-1",children:s.files.map(w=>t.jsx("div",{className:"text-caption font-mono text-foreground opacity-70 bg-background px-2 py-1 rounded border border-border/50",children:w},w))})]})]})]})});us.displayName="Task";const ur=l.forwardRef(({tasks:s,collapsible:e=!0,onTaskClick:n,emptyMessage:o="No tasks yet.",className:a,...i},d)=>t.jsx("div",{ref:d,className:h("space-y-2 max-h-96 overflow-y-auto",a),...i,children:s.length===0?t.jsx("p",{className:"text-paragraph-sm text-foreground opacity-60 italic py-4 text-center",children:o}):s.map(c=>t.jsx(us,{task:c,collapsible:e,...n?{onTaskClick:n}:{}},c.id))}));ur.displayName="TaskList";const pr=Q("flex min-h-[80px] w-full rounded-md border bg-background px-3 py-2 text-paragraph-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),fr=l.forwardRef(({className:s,autoResize:e=!1,maxHeight:n=200,variant:o,...a},i)=>{const d=l.useRef(null),c=l.useCallback(r=>{d.current=r,typeof i=="function"?i(r):i&&(i.current=r)},[i]),p=l.useCallback(()=>{const r=d.current;if(!r||!e)return;r.style.height="auto";const u=Math.min(r.scrollHeight,n);r.style.height=`${u}px`,r.scrollHeight>n?r.style.overflowY="auto":r.style.overflowY="hidden"},[e,n]);return l.useEffect(()=>{p()},[p]),t.jsx("textarea",{className:h(pr({variant:o}),e&&"overflow-y-hidden",s),ref:c,...a})});fr.displayName="Textarea";function ps(){const{setTheme:s}=is();return t.jsxs(Gt,{children:[t.jsx(Kt,{asChild:!0,children:t.jsxs(ge,{children:[t.jsx(hn,{className:"size-4 text-muted-foreground rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),t.jsx(gn,{className:"absolute size-4 text-muted-foreground rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),t.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),t.jsxs(Se,{align:"end",children:[t.jsx(q,{onClick:()=>s("light"),children:"Light"}),t.jsx(q,{onClick:()=>s("dark"),children:"Dark"}),t.jsx(q,{onClick:()=>s("system"),children:"System"})]})]})}function mr(){return"http://localhost:3100"}const hr={agentServerUrl:mr()};function gr(){const{client:s,error:e,sessionId:n}=In({serverUrl:hr.agentServerUrl});return t.jsx(nr,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:t.jsx($o,{client:s,initialSessionId:n,error:e})})}const fs=document.getElementById("root");if(!fs)throw new Error("Root element not found");ks.createRoot(fs).render(t.jsx(Ts.StrictMode,{children:t.jsx(gr,{})}));
|
package/dist/index.html
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Agent Chat</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-DBa1bubT.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/vendor-CDPxlbZ6.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/react-BxIc-aOD.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/acp-sdk-CrD5QpoU.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/radix-BwF8w229.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/icons-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/icons-gyxX6Wmy.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/markdown-PIOGdvNw.js">
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cm4MNrdW.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@townco/gui-template",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"check": "tsc --noEmit"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@townco/core": "0.0.
|
|
23
|
-
"@townco/ui": "0.1.
|
|
22
|
+
"@townco/core": "0.0.21",
|
|
23
|
+
"@townco/ui": "0.1.43",
|
|
24
24
|
"lucide-react": "^0.552.0",
|
|
25
25
|
"react": "^19.2.0",
|
|
26
26
|
"react-dom": "^19.2.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@tailwindcss/postcss": "^4.1.17",
|
|
30
|
-
"@townco/tsconfig": "0.1.
|
|
30
|
+
"@townco/tsconfig": "0.1.40",
|
|
31
31
|
"@types/react": "^19.2.2",
|
|
32
32
|
"@types/react-dom": "^19.2.2",
|
|
33
33
|
"@vitejs/plugin-react": "^5.1.0",
|
package/src/App.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useACPClient } from "@townco/ui";
|
|
2
|
-
import { ChatView } from "@townco/ui/gui";
|
|
2
|
+
import { ChatView, ThemeProvider } from "@townco/ui/gui";
|
|
3
3
|
import { config } from "./config.js";
|
|
4
4
|
|
|
5
5
|
function App() {
|
|
@@ -8,7 +8,9 @@ function App() {
|
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
|
-
<
|
|
11
|
+
<ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
|
|
12
|
+
<ChatView client={client} initialSessionId={sessionId} error={error} />
|
|
13
|
+
</ThemeProvider>
|
|
12
14
|
);
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n}from"./react-BxIc-aOD.js";const _=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,t,c)=>c?c.toUpperCase():t.toLowerCase()),i=o=>{const a=m(o);return a.charAt(0).toUpperCase()+a.slice(1)},l=(...o)=>o.filter((a,t,c)=>!!a&&a.trim()!==""&&c.indexOf(a)===t).join(" ").trim(),g=o=>{for(const a in o)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var u={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const v=n.forwardRef(({color:o="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:c,className:r="",children:s,iconNode:h,...d},p)=>n.createElement("svg",{ref:p,...u,width:a,height:a,stroke:o,strokeWidth:c?Number(t)*24/Number(a):t,className:l("lucide",r),...!s&&!g(d)&&{"aria-hidden":"true"},...d},[...h.map(([y,k])=>n.createElement(y,k)),...Array.isArray(s)?s:[s]]));const e=(o,a)=>{const t=n.forwardRef(({className:c,...r},s)=>n.createElement(v,{ref:s,iconNode:a,className:l(`lucide-${_(i(o))}`,`lucide-${o}`,c),...r}));return t.displayName=i(o),t};const w=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Y=e("arrow-down",w);const x=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],e1=e("arrow-up",x);const M=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],a1=e("check",M);const $=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],o1=e("chevron-down",$);const N=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],t1=e("chevron-right",N);const f=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],c1=e("chevron-up",f);const C=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],s1=e("chevrons-up-down",C);const b=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],n1=e("circle-check",b);const A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],r1=e("circle",A);const j=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],d1=e("cloud",j);const q=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],i1=e("code",q);const z=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],l1=e("database",z);const H=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],h1=e("ellipsis-vertical",H);const L=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],p1=e("file-code",L);const V=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],y1=e("file-text",V);const S=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],k1=e("folder-open",S);const E=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],_1=e("folder",E);const P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],m1=e("globe",P);const D=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],g1=e("link-2",D);const F=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],u1=e("link",F);const U=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],v1=e("loader-circle",U);const R=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],w1=e("mic",R);const W=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],x1=e("panel-right",W);const Z=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],M1=e("paperclip",Z);const B=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$1=e("search",B);const G=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],N1=e("settings",G);const I=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],f1=e("sparkles",I);const O=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],C1=e("square-check-big",O);const K=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],b1=e("square-pen",K);const T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],A1=e("square-slash",T);const X=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],j1=e("wrench",X);const J=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],q1=e("x",J);export{Y as A,t1 as C,l1 as D,h1 as E,k1 as F,m1 as G,g1 as L,w1 as M,M1 as P,A1 as S,j1 as W,q1 as X,a1 as a,r1 as b,_1 as c,p1 as d,o1 as e,n1 as f,C1 as g,y1 as h,f1 as i,N1 as j,i1 as k,e1 as l,x1 as m,c1 as n,b1 as o,$1 as p,d1 as q,u1 as r,v1 as s,s1 as t};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{r as l,j as t,P as hs,e as xs,f as bs,M as ys,h as ws,b as vs}from"./react-BxIc-aOD.js";import{P as ke,a as Ns}from"./acp-sdk-CrD5QpoU.js";import{L as $,M as E,N as A,O as w,P as ze,Q as z,R as M,S as L,T as F,U as Ss,W as ee,X as de,Y as js,Z as Cs,$ as ks,a0 as Ts,a1 as q,a2 as Is,a3 as Te}from"./vendor-CDPxlbZ6.js";import{S as te,a as _e,b as Le,P as Es,C as Fe,I as Oe,c as Be,d as $e,R as He,L as We,e as Ve,f as Rs,T as As,g as qe,h as Qe,i as Ge,j as Ms,k as Ke,l as Us,m as Ds,n as Ps,O as Je,o as zs,p as Xe,q as _s,r as Ye,D as Ze,s as et,t as tt,u as Ls,v as st,w as nt,x as Fs,y as ot,V as Os,z as rt,A as at,B as Bs,E as $s,F as it}from"./radix-BwF8w229.js";import{C as xe,S as Hs,P as Ws,M as Vs,A as qs,a as lt,b as be,F as Qs,c as Gs,d as Ks,E as Js,e as se,f as ct,g as ye,h as we,D as dt,L as ut,i as Ie,j as Xs,k as Ys,l as Zs,m as en,n as pt,X as tn,W as ft,o as sn,p as nn,q as on,r as rn,G as an,s as mt,t as ln}from"./icons-xaawVwTw.js";import{r as cn}from"./markdown-PIOGdvNw.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var dn={};const re=typeof process<"u"&&process.versions?.node;let un,pn=0;const fn=new Set;function mn(s){for(const e of fn)e(s)}const Ee={trace:0,debug:1,info:2,warn:3,error:4,fatal:5};class gn{service;minLevel;logFilePath;logsDir;writeQueue=[];isWriting=!1;enableConsoleOutput;constructor(e,n="debug"){this.service=e,this.minLevel=n,typeof process<"u"&&(this.minLevel="info"),this.enableConsoleOutput=typeof process<"u"&&dn?.TOWN_LOG_CONSOLE==="true"||!1}setupFileLogging(){}async writeToFile(e){if(!(!this.logFilePath||!re)&&(this.writeQueue.push(e),!this.isWriting)){for(this.isWriting=!0;this.writeQueue.length>0;){const o=`${this.writeQueue.splice(0,this.writeQueue.length).join(`
|
|
2
|
-
`)}
|
|
3
|
-
`;try{await require("node:fs").promises.appendFile(this.logFilePath,o,"utf-8")}catch{}}this.isWriting=!1}}shouldLog(e){return Ee[e]>=Ee[this.minLevel]}log(e,n,o){if(!this.shouldLog(e))return;const i={id:`log_${++pn}`,timestamp:new Date().toISOString(),level:e,service:this.service,message:n,...o&&{metadata:o}};if(mn(i),re&&this.logFilePath,re&&this.logFilePath){const a={timestamp:i.timestamp,level:i.level,service:i.service,message:i.message,...i.metadata&&{metadata:i.metadata}};this.writeToFile(JSON.stringify(a)).catch(()=>{})}if(re&&this.enableConsoleOutput){const a=i.timestamp,c=i.level.toUpperCase().padEnd(5),f=`[${this.service}]`,u=i.metadata?` ${JSON.stringify(i.metadata)}`:"";console.log(`${a} ${c} ${f} ${i.message}${u}`)}}trace(e,n){this.log("trace",e,n)}debug(e,n){this.log("debug",e,n)}info(e,n){this.log("info",e,n)}warn(e,n){this.log("warn",e,n)}error(e,n){this.log("error",e,n)}fatal(e,n){this.log("fatal",e,n)}}function H(s,e="debug"){return new gn(s,e)}const k=H("http-transport");class hn{connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;messageQueue=[];currentSessionId=null;chunkResolvers=[];streamComplete=!1;sseAbortController=null;reconnectAttempts=0;maxReconnectAttempts=5;reconnectDelay=1e3;reconnecting=!1;abortController=null;options;isReceivingMessages=!1;isInReplayMode=!1;constructor(e){this.options={...e,baseUrl:e.baseUrl.replace(/\/$/,"")}}async connect(){if(!this.connected)try{this.abortController=new AbortController;const e={protocolVersion:ke,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},n=await this.sendRpcRequest("initialize",e);k.info("ACP connection initialized",{initResponse:n});const o={cwd:"/",mcpServers:[]},i=await this.sendRpcRequest("session/new",o);this.currentSessionId=i.sessionId,k.info("Session created",{sessionId:this.currentSessionId}),await this.connectSSE(),this.connected=!0,this.reconnectAttempts=0}catch(e){this.connected=!1;const n=e instanceof Error?e:new Error(String(e));throw this.notifyError(n),n}}async loadSession(e){this.connected&&(k.warn("Transport already connected, disconnecting first",{sessionId:e}),await this.disconnect());try{this.abortController=new AbortController;const n={protocolVersion:ke,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}};k.info("Loading session - initializing connection",{sessionId:e});const o=await this.sendRpcRequest("initialize",n);if(!o.agentCapabilities?.loadSession)throw k.error("Agent does not support loading sessions",{capabilities:o.agentCapabilities}),new Error("Agent does not support loading sessions");k.info("ACP connection initialized, loading session",{sessionId:e,capabilities:o.agentCapabilities}),this.isInReplayMode=!0,this.currentSessionId=e,await this.connectSSE();const i={sessionId:e,cwd:"/",mcpServers:[]};k.info("Sending session/load request",{loadRequest:i});const a=await this.sendRpcRequest("session/load",i);k.info("Session loaded successfully",{sessionId:this.currentSessionId,loadResponse:a}),this.connected=!0,this.reconnectAttempts=0}catch(n){this.connected=!1;const o=n instanceof Error?n:new Error(String(n));throw k.error("Failed to load session",{sessionId:e,error:o.message,stack:o.stack}),this.notifyError(o),o}}async disconnect(){if(this.connected)try{this.abortController&&(this.abortController.abort(),this.abortController=null),this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.connected=!1,this.currentSessionId=null,this.messageQueue=[],this.chunkResolvers=[],this.streamComplete=!1,this.reconnecting=!1,this.reconnectAttempts=0}catch(e){const n=e instanceof Error?e:new Error(String(e));throw this.notifyError(n),n}}async send(e){if(!this.connected||!this.currentSessionId)throw new Error("Transport not connected");this.isInReplayMode&&(k.info("Exiting replay mode - user sent a message"),this.isInReplayMode=!1);try{this.streamComplete=!1,this.messageQueue=[];const n=e.content.filter(c=>c.type==="text").map(c=>c.text).join(`
|
|
4
|
-
`),o={sessionId:this.currentSessionId,prompt:[{type:"text",text:n}]},i=await this.sendRpcRequest("session/prompt",o);k.debug("Prompt sent",{promptResponse:i}),this.streamComplete=!0;const a=this.chunkResolvers.shift();a?a({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}):this.messageQueue.push({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0})}catch(n){this.streamComplete=!0;const o=n instanceof Error?n:new Error(String(n));throw this.notifyError(o),o}}async*receive(){this.isReceivingMessages=!0;try{for(;!this.streamComplete;)if(this.messageQueue.length>0){const e=this.messageQueue.shift();if(e&&(yield e,e.isComplete))return}else{const e=await new Promise(n=>{this.chunkResolvers.push(n)});if(e.isComplete){yield e;return}else yield e}for(;this.messageQueue.length>0;){const e=this.messageQueue.shift();e&&(yield e)}yield{id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}}finally{this.isReceivingMessages=!1}}isConnected(){return this.connected}onSessionUpdate(e){return this.sessionUpdateCallbacks.add(e),()=>{this.sessionUpdateCallbacks.delete(e)}}onError(e){return this.errorCallbacks.add(e),()=>{this.errorCallbacks.delete(e)}}async sendRpcRequest(e,n){const i={jsonrpc:"2.0",id:this.generateRequestId(),method:e,params:n};k.debug("Sending RPC request",{method:e,params:n,request:i});const a={"Content-Type":"application/json",...this.options.headers},c=this.options.timeout??600*1e3,f=new AbortController,u=setTimeout(()=>f.abort(),c);try{const r=await fetch(`${this.options.baseUrl}/rpc`,{method:"POST",headers:a,body:JSON.stringify(i),signal:f.signal});if(clearTimeout(u),!r.ok){const p=await r.text();throw new Error(`HTTP ${r.status}: ${p}`)}const d=await r.json();if(d.error)throw new Error(`ACP error: ${d.error.message||JSON.stringify(d.error)}`);return d.result||d}catch(r){throw clearTimeout(u),r instanceof Error&&r.name==="AbortError"?new Error(`Request timeout after ${c}ms`):r}}async connectSSE(){if(!this.currentSessionId)throw new Error("Cannot connect SSE without a session ID");const e=`${this.options.baseUrl}/events`,n={"X-Session-ID":this.currentSessionId,...this.options.headers};this.sseAbortController=new AbortController;try{const o=await fetch(e,{method:"GET",headers:n,signal:this.sseAbortController.signal});if(!o.ok)throw new Error(`SSE connection failed: HTTP ${o.status}`);if(!o.body)throw new Error("Response body is null");k.debug("SSE connection opened"),this.reconnectAttempts=0,this.reconnectDelay=1e3;const i=o.body.getReader(),a=new TextDecoder;let c="";(async()=>{try{for(;;){const{done:f,value:u}=await i.read();if(f){k.debug("SSE stream closed by server"),this.connected&&await this.handleSSEDisconnect();break}c+=a.decode(u,{stream:!0});const r=c.split(`
|
|
5
|
-
`);c=r.pop()||"";let d={event:"message",data:""};for(const p of r)p.startsWith("event:")?d.event=p.substring(6).trim():p.startsWith("data:")?d.data=p.substring(5).trim():p===""&&(d.event==="message"&&d.data&&this.handleSSEMessage(d.data),d={event:"message",data:""})}}catch(f){if(f instanceof Error&&f.name==="AbortError"){k.debug("SSE stream aborted");return}k.error("Error reading SSE stream",{error:f}),this.connected&&!this.reconnecting&&await this.handleSSEDisconnect()}})()}catch(o){throw k.error("SSE connection error",{error:o}),o}}async handleSSEDisconnect(){if(this.reconnecting||!this.connected)return;if(this.reconnecting=!0,this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.reconnectAttempts>=this.maxReconnectAttempts){const n=new Error(`SSE reconnection failed after ${this.maxReconnectAttempts} attempts`);this.notifyError(n),this.connected=!1,this.reconnecting=!1;return}this.reconnectAttempts++;const e=Math.min(this.reconnectDelay*2**(this.reconnectAttempts-1),32e3);k.debug("SSE reconnecting",{delay:e,attempt:this.reconnectAttempts,maxAttempts:this.maxReconnectAttempts}),await new Promise(n=>setTimeout(n,e));try{await this.connectSSE(),k.info("SSE reconnected successfully"),this.reconnecting=!1}catch(n){k.error("SSE reconnection failed",{error:n}),this.reconnecting=!1}}handleSSEMessage(e){try{const n=JSON.parse(e);k.debug("Received SSE message",{message:n});const o=Ns.safeParse(n);if(!o.success){k.error("Invalid ACP message from SSE",{issues:o.error.issues});return}const i=o.data;k.debug("Parsed ACP message",{method:"method"in i?i.method:"(no method)"}),"method"in i&&i.method==="session/update"&&(k.debug("Received session/update notification"),"params"in i&&i.params&&(k.debug("Calling handleSessionNotification",{params:i.params}),this.handleSessionNotification(i.params)))}catch(n){k.error("Error parsing SSE message",{error:n}),this.notifyError(n instanceof Error?n:new Error(String(n)))}}handleSessionNotification(e){k.debug("handleSessionNotification called",{params:e});const o=e.update,i=this.currentSessionId||e.sessionId;if(k.debug("Update session type",{sessionUpdate:o?.sessionUpdate}),o?.sessionUpdate==="tool_call"){k.debug("Tool call notification",{tokenUsage:o.tokenUsage});const a=o._meta&&typeof o._meta=="object"&&"messageId"in o._meta?String(o._meta.messageId):void 0,c=o._meta&&typeof o._meta=="object"&&"prettyName"in o._meta?String(o._meta.prettyName):void 0,f=o._meta&&typeof o._meta=="object"&&"icon"in o._meta?String(o._meta.icon):void 0,u={id:o.toolCallId??"",title:o.title??"",prettyName:c,icon:f,kind:o.kind||"other",status:o.status||"pending",locations:o.locations,rawInput:o.rawInput,tokenUsage:o.tokenUsage,content:o.content?.map(d=>{if(typeof d!="object"||d===null)return{type:"text",text:""};const p=d;if(p.type==="content"&&typeof p.content=="object"&&p.content!==null){const h=p.content;if(h.type==="text")return{type:"content",content:{type:"text",text:typeof h.text=="string"?h.text:""}}}return p.type==="text"?{type:"text",text:typeof p.text=="string"?p.text:""}:p.type==="diff"?{type:"diff",path:typeof p.path=="string"?p.path:"",oldText:typeof p.oldText=="string"?p.oldText:"",newText:typeof p.newText=="string"?p.newText:"",line:typeof p.line=="number"?p.line:null}:p.type==="terminal"?{type:"terminal",terminalId:typeof p.terminalId=="string"?p.terminalId:""}:{type:"text",text:""}}),startedAt:Date.now()},r={type:"tool_call",sessionId:i,status:"active",toolCall:u,messageId:a};this.notifySessionUpdate(r)}else if(o?.sessionUpdate==="tool_call_update"){const a=o._meta&&typeof o._meta=="object"&&"messageId"in o._meta?String(o._meta.messageId):void 0,c={id:o.toolCallId??"",status:o.status,locations:o.locations,rawOutput:o.rawOutput,tokenUsage:o.tokenUsage,content:o.content?.map(u=>{if(typeof u!="object"||u===null)return{type:"text",text:""};const r=u;if(r.type==="content"&&typeof r.content=="object"&&r.content!==null){const d=r.content;if(d.type==="text")return{type:"content",content:{type:"text",text:typeof d.text=="string"?d.text:""}}}return r.type==="text"?{type:"text",text:typeof r.text=="string"?r.text:""}:r.type==="diff"?{type:"diff",path:typeof r.path=="string"?r.path:"",oldText:typeof r.oldText=="string"?r.oldText:"",newText:typeof r.newText=="string"?r.newText:"",line:typeof r.line=="number"?r.line:null}:r.type==="terminal"?{type:"terminal",terminalId:typeof r.terminalId=="string"?r.terminalId:""}:{type:"text",text:""}}),error:o.error,completedAt:o.status==="completed"||o.status==="failed"?Date.now():void 0},f={type:"tool_call_update",sessionId:i,status:"active",toolCallUpdate:c,messageId:a};k.debug("Notifying tool_call_update session update",{sessionUpdate:f}),this.notifySessionUpdate(f)}else if(o&&"sessionUpdate"in o&&o.sessionUpdate==="tool_output"){const a=o,c=a._meta&&typeof a._meta=="object"&&"messageId"in a._meta?String(a._meta.messageId):void 0,f={id:a.toolCallId??"",rawOutput:a.rawOutput,content:a.content?.map(r=>{if(typeof r!="object"||r===null)return{type:"text",text:""};const d=r;if(d.type==="content"&&typeof d.content=="object"&&d.content!==null){const p=d.content;if(p.type==="text")return{type:"content",content:{type:"text",text:typeof p.text=="string"?p.text:""}}}return d.type==="text"?{type:"text",text:typeof d.text=="string"?d.text:""}:d.type==="diff"?{type:"diff",path:typeof d.path=="string"?d.path:"",oldText:typeof d.oldText=="string"?d.oldText:"",newText:typeof d.newText=="string"?d.newText:"",line:typeof d.line=="number"?d.line:null}:d.type==="terminal"?{type:"terminal",terminalId:typeof d.terminalId=="string"?d.terminalId:""}:{type:"text",text:""}})},u={type:"tool_call_update",sessionId:i,status:"active",toolCallUpdate:f,messageId:c};k.debug("Notifying tool_output as tool_call_update",{sessionUpdate:u}),this.notifySessionUpdate(u)}else if(o?.sessionUpdate==="agent_message_chunk"){const a=o._meta&&typeof o._meta=="object"&&"isReplay"in o._meta&&o._meta.isReplay===!0;if(this.isInReplayMode&&!a)return;const c={type:"generic",sessionId:i,status:"active"},f=o._meta&&typeof o._meta=="object"&&"tokenUsage"in o._meta?o._meta.tokenUsage:void 0,u=o.content;if(u&&typeof u=="object"){const r=u;let d=null;if(r.type==="text"&&typeof r.text=="string"&&(d={id:e.sessionId,role:"assistant",contentDelta:{type:"text",text:r.text},tokenUsage:f,isComplete:!1}),d&&!a){const p=this.chunkResolvers.shift();p?p(d):this.messageQueue.push(d)}if(d&&typeof r.text=="string"&&(a||!this.isReceivingMessages)){const p={type:"generic",sessionId:i,status:"active",message:{id:`msg_${Date.now()}_assistant`,role:"assistant",content:[{type:"text",text:r.text}],timestamp:new Date().toISOString()}};this.notifySessionUpdate(p)}}a||this.notifySessionUpdate(c)}else if(o?.sessionUpdate==="user_message_chunk"){k.debug("Received user_message_chunk",{update:o});const a=o.content;if(a&&typeof a=="object"){const c=a;if(c.type==="text"&&typeof c.text=="string"){const f={type:"generic",sessionId:i,status:"active",message:{id:`msg_${Date.now()}_user`,role:"user",content:[{type:"text",text:c.text}],timestamp:new Date().toISOString()}};k.debug("Notifying session update for user message"),this.notifySessionUpdate(f)}}}else{const a={type:"generic",sessionId:i,status:"active"};this.notifySessionUpdate(a)}}generateRequestId(){return`req-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}notifySessionUpdate(e){for(const n of this.sessionUpdateCallbacks)try{n(e)}catch(o){k.error("Error in session update callback",{error:o})}}notifyError(e){for(const n of this.errorCallbacks)try{n(e)}catch(o){k.error("Error in error callback",{error:o})}}}class xn{constructor(){throw new Error("StdioTransport is not available in the browser. Use HttpTransport or WebSocketTransport instead.")}async connect(){throw new Error("StdioTransport not available in browser")}async disconnect(){}async send(){throw new Error("StdioTransport not available in browser")}async*receive(){throw new Error("StdioTransport not available in browser")}isConnected(){return!1}onSessionUpdate(){return()=>{}}onError(){return()=>{}}}class bn{ws=null;connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;constructor(e){}async connect(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async disconnect(){this.ws&&(this.ws.close(),this.ws=null),this.connected=!1}async send(e){throw!this.connected||!this.ws?new Error("Transport not connected"):new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async*receive(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}isConnected(){return this.connected}onSessionUpdate(e){return this.sessionUpdateCallbacks.add(e),()=>{this.sessionUpdateCallbacks.delete(e)}}onError(e){return this.errorCallbacks.add(e),()=>{this.errorCallbacks.delete(e)}}}const he=H("acp-client","debug");class yn{config;transport;sessions=new Map;currentSessionId=null;sessionUpdateHandlers=new Set;errorHandlers=new Set;constructor(e){this.config=e,this.transport=this.createTransport(),this.setupTransportListeners(),e.autoConnect&&this.connect().catch(n=>{he.error("Failed to auto-connect",{error:n instanceof Error?n.message:String(n)})})}async connect(){await this.transport.connect()}async disconnect(){await this.transport.disconnect(),this.currentSessionId=null}isConnected(){return this.transport.isConnected()}async startSession(e){const n="currentSessionId"in this.transport?this.transport.currentSessionId:void 0;if(n){const c=new Date().toISOString(),f={id:n,status:"connected",config:e?{...e,agentPath:e.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:c}};return this.sessions.set(n,f),this.currentSessionId=n,n}const o=this.generateSessionId(),i=new Date().toISOString(),a={id:o,status:"connecting",config:e?{...e,agentPath:e.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:i}};return this.sessions.set(o,a),this.currentSessionId=o,this.updateSessionStatus(o,"connected"),o}async loadSession(e,n){if(!this.transport.loadSession)throw new Error("Transport does not support loading sessions");const o=new Date().toISOString(),i={id:e,status:"connecting",config:n?{...n,agentPath:n.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:o}};return this.sessions.set(e,i),this.currentSessionId=e,await this.transport.loadSession(e),this.updateSessionStatus(e,"connected"),e}async sendMessage(e,n){const o=n||this.currentSessionId;if(!o)throw new Error("No active session. Start a session first.");if(!this.transport.isConnected())throw new Error("Transport not connected");const i=this.sessions.get(o);if(!i)throw new Error(`Session ${o} not found`);const a={id:this.generateMessageId(),role:"user",content:[{type:"text",text:e}],timestamp:new Date().toISOString()};i.messages.push(a),this.updateSessionStatus(o,"active"),await this.transport.send(a)}async*receiveMessages(){if(!this.transport.isConnected())throw new Error("Transport not connected");yield*this.transport.receive()}getSession(e){return this.sessions.get(e)}getCurrentSession(){return this.currentSessionId?this.sessions.get(this.currentSessionId):void 0}getAllSessions(){return Array.from(this.sessions.values())}onSessionUpdate(e){return this.sessionUpdateHandlers.add(e),()=>{this.sessionUpdateHandlers.delete(e)}}onError(e){return this.errorHandlers.add(e),()=>{this.errorHandlers.delete(e)}}createTransport(){switch(this.config.type){case"stdio":return new xn(this.config.options);case"http":return new hn(this.config.options);case"websocket":return new bn(this.config.options);default:throw new Error(`Unknown transport type: ${this.config.type}`)}}setupTransportListeners(){this.transport.onSessionUpdate(e=>{this.handleSessionUpdate(e)}),this.transport.onError(e=>{this.handleError(e)})}handleSessionUpdate(e){if(e.sessionId){const n=this.sessions.get(e.sessionId);n&&(e.status&&(n.status=e.status),e.message&&n.messages.push(e.message),e.error&&(n.error=e.error))}for(const n of this.sessionUpdateHandlers)try{n(e)}catch(o){he.error("Error in session update handler",{error:o instanceof Error?o.message:String(o)})}}handleError(e){for(const n of this.errorHandlers)try{n(e)}catch(o){he.error("Error in error handler",{error:o instanceof Error?o.message:String(o)})}}updateSessionStatus(e,n){const o=this.sessions.get(e);o&&(o.status=n,this.handleSessionUpdate({sessionId:e,status:n}))}generateSessionId(){return`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}generateMessageId(){return`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}}const G=H("acp-client-hook");function wn(s){const[e,n]=l.useState(null),[o,i]=l.useState(null),[a,c]=l.useState(null);return l.useEffect(()=>{const u=new URLSearchParams(window.location.search).get("session");u&&(G.info("Session ID found in URL",{sessionId:u}),c(u));try{G.info("Initializing ACP client",{serverUrl:s.serverUrl});const r=new yn({type:"http",options:{baseUrl:s.serverUrl}});return n(r),G.info("ACP client initialized successfully"),()=>{G.debug("Disconnecting ACP client"),r.disconnect().catch(d=>{G.error("Failed to disconnect ACP client",{error:d instanceof Error?d.message:String(d)})})}}catch(r){const d=r instanceof Error?r.message:"Failed to initialize ACP client";i(d),G.error("Failed to initialize ACP client",{error:r instanceof Error?r.message:String(r),stack:r instanceof Error?r.stack:void 0});return}},[s.serverUrl]),{client:e,error:o,sessionId:a}}const gt=$(["pending","in_progress","completed","failed"]),vn=$(["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"]),ht=E({path:w(),line:A().nullable().optional()}),ve=E({inputTokens:A().optional(),outputTokens:A().optional(),totalTokens:A().optional()}),xt=ze("type",[E({type:z("content"),content:E({type:z("text"),text:w()})}),E({type:z("text"),text:w()}),E({type:z("diff"),path:w(),oldText:w(),newText:w(),line:A().nullable().optional()}),E({type:z("terminal"),terminalId:w()})]),bt=E({id:w(),title:w(),prettyName:w().optional(),icon:w().optional(),kind:vn,status:gt,contentPosition:A().optional(),locations:M(ht).optional(),rawInput:L(w(),F()).optional(),rawOutput:L(w(),F()).optional(),content:M(xt).optional(),error:w().optional(),startedAt:A().optional(),completedAt:A().optional(),tokenUsage:ve.optional()}),Nn=E({id:w(),status:gt.optional(),locations:M(ht).optional(),rawOutput:L(w(),F()).optional(),content:M(xt).optional(),error:w().optional(),completedAt:A().optional(),tokenUsage:ve.optional()});function Re(s,e){return{...s,status:e.status??s.status,locations:e.locations??s.locations,rawOutput:e.rawOutput??s.rawOutput,content:e.content?[...s.content??[],...e.content]:s.content,error:e.error??s.error,completedAt:e.completedAt??s.completedAt,tokenUsage:e.tokenUsage??s.tokenUsage}}const K=H("chat-store","debug"),T=Ss(s=>({connectionStatus:"disconnected",sessionId:null,error:null,messages:[],isStreaming:!1,streamingStartTime:null,toolCalls:{},totalBilled:{inputTokens:0,outputTokens:0,totalTokens:0},currentContext:{inputTokens:0,outputTokens:0,totalTokens:0},currentModel:"claude-sonnet-4-5-20250929",tokenDisplayMode:"context",logs:[],activeTab:"chat",input:{value:"",isSubmitting:!1,attachedFiles:[]},setConnectionStatus:e=>s({connectionStatus:e}),setSessionId:e=>s({sessionId:e}),setError:e=>s({error:e}),addMessage:e=>s(n=>({messages:[...n.messages,e]})),updateMessage:(e,n)=>s(o=>{const i=o.messages.find(r=>r.id===e);let a=o.totalBilled,c=o.currentContext,f=n;if(n.tokenUsage){const r=i?.tokenUsage;K.debug("updateMessage: incoming tokenUsage",{incoming:n.tokenUsage,existing:r});const d={inputTokens:Math.max(n.tokenUsage.inputTokens??0,r?.inputTokens??0),outputTokens:Math.max(n.tokenUsage.outputTokens??0,r?.outputTokens??0),totalTokens:Math.max(n.tokenUsage.inputTokens??0,r?.inputTokens??0)+Math.max(n.tokenUsage.outputTokens??0,r?.outputTokens??0)};K.debug("updateMessage: merged tokenUsage",{merged:d}),f={...n,tokenUsage:d};const p=d.inputTokens-(r?.inputTokens??0),h=d.outputTokens-(r?.outputTokens??0),v=d.totalTokens-(r?.totalTokens??0);a={inputTokens:o.totalBilled.inputTokens+p,outputTokens:o.totalBilled.outputTokens+h,totalTokens:o.totalBilled.totalTokens+v},c={inputTokens:d.inputTokens,outputTokens:o.currentContext.outputTokens+h,totalTokens:d.totalTokens}}const u=o.messages.map(r=>r.id===e?{...r,...f}:r);if(n.tokenUsage&&f.tokenUsage){const r=i?.tokenUsage,d=f.tokenUsage,p=(d.inputTokens??0)-(r?.inputTokens??0),h=(d.outputTokens??0)-(r?.outputTokens??0),v=(d.totalTokens??0)-(r?.totalTokens??0),m=u.filter(y=>y.tokenUsage).map(y=>({id:y.id,role:y.role,tokens:y.tokenUsage})),x=u.reduce((y,N)=>({inputTokens:y.inputTokens+(N.tokenUsage?.inputTokens??0),outputTokens:y.outputTokens+(N.tokenUsage?.outputTokens??0),totalTokens:y.totalTokens+(N.tokenUsage?.totalTokens??0)}),{inputTokens:0,outputTokens:0,totalTokens:0}),b=x.inputTokens===a.inputTokens&&x.outputTokens===a.outputTokens&&x.totalTokens===a.totalTokens;K.debug("updateMessage: tokenUsage update",{messageId:e,updates:n.tokenUsage,existing:r,messageMax:d,delta:{inputDelta:p,outputDelta:h,totalDelta:v},totalBilled:a,currentContext:c,actualSum:x,billedCorrect:b?"✅":"❌",messageCount:u.length,messagesWithTokens:m.length,breakdown:m})}return{messages:u,totalBilled:a,currentContext:c}}),clearMessages:()=>s({messages:[]}),setIsStreaming:e=>s({isStreaming:e}),setStreamingStartTime:e=>s({streamingStartTime:e}),addToolCall:(e,n)=>s(o=>({toolCalls:{...o.toolCalls,[e]:[...o.toolCalls[e]||[],n]}})),addToolCallToCurrentMessage:e=>s(n=>{const o=n.messages.findLastIndex(u=>u.role==="assistant");if(o===-1){K.debug("No assistant message found, creating one for tool call at position 0");const u={id:`msg_${Date.now()}_assistant`,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!1,toolCalls:[{...e,contentPosition:0}]};return{messages:[...n.messages,u]}}const i=[...n.messages],a=i[o];if(!a)return n;const c=a.content.length,f={...e,contentPosition:c};return i[o]={...a,toolCalls:[...a.toolCalls||[],f]},{messages:i}}),updateToolCallInCurrentMessage:e=>s(n=>{const o=n.messages.findLastIndex(d=>d.role==="assistant");if(o===-1)return K.warn("No assistant message found to update tool call in"),n;const i=[...n.messages],a=i[o];if(!a)return n;const c=a.toolCalls||[],f=c.findIndex(d=>d.id===e.id);if(f===-1)return K.warn(`Tool call ${e.id} not found in message`),n;const u=c[f];if(!u)return n;const r=[...c];return r[f]=Re(u,e),i[o]={...a,toolCalls:r},{messages:i}}),updateToolCall:(e,n)=>s(o=>{const i=o.toolCalls[e]||[],a=i.findIndex(u=>u.id===n.id);if(a===-1)return o;const c=i[a];if(!c)return o;const f=[...i];return f[a]=Re(c,n),{toolCalls:{...o.toolCalls,[e]:f}}}),setInputValue:e=>s(n=>({input:{...n.input,value:e}})),setInputSubmitting:e=>s(n=>({input:{...n.input,isSubmitting:e}})),addFileAttachment:e=>s(n=>({input:{...n.input,attachedFiles:[...n.input.attachedFiles,e]}})),removeFileAttachment:e=>s(n=>({input:{...n.input,attachedFiles:n.input.attachedFiles.filter((o,i)=>i!==e)}})),clearInput:()=>s(e=>({input:{value:"",isSubmitting:!1,attachedFiles:[]}})),addTokenUsage:e=>s(n=>({totalBilled:{inputTokens:n.totalBilled.inputTokens+(e.inputTokens??0),outputTokens:n.totalBilled.outputTokens+(e.outputTokens??0),totalTokens:n.totalBilled.totalTokens+(e.totalTokens??0)},currentContext:{inputTokens:e.inputTokens??n.currentContext.inputTokens,outputTokens:n.currentContext.outputTokens+(e.outputTokens??0),totalTokens:(e.inputTokens??n.currentContext.inputTokens)+(n.currentContext.outputTokens+(e.outputTokens??0))}})),setCurrentModel:e=>s({currentModel:e}),resetTokens:()=>s({totalBilled:{inputTokens:0,outputTokens:0,totalTokens:0},currentContext:{inputTokens:0,outputTokens:0,totalTokens:0}}),cycleTokenDisplayMode:()=>s(e=>{const n=["context","input","output"],i=(n.indexOf(e.tokenDisplayMode)+1)%n.length,a=n[i];return a?{tokenDisplayMode:a}:e}),addLog:e=>s(n=>({logs:[...n.logs,e]})),clearLogs:()=>s({logs:[]}),setActiveTab:e=>s({activeTab:e})})),J=H("use-chat-messages","debug");function yt(s,e){const n=T(p=>p.messages),o=T(p=>p.isStreaming),i=T(p=>p.sessionId),a=T(p=>p.setIsStreaming),c=T(p=>p.setStreamingStartTime),f=T(p=>p.addMessage),u=T(p=>p.updateMessage),r=T(p=>p.setError),d=l.useCallback(async p=>{if(!s){J.error("No client available"),r("No client available");return}let h=i;if(!h){J.info("Creating new session before sending first message");const m=await e();if(!m){J.error("Failed to create session"),r("Failed to create session");return}h=m,J.info("Session created successfully",{sessionId:m})}const v=`msg_${Date.now()}_assistant`;try{const m=Date.now();a(!0),c(m);const x={id:`msg_${Date.now()}_user`,role:"user",content:p,timestamp:new Date().toISOString(),isStreaming:!1};f(x);const b={id:v,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!0,streamingStartTime:m};f(b);const y=s.receiveMessages();s.sendMessage(p,h).catch(C=>{const I=C instanceof Error?C.message:String(C);r(I),a(!1),c(null)});let N="",j=!1;for await(const C of y)if(C.tokenUsage&&J.debug("chunk.tokenUsage",{tokenUsage:C.tokenUsage}),C.isComplete){u(v,{content:N,isStreaming:!1,streamingStartTime:void 0,...C.tokenUsage?{tokenUsage:C.tokenUsage}:{}}),a(!1),c(null),j=!0;break}else C.contentDelta.type==="text"&&(N+=C.contentDelta.text,u(v,{content:N,...C.tokenUsage?{tokenUsage:C.tokenUsage}:{}}),await new Promise(I=>setTimeout(I,16)));j||(J.warn("Stream ended without isComplete flag"),u(v,{isStreaming:!1,streamingStartTime:void 0}),a(!1),c(null))}catch(m){const x=m instanceof Error?m.message:String(m);r(x),a(!1),c(null),u(v,{isStreaming:!1,streamingStartTime:void 0})}},[s,i,e,f,u,a,c,r]);return{messages:n,isStreaming:o,sendMessage:d}}const Sn=H("use-chat-input","debug");function jn(s,e){const n=T(h=>h.input),o=T(h=>h.setInputValue),i=T(h=>h.setInputSubmitting),a=T(h=>h.addFileAttachment),c=T(h=>h.removeFileAttachment),{sendMessage:f}=yt(s,e),u=l.useCallback(h=>{o(h)},[o]),r=l.useCallback(async()=>{if(!n.value.trim()||n.isSubmitting)return;const h=n.value;o(""),i(!0);try{await f(h)}catch(v){Sn.error("Failed to send message",{error:v instanceof Error?v.message:String(v)})}finally{i(!1)}},[n,o,i,f]),d=l.useCallback(h=>{a(h)},[a]),p=l.useCallback(h=>{c(h)},[c]);return{value:n.value,isSubmitting:n.isSubmitting,attachedFiles:n.attachedFiles,onChange:u,onSubmit:r,onAttachFile:d,onRemoveFile:p}}const W=H("use-chat-session","debug");function Cn(s,e){const n=T(m=>m.connectionStatus),o=T(m=>m.sessionId),i=T(m=>m.setConnectionStatus),a=T(m=>m.setSessionId),c=T(m=>m.setError),f=T(m=>m.clearMessages),u=T(m=>m.resetTokens),r=T(m=>m.addMessage);l.useEffect(()=>s?s.onSessionUpdate(x=>{if(x.message&&(W.debug("Session update with message",{message:x.message}),x.message.role!=="tool")){const b=x.message.content.map(j=>j.type==="text"?j.text:"").join(""),y=T.getState().messages,N=y[y.length-1];if(x.message.role==="assistant"&&N?.role==="assistant"&&N.content===""&&b)W.debug("Appending text to existing assistant message"),T.getState().updateMessage(N.id,{content:N.content+b});else{const j={id:x.message.id,role:x.message.role,content:b,timestamp:x.message.timestamp,isStreaming:!1};r(j)}}}):void 0,[s,r]);const d=l.useCallback(async()=>{if(!s){c("No client available");return}try{i("connecting"),c(null),await s.connect(),i("connected")}catch(m){W.error("Failed to connect",{error:m instanceof Error?m.message:String(m)});const x=m instanceof Error?m.message:String(m);c(x),i("error")}},[s,i,c]),p=l.useCallback(async m=>{if(!s){c("No client available");return}try{i("connecting"),c(null);const x=await s.loadSession(m);a(x),i("connected"),u(),W.info("Session loaded successfully",{sessionId:x})}catch(x){W.warn("Failed to load session, creating new one instead",{sessionId:m,error:x instanceof Error?x.message:String(x)});try{await d();const b=await s.startSession();if(a(b),f(),u(),typeof window<"u"){const y=new URL(window.location.href);y.searchParams.set("session",b),window.history.replaceState({},"",y.toString())}W.info("Created new session after failed load",{sessionId:b})}catch(b){const y=b instanceof Error?b.message:String(b);c(`Failed to load or create session: ${y}`),i("error")}}},[s,i,a,c,f,u,d]),h=l.useCallback(async()=>{if(!s)return c("No client available"),null;try{const m=await s.startSession();if(a(m),f(),u(),typeof window<"u"){const x=new URL(window.location.href);x.searchParams.set("session",m),window.history.pushState({},"",x.toString())}return m}catch(m){const x=m instanceof Error?m.message:String(m);return c(x),null}},[s,a,c,f,u]),v=l.useCallback(async()=>{if(s)try{await s.disconnect(),i("disconnected"),a(null)}catch(m){const x=m instanceof Error?m.message:String(m);c(x)}},[s,i,a,c]);return l.useEffect(()=>{!s||n!=="disconnected"||(e?(W.info("Loading initial session from URL",{sessionId:e}),p(e)):d())},[s,n,e,d,p]),{connectionStatus:n,sessionId:o,connect:d,loadSession:p,startSession:h,disconnect:v}}function kn(s){const e=T(c=>c.toolCalls),n=T(c=>c.addToolCall),o=T(c=>c.updateToolCall),i=T(c=>c.addToolCallToCurrentMessage),a=T(c=>c.updateToolCallInCurrentMessage);return l.useEffect(()=>{if(!s)return;const c=s.onSessionUpdate(f=>{f.type==="tool_call"?(n(f.sessionId,f.toolCall),i(f.toolCall)):f.type==="tool_call_update"&&(o(f.sessionId,f.toolCallUpdate),a(f.toolCallUpdate))});return()=>{c()}},[s,n,o,i,a]),{toolCalls:e,getToolCallsForSession:c=>{const f=e[c];return f&&f.length>0?f:Object.values(e).flat()}}}const Tn=E({id:w(),role:$(["user","assistant","system"]),content:w(),timestamp:de(),isStreaming:ee().default(!1),streamingStartTime:A().optional(),metadata:L(w(),F()).optional(),toolCalls:M(bt).optional(),tokenUsage:ve.optional()}),In=E({value:w(),isSubmitting:ee(),attachedFiles:M(E({name:w(),path:w(),size:A(),mimeType:w()}))});E({sessionId:w().nullable(),isConnected:ee(),isStreaming:ee(),messages:M(Tn),input:In,error:w().nullable()});$(["disconnected","connecting","connected","error"]);const En=E({name:w(),description:w().optional(),parameters:L(w(),F()).optional()}),Rn=E({name:w(),description:w(),parameters:L(w(),F()),required:M(w()).optional()}),An=E({name:w(),version:w().optional(),description:w().optional(),author:w().optional(),capabilities:M(En).optional(),tools:M(Rn).optional(),supportedFormats:M(w()).optional()}),Mn=$(["initializing","ready","busy","error","terminated"]);E({status:Mn,info:An.optional(),pid:A().optional(),error:w().optional(),uptime:A().optional()});const wt=$(["user","assistant","system","tool"]),Un=$(["text","image","file","tool_call","tool_result"]),ne=E({type:Un}),Dn=ne.extend({type:z("text"),text:w()}),Pn=ne.extend({type:z("image"),url:w().url().optional(),data:w().optional(),mimeType:w().optional()}),zn=ne.extend({type:z("file"),name:w(),path:w().optional(),url:w().url().optional(),mimeType:w(),size:A().optional()}),_n=ne.extend({type:z("tool_call"),id:w(),name:w(),arguments:L(w(),F())}),Ln=ne.extend({type:z("tool_result"),callId:w(),result:F(),error:w().optional()}),vt=ze("type",[Dn,Pn,zn,_n,Ln]),Nt=E({id:w(),role:wt,content:M(vt),timestamp:de(),metadata:L(w(),F()).optional()});E({id:w(),role:wt,contentDelta:vt,isComplete:ee(),tokenUsage:E({inputTokens:A().optional(),outputTokens:A().optional(),totalTokens:A().optional()}).optional()});const St=$(["idle","connecting","connected","active","streaming","error","disconnected"]),Fn=E({agentPath:w(),agentArgs:M(w()).optional(),environment:L(w(),w()).optional(),workingDirectory:w().optional(),timeout:A().optional()}),On=E({agentName:w().optional(),agentVersion:w().optional(),capabilities:M(w()).optional(),startedAt:de(),lastActivityAt:de().optional()});E({id:w(),status:St,config:Fn,metadata:On.optional(),messages:M(Nt),error:w().optional()});const ue=E({sessionId:w(),status:St.optional(),message:Nt.optional(),error:w().optional()}),Bn=ue.extend({type:z("tool_call"),toolCall:bt,messageId:w().optional()}),$n=ue.extend({type:z("tool_call_update"),toolCallUpdate:Nn,messageId:w().optional()}),Hn=ue.extend({type:z("tool_output"),toolOutput:E({id:w(),content:M(js()).optional(),rawOutput:L(w(),F()).optional()}),messageId:w().optional()}),Wn=ue.extend({type:z("generic").optional()});Cs([Bn,$n,Hn,Wn]);const Vn=[{id:"folder-1",name:"Item 1",type:"folder",children:[{id:"file-1-1",name:"Item 2",type:"file",extension:"tsx"},{id:"file-1-2",name:"Item 3",type:"file",extension:"ts"},{id:"file-1-3",name:"Item 4",type:"file",extension:"json"},{id:"file-1-4",name:"Item 5",type:"file",extension:"md"}]},{id:"folder-2",name:"Description 1",type:"folder",children:[{id:"file-2-1",name:"Description 2",type:"file",extension:"tsx"},{id:"file-2-2",name:"Description 3",type:"file",extension:"ts"},{id:"file-2-3",name:"Description 4",type:"file",extension:"json"},{id:"file-2-4",name:"Description 5",type:"file",extension:"md"}]},{id:"folder-3",name:"financial-docs",type:"folder",children:[]}];class qn{data;constructor(e=Vn){this.data=e}async getRootItems(){return Promise.resolve(this.data)}async getItemChildren(e){const n=i=>{for(const a of i){if(a.id===e)return a;if(a.children){const c=n(a.children);if(c)return c}}},o=n(this.data);return Promise.resolve(o?.children||[])}async getItemDetails(e){const n=i=>{for(const a of i){if(a.id===e)return a;if(a.children){const c=n(a.children);if(c)return c}}},o=n(this.data);if(!o)throw new Error(`Item with id ${e} not found`);return Promise.resolve(o)}}const Qn=[{id:"1",title:"Boeing Scores Early Wins at Dubai Airshow",url:"https://www.reuters.com/business/aerospace-defense/boeing-scores-early-wins-dubai-airshow-2024-11-17",snippet:"DUBAI, Nov 17 (Reuters) - Boeing (BA.N), opens new tab took centre stage at day one of the Dubai Airshow on Monday, booking a $38 billion order from host carrier Emirates and clinching more deals with African carriers, while China displayed its C919 in the Middle East for the first time.",sourceName:"Reuters",favicon:"https://www.reuters.com/favicon.ico"},{id:"2",title:"Boeing's Sustainable Aviation Goals Take Flight",url:"https://www.forbes.com/boeing-sustainability",snippet:"SEATTLE, Nov 18 (Reuters) - Boeing is making headway towards its sustainability targets, unveiling plans for a new eco-friendly aircraft design aimed at reducing emissions by 50% by 2030.",sourceName:"Forbes"},{id:"3",title:"Boeing Faces Increased Competition in Global Aviation Market",url:"https://www.reuters.com/business/aerospace-defense/boeing-competition-2024-11-19",snippet:"CHICAGO, Nov 19 (Reuters) - As the global aviation industry rebounds post-pandemic, Boeing is grappling with intensified competition from rival manufacturers, particularly in the Asian market.",sourceName:"Reuters",favicon:"https://www.reuters.com/favicon.ico"},{id:"4",title:"Boeing's Starliner Successfully Completes Orbital Test Flight",url:"https://www.theverge.com/boeing-starliner",snippet:"NASA, Nov 20 (Reuters) - Boeing's CST-100 Starliner spacecraft achieves a significant milestone, successfully completing its orbital test flight, paving the way for future crewed missions to the International Space Station.",sourceName:"The Verge"}],Gn=[{id:"todo-1",text:"Review filesystem implementation",status:"completed"},{id:"todo-2",text:"Add overflow menu actions",status:"in_progress"},{id:"todo-3",text:"Connect to real filesystem API",status:"pending"},{id:"todo-4",text:"Implement drag and drop support",status:"pending"},{id:"todo-5",text:"Add file preview functionality",status:"pending"}];function g(...s){return ks(Ts(s))}const Kn=q("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-paragraph-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-hover",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive-hover",outline:"border border-input bg-background hover:bg-accent-hover hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary-hover",ghost:"hover:bg-accent-hover hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),X=l.forwardRef(({className:s,variant:e,size:n,asChild:o=!1,...i},a)=>{const c=o?te:"button";return t.jsx(c,{className:g(Kn({variant:e,size:n,className:s})),ref:a,...i})});X.displayName="Button";const Jn=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("rounded-lg border bg-card text-card-foreground shadow-sm",s),...e}));Jn.displayName="Card";const Xn=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("flex flex-col space-y-1.5 p-6",s),...e}));Xn.displayName="CardHeader";const Yn=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("text-2xl font-semibold leading-none tracking-tight",s),...e}));Yn.displayName="CardTitle";const Zn=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("text-sm text-muted-foreground",s),...e}));Zn.displayName="CardDescription";const eo=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("p-6 pt-0",s),...e}));eo.displayName="CardContent";const to=l.forwardRef(({className:s,...e},n)=>t.jsx("div",{ref:n,className:g("flex items-center p-6 pt-0",s),...e}));to.displayName="CardFooter";const jt=l.forwardRef(({title:s,description:e,guideUrl:n,guideText:o="Guide",suggestedPrompts:i=[],onPromptClick:a,onGuideClick:c,onOpenFiles:f,onPromptHover:u,onPromptLeave:r,className:d,...p},h)=>{const v=b=>{a?.(b)},m=()=>{n&&window.open(n,"_blank","noopener,noreferrer"),c?.()},x=[];for(let b=0;b<i.length;b+=2)x.push(i.slice(b,b+2));return t.jsxs("div",{ref:h,className:g("flex flex-col items-start",d),...p,children:[t.jsx("h3",{className:"text-heading-4 text-text-primary mb-6",children:s}),t.jsx("p",{className:"text-subheading text-text-secondary max-w-prose mb-6",children:e}),f&&t.jsxs("button",{type:"button",onClick:f,className:"inline-flex items-center gap-1 py-1.5 pr-3 -ml-3 pl-3 rounded-lg hover:bg-accent transition-colors mb-6",children:[t.jsx("span",{className:"text-paragraph-sm-medium text-foreground tracking-wide leading-none",children:"View Files"}),t.jsx(xe,{className:"size-4 text-foreground shrink-0"})]}),(n||c)&&t.jsxs("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1 py-1.5 pr-3 -ml-3 pl-3 rounded-lg hover:bg-accent transition-colors",children:[t.jsx("span",{className:"text-paragraph-sm-medium text-foreground tracking-wide leading-none",children:o}),t.jsx(xe,{className:"size-4 text-foreground shrink-0"})]}),i.length>0&&t.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-prompt-container",children:[t.jsx("p",{className:"text-label text-text-tertiary",children:"Suggested Prompts"}),t.jsx("div",{className:"flex flex-col gap-2.5",children:x.map(b=>t.jsx("div",{className:"flex gap-2.5 items-center",children:b.map(y=>t.jsx("button",{type:"button",onClick:()=>v(y),onMouseEnter:()=>u?.(y),onMouseLeave:()=>r?.(),className:"flex-1 flex items-start gap-2 p-3 bg-secondary hover:bg-secondary/80 rounded-2xl transition-colors min-w-0",children:t.jsx("span",{className:"text-paragraph font-normal leading-normal text-text-tertiary truncate",children:y})},y))},b.join("-")))})]})]})});jt.displayName="ChatEmptyState";const Ct=l.createContext(void 0),Ne=()=>{const s=l.useContext(Ct);if(!s)throw new Error("ChatHeader components must be used within ChatHeader.Root");return s},kt=l.forwardRef(({defaultExpanded:s=!1,expanded:e,onExpandedChange:n,className:o,children:i,...a},c)=>{const[f,u]=l.useState(s),r=e??f,d=l.useCallback(m=>{u(m),n?.(m)},[n]),p=l.Children.toArray(i),h=p.find(m=>l.isValidElement(m)&&typeof m.type=="function"&&m.type.displayName==="ChatHeader.ExpandablePanel"),v=p.filter(m=>m!==h);return t.jsxs(Ct.Provider,{value:{isExpanded:r,setIsExpanded:d},children:[t.jsx("div",{ref:c,className:g("flex items-center justify-between px-6 py-4",o),...a,children:v}),h]})});kt.displayName="ChatHeader.Root";const so=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("h1",{ref:o,className:g("m-0 text-subheading font-semibold",s),...n,children:e}));so.displayName="ChatHeader.Title";const no=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("flex items-center gap-3",s),...n,children:e}));no.displayName="ChatHeader.Actions";const oo=s=>{switch(s){case"connected":return"bg-green-500";case"connecting":return"bg-yellow-500";case"error":return"bg-red-500";default:return"bg-gray-500"}},ro=s=>{switch(s){case"connected":return"Connected";case"connecting":return"Connecting...";case"error":return"Connection Error";default:return"No Server"}},ao=l.forwardRef(({status:s,statusText:e,className:n,...o},i)=>{const a=e??ro(s),c=oo(s);return t.jsxs("div",{ref:i,className:g("flex items-center gap-2",n),...o,children:[t.jsx("div",{className:g("h-2 w-2 rounded-full",c)}),t.jsx("span",{className:"text-paragraph-sm text-muted-foreground",children:a})]})});ao.displayName="ChatHeader.StatusIndicator";const io=l.forwardRef(({icon:s,className:e,children:n,onClick:o,...i},a)=>{const{isExpanded:c,setIsExpanded:f}=Ne(),u=r=>{f(!c),o?.(r)};return t.jsxs("button",{ref:a,type:"button",onClick:u,className:g("rounded p-1 transition-colors hover:bg-background lg:hidden",e),"aria-label":c?"Collapse header":"Expand header",...i,children:[s&&t.jsx("div",{className:g("transition-transform duration-200",c&&"rotate-180"),children:s}),n]})});io.displayName="ChatHeader.Toggle";const Tt=l.forwardRef(({className:s,children:e,...n},o)=>{const{isExpanded:i}=Ne();return i?t.jsx("div",{ref:o,className:g("absolute top-full left-0 right-0 z-50 border-b border-border bg-card px-6 py-4 shadow-lg lg:hidden",s),...n,children:e}):null});Tt.displayName="ChatHeader.ExpandablePanel";const It=l.forwardRef(({commands:s=[],showCommandMenu:e,commandMenuQuery:n,selectedMenuIndex:o,setSelectedMenuIndex:i,setMenuItemCount:a,triggerCounter:c,onChange:f,className:u,...r},d)=>{const p=l.useCallback((v,m)=>{const x=v.toLowerCase(),b=m.toLowerCase();if(!m)return 1;if(x.includes(b))return 1-b.length/x.length;let y=0;for(let N=0;N<x.length&&y<b.length;N++)x[N]===b[y]&&y++;return y===b.length?.5-y/x.length:0},[]),h=l.useMemo(()=>s.map(v=>({...v,score:Math.max(p(v.label,n),v.description?p(v.description,n):0)})).filter(v=>v.score>0).sort((v,m)=>m.score-v.score),[s,n,p]);return l.useEffect(()=>{a(h.length)},[h.length,a]),l.useEffect(()=>{i(0)},[i]),l.useEffect(()=>{c>0&&h[o]&&(h[o].onSelect(),f(""))},[c,h,o,f]),!e||h.length===0?null:t.jsxs("div",{ref:d,className:g("absolute bottom-full left-0 z-50 mb-2 w-full max-w-md","rounded-md border border-border bg-card p-2 shadow-lg",u),...r,children:[t.jsx("div",{className:"text-caption font-semibold text-muted-foreground px-2 py-1",children:"Commands"}),t.jsx("div",{className:"max-h-64 overflow-y-auto",children:h.map((v,m)=>t.jsxs("button",{type:"button",onClick:()=>v.onSelect(),className:g("w-full rounded-sm px-2 py-2 text-left text-paragraph-sm transition-colors","flex items-start gap-2","hover:bg-muted",m===o&&"bg-muted"),children:[v.icon&&t.jsx("span",{className:"shrink-0 mt-0.5",children:v.icon}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium",children:v.label}),v.description&&t.jsx("div",{className:"text-caption text-muted-foreground truncate",children:v.description})]})]},v.id))})]})});It.displayName="ChatInputCommandMenu";const Et=l.createContext(void 0),pe=()=>{const s=l.useContext(Et);if(!s)throw new Error("ChatInput components must be used within ChatInput.Root");return s},Rt=l.forwardRef(({client:s,startSession:e,value:n,onChange:o,onSubmit:i,disabled:a=!1,isSubmitting:c,submitOnEnter:f=!0,className:u,children:r,...d},p)=>{const h=l.useRef(null),v=l.useCallback(async()=>Promise.resolve(null),[]),m=jn(s??null,e??v),x=T(D=>D.isStreaming),b=s&&e,y=b?m.value:n||"",N=b?m.onChange:o||(()=>{}),j=b?m.onSubmit:i||(async()=>{}),C=b?m.isSubmitting||x:c||!1,[I,U]=l.useState(!1),[S,R]=l.useState(""),[P,Q]=l.useState(0),[B,ls]=l.useState(0),[cs,ds]=l.useState(0),us=l.useCallback(()=>{ds(D=>D+1)},[]),ps=async D=>{D.preventDefault(),y.trim()&&!C&&!a&&(await j(),setTimeout(()=>{h.current?.focus()},0))},fs=D=>{const O=D.target;!(O.tagName==="BUTTON"||O.tagName==="INPUT"||O.tagName==="TEXTAREA"||O.closest("button"))&&h.current&&h.current.focus()},ms=D=>{const O=D.target;!(O.tagName==="BUTTON"||O.tagName==="INPUT"||O.tagName==="TEXTAREA"||O.closest("button"))&&D.key===" "&&(D.preventDefault(),h.current&&h.current.focus())};return l.useEffect(()=>{const D=document.querySelector('textarea[name="chat-input"]');D&&h.current!==D&&(h.current=D)},[]),l.useEffect(()=>{!y&&h.current&&(h.current.style.height="auto",h.current.style.overflowY="hidden")},[y]),t.jsx(Et.Provider,{value:{value:y,onChange:N,onSubmit:j,disabled:a,isSubmitting:C,submitOnEnter:f,showCommandMenu:I,setShowCommandMenu:U,commandMenuQuery:S,setCommandMenuQuery:R,selectedMenuIndex:P,setSelectedMenuIndex:Q,menuItemCount:B,setMenuItemCount:ls,triggerMenuSelect:us,triggerCounter:cs},children:t.jsx("form",{ref:p,onSubmit:ps,onClick:fs,onKeyDown:ms,className:g("relative w-full divide-y rounded-xl border bg-background shadow-md",u),...d,children:r})})});Rt.displayName="ChatInput.Root";const At=l.forwardRef(({asChild:s=!1,className:e,onKeyDown:n,children:o,...i},a)=>{const{value:c,onChange:f,onSubmit:u,disabled:r,isSubmitting:d,submitOnEnter:p,showCommandMenu:h,setShowCommandMenu:v,setCommandMenuQuery:m,setSelectedMenuIndex:x,menuItemCount:b,triggerMenuSelect:y}=pe(),N=l.useRef(null),U={ref:l.useCallback(S=>{N.current=S,typeof a=="function"?a(S):a&&(a.current=S)},[a]),name:"chat-input",value:c,onChange:S=>{const R=S.target.value;if(f(R),R.startsWith("/")&&!R.includes(`
|
|
6
|
-
`)){v(!0);const B=R.slice(1);m(B)}else v(!1),m("");const P=N.current;if(!P)return;P.style.height="auto";const Q=Math.min(P.scrollHeight,164);P.style.height=`${Q}px`,P.scrollHeight>164?P.style.overflowY="auto":P.style.overflowY="hidden"},onKeyDown:S=>{if(h&&b>0){if(S.key==="ArrowDown"){S.preventDefault(),x(R=>(R+1)%b);return}else if(S.key==="ArrowUp"){S.preventDefault(),x(R=>(R-1+b)%b);return}else if(S.key==="Enter"&&!S.shiftKey){S.preventDefault(),y();return}else if(S.key==="Escape"){S.preventDefault(),v(!1),m("");return}}p&&S.key==="Enter"&&!S.shiftKey&&(c.trim()&&!d&&!r?(S.preventDefault(),u()):(d||r)&&S.preventDefault()),n?.(S)},disabled:r,...i};return s&&l.isValidElement(o)?l.cloneElement(o,U):t.jsx("textarea",{...U,rows:1,className:g("w-full resize-none rounded-none border-none p-4 shadow-none","outline-none ring-0 max-h-[6lh] min-h-[44px]","bg-transparent dark:bg-transparent focus-visible:ring-0","text-paragraph-sm placeholder:text-muted-foreground","disabled:cursor-not-allowed disabled:opacity-50",e)})});At.displayName="ChatInput.Field";const Mt=l.forwardRef(({asChild:s=!1,className:e,disabled:n,children:o,...i},a)=>{const{value:c,disabled:f,isSubmitting:u}=pe(),r=n||f||u||!c.trim(),d=s?te:X;return t.jsx(d,{ref:a,type:"submit",disabled:r,variant:s?void 0:"default",size:"icon",className:g(!s&&"gap-1.5 rounded-full",e),...i,children:o})});Mt.displayName="ChatInput.Submit";const Ut=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("flex items-center justify-between p-2",s),...n,children:e}));Ut.displayName="ChatInput.Toolbar";const Dt=l.forwardRef(({asChild:s=!1,className:e,children:n,onClick:o,...i},a)=>{const{value:c,onChange:f,setShowCommandMenu:u,setCommandMenuQuery:r}=pe(),d=h=>{c.startsWith("/")||(f("/"),u(!0),r("")),o?.(h)},p=s?te:X;return t.jsx(p,{ref:a,type:"button",variant:"ghost",size:"icon",className:g("rounded-full",e),onClick:d,...i,children:n||t.jsx(Hs,{className:"size-4"})})});Dt.displayName="ChatInput.Actions";const Pt=l.forwardRef(({asChild:s=!1,className:e,children:n,...o},i)=>{const a=s?te:X;return t.jsx(a,{ref:i,type:"button",variant:"ghost",size:"icon",className:g("rounded-full",e),...o,children:n||t.jsx(Ws,{className:"size-4"})})});Pt.displayName="ChatInput.Attachment";const zt=l.forwardRef(({asChild:s=!1,className:e,children:n,...o},i)=>{const a=s?te:X;return t.jsx(a,{ref:i,type:"button",variant:"ghost",size:"icon",className:g("rounded-full",e),...o,children:n||t.jsx(Vs,{className:"size-4"})})});zt.displayName="ChatInput.VoiceInput";const _t=l.forwardRef(({commands:s=[],className:e,onChange:n,...o},i)=>{const{showCommandMenu:a,commandMenuQuery:c,selectedMenuIndex:f,setSelectedMenuIndex:u,setMenuItemCount:r,triggerCounter:d,onChange:p}=pe();return t.jsx(It,{ref:i,commands:s,showCommandMenu:a,commandMenuQuery:c,selectedMenuIndex:f,setSelectedMenuIndex:u,setMenuItemCount:r,triggerCounter:d,onChange:p,className:e,...o})});_t.displayName="ChatInput.CommandMenu";const lo=({className:s,...e})=>t.jsx(hs,{className:g("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",s),...e}),Lt=({className:s,...e})=>t.jsx(xs,{className:g(s),...e}),co=({withHandle:s,className:e,...n})=>t.jsx(bs,{className:g("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...n,children:s&&t.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-2.5 w-2.5",children:[t.jsx("title",{children:"Resize Handle"}),t.jsx("circle",{cx:"9",cy:"12",r:"1"}),t.jsx("circle",{cx:"9",cy:"5",r:"1"}),t.jsx("circle",{cx:"9",cy:"19",r:"1"}),t.jsx("circle",{cx:"15",cy:"12",r:"1"}),t.jsx("circle",{cx:"15",cy:"5",r:"1"}),t.jsx("circle",{cx:"15",cy:"19",r:"1"})]})})}),uo=({...s})=>t.jsx(Is,{position:"top-center",className:"toaster group",style:{"--top-offset":"16px","--width:":"calc(100% - 2 * var(--top-offset))",position:"absolute",zIndex:5,top:"var(--top-offset)",left:"50%",transform:"translateX(-50%)",width:"calc(100% - 2 * var(--top-offset))",maxWidth:"480px"},offset:0,toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...s}),Ft=l.createContext(void 0),oe=()=>{const s=l.useContext(Ft);if(!s)throw new Error("ChatLayout components must be used within ChatLayout.Root");return s},Ot=l.forwardRef(({defaultSidebarOpen:s=!1,defaultPanelSize:e="hidden",defaultActiveTab:n="todo",className:o,children:i,...a},c)=>{const[f,u]=l.useState(s),[r,d]=l.useState(e),[p,h]=l.useState(n);return t.jsx(Ft.Provider,{value:{sidebarOpen:f,setSidebarOpen:u,panelSize:r,setPanelSize:d,activeTab:p,setActiveTab:h},children:t.jsx("div",{ref:c,className:g("flex h-screen flex-row bg-background text-foreground",o),...a,children:t.jsx(lo,{direction:"horizontal",className:"flex-1",children:i})})})});Ot.displayName="ChatLayout.Root";const po=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("relative z-10 border-b border-border bg-card shrink-0",s),...n,children:e}));po.displayName="ChatLayout.Header";const Bt=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx(Lt,{defaultSize:75,minSize:50,children:t.jsx("div",{ref:o,className:g("flex flex-1 flex-col overflow-hidden h-full",s),...n,children:e})}));Bt.displayName="ChatLayout.Main";const $t=l.forwardRef(({showToaster:s=!0,className:e,children:n,...o},i)=>t.jsxs("div",{ref:i,className:g("relative flex flex-1 flex-col overflow-hidden",e),...o,children:[n,s&&t.jsx(uo,{})]}));$t.displayName="ChatLayout.Body";const Ht=l.forwardRef(({className:s,children:e,onScrollChange:n,showScrollToBottom:o=!0,...i},a)=>{const[c,f]=l.useState(!1),u=l.useRef(null),r=l.useRef(!0),d=l.useRef(!1);l.useImperativeHandle(a,()=>u.current);const p=l.useCallback(()=>{const b=u.current;if(!b)return!1;const{scrollTop:y,scrollHeight:N,clientHeight:j}=b,I=N-y-j<100;return f(!I&&o),n?.(I),I},[n,o]),h=l.useCallback(()=>{if(d.current)return;const b=p();r.current=b},[p]),v=l.useCallback((b=!0)=>{const y=u.current;y&&(d.current=!0,r.current=!0,y.scrollTo({top:y.scrollHeight,behavior:b?"smooth":"auto"}),setTimeout(()=>{d.current=!1},b?300:0))},[]);l.useEffect(()=>{u.current&&(r.current&&!d.current&&requestAnimationFrame(()=>{v(!1)}),d.current||p())},[e,v,p]),l.useEffect(()=>{if(!d.current){const b=p();r.current=b}},[p]);const m=l.useCallback(()=>{d.current=!1;const b=u.current;if(!b)return;const{scrollTop:y,scrollHeight:N,clientHeight:j}=b;N-y-j>=100&&(r.current=!1)},[]),x=l.useCallback(b=>{["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(b.key)&&(d.current=!1,requestAnimationFrame(()=>{const N=u.current;if(!N)return;const{scrollTop:j,scrollHeight:C,clientHeight:I}=N,U=C-j-I;r.current=U<100}))},[]);return t.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[t.jsx("div",{ref:u,className:g("h-full overflow-y-auto flex flex-col",s),onScroll:h,onWheel:m,onTouchStart:m,onKeyDown:x,tabIndex:0,...i,children:t.jsx("div",{className:"mx-auto max-w-chat flex-1 w-full flex flex-col",children:e})}),c&&t.jsx("button",{type:"button",onClick:()=>v(!0),className:g("absolute bottom-4 left-1/2 -translate-x-1/2 z-10","flex items-center justify-center p-2 rounded-full","bg-card border border-border shadow-lg","text-foreground","hover:bg-accent hover:text-accent-foreground","transition-all duration-200 ease-in-out","animate-in fade-in slide-in-from-bottom-2"),"aria-label":"Scroll to bottom",children:t.jsx(qs,{className:"size-4"})})]})});Ht.displayName="ChatLayout.Messages";const Wt=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("bg-linear-to-t from-background to-transparent px-4 pb-4",s),...n,children:t.jsx("div",{className:"mx-auto max-w-chat",children:e})}));Wt.displayName="ChatLayout.Footer";const fo=l.forwardRef(({className:s,children:e,...n},o)=>{const{sidebarOpen:i}=oe();return i?t.jsx("div",{ref:o,className:g("border-r border-border bg-card w-64 overflow-y-auto",s),...n,children:e}):null});fo.displayName="ChatLayout.Sidebar";const Vt=l.forwardRef(({breakpoint:s="lg",className:e,children:n,...o},i)=>{const{panelSize:a}=oe(),[c,f]=l.useState(25);return l.useEffect(()=>{const u=()=>{const d=400/window.innerWidth*100;f(Math.max(d,25))};return u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}},[]),a==="hidden"?null:t.jsxs(t.Fragment,{children:[t.jsx(co,{withHandle:!0,className:"group-hover:opacity-100 opacity-0 transition-opacity"}),t.jsx(Lt,{defaultSize:25,minSize:c,maxSize:35,className:"group",children:t.jsx("div",{ref:i,className:g("hidden h-full border-l border-border bg-card overflow-y-auto transition-all duration-300",s==="md"&&"md:block",s==="lg"&&"lg:block",s==="xl"&&"xl:block",s==="2xl"&&"2xl:block",e),...o,children:n})})]})});Vt.displayName="ChatLayout.Aside";const mo=Rs,go=As,ho=l.forwardRef(({className:s,inset:e,children:n,...o},i)=>t.jsxs(_e,{ref:i,className:g("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-paragraph-sm outline-none","focus:bg-muted data-[state=open]:bg-muted",e&&"pl-8",s),...o,children:[n,t.jsx(xe,{className:"ml-auto h-4 w-4"})]}));ho.displayName=_e.displayName;const xo=l.forwardRef(({className:s,...e},n)=>t.jsx(Le,{ref:n,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",s),...e}));xo.displayName=Le.displayName;const qt=l.forwardRef(({className:s,sideOffset:e=4,...n},o)=>t.jsx(Es,{children:t.jsx(Fe,{ref:o,sideOffset:e,className:g("z-50 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-0.5 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",s),...n})}));qt.displayName=Fe.displayName;const ie=l.forwardRef(({className:s,inset:e,...n},o)=>t.jsx(Oe,{ref:o,className:g("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-paragraph-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",s),...n}));ie.displayName=Oe.displayName;const bo=l.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Be,{ref:o,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx($e,{children:t.jsx(lt,{className:"h-4 w-4"})})}),e]}));bo.displayName=Be.displayName;const yo=l.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(He,{ref:o,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx($e,{children:t.jsx(be,{className:"h-2 w-2 fill-current"})})}),e]}));yo.displayName=He.displayName;const wo=l.forwardRef(({className:s,inset:e,...n},o)=>t.jsx(We,{ref:o,className:g("px-2 py-1.5 text-paragraph-sm font-semibold",e&&"pl-8",s),...n}));wo.displayName=We.displayName;const Qt=l.forwardRef(({className:s,...e},n)=>t.jsx(Ve,{ref:n,className:g("-mx-1 my-1 h-px bg-border",s),...e}));Qt.displayName=Ve.displayName;function Gt({item:s,level:e=0,onSelect:n,selectedId:o,isDropTarget:i=!1,onDownload:a,onRename:c,onDelete:f}){const[u,r]=l.useState(!0),d=o===s.id,p=()=>{s.type==="folder"&&r(!u)},h=()=>{n?.(s),s.type==="folder"&&p()},v=x=>{x.key==="Enter"||x.key===" "?(x.preventDefault(),h()):x.key==="ArrowRight"&&s.type==="folder"&&!u?(x.preventDefault(),r(!0)):x.key==="ArrowLeft"&&s.type==="folder"&&u&&(x.preventDefault(),r(!1))},m=()=>e===0?"p-2":e===1?"pl-8 pr-2 py-2":"pl-16 pr-2 py-2";return t.jsxs("div",{className:"flex flex-col w-full",children:[t.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":s.type==="folder"?u:void 0,className:g("group/item flex items-center gap-2 rounded-md cursor-pointer transition-colors text-paragraph-sm",m(),"hover:bg-accent-hover","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",d&&"bg-accent",i&&["bg-accent","border border-dashed border-border-dark"]),onClick:h,onKeyDown:v,children:[t.jsx("div",{className:"shrink-0 size-4 flex items-center justify-center text-foreground",children:s.type==="folder"?u?t.jsx(Qs,{className:"size-4"}):t.jsx(Gs,{className:"size-4"}):t.jsx(Ks,{className:"size-4"})}),t.jsx("p",{className:"flex-1 text-foreground whitespace-nowrap overflow-hidden text-ellipsis",children:s.name}),t.jsxs(mo,{children:[t.jsx(go,{asChild:!0,children:t.jsx("button",{className:g("shrink-0 size-4 transition-opacity text-muted-foreground hover:text-foreground","opacity-0 group-hover/item:opacity-100","data-[state=open]:opacity-100"),onClick:x=>{x.stopPropagation()},"aria-label":"More options",type:"button",tabIndex:-1,children:t.jsx(Js,{className:"size-4"})})}),t.jsxs(qt,{align:"end",side:"bottom",sideOffset:5,alignOffset:0,collisionPadding:8,className:"w-40 z-[100]",onClick:x=>x.stopPropagation(),children:[a&&t.jsx(ie,{onClick:x=>{x.stopPropagation(),a(s)},children:"Download"}),c&&t.jsx(ie,{onClick:x=>{x.stopPropagation(),c(s)},children:"Rename"}),(a||c)&&f&&t.jsx(Qt,{}),f&&t.jsx(ie,{className:"text-destructive focus:text-destructive focus:bg-muted",onClick:x=>{x.stopPropagation(),f(s)},children:t.jsx("span",{className:"text-paragraph-sm",children:"Delete"})})]})]}),s.type==="folder"&&t.jsx("div",{className:"shrink-0 size-4 flex items-center justify-center text-muted-foreground",children:t.jsx(se,{className:g("size-4 transition-transform",!u&&"-rotate-90")})})]}),s.type==="folder"&&u&&s.children&&t.jsx("div",{className:"flex flex-col",children:s.children.map(x=>t.jsx(Gt,{item:x,level:e+1,...n&&{onSelect:n},...o&&{selectedId:o},...a&&{onDownload:a},...c&&{onRename:c},...f&&{onDelete:f}},x.id))})]})}const vo=new qn;function No({className:s,provider:e=vo,onItemSelect:n,onDownload:o,onRename:i,onDelete:a}){const[c,f]=l.useState([]),[u,r]=l.useState(),[d,p]=l.useState(!0),[h,v]=l.useState();l.useEffect(()=>{(async()=>{try{p(!0);const b=await e.getRootItems();f(b),v(void 0)}catch(b){v(b instanceof Error?b.message:"Failed to load items")}finally{p(!1)}})()},[e]);const m=x=>{r(x.id),n?.(x)};return d?t.jsx("div",{className:g("",s),children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):h?t.jsx("div",{className:g("",s),children:t.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",h]})}):t.jsx("div",{className:g("flex flex-col",s),children:c.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No items found"}):c.map(x=>t.jsx(Gt,{item:x,onSelect:m,...u&&{selectedId:u},...o&&{onDownload:o},...i&&{onRename:i},...a&&{onDelete:a}},x.id))})}const Kt=l.forwardRef(({source:s,isSelected:e,className:n,...o},i)=>t.jsxs("button",{ref:i,type:"button",className:g("group flex w-full text-left gap-2 items-start p-2 rounded-md cursor-pointer transition-colors text-paragraph-sm","hover:bg-accent-hover","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",e&&"bg-accent",n),onClick:()=>window.open(s.url,"_blank"),...o,children:[t.jsx("div",{className:"shrink-0 flex items-center h-5",children:t.jsx("div",{className:"relative rounded-[3px] size-4 overflow-hidden bg-muted",children:s.favicon?t.jsx("img",{alt:s.sourceName,className:"size-full object-cover",src:s.favicon}):t.jsx("div",{className:"size-full bg-muted"})})}),t.jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[t.jsxs("div",{className:"text-paragraph-sm text-foreground",children:[t.jsx("span",{className:"font-medium",children:s.sourceName}),t.jsxs("span",{className:"text-muted-foreground",children:[" · ",s.title]})]}),t.jsx("p",{className:"text-paragraph-sm text-muted-foreground line-clamp-3",children:s.snippet})]})]}));Kt.displayName="SourceListItem";const Jt=l.forwardRef(({todo:s,className:e,...n},o)=>{const i=s.status==="completed";return t.jsxs("div",{ref:o,className:g("group flex items-center gap-2 p-2 rounded-md cursor-pointer transition-colors text-paragraph-sm","hover:bg-accent-hover","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",!1,e),role:"button",tabIndex:0,...n,children:[t.jsx("div",{className:"shrink-0 size-4 flex items-center justify-center text-foreground",children:i?t.jsx(ct,{className:"size-4 text-muted-foreground"}):t.jsx(be,{className:"size-4 text-foreground"})}),t.jsx("p",{className:g("flex-1 text-foreground",i&&"line-through text-muted-foreground",s.status==="in_progress"&&"font-medium"),children:s.text})]})});Jt.displayName="TodoListItem";const Se=l.forwardRef(({client:s,todos:e,className:n,...o},i)=>{const a=e||[];return t.jsx("div",{ref:i,className:g("space-y-2 max-h-64 overflow-y-auto",n),...o,children:a.length===0?t.jsx("p",{className:"text-paragraph-sm text-foreground opacity-60 italic",children:"No tasks yet."}):a.map(c=>t.jsx(Jt,{todo:c},c.id))})});Se.displayName="TodoList";const fe=l.forwardRef(({todos:s,className:e,...n},o)=>{const i=s&&s.length>0?s:Gn;return t.jsx("div",{ref:o,className:g("space-y-2",e),...n,children:t.jsx(Se,{todos:i})})});fe.displayName="TodoTabContent";const me=l.forwardRef(({files:s=[],provider:e,onFileSelect:n,className:o,...i},a)=>{const c=l.useCallback(r=>{console.log("Download:",r.name)},[]),f=l.useCallback(r=>{console.log("Rename:",r.name)},[]),u=l.useCallback(r=>{console.log("Delete:",r.name)},[]);return t.jsx("div",{ref:a,className:g("h-full",o),...i,children:t.jsx(No,{...e&&{provider:e},onItemSelect:r=>{r.type==="file"&&n&&n(r.path||r.name)},onDownload:c,onRename:f,onDelete:u,className:"h-full"})})});me.displayName="FilesTabContent";const ge=l.forwardRef(({sources:s,className:e,...n},o)=>{const i=s&&s.length>0?s:Qn;return t.jsx("div",{ref:o,className:g("space-y-2",e),...n,children:i.map(a=>t.jsx(Kt,{source:a},a.id))})});ge.displayName="SourcesTabContent";const So=l.forwardRef(({data:s,className:e,...n},o)=>t.jsxs("div",{ref:o,className:g("space-y-4",e),...n,children:[t.jsx("h3",{className:"font-semibold text-subheading",children:"Database"}),t.jsxs("div",{className:"text-paragraph-sm text-muted-foreground",children:[t.jsx("p",{children:"Database viewer - panel automatically expanded to large size"}),t.jsxs("div",{className:"mt-4 p-4 border border-border rounded",children:[t.jsx("p",{children:"Your large data table would go here"}),s&&typeof s=="object"?t.jsx("pre",{className:"mt-2 text-caption overflow-auto",children:JSON.stringify(s,null,2)}):null]})]})]}));So.displayName="DatabaseTabContent";const je=Ms,Y=l.forwardRef(({className:s,...e},n)=>t.jsx(qe,{ref:n,className:g("inline-flex h-10 items-center rounded-md bg-muted p-1 text-muted-foreground gap-1",s),...e}));Y.displayName=qe.displayName;const Z=l.forwardRef(({className:s,...e},n)=>t.jsx(Qe,{ref:n,className:g("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-paragraph-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...e}));Z.displayName=Qe.displayName;const _=l.forwardRef(({className:s,...e},n)=>t.jsx(Ge,{ref:n,className:g("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...e}));_.displayName=Ge.displayName;const jo=l.forwardRef(({client:s,todos:e,variant:n="animated",showIcons:o=!1,visibleTabs:i=["todo","files","database"],className:a,...c},f)=>{const u=e||[],[r,d]=l.useState(i[0]||"todo"),p=l.useRef(null),h=l.useRef(null);l.useEffect(()=>{const b=setTimeout(()=>{const y=p.current;if(r&&y){const N=h.current;if(N){const j=y.getBoundingClientRect(),C=N.getBoundingClientRect(),I=C.left-j.left,U=C.width,S=I/j.width*100,R=100-(I+U)/j.width*100;y.style.clipPath=`inset(0 ${R.toFixed(2)}% 0 ${S.toFixed(2)}% round 999px)`}}},0);return()=>clearTimeout(b)},[r]);const m=[{id:"todo",label:n==="pills"?"To-do":"To-Do List",icon:ye},{id:"files",label:"Files",icon:we},{id:"database",label:"Database",icon:dt},{id:"sources",label:"Sources",icon:ut}].filter(x=>i.includes(x.id));return t.jsx("div",{ref:f,className:g("select-none",a),...c,children:t.jsxs(je,{value:r,onValueChange:d,className:"w-full",children:[n==="pills"?t.jsx(Y,{className:g("w-full justify-start bg-transparent p-0 h-auto","gap-1"),children:m.map(x=>{const b=x.icon;return t.jsxs(Z,{value:x.id,className:g("gap-2 px-3 py-1.5 rounded-lg text-paragraph-sm font-medium","data-[state=active]:bg-zinc-100 data-[state=active]:text-foreground","data-[state=inactive]:text-muted-foreground"),children:[o&&b&&t.jsx(b,{className:"size-4"}),x.label]},x.id)})}):t.jsxs("div",{className:"relative mb-4 border-border",children:[t.jsx(Y,{className:"bg-transparent p-0 h-auto rounded-none w-full border-none",children:m.map(x=>t.jsx(Z,{value:x.id,className:"px-3 py-1 text-paragraph-sm font-medium rounded-none text-foreground opacity-60 data-[state=active]:opacity-100 data-[state=active]:bg-transparent data-[state=active]:shadow-none",children:x.label},x.id))}),t.jsx("div",{ref:p,className:"absolute top-0 left-0 w-full overflow-hidden z-10 pointer-events-none",style:{clipPath:"inset(0 100% 0 0% round 999px)",transition:"clip-path 0.25s ease-out"},children:t.jsx(Y,{className:"bg-secondary p-0 h-auto rounded-none w-full border-none",children:m.map(x=>t.jsx(Z,{value:x.id,ref:r===x.id?h:null,className:"px-3 py-1 text-paragraph-sm font-medium rounded-none text-primary bg-transparent data-[state=active]:shadow-none shadow-none",tabIndex:-1,children:x.label},x.id))})})]}),t.jsx(_,{value:"todo",className:n==="pills"?"mt-0":"",children:n==="pills"?t.jsx(fe,{todos:u}):t.jsx(Se,{todos:u})}),t.jsx(_,{value:"files",className:n==="pills"?"mt-0":"",children:t.jsx(me,{})}),t.jsx(_,{value:"database",className:n==="pills"?"mt-0":"",children:t.jsx("div",{className:"text-paragraph-sm text-foreground opacity-60 italic",children:"Database tab coming soon..."})}),t.jsx(_,{value:"sources",className:n==="pills"?"mt-0":"",children:t.jsx(ge,{})})]})})});jo.displayName="ChatSecondaryPanel";const Co=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("flex h-full flex-col",s),...n,children:e}));Co.displayName="ChatSidebar.Root";const ko=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("border-b border-border px-4 py-3",s),...n,children:e}));ko.displayName="ChatSidebar.Header";const To=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("flex-1 overflow-y-auto p-4",s),...n,children:e}));To.displayName="ChatSidebar.Content";const Io=l.forwardRef(({className:s,children:e,...n},o)=>t.jsx("div",{ref:o,className:g("border-t border-border px-4 py-3",s),...n,children:e}));Io.displayName="ChatSidebar.Footer";const Eo=l.forwardRef(({children:s,className:e,...n},o)=>{const[i,a]=l.useState(s),[c,f]=l.useState(!1),u=l.useRef(s),r=l.useRef(!0);return l.useEffect(()=>{if(r.current){r.current=!1,u.current=s;return}if(u.current===s)return;f(!0);const d=setTimeout(()=>{a(s),u.current=s,requestAnimationFrame(()=>{f(!1)})},150);return()=>{clearTimeout(d)}},[s]),t.jsx("span",{ref:o,className:g("text-sm text-foreground opacity-60 transition-opacity duration-300",c?"opacity-0":"opacity-60",e),...n,children:i})});Eo.displayName="ChatStatus";const le=128e3,Ae={"claude-sonnet-4-5-20250929":2e5,"claude-sonnet-4-20250514":2e5,"claude-3-5-sonnet-20241022":2e5,"claude-3-5-sonnet-20240620":2e5,"claude-3-opus-20240229":2e5,"claude-3-sonnet-20240229":2e5,"claude-3-haiku-20240307":2e5,"gpt-4-turbo":128e3,"gpt-4-turbo-preview":128e3,"gpt-4-0125-preview":128e3,"gpt-4-1106-preview":128e3,"gpt-4":8192,"gpt-4-32k":32768,"gpt-3.5-turbo":16385,"gpt-3.5-turbo-16k":16385,default:le};function Ro(s){if(!s)return le;if(s in Ae)return Ae[s]??le;const e=s.toLowerCase();return e.includes("claude")?2e5:e.includes("gpt-4-turbo")?128e3:e.includes("gpt-4-32k")?32768:e.includes("gpt-4")?8192:e.includes("gpt-3.5")?16385:le}function Xt(s,e){const n=Ro(e);return s/n*100}function Ao(s,e,n=1){return`${Xt(s,e).toFixed(n)}%`}const V=H("gui");function Mo({children:s}){const{setPanelSize:e,setActiveTab:n}=oe(),o=()=>{e("small"),n("files")};return t.jsx(t.Fragment,{children:s({openFiles:o})})}function Uo(){const{activeTab:s,setActiveTab:e}=oe();return t.jsxs(je,{value:s,onValueChange:n=>e(n),className:"flex flex-col h-full",children:[t.jsx("div",{className:g("border-b border-border bg-card","px-6 py-2 h-16","flex items-center","[border-bottom-width:0.5px]"),children:t.jsx(Ce,{showIcons:!0,visibleTabs:["todo","files","sources"],variant:"compact"})}),t.jsx(_,{value:"todo",className:"flex-1 p-4 mt-0",children:t.jsx(fe,{})}),t.jsx(_,{value:"files",className:"flex-1 p-4 mt-0",children:t.jsx(me,{})}),t.jsx(_,{value:"sources",className:"flex-1 p-4 mt-0",children:t.jsx(ge,{})})]})}function Do({agentName:s,showHeader:e}){const{isExpanded:n,setIsExpanded:o}=Ne();return t.jsxs("div",{className:"flex lg:hidden items-center gap-2 flex-1",children:[e&&t.jsx("div",{className:"flex items-center gap-2 flex-1",children:t.jsx("h1",{className:"text-heading-4 text-foreground",children:s})}),!e&&t.jsx("div",{className:"flex-1"}),t.jsx("button",{type:"button",className:"flex items-center justify-center shrink-0 cursor-pointer","aria-label":"Toggle menu",onClick:()=>o(!n),children:t.jsx(pt,{className:g("size-4 text-muted-foreground transition-transform duration-200",n?"":"rotate-180")})})]})}function Po({agentName:s,todos:e,sources:n,showHeader:o}){const{panelSize:i,setPanelSize:a}=oe();return t.jsxs(kt,{className:g("border-b border-border bg-card relative lg:p-0","[border-bottom-width:0.5px]"),children:[t.jsxs("div",{className:"hidden lg:flex items-center gap-2 w-full h-16 py-5 pl-6 pr-4",children:[o&&t.jsx("div",{className:"flex items-center gap-2 flex-1",children:t.jsx("h1",{className:"text-heading-4 text-foreground",children:s})}),!o&&t.jsx("div",{className:"flex-1"}),t.jsx("button",{type:"button",className:"flex items-center justify-center shrink-0 cursor-pointer","aria-label":"Toggle sidebar",onClick:()=>{a(i==="hidden"?"small":"hidden")},children:t.jsx(en,{className:"size-4 text-muted-foreground"})})]}),t.jsx(Do,{agentName:s,showHeader:o}),t.jsx(Tt,{className:g("pt-6 pb-8 px-6","border-b border-border bg-card","shadow-[0_4px_16px_0_rgba(0,0,0,0.04)]","[border-bottom-width:0.5px]"),children:t.jsxs(je,{defaultValue:"todo",className:"w-full",children:[t.jsx(Ce,{showIcons:!0,visibleTabs:["todo","files","sources"],variant:"default"}),t.jsx(_,{value:"todo",className:"mt-4",children:t.jsx(fe,{todos:e})}),t.jsx(_,{value:"files",className:"mt-4",children:t.jsx(me,{})}),t.jsx(_,{value:"sources",className:"mt-4",children:t.jsx(ge,{sources:n})})]})})]})}function zo({client:s,initialSessionId:e,error:n}){const{connectionStatus:o,connect:i,sessionId:a,startSession:c}=Cn(s,e),{messages:f,sendMessage:u}=yt(s,c);kn(s);const r=T(S=>S.error),d=T(S=>S.currentModel),[p,h]=l.useState("Agent"),[v,m]=l.useState(typeof window<"u"?window.innerWidth>=1024:!0),[x,b]=l.useState("Type a message or / for commands...");l.useEffect(()=>{V.debug("Connection status changed",{status:o}),o==="error"&&r&&V.error("Connection error occurred",{error:r})},[o,r]),l.useEffect(()=>{if(s&&a){const S=s.getCurrentSession();S?.metadata?.agentName&&h(S.metadata.agentName)}},[s,a]),l.useEffect(()=>{const S=window.matchMedia("(min-width: 1024px)"),R=P=>{m(P.matches)};return m(S.matches),S.addEventListener("change",R),()=>{S.removeEventListener("change",R)}},[]);const y=S=>{b(S)},N=()=>{b("Type a message or / for commands...")};if(n)return t.jsx("div",{className:"flex items-center justify-center h-screen bg-background",children:t.jsxs("div",{className:"text-center p-8 max-w-md",children:[t.jsx("h1",{className:"text-2xl font-bold text-destructive mb-4",children:"Initialization Error"}),t.jsx("p",{className:"text-foreground mb-4",children:n}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to initialize the ACP client. Check the console for details."})]})});const j=[],C=[{id:"1",title:"Boeing Scores Early Wins at Dubai Airshow",sourceName:"Reuters",url:"https://www.reuters.com/markets/companies/BA.N",snippet:"DUBAI, Nov 17 (Reuters) - Boeing (BA.N), opens new tab took centre stage at day one of the Dubai Airshow on Monday, booking a $38 billion order from host carrier Emirates and clinching more deals with African carriers, while China displayed its C919 in the Middle East for the first time.",favicon:"https://www.google.com/s2/favicons?domain=reuters.com&sz=32"},{id:"2",title:"Boeing's Sustainable Aviation Goals Take Flight",sourceName:"Forbes",url:"https://www.forbes.com",snippet:"SEATTLE, Nov 18 (Reuters) - Boeing is making headway towards its sustainability targets, unveiling plans for a new eco-friendly aircraft design aimed at reducing emissions by 50% by 2030.",favicon:"https://www.google.com/s2/favicons?domain=forbes.com&sz=32"},{id:"3",title:"Boeing Faces Increased Competition in Global Aviation Market",sourceName:"Reuters",url:"https://www.reuters.com",snippet:"CHICAGO, Nov 19 (Reuters) - As the global aviation industry rebounds post-pandemic, Boeing is grappling with intensified competition from rival manufacturers, particularly in the Asian market.",favicon:"https://www.google.com/s2/favicons?domain=reuters.com&sz=32"},{id:"4",title:"Boeing's Starliner Successfully Completes Orbital Test Flight",sourceName:"The Verge",url:"https://www.theverge.com",snippet:"NASA, Nov 20 (Reuters) - Boeing's CST-100 Starliner spacecraft achieves a significant milestone, successfully completing its orbital test flight, paving the way for future crewed missions to the International Space Station.",favicon:"https://www.google.com/s2/favicons?domain=theverge.com&sz=32"}],I=f.slice().reverse().find(S=>S.role==="assistant"&&S.tokenUsage)?.tokenUsage,U=[{id:"model-sonnet",label:"Use Sonnet 4.5",description:"Switch to Claude Sonnet 4.5 model",icon:t.jsx(Ie,{className:"h-4 w-4"}),category:"model",onSelect:()=>{V.info("User selected Sonnet 4.5 model")}},{id:"model-opus",label:"Use Opus",description:"Switch to Claude Opus model",icon:t.jsx(Ie,{className:"h-4 w-4"}),category:"model",onSelect:()=>{V.info("User selected Opus model")}},{id:"settings",label:"Open Settings",description:"Configure chat preferences",icon:t.jsx(Xs,{className:"h-4 w-4"}),category:"action",onSelect:()=>{V.info("User opened settings")}},{id:"code-mode",label:"Code Mode",description:"Enable code-focused responses",icon:t.jsx(Ys,{className:"h-4 w-4"}),category:"mode",onSelect:()=>{V.info("User enabled code mode")}}];return t.jsxs(Ot,{defaultPanelSize:"hidden",defaultActiveTab:"todo",children:[t.jsxs(Bt,{children:[t.jsx(Po,{agentName:p,todos:j,sources:C,showHeader:f.length>0}),o==="error"&&r&&t.jsx("div",{className:"border-b border-destructive/20 bg-destructive/10 px-6 py-4",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("h3",{className:"mb-1 text-paragraph-sm font-semibold text-destructive",children:"Connection Error"}),t.jsx("p",{className:"whitespace-pre-line text-paragraph-sm text-foreground",children:r})]}),t.jsx("button",{type:"button",onClick:i,className:"rounded-lg bg-destructive px-4 py-2 text-paragraph-sm font-medium text-destructive-foreground transition-colors hover:bg-destructive-hover",children:"Retry"})]})}),t.jsxs($t,{children:[t.jsx(Ht,{children:f.length===0?t.jsx(Mo,{children:({openFiles:S})=>t.jsx("div",{className:"flex flex-1 items-center px-4",children:t.jsx(jt,{title:p,description:"This agent can help you with your tasks. Start a conversation by typing a message below.",suggestedPrompts:["Search the web for the latest news on top tech company earnings, produce a summary for each company, and then a macro trend analysis of the tech industry. Use your todo list","Explain how this works","Create a new feature","Review my changes"],onPromptClick:R=>{u(R),b("Type a message or / for commands..."),V.info("Prompt clicked",{prompt:R})},onPromptHover:y,onPromptLeave:N,onOpenFiles:S})})}):t.jsx("div",{className:"flex flex-col px-4",children:f.map((S,R)=>{const P=R===0,Q=P?null:f[R-1];let B="mt-2";return P?B="mt-2":S.role==="user"?B=(Q?.role==="user","mt-4"):S.role==="assistant"&&(B=Q?.role==="assistant"?"mt-2":"mt-6"),t.jsx(ts,{message:S,className:B,isLastMessage:R===f.length-1,children:t.jsx(ns,{message:S,thinkingDisplayStyle:"collapsible"})},S.id)})})}),t.jsx(Wt,{children:t.jsxs(Rt,{client:s,startSession:c,children:[t.jsx(_t,{commands:U}),t.jsx(At,{placeholder:x,autoFocus:!0}),t.jsxs(Ut,{children:[t.jsxs("div",{className:"flex items-baseline gap-1",children:[t.jsx(Dt,{}),t.jsx(Pt,{}),I&&t.jsx(Zt,{percentage:Xt(I.totalTokens??0,d??void 0),tokens:I.totalTokens??0,formattedPercentage:Ao(I.totalTokens??0,d??void 0)})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(zt,{}),t.jsx(Mt,{children:t.jsx(Zs,{className:"size-4"})})]})]})]})})]})]}),v&&t.jsx(Vt,{breakpoint:"lg",children:t.jsx(Uo,{})})]})}const _o=Us,Lo=Ds,Fo=Ps,Yt=l.forwardRef(({className:s,sideOffset:e=4,...n},o)=>t.jsx(Ke,{ref:o,sideOffset:e,className:g("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...n}));Yt.displayName=Ke.displayName;const Zt=l.forwardRef(({percentage:s,tokens:e,formattedPercentage:n,className:o,...i},a)=>{const c=Math.min(100,Math.max(0,s)),f=16,u=2,r=(f-u)/2,d=f/2,p=2*Math.PI*r,h=p-c/100*p;return t.jsx(_o,{children:t.jsxs(Lo,{children:[t.jsx(Fo,{asChild:!0,children:t.jsx(X,{ref:a,type:"button",variant:"ghost",size:"icon",className:g("rounded-full cursor-default",o),...i,children:t.jsxs("svg",{width:f,height:f,viewBox:`0 0 ${f} ${f}`,className:"transform -rotate-90",children:[t.jsx("circle",{cx:d,cy:d,r,stroke:"currentColor",strokeWidth:u,fill:"transparent",className:"opacity-20"}),t.jsx("circle",{cx:d,cy:d,r,stroke:"currentColor",strokeWidth:u,fill:"transparent",strokeDasharray:p,strokeDashoffset:h,strokeLinecap:"round",className:"transition-all duration-300 ease-in-out"})]})})}),t.jsx(Yt,{side:"top",align:"center",children:t.jsxs("p",{children:["Context: ",n," (",e.toLocaleString()," tokens)"]})})]})})});Zt.displayName="ContextUsageButton";const Oo=l.forwardRef(({autoScroll:s=!0,isStreaming:e=!1,scrollBehavior:n="smooth",scrollThreshold:o=100,showScrollButton:i=!0,scrollButton:a,className:c,children:f,...u},r)=>{const d=l.useRef(null),[p,h]=l.useState(!0),[v,m]=l.useState(!1),x=l.useRef(0);l.useImperativeHandle(r,()=>{if(!d.current)throw new Error("Container ref not initialized");return d.current});const b=l.useCallback(()=>{const N=d.current;if(!N)return;const{scrollTop:j,scrollHeight:C,clientHeight:I}=N,S=C-j-I<o;h(S),m(!S&&i),x.current=j},[o,i]),y=l.useCallback((N=n)=>{const j=d.current;j&&j.scrollTo({top:j.scrollHeight,behavior:N})},[n]);return l.useEffect(()=>{!s||!d.current||(e&&p?y("auto"):!e&&p&&y())},[s,e,p,y]),l.useEffect(()=>{const N=d.current;if(!N)return;const j=()=>{b()};return N.addEventListener("scroll",j,{passive:!0}),b(),()=>{N.removeEventListener("scroll",j)}},[b]),l.useEffect(()=>{const N=d.current;if(!N)return;const j=new ResizeObserver(()=>{p&&s&&y("auto")});return j.observe(N),()=>{j.disconnect()}},[p,s,y]),t.jsxs("div",{className:"relative flex-1",children:[t.jsx("div",{ref:d,className:g("h-full overflow-y-auto overflow-x-hidden","scrollbar-thin scrollbar-thumb-[border] scrollbar-track-transparent",c),...u,children:t.jsx("div",{className:"flex flex-col gap-4 px-4 py-4",children:f})}),v&&t.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10",children:a||t.jsxs("button",{type:"button",onClick:()=>y(),className:"px-4 py-2 rounded-full bg-card border border-border shadow-lg hover:shadow-xl hover:bg-card/90 transition-all text-sm font-medium text-foreground flex items-center gap-2","aria-label":"Scroll to bottom",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Down arrow",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})}),"Scroll to bottom"]})})]})});Oo.displayName="Conversation";const Bo=zs,es=l.forwardRef(({className:s,...e},n)=>t.jsx(Je,{ref:n,className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...e}));es.displayName=Je.displayName;const $o=l.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(Bo,{children:[t.jsx(es,{}),t.jsxs(Xe,{ref:o,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...n,children:[e,t.jsxs(_s,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(tn,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));$o.displayName=Xe.displayName;const Ho=l.forwardRef(({className:s,...e},n)=>t.jsx(Ye,{ref:n,className:g("text-subheading font-semibold leading-none tracking-tight",s),...e}));Ho.displayName=Ye.displayName;const Wo=l.forwardRef(({className:s,...e},n)=>t.jsx(Ze,{ref:n,className:g("text-paragraph-sm text-muted-foreground",s),...e}));Wo.displayName=Ze.displayName;const Vo=q("flex h-10 w-full rounded-md border bg-input-background px-3 py-2 text-paragraph-sm ring-offset-background file:border-0 file:bg-transparent file:text-paragraph-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),qo=l.forwardRef(({className:s,type:e,variant:n,...o},i)=>t.jsx("input",{type:e,className:g(Vo({variant:n,className:s})),ref:i,...o}));qo.displayName="Input";const Qo=l.forwardRef(({className:s,...e},n)=>t.jsx(et,{ref:n,className:g("text-label font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...e}));Qo.displayName=et.displayName;const Go=q("flex animate-fadeIn",{variants:{role:{user:"max-w-[80%] self-end ml-auto mr-2",assistant:"self-start mr-auto",system:"self-start mr-auto max-w-full"},layout:{default:"",full:"max-w-full",compact:"max-w-[90%]"}},defaultVariants:{role:"assistant",layout:"default"}}),ts=l.forwardRef(({message:s,role:e,layout:n,className:o,children:i,messageId:a,autoScroll:c,isLastMessage:f=!1,...u},r)=>{const d=s?s.role:e||"assistant",p=s?s.id:a,h=l.useRef(null),[v,m]=l.useState(void 0);return l.useImperativeHandle(r,()=>h.current),l.useEffect(()=>{if(!f||d!=="assistant"){m(void 0);return}const x=()=>{const y=h.current;if(!y)return;let N=y.parentElement;for(;N&&!N.classList.contains("overflow-y-auto");)N=N.parentElement;if(!N)return;const j=y.previousElementSibling;if(!j||j.getAttribute("aria-label")!=="user message"){m(void 0);return}const C=N.clientHeight,I=j.offsetHeight,S=Math.max(0,C-I-32);m(S)};x();const b=new ResizeObserver(x);if(h.current){b.observe(h.current);let y=h.current.parentElement;for(;y&&!y.classList.contains("overflow-y-auto");)y=y.parentElement;y&&b.observe(y)}return()=>b.disconnect()},[f,d]),l.useEffect(()=>{if((c!==void 0?c:d==="user")&&h.current){const b=setTimeout(()=>{h.current?.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},50);return()=>clearTimeout(b)}},[d,c]),t.jsx("article",{ref:h,"aria-label":`${d} message`,"data-message-id":p,className:g(Go({role:d,layout:n}),o),style:{minHeight:v!==void 0?`${v}px`:void 0},...u,children:i})});ts.displayName="Message";const Me=q("mb-3 rounded-lg bg-card border border-border transition-all",{variants:{variant:{default:"opacity-70",subtle:"opacity-50",prominent:"opacity-90 shadow-sm"}},defaultVariants:{variant:"default"}}),Ko=q("w-4 h-4 text-foreground opacity-60 transition-transform duration-200",{variants:{expanded:{true:"rotate-180",false:""}},defaultVariants:{expanded:!1}}),ss=l.forwardRef(({content:s,isStreaming:e=!1,mode:n="collapsible",defaultExpanded:o=!1,autoExpand:i=!1,autoCollapse:a=!0,autoCollapseDelay:c=2e3,label:f="Thinking",variant:u,className:r},d)=>{const[p,h]=l.useState(n==="inline"?!0:o),[v,m]=l.useState(!1);return l.useEffect(()=>{if(a&&!e&&s&&n==="collapsible"){const x=setTimeout(()=>{m(!0),h(!1)},c);return()=>clearTimeout(x)}},[e,s,a,c,n]),l.useEffect(()=>{i&&e&&n==="collapsible"&&!v&&h(!0)},[i,e,n,v]),!s&&!e?null:n==="inline"?t.jsxs("div",{ref:d,className:g(Me({variant:u}),"p-3",r),children:[t.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[t.jsx("span",{className:"text-caption font-medium text-foreground opacity-60 uppercase tracking-wide",children:f}),e&&t.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse"})]}),t.jsxs("div",{className:"text-paragraph-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,e&&s&&t.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})]}):t.jsxs("div",{ref:d,className:g("mb-3",r),children:[t.jsxs("button",{type:"button",onClick:()=>{h(!p),m(!1)},className:"w-full flex items-center justify-between p-2.5 rounded-lg bg-card border border-border hover:bg-card/80 hover:shadow-sm transition-all text-left","aria-expanded":p,"aria-label":`${p?"Collapse":"Expand"} reasoning`,children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[t.jsx("span",{className:"text-caption font-medium text-foreground opacity-60 uppercase tracking-wide shrink-0",children:f}),e&&t.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse shrink-0"}),!p&&s&&t.jsxs("span",{className:"text-caption text-foreground opacity-50 truncate",children:[s.substring(0,60),s.length>60&&"..."]})]}),t.jsx(se,{className:Ko({expanded:p}),"aria-hidden":"true"})]}),p&&t.jsx("div",{className:g(Me({variant:u}),"mt-2 p-3 animate-fadeIn"),children:t.jsxs("div",{className:"text-paragraph-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,e&&s&&t.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})})]})});ss.displayName="Reasoning";const ce=l.forwardRef(({content:s,isStreaming:e=!1,showEmpty:n=!0,emptyMessage:o="",className:i,...a},c)=>{if(!s&&e&&n)return t.jsx("div",{ref:c,className:g("opacity-70 italic text-paragraph-sm",i),...a,children:o});if(!s)return null;const f={table:({node:u,...r})=>t.jsx("div",{className:"overflow-x-auto my-4",children:t.jsx("table",{className:"min-w-full border-collapse border border-border rounded-md",...r})}),thead:({node:u,...r})=>t.jsx("thead",{className:"bg-card border-b border-border",...r}),tbody:({node:u,...r})=>t.jsx("tbody",{...r}),tr:({node:u,...r})=>t.jsx("tr",{className:"border-b border-border hover:bg-card transition-colors",...r}),th:({node:u,...r})=>t.jsx("th",{className:"px-4 py-2 text-left font-semibold text-foreground border-r border-border last:border-r-0",...r}),td:({node:u,...r})=>t.jsx("td",{className:"px-4 py-2 text-foreground border-r border-border last:border-r-0",...r}),input:({node:u,checked:r,...d})=>d.type==="checkbox"?t.jsx("input",{type:"checkbox",checked:r||!1,disabled:!0,readOnly:!0,className:"mr-2 w-4 h-4 accent-[primary] cursor-not-allowed",...d}):t.jsx("input",{...d}),code:({node:u,...r})=>r.className?.includes("language-")?t.jsx("code",{className:"block p-4 bg-card border border-border rounded-md overflow-x-auto text-code text-foreground shadow-sm",...r}):t.jsx("code",{className:"px-1.5 py-0.5 bg-card border border-border rounded text-code text-foreground",...r}),pre:({node:u,...r})=>t.jsx("pre",{className:"my-4 rounded-lg",...r}),h1:({node:u,...r})=>t.jsx("h1",{className:"text-heading-3 mt-6 mb-4 text-foreground border-b border-border pb-2",...r}),h2:({node:u,...r})=>t.jsx("h2",{className:"text-subheading mt-5 mb-3 text-foreground border-b border-border/50 pb-1.5",...r}),h3:({node:u,...r})=>t.jsx("h3",{className:"text-subheading mt-4 mb-2 text-foreground",...r}),h4:({node:u,...r})=>t.jsx("h4",{className:"text-paragraph-sm font-semibold mt-3 mb-2 text-foreground",...r}),ul:({node:u,...r})=>{const d=u?.children?.some(p=>typeof p=="object"&&p!==null&&"type"in p&&p.type==="element"&&"tagName"in p&&p.tagName==="li"&&"children"in p&&Array.isArray(p.children)&&p.children.some(h=>typeof h=="object"&&h!==null&&"type"in h&&h.type==="element"&&"tagName"in h&&h.tagName==="input"&&"properties"in h&&typeof h.properties=="object"&&h.properties!==null&&"type"in h.properties&&h.properties.type==="checkbox"));return t.jsx("ul",{className:g("my-2 space-y-1 text-foreground",d?"list-none space-y-2":"list-disc list-outside pl-4"),...r})},ol:({node:u,...r})=>t.jsx("ol",{className:"list-decimal list-outside pl-4 my-2 space-y-1 text-foreground",...r}),li:({node:u,...r})=>{const d=u?.children?.some(p=>typeof p=="object"&&p!==null&&"type"in p&&p.type==="element"&&"tagName"in p&&p.tagName==="input"&&"properties"in p&&typeof p.properties=="object"&&p.properties!==null&&"type"in p.properties&&p.properties.type==="checkbox");return t.jsx("li",{className:g(d?"flex items-start gap-2":""),...r})},a:({node:u,...r})=>t.jsx("a",{className:"text-primary hover:underline decoration-2 underline-offset-2 transition-all",target:"_blank",rel:"noopener noreferrer",...r}),p:({node:u,...r})=>t.jsx("p",{className:"mb-2 text-foreground leading-relaxed",...r}),blockquote:({node:u,...r})=>t.jsx("blockquote",{className:"border-l-4 border-[primary] pl-4 italic my-4 text-foreground bg-card py-2 rounded-r-md shadow-sm",...r}),hr:({node:u,...r})=>t.jsx("hr",{className:"my-6 border-t border-border opacity-50",...r})};return t.jsx("div",{ref:c,className:g("markdown-content prose prose-sm max-w-none dark:prose-invert",i),...a,children:t.jsx(ys,{remarkPlugins:[cn],components:f,children:s})})});ce.displayName="Response";const Ue={Globe:an,Link:rn,Cloud:on,CheckSquare:ye,Search:nn,FileText:we,Edit:sn,Wrench:ft};function De({toolCall:s}){const[e,n]=l.useState(!1),o=s.icon&&Ue[s.icon]?Ue[s.icon]:ft,i=s.prettyName||s.title;return t.jsxs("div",{className:"flex flex-col my-4",children:[t.jsx("button",{type:"button",className:"flex items-center gap-2 cursor-pointer bg-transparent border-none p-0 text-left group w-fit",onClick:()=>n(!e),"aria-expanded":e,children:t.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-medium text-zinc-500",children:[t.jsx("div",{className:"text-zinc-500",children:t.jsx(o,{className:"h-3 w-3"})}),t.jsx("span",{className:"text-paragraph-sm text-zinc-500",children:i}),t.jsx(se,{className:`h-3 w-3 text-zinc-400 transition-transform duration-200 ${e?"rotate-180":""}`})]})}),e&&t.jsxs("div",{className:"mt-2 text-sm border border-zinc-200 rounded-lg bg-zinc-50 overflow-hidden w-full",children:[s.locations&&s.locations.length>0&&t.jsxs("div",{className:"p-3 border-b border-zinc-200",children:[t.jsx("div",{className:"text-[10px] font-bold text-zinc-400 uppercase tracking-wider mb-1.5 font-sans",children:"Files"}),t.jsx("ul",{className:"space-y-1",children:s.locations.map(a=>t.jsxs("li",{className:"font-mono text-[11px] text-zinc-700 bg-zinc-200/50 px-1.5 py-0.5 rounded w-fit",children:[a.path,a.line!==null&&a.line!==void 0&&`:${a.line}`]},`${a.path}:${a.line??""}`))})]}),s.rawInput&&Object.keys(s.rawInput).length>0&&t.jsxs("div",{className:"p-3 border-b border-zinc-200",children:[t.jsx("div",{className:"text-[10px] font-bold text-zinc-400 uppercase tracking-wider mb-1.5 font-sans",children:"Input"}),t.jsx("div",{className:"text-[11px] font-mono text-zinc-700",children:t.jsx(Te,{value:s.rawInput,collapsed:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:{fontSize:"11px",backgroundColor:"transparent",fontFamily:"inherit"}})})]}),s.content&&s.content.length>0||s.error?t.jsxs("div",{className:"p-3 border-b border-zinc-200 last:border-0",children:[t.jsx("div",{className:"text-[10px] font-bold text-zinc-400 uppercase tracking-wider mb-1.5 font-sans",children:"Output"}),t.jsxs("div",{className:"space-y-2 text-[11px] text-zinc-700",children:[s.content?.map((a,c)=>{const f=()=>a.type==="diff"&&"path"in a?`diff-${a.path}-${c}`:a.type==="terminal"&&"terminalId"in a?`terminal-${a.terminalId}`:a.type==="text"&&"text"in a?`text-${a.text.substring(0,20)}-${c}`:a.type==="content"&&"content"in a?`content-${a.content.text?.substring(0,20)}-${c}`:`block-${c}`,u=(r,d)=>{try{const p=JSON.parse(r);if(typeof p=="object"&&p!==null)return t.jsx("div",{className:"text-[11px]",children:t.jsx(Te,{value:p,collapsed:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:{fontSize:"11px",backgroundColor:"transparent",fontFamily:"inherit"}})},d)}catch{}return t.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-zinc-700 overflow-x-auto",children:r},d)};if(a.type==="content"&&"content"in a){const r=a.content;if(r.type==="text"&&r.text)return u(r.text,f())}return a.type==="text"&&"text"in a?u(a.text,f()):a.type==="diff"&&"path"in a&&"oldText"in a&&"newText"in a?t.jsxs("div",{className:"border border-zinc-200 rounded bg-white",children:[t.jsxs("div",{className:"bg-zinc-50 px-2 py-1 text-[10px] font-mono text-zinc-500 border-b border-zinc-200",children:[a.path,"line"in a&&a.line!==null&&a.line!==void 0&&`:${a.line}`]}),t.jsxs("div",{className:"p-2 font-mono text-[11px]",children:[t.jsxs("div",{className:"text-red-600",children:["- ",a.oldText]}),t.jsxs("div",{className:"text-green-600",children:["+ ",a.newText]})]})]},f()):a.type==="terminal"&&"terminalId"in a?t.jsxs("div",{className:"bg-zinc-900 text-zinc-100 p-2 rounded text-[11px] font-mono",children:["Terminal: ",a.terminalId]},f()):null}),s.error&&t.jsxs("div",{className:"text-red-600 font-mono text-[11px] mt-2",children:["Error: ",s.error]})]})]}):null,(s.tokenUsage||s.startedAt)&&t.jsxs("div",{className:"p-2 bg-zinc-100/50 border-t border-zinc-200 flex flex-wrap gap-4 text-[10px] text-zinc-500 font-sans",children:[s.tokenUsage&&t.jsxs("div",{className:"flex gap-3",children:[s.tokenUsage.inputTokens!==void 0&&t.jsxs("div",{children:[t.jsx("span",{className:"uppercase tracking-wide font-semibold mr-1",children:"Input:"}),s.tokenUsage.inputTokens.toLocaleString()]}),s.tokenUsage.outputTokens!==void 0&&t.jsxs("div",{children:[t.jsx("span",{className:"uppercase tracking-wide font-semibold mr-1",children:"Output:"}),s.tokenUsage.outputTokens.toLocaleString()]}),s.tokenUsage.totalTokens!==void 0&&t.jsxs("div",{children:[t.jsx("span",{className:"uppercase tracking-wide font-semibold mr-1",children:"Total:"}),s.tokenUsage.totalTokens.toLocaleString()]})]}),s.startedAt&&t.jsxs("div",{className:"flex gap-3 ml-auto",children:[t.jsxs("span",{children:["Started: ",new Date(s.startedAt).toLocaleTimeString()]}),s.completedAt&&t.jsxs("span",{children:["Completed:"," ",new Date(s.completedAt).toLocaleTimeString()," (",Math.round((s.completedAt-s.startedAt)/1e3),"s)"]})]})]})]})]})}const ae=["Thinking","Pensando","Pensant","Denkend","Pensando","考えている","생각 중","思考中","Размышляя","Düşünüyor","Myślący","Tänkande","Pensando","Ajatellen","Σκεπτόμενος","חושב","सोच रहा है","Berpikir"],Pe=["...","·..",".·.","..·",".·.","·.."];function Jo({startTime:s}){const[e,n]=l.useState(0),[o,i]=l.useState(()=>ae[Math.floor(Math.random()*ae.length)]),[a,c]=l.useState(0);l.useEffect(()=>{const r=setInterval(()=>{const p=Date.now()-s;n(p)},100);return()=>clearInterval(r)},[s]),l.useEffect(()=>{const r=setInterval(()=>{const d=Math.floor(Math.random()*ae.length);i(ae[d])},1500);return()=>clearInterval(r)},[]),l.useEffect(()=>{const r=setInterval(()=>{c(d=>(d+1)%Pe.length)},100);return()=>clearInterval(r)},[]);const f=(e/1e3).toFixed(1),u=Pe[a];return t.jsxs("span",{className:"text-muted-foreground text-paragraph-sm",children:[o,u," ",f,"s"]})}const Xo=q("w-full rounded-2xl text-[var(--font-size)] font-[var(--font-family)] leading-relaxed break-words transition-colors",{variants:{role:{user:"bg-secondary text-foreground px-4 py-4 text-paragraph",assistant:"text-foreground text-paragraph-sm",system:"bg-card border border-border text-foreground opacity-80 text-caption px-4 py-3"},variant:{default:"",outline:"border border-border",ghost:"bg-transparent"}},defaultVariants:{role:"assistant",variant:"default"}}),ns=l.forwardRef(({role:s,variant:e,isStreaming:n,message:o,thinkingDisplayStyle:i="collapsible",className:a,children:c,...f},u)=>{const r=T(m=>m.streamingStartTime);T(m=>m.currentModel);const d=o&&!c,p=d?o.role:s||"assistant",h=d?o.isStreaming:n;let v=c;if(d){const m=o.metadata?.thinking,x=!!m,b=o.isStreaming&&!o.content&&o.role==="assistant";v=t.jsxs(t.Fragment,{children:[o.role==="assistant"&&x&&t.jsx(ss,{content:m,isStreaming:o.isStreaming,mode:i,autoCollapse:!0}),b&&r&&t.jsxs("div",{className:"flex items-center gap-2 opacity-50",children:[t.jsx(mt,{className:"size-4 animate-spin text-muted-foreground"}),t.jsx(Jo,{startTime:r})]}),o.role==="assistant"?(()=>{const y=(o.toolCalls||[]).slice().sort((C,I)=>(C.contentPosition??1/0)-(I.contentPosition??1/0));if(y.length===0||!y.some(C=>C.contentPosition!==void 0))return t.jsxs(t.Fragment,{children:[y.length>0&&t.jsx("div",{className:"flex flex-col gap-2 mb-1",children:y.map(C=>t.jsx(De,{toolCall:C},C.id))}),t.jsx(ce,{content:o.content,isStreaming:o.isStreaming,showEmpty:!1})]});const N=[];let j=0;if(y.forEach(C=>{const I=C.contentPosition??o.content.length;if(I>j){const U=o.content.slice(j,I);U&&N.push(t.jsx(ce,{content:U,isStreaming:!1,showEmpty:!1},`text-before-${C.id}`))}N.push(t.jsx("div",{children:t.jsx(De,{toolCall:C})},`tool-${C.id}`)),j=I}),j<o.content.length){const C=o.content.slice(j);C&&N.push(t.jsx(ce,{content:C,isStreaming:o.isStreaming,showEmpty:!1},"text-end"))}return t.jsx(t.Fragment,{children:N})})():t.jsx("div",{className:"whitespace-pre-wrap",children:o.content})]})}return t.jsx("div",{ref:u,className:g(Xo({role:p,variant:e}),h&&"animate-pulse-subtle",a),...f,children:v})});ns.displayName="MessageContent";const Ce=l.forwardRef(({showIcons:s=!0,visibleTabs:e=["todo","files"],variant:n="default",className:o,...i},a)=>{const f=[{id:"todo",label:"To-do",icon:ye},{id:"files",label:"Files",icon:we},{id:"database",label:"Database",icon:dt},{id:"sources",label:"Sources",icon:ut}].filter(r=>e.includes(r.id)),u=n==="compact"?"gap-[4px]":"gap-3";return t.jsx(Y,{ref:a,className:g("w-full justify-start bg-transparent p-0 h-auto",u,o),...i,children:f.map(r=>{const d=r.icon;return t.jsxs(Z,{value:r.id,className:g("gap-2 px-3 py-1.5 rounded-lg text-paragraph-sm font-medium","data-[state=active]:bg-zinc-100 data-[state=active]:text-foreground","data-[state=inactive]:text-muted-foreground"),children:[s&&d&&t.jsx(d,{className:"size-4"}),r.label]},r.id)})})});Ce.displayName="PanelTabsHeader";const Yo=l.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(tt,{ref:o,className:g("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-paragraph-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...n,children:[e,t.jsx(Ls,{asChild:!0,children:t.jsx(ln,{className:"h-4 w-4 opacity-50"})})]}));Yo.displayName=tt.displayName;const os=l.forwardRef(({className:s,...e},n)=>t.jsx(st,{ref:n,className:g("flex cursor-default items-center justify-center py-1",s),...e,children:t.jsx(pt,{className:"h-4 w-4"})}));os.displayName=st.displayName;const rs=l.forwardRef(({className:s,...e},n)=>t.jsx(nt,{ref:n,className:g("flex cursor-default items-center justify-center py-1",s),...e,children:t.jsx(se,{className:"h-4 w-4"})}));rs.displayName=nt.displayName;const Zo=l.forwardRef(({className:s,children:e,position:n="popper",...o},i)=>t.jsx(Fs,{children:t.jsxs(ot,{ref:i,className:g("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...o,children:[t.jsx(os,{}),t.jsx(Os,{className:g("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),t.jsx(rs,{})]})}));Zo.displayName=ot.displayName;const er=l.forwardRef(({className:s,...e},n)=>t.jsx(rt,{ref:n,className:g("py-1.5 pl-8 pr-2 text-paragraph-sm font-semibold",s),...e}));er.displayName=rt.displayName;const tr=l.forwardRef(({className:s,children:e,...n},o)=>t.jsxs(at,{ref:o,className:g("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Bs,{children:t.jsx(lt,{className:"h-4 w-4"})})}),t.jsx($s,{children:e})]}));tr.displayName=at.displayName;const sr=l.forwardRef(({className:s,...e},n)=>t.jsx(it,{ref:n,className:g("-mx-1 my-1 h-px bg-muted",s),...e}));sr.displayName=it.displayName;const as=l.forwardRef(({task:s,collapsible:e=!0,defaultExpanded:n=!1,onTaskClick:o,className:i,...a},c)=>{const[f,u]=l.useState(n),r=!!(s.details||s.files&&s.files.length>0),d={pending:be,in_progress:mt,completed:ct}[s.status],p=()=>{switch(s.status){case"completed":return"text-green-500";case"in_progress":return"text-primary";default:return"text-foreground opacity-40"}},h=()=>{r&&e&&u(!f),o?.(s)};return t.jsxs("div",{ref:c,className:g("rounded-lg border border-border bg-card transition-all","hover:shadow-sm hover:border-border/80",i),...a,children:[t.jsxs("button",{type:"button",onClick:h,className:g("w-full flex items-center gap-3 px-3 py-2.5 text-left",r&&e&&"cursor-pointer"),disabled:!r&&!e,children:[t.jsx(d,{className:g("w-4 h-4 shrink-0",p(),s.status==="in_progress"&&"animate-spin")}),t.jsx("span",{className:g("flex-1 text-paragraph-sm font-[var(--font-family)]",s.status==="completed"&&"line-through opacity-60",s.status==="in_progress"&&"font-medium"),children:s.text}),r&&e&&t.jsx(se,{className:g("w-4 h-4 text-foreground opacity-50 transition-transform duration-200 shrink-0",f&&"rotate-180"),"aria-hidden":"true"})]}),r&&f&&t.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-border/50 animate-fadeIn",children:[s.details&&t.jsx("p",{className:"text-paragraph-sm text-foreground opacity-80 leading-relaxed mb-2",children:s.details}),s.files&&s.files.length>0&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("span",{className:"text-caption font-medium text-foreground opacity-60 uppercase tracking-wide",children:"Files:"}),t.jsx("div",{className:"space-y-1",children:s.files.map(v=>t.jsx("div",{className:"text-caption font-mono text-foreground opacity-70 bg-background px-2 py-1 rounded border border-border/50",children:v},v))})]})]})]})});as.displayName="Task";const nr=l.forwardRef(({tasks:s,collapsible:e=!0,onTaskClick:n,emptyMessage:o="No tasks yet.",className:i,...a},c)=>t.jsx("div",{ref:c,className:g("space-y-2 max-h-96 overflow-y-auto",i),...a,children:s.length===0?t.jsx("p",{className:"text-paragraph-sm text-foreground opacity-60 italic py-4 text-center",children:o}):s.map(f=>t.jsx(as,{task:f,collapsible:e,...n?{onTaskClick:n}:{}},f.id))}));nr.displayName="TaskList";const or=q("flex min-h-[80px] w-full rounded-md border bg-background px-3 py-2 text-paragraph-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),rr=l.forwardRef(({className:s,autoResize:e=!1,maxHeight:n=200,variant:o,...i},a)=>{const c=l.useRef(null),f=l.useCallback(r=>{c.current=r,typeof a=="function"?a(r):a&&(a.current=r)},[a]),u=l.useCallback(()=>{const r=c.current;if(!r||!e)return;r.style.height="auto";const d=Math.min(r.scrollHeight,n);r.style.height=`${d}px`,r.scrollHeight>n?r.style.overflowY="auto":r.style.overflowY="hidden"},[e,n]);return l.useEffect(()=>{u()},[u]),t.jsx("textarea",{className:g(or({variant:o}),e&&"overflow-y-hidden",s),ref:f,...i})});rr.displayName="Textarea";function ar(){return"http://localhost:3100"}const ir={agentServerUrl:ar()};function lr(){const{client:s,error:e,sessionId:n}=wn({serverUrl:ir.agentServerUrl});return t.jsx(zo,{client:s,initialSessionId:n,error:e})}const is=document.getElementById("root");if(!is)throw new Error("Root element not found");ws.createRoot(is).render(t.jsx(vs.StrictMode,{children:t.jsx(lr,{})}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-gray-500:oklch(55.1% .027 264.364);--color-zinc-50:oklch(98.5% 0 0);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-900:oklch(21% .006 285.885);--color-neutral-50:oklch(98.5% 0 0);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--radius:.5rem;--max-width-prose:477px;--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-primary-hover:var(--primary-hover);--color-secondary:var(--secondary);--color-secondary-foreground:var(--secondary-foreground);--color-secondary-hover:var(--secondary-hover);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-accent-hover:var(--accent-hover);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-destructive-hover:var(--destructive-hover);--color-border:var(--border);--color-border-dark:var(--border-dark);--color-input:var(--input);--color-input-background:var(--input-background);--color-ring:var(--ring);--color-text-primary:var(--text-primary);--color-text-secondary:var(--text-secondary);--color-text-tertiary:var(--text-tertiary);--max-width-chat:720px;--max-width-prompt-container:393px;--letter-spacing-tight:-.48px;--letter-spacing-heading:-.4px;--letter-spacing-uppercase:1.12px;--font-size-heading-1:3rem;--line-height-heading-1:1;--font-size-heading-2:1.875rem;--line-height-heading-2:1;--font-size-heading-3:1.5rem;--line-height-heading-3:1.2;--font-size-heading-4:1.25rem;--line-height-heading-4:1.2;--font-size-heading-5:1rem;--line-height-heading-5:1.2;--font-size-subheading:1.25rem;--line-height-subheading:1.5;--font-size-label:.875rem;--line-height-label:1.5;--font-size-paragraph:1rem;--line-height-paragraph:1.5;--font-size-paragraph-sm:.875rem;--line-height-paragraph-sm:1.5;--font-size-paragraph-mini:.75rem;--line-height-paragraph-mini:1.5;--font-size-caption:.75rem;--line-height-caption:1.5;--font-size-code:.875rem;--line-height-code:1.5;--letter-spacing-wide:.07em}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground)}button{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing)*0)}.right-4{right:calc(var(--spacing)*4)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-50{z-index:50}.z-\[100\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.my-2{margin-block:calc(var(--spacing)*2)}.my-4{margin-block:calc(var(--spacing)*4)}.my-6{margin-block:calc(var(--spacing)*6)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-auto{margin-right:auto}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.-ml-3{margin-left:calc(var(--spacing)*-3)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-full{width:100%;height:100%}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-16{height:calc(var(--spacing)*16)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[6lh\]{max-height:6lh}.min-h-\[44px\]{min-height:44px}.min-h-\[80px\]{min-height:80px}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-10{width:calc(var(--spacing)*10)}.w-40{width:calc(var(--spacing)*40)}.w-64{width:calc(var(--spacing)*64)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\[80\%\]{max-width:80%}.max-w-\[90\%\]{max-width:90%}.max-w-\[200px\]{max-width:200px}.max-w-chat{max-width:var(--max-width-chat)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-prompt-container{max-width:var(--max-width-prompt-container)}.max-w-prose{max-width:var(--max-width-prose)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-outside{list-style-position:outside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-\[4px\]{gap:4px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:var(--radius)}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[3px\]{border-radius:3px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[border-bottom-width\:0\.5px\]{border-bottom-width:.5px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-\[primary\]{border-color:primary}.border-border{border-color:var(--color-border)}.border-border-dark{border-color:var(--color-border-dark)}.border-border\/50{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.border-destructive,.border-destructive\/20{border-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/20{border-color:color-mix(in oklab,var(--color-destructive)20%,transparent)}}.border-green-500{border-color:var(--color-green-500)}.border-input{border-color:var(--color-input)}.border-zinc-200{border-color:var(--color-zinc-200)}.bg-accent{background-color:var(--color-accent)}.bg-background{background-color:var(--color-background)}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-destructive,.bg-destructive\/10{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--color-destructive)10%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-green-500{background-color:var(--color-green-500)}.bg-input-background{background-color:var(--color-input-background)}.bg-muted{background-color:var(--color-muted)}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-red-500{background-color:var(--color-red-500)}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-zinc-50{background-color:var(--color-zinc-50)}.bg-zinc-100\/50{background-color:#f4f4f580}@supports (color:color-mix(in lab,red,red)){.bg-zinc-100\/50{background-color:color-mix(in oklab,var(--color-zinc-100)50%,transparent)}}.bg-zinc-200\/50{background-color:#e4e4e780}@supports (color:color-mix(in lab,red,red)){.bg-zinc-200\/50{background-color:color-mix(in oklab,var(--color-zinc-200)50%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-linear-to-t{--tw-gradient-position:to top}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-t{--tw-gradient-position:to top in oklab}}.bg-linear-to-t{background-image:linear-gradient(var(--tw-gradient-stops))}.from-background{--tw-gradient-from:var(--color-background);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-3{padding-right:calc(var(--spacing)*3)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1\.5{padding-bottom:calc(var(--spacing)*1.5)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-8{padding-bottom:calc(var(--spacing)*8)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-16{padding-left:calc(var(--spacing)*16)}.text-center{text-align:center}.text-end{text-align:end}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-\[var\(--font-family\)\]{--tw-font-weight:var(--font-family);font-weight:var(--font-family)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--font-size\)\]{color:var(--font-size)}.text-card-foreground{color:var(--color-card-foreground)}.text-destructive{color:var(--color-destructive)}.text-destructive-foreground{color:var(--color-destructive-foreground)}.text-foreground{color:var(--color-foreground)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.text-text-tertiary{color:var(--color-text-tertiary)}.text-zinc-100{color:var(--color-zinc-100)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-700{color:var(--color-zinc-700)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.decoration-2{text-decoration-thickness:2px}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.accent-\[primary\]{accent-color:primary}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow-\[0_4px_16px_0_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/item\:opacity-100:is(:where(.group\/item):hover *){opacity:1}}.group-\[\.toast\]\:bg-muted:is(:where(.group).toast *){background-color:var(--color-muted)}.group-\[\.toast\]\:bg-primary:is(:where(.group).toast *){background-color:var(--color-primary)}.group-\[\.toast\]\:text-muted-foreground:is(:where(.group).toast *){color:var(--color-muted-foreground)}.group-\[\.toast\]\:text-primary-foreground:is(:where(.group).toast *){color:var(--color-primary-foreground)}.group-\[\.toaster\]\:border-border:is(:where(.group).toaster *){border-color:var(--color-border)}.group-\[\.toaster\]\:bg-background:is(:where(.group).toaster *){background-color:var(--color-background)}.group-\[\.toaster\]\:text-foreground:is(:where(.group).toaster *){color:var(--color-foreground)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing)*1)}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}@media(hover:hover){.hover\:border-border\/80:hover{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.hover\:border-border\/80:hover{border-color:color-mix(in oklab,var(--color-border)80%,transparent)}}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-accent-hover:hover{background-color:var(--color-accent-hover)}.hover\:bg-background:hover{background-color:var(--color-background)}.hover\:bg-card:hover,.hover\:bg-card\/80:hover{background-color:var(--color-card)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/80:hover{background-color:color-mix(in oklab,var(--color-card)80%,transparent)}}.hover\:bg-card\/90:hover{background-color:var(--color-card)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/90:hover{background-color:color-mix(in oklab,var(--color-card)90%,transparent)}}.hover\:bg-destructive-hover:hover{background-color:var(--color-destructive-hover)}.hover\:bg-muted:hover{background-color:var(--color-muted)}.hover\:bg-primary-hover:hover{background-color:var(--color-primary-hover)}.hover\:bg-secondary-hover:hover{background-color:var(--color-secondary-hover)}.hover\:bg-secondary\/80:hover{background-color:var(--color-secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary)80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:text-foreground:hover{color:var(--color-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-sm:hover{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:bg-muted:focus{background-color:var(--color-muted)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.focus\:text-destructive:focus{color:var(--color-destructive)}.focus\:text-foreground:focus{color:var(--color-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-border-dark:focus-visible{--tw-ring-color:var(--color-border-dark)}.focus-visible\:ring-destructive:focus-visible{--tw-ring-color:var(--color-destructive)}.focus-visible\:ring-green-500:focus-visible{--tw-ring-color:var(--color-green-500)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing)*1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--color-background)}.data-\[state\=active\]\:bg-transparent[data-state=active]{background-color:#0000}.data-\[state\=active\]\:bg-zinc-100[data-state=active]{background-color:var(--color-zinc-100)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--color-foreground)}.data-\[state\=active\]\:opacity-100[data-state=active]{opacity:1}.data-\[state\=active\]\:shadow-none[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=inactive\]\:text-muted-foreground[data-state=inactive]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:bg-muted[data-state=open]{background-color:var(--color-muted)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}@media(min-width:40rem){.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:block{display:block}}@media(min-width:64rem){.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:p-0{padding:calc(var(--spacing)*0)}}@media(min-width:80rem){.xl\:block{display:block}}@media(min-width:96rem){.\32xl\:block{display:block}}@media(prefers-color-scheme:dark){.dark\:bg-transparent{background-color:#0000}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.text-heading-1{font-size:var(--font-size-heading-1);line-height:var(--line-height-heading-1);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-heading-2{font-size:var(--font-size-heading-2);line-height:var(--line-height-heading-2);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-heading-3{font-size:var(--font-size-heading-3);line-height:var(--line-height-heading-3);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-heading-4{font-size:var(--font-size-heading-4);line-height:var(--line-height-heading-4);letter-spacing:var(--letter-spacing-heading);font-weight:600}.text-heading-5{font-size:var(--font-size-heading-5);line-height:var(--line-height-heading-5);letter-spacing:var(--letter-spacing-heading);font-weight:600}.text-subheading{font-size:var(--font-size-subheading);line-height:var(--line-height-subheading);font-weight:400}.text-label{font-size:var(--font-size-label);line-height:var(--line-height-label);letter-spacing:var(--letter-spacing-uppercase);text-transform:uppercase;font-weight:500}.text-paragraph{font-size:var(--font-size-paragraph);line-height:var(--line-height-paragraph);font-weight:400}.text-paragraph-medium{font-size:var(--font-size-paragraph);line-height:var(--line-height-paragraph);font-weight:500}.text-paragraph-sm{font-size:var(--font-size-paragraph-sm);line-height:var(--line-height-paragraph-sm);font-weight:400}.text-paragraph-sm-medium{font-size:var(--font-size-paragraph-sm);line-height:var(--line-height-paragraph-sm);letter-spacing:var(--letter-spacing-wide);font-weight:500}.text-paragraph-mini{font-size:var(--font-size-paragraph-mini);line-height:var(--line-height-paragraph-mini);font-weight:400}.text-paragraph-mini-medium{font-size:var(--font-size-paragraph-mini);line-height:var(--line-height-paragraph-mini);font-weight:500}.text-caption{font-size:var(--font-size-caption);line-height:var(--line-height-caption);font-weight:400}.text-code{font-size:var(--font-size-code);line-height:var(--line-height-code);font-family:monospace}}:root{--background:var(--color-white);--foreground:var(--color-neutral-950);--card:var(--color-white);--card-foreground:var(--color-neutral-950);--popover:var(--color-white);--popover-foreground:var(--color-neutral-950);--primary:var(--color-neutral-900);--primary-foreground:var(--color-neutral-50);--primary-hover:var(--color-neutral-700);--secondary:var(--color-neutral-100);--secondary-foreground:var(--color-neutral-900);--secondary-hover:var(--color-neutral-50);--muted:var(--color-neutral-50);--muted-foreground:var(--color-neutral-500);--accent:var(--color-neutral-100);--accent-foreground:var(--color-neutral-900);--accent-hover:var(--color-neutral-50);--destructive:var(--color-red-500);--destructive-foreground:var(--color-neutral-50);--destructive-hover:var(--color-red-600);--border:var(--color-neutral-200);--border-dark:var(--color-neutral-300);--border-focus:var(--color-neutral-400);--border-error:var(--color-red-500);--input:var(--color-neutral-200);--input-background:var(--color-white);--ring:var(--color-neutral-900);--text-primary:var(--color-neutral-900);--text-secondary:var(--color-neutral-600);--text-tertiary:var(--color-neutral-500)}.dark{--background:var(--color-neutral-950);--foreground:var(--color-neutral-50);--card:var(--color-neutral-950);--card-foreground:var(--color-neutral-50);--popover:var(--color-neutral-950);--popover-foreground:var(--color-neutral-50);--primary:var(--color-neutral-50);--primary-foreground:var(--color-neutral-900);--primary-hover:var(--color-neutral-200);--secondary:var(--color-neutral-800);--secondary-foreground:var(--color-neutral-50);--secondary-hover:var(--color-neutral-700);--muted:var(--color-neutral-800);--muted-foreground:var(--color-neutral-400);--accent:var(--color-neutral-800);--accent-foreground:var(--color-neutral-50);--accent-hover:var(--color-neutral-700);--destructive:var(--color-red-900);--destructive-foreground:var(--color-neutral-50);--destructive-hover:var(--color-red-800);--border:var(--color-neutral-800);--border-dark:var(--color-neutral-700);--border-focus:var(--color-neutral-600);--border-error:var(--color-red-500);--input:var(--color-neutral-800);--input-background:var(--color-neutral-950);--ring:var(--color-neutral-300);--text-primary:var(--color-neutral-50);--text-secondary:var(--color-neutral-400);--text-tertiary:var(--color-neutral-500)}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes exit{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes slideDownAndFade{0%{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideLeftAndFade{0%{opacity:0;transform:translate(2px)}to{opacity:1;transform:translate(0)}}@keyframes slideUpAndFade{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideRightAndFade{0%{opacity:0;transform:translate(-2px)}to{opacity:1;transform:translate(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes pulse{50%{opacity:.5}}
|