remote-codex 0.11.22 → 0.11.24
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/README.md +211 -110
- package/apps/relay-server/dist/index.js +442 -54
- package/apps/supervisor-api/dist/index.js +68 -27
- package/apps/supervisor-web/dist/assets/index-DeQ67jTv.js +5 -0
- package/apps/supervisor-web/dist/assets/index-DgSdRu7a.css +1 -0
- package/apps/supervisor-web/dist/assets/thread-ui-Ck4oSYRQ.js +3665 -0
- package/apps/supervisor-web/dist/index.html +3 -3
- package/package.json +2 -1
- package/packages/shared/src/index.ts +45 -0
- package/apps/supervisor-web/dist/assets/index-BfspE5mQ.js +0 -5
- package/apps/supervisor-web/dist/assets/index-BmBS1Wzk.css +0 -1
- package/apps/supervisor-web/dist/assets/thread-ui-CDgAOcDh.js +0 -3631
|
@@ -0,0 +1,3665 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-oEok_Crl.js","assets/markdown-vendor-BQJfKm05.js","assets/react-vendor-CgLzZcV4.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/terminal-vendor-B365Go3Z.js","assets/terminal-vendor-Beg8tuEN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{l as B,R as Mi,I as _i,C as Ai,S as Ps,H as $i,T as Di,a as Bi,b as Gi,c as Fi,d as Hi,e as Oi,D as Wi,P as Ui,O as Vi,f as Ki,g as qi,h as Xi,i as Yi,j as Zi,k as Ji,m as Qi,n as ed,A as td,o as rd,p as nd}from"./ui-vendor-CeKGesq3.js";import{r as c,R as ad,j as t,b as Br}from"./react-vendor-CgLzZcV4.js";import{u as sd,a as od,H as ga,P as Rt,b as ld,M as Is,R as id,i as dd,C as cd,B as hd,c as xa,g as zs}from"./graph-vendor-DVPtkh3h.js";import"./terminal-vendor-B365Go3Z.js";import{M as ud,r as md,a as pd,b as fd}from"./markdown-vendor-BQJfKm05.js";const gd="modulepreload",xd=function(e){return"/"+e},ba={},qe=function(r,n,a){let o=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(u=>Promise.resolve(u).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),d=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=l(n.map(h=>{if(h=xd(h),h in ba)return;ba[h]=!0;const u=h.endsWith(".css"),m=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":gd,u||(f.as="script"),f.crossOrigin="",f.href=h,d&&f.setAttribute("nonce",d),document.head.appendChild(f),u)return new Promise((p,g)=>{f.addEventListener("load",p),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(l){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=l,window.dispatchEvent(i),!i.defaultPrevented)throw l}return o.then(l=>{for(const i of l||[])i.status==="rejected"&&s(i.reason);return r().catch(s)})};function Rs(e){var r,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(r=0;r<o;r++)e[r]&&(n=Rs(e[r]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Ms(){for(var e,r,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(r=Rs(e))&&(a&&(a+=" "),a+=r);return a}const bd=(e,r)=>{const n=new Array(e.length+r.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<r.length;a++)n[e.length+a]=r[a];return n},vd=(e,r)=>({classGroupId:e,validator:r}),_s=(e=new Map,r=null,n)=>({nextPart:e,validators:r,classGroupId:n}),Rr="-",va=[],kd="arbitrary..",wd=e=>{const r=jd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return yd(l);const i=l.split(Rr),d=i[0]===""&&i.length>1?1:0;return As(i,d,r)},getConflictingClassGroupIds:(l,i)=>{if(i){const d=a[l],h=n[l];return d?h?bd(h,d):d:h||va}return n[l]||va}}},As=(e,r,n)=>{if(e.length-r===0)return n.classGroupId;const o=e[r],s=n.nextPart.get(o);if(s){const h=As(e,r+1,s);if(h)return h}const l=n.validators;if(l===null)return;const i=r===0?e.join(Rr):e.slice(r).join(Rr),d=l.length;for(let h=0;h<d;h++){const u=l[h];if(u.validator(i))return u.classGroupId}},yd=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=e.slice(1,-1),n=r.indexOf(":"),a=r.slice(0,n);return a?kd+a:void 0})(),jd=e=>{const{theme:r,classGroups:n}=e;return Nd(n,r)},Nd=(e,r)=>{const n=_s();for(const a in e){const o=e[a];Un(o,n,a,r)}return n},Un=(e,r,n,a)=>{const o=e.length;for(let s=0;s<o;s++){const l=e[s];Cd(l,r,n,a)}},Cd=(e,r,n,a)=>{if(typeof e=="string"){Sd(e,r,n);return}if(typeof e=="function"){Td(e,r,n,a);return}Ed(e,r,n,a)},Sd=(e,r,n)=>{const a=e===""?r:$s(r,e);a.classGroupId=n},Td=(e,r,n,a)=>{if(Ld(e)){Un(e(a),r,n,a);return}r.validators===null&&(r.validators=[]),r.validators.push(vd(n,e))},Ed=(e,r,n,a)=>{const o=Object.entries(e),s=o.length;for(let l=0;l<s;l++){const[i,d]=o[l];Un(d,$s(r,i),n,a)}},$s=(e,r)=>{let n=e;const a=r.split(Rr),o=a.length;for(let s=0;s<o;s++){const l=a[s];let i=n.nextPart.get(l);i||(i=_s(),n.nextPart.set(l,i)),n=i}return n},Ld=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Pd=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,n=Object.create(null),a=Object.create(null);const o=(s,l)=>{n[s]=l,r++,r>e&&(r=0,a=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=a[s])!==void 0)return o(s,l),l},set(s,l){s in n?n[s]=l:o(s,l)}}},Nn="!",ka=":",Id=[],wa=(e,r,n,a,o)=>({modifiers:e,hasImportantModifier:r,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),zd=e=>{const{prefix:r,experimentalParseClassName:n}=e;let a=o=>{const s=[];let l=0,i=0,d=0,h;const u=o.length;for(let b=0;b<u;b++){const v=o[b];if(l===0&&i===0){if(v===ka){s.push(o.slice(d,b)),d=b+1;continue}if(v==="/"){h=b;continue}}v==="["?l++:v==="]"?l--:v==="("?i++:v===")"&&i--}const m=s.length===0?o:o.slice(d);let f=m,p=!1;m.endsWith(Nn)?(f=m.slice(0,-1),p=!0):m.startsWith(Nn)&&(f=m.slice(1),p=!0);const g=h&&h>d?h-d:void 0;return wa(s,p,f,g)};if(r){const o=r+ka,s=a;a=l=>l.startsWith(o)?s(l.slice(o.length)):wa(Id,!1,l,void 0,!0)}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},Rd=e=>{const r=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{r.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let s=0;s<n.length;s++){const l=n[s],i=l[0]==="[",d=r.has(l);i||d?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(l)):o.push(l)}return o.length>0&&(o.sort(),a.push(...o)),a}},Md=e=>({cache:Pd(e.cacheSize),parseClassName:zd(e),sortModifiers:Rd(e),postfixLookupClassGroupIds:_d(e),...wd(e)}),_d=e=>{const r=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let a=0;a<n.length;a++)r[n[a]]=!0;return r},Ad=/\s+/,$d=(e,r)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:l}=r,i=[],d=e.trim().split(Ad);let h="";for(let u=d.length-1;u>=0;u-=1){const m=d[u],{isExternal:f,modifiers:p,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:v}=n(m);if(f){h=m+(h.length>0?" "+h:h);continue}let x=!!v,y;if(x){const C=b.substring(0,v);y=a(C);const T=y&&l[y]?a(b):void 0;T&&T!==y&&(y=T,x=!1)}else y=a(b);if(!y){if(!x){h=m+(h.length>0?" "+h:h);continue}if(y=a(b),!y){h=m+(h.length>0?" "+h:h);continue}x=!1}const k=p.length===0?"":p.length===1?p[0]:s(p).join(":"),S=g?k+Nn:k,w=S+y;if(i.indexOf(w)>-1)continue;i.push(w);const N=o(y,x);for(let C=0;C<N.length;++C){const T=N[C];i.push(S+T)}h=m+(h.length>0?" "+h:h)}return h},Dd=(...e)=>{let r=0,n,a,o="";for(;r<e.length;)(n=e[r++])&&(a=Ds(n))&&(o&&(o+=" "),o+=a);return o},Ds=e=>{if(typeof e=="string")return e;let r,n="";for(let a=0;a<e.length;a++)e[a]&&(r=Ds(e[a]))&&(n&&(n+=" "),n+=r);return n},Bd=(e,...r)=>{let n,a,o,s;const l=d=>{const h=r.reduce((u,m)=>m(u),e());return n=Md(h),a=n.cache.get,o=n.cache.set,s=i,i(d)},i=d=>{const h=a(d);if(h)return h;const u=$d(d,n);return o(d,u),u};return s=l,(...d)=>s(Dd(...d))},Gd=[],Je=e=>{const r=n=>n[e]||Gd;return r.isThemeGetter=!0,r},Bs=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Gs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Fd=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Hd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Od=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Wd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ud=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wt=e=>Fd.test(e),Ee=e=>!!e&&!Number.isNaN(Number(e)),ut=e=>!!e&&Number.isInteger(Number(e)),sn=e=>e.endsWith("%")&&Ee(e.slice(0,-1)),ft=e=>Hd.test(e),Fs=()=>!0,Kd=e=>Od.test(e)&&!Wd.test(e),Vn=()=>!1,qd=e=>Ud.test(e),Xd=e=>Vd.test(e),Yd=e=>!ie(e)&&!he(e),Zd=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Jd=e=>Ct(e,Ws,Vn),ie=e=>Bs.test(e),Pt=e=>Ct(e,Us,Kd),ya=e=>Ct(e,oc,Ee),Qd=e=>Ct(e,Ks,Fs),ec=e=>Ct(e,Vs,Vn),ja=e=>Ct(e,Hs,Vn),tc=e=>Ct(e,Os,Xd),wr=e=>Ct(e,qs,qd),he=e=>Gs.test(e),ar=e=>Gt(e,Us),rc=e=>Gt(e,Vs),Na=e=>Gt(e,Hs),nc=e=>Gt(e,Ws),ac=e=>Gt(e,Os),yr=e=>Gt(e,qs,!0),sc=e=>Gt(e,Ks,!0),Ct=(e,r,n)=>{const a=Bs.exec(e);return a?a[1]?r(a[1]):n(a[2]):!1},Gt=(e,r,n=!1)=>{const a=Gs.exec(e);return a?a[1]?r(a[1]):n:!1},Hs=e=>e==="position"||e==="percentage",Os=e=>e==="image"||e==="url",Ws=e=>e==="length"||e==="size"||e==="bg-size",Us=e=>e==="length",oc=e=>e==="number",Vs=e=>e==="family-name",Ks=e=>e==="number"||e==="weight",qs=e=>e==="shadow",lc=()=>{const e=Je("color"),r=Je("font"),n=Je("text"),a=Je("font-weight"),o=Je("tracking"),s=Je("leading"),l=Je("breakpoint"),i=Je("container"),d=Je("spacing"),h=Je("radius"),u=Je("shadow"),m=Je("inset-shadow"),f=Je("text-shadow"),p=Je("drop-shadow"),g=Je("blur"),b=Je("perspective"),v=Je("aspect"),x=Je("ease"),y=Je("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...S(),he,ie],N=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],T=()=>[he,ie,d],P=()=>[wt,"full","auto",...T()],K=()=>[ut,"none","subgrid",he,ie],G=()=>["auto",{span:["full",ut,he,ie]},ut,he,ie],A=()=>[ut,"auto",he,ie],J=()=>["auto","min","max","fr",he,ie],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...T()],oe=()=>[wt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],_=()=>[wt,"screen","full","dvw","lvw","svw","min","max","fit",...T()],Y=()=>[wt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],z=()=>[e,he,ie],q=()=>[...S(),Na,ja,{position:[he,ie]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],E=()=>["auto","cover","contain",nc,Jd,{size:[he,ie]}],W=()=>[sn,ar,Pt],H=()=>["","none","full",h,he,ie],j=()=>["",Ee,ar,Pt],L=()=>["solid","dashed","dotted","double"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[Ee,sn,Na,ja],se=()=>["","none",g,he,ie],Q=()=>["none",Ee,he,ie],de=()=>["none",Ee,he,ie],re=()=>[Ee,he,ie],ue=()=>[wt,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ft],breakpoint:[ft],color:[Fs],container:[ft],"drop-shadow":[ft],ease:["in","out","in-out"],font:[Yd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ft],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ft],shadow:[ft],spacing:["px",Ee],text:[ft],"text-shadow":[ft],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wt,ie,he,v]}],container:["container"],"container-type":[{"@container":["","normal","size",he,ie]}],"container-named":[Zd],columns:[{columns:[Ee,ie,he,i]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[ut,"auto",he,ie]}],basis:[{basis:[wt,"full","auto",i,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ee,wt,"auto","initial","none",ie]}],grow:[{grow:["",Ee,he,ie]}],shrink:[{shrink:["",Ee,he,ie]}],order:[{order:[ut,"first","last","none",he,ie]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],"inline-size":[{inline:["auto",..._()]}],"min-inline-size":[{"min-inline":["auto",..._()]}],"max-inline-size":[{"max-inline":["none",..._()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[i,"screen",...oe()]}],"min-w":[{"min-w":[i,"screen","none",...oe()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[l]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh",...oe()]}],"font-size":[{text:["base",n,ar,Pt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,sc,Qd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",sn,ie]}],"font-family":[{font:[rc,ec,r]}],"font-features":[{"font-features":[ie]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,he,ie]}],"line-clamp":[{"line-clamp":[Ee,"none",he,ya]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",he,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ee,"from-font","auto",he,Pt]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ee,"auto",he,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"tab-size":[{tab:[ut,he,ie]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ut,he,ie],radial:["",he,ie],conic:[ut,he,ie]},ac,tc]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:j()}],"border-w-x":[{"border-x":j()}],"border-w-y":[{"border-y":j()}],"border-w-s":[{"border-s":j()}],"border-w-e":[{"border-e":j()}],"border-w-bs":[{"border-bs":j()}],"border-w-be":[{"border-be":j()}],"border-w-t":[{"border-t":j()}],"border-w-r":[{"border-r":j()}],"border-w-b":[{"border-b":j()}],"border-w-l":[{"border-l":j()}],"divide-x":[{"divide-x":j()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":j()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...L(),"hidden","none"]}],"divide-style":[{divide:[...L(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...L(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ee,he,ie]}],"outline-w":[{outline:["",Ee,ar,Pt]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,yr,wr]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",m,yr,wr]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ee,Pt]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":j()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,yr,wr]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ee,he,ie]}],"mix-blend":[{"mix-blend":[...U(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":U()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ee]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[he,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Ee]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,ie]}],filter:[{filter:["","none",he,ie]}],blur:[{blur:se()}],brightness:[{brightness:[Ee,he,ie]}],contrast:[{contrast:[Ee,he,ie]}],"drop-shadow":[{"drop-shadow":["","none",p,yr,wr]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ee,he,ie]}],"hue-rotate":[{"hue-rotate":[Ee,he,ie]}],invert:[{invert:["",Ee,he,ie]}],saturate:[{saturate:[Ee,he,ie]}],sepia:[{sepia:["",Ee,he,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",he,ie]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[Ee,he,ie]}],"backdrop-contrast":[{"backdrop-contrast":[Ee,he,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ee,he,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ee,he,ie]}],"backdrop-invert":[{"backdrop-invert":["",Ee,he,ie]}],"backdrop-opacity":[{"backdrop-opacity":[Ee,he,ie]}],"backdrop-saturate":[{"backdrop-saturate":[Ee,he,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",Ee,he,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ee,"initial",he,ie]}],ease:[{ease:["linear","initial",x,he,ie]}],delay:[{delay:[Ee,he,ie]}],animate:[{animate:["none",y,he,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,he,ie]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:Q()}],"rotate-x":[{"rotate-x":Q()}],"rotate-y":[{"rotate-y":Q()}],"rotate-z":[{"rotate-z":Q()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[he,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],zoom:[{zoom:[ut,he,ie]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,ie]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ee,ar,Pt,ya]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ic=Bd(lc),Ca=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Sa=Ms,fr=(e,r)=>n=>{var a;if((r==null?void 0:r.variants)==null)return Sa(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=r,l=Object.keys(o).map(h=>{const u=n==null?void 0:n[h],m=s==null?void 0:s[h];if(u===null)return null;const f=Ca(u)||Ca(m);return o[h][f]}),i=n&&Object.entries(n).reduce((h,u)=>{let[m,f]=u;return f===void 0||(h[m]=f),h},{}),d=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((h,u)=>{let{class:m,className:f,...p}=u;return Object.entries(p).every(g=>{let[b,v]=g;return Array.isArray(v)?v.includes({...s,...i}[b]):{...s,...i}[b]===v})?[...h,m,f]:h},[]);return Sa(e,l,d,n==null?void 0:n.class,n==null?void 0:n.className)},Gr=c.createContext(null);Gr.displayName="PanelGroupContext";const Ue={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Kn=10,At=c.useLayoutEffect,Ta=ad.useId,dc=typeof Ta=="function"?Ta:()=>null;let cc=0;function qn(e=null){const r=dc(),n=c.useRef(e||r||null);return n.current===null&&(n.current=""+cc++),e??n.current}function Xs({children:e,className:r="",collapsedSize:n,collapsible:a,defaultSize:o,forwardedRef:s,id:l,maxSize:i,minSize:d,onCollapse:h,onExpand:u,onResize:m,order:f,style:p,tagName:g="div",...b}){const v=c.useContext(Gr);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:y,getPanelSize:k,getPanelStyle:S,groupId:w,isPanelCollapsed:N,reevaluatePanelConstraints:C,registerPanel:T,resizePanel:P,unregisterPanel:K}=v,G=qn(l),A=c.useRef({callbacks:{onCollapse:h,onExpand:u,onResize:m},constraints:{collapsedSize:n,collapsible:a,defaultSize:o,maxSize:i,minSize:d},id:G,idIsFromProps:l!==void 0,order:f});c.useRef({didLogMissingDefaultSizeWarning:!1}),At(()=>{const{callbacks:Z,constraints:D}=A.current,te={...D};A.current.id=G,A.current.idIsFromProps=l!==void 0,A.current.order=f,Z.onCollapse=h,Z.onExpand=u,Z.onResize=m,D.collapsedSize=n,D.collapsible=a,D.defaultSize=o,D.maxSize=i,D.minSize=d,(te.collapsedSize!==D.collapsedSize||te.collapsible!==D.collapsible||te.maxSize!==D.maxSize||te.minSize!==D.minSize)&&C(A.current,te)}),At(()=>{const Z=A.current;return T(Z),()=>{K(Z)}},[f,G,T,K]),c.useImperativeHandle(s,()=>({collapse:()=>{x(A.current)},expand:Z=>{y(A.current,Z)},getId(){return G},getSize(){return k(A.current)},isCollapsed(){return N(A.current)},isExpanded(){return!N(A.current)},resize:Z=>{P(A.current,Z)}}),[x,y,k,N,G,P]);const J=S(A.current,o);return c.createElement(g,{...b,children:e,className:r,id:G,style:{...J,...p},[Ue.groupId]:w,[Ue.panel]:"",[Ue.panelCollapsible]:a||void 0,[Ue.panelId]:G,[Ue.panelSize]:parseFloat(""+J.flexGrow).toFixed(1)})}const Ys=c.forwardRef((e,r)=>c.createElement(Xs,{...e,forwardedRef:r}));Xs.displayName="Panel";Ys.displayName="forwardRef(Panel)";let Cn=null,Er=-1,jt=null;function hc(e,r,n){const a=(r&to)!==0,o=(r&ro)!==0,s=(r&no)!==0,l=(r&ao)!==0;if(r){if(a)return s?"se-resize":l?"ne-resize":"e-resize";if(o)return s?"sw-resize":l?"nw-resize":"w-resize";if(s)return"s-resize";if(l)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function uc(){jt!==null&&(document.head.removeChild(jt),Cn=null,jt=null,Er=-1)}function on(e,r,n){var a,o;const s=hc(e,r);if(Cn!==s){if(Cn=s,jt===null&&(jt=document.createElement("style"),document.head.appendChild(jt)),Er>=0){var l;(l=jt.sheet)===null||l===void 0||l.removeRule(Er)}Er=(a=(o=jt.sheet)===null||o===void 0?void 0:o.insertRule(`*{cursor: ${s} !important;}`))!==null&&a!==void 0?a:-1}}function Zs(e){return e.type==="keydown"}function Js(e){return e.type.startsWith("pointer")}function Qs(e){return e.type.startsWith("mouse")}function Fr(e){if(Js(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Qs(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function mc(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function pc(e,r,n){return e.x<r.x+r.width&&e.x+e.width>r.x&&e.y<r.y+r.height&&e.y+e.height>r.y}function fc(e,r){if(e===r)throw new Error("Cannot compare node with itself");const n={a:Pa(e),b:Pa(r)};let a;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),r=n.b.pop(),a=e;Se(a,"Stacking order can only be calculated for elements with a common ancestor");const o={a:La(Ea(n.a)),b:La(Ea(n.b))};if(o.a===o.b){const s=a.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let i=s.length;for(;i--;){const d=s[i];if(d===l.a)return 1;if(d===l.b)return-1}}return Math.sign(o.a-o.b)}const gc=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function xc(e){var r;const n=getComputedStyle((r=eo(e))!==null&&r!==void 0?r:e).display;return n==="flex"||n==="inline-flex"}function bc(e){const r=getComputedStyle(e);return!!(r.position==="fixed"||r.zIndex!=="auto"&&(r.position!=="static"||xc(e))||+r.opacity<1||"transform"in r&&r.transform!=="none"||"webkitTransform"in r&&r.webkitTransform!=="none"||"mixBlendMode"in r&&r.mixBlendMode!=="normal"||"filter"in r&&r.filter!=="none"||"webkitFilter"in r&&r.webkitFilter!=="none"||"isolation"in r&&r.isolation==="isolate"||gc.test(r.willChange)||r.webkitOverflowScrolling==="touch")}function Ea(e){let r=e.length;for(;r--;){const n=e[r];if(Se(n,"Missing node"),bc(n))return n}return null}function La(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Pa(e){const r=[];for(;e;)r.push(e),e=eo(e);return r}function eo(e){const{parentNode:r}=e;return r&&r instanceof ShadowRoot?r.host:r}const to=1,ro=2,no=4,ao=8,vc=mc()==="coarse";let ht=[],Jt=!1,Nt=new Map,Hr=new Map;const ur=new Set;function kc(e,r,n,a,o){var s;const{ownerDocument:l}=r,i={direction:n,element:r,hitAreaMargins:a,setResizeHandlerState:o},d=(s=Nt.get(l))!==null&&s!==void 0?s:0;return Nt.set(l,d+1),ur.add(i),Mr(),function(){var u;Hr.delete(e),ur.delete(i);const m=(u=Nt.get(l))!==null&&u!==void 0?u:1;if(Nt.set(l,m-1),Mr(),m===1&&Nt.delete(l),ht.includes(i)){const f=ht.indexOf(i);f>=0&&ht.splice(f,1),Or(),o("up",!0,null)}}}function wc(e){const{target:r}=e,{x:n,y:a}=Fr(e);Jt=!0,Xn({target:r,x:n,y:a}),Mr(),ht.length>0&&(_r("down",e),Or(),e.preventDefault(),so(r)||e.stopImmediatePropagation())}function ln(e){const{x:r,y:n}=Fr(e);if(Jt&&e.type!=="pointerleave"&&e.buttons===0&&(Jt=!1,_r("up",e)),!Jt){const{target:a}=e;Xn({target:a,x:r,y:n})}_r("move",e),Or(),ht.length>0&&e.preventDefault()}function dn(e){const{target:r}=e,{x:n,y:a}=Fr(e);Hr.clear(),Jt=!1,ht.length>0&&(e.preventDefault(),so(r)||e.stopImmediatePropagation()),_r("up",e),Xn({target:r,x:n,y:a}),Or(),Mr()}function so(e){let r=e;for(;r;){if(r.hasAttribute(Ue.resizeHandle))return!0;r=r.parentElement}return!1}function Xn({target:e,x:r,y:n}){ht.splice(0);let a=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(a=e),ur.forEach(o=>{const{element:s,hitAreaMargins:l}=o,i=s.getBoundingClientRect(),{bottom:d,left:h,right:u,top:m}=i,f=vc?l.coarse:l.fine;if(r>=h-f&&r<=u+f&&n>=m-f&&n<=d+f){if(a!==null&&document.contains(a)&&s!==a&&!s.contains(a)&&!a.contains(s)&&fc(a,s)>0){let g=a,b=!1;for(;g&&!g.contains(s);){if(pc(g.getBoundingClientRect(),i)){b=!0;break}g=g.parentElement}if(b)return}ht.push(o)}})}function cn(e,r){Hr.set(e,r)}function Or(){let e=!1,r=!1;ht.forEach(a=>{const{direction:o}=a;o==="horizontal"?e=!0:r=!0});let n=0;Hr.forEach(a=>{n|=a}),e&&r?on("intersection",n):e?on("horizontal",n):r?on("vertical",n):uc()}let hn;function Mr(){var e;(e=hn)===null||e===void 0||e.abort(),hn=new AbortController;const r={capture:!0,signal:hn.signal};ur.size&&(Jt?(ht.length>0&&Nt.forEach((n,a)=>{const{body:o}=a;n>0&&(o.addEventListener("contextmenu",dn,r),o.addEventListener("pointerleave",ln,r),o.addEventListener("pointermove",ln,r))}),Nt.forEach((n,a)=>{const{body:o}=a;o.addEventListener("pointerup",dn,r),o.addEventListener("pointercancel",dn,r)})):Nt.forEach((n,a)=>{const{body:o}=a;n>0&&(o.addEventListener("pointerdown",wc,r),o.addEventListener("pointermove",ln,r))}))}function _r(e,r){ur.forEach(n=>{const{setResizeHandlerState:a}=n,o=ht.includes(n);a(e,o,r)})}function yc(){const[e,r]=c.useState(0);return c.useCallback(()=>r(n=>n+1),[])}function Se(e,r){if(!e)throw console.error(r),Error(r)}function Bt(e,r,n=Kn){return e.toFixed(n)===r.toFixed(n)?0:e>r?1:-1}function gt(e,r,n=Kn){return Bt(e,r,n)===0}function dt(e,r,n){return Bt(e,r,n)===0}function jc(e,r,n){if(e.length!==r.length)return!1;for(let a=0;a<e.length;a++){const o=e[a],s=r[a];if(!dt(o,s,n))return!1}return!0}function Yt({panelConstraints:e,panelIndex:r,size:n}){const a=e[r];Se(a!=null,`Panel constraints not found for index ${r}`);let{collapsedSize:o=0,collapsible:s,maxSize:l=100,minSize:i=0}=a;if(Bt(n,i)<0)if(s){const d=(o+i)/2;Bt(n,d)<0?n=o:n=i}else n=i;return n=Math.min(l,n),n=parseFloat(n.toFixed(Kn)),n}function ir({delta:e,initialLayout:r,panelConstraints:n,pivotIndices:a,prevLayout:o,trigger:s}){if(dt(e,0))return r;const l=[...r],[i,d]=a;Se(i!=null,"Invalid first pivot index"),Se(d!=null,"Invalid second pivot index");let h=0;if(s==="keyboard"){{const m=e<0?d:i,f=n[m];Se(f,`Panel constraints not found for index ${m}`);const{collapsedSize:p=0,collapsible:g,minSize:b=0}=f;if(g){const v=r[m];if(Se(v!=null,`Previous layout not found for panel index ${m}`),dt(v,p)){const x=b-v;Bt(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const m=e<0?i:d,f=n[m];Se(f,`No panel constraints found for index ${m}`);const{collapsedSize:p=0,collapsible:g,minSize:b=0}=f;if(g){const v=r[m];if(Se(v!=null,`Previous layout not found for panel index ${m}`),dt(v,b)){const x=v-p;Bt(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const m=e<0?1:-1;let f=e<0?d:i,p=0;for(;;){const b=r[f];Se(b!=null,`Previous layout not found for panel index ${f}`);const x=Yt({panelConstraints:n,panelIndex:f,size:100})-b;if(p+=x,f+=m,f<0||f>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-g:g}{let f=e<0?i:d;for(;f>=0&&f<n.length;){const p=Math.abs(e)-Math.abs(h),g=r[f];Se(g!=null,`Previous layout not found for panel index ${f}`);const b=g-p,v=Yt({panelConstraints:n,panelIndex:f,size:b});if(!dt(g,v)&&(h+=g-v,l[f]=v,h.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(jc(o,l))return o;{const m=e<0?d:i,f=r[m];Se(f!=null,`Previous layout not found for panel index ${m}`);const p=f+h,g=Yt({panelConstraints:n,panelIndex:m,size:p});if(l[m]=g,!dt(g,p)){let b=p-g,x=e<0?d:i;for(;x>=0&&x<n.length;){const y=l[x];Se(y!=null,`Previous layout not found for panel index ${x}`);const k=y+b,S=Yt({panelConstraints:n,panelIndex:x,size:k});if(dt(y,S)||(b-=S-y,l[x]=S),dt(b,0))break;e>0?x--:x++}}}const u=l.reduce((m,f)=>f+m,0);return dt(u,100)?l:o}function Nc({layout:e,panelsArray:r,pivotIndices:n}){let a=0,o=100,s=0,l=0;const i=n[0];Se(i!=null,"No pivot index found"),r.forEach((m,f)=>{const{constraints:p}=m,{maxSize:g=100,minSize:b=0}=p;f===i?(a=b,o=g):(s+=b,l+=g)});const d=Math.min(o,100-s),h=Math.max(a,100-l),u=e[i];return{valueMax:d,valueMin:h,valueNow:u}}function mr(e,r=document){return Array.from(r.querySelectorAll(`[${Ue.resizeHandleId}][data-panel-group-id="${e}"]`))}function oo(e,r,n=document){const o=mr(e,n).findIndex(s=>s.getAttribute(Ue.resizeHandleId)===r);return o??null}function lo(e,r,n){const a=oo(e,r,n);return a!=null?[a,a+1]:[-1,-1]}function Cc(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function io(e,r=document){if(Cc(r)&&r.dataset.panelGroupId==e)return r;const n=r.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function Wr(e,r=document){const n=r.querySelector(`[${Ue.resizeHandleId}="${e}"]`);return n||null}function Sc(e,r,n,a=document){var o,s,l,i;const d=Wr(r,a),h=mr(e,a),u=d?h.indexOf(d):-1,m=(o=(s=n[u])===null||s===void 0?void 0:s.id)!==null&&o!==void 0?o:null,f=(l=(i=n[u+1])===null||i===void 0?void 0:i.id)!==null&&l!==void 0?l:null;return[m,f]}function Tc({committedValuesRef:e,eagerValuesRef:r,groupId:n,layout:a,panelDataArray:o,panelGroupElement:s,setLayout:l}){c.useRef({didWarnAboutMissingResizeHandle:!1}),At(()=>{if(!s)return;const i=mr(n,s);for(let d=0;d<o.length-1;d++){const{valueMax:h,valueMin:u,valueNow:m}=Nc({layout:a,panelsArray:o,pivotIndices:[d,d+1]}),f=i[d];if(f!=null){const p=o[d];Se(p,`No panel data found for index "${d}"`),f.setAttribute("aria-controls",p.id),f.setAttribute("aria-valuemax",""+Math.round(h)),f.setAttribute("aria-valuemin",""+Math.round(u)),f.setAttribute("aria-valuenow",m!=null?""+Math.round(m):"")}}return()=>{i.forEach((d,h)=>{d.removeAttribute("aria-controls"),d.removeAttribute("aria-valuemax"),d.removeAttribute("aria-valuemin"),d.removeAttribute("aria-valuenow")})}},[n,a,o,s]),c.useEffect(()=>{if(!s)return;const i=r.current;Se(i,"Eager values not found");const{panelDataArray:d}=i,h=io(n,s);Se(h!=null,`No group found for id "${n}"`);const u=mr(n,s);Se(u,`No resize handles found for group id "${n}"`);const m=u.map(f=>{const p=f.getAttribute(Ue.resizeHandleId);Se(p,"Resize handle element has no handle id attribute");const[g,b]=Sc(n,p,d,s);if(g==null||b==null)return()=>{};const v=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const y=d.findIndex(k=>k.id===g);if(y>=0){const k=d[y];Se(k,`No panel data found for index ${y}`);const S=a[y],{collapsedSize:w=0,collapsible:N,minSize:C=0}=k.constraints;if(S!=null&&N){const T=ir({delta:dt(S,w)?C-w:w-S,initialLayout:a,panelConstraints:d.map(P=>P.constraints),pivotIndices:lo(n,p,s),prevLayout:a,trigger:"keyboard"});a!==T&&l(T)}}break}}};return f.addEventListener("keydown",v),()=>{f.removeEventListener("keydown",v)}});return()=>{m.forEach(f=>f())}},[s,e,r,n,a,o,l])}function Ia(e,r){if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0}function co(e,r){const n=e==="horizontal",{x:a,y:o}=Fr(r);return n?a:o}function Ec(e,r,n,a,o){const s=n==="horizontal",l=Wr(r,o);Se(l,`No resize handle element found for id "${r}"`);const i=l.getAttribute(Ue.groupId);Se(i,"Resize handle element has no group id attribute");let{initialCursorPosition:d}=a;const h=co(n,e),u=io(i,o);Se(u,`No group element found for id "${i}"`);const m=u.getBoundingClientRect(),f=s?m.width:m.height;return(h-d)/f*100}function Lc(e,r,n,a,o,s){if(Zs(e)){const l=n==="horizontal";let i=0;e.shiftKey?i=100:o!=null?i=o:i=10;let d=0;switch(e.key){case"ArrowDown":d=l?0:i;break;case"ArrowLeft":d=l?-i:0;break;case"ArrowRight":d=l?i:0;break;case"ArrowUp":d=l?0:-i;break;case"End":d=100;break;case"Home":d=-100;break}return d}else return a==null?0:Ec(e,r,n,a,s)}function Pc({panelDataArray:e}){const r=Array(e.length),n=e.map(s=>s.constraints);let a=0,o=100;for(let s=0;s<e.length;s++){const l=n[s];Se(l,`Panel constraints not found for index ${s}`);const{defaultSize:i}=l;i!=null&&(a++,r[s]=i,o-=i)}for(let s=0;s<e.length;s++){const l=n[s];Se(l,`Panel constraints not found for index ${s}`);const{defaultSize:i}=l;if(i!=null)continue;const d=e.length-a,h=o/d;a++,r[s]=h,o-=h}return r}function Ut(e,r,n){r.forEach((a,o)=>{const s=e[o];Se(s,`Panel data not found for index ${o}`);const{callbacks:l,constraints:i,id:d}=s,{collapsedSize:h=0,collapsible:u}=i,m=n[d];if(m==null||a!==m){n[d]=a;const{onCollapse:f,onExpand:p,onResize:g}=l;g&&g(a,m),u&&(f||p)&&(p&&(m==null||gt(m,h))&&!gt(a,h)&&p(),f&&(m==null||!gt(m,h))&>(a,h)&&f())}})}function jr(e,r){if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=r[n])return!1;return!0}function Ic({defaultSize:e,dragState:r,layout:n,panelData:a,panelIndex:o,precision:s=3}){const l=n[o];let i;return l==null?i=e!=null?e.toFixed(s):"1":a.length===1?i="1":i=l.toFixed(s),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:r!==null?"none":void 0}}function zc(e,r=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},r)}}function za(e){try{if(typeof localStorage<"u")e.getItem=r=>localStorage.getItem(r),e.setItem=(r,n)=>{localStorage.setItem(r,n)};else throw new Error("localStorage not supported in this environment")}catch(r){console.error(r),e.getItem=()=>null,e.setItem=()=>{}}}function ho(e){return`react-resizable-panels:${e}`}function uo(e){return e.map(r=>{const{constraints:n,id:a,idIsFromProps:o,order:s}=r;return o?a:s?`${s}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((r,n)=>r.localeCompare(n)).join(",")}function mo(e,r){try{const n=ho(e),a=r.getItem(n);if(a){const o=JSON.parse(a);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Rc(e,r,n){var a,o;const s=(a=mo(e,n))!==null&&a!==void 0?a:{},l=uo(r);return(o=s[l])!==null&&o!==void 0?o:null}function Mc(e,r,n,a,o){var s;const l=ho(e),i=uo(r),d=(s=mo(e,o))!==null&&s!==void 0?s:{};d[i]={expandToSizes:Object.fromEntries(n.entries()),layout:a};try{o.setItem(l,JSON.stringify(d))}catch(h){console.error(h)}}function Ra({layout:e,panelConstraints:r}){const n=[...e],a=n.reduce((s,l)=>s+l,0);if(n.length!==r.length)throw Error(`Invalid ${r.length} panel layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!dt(a,100)&&n.length>0)for(let s=0;s<r.length;s++){const l=n[s];Se(l!=null,`No layout data found for index ${s}`);const i=100/a*l;n[s]=i}let o=0;for(let s=0;s<r.length;s++){const l=n[s];Se(l!=null,`No layout data found for index ${s}`);const i=Yt({panelConstraints:r,panelIndex:s,size:l});l!=i&&(o+=l-i,n[s]=i)}if(!dt(o,0))for(let s=0;s<r.length;s++){const l=n[s];Se(l!=null,`No layout data found for index ${s}`);const i=l+o,d=Yt({panelConstraints:r,panelIndex:s,size:i});if(l!==d&&(o-=d-l,n[s]=d,dt(o,0)))break}return n}const _c=100,dr={getItem:e=>(za(dr),dr.getItem(e)),setItem:(e,r)=>{za(dr),dr.setItem(e,r)}},Ma={};function po({autoSaveId:e=null,children:r,className:n="",direction:a,forwardedRef:o,id:s=null,onLayout:l=null,keyboardResizeBy:i=null,storage:d=dr,style:h,tagName:u="div",...m}){const f=qn(s),p=c.useRef(null),[g,b]=c.useState(null),[v,x]=c.useState([]),y=yc(),k=c.useRef({}),S=c.useRef(new Map),w=c.useRef(0),N=c.useRef({autoSaveId:e,direction:a,dragState:g,id:f,keyboardResizeBy:i,onLayout:l,storage:d}),C=c.useRef({layout:v,panelDataArray:[],panelDataArrayChanged:!1});c.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),c.useImperativeHandle(o,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:E}=C.current;return E},setLayout:E=>{const{onLayout:W}=N.current,{layout:H,panelDataArray:j}=C.current,L=Ra({layout:E,panelConstraints:j.map(U=>U.constraints)});Ia(H,L)||(x(L),C.current.layout=L,W&&W(L),Ut(j,L,k.current))}}),[]),At(()=>{N.current.autoSaveId=e,N.current.direction=a,N.current.dragState=g,N.current.id=f,N.current.onLayout=l,N.current.storage=d}),Tc({committedValuesRef:N,eagerValuesRef:C,groupId:f,layout:v,panelDataArray:C.current.panelDataArray,setLayout:x,panelGroupElement:p.current}),c.useEffect(()=>{const{panelDataArray:E}=C.current;if(e){if(v.length===0||v.length!==E.length)return;let W=Ma[e];W==null&&(W=zc(Mc,_c),Ma[e]=W);const H=[...E],j=new Map(S.current);W(e,H,j,v,d)}},[e,v,d]),c.useEffect(()=>{});const T=c.useCallback(E=>{const{onLayout:W}=N.current,{layout:H,panelDataArray:j}=C.current;if(E.constraints.collapsible){const L=j.map(Q=>Q.constraints),{collapsedSize:U=0,panelSize:X,pivotIndices:se}=It(j,E,H);if(Se(X!=null,`Panel size not found for panel "${E.id}"`),!gt(X,U)){S.current.set(E.id,X);const de=Kt(j,E)===j.length-1?X-U:U-X,re=ir({delta:de,initialLayout:H,panelConstraints:L,pivotIndices:se,prevLayout:H,trigger:"imperative-api"});jr(H,re)||(x(re),C.current.layout=re,W&&W(re),Ut(j,re,k.current))}}},[]),P=c.useCallback((E,W)=>{const{onLayout:H}=N.current,{layout:j,panelDataArray:L}=C.current;if(E.constraints.collapsible){const U=L.map(ue=>ue.constraints),{collapsedSize:X=0,panelSize:se=0,minSize:Q=0,pivotIndices:de}=It(L,E,j),re=W??Q;if(gt(se,X)){const ue=S.current.get(E.id),be=ue!=null&&ue>=re?ue:re,Pe=Kt(L,E)===L.length-1?se-be:be-se,le=ir({delta:Pe,initialLayout:j,panelConstraints:U,pivotIndices:de,prevLayout:j,trigger:"imperative-api"});jr(j,le)||(x(le),C.current.layout=le,H&&H(le),Ut(L,le,k.current))}}},[]),K=c.useCallback(E=>{const{layout:W,panelDataArray:H}=C.current,{panelSize:j}=It(H,E,W);return Se(j!=null,`Panel size not found for panel "${E.id}"`),j},[]),G=c.useCallback((E,W)=>{const{panelDataArray:H}=C.current,j=Kt(H,E);return Ic({defaultSize:W,dragState:g,layout:v,panelData:H,panelIndex:j})},[g,v]),A=c.useCallback(E=>{const{layout:W,panelDataArray:H}=C.current,{collapsedSize:j=0,collapsible:L,panelSize:U}=It(H,E,W);return Se(U!=null,`Panel size not found for panel "${E.id}"`),L===!0&>(U,j)},[]),J=c.useCallback(E=>{const{layout:W,panelDataArray:H}=C.current,{collapsedSize:j=0,collapsible:L,panelSize:U}=It(H,E,W);return Se(U!=null,`Panel size not found for panel "${E.id}"`),!L||Bt(U,j)>0},[]),Z=c.useCallback(E=>{const{panelDataArray:W}=C.current;W.push(E),W.sort((H,j)=>{const L=H.order,U=j.order;return L==null&&U==null?0:L==null?-1:U==null?1:L-U}),C.current.panelDataArrayChanged=!0,y()},[y]);At(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;const{autoSaveId:E,onLayout:W,storage:H}=N.current,{layout:j,panelDataArray:L}=C.current;let U=null;if(E){const se=Rc(E,L,H);se&&(S.current=new Map(Object.entries(se.expandToSizes)),U=se.layout)}U==null&&(U=Pc({panelDataArray:L}));const X=Ra({layout:U,panelConstraints:L.map(se=>se.constraints)});Ia(j,X)||(x(X),C.current.layout=X,W&&W(X),Ut(L,X,k.current))}}),At(()=>{const E=C.current;return()=>{E.layout=[]}},[]);const D=c.useCallback(E=>{let W=!1;const H=p.current;return H&&window.getComputedStyle(H,null).getPropertyValue("direction")==="rtl"&&(W=!0),function(L){L.preventDefault();const U=p.current;if(!U)return()=>null;const{direction:X,dragState:se,id:Q,keyboardResizeBy:de,onLayout:re}=N.current,{layout:ue,panelDataArray:be}=C.current,{initialLayout:ve}=se??{},Pe=lo(Q,E,U);let le=Lc(L,E,X,se,de,U);const Ne=X==="horizontal";Ne&&W&&(le=-le);const we=be.map(xe=>xe.constraints),O=ir({delta:le,initialLayout:ve??ue,panelConstraints:we,pivotIndices:Pe,prevLayout:ue,trigger:Zs(L)?"keyboard":"mouse-or-touch"}),ce=!jr(ue,O);(Js(L)||Qs(L))&&w.current!=le&&(w.current=le,!ce&&le!==0?Ne?cn(E,le<0?to:ro):cn(E,le<0?no:ao):cn(E,0)),ce&&(x(O),C.current.layout=O,re&&re(O),Ut(be,O,k.current))}},[]),te=c.useCallback((E,W)=>{const{onLayout:H}=N.current,{layout:j,panelDataArray:L}=C.current,U=L.map(ue=>ue.constraints),{panelSize:X,pivotIndices:se}=It(L,E,j);Se(X!=null,`Panel size not found for panel "${E.id}"`);const de=Kt(L,E)===L.length-1?X-W:W-X,re=ir({delta:de,initialLayout:j,panelConstraints:U,pivotIndices:se,prevLayout:j,trigger:"imperative-api"});jr(j,re)||(x(re),C.current.layout=re,H&&H(re),Ut(L,re,k.current))},[]),oe=c.useCallback((E,W)=>{const{layout:H,panelDataArray:j}=C.current,{collapsedSize:L=0,collapsible:U}=W,{collapsedSize:X=0,collapsible:se,maxSize:Q=100,minSize:de=0}=E.constraints,{panelSize:re}=It(j,E,H);re!=null&&(U&&se&>(re,L)?gt(L,X)||te(E,X):re<de?te(E,de):re>Q&&te(E,Q))},[te]),_=c.useCallback((E,W)=>{const{direction:H}=N.current,{layout:j}=C.current;if(!p.current)return;const L=Wr(E,p.current);Se(L,`Drag handle element not found for id "${E}"`);const U=co(H,W);b({dragHandleId:E,dragHandleRect:L.getBoundingClientRect(),initialCursorPosition:U,initialLayout:j})},[]),Y=c.useCallback(()=>{b(null)},[]),z=c.useCallback(E=>{const{panelDataArray:W}=C.current,H=Kt(W,E);H>=0&&(W.splice(H,1),delete k.current[E.id],C.current.panelDataArrayChanged=!0,y())},[y]),q=c.useMemo(()=>({collapsePanel:T,direction:a,dragState:g,expandPanel:P,getPanelSize:K,getPanelStyle:G,groupId:f,isPanelCollapsed:A,isPanelExpanded:J,reevaluatePanelConstraints:oe,registerPanel:Z,registerResizeHandle:D,resizePanel:te,startDragging:_,stopDragging:Y,unregisterPanel:z,panelGroupElement:p.current}),[T,g,a,P,K,G,f,A,J,oe,Z,D,te,_,Y,z]),F={display:"flex",flexDirection:a==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return c.createElement(Gr.Provider,{value:q},c.createElement(u,{...m,children:r,className:n,id:s,ref:p,style:{...F,...h},[Ue.group]:"",[Ue.groupDirection]:a,[Ue.groupId]:f}))}const fo=c.forwardRef((e,r)=>c.createElement(po,{...e,forwardedRef:r}));po.displayName="PanelGroup";fo.displayName="forwardRef(PanelGroup)";function Kt(e,r){return e.findIndex(n=>n===r||n.id===r.id)}function It(e,r,n){const a=Kt(e,r),s=a===e.length-1?[a-1,a]:[a,a+1],l=n[a];return{...r.constraints,panelSize:l,pivotIndices:s}}function Ac({disabled:e,handleId:r,resizeHandler:n,panelGroupElement:a}){c.useEffect(()=>{if(e||n==null||a==null)return;const o=Wr(r,a);if(o==null)return;const s=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),n(l);break}case"F6":{l.preventDefault();const i=o.getAttribute(Ue.groupId);Se(i,`No group element found for id "${i}"`);const d=mr(i,a),h=oo(i,r,a);Se(h!==null,`No resize element found for id "${r}"`);const u=l.shiftKey?h>0?h-1:d.length-1:h+1<d.length?h+1:0;d[u].focus();break}}};return o.addEventListener("keydown",s),()=>{o.removeEventListener("keydown",s)}},[a,e,r,n])}function go({children:e=null,className:r="",disabled:n=!1,hitAreaMargins:a,id:o,onBlur:s,onClick:l,onDragging:i,onFocus:d,onPointerDown:h,onPointerUp:u,style:m={},tabIndex:f=0,tagName:p="div",...g}){var b,v;const x=c.useRef(null),y=c.useRef({onClick:l,onDragging:i,onPointerDown:h,onPointerUp:u});c.useEffect(()=>{y.current.onClick=l,y.current.onDragging=i,y.current.onPointerDown=h,y.current.onPointerUp=u});const k=c.useContext(Gr);if(k===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:S,groupId:w,registerResizeHandle:N,startDragging:C,stopDragging:T,panelGroupElement:P}=k,K=qn(o),[G,A]=c.useState("inactive"),[J,Z]=c.useState(!1),[D,te]=c.useState(null),oe=c.useRef({state:G});At(()=>{oe.current.state=G}),c.useEffect(()=>{if(n)te(null);else{const q=N(K);te(()=>q)}},[n,K,N]);const _=(b=a==null?void 0:a.coarse)!==null&&b!==void 0?b:15,Y=(v=a==null?void 0:a.fine)!==null&&v!==void 0?v:5;c.useEffect(()=>{if(n||D==null)return;const q=x.current;Se(q,"Element ref not attached");let F=!1;return kc(K,q,S,{coarse:_,fine:Y},(W,H,j)=>{if(!H){A("inactive");return}switch(W){case"down":{A("drag"),F=!1,Se(j,'Expected event to be defined for "down" action'),C(K,j);const{onDragging:L,onPointerDown:U}=y.current;L==null||L(!0),U==null||U();break}case"move":{const{state:L}=oe.current;F=!0,L!=="drag"&&A("hover"),Se(j,'Expected event to be defined for "move" action'),D(j);break}case"up":{A("hover"),T();const{onClick:L,onDragging:U,onPointerUp:X}=y.current;U==null||U(!1),X==null||X(),F||L==null||L();break}}})},[_,S,n,Y,N,K,D,C,T]),Ac({disabled:n,handleId:K,resizeHandler:D,panelGroupElement:P});const z={touchAction:"none",userSelect:"none"};return c.createElement(p,{...g,children:e,className:r,id:o,onBlur:()=>{Z(!1),s==null||s()},onFocus:()=>{Z(!0),d==null||d()},ref:x,role:"separator",style:{...z,...m},tabIndex:f,[Ue.groupDirection]:S,[Ue.groupId]:w,[Ue.resizeHandle]:"",[Ue.resizeHandleActive]:G==="drag"?"pointer":J?"keyboard":void 0,[Ue.resizeHandleEnabled]:!n,[Ue.resizeHandleId]:K,[Ue.resizeHandleState]:G})}go.displayName="PanelResizeHandle";var $c=Object.defineProperty,Dc=Object.getOwnPropertyNames,Be=(e,r)=>function(){return e&&(r=(0,e[Dc(e)[0]])(e=0)),r},Bc=(e,r)=>{for(var n in r)$c(e,n,{get:r[n],enumerable:!0})};function nt(...e){return ic(Ms(e))}var St=Be({"src/components/graph-ui/utils.ts"(){}});function pr({asChild:e=!1,className:r,size:n,variant:a,...o}){const s=e?Ps:"button";return t.jsx(s,{"data-slot":"button",className:nt(xo({variant:a,size:n,className:r})),...o})}var xo,Ur=Be({"src/components/graph-ui/Button.tsx"(){St(),xo=fr("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}})}});function bo(...e){return e.filter(Boolean).join(" ")}function Sn({className:e,...r}){return t.jsx(fo,{"data-slot":"resizable-panel-group",className:bo("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...r})}function Zt({...e}){return t.jsx(Ys,{"data-slot":"resizable-panel",...e})}function Tn({withHandle:e,className:r,...n}){return t.jsx(go,{"data-slot":"resizable-handle",className:bo("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden 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-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",r),...n,children:e?t.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:t.jsx(B.GripVerticalIcon,{className:"size-2.5"})}):null})}var vo=Be({"src/components/graph-workspace/GraphResizablePanels.tsx"(){}});function Yn(...e){return e.filter(Boolean).join(" ")}function gr({...e}){return t.jsx(Mi,{"data-slot":"accordion",...e})}function xr({className:e,...r}){return t.jsx(_i,{"data-slot":"accordion-item",className:Yn("border-b last:border-b-0",e),...r})}function Vr({className:e,children:r,...n}){return t.jsx($i,{className:"flex",children:t.jsxs(Di,{"data-slot":"accordion-trigger",className:Yn("flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium outline-none transition-all hover:underline disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...n,children:[r,t.jsx(B.ChevronDownIcon,{className:"pointer-events-none size-4 shrink-0 translate-y-0.5 text-[var(--theme-fg-muted)] transition-transform duration-200"})]})})}function br({className:e,children:r,...n}){return t.jsx(Ai,{"data-slot":"accordion-content",className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:t.jsx("div",{className:Yn("pb-4 pt-0",e),children:r})})}var vr=Be({"src/components/graph-workspace/GraphAccordion.tsx"(){}});function Gc(e){var n;const r=[];for(const a of e.turns)for(const o of a.items)o.kind==="artifact"&&o.artifact&&r.push(o.artifact);for(const a of((n=e.liveItems)==null?void 0:n.items)??[])a.kind==="artifact"&&a.artifact&&r.push(a.artifact);return r}function Fc(e){return e.trim().replace(/^\/+|\/+$/g,"").replace(/[^\w.-]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function kr(e){var r;return((r=e.split(".").pop())==null?void 0:r.toLowerCase())||""}function Hc(e){return e.split("/").filter(Boolean).at(-1)??e}function qt(e){const r=e.kind==="directory"?"directory":"file",n=(e.children??[]).map(qt);return{id:`workspace:${e.path}`,name:e.name,path:e.path,kind:r,...e.size!==void 0?{size:e.size}:{},...e.hasChildren!==void 0?{hasChildren:e.hasChildren}:r==="directory"?{hasChildren:n.length>0}:{},...e.childrenLoaded!==void 0?{childrenLoaded:e.childrenLoaded}:r==="directory"?{childrenLoaded:e.children!==void 0}:{},...e.truncated!==void 0?{truncated:e.truncated}:{},workspaceNode:e,children:n}}function ko(e,r,n,a={}){if(e.path===r)return{...e,children:n,hasChildren:n.length>0,childrenLoaded:!0,truncated:a.truncated??e.truncated};if(e.children.length===0)return e;let o=!1;const s=e.children.map(l=>{const i=ko(l,r,n,a);return i!==l&&(o=!0),i});return o?{...e,children:s}:e}function wo(e){if(e.kind==="file")return e;for(const r of e.children){const n=wo(r);if(n)return n}return null}function En(e,r){if(!e||r===null)return null;if(e.path===r)return e;for(const n of e.children){const a=En(n,r);if(a)return a}return null}function yo(e){return e.trim().replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/^\/+/,"")}function Oc(e){const n=yo(e).split("/").filter(Boolean);n.pop();const a=[];let o="";for(const s of n)o=o?`${o}/${s}`:s,a.push(o);return a}function Ln(e,r,n){if(e.path===r)return n;if(e.children.length===0)return e;let a=!1;const o=e.children.map(s=>{const l=Ln(s,r,n);return l!==s&&(a=!0),l});return a?{...e,children:o}:e}function Pn(e,r){return!e||!r?!1:e.path===r?!0:e.children.some(n=>Pn(n,r))}function Wc(e){if(!e)return null;const r=kr(e.path);return Zn.has(r)?{content:[e.content.endsWith(`
|
|
3
|
+
`)?e.content:`${e.content}
|
|
4
|
+
`],format:r==="extxyz"?"xyz":r,name:e.name,uuid:e.path}:null}function Uc(e){const r=kr(e);return r==="tsx"||r==="jsx"?"tsx":r==="yml"?"yaml":r||"text"}function Vc(e,r){let n=e,a="";for(const o of r){a=a?`${a}/${o}`:o;let s=n.children.find(l=>l.kind==="directory"&&l.name===o);s||(s={id:`dir:${a}`,name:o,path:a,kind:"directory",children:[]},n.children.push(s)),n=s}return n}function Kc(e,r,n){const a=r.split("/").filter(Boolean),o=a.pop()??n.name;Vc(e,a).children.push({...n,name:n.name||o,path:r})}function qc(e,r){return e.kind==="directory"&&r.kind!=="directory"?-1:e.kind!=="directory"&&r.kind==="directory"?1:e.name.localeCompare(r.name)}function jo(e){e.children.sort(qc);for(const r of e.children)jo(r);return e}function _a(e,r,n,a){var u;const o={id:"root",name:e.workspace.label??"Workspace",path:"",kind:"directory",children:[]},s={id:"artifacts",name:"artifacts",path:"artifacts",kind:"directory",children:[]};for(const m of r){const f=m.title||m.id,p=Fc(f)||m.id;s.children.push({id:`artifact:${m.id}`,name:`${p}.artifact`,path:`artifacts/${p}.artifact`,kind:"artifact",artifact:m,preview:m.summaryText??m.type,detail:JSON.stringify(m.payload,null,2),children:[]})}const l={id:"thread-events",name:"thread-events",path:"thread-events",kind:"directory",children:[]},i={id:"live",name:"live",path:"live",kind:"directory",children:[]};let d=0;const h=(m,f,p=!1)=>{d+=1;const g=f.kind.replace(/([A-Z])/g,"-$1").toLowerCase(),b=`${p?"live":`thread-events/${m}`}/${String(d).padStart(3,"0")}-${g}.json`,v="text"in f&&typeof f.text=="string"?f.text.slice(0,160):f.kind,x=f.kind==="artifact"&&f.artifact?f.artifact:null,y=x&&p?{id:`live-artifact:${x.id}`,name:x.title||x.id,path:b,kind:"live-artifact",artifact:x,item:f,preview:x.summaryText??x.type,detail:JSON.stringify(x.payload,null,2),children:[]}:{id:`event:${f.id}`,name:Hc(b),path:b,kind:"event",item:f,preview:v,detail:JSON.stringify(f,null,2),children:[]};if(p){i.children.push(y);return}Kc(l,b.replace(/^thread-events\//,""),y)};for(const m of e.turns)for(const f of m.items)(f.kind==="commandExecution"||f.kind==="webSearch"||f.kind==="fileRead"||f.kind==="fileChange"||f.kind==="agentToolCall"||f.kind==="skillToolCall"||f.kind==="toolCall"||f.kind==="hook"||f.kind==="plan"||f.kind==="reasoning")&&h(m.id,f);for(const m of((u=e.liveItems)==null?void 0:u.items)??[])h(e.thread.activeTurnId??"live",m,!0);return o.children.push(s,l,i),jo(o)}function Xc(e){const r=new Map,n=a=>{r.set(a.id,a);for(const o of a.children)n(o)};return n(e),r}function No(e){if(e.kind==="artifact"||e.kind==="live-artifact"||e.kind==="event"||e.kind==="file")return e;for(const r of e.children){const n=No(r);if(n)return n}return null}function Aa(e){const r=e.split("/").filter(Boolean),n=[];for(let a=1;a<=r.length;a+=1)n.push(r.slice(0,a).join("/"));return n}var Zn,Co,So,Jn=Be({"src/components/graph-workspace/workspaceTree.ts"(){Zn=new Set(["xyz","extxyz","cif","pdb"]),Co=new Set(["png","jpg","jpeg","gif","webp","svg"]),So=new Set(["pdf"])}});function Xt({label:e,children:r}){return t.jsxs("section",{className:"thread-workspace-card rounded-lg border p-3",children:[t.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.14em] text-[var(--theme-fg-muted)]",children:e}),t.jsx("div",{className:"mt-2 text-sm text-[var(--theme-fg)]",children:r})]})}var To=Be({"src/components/graph-workspace/GraphWorkspaceCards.tsx"(){}});function Yc({className:e,decorative:r=!0,orientation:n="horizontal",...a}){return t.jsx(rd,{"data-slot":"separator",decorative:r,orientation:n,className:nt("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...a})}var Zc=Be({"src/components/graph-ui/Separator.tsx"(){St()}});function Jc({className:e,orientation:r,...n}){return t.jsx("div",{role:"group","data-slot":"button-group","data-orientation":r,className:nt(Eo({orientation:r}),e),...n})}function Qc({className:e,orientation:r="vertical",...n}){return t.jsx(Yc,{"data-slot":"button-group-separator",orientation:r,className:nt("relative !m-0 self-stretch bg-input data-[orientation=vertical]:h-auto",e),...n})}var Eo,Lo=Be({"src/components/graph-ui/ButtonGroup.tsx"(){Zc(),St(),Eo=fr("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}})}});function eh({delayDuration:e=0,...r}){return t.jsx(nd,{"data-slot":"tooltip-provider",delayDuration:e,...r})}function th({...e}){return t.jsx(eh,{children:t.jsx(Zi,{"data-slot":"tooltip",...e})})}function rh({...e}){return t.jsx(Ji,{"data-slot":"tooltip-trigger",...e})}function nh({children:e,className:r,sideOffset:n=0,...a}){return t.jsx(Qi,{children:t.jsxs(ed,{"data-slot":"tooltip-content",sideOffset:n,className:nt("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md bg-foreground px-3 py-1.5 text-balance text-xs text-background animate-in fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",r),...a,children:[e,t.jsx(td,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}var ah=Be({"src/components/graph-ui/Tooltip.tsx"(){St()}});function sh(e){return(e==null?void 0:e.trim().replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""))||"molecule"}function $a(e,r){const n=new Blob([e],{type:"text/plain"}),a=URL.createObjectURL(n),o=document.createElement("a");o.href=a,o.download=r,o.click(),URL.revokeObjectURL(a)}function Ye({children:e,disabled:r,label:n,onClick:a}){return t.jsxs(th,{children:[t.jsx(rh,{asChild:!0,children:t.jsx(pr,{type:"button",variant:"outline",size:"icon",className:"thread-graph-molecule-button size-8",disabled:r,onClick:a,title:n,"aria-label":n,children:e})}),t.jsx(nh,{children:t.jsx("p",{children:n})})]})}function In({children:e,className:r=""}){return t.jsx(Jc,{className:`thread-graph-molecule-button-group ${r}`,children:e})}var Po=Be({"src/components/graph-workspace/GraphMoleculeViewerControls.tsx"(){Ur(),Lo(),ah()}});function oh({cameraInfo:e,onClearSelection:r,onClearStaged:n,onSendSelection:a,onSendStaged:o,onStageSelection:s,onToggleUnitCell:l,selectedAtomLabels:i,selectedSerials:d,stagedAtoms:h,stagedMolecules:u,unitCellAvailable:m,unitCellVisible:f}){const p=d.length>0,g=h>0;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex w-full justify-between gap-2 overflow-x-auto",children:[t.jsxs(In,{children:[t.jsx(Ye,{label:"Distance",children:t.jsx(B.AlignVerticalDistributeCenter,{className:"size-4"})}),t.jsx(Ye,{label:"Connectivity",children:t.jsx(B.Share2,{className:"size-4"})}),t.jsx(Ye,{label:"Angle",children:t.jsx(B.Waypoints,{className:"size-4"})}),t.jsx(Ye,{label:"Dihedral",children:t.jsx(B.Spline,{className:"size-4"})}),t.jsx(Ye,{label:"Add dummy atoms",children:t.jsx(B.Bubbles,{className:"size-4"})}),t.jsx(Ye,{label:"Delete atoms",children:t.jsx(B.CircleX,{className:"size-4"})}),t.jsx(Ye,{label:"Rotate",children:t.jsx(B.Rotate3d,{className:"size-4"})})]}),t.jsxs(In,{children:[t.jsx(Ye,{label:f?"Hide unit cell":"Show unit cell",disabled:!m,onClick:l,children:t.jsx(B.Boxes,{className:"size-4"})}),t.jsx(Ye,{label:"Clear selection",disabled:!p,onClick:r,children:t.jsx(B.Trash2,{className:"size-4"})}),t.jsx(Ye,{label:"Send selection",disabled:!p,onClick:a,children:t.jsx(B.Send,{className:"size-4"})}),t.jsx(Ye,{label:"Stage current selection",disabled:!p,onClick:s,children:t.jsx(B.Box,{className:"size-4"})}),t.jsx(Ye,{label:"Clear staged selections",disabled:!g,onClick:n,children:t.jsx(B.Eraser,{className:"size-4"})}),t.jsx(Ye,{label:"Send staged selections",disabled:!g,onClick:o,children:t.jsx(B.ArrowUpRight,{className:"size-4"})})]})]}),e?t.jsxs("div",{className:"thread-graph-molecule-camera",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"XYZ: "}),"x=",e.position.x.toFixed(1)," y=",e.position.y.toFixed(1)," z=",e.position.z.toFixed(1),t.jsx("br",{}),t.jsx("strong",{children:"Quat: "}),"qx=",e.position.qx.toFixed(2)," qy=",e.position.qy.toFixed(2)," qz=",e.position.qz.toFixed(2)," qw=",e.position.qw.toFixed(2)]}),t.jsx("div",{className:"thread-graph-molecule-camera-divider"}),t.jsxs("div",{className:"flex flex-col gap-1 text-[10px]",children:[t.jsxs("div",{children:["Selected atoms:"," ",d.length>0?d.map(b=>`${i[b]??"Atom"}(${b})`).join(", "):"None"]}),t.jsxs("div",{children:["Staged: ",u," molecule(s), ",h," atom(s)"]})]})]}):null]})}var lh=Be({"src/components/graph-workspace/GraphMoleculeViewerLowerButtonGroup.tsx"(){Po()}});function ih({currentIndex:e,exportContent:r,moleculeId:n,onScreenshot:a,viewerRef:o,xyzContent:s,xyzFormat:l}){const i=sh(n);async function d(){s&&await navigator.clipboard.writeText(s)}function h(){s&&$a(s,`${i}_step_${e+1}.${l||"xyz"}`)}function u(){r&&$a(r,`${i}_trajectory.${l||"xyz"}`)}function m(){o.current&&(o.current.zoom(1.2),o.current.render())}function f(){o.current&&(o.current.zoom(.8),o.current.render())}function p(){o.current&&(o.current.zoomTo(),o.current.setCameraParameters({}),o.current.render())}return t.jsxs(In,{className:"ml-auto justify-end",children:[t.jsx(Ye,{label:"Copy current structure",onClick:()=>void d(),disabled:!s,children:t.jsx(B.Copy,{className:"size-3.5"})}),t.jsx(Ye,{label:"Download current structure",onClick:h,disabled:!s,children:t.jsx(B.Download,{className:"size-3.5"})}),t.jsx(Ye,{label:"Download full trajectory",onClick:u,disabled:!r,children:t.jsx(B.Box,{className:"size-3.5"})}),t.jsx(Ye,{label:"Copy screenshot",onClick:a,disabled:!o.current||!s,children:t.jsx(B.Camera,{className:"size-3.5"})}),t.jsx(Qc,{className:"thread-graph-molecule-button-divider"}),t.jsx(Ye,{label:"Zoom in",onClick:m,disabled:!o.current||!s,children:t.jsx(B.ZoomIn,{className:"size-3.5"})}),t.jsx(Ye,{label:"Zoom out",onClick:f,disabled:!o.current||!s,children:t.jsx(B.ZoomOut,{className:"size-3.5"})}),t.jsx(Ye,{label:"Reset camera",onClick:p,disabled:!o.current||!s,children:t.jsx(B.RotateCcw,{className:"size-3.5"})})]})}var dh=Be({"src/components/graph-workspace/GraphMoleculeViewerUpperButtonGroup.tsx"(){Lo(),Po()}});async function ch(){if(typeof window>"u")throw new Error("3Dmol is only available in a browser environment.");return window["3Dmol"]?window["3Dmol"]:(Lr||(Lr=new Promise((e,r)=>{const n=document.querySelector('script[data-remote-codex-3dmol="true"]'),a=()=>{if(window["3Dmol"]){e(window["3Dmol"]);return}r(new Error("3Dmol loaded without exposing the expected global."))};if(n){n.addEventListener("load",a,{once:!0}),n.addEventListener("error",()=>r(new Error("Unable to load 3Dmol viewer runtime.")),{once:!0});return}const o=document.createElement("script");o.src="/vendor/3Dmol-min.js",o.async=!0,o.dataset.remoteCodex3dmol="true",o.addEventListener("load",a,{once:!0}),o.addEventListener("error",()=>r(new Error("Unable to load 3Dmol viewer runtime.")),{once:!0}),document.head.appendChild(o)})),Lr)}var Lr,hh=Be({"src/components/graph-workspace/load3Dmol.ts"(){Lr=null}});function uh({className:e,defaultValue:r,max:n=100,min:a=0,value:o,...s}){const l=c.useMemo(()=>Array.isArray(o)?o:Array.isArray(r)?r:[a,n],[r,n,a,o]);return t.jsxs(Ki,{"data-slot":"slider",...r!==void 0?{defaultValue:r}:{},...o!==void 0?{value:o}:{},min:a,max:n,className:nt("relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...s,children:[t.jsx(qi,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",children:t.jsx(Xi,{"data-slot":"slider-range",className:"absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})}),Array.from({length:l.length},(i,d)=>t.jsx(Yi,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50"},d))]})}var mh=Be({"src/components/graph-ui/Slider.tsx"(){St()}});function ph(e){const r=e==null?void 0:e.trim().toLowerCase();return!r||r==="extxyz"?"xyz":r}function fh(e){var o,s;const r=e.replace(/\r\n/g,`
|
|
5
|
+
`).replace(/\r/g,`
|
|
6
|
+
`).split(`
|
|
7
|
+
`),n=[];let a=0;for(;a<r.length;){for(;a<r.length&&((o=r[a])==null?void 0:o.trim())==="";)a+=1;if(a>=r.length)break;const l=Number.parseInt(((s=r[a])==null?void 0:s.trim())??"",10);if(!Number.isFinite(l)||l<0)return[e];const i=l+2;if(a+i>r.length)return[e];n.push(`${r.slice(a,a+i).join(`
|
|
8
|
+
`)}
|
|
9
|
+
`),a+=i}return n.length>0?n:[e]}function Da(e,r){return r!=="xyz"?e:e.flatMap(n=>fh(n))}function Ba(e){return e.map(r=>`${r.replace(/\s+$/g,"")}
|
|
10
|
+
`).join("")}function gh(e){if(!e)return{format:"xyz",frames:[],exportContent:""};if(typeof e=="string"){const o=Da([e],"xyz");return{frames:o,format:"xyz",exportContent:Ba(o)}}const r=ph(e.format),n=e.content.filter(o=>o.trim().length>0);return{frames:Da(n,r),format:r,exportContent:Ba(n)}}var xh=Be({"src/components/graph-workspace/GraphMoleculeViewerData.ts"(){}});function bh({className:e="",moleculeId:r=null,onScreenshot:n,onSelectionChange:a,source:o,title:s="PyMOL-style (PDB/CIF)"}){const l=c.useRef(null),i=c.useRef(null),d=c.useRef(null),h=c.useRef(!1),u=c.useRef(!0),[m,f]=c.useState(null),[p,g]=c.useState(0),[b,v]=c.useState(null),[x,y]=c.useState(!1),[k,S]=c.useState({}),[w,N]=c.useState([]),[C,T]=c.useState({}),[P,K]=c.useState(!1),[G,A]=c.useState(!1),[J,Z]=c.useState(null),D=c.useMemo(()=>gh(o),[o]),te=D.frames,oe=D.format,_=te[p]??null,Y=te.length>0&&p===te.length-1,z=r??"current",q=Object.values(C).reduce((j,L)=>j+L.length,0),F=Object.keys(C).length;c.useEffect(()=>{if(te.length===0){g(0);return}g(te.length-1)},[te.length]),c.useEffect(()=>{if(!x||te.length<=1)return;const j=window.setInterval(()=>{g(L=>L>=te.length-1?(window.clearInterval(j),y(!1),L):L+1)},200);return()=>window.clearInterval(j)},[x,te.length]),c.useEffect(()=>{const j=l.current;if(!j||i.current)return;let L=!1;try{const X=document.createElement("canvas");if(!(X.getContext("webgl2")||X.getContext("webgl")||X.getContext("experimental-webgl"))){Z("WebGL is unavailable in this browser environment. Unable to render 3D viewer.");return}}catch{Z("WebGL is unavailable in this browser environment. Unable to render 3D viewer.");return}const U=()=>{var X,se;(X=i.current)==null||X.resize(),(se=i.current)==null||se.render()};return ch().then(X=>{if(!(L||i.current))try{const se=X.createViewer(j,{});i.current=se,se.setBackgroundColor("#f8fafc",.8),window.addEventListener("resize",U),window.setTimeout(U,100)}catch(se){console.error("Failed to initialize 3Dmol viewer:",se),Z("Failed to initialize 3D viewer. Please refresh or try another browser.")}}).catch(X=>{console.error("Failed to load 3Dmol viewer runtime:",X),Z("Failed to load 3D viewer runtime. Please refresh or try another browser.")}),()=>{L=!0,window.removeEventListener("resize",U),i.current=null,d.current=null}},[]),c.useEffect(()=>{const j=i.current;if(!(!j||!_))try{j.removeAllModels(),j.removeAllShapes(),j.removeAllLabels();const L=j.addModel(_,oe||"xyz");d.current=L,L.setStyle({},{stick:{radius:.2},sphere:{scale:.3}});const U=L.getCrystData(),X=!!(U&&typeof U=="object"&&Object.keys(U).length);K(X),A(X?u.current:!1),N([]),S({});const se=_.split(`
|
|
11
|
+
`).slice(2).map(Q=>Q.trim()).filter(Boolean).map(Q=>Q.split(/\s+/)[0]??"Atom");h.current||(j.zoomTo(),h.current=!0),L.setClickable({},!0,(Q,de,re)=>{const ue=Q.serial??Q.index;if(ue===void 0)return;const be=Q.atom||Q.elem||se[ue]||"Atom";N(ve=>{const le=!!(re!=null&&re.shiftKey||re!=null&&re.metaKey||re!=null&&re.ctrlKey)?ve.includes(ue)?ve.filter(Ne=>Ne!==ue):[...ve,ue]:ve.length===1&&ve[0]===ue?[]:[ue];return S(Ne=>{if(le.length===0)return{};const we={};return le.forEach(O=>{we[O]=Ne[O]||se[O]||be}),we}),le})}),L.setHoverable({},!0,(Q,de,re)=>{!re||!Q||v({x:re.clientX,y:re.clientY,label:`${Q.atom||Q.elem||"Atom"} (${Q.serial??Q.index??"?"})`,coords:{x:Q.x.toFixed(2),y:Q.y.toFixed(2),z:Q.z.toFixed(2)}})},()=>v(null)),j.render()}catch(L){console.error("Failed to render molecule:",L),Z("Unable to render this molecular structure.")}},[_,oe]),c.useEffect(()=>{const j=i.current,L=d.current;if(!(!j||!L)){try{j.removeUnitCell(L)}catch{}if(G&&P)try{j.addUnitCell(L,{box:{color:"black",opacity:1,linewidth:5},astyle:{radius:.12,mid:.85,color:"red",opacity:.6},bstyle:{radius:.12,mid:.85,color:"green",opacity:.6},cstyle:{radius:.12,mid:.85,color:"blue",opacity:.6},alabel:"a",blabel:"b",clabel:"c"})}catch{K(!1),A(!1)}j.render()}},[P,G,_,oe]),c.useEffect(()=>{const j=i.current,L=d.current;!j||!L||!_||(L.setStyle({},{stick:{radius:.2},sphere:{scale:.3}}),w.length>0&&L.setStyle({serial:w},{stick:{radius:.3,color:"yellow"},sphere:{scale:.4,color:"yellow"}}),j.render(),a==null||a({moleculeId:r,atoms:w}))},[r,a,w,_]),c.useEffect(()=>{if(!_)return;let j=0;const L=()=>{var X,se;const U=(se=(X=i.current)==null?void 0:X.getView)==null?void 0:se.call(X);if(Array.isArray(U)&&U.length>=8){const[Q,de,re,ue,be,ve,Pe,le]=U;if(typeof Q=="number"&&typeof de=="number"&&typeof re=="number"&&typeof ue=="number"&&typeof be=="number"&&typeof ve=="number"&&typeof Pe=="number"&&typeof le=="number"){const Ne=Math.sqrt(be*be+ve*ve+Pe*Pe),we=Ne>0?{x:be/Ne,y:ve/Ne,z:Pe/Ne}:{x:0,y:0,z:0};f({position:{x:Q,y:de,z:re,qx:be,qy:ve,qz:Pe,qw:le},lookAt:we,zoom:ue})}}j=window.requestAnimationFrame(L)};return j=window.requestAnimationFrame(L),()=>window.cancelAnimationFrame(j)},[_]);const E=c.useCallback(async()=>{const j=i.current;if(!(j!=null&&j.pngURI))return;j.render();const L=j.pngURI();if(L){try{const X=await(await fetch(L)).blob(),se=new ClipboardItem({[X.type||"image/png"]:X});await navigator.clipboard.write([se])}catch{}n==null||n({moleculeId:r,image:L})}},[r,n]);function W(){P&&A(j=>{const L=!j;return u.current=L,L})}function H(){w.length!==0&&T(j=>{const L=j[z]??[];return{...j,[z]:Array.from(new Set([...L,...w]))}})}return t.jsxs("div",{className:`thread-graph-molecule-viewer flex h-full min-h-0 flex-col bg-white ${e}`,children:[t.jsxs("div",{className:"thread-graph-molecule-header flex shrink-0 items-center justify-between gap-3 border-b border-slate-200 px-3 py-2 sm:px-4 sm:py-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("h2",{className:"truncate text-sm font-semibold text-slate-900",children:s}),t.jsx("p",{className:"mt-1 hidden text-[11px] text-slate-400 sm:block",children:"cartoon + surface"})]}),t.jsx("span",{className:"shrink-0 text-[11px] text-slate-400",children:"workspace preview"})]}),t.jsxs("div",{className:"thread-graph-molecule-body min-h-0 flex-1",children:[t.jsxs("div",{ref:l,"data-testid":"molecule-viewer",className:"thread-graph-molecule-stage relative min-h-0 flex-1 overflow-hidden",children:[J?t.jsx("div",{"data-testid":"molecule-viewer-error",className:"thread-graph-molecule-error absolute inset-0 flex items-center justify-center bg-red-50 p-4 text-sm text-red-700",children:J}):null,!J&&!_?t.jsx("div",{className:"thread-graph-molecule-empty absolute inset-0 flex items-center justify-center p-4 text-sm text-slate-400",children:"No molecule data available."}):null,b?t.jsxs("div",{className:"thread-graph-molecule-tooltip pointer-events-none fixed z-[1000] rounded-md border border-gray-300 bg-white/95 px-2 py-1.5 text-[10px] text-gray-800 shadow-md",style:{left:b.x-20,top:b.y-50},children:[t.jsx("div",{className:"mb-0.5 font-semibold text-gray-900",children:b.label}),t.jsxs("div",{className:"space-x-2 text-gray-600",children:[t.jsxs("span",{children:["x: ",b.coords.x]}),t.jsxs("span",{children:["y: ",b.coords.y]}),t.jsxs("span",{children:["z: ",b.coords.z]})]})]}):null]}),t.jsxs("div",{className:"thread-graph-molecule-controls shrink-0",children:[t.jsxs("div",{className:"thread-graph-molecule-control-row",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"thread-graph-molecule-control-title",children:"Ball & Stick"}),t.jsx("p",{className:"thread-graph-molecule-control-subtitle",children:"XYZ / PDB / CIF preview"})]}),t.jsx(ih,{currentIndex:p,exportContent:D.exportContent,moleculeId:r,onScreenshot:()=>void E(),viewerRef:i,xyzContent:_,xyzFormat:oe})]}),te.length>1?t.jsxs("div",{className:"thread-graph-molecule-trajectory",children:[t.jsxs("div",{className:"mb-2 flex justify-between gap-3 text-xs",children:[t.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:["Trajectory ",p+1," / ",te.length,t.jsx(pr,{type:"button",variant:"ghost",size:"icon",className:"thread-graph-molecule-button h-5 w-5",onClick:()=>{y(j=>{const L=!j;return L&&p===te.length-1&&g(0),L})},"aria-label":x?"Pause trajectory":"Play trajectory",title:x?"Pause trajectory":"Play trajectory",children:x&&p!==te.length-1?t.jsx(B.Pause,{className:"h-3 w-3"}):t.jsx(B.Play,{className:"h-3 w-3"})})]}),t.jsxs(pr,{type:"button",variant:"ghost",onClick:()=>g(te.length-1),className:"thread-graph-molecule-live-button",children:[t.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${Y?"animate-pulse bg-red-600":"bg-gray-300"}`}),"Live"]})]}),t.jsx(uh,{value:[p],max:te.length-1,step:1,onValueChange:j=>g(j[0]??0),"aria-label":"Trajectory frame"})]}):null,t.jsx(oh,{cameraInfo:m,onClearSelection:()=>N([]),onClearStaged:()=>T({}),onSendSelection:()=>a==null?void 0:a({moleculeId:r,atoms:w}),onSendStaged:()=>{Object.entries(C).forEach(([j,L])=>{a==null||a({moleculeId:j==="current"?r:j,atoms:L})})},onStageSelection:H,onToggleUnitCell:W,selectedAtomLabels:k,selectedSerials:w,stagedAtoms:q,stagedMolecules:F,unitCellAvailable:P,unitCellVisible:G})]})]})]})}var vh=Be({"src/components/graph-workspace/GraphMoleculeViewer.tsx"(){lh(),dh(),hh(),Ur(),mh(),xh()}});function kh(e){return!e.truncated&&e.size<=Io&&e.content.split(`
|
|
12
|
+
`).length<=zo}function wh(e){return e&&(e.node.path||e.node.name)||null}function yh(e){if(!e)return null;switch(e.kind){case"live-artifact":return{kind:"live-molecule",node:e};case"file":return{kind:"workspace-file",node:e};case"artifact":return{kind:"artifact",node:e};case"event":return{kind:"event",node:e};case"meta":return{kind:"meta",node:e};case"directory":return null}}function jh({error:e,imageUrl:r,loadingMore:n,onSaveFile:a,onLoadMore:o,onCollapse:s,pdfUrl:l,previewFile:i,previewLoading:d,plugins:h,selectedTarget:u}){const[m,f]=c.useState(!1),[p,g]=c.useState(""),[b,v]=c.useState(null),[x,y]=c.useState(!1),k=(u==null?void 0:u.node)??null,S=k!=null&&k.artifact?h.renderArtifact({artifact:k.artifact,expanded:!0,onToggleExpanded:()=>{}}):null,w=Wc(i??null),N=(i==null?void 0:i.language)||Uc((i==null?void 0:i.path)??""),C=i?kr(i.path):"",T=wh(u),P=i!==null&&Zn.has(C),K=!!(i&&a)&&!P&&kh(i),G=(u==null?void 0:u.kind)==="live-molecule",A=!!(k!=null&&k.artifact&&S),J=!!w||A;c.useEffect(()=>{f(!1),g((i==null?void 0:i.content)??""),v(null)},[i==null?void 0:i.path,i==null?void 0:i.content]);async function Z(){if(!(!i||!a)){y(!0),v(null);try{await a({path:i.path,content:p}),f(!1)}catch(D){v(D instanceof Error?D.message:"Failed to save file.")}finally{y(!1)}}}return t.jsxs("section",{className:"thread-graph-viewer flex h-full min-h-0 flex-col overflow-hidden rounded-[12px]","data-preview-target-kind":(u==null?void 0:u.kind)??"none",children:[t.jsxs("div",{className:"thread-graph-viewer-header flex h-12 shrink-0 items-center justify-between gap-3 border-b px-3 sm:h-[60px] sm:px-5",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx("h2",{className:"text-base font-semibold text-slate-900 sm:text-[18px] dark:text-slate-100",children:"Viewer"}),T?t.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-slate-500 dark:text-slate-400",children:T}):null]}),s?t.jsx("button",{type:"button",onClick:s,"data-testid":"collapse-viewer",className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-slate-500 transition hover:bg-slate-100 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-[#222733] dark:hover:text-slate-100",title:"Collapse workspace","aria-label":"Collapse workspace",children:t.jsx(B.ChevronsRight,{className:"h-4 w-4"})}):null]}),t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[e?t.jsx("div",{className:"border-b border-rose-200 bg-rose-50 px-5 py-3 text-sm text-rose-700 dark:border-rose-400/25 dark:bg-rose-400/10 dark:text-rose-200",children:e}):null,u?u.kind==="workspace-file"&&d?t.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-5 text-center text-sm text-slate-400 dark:text-slate-500",children:"Loading file preview..."}):u.kind==="workspace-file"&&w?t.jsx("div",{className:"thread-graph-molecule-preview min-h-0 flex-1 overflow-hidden",children:t.jsx(bh,{source:w,moleculeId:w.uuid??u.node.path,title:"PyMOL-style (PDB/CIF)"})}):u.kind==="workspace-file"&&r?t.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-auto p-5",children:t.jsx("img",{src:r,alt:u.node.path||u.node.name,className:"max-h-full max-w-full object-contain"})}):u.kind==="workspace-file"&&l?t.jsx("div",{className:"thread-graph-file-preview-frame min-h-0 flex-1 overflow-hidden",children:t.jsx("iframe",{src:l,title:`PDF preview: ${u.node.path||u.node.name}`,className:"h-full w-full border-0"})}):u.kind==="workspace-file"&&i?t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[t.jsxs("div",{className:"thread-graph-file-preview-header flex min-h-12 items-center justify-between gap-3 border-b px-4 py-2",children:[t.jsxs("div",{className:"min-w-0 text-xs uppercase tracking-[0.12em]",children:[P?"molecule":N||C||"text"," |"," ",i.size.toLocaleString()," bytes",i.truncated?t.jsxs("span",{className:"ml-2 text-amber-500",children:["showing ",i.nextOffset.toLocaleString()," bytes"]}):null]}),K?t.jsx("div",{className:"flex shrink-0 items-center gap-1",children:m?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>{g(i.content),f(!1),v(null)},disabled:x,className:"thread-graph-explorer-icon-button flex h-8 w-8 items-center justify-center rounded-lg border shadow-none transition disabled:cursor-not-allowed disabled:opacity-50",title:"Cancel edits","aria-label":"Cancel edits",children:t.jsx(B.X,{className:"h-4 w-4"})}),t.jsx("button",{type:"button",onClick:()=>void Z(),disabled:x||p===i.content,className:"thread-graph-explorer-icon-button flex h-8 w-8 items-center justify-center rounded-lg border shadow-none transition disabled:cursor-not-allowed disabled:opacity-50",title:"Save file","aria-label":"Save file",children:t.jsx(B.Save,{className:"h-4 w-4"})})]}):t.jsx("button",{type:"button",onClick:()=>{g(i.content),f(!0),v(null)},className:"thread-graph-explorer-icon-button flex h-8 w-8 items-center justify-center rounded-lg border shadow-none transition",title:"Edit file","aria-label":"Edit file",children:t.jsx(B.Pencil,{className:"h-4 w-4"})})}):null]}),b?t.jsx("div",{className:"border-b border-rose-200 bg-rose-50 px-4 py-2 text-sm text-rose-700 dark:border-rose-400/25 dark:bg-rose-400/10 dark:text-rose-200",children:b}):null,m?t.jsx("textarea",{value:p,onChange:D=>g(D.currentTarget.value),spellCheck:!1,"aria-label":"Workspace file editor",className:"thread-graph-file-editor min-h-0 flex-1 resize-none border-0 bg-transparent p-4 font-mono text-[12px] leading-5 text-slate-900 outline-none dark:text-slate-100"}):t.jsx(Pr,{content:i.content}),i.truncated&&o?t.jsx("div",{className:"thread-graph-file-preview-footer flex justify-center border-t px-4 py-3",children:t.jsx("button",{type:"button",onClick:o,disabled:n,title:"Load more workspace preview","aria-label":"Load more workspace preview",className:"thread-graph-load-more-button rounded-md px-4 py-1.5 text-xs disabled:opacity-50",children:n?"Loading...":`Load more (${(i.size-i.nextOffset).toLocaleString()} bytes remaining)`})}):null]}):(u.kind==="live-molecule"||u.kind==="artifact")&&u.node.artifact?t.jsx("div",{className:J||G?"min-h-0 flex-1 overflow-hidden":"min-h-0 flex-1 overflow-auto p-3",children:S}):u.kind==="meta"?t.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-3",children:t.jsx("div",{className:"grid gap-3",children:t.jsx(Xt,{label:"Workspace Data",children:t.jsx(Pr,{content:u.node.detail??""})})})}):t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[t.jsx("div",{className:"thread-graph-file-preview-header border-b px-4 py-3 text-xs uppercase tracking-[0.12em]",children:u.node.kind}),t.jsx(Pr,{content:u.node.detail??u.node.preview??u.node.name})]}):t.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-5 text-center text-sm text-slate-400 dark:text-slate-500",children:"Pick a live molecule, workspace file, artifact, or thread event to preview it."})]})]})}var Io,zo,Pr,Nh=Be({"src/components/graph-workspace/GraphWorkspacePreviewPane.tsx"(){Jn(),To(),vh(),Io=50*1024,zo=1e3,Pr=c.memo(function({content:r}){return t.jsx("div",{className:"thread-graph-code-preview min-h-0 flex-1 overflow-auto",children:t.jsx("pre",{className:"thread-graph-plain-code-preview",children:t.jsx("code",{children:r})})})})}});function Ch({files:e,onCancel:r,onConfirm:n}){return t.jsx("div",{className:"thread-graph-dialog-backdrop fixed inset-0 z-50 flex items-center justify-center bg-black/40 px-4",children:t.jsxs("div",{className:"thread-graph-dialog w-full max-w-sm rounded-xl border bg-[var(--theme-panel)] p-6 shadow-xl",children:[t.jsx("h3",{className:"text-base font-semibold text-[var(--theme-fg)]",children:"Empty garbage?"}),t.jsxs("p",{className:"mt-1 text-sm leading-5 text-[var(--theme-fg-muted)]",children:["Permanently delete all files in the"," ",t.jsx("code",{className:"rounded bg-[var(--theme-muted)] px-1 text-xs text-[var(--theme-fg-soft)]",children:"garbage/"})," ","folder."]}),e.length===0?t.jsx("p",{className:"mt-3 text-sm text-[var(--theme-fg-muted)]",children:"Garbage is empty."}):t.jsx("ul",{className:"mt-3 max-h-40 overflow-y-auto rounded-md border border-[var(--theme-border)] bg-[var(--theme-surface)] p-2 text-xs text-[var(--theme-fg-soft)]",children:e.map(a=>t.jsx("li",{className:"truncate py-0.5",title:a,children:a},a))}),t.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[t.jsx("button",{type:"button",onClick:r,className:"thread-secondary-action rounded-md px-3 py-1.5 text-sm",children:"Cancel"}),e.length>0?t.jsx("button",{type:"button",onClick:n,className:"ui-action-danger rounded-md px-3 py-1.5 text-sm font-medium",children:"Yes, empty garbage"}):null]})]})})}var Sh=Be({"src/components/graph-workspace/GraphEmptyGarbageDialog.tsx"(){}});function Ro(e){return`${_o}${e.workspaceId??"workspace"}:${e.threadId}`}function Th(e){if(typeof window>"u")return[];try{const r=window.localStorage.getItem(Ro(e));if(!r)return[];const n=JSON.parse(r);return Array.isArray(n)?n.filter(a=>typeof a=="string"):[]}catch{return[]}}function Ga(e,r){if(!(typeof window>"u"))try{window.localStorage.setItem(Ro(e),JSON.stringify([...r]))}catch{}}function zn(e,r){if(!r||e.path!==r.path||e.kind!=="directory")return e;const n=new Map(r.children.map(s=>[s.path,s])),a=e.children.map(s=>zn(s,n.get(s.path)??null)),o=e.childrenLoaded&&e.children.length>0;return{...e,children:o||!r.childrenLoaded?a:r.children,childrenLoaded:e.childrenLoaded||r.childrenLoaded,truncated:e.truncated??r.truncated}}function Fa(e,r){if(e.kind==="directory")return r?t.jsx(B.FolderOpen,{className:"h-4 w-4 text-slate-500 dark:text-slate-400"}):t.jsx(B.Folder,{className:"h-4 w-4 text-slate-500 dark:text-slate-400"});const n=kr(e.name);return n==="zip"?t.jsx(B.FileArchive,{className:"h-4 w-4 text-amber-600"}):e.kind==="file"&&["png","jpg","jpeg","gif","webp","svg"].includes(n)?t.jsx(B.FileImage,{className:"h-4 w-4 text-sky-500"}):e.kind==="artifact"||["xyz","extxyz","cif","pdf","json","ts","tsx","js","jsx","md","yaml","yml","py"].includes(n)?t.jsx(B.FileCode2,{className:"h-4 w-4 text-emerald-600"}):t.jsx(B.File,{className:"h-4 w-4 text-slate-400 dark:text-slate-500"})}function Mo({depth:e,expandedPaths:r,loadingPaths:n,node:a,onDownload:o,onPreview:s,onSelect:l,onToggle:i,selectedNodeId:d}){const h=a.kind==="directory",u=h&&(a.path===""||r.has(a.path)),m=h&&n.has(a.path),f=d===a.id,p=`${e*.75+.5}rem`;return h?t.jsxs("div",{children:[t.jsxs("div",{className:"thread-graph-tree-row group flex items-center text-sm text-slate-600 transition hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-[#222733] dark:hover:text-slate-100",children:[t.jsxs("button",{type:"button",onClick:()=>i(a.path),className:"flex min-h-9 min-w-0 flex-1 items-center gap-2 px-2 py-2 text-left sm:min-h-0 sm:py-1.5",style:{paddingLeft:p},children:[u?t.jsx(B.ChevronDown,{className:"h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500"}):t.jsx(B.ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500"}),Fa(a,u),t.jsx("span",{className:"truncate",children:a.name}),m?t.jsx("span",{className:"ml-auto shrink-0 text-xs text-slate-400 dark:text-slate-500",children:"Loading"}):null]}),o?t.jsx("button",{type:"button",onClick:()=>o(a),className:"thread-graph-tree-action mr-1 flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-slate-400 transition hover:bg-white hover:text-slate-900 sm:h-7 sm:w-7 sm:opacity-0 sm:group-hover:opacity-100 sm:focus:opacity-100 dark:text-slate-500 dark:hover:bg-[#1d222c] dark:hover:text-slate-100",title:a.path?`Download ${a.name}`:"Download workspace","aria-label":a.path?`Download ${a.name}`:"Download workspace",children:t.jsx(B.Download,{className:"h-3.5 w-3.5"})}):null]}),u?t.jsxs("div",{children:[a.children.map(g=>t.jsx(Mo,{depth:e+1,expandedPaths:r,loadingPaths:n,node:g,...o?{onDownload:o}:{},...s?{onPreview:s}:{},onSelect:l,onToggle:i,selectedNodeId:d},g.id)),a.truncated?t.jsx("div",{className:"px-2 py-1 text-xs text-slate-400 dark:text-slate-500",style:{paddingLeft:`${(e+1)*.75+.5}rem`},children:"More items not shown"}):null]}):null]}):t.jsxs("div",{className:`thread-graph-tree-row group flex items-center text-sm transition ${f?"is-selected":"text-slate-600 hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-[#222733] dark:hover:text-slate-100"}`,children:[t.jsxs("button",{type:"button",onClick:()=>l(a.id),className:"flex min-h-9 min-w-0 flex-1 items-center gap-2 px-2 py-2 text-left sm:min-h-0 sm:py-1.5",style:{paddingLeft:`${e*.75+2.2}rem`},children:[Fa(a,!1),t.jsx("span",{className:"truncate",children:a.name})]}),a.kind==="file"&&(s||o)?t.jsxs("div",{className:"mr-1 flex shrink-0 items-center gap-0.5",children:[s?t.jsx("button",{type:"button",onClick:()=>s(a),className:`thread-graph-tree-action flex h-9 w-9 shrink-0 items-center justify-center rounded-md transition sm:h-7 sm:w-7 sm:opacity-0 sm:group-hover:opacity-100 sm:focus:opacity-100 ${f?"is-selected":"text-slate-400 hover:bg-white hover:text-slate-900 dark:text-slate-500 dark:hover:bg-[#1d222c] dark:hover:text-slate-100"}`,title:`Preview ${a.name}`,"aria-label":`Preview ${a.name}`,children:t.jsx(B.Eye,{className:"h-3.5 w-3.5"})}):null,o?t.jsx("button",{type:"button",onClick:()=>o(a),className:`thread-graph-tree-action flex h-9 w-9 shrink-0 items-center justify-center rounded-md transition sm:h-7 sm:w-7 sm:opacity-0 sm:group-hover:opacity-100 sm:focus:opacity-100 ${f?"is-selected":"text-slate-400 hover:bg-white hover:text-slate-900 dark:text-slate-500 dark:hover:bg-[#1d222c] dark:hover:text-slate-100"}`,title:`Download ${a.name}`,"aria-label":`Download ${a.name}`,children:t.jsx(B.Download,{className:"h-3.5 w-3.5"})}):null]}):null]})}function Eh({liveNodes:e,onSelect:r,selectedNodeId:n}){return e.length===0?null:t.jsxs("div",{className:"border-b border-slate-200 py-2 dark:border-[#2a2f3a]",children:[t.jsx("div",{className:"thread-graph-workspace-label px-3 pb-1 text-[11px] font-semibold tracking-normal text-slate-500 dark:text-slate-400",children:"Live"}),t.jsx("div",{className:"space-y-0.5",children:e.map(a=>{var s;const o=n===a.id;return t.jsxs("button",{type:"button","data-testid":"live-molecule-item","data-molecule-id":((s=a.artifact)==null?void 0:s.id)??a.id,onClick:()=>r(a.id),className:`thread-graph-tree-row flex min-h-9 w-full items-center gap-2 px-3 py-2 text-left text-sm transition sm:min-h-0 sm:py-1.5 ${o?"is-selected":"text-slate-600 hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-[#222733] dark:hover:text-slate-100"}`,children:[t.jsx(B.FileCode2,{className:`h-4 w-4 shrink-0 ${o?"text-current":"text-emerald-600 dark:text-emerald-300"}`}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.name})]},a.id)})})]})}function Lh({canEmptyGarbage:e,canUpload:r,onCollapse:n,expandedPaths:a,loadingPaths:o,loading:s,onDownload:l,onEmptyGarbage:i,onPreview:d,onRefresh:h,onSelect:u,onToggle:m,onUpload:f,explorerScrollTopRef:p,explorerScrollerRef:g,selectedNodeId:b,tree:v,liveNodes:x}){const y=c.useMemo(()=>({...v,children:v.children.filter(k=>k.path!=="live")}),[v]);return c.useLayoutEffect(()=>{const k=g.current;k&&(k.scrollTop=p.current)},[g,p]),t.jsxs("aside",{className:`${Ao} flex flex-col`,children:[t.jsxs("div",{className:$o,children:[t.jsx("div",{className:"min-w-0",children:t.jsx("h2",{className:Do,children:"Explorer"})}),t.jsxs("div",{className:"flex items-center gap-1",children:[n?t.jsxs("button",{type:"button","data-testid":"collapse-explorer",onClick:n,className:Bo,title:"Collapse Explorer","aria-label":"Collapse Explorer",children:[t.jsx(B.ChevronsLeft,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Collapse Explorer"})]}):null,t.jsx("button",{type:"button",onClick:f,disabled:!r,className:zr,title:r?"Upload file":"Upload is unavailable for this workspace","aria-label":"Upload file",children:t.jsx(B.Upload,{className:"h-4 w-4"})}),t.jsx("button",{type:"button",onClick:h,className:zr,title:"Refresh workspace","aria-label":"Refresh workspace",children:t.jsx(B.RefreshCw,{className:`h-4 w-4 ${s?"animate-spin":""}`})}),i?t.jsx("button",{type:"button",onClick:i,disabled:!e,className:zr,title:e?"Empty garbage":"Garbage controls are unavailable","aria-label":"Empty garbage",children:t.jsx(B.Trash2,{className:"h-4 w-4"})}):null]})]}),t.jsxs("div",{ref:g,className:"thread-graph-workspace-tree-scroll min-h-0 flex-1 overflow-y-auto py-2",onScroll:k=>{p.current=k.currentTarget.scrollTop},children:[t.jsx(Eh,{liveNodes:x??[],onSelect:u,selectedNodeId:b}),t.jsx("div",{className:Go,children:"Workspace"}),t.jsx(Mo,{depth:0,expandedPaths:a,loadingPaths:o,node:y,...l?{onDownload:l}:{},...d?{onPreview:d}:{},onSelect:u,onToggle:m,selectedNodeId:b}),y.children.length===0?t.jsx("p",{className:Fo,children:"This workspace is empty. Agent tool runs execute inside the thread workspace, so files should appear here as the session works."}):null]})]})}function Ph({activeView:e,detail:r,artifacts:n,plugins:a,status:o,focusPathRequest:s,workspaceAdapter:l}){const[i,d]=c.useState(null),h=c.useMemo(()=>l&&i?null:_a(r,n),[e,i,n,r,o,l]),u=i??h??_a(r,n),m=c.useMemo(()=>Xc(u),[u]),f=c.useMemo(()=>{var M;return((M=u.children.find($=>$.path==="live"))==null?void 0:M.children)??[]},[u]),p=No(u),[g,b]=c.useState(()=>(p==null?void 0:p.id)??null),[v,x]=c.useState(()=>new Set(["","artifacts","thread-events","live",...Aa((p==null?void 0:p.path)??"")])),[y,k]=c.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(max-width: 639px)").matches?"viewer":null),[S,w]=c.useState(null),[N,C]=c.useState(!1),[T,P]=c.useState(()=>new Set),[K,G]=c.useState(!1),[A,J]=c.useState(!1),[Z,D]=c.useState(!1),[te,oe]=c.useState([]),[_,Y]=c.useState(null),[z,q]=c.useState(null),[F,E]=c.useState(null),[W,H]=c.useState(!1),j=c.useRef(null),L=c.useRef(null),U=c.useRef(0),X=c.useRef(null),se=!!l,Q=(g?m.get(g):null)??p??null,de={threadId:r.thread.id,workspaceId:r.workspace.id??r.thread.workspaceId??null};c.useEffect(()=>{U.current=0,X.current=null,x(new Set(["","artifacts","thread-events","live",...Th(de),...Aa((p==null?void 0:p.path)??"")]))},[de.threadId,de.workspaceId]);function re(){var $;const M=(($=L.current)==null?void 0:$.scrollTop)??U.current;U.current=M,X.current=M}function ue(){const M=X.current??U.current;if(!L.current)return;let ee=0;const me=()=>{const ke=L.current;ke&&(ke.scrollTop=Math.min(M,Math.max(0,ke.scrollHeight-ke.clientHeight)),U.current=ke.scrollTop,ee+=1,ee<8?window.requestAnimationFrame(me):X.current=null)};window.requestAnimationFrame(me)}c.useLayoutEffect(()=>{y!=="explorer"&&ue()},[y,u]),c.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const M=window.matchMedia("(max-width: 639px)"),$=()=>H(M.matches);return $(),typeof M.addEventListener=="function"?(M.addEventListener("change",$),()=>M.removeEventListener("change",$)):(M.addListener($),()=>M.removeListener($))},[]);async function be(M){if(!l)return;const $=M??(Q==null?void 0:Q.path)??null;C(!0),w(null);try{const ee=qt(await l.listTree({...de,path:""}));let me=i?zn(ee,i):ee;if(i){const Re=[...v].filter(je=>je).sort((je,De)=>je.split("/").length-De.split("/").length);for(const je of Re){const De=En(i,je);if((De==null?void 0:De.kind)!=="directory"||!De.childrenLoaded)continue;const Ve=qt(await l.listTree({...de,path:je}));me=Ln(me,je,zn(Ve,De))}}d(me);const ke=wo(me);b(Re=>{var De;const je=$??(Re?(De=m.get(Re))==null?void 0:De.path:null);return je&&Pn(me,je)?`workspace:${je}`:(ke==null?void 0:ke.id)??Re})}catch(ee){w(ee instanceof Error?ee.message:"Failed to load workspace"),d(null)}finally{C(!1)}}async function ve(M){if(!(!l||!i)){P($=>{if($.has(M))return $;const ee=new Set($);return ee.add(M),ee}),w(null);try{const $=qt(await l.listTree({...de,path:M}));d(ee=>ee&&ko(ee,M,$.children,{truncated:$.truncated}))}catch($){w($ instanceof Error?$.message:"Failed to load directory")}finally{P($=>{if(!$.has(M))return $;const ee=new Set($);return ee.delete(M),ee})}}}async function Pe(M){const $=yo(M);if(!$)return;const ee=Oc($);if(k(null),x(me=>{const ke=new Set(me);ke.add("");for(const Re of ee)ke.add(Re);return Ga(de,ke),ke}),!l){Pn(u,$)&&b(`workspace:${$}`);return}C(!0),w(null);try{let me=i??qt(await l.listTree({...de,path:""}));for(const ke of ee){const Re=En(me,ke);if((Re==null?void 0:Re.kind)==="directory"&&Re.childrenLoaded)continue;const je=qt(await l.listTree({...de,path:ke}));me=Ln(me,ke,je)}d(me),b(`workspace:${$}`)}catch(me){w(me instanceof Error?me.message:`Failed to open ${$}`)}finally{C(!1)}}c.useEffect(()=>{if(!(!l||!i))for(const M of m.values())M.path&&M.kind==="directory"&&v.has(M.path)&&M.hasChildren&&!M.childrenLoaded&&!T.has(M.path)&&ve(M.path)},[i,v,m,l]),c.useEffect(()=>{d(null),P(new Set),Y(null),q(null),E(null),w(null),be()},[se,r.thread.id,r.workspace.id,r.thread.workspaceId]),c.useEffect(()=>{s&&Pe(s.path)},[s==null?void 0:s.requestId]),c.useEffect(()=>{l!=null&&l.subscribeWorkspaceChanged},[l,de.threadId,de.workspaceId]),c.useEffect(()=>{const M=l&&(Q==null?void 0:Q.kind)==="file"?Q.path:null;if(!M){Y(null),q(null),E(null);return}const $=M;let ee=!1;async function me(){var ke;if(l){G(!0),w(null),Y(null),q(null),E(null);try{const Re=kr($),je=(ke=l.getRawFileUrl)==null?void 0:ke.call(l,{...de,path:$});if(je&&Co.has(Re)){ee||q(je);return}if(je&&So.has(Re)){ee||E(je);return}const De=await l.readFile({...de,path:$,limit:Ir});ee||Y(De)}catch(Re){ee||w(Re instanceof Error?Re.message:"Failed to read file")}finally{ee||G(!1)}}}return me(),()=>{ee=!0}},[l,Q==null?void 0:Q.id]);async function le(){if(!(!l||!(_!=null&&_.truncated))){J(!0);try{const M=await l.readFile({...de,path:_.path,offset:_.nextOffset,limit:Ir});Y($=>$&&{...$,content:$.content+M.content,truncated:M.truncated,nextOffset:M.nextOffset,size:M.size})}finally{J(!1)}}}async function Ne(M){if(!(l!=null&&l.writeFile))return;w(null),await l.writeFile({...de,path:M.path,content:M.content}),await be(M.path);const $=await l.readFile({...de,path:M.path,limit:Ir});Y($)}async function we(M){if(!(!(l!=null&&l.uploadFile)||!M)){C(!0),w(null);try{const $=await l.uploadFile({...de,path:M.name,file:M}),ee=$.kind==="archive"?$.paths[0]??null:$.file.path;await be(ee)}catch($){w($ instanceof Error?$.message:"Failed to upload file")}finally{C(!1)}}}async function O(M){var ee;const $=(ee=M.target.files)==null?void 0:ee[0];M.target.value="",$&&await we($)}function ce(){if(!(l!=null&&l.uploadFile))return;const M=()=>{var $;return($=j.current)==null?void 0:$.click()};if(l.pickUploadFile){l.pickUploadFile({...de,defaultPick:M,upload:we});return}M()}function xe(M){var $;($=l==null?void 0:l.downloadNode)==null||$.call(l,{...de,path:M.path,kind:M.kind==="directory"?"directory":"file"})}function ye(M){M.kind==="file"&&(re(),b(M.id),k("explorer"))}async function Me(){if(l!=null&&l.emptyGarbage){if(w(null),!l.listGarbage){oe([]),D(!0);return}try{const M=await l.listGarbage(de);oe(M.map($=>`garbage/${$}`))}catch(M){oe([]),w(M instanceof Error?M.message:"Failed to list garbage files")}finally{D(!0)}}}async function _e(){if(l!=null&&l.emptyGarbage){D(!1),w(null);try{await l.emptyGarbage(de),await be((Q==null?void 0:Q.path)??null)}catch(M){w(M instanceof Error?M.message:"Failed to empty garbage")}}}const Te={...l!=null&&l.downloadNode?{onDownload:xe}:{},...l!=null&&l.emptyGarbage?{onEmptyGarbage:Me}:{},...l?{onRefresh:()=>void be((Q==null?void 0:Q.path)??null)}:{},...l!=null&&l.uploadFile?{onUpload:ce}:{}};function $e(M){if(!M)return;const $=m.get(`workspace:${M}`),ee=($==null?void 0:$.kind)==="directory"&&$.hasChildren&&!$.childrenLoaded&&!T.has(M);x(me=>{const ke=new Set(me);return ke.has(M)?ke.delete(M):ke.add(M),Ga(de,ke),ke}),!v.has(M)&&ee&&ve(M)}const R=t.jsx(Lh,{canEmptyGarbage:!!(l!=null&&l.emptyGarbage),canUpload:!!(l!=null&&l.uploadFile),onCollapse:()=>{re(),k("explorer")},expandedPaths:v,loadingPaths:T,loading:N,explorerScrollTopRef:U,explorerScrollerRef:L,...Te,onPreview:ye,onSelect:M=>{b(M)},onToggle:$e,selectedNodeId:(Q==null?void 0:Q.id)??null,tree:u,liveNodes:f}),pe=t.jsx(jh,{error:S,imageUrl:z,loadingMore:A,onLoadMore:le,...l!=null&&l.writeFile?{onSaveFile:Ne}:{},onCollapse:()=>{re(),k("viewer")},pdfUrl:F,previewFile:_,previewLoading:K,plugins:a,selectedTarget:yh(Q)});return y==="explorer"?t.jsx("div",{"data-testid":"workspace-panel",className:"relative h-full min-h-0 w-full overflow-hidden p-2",children:pe}):y==="viewer"?t.jsx("div",{"data-testid":"workspace-panel",className:"relative h-full min-h-0 w-full overflow-hidden p-2",children:R}):t.jsxs("div",{"data-testid":"workspace-panel",className:"flex h-full min-h-0 w-full overflow-hidden bg-transparent p-2",children:[Z?t.jsx(Ch,{files:te,onCancel:()=>D(!1),onConfirm:()=>void _e()}):null,W?t.jsxs(Sn,{direction:"vertical",className:"thread-graph-workspace-mobile-stack",children:[t.jsx(Zt,{defaultSize:42,minSize:18,children:t.jsx("div",{className:"thread-graph-workspace-mobile-explorer h-full min-h-0 overflow-hidden",children:R})}),t.jsx(Tn,{className:"thread-graph-workspace-resize-handle h-2 bg-transparent after:h-px after:bg-slate-200/80 after:transition-colors hover:after:bg-slate-300 dark:after:bg-[#303642] dark:hover:after:bg-[#475063]"}),t.jsx(Zt,{defaultSize:58,minSize:18,children:t.jsx("div",{className:"thread-graph-workspace-mobile-viewer h-full min-h-0 overflow-hidden",children:pe})})]}):t.jsxs(Sn,{direction:"horizontal",className:"thread-graph-workspace-resizable",children:[t.jsx(Zt,{defaultSize:33,minSize:20,children:t.jsx("div",{className:"thread-graph-workspace-explorer-pane h-full min-h-0 overflow-hidden",children:R})}),t.jsx(Tn,{className:"thread-graph-workspace-resize-handle w-2 bg-transparent after:w-px after:bg-slate-200/80 after:transition-colors hover:after:bg-slate-300 dark:after:bg-[#303642] dark:hover:after:bg-[#475063]"}),t.jsx(Zt,{defaultSize:67,minSize:30,children:t.jsx("div",{className:"thread-graph-workspace-viewer-pane h-full min-h-0 overflow-hidden",children:pe})})]}),t.jsx("input",{ref:j,type:"file","aria-label":"Workspace upload file input","data-testid":"workspace-upload-file-input",className:"hidden",onChange:M=>void O(M)})]})}var Ir,_o,Ao,$o,Do,zr,Bo,Go,Fo,Ih=Be({"src/components/graph-workspace/GraphWorkspaceExplorer.tsx"(){Jn(),Nh(),Sh(),vo(),Ir=24e3,_o="remote-codex:graphchat:workspace:expanded:",Ao="thread-graph-explorer h-full min-h-0 overflow-hidden rounded-[12px]",$o="thread-graph-explorer-header flex h-[60px] shrink-0 items-center justify-between border-b px-4",Do="text-[18px] font-semibold text-slate-900 dark:text-slate-100",zr="thread-graph-explorer-icon-button flex h-8 w-8 items-center justify-center rounded-lg border shadow-none transition disabled:cursor-not-allowed disabled:opacity-50",Bo="thread-graph-explorer-collapse-button flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition hover:bg-slate-100 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-[#222733] dark:hover:text-slate-100",Go="thread-graph-workspace-label px-3 pb-1 pt-2 text-[11px] font-semibold tracking-normal text-slate-500 dark:text-slate-400",Fo="thread-graph-workspace-empty mx-4 mt-3 rounded-lg border border-dashed border-slate-200 bg-slate-50 px-3 py-4 text-sm text-slate-500 dark:border-[#303642] dark:bg-[#1b1f29] dark:text-slate-400"}});function un({children:e}){return t.jsx("span",{className:"thread-guide-tag inline-flex items-center rounded px-1.5 py-0.5 font-mono text-[10px]",children:e})}function Vt({items:e}){return t.jsx("ul",{className:"space-y-1 text-[12px] text-[var(--theme-fg-muted)]",children:e.map((r,n)=>t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{className:"mt-[6px] h-1 w-1 shrink-0 rounded-full bg-[var(--theme-border-contrast)]"}),t.jsx("span",{children:r})]},n))})}function zh({children:e}){return t.jsx("span",{className:"thread-guide-icon flex h-5 w-5 shrink-0 items-center justify-center rounded-md",children:e})}function sr({value:e,title:r,icon:n,children:a}){return t.jsxs(xr,{value:e,className:"thread-guide-section border-b border-[var(--theme-border)] last:border-b-0",children:[t.jsx(Vr,{className:"py-3 hover:no-underline [&[data-state=open]]:pb-2",children:t.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-[var(--theme-fg)]",children:[t.jsx(zh,{children:n}),r]})}),t.jsx(br,{className:"space-y-3 pb-3",children:a})]})}function Rh(){return t.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[t.jsxs("div",{className:"shrink-0 border-b border-[var(--theme-border)] px-4 py-3",children:[t.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--theme-fg-muted)]",children:"What can I do?"}),t.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--theme-fg-muted)]",children:"Upload files, ask in plain language, get results."})]}),t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-6",children:t.jsxs(gr,{type:"multiple",defaultValue:["start","workspace","remote-codex"],className:"space-y-0",children:[t.jsxs(sr,{value:"start",title:"Getting Started",icon:t.jsx(B.Zap,{className:"h-3 w-3"}),children:[t.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"graphchat connects a language model to your files and a set of tools. Each Remote Codex thread has its own isolated workspace."}),t.jsx(Vt,{items:["Upload data files via the Workspace panel","Type a question or task in plain language","The agent calls tools, writes results to the workspace, and explains what it found","Agent-produced files appear in the workspace automatically when the host reports changes"]})]}),t.jsxs(sr,{value:"workspace",title:"Workspace Explorer",icon:t.jsx(B.FolderOpen,{className:"h-3 w-3"}),children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(B.Upload,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Upload"}),t.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"Upload files through the Workspace panel when the host exposes workspace upload support. Composer attachments stay available for prompt context."})]})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(B.Plus,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"New files and folders"}),t.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"Remote Codex normally creates files through tools and shell commands. They appear in Explorer after workspace refreshes."})]})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(B.MoveRight,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Move and organize"}),t.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"Use the agent or terminal to reorganize files. Explorer keeps the GraphChat file tree and preview flow."})]})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(B.Trash2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-rose-400"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Garbage folder"}),t.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"If the host exposes garbage controls, Explorer can permanently empty unwanted workspace files."})]})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(B.RefreshCw,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Refresh"}),t.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"Resync the file tree manually after shell commands, external changes, or agent tool runs."})]})]}),t.jsxs("div",{className:"rounded-lg border border-[var(--theme-border)] p-2.5",children:[t.jsx("p",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wide text-[var(--theme-fg-muted)]",children:"Preview surfaces"}),t.jsx(Vt,{items:[t.jsxs(t.Fragment,{children:[t.jsx(un,{children:".xyz .extxyz .cif"})," use the 3D molecule plugin."]}),t.jsxs(t.Fragment,{children:[t.jsx(un,{children:".png .jpg .gif .svg .webp"})," use inline image preview."]}),t.jsxs(t.Fragment,{children:[t.jsx(un,{children:".py .json .ts .md .csv"})," use text/code preview."]}),"Large files load in chunks when the workspace adapter supports it."]})]})]}),t.jsxs(sr,{value:"viewer",title:"Viewer",icon:t.jsx(B.FileImage,{className:"h-3 w-3"}),children:[t.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"Viewer is the GraphChat-style artifact surface. It opens Remote Codex artifacts through the same frontend plugin renderers used in rich message bubbles, and previews workspace files from Explorer."}),t.jsx(Vt,{items:["Expand one artifact at a time for inspection","Fallback JSON preview is available for unknown artifact types","3D molecule artifacts remain interactive when the XYZ plugin is enabled"]})]}),t.jsxs(sr,{value:"usage",title:"Tool Usage & Chat",icon:t.jsx(B.BarChart2,{className:"h-3 w-3"}),children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(B.BarChart2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Usage tab"}),t.jsx(Vt,{items:["Bar chart of tool and command counts for this thread","Expandable call log: inspect every input and output","Recent live events appear with persisted history"]})]})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(B.MessageSquare,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Chat controls"}),t.jsx(Vt,{items:["New Chat creates a fresh Remote Codex thread with its own workspace","Interrupt, compact, goal controls, and model controls remain in the composer","Shell view stays available when a shell adapter is attached"]})]})]})]}),t.jsx(sr,{value:"remote-codex",title:"Remote Codex Extras",icon:t.jsx(B.Code2,{className:"h-3 w-3"}),children:t.jsx(Vt,{items:["Slash toolbox: skills, MCP, hooks, goals, forks, model controls, provider settings","Rich message bubbles: reasoning, commands, searches, file reads, file changes, plans, action requests, artifacts","Plugin surfaces: terminal, XYZ molecule viewer, inline code renderers, and imported plugin panels","Thread metadata stays in the left rail and Workspace tab instead of replacing chat"]})})]})})]})}var Mh=Be({"src/components/graph-workspace/GraphGuidePanel.tsx"(){vr()}});function _h(e){if(e==null)return"—";if(typeof e=="string")return e.length>2e3?`${e.slice(0,2e3)}
|
|
13
|
+
...(truncated)`:e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Ha({label:e,value:r}){return t.jsxs("div",{children:[t.jsx("p",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-[var(--theme-fg-muted)]",children:e}),t.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-[var(--theme-surface-strong)] p-2 text-[11px] leading-relaxed text-[var(--theme-fg-soft)]",children:_h(r)})]})}function Ah({event:e}){return t.jsxs(xr,{value:e.id,className:"thread-tool-call mb-2 overflow-hidden rounded-lg border border-[var(--theme-border)] last:mb-0",children:[t.jsxs(Vr,{className:"px-3 py-2 text-xs font-medium text-[var(--theme-fg)] hover:bg-[var(--theme-hover)] hover:no-underline [&[data-state=open]]:bg-[var(--theme-hover)]",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--theme-accent-strong)]"}),t.jsx("span",{className:"truncate font-mono text-xs font-medium text-[var(--theme-fg)]",children:e.label}),e.status?t.jsx("span",{className:"shrink-0 rounded-full border border-[var(--theme-border)] px-1.5 py-0.5 text-[9px] uppercase tracking-[0.12em] text-[var(--theme-fg-muted)]",children:e.status}):null]}),t.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:e.turnId?t.jsx("span",{className:"max-w-20 truncate text-[10px] text-[var(--theme-fg-muted)]",children:e.turnId}):null})]}),t.jsx(br,{className:"px-3 pb-3",children:t.jsxs("div",{className:"space-y-2 px-3 pb-3 pt-1",children:[t.jsx(Ha,{label:"Input",value:e.preview}),t.jsx(Ha,{label:"Output",value:e.detail})]})})]})}function $h({formatToolKind:e,toolCounts:r,toolEvents:n,maxToolCount:a}){const[o,s]=c.useState(()=>{var i;return((i=n.at(-1))==null?void 0:i.id)??null}),l=c.useRef(null);return c.useEffect(()=>{s(i=>{var d;return i??((d=n.at(-1))==null?void 0:d.id)??null})},[n]),c.useEffect(()=>{var i;(i=l.current)==null||i.scrollIntoView({behavior:"smooth",block:"nearest"})},[n.length]),r.length?t.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[t.jsxs("div",{className:"shrink-0 border-b border-[var(--theme-border)] p-4",children:[t.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--theme-fg-muted)]",children:"Calls this session"}),t.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded px-2 py-1 text-[11px] text-[var(--theme-fg-muted)] opacity-60",disabled:!0,title:"Remote Codex streams tool history from thread events",children:[t.jsx(B.RefreshCw,{className:"h-3 w-3"}),"Reload"]})]}),t.jsx("div",{className:"space-y-2",children:r.map(([i,d])=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"w-40 shrink-0 truncate text-right font-mono text-[11px] text-[var(--theme-fg-muted)]",title:e(i),children:e(i)}),t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx("div",{className:"relative h-4 flex-1 overflow-hidden rounded-sm bg-[var(--theme-muted)]",children:t.jsx("div",{className:"h-full rounded-sm bg-[var(--theme-accent-strong)] transition-all duration-300",style:{width:`${d/a*100}%`}})}),t.jsx("span",{className:"w-5 shrink-0 text-right text-[11px] font-medium text-[var(--theme-fg-soft)]",children:d})]})]},i))})]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[t.jsx("h2",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-[var(--theme-fg-muted)]",children:"Call log"}),t.jsx(gr,{type:"single",collapsible:!0,value:o??"",onValueChange:i=>s(i||null),className:"space-y-0",children:n.slice(-50).map(i=>t.jsx(Ah,{event:i},i.id))}),t.jsx("div",{ref:l})]})]}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-sm text-[var(--theme-fg-muted)]",children:[t.jsx("span",{children:"No tool calls yet. Run the agent to see usage."}),t.jsxs("span",{className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs",children:[t.jsx(B.RefreshCw,{className:"h-3 w-3"}),"Reload from workspace"]})]})}var Dh=Be({"src/components/graph-workspace/GraphToolUsagePanel.tsx"(){vr()}});function Oa(e,r){const n=Math.max(e.measured.width??1,1),a=Math.max(e.measured.height??1,1),o=e.internals.positionAbsolute,s=r.internals.positionAbsolute,l=Math.max(r.measured.width??1,1),i=Math.max(r.measured.height??1,1),d=n/2,h=a/2,u=o.x+d,m=o.y+h,f=s.x+l/2,p=s.y+i/2,g=(f-u)/(2*d)-(p-m)/(2*h),b=(f-u)/(2*d)+(p-m)/(2*h),v=1/(Math.abs(g)+Math.abs(b)),x=v*g,y=v*b,k=d*(x+y)+u,S=h*(-x+y)+m;return{x:k,y:S}}function Wa(e,r){const n={...e.internals.positionAbsolute,...e},a=Math.round(n.x),o=Math.round(n.y),s=Math.round(r.x),l=Math.round(r.y);return s<=a+1?Rt.Left:s>=a+(e.measured.width??1)-1?Rt.Right:l<=o+1?Rt.Top:l>=n.y+(e.measured.height??1)-1?Rt.Bottom:Rt.Top}function Ho(e,r){const n=Oa(e,r),a=Oa(r,e),o=Wa(e,n),s=Wa(r,a);return{sx:n.x,sy:n.y,tx:a.x,ty:a.y,sourcePos:o,targetPos:s}}function Bh(e,r=900,n=620){if(!e||!Array.isArray(e))return{nodes:[],edges:[]};const a=(d,h,u,m)=>{const f=new Map,p=d.length;d.forEach((g,b)=>{const v=g.id.split("").reduce((x,y)=>{const k=(x<<5)-x+y.charCodeAt(0);return k&k},0);f.set(g.id,{x:Math.abs(v)%u+b*100%u,y:Math.abs(v>>16)%m+b*150%m,vx:0,vy:0})});for(let g=0;g<200;g+=1){for(let b=0;b<p;b+=1)for(let v=b+1;v<p;v+=1){const x=d[b],y=d[v];if(!x||!y)continue;const k=f.get(x.id),S=f.get(y.id);if(!k||!S)continue;const w=k.x-S.x,N=k.y-S.y,C=Math.sqrt(w*w+N*N)||1,P=(200-C)*.5,K=w/C*P,G=N/C*P;k.vx+=K,k.vy+=G,S.vx-=K,S.vy-=G}h.forEach(b=>{const v=f.get(b.source),x=f.get(b.target);if(!v||!x)return;const y=x.x-v.x,k=x.y-v.y,S=Math.sqrt(y*y+k*k)||1,N=(S-120)*.3,C=y/S*N,T=k/S*N;v.vx+=C,v.vy+=T,x.vx-=C,x.vy-=T}),f.forEach(b=>{b.x+=b.vx*.1,b.y+=b.vy*.1,b.vx*=.9,b.vy*=.9,b.x=Math.max(80,Math.min(u-80,b.x)),b.y=Math.max(80,Math.min(m-80,b.y))})}return f},o=new Set(e.map(d=>d.id)),s=[];e.forEach(d=>{if(!d.out_node_id)return;(Array.isArray(d.out_node_id)?d.out_node_id:[d.out_node_id]).forEach(u=>{o.has(u)&&s.push({id:`${d.id}-${u}`,source:d.id,target:u,type:"floating",sourceHandle:null,targetHandle:null,markerEnd:{type:Is.Arrow}})})});const l=a(e,s,r,n);return{nodes:e.map(d=>({id:d.id,type:"styledNode",position:l.get(d.id)??{x:100,y:100},data:{label:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-sm font-semibold",children:d.name}),d.description?t.jsx("div",{className:"mt-1 max-w-32 overflow-hidden text-ellipsis text-xs text-slate-500 dark:text-slate-400",children:d.description}):null]})}})),edges:s}}var Qn=Be({"src/components/graph-chat/FloatingHelper.tsx"(){}});function Gh({toX:e,toY:r,fromPosition:n,toPosition:a,fromNode:o}){if(!o)return null;const s={id:"connection-target",measured:{width:1,height:1},internals:{positionAbsolute:{x:e,y:r}}},{sx:l,sy:i,tx:d,ty:h,sourcePos:u,targetPos:m}=Ho(o,s),[f]=zs({sourceX:l,sourceY:i,sourcePosition:u||n,targetPosition:m||a,targetX:d||e,targetY:h||r});return t.jsxs("g",{children:[t.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"animated",d:f}),t.jsx("circle",{cx:d||e,cy:h||r,fill:"var(--theme-panel)",r:3,stroke:"currentColor",strokeWidth:1.5})]})}var Fh=Be({"src/components/graph-chat/FloatingConnectionLine.tsx"(){Qn()}});function Hh({id:e,source:r,target:n,markerEnd:a,style:o}){const s=xa(r),l=xa(n);if(!s||!l)return null;const{sx:i,sy:d,tx:h,ty:u,sourcePos:m,targetPos:f}=Ho(s,l),[p]=zs({sourceX:i,sourceY:d,sourcePosition:m,targetPosition:f,targetX:h,targetY:u});return t.jsx("path",{id:e,className:"react-flow__edge-path",d:p,markerEnd:a,style:o})}var Oh=Be({"src/components/graph-chat/FloatingEdge.tsx"(){Qn()}});function Wh({nodes:e}){const[r,n,a]=sd([]),[o,s,l]=od([]),i=c.useMemo(()=>Bh(e),[e]),d=c.useMemo(()=>({floating:Hh}),[]),h=c.useMemo(()=>({styledNode:({data:m,isConnectable:f})=>t.jsxs("div",{className:"thread-graph-flow-node",children:[m.label,t.jsx(ga,{type:"target",position:Rt.Top,isConnectable:f,style:{opacity:0,pointerEvents:"none"}}),t.jsx(ga,{type:"source",position:Rt.Bottom,isConnectable:f,style:{opacity:0,pointerEvents:"none"}})]})}),[]);c.useEffect(()=>{n(i.nodes),s(i.edges)},[i.edges,i.nodes,s,n]);const u=c.useCallback(m=>s(f=>ld({...m,type:"floating",sourceHandle:null,targetHandle:null,markerEnd:{type:Is.Arrow}},f)),[s]);return t.jsx("div",{className:"thread-graph-flow h-full min-h-0",children:t.jsx(id,{children:t.jsxs(dd,{nodes:r,edges:o,onNodesChange:a,onEdgesChange:l,onConnect:u,fitView:!0,nodeTypes:h,edgeTypes:d,connectionLineComponent:Gh,children:[t.jsx(cd,{}),t.jsx(hd,{gap:16})]})})})}var Uh=Be({"src/components/graph-chat/GraphVisualization.tsx"(){Fh(),Oh(),Qn()}});function Vh(e){return{...Wo,...e}}function Ua(e,r){const n=a=>{switch(a){case"workspace":return e.workspace;case"tools":return e.toolUsage;case"guide":return e.guide;case"graph":return e.threadGraph;case"extensions":return e.extensions}};return r&&n(r)?r:["workspace","tools","guide","graph","extensions"].find(n)??null}function Kh(e,r){switch(r){case"workspace":return e.workspace;case"tools":return e.toolUsage;case"guide":return e.guide;case"graph":return e.threadGraph;case"extensions":return e.extensions}}function qh(e){var o;const r=[],n=new Set(["toolCall","commandExecution","webSearch","fileRead","fileChange","agentToolCall","skillToolCall","hook"]);let a=0;for(const s of e.turns)for(const l of s.items)n.has(l.kind)&&(r.push({id:l.id,kind:l.kind,label:Ar(l.kind),preview:l.previewText??l.text??l.kind,detail:l.detailText??l.text??l.previewText??l.kind,turnId:l.sourceTurnId??s.id,status:l.status??null,sequence:a}),a+=1);for(const s of((o=e.liveItems)==null?void 0:o.items)??[])n.has(s.kind)&&(r.push({id:s.id,kind:s.kind,label:Ar(s.kind),preview:s.previewText??s.text??s.kind,detail:s.detailText??s.text??s.previewText??s.kind,turnId:s.sourceTurnId??null,status:s.status??null,sequence:a}),a+=1);return r}function Ar(e){switch(e){case"toolCall":return"Tool call";case"agentToolCall":return"Agent tool";case"skillToolCall":return"Skill tool";case"commandExecution":return"Command";case"webSearch":return"Search";case"fileRead":return"File read";case"fileChange":return"File change";case"hook":return"Hook";default:return e.replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase())}}function Xh(e){switch(e.kind){case"userMessage":return"User";case"agentMessage":return"Agent";default:return Ar(e.kind)}}function Yh(e){return(e.previewText??e.text??e.detailText??e.kind).replace(/\s+/g," ").slice(0,96)}function Zh(e,r){const n=[{id:`thread:${e.thread.id}`,name:e.thread.title||"Thread",description:e.thread.model??e.thread.status},{id:`workspace:${e.workspace.id}`,name:e.workspace.label??"Workspace",description:e.workspace.absPath,out_node_id:`thread:${e.thread.id}`}];let a=null;for(const s of e.turns){const l=`turn:${s.id}`;n.push({id:l,name:`Turn ${n.filter(d=>d.id.startsWith("turn:")).length+1}`,description:s.status,out_node_id:a?[`thread:${e.thread.id}`,a]:`thread:${e.thread.id}`}),a=l;let i=null;for(const d of s.items){const h=`item:${d.id}`,u=[l];i&&u.push(i),n.push({id:h,name:Xh(d),description:Yh(d),out_node_id:u}),i=h,d.kind==="artifact"&&d.artifact&&n.push({id:`artifact:${d.artifact.id}`,name:d.artifact.title||d.artifact.type,description:d.artifact.summaryText??d.artifact.type,out_node_id:h})}}const o=new Set(n.map(s=>s.id));for(const s of r){const l=`tool:${s.id}`;o.has(l)||o.has(`item:${s.id}`)||n.push({id:l,name:s.label,description:s.preview,out_node_id:s.turnId?`turn:${s.turnId}`:`thread:${e.thread.id}`})}return n.slice(0,120)}function Oo({detail:e,status:r,plugins:n,workspaceAdapter:a,metaContent:o,settingsContent:s,activeView:l="chat",features:i,focusPathRequest:d=null}){const h=c.useMemo(()=>Vh(i),[i]),u=Ua(h,i==null?void 0:i.defaultTab),[m,f]=c.useState(u),p=c.useMemo(()=>Gc(e),[e]),g=c.useMemo(()=>qh(e),[e]),b=c.useMemo(()=>{const w=new Map;for(const N of g)w.set(N.kind,(w.get(N.kind)??0)+1);return[...w.entries()].sort((N,C)=>C[1]-N[1])},[g]),v=n.getThreadPanels(),x=Math.max(...b.map(([,w])=>w),1),y=c.useMemo(()=>Zh(e,g),[e,g]),k=c.useMemo(()=>{const w=[];return h.workspace&&w.push({id:"workspace",label:"Workspace",icon:null}),h.toolUsage&&w.push({id:"tools",label:"Tool Usage",icon:B.BarChart2}),h.guide&&w.push({id:"guide",label:"Guide",icon:B.BookOpen}),w},[h.guide,h.toolUsage,h.workspace]),S=c.useMemo(()=>{const w=[];return h.threadGraph&&w.push({id:"graph",label:"Thread graph",icon:B.GitBranch}),h.extensions&&w.push({id:"extensions",label:"Remote Codex extensions",icon:B.Wrench}),w},[h.extensions,h.threadGraph]);return c.useEffect(()=>{(!m||!Kh(h,m))&&f(Ua(h,i==null?void 0:i.defaultTab))},[m,i==null?void 0:i.defaultTab,h]),c.useEffect(()=>{d&&h.workspace&&f("workspace")},[h.workspace,d==null?void 0:d.requestId]),m?t.jsxs("div",{className:"thread-graph-right-panel flex h-full min-h-0 flex-col overflow-hidden",children:[t.jsxs("div",{className:"thread-graph-right-tabs flex shrink-0 items-center gap-1 overflow-hidden border-b px-3 py-2",children:[k.map(w=>{const N=w.icon;return t.jsxs("button",{type:"button",onClick:()=>f(w.id),className:`thread-graph-right-tab inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition ${m===w.id?"is-active":""}`,children:[N?t.jsx(N,{className:"h-3.5 w-3.5"}):null,w.label]},w.id)}),S.length?t.jsx("div",{className:"thread-graph-right-tab-secondary ml-auto flex min-w-0 shrink items-center gap-1 border-l pl-2","aria-label":"Remote Codex workspace extensions",children:S.map(w=>{const N=w.icon;return t.jsx("button",{type:"button",onClick:()=>f(w.id),className:`thread-graph-right-tab inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-xs font-medium transition ${m===w.id?"is-active":""}`,title:w.label,"aria-label":w.label,children:t.jsx(N,{className:"h-3.5 w-3.5"})},w.id)})}):null]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[m==="workspace"?t.jsx(Ph,{activeView:l,detail:e,artifacts:p,plugins:n,status:r,focusPathRequest:d,workspaceAdapter:a??null}):null,m==="tools"?t.jsx($h,{formatToolKind:Ar,toolCounts:b,toolEvents:g,maxToolCount:x}):null,m==="graph"?t.jsx("div",{className:"thread-graph-visualization-panel h-full min-h-0 p-3",children:t.jsx(Wh,{nodes:y})}):null,m==="extensions"?t.jsx("div",{className:"h-full min-h-0 overflow-y-auto p-3",children:t.jsxs("div",{className:"grid gap-3",children:[t.jsx(Xt,{label:"Plugin Panels",children:v.length?t.jsx("div",{className:"flex flex-wrap gap-2",children:v.map(w=>t.jsx("span",{className:"rounded-full border border-[var(--theme-border)] px-2 py-1 text-xs text-[var(--theme-fg-soft)]",children:w.label},w.id))}):t.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"No thread panels are enabled."})}),t.jsx(Xt,{label:"Enabled Renderers",children:t.jsx("div",{className:"flex flex-wrap gap-2",children:n.plugins.filter(w=>w.enabled).map(w=>t.jsx("span",{className:"rounded-full border border-[var(--theme-border)] px-2 py-1 text-xs text-[var(--theme-fg-soft)]",children:w.name},w.id))})}),t.jsx(Xt,{label:"Remote Codex Tools",children:t.jsxs("div",{className:"grid gap-2 text-[var(--theme-fg-muted)]",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(B.Terminal,{className:"mt-0.5 h-4 w-4 shrink-0"}),t.jsx("p",{children:"Terminal stays available when the Terminal plugin and shell adapter are attached."})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(B.Paperclip,{className:"mt-0.5 h-4 w-4 shrink-0"}),t.jsx("p",{children:"Composer attachments, slash panels, hooks, MCP, goals, and fork controls remain part of the chat surface."})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(B.Trash2,{className:"mt-0.5 h-4 w-4 shrink-0"}),t.jsx("p",{children:"Destructive actions stay explicit: delete thread, interrupt, compact, and hook trust controls remain host governed."})]})]})}),o?t.jsx(Xt,{label:"Thread Meta",children:o}):null,s?t.jsx(Xt,{label:"Settings",children:s}):null]})}):null,m==="guide"?t.jsx(Rh,{}):null]})]}):null}var Wo,Uo,Jh=Be({"src/components/ThreadGraphWorkspacePanel.tsx"(){Ih(),To(),Mh(),Dh(),Jn(),Uh(),Wo={workspace:!0,toolUsage:!0,guide:!0,threadGraph:!0,extensions:!0},Uo=c.memo(Oo)}}),Vo={};Bc(Vo,{MemoizedThreadGraphWorkspacePanel:()=>Uo,ThreadGraphWorkspacePanel:()=>Oo});var Qh=Be({"src/workspace-panel.ts"(){Jh()}});function tr(e,{insertAt:r}={}){if(!e||typeof document>"u")return;const n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",r==="top"&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}tr(`.thread-ui-shell,
|
|
14
|
+
.thread-graph-dialog {
|
|
15
|
+
color-scheme: light;
|
|
16
|
+
--radius: 0.625rem;
|
|
17
|
+
--background: oklch(1 0 0);
|
|
18
|
+
--foreground: oklch(0.145 0 0);
|
|
19
|
+
--card: oklch(1 0 0);
|
|
20
|
+
--card-foreground: oklch(0.145 0 0);
|
|
21
|
+
--popover: oklch(1 0 0);
|
|
22
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
23
|
+
--primary: oklch(0.205 0 0);
|
|
24
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
25
|
+
--secondary: oklch(0.97 0 0);
|
|
26
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
27
|
+
--muted: oklch(0.97 0 0);
|
|
28
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
29
|
+
--accent: oklch(0.97 0 0);
|
|
30
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
31
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
32
|
+
--border: oklch(0.922 0 0);
|
|
33
|
+
--input: oklch(0.922 0 0);
|
|
34
|
+
--ring: oklch(0.708 0 0);
|
|
35
|
+
--sidebar: oklch(0.985 0 0);
|
|
36
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
37
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
38
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
39
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
40
|
+
--thread-gc-bg: #eef2f7;
|
|
41
|
+
--thread-gc-panel: #f8fafc;
|
|
42
|
+
--thread-gc-workspace: #f3f6fb;
|
|
43
|
+
--thread-gc-surface: #edf2f7;
|
|
44
|
+
--thread-gc-muted: #e6edf5;
|
|
45
|
+
--thread-gc-hover: #e8eef6;
|
|
46
|
+
--thread-gc-border: rgb(203 213 225 / 0.82);
|
|
47
|
+
--thread-gc-border-strong: rgb(174 187 204);
|
|
48
|
+
--thread-gc-border-contrast: rgb(123 139 161);
|
|
49
|
+
--thread-gc-fg: rgb(15 23 42);
|
|
50
|
+
--thread-gc-fg-soft: rgb(51 65 85);
|
|
51
|
+
--thread-gc-fg-muted: rgb(148 163 184);
|
|
52
|
+
--thread-gc-primary: rgb(2 6 23);
|
|
53
|
+
--thread-gc-primary-hover: rgb(30 41 59);
|
|
54
|
+
--thread-gc-primary-fg: #f8fafc;
|
|
55
|
+
--thread-gc-accent-soft: rgb(241 245 249);
|
|
56
|
+
--thread-gc-accent-strong: rgb(15 23 42);
|
|
57
|
+
--thread-gc-accent-border: rgb(203 213 225);
|
|
58
|
+
--thread-gc-shadow: 0 10px 30px rgb(15 23 42 / 0.04);
|
|
59
|
+
--theme-bg: var(--thread-gc-bg);
|
|
60
|
+
--theme-panel: var(--thread-gc-panel);
|
|
61
|
+
--theme-surface: var(--thread-gc-workspace);
|
|
62
|
+
--theme-surface-strong: var(--thread-gc-surface);
|
|
63
|
+
--theme-muted: var(--thread-gc-muted);
|
|
64
|
+
--theme-hover: var(--thread-gc-hover);
|
|
65
|
+
--theme-border: var(--thread-gc-border);
|
|
66
|
+
--theme-border-strong: var(--thread-gc-border-strong);
|
|
67
|
+
--theme-border-contrast: var(--thread-gc-border-contrast);
|
|
68
|
+
--theme-fg: var(--thread-gc-fg);
|
|
69
|
+
--theme-fg-soft: var(--thread-gc-fg-soft);
|
|
70
|
+
--theme-fg-muted: var(--thread-gc-fg-muted);
|
|
71
|
+
--theme-accent-solid: var(--thread-gc-primary);
|
|
72
|
+
--theme-accent-solid-hover: var(--thread-gc-primary-hover);
|
|
73
|
+
--theme-accent-solid-fg: var(--thread-gc-primary-fg);
|
|
74
|
+
--theme-accent-soft: var(--thread-gc-accent-soft);
|
|
75
|
+
--theme-accent-strong: var(--thread-gc-accent-strong);
|
|
76
|
+
--theme-accent-border: var(--thread-gc-accent-border);
|
|
77
|
+
--theme-shadow: var(--thread-gc-shadow);
|
|
78
|
+
background: var(--theme-bg);
|
|
79
|
+
color: var(--theme-fg);
|
|
80
|
+
isolation: isolate;
|
|
81
|
+
font-family:
|
|
82
|
+
Inter,
|
|
83
|
+
ui-sans-serif,
|
|
84
|
+
system-ui,
|
|
85
|
+
-apple-system,
|
|
86
|
+
BlinkMacSystemFont,
|
|
87
|
+
"Segoe UI",
|
|
88
|
+
"Noto Sans CJK SC",
|
|
89
|
+
"Noto Sans SC",
|
|
90
|
+
"Microsoft YaHei",
|
|
91
|
+
"PingFang SC",
|
|
92
|
+
"Hiragino Sans GB",
|
|
93
|
+
sans-serif;
|
|
94
|
+
}
|
|
95
|
+
.thread-graph-dialog {
|
|
96
|
+
background: var(--theme-panel);
|
|
97
|
+
color: var(--theme-fg);
|
|
98
|
+
}
|
|
99
|
+
.thread-ui-shell.thread-ui-viewport-constrained {
|
|
100
|
+
height: 100svh;
|
|
101
|
+
max-height: 100svh;
|
|
102
|
+
min-height: 0;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
overscroll-behavior: none;
|
|
105
|
+
}
|
|
106
|
+
.thread-ui-shell.thread-ui-theme-dark,
|
|
107
|
+
.thread-ui-shell[data-theme-effective=dark],
|
|
108
|
+
:root[data-theme-effective=dark] .thread-ui-shell,
|
|
109
|
+
.thread-ui-shell.dark,
|
|
110
|
+
.thread-ui-shell[data-theme=dark],
|
|
111
|
+
.thread-ui-shell[data-theme-mode=dark],
|
|
112
|
+
.thread-ui-shell[data-theme-mode=system][data-system-theme=dark],
|
|
113
|
+
.thread-graph-dialog[data-theme-effective=dark],
|
|
114
|
+
.thread-graph-dialog[data-theme-mode=dark],
|
|
115
|
+
.thread-graph-dialog[data-theme-mode=system][data-system-theme=dark] {
|
|
116
|
+
color-scheme: dark;
|
|
117
|
+
--background: oklch(0.145 0 0);
|
|
118
|
+
--foreground: oklch(0.985 0 0);
|
|
119
|
+
--card: oklch(0.205 0 0);
|
|
120
|
+
--card-foreground: oklch(0.985 0 0);
|
|
121
|
+
--popover: oklch(0.205 0 0);
|
|
122
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
123
|
+
--primary: oklch(0.922 0 0);
|
|
124
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
125
|
+
--secondary: oklch(0.269 0 0);
|
|
126
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
127
|
+
--muted: oklch(0.269 0 0);
|
|
128
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
129
|
+
--accent: oklch(0.269 0 0);
|
|
130
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
131
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
132
|
+
--border: oklch(1 0 0 / 10%);
|
|
133
|
+
--input: oklch(1 0 0 / 15%);
|
|
134
|
+
--ring: oklch(0.556 0 0);
|
|
135
|
+
--sidebar: oklch(0.205 0 0);
|
|
136
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
137
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
138
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
139
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
140
|
+
--thread-gc-bg: #101217;
|
|
141
|
+
--thread-gc-panel: #171a22;
|
|
142
|
+
--thread-gc-workspace: #151820;
|
|
143
|
+
--thread-gc-surface: #1d222c;
|
|
144
|
+
--thread-gc-muted: #222733;
|
|
145
|
+
--thread-gc-hover: #222733;
|
|
146
|
+
--thread-gc-border: #2a2f3a;
|
|
147
|
+
--thread-gc-border-strong: #303642;
|
|
148
|
+
--thread-gc-border-contrast: #475063;
|
|
149
|
+
--thread-gc-fg: rgb(241 245 249);
|
|
150
|
+
--thread-gc-fg-soft: rgb(203 213 225);
|
|
151
|
+
--thread-gc-fg-muted: rgb(148 163 184);
|
|
152
|
+
--thread-gc-primary: rgb(241 245 249);
|
|
153
|
+
--thread-gc-primary-hover: rgb(203 213 225);
|
|
154
|
+
--thread-gc-primary-fg: #11141a;
|
|
155
|
+
--thread-gc-accent-soft: #222733;
|
|
156
|
+
--thread-gc-accent-strong: rgb(241 245 249);
|
|
157
|
+
--thread-gc-accent-border: #303642;
|
|
158
|
+
--thread-gc-shadow: 0 18px 40px rgb(0 0 0 / 0.28);
|
|
159
|
+
}
|
|
160
|
+
.thread-ui-shell *,
|
|
161
|
+
.thread-ui-shell *::before,
|
|
162
|
+
.thread-ui-shell *::after {
|
|
163
|
+
box-sizing: border-box;
|
|
164
|
+
}
|
|
165
|
+
.thread-ui-shell .thread-main-panel,
|
|
166
|
+
.thread-ui-shell .thread-detail-surface,
|
|
167
|
+
.thread-ui-shell .thread-sidebar-surface,
|
|
168
|
+
.thread-ui-shell .thread-workspace-panel,
|
|
169
|
+
.thread-ui-shell .thread-workspace-card {
|
|
170
|
+
border-color: var(--theme-border);
|
|
171
|
+
background: var(--theme-panel);
|
|
172
|
+
color: var(--theme-fg);
|
|
173
|
+
}
|
|
174
|
+
.thread-ui-shell .thread-sidebar-surface {
|
|
175
|
+
background: color-mix(in oklch, var(--theme-panel) 92%, var(--theme-surface));
|
|
176
|
+
color: var(--theme-fg);
|
|
177
|
+
}
|
|
178
|
+
.thread-ui-shell .thread-graph-rooms-surface,
|
|
179
|
+
.thread-ui-shell .thread-topbar-surface {
|
|
180
|
+
border-color: var(--theme-border);
|
|
181
|
+
background: var(--theme-panel);
|
|
182
|
+
color: var(--theme-fg);
|
|
183
|
+
}
|
|
184
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-rooms-surface,
|
|
185
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-rooms-surface,
|
|
186
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-graph-rooms-surface,
|
|
187
|
+
.thread-ui-shell.dark .thread-graph-rooms-surface,
|
|
188
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-topbar-surface,
|
|
189
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-topbar-surface,
|
|
190
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-topbar-surface,
|
|
191
|
+
.thread-ui-shell.dark .thread-topbar-surface {
|
|
192
|
+
border-color: #2a2f3a;
|
|
193
|
+
background: #171a22;
|
|
194
|
+
color: rgb(241 245 249);
|
|
195
|
+
box-shadow: 0 18px 40px rgb(0 0 0 / 0.28);
|
|
196
|
+
}
|
|
197
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-rooms-surface,
|
|
198
|
+
:root[data-theme-effective=light] .thread-ui-shell .thread-graph-rooms-surface,
|
|
199
|
+
.thread-ui-shell[data-theme-effective=light] .thread-topbar-surface,
|
|
200
|
+
:root[data-theme-effective=light] .thread-ui-shell .thread-topbar-surface {
|
|
201
|
+
border-color: rgb(226 232 240 / 0.8);
|
|
202
|
+
background: rgb(255 255 255);
|
|
203
|
+
color: rgb(15 23 42);
|
|
204
|
+
box-shadow: 0 10px 30px rgb(15 23 42 / 0.04);
|
|
205
|
+
}
|
|
206
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-mobile-scrim,
|
|
207
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-mobile-scrim,
|
|
208
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-mobile-scrim,
|
|
209
|
+
.thread-ui-shell.dark .thread-mobile-scrim {
|
|
210
|
+
background: rgb(0 0 0 / 0.55);
|
|
211
|
+
}
|
|
212
|
+
.thread-ui-shell .thread-shell-frame {
|
|
213
|
+
display: block;
|
|
214
|
+
height: 100%;
|
|
215
|
+
min-height: 0;
|
|
216
|
+
width: 100%;
|
|
217
|
+
}
|
|
218
|
+
.thread-ui-shell .thread-rooms-rail {
|
|
219
|
+
transform: none;
|
|
220
|
+
translate: -100% 0;
|
|
221
|
+
overflow-x: hidden;
|
|
222
|
+
}
|
|
223
|
+
.thread-ui-shell .thread-rooms-rail.translate-x-0 {
|
|
224
|
+
transform: none;
|
|
225
|
+
translate: 0 0;
|
|
226
|
+
}
|
|
227
|
+
.thread-ui-shell .thread-shell-main {
|
|
228
|
+
height: 100%;
|
|
229
|
+
width: 100%;
|
|
230
|
+
min-width: 0;
|
|
231
|
+
min-height: 0;
|
|
232
|
+
overflow: hidden;
|
|
233
|
+
}
|
|
234
|
+
.thread-ui-shell .thread-shell-card {
|
|
235
|
+
border-color: transparent;
|
|
236
|
+
}
|
|
237
|
+
.thread-ui-shell .thread-desktop-only-flex,
|
|
238
|
+
.thread-ui-shell .thread-desktop-only-inline-flex,
|
|
239
|
+
.thread-ui-shell .thread-mobile-chat-hidden,
|
|
240
|
+
.thread-ui-shell .thread-mobile-workspace-hidden {
|
|
241
|
+
display: none;
|
|
242
|
+
}
|
|
243
|
+
.thread-ui-shell .thread-mobile-only-block {
|
|
244
|
+
display: block;
|
|
245
|
+
}
|
|
246
|
+
.thread-ui-shell .thread-mobile-only-grid {
|
|
247
|
+
display: grid;
|
|
248
|
+
}
|
|
249
|
+
.thread-ui-shell .thread-mobile-only-inline-flex {
|
|
250
|
+
display: inline-flex;
|
|
251
|
+
}
|
|
252
|
+
.thread-ui-shell .thread-main-panel,
|
|
253
|
+
.thread-ui-shell .thread-shell-card {
|
|
254
|
+
height: 100%;
|
|
255
|
+
min-height: 0;
|
|
256
|
+
}
|
|
257
|
+
.thread-ui-shell .thread-topbar-surface {
|
|
258
|
+
min-height: 3.5rem;
|
|
259
|
+
}
|
|
260
|
+
.thread-ui-shell .thread-icon-button,
|
|
261
|
+
.thread-ui-shell .thread-secondary-action {
|
|
262
|
+
border-color: var(--theme-border);
|
|
263
|
+
background: transparent;
|
|
264
|
+
color: var(--theme-fg-soft);
|
|
265
|
+
}
|
|
266
|
+
.thread-ui-shell .thread-icon-button:hover,
|
|
267
|
+
.thread-ui-shell .thread-secondary-action:hover {
|
|
268
|
+
background: var(--theme-hover);
|
|
269
|
+
color: var(--theme-fg);
|
|
270
|
+
}
|
|
271
|
+
.thread-ui-shell .thread-topbar-meta-row {
|
|
272
|
+
color: var(--theme-fg-muted);
|
|
273
|
+
}
|
|
274
|
+
.thread-ui-shell button.thread-topbar-meta-row:hover {
|
|
275
|
+
color: var(--theme-fg);
|
|
276
|
+
}
|
|
277
|
+
.thread-ui-shell .thread-topbar-meta-row[aria-expanded=true] {
|
|
278
|
+
color: var(--theme-fg);
|
|
279
|
+
}
|
|
280
|
+
.thread-ui-shell .thread-topbar-details-trigger {
|
|
281
|
+
border-color: var(--theme-border);
|
|
282
|
+
background: var(--theme-surface);
|
|
283
|
+
color: var(--theme-fg-soft);
|
|
284
|
+
}
|
|
285
|
+
.thread-ui-shell .thread-topbar-details-trigger:hover,
|
|
286
|
+
.thread-ui-shell .thread-topbar-details-trigger[aria-expanded=true] {
|
|
287
|
+
border-color: var(--theme-border-strong);
|
|
288
|
+
background: var(--theme-hover);
|
|
289
|
+
color: var(--theme-fg);
|
|
290
|
+
}
|
|
291
|
+
.thread-ui-shell .thread-topbar-details-popover {
|
|
292
|
+
border-color: var(--theme-border);
|
|
293
|
+
background: var(--theme-panel);
|
|
294
|
+
color: var(--theme-fg);
|
|
295
|
+
box-shadow: var(--theme-shadow);
|
|
296
|
+
}
|
|
297
|
+
.thread-ui-shell .thread-topbar-meta-row .font-mono {
|
|
298
|
+
color: var(--theme-fg-soft);
|
|
299
|
+
}
|
|
300
|
+
.thread-ui-shell button.thread-topbar-meta-row:hover .font-mono {
|
|
301
|
+
color: var(--theme-fg);
|
|
302
|
+
}
|
|
303
|
+
.thread-ui-shell .thread-graph-topbar-actions {
|
|
304
|
+
border-color: var(--theme-border);
|
|
305
|
+
background: var(--theme-surface);
|
|
306
|
+
}
|
|
307
|
+
.thread-ui-shell .thread-graph-topbar-actions > * {
|
|
308
|
+
display: inline-flex;
|
|
309
|
+
align-items: center;
|
|
310
|
+
gap: 0.25rem;
|
|
311
|
+
}
|
|
312
|
+
.thread-ui-shell .thread-graph-topbar-actions button,
|
|
313
|
+
.thread-ui-shell .thread-graph-topbar-actions a {
|
|
314
|
+
min-width: 2rem;
|
|
315
|
+
height: 2rem;
|
|
316
|
+
border-radius: 0.375rem;
|
|
317
|
+
border-color: transparent;
|
|
318
|
+
background: transparent;
|
|
319
|
+
color: var(--theme-fg-soft);
|
|
320
|
+
box-shadow: none;
|
|
321
|
+
}
|
|
322
|
+
.thread-ui-shell .thread-graph-topbar-actions button:hover,
|
|
323
|
+
.thread-ui-shell .thread-graph-topbar-actions a:hover {
|
|
324
|
+
background: var(--theme-hover);
|
|
325
|
+
color: var(--theme-fg);
|
|
326
|
+
}
|
|
327
|
+
.thread-ui-shell .thread-graph-topbar-actions button:disabled,
|
|
328
|
+
.thread-ui-shell .thread-graph-topbar-actions a[aria-disabled=true] {
|
|
329
|
+
cursor: not-allowed;
|
|
330
|
+
opacity: 0.5;
|
|
331
|
+
}
|
|
332
|
+
.thread-ui-shell .thread-graph-dialog,
|
|
333
|
+
.thread-graph-dialog {
|
|
334
|
+
border-color: var(--theme-border);
|
|
335
|
+
color: var(--theme-fg);
|
|
336
|
+
}
|
|
337
|
+
.thread-ui-shell .thread-graph-settings-dialog,
|
|
338
|
+
.thread-graph-settings-dialog,
|
|
339
|
+
.thread-graph-create-thread-dialog {
|
|
340
|
+
border-color: var(--theme-border);
|
|
341
|
+
background: var(--theme-panel);
|
|
342
|
+
color: var(--theme-fg);
|
|
343
|
+
}
|
|
344
|
+
.thread-ui-shell .thread-graph-settings-dialog [data-slot=dialog-description],
|
|
345
|
+
.thread-graph-settings-dialog [data-slot=dialog-description],
|
|
346
|
+
.thread-graph-create-thread-dialog [data-slot=dialog-description] {
|
|
347
|
+
color: var(--theme-fg-muted);
|
|
348
|
+
}
|
|
349
|
+
.thread-ui-shell .thread-graph-settings-dialog [data-slot=dialog-close],
|
|
350
|
+
.thread-graph-settings-dialog [data-slot=dialog-close],
|
|
351
|
+
.thread-graph-create-thread-dialog [data-slot=dialog-close] {
|
|
352
|
+
color: var(--theme-fg-muted);
|
|
353
|
+
}
|
|
354
|
+
.thread-ui-shell .thread-graph-settings-dialog [data-slot=dialog-close]:hover,
|
|
355
|
+
.thread-graph-settings-dialog [data-slot=dialog-close]:hover,
|
|
356
|
+
.thread-graph-create-thread-dialog [data-slot=dialog-close]:hover {
|
|
357
|
+
color: var(--theme-fg);
|
|
358
|
+
}
|
|
359
|
+
.thread-ui-shell .thread-graph-settings-card,
|
|
360
|
+
.thread-ui-shell .thread-graph-theme-mode-group,
|
|
361
|
+
.thread-ui-shell .thread-graph-settings-tabs,
|
|
362
|
+
.thread-graph-settings-dialog .thread-graph-settings-card,
|
|
363
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-group,
|
|
364
|
+
.thread-graph-settings-dialog .thread-graph-settings-tabs {
|
|
365
|
+
border-color: var(--theme-border);
|
|
366
|
+
background: var(--theme-surface);
|
|
367
|
+
}
|
|
368
|
+
.thread-ui-shell .thread-graph-theme-mode-button,
|
|
369
|
+
.thread-ui-shell .thread-graph-settings-tab-button,
|
|
370
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button,
|
|
371
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button {
|
|
372
|
+
color: var(--theme-fg-muted);
|
|
373
|
+
}
|
|
374
|
+
.thread-ui-shell .thread-graph-theme-mode-button:hover:not(:disabled),
|
|
375
|
+
.thread-ui-shell .thread-graph-settings-tab-button:hover:not(:disabled),
|
|
376
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button:hover:not(:disabled),
|
|
377
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button:hover:not(:disabled) {
|
|
378
|
+
background: var(--theme-hover);
|
|
379
|
+
color: var(--theme-fg);
|
|
380
|
+
}
|
|
381
|
+
.thread-ui-shell .thread-graph-theme-mode-button.is-selected,
|
|
382
|
+
.thread-ui-shell .thread-graph-settings-tab-button.is-active,
|
|
383
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button.is-selected,
|
|
384
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button.is-active {
|
|
385
|
+
background: var(--theme-accent-solid);
|
|
386
|
+
color: var(--theme-accent-solid-fg);
|
|
387
|
+
box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
|
|
388
|
+
}
|
|
389
|
+
.thread-ui-shell .thread-graph-theme-mode-button:disabled,
|
|
390
|
+
.thread-ui-shell .thread-graph-settings-tab-button:disabled,
|
|
391
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button:disabled,
|
|
392
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button:disabled {
|
|
393
|
+
cursor: not-allowed;
|
|
394
|
+
opacity: 0.55;
|
|
395
|
+
}
|
|
396
|
+
.thread-graph-settings-dialog .thread-graph-settings-body {
|
|
397
|
+
max-height: min(62vh, 42rem);
|
|
398
|
+
color: var(--theme-fg);
|
|
399
|
+
}
|
|
400
|
+
.thread-graph-settings-dialog .thread-graph-settings-global-content {
|
|
401
|
+
color: var(--theme-fg);
|
|
402
|
+
}
|
|
403
|
+
.thread-graph-settings-dialog .thread-graph-settings-body dt,
|
|
404
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-500,
|
|
405
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-500,
|
|
406
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-400,
|
|
407
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-400 {
|
|
408
|
+
color: var(--theme-fg-muted) !important;
|
|
409
|
+
}
|
|
410
|
+
.thread-graph-settings-dialog .thread-graph-settings-body dd,
|
|
411
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-100,
|
|
412
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-200,
|
|
413
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-300,
|
|
414
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-100,
|
|
415
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-200,
|
|
416
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-300 {
|
|
417
|
+
color: var(--theme-fg) !important;
|
|
418
|
+
}
|
|
419
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-stone-950,
|
|
420
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-stone-900,
|
|
421
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-slate-950,
|
|
422
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-slate-900 {
|
|
423
|
+
background: var(--theme-surface-strong) !important;
|
|
424
|
+
}
|
|
425
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-stone-800,
|
|
426
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-stone-700,
|
|
427
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-slate-800,
|
|
428
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-slate-700 {
|
|
429
|
+
border-color: var(--theme-border) !important;
|
|
430
|
+
}
|
|
431
|
+
.thread-graph-create-thread-input {
|
|
432
|
+
border-color: var(--theme-border);
|
|
433
|
+
background: var(--theme-surface);
|
|
434
|
+
color: var(--theme-fg);
|
|
435
|
+
}
|
|
436
|
+
.thread-graph-create-thread-input::placeholder {
|
|
437
|
+
color: var(--theme-fg-muted);
|
|
438
|
+
}
|
|
439
|
+
.thread-graph-create-thread-input:focus {
|
|
440
|
+
border-color: var(--theme-border-contrast);
|
|
441
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-border-contrast) 18%, transparent);
|
|
442
|
+
}
|
|
443
|
+
.thread-graph-create-thread-submit {
|
|
444
|
+
background: var(--theme-accent-solid);
|
|
445
|
+
color: var(--theme-accent-solid-fg);
|
|
446
|
+
}
|
|
447
|
+
.thread-graph-create-thread-submit:hover:not(:disabled) {
|
|
448
|
+
background: var(--theme-accent-solid-hover);
|
|
449
|
+
}
|
|
450
|
+
.thread-ui-shell .ui-action-danger {
|
|
451
|
+
border: 1px solid color-mix(in oklch, rgb(244 63 94) 48%, var(--theme-border));
|
|
452
|
+
background: color-mix(in oklch, rgb(244 63 94) 18%, var(--theme-panel));
|
|
453
|
+
color: color-mix(in oklch, rgb(254 226 226) 86%, var(--theme-fg));
|
|
454
|
+
}
|
|
455
|
+
.thread-ui-shell .ui-action-danger:hover {
|
|
456
|
+
background: color-mix(in oklch, rgb(244 63 94) 26%, var(--theme-panel));
|
|
457
|
+
color: rgb(254 226 226);
|
|
458
|
+
}
|
|
459
|
+
.thread-ui-shell .thread-mobile-segment {
|
|
460
|
+
background: var(--theme-surface-strong);
|
|
461
|
+
color: var(--theme-fg-soft);
|
|
462
|
+
}
|
|
463
|
+
.thread-ui-shell .thread-mobile-segment:hover {
|
|
464
|
+
background: var(--theme-hover);
|
|
465
|
+
color: var(--theme-fg);
|
|
466
|
+
}
|
|
467
|
+
.thread-ui-shell .thread-mobile-segment.is-active {
|
|
468
|
+
background: var(--theme-accent-solid);
|
|
469
|
+
color: var(--theme-accent-solid-fg);
|
|
470
|
+
}
|
|
471
|
+
.thread-ui-shell .thread-sidebar-card {
|
|
472
|
+
border-color: transparent;
|
|
473
|
+
background: var(--theme-surface-strong);
|
|
474
|
+
color: var(--theme-fg-soft);
|
|
475
|
+
}
|
|
476
|
+
.thread-ui-shell .thread-graph-room-card {
|
|
477
|
+
border-color: rgb(226 232 240 / 0.9);
|
|
478
|
+
background: rgb(248 250 252);
|
|
479
|
+
color: rgb(51 65 85);
|
|
480
|
+
}
|
|
481
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card {
|
|
482
|
+
border-color: rgb(226 232 240 / 0.9);
|
|
483
|
+
background: rgb(248 250 252);
|
|
484
|
+
color: rgb(51 65 85);
|
|
485
|
+
}
|
|
486
|
+
.thread-ui-shell .thread-sidebar-card:hover {
|
|
487
|
+
border-color: var(--theme-border);
|
|
488
|
+
background: var(--theme-panel);
|
|
489
|
+
color: var(--theme-fg);
|
|
490
|
+
}
|
|
491
|
+
.thread-ui-shell .thread-graph-room-card:hover {
|
|
492
|
+
border-color: rgb(203 213 225);
|
|
493
|
+
background: rgb(255 255 255);
|
|
494
|
+
color: rgb(15 23 42);
|
|
495
|
+
}
|
|
496
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card:hover {
|
|
497
|
+
border-color: rgb(203 213 225);
|
|
498
|
+
background: rgb(255 255 255);
|
|
499
|
+
color: rgb(15 23 42);
|
|
500
|
+
}
|
|
501
|
+
.thread-ui-shell .thread-sidebar-card-active {
|
|
502
|
+
border-color: var(--theme-accent-solid);
|
|
503
|
+
background: var(--theme-accent-solid);
|
|
504
|
+
color: var(--theme-accent-solid-fg);
|
|
505
|
+
box-shadow: 0 12px 30px oklch(0.22 0.024 255 / 0.18);
|
|
506
|
+
}
|
|
507
|
+
.thread-ui-shell .thread-graph-room-card.is-active {
|
|
508
|
+
border-color: rgb(203 213 225);
|
|
509
|
+
background: rgb(241 245 249);
|
|
510
|
+
color: rgb(15 23 42);
|
|
511
|
+
box-shadow: 0 8px 22px rgb(15 23 42 / 0.06);
|
|
512
|
+
}
|
|
513
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card.is-active {
|
|
514
|
+
border-color: rgb(203 213 225);
|
|
515
|
+
background: rgb(241 245 249);
|
|
516
|
+
color: rgb(15 23 42);
|
|
517
|
+
box-shadow: 0 8px 22px rgb(15 23 42 / 0.06);
|
|
518
|
+
}
|
|
519
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card.is-active,
|
|
520
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card.is-active,
|
|
521
|
+
.thread-ui-shell.dark .thread-graph-room-card.is-active {
|
|
522
|
+
border-color: #3c4556;
|
|
523
|
+
background: #262c38;
|
|
524
|
+
color: rgb(241 245 249);
|
|
525
|
+
box-shadow: 0 10px 24px rgb(0 0 0 / 0.18);
|
|
526
|
+
}
|
|
527
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card,
|
|
528
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card,
|
|
529
|
+
.thread-ui-shell.dark .thread-graph-room-card {
|
|
530
|
+
border-color: transparent;
|
|
531
|
+
background: #1d222c;
|
|
532
|
+
color: rgb(203 213 225);
|
|
533
|
+
}
|
|
534
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card:hover,
|
|
535
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card:hover,
|
|
536
|
+
.thread-ui-shell.dark .thread-graph-room-card:hover {
|
|
537
|
+
border-color: #343b48;
|
|
538
|
+
background: #222733;
|
|
539
|
+
color: rgb(241 245 249);
|
|
540
|
+
}
|
|
541
|
+
.thread-ui-shell .thread-sidebar-card-icon {
|
|
542
|
+
background: var(--theme-panel);
|
|
543
|
+
color: var(--theme-fg-muted);
|
|
544
|
+
}
|
|
545
|
+
.thread-ui-shell .thread-graph-room-card-icon {
|
|
546
|
+
background: rgb(255 255 255);
|
|
547
|
+
color: rgb(100 116 139);
|
|
548
|
+
}
|
|
549
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card-icon {
|
|
550
|
+
background: rgb(255 255 255);
|
|
551
|
+
color: rgb(100 116 139);
|
|
552
|
+
}
|
|
553
|
+
.thread-ui-shell .thread-sidebar-card-icon.is-active {
|
|
554
|
+
background: color-mix(in oklch, var(--theme-accent-solid-fg) 16%, transparent);
|
|
555
|
+
color: var(--theme-accent-solid-fg);
|
|
556
|
+
}
|
|
557
|
+
.thread-ui-shell .thread-graph-room-card-icon.is-active {
|
|
558
|
+
background: rgb(226 232 240);
|
|
559
|
+
color: rgb(15 23 42);
|
|
560
|
+
}
|
|
561
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card-icon.is-active {
|
|
562
|
+
background: rgb(226 232 240);
|
|
563
|
+
color: rgb(15 23 42);
|
|
564
|
+
}
|
|
565
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card-icon.is-active,
|
|
566
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card-icon.is-active,
|
|
567
|
+
.thread-ui-shell.dark .thread-graph-room-card-icon.is-active {
|
|
568
|
+
background: #12151c;
|
|
569
|
+
color: rgb(226 232 240);
|
|
570
|
+
}
|
|
571
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card-icon,
|
|
572
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card-icon,
|
|
573
|
+
.thread-ui-shell.dark .thread-graph-room-card-icon {
|
|
574
|
+
background: #12151c;
|
|
575
|
+
color: rgb(148 163 184);
|
|
576
|
+
}
|
|
577
|
+
.thread-ui-shell .thread-sidebar-card-active .thread-sidebar-card-title,
|
|
578
|
+
.thread-ui-shell .thread-sidebar-card-active p,
|
|
579
|
+
.thread-ui-shell .thread-sidebar-card-active span,
|
|
580
|
+
.thread-ui-shell .thread-sidebar-card-active button,
|
|
581
|
+
.thread-ui-shell .thread-graph-room-card.is-active .thread-graph-room-card-title,
|
|
582
|
+
.thread-ui-shell .thread-graph-room-card.is-active p,
|
|
583
|
+
.thread-ui-shell .thread-graph-room-card.is-active button {
|
|
584
|
+
color: inherit;
|
|
585
|
+
}
|
|
586
|
+
.thread-ui-shell .thread-card-quiet-button {
|
|
587
|
+
color: var(--theme-fg-muted);
|
|
588
|
+
}
|
|
589
|
+
.thread-ui-shell .thread-card-quiet-button:hover {
|
|
590
|
+
background: color-mix(in oklch, var(--theme-hover) 80%, transparent);
|
|
591
|
+
color: var(--theme-fg);
|
|
592
|
+
}
|
|
593
|
+
.thread-ui-shell .thread-card-session-copy-button {
|
|
594
|
+
opacity: 0;
|
|
595
|
+
}
|
|
596
|
+
.thread-ui-shell .thread-graph-room-card:hover .thread-card-session-copy-button,
|
|
597
|
+
.thread-ui-shell .thread-card-session-copy-button:focus-visible,
|
|
598
|
+
.thread-ui-shell .thread-card-session-copy-button:active {
|
|
599
|
+
opacity: 1;
|
|
600
|
+
}
|
|
601
|
+
.thread-ui-shell .thread-card-danger-button {
|
|
602
|
+
color: oklch(0.62 0.16 25);
|
|
603
|
+
}
|
|
604
|
+
.thread-ui-shell .thread-card-danger-button:hover {
|
|
605
|
+
background: rgb(254 226 226);
|
|
606
|
+
}
|
|
607
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-card-danger-button:hover,
|
|
608
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-card-danger-button:hover,
|
|
609
|
+
.thread-ui-shell.dark .thread-card-danger-button:hover {
|
|
610
|
+
background: rgb(127 29 29 / 0.32);
|
|
611
|
+
}
|
|
612
|
+
.thread-ui-shell .thread-new-thread-button,
|
|
613
|
+
.thread-ui-shell .thread-graph-new-room-button {
|
|
614
|
+
min-width: 0;
|
|
615
|
+
}
|
|
616
|
+
.thread-ui-shell .thread-graph-new-room-strip {
|
|
617
|
+
border-color: var(--theme-border);
|
|
618
|
+
}
|
|
619
|
+
.thread-ui-shell .thread-graph-new-room-button {
|
|
620
|
+
background: var(--theme-accent-solid);
|
|
621
|
+
color: var(--theme-accent-solid-fg);
|
|
622
|
+
transition: background-color 160ms ease, transform 160ms ease;
|
|
623
|
+
}
|
|
624
|
+
.thread-ui-shell .thread-graph-new-room-button:hover {
|
|
625
|
+
background: var(--theme-accent-solid-hover);
|
|
626
|
+
transform: translateY(-1px);
|
|
627
|
+
}
|
|
628
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-new-room-button,
|
|
629
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-new-room-button,
|
|
630
|
+
.thread-ui-shell.dark .thread-graph-new-room-button {
|
|
631
|
+
border: 1px solid #343b48;
|
|
632
|
+
background: #222733;
|
|
633
|
+
color: rgb(241 245 249);
|
|
634
|
+
}
|
|
635
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-new-room-button:hover,
|
|
636
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-new-room-button:hover,
|
|
637
|
+
.thread-ui-shell.dark .thread-graph-new-room-button:hover {
|
|
638
|
+
border-color: #465164;
|
|
639
|
+
background: #2b313d;
|
|
640
|
+
}
|
|
641
|
+
`);tr(`.thread-ui-shell .thread-detail-surface {
|
|
642
|
+
border-color: transparent;
|
|
643
|
+
background: var(--theme-surface);
|
|
644
|
+
box-shadow: none;
|
|
645
|
+
}
|
|
646
|
+
.thread-ui-shell .thread-graph-chat-panel {
|
|
647
|
+
background: var(--theme-surface);
|
|
648
|
+
color: var(--theme-fg);
|
|
649
|
+
}
|
|
650
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-chat-panel,
|
|
651
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-chat-panel,
|
|
652
|
+
.thread-ui-shell.dark .thread-graph-chat-panel {
|
|
653
|
+
background: var(--theme-surface);
|
|
654
|
+
color: var(--theme-fg);
|
|
655
|
+
}
|
|
656
|
+
.thread-ui-shell .thread-graph-scroll-container {
|
|
657
|
+
background: var(--theme-surface);
|
|
658
|
+
color: var(--theme-fg);
|
|
659
|
+
scrollbar-color: rgb(203 213 225) transparent;
|
|
660
|
+
}
|
|
661
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-scroll-container,
|
|
662
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-scroll-container,
|
|
663
|
+
.thread-ui-shell.dark .thread-graph-scroll-container {
|
|
664
|
+
background: var(--theme-surface);
|
|
665
|
+
color: var(--theme-fg);
|
|
666
|
+
scrollbar-color: #374151 transparent;
|
|
667
|
+
}
|
|
668
|
+
.thread-ui-shell .thread-graph-scroll-content {
|
|
669
|
+
min-height: 100%;
|
|
670
|
+
padding: 0.75rem 0 max(0rem, var(--thread-graph-chat-scroll-bottom-spacer, 0px));
|
|
671
|
+
}
|
|
672
|
+
.thread-ui-shell .thread-graph-message-list {
|
|
673
|
+
display: flex;
|
|
674
|
+
flex-direction: column;
|
|
675
|
+
gap: 1rem;
|
|
676
|
+
}
|
|
677
|
+
.thread-ui-shell .thread-graph-message-section {
|
|
678
|
+
border-top: 1px solid var(--theme-border);
|
|
679
|
+
}
|
|
680
|
+
.thread-ui-shell .thread-graph-history-control,
|
|
681
|
+
.thread-ui-shell .thread-graph-empty-state {
|
|
682
|
+
color: var(--theme-fg-muted);
|
|
683
|
+
}
|
|
684
|
+
.thread-ui-shell .thread-graph-history-button,
|
|
685
|
+
.thread-ui-shell .thread-graph-turn-index,
|
|
686
|
+
.thread-ui-shell .thread-graph-turn-collapse {
|
|
687
|
+
border-color: var(--theme-border);
|
|
688
|
+
background: var(--theme-panel);
|
|
689
|
+
color: var(--theme-fg-muted);
|
|
690
|
+
}
|
|
691
|
+
.thread-ui-shell .thread-graph-history-button:hover,
|
|
692
|
+
.thread-ui-shell .thread-graph-turn-collapse:hover {
|
|
693
|
+
background: var(--theme-hover);
|
|
694
|
+
color: var(--theme-fg);
|
|
695
|
+
}
|
|
696
|
+
.thread-ui-shell .thread-graph-turn {
|
|
697
|
+
border-radius: 0;
|
|
698
|
+
}
|
|
699
|
+
.thread-ui-shell .thread-graph-turn-header {
|
|
700
|
+
color: var(--theme-fg-muted);
|
|
701
|
+
}
|
|
702
|
+
.thread-ui-shell .thread-graph-turn-time {
|
|
703
|
+
color: var(--theme-fg-muted);
|
|
704
|
+
}
|
|
705
|
+
.thread-ui-shell .thread-graph-worked-summary {
|
|
706
|
+
color: var(--theme-fg-muted);
|
|
707
|
+
}
|
|
708
|
+
.thread-ui-shell .thread-graph-worked-summary:hover {
|
|
709
|
+
color: var(--theme-fg-soft);
|
|
710
|
+
}
|
|
711
|
+
.thread-ui-shell .thread-graph-worked-rule {
|
|
712
|
+
background: var(--theme-border);
|
|
713
|
+
}
|
|
714
|
+
.thread-ui-shell :where(.text-stone-100, .text-stone-200, .text-stone-300) {
|
|
715
|
+
color: var(--theme-fg) !important;
|
|
716
|
+
}
|
|
717
|
+
.thread-ui-shell :where(.text-stone-400, .text-stone-500, .text-stone-600) {
|
|
718
|
+
color: var(--theme-fg-muted) !important;
|
|
719
|
+
}
|
|
720
|
+
.thread-ui-shell :where(.border-stone-600, .border-stone-700, .border-stone-700\\/90, .border-stone-800, .border-stone-800\\/80) {
|
|
721
|
+
border-color: var(--theme-border) !important;
|
|
722
|
+
}
|
|
723
|
+
.thread-ui-shell :where(.bg-stone-800, .bg-stone-800\\/60, .bg-stone-800\\/80, .bg-stone-900, .bg-stone-900\\/60, .bg-stone-900\\/70, .bg-stone-900\\/72, .bg-stone-900\\/80, .bg-stone-950, .bg-stone-950\\/70, .bg-stone-950\\/90) {
|
|
724
|
+
background: var(--theme-surface-strong) !important;
|
|
725
|
+
}
|
|
726
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-sky-100, .text-sky-50),
|
|
727
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-sky-100, .text-sky-50) {
|
|
728
|
+
color: rgb(3 105 161);
|
|
729
|
+
}
|
|
730
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-emerald-100, .text-emerald-50),
|
|
731
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-emerald-100, .text-emerald-50) {
|
|
732
|
+
color: rgb(21 128 61);
|
|
733
|
+
}
|
|
734
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-rose-100, .text-rose-50),
|
|
735
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-rose-100, .text-rose-50) {
|
|
736
|
+
color: rgb(190 24 93);
|
|
737
|
+
}
|
|
738
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-amber-100, .text-amber-50, .text-amber-200),
|
|
739
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-amber-100, .text-amber-50, .text-amber-200) {
|
|
740
|
+
color: rgb(120 53 15);
|
|
741
|
+
}
|
|
742
|
+
.thread-ui-shell[data-theme-effective=light] .text-fuchsia-100,
|
|
743
|
+
:root[data-theme-effective=light] .thread-ui-shell .text-fuchsia-100 {
|
|
744
|
+
color: rgb(162 28 175);
|
|
745
|
+
}
|
|
746
|
+
.thread-ui-shell[data-theme-effective=light] .text-violet-100,
|
|
747
|
+
:root[data-theme-effective=light] .thread-ui-shell .text-violet-100 {
|
|
748
|
+
color: rgb(109 40 217);
|
|
749
|
+
}
|
|
750
|
+
.thread-ui-shell[data-theme-effective=light] .text-lime-100,
|
|
751
|
+
:root[data-theme-effective=light] .thread-ui-shell .text-lime-100 {
|
|
752
|
+
color: rgb(77 124 15);
|
|
753
|
+
}
|
|
754
|
+
.thread-ui-shell[data-theme-effective=light] :where(.bg-sky-300\\/10, .bg-sky-300\\/15, .bg-emerald-300\\/10, .bg-emerald-300\\/15, .bg-amber-300\\/10, .bg-amber-300\\/15, .bg-rose-300\\/10, .bg-rose-300\\/15, .bg-fuchsia-300\\/10, .bg-fuchsia-300\\/15, .bg-violet-300\\/10, .bg-violet-300\\/15, .bg-lime-300\\/10, .bg-lime-300\\/15),
|
|
755
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.bg-sky-300\\/10, .bg-sky-300\\/15, .bg-emerald-300\\/10, .bg-emerald-300\\/15, .bg-amber-300\\/10, .bg-amber-300\\/15, .bg-rose-300\\/10, .bg-rose-300\\/15, .bg-fuchsia-300\\/10, .bg-fuchsia-300\\/15, .bg-violet-300\\/10, .bg-violet-300\\/15, .bg-lime-300\\/10, .bg-lime-300\\/15) {
|
|
756
|
+
filter: saturate(0.72) brightness(0.97);
|
|
757
|
+
}
|
|
758
|
+
.thread-ui-shell .thread-token-popover {
|
|
759
|
+
border-color: var(--theme-border);
|
|
760
|
+
background: var(--theme-panel);
|
|
761
|
+
color: var(--theme-fg);
|
|
762
|
+
}
|
|
763
|
+
.thread-ui-shell .thread-token-popover-row {
|
|
764
|
+
border-color: var(--theme-border);
|
|
765
|
+
background: var(--theme-surface);
|
|
766
|
+
}
|
|
767
|
+
.thread-ui-shell .thread-token-popover-text {
|
|
768
|
+
color: var(--theme-fg-soft);
|
|
769
|
+
}
|
|
770
|
+
.thread-ui-shell .thread-token-popover-strong {
|
|
771
|
+
color: var(--theme-fg);
|
|
772
|
+
}
|
|
773
|
+
.thread-ui-shell .token-badge-in {
|
|
774
|
+
border-color: rgb(22 101 52 / 0.32);
|
|
775
|
+
background: rgb(220 252 231 / 0.72);
|
|
776
|
+
color: rgb(20 83 45);
|
|
777
|
+
}
|
|
778
|
+
.thread-ui-shell .token-badge-cache {
|
|
779
|
+
border-color: rgb(3 105 161 / 0.32);
|
|
780
|
+
background: rgb(224 242 254 / 0.76);
|
|
781
|
+
color: rgb(7 89 133);
|
|
782
|
+
}
|
|
783
|
+
.thread-ui-shell .token-badge-out {
|
|
784
|
+
border-color: rgb(109 40 217 / 0.28);
|
|
785
|
+
background: rgb(237 233 254 / 0.76);
|
|
786
|
+
color: rgb(91 33 182);
|
|
787
|
+
}
|
|
788
|
+
.thread-ui-shell .token-badge-reason {
|
|
789
|
+
border-color: rgb(146 64 14 / 0.28);
|
|
790
|
+
background: rgb(254 243 199 / 0.72);
|
|
791
|
+
color: rgb(120 53 15);
|
|
792
|
+
}
|
|
793
|
+
.thread-ui-shell .token-badge-total {
|
|
794
|
+
border-color: rgb(77 124 15 / 0.3);
|
|
795
|
+
background: rgb(236 252 203 / 0.72);
|
|
796
|
+
color: rgb(63 98 18);
|
|
797
|
+
}
|
|
798
|
+
.thread-ui-shell .token-badge-empty {
|
|
799
|
+
border-color: var(--theme-border-strong);
|
|
800
|
+
background: var(--theme-surface);
|
|
801
|
+
color: var(--theme-fg-soft);
|
|
802
|
+
}
|
|
803
|
+
.thread-ui-shell .thread-token-badge-value {
|
|
804
|
+
color: currentColor;
|
|
805
|
+
}
|
|
806
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-token-popover,
|
|
807
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-token-popover,
|
|
808
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-token-popover,
|
|
809
|
+
.thread-ui-shell.dark .thread-token-popover {
|
|
810
|
+
border-color: #303642;
|
|
811
|
+
background: #171a22;
|
|
812
|
+
}
|
|
813
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-token-popover-row,
|
|
814
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-token-popover-row,
|
|
815
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-token-popover-row,
|
|
816
|
+
.thread-ui-shell.dark .thread-token-popover-row {
|
|
817
|
+
border-color: #303642;
|
|
818
|
+
background: #1d222c;
|
|
819
|
+
}
|
|
820
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-in,
|
|
821
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-cache,
|
|
822
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-out,
|
|
823
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-reason,
|
|
824
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-total,
|
|
825
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-in,
|
|
826
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-cache,
|
|
827
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-out,
|
|
828
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-reason,
|
|
829
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-total,
|
|
830
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-in,
|
|
831
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-cache,
|
|
832
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-out,
|
|
833
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-reason,
|
|
834
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-total,
|
|
835
|
+
.thread-ui-shell.dark .token-badge-in,
|
|
836
|
+
.thread-ui-shell.dark .token-badge-cache,
|
|
837
|
+
.thread-ui-shell.dark .token-badge-out,
|
|
838
|
+
.thread-ui-shell.dark .token-badge-reason,
|
|
839
|
+
.thread-ui-shell.dark .token-badge-total {
|
|
840
|
+
background-color: color-mix(in oklch, currentColor 12%, transparent);
|
|
841
|
+
}
|
|
842
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-in,
|
|
843
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-in,
|
|
844
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-in,
|
|
845
|
+
.thread-ui-shell.dark .token-badge-in {
|
|
846
|
+
color: rgb(134 239 172);
|
|
847
|
+
}
|
|
848
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-cache,
|
|
849
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-cache,
|
|
850
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-cache,
|
|
851
|
+
.thread-ui-shell.dark .token-badge-cache {
|
|
852
|
+
color: rgb(125 211 252);
|
|
853
|
+
}
|
|
854
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-out,
|
|
855
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-out,
|
|
856
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-out,
|
|
857
|
+
.thread-ui-shell.dark .token-badge-out {
|
|
858
|
+
color: rgb(196 181 253);
|
|
859
|
+
}
|
|
860
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-reason,
|
|
861
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-reason,
|
|
862
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-reason,
|
|
863
|
+
.thread-ui-shell.dark .token-badge-reason {
|
|
864
|
+
color: rgb(252 211 77);
|
|
865
|
+
}
|
|
866
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-total,
|
|
867
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-total,
|
|
868
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-total,
|
|
869
|
+
.thread-ui-shell.dark .token-badge-total {
|
|
870
|
+
color: rgb(190 242 100);
|
|
871
|
+
}
|
|
872
|
+
.thread-ui-shell .thread-graph-event,
|
|
873
|
+
.thread-ui-shell .thread-graph-event-card,
|
|
874
|
+
.thread-ui-shell .thread-graph-history-group,
|
|
875
|
+
.thread-ui-shell .thread-graph-history-group-card {
|
|
876
|
+
border-color: var(--theme-border);
|
|
877
|
+
background: var(--theme-panel);
|
|
878
|
+
color: var(--theme-fg);
|
|
879
|
+
}
|
|
880
|
+
.thread-ui-shell .thread-graph-event-card,
|
|
881
|
+
.thread-ui-shell .thread-graph-history-group-card {
|
|
882
|
+
background: var(--theme-surface);
|
|
883
|
+
}
|
|
884
|
+
.thread-ui-shell .thread-graph-event-line,
|
|
885
|
+
.thread-ui-shell .thread-graph-history-group-toggle {
|
|
886
|
+
color: var(--theme-fg);
|
|
887
|
+
}
|
|
888
|
+
.thread-ui-shell .thread-graph-history-group-list {
|
|
889
|
+
border-color: var(--theme-border);
|
|
890
|
+
}
|
|
891
|
+
`);tr(`.thread-ui-shell .thread-workspace-panel {
|
|
892
|
+
background: var(--theme-panel);
|
|
893
|
+
}
|
|
894
|
+
.thread-ui-shell .thread-workspace-card {
|
|
895
|
+
background: var(--theme-surface);
|
|
896
|
+
}
|
|
897
|
+
.thread-ui-shell .thread-workspace-collapse-tab,
|
|
898
|
+
.thread-ui-shell .thread-workspace-small-toggle,
|
|
899
|
+
.thread-ui-shell .thread-workspace-expand-fab,
|
|
900
|
+
.thread-ui-shell .thread-graph-panel-expand-fab {
|
|
901
|
+
align-items: center;
|
|
902
|
+
justify-content: center;
|
|
903
|
+
width: 2rem;
|
|
904
|
+
height: 2rem;
|
|
905
|
+
border: 1px solid var(--theme-border);
|
|
906
|
+
border-radius: 999px;
|
|
907
|
+
background: color-mix(in oklch, var(--theme-panel) 92%, transparent);
|
|
908
|
+
color: var(--theme-fg-soft);
|
|
909
|
+
box-shadow: 0 10px 26px color-mix(in oklch, var(--theme-bg) 62%, transparent);
|
|
910
|
+
transition:
|
|
911
|
+
background-color 160ms ease,
|
|
912
|
+
border-color 160ms ease,
|
|
913
|
+
color 160ms ease,
|
|
914
|
+
transform 160ms ease,
|
|
915
|
+
box-shadow 160ms ease;
|
|
916
|
+
}
|
|
917
|
+
.thread-ui-shell .thread-workspace-collapse-tab:hover,
|
|
918
|
+
.thread-ui-shell .thread-workspace-small-toggle:hover,
|
|
919
|
+
.thread-ui-shell .thread-workspace-expand-fab:hover,
|
|
920
|
+
.thread-ui-shell .thread-graph-panel-expand-fab:hover {
|
|
921
|
+
border-color: var(--theme-border-strong);
|
|
922
|
+
background: var(--theme-hover);
|
|
923
|
+
color: var(--theme-fg);
|
|
924
|
+
box-shadow: 0 14px 30px color-mix(in oklch, var(--theme-bg) 72%, transparent);
|
|
925
|
+
}
|
|
926
|
+
.thread-ui-shell .thread-workspace-collapse-tab {
|
|
927
|
+
position: absolute;
|
|
928
|
+
left: -1rem;
|
|
929
|
+
top: 50%;
|
|
930
|
+
z-index: 30;
|
|
931
|
+
transform: translateY(-50%);
|
|
932
|
+
}
|
|
933
|
+
.thread-ui-shell .thread-workspace-collapse-tab:hover {
|
|
934
|
+
transform: translateY(-50%) translateX(-1px);
|
|
935
|
+
}
|
|
936
|
+
.thread-ui-shell .thread-workspace-expand-fab {
|
|
937
|
+
position: absolute;
|
|
938
|
+
right: 0.75rem;
|
|
939
|
+
top: 50%;
|
|
940
|
+
z-index: 30;
|
|
941
|
+
transform: translateY(-50%);
|
|
942
|
+
}
|
|
943
|
+
.thread-ui-shell .thread-workspace-expand-fab:hover {
|
|
944
|
+
transform: translateY(-50%) translateX(-1px);
|
|
945
|
+
}
|
|
946
|
+
.thread-ui-shell .thread-chat-usage-footer {
|
|
947
|
+
background: var(--theme-surface);
|
|
948
|
+
color: rgb(148 163 184);
|
|
949
|
+
}
|
|
950
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-chat-usage-footer,
|
|
951
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-chat-usage-footer,
|
|
952
|
+
.thread-ui-shell.dark .thread-chat-usage-footer {
|
|
953
|
+
background: var(--theme-surface);
|
|
954
|
+
color: rgb(100 116 139);
|
|
955
|
+
}
|
|
956
|
+
.thread-ui-shell .thread-graph-composer-host {
|
|
957
|
+
border-top: 1px solid rgb(226 232 240);
|
|
958
|
+
background: var(--theme-surface);
|
|
959
|
+
padding: 0.5rem 0.75rem calc(env(safe-area-inset-bottom) + 0.5rem);
|
|
960
|
+
}
|
|
961
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-host,
|
|
962
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-host,
|
|
963
|
+
.thread-ui-shell.dark .thread-graph-composer-host {
|
|
964
|
+
border-top-color: #2a2f3a;
|
|
965
|
+
background: var(--theme-surface);
|
|
966
|
+
}
|
|
967
|
+
.thread-ui-shell .thread-graph-composer-host > .thread-composer-layer,
|
|
968
|
+
.thread-ui-shell .thread-graph-composer-host > .thread-graph-composer-layer {
|
|
969
|
+
width: 100%;
|
|
970
|
+
}
|
|
971
|
+
.thread-ui-shell .thread-split-chat-pane,
|
|
972
|
+
.thread-ui-shell .thread-split-workspace-pane {
|
|
973
|
+
width: 100%;
|
|
974
|
+
min-height: 0;
|
|
975
|
+
}
|
|
976
|
+
.thread-ui-shell .thread-split-chat-pane {
|
|
977
|
+
min-width: 0;
|
|
978
|
+
}
|
|
979
|
+
.thread-ui-shell .thread-split-region,
|
|
980
|
+
.thread-ui-shell .thread-split-container {
|
|
981
|
+
height: 100%;
|
|
982
|
+
min-height: 0;
|
|
983
|
+
overflow: hidden;
|
|
984
|
+
}
|
|
985
|
+
.thread-ui-shell .thread-graph-shell-desktop-split {
|
|
986
|
+
display: none !important;
|
|
987
|
+
}
|
|
988
|
+
.thread-ui-shell .thread-graph-shell-mobile-split {
|
|
989
|
+
display: block !important;
|
|
990
|
+
}
|
|
991
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split {
|
|
992
|
+
display: flex !important;
|
|
993
|
+
}
|
|
994
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-mobile-split {
|
|
995
|
+
display: none !important;
|
|
996
|
+
}
|
|
997
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
998
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-workspace-pane,
|
|
999
|
+
.thread-ui-shell .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
1000
|
+
.thread-ui-shell .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
1001
|
+
min-width: 0;
|
|
1002
|
+
height: 100%;
|
|
1003
|
+
}
|
|
1004
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
1005
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
1006
|
+
flex: 1 1 0;
|
|
1007
|
+
min-width: 0;
|
|
1008
|
+
width: auto;
|
|
1009
|
+
}
|
|
1010
|
+
.thread-ui-shell[data-thread-layout=desktop] {
|
|
1011
|
+
padding: 0.5rem;
|
|
1012
|
+
}
|
|
1013
|
+
.thread-ui-shell[data-thread-layout=desktop].thread-ui-viewport-constrained {
|
|
1014
|
+
height: 100svh;
|
|
1015
|
+
max-height: 100svh;
|
|
1016
|
+
}
|
|
1017
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-shell-frame {
|
|
1018
|
+
display: grid;
|
|
1019
|
+
grid-template-columns: 264px minmax(0, 1fr);
|
|
1020
|
+
gap: 0.5rem;
|
|
1021
|
+
height: 100%;
|
|
1022
|
+
min-height: 0;
|
|
1023
|
+
}
|
|
1024
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-desktop-only-flex {
|
|
1025
|
+
display: flex !important;
|
|
1026
|
+
}
|
|
1027
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-desktop-only-inline-flex {
|
|
1028
|
+
display: inline-flex !important;
|
|
1029
|
+
}
|
|
1030
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-only-block,
|
|
1031
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-only-grid,
|
|
1032
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-only-inline-flex {
|
|
1033
|
+
display: none !important;
|
|
1034
|
+
}
|
|
1035
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-chat-hidden,
|
|
1036
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-workspace-hidden {
|
|
1037
|
+
display: block !important;
|
|
1038
|
+
}
|
|
1039
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-desktop-collapsed-hidden {
|
|
1040
|
+
display: none;
|
|
1041
|
+
}
|
|
1042
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-shell-frame.is-rail-collapsed {
|
|
1043
|
+
grid-template-columns: 56px minmax(0, 1fr);
|
|
1044
|
+
}
|
|
1045
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-rooms-rail {
|
|
1046
|
+
position: static;
|
|
1047
|
+
z-index: auto;
|
|
1048
|
+
width: auto;
|
|
1049
|
+
min-width: 0;
|
|
1050
|
+
height: 100%;
|
|
1051
|
+
transform: none;
|
|
1052
|
+
translate: 0 0;
|
|
1053
|
+
pointer-events: auto;
|
|
1054
|
+
border: 1px solid var(--theme-border);
|
|
1055
|
+
border-radius: 12px;
|
|
1056
|
+
box-shadow: var(--theme-shadow);
|
|
1057
|
+
}
|
|
1058
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-rooms-rail-header {
|
|
1059
|
+
height: 4rem;
|
|
1060
|
+
align-items: center;
|
|
1061
|
+
padding-bottom: 0;
|
|
1062
|
+
}
|
|
1063
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-shell-card {
|
|
1064
|
+
border: 1px solid var(--theme-border);
|
|
1065
|
+
border-radius: 12px;
|
|
1066
|
+
}
|
|
1067
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-topbar-row {
|
|
1068
|
+
min-height: 4rem;
|
|
1069
|
+
padding-left: 1.25rem;
|
|
1070
|
+
padding-right: 1.25rem;
|
|
1071
|
+
}
|
|
1072
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-view-switch {
|
|
1073
|
+
display: none !important;
|
|
1074
|
+
}
|
|
1075
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-region {
|
|
1076
|
+
padding: 0.5rem;
|
|
1077
|
+
}
|
|
1078
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-container.has-workspace {
|
|
1079
|
+
display: flex;
|
|
1080
|
+
align-items: stretch;
|
|
1081
|
+
min-width: 0;
|
|
1082
|
+
min-height: 0;
|
|
1083
|
+
}
|
|
1084
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-chat-pane {
|
|
1085
|
+
flex: 0 0 var(--thread-chat-percent, 54%);
|
|
1086
|
+
min-width: min(31rem, 100%);
|
|
1087
|
+
width: auto;
|
|
1088
|
+
height: 100%;
|
|
1089
|
+
display: block;
|
|
1090
|
+
}
|
|
1091
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-workspace-pane {
|
|
1092
|
+
flex: 0 0 var(--thread-workspace-percent, 46%);
|
|
1093
|
+
min-width: 19rem;
|
|
1094
|
+
width: auto;
|
|
1095
|
+
height: 100%;
|
|
1096
|
+
display: block;
|
|
1097
|
+
}
|
|
1098
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-resize-handle {
|
|
1099
|
+
display: flex !important;
|
|
1100
|
+
}
|
|
1101
|
+
@media (min-width: 640px) {
|
|
1102
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) {
|
|
1103
|
+
padding: 0.5rem;
|
|
1104
|
+
}
|
|
1105
|
+
.thread-ui-shell:not([data-thread-layout=mobile]).thread-ui-viewport-constrained {
|
|
1106
|
+
height: 100svh;
|
|
1107
|
+
max-height: 100svh;
|
|
1108
|
+
}
|
|
1109
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-shell-frame {
|
|
1110
|
+
display: grid;
|
|
1111
|
+
grid-template-columns: 264px minmax(0, 1fr);
|
|
1112
|
+
gap: 0.5rem;
|
|
1113
|
+
height: 100%;
|
|
1114
|
+
min-height: 0;
|
|
1115
|
+
}
|
|
1116
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-desktop-only-flex {
|
|
1117
|
+
display: flex !important;
|
|
1118
|
+
}
|
|
1119
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-desktop-only-inline-flex {
|
|
1120
|
+
display: inline-flex !important;
|
|
1121
|
+
}
|
|
1122
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-only-block,
|
|
1123
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-only-grid,
|
|
1124
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-only-inline-flex {
|
|
1125
|
+
display: none !important;
|
|
1126
|
+
}
|
|
1127
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-chat-hidden,
|
|
1128
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-workspace-hidden {
|
|
1129
|
+
display: block !important;
|
|
1130
|
+
}
|
|
1131
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-desktop-collapsed-hidden {
|
|
1132
|
+
display: none;
|
|
1133
|
+
}
|
|
1134
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-shell-frame.is-rail-collapsed {
|
|
1135
|
+
grid-template-columns: 56px minmax(0, 1fr);
|
|
1136
|
+
}
|
|
1137
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-rooms-rail {
|
|
1138
|
+
position: static;
|
|
1139
|
+
z-index: auto;
|
|
1140
|
+
width: auto;
|
|
1141
|
+
min-width: 0;
|
|
1142
|
+
height: 100%;
|
|
1143
|
+
transform: none;
|
|
1144
|
+
translate: 0 0;
|
|
1145
|
+
pointer-events: auto;
|
|
1146
|
+
border: 1px solid var(--theme-border);
|
|
1147
|
+
border-radius: 12px;
|
|
1148
|
+
box-shadow: var(--theme-shadow);
|
|
1149
|
+
}
|
|
1150
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-rooms-rail-header {
|
|
1151
|
+
height: 4rem;
|
|
1152
|
+
align-items: center;
|
|
1153
|
+
padding-bottom: 0;
|
|
1154
|
+
}
|
|
1155
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-shell-card {
|
|
1156
|
+
border: 1px solid var(--theme-border);
|
|
1157
|
+
border-radius: 12px;
|
|
1158
|
+
}
|
|
1159
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-topbar-row {
|
|
1160
|
+
min-height: 4rem;
|
|
1161
|
+
padding-left: 1.25rem;
|
|
1162
|
+
padding-right: 1.25rem;
|
|
1163
|
+
}
|
|
1164
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-view-switch {
|
|
1165
|
+
display: none !important;
|
|
1166
|
+
}
|
|
1167
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-region {
|
|
1168
|
+
padding: 0.5rem;
|
|
1169
|
+
}
|
|
1170
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-container.has-workspace {
|
|
1171
|
+
display: flex;
|
|
1172
|
+
align-items: stretch;
|
|
1173
|
+
min-width: 0;
|
|
1174
|
+
min-height: 0;
|
|
1175
|
+
}
|
|
1176
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-chat-pane {
|
|
1177
|
+
flex: 0 0 var(--thread-chat-percent, 54%);
|
|
1178
|
+
min-width: min(31rem, 100%);
|
|
1179
|
+
width: auto;
|
|
1180
|
+
height: 100%;
|
|
1181
|
+
display: block;
|
|
1182
|
+
}
|
|
1183
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-workspace-pane {
|
|
1184
|
+
flex: 0 0 var(--thread-workspace-percent, 46%);
|
|
1185
|
+
min-width: 19rem;
|
|
1186
|
+
width: auto;
|
|
1187
|
+
height: 100%;
|
|
1188
|
+
display: block;
|
|
1189
|
+
}
|
|
1190
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-resize-handle {
|
|
1191
|
+
display: flex !important;
|
|
1192
|
+
}
|
|
1193
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split {
|
|
1194
|
+
display: flex !important;
|
|
1195
|
+
}
|
|
1196
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-mobile-split {
|
|
1197
|
+
display: none !important;
|
|
1198
|
+
}
|
|
1199
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
1200
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
1201
|
+
flex: 1 1 0;
|
|
1202
|
+
min-width: 0;
|
|
1203
|
+
width: auto;
|
|
1204
|
+
}
|
|
1205
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-chat-pane {
|
|
1206
|
+
min-width: 0;
|
|
1207
|
+
}
|
|
1208
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
1209
|
+
min-width: 0;
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
.thread-ui-shell .thread-resize-handle span {
|
|
1213
|
+
background: var(--theme-border);
|
|
1214
|
+
}
|
|
1215
|
+
.thread-ui-shell .thread-resize-handle:hover span,
|
|
1216
|
+
.thread-ui-shell .thread-resize-handle:focus-visible span {
|
|
1217
|
+
background: var(--theme-border-strong);
|
|
1218
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--theme-accent-border) 24%, transparent);
|
|
1219
|
+
}
|
|
1220
|
+
.thread-ui-shell .thread-graph-right-tabs {
|
|
1221
|
+
border-color: var(--theme-border);
|
|
1222
|
+
background: var(--theme-surface);
|
|
1223
|
+
}
|
|
1224
|
+
.thread-ui-shell .thread-graph-right-tab-secondary {
|
|
1225
|
+
border-color: var(--theme-border);
|
|
1226
|
+
}
|
|
1227
|
+
.thread-ui-shell .thread-workspace-tab,
|
|
1228
|
+
.thread-ui-shell .thread-graph-right-tab {
|
|
1229
|
+
color: var(--theme-fg-muted);
|
|
1230
|
+
}
|
|
1231
|
+
.thread-ui-shell .thread-workspace-tab:hover,
|
|
1232
|
+
.thread-ui-shell .thread-graph-right-tab:hover {
|
|
1233
|
+
background: var(--theme-hover);
|
|
1234
|
+
color: var(--theme-fg);
|
|
1235
|
+
}
|
|
1236
|
+
.thread-ui-shell .thread-workspace-tab.is-active,
|
|
1237
|
+
.thread-ui-shell .thread-graph-right-tab.is-active {
|
|
1238
|
+
background: var(--theme-surface-strong);
|
|
1239
|
+
color: var(--theme-fg);
|
|
1240
|
+
}
|
|
1241
|
+
.thread-ui-shell .thread-graph-visualization-panel {
|
|
1242
|
+
background: var(--theme-surface);
|
|
1243
|
+
color: var(--theme-fg);
|
|
1244
|
+
}
|
|
1245
|
+
.thread-ui-shell .thread-graph-flow {
|
|
1246
|
+
overflow: hidden;
|
|
1247
|
+
border: 1px solid var(--theme-border);
|
|
1248
|
+
border-radius: 12px;
|
|
1249
|
+
background: var(--theme-surface);
|
|
1250
|
+
}
|
|
1251
|
+
.thread-ui-shell .thread-graph-flow-node {
|
|
1252
|
+
position: relative;
|
|
1253
|
+
min-width: 8rem;
|
|
1254
|
+
max-width: 12rem;
|
|
1255
|
+
border: 1px solid var(--theme-border-strong);
|
|
1256
|
+
border-radius: 8px;
|
|
1257
|
+
background: var(--theme-panel);
|
|
1258
|
+
padding: 0.85rem 1rem;
|
|
1259
|
+
color: var(--theme-fg);
|
|
1260
|
+
text-align: center;
|
|
1261
|
+
box-shadow: var(--theme-shadow);
|
|
1262
|
+
}
|
|
1263
|
+
.thread-ui-shell .thread-graph-flow .react-flow {
|
|
1264
|
+
background: var(--theme-surface);
|
|
1265
|
+
color: var(--theme-fg);
|
|
1266
|
+
}
|
|
1267
|
+
.thread-ui-shell .thread-graph-flow .react-flow__edge-path {
|
|
1268
|
+
stroke: var(--theme-border-contrast);
|
|
1269
|
+
}
|
|
1270
|
+
.thread-ui-shell .thread-graph-flow .react-flow__background {
|
|
1271
|
+
background: var(--theme-surface);
|
|
1272
|
+
}
|
|
1273
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls {
|
|
1274
|
+
overflow: hidden;
|
|
1275
|
+
border: 1px solid var(--theme-border);
|
|
1276
|
+
border-radius: 8px;
|
|
1277
|
+
box-shadow: var(--theme-shadow);
|
|
1278
|
+
}
|
|
1279
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls-button {
|
|
1280
|
+
border-bottom-color: var(--theme-border);
|
|
1281
|
+
background: var(--theme-panel);
|
|
1282
|
+
color: var(--theme-fg-soft);
|
|
1283
|
+
}
|
|
1284
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls-button:hover {
|
|
1285
|
+
background: var(--theme-hover);
|
|
1286
|
+
color: var(--theme-fg);
|
|
1287
|
+
}
|
|
1288
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls-button svg {
|
|
1289
|
+
fill: currentColor;
|
|
1290
|
+
}
|
|
1291
|
+
.thread-ui-shell .thread-guide-section {
|
|
1292
|
+
color: var(--theme-fg);
|
|
1293
|
+
}
|
|
1294
|
+
.thread-ui-shell .thread-guide-icon,
|
|
1295
|
+
.thread-ui-shell .thread-guide-tag {
|
|
1296
|
+
background: var(--theme-surface-strong);
|
|
1297
|
+
color: var(--theme-fg-muted);
|
|
1298
|
+
}
|
|
1299
|
+
.thread-ui-shell .thread-graph-workspace-mobile-tabs,
|
|
1300
|
+
.thread-ui-shell .thread-graph-workspace-mobile-explorer {
|
|
1301
|
+
border-color: var(--theme-border);
|
|
1302
|
+
background: var(--theme-surface);
|
|
1303
|
+
}
|
|
1304
|
+
.thread-ui-shell .thread-graph-workspace-mobile-stack,
|
|
1305
|
+
.thread-ui-shell .thread-graph-workspace-mobile-viewer {
|
|
1306
|
+
background: var(--theme-surface);
|
|
1307
|
+
color: var(--theme-fg);
|
|
1308
|
+
}
|
|
1309
|
+
.thread-ui-shell .thread-graph-workspace-resizable {
|
|
1310
|
+
height: 100%;
|
|
1311
|
+
min-width: 0;
|
|
1312
|
+
}
|
|
1313
|
+
.thread-ui-shell .thread-graph-workspace-explorer-pane {
|
|
1314
|
+
min-width: 0;
|
|
1315
|
+
}
|
|
1316
|
+
.thread-ui-shell .thread-graph-workspace-viewer-pane {
|
|
1317
|
+
min-width: 0;
|
|
1318
|
+
}
|
|
1319
|
+
.thread-ui-shell .thread-graph-workspace-resize-handle::after {
|
|
1320
|
+
background: var(--theme-border);
|
|
1321
|
+
}
|
|
1322
|
+
.thread-ui-shell .thread-graph-workspace-resize-handle:hover::after,
|
|
1323
|
+
.thread-ui-shell .thread-graph-workspace-resize-handle:focus-visible::after {
|
|
1324
|
+
background: var(--theme-border-contrast);
|
|
1325
|
+
}
|
|
1326
|
+
.thread-ui-shell .thread-graph-explorer,
|
|
1327
|
+
.thread-ui-shell .thread-graph-viewer {
|
|
1328
|
+
border-color: var(--theme-border);
|
|
1329
|
+
background: var(--theme-surface);
|
|
1330
|
+
color: var(--theme-fg);
|
|
1331
|
+
}
|
|
1332
|
+
.thread-ui-shell .thread-graph-explorer-header,
|
|
1333
|
+
.thread-ui-shell .thread-graph-viewer-header {
|
|
1334
|
+
border-color: var(--theme-border);
|
|
1335
|
+
background: var(--theme-surface);
|
|
1336
|
+
color: var(--theme-fg);
|
|
1337
|
+
}
|
|
1338
|
+
.thread-ui-shell .thread-graph-explorer h2,
|
|
1339
|
+
.thread-ui-shell .thread-graph-viewer h2 {
|
|
1340
|
+
color: var(--theme-fg);
|
|
1341
|
+
}
|
|
1342
|
+
.thread-ui-shell .thread-graph-explorer-icon-button,
|
|
1343
|
+
.thread-ui-shell .thread-graph-explorer-collapse-button,
|
|
1344
|
+
.thread-ui-shell .thread-graph-viewer-header button {
|
|
1345
|
+
border-color: var(--theme-border);
|
|
1346
|
+
background: var(--theme-surface-strong);
|
|
1347
|
+
color: var(--theme-fg-soft);
|
|
1348
|
+
}
|
|
1349
|
+
.thread-ui-shell .thread-graph-explorer-icon-button:hover,
|
|
1350
|
+
.thread-ui-shell .thread-graph-explorer-collapse-button:hover,
|
|
1351
|
+
.thread-ui-shell .thread-graph-viewer-header button:hover {
|
|
1352
|
+
border-color: var(--theme-border-strong);
|
|
1353
|
+
background: var(--theme-hover);
|
|
1354
|
+
color: var(--theme-fg);
|
|
1355
|
+
}
|
|
1356
|
+
.thread-ui-shell .thread-graph-panel-expand-fab {
|
|
1357
|
+
position: absolute;
|
|
1358
|
+
top: 50%;
|
|
1359
|
+
z-index: 30;
|
|
1360
|
+
display: inline-flex;
|
|
1361
|
+
transform: translateY(-50%);
|
|
1362
|
+
}
|
|
1363
|
+
`);tr(`} .thread-ui-shell .thread-graph-panel-expand-fab.left-3 {
|
|
1364
|
+
left: 0.75rem;
|
|
1365
|
+
}
|
|
1366
|
+
.thread-ui-shell .thread-graph-panel-expand-fab.right-3 {
|
|
1367
|
+
right: 0.75rem;
|
|
1368
|
+
}
|
|
1369
|
+
.thread-ui-shell .thread-graph-panel-expand-fab:hover {
|
|
1370
|
+
transform: translateY(-50%) scale(1.04);
|
|
1371
|
+
}
|
|
1372
|
+
.thread-ui-shell .thread-graph-workspace-label,
|
|
1373
|
+
.thread-ui-shell .thread-graph-workspace-loading,
|
|
1374
|
+
.thread-ui-shell .thread-graph-workspace-empty,
|
|
1375
|
+
.thread-ui-shell .thread-graph-file-preview-header,
|
|
1376
|
+
.thread-ui-shell .thread-graph-file-preview-footer {
|
|
1377
|
+
color: var(--theme-fg-muted);
|
|
1378
|
+
}
|
|
1379
|
+
.thread-ui-shell .thread-graph-file-preview-header,
|
|
1380
|
+
.thread-ui-shell .thread-graph-file-preview-footer {
|
|
1381
|
+
border-color: var(--theme-border);
|
|
1382
|
+
}
|
|
1383
|
+
.thread-ui-shell .thread-graph-file-preview-footer,
|
|
1384
|
+
.thread-ui-shell .thread-graph-file-preview-frame {
|
|
1385
|
+
background: var(--theme-bg);
|
|
1386
|
+
}
|
|
1387
|
+
.thread-ui-shell .thread-graph-workspace-empty {
|
|
1388
|
+
border-color: var(--theme-border);
|
|
1389
|
+
background: var(--theme-surface-strong);
|
|
1390
|
+
}
|
|
1391
|
+
.thread-ui-shell .thread-graph-explorer button,
|
|
1392
|
+
.thread-ui-shell .thread-graph-viewer button {
|
|
1393
|
+
color: inherit;
|
|
1394
|
+
}
|
|
1395
|
+
.thread-ui-shell .thread-graph-tree-row {
|
|
1396
|
+
color: var(--theme-fg-soft);
|
|
1397
|
+
}
|
|
1398
|
+
.thread-ui-shell .thread-graph-tree-row:hover {
|
|
1399
|
+
background: var(--theme-hover);
|
|
1400
|
+
color: var(--theme-fg);
|
|
1401
|
+
}
|
|
1402
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected {
|
|
1403
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 13%, var(--theme-panel));
|
|
1404
|
+
color: var(--theme-fg);
|
|
1405
|
+
box-shadow: inset 3px 0 0 color-mix(in oklch, var(--theme-accent-solid) 72%, transparent);
|
|
1406
|
+
}
|
|
1407
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tree-row.is-selected,
|
|
1408
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tree-row.is-selected,
|
|
1409
|
+
.thread-ui-shell.dark .thread-graph-tree-row.is-selected {
|
|
1410
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 18%, var(--theme-panel));
|
|
1411
|
+
color: var(--theme-fg);
|
|
1412
|
+
box-shadow: inset 3px 0 0 color-mix(in oklch, var(--theme-accent-solid) 72%, transparent);
|
|
1413
|
+
}
|
|
1414
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected svg {
|
|
1415
|
+
color: currentColor;
|
|
1416
|
+
}
|
|
1417
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected .thread-graph-tree-action,
|
|
1418
|
+
.thread-ui-shell .thread-graph-tree-action.is-selected {
|
|
1419
|
+
color: var(--theme-fg-muted);
|
|
1420
|
+
}
|
|
1421
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected .thread-graph-tree-action:hover,
|
|
1422
|
+
.thread-ui-shell .thread-graph-tree-action.is-selected:hover {
|
|
1423
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 12%, transparent);
|
|
1424
|
+
color: var(--theme-fg);
|
|
1425
|
+
}
|
|
1426
|
+
.thread-ui-shell .thread-graph-tree-action {
|
|
1427
|
+
color: var(--theme-fg-muted);
|
|
1428
|
+
}
|
|
1429
|
+
.thread-ui-shell .thread-graph-tree-action:hover {
|
|
1430
|
+
background: var(--theme-surface-strong);
|
|
1431
|
+
color: var(--theme-fg);
|
|
1432
|
+
}
|
|
1433
|
+
.thread-ui-shell .thread-graph-molecule-preview {
|
|
1434
|
+
background: var(--theme-surface);
|
|
1435
|
+
}
|
|
1436
|
+
.thread-ui-shell .thread-graph-molecule-viewer {
|
|
1437
|
+
background: var(--theme-surface);
|
|
1438
|
+
color: var(--theme-fg);
|
|
1439
|
+
}
|
|
1440
|
+
.thread-ui-shell .thread-graph-molecule-header,
|
|
1441
|
+
.thread-ui-shell .thread-graph-molecule-controls {
|
|
1442
|
+
border-color: var(--theme-border);
|
|
1443
|
+
background: var(--theme-surface);
|
|
1444
|
+
color: var(--theme-fg);
|
|
1445
|
+
}
|
|
1446
|
+
.thread-ui-shell .thread-graph-molecule-body {
|
|
1447
|
+
display: flex;
|
|
1448
|
+
min-height: 0;
|
|
1449
|
+
flex: 1;
|
|
1450
|
+
flex-direction: column;
|
|
1451
|
+
overflow: hidden;
|
|
1452
|
+
}
|
|
1453
|
+
.thread-ui-shell .thread-graph-molecule-header h2 {
|
|
1454
|
+
color: var(--theme-fg);
|
|
1455
|
+
}
|
|
1456
|
+
.thread-ui-shell .thread-graph-molecule-header p,
|
|
1457
|
+
.thread-ui-shell .thread-graph-molecule-header span,
|
|
1458
|
+
.thread-ui-shell .thread-graph-molecule-trajectory {
|
|
1459
|
+
color: var(--theme-fg-muted);
|
|
1460
|
+
}
|
|
1461
|
+
.thread-ui-shell .thread-graph-molecule-controls {
|
|
1462
|
+
border-top: 1px solid var(--theme-border);
|
|
1463
|
+
display: flex;
|
|
1464
|
+
flex-direction: column;
|
|
1465
|
+
gap: 0.75rem;
|
|
1466
|
+
max-height: min(42%, 18rem);
|
|
1467
|
+
overflow: auto;
|
|
1468
|
+
padding: 0.75rem;
|
|
1469
|
+
}
|
|
1470
|
+
.thread-ui-shell .thread-graph-molecule-control-row {
|
|
1471
|
+
display: flex;
|
|
1472
|
+
align-items: flex-start;
|
|
1473
|
+
justify-content: space-between;
|
|
1474
|
+
gap: 0.75rem;
|
|
1475
|
+
}
|
|
1476
|
+
.thread-ui-shell .thread-graph-molecule-control-title {
|
|
1477
|
+
color: var(--theme-fg);
|
|
1478
|
+
font-size: 0.875rem;
|
|
1479
|
+
font-weight: 600;
|
|
1480
|
+
line-height: 1.25rem;
|
|
1481
|
+
}
|
|
1482
|
+
.thread-ui-shell .thread-graph-molecule-control-subtitle {
|
|
1483
|
+
margin-top: 0.125rem;
|
|
1484
|
+
color: var(--theme-fg-muted);
|
|
1485
|
+
font-size: 0.6875rem;
|
|
1486
|
+
line-height: 1rem;
|
|
1487
|
+
}
|
|
1488
|
+
.thread-ui-shell .thread-graph-molecule-button-group {
|
|
1489
|
+
display: inline-flex;
|
|
1490
|
+
align-items: center;
|
|
1491
|
+
gap: 0.125rem;
|
|
1492
|
+
border: 1px solid var(--theme-border);
|
|
1493
|
+
border-radius: 0.5rem;
|
|
1494
|
+
background: var(--theme-surface);
|
|
1495
|
+
padding: 0.125rem;
|
|
1496
|
+
}
|
|
1497
|
+
.thread-ui-shell .thread-graph-molecule-button {
|
|
1498
|
+
display: inline-flex;
|
|
1499
|
+
min-width: 1.75rem;
|
|
1500
|
+
height: 1.75rem;
|
|
1501
|
+
align-items: center;
|
|
1502
|
+
justify-content: center;
|
|
1503
|
+
border: 1px solid transparent;
|
|
1504
|
+
border-radius: 0.375rem;
|
|
1505
|
+
background: transparent;
|
|
1506
|
+
color: var(--theme-fg-soft);
|
|
1507
|
+
transition:
|
|
1508
|
+
background-color 140ms ease,
|
|
1509
|
+
border-color 140ms ease,
|
|
1510
|
+
color 140ms ease,
|
|
1511
|
+
opacity 140ms ease;
|
|
1512
|
+
}
|
|
1513
|
+
.thread-ui-shell .thread-graph-molecule-button:hover:not(:disabled) {
|
|
1514
|
+
border-color: var(--theme-border);
|
|
1515
|
+
background: var(--theme-hover);
|
|
1516
|
+
color: var(--theme-fg);
|
|
1517
|
+
}
|
|
1518
|
+
.thread-ui-shell .thread-graph-molecule-button:disabled {
|
|
1519
|
+
cursor: not-allowed;
|
|
1520
|
+
color: var(--theme-fg-subtle);
|
|
1521
|
+
opacity: 0.45;
|
|
1522
|
+
}
|
|
1523
|
+
.thread-ui-shell .thread-graph-molecule-button-divider {
|
|
1524
|
+
width: 1px;
|
|
1525
|
+
align-self: stretch;
|
|
1526
|
+
margin-inline: 0.25rem;
|
|
1527
|
+
background: var(--theme-border);
|
|
1528
|
+
}
|
|
1529
|
+
.thread-ui-shell .thread-graph-molecule-stage {
|
|
1530
|
+
background: var(--theme-bg);
|
|
1531
|
+
}
|
|
1532
|
+
.thread-ui-shell .thread-graph-molecule-error {
|
|
1533
|
+
background: color-mix(in oklch, #ef4444 12%, var(--theme-surface));
|
|
1534
|
+
color: var(--theme-danger);
|
|
1535
|
+
}
|
|
1536
|
+
.thread-ui-shell .thread-graph-molecule-empty {
|
|
1537
|
+
color: var(--theme-fg-muted);
|
|
1538
|
+
}
|
|
1539
|
+
.thread-ui-shell .thread-graph-molecule-tooltip {
|
|
1540
|
+
border-color: var(--theme-border);
|
|
1541
|
+
background: color-mix(in oklch, var(--theme-surface) 96%, transparent);
|
|
1542
|
+
color: var(--theme-fg);
|
|
1543
|
+
box-shadow: 0 10px 28px color-mix(in oklch, var(--theme-bg) 72%, transparent);
|
|
1544
|
+
}
|
|
1545
|
+
.thread-ui-shell .thread-graph-molecule-tooltip div,
|
|
1546
|
+
.thread-ui-shell .thread-graph-molecule-tooltip span {
|
|
1547
|
+
color: inherit;
|
|
1548
|
+
}
|
|
1549
|
+
.thread-ui-shell .thread-graph-molecule-trajectory input {
|
|
1550
|
+
accent-color: var(--theme-accent-solid);
|
|
1551
|
+
}
|
|
1552
|
+
.thread-ui-shell .thread-graph-molecule-live-button {
|
|
1553
|
+
display: inline-flex;
|
|
1554
|
+
align-items: center;
|
|
1555
|
+
gap: 0.25rem;
|
|
1556
|
+
border: 1px solid var(--theme-border);
|
|
1557
|
+
border-radius: 0.375rem;
|
|
1558
|
+
background: var(--theme-surface);
|
|
1559
|
+
padding: 0.125rem 0.5rem;
|
|
1560
|
+
color: var(--theme-fg-muted);
|
|
1561
|
+
transition: background-color 140ms ease, color 140ms ease;
|
|
1562
|
+
}
|
|
1563
|
+
.thread-ui-shell .thread-graph-molecule-live-button:hover {
|
|
1564
|
+
background: var(--theme-hover);
|
|
1565
|
+
color: var(--theme-fg);
|
|
1566
|
+
}
|
|
1567
|
+
.thread-ui-shell .thread-graph-molecule-camera {
|
|
1568
|
+
margin-top: 0.75rem;
|
|
1569
|
+
border: 1px solid var(--theme-border);
|
|
1570
|
+
border-radius: 0.5rem;
|
|
1571
|
+
padding: 0.5rem;
|
|
1572
|
+
color: var(--theme-fg-muted);
|
|
1573
|
+
font-size: 0.625rem;
|
|
1574
|
+
}
|
|
1575
|
+
.thread-ui-shell .thread-graph-molecule-camera-divider {
|
|
1576
|
+
width: 100%;
|
|
1577
|
+
height: 1px;
|
|
1578
|
+
margin-block: 0.5rem;
|
|
1579
|
+
background: var(--theme-border);
|
|
1580
|
+
}
|
|
1581
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin {
|
|
1582
|
+
height: 100%;
|
|
1583
|
+
min-height: 0;
|
|
1584
|
+
border: 0;
|
|
1585
|
+
border-radius: 0;
|
|
1586
|
+
background: var(--theme-surface);
|
|
1587
|
+
color: var(--theme-fg);
|
|
1588
|
+
}
|
|
1589
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header {
|
|
1590
|
+
min-height: 60px;
|
|
1591
|
+
border-color: var(--theme-border);
|
|
1592
|
+
background: var(--theme-surface);
|
|
1593
|
+
padding: 0.75rem 1.25rem;
|
|
1594
|
+
}
|
|
1595
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header h2 {
|
|
1596
|
+
color: var(--theme-fg);
|
|
1597
|
+
font-size: 0.875rem;
|
|
1598
|
+
font-weight: 650;
|
|
1599
|
+
}
|
|
1600
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header p,
|
|
1601
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header span {
|
|
1602
|
+
color: var(--theme-fg-muted);
|
|
1603
|
+
}
|
|
1604
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar {
|
|
1605
|
+
border-color: var(--theme-border);
|
|
1606
|
+
background: var(--theme-surface);
|
|
1607
|
+
padding: 0.5rem 0.625rem;
|
|
1608
|
+
}
|
|
1609
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar button,
|
|
1610
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button {
|
|
1611
|
+
border-color: var(--theme-border);
|
|
1612
|
+
background: var(--theme-surface-strong);
|
|
1613
|
+
color: var(--theme-fg-soft);
|
|
1614
|
+
}
|
|
1615
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar button:hover,
|
|
1616
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button:hover {
|
|
1617
|
+
border-color: var(--theme-border-strong);
|
|
1618
|
+
background: var(--theme-hover);
|
|
1619
|
+
color: var(--theme-fg);
|
|
1620
|
+
}
|
|
1621
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar button:disabled,
|
|
1622
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button:disabled {
|
|
1623
|
+
color: var(--theme-fg-subtle);
|
|
1624
|
+
}
|
|
1625
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar-divider {
|
|
1626
|
+
background: var(--theme-border);
|
|
1627
|
+
}
|
|
1628
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__stage {
|
|
1629
|
+
min-height: 0;
|
|
1630
|
+
background: var(--theme-bg);
|
|
1631
|
+
}
|
|
1632
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__error {
|
|
1633
|
+
background: color-mix(in oklch, #ef4444 12%, var(--theme-surface));
|
|
1634
|
+
color: var(--theme-danger);
|
|
1635
|
+
}
|
|
1636
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__empty {
|
|
1637
|
+
color: var(--theme-fg-muted);
|
|
1638
|
+
}
|
|
1639
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__tooltip {
|
|
1640
|
+
border-color: var(--theme-border);
|
|
1641
|
+
background: color-mix(in oklch, var(--theme-surface) 96%, transparent);
|
|
1642
|
+
color: var(--theme-fg);
|
|
1643
|
+
box-shadow: 0 10px 28px color-mix(in oklch, var(--theme-bg) 72%, transparent);
|
|
1644
|
+
}
|
|
1645
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__tooltip span {
|
|
1646
|
+
color: var(--theme-fg-soft);
|
|
1647
|
+
}
|
|
1648
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline,
|
|
1649
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__status {
|
|
1650
|
+
border-color: var(--theme-border);
|
|
1651
|
+
background: var(--theme-surface);
|
|
1652
|
+
color: var(--theme-fg-muted);
|
|
1653
|
+
}
|
|
1654
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline input {
|
|
1655
|
+
accent-color: var(--theme-accent-solid);
|
|
1656
|
+
}
|
|
1657
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button.is-live {
|
|
1658
|
+
color: var(--theme-danger);
|
|
1659
|
+
}
|
|
1660
|
+
.thread-ui-shell .thread-graph-file-preview-header,
|
|
1661
|
+
.thread-ui-shell .thread-graph-file-preview-footer {
|
|
1662
|
+
border-color: var(--theme-border);
|
|
1663
|
+
background: var(--theme-surface);
|
|
1664
|
+
color: var(--theme-fg-muted);
|
|
1665
|
+
}
|
|
1666
|
+
.thread-ui-shell .thread-graph-load-more-button {
|
|
1667
|
+
border: 1px solid var(--theme-border);
|
|
1668
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 8%, var(--theme-panel));
|
|
1669
|
+
color: var(--theme-fg-soft);
|
|
1670
|
+
transition:
|
|
1671
|
+
background-color 140ms ease,
|
|
1672
|
+
border-color 140ms ease,
|
|
1673
|
+
color 140ms ease;
|
|
1674
|
+
}
|
|
1675
|
+
.thread-ui-shell .thread-graph-load-more-button:hover:not(:disabled) {
|
|
1676
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 28%, var(--theme-border));
|
|
1677
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 14%, var(--theme-panel));
|
|
1678
|
+
color: var(--theme-fg);
|
|
1679
|
+
}
|
|
1680
|
+
.thread-ui-shell .thread-graph-code-preview {
|
|
1681
|
+
background: var(--theme-bg);
|
|
1682
|
+
color: var(--theme-fg);
|
|
1683
|
+
}
|
|
1684
|
+
.thread-ui-shell .thread-graph-code-preview pre,
|
|
1685
|
+
.thread-ui-shell .thread-graph-code-preview code {
|
|
1686
|
+
font-family:
|
|
1687
|
+
ui-monospace,
|
|
1688
|
+
SFMono-Regular,
|
|
1689
|
+
Menlo,
|
|
1690
|
+
Monaco,
|
|
1691
|
+
Consolas,
|
|
1692
|
+
"Liberation Mono",
|
|
1693
|
+
monospace !important;
|
|
1694
|
+
font-size: 0.78rem;
|
|
1695
|
+
line-height: 1.55;
|
|
1696
|
+
}
|
|
1697
|
+
.thread-ui-shell .thread-graph-plain-code-preview {
|
|
1698
|
+
min-height: 100%;
|
|
1699
|
+
margin: 0;
|
|
1700
|
+
padding: 1rem;
|
|
1701
|
+
background: transparent;
|
|
1702
|
+
color: var(--theme-fg);
|
|
1703
|
+
white-space: pre;
|
|
1704
|
+
}
|
|
1705
|
+
.thread-ui-shell .thread-tool-call {
|
|
1706
|
+
background: var(--theme-panel);
|
|
1707
|
+
color: var(--theme-fg);
|
|
1708
|
+
overflow: hidden;
|
|
1709
|
+
}
|
|
1710
|
+
.thread-ui-shell .thread-tool-call:hover {
|
|
1711
|
+
border-color: var(--theme-border-strong);
|
|
1712
|
+
}
|
|
1713
|
+
.thread-ui-shell .thread-graph-tool-call {
|
|
1714
|
+
font-family:
|
|
1715
|
+
Inter,
|
|
1716
|
+
ui-sans-serif,
|
|
1717
|
+
system-ui,
|
|
1718
|
+
-apple-system,
|
|
1719
|
+
BlinkMacSystemFont,
|
|
1720
|
+
"Segoe UI",
|
|
1721
|
+
sans-serif;
|
|
1722
|
+
}
|
|
1723
|
+
.thread-ui-shell .thread-graph-tool-call,
|
|
1724
|
+
.thread-ui-shell .thread-graph-tool-accordion,
|
|
1725
|
+
.thread-ui-shell .thread-graph-tool-trigger,
|
|
1726
|
+
.thread-ui-shell .thread-graph-tool-content,
|
|
1727
|
+
.thread-ui-shell .thread-graph-tool-json,
|
|
1728
|
+
.thread-ui-shell .thread-graph-tool-output {
|
|
1729
|
+
color: var(--theme-fg);
|
|
1730
|
+
}
|
|
1731
|
+
.thread-ui-shell .thread-graph-tool-accordion {
|
|
1732
|
+
overflow: hidden;
|
|
1733
|
+
border: 1px solid var(--theme-border);
|
|
1734
|
+
border-radius: 0.5rem;
|
|
1735
|
+
background: var(--theme-panel);
|
|
1736
|
+
box-shadow: 0 1px 2px color-mix(in oklch, var(--theme-bg) 65%, transparent);
|
|
1737
|
+
}
|
|
1738
|
+
.thread-ui-shell .thread-graph-tool-trigger {
|
|
1739
|
+
display: flex;
|
|
1740
|
+
width: 100%;
|
|
1741
|
+
min-width: 0;
|
|
1742
|
+
align-items: center;
|
|
1743
|
+
justify-content: space-between;
|
|
1744
|
+
gap: 0.75rem;
|
|
1745
|
+
border: 0;
|
|
1746
|
+
background: var(--theme-panel);
|
|
1747
|
+
text-align: left;
|
|
1748
|
+
transition: background 160ms ease, color 160ms ease;
|
|
1749
|
+
}
|
|
1750
|
+
.thread-ui-shell .thread-graph-tool-trigger:hover {
|
|
1751
|
+
background: var(--theme-hover);
|
|
1752
|
+
}
|
|
1753
|
+
.thread-ui-shell .thread-graph-tool-trigger svg {
|
|
1754
|
+
color: var(--theme-fg-muted);
|
|
1755
|
+
}
|
|
1756
|
+
.thread-ui-shell .thread-graph-tool-trigger > svg {
|
|
1757
|
+
margin-left: auto;
|
|
1758
|
+
}
|
|
1759
|
+
.thread-ui-shell .thread-graph-tool-badge {
|
|
1760
|
+
display: inline-flex;
|
|
1761
|
+
min-height: 1.35rem;
|
|
1762
|
+
shrink: 0;
|
|
1763
|
+
align-items: center;
|
|
1764
|
+
gap: 0.25rem;
|
|
1765
|
+
border: 1px solid transparent;
|
|
1766
|
+
border-radius: 999px;
|
|
1767
|
+
padding: 0.1rem 0.5rem;
|
|
1768
|
+
font-size: 0.75rem;
|
|
1769
|
+
font-weight: 400;
|
|
1770
|
+
line-height: 1rem;
|
|
1771
|
+
}
|
|
1772
|
+
.thread-ui-shell .thread-graph-tool-badge.is-completed {
|
|
1773
|
+
background: oklch(0.94 0.052 155);
|
|
1774
|
+
color: oklch(0.43 0.095 155);
|
|
1775
|
+
}
|
|
1776
|
+
.thread-ui-shell .thread-graph-tool-badge.is-failed {
|
|
1777
|
+
background: oklch(0.94 0.04 25);
|
|
1778
|
+
color: oklch(0.48 0.125 24);
|
|
1779
|
+
}
|
|
1780
|
+
.thread-ui-shell .thread-graph-tool-badge.is-pending {
|
|
1781
|
+
background: oklch(0.94 0.03 235);
|
|
1782
|
+
color: oklch(0.43 0.09 242);
|
|
1783
|
+
}
|
|
1784
|
+
.thread-ui-shell .thread-graph-tool-badge.is-neutral {
|
|
1785
|
+
background: var(--theme-muted);
|
|
1786
|
+
color: var(--theme-fg-muted);
|
|
1787
|
+
}
|
|
1788
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-completed,
|
|
1789
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-completed,
|
|
1790
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-completed {
|
|
1791
|
+
background: oklch(0.31 0.05 155);
|
|
1792
|
+
color: oklch(0.8 0.115 155);
|
|
1793
|
+
}
|
|
1794
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-failed,
|
|
1795
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-failed,
|
|
1796
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-failed {
|
|
1797
|
+
background: oklch(0.31 0.052 25);
|
|
1798
|
+
color: oklch(0.78 0.12 25);
|
|
1799
|
+
}
|
|
1800
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-pending,
|
|
1801
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-pending,
|
|
1802
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-pending {
|
|
1803
|
+
background: oklch(0.3 0.042 235);
|
|
1804
|
+
color: oklch(0.77 0.1 235);
|
|
1805
|
+
}
|
|
1806
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-neutral,
|
|
1807
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-neutral,
|
|
1808
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-neutral {
|
|
1809
|
+
background: #222733;
|
|
1810
|
+
color: rgb(148 163 184);
|
|
1811
|
+
}
|
|
1812
|
+
.thread-ui-shell .thread-graph-tool-content {
|
|
1813
|
+
display: grid;
|
|
1814
|
+
gap: 0.75rem;
|
|
1815
|
+
border-top: 0;
|
|
1816
|
+
background: var(--theme-panel);
|
|
1817
|
+
}
|
|
1818
|
+
.thread-ui-shell .thread-graph-tool-content h4 {
|
|
1819
|
+
margin: 0.25rem 0 0.5rem;
|
|
1820
|
+
color: var(--theme-fg-muted);
|
|
1821
|
+
font-size: 0.625rem;
|
|
1822
|
+
font-weight: 700;
|
|
1823
|
+
letter-spacing: 0.08em;
|
|
1824
|
+
line-height: 1rem;
|
|
1825
|
+
text-transform: uppercase;
|
|
1826
|
+
}
|
|
1827
|
+
.thread-ui-shell .thread-graph-tool-json,
|
|
1828
|
+
.thread-ui-shell .thread-graph-tool-output {
|
|
1829
|
+
overflow-x: auto;
|
|
1830
|
+
border: 1px solid var(--theme-border);
|
|
1831
|
+
border-radius: 0.375rem;
|
|
1832
|
+
background: var(--theme-surface-strong);
|
|
1833
|
+
padding: 0.75rem;
|
|
1834
|
+
font-family:
|
|
1835
|
+
ui-monospace,
|
|
1836
|
+
SFMono-Regular,
|
|
1837
|
+
Menlo,
|
|
1838
|
+
Monaco,
|
|
1839
|
+
Consolas,
|
|
1840
|
+
"Liberation Mono",
|
|
1841
|
+
monospace;
|
|
1842
|
+
font-size: 0.78rem;
|
|
1843
|
+
line-height: 1.55;
|
|
1844
|
+
white-space: pre-wrap;
|
|
1845
|
+
}
|
|
1846
|
+
.thread-ui-shell .thread-graph-tool-json > div {
|
|
1847
|
+
padding-left: 1rem;
|
|
1848
|
+
}
|
|
1849
|
+
.thread-ui-shell .thread-graph-tool-output {
|
|
1850
|
+
margin-top: 0.5rem;
|
|
1851
|
+
}
|
|
1852
|
+
.thread-ui-shell .thread-graph-tool-key {
|
|
1853
|
+
color: oklch(0.58 0.18 18);
|
|
1854
|
+
}
|
|
1855
|
+
.thread-ui-shell .thread-graph-tool-string {
|
|
1856
|
+
color: oklch(0.52 0.12 155);
|
|
1857
|
+
}
|
|
1858
|
+
.thread-ui-shell .thread-graph-tool-number {
|
|
1859
|
+
color: oklch(0.55 0.13 235);
|
|
1860
|
+
}
|
|
1861
|
+
.thread-ui-shell .thread-graph-tool-boolean {
|
|
1862
|
+
color: oklch(0.56 0.13 302);
|
|
1863
|
+
}
|
|
1864
|
+
.thread-ui-shell .thread-graph-tool-null,
|
|
1865
|
+
.thread-ui-shell .thread-graph-tool-punctuation,
|
|
1866
|
+
.thread-ui-shell .thread-graph-tool-object {
|
|
1867
|
+
color: var(--theme-fg-muted);
|
|
1868
|
+
}
|
|
1869
|
+
.thread-ui-shell .thread-graph-history-tool {
|
|
1870
|
+
width: 100%;
|
|
1871
|
+
min-width: 0;
|
|
1872
|
+
border: 0;
|
|
1873
|
+
background: transparent !important;
|
|
1874
|
+
color: var(--theme-fg);
|
|
1875
|
+
}
|
|
1876
|
+
.thread-ui-shell .thread-graph-history-tool-accordion {
|
|
1877
|
+
background: var(--theme-panel);
|
|
1878
|
+
}
|
|
1879
|
+
.thread-ui-shell .thread-graph-history-tool-trigger {
|
|
1880
|
+
min-height: 2.75rem;
|
|
1881
|
+
}
|
|
1882
|
+
.thread-ui-shell .thread-graph-history-tool-trigger > div:first-child {
|
|
1883
|
+
min-width: 0;
|
|
1884
|
+
}
|
|
1885
|
+
.thread-ui-shell .thread-graph-history-tool-icon {
|
|
1886
|
+
display: inline-flex;
|
|
1887
|
+
align-items: center;
|
|
1888
|
+
justify-content: center;
|
|
1889
|
+
color: var(--theme-fg-muted);
|
|
1890
|
+
}
|
|
1891
|
+
.thread-ui-shell .thread-graph-history-tool.is-command .thread-graph-history-tool-icon {
|
|
1892
|
+
color: oklch(0.63 0.12 75);
|
|
1893
|
+
}
|
|
1894
|
+
.thread-ui-shell .thread-graph-history-tool.is-tool .thread-graph-history-tool-icon {
|
|
1895
|
+
color: oklch(0.61 0.12 315);
|
|
1896
|
+
}
|
|
1897
|
+
.thread-ui-shell .thread-graph-history-tool.is-agent .thread-graph-history-tool-icon {
|
|
1898
|
+
color: oklch(0.58 0.11 170);
|
|
1899
|
+
}
|
|
1900
|
+
.thread-ui-shell .thread-graph-history-tool.is-skill .thread-graph-history-tool-icon {
|
|
1901
|
+
color: oklch(0.58 0.12 285);
|
|
1902
|
+
}
|
|
1903
|
+
.thread-ui-shell .thread-graph-history-tool.is-search .thread-graph-history-tool-icon {
|
|
1904
|
+
color: oklch(0.58 0.12 235);
|
|
1905
|
+
}
|
|
1906
|
+
.thread-ui-shell .thread-graph-history-tool.is-file-read .thread-graph-history-tool-icon {
|
|
1907
|
+
color: oklch(0.58 0.1 205);
|
|
1908
|
+
}
|
|
1909
|
+
.thread-ui-shell .thread-graph-history-tool-summary {
|
|
1910
|
+
display: flex;
|
|
1911
|
+
min-width: 0;
|
|
1912
|
+
align-items: center;
|
|
1913
|
+
gap: 0.5rem;
|
|
1914
|
+
overflow: hidden;
|
|
1915
|
+
border: 1px solid var(--theme-border);
|
|
1916
|
+
border-radius: 0.375rem;
|
|
1917
|
+
background: var(--theme-surface-strong);
|
|
1918
|
+
padding: 0.65rem 0.75rem;
|
|
1919
|
+
color: var(--theme-fg-soft);
|
|
1920
|
+
font-size: 0.875rem;
|
|
1921
|
+
line-height: 1.5;
|
|
1922
|
+
}
|
|
1923
|
+
.thread-ui-shell .thread-graph-history-tool-summary > span:first-child {
|
|
1924
|
+
min-width: 0;
|
|
1925
|
+
overflow: hidden;
|
|
1926
|
+
text-overflow: ellipsis;
|
|
1927
|
+
white-space: nowrap;
|
|
1928
|
+
}
|
|
1929
|
+
.thread-ui-shell .thread-graph-history-tool-ellipsis {
|
|
1930
|
+
flex: 0 0 auto;
|
|
1931
|
+
color: var(--theme-fg-muted);
|
|
1932
|
+
font-size: 0.75rem;
|
|
1933
|
+
letter-spacing: 0.16em;
|
|
1934
|
+
}
|
|
1935
|
+
.thread-ui-shell .thread-graph-history-tool-open {
|
|
1936
|
+
border-color: var(--theme-border);
|
|
1937
|
+
background: var(--theme-surface);
|
|
1938
|
+
color: var(--theme-fg-soft);
|
|
1939
|
+
}
|
|
1940
|
+
.thread-ui-shell .thread-graph-history-tool-open:hover {
|
|
1941
|
+
background: var(--theme-hover);
|
|
1942
|
+
color: var(--theme-fg);
|
|
1943
|
+
}
|
|
1944
|
+
.thread-ui-shell .thread-graph-history-event {
|
|
1945
|
+
display: flex;
|
|
1946
|
+
min-width: 0;
|
|
1947
|
+
width: 100%;
|
|
1948
|
+
align-items: flex-start;
|
|
1949
|
+
gap: 0.625rem;
|
|
1950
|
+
border: 0;
|
|
1951
|
+
background: transparent !important;
|
|
1952
|
+
color: var(--theme-fg);
|
|
1953
|
+
}
|
|
1954
|
+
.thread-ui-shell .thread-graph-history-event-icon {
|
|
1955
|
+
display: inline-flex;
|
|
1956
|
+
height: 1.75rem;
|
|
1957
|
+
width: 1.75rem;
|
|
1958
|
+
flex: 0 0 auto;
|
|
1959
|
+
align-items: center;
|
|
1960
|
+
justify-content: center;
|
|
1961
|
+
border: 1px solid var(--theme-border);
|
|
1962
|
+
border-radius: 999px;
|
|
1963
|
+
background: var(--theme-panel);
|
|
1964
|
+
color: var(--theme-fg-muted);
|
|
1965
|
+
}
|
|
1966
|
+
.thread-ui-shell .thread-graph-history-event-card {
|
|
1967
|
+
min-width: 0;
|
|
1968
|
+
flex: 1 1 auto;
|
|
1969
|
+
overflow: hidden;
|
|
1970
|
+
border: 1px solid var(--theme-border);
|
|
1971
|
+
border-radius: 0.5rem;
|
|
1972
|
+
background: var(--theme-panel);
|
|
1973
|
+
color: var(--theme-fg);
|
|
1974
|
+
box-shadow: 0 1px 2px color-mix(in oklch, var(--theme-bg) 65%, transparent);
|
|
1975
|
+
}
|
|
1976
|
+
.thread-ui-shell .thread-graph-history-event-header {
|
|
1977
|
+
display: flex;
|
|
1978
|
+
min-width: 0;
|
|
1979
|
+
align-items: center;
|
|
1980
|
+
justify-content: space-between;
|
|
1981
|
+
gap: 0.75rem;
|
|
1982
|
+
padding: 0.75rem 1rem;
|
|
1983
|
+
}
|
|
1984
|
+
.thread-ui-shell .thread-graph-history-event-heading {
|
|
1985
|
+
flex: 1 1 auto;
|
|
1986
|
+
min-width: 0;
|
|
1987
|
+
}
|
|
1988
|
+
.thread-ui-shell .thread-graph-history-event-title {
|
|
1989
|
+
flex: 0 0 auto;
|
|
1990
|
+
max-width: min(14rem, 36%);
|
|
1991
|
+
}
|
|
1992
|
+
.thread-ui-shell .thread-graph-history-event-actions {
|
|
1993
|
+
display: inline-flex;
|
|
1994
|
+
flex: 0 0 auto;
|
|
1995
|
+
align-items: center;
|
|
1996
|
+
gap: 0.5rem;
|
|
1997
|
+
}
|
|
1998
|
+
.thread-ui-shell .thread-graph-history-event-body {
|
|
1999
|
+
display: grid;
|
|
2000
|
+
gap: 0.625rem;
|
|
2001
|
+
border-top: 1px solid var(--theme-border);
|
|
2002
|
+
padding: 0.75rem 1rem 1rem;
|
|
2003
|
+
color: var(--theme-fg-soft);
|
|
2004
|
+
}
|
|
2005
|
+
.thread-ui-shell .thread-graph-history-event-line {
|
|
2006
|
+
display: flex;
|
|
2007
|
+
min-width: 0;
|
|
2008
|
+
align-items: center;
|
|
2009
|
+
gap: 0.5rem;
|
|
2010
|
+
color: var(--theme-fg);
|
|
2011
|
+
}
|
|
2012
|
+
.thread-ui-shell .thread-graph-history-event-primary {
|
|
2013
|
+
min-width: 0;
|
|
2014
|
+
color: var(--theme-fg);
|
|
2015
|
+
font-size: 0.875rem;
|
|
2016
|
+
font-weight: 500;
|
|
2017
|
+
line-height: 1.5;
|
|
2018
|
+
}
|
|
2019
|
+
.thread-ui-shell .thread-graph-history-event-secondary {
|
|
2020
|
+
min-width: 0;
|
|
2021
|
+
color: var(--theme-fg-muted);
|
|
2022
|
+
font-size: 0.75rem;
|
|
2023
|
+
line-height: 1.35;
|
|
2024
|
+
}
|
|
2025
|
+
.thread-ui-shell .thread-graph-history-event-summary {
|
|
2026
|
+
display: block;
|
|
2027
|
+
width: 100%;
|
|
2028
|
+
min-width: 0;
|
|
2029
|
+
overflow: hidden;
|
|
2030
|
+
border: 1px solid var(--theme-border);
|
|
2031
|
+
border-radius: 0.375rem;
|
|
2032
|
+
background: var(--theme-surface-strong);
|
|
2033
|
+
padding: 0.65rem 0.75rem;
|
|
2034
|
+
color: var(--theme-fg-soft);
|
|
2035
|
+
font-size: 0.875rem;
|
|
2036
|
+
line-height: 1.5;
|
|
2037
|
+
text-align: left;
|
|
2038
|
+
}
|
|
2039
|
+
.thread-ui-shell .thread-graph-history-event-summary.is-clickable {
|
|
2040
|
+
transition: background 160ms ease, color 160ms ease;
|
|
2041
|
+
}
|
|
2042
|
+
.thread-ui-shell .thread-graph-history-event-summary.is-clickable:hover {
|
|
2043
|
+
background: var(--theme-hover);
|
|
2044
|
+
color: var(--theme-fg);
|
|
2045
|
+
}
|
|
2046
|
+
.thread-ui-shell .thread-graph-history-event-prose {
|
|
2047
|
+
color: var(--theme-fg-soft);
|
|
2048
|
+
}
|
|
2049
|
+
.thread-ui-shell .thread-graph-history-event-pre {
|
|
2050
|
+
overflow-x: auto;
|
|
2051
|
+
border: 1px solid var(--theme-border);
|
|
2052
|
+
border-radius: 0.375rem;
|
|
2053
|
+
background: var(--theme-surface-strong);
|
|
2054
|
+
padding: 0.75rem;
|
|
2055
|
+
color: var(--theme-fg-soft);
|
|
2056
|
+
font-size: 0.8125rem;
|
|
2057
|
+
line-height: 1.55;
|
|
2058
|
+
white-space: pre-wrap;
|
|
2059
|
+
}
|
|
2060
|
+
.thread-ui-shell .thread-graph-history-event-action,
|
|
2061
|
+
.thread-ui-shell .thread-graph-history-event-pill {
|
|
2062
|
+
display: inline-flex;
|
|
2063
|
+
align-items: center;
|
|
2064
|
+
gap: 0.375rem;
|
|
2065
|
+
border: 1px solid var(--theme-border);
|
|
2066
|
+
border-radius: 999px;
|
|
2067
|
+
background: var(--theme-surface);
|
|
2068
|
+
padding: 0.25rem 0.55rem;
|
|
2069
|
+
color: var(--theme-fg-muted);
|
|
2070
|
+
font-size: 0.6875rem;
|
|
2071
|
+
font-weight: 500;
|
|
2072
|
+
line-height: 1rem;
|
|
2073
|
+
transition: background 160ms ease, color 160ms ease;
|
|
2074
|
+
}
|
|
2075
|
+
.thread-ui-shell .thread-graph-history-event-action:hover {
|
|
2076
|
+
background: var(--theme-hover);
|
|
2077
|
+
color: var(--theme-fg);
|
|
2078
|
+
}
|
|
2079
|
+
.thread-ui-shell .thread-graph-history-event-path {
|
|
2080
|
+
display: block;
|
|
2081
|
+
max-width: 100%;
|
|
2082
|
+
overflow: hidden;
|
|
2083
|
+
text-overflow: ellipsis;
|
|
2084
|
+
white-space: nowrap;
|
|
2085
|
+
color: var(--theme-fg-muted);
|
|
2086
|
+
font-size: 0.75rem;
|
|
2087
|
+
line-height: 1.4;
|
|
2088
|
+
text-align: left;
|
|
2089
|
+
}
|
|
2090
|
+
.thread-ui-shell .thread-graph-history-event-path:hover {
|
|
2091
|
+
color: var(--theme-fg);
|
|
2092
|
+
}
|
|
2093
|
+
.thread-ui-shell .thread-graph-history-event-image {
|
|
2094
|
+
max-height: 24rem;
|
|
2095
|
+
width: 100%;
|
|
2096
|
+
object-fit: contain;
|
|
2097
|
+
border: 1px solid var(--theme-border);
|
|
2098
|
+
border-radius: 0.5rem;
|
|
2099
|
+
background: var(--theme-surface-strong);
|
|
2100
|
+
}
|
|
2101
|
+
.thread-ui-shell .thread-graph-history-event.is-plan .thread-graph-history-event-icon {
|
|
2102
|
+
color: oklch(0.58 0.12 235);
|
|
2103
|
+
}
|
|
2104
|
+
.thread-ui-shell .thread-graph-history-event.is-context .thread-graph-history-event-icon {
|
|
2105
|
+
color: oklch(0.58 0.11 170);
|
|
2106
|
+
}
|
|
2107
|
+
.thread-ui-shell .thread-graph-history-event.is-image .thread-graph-history-event-icon,
|
|
2108
|
+
.thread-ui-shell .thread-graph-history-event.is-artifact .thread-graph-history-event-icon {
|
|
2109
|
+
color: oklch(0.58 0.12 285);
|
|
2110
|
+
}
|
|
2111
|
+
.thread-ui-shell .thread-graph-history-event.is-file-change .thread-graph-history-event-icon {
|
|
2112
|
+
color: oklch(0.62 0.12 145);
|
|
2113
|
+
}
|
|
2114
|
+
.thread-ui-shell .thread-graph-history-event.is-hook .thread-graph-history-event-icon {
|
|
2115
|
+
color: oklch(0.61 0.12 315);
|
|
2116
|
+
}
|
|
2117
|
+
@media (max-width: 639px) {
|
|
2118
|
+
.thread-ui-shell .thread-graph-history-event {
|
|
2119
|
+
gap: 0.5rem;
|
|
2120
|
+
}
|
|
2121
|
+
.thread-ui-shell .thread-graph-history-event-icon {
|
|
2122
|
+
height: 1.5rem;
|
|
2123
|
+
width: 1.5rem;
|
|
2124
|
+
}
|
|
2125
|
+
.thread-ui-shell .thread-graph-history-event-header,
|
|
2126
|
+
.thread-ui-shell .thread-graph-history-event-body {
|
|
2127
|
+
padding-left: 0.75rem;
|
|
2128
|
+
padding-right: 0.75rem;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
.thread-ui-shell .thread-graph-history-detail-row {
|
|
2132
|
+
border-color: var(--theme-border);
|
|
2133
|
+
background: var(--theme-surface);
|
|
2134
|
+
color: var(--theme-fg);
|
|
2135
|
+
}
|
|
2136
|
+
.thread-ui-shell .thread-graph-history-detail-row:hover {
|
|
2137
|
+
background: var(--theme-hover);
|
|
2138
|
+
color: var(--theme-fg);
|
|
2139
|
+
}
|
|
2140
|
+
.thread-ui-shell .thread-graph-history-detail-text {
|
|
2141
|
+
color: var(--theme-fg);
|
|
2142
|
+
}
|
|
2143
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-card {
|
|
2144
|
+
border-radius: 0.4375rem;
|
|
2145
|
+
}
|
|
2146
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-header {
|
|
2147
|
+
min-height: 2.75rem;
|
|
2148
|
+
padding-block: 0.5rem;
|
|
2149
|
+
}
|
|
2150
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-heading {
|
|
2151
|
+
flex: 1 1 auto;
|
|
2152
|
+
min-width: 0;
|
|
2153
|
+
gap: 0.375rem;
|
|
2154
|
+
}
|
|
2155
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-title {
|
|
2156
|
+
max-width: none;
|
|
2157
|
+
font-size: 0.8125rem;
|
|
2158
|
+
}
|
|
2159
|
+
.thread-ui-shell .thread-graph-file-change-inline,
|
|
2160
|
+
.thread-ui-shell .thread-graph-file-change-inline-button {
|
|
2161
|
+
min-width: 0;
|
|
2162
|
+
}
|
|
2163
|
+
.thread-ui-shell .thread-graph-file-change-inline {
|
|
2164
|
+
max-width: 100%;
|
|
2165
|
+
gap: 0.375rem;
|
|
2166
|
+
}
|
|
2167
|
+
.thread-ui-shell .thread-graph-file-change-inline-button {
|
|
2168
|
+
display: block;
|
|
2169
|
+
flex: 1 1 auto;
|
|
2170
|
+
color: inherit;
|
|
2171
|
+
}
|
|
2172
|
+
.thread-ui-shell .thread-graph-file-change-inline-button:hover .thread-graph-history-detail-text {
|
|
2173
|
+
color: var(--theme-fg);
|
|
2174
|
+
text-decoration: underline;
|
|
2175
|
+
text-decoration-thickness: 1px;
|
|
2176
|
+
text-underline-offset: 2px;
|
|
2177
|
+
}
|
|
2178
|
+
.thread-ui-shell .thread-graph-history-detail-meta {
|
|
2179
|
+
color: var(--theme-fg-muted);
|
|
2180
|
+
}
|
|
2181
|
+
.thread-ui-shell .thread-graph-history-delta-badge {
|
|
2182
|
+
display: inline-flex;
|
|
2183
|
+
align-items: center;
|
|
2184
|
+
justify-content: center;
|
|
2185
|
+
border: 1px solid transparent;
|
|
2186
|
+
border-radius: 999px;
|
|
2187
|
+
padding: 0.125rem 0.375rem;
|
|
2188
|
+
font-size: 0.6875rem;
|
|
2189
|
+
font-weight: 500;
|
|
2190
|
+
line-height: 1rem;
|
|
2191
|
+
}
|
|
2192
|
+
.thread-ui-shell .thread-graph-history-delta-badge.is-add {
|
|
2193
|
+
border-color: rgb(52 211 153 / 0.28);
|
|
2194
|
+
background: rgb(52 211 153 / 0.1);
|
|
2195
|
+
color: rgb(167 243 208);
|
|
2196
|
+
}
|
|
2197
|
+
.thread-ui-shell .thread-graph-history-delta-badge.is-remove {
|
|
2198
|
+
border-color: rgb(251 113 133 / 0.3);
|
|
2199
|
+
background: rgb(251 113 133 / 0.1);
|
|
2200
|
+
color: rgb(254 205 211);
|
|
2201
|
+
}
|
|
2202
|
+
.thread-ui-shell .thread-graph-history-delta-badge.is-neutral {
|
|
2203
|
+
border-color: var(--theme-border);
|
|
2204
|
+
background: var(--theme-muted);
|
|
2205
|
+
color: var(--theme-fg-soft);
|
|
2206
|
+
}
|
|
2207
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-history-delta-badge.is-add {
|
|
2208
|
+
border-color: rgb(16 185 129 / 0.25);
|
|
2209
|
+
background: rgb(16 185 129 / 0.1);
|
|
2210
|
+
color: rgb(4 120 87);
|
|
2211
|
+
}
|
|
2212
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-history-delta-badge.is-remove {
|
|
2213
|
+
border-color: rgb(244 63 94 / 0.25);
|
|
2214
|
+
background: rgb(244 63 94 / 0.1);
|
|
2215
|
+
color: rgb(190 18 60);
|
|
2216
|
+
}
|
|
2217
|
+
@media (max-width: 639px) {
|
|
2218
|
+
.thread-ui-shell .thread-graph-history-tool-trigger {
|
|
2219
|
+
padding-left: 0.75rem;
|
|
2220
|
+
padding-right: 0.75rem;
|
|
2221
|
+
}
|
|
2222
|
+
.thread-ui-shell .thread-graph-history-tool-trigger .thread-graph-tool-badge {
|
|
2223
|
+
max-width: 7.5rem;
|
|
2224
|
+
}
|
|
2225
|
+
.thread-ui-shell .thread-graph-history-tool-content {
|
|
2226
|
+
padding-left: 0.75rem;
|
|
2227
|
+
padding-right: 0.75rem;
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
.thread-ui-shell .xyz-viewer-plugin {
|
|
2231
|
+
border-color: var(--theme-border);
|
|
2232
|
+
border-radius: 0;
|
|
2233
|
+
background: var(--theme-surface);
|
|
2234
|
+
color: var(--theme-fg);
|
|
2235
|
+
}
|
|
2236
|
+
.thread-ui-shell .xyz-viewer-plugin__header,
|
|
2237
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar,
|
|
2238
|
+
.thread-ui-shell .xyz-viewer-plugin__timeline,
|
|
2239
|
+
.thread-ui-shell .xyz-viewer-plugin__status {
|
|
2240
|
+
border-color: var(--theme-border);
|
|
2241
|
+
background: var(--theme-surface);
|
|
2242
|
+
color: var(--theme-fg-muted);
|
|
2243
|
+
}
|
|
2244
|
+
.thread-ui-shell .xyz-viewer-plugin__header h2 {
|
|
2245
|
+
color: var(--theme-fg);
|
|
2246
|
+
}
|
|
2247
|
+
.thread-ui-shell .xyz-viewer-plugin__header p,
|
|
2248
|
+
.thread-ui-shell .xyz-viewer-plugin__header span,
|
|
2249
|
+
.thread-ui-shell .xyz-viewer-plugin__tooltip span {
|
|
2250
|
+
color: var(--theme-fg-muted);
|
|
2251
|
+
}
|
|
2252
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar button,
|
|
2253
|
+
.thread-ui-shell .xyz-viewer-plugin__timeline button {
|
|
2254
|
+
border-color: var(--theme-border);
|
|
2255
|
+
background: var(--theme-surface-strong);
|
|
2256
|
+
color: var(--theme-fg-soft);
|
|
2257
|
+
}
|
|
2258
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar button:hover,
|
|
2259
|
+
.thread-ui-shell .xyz-viewer-plugin__timeline button:hover {
|
|
2260
|
+
background: var(--theme-hover);
|
|
2261
|
+
color: var(--theme-fg);
|
|
2262
|
+
}
|
|
2263
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar-divider {
|
|
2264
|
+
background: var(--theme-border);
|
|
2265
|
+
}
|
|
2266
|
+
.thread-ui-shell .xyz-viewer-plugin__stage {
|
|
2267
|
+
background: var(--theme-bg);
|
|
2268
|
+
}
|
|
2269
|
+
.thread-ui-shell .xyz-viewer-plugin__tooltip {
|
|
2270
|
+
border-color: var(--theme-border);
|
|
2271
|
+
background: color-mix(in oklch, var(--theme-panel) 96%, transparent);
|
|
2272
|
+
box-shadow: var(--theme-shadow);
|
|
2273
|
+
color: var(--theme-fg);
|
|
2274
|
+
}
|
|
2275
|
+
.thread-ui-shell .xyz-viewer-plugin__empty {
|
|
2276
|
+
color: var(--theme-fg-muted);
|
|
2277
|
+
}
|
|
2278
|
+
.thread-ui-shell .xyz-viewer-plugin__error {
|
|
2279
|
+
background: color-mix(in oklch, oklch(0.62 0.16 25) 14%, var(--theme-panel));
|
|
2280
|
+
color: oklch(0.78 0.12 25);
|
|
2281
|
+
}
|
|
2282
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-key,
|
|
2283
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-key,
|
|
2284
|
+
.thread-ui-shell.dark .thread-graph-tool-key {
|
|
2285
|
+
color: oklch(0.78 0.12 18);
|
|
2286
|
+
}
|
|
2287
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-string,
|
|
2288
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-string,
|
|
2289
|
+
.thread-ui-shell.dark .thread-graph-tool-string {
|
|
2290
|
+
color: oklch(0.79 0.11 155);
|
|
2291
|
+
}
|
|
2292
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-number,
|
|
2293
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-number,
|
|
2294
|
+
.thread-ui-shell.dark .thread-graph-tool-number {
|
|
2295
|
+
color: oklch(0.77 0.1 235);
|
|
2296
|
+
}
|
|
2297
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-boolean,
|
|
2298
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-boolean,
|
|
2299
|
+
.thread-ui-shell.dark .thread-graph-tool-boolean {
|
|
2300
|
+
color: oklch(0.79 0.1 302);
|
|
2301
|
+
}
|
|
2302
|
+
.thread-ui-shell .thread-timeline-surface,
|
|
2303
|
+
.thread-ui-shell .thread-scroll-container {
|
|
2304
|
+
background: var(--theme-surface);
|
|
2305
|
+
color: var(--theme-fg);
|
|
2306
|
+
scrollbar-color: var(--theme-border-strong) transparent;
|
|
2307
|
+
}
|
|
2308
|
+
.thread-ui-shell .thread-scroll-container > div > .divide-y {
|
|
2309
|
+
border-color: var(--theme-border);
|
|
2310
|
+
}
|
|
2311
|
+
.thread-ui-shell .timeline-item-frame {
|
|
2312
|
+
border-color: var(--theme-border);
|
|
2313
|
+
background: var(--theme-panel);
|
|
2314
|
+
color: var(--theme-fg);
|
|
2315
|
+
box-shadow: none;
|
|
2316
|
+
}
|
|
2317
|
+
.thread-ui-shell .timeline-agent {
|
|
2318
|
+
border-color: transparent;
|
|
2319
|
+
background: transparent;
|
|
2320
|
+
box-shadow: none;
|
|
2321
|
+
}
|
|
2322
|
+
.thread-ui-shell .timeline-user {
|
|
2323
|
+
border-color: transparent;
|
|
2324
|
+
background: oklch(0.94 0.025 214);
|
|
2325
|
+
color: oklch(0.24 0.027 255);
|
|
2326
|
+
}
|
|
2327
|
+
.thread-ui-shell.thread-ui-theme-dark .timeline-user,
|
|
2328
|
+
.thread-ui-shell[data-theme-effective=dark] .timeline-user,
|
|
2329
|
+
.thread-ui-shell.dark .timeline-user {
|
|
2330
|
+
background: oklch(0.29 0.034 224);
|
|
2331
|
+
color: var(--theme-fg);
|
|
2332
|
+
}
|
|
2333
|
+
.thread-ui-shell .timeline-command,
|
|
2334
|
+
.thread-ui-shell .timeline-agent-tool,
|
|
2335
|
+
.thread-ui-shell .timeline-skill-tool,
|
|
2336
|
+
.thread-ui-shell .timeline-action,
|
|
2337
|
+
.thread-ui-shell .timeline-file-change,
|
|
2338
|
+
.thread-ui-shell .timeline-file-read,
|
|
2339
|
+
.thread-ui-shell .timeline-search,
|
|
2340
|
+
.thread-ui-shell .timeline-plan,
|
|
2341
|
+
.thread-ui-shell .timeline-reasoning,
|
|
2342
|
+
.thread-ui-shell .timeline-other,
|
|
2343
|
+
.thread-ui-shell .timeline-special-warning,
|
|
2344
|
+
.thread-ui-shell .timeline-special-info,
|
|
2345
|
+
.thread-ui-shell .timeline-special-file-read,
|
|
2346
|
+
.thread-ui-shell .timeline-special-success,
|
|
2347
|
+
.thread-ui-shell .timeline-mobile-dense-event,
|
|
2348
|
+
.thread-ui-shell .timeline-batch-inner,
|
|
2349
|
+
.thread-ui-shell .timeline-item-inner {
|
|
2350
|
+
border-color: var(--theme-border);
|
|
2351
|
+
background: var(--theme-panel);
|
|
2352
|
+
color: var(--theme-fg);
|
|
2353
|
+
}
|
|
2354
|
+
.thread-ui-shell .timeline-special-warning,
|
|
2355
|
+
.thread-ui-shell .timeline-special-info,
|
|
2356
|
+
.thread-ui-shell .timeline-special-file-read,
|
|
2357
|
+
.thread-ui-shell .timeline-special-success {
|
|
2358
|
+
box-shadow: none;
|
|
2359
|
+
}
|
|
2360
|
+
.thread-ui-shell .timeline-mobile-dense-command,
|
|
2361
|
+
.thread-ui-shell .timeline-mobile-dense-search,
|
|
2362
|
+
.thread-ui-shell .timeline-mobile-dense-file-read,
|
|
2363
|
+
.thread-ui-shell .timeline-mobile-dense-file {
|
|
2364
|
+
background: var(--theme-panel);
|
|
2365
|
+
}
|
|
2366
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.border-stone-700, .border-stone-700\\/90, .border-stone-800, .border-stone-800\\/80) {
|
|
2367
|
+
border-color: var(--theme-border) !important;
|
|
2368
|
+
}
|
|
2369
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.bg-stone-800, .bg-stone-900, .bg-stone-900\\/60, .bg-stone-900\\/72, .bg-stone-900\\/80, .bg-stone-950, .bg-stone-950\\/35, .bg-stone-950\\/40, .bg-stone-950\\/60, .bg-stone-950\\/70, .bg-stone-950\\/90, .bg-stone-950\\/96) {
|
|
2370
|
+
background: var(--theme-surface-strong) !important;
|
|
2371
|
+
}
|
|
2372
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-stone-100, .text-stone-200, .text-stone-300, .text-sky-50, .text-sky-100, .text-emerald-50, .text-emerald-100, .text-amber-100) {
|
|
2373
|
+
color: var(--theme-fg) !important;
|
|
2374
|
+
}
|
|
2375
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-stone-400, .text-stone-500) {
|
|
2376
|
+
color: var(--theme-fg-muted) !important;
|
|
2377
|
+
}
|
|
2378
|
+
.thread-ui-shell .timeline-kind-agent,
|
|
2379
|
+
.thread-ui-shell .timeline-kind-user,
|
|
2380
|
+
.thread-ui-shell .timeline-kind-command,
|
|
2381
|
+
.thread-ui-shell .timeline-kind-search,
|
|
2382
|
+
.thread-ui-shell .timeline-kind-file-read,
|
|
2383
|
+
.thread-ui-shell .timeline-kind-reasoning,
|
|
2384
|
+
.thread-ui-shell .timeline-kind-agent-tool,
|
|
2385
|
+
.thread-ui-shell .timeline-kind-skill-tool,
|
|
2386
|
+
.thread-ui-shell .timeline-kind-action,
|
|
2387
|
+
.thread-ui-shell .timeline-kind-plan,
|
|
2388
|
+
.thread-ui-shell .timeline-kind-file {
|
|
2389
|
+
border-left-width: 1px;
|
|
2390
|
+
}
|
|
2391
|
+
.thread-ui-shell .timeline-primary-text,
|
|
2392
|
+
.thread-ui-shell .timeline-message-content,
|
|
2393
|
+
.thread-ui-shell .timeline-mobile-bubble-content,
|
|
2394
|
+
.thread-ui-shell .thread-message-prose,
|
|
2395
|
+
.thread-ui-shell .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2396
|
+
color: var(--theme-fg);
|
|
2397
|
+
}
|
|
2398
|
+
.thread-ui-shell .timeline-user .thread-message-prose,
|
|
2399
|
+
.thread-ui-shell .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2400
|
+
color: oklch(0.24 0.027 255);
|
|
2401
|
+
}
|
|
2402
|
+
.thread-ui-shell.thread-ui-theme-dark .timeline-user .thread-message-prose,
|
|
2403
|
+
.thread-ui-shell[data-theme-effective=dark] .timeline-user .thread-message-prose,
|
|
2404
|
+
.thread-ui-shell.dark .timeline-user .thread-message-prose,
|
|
2405
|
+
.thread-ui-shell.thread-ui-theme-dark .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2406
|
+
.thread-ui-shell[data-theme-effective=dark] .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2407
|
+
.thread-ui-shell.dark .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2408
|
+
color: var(--theme-fg);
|
|
2409
|
+
}
|
|
2410
|
+
.thread-ui-shell .timeline-agent .thread-message-prose,
|
|
2411
|
+
.thread-ui-shell .timeline-agent .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2412
|
+
color: var(--theme-fg);
|
|
2413
|
+
}
|
|
2414
|
+
.thread-ui-shell .thread-graph-message {
|
|
2415
|
+
width: 100%;
|
|
2416
|
+
min-width: 0;
|
|
2417
|
+
}
|
|
2418
|
+
.thread-ui-shell .thread-graph-message-bubble {
|
|
2419
|
+
color: var(--theme-fg);
|
|
2420
|
+
}
|
|
2421
|
+
.thread-ui-shell .thread-graph-message-bubble.is-user {
|
|
2422
|
+
width: 100%;
|
|
2423
|
+
max-width: 100%;
|
|
2424
|
+
border-radius: 0.75rem;
|
|
2425
|
+
background: #eef5f9;
|
|
2426
|
+
padding: 0.5rem 0.75rem;
|
|
2427
|
+
color: rgb(15 23 42);
|
|
2428
|
+
}
|
|
2429
|
+
.thread-ui-shell .thread-graph-message-bubble.is-assistant {
|
|
2430
|
+
width: 100%;
|
|
2431
|
+
border: 0;
|
|
2432
|
+
background: transparent;
|
|
2433
|
+
padding: 0;
|
|
2434
|
+
box-shadow: none;
|
|
2435
|
+
}
|
|
2436
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-bubble.is-user,
|
|
2437
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-bubble.is-user,
|
|
2438
|
+
.thread-ui-shell.dark .thread-graph-message-bubble.is-user {
|
|
2439
|
+
background: #212b35;
|
|
2440
|
+
color: rgb(241 245 249);
|
|
2441
|
+
}
|
|
2442
|
+
.thread-ui-shell .thread-graph-message-content.is-user,
|
|
2443
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-message-prose,
|
|
2444
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2445
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2446
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2447
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2448
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-message-prose :where(p, li, span, div, strong, em, code),
|
|
2449
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code) {
|
|
2450
|
+
color: rgb(51 65 85);
|
|
2451
|
+
}
|
|
2452
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user,
|
|
2453
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user,
|
|
2454
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user,
|
|
2455
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-message-prose,
|
|
2456
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-message-prose,
|
|
2457
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-message-prose,
|
|
2458
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2459
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2460
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2461
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2462
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2463
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2464
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2465
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2466
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2467
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2468
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2469
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2470
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-message-prose :where(p, li, span, div, strong, em, code),
|
|
2471
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-message-prose :where(p, li, span, div, strong, em, code),
|
|
2472
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-message-prose :where(p, li, span, div, strong, em, code),
|
|
2473
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code),
|
|
2474
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code),
|
|
2475
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code) {
|
|
2476
|
+
color: rgb(226 232 240);
|
|
2477
|
+
}
|
|
2478
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant,
|
|
2479
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-message-prose,
|
|
2480
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-markdown,
|
|
2481
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-plain-text,
|
|
2482
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2483
|
+
color: var(--theme-fg);
|
|
2484
|
+
}
|
|
2485
|
+
.thread-ui-shell .thread-graph-message-prose,
|
|
2486
|
+
.thread-ui-shell .thread-graph-markdown,
|
|
2487
|
+
.thread-ui-shell .thread-graph-plain-text {
|
|
2488
|
+
color: inherit;
|
|
2489
|
+
}
|
|
2490
|
+
.thread-ui-shell .thread-graph-markdown {
|
|
2491
|
+
max-width: none;
|
|
2492
|
+
font-size: 0.875rem;
|
|
2493
|
+
line-height: 1.7;
|
|
2494
|
+
}
|
|
2495
|
+
.thread-ui-shell .thread-graph-message-markdown {
|
|
2496
|
+
color: inherit;
|
|
2497
|
+
word-break: break-word;
|
|
2498
|
+
}
|
|
2499
|
+
.thread-ui-shell .thread-graph-show-more {
|
|
2500
|
+
min-height: 1.25rem;
|
|
2501
|
+
border-color: var(--theme-border);
|
|
2502
|
+
background: color-mix(in oklch, var(--theme-panel) 72%, transparent);
|
|
2503
|
+
color: var(--theme-fg-muted);
|
|
2504
|
+
}
|
|
2505
|
+
.thread-ui-shell .thread-graph-show-more:hover,
|
|
2506
|
+
.thread-ui-shell .thread-graph-show-more:focus-visible {
|
|
2507
|
+
background: var(--theme-hover);
|
|
2508
|
+
color: var(--theme-fg);
|
|
2509
|
+
}
|
|
2510
|
+
.thread-ui-shell .thread-graph-markdown :where(p, ul, ol, pre, blockquote, table, hr) {
|
|
2511
|
+
margin-bottom: 0.75rem;
|
|
2512
|
+
}
|
|
2513
|
+
.thread-ui-shell .thread-graph-markdown :where(p:last-child, ul:last-child, ol:last-child, pre:last-child, blockquote:last-child, table:last-child, hr:last-child) {
|
|
2514
|
+
margin-bottom: 0;
|
|
2515
|
+
}
|
|
2516
|
+
.thread-ui-shell .thread-graph-markdown :where(a) {
|
|
2517
|
+
color: rgb(3 105 161);
|
|
2518
|
+
text-decoration: underline;
|
|
2519
|
+
text-underline-offset: 2px;
|
|
2520
|
+
}
|
|
2521
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-markdown :where(a),
|
|
2522
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-markdown :where(a),
|
|
2523
|
+
.thread-ui-shell.dark .thread-graph-markdown :where(a) {
|
|
2524
|
+
color: rgb(125 211 252);
|
|
2525
|
+
}
|
|
2526
|
+
.thread-ui-shell .thread-graph-markdown :where(blockquote) {
|
|
2527
|
+
border-left: 3px solid var(--theme-border-strong);
|
|
2528
|
+
padding-left: 0.85rem;
|
|
2529
|
+
color: var(--theme-fg-soft);
|
|
2530
|
+
}
|
|
2531
|
+
.thread-ui-shell .thread-graph-markdown :where(ul, ol) {
|
|
2532
|
+
padding-left: 1.25rem;
|
|
2533
|
+
}
|
|
2534
|
+
.thread-ui-shell .thread-graph-markdown :where(li) {
|
|
2535
|
+
margin-top: 0.25rem;
|
|
2536
|
+
}
|
|
2537
|
+
.thread-ui-shell .thread-graph-markdown :where(table) {
|
|
2538
|
+
display: block;
|
|
2539
|
+
width: 100%;
|
|
2540
|
+
overflow-x: auto;
|
|
2541
|
+
border-collapse: collapse;
|
|
2542
|
+
}
|
|
2543
|
+
.thread-ui-shell .thread-graph-markdown :where(th, td) {
|
|
2544
|
+
border: 1px solid var(--theme-border);
|
|
2545
|
+
padding: 0.4rem 0.55rem;
|
|
2546
|
+
text-align: left;
|
|
2547
|
+
}
|
|
2548
|
+
.thread-ui-shell .thread-graph-markdown :where(th) {
|
|
2549
|
+
background: var(--theme-surface-strong);
|
|
2550
|
+
color: var(--theme-fg);
|
|
2551
|
+
}
|
|
2552
|
+
.thread-ui-shell .thread-graph-code-block {
|
|
2553
|
+
border-color: rgb(226 232 240);
|
|
2554
|
+
background: rgb(248 250 252);
|
|
2555
|
+
color: rgb(31 41 55);
|
|
2556
|
+
}
|
|
2557
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-code-block,
|
|
2558
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-code-block,
|
|
2559
|
+
.thread-ui-shell.dark .thread-graph-code-block {
|
|
2560
|
+
border-color: #303642;
|
|
2561
|
+
background: #11141a;
|
|
2562
|
+
color: rgb(241 245 249);
|
|
2563
|
+
}
|
|
2564
|
+
.thread-ui-shell .thread-graph-code-block pre,
|
|
2565
|
+
.thread-ui-shell .thread-graph-code-block code {
|
|
2566
|
+
margin: 0;
|
|
2567
|
+
background: transparent;
|
|
2568
|
+
color: inherit;
|
|
2569
|
+
}
|
|
2570
|
+
.thread-ui-shell .thread-graph-code-copy {
|
|
2571
|
+
background: rgb(255 255 255 / 0.72);
|
|
2572
|
+
color: rgb(51 65 85);
|
|
2573
|
+
box-shadow: 0 4px 12px rgb(15 23 42 / 0.08);
|
|
2574
|
+
}
|
|
2575
|
+
.thread-ui-shell .thread-graph-code-copy:hover {
|
|
2576
|
+
background: rgb(255 255 255);
|
|
2577
|
+
color: rgb(15 23 42);
|
|
2578
|
+
}
|
|
2579
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-code-copy,
|
|
2580
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-code-copy,
|
|
2581
|
+
.thread-ui-shell.dark .thread-graph-code-copy {
|
|
2582
|
+
background: rgb(34 39 51 / 0.82);
|
|
2583
|
+
color: rgb(226 232 240);
|
|
2584
|
+
}
|
|
2585
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-code-copy:hover,
|
|
2586
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-code-copy:hover,
|
|
2587
|
+
.thread-ui-shell.dark .thread-graph-code-copy:hover {
|
|
2588
|
+
background: #2b313d;
|
|
2589
|
+
color: rgb(248 250 252);
|
|
2590
|
+
}
|
|
2591
|
+
.thread-ui-shell .thread-graph-inline-code {
|
|
2592
|
+
background: rgb(241 245 249);
|
|
2593
|
+
color: rgb(31 41 55);
|
|
2594
|
+
}
|
|
2595
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-inline-code,
|
|
2596
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-inline-code,
|
|
2597
|
+
.thread-ui-shell.dark .thread-graph-inline-code {
|
|
2598
|
+
background: #222733;
|
|
2599
|
+
color: rgb(241 245 249);
|
|
2600
|
+
}
|
|
2601
|
+
.thread-ui-shell .thread-graph-message-sender {
|
|
2602
|
+
background: oklch(0.96 0.025 155);
|
|
2603
|
+
color: oklch(0.42 0.11 155);
|
|
2604
|
+
}
|
|
2605
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-sender,
|
|
2606
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-sender,
|
|
2607
|
+
.thread-ui-shell.dark .thread-graph-message-sender {
|
|
2608
|
+
background: rgb(52 211 153 / 0.1);
|
|
2609
|
+
color: rgb(110 231 183);
|
|
2610
|
+
}
|
|
2611
|
+
.thread-ui-shell .thread-graph-message-copy {
|
|
2612
|
+
border-color: var(--theme-border);
|
|
2613
|
+
background: var(--theme-panel);
|
|
2614
|
+
color: var(--theme-fg-muted);
|
|
2615
|
+
}
|
|
2616
|
+
.thread-ui-shell .thread-graph-thinking-toggle {
|
|
2617
|
+
border-color: var(--theme-border);
|
|
2618
|
+
background: var(--theme-panel);
|
|
2619
|
+
color: var(--theme-fg-muted);
|
|
2620
|
+
}
|
|
2621
|
+
.thread-ui-shell .thread-graph-message-copy:hover,
|
|
2622
|
+
.thread-ui-shell .thread-graph-thinking-toggle:hover,
|
|
2623
|
+
.thread-ui-shell .thread-graph-thinking-toggle.is-open {
|
|
2624
|
+
background: var(--theme-hover);
|
|
2625
|
+
color: var(--theme-fg);
|
|
2626
|
+
}
|
|
2627
|
+
.thread-ui-shell .thread-graph-message-header-actions {
|
|
2628
|
+
color: var(--theme-fg-muted);
|
|
2629
|
+
}
|
|
2630
|
+
.thread-ui-shell .thread-graph-message-time {
|
|
2631
|
+
color: var(--theme-fg-muted);
|
|
2632
|
+
white-space: nowrap;
|
|
2633
|
+
}
|
|
2634
|
+
.thread-ui-shell .thread-graph-message-status {
|
|
2635
|
+
box-shadow: none;
|
|
2636
|
+
}
|
|
2637
|
+
.thread-ui-shell .thread-graph-message-status-icon {
|
|
2638
|
+
align-items: center;
|
|
2639
|
+
justify-content: center;
|
|
2640
|
+
}
|
|
2641
|
+
@media (max-width: 639px) {
|
|
2642
|
+
.thread-ui-shell .thread-graph-message-header {
|
|
2643
|
+
margin-bottom: 0.375rem;
|
|
2644
|
+
flex-wrap: nowrap;
|
|
2645
|
+
}
|
|
2646
|
+
.thread-ui-shell .thread-graph-message-sender {
|
|
2647
|
+
padding: 0.1875rem 0.5rem;
|
|
2648
|
+
font-size: 0.6875rem;
|
|
2649
|
+
line-height: 1rem;
|
|
2650
|
+
}
|
|
2651
|
+
.thread-ui-shell .thread-graph-message-header-actions {
|
|
2652
|
+
gap: 0.25rem;
|
|
2653
|
+
}
|
|
2654
|
+
.thread-ui-shell .thread-graph-message-copy {
|
|
2655
|
+
height: 1.55rem;
|
|
2656
|
+
width: 1.55rem;
|
|
2657
|
+
border-radius: 0.45rem;
|
|
2658
|
+
}
|
|
2659
|
+
.thread-ui-shell .thread-graph-message-time {
|
|
2660
|
+
font-size: 0.625rem;
|
|
2661
|
+
}
|
|
2662
|
+
.thread-ui-shell :where(.thread-graph-message-status, .thread-graph-tool-badge) .thread-graph-status-label {
|
|
2663
|
+
position: absolute;
|
|
2664
|
+
width: 1px;
|
|
2665
|
+
height: 1px;
|
|
2666
|
+
padding: 0;
|
|
2667
|
+
margin: -1px;
|
|
2668
|
+
overflow: hidden;
|
|
2669
|
+
clip: rect(0, 0, 0, 0);
|
|
2670
|
+
white-space: nowrap;
|
|
2671
|
+
border: 0;
|
|
2672
|
+
}
|
|
2673
|
+
.thread-ui-shell :where(.thread-graph-message-status, .thread-graph-tool-badge) {
|
|
2674
|
+
min-width: 1.45rem;
|
|
2675
|
+
justify-content: center;
|
|
2676
|
+
padding-left: 0.25rem !important;
|
|
2677
|
+
padding-right: 0.25rem !important;
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
@media (min-width: 640px) {
|
|
2681
|
+
.thread-ui-shell .thread-graph-message-bubble.is-user {
|
|
2682
|
+
padding: 0.375rem 1rem;
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
`);tr(`.thread-ui-shell .timeline-soft-text,
|
|
2686
|
+
.thread-ui-shell .thread-message-prose :where(blockquote) {
|
|
2687
|
+
color: var(--theme-fg-soft);
|
|
2688
|
+
}
|
|
2689
|
+
.thread-ui-shell .timeline-meta-text,
|
|
2690
|
+
.thread-ui-shell .thread-message-prose :where(figcaption) {
|
|
2691
|
+
color: var(--theme-fg-muted);
|
|
2692
|
+
}
|
|
2693
|
+
.thread-ui-shell .timeline-overlay-badge,
|
|
2694
|
+
.thread-ui-shell .ui-status-neutral,
|
|
2695
|
+
.thread-ui-shell .ui-status-info,
|
|
2696
|
+
.thread-ui-shell .ui-status-warning,
|
|
2697
|
+
.thread-ui-shell .ui-status-success,
|
|
2698
|
+
.thread-ui-shell .ui-status-danger {
|
|
2699
|
+
border-color: transparent;
|
|
2700
|
+
box-shadow: none;
|
|
2701
|
+
}
|
|
2702
|
+
.thread-ui-shell .timeline-command-status-complete,
|
|
2703
|
+
.thread-ui-shell .timeline-command-status-pending,
|
|
2704
|
+
.thread-ui-shell .timeline-delta-badge,
|
|
2705
|
+
.thread-ui-shell .timeline-live-plan-step {
|
|
2706
|
+
border-color: var(--theme-border);
|
|
2707
|
+
background: var(--theme-muted);
|
|
2708
|
+
color: var(--theme-fg-soft);
|
|
2709
|
+
}
|
|
2710
|
+
.thread-ui-shell .ui-status-neutral {
|
|
2711
|
+
background: var(--theme-muted);
|
|
2712
|
+
color: var(--theme-fg-soft);
|
|
2713
|
+
}
|
|
2714
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-neutral,
|
|
2715
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-neutral,
|
|
2716
|
+
.thread-ui-shell.dark .ui-status-neutral {
|
|
2717
|
+
border-color: #303642;
|
|
2718
|
+
background: #151923;
|
|
2719
|
+
color: rgb(203 213 225);
|
|
2720
|
+
}
|
|
2721
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card.is-active .ui-status-neutral,
|
|
2722
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card.is-active .ui-status-neutral,
|
|
2723
|
+
.thread-ui-shell.dark .thread-graph-room-card.is-active .ui-status-neutral {
|
|
2724
|
+
border-color: #424b5e;
|
|
2725
|
+
background: #1a1f2a;
|
|
2726
|
+
color: rgb(203 213 225);
|
|
2727
|
+
}
|
|
2728
|
+
.thread-ui-shell .ui-status-info {
|
|
2729
|
+
background: oklch(0.94 0.03 235);
|
|
2730
|
+
color: oklch(0.43 0.09 242);
|
|
2731
|
+
}
|
|
2732
|
+
.thread-ui-shell .ui-status-warning {
|
|
2733
|
+
background: oklch(0.94 0.048 84);
|
|
2734
|
+
color: oklch(0.46 0.08 75);
|
|
2735
|
+
}
|
|
2736
|
+
.thread-ui-shell .ui-status-success {
|
|
2737
|
+
background: oklch(0.94 0.052 155);
|
|
2738
|
+
color: oklch(0.43 0.095 155);
|
|
2739
|
+
}
|
|
2740
|
+
.thread-ui-shell .ui-status-danger {
|
|
2741
|
+
background: oklch(0.94 0.04 25);
|
|
2742
|
+
color: oklch(0.48 0.125 24);
|
|
2743
|
+
}
|
|
2744
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-info,
|
|
2745
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-info,
|
|
2746
|
+
.thread-ui-shell.dark .ui-status-info {
|
|
2747
|
+
background: oklch(0.3 0.042 235);
|
|
2748
|
+
color: oklch(0.77 0.1 235);
|
|
2749
|
+
}
|
|
2750
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-warning,
|
|
2751
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-warning,
|
|
2752
|
+
.thread-ui-shell.dark .ui-status-warning {
|
|
2753
|
+
background: oklch(0.31 0.045 75);
|
|
2754
|
+
color: oklch(0.83 0.11 80);
|
|
2755
|
+
}
|
|
2756
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-success,
|
|
2757
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-success,
|
|
2758
|
+
.thread-ui-shell.dark .ui-status-success {
|
|
2759
|
+
background: oklch(0.31 0.05 155);
|
|
2760
|
+
color: oklch(0.8 0.115 155);
|
|
2761
|
+
}
|
|
2762
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-danger,
|
|
2763
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-danger,
|
|
2764
|
+
.thread-ui-shell.dark .ui-status-danger {
|
|
2765
|
+
background: oklch(0.31 0.052 25);
|
|
2766
|
+
color: oklch(0.78 0.12 25);
|
|
2767
|
+
}
|
|
2768
|
+
.thread-ui-shell .thread-message-icon-user,
|
|
2769
|
+
.thread-ui-shell .thread-message-icon-agent {
|
|
2770
|
+
border-color: transparent;
|
|
2771
|
+
background: var(--theme-muted);
|
|
2772
|
+
color: var(--theme-fg-muted);
|
|
2773
|
+
}
|
|
2774
|
+
.thread-ui-shell .thread-graph-thinking-trigger {
|
|
2775
|
+
display: inline-flex;
|
|
2776
|
+
align-items: center;
|
|
2777
|
+
color: rgb(148 163 184);
|
|
2778
|
+
}
|
|
2779
|
+
.thread-ui-shell .thread-graph-thinking-trigger:hover,
|
|
2780
|
+
.thread-ui-shell .thread-graph-thinking-trigger[data-state=open] {
|
|
2781
|
+
color: rgb(125 211 252);
|
|
2782
|
+
}
|
|
2783
|
+
.thread-ui-shell .thread-graph-thinking-label {
|
|
2784
|
+
min-width: 0;
|
|
2785
|
+
}
|
|
2786
|
+
.thread-ui-shell .thread-graph-thinking-body {
|
|
2787
|
+
border-color: rgb(42 47 58);
|
|
2788
|
+
background: #1b1f29;
|
|
2789
|
+
color: rgb(203 213 225);
|
|
2790
|
+
}
|
|
2791
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-trigger {
|
|
2792
|
+
color: rgb(100 116 139);
|
|
2793
|
+
}
|
|
2794
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-trigger:hover,
|
|
2795
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-trigger[data-state=open] {
|
|
2796
|
+
color: rgb(3 105 161);
|
|
2797
|
+
}
|
|
2798
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-body {
|
|
2799
|
+
border-color: rgb(226 232 240);
|
|
2800
|
+
background: rgb(248 250 252);
|
|
2801
|
+
color: rgb(51 65 85);
|
|
2802
|
+
}
|
|
2803
|
+
.thread-ui-shell .timeline-corner-copy-visual {
|
|
2804
|
+
border-color: var(--theme-border);
|
|
2805
|
+
background: color-mix(in oklch, var(--theme-panel) 88%, transparent);
|
|
2806
|
+
color: var(--theme-fg-muted);
|
|
2807
|
+
}
|
|
2808
|
+
.thread-ui-shell .thread-composer-form {
|
|
2809
|
+
border-color: var(--theme-border);
|
|
2810
|
+
background: var(--theme-surface);
|
|
2811
|
+
}
|
|
2812
|
+
.thread-ui-shell .thread-composer-toolbar,
|
|
2813
|
+
.thread-ui-shell .thread-composer-input,
|
|
2814
|
+
.thread-ui-shell .thread-composer-menu {
|
|
2815
|
+
border-color: var(--theme-border);
|
|
2816
|
+
background: var(--theme-panel);
|
|
2817
|
+
color: var(--theme-fg);
|
|
2818
|
+
}
|
|
2819
|
+
.thread-ui-shell .thread-composer-toolbar {
|
|
2820
|
+
border-radius: 0;
|
|
2821
|
+
border: 0;
|
|
2822
|
+
background: transparent;
|
|
2823
|
+
box-shadow: none;
|
|
2824
|
+
order: 2;
|
|
2825
|
+
min-height: 2.75rem;
|
|
2826
|
+
padding: 0.25rem 0.75rem 0.65rem;
|
|
2827
|
+
flex-wrap: wrap;
|
|
2828
|
+
align-items: center;
|
|
2829
|
+
}
|
|
2830
|
+
.thread-ui-shell .thread-composer-prompt-region {
|
|
2831
|
+
order: 1;
|
|
2832
|
+
}
|
|
2833
|
+
.thread-ui-shell .thread-composer-input {
|
|
2834
|
+
position: relative;
|
|
2835
|
+
min-height: 5.25rem !important;
|
|
2836
|
+
max-height: 12rem !important;
|
|
2837
|
+
border: 0;
|
|
2838
|
+
border-radius: 0;
|
|
2839
|
+
background: transparent !important;
|
|
2840
|
+
box-shadow: none;
|
|
2841
|
+
overflow: visible;
|
|
2842
|
+
padding-top: 0.7rem;
|
|
2843
|
+
padding-bottom: 0.45rem;
|
|
2844
|
+
}
|
|
2845
|
+
.thread-ui-shell .thread-composer-input:focus-within {
|
|
2846
|
+
border-color: transparent;
|
|
2847
|
+
box-shadow: none;
|
|
2848
|
+
}
|
|
2849
|
+
.thread-ui-shell .thread-composer-input [contenteditable],
|
|
2850
|
+
.thread-ui-shell .thread-composer-input textarea {
|
|
2851
|
+
display: block;
|
|
2852
|
+
width: 100%;
|
|
2853
|
+
min-width: 0;
|
|
2854
|
+
background: transparent !important;
|
|
2855
|
+
color: var(--theme-fg);
|
|
2856
|
+
font-size: 1rem;
|
|
2857
|
+
line-height: 1.55;
|
|
2858
|
+
}
|
|
2859
|
+
.thread-ui-shell .thread-composer-input [contenteditable] {
|
|
2860
|
+
min-height: 4.15rem !important;
|
|
2861
|
+
max-height: 9.5rem !important;
|
|
2862
|
+
overflow-y: auto;
|
|
2863
|
+
}
|
|
2864
|
+
.thread-ui-shell .thread-composer-input textarea {
|
|
2865
|
+
min-height: 4.15rem !important;
|
|
2866
|
+
max-height: 9.5rem !important;
|
|
2867
|
+
overflow-y: auto;
|
|
2868
|
+
resize: none;
|
|
2869
|
+
}
|
|
2870
|
+
.thread-ui-shell .thread-composer-shell {
|
|
2871
|
+
border: 1px solid var(--theme-border);
|
|
2872
|
+
background: #fbfcfd;
|
|
2873
|
+
box-shadow: 0 4px 18px oklch(0.22 0.024 255 / 0.04);
|
|
2874
|
+
}
|
|
2875
|
+
.thread-ui-shell .thread-composer-send-button {
|
|
2876
|
+
flex: 0 0 auto;
|
|
2877
|
+
}
|
|
2878
|
+
.thread-ui-shell .thread-goal-compose-card {
|
|
2879
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 18%, var(--theme-border));
|
|
2880
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 7%, var(--theme-panel));
|
|
2881
|
+
color: var(--theme-fg-soft);
|
|
2882
|
+
box-shadow: 0 8px 18px rgb(15 23 42 / 0.05);
|
|
2883
|
+
}
|
|
2884
|
+
.thread-ui-shell .thread-goal-compose-label {
|
|
2885
|
+
color: color-mix(in oklch, var(--theme-accent-solid) 68%, var(--theme-fg));
|
|
2886
|
+
}
|
|
2887
|
+
.thread-ui-shell .thread-goal-compose-field {
|
|
2888
|
+
color: var(--theme-fg-soft);
|
|
2889
|
+
}
|
|
2890
|
+
.thread-ui-shell .thread-goal-compose-input {
|
|
2891
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 20%, var(--theme-border));
|
|
2892
|
+
background: var(--theme-panel);
|
|
2893
|
+
color: var(--theme-fg);
|
|
2894
|
+
}
|
|
2895
|
+
.thread-ui-shell .thread-goal-compose-input::placeholder {
|
|
2896
|
+
color: var(--theme-fg-muted);
|
|
2897
|
+
}
|
|
2898
|
+
.thread-ui-shell .thread-goal-compose-input:focus {
|
|
2899
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 48%, var(--theme-border));
|
|
2900
|
+
}
|
|
2901
|
+
.thread-ui-shell .thread-goal-compose-cancel {
|
|
2902
|
+
border-color: var(--theme-border);
|
|
2903
|
+
background: var(--theme-surface-strong);
|
|
2904
|
+
color: var(--theme-fg-soft);
|
|
2905
|
+
}
|
|
2906
|
+
.thread-ui-shell .thread-goal-compose-cancel:hover {
|
|
2907
|
+
background: var(--theme-hover);
|
|
2908
|
+
color: var(--theme-fg);
|
|
2909
|
+
}
|
|
2910
|
+
.thread-ui-shell .thread-goal-compose-error {
|
|
2911
|
+
color: rgb(190 18 60);
|
|
2912
|
+
}
|
|
2913
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-card,
|
|
2914
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-card,
|
|
2915
|
+
.thread-ui-shell.dark .thread-goal-compose-card {
|
|
2916
|
+
border-color: rgb(125 211 252 / 0.25);
|
|
2917
|
+
background: rgb(125 211 252 / 0.07);
|
|
2918
|
+
color: rgb(226 232 240);
|
|
2919
|
+
box-shadow: 0 8px 18px rgb(0 0 0 / 0.18);
|
|
2920
|
+
}
|
|
2921
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-label,
|
|
2922
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-label,
|
|
2923
|
+
.thread-ui-shell.dark .thread-goal-compose-label {
|
|
2924
|
+
color: rgb(224 242 254 / 0.9);
|
|
2925
|
+
}
|
|
2926
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-field,
|
|
2927
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-field,
|
|
2928
|
+
.thread-ui-shell.dark .thread-goal-compose-field {
|
|
2929
|
+
color: rgb(203 213 225);
|
|
2930
|
+
}
|
|
2931
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-input,
|
|
2932
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-input,
|
|
2933
|
+
.thread-ui-shell.dark .thread-goal-compose-input {
|
|
2934
|
+
border-color: rgb(125 211 252 / 0.25);
|
|
2935
|
+
background: rgb(2 6 23 / 0.46);
|
|
2936
|
+
color: rgb(241 245 249);
|
|
2937
|
+
}
|
|
2938
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-cancel,
|
|
2939
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-cancel,
|
|
2940
|
+
.thread-ui-shell.dark .thread-goal-compose-cancel {
|
|
2941
|
+
border-color: #343b48;
|
|
2942
|
+
background: #1d222c;
|
|
2943
|
+
color: rgb(203 213 225);
|
|
2944
|
+
}
|
|
2945
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-cancel:hover,
|
|
2946
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-cancel:hover,
|
|
2947
|
+
.thread-ui-shell.dark .thread-goal-compose-cancel:hover {
|
|
2948
|
+
background: #222733;
|
|
2949
|
+
color: rgb(241 245 249);
|
|
2950
|
+
}
|
|
2951
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-error,
|
|
2952
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-error,
|
|
2953
|
+
.thread-ui-shell.dark .thread-goal-compose-error {
|
|
2954
|
+
color: rgb(254 205 211);
|
|
2955
|
+
}
|
|
2956
|
+
@media (min-width: 640px) {
|
|
2957
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-shell {
|
|
2958
|
+
border-radius: 16px;
|
|
2959
|
+
}
|
|
2960
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-input {
|
|
2961
|
+
min-height: 5.75rem !important;
|
|
2962
|
+
max-height: 12.5rem !important;
|
|
2963
|
+
padding-top: 0.9rem;
|
|
2964
|
+
}
|
|
2965
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-input [contenteditable],
|
|
2966
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-input textarea {
|
|
2967
|
+
min-height: 4.5rem !important;
|
|
2968
|
+
max-height: 10rem !important;
|
|
2969
|
+
font-size: 0.875rem;
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-form {
|
|
2973
|
+
padding: 0.5rem 1rem 0.75rem;
|
|
2974
|
+
}
|
|
2975
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-shell,
|
|
2976
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-shell,
|
|
2977
|
+
.thread-ui-shell.dark .thread-composer-shell {
|
|
2978
|
+
border-color: #303642;
|
|
2979
|
+
background: #181b23;
|
|
2980
|
+
box-shadow: 0 8px 24px oklch(0 0 0 / 0.22);
|
|
2981
|
+
}
|
|
2982
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-toolbar,
|
|
2983
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-toolbar,
|
|
2984
|
+
.thread-ui-shell.dark .thread-composer-toolbar,
|
|
2985
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input,
|
|
2986
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input,
|
|
2987
|
+
.thread-ui-shell.dark .thread-composer-input {
|
|
2988
|
+
border-color: #303642 !important;
|
|
2989
|
+
background: transparent !important;
|
|
2990
|
+
color: rgb(241 245 249) !important;
|
|
2991
|
+
box-shadow: none !important;
|
|
2992
|
+
}
|
|
2993
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input [contenteditable],
|
|
2994
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input [contenteditable],
|
|
2995
|
+
.thread-ui-shell.dark .thread-composer-input [contenteditable],
|
|
2996
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input textarea,
|
|
2997
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input textarea,
|
|
2998
|
+
.thread-ui-shell.dark .thread-composer-input textarea {
|
|
2999
|
+
background: transparent !important;
|
|
3000
|
+
color: rgb(241 245 249) !important;
|
|
3001
|
+
}
|
|
3002
|
+
.thread-ui-shell .thread-graph-composer-form {
|
|
3003
|
+
border-color: var(--theme-border);
|
|
3004
|
+
background: var(--theme-surface);
|
|
3005
|
+
}
|
|
3006
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-form,
|
|
3007
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-form,
|
|
3008
|
+
.thread-ui-shell.dark .thread-graph-composer-form {
|
|
3009
|
+
border-color: var(--theme-border);
|
|
3010
|
+
background: var(--theme-surface);
|
|
3011
|
+
}
|
|
3012
|
+
.thread-ui-shell .thread-graph-composer-shell {
|
|
3013
|
+
border: 1px solid var(--theme-border);
|
|
3014
|
+
background: var(--theme-panel);
|
|
3015
|
+
box-shadow: 0 4px 18px oklch(0.22 0.024 255 / 0.04);
|
|
3016
|
+
overflow: visible !important;
|
|
3017
|
+
}
|
|
3018
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-shell,
|
|
3019
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-shell,
|
|
3020
|
+
.thread-ui-shell.dark .thread-graph-composer-shell {
|
|
3021
|
+
border-color: var(--theme-border-strong);
|
|
3022
|
+
background: var(--theme-panel);
|
|
3023
|
+
box-shadow: 0 8px 24px oklch(0 0 0 / 0.22);
|
|
3024
|
+
}
|
|
3025
|
+
.thread-ui-shell .thread-graph-composer-input-group {
|
|
3026
|
+
order: 1;
|
|
3027
|
+
display: flex;
|
|
3028
|
+
flex-direction: column;
|
|
3029
|
+
align-items: stretch;
|
|
3030
|
+
height: auto;
|
|
3031
|
+
min-height: 0;
|
|
3032
|
+
color: rgb(30 41 59);
|
|
3033
|
+
overflow: visible !important;
|
|
3034
|
+
}
|
|
3035
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-input-group,
|
|
3036
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-input-group,
|
|
3037
|
+
.thread-ui-shell.dark .thread-graph-composer-input-group {
|
|
3038
|
+
color: rgb(241 245 249);
|
|
3039
|
+
}
|
|
3040
|
+
.thread-ui-shell .thread-graph-composer-prompt-region {
|
|
3041
|
+
order: 1;
|
|
3042
|
+
}
|
|
3043
|
+
.thread-ui-shell .thread-graph-composer-input {
|
|
3044
|
+
position: relative;
|
|
3045
|
+
border: 0;
|
|
3046
|
+
background: transparent;
|
|
3047
|
+
color: rgb(30 41 59);
|
|
3048
|
+
box-shadow: none;
|
|
3049
|
+
overflow-y: auto;
|
|
3050
|
+
}
|
|
3051
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-input,
|
|
3052
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-input,
|
|
3053
|
+
.thread-ui-shell.dark .thread-graph-composer-input {
|
|
3054
|
+
color: rgb(241 245 249);
|
|
3055
|
+
}
|
|
3056
|
+
.thread-ui-shell .thread-graph-composer-input [contenteditable] {
|
|
3057
|
+
display: block;
|
|
3058
|
+
width: 100%;
|
|
3059
|
+
min-width: 0;
|
|
3060
|
+
overflow-y: auto;
|
|
3061
|
+
background: transparent;
|
|
3062
|
+
color: inherit;
|
|
3063
|
+
}
|
|
3064
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-chip,
|
|
3065
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-chip {
|
|
3066
|
+
box-sizing: border-box;
|
|
3067
|
+
flex: 0 0 auto;
|
|
3068
|
+
width: max-content !important;
|
|
3069
|
+
max-width: min(100%, 7.25rem) !important;
|
|
3070
|
+
vertical-align: middle;
|
|
3071
|
+
}
|
|
3072
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-chip-photo,
|
|
3073
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-chip-photo {
|
|
3074
|
+
display: inline-flex !important;
|
|
3075
|
+
flex-direction: column;
|
|
3076
|
+
align-items: flex-start;
|
|
3077
|
+
gap: 0.25rem;
|
|
3078
|
+
padding: 0.35rem !important;
|
|
3079
|
+
}
|
|
3080
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-thumb,
|
|
3081
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-thumb {
|
|
3082
|
+
display: block;
|
|
3083
|
+
width: 5.75rem !important;
|
|
3084
|
+
height: 3.75rem !important;
|
|
3085
|
+
max-width: 100%;
|
|
3086
|
+
border-radius: 0.6rem !important;
|
|
3087
|
+
object-fit: cover;
|
|
3088
|
+
}
|
|
3089
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3090
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-caption {
|
|
3091
|
+
display: block !important;
|
|
3092
|
+
width: 100%;
|
|
3093
|
+
max-width: 5.75rem !important;
|
|
3094
|
+
margin-left: 0 !important;
|
|
3095
|
+
overflow: hidden;
|
|
3096
|
+
color: rgb(3 105 161);
|
|
3097
|
+
text-overflow: ellipsis;
|
|
3098
|
+
white-space: nowrap;
|
|
3099
|
+
}
|
|
3100
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3101
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3102
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3103
|
+
.thread-ui-shell.dark .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3104
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input .thread-composer-attachment-caption,
|
|
3105
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input .thread-composer-attachment-caption,
|
|
3106
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-composer-input .thread-composer-attachment-caption,
|
|
3107
|
+
.thread-ui-shell.dark .thread-composer-input .thread-composer-attachment-caption {
|
|
3108
|
+
color: rgb(125 211 252);
|
|
3109
|
+
}
|
|
3110
|
+
.thread-ui-shell .thread-graph-composer-toolbar {
|
|
3111
|
+
order: 2;
|
|
3112
|
+
width: 100%;
|
|
3113
|
+
min-height: 2.75rem;
|
|
3114
|
+
flex-wrap: wrap;
|
|
3115
|
+
justify-content: flex-start;
|
|
3116
|
+
gap: 0.5rem;
|
|
3117
|
+
border: 0;
|
|
3118
|
+
background: transparent;
|
|
3119
|
+
padding: 0 0.5rem 0.5rem;
|
|
3120
|
+
color: rgb(100 116 139);
|
|
3121
|
+
box-shadow: none;
|
|
3122
|
+
overflow: visible !important;
|
|
3123
|
+
}
|
|
3124
|
+
@media (min-width: 640px) {
|
|
3125
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-composer-toolbar {
|
|
3126
|
+
flex-wrap: nowrap;
|
|
3127
|
+
padding: 0 0.75rem 0.75rem;
|
|
3128
|
+
}
|
|
3129
|
+
}
|
|
3130
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-toolbar,
|
|
3131
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-toolbar,
|
|
3132
|
+
.thread-ui-shell.dark .thread-graph-composer-toolbar {
|
|
3133
|
+
color: rgb(148 163 184);
|
|
3134
|
+
}
|
|
3135
|
+
.thread-ui-shell .thread-graph-composer-send-button {
|
|
3136
|
+
flex: 0 0 auto;
|
|
3137
|
+
}
|
|
3138
|
+
.thread-ui-shell .thread-graph-composer-stop-button {
|
|
3139
|
+
border-color: rgb(244 63 94 / 0.28) !important;
|
|
3140
|
+
box-shadow: 0 8px 18px rgb(15 23 42 / 0.14);
|
|
3141
|
+
}
|
|
3142
|
+
.thread-ui-shell .thread-graph-composer-prompt-region .thread-graph-composer-stop-button {
|
|
3143
|
+
position: absolute;
|
|
3144
|
+
}
|
|
3145
|
+
@media (max-width: 639px) {
|
|
3146
|
+
.thread-ui-shell .thread-graph-composer-form {
|
|
3147
|
+
padding: 0.35rem 0.55rem calc(env(safe-area-inset-bottom) + 0.35rem) !important;
|
|
3148
|
+
}
|
|
3149
|
+
.thread-ui-shell .thread-graph-composer-shell {
|
|
3150
|
+
border-radius: 14px !important;
|
|
3151
|
+
}
|
|
3152
|
+
.thread-ui-shell .thread-graph-composer-input {
|
|
3153
|
+
min-height: 3.65rem !important;
|
|
3154
|
+
max-height: 7.5rem !important;
|
|
3155
|
+
padding: 0.65rem 0.75rem 0.2rem !important;
|
|
3156
|
+
}
|
|
3157
|
+
.thread-ui-shell .thread-graph-composer-input [contenteditable] {
|
|
3158
|
+
min-height: 3rem !important;
|
|
3159
|
+
padding-right: 2.5rem;
|
|
3160
|
+
}
|
|
3161
|
+
.thread-ui-shell .thread-graph-composer-toolbar {
|
|
3162
|
+
min-height: 2.35rem;
|
|
3163
|
+
gap: 0.3rem;
|
|
3164
|
+
padding: 0 0.45rem 0.45rem;
|
|
3165
|
+
}
|
|
3166
|
+
.thread-ui-shell .thread-graph-composer-toolbar > .flex {
|
|
3167
|
+
min-width: 0;
|
|
3168
|
+
gap: 0.3rem;
|
|
3169
|
+
}
|
|
3170
|
+
.thread-ui-shell .thread-graph-composer-icon-button,
|
|
3171
|
+
.thread-ui-shell .thread-graph-composer-send-button {
|
|
3172
|
+
width: 1.95rem !important;
|
|
3173
|
+
height: 1.95rem !important;
|
|
3174
|
+
}
|
|
3175
|
+
.thread-ui-shell .thread-graph-composer-inline-toggle {
|
|
3176
|
+
height: 1.95rem;
|
|
3177
|
+
max-width: 6.75rem !important;
|
|
3178
|
+
padding-left: 0.5rem !important;
|
|
3179
|
+
padding-right: 0.5rem !important;
|
|
3180
|
+
font-size: 0.6875rem;
|
|
3181
|
+
}
|
|
3182
|
+
.thread-ui-shell .thread-graph-composer-stop-button {
|
|
3183
|
+
top: 0.45rem !important;
|
|
3184
|
+
right: 0.45rem !important;
|
|
3185
|
+
width: 1.8rem !important;
|
|
3186
|
+
height: 1.8rem !important;
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
.thread-ui-shell .thread-composer-icon-button,
|
|
3190
|
+
.thread-ui-shell .thread-composer-inline-toggle,
|
|
3191
|
+
.thread-ui-shell .thread-composer-chip-button,
|
|
3192
|
+
.thread-ui-shell .thread-composer-menu-item,
|
|
3193
|
+
.thread-ui-shell .thread-composer-panel-button,
|
|
3194
|
+
.thread-ui-shell .thread-graph-composer-icon-button,
|
|
3195
|
+
.thread-ui-shell .thread-graph-composer-inline-toggle,
|
|
3196
|
+
.thread-ui-shell .thread-graph-composer-chip-button,
|
|
3197
|
+
.thread-ui-shell .thread-graph-composer-menu-item,
|
|
3198
|
+
.thread-ui-shell .thread-graph-composer-panel-button {
|
|
3199
|
+
border-color: var(--theme-border) !important;
|
|
3200
|
+
background: transparent !important;
|
|
3201
|
+
color: var(--theme-fg-soft) !important;
|
|
3202
|
+
}
|
|
3203
|
+
.thread-ui-shell .thread-composer-icon-button:hover,
|
|
3204
|
+
.thread-ui-shell .thread-composer-inline-toggle:hover,
|
|
3205
|
+
.thread-ui-shell .thread-composer-chip-button:hover,
|
|
3206
|
+
.thread-ui-shell .thread-composer-menu-item:hover,
|
|
3207
|
+
.thread-ui-shell .thread-composer-panel-button:hover,
|
|
3208
|
+
.thread-ui-shell .thread-graph-composer-icon-button:hover,
|
|
3209
|
+
.thread-ui-shell .thread-graph-composer-inline-toggle:hover,
|
|
3210
|
+
.thread-ui-shell .thread-graph-composer-chip-button:hover,
|
|
3211
|
+
.thread-ui-shell .thread-graph-composer-menu-item:hover,
|
|
3212
|
+
.thread-ui-shell .thread-graph-composer-panel-button:hover {
|
|
3213
|
+
background: var(--theme-hover) !important;
|
|
3214
|
+
color: var(--theme-fg) !important;
|
|
3215
|
+
}
|
|
3216
|
+
.thread-ui-shell .thread-composer-icon-button,
|
|
3217
|
+
.thread-ui-shell .thread-graph-composer-icon-button {
|
|
3218
|
+
background: var(--theme-muted) !important;
|
|
3219
|
+
}
|
|
3220
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-icon-button,
|
|
3221
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-icon-button,
|
|
3222
|
+
.thread-ui-shell.dark .thread-composer-icon-button,
|
|
3223
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-icon-button,
|
|
3224
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-icon-button,
|
|
3225
|
+
.thread-ui-shell.dark .thread-graph-composer-icon-button {
|
|
3226
|
+
border-color: #303642 !important;
|
|
3227
|
+
background: #222733 !important;
|
|
3228
|
+
color: rgb(203 213 225) !important;
|
|
3229
|
+
}
|
|
3230
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-icon-button:hover,
|
|
3231
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-icon-button:hover,
|
|
3232
|
+
.thread-ui-shell.dark .thread-composer-icon-button:hover,
|
|
3233
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-icon-button:hover,
|
|
3234
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-icon-button:hover,
|
|
3235
|
+
.thread-ui-shell.dark .thread-graph-composer-icon-button:hover {
|
|
3236
|
+
background: #2b313d !important;
|
|
3237
|
+
color: rgb(241 245 249) !important;
|
|
3238
|
+
}
|
|
3239
|
+
.thread-ui-shell .thread-composer-menu,
|
|
3240
|
+
.thread-ui-shell .thread-graph-composer-menu {
|
|
3241
|
+
border-radius: 12px;
|
|
3242
|
+
border-color: var(--theme-border) !important;
|
|
3243
|
+
background: color-mix(in oklch, var(--theme-panel) 96%, transparent) !important;
|
|
3244
|
+
color: var(--theme-fg) !important;
|
|
3245
|
+
box-shadow: 0 16px 38px oklch(0.22 0.024 255 / 0.16);
|
|
3246
|
+
z-index: 80;
|
|
3247
|
+
}
|
|
3248
|
+
.thread-ui-shell [data-composer-menu-surface=true] {
|
|
3249
|
+
border-color: var(--theme-border) !important;
|
|
3250
|
+
background: color-mix(in oklch, var(--theme-panel) 96%, transparent) !important;
|
|
3251
|
+
color: var(--theme-fg) !important;
|
|
3252
|
+
box-shadow: 0 16px 38px oklch(0.22 0.024 255 / 0.16) !important;
|
|
3253
|
+
}
|
|
3254
|
+
.thread-ui-shell .thread-graph-composer-menu {
|
|
3255
|
+
max-height: min(27rem, calc(100svh - 8rem));
|
|
3256
|
+
overflow: auto !important;
|
|
3257
|
+
}
|
|
3258
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select) {
|
|
3259
|
+
border-color: var(--theme-border) !important;
|
|
3260
|
+
background: var(--theme-panel) !important;
|
|
3261
|
+
color: var(--theme-fg) !important;
|
|
3262
|
+
}
|
|
3263
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea)::placeholder {
|
|
3264
|
+
color: var(--theme-fg-muted) !important;
|
|
3265
|
+
}
|
|
3266
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select):focus {
|
|
3267
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 38%, var(--theme-border)) !important;
|
|
3268
|
+
}
|
|
3269
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.border-sky-300\\/35, .border-emerald-400\\/45) {
|
|
3270
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 24%, var(--theme-border)) !important;
|
|
3271
|
+
}
|
|
3272
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.bg-sky-300\\/10, .bg-sky-300\\/12, .bg-emerald-400\\/12) {
|
|
3273
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 8%, var(--theme-panel)) !important;
|
|
3274
|
+
}
|
|
3275
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200) {
|
|
3276
|
+
color: rgb(190 18 60) !important;
|
|
3277
|
+
}
|
|
3278
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-amber-100\\/85, .text-amber-100\\/60) {
|
|
3279
|
+
color: rgb(146 64 14) !important;
|
|
3280
|
+
}
|
|
3281
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-menu,
|
|
3282
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-menu,
|
|
3283
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-composer-menu,
|
|
3284
|
+
.thread-ui-shell.dark .thread-composer-menu,
|
|
3285
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-menu,
|
|
3286
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-menu,
|
|
3287
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-graph-composer-menu,
|
|
3288
|
+
.thread-ui-shell.dark .thread-graph-composer-menu,
|
|
3289
|
+
.thread-ui-shell.thread-ui-theme-dark [data-composer-menu-surface=true],
|
|
3290
|
+
.thread-ui-shell[data-theme-effective=dark] [data-composer-menu-surface=true],
|
|
3291
|
+
:root[data-theme-effective=dark] .thread-ui-shell [data-composer-menu-surface=true],
|
|
3292
|
+
.thread-ui-shell.dark [data-composer-menu-surface=true] {
|
|
3293
|
+
border-color: #303642 !important;
|
|
3294
|
+
background: rgb(23 26 34 / 0.96) !important;
|
|
3295
|
+
color: rgb(241 245 249) !important;
|
|
3296
|
+
box-shadow: 0 18px 48px rgb(0 0 0 / 0.28) !important;
|
|
3297
|
+
}
|
|
3298
|
+
.thread-ui-shell.thread-ui-theme-dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select),
|
|
3299
|
+
.thread-ui-shell[data-theme-effective=dark] :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select),
|
|
3300
|
+
:root[data-theme-effective=dark] .thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select),
|
|
3301
|
+
.thread-ui-shell.dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select) {
|
|
3302
|
+
border-color: #303642 !important;
|
|
3303
|
+
background: #11141a !important;
|
|
3304
|
+
color: rgb(241 245 249) !important;
|
|
3305
|
+
}
|
|
3306
|
+
.thread-ui-shell.thread-ui-theme-dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200),
|
|
3307
|
+
.thread-ui-shell[data-theme-effective=dark] :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200),
|
|
3308
|
+
:root[data-theme-effective=dark] .thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200),
|
|
3309
|
+
.thread-ui-shell.dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200) {
|
|
3310
|
+
color: rgb(254 205 211) !important;
|
|
3311
|
+
}
|
|
3312
|
+
.thread-ui-shell.thread-ui-theme-dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-amber-100\\/85, .text-amber-100\\/60),
|
|
3313
|
+
.thread-ui-shell[data-theme-effective=dark] :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-amber-100\\/85, .text-amber-100\\/60),
|
|
3314
|
+
:root[data-theme-effective=dark] .thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-amber-100\\/85, .text-amber-100\\/60),
|
|
3315
|
+
.thread-ui-shell.dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-amber-100\\/85, .text-amber-100\\/60) {
|
|
3316
|
+
color: rgb(253 230 138) !important;
|
|
3317
|
+
}
|
|
3318
|
+
.thread-ui-shell .thread-composer-plan-toggle-active,
|
|
3319
|
+
.thread-ui-shell .thread-graph-composer-plan-toggle-active {
|
|
3320
|
+
border-color: oklch(0.76 0.17 88 / 0.72) !important;
|
|
3321
|
+
background:
|
|
3322
|
+
linear-gradient(
|
|
3323
|
+
135deg,
|
|
3324
|
+
oklch(0.78 0.16 86 / 0.26),
|
|
3325
|
+
oklch(0.64 0.12 190 / 0.2)),
|
|
3326
|
+
var(--theme-accent-soft) !important;
|
|
3327
|
+
color: oklch(0.92 0.09 92) !important;
|
|
3328
|
+
box-shadow:
|
|
3329
|
+
0 0 0 1px oklch(0.78 0.16 86 / 0.22),
|
|
3330
|
+
0 0 18px oklch(0.78 0.16 86 / 0.28),
|
|
3331
|
+
inset 0 0 0 1px oklch(0.95 0.04 90 / 0.16) !important;
|
|
3332
|
+
}
|
|
3333
|
+
.thread-ui-shell .thread-jump-latest-badge {
|
|
3334
|
+
border-color: var(--theme-border);
|
|
3335
|
+
background: var(--theme-panel);
|
|
3336
|
+
color: var(--theme-fg-muted);
|
|
3337
|
+
}
|
|
3338
|
+
.thread-ui-shell .ui-action-primary {
|
|
3339
|
+
background: var(--theme-accent-solid);
|
|
3340
|
+
color: var(--theme-accent-solid-fg);
|
|
3341
|
+
}
|
|
3342
|
+
.thread-ui-shell .ui-action-primary:hover {
|
|
3343
|
+
background: var(--theme-accent-solid-hover);
|
|
3344
|
+
}
|
|
3345
|
+
.thread-ui-shell .ui-action-info {
|
|
3346
|
+
background: oklch(0.46 0.1 235);
|
|
3347
|
+
color: oklch(0.98 0.005 235);
|
|
3348
|
+
}
|
|
3349
|
+
.thread-ui-shell .ui-action-danger {
|
|
3350
|
+
background: oklch(0.56 0.16 25);
|
|
3351
|
+
color: oklch(0.98 0.005 25);
|
|
3352
|
+
}
|
|
3353
|
+
.thread-ui-shell .thread-composer-send-button.ui-action-danger,
|
|
3354
|
+
.thread-ui-shell .thread-graph-composer-send-button.ui-action-danger {
|
|
3355
|
+
border: 1px solid var(--theme-border) !important;
|
|
3356
|
+
background: var(--theme-muted) !important;
|
|
3357
|
+
color: var(--theme-fg-soft) !important;
|
|
3358
|
+
}
|
|
3359
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-send-button.ui-action-danger,
|
|
3360
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-send-button.ui-action-danger,
|
|
3361
|
+
.thread-ui-shell.dark .thread-composer-send-button.ui-action-danger,
|
|
3362
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-send-button.ui-action-danger,
|
|
3363
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-send-button.ui-action-danger,
|
|
3364
|
+
.thread-ui-shell.dark .thread-graph-composer-send-button.ui-action-danger {
|
|
3365
|
+
border-color: #303642 !important;
|
|
3366
|
+
background: #222733 !important;
|
|
3367
|
+
color: rgb(241 245 249) !important;
|
|
3368
|
+
}
|
|
3369
|
+
.thread-ui-shell .thread-composer-send-button.ui-action-danger:hover,
|
|
3370
|
+
.thread-ui-shell .thread-graph-composer-send-button.ui-action-danger:hover {
|
|
3371
|
+
background: var(--theme-hover) !important;
|
|
3372
|
+
color: var(--theme-fg) !important;
|
|
3373
|
+
}
|
|
3374
|
+
.thread-ui-shell .thread-empty-surface,
|
|
3375
|
+
.thread-ui-shell .timeline-pending-card,
|
|
3376
|
+
.thread-ui-shell .timeline-note-card,
|
|
3377
|
+
.thread-ui-shell .timeline-activity-card,
|
|
3378
|
+
.thread-ui-shell .timeline-live-plan-card,
|
|
3379
|
+
.thread-ui-shell .timeline-question-section,
|
|
3380
|
+
.thread-ui-shell .timeline-live-plan-step,
|
|
3381
|
+
.thread-ui-shell .timeline-detail-row {
|
|
3382
|
+
border-color: var(--theme-border);
|
|
3383
|
+
background: var(--theme-panel);
|
|
3384
|
+
color: var(--theme-fg);
|
|
3385
|
+
}
|
|
3386
|
+
.thread-ui-shell .prose,
|
|
3387
|
+
.thread-ui-shell .prose :where(p, li, strong, code, pre, blockquote) {
|
|
3388
|
+
color: inherit;
|
|
3389
|
+
}
|
|
3390
|
+
.thread-ui-shell .prose img {
|
|
3391
|
+
max-width: min(28rem, 100%);
|
|
3392
|
+
height: auto;
|
|
3393
|
+
border-radius: 10px;
|
|
3394
|
+
border: 1px solid var(--theme-border);
|
|
3395
|
+
box-shadow: 0 12px 35px oklch(0.22 0.024 255 / 0.14);
|
|
3396
|
+
margin-top: 0.75rem;
|
|
3397
|
+
margin-bottom: 0.75rem;
|
|
3398
|
+
}
|
|
3399
|
+
.thread-ui-shell .thread-graph-plan-card {
|
|
3400
|
+
border-color: rgb(42 47 58);
|
|
3401
|
+
background: #1b1f29;
|
|
3402
|
+
color: rgb(241 245 249);
|
|
3403
|
+
box-shadow: none;
|
|
3404
|
+
}
|
|
3405
|
+
.thread-ui-shell .thread-graph-plan-step {
|
|
3406
|
+
border-color: rgb(48 54 66);
|
|
3407
|
+
background: #181b23;
|
|
3408
|
+
color: rgb(241 245 249);
|
|
3409
|
+
}
|
|
3410
|
+
.thread-ui-shell .thread-graph-plan-explanation {
|
|
3411
|
+
color: rgb(148 163 184);
|
|
3412
|
+
}
|
|
3413
|
+
.thread-ui-shell .thread-graph-plan-badge {
|
|
3414
|
+
border-color: transparent;
|
|
3415
|
+
background: rgb(56 189 248 / 0.12);
|
|
3416
|
+
color: rgb(186 230 253);
|
|
3417
|
+
box-shadow: none;
|
|
3418
|
+
text-transform: uppercase;
|
|
3419
|
+
letter-spacing: 0.16em;
|
|
3420
|
+
}
|
|
3421
|
+
.thread-ui-shell .thread-graph-plan-status {
|
|
3422
|
+
height: 1.75rem;
|
|
3423
|
+
min-width: 1.75rem;
|
|
3424
|
+
padding: 0;
|
|
3425
|
+
border-color: transparent;
|
|
3426
|
+
box-shadow: none;
|
|
3427
|
+
}
|
|
3428
|
+
.thread-ui-shell .thread-graph-plan-status.is-completed {
|
|
3429
|
+
background: rgb(52 211 153 / 0.14);
|
|
3430
|
+
color: rgb(167 243 208);
|
|
3431
|
+
}
|
|
3432
|
+
.thread-ui-shell .thread-graph-plan-status.is-running {
|
|
3433
|
+
background: rgb(56 189 248 / 0.14);
|
|
3434
|
+
color: rgb(186 230 253);
|
|
3435
|
+
}
|
|
3436
|
+
.thread-ui-shell .thread-graph-plan-status.is-pending,
|
|
3437
|
+
.thread-ui-shell .thread-graph-plan-status.is-unknown {
|
|
3438
|
+
background: #2b313d;
|
|
3439
|
+
color: rgb(203 213 225);
|
|
3440
|
+
}
|
|
3441
|
+
.thread-ui-shell .thread-graph-plan-status.is-failed {
|
|
3442
|
+
background: rgb(251 113 133 / 0.14);
|
|
3443
|
+
color: rgb(254 205 211);
|
|
3444
|
+
}
|
|
3445
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-card {
|
|
3446
|
+
border-color: rgb(226 232 240);
|
|
3447
|
+
background: rgb(248 250 252);
|
|
3448
|
+
color: rgb(15 23 42);
|
|
3449
|
+
}
|
|
3450
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-step {
|
|
3451
|
+
border-color: rgb(226 232 240);
|
|
3452
|
+
background: rgb(255 255 255);
|
|
3453
|
+
color: rgb(15 23 42);
|
|
3454
|
+
}
|
|
3455
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-explanation {
|
|
3456
|
+
color: rgb(100 116 139);
|
|
3457
|
+
}
|
|
3458
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-badge {
|
|
3459
|
+
background: rgb(14 165 233 / 0.1);
|
|
3460
|
+
color: rgb(3 105 161);
|
|
3461
|
+
}
|
|
3462
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-completed {
|
|
3463
|
+
background: rgb(16 185 129 / 0.12);
|
|
3464
|
+
color: rgb(4 120 87);
|
|
3465
|
+
}
|
|
3466
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-running {
|
|
3467
|
+
background: rgb(14 165 233 / 0.12);
|
|
3468
|
+
color: rgb(3 105 161);
|
|
3469
|
+
}
|
|
3470
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-pending,
|
|
3471
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-unknown {
|
|
3472
|
+
background: rgb(226 232 240);
|
|
3473
|
+
color: rgb(71 85 105);
|
|
3474
|
+
}
|
|
3475
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-failed {
|
|
3476
|
+
background: rgb(244 63 94 / 0.12);
|
|
3477
|
+
color: rgb(190 18 60);
|
|
3478
|
+
}
|
|
3479
|
+
.thread-ui-shell .thread-graph-event {
|
|
3480
|
+
background: transparent !important;
|
|
3481
|
+
color: var(--theme-fg) !important;
|
|
3482
|
+
}
|
|
3483
|
+
.thread-ui-shell .thread-graph-event-card {
|
|
3484
|
+
background: var(--theme-surface) !important;
|
|
3485
|
+
color: var(--theme-fg) !important;
|
|
3486
|
+
}
|
|
3487
|
+
.thread-ui-shell .thread-graph-plan-card,
|
|
3488
|
+
.thread-ui-shell .thread-graph-plan-step,
|
|
3489
|
+
.thread-ui-shell .thread-graph-plan-step-text {
|
|
3490
|
+
color: rgb(241 245 249) !important;
|
|
3491
|
+
}
|
|
3492
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-card,
|
|
3493
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-step,
|
|
3494
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-step-text {
|
|
3495
|
+
color: rgb(15 23 42) !important;
|
|
3496
|
+
}
|
|
3497
|
+
`);tr(`.thread-export-dialog-root {
|
|
3498
|
+
--export-bg: rgb(248 250 252);
|
|
3499
|
+
--export-panel: rgb(255 255 255);
|
|
3500
|
+
--export-surface: rgb(241 245 249);
|
|
3501
|
+
--export-surface-strong: rgb(226 232 240);
|
|
3502
|
+
--export-border: rgb(203 213 225);
|
|
3503
|
+
--export-fg: rgb(15 23 42);
|
|
3504
|
+
--export-fg-soft: rgb(51 65 85);
|
|
3505
|
+
--export-fg-muted: rgb(100 116 139);
|
|
3506
|
+
--export-accent: rgb(217 119 6);
|
|
3507
|
+
--export-accent-bg: rgb(254 243 199);
|
|
3508
|
+
--export-accent-border: rgb(251 191 36);
|
|
3509
|
+
--export-shadow: rgb(15 23 42 / 0.16);
|
|
3510
|
+
color: var(--export-fg);
|
|
3511
|
+
position: fixed;
|
|
3512
|
+
inset: 0;
|
|
3513
|
+
z-index: 96;
|
|
3514
|
+
display: flex;
|
|
3515
|
+
align-items: flex-end;
|
|
3516
|
+
justify-content: center;
|
|
3517
|
+
overflow: hidden;
|
|
3518
|
+
padding: 0;
|
|
3519
|
+
}
|
|
3520
|
+
.thread-export-dialog-root.thread-ui-theme-dark,
|
|
3521
|
+
.thread-export-dialog-root[data-theme-effective=dark] {
|
|
3522
|
+
--export-bg: #12151c;
|
|
3523
|
+
--export-panel: #181d25;
|
|
3524
|
+
--export-surface: #1d222c;
|
|
3525
|
+
--export-surface-strong: #262c38;
|
|
3526
|
+
--export-border: #343b48;
|
|
3527
|
+
--export-fg: rgb(241 245 249);
|
|
3528
|
+
--export-fg-soft: rgb(203 213 225);
|
|
3529
|
+
--export-fg-muted: rgb(148 163 184);
|
|
3530
|
+
--export-accent: rgb(245 158 11);
|
|
3531
|
+
--export-accent-bg: rgb(245 158 11 / 0.16);
|
|
3532
|
+
--export-accent-border: rgb(245 158 11 / 0.34);
|
|
3533
|
+
--export-shadow: rgb(0 0 0 / 0.36);
|
|
3534
|
+
}
|
|
3535
|
+
.thread-export-dialog-backdrop {
|
|
3536
|
+
background: color-mix(in oklch, var(--export-bg) 68%, transparent);
|
|
3537
|
+
}
|
|
3538
|
+
.thread-export-dialog-root.thread-ui-theme-dark .thread-export-dialog-backdrop,
|
|
3539
|
+
.thread-export-dialog-root[data-theme-effective=dark] .thread-export-dialog-backdrop {
|
|
3540
|
+
background: rgb(2 6 23 / 0.74);
|
|
3541
|
+
}
|
|
3542
|
+
.thread-export-dialog-panel {
|
|
3543
|
+
position: relative;
|
|
3544
|
+
z-index: 1;
|
|
3545
|
+
display: flex;
|
|
3546
|
+
width: 100%;
|
|
3547
|
+
max-width: 42rem;
|
|
3548
|
+
flex-direction: column;
|
|
3549
|
+
border-color: var(--export-border);
|
|
3550
|
+
background: var(--export-panel);
|
|
3551
|
+
box-shadow: 0 26px 80px var(--export-shadow);
|
|
3552
|
+
max-height: calc(100% - max(env(safe-area-inset-top), var(--android-safe-area-top, 0px)) - max(0.75rem, env(safe-area-inset-bottom), var(--android-safe-area-bottom, 0px)));
|
|
3553
|
+
}
|
|
3554
|
+
.thread-export-dialog-header,
|
|
3555
|
+
.thread-export-dialog-footer,
|
|
3556
|
+
.thread-export-dialog-box-header {
|
|
3557
|
+
border-color: var(--export-border);
|
|
3558
|
+
}
|
|
3559
|
+
.thread-export-dialog-title,
|
|
3560
|
+
.thread-export-dialog-strong,
|
|
3561
|
+
.thread-export-dialog-body-text {
|
|
3562
|
+
color: var(--export-fg);
|
|
3563
|
+
}
|
|
3564
|
+
.thread-export-dialog-subtitle,
|
|
3565
|
+
.thread-export-dialog-status-pill {
|
|
3566
|
+
color: var(--export-fg-muted);
|
|
3567
|
+
}
|
|
3568
|
+
.thread-export-dialog-icon-button,
|
|
3569
|
+
.thread-export-dialog-secondary-button,
|
|
3570
|
+
.thread-export-dialog-segment,
|
|
3571
|
+
.thread-export-dialog-box,
|
|
3572
|
+
.thread-export-dialog-status-pill {
|
|
3573
|
+
border-color: var(--export-border);
|
|
3574
|
+
background: var(--export-surface);
|
|
3575
|
+
}
|
|
3576
|
+
.thread-export-dialog-segment,
|
|
3577
|
+
.thread-export-dialog-box {
|
|
3578
|
+
background: color-mix(in oklch, var(--export-surface) 72%, var(--export-panel));
|
|
3579
|
+
}
|
|
3580
|
+
.thread-export-dialog-icon-button,
|
|
3581
|
+
.thread-export-dialog-secondary-button {
|
|
3582
|
+
color: var(--export-fg-soft);
|
|
3583
|
+
}
|
|
3584
|
+
.thread-export-dialog-icon-button:hover:not(:disabled),
|
|
3585
|
+
.thread-export-dialog-secondary-button:hover:not(:disabled),
|
|
3586
|
+
.thread-export-dialog-turn-row:hover {
|
|
3587
|
+
background: var(--export-surface-strong);
|
|
3588
|
+
color: var(--export-fg);
|
|
3589
|
+
}
|
|
3590
|
+
.thread-export-dialog-muted-action {
|
|
3591
|
+
color: var(--export-fg-muted);
|
|
3592
|
+
}
|
|
3593
|
+
.thread-export-dialog-muted-action:hover {
|
|
3594
|
+
color: var(--export-fg);
|
|
3595
|
+
}
|
|
3596
|
+
.thread-export-dialog-root .ui-status-warning {
|
|
3597
|
+
border: 1px solid var(--export-accent-border);
|
|
3598
|
+
background: var(--export-accent-bg);
|
|
3599
|
+
color: color-mix(in oklch, var(--export-accent) 72%, var(--export-fg));
|
|
3600
|
+
}
|
|
3601
|
+
.thread-export-dialog-checkbox {
|
|
3602
|
+
accent-color: var(--export-accent);
|
|
3603
|
+
}
|
|
3604
|
+
.thread-export-dialog-turn-row {
|
|
3605
|
+
color: var(--export-fg-soft);
|
|
3606
|
+
}
|
|
3607
|
+
@media (max-width: 639px) {
|
|
3608
|
+
.thread-export-dialog-panel {
|
|
3609
|
+
position: fixed;
|
|
3610
|
+
right: 0;
|
|
3611
|
+
bottom: 0;
|
|
3612
|
+
left: 0;
|
|
3613
|
+
width: 100%;
|
|
3614
|
+
max-width: none;
|
|
3615
|
+
border-bottom-right-radius: 0;
|
|
3616
|
+
border-bottom-left-radius: 0;
|
|
3617
|
+
transform: translateZ(0);
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
@media (min-width: 640px) {
|
|
3621
|
+
.thread-export-dialog-root {
|
|
3622
|
+
align-items: center;
|
|
3623
|
+
padding: 1.5rem;
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
`);function eu(e){return e.replace(/\u00a0/g," ")}function tu(e,r){if(!e)return[];const n=[],a=[...r].sort((l,i)=>i.placeholder.length-l.placeholder.length);let o=0,s=0;for(;o<e.length;){const l=a.find(h=>e.startsWith(h.placeholder,o));if(l){n.push({type:"attachment",key:`${l.clientId}-${o}`,attachment:l}),o+=l.placeholder.length;continue}let i=e.length;for(const h of a){const u=e.indexOf(h.placeholder,o);u!==-1&&u<i&&(i=u)}const d=e.slice(o,i);d&&(n.push({type:"text",key:`text-${s}`,text:d}),s+=1),o=i}return n}function ru(e,r,n){const a=e==="photo"?"PHOTO":"FILE";let o=0;for(;;){const s=o===0?r:`${r} (${o+1})`,l=`[${a} ${s}]`;if(!n.has(l))return l;o+=1}}function nu(e,r,n){const a=r.start>0?e[r.start-1]:"",o=r.end<e.length?e[r.end]:"",s=!!(a&&!/\s/.test(a)),l=!o||!/\s/.test(o);return`${s?" ":""}${n.join(" ")}${l?" ":""}`}function au({files:e,kindForFile:r,usedPlaceholders:n,buildClientId:a}){return e.map(o=>{const s=r(o),l=xu(o,s),i=ru(s,bu(l),n);return n.add(i),{clientId:a(),kind:s,originalName:l,placeholder:i,file:o}})}function su({prompt:e,attachments:r,files:n,selection:a,kindForFile:o,buildClientId:s}){const l=new Set(r.map(p=>p.placeholder)),i=au({files:n,kindForFile:o,usedPlaceholders:l,buildClientId:s}),d=a?{start:a.start,end:a.end}:{start:e.length,end:e.length},h=nu(e,d,i.map(p=>p.placeholder)),u=`${e.slice(0,d.start)}${h}${e.slice(d.end)}`,m=h.endsWith(" ")?1:0,f=d.start+h.length-m;return{draft:{prompt:u,attachments:[...r,...i]},selection:{start:f,end:f},insertedAttachmentIds:i.map(p=>p.clientId)}}function ou({prompt:e,attachments:r,isShellView:n}){if(n)return{prompt:e};const a=e.trim();if(!a)return null;const o=r.filter(s=>a.includes(s.placeholder));return o.length>0?{prompt:a,attachments:o}:{prompt:a}}function lu({files:e,plainText:r,htmlText:n,htmlToText:a}){if(e.length>0)return{type:"append-files",preventDefault:!0,files:e};const o=r||a(n);return!o&&!n?{type:"ignore",preventDefault:!1}:{type:"insert-text",preventDefault:!0,text:o}}function Va(e){return e?{type:"accept-files",preventDefault:!0,activateDragTarget:!0}:{type:"ignore",preventDefault:!1,activateDragTarget:!1}}function iu(e){return e.length>0?{type:"accept-files",preventDefault:!0,activateDragTarget:!0,files:e}:{type:"ignore",preventDefault:!1,activateDragTarget:!1}}function du({key:e,metaKey:r,ctrlKey:n,busy:a,disabled:o}){const s=e==="Enter"&&(r||n);return{preventDefault:s,submit:s&&!a&&!o}}function cu({nextMode:e,previousOptimisticMode:r}){return{optimisticMode:e??null,rollbackMode:e?r:null,shouldRollbackMode:!!e,closeMenuOnSuccess:!0}}function Nr(e){return`${e.prompt}${e.attachments.map(r=>`${r.clientId}${r.kind}${r.placeholder}${r.originalName}`).join("")}`}function Ka(e){if(!e)return"Auto";switch(e){case"xhigh":return"xhigh";default:return e}}function hu(e){const r=e.trim();if(!r)return null;const n=Number(r);return!Number.isFinite(n)||n<=0?Number.NaN:Math.round(n*1e3)}function uu(e){if(!e)return"";const r=e/1e3;return Number.isInteger(r)?String(r):String(Number(r.toFixed(1)))}function Rn(e){return e.replace(/\r\n/g,`
|
|
3627
|
+
`)}function mu(e){const r=e.trim();return/^[A-Za-z0-9_-]+$/.test(r)?r:null}function pu(e){const n=Rn(e).split(`
|
|
3628
|
+
`).map(o=>o.trim()).filter(Boolean).find(o=>/^\[mcp_servers\.[^\]]+\]$/.test(o));if(!n)return null;const a=n.match(/^\[mcp_servers\.([A-Za-z0-9_-]+)\]$/);return(a==null?void 0:a[1])??null}function fu(e,r){return`[mcp_servers.${e}]
|
|
3629
|
+
url = ${JSON.stringify(r.trim())}
|
|
3630
|
+
`}function qa(e,r,n){var m,f;const a=Rn(e),o=`${Rn(n).trim()}
|
|
3631
|
+
`,s=a.split(`
|
|
3632
|
+
`),l=`[mcp_servers.${r}]`,i=`[mcp_servers.${r}.`;let d=-1,h=s.length;for(let p=0;p<s.length;p+=1)if((((m=s[p])==null?void 0:m.trim())??"")===l){d=p;break}if(d>=0){for(let b=d+1;b<s.length;b+=1){const v=((f=s[b])==null?void 0:f.trim())??"";if(v.startsWith("[")&&!(v===l||v.startsWith(i))){h=b;break}}const p=s.slice(0,d).join(`
|
|
3633
|
+
`).trimEnd(),g=s.slice(h).join(`
|
|
3634
|
+
`).trim();return[p,o.trimEnd(),g].filter(Boolean).join(`
|
|
3635
|
+
|
|
3636
|
+
`).replace(/\n{3,}/g,`
|
|
3637
|
+
|
|
3638
|
+
`).concat(`
|
|
3639
|
+
`)}const u=a.trimEnd();return u?`${u}
|
|
3640
|
+
|
|
3641
|
+
${o}`:o}function Ko(e){return typeof e!="number"||Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))}function mn(e){const r=e/1e3;return Number.isInteger(r)?`${r}k`:`${Number(r.toFixed(1))}k`}function gu(e,r){if(!e)return"Select model";if((r==null?void 0:r.availability)!=="available"||typeof r.tokensInContextWindow!="number"||typeof r.modelContextWindow!="number")return`${e} · context unavailable`;const n=Math.max(r.tokensInContextWindow,0),a=Math.max(r.modelContextWindow,0),o=Math.max(a-n,0);return[e,`${mn(n)} used / ${mn(a)}`,`${mn(o)} left`,`${Ko(r.remainingPercent)}% context left`].join(" · ")}function xu(e,r){const n=e.name.trim();if(n)return n;const a=r==="photo"?e.type.includes("png")?".png":e.type.includes("heic")?".heic":e.type.includes("heif")?".heif":e.type.includes("webp")?".webp":".jpg":"";return`${r==="photo"?"photo":"file"}-${Date.now()}${a}`}function bu(e){return e.replace(/[\r\n[\]]+/g," ").replace(/\s+/g," ").trim()||"attachment"}function Mn(e){return e.type.startsWith("image/")?"photo":"file"}function _n(e,r){const n=[];if(e)for(const a of Array.from(e)){if(a.kind!=="file")continue;const o=a.getAsFile();o&&n.push(o)}return n.length>0?n:r?Array.from(r):[]}function Xa(e,r){return _n(e,r).length>0}function vu(e){const r=e.replace(/[\\/]+$/,"").trim();return r?r.split(/[\\/]/).filter(Boolean).at(-1)??r:""}function Ya(e){const r=e.placeholder.match(/^\[(?:PHOTO|FILE)\s+(.+)\]$/);return r!=null&&r[1]?r[1]:vu(e.originalName)}var $r=[{value:"preToolUse",label:"PreToolUse",matcherHint:"Bash"},{value:"permissionRequest",label:"PermissionRequest",matcherHint:"Bash"},{value:"postToolUse",label:"PostToolUse",matcherHint:"Bash"},{value:"sessionStart",label:"SessionStart",matcherHint:"startup|resume"},{value:"userPromptSubmit",label:"UserPromptSubmit",matcherHint:""},{value:"stop",label:"Stop",matcherHint:""},{value:"preCompact",label:"PreCompact",matcherHint:""},{value:"postCompact",label:"PostCompact",matcherHint:""}];function ku({goalComposeMode:e,goalBusy:r,threadConnected:n,busy:a,isShellView:o,disabledPlaceholder:s,settingsBusy:l,supportedEffortCount:i,fastMode:d}){const h=e?"Describe the goal the backend should continue working toward...":s??(o?"Send shell input to the attached terminal...":"Ask the backend to inspect, modify, or explain code..."),u=e?r?"Setting...":"Set goal":!n&&a?"Connecting...":n&&a&&!o?"Sending...":"Send",m=n?e?"ui-action-info":"ui-action-primary":"ui-action-danger",f=l;return{promptPlaceholder:h,interruptLabel:o?"Send Ctrl-C":"Stop Current Turn",sendButtonLabel:u,sendButtonClassName:m,modelControlsDisabled:f,effortControlsDisabled:f||i===0,effortControlTitle:d?"Fast mode is on. Turn it off from the slash toolbox to edit reasoning.":i===0?"The selected model does not expose adjustable reasoning effort.":"Select reasoning effort"}}function wu({isShellView:e,edgeToEdgeMobile:r,isMobileShell:n,openMenu:a,isDragTargetActive:o,busy:s}){const l=e?"thread-composer-layer thread-shell-composer-layer":"thread-graph-composer-layer",i=e?"thread-composer-form":"thread-graph-composer-form",d=e?"thread-composer-form-floating":"thread-graph-composer-form-floating",h=e?"thread-composer-input":"thread-graph-composer-input";return{composerLayerClassName:a?`${l} relative z-[80] shrink-0`:`${l} relative z-20 shrink-0`,formClassName:e?r||n?`${i} ${d} relative z-20 shrink-0 border-t border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-2 pb-[calc(env(safe-area-inset-bottom)+0.5rem)] sm:px-4 sm:py-3`:`${i} relative z-20 shrink-0 border-t border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-2 pb-[calc(env(safe-area-inset-bottom)+0.5rem)] sm:px-4 sm:py-3`:`${i} ${r?d:""} relative z-20 shrink-0 border-t px-3 py-2 pb-[calc(env(safe-area-inset-bottom)+0.5rem)] sm:px-4 sm:py-3`,composerShellClassName:e?"thread-composer-shell":"thread-graph-composer-shell",composerToolbarClassName:e?"thread-composer-toolbar":"thread-graph-composer-toolbar",composerInputClassName:h,composerIconButtonClassName:e?"thread-composer-icon-button":"thread-graph-composer-icon-button",composerMenuClassName:e?"thread-composer-menu":"thread-graph-composer-menu",composerMenuItemClassName:e?"thread-composer-menu-item":"thread-graph-composer-menu-item",composerInlineToggleClassName:e?"thread-composer-inline-toggle":"thread-graph-composer-inline-toggle",composerPanelButtonClassName:e?"thread-composer-panel-button":"thread-graph-composer-panel-button",composerChipButtonClassName:e?"thread-composer-chip-button":"thread-graph-composer-chip-button",composerPlanToggleActiveClassName:e?"thread-composer-plan-toggle-active":"thread-graph-composer-plan-toggle-active",composerSendButtonClassName:e?"thread-composer-send-button":"thread-graph-composer-send-button",composerPromptRegionClassName:e?"thread-composer-prompt-region":"thread-graph-composer-prompt-region",promptInputClassName:`${h} min-h-[5.25rem] w-full px-4 pr-14 pt-3 outline-none transition sm:min-h-[5.75rem] ${o?"is-drag-target border-sky-300/80 bg-sky-300/[0.08] shadow-[0_0_0_1px_rgba(125,211,252,0.2)]":""}`,graphChatInputGroupClassName:`thread-graph-composer-input-group relative border-0 bg-transparent shadow-none ring-0 ${s?"bg-amber-50/40 dark:bg-amber-400/10":"bg-transparent"}`,graphChatInputClassName:`${h} min-h-[68px] max-h-32 w-full overflow-y-auto px-3 pt-3 text-[16px] leading-relaxed text-slate-800 outline-none transition sm:min-h-[92px] sm:max-h-40 sm:px-4 sm:pt-4 sm:text-[14px] dark:text-slate-100 ${o?"is-drag-target bg-sky-300/[0.08] shadow-[0_0_0_1px_rgba(125,211,252,0.2)]":""}`}}function yu(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"m4 5 2 2-2 2"}),t.jsx("path",{d:"M7.75 9.5h4.25"})]})}function ju(){return t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",children:t.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function Nu(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M10.75 2.5 5.25 13.5"}),t.jsx("path",{d:"M4.25 5.25h2.25"}),t.jsx("path",{d:"M9.5 10.75h2.25"})]})}function Cu(){return t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M3 4.5A1.75 1.75 0 0 1 4.75 2.75h6.5A1.75 1.75 0 0 1 13 4.5v4A1.75 1.75 0 0 1 11.25 10.25H8l-2.75 2v-2H4.75A1.75 1.75 0 0 1 3 8.5v-4Z"})})}function Su(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:[t.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),t.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),t.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function An(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M5.5 3.25h5"}),t.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function Tu(e){switch(e){case"bearerToken":return"Token";case"oAuth":return"OAuth";case"notLoggedIn":return"Login";case"unsupported":return"Public";default:return"Unknown"}}function Eu(e){switch(e){case"repo":return"Repo";case"system":return"System";case"admin":return"Admin";case"user":default:return"User"}}function Lu(e){var r;return((r=$r.find(n=>n.value===e))==null?void 0:r.label)??e}function Pu(e){var r;switch(e){case"cloudRequirements":return"Cloud";case"legacyManagedConfigFile":case"legacyManagedConfigMdm":return"Managed";case"sessionFlags":return"Session";default:return((r=e[0])==null?void 0:r.toUpperCase())+e.slice(1)}}function Iu(e){switch(e){case"managed":return"Managed";case"modified":return"Modified";case"trusted":return"Trusted";case"untrusted":return"Review"}}function zu(e){switch(e){case"preToolUse":return"PreToolUse";case"permissionRequest":return"PermissionRequest";case"postToolUse":return"PostToolUse";case"preCompact":return"PreCompact";case"postCompact":return"PostCompact";case"sessionStart":return"SessionStart";case"userPromptSubmit":return"UserPromptSubmit";case"stop":return"Stop"}}function Ru(e){return e.source==="user"?"global":e.source==="project"?"project":null}function qo(e){const r=Ru(e);return!r||e.handlerType!=="command"||!e.command||e.isManaged?null:{scope:r,eventName:e.eventName,matcher:e.matcher,command:e.command,timeoutSec:e.timeoutSec,statusMessage:e.statusMessage}}function Mu(e){switch(e){case"active":return"Active";case"paused":return"Paused";case"budgetLimited":return"Budget";case"complete":return"Complete";default:return e}}function _u({contextUsage:e}){const r=(e==null?void 0:e.availability)??"unavailable",n=Ko(e==null?void 0:e.remainingPercent);if(r!=="available")return null;const a=n<=20?"rgba(251,113,133,0.90)":n<=40?"rgba(252,211,77,0.85)":"rgba(125,211,252,0.80)";return t.jsx("span",{"aria-hidden":"true",className:"thread-context-progress-track pointer-events-none mt-0.5 block",children:t.jsx("span",{className:"thread-context-progress-fill block",style:{width:`${n}%`,backgroundColor:a}})})}function zt({label:e,tone:r="stone"}){const n=r==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-50":r==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-50":"border-stone-700/90 bg-stone-900/80 text-stone-100";return t.jsx("span",{className:`inline-flex min-w-[3rem] items-center justify-center rounded-full border px-2 py-1.5 text-[10px] font-medium tracking-[0.12em] ${n}`,children:e})}function Au(e,r){return(e??[]).filter(n=>{switch(n.action){case"fast":return r.fast;case"compact":return r.compact;case"goal":return r.goal;case"fork":return r.fork;case"skills":return r.skills;case"mcp":return r.mcp;case"hooks":return r.hooks;case"prompt":case"unsupported":return!0;default:return!1}})}function $u(e,{fastMode:r,goalComposeMode:n}){switch(e.action){case"fast":return{type:"toggleFast",fastMode:!r};case"compact":return{type:"runCompact"};case"goal":return n?{type:"exitGoalCompose"}:{type:"enterGoalCompose"};case"fork":case"skills":case"mcp":case"hooks":return{type:"openPanel",panel:e.action};case"prompt":return{type:"insertPrompt",text:`${e.command} `};default:return{type:"noop"}}}function Du(e,{fastMode:r,compactBusy:n,goalComposeMode:a,goalStatus:o,busy:s}){switch(e.action){case"fast":return r?"On":"Off";case"compact":return n?"Busy":"Run";case"goal":return a?"Composing":o?Mu(o):"Open";case"fork":return s?"Idle only":"Open";case"skills":case"mcp":case"hooks":return"View";case"prompt":return"Compose";case"unsupported":return"Unavailable";default:return""}}function Bu(e,{settingsBusy:r,compactBusy:n,busy:a,forkBusy:o}){switch(e.action){case"fast":return r;case"compact":return n||a;case"fork":return a||o;case"unsupported":return!0;default:return!1}}function Gu(e,{fastMode:r,goalComposeMode:n,goalStatus:a,menuItemClassName:o}){return`${e.action==="fast"&&r||e.action==="goal"&&(n||a==="active")?"ui-status-warning":o} mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60`}function Fu(e){if(!e)return"";const r=document.createElement("div");return r.innerHTML=e,r.textContent??""}function Hu(e){return!!e.querySelector("[style], font")}function Mt(e){return e instanceof HTMLElement&&e.dataset.segmentType==="attachment"&&e.dataset.placeholder?e.dataset.placeholder:e.textContent??""}function Xo(e){let r="";for(const n of Array.from(e.childNodes))r+=Mt(n);return r.replace(/\u00a0/g," ")}function Za(e,r,n){var i;let a=null,o=n;if(r===e){const d=Array.from(e.childNodes);let h=0;for(let u=0;u<Math.min(n,d.length);u+=1){const m=d[u];m&&(h+=Mt(m).length)}return h}if(r.nodeType===Node.TEXT_NODE)a=r;else{const d=Array.from(e.childNodes).find(h=>h.contains(r));if(!d)return Xo(e).length;if(a=d,d instanceof HTMLElement&&d.dataset.segmentType==="attachment"){const h=document.createRange();h.selectNodeContents(d);const u=Mt(d).length;try{h.setEnd(r,n);const m=h.toString().length,f=((i=d.textContent)==null?void 0:i.length)??0;f===0?o=u:o=Math.round(Math.min(1,m/f)*u)}catch{o=u}}else{const h=document.createRange();h.selectNodeContents(d);try{h.setEnd(r,n),o=h.toString().length}catch{o=Mt(d).length}}}const s=Array.from(e.childNodes);let l=0;for(const d of s){if(d===a)return d.nodeType===Node.TEXT_NODE?l+o:l+Math.min(o,Mt(d).length);l+=Mt(d).length}return l}function Ou(e){const r=window.getSelection();if(!r||r.rangeCount===0)return null;const n=r.getRangeAt(0);return!e.contains(n.startContainer)||!e.contains(n.endContainer)?null:{start:Za(e,n.startContainer,n.startOffset),end:Za(e,n.endContainer,n.endOffset)}}function Ja(e,r){let n=Math.max(0,r);const a=Array.from(e.childNodes);for(const[o,s]of a.entries()){const i=Mt(s).length;if(s.nodeType===Node.TEXT_NODE){if(n<=i)return{node:s,offset:n};n-=i;continue}if(s instanceof HTMLElement&&s.dataset.segmentType==="attachment"){if(n===0)return{node:e,offset:o};if(n<=i){const d=a[o+1];return n===i&&(d==null?void 0:d.nodeType)===Node.TEXT_NODE?{node:d,offset:0}:{node:e,offset:o+1}}n-=i;continue}if(n<=i)return{node:e,offset:o+1};n-=i}return{node:e,offset:e.childNodes.length}}function Wu(e,r){const n=Ja(e,r.start),a=Ja(e,r.end),o=document.createRange();o.setStart(n.node,n.offset),o.setEnd(a.node,a.offset);const s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(o)}function Uu(e,r){if(r.length===0)return!1;const n=r.at(-1);if(!n)return!1;const a=Array.from(e.childNodes).find(i=>i instanceof HTMLElement&&i.dataset.segmentType==="attachment"&&i.dataset.clientId===n);if(!(a instanceof HTMLElement))return!1;const o=document.createRange(),s=a.nextSibling;(s==null?void 0:s.nodeType)===Node.TEXT_NODE?o.setStart(s,0):o.setStartAfter(a),o.collapse(!0);const l=window.getSelection();return l==null||l.removeAllRanges(),l==null||l.addRange(o),!0}Ur();St();function Vu({className:e,...r}){return t.jsx("div",{"data-slot":"input-group",role:"group",className:nt("group/input-group relative flex w-full min-w-0 items-center rounded-md border shadow-xs outline-none transition-[color,box-shadow]","h-9 has-[>textarea]:h-auto","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col",e),...r})}var Ku=fr("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*=size-])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem]","block-start":"order-first w-full justify-start px-3 pt-3","block-end":"order-last w-full justify-start px-3 pb-3"}},defaultVariants:{align:"inline-start"}});function qu({className:e,align:r="inline-start",...n}){return t.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":r,className:nt(Ku({align:r}),e),onClick:a=>{var s;if(a.target.closest("button"))return;const o=(s=a.currentTarget.parentElement)==null?void 0:s.querySelector('[data-slot="input-group-control"] [contenteditable="true"], [data-slot="input-group-control"] textarea, [data-slot="input-group-control"] input, [data-slot="input-group-control"]');o==null||o.focus()},...n})}var Xu=fr("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*=size-])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function xt({className:e,type:r="button",variant:n="ghost",size:a="xs",...o}){return t.jsx(pr,{type:r,"data-size":a,variant:n,className:nt(Xu({size:a}),e),...o})}function Yu({className:e,...r}){return t.jsx("span",{className:nt("flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4",e),...r})}function Zu({photoInputRef:e,fileInputRef:r,onAppendAttachments:n}){function a(o,s){n(o.target.files,s),o.target.value=""}return t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:e,type:"file",accept:"image/*",multiple:!0,tabIndex:-1,className:"sr-only",onChange:o=>a(o,"photo")}),t.jsx("input",{ref:r,type:"file",multiple:!0,tabIndex:-1,className:"sr-only",onChange:o=>a(o,"file")})]})}function Ju({activeView:e,followTail:r,onToggleFollow:n}){return e!=="chat"?null:t.jsx("button",{type:"button","aria-label":"Jump to latest",title:r?"Latest turn is in view":"Jump to the latest messages",onClick:()=>n==null?void 0:n(),className:"absolute left-1/2 top-0 z-[90] inline-flex h-11 min-w-[7rem] -translate-x-1/2 -translate-y-full items-end justify-center bg-transparent pb-1 touch-manipulation sm:h-10",children:t.jsx("span",{className:`thread-jump-latest-badge pointer-events-none inline-flex h-4 min-w-[3.75rem] items-center justify-center rounded-[0.7rem] border shadow-sm transition ${r?"is-active border-sky-300/36 bg-sky-300/[0.03] text-sky-100/86":"border-stone-500/70 bg-stone-950/[0.08] text-stone-200/86"}`,children:t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m4 6 4 4 4-4"})})})})}function Qu({activeView:e,layerClassName:r,formClassName:n,shellClassName:a,inputGroupClassName:o,error:s,followTail:l,photoInputRef:i,fileInputRef:d,onAppendAttachments:h,onToggleFollow:u,onSubmit:m,formRef:f,promptSlot:p,toolbarSlot:g,goalSlot:b,shellPromptSlot:v}){return t.jsxs("div",{className:r,children:[t.jsx(Zu,{photoInputRef:i,fileInputRef:d,onAppendAttachments:h}),t.jsx(Ju,{activeView:e,followTail:l,onToggleFollow:u}),t.jsxs("form",{ref:f,"data-testid":e==="chat"?"chat-composer":void 0,onSubmit:m,className:n,children:[t.jsxs("div",{className:`${a} flex w-full flex-col overflow-visible rounded-[16px] sm:rounded-[18px]`,children:[t.jsxs(Vu,{className:o,children:[p,g]}),b,v]}),s?t.jsx("div",{className:"mt-2 rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:s}):null]})]})}function em({open:e,iconButtonClassName:r,menuClassName:n,menuItemClassName:a,onToggle:o,onPickPhoto:s,onPickFile:l}){return t.jsxs("div",{className:"relative",children:[t.jsx(xt,{type:"button",variant:"ghost",size:"icon-xs","data-composer-menu-trigger":"true","aria-label":"Add attachment",title:"Add attachment",onClick:o,className:`${r} h-9 w-9 rounded-full sm:h-8 sm:w-8`,children:t.jsx(ju,{})}),e&&t.jsx("div",{"data-composer-menu-surface":"true",className:`${n} absolute bottom-full left-0 mb-2 w-32 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20`,children:t.jsxs("div",{className:"p-2",children:[t.jsx("button",{type:"button",onClick:s,className:`${a} block w-full rounded-xl px-3 py-2 text-left text-sm transition`,children:"Photo"}),t.jsx("button",{type:"button",onClick:l,className:`${a} mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition`,children:"File"})]})})]})}var Yo=[{mode:"read-only",label:"Read only"},{mode:"workspace-write",label:"Workspace write"},{mode:"danger-full-access",label:"Danger"}];function Qa(e){var r;return((r=Yo.find(n=>n.mode===e))==null?void 0:r.label)??"Default"}function tm({openMenu:e,model:r,modelOptions:n,modelContextTitle:a,contextUsage:o,reasoningEffort:s,supportedEfforts:l,displayedCollaborationMode:i,sandboxMode:d,planModeAvailable:h,sandboxModeAvailable:u,settingsBusy:m,goalComposeMode:f,goalBusy:p,activeView:g,disabled:b,fastMode:v,sendButtonLabel:x,sendButtonClassName:y,modelControlsDisabled:k,effortControlsDisabled:S,effortControlTitle:w,inlineToggleClassName:N,menuItemClassName:C,planToggleActiveClassName:T,sendButtonBaseClassName:P,onSetOpenMenu:K,onUpdateSettings:G}){return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative min-w-0",children:[t.jsx(xt,{type:"button",variant:"ghost",size:"xs","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":e==="model","aria-label":r??"Select model",disabled:k||n.length===0,onClick:()=>K(A=>A==="model"?null:"model"),title:v?`Fast mode is on. Turn it off from the slash toolbox to edit model. ${a}`:a,className:`${N} relative min-w-0 max-w-[8.75rem] overflow-hidden rounded-full px-2.5 text-left text-stone-300 disabled:cursor-not-allowed disabled:text-stone-600 sm:max-w-[11rem]`,children:t.jsx("span",{className:"relative z-[1] block min-w-0 truncate whitespace-nowrap [direction:rtl]",children:r??"Select model"})}),r?t.jsx(_u,{contextUsage:o}):null,e==="model"&&t.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[9rem] max-w-[14rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:t.jsx("div",{className:"max-h-72 overflow-auto p-2",children:n.map(A=>t.jsx("button",{type:"button",onClick:()=>G({model:A.model,reasoningEffort:A.defaultReasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${A.model===r?"ui-status-warning":`${C} text-stone-300`}`,children:t.jsx("p",{className:"text-sm font-medium",children:A.model})},A.id))})})]}),t.jsxs("div",{className:"relative",children:[t.jsx(xt,{type:"button",variant:"ghost",size:"xs","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":e==="effort",disabled:S,onClick:()=>K(A=>A==="effort"?null:"effort"),title:w,className:`${N} rounded-full px-2 disabled:cursor-not-allowed disabled:text-stone-700 ${S?"text-stone-500":"text-stone-300 hover:text-stone-100"}`,children:Ka(s)}),e==="effort"&&t.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[8rem] max-w-[12rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:t.jsx("div",{className:"max-h-72 overflow-auto p-2",children:l.map(A=>t.jsx("button",{type:"button",onClick:()=>G({reasoningEffort:A.reasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${A.reasoningEffort===s?"ui-status-warning":`${C} text-stone-300`}`,children:t.jsx("p",{className:"text-sm font-medium",children:Ka(A.reasoningEffort)})},A.reasoningEffort))})})]}),u&&t.jsxs("div",{className:"relative",children:[t.jsx(xt,{type:"button",variant:"ghost",size:"xs","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":e==="sandbox","aria-label":`Sandbox: ${Qa(d)}`,disabled:m,onClick:()=>K(A=>A==="sandbox"?null:"sandbox"),title:`Sandbox: ${Qa(d)}`,className:`${N} rounded-full px-2.5 text-stone-300 disabled:cursor-not-allowed disabled:text-stone-700`,children:"Sandbox"}),e==="sandbox"&&t.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[9rem] max-w-[13rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:t.jsx("div",{className:"max-h-72 overflow-auto p-2",children:Yo.map(A=>t.jsx("button",{type:"button",onClick:()=>G({sandboxMode:A.mode}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${A.mode===d?"ui-status-warning":`${C} text-stone-300`}`,children:t.jsx("p",{className:"text-sm font-medium",children:A.label})},A.mode))})})]}),h&&t.jsx(xt,{type:"button",variant:"ghost",size:"xs","aria-pressed":i==="plan",disabled:m,onClick:()=>G({collaborationMode:i==="plan"?"default":"plan"}),className:`${N} rounded-full px-2.5 ${i==="plan"?`${T} border !border-[oklch(0.78_0.16_86_/_0.76)] !bg-[oklch(0.44_0.095_82_/_0.72)] !text-[oklch(0.96_0.055_92)] shadow-[0_0_0_1px_oklch(0.78_0.16_86_/_0.24),0_0_18px_oklch(0.78_0.16_86_/_0.42),inset_0_0_0_1px_oklch(0.98_0.04_96_/_0.18)]`:"text-stone-500"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Plan"}),t.jsx(xt,{type:"submit",variant:"default",size:"icon-xs","aria-label":f?"Set goal":"Send Prompt",title:x,disabled:p||(g==="chat"?b:!1),className:`${P} h-9 w-9 rounded-full text-sm font-medium disabled:cursor-not-allowed sm:h-8 sm:w-8 ${y}`,children:t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M8 13V3"}),t.jsx("path",{d:"m4 7 4-4 4 4"})]})})]})}function rm({busy:e,shellControlState:r,onPaste:n,onCopy:a,onClear:o,onShellControl:s}){const l=!!(r!=null&&r.shellInputEnabled),i=!!(r!=null&&r.isCommandRunning);return t.jsx("div",{"data-composer-menu-surface":"true",className:"absolute right-0 top-full z-40 mt-2 w-[11.5rem] max-w-[calc(100vw-1.5rem)] rounded-[1rem] border border-stone-700/90 bg-stone-950/96 p-2 shadow-2xl shadow-stone-950/40 sm:w-48",onMouseDown:d=>{d.stopPropagation()},onPointerDown:d=>{d.stopPropagation()},onTouchStart:d=>{d.stopPropagation()},children:t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsx("button",{type:"button",onClick:n,className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2 py-2 text-sky-50",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(An,{}),t.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Paste"})]})}),t.jsx("button",{type:"button",onClick:a,className:"inline-flex items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-2 text-stone-100",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(An,{}),t.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Copy"})]})}),t.jsx("button",{type:"button",disabled:e,onClick:o,className:"disabled:cursor-not-allowed disabled:opacity-45",children:t.jsx(zt,{label:"CLEAR",tone:"sky"})}),t.jsx("button",{type:"button",disabled:!l||!i,onClick:()=>s("ctrl_c"),className:"disabled:cursor-not-allowed disabled:opacity-45",children:t.jsx(zt,{label:"CTRL-C",tone:"rose"})}),t.jsx("button",{type:"button",disabled:!l,onClick:()=>s("ctrl_d"),className:"disabled:cursor-not-allowed disabled:opacity-45",children:t.jsx(zt,{label:"CTRL-D"})}),t.jsx("button",{type:"button",disabled:!l,onClick:()=>s("esc"),className:"disabled:cursor-not-allowed disabled:opacity-45",children:t.jsx(zt,{label:"ESC"})}),t.jsx("button",{type:"button",disabled:!l,onClick:()=>s("tab"),className:"disabled:cursor-not-allowed disabled:opacity-45",children:t.jsx(zt,{label:"TAB"})}),t.jsx("button",{type:"button",disabled:!l,onClick:()=>s("up"),className:"disabled:cursor-not-allowed disabled:opacity-45",children:t.jsx(zt,{label:"UP"})}),t.jsx("button",{type:"button",disabled:!l,onClick:()=>s("down"),className:"disabled:cursor-not-allowed disabled:opacity-45",children:t.jsx(zt,{label:"DOWN"})})]})})}function nm({busy:e,forkBusy:r,composerMenuItemClassName:n,onForkLatest:a,onSelectForkTurnPanel:o}){return t.jsxs("div",{className:"p-2",children:[t.jsx("button",{type:"button",disabled:e||r,onClick:()=>void a(),className:`${n} block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60`,children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:"Fork from latest"}),t.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:r?"Forking":"Run"})]})}),t.jsx("button",{type:"button",disabled:e||r,onClick:s=>{s.stopPropagation(),o()},className:`${n} mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60`,children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:"Fork from selected turn"}),t.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"Pick"})]})}),e?t.jsx("p",{className:"mt-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Fork is only available while the thread is idle."}):null]})}function am({forkTurnOptionsState:e,forkBusy:r,composerPanelButtonClassName:n,onForkTurn:a}){var o,s;return t.jsxs("div",{className:"p-2",children:[e.status==="loading"&&!e.data?t.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading turns..."}):null,e.error?t.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:e.error}):null,(o=e.data)!=null&&o.length?t.jsx("div",{className:"space-y-2",children:e.data.map(l=>t.jsx("button",{type:"button",disabled:r,onClick:()=>void a(l.turnId),className:`${n} block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition disabled:cursor-not-allowed disabled:opacity-60`,children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("span",{className:"text-sm text-stone-100",children:["Turn ",l.turnIndex]}),t.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:r?"Forking":l.status})]})},l.turnId))}):null,e.status!=="loading"&&!e.error&&(((s=e.data)==null?void 0:s.length)??0)===0?t.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No turns available to fork yet."}):null]})}function sm({hooksPanelMode:e,hooksState:r,hostConfigFilesAvailable:n,hookTrustAvailable:a,hookConfigBusy:o,hookConfigError:s,hookConfigSuccess:l,editingHookTarget:i,hookScope:d,hookEventName:h,hookMatcher:u,hookCommand:m,hookTimeoutSec:f,hookStatusMessage:p,composerChipButtonClassName:g,onResetHookForm:b,onSetHooksPanelMode:v,onClearHookConfigStatus:x,onSetEditingHookTarget:y,onSetHookScope:k,onSetHookEventName:S,onSetHookMatcher:w,onSetHookCommand:N,onSetHookTimeoutSec:C,onSetHookStatusMessage:T,onSaveHook:P,onStartEditingHook:K,onTrustHook:G,onUntrustHook:A}){var J,Z,D,te,oe;return t.jsxs("div",{className:"p-2",children:[t.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-xs text-stone-400",children:"Hook config sources"}),t.jsx("p",{className:"truncate text-[11px] text-stone-500",children:((J=r.data)==null?void 0:J.projectHooksPath)??"<workspace hooks config>"})]}),e==="list"&&n?t.jsx("button",{type:"button",onClick:_=>{_.stopPropagation(),b(),v("add"),x()},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add Hook"}):null]}),r.status==="loading"&&!r.data?t.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading hooks..."}):null,r.error?t.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:r.error}):null,s?t.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:s}):null,l?t.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:l}):null,e==="add"||e==="edit"?t.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[e==="edit"?t.jsxs("p",{className:"rounded-lg border border-stone-800 bg-stone-950 px-3 py-2 text-[11px] text-stone-400",children:["Editing"," ",zu((i==null?void 0:i.eventName)??h)," ","in ",(i==null?void 0:i.scope)==="global"?"global":"project"," ","hooks.json"]}):null,t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsxs("label",{className:"block text-xs text-stone-400",children:["Scope",t.jsxs("select",{"aria-label":"Hook scope",value:d,onChange:_=>k(_.target.value),disabled:e==="edit",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:[t.jsx("option",{value:"project",children:"Project"}),t.jsx("option",{value:"global",children:"Global"})]})]}),t.jsxs("label",{className:"block text-xs text-stone-400",children:["Event",t.jsx("select",{"aria-label":"Hook event",value:h,onChange:_=>S(_.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:$r.map(_=>t.jsx("option",{value:_.value,children:_.label},_.value))})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Matcher"}),t.jsx("input",{"aria-label":"Hook matcher",value:u,onChange:_=>w(_.target.value),placeholder:"Bash",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Command"}),t.jsx("textarea",{"aria-label":"Hook command",value:m,onChange:_=>N(_.target.value),rows:3,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 font-mono text-xs text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsxs("label",{className:"block text-xs text-stone-400",children:["Timeout",t.jsx("input",{"aria-label":"Hook timeout seconds",value:f,onChange:_=>C(_.target.value),inputMode:"numeric",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]}),t.jsxs("label",{className:"block text-xs text-stone-400",children:["Status message",t.jsx("input",{"aria-label":"Hook status message",value:p,onChange:_=>T(_.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsx("button",{type:"button",onClick:()=>{v("list"),y(null)},className:`${g} rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition`,children:"Back"}),t.jsx("button",{type:"button",onClick:()=>void P(),disabled:o,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:o?"Saving...":e==="edit"?"Update Hook":"Write Hook"})]})]}):null,e==="list"&&((Z=r.data)!=null&&Z.warnings.length)?t.jsx("div",{className:"mb-2 space-y-2",children:r.data.warnings.map(_=>t.jsx("p",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:_},_))}):null,e==="list"&&((D=r.data)!=null&&D.errors.length)?t.jsx("div",{className:"mb-2 space-y-2",children:r.data.errors.map(_=>t.jsxs("div",{className:"rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-2 text-xs text-rose-100/90",children:[t.jsx("p",{className:"font-medium",children:_.message}),t.jsx("p",{className:"mt-1 break-all text-rose-100/60",children:_.path})]},`${_.path}:${_.message}`))}):null,e==="list"&&((te=r.data)!=null&&te.hooks.length)?t.jsx("div",{className:"space-y-2",children:r.data.hooks.map(_=>t.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("p",{className:"truncate text-sm font-medium text-stone-100",children:[Lu(_.eventName),_.matcher?` · ${_.matcher}`:""]}),t.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-stone-400",children:_.command??_.handlerType}),_.statusMessage?t.jsx("p",{className:"mt-1 truncate text-[11px] text-stone-500",children:_.statusMessage}):null]}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.08em] text-stone-500",children:[qo(_)?t.jsx("button",{type:"button",onClick:Y=>{Y.stopPropagation(),K(_)},className:`${g} rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-sky-100 transition hover:border-sky-300/35 hover:bg-sky-300/10`,children:"Edit"}):null,a&&_.trustStatus==="trusted"&&!_.isManaged?t.jsx("button",{type:"button",disabled:o,onClick:Y=>{Y.stopPropagation(),A(_)},className:`${g} rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-amber-100 transition hover:border-amber-300/35 hover:bg-amber-300/10 disabled:cursor-not-allowed disabled:opacity-50`,children:"Untrust"}):null,(_.trustStatus==="untrusted"||_.trustStatus==="modified")&&!_.isManaged&&a?t.jsx("button",{type:"button",disabled:o||!_.currentHash,onClick:Y=>{Y.stopPropagation(),G(_)},className:`${g} rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-emerald-100 transition hover:border-emerald-300/35 hover:bg-emerald-300/10 disabled:cursor-not-allowed disabled:opacity-50`,children:"Trust"}):null,t.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-0.5 text-stone-300",children:Iu(_.trustStatus)})]}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em] text-stone-500",children:[t.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:Pu(_.source)}),t.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:_.enabled?"Enabled":"Disabled"}),t.jsxs("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:[_.timeoutSec,"s"]})]})]},_.key))}):null,e==="list"&&r.status!=="loading"&&!r.error&&(((oe=r.data)==null?void 0:oe.hooks.length)??0)===0?t.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No hooks configured for this workspace."}):null]})}function om({mcpPanelMode:e,mcpState:r,mcpConfigEditing:n,mcpConfigPath:a,mcpConfigError:o,mcpConfigSuccess:s,mcpConfigBusy:l,mcpHttpName:i,mcpHttpUrl:d,mcpRawBlock:h,composerPanelButtonClassName:u,composerChipButtonClassName:m,onSetMcpPanelMode:f,onClearMcpConfigStatus:p,onSetMcpHttpName:g,onSetMcpHttpUrl:b,onSetMcpRawBlock:v,onPrepareRawMcpBlock:x,onSaveHttpMcp:y,onSaveRawMcpBlock:k}){var S,w;return t.jsxs("div",{className:"p-2",children:[t.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-xs text-stone-400",children:"MCP config source"}),t.jsx("p",{className:"truncate text-[11px] text-stone-500",children:a??"<provider config>"})]}),e==="list"&&n?t.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),f("add"),p()},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add MCP"}):null]}),r.status==="loading"&&!r.data?t.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading MCP servers..."}):null,r.error?t.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:r.error}):null,o?t.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:o}):null,s?t.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:s}):null,e==="add"?t.jsxs("div",{className:"space-y-2",children:[t.jsxs("button",{type:"button",onClick:N=>{N.stopPropagation(),f("http"),p()},className:`${u} block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition`,children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{className:"text-sm text-stone-100",children:"HTTP / Streamable HTTP"}),t.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"Form"})]}),t.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Add an MCP server with a name and URL, then write the matching block into provider config."})]}),t.jsxs("button",{type:"button",onClick:N=>{N.stopPropagation(),x()},className:`${u} block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition`,children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{className:"text-sm text-stone-100",children:"stdio / raw block"}),t.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"TOML"})]}),t.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Write a single `[mcp_servers.name]` block, then save it back into provider config."})]})]}):null,e==="http"?t.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"MCP name"}),t.jsx("input",{"aria-label":"MCP name",value:i,onChange:N=>g(N.target.value),placeholder:"openaiDeveloperDocs",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"URL"}),t.jsx("input",{"aria-label":"URL",value:d,onChange:N=>b(N.target.value),placeholder:"https://developers.openai.com/mcp",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsx("button",{type:"button",onClick:()=>f("add"),className:`${m} rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition`,children:"Back"}),t.jsx("button",{type:"button",onClick:()=>void y(),disabled:l,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:l?"Saving...":"Write HTTP MCP"})]})]}):null,e==="stdio"?t.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[t.jsx("label",{className:"block text-xs text-stone-400",children:"MCP block for provider config"}),t.jsx("textarea",{"aria-label":"MCP block for provider config",value:h,onChange:N=>v(N.target.value),rows:8,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsx("button",{type:"button",onClick:()=>f("add"),className:`${m} rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition`,children:"Back"}),t.jsx("button",{type:"button",onClick:()=>void k(),disabled:l,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:l?"Saving...":"Write raw block"})]})]}):null,e==="list"&&((S=r.data)!=null&&S.servers.length)?t.jsx("div",{className:"space-y-2",children:r.data.servers.map(N=>t.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:N.name}),t.jsxs("p",{className:"mt-0.5 text-xs text-stone-400",children:[N.tools.length," tools · ",N.resourceCount," ","resources · ",N.resourceTemplateCount," templates"]})]}),t.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:Tu(N.authStatus)})]}),N.tools.length>0?t.jsx("p",{className:"mt-2 line-clamp-2 text-xs text-stone-500",children:N.tools.slice(0,4).map(C=>C.title??C.name).join(" · ")}):null]},N.name))}):null,e==="list"&&r.status!=="loading"&&!r.error&&(((w=r.data)==null?void 0:w.servers.length)??0)===0?t.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No MCP servers available right now."}):null]})}function lm({skillsState:e,copiedSkillName:r,composerChipButtonClassName:n,onCopySkillInvokeName:a}){var o,s,l,i;return t.jsxs("div",{className:"p-2",children:[e.status==="loading"&&!e.data?t.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading skills..."}):null,e.error?t.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:e.error}):null,(o=e.data)!=null&&o.skills.length?t.jsx("div",{className:"space-y-2",children:e.data.skills.map(d=>{var h,u;return t.jsx("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:((h=d.interface)==null?void 0:h.displayName)??d.name}),t.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em]",children:[t.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1 text-stone-400",children:Eu(d.scope)}),t.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 rounded-full border px-2 py-1 normal-case tracking-normal transition ${r===d.name?"border-emerald-400/45 bg-emerald-400/12 text-emerald-100":`${n} border-stone-700 text-stone-300 hover:border-stone-500`}`,onClick:()=>void a(d.name),title:`Copy $${d.name}`,"aria-label":`Copy $${d.name}`,children:[t.jsx(An,{}),"$",d.name]})]}),t.jsx("p",{className:"text-xs leading-5 text-stone-400",children:((u=d.interface)==null?void 0:u.shortDescription)??d.shortDescription??d.description})]})},d.path)})}):null,(s=e.data)!=null&&s.errors.length?t.jsx("div",{className:"mt-2 space-y-2",children:e.data.errors.map(d=>t.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:[t.jsx("p",{className:"font-medium",children:d.message}),t.jsx("p",{className:"mt-1 break-all text-amber-100/60",children:d.path})]},`${d.path}:${d.message}`))}):null,e.status!=="loading"&&!e.error&&(((l=e.data)==null?void 0:l.skills.length)??0)===0&&(((i=e.data)==null?void 0:i.errors.length)??0)===0?t.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No skills available right now."}):null]})}function im({open:e,slashPanelView:r,availableToolboxItems:n,busy:a,forkBusy:o,forkTurnOptionsState:s,skillsState:l,copiedSkillName:i,hooksPanelMode:d,hooksState:h,hostConfigFilesAvailable:u,hookTrustAvailable:m,hookConfigBusy:f,hookConfigError:p,hookConfigSuccess:g,editingHookTarget:b,hookScope:v,hookEventName:x,hookMatcher:y,hookCommand:k,hookTimeoutSec:S,hookStatusMessage:w,mcpPanelMode:N,mcpState:C,mcpConfigEditing:T,mcpConfigPath:P,mcpConfigError:K,mcpConfigSuccess:G,mcpConfigBusy:A,mcpHttpName:J,mcpHttpUrl:Z,mcpRawBlock:D,iconButtonClassName:te,menuClassName:oe,menuItemClassName:_,panelButtonClassName:Y,chipButtonClassName:z,onToggle:q,onToolboxItemClick:F,toolboxItemDisabled:E,toolboxItemClassName:W,toolboxItemStatus:H,onSetSlashPanelView:j,onOpenForkTurns:L,onForkLatest:U,onForkTurn:X,onCopySkillInvokeName:se,onResetHookForm:Q,onSetHooksPanelMode:de,onClearHookConfigStatus:re,onSetEditingHookTarget:ue,onSetHookScope:be,onSetHookEventName:ve,onSetHookMatcher:Pe,onSetHookCommand:le,onSetHookTimeoutSec:Ne,onSetHookStatusMessage:we,onSaveHook:O,onStartEditingHook:ce,onTrustHook:xe,onUntrustHook:ye,onSetMcpPanelMode:Me,onClearMcpConfigStatus:_e,onSetMcpHttpName:Te,onSetMcpHttpUrl:$e,onSetMcpRawBlock:R,onPrepareRawMcpBlock:pe,onSaveHttpMcp:M,onSaveRawMcpBlock:$}){return t.jsxs("div",{className:"relative",children:[t.jsx(xt,{type:"button",variant:"ghost",size:"icon-xs","data-composer-menu-trigger":"true","aria-label":"Open slash toolbox",title:"Open slash toolbox",onClick:q,className:`${te} h-9 w-9 rounded-full sm:h-8 sm:w-8`,children:t.jsx(Nu,{})}),e&&t.jsx("div",{"data-composer-menu-surface":"true",className:`${oe} absolute bottom-full left-0 z-40 mb-2 w-72 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20 backdrop-blur-xl`,onClick:ee=>{ee.stopPropagation()},onMouseDown:ee=>{ee.stopPropagation()},onPointerDown:ee=>{ee.stopPropagation()},onTouchStart:ee=>{ee.stopPropagation()},children:r==="root"?t.jsxs("div",{className:"p-2",children:[n.map((ee,me)=>t.jsx("button",{type:"button",disabled:E(ee),onClick:ke=>F(ee,ke),className:`${W(ee)} ${me===0?"mt-0":""}`,title:ee.description??ee.label,children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:ee.command}),t.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:H(ee)})]})},`${ee.action}:${ee.command}`)),n.length===0?t.jsx("p",{className:"px-3 py-2 text-sm text-stone-400",children:"No backend tools are available for this thread."}):null]}):t.jsx("div",{className:"max-h-80 overflow-auto",children:r==="fork"?t.jsx(nm,{busy:a,forkBusy:o,composerMenuItemClassName:_,onForkLatest:U,onSelectForkTurnPanel:()=>(j("forkTurns"),L())}):r==="forkTurns"?t.jsx(am,{forkTurnOptionsState:s,forkBusy:o,composerPanelButtonClassName:Y,onForkTurn:X}):r==="skills"?t.jsx(lm,{skillsState:l,copiedSkillName:i,composerChipButtonClassName:z,onCopySkillInvokeName:se}):r==="hooks"?t.jsx(sm,{hooksPanelMode:d,hooksState:h,hostConfigFilesAvailable:u,hookTrustAvailable:m,hookConfigBusy:f,hookConfigError:p,hookConfigSuccess:g,editingHookTarget:b,hookScope:v,hookEventName:x,hookMatcher:y,hookCommand:k,hookTimeoutSec:S,hookStatusMessage:w,composerChipButtonClassName:z,onResetHookForm:Q,onSetHooksPanelMode:de,onClearHookConfigStatus:re,onSetEditingHookTarget:ue,onSetHookScope:be,onSetHookEventName:ve,onSetHookMatcher:Pe,onSetHookCommand:le,onSetHookTimeoutSec:Ne,onSetHookStatusMessage:we,onSaveHook:O,onStartEditingHook:ce,onTrustHook:xe,onUntrustHook:ye}):t.jsx(om,{mcpPanelMode:N,mcpState:C,mcpConfigEditing:T,mcpConfigPath:P,mcpConfigError:K,mcpConfigSuccess:G,mcpConfigBusy:A,mcpHttpName:J,mcpHttpUrl:Z,mcpRawBlock:D,composerPanelButtonClassName:Y,composerChipButtonClassName:z,onSetMcpPanelMode:Me,onClearMcpConfigStatus:_e,onSetMcpHttpName:Te,onSetMcpHttpUrl:$e,onSetMcpRawBlock:R,onPrepareRawMcpBlock:pe,onSaveHttpMcp:M,onSaveRawMcpBlock:$})})})]})}function dm({isShellView:e,canToggleShellView:r,isMobileShell:n,shellPromptLabel:a,openMenu:o,toolbarClassName:s,iconButtonClassName:l,slashToolboxProps:i,attachmentMenuProps:d,settingsToolbarProps:h,shellToolsPanelProps:u,onToggleView:m,onDismissPromptFocus:f,onSetOpenMenu:p}){return t.jsxs(qu,{align:"block-end",className:`${s} relative z-30 mb-0 flex items-center gap-2 text-xs`,children:[t.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[!e&&i?t.jsx(im,{...i}):null,!e&&d?t.jsx(em,{...d}):null,r&&t.jsx(xt,{type:"button",variant:"ghost",size:"icon-xs","aria-label":e?"Switch to chat":"Switch to shell",title:e?"Switch to chat":"Switch to shell",onClick:()=>m==null?void 0:m(),className:`${l} h-9 w-9 rounded-full sm:h-8 sm:w-8`,children:e?t.jsx(Cu,{}):t.jsx(yu,{})})]}),t.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-1.5",children:[!e&&h?t.jsx(tm,{...h}):null,e&&a?t.jsx(Yu,{className:"min-w-0 max-w-[12rem] truncate rounded-full px-1.5 py-1 text-stone-400",title:a,children:a}):null,n&&t.jsxs("div",{className:"relative",children:[t.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":o==="shellTools"?"Close shell tools":"Open shell tools","aria-haspopup":"menu","aria-expanded":o==="shellTools",title:o==="shellTools"?"Close shell tools":"Open shell tools",onClick:()=>{f(),p(g=>g==="shellTools"?null:"shellTools")},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:t.jsx(Su,{})}),o==="shellTools"&&u?t.jsx(rm,{...u}):null]})]})]})}function cm(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`attachment-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function hm(e){return[...e.filter(r=>Mn(r)==="photo"),...e.filter(r=>Mn(r)==="file")]}function um({prompt:e,attachments:r,updateDraft:n,getSelection:a,selectionSnapshotRef:o,pendingSelectionRef:s,pendingInsertedAttachmentIdsRef:l,onInserted:i,buildClientId:d=cm}){const h=c.useCallback((f,p)=>{if(f.length===0)return!1;const g=su({prompt:e,attachments:r,files:f,selection:a()??o.current,kindForFile:p,buildClientId:d});return n(()=>g.draft),s.current=g.selection,o.current=g.selection,l.current=g.insertedAttachmentIds,i==null||i(),!0},[r,d,a,i,l,s,e,o,n]),u=c.useCallback((f,p)=>!f||f.length===0?!1:h(Array.from(f),()=>p),[h]),m=c.useCallback(f=>h(hm(f),Mn),[h]);return{appendAttachments:u,appendDroppedAttachments:m}}function es(e){for(const r of e.values())URL.revokeObjectURL(r);e.clear()}function mm({attachments:e,isShellView:r}){const n=c.useRef(new Map),[a,o]=c.useState({});return c.useEffect(()=>{const s=n.current;if(r){es(s),o({});return}const l={},i=new Set;for(const d of e){if(d.kind!=="photo")continue;i.add(d.clientId);let h=s.get(d.clientId);h||(h=URL.createObjectURL(d.file),s.set(d.clientId,h)),l[d.clientId]=h}for(const[d,h]of s.entries())i.has(d)||(URL.revokeObjectURL(h),s.delete(d));o(l)},[e,r]),c.useEffect(()=>{const s=n.current;return()=>{es(s)}},[]),a}var pm=180;function pn(e,r){return{prompt:e??"",attachments:r??[]}}function fm({isShellView:e,draftPrompt:r,draftAttachments:n,onDraftChange:a}){const[o,s]=c.useState({prompt:"",attachments:[]}),[l,i]=c.useState(()=>pn(r,n)),d=c.useRef(null),h=c.useRef(l),u=c.useRef(Nr(l)),m=!e&&r!==void 0&&n!==void 0&&typeof a=="function",f=m?Nr(pn(r,n)):"",p=c.useRef(f);c.useLayoutEffect(()=>{if(!m){p.current="";return}const k=pn(r,n),S=Nr(k);S!==p.current&&(p.current=S,u.current=S,h.current=k,d.current!==null&&(window.clearTimeout(d.current),d.current=null),i(k))},[n,r,m]);const g=c.useCallback(k=>{if(!m||!a)return;const S=Nr(k);S!==u.current&&(u.current=S,a(()=>({prompt:k.prompt,attachments:k.attachments})))},[m,a]);c.useEffect(()=>()=>{g(h.current),d.current!==null&&window.clearTimeout(d.current)},[g]);const b=c.useCallback((k,S)=>{if(m){if(d.current!==null&&(window.clearTimeout(d.current),d.current=null),S==="immediate"){g(k);return}d.current=window.setTimeout(()=>{d.current=null,g(h.current)},pm)}},[m,g]),v=c.useCallback((k=h.current)=>{b(k,"immediate")},[b]),x=c.useCallback((k,S="immediate")=>{if(m){const w=k(h.current);h.current=w,i(w),b(w,S);return}s(w=>k(w))},[m,b]),y=m?l:o;return{prompt:y.prompt,attachments:y.attachments,isDraftControlled:m,updateDraft:x,flushControlledDraftToHost:v}}function gm({slashPanelView:e,onForkLatest:r,onForkTurn:n,closeMenu:a}){const[o,s]=c.useState(!1);c.useEffect(()=>{e!=="forkTurns"&&s(!1)},[e]);const l=c.useCallback(async()=>{if(r){s(!0);try{await r(),a()}finally{s(!1)}}},[a,r]),i=c.useCallback(async d=>{if(n){s(!0);try{await n(d),a()}finally{s(!1)}}},[a,n]);return{forkBusy:o,forkLatest:l,forkTurn:i}}function xm({prompt:e,goalTokenBudgetSource:r,promptRef:n,onOpenGoal:a,onUpdateGoal:o,updateDraft:s,closeMenu:l,resetSlashPanel:i}){const[d,h]=c.useState(!1),[u,m]=c.useState(""),[f,p]=c.useState(!1),[g,b]=c.useState(null),v=c.useCallback(async()=>{const k=e.trim();if(!k)return b("Goal objective cannot be empty."),!1;const S=u.trim(),w=hu(S);if(S.length>0&&(w===null||!Number.isInteger(w)||w<=0))return b("Token budget must be a positive number in thousands."),!1;if(!o)return b("/goal is unavailable in this view."),!1;p(!0),b(null);try{return await o({objective:k,status:"active",tokenBudget:w}),m(""),h(!1),s(()=>({prompt:"",attachments:[]})),!0}catch(N){return b(N instanceof Error?N.message:"Unable to set goal."),!1}finally{p(!1)}},[u,o,e,s]),x=c.useCallback(()=>{l(),i(),h(!0),m(uu(r==null?void 0:r.tokenBudget)),b(null),a==null||a(),requestAnimationFrame(()=>{var k;(k=n.current)==null||k.focus()})},[l,r==null?void 0:r.tokenBudget,a,n,i]),y=c.useCallback(()=>{h(!1),b(null)},[]);return{goalComposeMode:d,goalTokenBudget:u,goalBusy:f,goalLocalError:g,setGoalTokenBudget:m,submitGoal:v,enterGoalComposeMode:x,exitGoalComposeMode:y}}var fn=`node -e "process.stdin.resume(); process.stdin.on('end', () => console.error('hook ran'))"`;function bm(e){const r=new Map;for(const n of e??[])r.set(n.eventName,n.command);return r}function vm({slashPanelView:e,hookCommandTemplates:r,onCreateHook:n,onUpdateHook:a,onTrustHook:o,onUntrustHook:s}){const[l,i]=c.useState("list"),[d,h]=c.useState("project"),[u,m]=c.useState("preToolUse"),[f,p]=c.useState("Bash"),[g,b]=c.useState(fn),[v,x]=c.useState("30"),[y,k]=c.useState("Running hook"),[S,w]=c.useState(null),[N,C]=c.useState(!1),[T,P]=c.useState(null),[K,G]=c.useState(null),A=c.useMemo(()=>bm(r),[r]),J=c.useCallback(q=>A.get(q)??A.get("preToolUse")??fn,[A]),Z=c.useMemo(()=>new Set([fn,...A.values()]),[A]),D=c.useCallback(()=>{P(null),G(null)},[]);c.useEffect(()=>{e!=="hooks"&&(i("list"),D())},[D,e]),c.useEffect(()=>{const q=$r.find(F=>F.value===u);p(F=>{const E=F.trim(),W=new Set($r.map(H=>H.matcherHint).filter(Boolean));return E&&!W.has(E)?F:(q==null?void 0:q.matcherHint)??""}),b(F=>Z.has(F.trim())?J(u):F)},[J,Z,u]);const te=c.useCallback(()=>{w(null),h("project"),m("preToolUse"),p("Bash"),b(J("preToolUse")),x("30"),k("Running hook")},[J]),oe=c.useCallback(q=>{const F=qo(q);if(!F){P("Only command hooks in global or project hooks.json can be edited here.");return}w(F),h(F.scope),m(F.eventName),p(F.matcher??""),b(F.command),x(F.timeoutSec?String(F.timeoutSec):""),k(F.statusMessage??""),P(null),G(null),i("edit")},[]),_=c.useCallback(async()=>{if(l==="edit"&&!a){P("Hook editing is unavailable in this view.");return}if(l!=="edit"&&!n){P("Hook editing is unavailable in this view.");return}if(l==="edit"&&!S){P("Select a hook to edit first.");return}const q=g.trim();if(!q){P("Hook command cannot be empty.");return}const F=v.trim(),E=F?Number(F):null;if(F&&(E===null||!Number.isInteger(E)||E<=0)){P("Timeout must be a positive number of seconds.");return}C(!0),P(null),G(null);try{const W={scope:d,eventName:u,matcher:f.trim()||null,command:q,timeoutSec:E,statusMessage:y.trim()||null};l==="edit"?await(a==null?void 0:a({...W,target:S})):await(n==null?void 0:n(W)),G(`${d==="project"?"Project":"Global"} hook ${l==="edit"?"updated":"written"} in hooks.json and trusted.`),i("list"),w(null)}catch(W){P(W instanceof Error?W.message:"Unable to write hooks.json.")}finally{C(!1)}},[S,g,u,f,d,y,v,l,n,a]),Y=c.useCallback(async q=>{if(!o||!q.currentHash){P("Hook trust is unavailable in this view.");return}C(!0),P(null),G(null);try{await o({key:q.key,currentHash:q.currentHash}),G("Hook trusted.")}catch(F){P(F instanceof Error?F.message:"Unable to trust hook.")}finally{C(!1)}},[o]),z=c.useCallback(async q=>{if(!s){P("Hook trust is unavailable in this view.");return}C(!0),P(null),G(null);try{await s({key:q.key}),G("Hook untrusted.")}catch(F){P(F instanceof Error?F.message:"Unable to untrust hook.")}finally{C(!1)}},[s]);return{hooksPanelMode:l,hookScope:d,hookEventName:u,hookMatcher:f,hookCommand:g,hookTimeoutSec:v,hookStatusMessage:y,editingHookTarget:S,hookConfigBusy:N,hookConfigError:T,hookConfigSuccess:K,setHooksPanelMode:i,setEditingHookTarget:w,setHookScope:h,setHookEventName:m,setHookMatcher:p,setHookCommand:b,setHookTimeoutSec:x,setHookStatusMessage:k,clearHookConfigStatus:D,resetHookForm:te,startEditingHook:oe,saveHook:_,trustHook:Y,untrustHook:z}}var km=`[mcp_servers.example_stdio]
|
|
3642
|
+
command = "npx"
|
|
3643
|
+
args = ["-y", "your-mcp-server"]
|
|
3644
|
+
`,ts="MCP entry written to provider config. Restart the backend if it does not appear immediately.";function wm({hostConfigFilesAvailable:e,onReadProviderConfig:r,onWriteProviderConfig:n,setMcpPanelMode:a,onOpenMcp:o}){const[s,l]=c.useState(""),[i,d]=c.useState(""),[h,u]=c.useState(""),[m,f]=c.useState(null),[p,g]=c.useState(!1),[b,v]=c.useState(null),[x,y]=c.useState(null),k=c.useCallback(()=>{v(null),y(null)},[]),S=c.useCallback(async()=>{if(!e||!r)throw new Error("Provider config editing is unavailable for this thread.");const P=await r();return f(P.path),P},[e,r]),w=c.useCallback(async P=>{if(!e||!n)throw new Error("Provider config editing is unavailable for this thread.");const K=await n(P);return f(K.path),K},[e,n]),N=c.useCallback(async()=>{const P=mu(s),K=i.trim();if(!P){v("MCP name must use only letters, numbers, underscore, or hyphen.");return}if(!/^https?:\/\//i.test(K)){v("HTTP MCP URL must start with http:// or https://");return}g(!0),v(null),y(null);try{const G=await S(),A=qa(G.content,P,fu(P,K));await w(A),y(ts),a("list"),l(""),d(""),o==null||o()}catch(G){v(G instanceof Error?G.message:"Unable to update provider config.")}finally{g(!1)}},[S,s,i,o,a,w]),C=c.useCallback(async()=>{g(!0),v(null),y(null);try{await S(),u(P=>P||km),a("stdio")}catch(P){v(P instanceof Error?P.message:"Unable to load provider config.")}finally{g(!1)}},[S,a]),T=c.useCallback(async()=>{const P=pu(h);if(!P){v("The raw MCP block must start with a header like [mcp_servers.name].");return}g(!0),v(null),y(null);try{const K=await S(),G=qa(K.content,P,h);await w(G),y(ts),a("list"),o==null||o()}catch(K){v(K instanceof Error?K.message:"Unable to update provider config.")}finally{g(!1)}},[S,h,o,a,w]);return{mcpHttpName:s,mcpHttpUrl:i,mcpRawBlock:h,mcpConfigPath:m,mcpConfigBusy:p,mcpConfigError:b,mcpConfigSuccess:x,setMcpHttpName:l,setMcpHttpUrl:d,setMcpRawBlock:u,clearMcpConfigStatus:k,prepareRawMcpBlock:C,saveHttpMcp:N,saveRawMcpBlock:T}}function ym({openMenu:e,setOpenMenu:r,slashPanelView:n,setSlashPanelView:a,setMcpPanelMode:o,clearMcpConfigStatus:s,clearHookConfigStatus:l}){const[i,d]=c.useState(null);c.useEffect(()=>{e!=="slash"&&(a("root"),o("list"),s(),l())},[l,s,e,o,a]),c.useEffect(()=>{n!=="mcp"&&(o("list"),s())},[s,o,n]),c.useEffect(()=>{if(!i)return;const u=window.setTimeout(()=>{d(m=>m===i?null:m)},1400);return()=>{window.clearTimeout(u)}},[i]),c.useEffect(()=>{function u(m){(typeof m.composedPath=="function"?m.composedPath():[]).some(g=>g instanceof HTMLElement&&(g.dataset.composerMenuSurface==="true"||g.dataset.composerMenuTrigger==="true"))||e&&r(null)}if(e)return window.addEventListener("pointerdown",u),()=>{window.removeEventListener("pointerdown",u)}},[e,r]);const h=c.useCallback(async u=>{try{await navigator.clipboard.writeText(`$${u}`),d(u)}catch{d(null)}},[]);return{copiedSkillName:i,copySkillInvokeName:h}}function jm(e,r){const{attachment:n}=e,a=document.createElement("span");if(a.dataset.segmentType="attachment",a.dataset.clientId=n.clientId,a.dataset.placeholder=n.placeholder,a.contentEditable="false",a.className="thread-composer-attachment-chip mx-[0.12rem] inline-flex max-w-full align-baseline",n.kind==="photo"){a.classList.add("thread-composer-attachment-chip-photo","rounded-[0.95rem]","border","border-sky-300/35","bg-sky-300/10","p-1","shadow-sm","shadow-stone-950/20");const l=r[n.clientId];if(l){const d=document.createElement("img");d.src=l,d.alt=n.originalName||"Pasted image",d.className="thread-composer-attachment-thumb h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-950 object-contain",d.draggable=!1,a.append(d)}else{const d=document.createElement("span");d.className="thread-composer-attachment-thumb inline-block h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-900/80",d.setAttribute("aria-hidden","true"),a.append(d)}const i=document.createElement("span");return i.className="thread-composer-attachment-caption ml-2 inline-flex max-w-[8rem] items-center text-[10px] font-medium tracking-[0.08em] text-sky-50",i.textContent=Ya(n),a.append(i),a}a.classList.add("items-center","gap-2","rounded-[0.95rem]","border","border-emerald-300/35","bg-emerald-300/10","px-2.5","py-2","text-[10px]","font-medium","tracking-[0.08em]","text-emerald-50","shadow-sm","shadow-stone-950/20");const o=document.createElement("span");o.className="inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/25 bg-emerald-300/12 text-[9px]",o.textContent="FILE";const s=document.createElement("span");return s.className="inline-flex max-w-[10rem] truncate",s.textContent=Ya(n),a.append(o,s),a}function Nm(e,r){const n=document.createDocumentFragment();for(const a of e){if(a.type==="text"){n.append(document.createTextNode(a.text===" "?" ":a.text));continue}n.append(jm(a,r))}return n}function Cm({promptRef:e,isShellView:r,prompt:n,promptSegments:a,attachmentPreviewUrls:o,previewSignature:s,editorSanitizeNonce:l,pendingSelectionRef:i,pendingInsertedAttachmentIdsRef:d,selectionSnapshotRef:h,renderedPreviewSignatureRef:u,renderedSanitizeNonceRef:m,serializeEditorPrompt:f,restoreSelection:p}){c.useLayoutEffect(()=>{const g=e.current;if(!g||r)return;const b=i.current,v=f()!==n||u.current!==s||m.current!==l;v&&(g.replaceChildren(Nm(a,o)),u.current=s,m.current=l),b!==null?(g.focus(),Uu(g,d.current)||p(b),h.current=b):document.activeElement===g&&v&&p(h.current),i.current=null,d.current=[]},[o,l,r,s,n,e,a,d,i,u,m,p,h,f])}function Sm({tokenBudget:e,error:r,onTokenBudgetChange:n,onCancel:a}){return t.jsxs("div",{className:"thread-goal-compose-card relative z-20 mb-1.5 flex flex-wrap items-center gap-2 rounded-2xl border px-3 py-2 text-xs shadow-sm",children:[t.jsx("span",{className:"thread-goal-compose-label font-medium uppercase tracking-[0.16em]",children:"Goal"}),t.jsxs("label",{className:"thread-goal-compose-field flex items-center gap-2",children:[t.jsx("span",{children:"Max tokens (k)"}),t.jsx("input",{"aria-label":"Goal token budget",value:e,onChange:o=>n(o.target.value),inputMode:"numeric",placeholder:"Optional",className:"thread-goal-compose-input h-7 w-24 rounded-full border px-3 text-xs outline-none"})]}),r?t.jsx("span",{className:"thread-goal-compose-error min-w-0 flex-1",children:r}):null,t.jsx("button",{type:"button",onClick:a,className:"thread-goal-compose-cancel rounded-full border px-2.5 py-1 text-[11px] transition",children:"Cancel"})]})}function Tm({promptRef:e,prompt:r,disabled:n,promptPlaceholder:a,canInterrupt:o,interruptLabel:s,composerPromptRegionClassName:l,graphChatInputClassName:i,onInterrupt:d,onInput:h,onPaste:u,onKeyDown:m,onKeyUp:f,onMouseUp:p,onBlur:g,onDragEnter:b,onDragOver:v,onDragLeave:x,onDrop:y}){return t.jsxs("div",{"data-slot":"input-group-control",className:`${l} relative w-full`,children:[t.jsxs("div",{className:i,children:[r.length===0&&t.jsx("span",{className:`pointer-events-none absolute left-3 top-3 truncate text-slate-500 sm:left-4 sm:top-4 dark:text-slate-400 ${o?"right-12":"right-3 sm:right-4"}`,children:a}),t.jsx("div",{ref:e,role:"textbox","aria-label":"Prompt","aria-multiline":"true",contentEditable:!n,suppressContentEditableWarning:!0,onInput:h,onPaste:u,onKeyDown:m,onKeyUp:f,onMouseUp:p,onBlur:g,onDragEnter:b,onDragOver:v,onDragLeave:x,onDrop:y,className:`relative z-[1] min-h-[4.25rem] whitespace-pre-wrap break-words pb-2 outline-none sm:min-h-[4.25rem] ${o?"pr-12":""} ${n?"cursor-not-allowed text-slate-500":""}`})]}),o?t.jsx(xt,{type:"button",variant:"ghost",size:"icon-xs","aria-label":s,title:s,onClick:k=>{k.preventDefault(),d==null||d()},className:"thread-graph-composer-stop-button ui-action-danger absolute right-2 top-2 z-30 h-8 w-8 rounded-full text-sm font-medium",children:t.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"})}):null]})}function Em({prompt:e,promptPlaceholder:r,promptRegionClassName:n,promptInputClassName:a,interruptLabel:o,canInterrupt:s,sendButtonLabel:l,sendButtonClassName:i,sendDisabled:d,onPromptChange:h,onPromptKeyDown:u,onInterrupt:m}){return t.jsxs("div",{className:`${n} relative`,children:[t.jsx("textarea",{"aria-label":"Prompt",disabled:!1,value:e,onChange:f=>h(f.target.value),onKeyDown:u,rows:2,placeholder:r,className:`${a} resize-y pb-10`}),t.jsx("button",{type:"button","aria-label":o,title:o,onClick:()=>void(m==null?void 0:m()),disabled:!s,className:`absolute right-2.5 top-2.5 inline-flex h-8 w-8 items-center justify-center rounded-full border transition ${s?"border-rose-300/55 bg-rose-300/[0.14] text-rose-50 shadow-lg shadow-rose-950/20 hover:bg-rose-300/[0.22]":"cursor-not-allowed border-stone-700/30 bg-stone-400/[0.02] text-stone-500/55 opacity-55"}`,children:t.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"})}),t.jsx("button",{type:"submit","aria-label":"Send Shell Input",onMouseDown:f=>{f.preventDefault()},onPointerDown:f=>{f.preventDefault()},onTouchStart:f=>{f.preventDefault()},disabled:d,className:`absolute bottom-2.5 right-2.5 rounded-full px-3.5 py-1.5 text-sm font-medium shadow-lg shadow-stone-950/30 transition disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300 ${i}`,children:l})]})}function Lm({isShellView:e,promptRef:r,prompt:n,disabled:a,promptPlaceholder:o,canInterrupt:s,interruptLabel:l,composerPromptRegionClassName:i,graphChatInputClassName:d,promptInputClassName:h,goalComposeMode:u,goalTokenBudget:m,goalLocalError:f,goalBusy:p,busy:g,sendButtonLabel:b,sendButtonClassName:v,onInterrupt:x,onPromptInput:y,onPromptPaste:k,onPromptKeyDown:S,onPromptKeyUp:w,onPromptMouseUp:N,onPromptBlur:C,onPromptDragEnter:T,onPromptDragOver:P,onPromptDragLeave:K,onPromptDrop:G,onGoalTokenBudgetChange:A,onCancelGoal:J,onShellPromptChange:Z}){return{promptSlot:e?null:t.jsx(Tm,{promptRef:r,prompt:n,disabled:a,promptPlaceholder:o,canInterrupt:s,interruptLabel:l,composerPromptRegionClassName:i,graphChatInputClassName:d,onInterrupt:x,onInput:y,onPaste:k,onKeyDown:S,onKeyUp:w,onMouseUp:N,onBlur:C,onDragEnter:T,onDragOver:P,onDragLeave:K,onDrop:G}),goalSlot:u&&!e?t.jsx(Sm,{tokenBudget:m,error:f,onTokenBudgetChange:A,onCancel:J}):null,shellPromptSlot:e?t.jsx(Em,{prompt:n,promptPlaceholder:o,promptRegionClassName:i,promptInputClassName:h,interruptLabel:l,canInterrupt:s,sendButtonLabel:b,sendButtonClassName:v,sendDisabled:p||g,onPromptChange:Z,onPromptKeyDown:S,onInterrupt:x}):null}}function Pm({collaborationMode:e,onUpdateSettings:r,closeMenu:n}){const[a,o]=c.useState(null),s=a??e;c.useEffect(()=>{o(null)},[e]);const l=c.useCallback(async i=>{const d=cu({nextMode:i.collaborationMode,previousOptimisticMode:a});d.optimisticMode&&o(d.optimisticMode);try{await(r==null?void 0:r(i)),d.closeMenuOnSuccess&&n()}catch(h){throw d.shouldRollbackMode&&o(d.rollbackMode),h}},[n,r,a]);return{displayedCollaborationMode:s,updateSettings:l}}function Im({isShellView:e,canToggleShellView:r,isMobileShell:n,shellPromptLabel:a,openMenu:o,toolbarClassName:s,iconButtonClassName:l,menuClassName:i,menuItemClassName:d,panelButtonClassName:h,chipButtonClassName:u,inlineToggleClassName:m,planToggleActiveClassName:f,sendButtonBaseClassName:p,slashPanelView:g,availableToolboxItems:b,busy:v,settingsBusy:x,compactBusy:y,forkBusy:k,fastMode:S,goalComposeMode:w,goalBusy:N,goalStatus:C,activeView:T,disabled:P,model:K,modelOptions:G,modelContextTitle:A,contextUsage:J,reasoningEffort:Z,supportedEfforts:D,displayedCollaborationMode:te,sandboxMode:oe,sendButtonLabel:_,sendButtonClassName:Y,modelControlsDisabled:z,effortControlsDisabled:q,effortControlTitle:F,forkTurnOptionsState:E,skillsState:W,copiedSkillName:H,hooksPanelMode:j,hooksState:L,hookConfigBusy:U,hookConfigError:X,hookConfigSuccess:se,editingHookTarget:Q,hookScope:de,hookEventName:re,hookMatcher:ue,hookCommand:be,hookTimeoutSec:ve,hookStatusMessage:Pe,mcpPanelMode:le,mcpState:Ne,mcpConfigPath:we,mcpConfigError:O,mcpConfigSuccess:ce,mcpConfigBusy:xe,mcpHttpName:ye,mcpHttpUrl:Me,mcpRawBlock:_e,capabilities:Te,shellControlState:$e,onToggleView:R,onDismissPromptFocus:pe,onSetOpenMenu:M,onToolboxItemClick:$,onSetSlashPanelView:ee,onOpenForkTurns:me,onForkLatest:ke,onForkTurn:Re,onCopySkillInvokeName:je,onResetHookForm:De,onSetHooksPanelMode:Ve,onClearHookConfigStatus:Qe,onSetEditingHookTarget:at,onSetHookScope:rt,onSetHookEventName:lt,onSetHookMatcher:it,onSetHookCommand:He,onSetHookTimeoutSec:Oe,onSetHookStatusMessage:We,onSaveHook:tt,onStartEditingHook:I,onTrustHook:V,onUntrustHook:fe,onSetMcpPanelMode:Le,onClearMcpConfigStatus:ne,onSetMcpHttpName:Fe,onSetMcpHttpUrl:Ge,onSetMcpRawBlock:Ae,onPrepareRawMcpBlock:Xe,onSaveHttpMcp:st,onSaveRawMcpBlock:bt,onPickPhoto:Tt,onPickFile:vt,onUpdateSettings:ge,onPasteShell:Ie,onCopyShell:et,onClearShell:Ke,onShellControl:kt}){const Ht=e?null:{open:o==="slash",slashPanelView:g,availableToolboxItems:b,busy:v,forkBusy:k,forkTurnOptionsState:E,skillsState:W,copiedSkillName:H,hooksPanelMode:j,hooksState:L,hostConfigFilesAvailable:Te.hostConfigFiles,hookTrustAvailable:Te.hookTrust,hookConfigBusy:U,hookConfigError:X,hookConfigSuccess:se,editingHookTarget:Q,hookScope:de,hookEventName:re,hookMatcher:ue,hookCommand:be,hookTimeoutSec:ve,hookStatusMessage:Pe,mcpPanelMode:le,mcpState:Ne,mcpConfigEditing:Te.mcpConfigEditing,mcpConfigPath:we,mcpConfigError:O,mcpConfigSuccess:ce,mcpConfigBusy:xe,mcpHttpName:ye,mcpHttpUrl:Me,mcpRawBlock:_e,iconButtonClassName:l,menuClassName:i,menuItemClassName:d,panelButtonClassName:h,chipButtonClassName:u,onToggle:()=>M(ct=>ct==="slash"?null:"slash"),onToolboxItemClick:$,toolboxItemDisabled:ct=>Bu(ct,{settingsBusy:x,compactBusy:y,busy:v,forkBusy:k}),toolboxItemClassName:ct=>Gu(ct,{fastMode:S,goalComposeMode:w,goalStatus:C,menuItemClassName:d}),toolboxItemStatus:ct=>Du(ct,{fastMode:S,compactBusy:y,goalComposeMode:w,goalStatus:C,busy:v}),onSetSlashPanelView:ee,onOpenForkTurns:me,onForkLatest:ke,onForkTurn:Re,onCopySkillInvokeName:je,onResetHookForm:De,onSetHooksPanelMode:Ve,onClearHookConfigStatus:Qe,onSetEditingHookTarget:at,onSetHookScope:rt,onSetHookEventName:lt,onSetHookMatcher:it,onSetHookCommand:He,onSetHookTimeoutSec:Oe,onSetHookStatusMessage:We,onSaveHook:tt,onStartEditingHook:I,onTrustHook:V,onUntrustHook:fe,onSetMcpPanelMode:Le,onClearMcpConfigStatus:ne,onSetMcpHttpName:Fe,onSetMcpHttpUrl:Ge,onSetMcpRawBlock:Ae,onPrepareRawMcpBlock:Xe,onSaveHttpMcp:st,onSaveRawMcpBlock:bt},Jr=e?null:{open:o==="attachments",iconButtonClassName:l,menuClassName:i,menuItemClassName:d,onToggle:()=>M(ct=>ct==="attachments"?null:"attachments"),onPickPhoto:Tt,onPickFile:vt},Qr=e?null:{openMenu:o,model:K,modelOptions:G,modelContextTitle:A,contextUsage:J,reasoningEffort:Z,supportedEfforts:D,displayedCollaborationMode:te,sandboxMode:oe,planModeAvailable:Te.planMode,sandboxModeAvailable:Te.sandboxMode,settingsBusy:x,goalComposeMode:w,goalBusy:N,activeView:T,disabled:P,fastMode:S,sendButtonLabel:_,sendButtonClassName:Y,modelControlsDisabled:z,effortControlsDisabled:q,effortControlTitle:F,inlineToggleClassName:m,menuItemClassName:d,planToggleActiveClassName:f,sendButtonBaseClassName:p,onSetOpenMenu:M,onUpdateSettings:ge};return{isShellView:e,canToggleShellView:r,isMobileShell:n,shellPromptLabel:a,openMenu:o,toolbarClassName:s,iconButtonClassName:l,slashToolboxProps:Ht,attachmentMenuProps:Jr,settingsToolbarProps:Qr,shellToolsPanelProps:o==="shellTools"?{busy:v,shellControlState:$e,onPaste:Ie,onCopy:et,onClear:Ke,onShellControl:kt}:null,shellControlState:$e,onToggleView:R,onDismissPromptFocus:pe,onSetOpenMenu:M}}function $n({activeView:e,edgeToEdgeMobile:r=!1,busy:n=!1,settingsBusy:a=!1,compactBusy:o=!1,error:s,model:l=null,reasoningEffort:i=null,fastMode:d=!1,collaborationMode:h="default",sandboxMode:u=null,hideSandboxModeControl:m=!1,modelOptions:f=[],contextUsage:p=null,capabilities:g=null,toolboxItems:b=null,hookCommandTemplates:v=null,mcpConfigFormat:x="none",followTail:y=!1,threadConnected:k=!0,shellAvailable:S=!0,disabled:w=!1,disabledPlaceholder:N,shellControlState:C=null,draftPrompt:T,draftAttachments:P,onPickAttachment:K,skillsState:G={status:"idle",data:null,error:null},mcpState:A={status:"idle",data:null,error:null},hooksState:J={status:"idle",data:null,error:null},goalState:Z={status:"idle",data:null,error:null},forkTurnOptionsState:D={status:"idle",data:null,error:null},onDraftChange:te,onSubmit:oe,onInterrupt:_,onCompact:Y,onOpenSkills:z,onOpenMcp:q,onOpenHooks:F,onCreateHook:E,onUpdateHook:W,onTrustHook:H,onUntrustHook:j,onOpenGoal:L,onUpdateGoal:U,onOpenForkTurns:X,onForkLatest:se,onForkTurn:Q,onReadProviderConfig:de,onWriteProviderConfig:re,onToggleFollow:ue,onUpdateSettings:be,onToggleView:ve,onShellCopy:Pe,onShellControl:le,canInterrupt:Ne=!1}){var fa;const[we,O]=c.useState(null),[ce,xe]=c.useState("root"),[ye,Me]=c.useState("list"),_e=c.useMemo(()=>({fast:(g==null?void 0:g.controls.performanceMode)??!1,compact:(g==null?void 0:g.turns.compact)??!1,goal:(g==null?void 0:g.controls.goals)??!1,fork:(g==null?void 0:g.branching.fork)??!1,skills:(g==null?void 0:g.management.skills)??!1,mcp:(g==null?void 0:g.management.mcpStatus)??!1,hooks:(g==null?void 0:g.management.hooks)??!1,hostConfigFiles:(g==null?void 0:g.management.hostConfigFiles)??!1,mcpConfigEditing:x==="codex-toml"&&!!(g!=null&&g.management.hostConfigFiles)&&!!de&&!!re,hookTrust:(g==null?void 0:g.management.hookTrust)??!1,planMode:(g==null?void 0:g.controls.planMode)??!1,sandboxMode:(g==null?void 0:g.controls.sandboxMode)??!1}),[g,x,de,re]),Te=c.useMemo(()=>Au(b,_e),[_e,b]),$e=c.useRef(null),R=c.useRef(null),pe=c.useRef(null),M=c.useRef(null),$=c.useRef(null),ee=c.useRef([]),me=c.useRef(null),ke=c.useRef(""),Re=c.useRef(0),je=e==="shell",De=S||je,Ve=!!(je&&(C!=null&&C.isMobileShell)),Qe=(C==null?void 0:C.promptLabel)??null,[at,rt]=c.useState(!1),[lt,it]=c.useState(0),{prompt:He,attachments:Oe,isDraftControlled:We,updateDraft:tt,flushControlledDraftToHost:I}=fm({isShellView:je,draftPrompt:T,draftAttachments:P,onDraftChange:te}),V=mm({attachments:Oe,isShellView:je}),{displayedCollaborationMode:fe,updateSettings:Le}=Pm({collaborationMode:h,onUpdateSettings:be,closeMenu:()=>O(null)}),{forkBusy:ne,forkLatest:Fe,forkTurn:Ge}=gm({slashPanelView:ce,onForkLatest:se,onForkTurn:Q,closeMenu:()=>O(null)}),{hooksPanelMode:Ae,hookScope:Xe,hookEventName:st,hookMatcher:bt,hookCommand:Tt,hookTimeoutSec:vt,hookStatusMessage:ge,editingHookTarget:Ie,hookConfigBusy:et,hookConfigError:Ke,hookConfigSuccess:kt,setHooksPanelMode:Ht,setEditingHookTarget:Jr,setHookScope:Qr,setHookEventName:sa,setHookMatcher:ct,setHookCommand:vl,setHookTimeoutSec:kl,setHookStatusMessage:wl,clearHookConfigStatus:oa,resetHookForm:yl,startEditingHook:jl,saveHook:Nl,trustHook:Cl,untrustHook:Sl}=vm({slashPanelView:ce,hookCommandTemplates:v,onCreateHook:E,onUpdateHook:W,onTrustHook:H,onUntrustHook:j}),{goalComposeMode:nr,goalTokenBudget:Tl,goalBusy:en,goalLocalError:El,setGoalTokenBudget:Ll,submitGoal:Pl,enterGoalComposeMode:Il,exitGoalComposeMode:la}=xm({prompt:He,goalTokenBudgetSource:Z.data,promptRef:R,onOpenGoal:L,onUpdateGoal:U,updateDraft:tt,closeMenu:()=>O(null),resetSlashPanel:()=>xe("root")}),{mcpHttpName:zl,mcpHttpUrl:Rl,mcpRawBlock:Ml,mcpConfigPath:_l,mcpConfigBusy:Al,mcpConfigError:$l,mcpConfigSuccess:Dl,setMcpHttpName:Bl,setMcpHttpUrl:Gl,setMcpRawBlock:Fl,clearMcpConfigStatus:ia,prepareRawMcpBlock:Hl,saveHttpMcp:Ol,saveRawMcpBlock:Wl}=wm({hostConfigFilesAvailable:_e.hostConfigFiles,onReadProviderConfig:de,onWriteProviderConfig:re,setMcpPanelMode:Me,onOpenMcp:q}),{copiedSkillName:Ul,copySkillInvokeName:Vl}=ym({openMenu:we,setOpenMenu:O,slashPanelView:ce,setSlashPanelView:xe,setMcpPanelMode:Me,clearMcpConfigStatus:ia,clearHookConfigStatus:oa}),Kl=c.useCallback(ae=>{tt(Ce=>{if(typeof ae=="function"){const ze=ae(Ce.prompt,Ce.attachments);return{prompt:ze.prompt,attachments:ze.attachments??Ce.attachments}}return{prompt:ae,attachments:Ce.attachments}})},[tt]),tn=c.useMemo(()=>f.find(ae=>ae.model===l)??null,[l,f]),ql=gu(l,p),da=(tn==null?void 0:tn.supportedReasoningEfforts)??[],Xl=c.useMemo(()=>tu(He,Oe),[Oe,He]),Yl=c.useMemo(()=>Object.entries(V).sort(([ae],[Ce])=>ae.localeCompare(Ce)).map(([ae,Ce])=>`${ae}:${Ce}`).join("|"),[V]);function Zl(ae,Ce){Ce.stopPropagation();const ze=$u(ae,{fastMode:d,goalComposeMode:nr});switch(ze.type){case"toggleFast":Le({fastMode:ze.fastMode});break;case"runCompact":O(null),Y==null||Y();break;case"enterGoalCompose":Il();break;case"exitGoalCompose":la(),O(null);break;case"openPanel":xe(ze.panel),ze.panel==="skills"?z==null||z():ze.panel==="mcp"?q==null||q():ze.panel==="hooks"&&(F==null||F());break;case"insertPrompt":an(ze.text),xe("root"),O(null);break}}function Ot(){const ae=R.current;return ae?Ou(ae):null}const Jl=c.useCallback(ae=>{const Ce=R.current;!Ce||!ae||Wu(Ce,ae)},[]),rn=c.useCallback(()=>{const ae=R.current;return ae?Xo(ae):He},[He]),{appendAttachments:nn,appendDroppedAttachments:ca}=um({prompt:He,attachments:Oe,updateDraft:tt,getSelection:Ot,selectionSnapshotRef:me,pendingSelectionRef:$,pendingInsertedAttachmentIdsRef:ee,onInserted:()=>O(null)}),ha=c.useCallback((ae,Ce)=>{var ze;if(Et(),K){K({kind:ae,appendAttachments:(Ze,ot=ae)=>nn(Ze,ot),defaultPick:()=>{var Ze;return(Ze=Ce.current)==null?void 0:Ze.click()}});return}(ze=Ce.current)==null||ze.click()},[nn,Et,K]);function an(ae){if(!ae)return;const Ce=Ot()??me.current,ze=(Ce==null?void 0:Ce.start)??He.length,Ze=(Ce==null?void 0:Ce.end)??ze,ot=eu(ae),Wt=`${He.slice(0,ze)}${ot}${He.slice(Ze)}`;tt(Ri=>({prompt:Wt,attachments:Ri.attachments}));const Lt=ze+ot.length;$.current={start:Lt,end:Lt},me.current={start:Lt,end:Lt}}Cm({promptRef:R,isShellView:je,prompt:He,promptSegments:Xl,attachmentPreviewUrls:V,previewSignature:Yl,editorSanitizeNonce:lt,pendingSelectionRef:$,pendingInsertedAttachmentIdsRef:ee,selectionSnapshotRef:me,renderedPreviewSignatureRef:ke,renderedSanitizeNonceRef:Re,serializeEditorPrompt:rn,restoreSelection:Jl});function Et(){var ae;(ae=R.current)==null||ae.blur(),document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur()}async function Ql(){var ae;if(Et(),O(null),!!((ae=navigator.clipboard)!=null&&ae.readText))try{const Ce=await navigator.clipboard.readText();an(Ce)}catch{return}}async function ua(){if(We&&I(),nr&&!je){await Pl();return}const ae=ou({prompt:He,attachments:Oe,isShellView:je});!ae||await oe(ae)===!1||tt(()=>({prompt:"",attachments:[]}))}async function ei(ae){ae.preventDefault(),await ua()}function ti(){const ae=rn(),Ce=Ot();me.current=Ce;const ze=R.current;(ze?Hu(ze):!1)&&($.current=Ce,it(ot=>ot+1)),tt(ot=>({prompt:ae,attachments:ot.attachments.filter(Wt=>ae.includes(Wt.placeholder))}),"deferred")}function ri(ae){var Ze,ot,Wt,Lt;const Ce=_n((Ze=ae.clipboardData)==null?void 0:Ze.items,(ot=ae.clipboardData)==null?void 0:ot.files),ze=lu({files:Ce,plainText:((Wt=ae.clipboardData)==null?void 0:Wt.getData("text/plain"))??"",htmlText:((Lt=ae.clipboardData)==null?void 0:Lt.getData("text/html"))??"",htmlToText:Fu});ze.preventDefault&&ae.preventDefault(),ze.type==="insert-text"?an(ze.text):ze.type==="append-files"&&ca(ze.files)}function ni(ae){var ze,Ze;const Ce=Va(Xa((ze=ae.dataTransfer)==null?void 0:ze.items,(Ze=ae.dataTransfer)==null?void 0:Ze.files));Ce.preventDefault&&ae.preventDefault(),Ce.activateDragTarget&&rt(!0)}function ai(ae){var ze,Ze;const Ce=Va(Xa((ze=ae.dataTransfer)==null?void 0:ze.items,(Ze=ae.dataTransfer)==null?void 0:Ze.files));Ce.preventDefault&&ae.preventDefault(),Ce.activateDragTarget&&ae.dataTransfer&&(ae.dataTransfer.dropEffect="copy"),Ce.activateDragTarget&&rt(!0)}function si(ae){ae.currentTarget.contains(ae.relatedTarget)||rt(!1)}function oi(ae){var Ze,ot;const Ce=_n((Ze=ae.dataTransfer)==null?void 0:Ze.items,(ot=ae.dataTransfer)==null?void 0:ot.files),ze=iu(Ce);ze.preventDefault&&ae.preventDefault(),ze.type==="accept-files"&&(rt(!1),ca(ze.files??[]))}function li(ae){if(e==="chat"&&ae.key==="/"&&!ae.metaKey&&!ae.ctrlKey&&!ae.altKey&&!n&&!w&&Te.length>0&&rn().trim().length===0){ae.preventDefault(),xe("root"),O("slash");return}const Ce=du({key:ae.key,metaKey:ae.metaKey,ctrlKey:ae.ctrlKey,busy:n,disabled:w});Ce.preventDefault&&ae.preventDefault(),Ce.submit&&ua()}const{promptPlaceholder:ii,interruptLabel:di,sendButtonLabel:ma,sendButtonClassName:pa,modelControlsDisabled:ci,effortControlsDisabled:hi,effortControlTitle:ui}=ku({goalComposeMode:nr,goalBusy:en,threadConnected:k,busy:n,isShellView:je,disabledPlaceholder:N,settingsBusy:a,supportedEffortCount:da.length,fastMode:d}),{composerLayerClassName:mi,formClassName:pi,composerShellClassName:fi,composerToolbarClassName:gi,composerIconButtonClassName:xi,composerMenuClassName:bi,composerMenuItemClassName:vi,composerInlineToggleClassName:ki,composerPanelButtonClassName:wi,composerChipButtonClassName:yi,composerPlanToggleActiveClassName:ji,composerSendButtonClassName:Ni,composerPromptRegionClassName:Ci,promptInputClassName:Si,graphChatInputGroupClassName:Ti,graphChatInputClassName:Ei}=wu({isShellView:je,edgeToEdgeMobile:r,isMobileShell:Ve,openMenu:we!==null,isDragTargetActive:at,busy:n}),Li=Im({isShellView:je,canToggleShellView:De,isMobileShell:Ve,shellPromptLabel:Qe,openMenu:we,toolbarClassName:gi,iconButtonClassName:xi,menuClassName:bi,menuItemClassName:vi,panelButtonClassName:wi,chipButtonClassName:yi,inlineToggleClassName:ki,planToggleActiveClassName:ji,sendButtonBaseClassName:Ni,slashPanelView:ce,availableToolboxItems:Te,busy:n,settingsBusy:a,compactBusy:o,forkBusy:ne,fastMode:d,goalComposeMode:nr,goalBusy:en,goalStatus:(fa=Z.data)==null?void 0:fa.status,activeView:e,disabled:w,model:l,modelOptions:f,modelContextTitle:ql,contextUsage:p,reasoningEffort:i,supportedEfforts:da,displayedCollaborationMode:fe,sandboxMode:u,sendButtonLabel:ma,sendButtonClassName:pa,modelControlsDisabled:ci,effortControlsDisabled:hi,effortControlTitle:ui,forkTurnOptionsState:D,skillsState:G,copiedSkillName:Ul,hooksPanelMode:Ae,hooksState:J,hookConfigBusy:et,hookConfigError:Ke,hookConfigSuccess:kt,editingHookTarget:Ie,hookScope:Xe,hookEventName:st,hookMatcher:bt,hookCommand:Tt,hookTimeoutSec:vt,hookStatusMessage:ge,mcpPanelMode:ye,mcpState:A,mcpConfigPath:_l,mcpConfigError:$l,mcpConfigSuccess:Dl,mcpConfigBusy:Al,mcpHttpName:zl,mcpHttpUrl:Rl,mcpRawBlock:Ml,capabilities:{hostConfigFiles:_e.hostConfigFiles,hookTrust:_e.hookTrust,mcpConfigEditing:_e.mcpConfigEditing,planMode:_e.planMode,sandboxMode:m?!1:_e.sandboxMode},shellControlState:C,onToggleView:ve,onDismissPromptFocus:Et,onSetOpenMenu:O,onToolboxItemClick:Zl,onSetSlashPanelView:xe,onOpenForkTurns:()=>X==null?void 0:X(),onForkLatest:Fe,onForkTurn:Ge,onCopySkillInvokeName:Vl,onResetHookForm:yl,onSetHooksPanelMode:Ht,onClearHookConfigStatus:oa,onSetEditingHookTarget:Jr,onSetHookScope:Qr,onSetHookEventName:sa,onSetHookMatcher:ct,onSetHookCommand:vl,onSetHookTimeoutSec:kl,onSetHookStatusMessage:wl,onSaveHook:Nl,onStartEditingHook:jl,onTrustHook:Cl,onUntrustHook:Sl,onSetMcpPanelMode:Me,onClearMcpConfigStatus:ia,onSetMcpHttpName:Bl,onSetMcpHttpUrl:Gl,onSetMcpRawBlock:Fl,onPrepareRawMcpBlock:Hl,onSaveHttpMcp:Ol,onSaveRawMcpBlock:Wl,onPickPhoto:()=>ha("photo",pe),onPickFile:()=>ha("file",M),onUpdateSettings:ae=>void Le(ae),onPasteShell:()=>void Ql(),onCopyShell:()=>{Et(),O(null),Pe==null||Pe()},onClearShell:()=>{Et(),O(null),oe({prompt:"clear"})},onShellControl:ae=>{Et(),O(null),le==null||le(ae)}}),{promptSlot:Pi,goalSlot:Ii,shellPromptSlot:zi}=Lm({isShellView:je,promptRef:R,prompt:He,disabled:w,promptPlaceholder:ii,canInterrupt:Ne,interruptLabel:di,composerPromptRegionClassName:Ci,graphChatInputClassName:Ei,promptInputClassName:Si,goalComposeMode:nr,goalTokenBudget:Tl,goalLocalError:El,goalBusy:en,busy:n,sendButtonLabel:ma,sendButtonClassName:pa,onInterrupt:_,onPromptInput:ti,onPromptPaste:ri,onPromptKeyDown:li,onPromptKeyUp:()=>{me.current=Ot()},onPromptMouseUp:()=>{me.current=Ot()},onPromptBlur:()=>{me.current=Ot(),rt(!1),We&&I()},onPromptDragEnter:ni,onPromptDragOver:ai,onPromptDragLeave:si,onPromptDrop:oi,onGoalTokenBudgetChange:Ll,onCancelGoal:la,onShellPromptChange:Kl});return t.jsx(Qu,{activeView:e,layerClassName:mi,formClassName:pi,shellClassName:fi,inputGroupClassName:Ti,error:s,followTail:y,photoInputRef:pe,fileInputRef:M,onAppendAttachments:nn,onToggleFollow:ue,onSubmit:ei,formRef:$e,promptSlot:Pi,toolbarSlot:t.jsx(dm,{...Li}),goalSlot:Ii,shellPromptSlot:zi})}var zm=c.createContext(null);function Zo(){return c.useContext(zm)}function $t(e){return e?new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"}):"Time unavailable"}function Qt(e){return e?new Date(e).toLocaleString():"Time unavailable"}function Rm(e){switch(e){case"idle":return"Idle";case"running":return"Running";case"interrupted":return"Interrupted";case"failed":return"Failed";case"not_loaded":return"Not Loaded";case"system_error":return"System Error"}}function Mm(e){switch(e){case"idle":return"ui-status-neutral";case"running":return"ui-status-info";case"interrupted":return"ui-status-warning";case"failed":case"system_error":return"ui-status-danger";case"not_loaded":return"ui-status-neutral"}}function Jo(e){switch(e){case"sending":return"Sending";case"completed":return"Completed";case"interrupted":return"Interrupted";case"failed":return"Failed";case"inProgress":return"Running"}}function _m({open:e,title:r,label:n,value:a,busy:o=!1,onChange:s,onCancel:l,onSubmit:i}){if(c.useEffect(()=>{if(!e)return;function h(u){u.key==="Escape"&&!o&&l()}return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[o,l,e]),!e)return null;function d(h){h.preventDefault(),i()}return Br.createPortal(t.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[t.jsx("button",{type:"button","aria-label":"Close rename dialog",onClick:l,disabled:o,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),t.jsxs("form",{role:"dialog","aria-modal":"true","aria-label":r,onSubmit:d,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium text-stone-100",children:r}),t.jsx("p",{className:"mt-1 text-sm text-stone-500",children:"Changes are saved only after confirmation."})]}),t.jsx("button",{type:"button","aria-label":"Close dialog",onClick:l,disabled:o,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:t.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),t.jsxs("div",{className:"mt-5",children:[t.jsx("label",{htmlFor:"rename-dialog-input",className:"text-sm font-medium text-stone-200",children:n}),t.jsx("input",{id:"rename-dialog-input","aria-label":n,autoFocus:!0,value:a,onChange:h=>s(h.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),t.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[t.jsx("button",{type:"button",onClick:l,disabled:o,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),t.jsx("button",{type:"submit",disabled:o||!a.trim(),className:"ui-action-success rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:"Save"})]})]})]}),document.body)}function Am({children:e,effectiveTheme:r,layoutMode:n,themeMode:a,viewportConstrained:o}){return t.jsx("div",{className:`thread-ui-shell ${r==="dark"?"thread-ui-theme-dark dark":""} ${o?"thread-ui-viewport-constrained":""} ${o?"h-[100svh] max-h-[100svh] min-h-0 overflow-hidden overscroll-none":"min-h-[100svh] overflow-hidden"} bg-[#f6f8fb] text-slate-900 transition-colors duration-200 sm:p-2`,"data-theme-effective":r,"data-theme-mode":a??r,"data-thread-layout":n,children:e})}function $m({children:e,roomsRailCollapsed:r}){return t.jsx("div",{className:`thread-shell-frame relative h-full min-h-0 ${r?"is-rail-collapsed sm:grid-cols-[56px_minmax(0,1fr)]":"sm:grid-cols-[264px_minmax(0,1fr)]"}`,children:e})}function Dm({onClose:e,open:r}){return r?t.jsx("button",{type:"button","aria-hidden":"true",tabIndex:-1,className:"thread-mobile-only-block thread-mobile-scrim fixed inset-0 z-40 bg-slate-950/35 backdrop-blur-[1px]",onClick:e}):null}function Bm({children:e,collapsed:r,mobileOpen:n}){return t.jsx("aside",{className:`thread-graph-rooms-surface thread-rooms-rail fixed inset-y-0 left-0 z-50 flex min-h-0 min-w-0 w-[min(20rem,calc(100vw-2rem))] flex-col overflow-x-hidden border-r border-slate-200/80 bg-white shadow-[0_20px_50px_rgba(15,23,42,0.18)] transition-transform duration-200 ease-out sm:static sm:z-auto sm:w-auto sm:translate-x-0 sm:rounded-[12px] sm:border sm:shadow-[0_10px_30px_rgba(15,23,42,0.04)] ${n?"translate-x-0":"pointer-events-none -translate-x-full sm:pointer-events-auto"} ${r?"thread-ui-rail-collapsed sm:items-center":""}`,style:{paddingTop:"var(--android-safe-area-top, 0px)"},children:e})}function Gm({children:e}){return t.jsx("main",{className:"thread-shell-main h-full min-h-0 min-w-0 overflow-hidden",children:t.jsx("div",{className:"thread-main-panel thread-shell-card flex h-full min-h-0 flex-col overflow-hidden bg-white shadow-[0_10px_30px_rgba(15,23,42,0.04)] sm:rounded-[12px] sm:border sm:border-slate-200/80",children:e})})}function Fm({children:e}){return t.jsx("div",{className:"thread-topbar-surface flex shrink-0 flex-col border-b border-slate-200 bg-white pt-[env(safe-area-inset-top)] sm:pt-0",children:e})}function Hm({children:e}){return t.jsx("div",{className:"thread-split-region min-h-0 flex-1 overflow-hidden p-0 sm:p-2",children:e})}vo();St();function rs({...e}){return t.jsx(Bi,{"data-slot":"dialog",...e})}function ns({...e}){return t.jsx(Gi,{"data-slot":"dialog-trigger",...e})}function Om({...e}){return t.jsx(Ui,{"data-slot":"dialog-portal",...e})}function Wm({className:e,...r}){return t.jsx(Vi,{"data-slot":"dialog-overlay",className:nt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...r})}function as({children:e,className:r,showCloseButton:n=!0,...a}){return t.jsxs(Om,{"data-slot":"dialog-portal",children:[t.jsx(Wm,{}),t.jsxs(Fi,{"data-slot":"dialog-content",className:nt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",r),...a,children:[e,n?t.jsxs(Hi,{"data-slot":"dialog-close",className:"absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[t.jsx(B.XIcon,{}),t.jsx("span",{className:"sr-only",children:"Close"})]}):null]})]})}function ss({className:e,...r}){return t.jsx("div",{"data-slot":"dialog-header",className:nt("flex flex-col gap-2 text-center sm:text-left",e),...r})}function os({className:e,...r}){return t.jsx(Oi,{"data-slot":"dialog-title",className:nt("text-lg font-semibold leading-none",e),...r})}function ls({className:e,...r}){return t.jsx(Wi,{"data-slot":"dialog-description",className:nt("text-sm text-muted-foreground",e),...r})}var Um=[{value:"system",label:"Follow system",icon:B.Monitor},{value:"dark",label:"Dark",icon:B.Moon},{value:"light",label:"Light",icon:B.Sun}];function Vm({thread:e,currentThreadId:r,currentWorkspaceId:n,workspaceLabels:a={},onOpenThread:o,getThreadHref:s,renderThreadLink:l,onBeginRenameThread:i,onDeleteThread:d,showDeleteButton:h=!1,showSessionCopyButton:u=!1,collapsed:m=!1}){const[f,p]=c.useState("idle"),g=c.useRef(null),b=a[e.workspaceId],v=b&&!n?b:null,x=r===e.id;c.useEffect(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]);async function y(){const C=e.providerSessionId;if(C)try{await navigator.clipboard.writeText(C),p("copied"),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>p("idle"),1200)}catch{p("failed"),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>p("idle"),1600)}}const k=()=>o(e.id),S=`thread-graph-room-card group flex w-full items-center gap-3 rounded-xl border text-left transition ${x?"is-active":""} ${m?"justify-center px-2 py-2":"px-3 py-2.5"}`,w=t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`thread-graph-room-card-icon flex h-8 w-8 shrink-0 items-center justify-center rounded-full ${x?"is-active":""}`,children:t.jsx(B.MessageSquare,{className:"h-4 w-4"})}),t.jsxs("div",{className:`min-w-0 flex-1 ${m?"thread-desktop-collapsed-hidden":""}`,children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[t.jsx("p",{className:"thread-graph-room-card-title min-w-0 flex-1 truncate text-sm font-medium",title:e.title,children:e.title}),i&&!m?t.jsx("button",{type:"button",onClick:C=>{C.stopPropagation(),C.preventDefault(),i(e)},"aria-label":`Rename thread ${e.title}`,title:"Rename thread",className:"thread-card-quiet-button inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full transition",children:t.jsx(B.Pencil,{className:"h-3 w-3"})}):null,u&&e.providerSessionId?t.jsx("button",{type:"button","aria-label":"Copy session ID",title:f==="copied"?"Copied":f==="failed"?"Copy failed":"Copy session ID",onClick:C=>{C.stopPropagation(),C.preventDefault(),y()},className:"thread-card-quiet-button thread-card-session-copy-button inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full transition",children:t.jsx(B.Copy,{className:"h-3.5 w-3.5"})}):null]}),t.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2",children:[v?t.jsx("p",{className:"thread-graph-room-card-meta min-w-0 flex-1 truncate text-[11px] text-[var(--theme-fg-muted)]",title:v,children:v}):t.jsx("span",{className:"min-w-0 flex-1","aria-hidden":"true"}),t.jsx("span",{className:`shrink-0 rounded-full border px-1.5 py-0.5 text-[9px] uppercase tracking-normal ${Mm(e.status)}`,children:Rm(e.status)}),t.jsx("time",{className:"shrink-0 text-[11px] text-[var(--theme-fg-muted)]",dateTime:e.lastTurnStartedAt??e.updatedAt,children:$t(e.lastTurnStartedAt??e.updatedAt)})]})]}),h&&d&&!m?t.jsx("button",{type:"button",onClick:C=>{C.stopPropagation(),C.preventDefault(),d(e)},"aria-label":`Delete thread ${e.title}`,className:"thread-card-danger-button shrink-0 rounded-full p-1 transition",title:"Delete thread",children:t.jsx(B.Trash2,{className:"h-3.5 w-3.5"})}):null]}),N=s==null?void 0:s(e.id);return l?t.jsx(t.Fragment,{children:l({thread:e,children:w,className:S,onClick:k})}):N?t.jsx("a",{href:N,onClick:C=>{C.preventDefault(),k()},title:m?e.title:void 0,className:S,children:w}):t.jsx("div",{role:"link",tabIndex:0,onClick:k,onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),k())},title:m?e.title:void 0,className:S,children:w})}function Km({threads:e,currentThreadId:r,currentWorkspaceId:n,workspaceLabels:a={},onOpenThread:o,getThreadHref:s,renderThreadLink:l,onBeginRenameThread:i,onDeleteThread:d,scrollable:h=!1,maxHeightClassName:u="max-h-full",showDeleteButton:m=!1,showSessionCopyButton:f=!1,collapsed:p=!1}){const g=h?`min-h-0 min-w-0 overflow-x-hidden overflow-y-auto overscroll-contain pr-1 ${u}`:"";return t.jsx("div",{className:g,children:t.jsx("div",{className:"min-w-0 space-y-1",children:e.map(b=>t.jsx(Vm,{thread:b,currentThreadId:r,currentWorkspaceId:n,workspaceLabels:a,onOpenThread:o,showDeleteButton:m,showSessionCopyButton:f,collapsed:p,...s?{getThreadHref:s}:{},...l?{renderThreadLink:l}:{},...i?{onBeginRenameThread:i}:{},...d?{onDeleteThread:d}:{}},b.id))})})}function qm({threads:e,status:r,loading:n=!1,error:a,viewportConstrained:o=!1,layoutMode:s="responsive",effectiveTheme:l,themeMode:i,onThemeModeChange:d,showMobileNewThreadShortcut:h=!0,settingsDialogOpen:u,onSettingsDialogOpenChange:m,mobileHeaderAction:f,currentThreadId:p,currentThreadLabel:g=null,currentWorkspaceId:b=null,currentWorkspaceLabel:v=null,sessionLabel:x=null,usageLabel:y=null,threadActionsButton:k,topbarActions:S,metaContent:w,settingsContent:N,globalSettingsContent:C,workspaceLabels:T={},workspaceReturnHref:P,onWorkspaceReturn:K,getThreadHref:G,onOpenThread:A,getNewThreadHref:J,newThreadHref:Z,newThreadLabel:D="New Chat",onNewThread:te,onNewThreadTitle:oe,renderThreadLink:_,onCloseAppNavigation:Y,onRenameThread:z,onDeleteThread:q,workspaceContent:F,workspaceTitle:E="Workspace",workspaceActions:W,children:H}){const j=Zo(),L=typeof window<"u"?window.matchMedia("(max-width: 639px)").matches:s==="mobile",[U,X]=c.useState(()=>typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches:!1),se=i??(j==null?void 0:j.themeMode)??"system",Q=l??(j==null?void 0:j.effectiveTheme)??(se==="system"?U?"dark":"light":se),[de,re]=c.useState(!1),[ue,be]=c.useState(!1),[ve,Pe]=c.useState(!L),[le,Ne]=c.useState(L),[we,O]=c.useState("chat"),[ce,xe]=c.useState(null),[ye,Me]=c.useState(""),[_e,Te]=c.useState(null),[$e,R]=c.useState(!1),[pe,M]=c.useState(""),[$,ee]=c.useState(!1),[me,ke]=c.useState(!1),[Re,je]=c.useState("session");c.useEffect(()=>{if(typeof window>"u")return;const ge=window.matchMedia("(max-width: 639px)"),Ie=()=>{Ne(ge.matches)};return Ie(),ge.addEventListener("change",Ie),()=>{ge.removeEventListener("change",Ie)}},[]),c.useEffect(()=>{if(typeof window>"u")return;const ge=window.matchMedia("(prefers-color-scheme: dark)"),Ie=()=>{X(ge.matches)};return Ie(),ge.addEventListener("change",Ie),()=>{ge.removeEventListener("change",Ie)}},[]);const De=c.useMemo(()=>[...b?e.filter(Ie=>Ie.workspaceId===b):e].sort((Ie,et)=>{if(Ie.id===p)return-1;if(et.id===p)return 1;const Ke=Date.parse(Ie.lastTurnStartedAt??Ie.updatedAt);return Date.parse(et.lastTurnStartedAt??et.updatedAt)-Ke}),[p,b,e]),Ve=Z??(J==null?void 0:J(b)),Qe=v??b??"all",at=x??g??p??"default_session",rt=y??(r!=null&&r.state?`runtime ${r.state}`:"waiting for agent usage"),lt=d??(j==null?void 0:j.setThemeMode),it=!!lt,He=()=>{re(!1),Y==null||Y()};async function Oe(ge){if(!z)return;const Ie=ye.trim();if(Ie){Te(ge);try{await z(ge,Ie),xe(null),Me("")}finally{Te(null)}}}function We(ge){xe(ge.id),Me(ge.title)}function tt(){xe(null),Me("")}function I(ge){A==null||A(ge),He()}function V(ge){if(!Ve||!ge.trim())return Ve;try{const Ie=new URL(Ve,window.location.origin);return Ie.searchParams.set("title",ge.trim()),`${Ie.pathname}${Ie.search}${Ie.hash}`}catch{const Ie=Ve.includes("?")?"&":"?";return`${Ve}${Ie}title=${encodeURIComponent(ge.trim())}`}}async function fe(){const ge=pe.trim();ee(!0);try{if(ge&&oe){await oe(ge),M(""),R(!1),He();return}if(Ve){window.location.assign(V(ge)??Ve);return}await(te==null?void 0:te()),M(""),R(!1),He()}finally{ee(!1)}}function Le(ge,Ie=!1){const et=Ie?t.jsxs(t.Fragment,{children:[t.jsx(B.Plus,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:D})]}):t.jsxs(t.Fragment,{children:[t.jsx(B.Plus,{className:"h-4 w-4"}),t.jsx("span",{children:D})]});return t.jsxs(rs,{open:$e,onOpenChange:Ke=>{$||R(Ke)},children:[t.jsx(ns,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":Ie?D:void 0,title:D,className:ge,children:et})}),t.jsxs(as,{"data-testid":"create-thread-dialog","data-theme-effective":Q,"data-theme-mode":se,className:"thread-graph-create-thread-dialog thread-graph-dialog",children:[t.jsxs(ss,{children:[t.jsx(os,{children:"Create New Chat"}),t.jsx(ls,{children:"Name the room so it is easy to find later."})]}),t.jsxs("div",{className:"grid gap-3",children:[t.jsx("input",{id:"thread-graph-create-thread-title",name:"thread-title",value:pe,onChange:Ke=>M(Ke.target.value),onKeyDown:Ke=>{Ke.key==="Enter"&&(Ke.preventDefault(),fe())},placeholder:"Chat name","aria-label":"Chat name",autoComplete:"off",className:"thread-graph-create-thread-input h-10 rounded-md border px-3 text-sm outline-none transition"}),t.jsx("button",{type:"button",onClick:()=>void fe(),disabled:$,className:"thread-graph-create-thread-submit inline-flex h-10 items-center justify-center rounded-md px-4 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:$?"Creating...":"Create"})]})]})]})}function ne(){if(!N&&!w&&!C&&!it)return null;const ge=!!(N||w),Ie=!!C,et=Re==="global"&&Ie||!ge&&Ie?"global":"session";return t.jsxs(rs,{...u!==void 0?{open:u}:{},...m?{onOpenChange:m}:{},children:[t.jsx(ns,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":"Open settings",title:"Settings",className:"thread-icon-button inline-flex h-10 w-10 items-center justify-center rounded-full sm:h-9 sm:w-9",children:t.jsx(B.Settings,{className:"h-4 w-4"})})}),t.jsxs(as,{"data-testid":"settings-dialog","data-theme-effective":Q,"data-theme-mode":se,className:"thread-graph-settings-dialog thread-graph-dialog",children:[t.jsxs(ss,{children:[t.jsx(os,{children:"Settings"}),t.jsx(ls,{children:"Manage this session and host-wide preferences."})]}),it?t.jsx("div",{className:"thread-graph-settings-card rounded-lg border p-3",children:t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"font-medium text-[var(--theme-fg)]",children:"Appearance"}),t.jsxs("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:["Current theme: ",Q]})]}),t.jsx("div",{className:"thread-graph-theme-mode-group grid grid-cols-3 gap-1 rounded-lg border p-1",role:"group","aria-label":"Theme mode",children:Um.map(Ke=>{const kt=Ke.icon,Ht=se===Ke.value;return t.jsxs("button",{type:"button","data-testid":`theme-mode-${Ke.value}`,"aria-pressed":Ht,disabled:!it,onClick:()=>lt==null?void 0:lt(Ke.value),className:`thread-graph-theme-mode-button inline-flex min-h-9 items-center justify-center gap-1.5 rounded-md px-2 text-xs font-medium transition ${Ht?"is-selected":""}`,children:[t.jsx(kt,{className:"h-3.5 w-3.5"}),t.jsx("span",{className:"truncate",children:Ke.label})]},Ke.value)})})]})}):null,t.jsxs("div",{className:"thread-graph-settings-tabs grid grid-cols-2 gap-1 rounded-lg border p-1",children:[t.jsx("button",{type:"button","aria-pressed":et==="session",onClick:()=>je("session"),className:`thread-graph-settings-tab-button rounded-md px-3 py-2 text-sm font-medium transition ${et==="session"?"is-active":""}`,children:"Session"}),t.jsx("button",{type:"button","aria-pressed":et==="global",disabled:!Ie,onClick:()=>je("global"),className:`thread-graph-settings-tab-button rounded-md px-3 py-2 text-sm font-medium transition ${et==="global"?"is-active":""}`,children:"Global"})]}),t.jsx("div",{className:"thread-graph-settings-body mt-4 min-h-0 overflow-y-auto pr-1 text-sm",children:et==="session"?t.jsxs("div",{className:"grid gap-4",children:[N?t.jsx("div",{className:"thread-graph-settings-card rounded-lg border p-3",children:N}):null,w?t.jsx("div",{className:"thread-graph-settings-card rounded-lg border p-3",children:w}):null,ge?null:t.jsx("div",{className:"thread-graph-settings-card rounded-lg border p-3 text-[var(--theme-fg-muted)]",children:"No session settings are available."})]}):t.jsx("div",{className:"thread-graph-settings-global-content",children:C})})]})]})}function Fe(ge=!1){return t.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:t.jsxs("section",{className:"flex min-h-0 flex-1 flex-col",children:[t.jsxs("div",{className:`mb-3 flex items-center gap-2 px-2 text-xs font-medium tracking-normal text-[var(--theme-fg-muted)] ${ge?"justify-center":""}`,children:[t.jsx(B.Rows3,{className:"h-3.5 w-3.5"}),t.jsx("span",{className:ge?"sr-only":"",children:"Rooms"}),!ge&&n?t.jsx("span",{className:"ml-auto text-xs text-[var(--theme-fg-muted)]",children:"Refreshing..."}):null]}),t.jsxs("div",{className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto px-1",children:[a?t.jsx("div",{className:"rounded-xl border border-rose-500/30 bg-rose-500/10 px-3 py-3 text-sm text-rose-900 dark:text-rose-100",children:a}):null,!a&&De.length===0&&!n?t.jsx("div",{className:"rounded-xl border border-dashed border-[var(--theme-border)] bg-[var(--theme-surface)] px-4 py-6 text-sm text-[var(--theme-fg-muted)]",children:"No threads available in this view."}):null,De.length>0?t.jsx(Km,{threads:De,currentThreadId:p,currentWorkspaceId:b,workspaceLabels:T,onOpenThread:I,collapsed:ge,...z?{onBeginRenameThread:We}:{},showDeleteButton:!!q,...G?{getThreadHref:G}:{},..._?{renderThreadLink:_}:{},...q?{onDeleteThread:q}:{}}):null]})]})})}function Ge(){return F?t.jsxs("div",{className:"thread-workspace-panel relative flex h-full min-h-0 flex-col overflow-hidden rounded-[12px] border",children:[t.jsx("button",{type:"button",onClick:()=>Pe(!0),className:"thread-workspace-collapse-tab thread-desktop-only-inline-flex",title:"Collapse workspace","aria-label":"Collapse workspace",children:t.jsx(B.ChevronsRight,{className:"h-4 w-4"})}),W?t.jsx("div",{className:"pointer-events-none absolute right-12 top-2 z-20 flex items-center gap-1",children:t.jsx("div",{className:"pointer-events-auto",children:W})}):null,t.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:F})]}):t.jsxs("div",{className:"thread-workspace-panel flex h-full min-h-0 flex-col overflow-hidden rounded-[12px] border",children:[t.jsxs("div",{className:"thread-workspace-panel-header flex h-12 shrink-0 items-center justify-between gap-3 border-b border-[var(--theme-border)] px-3 sm:h-[60px] sm:px-4",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate text-base font-semibold text-[var(--theme-fg)] sm:text-[18px]",children:E}),t.jsx("p",{className:"truncate text-xs text-[var(--theme-fg-muted)]",children:v??b??"Current context"})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[W,t.jsx("button",{type:"button",onClick:()=>Pe(!0),className:"thread-workspace-small-toggle thread-desktop-only-inline-flex",title:"Collapse workspace","aria-label":"Collapse workspace",children:t.jsx(B.ChevronsRight,{className:"h-4 w-4"})})]})]}),t.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:F??t.jsxs("div",{className:"grid h-full min-h-0 gap-3 overflow-y-auto p-3 text-sm text-[var(--theme-fg-soft)]",children:[t.jsxs("div",{className:"thread-workspace-card rounded-lg border p-3",children:[t.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.14em] text-[var(--theme-fg-muted)]",children:"Runtime"}),t.jsx("p",{className:"mt-2 text-[var(--theme-fg)]",children:(r==null?void 0:r.state)??"unknown"})]}),t.jsxs("div",{className:"thread-workspace-card rounded-lg border p-3",children:[t.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.14em] text-[var(--theme-fg-muted)]",children:"Workspace"}),t.jsx("p",{className:"mt-2 break-words text-[var(--theme-fg)]",children:v??b??"All threads"})]})]})})]})}const Ae=!!F,Xe=s==="mobile"||s==="responsive"&&le,st=Xe,bt=st&&!de,vt=!!(P||K)?t.jsx("a",{href:P??"#",onClick:ge=>{K&&(ge.preventDefault(),K())},className:"thread-icon-button inline-flex h-10 w-10 items-center justify-center rounded-full sm:h-9 sm:w-9",title:"Back to workspace","aria-label":"Back to workspace",children:t.jsx(B.ArrowLeft,{className:"h-4 w-4"})}):null;return t.jsxs(t.Fragment,{children:[t.jsx(Am,{effectiveTheme:Q,layoutMode:s,themeMode:se,viewportConstrained:o,children:t.jsxs($m,{roomsRailCollapsed:ue,children:[t.jsx(Dm,{open:de,onClose:()=>re(!1)}),t.jsxs(Bm,{collapsed:ue,mobileOpen:de,children:[t.jsx("div",{className:`thread-rooms-rail-header flex h-[calc(3.75rem+env(safe-area-inset-top))] shrink-0 items-end border-b border-[var(--theme-border)] px-4 pb-3 sm:h-16 sm:items-center sm:pb-0 ${ue?"sm:w-full sm:justify-center sm:px-2":""}`,children:t.jsxs("div",{className:`flex w-full items-center gap-3 ${ue?"sm:justify-center":"justify-between"}`,children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx("button",{type:"button",onClick:()=>be(ge=>!ge),className:"thread-icon-button thread-desktop-only-flex h-9 w-9 shrink-0 items-center justify-center rounded-full",title:ue?"Expand rooms":"Collapse rooms","aria-label":ue?"Expand rooms":"Collapse rooms",children:ue?t.jsx(B.PanelLeftOpen,{className:"h-4 w-4"}):t.jsx(B.PanelLeftClose,{className:"h-4 w-4"})}),t.jsx("div",{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[var(--theme-accent-solid)] text-sm font-semibold text-[var(--theme-accent-solid-fg)] ${ue?"thread-desktop-collapsed-hidden":""}`,children:(v??"R").charAt(0).toUpperCase()}),t.jsxs("div",{className:`min-w-0 ${ue?"thread-desktop-collapsed-hidden":""}`,children:[t.jsx("p",{className:"truncate text-sm font-semibold text-[var(--theme-fg)]",children:v??"Remote Codex"}),t.jsx("p",{className:"truncate text-xs text-[var(--theme-fg-muted)]",children:b??"Thread workspace"})]})]}),t.jsxs("div",{className:`flex shrink-0 items-center gap-1 ${ue?"thread-desktop-collapsed-hidden":""}`,children:[ne(),vt,t.jsx("button",{type:"button",onClick:()=>re(!1),"aria-label":"Close rooms",title:"Close rooms",className:"thread-icon-button thread-mobile-only-inline-flex h-10 w-10 items-center justify-center rounded-full",children:t.jsx(B.X,{className:"h-4 w-4"})})]})]})}),t.jsx("div",{className:`thread-graph-new-room-strip flex shrink-0 items-center border-b ${ue?"h-12 w-full justify-center px-2 sm:h-12":"h-[68px] px-4"}`,children:Le(`thread-graph-new-room-button inline-flex items-center justify-center rounded-xl font-medium transition ${ue?"h-9 w-9 p-0":"h-11 w-full gap-2 px-3 text-sm sm:h-9"}`,ue)}),t.jsx("div",{className:`flex min-h-0 flex-1 flex-col ${ue?"w-full px-2 py-2":"px-3 py-3"}`,children:Fe(ue)})]}),t.jsxs(Gm,{children:[t.jsx(Fm,{children:t.jsx("div",{className:"thread-topbar-row flex min-h-12 items-center px-3 py-1.5 sm:min-h-12 sm:px-4",children:t.jsxs("div",{className:"flex w-full items-center justify-between gap-3 sm:gap-4",children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 sm:gap-3",children:[bt?t.jsx("button",{type:"button",onClick:()=>re(!0),"aria-label":"Open rooms",title:"Open rooms",className:"thread-icon-button thread-mobile-only-inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full",children:t.jsx(B.Menu,{className:"h-4 w-4"})}):null,t.jsxs("div",{className:"min-w-0",children:[st?t.jsx("h1",{className:"thread-mobile-only-block min-w-0 truncate text-sm font-semibold leading-none text-[var(--theme-fg)]",children:g??"Shared Workspace"}):null,t.jsxs("div",{className:"relative flex min-w-0 items-center gap-1.5",children:[t.jsxs("button",{type:"button",onClick:()=>{ke(ge=>!ge)},"aria-expanded":me,"aria-haspopup":"dialog",className:"thread-topbar-meta-row flex min-w-0 max-w-full items-center gap-1 text-left text-[11px] leading-none sm:text-xs",title:"Session and usage",children:[t.jsx("span",{className:"shrink-0",children:"Room"}),t.jsx("span",{className:"truncate font-mono",children:Qe})]}),me?t.jsxs("div",{className:"thread-topbar-details-popover absolute left-0 top-[calc(100%+0.5rem)] z-50 w-[min(26rem,calc(100vw-1.5rem))] rounded-lg border p-2.5 shadow-lg",role:"dialog","aria-label":"Session and usage",children:[t.jsxs("button",{type:"button",onClick:()=>{var ge;Qe&&((ge=navigator.clipboard)==null||ge.writeText(Qe))},className:"thread-topbar-meta-row flex min-w-0 max-w-full items-center gap-2 text-left text-xs leading-5",title:"Copy room ID",children:[t.jsx("span",{className:"w-12 shrink-0",children:"Room"}),t.jsx("span",{className:"truncate font-mono",children:Qe})]}),t.jsxs("button",{type:"button",onClick:()=>{var ge;at&&((ge=navigator.clipboard)==null||ge.writeText(at))},className:"thread-topbar-meta-row flex min-w-0 max-w-full items-center gap-2 text-left text-xs leading-5",title:"Copy session ID",children:[t.jsx("span",{className:"w-12 shrink-0",children:"Session"}),t.jsx("span",{className:"truncate font-mono",children:at})]}),t.jsxs("div",{className:"thread-topbar-meta-row mt-1 flex min-w-0 max-w-full items-center gap-2 text-xs leading-5",title:"Room token usage",children:[t.jsx("span",{className:"w-12 shrink-0",children:"Usage"}),t.jsx("span",{className:"truncate font-mono",children:rt})]})]}):null]})]})]}),t.jsxs("div",{className:"relative z-[1] inline-flex shrink-0 items-center gap-2",children:[k||S?t.jsxs("div",{className:"thread-graph-topbar-actions thread-desktop-only-inline-flex items-center rounded-lg border p-0.5 shadow-none",children:[k,S]}):null,st&&k?t.jsx("div",{className:"thread-mobile-only-inline-flex",children:k}):null,st&&Ae?t.jsx("button",{type:"button",onClick:()=>O(ge=>ge==="workspace"?"chat":"workspace"),"aria-label":we==="workspace"?"Show chat":"Show workspace",title:we==="workspace"?"Show chat":"Show workspace",className:"thread-icon-button thread-mobile-only-inline-flex h-10 w-10 items-center justify-center rounded-full",children:we==="workspace"?t.jsx(B.MessageSquare,{className:"h-4 w-4"}):t.jsx(B.Folder,{className:"h-4 w-4"})}):null,st?f:null,st&&h?Le("thread-secondary-action inline-flex h-10 items-center justify-center gap-2 rounded-lg border px-3 text-sm font-medium sm:h-9"):null]})]})})}),t.jsx(Hm,{children:Ae&&!ve?Xe?t.jsxs("div",{className:"thread-split-container thread-graph-shell-mobile-split h-full min-h-0 overflow-hidden",children:[t.jsx("div",{className:`h-full min-h-0 overflow-hidden ${we==="chat"?"block":"thread-mobile-chat-hidden"}`,children:H}),t.jsx("div",{className:`h-full min-h-0 overflow-hidden ${we==="workspace"?"block":"thread-mobile-workspace-hidden"}`,children:Ge()})]}):t.jsxs(Sn,{direction:"horizontal",className:"thread-split-container thread-graph-shell-resizable thread-graph-shell-desktop-split h-full min-h-0 overflow-hidden",children:[t.jsx(Zt,{defaultSize:47,minSize:30,maxSize:75,className:"thread-split-chat-pane min-w-0 overflow-hidden",children:H}),t.jsx(Tn,{className:"thread-resize-handle w-2 bg-transparent after:w-px after:bg-slate-200/80 after:transition-colors hover:after:bg-slate-300 dark:after:bg-[#303642] dark:hover:after:bg-[#475063]"}),t.jsx(Zt,{defaultSize:53,minSize:30,maxSize:70,className:"thread-split-workspace-pane min-w-0 overflow-hidden",children:Ge()})]}):t.jsxs("div",{className:"thread-split-container relative h-full min-h-0 overflow-hidden",children:[Ae&&ve?t.jsx("button",{type:"button",onClick:()=>Pe(!1),className:"thread-workspace-expand-fab thread-desktop-only-inline-flex",title:"Expand workspace","aria-label":"Expand workspace",children:t.jsx(B.ChevronsLeft,{className:"h-4 w-4"})}):null,H]})})]})]})}),t.jsx(_m,{open:ce!==null,title:"Rename Thread",label:"Thread Title",value:ye,busy:_e!==null,onChange:Me,onCancel:tt,onSubmit:()=>ce?Oe(ce):void 0})]})}function Xm({open:e,title:r,text:n,onClose:a}){return c.useEffect(()=>{if(!e)return;function o(s){s.key==="Escape"&&a()}return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}},[a,e]),e?Br.createPortal(t.jsxs("div",{className:"fixed inset-0 z-[90] flex items-center justify-center p-4 sm:p-6",children:[t.jsx("button",{type:"button","aria-label":"Close full text",onClick:a,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm"}),t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":r,className:"relative z-[1] flex max-h-[min(82vh,52rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-stone-800 px-4 py-3 sm:px-5",children:[t.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:r}),t.jsx("button",{type:"button","aria-label":"Close dialog",onClick:a,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800",children:t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:t.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),t.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-4 sm:px-5",children:t.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-200",children:n})})]})]}),document.body):null}var Ym=[/^(?: {0,3})#{1,6}\s+\S/m,/^(?: {0,3})>{1,}\s*\S/m,/^(?: {0,3})(?:[-+*]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?\S/m,/^(?: {0,3})(?:```|~~~)/m,/^(?: {0,3})(?:[-*_]\s*){3,}$/m],Zm=/^(?:\|?[^|\n]+\|[^|\n]+(?:\|[^|\n]+)*\|?\s*\n\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*$)/m,Jm=/!?\[[^\]\n]+\]\([^)]+\)/,Qm=/`[^`\n]+`/,ep=/(?:\*\*[^*\n]+\*\*|__[^_\n]+__)/,tp=/(^|[^\w])(?:\*[^*\n]+\*|_[^_\n]+_)(?=[^\w]|$)/,rp=/~~[^~\n]+~~/;function np(e){const r=e.trim();return r?Ym.some(n=>n.test(r))||Zm.test(r)?!0:/[`[\]*_~!]/.test(r)?Jm.test(r)||Qm.test(r)||ep.test(r)||tp.test(r)||rp.test(r):!1:!1}Ur();function Dn(e,r){const n=new Map(r.map(s=>[s.id,s])),a=e.map(s=>{var l,i;return{...s.manifest,enabled:((l=n.get(s.manifest.id))==null?void 0:l.enabled)??!0,source:((i=n.get(s.manifest.id))==null?void 0:i.source)??"builtin"}}),o=new Set(e.map(s=>s.manifest.id));for(const s of r)o.has(s.id)||a.push(s);return a}function ea(e=[]){const r=Dn(e,[]),n=e;return{plugins:r,loading:!1,error:null,async refresh(){},async importPluginManifest(){},async setPluginEnabled(){},async uninstallPlugin(){},renderArtifact:s=>{var i;const l=n.find(d=>d.renderArtifact&&d.manifest.capabilities.artifactTypes.some(h=>h.type===s.artifact.type));return((i=l==null?void 0:l.renderArtifact)==null?void 0:i.call(l,s))??null},renderInlineCode:s=>{for(const l of n)for(const i of l.inlineCodeRenderers??[]){if(!i.languages.includes(s.language.trim().toLowerCase()))continue;const d=i.render(s);if(d)return d}return null},hasRendererForArtifact:s=>n.some(l=>!!l.renderArtifact&&l.manifest.capabilities.artifactTypes.some(i=>i.type===s.type)),getThreadPanels:()=>n.flatMap(s=>s.threadPanels??[])}}var ta=c.createContext(ea());function ra(){return c.useContext(ta)??ea()}vr();function Qo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function is(e){return Qo(e)?Object.entries(e):e==null||e===""?[]:[["value",e]]}function el(e){return typeof e=="string"?t.jsxs("span",{className:"thread-graph-tool-string",children:['"',e,'"']}):typeof e=="number"?t.jsx("span",{className:"thread-graph-tool-number",children:e}):typeof e=="boolean"?t.jsx("span",{className:"thread-graph-tool-boolean",children:String(e)}):e===null?t.jsx("span",{className:"thread-graph-tool-null",children:"null"}):typeof e=="object"?t.jsx("span",{className:"thread-graph-tool-object",children:JSON.stringify(e)}):t.jsx("span",{children:String(e)})}function ap(e,r){return typeof r=="string"&&(e==="stdout"||e==="stderr"||e==="result")?t.jsx("pre",{className:"thread-graph-tool-output",children:r||"(empty)"}):typeof r=="object"&&r!==null?t.jsx("pre",{className:"thread-graph-tool-output",children:JSON.stringify(r,null,2)}):el(r)}function ds({callId:e,toolName:r,status:n,parameters:a,result:o}){const s=c.useMemo(()=>{switch(n){case"completed":return{className:"is-completed",icon:t.jsx(B.CheckCircle2,{className:"h-3.5 w-3.5"}),label:"Completed"};case"failed":return{className:"is-failed",icon:t.jsx(B.XCircle,{className:"h-3.5 w-3.5"}),label:"Failed"};default:return{className:"is-pending",icon:t.jsx(B.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),label:"Running"}}},[n]),l=c.useMemo(()=>is(o),[o]),i=c.useMemo(()=>is(a),[a]),d=c.useMemo(()=>typeof o=="string"?o.length>0:Qo(o)?["stdout","stderr","result"].some(f=>{const p=o[f];return typeof p=="string"&&p.length>0}):!1,[o]),h=n==="pending"||d,[u,m]=c.useState(h?"item-1":void 0);return c.useEffect(()=>{h&&m("item-1")},[e,h]),t.jsx("div",{className:"thread-graph-tool-call my-2 w-full font-sans not-prose",children:t.jsx(gr,{type:"single",collapsible:!0,onValueChange:f=>m(f||void 0),className:"thread-graph-tool-accordion w-full overflow-hidden rounded-lg border",...u!==void 0?{value:u}:{},children:t.jsxs(xr,{value:"item-1",className:"border-0",children:[t.jsx(Vr,{className:"thread-graph-tool-trigger px-4 py-3 hover:no-underline",children:t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(B.Wrench,{className:"h-4 w-4 shrink-0"}),t.jsx("span",{className:"min-w-0 truncate font-mono text-sm font-semibold",children:r}),t.jsxs("span",{className:`thread-graph-tool-badge ${s.className}`,title:s.label,"aria-label":`Status: ${s.label}`,children:[s.icon,t.jsx("span",{className:"thread-graph-status-label",children:s.label})]})]})}),t.jsxs(br,{className:"thread-graph-tool-content px-4 pb-4 pt-1",children:[t.jsxs("section",{children:[t.jsx("h4",{children:"Parameters"}),t.jsxs("div",{className:"thread-graph-tool-json",children:["{",t.jsx("br",{}),i.length>0?i.map(([f,p],g)=>t.jsxs("div",{children:[t.jsxs("span",{className:"thread-graph-tool-key",children:['"',f,'"']}),t.jsx("span",{className:"thread-graph-tool-punctuation",children:": "}),el(p),g<i.length-1?t.jsx("span",{className:"thread-graph-tool-punctuation",children:","}):null]},f)):t.jsx("div",{children:t.jsx("span",{className:"thread-graph-tool-null",children:"empty"})}),"}"]})]}),l.length>0?t.jsxs("section",{children:[t.jsx("h4",{children:"Result"}),t.jsxs("div",{className:"thread-graph-tool-json",children:["{",t.jsx("br",{}),l.map(([f,p],g)=>t.jsxs("div",{children:[t.jsxs("span",{className:"thread-graph-tool-key",children:['"',f,'"']}),t.jsx("span",{className:"thread-graph-tool-punctuation",children:": "}),ap(f,p),g<l.length-1?t.jsx("span",{className:"thread-graph-tool-punctuation",children:","}):null]},f)),"}"]})]}):null]})]})})})}var cs=null;function sp(){return cs??(cs=Promise.all([qe(()=>import("./core-oEok_Crl.js"),__vite__mapDeps([0,1,2])),qe(()=>import("./engine-javascript-DBd1bXLz.js"),[]),qe(()=>import("./ayu-light-BA47KaF1.js"),[]),qe(()=>import("./ayu-dark-DYE7WIF3.js"),[]),qe(()=>import("./javascript-wDzz0qaB.js"),[]),qe(()=>import("./typescript-BPQ3VLAy.js"),[]),qe(()=>import("./tsx-COt5Ahok.js"),[]),qe(()=>import("./jsx-g9-lgVsj.js"),[]),qe(()=>import("./python-B6aJPvgy.js"),[]),qe(()=>import("./json-Cp-IABpG.js"),[]),qe(()=>import("./shellscript-CEILq0vU.js").then(e=>e.b),[]),qe(()=>import("./shellscript-CEILq0vU.js").then(e=>e.s),[]),qe(()=>import("./yaml-Buea-lGh.js"),[]),qe(()=>import("./toml-vGWfd6FD.js"),[]),qe(()=>import("./markdown-Cvjx9yec.js"),[]),qe(()=>import("./html-pp8916En.js"),__vite__mapDeps([3,4,5])),qe(()=>import("./css-CLj8gQPS.js"),[]),qe(()=>import("./sql-CRqJ_cUM.js"),[]),qe(()=>import("./csv-fuZLfV_i.js"),[])]).then(([{createHighlighterCore:e},{createJavaScriptRegexEngine:r},n,a,o,s,l,i,d,h,u,m,f,p,g,b,v,x,y])=>e({engine:r(),themes:[n.default,a.default],langs:[o.default,s.default,l.default,i.default,d.default,h.default,u.default,m.default,f.default,p.default,g.default,b.default,v.default,x.default,y.default]}))),cs}function Kr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bn(e){if(!e)return{};if(Kr(e)&&Object.prototype.hasOwnProperty.call(e,"0"))try{const r=Object.keys(e).map(Number).filter(n=>Number.isFinite(n)).sort((n,a)=>n-a).map(n=>String(e[String(n)]??"")).join("");return JSON.parse(r)}catch{return e}if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}function Gn(){return{finalResult:null,stdout:"",stderr:""}}function op(e){return typeof e=="string"?{result:e}:e}function tl(e){const r=Kr(e.finalResult)?{...e.finalResult}:e.finalResult!=null?{result:e.finalResult}:{};return e.stdout&&(r.stdout=e.stdout),e.stderr&&(r.stderr=e.stderr),!("status"in r)&&(e.stdout||e.stderr)&&(r.status="pending"),r}function hs(e){if(!e)return"pending";if(!Kr(e))return"completed";const r=e.status;return r==="stream"||r==="pending"||r==="running"?"pending":r==="failed"||r==="error"||r==="timed_out"||typeof e.exit_code=="number"&&e.exit_code!==0?"failed":"completed"}function lp(e){const r=new Map,n=/```tool-result\s*([\s\S]*?)\s*```/g,a=e.replace(n,(l,i)=>{try{const d=JSON.parse(i),h=d.call_id;if(typeof h!="string")return l;const u=op(d.result),m=r.get(h)??Gn();return Kr(u)&&u.status==="stream"&&typeof u.chunk=="string"?u.stream==="stderr"?m.stderr+=u.chunk:m.stdout+=u.chunk:m.finalResult=u,r.set(h,m),""}catch{return l}}),o=/```tool-call\s*([\s\S]*?)\s*```/g;return{processedContent:a.replace(o,(l,i)=>{try{const d=JSON.parse(i),h=d.call_id,u=d.tool;if(typeof u!="string")return l;const m=Bn(d.args);if(typeof h=="string"&&r.has(h)){const f=tl(r.get(h)??Gn());return`\`\`\`tool-merged
|
|
3645
|
+
${JSON.stringify({call:{tool:u,args:m,call_id:h},result:f},null,2)}
|
|
3646
|
+
\`\`\``}return l}catch{return l}}),resultMap:r}}var ip=["/api/","/assets/","/control-plane","/devices/","/relay/","/relay-account","/relay-admin","/relay-devices","/relay-portal","/threads","/workspaces"];function us(e){return e.replace(/background-color:[^;"]+;?/g,"background-color: transparent;").replace(/background:[^;"]+;?/g,"background: transparent;")}function ms(e){return Array.isArray(e)?e.map(r=>String(r)).join(""):String(e??"")}function dp(e){if(!e||typeof e!="object"||!("position"in e))return{startLine:void 0,endLine:void 0};const r=e.position;if(!r||typeof r!="object")return{startLine:void 0,endLine:void 0};const n=r.start,a=r.end,o=n&&typeof n=="object"?n.line:void 0,s=a&&typeof a=="object"?a.line:void 0;return{startLine:typeof o=="number"?o:void 0,endLine:typeof s=="number"?s:void 0}}function cp(e){if(!e)return null;let r=e.trim();if(!r)return null;try{if(typeof window>"u")return null;const s=new URL(r,window.location.origin);if(s.origin!==window.location.origin&&s.protocol!=="file:")return null;r=(s.protocol==="file:",s.pathname)}catch{}try{r=decodeURIComponent(r)}catch{}if(!r.startsWith("/")||ip.some(s=>r===s||r.startsWith(s)))return null;const n=r.match(/:(\d+)(?::\d+)?$/),a=n?Number.parseInt(n[1]??"",10):void 0,o=n?r.slice(0,-n[0].length):r;return!o||o==="/"?null:{path:o,...Number.isFinite(a)?{line:a}:{}}}function hp({children:e,...r}){return up(e)?t.jsx(t.Fragment,{children:e}):t.jsx("pre",{...r,children:e})}function up(e){var n;if(!e||typeof e!="object"||!("props"in e))return!1;const r=(n=e.props)==null?void 0:n.className;return typeof r!="string"?!1:r.includes("language-tool-call")||r.includes("language-tool-merged")||r.includes("language-tool-result")}var mp=c.memo(function({className:r="thread-graph-markdown",content:n,onOpenWorkspaceFile:a}){const o=c.useRef(null),s=ra(),[l,i]=c.useState(null),[d,h]=c.useState({}),[u,m]=c.useState(!1),{processedContent:f,resultMap:p}=c.useMemo(()=>lp(n),[n]);c.useEffect(()=>{let v=!0;return sp().then(x=>{v&&i(x)}).catch(()=>{}),()=>{v=!1}},[]),c.useEffect(()=>{const v=o.current,x=v==null?void 0:v.closest(".thread-ui-shell"),y=()=>x?x.getAttribute("data-theme-effective")==="dark"||x.classList.contains("dark")||x.classList.contains("thread-ui-theme-dark"):document.documentElement.classList.contains("dark");if(m(y()),!x)return;const k=new MutationObserver(()=>m(y()));return k.observe(x,{attributes:!0,attributeFilter:["class","data-theme-effective"]}),()=>k.disconnect()},[]);async function g(v,x){try{await navigator.clipboard.writeText(x),h(y=>({...y,[v]:"copied"})),window.setTimeout(()=>{h(y=>{const k={...y};return delete k[v],k})},1200)}catch{h(y=>({...y,[v]:"failed"}))}}const b=({children:v,className:x,inline:y,node:k,...S})=>{var A;const w=/language-(\w+(?:-\w+)*)/.exec(x||""),N=w?w[1]??"":"",C=ms(v).replace(/\n$/,""),{startLine:T,endLine:P}=dp(k),K=y===!1||!!x||C.includes(`
|
|
3647
|
+
`)||T!==P;if(N==="tool-merged"){let J={call:{tool:"Unknown",args:{},call_id:void 0},result:null};try{J=JSON.parse(C)}catch{J={call:{tool:"Error",args:{raw:C}},result:{status:"failed"}}}const Z=typeof J.call.tool=="string"?J.call.tool:"Unknown",D=typeof J.call.call_id=="string"?J.call.call_id:void 0;return t.jsx(ds,{callId:D,toolName:Z,status:hs(J.result),parameters:Bn(J.call.args),result:J.result})}if(N==="tool-call"){let J={tool:"Unknown",args:{},call_id:void 0};try{J=JSON.parse(C)}catch{J={tool:"Error",args:{raw:C}}}const Z=typeof J.call_id=="string"?J.call_id:void 0,D=Z&&p.has(Z)?tl(p.get(Z)??Gn()):void 0;return t.jsx(ds,{callId:Z,toolName:typeof J.tool=="string"?J.tool:"Unknown",status:D?hs(D):"pending",parameters:Bn(J.args),result:D})}if(N==="tool-result")return null;if(["xyz","extxyz","cif","pdb"].includes(N)){const J=s.renderInlineCode({code:C,isIncomplete:!1,language:N});if(c.isValidElement(J))return J}if(K){const Z=(((A=l==null?void 0:l.getLoadedLanguages)==null?void 0:A.call(l))??[]).includes(N)?N:"text",D=u?"ayu-dark":"ayu-light",te=`${N||"text"}:${C.length}:${C.slice(0,32)}`;let oe="";if(l)try{oe=us(l.codeToHtml(C,{lang:Z,theme:D}))}catch{oe=us(l.codeToHtml(C,{lang:"text",theme:D}))}return t.jsxs("div",{className:"thread-graph-code-block not-prose relative my-3 overflow-auto rounded-xl border p-3 text-sm shadow-sm",children:[t.jsx(pr,{type:"button",onClick:()=>void g(te,C),variant:"ghost",size:"sm",className:"thread-graph-code-copy absolute right-2 top-2 z-10 rounded-md p-1.5",title:d[te]==="copied"?"Copied":d[te]==="failed"?"Copy failed":"Copy","aria-label":"Copy code",children:t.jsx(B.Copy,{className:"h-3.5 w-3.5"})}),oe?t.jsx("div",{dangerouslySetInnerHTML:{__html:oe}}):t.jsx("pre",{children:t.jsx("code",{className:"whitespace-pre",children:C})})]})}const G=ms(v).replace(/`+/g,"");return t.jsx("code",{className:`thread-graph-inline-code rounded px-1 py-0.5 font-mono font-normal text-[0.9em] ${x||""}`,...S,children:G})};return t.jsx("div",{ref:o,className:`thread-graph-message-markdown ${r}`,children:t.jsx(ud,{remarkPlugins:[pd,fd],rehypePlugins:[md],components:{a({href:v,children:x,...y}){const k=cp(v);return k&&a?t.jsx("a",{...y,href:v,className:"thread-inline-link",onClick:S=>{S.preventDefault(),a(k)},children:x}):t.jsx("a",{...y,href:v,className:"thread-inline-link",children:x})},code:b,pre:hp},children:f})})}),ps=4e3,pp=/\b(?:https?:\/\/|www\.)[^\s<>"'`]+/gi,fp=/[),.;:!?]+$/;function gp(e){return e.startsWith("www.")?`https://${e}`:e}function fs(e){const r=e.replace(/[\\/]+$/,"").trim();return r?r.split(/[\\/]/).filter(Boolean).at(-1)??r:""}function xp(e){var s;if(!e)return[];const r=/\[(PHOTO|FILE)\s+([^\]]+)\]/g,n=[];let a=0,o=0;for(const l of e.matchAll(r)){const i=l.index??0;i>a&&(n.push({type:"text",key:`text-${o}`,text:e.slice(a,i)}),o+=1);const d=l[1],h=((s=l[2])==null?void 0:s.trim())??"";d==="PHOTO"&&h?n.push({type:"photo",key:`photo-${o}`,path:h}):d==="FILE"&&h?n.push({type:"file",key:`file-${o}`,path:h}):n.push({type:"text",key:`text-${o}`,text:l[0]}),o+=1,a=i+l[0].length}return a<e.length&&n.push({type:"text",key:`text-${o}`,text:e.slice(a)}),n}function er({text:e}){var a;const r=[];let n=0;for(const o of e.matchAll(pp)){const s=o[0],l=o.index??0,i=((a=s.match(fp))==null?void 0:a[0])??"",d=i?s.slice(0,-i.length):s;d&&(l>n&&r.push(e.slice(n,l)),r.push(t.jsx("a",{href:gp(d),target:"_blank",rel:"noreferrer",className:"thread-inline-link",children:d},`${l}-${d}`)),i&&r.push(i),n=l+s.length)}return n<e.length&&r.push(e.slice(n)),t.jsx(t.Fragment,{children:r.length>0?r:e})}var rl=c.memo(function({text:r,scrollRootRef:n,streaming:a=!1,containerClassName:o="",plainTextClassName:s="thread-graph-plain-text whitespace-pre-wrap break-words text-[15px] leading-6",markdownClassName:l="thread-graph-markdown",onBeforeResize:i,onOpenWorkspaceFile:d}){const h=c.useRef(null),u=c.useRef(null),[m,f]=c.useState(!1),p=np(r),g=!a&&r.length>ps,b=g&&!m?`${r.slice(0,ps).trimEnd()}
|
|
3648
|
+
|
|
3649
|
+
...`:r,[v,x]=c.useState(a||typeof IntersectionObserver>"u"),y=c.useCallback(()=>{const k=n.current,S=h.current,w=(S==null?void 0:S.getBoundingClientRect().top)??null;i==null||i(),u.current=k&&w!==null?{root:k,top:w}:null,f(N=>!N)},[i,n]);return c.useLayoutEffect(()=>{const k=u.current,S=h.current;if(!k||!S)return;u.current=null;const w=()=>{const C=S.getBoundingClientRect().top;k.root.scrollTop+=C-k.top};w();const N=window.requestAnimationFrame(w);return()=>{window.cancelAnimationFrame(N)}},[m]),c.useEffect(()=>{if(a||typeof IntersectionObserver>"u"){x(!0);return}if(v||!h.current)return;const k=new IntersectionObserver(S=>{for(const w of S)if(w.isIntersecting){x(!0),k.disconnect();break}},{root:n.current,threshold:0});return k.observe(h.current),()=>{k.disconnect()}},[v,n,a]),t.jsxs("div",{ref:h,className:o,children:[v&&p?t.jsx(mp,{content:b,className:l,onOpenWorkspaceFile:d}):t.jsx("p",{className:s,children:t.jsx(er,{text:b})}),g?t.jsx("button",{type:"button",onClick:y,className:"thread-graph-show-more timeline-meta-text mt-1.5 flex w-full items-center justify-center rounded-md border border-[var(--theme-border)] px-2 py-0.5 text-[10px] leading-4 transition hover:bg-[var(--theme-hover)] hover:text-[var(--theme-fg)]",children:m?"Show less":`Show more (${r.length.toLocaleString()} chars)`}):null]})}),bp=c.memo(function({text:r,scrollRootRef:n,streaming:a=!1,onBeforeResize:o,onOpenWorkspaceFile:s}){return t.jsx(rl,{text:r,scrollRootRef:n,streaming:a,containerClassName:"thread-graph-message-prose",...o?{onBeforeResize:o}:{},...s?{onOpenWorkspaceFile:s}:{}})}),vp=c.memo(function({threadId:r,text:n,attachmentPreviewUrls:a,getImageAssetUrl:o}){const s=c.useMemo(()=>xp(n),[n]);return t.jsx("div",{className:"thread-graph-message-prose whitespace-pre-wrap break-words text-[15px] leading-6",children:s.map(l=>{if(l.type==="text")return t.jsx("span",{children:l.text},l.key);if(l.type==="photo"){const d=(a==null?void 0:a[l.path])??(r?(o==null?void 0:o({threadId:r,path:l.path}))??null:null),h=fs(l.path)||"Attached image";return t.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:t.jsxs("span",{className:"inline-flex max-w-full flex-col rounded-[1rem] border border-sky-300/28 bg-sky-300/[0.08] p-1.5 shadow-sm shadow-stone-950/20",children:[d?t.jsx("img",{src:d,alt:h,className:"h-[4.5rem] w-[6rem] rounded-[0.75rem] bg-stone-950 object-contain",loading:"lazy"}):t.jsx("span",{className:"inline-flex h-[4.5rem] w-[6rem] items-center justify-center rounded-[0.75rem] bg-stone-950 text-[10px] text-sky-100",children:"PHOTO"}),t.jsx("span",{className:"mt-1 max-w-[7rem] truncate text-[10px] font-medium tracking-[0.08em] text-sky-50",title:l.path,children:h})]})},l.key)}const i=fs(l.path)||"Attached file";return t.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:t.jsxs("span",{className:"inline-flex max-w-[12rem] items-center gap-2 rounded-[0.95rem] border border-emerald-300/28 bg-emerald-300/[0.08] px-2.5 py-2 text-[10px] font-medium tracking-[0.08em] text-emerald-50 shadow-sm shadow-stone-950/20",title:l.path,children:[t.jsx("span",{className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/20 bg-emerald-300/12 text-[9px]",children:"FILE"}),t.jsx("span",{className:"min-w-0 truncate",children:i})]})},l.key)})})});function kp(){return t.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(e=>t.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-sky-200/90",style:{animationDelay:`${e*180}ms`}},e))})}function gs({status:e}){if(!e)return null;const r=e.toLowerCase(),n=r.includes("running")||r.includes("generating")||r.includes("steering"),a=r.includes("failed")||r.includes("error"),o=r.includes("accepted")||r.includes("complete"),s=n?"ui-status-warning":a?"ui-status-danger":o?"ui-status-success":"ui-status-neutral",l=n?t.jsx(B.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):a?t.jsx(B.XCircle,{className:"h-3.5 w-3.5"}):o?t.jsx(B.CheckCircle2,{className:"h-3.5 w-3.5"}):t.jsx(B.Circle,{className:"h-3.5 w-3.5"});return t.jsxs("span",{className:`thread-graph-message-status inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-normal ${s}`,title:e,"aria-label":`Status: ${e}`,children:[t.jsx("span",{className:"thread-graph-message-status-icon inline-flex shrink-0",children:n?t.jsx(kp,{}):l}),t.jsx("span",{className:"thread-graph-status-label",children:e})]})}function wp({children:e,copyButton:r,kind:n,metaControl:a,reasoning:o,status:s,timeLabel:l,timeTitle:i}){const d=n==="userMessage",h=l?t.jsx("time",{dateTime:i??void 0,title:i??void 0,className:"thread-graph-message-time text-[10px] leading-none sm:text-[11px]",children:l}):null;return t.jsx("div",{"data-testid":"chat-message","data-role":d?"user":"assistant",className:"thread-graph-message flex justify-start",children:t.jsxs("div",{className:`thread-graph-message-bubble min-w-0 w-full max-w-full ${d?"is-user":"is-assistant"}`,children:[d?null:t.jsxs("div",{className:"thread-graph-message-header mb-2 flex min-w-0 items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[t.jsx("span",{className:"thread-graph-message-sender rounded-full px-2.5 py-1 text-xs font-semibold tracking-[0.02em]",children:"Assistant"}),t.jsx(gs,{status:s??"Complete"})]}),a?t.jsx("div",{className:"thread-graph-message-header-meta flex min-w-0 flex-1 justify-center",children:a}):null,r||h?t.jsxs("div",{className:"thread-graph-message-header-actions flex shrink-0 items-center gap-1.5 sm:gap-2",children:[r,h]}):null]}),o,t.jsx("div",{className:`thread-graph-message-content min-w-0 ${d?"is-user":"is-assistant"}`,children:e}),d&&(s||h)?t.jsxs("div",{className:"mt-1 flex items-center justify-end gap-2",children:[s?t.jsx(gs,{status:s}):null,h]}):null]})})}vr();function yp(e){if(!e)return!1;const r=e.toLowerCase();return r.includes("running")||r.includes("inprogress")||r.includes("in_progress")}function jp({tone:e="amber"}){const r=e==="sky"?"bg-sky-300/90":"bg-amber-200/90";return t.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>t.jsx("span",{className:`h-1.5 w-1.5 animate-pulse rounded-full ${r}`,style:{animationDelay:`${n*180}ms`}},n))})}var Dt=c.memo(function({threadId:r,item:n,scrollRootRef:a,streaming:o=!1,adapter:s,timeLabel:l,timeTitle:i,onBeforeMessageResize:d}){const[h,u]=c.useState("idle"),[m,f]=c.useState(!1),p=c.useRef(null),g=n.kind==="agentMessage"?n.reasoningItems??[]:[],b=g.map(C=>C.text.trim()).filter(Boolean).join(`
|
|
3650
|
+
|
|
3651
|
+
`),v=n.kind==="userMessage"&&(n.status==="Steering"||n.status==="Accepted"||n.status==="Awaiting response");c.useEffect(()=>()=>{p.current!==null&&window.clearTimeout(p.current)},[]);async function x(){try{await navigator.clipboard.writeText(n.text),u("copied"),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>u("idle"),1200)}catch{u("failed"),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>u("idle"),1600)}}function y(){d==null||d(),f(C=>!C)}const k=n.kind==="agentMessage"?t.jsx("button",{type:"button","aria-label":"Copy agent reply",title:h==="copied"?"Copied":h==="failed"?"Copy failed":"Copy agent reply",onClick:()=>void x(),className:`thread-graph-message-copy inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border transition ${h==="copied"?"ui-status-info":h==="failed"?"ui-status-danger":""}`,children:t.jsx(B.Copy,{className:"h-3.5 w-3.5"})}):null,S=g.some(C=>yp(C.status)),w=n.kind==="agentMessage"&&b?t.jsxs("button",{type:"button","aria-label":m?"Hide chain of thought":"Show chain of thought","aria-expanded":m,title:m?"Hide CoT":"Show CoT",onClick:y,className:`thread-graph-thinking-toggle inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border px-2 text-xs font-medium transition ${m?"is-open":""}`,children:[t.jsx(B.Brain,{className:`h-3.5 w-3.5 ${S?"animate-pulse":""}`}),t.jsx("span",{children:"CoT"}),S?t.jsx(jp,{tone:"sky"}):null]}):null,N=n.kind==="agentMessage"&&b?t.jsx("div",{className:"thread-graph-message-thinking mb-3",children:t.jsx(gr,{type:"single",collapsible:!0,className:"thread-graph-thinking-accordion w-full border-none",onValueChange:C=>f(!!C),...m?{value:"thoughts"}:{},children:t.jsx(xr,{value:"thoughts",className:"border-b-0",children:t.jsx(br,{className:"thread-graph-thinking-content pb-0",children:t.jsx("pre",{className:"thread-graph-thinking-body my-1 max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-xl border p-3 text-[12px] leading-5",children:t.jsx(er,{text:b})})})})})}):null;return t.jsx(wp,{kind:n.kind,status:v||n.kind==="agentMessage"?n.status:null,copyButton:k,metaControl:w,reasoning:N,timeLabel:l,timeTitle:i,children:n.kind==="agentMessage"?t.jsx(bp,{text:n.text,scrollRootRef:a,streaming:o,...d?{onBeforeResize:d}:{},...s!=null&&s.onOpenWorkspaceFile?{onOpenWorkspaceFile:s.onOpenWorkspaceFile}:{}}):t.jsx(vp,{threadId:r,text:n.text,attachmentPreviewUrls:n.attachmentPreviewUrls,getImageAssetUrl:s==null?void 0:s.getImageAssetUrl})})});function xs(e){return e.replace(/"/g,'"').replace(/'/g,"'").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function nl(e){const r=e.trim().match(/^<hook_prompt(?:\s+hook_run_id="([^"]+)")?>([\s\S]*)<\/hook_prompt>$/);if(!r)return null;const n=r[1]?xs(r[1]):null,a=xs(r[2]??"").trim(),o=(n==null?void 0:n.split(":")[0])??"hook",s=o==="stop"?"Stop":o,l=(n==null?void 0:n.split(":").slice(2).join(":"))||null;return{id:`live-hook-prompt:${n??"unknown"}`,kind:"hook",text:`${s} hook`,previewText:a||`${s} hook`,detailText:a||null,status:"Completed",hookEventName:o,hookEventLabel:s,hookHandlerType:"command",hookScope:"turn",hookSource:l?"project":null,hookSourcePath:l,hookStatusMessage:null,hookOutputEntries:a?[{kind:"warning",text:a}]:[]}}function Np(e){return e==="userMessage"||e==="agentMessage"}function Cp(e){return e==="commandExecution"||e==="webSearch"||e==="fileRead"||e==="fileChange"||e==="image"||e==="contextCompaction"}function Sp(e){return e==="agentMessage"||e==="reasoning"||e==="agentToolCall"||e==="skillToolCall"||e==="toolCall"||e==="plan"}function Tp(e,r){if(!r)return e;const n=[...e],a=n.findIndex(s=>s.kind==="userMessage");if(a<0)return n;for(let s=a+1;s<n.length;s+=1){const l=n[s];if(!l||l.kind!=="userMessage")continue;let i=s+1;for(;i<n.length&&Cp(n[i].kind);)i+=1;if(i===s+1)continue;const[d]=n.splice(s,1);n.splice(i-1,0,d),s=i-1}let o=!1;return n.map((s,l)=>s.kind!=="userMessage"?s:o?n.slice(l+1).some(d=>Sp(d.kind))?s:{...s,status:"Awaiting response"}:(o=!0,s))}function yt(e){return typeof e.sequence=="number"&&Number.isFinite(e.sequence)}function Cr(e){return yt(e)?e.sequence:Number.POSITIVE_INFINITY}function bs(e){var h;const r=[];let n=0;for(;n<e.length&&((h=e[n])==null?void 0:h.kind)==="userMessage"&&!yt(e[n]);)r.push(e[n]),n+=1;const a=e.slice(n);if(!a.some(yt))return e;const o=a.map(u=>Cr(u)).filter(Number.isFinite),s=o.length>0?Math.max(...o):0,l=[];let i=0;for(;i<a.length;){const u=a[i];if(yt(u)){l.push({item:u,index:i,order:Cr(u)}),i+=1;continue}const m=i;for(;i<a.length&&!yt(a[i]);)i+=1;const f=a.slice(m,i),p=[...a.slice(0,m)].reverse().find(yt),g=a.slice(i).find(yt),b=p?Cr(p):null,v=g?Cr(g):null;f.forEach((x,y)=>{let k;if(b===null&&v!==null)k=v-(f.length-y)/(f.length+1);else if(b!==null&&v!==null&&v>b){const S=v-b;k=b+(y+1)/(f.length+1)*S}else k=s+1+y/(f.length+1);l.push({item:x,index:m+y,order:k})})}const d=l.sort((u,m)=>{const f=u.order-m.order;return f===0?u.index-m.index:f}).map(u=>u.item);return[...r,...d]}function Ep(e,r){if(!r||r.length===0)return bs(e);const n=new Map(r.map(s=>[s.id,s])),a=e.map(s=>{const l=n.get(s.id);if(!l)return s;n.delete(s.id);const i={...s,...l,text:l.text||s.text},d=l.detailText??s.detailText,h=l.previewText??s.previewText,u=l.status??s.status,m=l.sequence??s.sequence;return d!==void 0&&(i.detailText=d),h!==void 0&&(i.previewText=h),u!==void 0&&(i.status=u),m!==void 0&&(i.sequence=m),i}),o=[...n.values()];return o.length===0&&!a.some(yt)||(a.push(...o),!a.some(s=>typeof s.sequence=="number"&&Number.isFinite(s.sequence)))?a:bs(a)}function Lp(e,r){if(!e)return"";const n=r.filter(d=>d.kind==="agentMessage").map(d=>d.text).filter(d=>d.length>0),a=n.at(-1)??"";if(a){const d=e.lastIndexOf(a);if(d>=0){const h=e.slice(d+a.length);return h.trim()?h:""}}const o=n.join("");if(!o)return e;const s=Math.min(e.length,o.length);let l=0;for(;l<s&&e[l]===o[l];)l+=1;if(l===0)return e;const i=e.slice(l);return i.trim()?i:""}function al(e){if(!e)return!1;const r=e.toLowerCase();return r.includes("running")||r.includes("inprogress")||r.includes("in_progress")}function Dr(e){return e==="inProgress"||e==="sending"}function Pp(e){var d,h;const r=[];let n=0;const a=new Set,o=[];function s(){const u=r.at(-1);return(u==null?void 0:u.kind)!=="item"||u.item.kind!=="agentMessage"?null:u}function l(u,m){if(m.length!==0){u.item={...u.item,reasoningItems:[...u.item.reasoningItems??[],...m]};for(const f of m)a.add(f.id)}}function i(){const u=o.splice(0);for(const m of u)r.push({kind:"item",key:m.id,item:m})}for(;n<e.length;){const u=e[n];if(!u)break;if(a.has(u.id)){n+=1;continue}if(u.kind==="reasoning"){let p=n;const g=[];for(;p<e.length&&((d=e[p])==null?void 0:d.kind)==="reasoning";)g.push(e[p]),p+=1;const b=s();b?l(b,g):o.push(...g),n=p;continue}if(u.kind==="agentMessage"){const p=o.splice(0),g={kind:"item",key:u.id,item:u};l(g,p),r.push(g),n+=1;continue}if(u.kind!=="commandExecution"&&u.kind!=="fileChange"&&u.kind!=="webSearch"&&u.kind!=="fileRead"){r.push({kind:"item",key:u.id,item:u}),n+=1;continue}const m=[];for(;n<e.length&&((h=e[n])==null?void 0:h.kind)===u.kind;)m.push(e[n]),n+=1;if(m.length===1){r.push({kind:"item",key:m[0].id,item:m[0]});continue}const f=m.map(p=>p.id).join(":");if(u.kind==="commandExecution"){r.push({kind:"commandGroup",key:f,items:m});continue}if(u.kind==="fileChange"){r.push({kind:"fileChangeGroup",key:f,items:m});continue}if(u.kind==="fileRead"){r.push({kind:"fileReadGroup",key:f,items:m});continue}r.push({kind:"searchGroup",key:f,items:m})}return i(),r}function sl(e,r){return[...e.map(n=>({id:n.id,startedAt:n.startedAt??""})),...r?[{id:r.id,startedAt:r.startedAt??""}]:[]]}function hr(e,r,n){const a=e.get(r)??[];a.push(n),e.set(r,a)}function ol(e,r){return e.find(n=>r&&n.startedAt&&r.localeCompare(n.startedAt)<=0)}function Ip({answeredRequestNotes:e,pendingRequests:r,visibleTurns:n,optimisticTurn:a}){const o=new Set(n.map(p=>p.id)),s=new Map,l=new Map,i=[],d=[];for(const p of e)p.turnId&&o.has(p.turnId)?hr(s,p.turnId,p):i.push(p);for(const p of r)p.turnId&&o.has(p.turnId)?hr(l,p.turnId,p):d.push(p);const h=sl(n,a),u=new Map,m=[],f=[...i.map(p=>({kind:"note",id:p.id,createdAt:p.createdAt??"",note:p})),...d.map(p=>({kind:"request",id:p.id,createdAt:p.createdAt,request:p}))].sort((p,g)=>p.createdAt.localeCompare(g.createdAt));for(const p of f){const g=ol(h,p.createdAt);if(!g){m.push(p);continue}hr(u,g.id,p)}return{notesByTurnId:s,pendingRequestsByTurnId:l,beforeTurnId:u,trailing:m}}function zp({activityNotes:e,visibleTurns:r,optimisticTurn:n}){const a=[...e].sort((m,f)=>m.createdAt.localeCompare(f.createdAt)),o=sl(r,n),s=[],l=new Map,i=new Map,d=[],u=o.map(m=>m.startedAt).filter(m=>!!m).sort().at(-1)??null;for(const m of a){if(m.anchorTurnId==="__leading__"){s.push(m);continue}if(m.anchorTurnId){o.some(p=>p.id===m.anchorTurnId)?hr(i,m.anchorTurnId,m):s.push(m);continue}const f=ol(o,m.createdAt);if(!f){!u||m.createdAt.localeCompare(u)<=0?s.push(m):d.push(m);continue}hr(l,f.id,m)}return{leading:s,beforeTurnId:l,afterTurnId:i,trailing:d}}function ll({request:e,busy:r=!1,onRespond:n}){const[a,o]=c.useState({}),[s,l]=c.useState({}),[i,d]=c.useState(null),h=e.questions[0]??null,u="__other__",m=e.kind==="planDecision"?"Plan":e.kind==="requestUserInput"?"Answer Required":e.title;function f(x){const y=/\s*\(recommended\)\s*$/i.test(x);return{rawLabel:x,displayLabel:x.replace(/\s*\(recommended\)\s*$/i,"").trim(),recommended:y}}function p(x){h&&(d(x),n==null||n(e.id,{answers:{[h.id]:{answers:[x]}}}))}function g(x){const y=a[x.id]??"";return Array.isArray(y)?y.map(k=>k===u?(s[x.id]??"").trim():k.trim()).filter(Boolean).join(", "):y===u?(s[x.id]??"").trim():y.trim()}function b(x){const y=a[x.id]??"";if(Array.isArray(y))return y.map(S=>S===u?(s[x.id]??"").trim():S.trim()).filter(Boolean);if(y===u){const S=(s[x.id]??"").trim();return S?[S]:[]}const k=y.trim();return k?[k]:[]}function v(x,y){o(k=>{const S=k[x],w=Array.isArray(S)?S:[],N=w.includes(y)?w.filter(C=>C!==y):[...w,y];return{...k,[x]:N}})}return t.jsxs("div",{className:"timeline-pending-card w-full rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem] sm:px-4",children:[t.jsx("div",{className:"flex items-center justify-between gap-3",children:t.jsxs("div",{children:[t.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:m}),e.kind!=="planDecision"&&e.description&&t.jsx("p",{className:"timeline-soft-text mt-1 text-[13px] leading-5",children:e.description})]})}),t.jsx("div",{className:"mt-3 space-y-3",children:e.questions.map(x=>t.jsxs("div",{className:"timeline-question-section rounded-xl border p-2.5 sm:p-3",children:[t.jsx("p",{className:"timeline-meta-text text-xs uppercase tracking-[0.2em]",children:x.header}),t.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5 sm:text-sm",children:x.question}),e.kind==="planDecision"&&x.options&&x.options.length>0?t.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:x.options.map((y,k)=>{const S=f(y.label),w=S.displayLabel.toLowerCase()==="implement";return t.jsxs("button",{type:"button",disabled:r,onClick:()=>p(y.label),className:`relative rounded-2xl border px-2.5 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${k===0?"ui-action-info":"border-stone-700 text-stone-200 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:y.description,children:[S.recommended?t.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/18 text-[10px] leading-none text-current",children:"✦"}):null,r&&i===y.label?w?"Starting...":"Saving...":S.displayLabel]},y.label)})}):x.options&&x.options.length>0?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[x.options.map(y=>{const k=f(y.label),S=a[x.id];return t.jsxs("button",{type:"button",disabled:r,onClick:()=>x.multiSelect?v(x.id,y.label):o(w=>({...w,[x.id]:y.label})),className:`relative rounded-2xl border px-3 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${(x.multiSelect?Array.isArray(S)&&S.includes(y.label):S===y.label)?"ui-status-warning":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:y.description,children:[k.recommended?t.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/10 text-[10px] leading-none text-amber-100/90",children:"✦"}):null,k.displayLabel]},y.label)}),x.isOther&&(()=>{const y=a[x.id];return t.jsx("button",{type:"button",disabled:r,onClick:()=>x.multiSelect?v(x.id,u):o(k=>({...k,[x.id]:u})),className:`rounded-2xl border px-3 py-1.5 text-[12px] leading-4 transition sm:text-[13px] ${(x.multiSelect?Array.isArray(y)&&y.includes(u):y===u)?"ui-status-info":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Not from above"})})()]}),x.isOther&&(()=>{const y=a[x.id];return(x.multiSelect?Array.isArray(y)&&y.includes(u):y===u)?t.jsx("input",{"aria-label":`${x.header} custom answer`,value:s[x.id]??"",onChange:S=>l(w=>({...w,[x.id]:S.target.value})),placeholder:"Enter a custom answer",className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-sky-300"}):null})()]}):t.jsx("input",{"aria-label":x.header,value:a[x.id]??"",onChange:y=>o(k=>({...k,[x.id]:y.target.value})),className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-amber-300"})]},x.id))}),e.kind!=="planDecision"&&t.jsx("div",{className:"mt-3 flex justify-end",children:t.jsx("button",{type:"button",disabled:r||e.questions.some(x=>!g(x)),onClick:()=>void(n==null?void 0:n(e.id,{answers:Object.fromEntries(e.questions.map(x=>[x.id,{answers:b(x)}]))})),className:"ui-action-info rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:r?"Submitting...":"Submit"})})]})}function il({note:e}){return t.jsxs("div",{className:"timeline-note-card w-full rounded-2xl border px-3 py-2.5",children:[t.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:e.title}),t.jsx("div",{className:"mt-1 space-y-1",children:e.summaryLines.map((r,n)=>t.jsxs("p",{className:"timeline-primary-text text-[13px] leading-5",children:["You selected ",r]},`${e.id}-${n}`))})]})}function dl({note:e,onOpenThread:r,onOpenLinkedThread:n}){const a=e.kind==="forkCreated"?"Fork":e.kind==="forkSource"?"Fork source":"System",o=e.kind==="forkCreated"?`Thread forked from Turn ${e.turnIndex??"?"}`:e.kind==="forkSource"?`Forked from ${e.linkedThreadTitle??"source thread"} at Turn ${e.turnIndex??"?"}`:e.text??"";return t.jsxs("div",{className:"timeline-activity-card w-full rounded-2xl border px-3 py-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:a}),t.jsx("time",{dateTime:e.createdAt,title:Qt(e.createdAt),className:"timeline-meta-text text-[10px]",children:$t(e.createdAt)})]}),t.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5",children:o}),e.linkedThreadId?t.jsx("button",{type:"button",onClick:()=>{const s=e.linkedThreadId;s&&(n==null||n(s),r==null||r(s))},className:"relative z-10 mt-2 inline-flex cursor-pointer rounded-full border border-amber-300/30 px-3 py-1.5 text-xs text-amber-100 transition hover:bg-amber-300/10",children:e.kind==="forkCreated"?"Open fork":"Back to source"}):null]})}function or({notes:e,onOpenThread:r,onOpenLinkedThread:n}){return e.length===0?null:t.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:e.map(a=>t.jsx(dl,{note:a,onOpenThread:r,onOpenLinkedThread:n},a.id))})}function Fn({entries:e,respondingRequestId:r,onRespondToRequest:n}){return e.length===0?null:t.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:e.map(a=>a.kind==="note"?t.jsx(il,{note:a.note},a.id):t.jsx(ll,{request:a.request,busy:r===a.request.id,onRespond:n},a.id))})}function Rp({notes:e,requests:r,respondingRequestId:n,onRespondToRequest:a}){const o=[...e.map(s=>({kind:"note",id:s.id,createdAt:s.createdAt??"",note:s})),...r.map(s=>({kind:"request",id:s.id,createdAt:s.createdAt,request:s}))].sort((s,l)=>s.createdAt.localeCompare(l.createdAt));return t.jsx(Fn,{entries:o,respondingRequestId:n,onRespondToRequest:a})}function Mp({entries:e,respondingRequestId:r,onRespondToRequest:n,onOpenThread:a,onOpenLinkedThread:o}){return e.length===0?null:t.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:[...e].sort((s,l)=>s.createdAt.localeCompare(l.createdAt)).map(s=>s.kind==="activity"?t.jsx(dl,{note:s.note,onOpenThread:a,onOpenLinkedThread:o},s.id):s.kind==="note"?t.jsx(il,{note:s.note},s.id):t.jsx(ll,{request:s.request,busy:r===s.request.id,onRespond:n},s.id))})}function _p({entries:e,expandedGroups:r,onToggleGroupedItem:n,renderCommandGroup:a,renderFileChangeGroup:o,renderFileReadGroup:s,renderItem:l,renderSearchGroup:i}){return t.jsx(t.Fragment,{children:e.map(d=>{const h=r[d.key]??!1,u=()=>n(d.key);return d.kind==="commandGroup"?a(d,h,u):d.kind==="fileChangeGroup"?o(d,h,u):d.kind==="searchGroup"?i(d,h,u):d.kind==="fileReadGroup"?s(d,h,u):l(d)})})}function qr({children:e,className:r,count:n,countBadgeClassName:a,desktopIconClassName:o,expanded:s,expandedListClassName:l,icon:i,onToggleExpanded:d,runningIndicator:h,summary:u,toggleAriaLabel:m,trailingSummary:f}){return t.jsx("div",{className:`thread-graph-history-group ${r} relative min-w-0 w-full overflow-hidden rounded-[0.9rem] border px-3 py-2.5`,children:t.jsxs("div",{className:"flex items-start gap-2.5",children:[t.jsxs("div",{className:"thread-graph-history-group-icon mt-0.5 flex shrink-0 items-center",children:[t.jsxs("span",{className:`relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border shadow-sm shadow-stone-950/20 ${o}`,children:[i,t.jsx("span",{className:`absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 ${a}`,children:n})]}),h]}),t.jsxs("div",{className:"thread-graph-history-group-card min-w-0 flex-1 rounded-[0.85rem] border px-3 py-2",children:[t.jsxs("button",{type:"button","aria-expanded":s,"aria-label":m,onClick:d,className:"thread-graph-history-group-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:[t.jsx("div",{className:"thread-graph-history-group-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:u}),f]}),s?t.jsx("div",{className:`thread-graph-history-group-list mt-3 space-y-2 border-t pt-3 ${l}`,children:e}):null]})]})})}vr();St();var Ap=fr("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium outline-none transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Xr({asChild:e=!1,className:r,variant:n,...a}){const o=e?Ps:"span";return t.jsx(o,{"data-slot":"badge",className:nt(Ap({variant:n,className:r})),...a})}function Yr(e){if(!e)return!1;const r=e.trim().toLowerCase();return r==="running"||r==="in_progress"||r==="in progress"||r==="pending"}function $p(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),t.jsx("path",{d:"M9 2.75v2h2"}),t.jsx("path",{d:"M6.2 8h3.6"}),t.jsx("path",{d:"M6.2 10h1.7"})]})}function Dp(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),t.jsx("path",{d:"M9 2.75v2h2"}),t.jsx("path",{d:"M6.15 7.25h3.7"}),t.jsx("path",{d:"M6.15 9.25h2.8"}),t.jsx("path",{d:"m10.4 10.7 1.2 1.2"}),t.jsx("circle",{cx:"9.25",cy:"9.55",r:"1.45"})]})}function Bp(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("rect",{x:"2.75",y:"3",width:"8.5",height:"3",rx:"1.1"}),t.jsx("rect",{x:"4.25",y:"6.5",width:"8.5",height:"3",rx:"1.1"}),t.jsx("rect",{x:"5.75",y:"10",width:"7.5",height:"3",rx:"1.1"}),t.jsx("path",{d:"m6.25 4.5 1 1-1 1"}),t.jsx("path",{d:"M7.9 5.5h1.7"}),t.jsx("path",{d:"m7.75 8 1 1-1 1"}),t.jsx("path",{d:"M9.4 9h1.7"})]})}function Gp(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("circle",{cx:"6",cy:"6",r:"2.3"}),t.jsx("path",{d:"m8 8 1.6 1.6"}),t.jsx("circle",{cx:"9.3",cy:"8.8",r:"2"}),t.jsx("path",{d:"m10.75 10.25 1.65 1.65"}),t.jsx("circle",{cx:"11.2",cy:"4.75",r:"1.8"}),t.jsx("path",{d:"m12.45 6 1.1 1.1"})]})}function Fp(e){const r=e.trim();if(!r)return"";const n=r.match(/(, \+\d+ more.*)$/),a=(n==null?void 0:n[1])??"",s=(a?r.slice(0,-a.length):r).replace(/\\/g,"/");if(!s.startsWith("/"))return`${s.replace(/^\.\//,"")}${a}`;const l=["/apps/","/packages/","/src/","/test/","/tests/","/docs/","/config/","/scripts/","/e2e/","/.agents/","/.codex/"];for(const i of l){const d=s.indexOf(i);if(d>=0)return`${s.slice(d+1)}${a}`}return r}function cl(e,r=42){const n=Fp(e);if(!n)return"";const a=n.match(/(, \+\d+ more.*)$/),o=(a==null?void 0:a[1])??"",s=o?n.slice(0,-o.length):n;if(s.length<=r)return`${s}${o}`;const i=s.replace(/\\/g,"/").split("/").filter(Boolean);if(i.length>1){const d=[];let h=o.length+4;for(let u=i.length-1;u>=0;u-=1){const m=i[u],f=h+m.length+(d.length>0?1:0);if(d.length>0&&f>r)break;d.unshift(m),h=f}if(d.length>0)return`.../${d.join("/")}${o}`}return`...${s.slice(-(r-o.length-3))}${o}`}function Hp(e){var a;const r=[];if(typeof e.changedFiles=="number"&&e.changedFiles>0&&r.push(`${e.changedFiles} ${e.changedFiles===1?"file":"files"}`),typeof e.addedLines=="number"&&e.addedLines>0&&r.push(`+${e.addedLines}`),typeof e.removedLines=="number"&&e.removedLines>0&&r.push(`-${e.removedLines}`),r.length>0)return r;const n=(a=e.previewText)==null?void 0:a.trim();return n?n.replace(/\bfiles changed\b/gi,"files").replace(/\bfile changed\b/gi,"file").split("·").map(o=>o.trim()).filter(Boolean):[]}function Hn({tone:e="amber"}){const r=e==="emerald"?"bg-sky-200/90":e==="sky"?"bg-sky-300/90":"bg-amber-200/90";return t.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>t.jsx("span",{className:`h-1.5 w-1.5 animate-pulse rounded-full ${r}`,style:{animationDelay:`${n*180}ms`}},n))})}function Op(e){var n;const r=e.replace(/\r\n/g,`
|
|
3652
|
+
`).split(`
|
|
3653
|
+
`);for(;r.length>1&&((n=r.at(-1))==null?void 0:n.trim())==="";)r.pop();return r}function pt(e){const r=Op(e);return r.length===1?{firstLine:r[0]??"",showGap:!1,isTruncated:!1}:{firstLine:r[0]??"",showGap:!0,isTruncated:!0}}function hl(e){const r=(e==null?void 0:e.trim().toLowerCase())??"";return r==="completed"||r==="complete"||r==="success"||r==="succeeded"?{className:"is-completed",icon:t.jsx(B.CheckCircle2,{className:"h-3.5 w-3.5"}),label:"Completed"}:r==="failed"||r==="failure"||r==="error"||r==="errored"?{className:"is-failed",icon:t.jsx(B.XCircle,{className:"h-3.5 w-3.5"}),label:"Failed"}:Yr(e)?{className:"is-pending",icon:t.jsx(B.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),label:(e==null?void 0:e.trim())||"Running"}:{className:"is-neutral",icon:null,label:(e==null?void 0:e.trim())||"Event"}}function Wp(e){switch(e){case"command":return"is-command";case"tool":return"is-tool";case"agent":return"is-agent";case"skill":return"is-skill";case"search":return"is-search";case"fileRead":return"is-file-read"}}function Up(e){switch(e){case"plan":return"is-plan";case"context":return"is-context";case"generic":return"is-generic";case"image":return"is-image";case"fileChange":return"is-file-change";case"artifact":return"is-artifact";case"hook":return"is-hook"}}function Ft({actions:e,children:r,className:n,headerMeta:a,icon:o,item:s,title:l,tone:i}){const d=hl(s.status);return t.jsxs("div",{className:`thread-graph-event thread-graph-history-event ${Up(i)} ${n??""}`,children:[t.jsx("div",{className:"thread-graph-history-event-icon","aria-hidden":"true",children:o}),t.jsxs("div",{className:"thread-graph-history-event-card",children:[t.jsxs("div",{className:"thread-graph-history-event-header",children:[t.jsxs("div",{className:"thread-graph-history-event-heading flex min-w-0 items-center gap-2",children:[t.jsx("span",{className:"thread-graph-history-event-title min-w-0 truncate font-mono text-sm font-semibold",children:l}),s.status?t.jsxs(Xr,{variant:"outline",className:`thread-graph-tool-badge ${d.className} rounded-full px-2 py-0.5 text-xs font-normal`,title:d.label,"aria-label":`Status: ${d.label}`,children:[d.icon,t.jsx("span",{className:"thread-graph-status-label",children:d.label})]}):null,a]}),e?t.jsx("div",{className:"thread-graph-history-event-actions",children:e}):null]}),r?t.jsx("div",{className:"thread-graph-history-event-body",children:r}):null]})]})}function rr({actionLabel:e="Open details",actionTitle:r,className:n,details:a,icon:o,item:s,onOpen:l,preview:i,title:d,tone:h}){const u=hl(s.status),[m,f]=c.useState(Yr(s.status)?"item-1":void 0);return t.jsx("div",{className:`thread-graph-event thread-graph-history-tool ${Wp(h)} ${n??""}`,children:t.jsx(gr,{type:"single",collapsible:!0,onValueChange:p=>f(p||void 0),className:"thread-graph-tool-accordion thread-graph-history-tool-accordion w-full overflow-hidden rounded-lg border",...m!==void 0?{value:m}:{},children:t.jsxs(xr,{value:"item-1",className:"border-0",children:[t.jsx(Vr,{"aria-label":`${m==="item-1"?"Collapse":"Expand"} ${d} history item`,className:"thread-graph-tool-trigger thread-graph-history-tool-trigger px-4 py-3 hover:no-underline",children:t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t.jsx("span",{className:"thread-graph-history-tool-icon shrink-0",children:o}),t.jsx("span",{className:"min-w-0 truncate font-mono text-sm font-semibold",children:d}),t.jsxs(Xr,{variant:"outline",className:`thread-graph-tool-badge ${u.className} ml-1 sm:ml-2 rounded-full px-2 py-0.5 text-xs font-normal`,title:u.label,"aria-label":`Status: ${u.label}`,children:[u.icon,t.jsx("span",{className:"thread-graph-status-label",children:u.label})]})]})}),t.jsxs(br,{className:"thread-graph-tool-content thread-graph-history-tool-content px-4 pb-4 pt-1",children:[t.jsxs("section",{children:[t.jsx("h4",{children:"Summary"}),t.jsxs("div",{className:"thread-graph-history-tool-summary",children:[t.jsx(er,{text:i.firstLine}),i.showGap?t.jsx("span",{className:"thread-graph-history-tool-ellipsis",children:"..."}):null]})]}),a?t.jsx("section",{children:a}):null,t.jsxs("button",{type:"button","aria-label":e,onClick:l,className:"thread-graph-history-tool-open inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition",children:[t.jsx(B.ExternalLink,{className:"h-3.5 w-3.5"}),r]})]})]})})})}var Vp=c.memo(function({item:r,scrollRootRef:n,onBeforeResize:a}){return t.jsx(Ft,{className:"thread-graph-event-plan",icon:t.jsx(B.ClipboardList,{className:"h-4 w-4"}),item:r,title:"plan",tone:"plan",children:t.jsx("div",{className:"thread-graph-history-event-prose",children:t.jsx(rl,{text:r.text,scrollRootRef:n,plainTextClassName:"thread-graph-plain-text whitespace-pre-wrap break-words text-sm leading-6",markdownClassName:"thread-graph-markdown text-sm",...a?{onBeforeResize:a}:{}})})})}),Kp=c.memo(function({item:r}){const n=Yr(r.status)||r.text==="Compacting context",a=n?"Compacting context":"Context compacted",o=r.detailText&&r.detailText!==a?r.detailText:null;return t.jsxs(Ft,{className:"thread-graph-event-context",icon:t.jsx(B.Archive,{className:"h-4 w-4"}),item:r,title:"context",tone:"context",children:[t.jsxs("div",{className:"thread-graph-history-event-line",children:[t.jsx("span",{className:"thread-graph-history-event-primary",children:a}),n?t.jsx(Hn,{tone:"emerald"}):null]}),o?t.jsx("p",{className:"thread-graph-history-event-secondary",title:o,children:o}):null]})}),qp=c.memo(function({item:r}){return t.jsx(Ft,{className:"thread-graph-event-generic",icon:t.jsx(B.Info,{className:"h-4 w-4"}),item:r,title:r.kind,tone:"generic",children:t.jsx("pre",{className:"thread-graph-history-event-pre",children:t.jsx(er,{text:r.text})})})}),Xp=c.memo(function({item:r,onOpen:n}){const a=pt(r.previewText??r.text);return t.jsx(rr,{actionLabel:"Open full command",actionTitle:"Command Output",className:"thread-graph-event-command",icon:t.jsx(B.Terminal,{className:"h-4 w-4"}),item:r,onOpen:()=>n(r,"Command Output"),preview:a,title:"command",tone:"command"})}),Yp=c.memo(function({item:r,onOpen:n}){const a=pt(r.text);return t.jsx(rr,{actionLabel:"Open full tool call",actionTitle:"Tool Call Details",className:"thread-graph-event-tool",icon:t.jsx(B.Wrench,{className:"h-4 w-4"}),item:r,onOpen:()=>n(r,"Tool Call Details"),preview:a,title:"tool_call",tone:"tool"})}),Zp=c.memo(function({item:r,onOpen:n}){const a=pt(r.text);return t.jsx(rr,{actionLabel:"Open agent details",actionTitle:"Agent Details",className:"thread-graph-event-agent-tool",icon:t.jsx(B.Bot,{className:"h-4 w-4"}),item:r,onOpen:()=>n(r,"Agent Details"),preview:a,title:"agent",tone:"agent"})}),Jp=c.memo(function({item:r,onOpen:n}){const a=pt(r.text);return t.jsx(rr,{actionLabel:"Open skill details",actionTitle:"Skill Details",className:"thread-graph-event-skill-tool",icon:t.jsx(B.Sparkles,{className:"h-4 w-4"}),item:r,onOpen:()=>n(r,"Skill Details"),preview:a,title:"skill",tone:"skill"})}),Qp=c.memo(function({item:r,onOpen:n}){var l,i;const a=((l=r.previewText)==null?void 0:l.trim())||r.text||"Web search",o=((i=r.detailText)==null?void 0:i.trim())||r.text||"Web search",s=pt(a);return t.jsx(rr,{actionLabel:"Open full web search",actionTitle:"Web Search Details",className:"thread-graph-event-search",icon:t.jsx(B.Search,{className:"h-4 w-4"}),item:r,onOpen:()=>n("Web Search Details",o),preview:s,title:"web_search",tone:"search"})}),ef=c.memo(function({item:r,onOpen:n}){var l,i;const a=((l=r.previewText)==null?void 0:l.trim())||r.text||"File read",o=((i=r.detailText)==null?void 0:i.trim())||r.text||"File read",s=pt(a);return t.jsx(rr,{actionLabel:"Open full file read",actionTitle:"File Read Details",className:"thread-graph-event-file-read",icon:t.jsx(B.FileText,{className:"h-4 w-4"}),item:r,onOpen:()=>n("File Read Details",o),preview:s,title:"file_read",tone:"fileRead"})}),tf=c.memo(function({threadId:r,item:n,onOpen:a,getImageAssetUrl:o}){const s=n.assetPath??n.detailText??null,l=r&&s?(o==null?void 0:o({threadId:r,path:s}))??null:null;return t.jsxs(Ft,{className:"thread-graph-event-image",icon:t.jsx(B.Image,{className:"h-4 w-4"}),item:n,title:"image",tone:"image",children:[l?t.jsx("button",{type:"button",onClick:()=>a("Image Path",s??n.text),className:"block w-full text-left",children:t.jsx("img",{src:l,alt:n.text||"Image preview",className:"thread-graph-history-event-image",loading:"lazy"})}):t.jsx("div",{className:"thread-graph-history-event-summary",children:n.text}),s?t.jsx("button",{type:"button",onClick:()=>a("Image Path",s),className:"thread-graph-history-event-path",title:s,children:s}):null]})}),rf=c.memo(function({item:r,onOpen:n}){var u,m,f;const a=(u=r.previewText)!=null&&u.trim()&&r.text.trim()!==r.previewText.trim()?r.text.trim():null,o=((m=r.detailText)==null?void 0:m.trim())||null,s=cl(a??((f=r.previewText)==null?void 0:f.trim())??r.text,48),l=Hp(r),i=!!(o||r.hasDeferredDetail),d=t.jsxs("div",{className:"thread-graph-event-line thread-graph-file-change-inline flex min-w-0 items-center gap-2",children:[t.jsx("span",{className:"thread-graph-history-detail-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip text-sm",title:a??s,children:s}),l.length>0&&t.jsx("div",{className:"inline-flex shrink-0 items-center justify-end gap-1.5 text-xs",children:l.map(p=>t.jsx("span",{className:`thread-graph-history-delta-badge ${p.startsWith("+")?"is-add":p.startsWith("-")?"is-remove":"is-neutral"}`,children:p},p))})]}),h=i?t.jsx("button",{type:"button","aria-label":"Open file change details",onClick:()=>n("File Change Details",o??r.text),className:"thread-graph-file-change-inline-button min-w-0 flex-1 text-left",title:a??s,children:d}):d;return t.jsx(Ft,{className:"thread-graph-event-file-change",headerMeta:h,icon:t.jsx(B.FilePenLine,{className:"h-4 w-4"}),item:r,title:"file_change",tone:"fileChange"})}),nf=c.memo(function({item:r,onSelect:n}){const a=ra(),[o,s]=c.useState(!1),l=r.artifact,i=l?a.renderArtifact({artifact:l,expanded:o,onToggleExpanded:()=>s(d=>!d)}):null;return t.jsx(Ft,{actions:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[l&&!a.hasRendererForArtifact(l)?t.jsx("span",{className:"thread-graph-history-event-secondary",children:"No renderer"}):null,l&&n?t.jsxs("button",{type:"button","aria-label":`Open artifact inspector for ${l.title}`,onClick:()=>n(r,l),className:"thread-graph-history-event-action",children:[t.jsx(B.PackageOpen,{className:"h-3.5 w-3.5"}),"Inspect"]}):null]}),className:"thread-graph-event-artifact",icon:t.jsx(B.PackageOpen,{className:"h-4 w-4"}),item:r,title:(l==null?void 0:l.type)??"artifact",tone:"artifact",children:i??t.jsxs("div",{className:"space-y-2",children:[t.jsxs("button",{type:"button",onClick:()=>s(d=>!d),className:"thread-graph-history-event-summary is-clickable flex w-full items-center justify-between gap-3 text-left",children:[t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:"thread-graph-history-event-primary block truncate",children:(l==null?void 0:l.title)??r.text}),t.jsx("span",{className:"thread-graph-history-event-secondary mt-1 block truncate",children:(l==null?void 0:l.summaryText)??r.previewText??r.text})]}),t.jsx("span",{className:"thread-graph-history-event-pill",children:o?"Hide":"Open"})]}),o?t.jsx("pre",{className:"thread-graph-history-event-pre max-h-80 overflow-auto",children:JSON.stringify((l==null?void 0:l.payload)??r,null,2)}):null]})})}),af=c.memo(function({item:r}){var d,h;const n=((d=r.hookOutputEntries)==null?void 0:d.map(u=>u.text.trim()).filter(Boolean).join(`
|
|
3654
|
+
`).trim())??"",a=r.hookEventLabel?`${r.hookEventLabel} hook`:r.text,o=((h=r.hookStatusMessage)==null?void 0:h.trim())||(r.previewText&&r.previewText!==r.hookStatusMessage?r.previewText.trim():"")||r.text.trim(),l=pt(n||(o&&o!==a?o:a)),i=!!(n&&l.showGap);return t.jsx(Ft,{className:"thread-graph-event-hook",icon:t.jsx(B.Webhook,{className:"h-4 w-4"}),item:r,title:r.hookEventLabel?`${r.hookEventLabel}_hook`:"hook",tone:"hook",children:t.jsxs("div",{className:"thread-graph-history-event-line",children:[t.jsx("p",{className:"thread-graph-history-detail-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:n?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"thread-graph-history-event-secondary mr-2 font-sans text-[11px] uppercase",children:a}),t.jsx(er,{text:l.firstLine})]}):t.jsx(er,{text:l.firstLine&&l.firstLine!==a?`${a} · ${l.firstLine}`:a})}),i?t.jsx("span",{className:"thread-graph-history-detail-meta shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})}),sf=c.memo(function({items:r,expanded:n,onToggleExpanded:a,onOpen:o}){const s=r.filter(i=>Yr(i.status)).length,l=r.length===1?"1 command":`${r.length} commands`;return t.jsx(qr,{className:"thread-graph-history-group-command",count:r.length,countBadgeClassName:"border-amber-200/35 text-amber-100",desktopIconClassName:"border-amber-300/30 bg-amber-300/[0.14] text-amber-100",expanded:n,expandedListClassName:"border-amber-300/12",icon:t.jsx(Bp,{}),onToggleExpanded:a,runningIndicator:s>0?t.jsx(Hn,{}):null,summary:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rounded-full border border-amber-300/28 bg-amber-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-amber-100",children:"Batch"}),t.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:l}),s>0?t.jsx("span",{className:"inline-flex items-center text-xs text-amber-100/90",children:t.jsx(Hn,{})}):null]}),toggleAriaLabel:`${n?"Collapse":"Expand"} ${r.length} command entries`,children:r.map((i,d)=>{const h=pt(i.text);return t.jsxs("button",{type:"button","aria-label":`Open grouped command ${d+1}`,onClick:()=>o(i,`Command Output ${d+1}`),className:"thread-graph-history-detail-row block w-full rounded-md border px-3 py-2 text-left transition",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs("span",{className:"rounded-full border border-amber-300/18 bg-amber-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-amber-100",children:["Step ",d+1]}),i.status&&t.jsx("span",{className:"thread-graph-history-detail-meta text-xs",children:i.status})]}),t.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[t.jsx("p",{className:"thread-graph-history-detail-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?t.jsx("span",{className:"thread-graph-history-detail-meta shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},i.id)})})}),of=c.memo(function({items:r,expanded:n,onToggleExpanded:a,onOpen:o}){const s=r.length===1?"1 search":`${r.length} searches`;return t.jsx(qr,{className:"thread-graph-history-group-search",count:r.length,countBadgeClassName:"border-sky-200/35 text-sky-100",desktopIconClassName:"border-sky-300/30 bg-sky-300/[0.14] text-sky-100",expanded:n,expandedListClassName:"border-sky-300/12",icon:t.jsx(Gp,{}),onToggleExpanded:a,summary:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rounded-full border border-sky-300/28 bg-sky-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-sky-100",children:"Batch"}),t.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:s})]}),toggleAriaLabel:`${n?"Collapse":"Expand"} ${r.length} web search entries`,children:r.map((l,i)=>{var m,f;const d=((m=l.previewText)==null?void 0:m.trim())||l.text||"Web search",h=pt(d),u=((f=l.detailText)==null?void 0:f.trim())||l.text||"Web search";return t.jsxs("button",{type:"button","aria-label":`Open grouped web search ${i+1}`,onClick:()=>o(`Web Search ${i+1}`,u),className:"thread-graph-history-detail-row block w-full rounded-md border px-3 py-2 text-left transition",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs("span",{className:"rounded-full border border-sky-300/18 bg-sky-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-100",children:["Search ",i+1]}),l.status&&t.jsx("span",{className:"thread-graph-history-detail-meta text-xs",children:l.status})]}),t.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[t.jsx("p",{className:"thread-graph-history-detail-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?t.jsx("span",{className:"thread-graph-history-detail-meta shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},l.id)})})}),lf=c.memo(function({items:r,expanded:n,onToggleExpanded:a,onOpen:o}){const s=r.length===1?"1 file read":`${r.length} file reads`;return t.jsx(qr,{className:"thread-graph-history-group-file-read",count:r.length,countBadgeClassName:"border-cyan-200/35 text-cyan-100",desktopIconClassName:"border-cyan-300/30 bg-cyan-300/[0.14] text-cyan-100",expanded:n,expandedListClassName:"border-cyan-300/12",icon:t.jsx(Dp,{}),onToggleExpanded:a,summary:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rounded-full border border-cyan-300/28 bg-cyan-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-cyan-100",children:"Batch"}),t.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:s})]}),toggleAriaLabel:`${n?"Collapse":"Expand"} ${r.length} file read entries`,children:r.map((l,i)=>{var m,f;const d=((m=l.previewText)==null?void 0:m.trim())||l.text||"File read",h=pt(d),u=((f=l.detailText)==null?void 0:f.trim())||l.text||"File read";return t.jsxs("button",{type:"button","aria-label":`Open grouped file read ${i+1}`,onClick:()=>o(`File Read ${i+1}`,u),className:"thread-graph-history-detail-row block w-full rounded-md border px-3 py-2 text-left transition",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs("span",{className:"rounded-full border border-cyan-300/18 bg-cyan-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-cyan-100",children:["Read ",i+1]}),l.status&&t.jsx("span",{className:"thread-graph-history-detail-meta text-xs",children:l.status})]}),t.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[t.jsx("p",{className:"thread-graph-history-detail-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?t.jsx("span",{className:"thread-graph-history-detail-meta shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},l.id)})})}),df=c.memo(function({items:r,expanded:n,onToggleExpanded:a,onOpen:o}){const s=r.reduce((h,u)=>h+(u.changedFiles??0),0),l=r.reduce((h,u)=>h+(u.addedLines??0),0),i=r.reduce((h,u)=>h+(u.removedLines??0),0),d=r.length===1?"1 file change":`${r.length} file changes`;return t.jsx(qr,{className:"thread-graph-history-group-file-change",count:r.length,countBadgeClassName:"border-lime-200/35 text-lime-100",desktopIconClassName:"border-lime-300/30 bg-lime-300/[0.14] text-lime-100",expanded:n,expandedListClassName:"border-lime-300/12",icon:t.jsx($p,{}),onToggleExpanded:a,summary:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rounded-full border border-lime-300/28 bg-lime-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-lime-100",children:"Batch"}),t.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:d}),s>0?t.jsxs("span",{className:"thread-graph-history-detail-meta text-xs",children:[s," files"]}):null]}),toggleAriaLabel:`${n?"Collapse":"Expand"} ${r.length} file change entries`,trailingSummary:t.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[l>0?t.jsxs("span",{className:"thread-graph-history-delta-badge is-add",children:["+",l]}):null,i>0?t.jsxs("span",{className:"thread-graph-history-delta-badge is-remove",children:["-",i]}):null]}),children:r.map((h,u)=>{var p,g,b,v;const m=((p=h.detailText)==null?void 0:p.trim())||((g=h.previewText)==null?void 0:g.trim())||h.text,f=(b=h.previewText)!=null&&b.trim()&&h.text.trim()!==h.previewText.trim()?h.text.trim():((v=h.previewText)==null?void 0:v.trim())||h.text;return t.jsx("button",{type:"button","aria-label":`Open grouped file change ${u+1}`,onClick:()=>o(`File Change ${u+1}`,m),className:"thread-graph-history-detail-row block w-full rounded-md border px-3 py-2 text-left transition",children:t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx("span",{className:"thread-graph-history-detail-text min-w-0 flex-1 text-sm leading-6",title:f,children:cl(f,34)}),t.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[(h.addedLines??0)>0?t.jsxs("span",{className:"thread-graph-history-delta-badge is-add",children:["+",h.addedLines]}):null,(h.removedLines??0)>0?t.jsxs("span",{className:"thread-graph-history-delta-badge is-remove",children:["-",h.removedLines]}):null]})]})},h.id)})})});function cf(e){const r=e.trim().toLowerCase();return r==="completed"||r==="done"||r==="complete"?"completed":r==="in_progress"||r==="in-progress"||r==="running"||r==="active"?"in_progress":r==="failed"||r==="error"||r==="cancelled"?"failed":r==="pending"||r==="todo"?"pending":"unknown"}function hf({status:e}){const r=cf(e),n=r==="completed"?"Plan step status: Completed":r==="in_progress"?"Plan step status: In progress":r==="pending"?"Plan step status: Pending":r==="failed"?"Plan step status: Failed":`Plan step status: ${e}`,a=r==="completed"?"thread-graph-plan-status is-completed":r==="in_progress"?"thread-graph-plan-status is-running":r==="pending"?"thread-graph-plan-status is-pending":r==="failed"?"thread-graph-plan-status is-failed":"thread-graph-plan-status is-unknown";return t.jsx(Xr,{"aria-label":n,title:n.replace("Plan step status: ",""),className:a,children:r==="completed"?t.jsx(B.CheckCircle2,{className:"h-3.5 w-3.5"}):r==="in_progress"?t.jsx(B.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):r==="pending"?t.jsx(B.Clock3,{className:"h-3.5 w-3.5"}):r==="failed"?t.jsx(B.XCircle,{className:"h-3.5 w-3.5"}):t.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.14em]",children:"?"})})}function uf({livePlan:e}){return t.jsxs("div",{className:"thread-graph-plan-card rounded-xl border px-3 py-3",children:[t.jsxs("div",{className:"thread-graph-plan-header flex flex-wrap items-center justify-between gap-2",children:[t.jsx("p",{className:"text-sm font-semibold",children:"Plan update"}),t.jsx(Xr,{className:"thread-graph-plan-badge",children:"Live"})]}),e.explanation?t.jsx("p",{className:"thread-graph-plan-explanation mt-3 text-sm",children:e.explanation}):null,t.jsx("div",{className:"mt-3 space-y-2",children:e.plan.map((r,n)=>t.jsxs("div",{className:"thread-graph-plan-step flex items-center justify-between gap-3 rounded-lg border px-3 py-2 text-sm",children:[t.jsx("span",{className:"thread-graph-plan-step-text min-w-0 flex-1",children:r.step}),t.jsx(hf,{status:r.status})]},`${e.turnId}-${n}`))})]})}function mf({footer:e,history:r,liveHookPrompt:n,liveOutput:a,livePlan:o}){return t.jsxs(t.Fragment,{children:[r,o?t.jsx(uf,{livePlan:o}):null,n??a??null,e]})}function pf({absoluteIndex:e,body:r,collapsed:n,collapsedBody:a,error:o,footer:s,headerStatus:l,isActive:i=!1,onToggleCollapse:d,refCallback:h,startedAt:u,timeLabel:m,timeTitle:f,tokenSummary:p}){return t.jsxs("article",{ref:h,"data-testid":"chat-turn","data-turn-active":i?"true":"false",className:"thread-graph-turn px-3 py-2 sm:px-5 sm:py-3",children:[t.jsxs("div",{className:"thread-graph-turn-header flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0 flex flex-1 items-start gap-1.5",children:[t.jsxs("div",{className:"min-w-0 flex flex-1 items-center gap-1.5 overflow-hidden",children:[t.jsxs("span",{className:"thread-graph-turn-index rounded-[0.6rem] border px-1.5 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Turn ",e]}),t.jsx("time",{dateTime:u??void 0,title:f,className:"thread-graph-turn-time shrink-0 text-[10px] sm:text-[11px]",children:m}),l,o?t.jsx("p",{className:"hidden truncate text-[11px] text-rose-200 sm:block",children:o}):null]}),p]}),t.jsx("button",{type:"button","aria-label":`${n?"Expand":"Collapse"} turn ${e}`,title:n?"Expand turn":"Collapse turn",onClick:d,className:"thread-graph-turn-collapse inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md transition",children:t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:n?t.jsx("path",{d:"m4.5 10 3.5-3.5L11.5 10"}):t.jsx("path",{d:"m4.5 6 3.5 3.5L11.5 6"})})})]}),o?t.jsx("p",{className:"mt-1 text-[11px] text-rose-200 sm:hidden",children:o}):null,t.jsxs("div",{className:"thread-graph-turn-body mt-2 space-y-2",children:[n?a:r,n?null:s]})]})}function ff(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M8 2.75v8"}),t.jsx("path",{d:"m4.75 7.5 3.25 3.25L11.25 7.5"})]})}function gf(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M8 13.25v-8"}),t.jsx("path",{d:"m11.25 8.5-3.25-3.25L4.75 8.5"})]})}function xf(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M3.25 5.25 8 2.75l4.75 2.5L8 7.75l-4.75-2.5Z"}),t.jsx("path",{d:"M3.25 8 8 10.5 12.75 8"}),t.jsx("path",{d:"M3.25 10.75 8 13.25l4.75-2.5"}),t.jsx("path",{d:"M3.25 5.25v5.5"}),t.jsx("path",{d:"M12.75 5.25v5.5"})]})}function bf(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M6.2 3.2a2.3 2.3 0 0 0-2.95 3.5A2.4 2.4 0 0 0 4.5 11h.2c.25 1.1 1.1 1.8 2.3 1.8h1.8c1.2 0 2.05-.7 2.3-1.8h.2A2.4 2.4 0 0 0 12.75 6.7 2.3 2.3 0 0 0 9.8 3.2"}),t.jsx("path",{d:"M6.3 6.15c.45-.42 1.02-.65 1.7-.65s1.25.23 1.7.65"}),t.jsx("path",{d:"M8 5.5v4.75"}),t.jsx("path",{d:"M6.75 9.05 8 10.25l1.25-1.2"})]})}function Sr(e){if(!Number.isFinite(e)||e<=0)return"0";if(e>=1e6){const r=e>=1e7?Math.round(e/1e6):e/1e6;return`${String(r.toFixed(1)).replace(/\.0$/,"")}m`}if(e>=1e3){const r=e>=1e4?Math.round(e/1e3):e/1e3;return`${String(r.toFixed(1)).replace(/\.0$/,"")}k`}return String(Math.round(e))}function vf(e){return!Number.isFinite(e)||e<=0?"$0":e>=100?`$${Math.round(e)}`:e>=10?`$${String(e.toFixed(1)).replace(/\.0$/,"")}`:e>=1?`$${String(e.toFixed(2)).replace(/0$/,"").replace(/\.$/,"")}`:e>=.1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:e>=.001?`$${e.toFixed(4)}`:"<$0.001"}function cr(e){return!Number.isFinite(e)||e<=0?"$0.0000":`$${e.toFixed(4)}`}function Tr(e,r,n){const a=e??null;return!Number.isFinite(a??NaN)||a===null||r<=0||n<=0?null:a*n/r}function ul(e){var i,d,h,u,m;const r=(i=e.tokenUsage)==null?void 0:i.total;if(!r)return[];const n=Math.max(r.inputTokens-r.cachedInputTokens,0),a=Math.max(r.cachedInputTokens,0),o=Math.max(r.reasoningOutputTokens,0),s=Math.max(r.outputTokens-o,0);return[n>0?{id:"in",label:"Input",tokenCompactValue:Sr(n),tokenRawValue:n,usdCompactValue:e.priceEstimate?cr(e.priceEstimate.inputUsd):"--",usdRawValue:((d=e.priceEstimate)==null?void 0:d.inputUsd)??null,className:"token-badge-in",icon:t.jsx(ff,{})}:null,a>0?{id:"cache",label:"Cached input",tokenCompactValue:Sr(a),tokenRawValue:a,usdCompactValue:e.priceEstimate?cr(e.priceEstimate.cachedInputUsd):"--",usdRawValue:((h=e.priceEstimate)==null?void 0:h.cachedInputUsd)??null,className:"token-badge-cache",icon:t.jsx(xf,{})}:null,s>0?{id:"out",label:"Output",tokenCompactValue:Sr(s),tokenRawValue:s,usdCompactValue:e.priceEstimate?cr(Tr(e.priceEstimate.outputUsd,Math.max(r.outputTokens,0),s)??0):"--",usdRawValue:Tr((u=e.priceEstimate)==null?void 0:u.outputUsd,Math.max(r.outputTokens,0),s),className:"token-badge-out",icon:t.jsx(gf,{})}:null,o>0?{id:"reason",label:"Reasoning",tokenCompactValue:Sr(o),tokenRawValue:o,usdCompactValue:e.priceEstimate?cr(Tr(e.priceEstimate.outputUsd,Math.max(r.outputTokens,0),o)??0):"--",usdRawValue:Tr((m=e.priceEstimate)==null?void 0:m.outputUsd,Math.max(r.outputTokens,0),o),className:"token-badge-reason",icon:t.jsx(bf,{})}:null].filter(f=>f!==null)}function kf(e){return ul(e).map(r=>({id:r.id,label:r.tokenCompactValue,title:`${r.label}: ${r.tokenRawValue} tokens`,className:r.className,icon:r.icon}))}function ml(e){return{label:e.priceEstimate?vf(e.priceEstimate.totalUsd):"--",title:e.priceEstimate===null||e.priceEstimate===void 0?"Price estimate unavailable for this model.":`Estimated cost: ${cr(e.priceEstimate.totalUsd)}`,className:e.priceEstimate?"token-badge-total":"token-badge-empty"}}var gn="inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-normal leading-none sm:text-[11px]";function wf({turn:e}){const r=ul(e),n=ml(e),[a,o]=c.useState(!1),[s,l]=c.useState(!1),[i,d]=c.useState(0),h=c.useRef(null),u=c.useRef(null),m=c.useRef(null);if(c.useLayoutEffect(()=>{if(!a||r.length===0){d(0);return}const p=()=>{const g=h.current,b=m.current;if(!g||!b)return;const v=g.getBoundingClientRect(),x=b.offsetWidth||b.getBoundingClientRect().width;if(x<=0)return;const y=window.innerWidth||document.documentElement.clientWidth,k=12,S=v.left+v.width/2-x/2,w=k,N=Math.max(w,y-k-x),C=Math.min(Math.max(S,w),N);d(Math.round(C-S))};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[r.length,a]),c.useEffect(()=>{if(!a&&!s)return;const p=g=>{g.target instanceof Node&&(h.current&&!h.current.contains(g.target)&&o(!1),u.current&&!u.current.contains(g.target)&&l(!1))};return document.addEventListener("pointerdown",p),()=>{document.removeEventListener("pointerdown",p)}},[s,a]),!n&&r.length===0)return null;const f=()=>t.jsx("div",{className:"thread-token-popover min-w-[12rem] rounded-2xl border p-2.5 shadow-2xl shadow-black/20 backdrop-blur",children:t.jsx("div",{className:"space-y-1",children:r.map(p=>t.jsxs("div",{className:"thread-token-popover-row flex items-center justify-between gap-3 rounded-xl border px-2.5 py-1.5 text-[11px]",title:`${p.label}: ${p.tokenRawValue} tokens`,children:[t.jsxs("span",{className:"thread-token-popover-text inline-flex min-w-0 items-center gap-2",children:[t.jsx("span",{className:"inline-flex shrink-0",children:p.icon}),t.jsx("span",{className:"thread-token-popover-strong font-medium",children:p.usdCompactValue})]}),t.jsx("span",{className:"thread-token-popover-text shrink-0 font-medium",children:p.tokenCompactValue})]},p.id))})});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hidden shrink-0 items-center gap-1.5 md:inline-flex",children:[n?t.jsxs("div",{ref:u,className:"relative shrink-0",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":s,onFocus:()=>l(!0),onBlur:()=>l(!1),className:`${gn} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}),s&&r.length>0?t.jsx("div",{className:"absolute left-1/2 top-full z-30 mt-1.5 -translate-x-1/2",children:f()}):null]}):null,r.map(p=>t.jsxs("span",{className:`${gn} ${p.className}`,title:`${p.label}: ${p.usdCompactValue}, ${p.tokenRawValue} tokens`,children:[p.icon,t.jsx("span",{className:"thread-token-badge-value font-medium",children:p.tokenCompactValue})]},p.id))]}),t.jsxs("div",{ref:h,className:"relative shrink-0 md:hidden",children:[n?t.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":a,onClick:()=>o(p=>!p),className:`${gn} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}):null,a&&r.length>0?t.jsx("div",{ref:m,className:"absolute left-1/2 top-full z-30 mt-1.5",style:{transform:`translateX(${i}px) translateX(-50%)`},children:f()}):null]})]})}function yf({tone:e="amber"}){const r=e==="emerald"?"bg-sky-200/90":e==="sky"?"bg-sky-300/90":"bg-amber-200/90";return t.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>t.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${r}`,style:{animationDelay:`${n*180}ms`}},n))})}function vs(e){const r=e.trim().toLowerCase();return r==="completed"||r==="done"||r==="complete"?"completed":r==="in_progress"||r==="in progress"||r==="inprogress"||r==="running"||r==="active"?"in_progress":r==="pending"||r==="todo"||r==="not_started"||r==="not started"||r==="queued"?"pending":r==="failed"||r==="error"?"failed":"other"}function jf(e){switch(e.kind){case"fileChange":case"webSearch":case"image":case"contextCompaction":return!0;case"commandExecution":case"toolCall":return!al(e.status);default:return!1}}function Nf(e,r,n){if(!e||!Dr(n))return e;const a=e.plan.findIndex(i=>vs(i.status)==="in_progress");if(a<0)return e;const o=e.plan.findIndex((i,d)=>d>a&&vs(i.status)==="pending");if(o<0||!r.some(i=>jf(i)))return e;const l=e.plan.map((i,d)=>d===a?{...i,status:"completed"}:d===o?{...i,status:"in_progress"}:i);return{...e,plan:l}}function Cf(e){var a;const r=(a=e.model)!=null&&a.trim()?e.model.trim():"--";let n="--";return e.reasoningEffortAvailable===null||e.reasoningEffortAvailable===void 0?n="--":e.reasoningEffortAvailable===!1?n="-":n=e.reasoningEffort??"--",[r,n].join(" · ")}function ks({status:e}){const r=Jo(e);return e==="completed"?t.jsx("span",{"aria-label":r,title:r,className:"timeline-status-icon timeline-status-icon-success inline-flex h-4 w-4 items-center justify-center",children:t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})})}):e==="failed"?t.jsx("span",{"aria-label":r,title:r,className:"timeline-status-icon timeline-status-icon-failed inline-flex h-4 w-4 items-center justify-center",children:t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})})}):e==="interrupted"?t.jsx("span",{"aria-label":r,title:r,className:"timeline-status-icon timeline-status-icon-warning inline-flex h-4 w-4 items-center justify-center",children:t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M6 4.5v7M10 4.5v7"})})}):t.jsx("span",{"aria-label":r,title:r,className:"inline-flex min-w-[1.25rem] items-center justify-center text-sky-200",children:t.jsx(yf,{tone:"emerald"})})}function ws({turn:e,variant:r="header"}){const n=Jo(e.status),a=Cf(e),o=kf(e),s=ml(e),l=Dr(e.status),i=e.status==="failed"?"border-rose-300/20 bg-rose-300/[0.06] text-rose-100":l?"border-sky-300/22 bg-sky-300/[0.08] text-sky-100":"border-stone-700/90 bg-stone-900/70 text-stone-200";if(r==="footer")return t.jsxs("div",{className:`flex w-full flex-col gap-1.5 rounded-[0.95rem] border px-3 py-2 text-xs ${i}`,children:[t.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(ks,{status:e.status}),t.jsx("span",{className:"timeline-soft-text min-w-0 truncate",children:a})]}),e.startedAt&&t.jsx("time",{dateTime:e.startedAt,title:Qt(e.startedAt),className:"timeline-meta-text shrink-0 text-[11px]",children:$t(e.startedAt)})]}),(s||o.length>0)&&t.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[s?t.jsx("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${s.className}`,title:s.title,children:s.label}):null,o.map(h=>t.jsxs("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${h.className}`,title:h.title,children:[h.icon?t.jsx("span",{className:"mr-1",children:h.icon}):null,h.label]},h.id))]})]});const d=`${n} · ${a}`;return t.jsxs("span",{className:`inline-flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1 text-[10px] sm:text-[11px] ${i}`,title:d,children:[t.jsx(ks,{status:e.status}),t.jsx("span",{className:"timeline-meta-text min-w-0 truncate",children:a})]})}function Sf(e,r){return e.createdAt??r}var na=c.memo(function({threadId:r,item:n,scrollRootRef:a,onOpenExpandedText:o,onOpenCommandDetail:s,onOpenToolCallDetail:l,onOpenDeferredHistoryItemDetail:i,onSelectArtifact:d,onBeforeMessageResize:h,adapter:u,timeLabel:m,timeTitle:f}){var p,g,b;if(Np(n.kind))return t.jsx(Dt,{threadId:r,item:n,scrollRootRef:a,timeLabel:m,timeTitle:f,...h?{onBeforeMessageResize:h}:{},...u?{adapter:u}:{}});if(n.kind==="artifact")return t.jsx(nf,{item:n,...d?{onSelect:(v,x)=>d({item:v,artifact:x})}:{}});if(n.kind==="commandExecution")return t.jsx(Xp,{item:n,onOpen:s});if(n.kind==="toolCall")return t.jsx(Yp,{item:n,onOpen:l});if(n.kind==="agentToolCall")return t.jsx(Zp,{item:n,onOpen:l});if(n.kind==="skillToolCall")return t.jsx(Jp,{item:n,onOpen:l});if(n.kind==="webSearch"){const v=n,x=((p=v.detailText)==null?void 0:p.trim())||v.text||"Web search";return t.jsx(Qp,{item:v,onOpen:()=>i(v,"Web Search Details",x,"Loading full web search details...","Unable to load full web search details.")})}if(n.kind==="fileRead"){const v=n,x=((g=v.detailText)==null?void 0:g.trim())||v.text||"File read";return t.jsx(ef,{item:v,onOpen:()=>i(v,"File Read Details",x,"Loading full file read details...","Unable to load full file read details.")})}if(n.kind==="image")return t.jsx(tf,{threadId:r,item:n,onOpen:o,getImageAssetUrl:u==null?void 0:u.getImageAssetUrl});if(n.kind==="plan")return t.jsx(Vp,{item:n,scrollRootRef:a,...h?{onBeforeResize:h}:{}});if(n.kind==="fileChange"){const v=n,x=((b=v.detailText)==null?void 0:b.trim())||v.text||"File change";return t.jsx(rf,{item:v,onOpen:()=>i(v,"File Change Details",x,"Loading full file change details...","Unable to load full file change details.")})}return n.kind==="contextCompaction"?t.jsx(Kp,{item:n}):n.kind==="hook"?t.jsx(af,{item:n}):t.jsx(qp,{item:n})});function Tf(e){return e==="completed"||e==="failed"||e==="interrupted"}function Ef(e){const r=Date.parse(e.createdAt??"");return Number.isFinite(r)?r:null}function Lf(e){let r=null;for(const n of e){const a=Ef(n);a!==null&&(r=r===null?a:Math.max(r,a))}return r}function Pf(e,r){const n=Date.parse(e??""),a=Lf(r);if(!Number.isFinite(n)||a===null||a<n)return"Worked";const o=Math.max(1,Math.round((a-n)/1e3)),s=Math.floor(o/3600),l=Math.floor(o%3600/60),i=o%60;return s>0?`Worked for ${s}h ${l}m`:l>0?`Worked for ${l}m ${i}s`:`Worked for ${i}s`}function If(e){const r=e.filter(s=>s.kind==="item"),n=r.map(s=>s.item).filter(s=>s.kind==="userMessage"),a=r.map(s=>s.item).reverse().find(s=>s.kind==="agentMessage"&&s.text.trim().length>0),o=e.filter(s=>s.kind!=="item"?!0:s.item.kind!=="userMessage"&&s.item.id!==(a==null?void 0:a.id));return{users:n,finalAgent:a,hiddenEntries:o}}var xn=c.memo(function({threadId:r,adapter:n,turn:a,absoluteIndex:o,isCollapsed:s,livePlan:l,liveItems:i,liveOutput:d,forceActive:h=!1,onToggleCollapse:u,onOpenExpandedText:m,onOpenCommandDetail:f,onOpenToolCallDetail:p,onOpenDeferredHistoryItemDetail:g,onSelectArtifact:b,onBeforeMessageResize:v,scrollRootRef:x,articleRef:y,isLatestVisibleTurn:k=!1}){const S=!!l||!!d||!!(i&&i.length>0),w=h||Dr(a.status)||S||k,N=w&&!Dr(a.status)?{...a,status:"inProgress"}:a,C=c.useMemo(()=>Ep(a.items,i),[i,a.items]),T=c.useMemo(()=>Nf(l,C,a.status),[l,C,a.status]),P=c.useMemo(()=>Lp(d,C),[d,C]),K=c.useMemo(()=>Tp(C,w),[w,C]),G=c.useMemo(()=>Pp(K),[K]),A=$t(a.startedAt),J=Qt(a.startedAt),Z=c.useMemo(()=>nl(P),[P]),[D,te]=c.useState({}),oe=c.useCallback(U=>{te(X=>({...X,[U]:!X[U]}))},[]),_=t.jsx(zf,{entries:G,expandedGroups:D,onToggleGroupedItem:oe,threadId:r,scrollRootRef:x,onOpenExpandedText:m,onOpenCommandDetail:f,onOpenToolCallDetail:p,onOpenDeferredHistoryItemDetail:g,...v?{onBeforeMessageResize:v}:{},fallbackTimestamp:a.startedAt,fallbackTimeLabel:A,fallbackTimeTitle:J,...b?{onSelectArtifact:b}:{},...n?{adapter:n}:{}}),Y=Z?t.jsx(na,{threadId:r,item:Z,scrollRootRef:x,onOpenExpandedText:m,onOpenCommandDetail:f,onOpenToolCallDetail:p,onOpenDeferredHistoryItemDetail:g,timeLabel:A,timeTitle:J,...b?{onSelectArtifact:b}:{},...n?{adapter:n}:{}}):null,z=!Z&&P?t.jsx(Dt,{item:{id:"live-agent-message",kind:"agentMessage",text:P},scrollRootRef:x,timeLabel:A,timeTitle:J,streaming:!0,...v?{onBeforeMessageResize:v}:{}}):null,q=w?t.jsx(ws,{turn:N,variant:"footer"}):null,F=c.useMemo(()=>If(G),[G]),E=c.useMemo(()=>Pf(a.startedAt,C),[C,a.startedAt]),W=F.hiddenEntries.length>0,H=s&&W,j=Tf(a.status)&&W?t.jsxs("div",{className:"thread-graph-turn-collapsed-summary space-y-2",children:[F.users.map(U=>t.jsx(Dt,{threadId:r,item:U,scrollRootRef:x,timeLabel:U.createdAt?$t(U.createdAt):A,timeTitle:U.createdAt?Qt(U.createdAt):J,...v?{onBeforeMessageResize:v}:{},...n?{adapter:n}:{}},U.id)),t.jsxs("button",{type:"button",className:"thread-graph-worked-summary group flex w-full items-center gap-2 py-2 text-left text-sm transition",onClick:()=>u(a.id,!0),"aria-label":`${E}. Expand turn ${o}`,children:[t.jsx("span",{className:"thread-graph-worked-label shrink-0",children:E}),t.jsx(B.ChevronRight,{className:"h-4 w-4 shrink-0 transition group-hover:translate-x-0.5"}),t.jsx("span",{className:"thread-graph-worked-rule h-px min-w-0 flex-1","aria-hidden":"true"})]}),F.finalAgent?t.jsx(Dt,{threadId:r,item:F.finalAgent,scrollRootRef:x,timeLabel:F.finalAgent.createdAt?$t(F.finalAgent.createdAt):A,timeTitle:F.finalAgent.createdAt?Qt(F.finalAgent.createdAt):J,...v?{onBeforeMessageResize:v}:{},...n?{adapter:n}:{}}):null]}):null,L=t.jsx(mf,{footer:q,history:_,liveHookPrompt:Y,liveOutput:z,livePlan:T});return t.jsx(pf,{absoluteIndex:o,body:L,collapsed:H,collapsedBody:j,error:a.error,headerStatus:t.jsx(ws,{turn:a}),isActive:w,onToggleCollapse:()=>u(a.id,H),refCallback:y,startedAt:a.startedAt,timeLabel:A,timeTitle:J,tokenSummary:t.jsx(wf,{turn:a})})});function zf({entries:e,expandedGroups:r,onToggleGroupedItem:n,threadId:a,scrollRootRef:o,onOpenExpandedText:s,onOpenCommandDetail:l,onOpenToolCallDetail:i,onOpenDeferredHistoryItemDetail:d,onSelectArtifact:h,onBeforeMessageResize:u,adapter:m,fallbackTimestamp:f,fallbackTimeLabel:p,fallbackTimeTitle:g}){return t.jsx(_p,{entries:e,expandedGroups:r,onToggleGroupedItem:n,renderCommandGroup:(b,v,x)=>t.jsx(sf,{items:b.items,expanded:v,onToggleExpanded:x,onOpen:l},b.key),renderFileChangeGroup:(b,v,x)=>t.jsx(df,{items:b.items,expanded:v,onToggleExpanded:x,onOpen:s},b.key),renderSearchGroup:(b,v,x)=>t.jsx(of,{items:b.items,expanded:v,onToggleExpanded:x,onOpen:s},b.key),renderFileReadGroup:(b,v,x)=>t.jsx(lf,{items:b.items,expanded:v,onToggleExpanded:x,onOpen:s},b.key),renderItem:b=>{const v=Sf(b.item,f??null);return t.jsx(na,{threadId:a,item:b.item,scrollRootRef:o,timeLabel:b.item.createdAt?$t(v):p,timeTitle:b.item.createdAt?Qt(v):g,onOpenExpandedText:s,onOpenCommandDetail:l,onOpenToolCallDetail:i,onOpenDeferredHistoryItemDetail:d,...u?{onBeforeMessageResize:u}:{},...h?{onSelectArtifact:h}:{},...m?{adapter:m}:{}},b.key)}})}var ys=3,Rf=3,On=80;function lr(e,r=On){return e.scrollHeight-e.scrollTop-e.clientHeight<=r}function Mf(e,r){const n=e.getBoundingClientRect(),a=r.getBoundingClientRect(),o=Math.max(n.top,a.top),s=Math.min(n.bottom,a.bottom);return Math.max(0,s-o)>0}function _f(e){return e.map(n=>{const a=n.createdAt;return typeof a=="string"&&a.trim()?a:null}).filter(n=>!!n).sort()[0]??null}function Af(e,r){return{id:e,startedAt:_f(r),status:"inProgress",error:null,model:null,reasoningEffort:null,reasoningEffortAvailable:null,tokenUsage:null,priceEstimate:null,items:[]}}function js(e,r,n){return{id:e.id,kind:e.kind,title:r,text:n}}function $f({loadHistoryItemDetail:e,onSelectHistoryItemDetail:r}){const n=c.useRef(0),a=c.useRef(new Map),[o,s]=c.useState(null),l=c.useCallback((p,g)=>{s({title:p,text:g})},[]),i=c.useCallback((p,g,b)=>{if(b&&r){r({item:p,detail:g});return}s({title:g.title,text:g.text})},[r]),d=c.useCallback(async({item:p,fallbackTitle:g,fallbackText:b,loadingText:v,errorText:x,useSelectionCallback:y})=>{if(!p.hasDeferredDetail||!e){i(p,js(p,g,b),y);return}const k=a.current.get(p.id);if(k){i(p,k,y);return}const S=n.current+1;n.current=S,y&&r||s({title:g,text:v});try{const w=await e(p.id);if(a.current.set(p.id,w),n.current!==S)return;i(p,w,y)}catch(w){if(n.current!==S)return;i(p,js(p,g,w instanceof Error?w.message:x),y)}},[e,r,i]),h=c.useCallback(async(p,g)=>{var b;await d({item:p,fallbackTitle:g,fallbackText:((b=p.detailText)==null?void 0:b.trim())||p.text||"Command output",loadingText:"Loading full command output...",errorText:"Unable to load full command output.",useSelectionCallback:!0})},[d]),u=c.useCallback(async(p,g)=>{var b;await d({item:p,fallbackTitle:g,fallbackText:((b=p.detailText)==null?void 0:b.trim())||p.text||"Tool call",loadingText:"Loading full tool call details...",errorText:"Unable to load full tool call details.",useSelectionCallback:!0})},[d]),m=c.useCallback(async(p,g,b,v,x)=>{await d({item:p,fallbackTitle:g,fallbackText:b,loadingText:v,errorText:x,useSelectionCallback:!1})},[d]),f=c.useCallback(()=>{n.current+=1,s(null)},[]);return{expandedText:o,openExpandedText:l,openCommandDetail:h,openToolCallDetail:u,openDeferredHistoryItemDetail:m,closeExpandedText:f}}function Df(e){const r=c.useRef(null),n=c.useRef(0),a=r.current;return(a===null||a.length!==e.length||e.some((s,l)=>!Object.is(s,a[l])))&&(n.current+=1,r.current=e),n.current}function Bf({threadId:e,turnsLength:r,totalTurnCount:n,loadingEarlier:a,onLoadEarlier:o,scrollRequestKey:s,bottomSpacer:l,onTailVisibilityChange:i,contentRevisionInputs:d}){const h=c.useRef(null),u=c.useRef(null),m=c.useRef(s),f=c.useRef(null),p=c.useRef(l),g=c.useRef(0),b=c.useRef(0),v=c.useRef(null),x=c.useRef(null),y=c.useRef(null),k=c.useRef(!0),S=c.useRef(!0),w=c.useRef(!1),N=c.useRef(!1),C=c.useRef(!1),T=c.useRef(!1),P=c.useRef(null),K=c.useRef(0),[G,A]=c.useState(ys),[J,Z]=c.useState(0),[D,te]=c.useState(!0),oe=Df(d),_=typeof o=="function"||n!==void 0,Y=n??r,z=_?0:Math.max(0,r-G),F=(_?Math.max(0,Y-r):0)+z,E=_?r:r-z,W=_?0:r-E,H=_?Math.max(0,Y-r):0,j=_?H+W:W,L=!_&&j>0&&J>=2,U=_&&H>0&&W===0&&typeof o=="function",X=c.useCallback(()=>{const O=h.current;if(!O){v.current=null;return}v.current={scrollHeight:O.scrollHeight,scrollTop:O.scrollTop}},[]),se=c.useCallback(()=>!U||a||C.current?!1:(X(),C.current=!0,T.current=!1,K.current=0,o==null||o(),!0),[U,a,o,X]),Q=c.useCallback(()=>{const O=h.current,ce=x.current;if(!O)return;const xe=ce?Mf(O,ce):lr(O);k.current=xe,te(ye=>ye===xe?ye:xe)},[]),de=c.useCallback(()=>{const O=h.current;if(O){N.current=!0;const ce=O.scrollTop,xe=b.current,ye=ce-xe;b.current=ce,lr(O,1)?(w.current=!1,S.current=!0):ye<-1?(w.current=!0,S.current=!1):ye>1&&(S.current=!w.current&&lr(O,On)),ce<=0&&N.current?T.current=!0:ce>0&&(T.current=!1,K.current=0)}Q()},[Q]),re=c.useCallback(()=>{const O=h.current;O&&(O.scrollTop=O.scrollHeight,b.current=O.scrollTop,g.current=O.scrollHeight,k.current=!0,te(ce=>ce||!0),w.current=!1,S.current=!0)},[]),ue=c.useCallback(()=>{const O=h.current;O&&(b.current=O.scrollTop,g.current=O.scrollHeight,S.current=!1,w.current=!0)},[]),be=c.useCallback(()=>{if(_&&W===0){se();return}A(O=>Math.min(r,O+Rf)),Z(O=>O+1)},[W,_,se,r]),ve=c.useCallback(O=>{const ce=h.current;if(!(!ce||O.deltaY>=-8||ce.scrollTop>0||!U)){if(!T.current){T.current=!0;return}se()}},[U,se]),Pe=c.useCallback(O=>{var ce;P.current=((ce=O.touches.item(0))==null?void 0:ce.clientY)??null,K.current=0},[]),le=c.useCallback(O=>{var _e;const ce=h.current,xe=((_e=O.touches.item(0))==null?void 0:_e.clientY)??null,ye=P.current;if(P.current=xe,!ce||xe===null||ye===null||ce.scrollTop>0||!U){K.current=0;return}const Me=xe-ye;if(Me<=0){K.current=0;return}if(!T.current){T.current=!0,K.current=0;return}K.current+=Me,K.current>=28&&se()},[U,se]),Ne=c.useCallback(()=>{P.current=null,K.current=0},[]),we=c.useCallback(()=>{A(r)},[r]);return c.useLayoutEffect(()=>{const O=window.requestAnimationFrame(()=>{re()});return()=>{window.cancelAnimationFrame(O)}},[e,re]),c.useEffect(()=>{C.current=!1,N.current=!1,T.current=!1,v.current=null},[e]),c.useEffect(()=>{a||(C.current=!1)},[a,r]),c.useLayoutEffect(()=>{const O=v.current,ce=h.current;if(!O||!ce||a)return;v.current=null;const xe=ce.scrollHeight-O.scrollHeight;if(xe<=0){g.current=ce.scrollHeight,b.current=ce.scrollTop;return}const ye=O.scrollTop+xe;ce.scrollTop=ye,b.current=ye,g.current=ce.scrollHeight,w.current=!0,S.current=!1,T.current=!1},[a,r]),c.useEffect(()=>{A(O=>O>=r-1?r:Math.max(O,ys))},[r]),c.useEffect(()=>{const O=h.current;O&&(g.current=O.scrollHeight,b.current=O.scrollTop,lr(O,1)?(w.current=!1,S.current=!0):(w.current||!lr(O,On))&&(S.current=!1)),Q()},[oe,Q,G]),c.useEffect(()=>{const O=s!==m.current,ce=f.current!==oe;if(f.current=oe,!(O||ce&&S.current&&!w.current))return;const ye=window.requestAnimationFrame(()=>{re()});return s!==m.current&&(m.current=s),()=>{window.cancelAnimationFrame(ye)}},[oe,D,re,s]),c.useEffect(()=>{const O=h.current,ce=u.current;if(!O||!ce||typeof ResizeObserver>"u")return;g.current=O.scrollHeight;const xe=new ResizeObserver(()=>{const ye=O.scrollHeight,Me=g.current;if(g.current=ye,ye<=Me)return;const _e=Me>0&&Me-O.scrollTop-O.clientHeight<=1;w.current||!(S.current||_e||k.current)||window.requestAnimationFrame(()=>{re()})});return xe.observe(ce),()=>{xe.disconnect()}},[re]),c.useEffect(()=>{if(!S.current||w.current){p.current=l;return}if(l===p.current)return;p.current=l;const O=window.requestAnimationFrame(()=>{re()});return()=>{window.cancelAnimationFrame(O)}},[l,re]),c.useEffect(()=>{i==null||i(D)},[D,i]),{scrollContainerRef:h,scrollContentRef:u,tailSentinelRef:x,topSentinelRef:y,isTailVisible:D,handleScroll:de,handleWheel:ve,handleTouchStart:Pe,handleTouchMove:le,handleTouchEnd:Ne,preserveScrollPositionForResize:ue,serverManagedHistory:_,effectiveTotalTurnCount:Y,startIndex:z,visibleTurnAbsoluteOffset:F,hiddenCount:j,loadedHiddenCount:W,unloadedHiddenCount:H,showLoadAll:L,handleLoadEarlierClick:be,handleLoadAllClick:we}}function Gf(e){return e==="completed"||e==="failed"||e==="interrupted"}function Ff(e,r){if(!r||r.id!==e.id||r.items.length===0)return e;const n=new Set(e.items.map(o=>o.id)),a=r.items.filter(o=>!n.has(o.id));return a.length===0?e:{...e,items:[...a,...e.items]}}function Hf({threadId:e,turns:r,totalTurnCount:n,pendingRequests:a=[],activeTurnId:o=null,threadRunning:s=!1,pendingSteers:l=[],livePlan:i=null,liveItems:d=null,respondingRequestId:h=null,onRespondToRequest:u,liveOutput:m,scrollRequestKey:f=0,bottomSpacer:p=0,className:g="",onTailVisibilityChange:b,loadingEarlier:v=!1,onLoadEarlier:x,ephemeralUserNote:y=null,answeredRequestNotes:k=[],activityNotes:S=[],optimisticSteers:w=[],optimisticTurn:N=null,onLoadHistoryItemDetail:C,onOpenThread:T,onSelectArtifact:P,onSelectHistoryItemDetail:K,adapter:G,autoCollapseCompletedTurns:A}){var tt,I,V,fe,Le;const J=Zo(),Z=A??(J==null?void 0:J.autoCollapseCompletedTurns)??!1,[D,te]=c.useState({}),[oe,_]=c.useState(()=>new Set),Y=(G==null?void 0:G.onLoadHistoryItemDetail)??C,z=G==null?void 0:G.onOpenLinkedThread,{expandedText:q,openExpandedText:F,openCommandDetail:E,openToolCallDetail:W,openDeferredHistoryItemDetail:H,closeExpandedText:j}=$f({loadHistoryItemDetail:Y,onSelectHistoryItemDetail:K}),{scrollContainerRef:L,scrollContentRef:U,tailSentinelRef:X,topSentinelRef:se,handleScroll:Q,handleWheel:de,handleTouchStart:re,handleTouchMove:ue,handleTouchEnd:be,preserveScrollPositionForResize:ve,serverManagedHistory:Pe,effectiveTotalTurnCount:le,startIndex:Ne,visibleTurnAbsoluteOffset:we,hiddenCount:O,loadedHiddenCount:ce,unloadedHiddenCount:xe,showLoadAll:ye,handleLoadEarlierClick:Me,handleLoadAllClick:_e}=Bf({threadId:e,turnsLength:r.length,totalTurnCount:n,loadingEarlier:v,onLoadEarlier:x,scrollRequestKey:f,bottomSpacer:p,onTailVisibilityChange:b,contentRevisionInputs:[r,a,l,w,m,i,d,N,k,S,y,p]}),Te=c.useCallback((ne,Fe)=>{te(Ge=>({...Ge,[ne]:!Fe}))},[]),$e=c.useCallback((ne,Fe)=>{const Ge=D[ne.id];return Ge!==void 0?Ge:!!(Z&&Gf(ne.status)&&!Fe.forceActive&&!Fe.hasLiveActivity)},[D,Z]),R=Pe?r:r.slice(Ne),pe=le+1,M=s&&(!o||!R.some(ne=>ne.id===o)&&(N==null?void 0:N.id)!==o),$=(N==null?void 0:N.id)??((tt=R.at(-1))==null?void 0:tt.id)??null,ee=M&&$!==null,me=!!d&&(R.some(ne=>ne.id===d.turnId)||(N==null?void 0:N.id)===d.turnId),ke=d&&me?d.turnId:d&&ee?$:null,Re=N&&ke===N.id?(d==null?void 0:d.items)??null:null,je=((d==null?void 0:d.items.length)??0)>0,De=d&&ke===null?d.items:null,Ve=c.useMemo(()=>d&&ke===null&&d.items.length>0?Af(d.turnId,d.items):null,[d,ke]),Qe=Math.max(1,le+(N?1:0)),at=!!m&&!!N&&N.status!=="failed"&&!Re,rt=m&&R.length>0?o&&R.some(ne=>ne.id===o)?o:((I=R.findLast(ne=>al(ne.status)))==null?void 0:I.id)??(ee?$:null):null,lt=!!rt,it=c.useMemo(()=>nl(m),[m]),He=[...l.map(ne=>({id:ne.id,prompt:ne.prompt,status:"Accepted",createdAt:ne.createdAt,canCancel:!0})),...w.map(ne=>({id:ne.id,prompt:ne.prompt,status:ne.status==="steering"?"Steering":null,createdAt:ne.createdAt,canCancel:!1}))].sort((ne,Fe)=>ne.createdAt.localeCompare(Fe.createdAt)),Oe=c.useMemo(()=>Ip({answeredRequestNotes:k,pendingRequests:a,visibleTurns:R,optimisticTurn:N}),[k,N,a,R]),We=c.useMemo(()=>zp({activityNotes:S,visibleTurns:R,optimisticTurn:N}),[S,N,R]);return t.jsxs(t.Fragment,{children:[t.jsx("section",{className:`flex min-h-0 flex-1 flex-col ${g}`.trim(),children:t.jsx("div",{ref:L,"data-testid":"thread-scroll-container",onScroll:Q,onWheel:de,onTouchStart:re,onTouchMove:ue,onTouchEnd:be,onTouchCancel:be,className:"thread-graph-scroll-container min-h-0 flex-1 overflow-y-auto overscroll-contain",style:p>0?{paddingBottom:p}:void 0,children:t.jsxs("div",{ref:U,className:"thread-graph-scroll-content",children:[t.jsx("div",{ref:se,"aria-hidden":"true",className:"h-px"}),r.length>0&&t.jsx("div",{className:"thread-graph-history-control px-3 pb-1 pt-2 sm:px-5 sm:pb-1.5 sm:pt-3",children:t.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 text-xs sm:text-sm",children:[O>0&&t.jsx("button",{type:"button",onClick:Me,disabled:v,className:"thread-graph-history-button rounded-full border px-2.5 py-1.5 transition",children:v?"Loading earlier...":"Load 3 earlier"}),ye&&t.jsx("button",{type:"button",onClick:_e,className:"rounded-full border border-amber-300/40 px-2.5 py-1.5 text-amber-200 transition hover:bg-amber-300/10",children:"Load full history"}),t.jsxs("p",{className:"timeline-meta-text",children:["Showing ",R.length," of ",le," turns",O>0?` · ${O} earlier hidden${ce>0&&xe>0?` (${ce} loaded)`:""}`:""]})]})}),r.length===0&&!m&&!N&&t.jsx("div",{className:"thread-graph-empty-state px-3 py-8 text-sm sm:px-5",children:"Send the first prompt to start the thread."}),(R.length>0||N||We.leading.length>0||We.trailing.length>0)&&t.jsxs("div",{className:"thread-graph-message-list",children:[We.leading.length>0?t.jsx(or,{notes:We.leading,onOpenThread:T,onOpenLinkedThread:z}):null,R.map((ne,Fe)=>{var Ge,Ae,Xe,st,bt;return t.jsxs("div",{children:[(((Ge=We.beforeTurnId.get(ne.id))==null?void 0:Ge.length)??0)>0?t.jsx(or,{notes:We.beforeTurnId.get(ne.id)??[],onOpenThread:T,onOpenLinkedThread:z}):null,(((Ae=Oe.beforeTurnId.get(ne.id))==null?void 0:Ae.length)??0)>0?t.jsx(Fn,{entries:Oe.beforeTurnId.get(ne.id)??[],respondingRequestId:h,onRespondToRequest:u??void 0}):null,(()=>{const Tt=Ff(ne,N),vt=(i==null?void 0:i.turnId)===ne.id?i:null,ge=ke===ne.id?(d==null?void 0:d.items)??null:null,Ie=rt===ne.id?m:"",et=o===ne.id||ee&&$===ne.id,Ke=!!vt||!!Ie||!!(ge&&ge.length>0),kt=$e(Tt,{forceActive:et,hasLiveActivity:Ke});return t.jsx(xn,{threadId:e,...G?{adapter:G}:{},turn:Tt,absoluteIndex:we+Fe+1,isCollapsed:kt,livePlan:vt,liveItems:ge,liveOutput:Ie,forceActive:et,onToggleCollapse:Te,onOpenExpandedText:F,onOpenCommandDetail:E,onOpenToolCallDetail:W,onOpenDeferredHistoryItemDetail:H,onBeforeMessageResize:ve,...P?{onSelectArtifact:P}:{},scrollRootRef:L,articleRef:void 0})})(),(((Xe=We.afterTurnId.get(ne.id))==null?void 0:Xe.length)??0)>0?t.jsx(or,{notes:We.afterTurnId.get(ne.id)??[],onOpenThread:T,onOpenLinkedThread:z}):null,(st=Oe.notesByTurnId.get(ne.id))!=null&&st.length||(bt=Oe.pendingRequestsByTurnId.get(ne.id))!=null&&bt.length?t.jsx(Rp,{notes:Oe.notesByTurnId.get(ne.id)??[],requests:Oe.pendingRequestsByTurnId.get(ne.id)??[],respondingRequestId:h,onRespondToRequest:u??void 0}):null]},ne.id)}),N&&R.every(ne=>ne.id!==N.id)&&t.jsxs(t.Fragment,{children:[(((V=We.beforeTurnId.get(N.id))==null?void 0:V.length)??0)>0?t.jsx(or,{notes:We.beforeTurnId.get(N.id)??[],onOpenThread:T,onOpenLinkedThread:z}):null,(((fe=Oe.beforeTurnId.get(N.id))==null?void 0:fe.length)??0)>0?t.jsx(Fn,{entries:Oe.beforeTurnId.get(N.id)??[],respondingRequestId:h,onRespondToRequest:u??void 0}):null,(()=>{const ne=at?m:"",Fe=o===N.id||ee&&$===N.id,Ge=!!(Re&&Re.length>0)||!!ne,Ae=$e(N,{forceActive:Fe,hasLiveActivity:Ge});return t.jsx(xn,{threadId:e,...G?{adapter:G}:{},turn:N,absoluteIndex:pe,isCollapsed:Ae,livePlan:null,liveItems:Re,liveOutput:ne,forceActive:Fe,onToggleCollapse:Te,onOpenExpandedText:F,onOpenCommandDetail:E,onOpenToolCallDetail:W,onOpenDeferredHistoryItemDetail:H,onBeforeMessageResize:ve,...P?{onSelectArtifact:P}:{},scrollRootRef:L})})(),(((Le=We.afterTurnId.get(N.id))==null?void 0:Le.length)??0)>0?t.jsx(or,{notes:We.afterTurnId.get(N.id)??[],onOpenThread:T,onOpenLinkedThread:z}):null]})]}),He.length>0&&t.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:He.map(ne=>t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Dt,{threadId:e,item:{id:ne.id,kind:"userMessage",text:ne.prompt,status:ne.status},scrollRootRef:L,onBeforeMessageResize:ve,...G?{adapter:G}:{}}),e&&ne.canCancel&&(G!=null&&G.cancelPendingSteer)?t.jsx("div",{className:"flex justify-end px-1",children:t.jsx("button",{type:"button",className:"thread-graph-history-button rounded-full border px-2.5 py-1 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",disabled:oe.has(ne.id),onClick:()=>{var Fe;_(Ge=>new Set(Ge).add(ne.id)),Promise.resolve((Fe=G.cancelPendingSteer)==null?void 0:Fe.call(G,e,ne.id)).catch(()=>{}).finally(()=>{_(Ge=>{const Ae=new Set(Ge);return Ae.delete(ne.id),Ae})})},children:oe.has(ne.id)?"Canceling...":"Cancel"})}):null]},ne.id))}),(Oe.trailing.length>0||We.trailing.length>0)&&t.jsx(Mp,{entries:[...We.trailing.map(ne=>({kind:"activity",id:ne.id,createdAt:ne.createdAt,note:ne})),...Oe.trailing],respondingRequestId:h,onRespondToRequest:u??void 0,onOpenThread:T,onOpenLinkedThread:z}),y&&t.jsx("div",{className:"thread-graph-message-section px-3 py-2.5 sm:px-5",children:t.jsx(Dt,{threadId:e,item:{id:"ephemeral-plan-decision-note",kind:"userMessage",text:y},scrollRootRef:L,onBeforeMessageResize:ve})}),Ve&&De&&De.length>0&&t.jsx(xn,{threadId:e,...G?{adapter:G}:{},turn:Ve,absoluteIndex:Qe,isCollapsed:D[Ve.id]??!1,livePlan:(i==null?void 0:i.turnId)===Ve.id?i:null,liveItems:De,liveOutput:"",forceActive:!0,onToggleCollapse:Te,onOpenExpandedText:F,onOpenCommandDetail:E,onOpenToolCallDetail:W,onOpenDeferredHistoryItemDetail:H,onBeforeMessageResize:ve,...P?{onSelectArtifact:P}:{},scrollRootRef:L}),m&&!lt&&!at&&!je&&t.jsx("div",{className:"thread-graph-message-section px-3 py-2.5 sm:px-5",children:it?t.jsx(na,{threadId:e,item:it,scrollRootRef:L,onOpenExpandedText:F,onOpenCommandDetail:E,onOpenToolCallDetail:W,onOpenDeferredHistoryItemDetail:H,onBeforeMessageResize:ve,...P?{onSelectArtifact:P}:{},...G?{adapter:G}:{}}):t.jsx(Dt,{threadId:e,item:{id:"live-agent-message-fallback",kind:"agentMessage",text:m},scrollRootRef:L,streaming:!0,onBeforeMessageResize:ve,...G?{adapter:G}:{}})}),t.jsx("div",{ref:X,"aria-hidden":"true",className:"h-px w-full"})]})})}),t.jsx(Xm,{open:q!==null,title:(q==null?void 0:q.title)??"Full text",text:(q==null?void 0:q.text)??"",onClose:j})]})}var pl=c.memo(Hf);function Of(e){return/^[a-z]$/i.test(e)?String.fromCharCode(e.toUpperCase().charCodeAt(0)-64):null}function Wn(e){return e.replace(/\r\n/g,`
|
|
3655
|
+
`)}function Ns(e){const r=Wn(e),n=r.split(`
|
|
3656
|
+
`);return r.endsWith(`
|
|
3657
|
+
`)&&n.at(-1)===""&&n.pop(),n}function Wf(e){const r=e.trim();return r?/(?:[$%#>])\s*$/.test(r):!1}function Uf(e,r){const n=r.trim();if(!n||e.length===0)return e;const[a,...o]=e;if(a===void 0)return e;const s=a.trim();return s===n||s.endsWith(` ${n}`)||s.endsWith(`$ ${n}`)||s.endsWith(`% ${n}`)||s.endsWith(`# ${n}`)||s.endsWith(`> ${n}`)?o:e}function Vf(e,r,n){var d,h;const a=Ns(e),o=Ns(r);let s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s+=1;let l=0;for(;l<a.length-s&&l<o.length-s&&a[a.length-1-l]===o[o.length-1-l];)l+=1;let i=o.slice(s,o.length-l);for(i=Uf(i,n);i.length>0&&((d=i[0])==null?void 0:d.trim())==="";)i.shift();for(;i.length>0&&(((h=i.at(-1))==null?void 0:h.trim())===""||Wf(i.at(-1)??""));)i.pop();return i.join(`
|
|
3658
|
+
`).trimEnd()}function Kf(e){switch(e){case"ctrl_c":return"";case"ctrl_d":return"";case"esc":return"\x1B";case"tab":return" ";case"up":return"\x1B[A";case"down":return"\x1B[B"}}function Cs(e){return{background:e==="light"?"#f2ede5":"#0c1117",foreground:e==="light"?"#3f3a36":"#d6dde6",cursor:e==="light"?"#3f3a36":"#d6dde6",black:e==="light"?"#d8cfc2":"#0f1720",brightBlack:e==="light"?"#8a7f73":"#475569",red:"#f87171",brightRed:"#fb7185",green:e==="light"?"#16a34a":"#86efac",brightGreen:e==="light"?"#22c55e":"#4ade80",yellow:"#fbbf24",brightYellow:"#fcd34d",blue:e==="light"?"#2563eb":"#93c5fd",brightBlue:e==="light"?"#3b82f6":"#60a5fa",magenta:e==="light"?"#7c3aed":"#c4b5fd",brightMagenta:e==="light"?"#8b5cf6":"#a78bfa",cyan:e==="light"?"#0891b2":"#67e8f9",brightCyan:e==="light"?"#06b6d4":"#22d3ee",white:e==="light"?"#5b5148":"#e2e8f0",brightWhite:e==="light"?"#2c2723":"#f8fafc"}}function bn(e){switch(e){case"not_created":return"Not created";case"creating":return"Creating";case"running":return"Running";case"attached":return"Attached";case"detached":return"Detached";case"exited":return"Exited";case"not_found":return"Missing";case"workspace_missing":return"Workspace missing"}}function Zr(e){if(!e)return"";const r=e.replace(/[\\/]+$/,"");return r?r.split(/[\\/]/).filter(Boolean).at(-1)??r:""}function aa(e,r){const n=[r==null?void 0:r.trim(),e==null?void 0:e.trim()].filter(Boolean);return n.length>0?n.join(" "):null}function vn(e){return Math.min(75,Math.max(25,e))}function qf(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4 fill-current",children:[t.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),t.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),t.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function Xf({connected:e}){return e?t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})}):t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-4.5 4.5c-.258.26-.479.541-.661.84m1.903 6.405a4.495 4.495 0 0 1-1.242-.88 4.483 4.483 0 0 1-1.062-1.683m6.587 2.345 5.907 5.907m-5.907-5.907L8.898 8.898M2.991 2.99 8.898 8.9"})})}function Ss(){return t.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M5.5 3.25h5"}),t.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function kn({label:e,tone:r="stone"}){const n=r==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-600 dark:text-rose-50":r==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-600 dark:text-sky-50":"shell-control-chip border";return t.jsx("span",{className:`inline-flex min-w-[3.45rem] items-center justify-center rounded-full border px-2.5 py-1.5 text-[11px] font-medium tracking-[0.12em] ${n}`,children:e})}var Yf=120,Zf=800,Jf=4e3,Qf=4500,eg="Shell connection timed out. Reconnecting...";function tg({isCurrentSocket:e,viewerId:r}){return!e||r?null:{connectionError:eg,isConnecting:!1,settleAttachPromise:!1,closeSocket:!0}}function rg({isCurrentSocket:e,shellId:r,attachSize:n}){return e?{message:{type:"shell.attach",shellId:r,cols:n.cols,rows:n.rows},shouldScheduleAttachTimeout:!0}:null}function ng({intentionalDisconnect:e,userDisconnectedShellId:r,shellId:n}){return!e&&r!==n}function ag({isCurrentSocket:e,hadViewer:r,intentionalDisconnect:n,userDisconnectedShellId:a,shellId:o}){return e?{shouldDetachShell:r,shouldScheduleReconnect:ng({intentionalDisconnect:n,userDisconnectedShellId:a,shellId:o})}:null}function sg({hasAttachSize:e,hasPendingRetry:r}){return!e&&!r}function fl({shellId:e,terminalReady:r,isVisible:n,canAttachShell:a,userDisconnectedShellId:o,hasTerminal:s,attachSize:l,hasPendingAttachRetry:i,hasCurrentSocketForShell:d,hasReconnectTimer:h}){return!e||!r||!n||!a||o===e||!s?{type:"skip"}:l===void 0?{type:"measureSize"}:l?d?{type:"reuseSocket",shouldClearAttachRetry:i}:{type:"startAttach",attachSize:l,shouldClearAttachRetry:i,shouldClearReconnectTimer:h}:sg({hasAttachSize:!1,hasPendingRetry:i})?{type:"scheduleRetry"}:{type:"skip"}}function og({hasShellId:e,terminalReady:r,workspacePathMissing:n,hasViewer:a,hasPendingAttach:o}){return!e||!r||n?{type:"reject"}:a?{type:"alreadyConnected"}:o?{type:"joinPending"}:{type:"startAttach"}}function lg({shellId:e,userDisconnectedShellId:r}){return{shouldClearUserDisconnectedShellId:!!e&&r===e,intentionalDisconnect:!1,connectionError:null,isConnecting:!0,shouldIncrementReconnectKey:!0}}function ig({hasShell:e}){return e?null:{viewerId:null,isConnecting:!1,settleAttachPromise:!1,connectionError:null,runtimePromptLabel:null,isCommandRunning:!1,shellSnapshot:"",lastCommandOutput:"",pendingCommand:null,shouldResetTerminal:!0}}function dg({hasReconnectTimer:e,hasAttachTimeout:r,hasAttachRetry:n}){return{shouldClearReconnectTimer:e,shouldClearAttachTimeout:r,shouldClearAttachRetry:n,settleAttachPromise:!1}}function gl({shellId:e,viewerId:r}){return e&&r?{type:"shell.detach",shellId:e,viewerId:r}:null}function cg({shellId:e,viewerId:r,hasSocket:n}){return{userDisconnectedShellId:e,intentionalDisconnect:!0,detachMessage:gl({shellId:e,viewerId:r}),shouldCloseSocket:n,shouldClearSocketRef:!0,shouldClearLastSentSize:!0,shouldDetachShell:!!e}}function hg({shellId:e,viewerId:r,socketReadyState:n,openReadyState:a,hasAttachRetryTimer:o,hasAttachTimeout:s,isCurrentSocket:l}){const i=gl({shellId:e,viewerId:r});return{intentionalDisconnect:!0,shouldClearAttachRetry:o,detachMessage:i,shouldSendDetachMessage:!!(i&&n===a),shouldClearViewer:!0,isConnecting:!1,settleAttachPromise:l?!1:void 0,shouldClearAttachTimeout:s,shouldCloseSocket:!0,shouldClearSocketRef:l}}function ug({size:e,previousSize:r,shellId:n,viewerId:a,syncBackendSize:o}){return o?(r==null?void 0:r.cols)===e.cols&&r.rows===e.rows?{nextLastSentSize:r,message:null}:{nextLastSentSize:e,message:n&&a?{type:"shell.resize",shellId:n,viewerId:a,cols:e.cols,rows:e.rows}:null}:{nextLastSentSize:r??e,message:null}}function mg(e,r){const n=typeof e.cwdBaseName=="string"?e.cwdBaseName:null,a=typeof e.envPrefix=="string"?e.envPrefix:null;return{data:typeof e.data=="string"?e.data:"",replace:e.replace===!0,cursorX:typeof e.cursorX=="number"?e.cursorX:void 0,cursorY:typeof e.cursorY=="number"?e.cursorY:void 0,paneHeight:typeof e.paneHeight=="number"?e.paneHeight:void 0,promptLabel:aa(n??Zr(r),a),isCommandRunning:e.isCommandRunning===!0}}function pg({currentSnapshot:e,data:r,replace:n,isCommandRunning:a,pendingCommand:o}){if(!r)return{nextSnapshot:e,nextPendingCommand:o,lastCommandOutput:null};const s=Wn(n?r:`${e}${r}`);return!n||a||!o?{nextSnapshot:s,nextPendingCommand:o,lastCommandOutput:null}:{nextSnapshot:s,nextPendingCommand:null,lastCommandOutput:Vf(o.beforeSnapshot,s,o.command)}}function fg({event:e,currentViewerId:r}){if(e.type==="shell.output")return null;if(e.type==="shell.connected"){const a=String(e.payload.viewerId??"");return{viewerId:a||null,isConnecting:!1,settleAttachPromise:!!a,isCommandRunning:void 0,connectionError:void 0,intentionalDisconnect:void 0,closeSocket:!1,shellUpdate:{status:"attached",attachedViewerId:a}}}if(e.type==="shell.error")return{viewerId:void 0,isConnecting:!1,settleAttachPromise:!1,isCommandRunning:void 0,connectionError:String(e.payload.message??"Shell connection failed."),intentionalDisconnect:void 0,closeSocket:!1,shellUpdate:e.payload.code==="viewer_conflict"?{status:"detached",attachedViewerId:null}:void 0};if(e.type==="shell.detached"){const a=String(e.payload.viewerId??"");if(!a||a!==r)return null;const o=String(e.payload.reason??"");return{viewerId:null,isConnecting:!1,settleAttachPromise:!1,isCommandRunning:!1,connectionError:o==="replaced"?"This shell connection was taken over by another pane or device.":null,intentionalDisconnect:o==="replaced"?!0:void 0,closeSocket:!0,shellUpdate:{status:"detached",attachedViewerId:null}}}if(e.type==="shell.exited")return{viewerId:null,isConnecting:!1,settleAttachPromise:!1,isCommandRunning:!1,connectionError:void 0,intentionalDisconnect:!0,closeSocket:!0,shellUpdate:{status:e.payload.state==="exited"?"exited":"not_found",attachedViewerId:null}};const n=e.payload.state;return{viewerId:n==="attached"?void 0:null,isConnecting:n==="attached"?void 0:!1,settleAttachPromise:n==="attached"?void 0:!1,isCommandRunning:n==="attached"?void 0:!1,connectionError:void 0,intentionalDisconnect:void 0,closeSocket:!1,shellUpdate:{status:n,attachedViewerId:n==="attached"?void 0:null}}}function xl(e,r,n,a,o){const s=r.replace(/\r\n/g,`
|
|
3659
|
+
`),l=s.split(`
|
|
3660
|
+
`);s.endsWith(`
|
|
3661
|
+
`)&&l.at(-1)===""&&l.pop();let d=l.join(`\r
|
|
3662
|
+
`);if(n!==void 0&&a!==void 0){const u=(o!==void 0?Math.max(0,l.length-o):0)+a,m=Math.max(0,l.length-u-1);m>0&&(d+=`\x1B[${m}A`),d+=`\r\x1B[${n+1}G`}e.reset(),e.write(d,()=>{e.scrollToBottom()})}function Ts(e){return e?Array.from(e.querySelectorAll(".xterm-rows > div")).map(n=>n.textContent??"").filter((n,a,o)=>n.length>0||a<o.length-1).join(`
|
|
3663
|
+
`).trimEnd():""}function gg({clearTimeout:e}){let r=null;const n=o=>{(o==null?void 0:o.timer)!==null&&(o==null?void 0:o.timer)!==void 0&&e(o.timer)};return{hasPending:()=>!!r,joinPending:()=>new Promise(o=>{r==null||r.waiters.push(o)}),start:({timeoutMs:o,setTimeout:s,onTimeout:l})=>new Promise(i=>{const d=s(()=>{r=null,l(),i(!1)},o);r={waiters:[i],timer:d}}),settle:o=>{const s=r;if(s){r=null,n(s);for(const l of s.waiters)l(o)}},clear:()=>{const o=r;r=null,n(o)}}}var Es={status:"not_created",shellInputEnabled:!1,isConnecting:!1,isCommandRunning:!1,promptLabel:null,error:null,hasShell:!1};function mt(e){return e.status!=="exited"&&e.status!=="not_found"}function xg({shell:e,workspacePathMissing:r}){return!!(e&&!r&&mt(e))}function bg(e,r){return e.status===r.status&&e.shellInputEnabled===r.shellInputEnabled&&e.isConnecting===r.isConnecting&&e.isCommandRunning===r.isCommandRunning&&e.promptLabel===r.promptLabel&&e.error===r.error&&e.hasShell===r.hasShell}function vg(e){return(e.activeShellId?e.shells.find(r=>r.id===e.activeShellId&&mt(r)):null)??(e.shell&&mt(e.shell)?e.shell:null)??e.shells.find(mt)??null}function kg({activeRuntime:e,activeShell:r,busy:n,loading:a,status:o,workspacePathMissing:s}){const l=n||a||o==="creating"||s,i=e.shellInputEnabled?"Disconnect shell":r&&!mt(r)?"Restart shell":r?"Connect shell":"Create shell",d=e.shellInputEnabled?"border-emerald-300/45 bg-emerald-300/18 text-emerald-50 ring-1 ring-emerald-300/20 hover:bg-emerald-300/24":r&&!mt(r)?"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800":s?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800";return{disabled:l,label:i,className:d}}function wg({activeRuntime:e,activeShell:r,connectionButtonDisabled:n,connectionButtonLabel:a,isMobileShell:o,busy:s,loading:l,error:i}){return{status:e.status,connectionButtonDisabled:n,connectionButtonLabel:a,shellInputEnabled:e.shellInputEnabled,isConnecting:e.isConnecting,isCommandRunning:e.isCommandRunning,promptLabel:e.promptLabel??(r?aa(Zr(r.cwd),null):null),isMobileShell:o,hasShell:!!r,busy:s,loading:l,error:e.error??i}}function _t(e){return e.current===null?!1:(window.clearTimeout(e.current),e.current=null,!0)}function yg({attachRetryTimerRef:e,setReconnectKey:r,delayMs:n=Yf}){e.current=window.setTimeout(()=>{e.current=null,r(a=>a+1)},n)}function jg({reconnectTimerRef:e,setReconnectKey:r,delayMs:n=Zf}){e.current=window.setTimeout(()=>{e.current=null,r(a=>a+1)},n)}function Ng({shellSocket:e,socketRef:r,viewerIdRef:n,attachTimeoutRef:a,setConnectionError:o,setIsConnecting:s,settleAttachPromise:l,delayMs:i=Jf}){a.current=window.setTimeout(()=>{var h,u,m;a.current=null;const d=tg({isCurrentSocket:!e.socket||((h=r.current)==null?void 0:h.socket)===e.socket,viewerId:n.current});d&&(o(d.connectionError),s(d.isConnecting),l(d.settleAttachPromise),d.closeSocket&&((u=e.close)==null||u.call(e),(m=e.socket)==null||m.close()))},i)}function Cg(e){return{...e,status:e.status==="attached"?"detached":e.status,attachedViewerId:null}}function Sg({shellId:e,viewerId:r,shellSocket:n,attachRetryTimerRef:a,attachTimeoutRef:o,socketRef:s,openReadyState:l}){var i;return hg({shellId:e,viewerId:r,socketReadyState:n.socket.readyState,openReadyState:l,hasAttachRetryTimer:a.current!==null,hasAttachTimeout:o.current!==null,isCurrentSocket:((i=s.current)==null?void 0:i.socket)===n.socket})}function Tg({closeApplication:e,shellId:r,attachTimeoutRef:n,socketRef:a,reconnectTimerRef:o,setViewerId:s,setIsConnecting:l,settleAttachPromise:i,onShellUpdate:d,setReconnectKey:h}){const u=e.closeAction;return u?(e.shouldClearAttachTimeout&&_t(n),e.shouldClearSocketRef&&(a.current=null),s(e.viewerId),l(e.isConnecting),i(e.settleAttachPromise),u.shouldDetachShell&&d(r,Cg,"detached"),u.shouldScheduleReconnect&&jg({reconnectTimerRef:o,setReconnectKey:h}),!0):!1}function Eg({cleanupAction:e,shellSocket:r,attachRetryTimerRef:n,attachTimeoutRef:a,socketRef:o,intentionalDisconnectRef:s,setViewerId:l,setIsConnecting:i,settleAttachPromise:d}){s.current=e.intentionalDisconnect,e.shouldClearAttachRetry&&_t(n),e.shouldSendDetachMessage&&e.detachMessage&&r.send(e.detachMessage),l(null),i(e.isConnecting),e.settleAttachPromise!==void 0&&d(e.settleAttachPromise),e.shouldClearAttachTimeout&&_t(a),r.socket.close(),e.shouldClearSocketRef&&(o.current=null)}function Lg({eventShellId:e,shellId:r,socketExists:n,isCurrentSocket:a}){return n&&!a?!1:e===r}function Pg(e){return fl({...e,attachSize:void 0})}function Ig({attachSize:e,...r}){return fl({...r,attachSize:e})}function zg({isCurrentSocket:e,shellId:r,attachSize:n,hasAttachTimeout:a}){const o=rg({isCurrentSocket:e,shellId:r,attachSize:n});return{openAction:o,shouldClearAttachTimeout:!!(o&&a)}}function Rg(e){const r=String(e.payload.viewerId??"");return{viewerId:r||null,settleAttachPromise:!!r,nextShell:n=>({...n,status:"attached",attachedViewerId:r})}}function Mg({event:e,shellCwd:r,currentSnapshot:n,pendingCommand:a}){const o=mg(e.payload,r),s=o.data?pg({currentSnapshot:n,data:o.data,replace:o.replace,isCommandRunning:o.isCommandRunning,pendingCommand:a}):null;return{output:o,snapshotUpdate:s}}function _g({isCurrentSocket:e,hadViewer:r,intentionalDisconnect:n,userDisconnectedShellId:a,shellId:o,hasAttachTimeout:s}){const l=ag({isCurrentSocket:e,hadViewer:r,intentionalDisconnect:n,userDisconnectedShellId:a,shellId:o});return{closeAction:l,shouldClearAttachTimeout:!!(l&&s),shouldClearSocketRef:!!l,viewerId:null,isConnecting:!1,settleAttachPromise:!1}}function Ag(e,r){return r.shellUpdate?{...e,status:r.shellUpdate.status==="attached"||r.shellUpdate.status==="detached"||r.shellUpdate.status==="exited"||r.shellUpdate.status==="not_found"?r.shellUpdate.status:e.status,attachedViewerId:r.shellUpdate.attachedViewerId===void 0?e.attachedViewerId:r.shellUpdate.attachedViewerId}:e}function $g(e){return e.current}function Dg({shell:e,shellAdapter:r,canAttachShell:n,terminalReady:a,reconnectKey:o,terminalRef:s,socketRef:l,viewerIdRef:i,shellIdRef:d,reconnectTimerRef:h,attachTimeoutRef:u,attachRetryTimerRef:m,isVisibleRef:f,intentionalDisconnectRef:p,userDisconnectedShellIdRef:g,shellSnapshotRef:b,pendingCommandRef:v,lastCommandOutputRef:x,snapshotCursorRef:y,syncTerminalSizeRef:k,setReconnectKey:S,setViewerId:w,setIsConnecting:N,setConnectionError:C,setRuntimePromptLabel:T,setIsCommandRunning:P,settleAttachPromise:K,onShellUpdate:G}){const A=e==null?void 0:e.id,J=e==null?void 0:e.cwd;c.useEffect(()=>{const Z=s.current,D={shellId:A??null,terminalReady:a,isVisible:f.current,canAttachShell:n,userDisconnectedShellId:g.current,hasTerminal:!!Z,hasPendingAttachRetry:m.current!==null,hasCurrentSocketForShell:!!(l.current&&d.current===A),hasReconnectTimer:h.current!==null};if(Pg(D).type==="skip")return;const oe=k.current(),_=Ig({...D,attachSize:oe});if(_.type==="skip"||_.type==="measureSize")return;if(_.type==="scheduleRetry"){yg({attachRetryTimerRef:m,setReconnectKey:S});return}if(_.shouldClearAttachRetry&&_t(m),_.type==="reuseSocket"||(_.shouldClearReconnectTimer&&_t(h),!A||!Z))return;const Y=_.attachSize;d.current=A,Z.reset(),C(null),w(null),N(!0),p.current=!1;const z=r.connectSocket({onConnected:()=>{var W;const q=u.current,F=zg({isCurrentSocket:((W=l.current)==null?void 0:W.socket)===z.socket,shellId:A,attachSize:Y,hasAttachTimeout:q!==null}),E=F.openAction;E&&(z.send(E.message),F.shouldClearAttachTimeout&&q!==null&&_t(u),E.shouldScheduleAttachTimeout&&Ng({shellSocket:z,socketRef:l,viewerIdRef:i,attachTimeoutRef:u,setConnectionError:C,setIsConnecting:N,settleAttachPromise:K}))},onShellEvent:q=>{var W;if(!Lg({eventShellId:q.shellId,shellId:A,socketExists:!!z.socket,isCurrentSocket:((W=l.current)==null?void 0:W.socket)===z.socket}))return;if(q.type==="shell.connected"){_t(u);const H=Rg(q);w(H.viewerId),N(!1),K(H.settleAttachPromise),G(A,H.nextShell,"attached");return}if(q.type==="shell.output"){const{output:H,snapshotUpdate:j}=Mg({event:q,shellCwd:J,currentSnapshot:b.current,pendingCommand:v.current});y.current={cursorX:H.cursorX,cursorY:H.cursorY,paneHeight:H.paneHeight},T(H.promptLabel),P(H.isCommandRunning),j&&(b.current=j.nextSnapshot,v.current=j.nextPendingCommand,j.lastCommandOutput!==null&&(x.current=j.lastCommandOutput),H.replace?xl(Z,H.data,H.cursorX,H.cursorY,H.paneHeight):Z.write(H.data));return}const E=fg({event:q,currentViewerId:i.current});E&&(E.viewerId!==void 0&&w(E.viewerId),E.isConnecting!==void 0&&N(E.isConnecting),E.settleAttachPromise!==void 0&&K(E.settleAttachPromise),E.isCommandRunning!==void 0&&P(E.isCommandRunning),E.connectionError!==void 0&&C(E.connectionError),E.intentionalDisconnect!==void 0&&(p.current=E.intentionalDisconnect),E.shellUpdate&&G(A,H=>Ag(H,E),E.shellUpdate.status),E.closeSocket&&z.socket.close())}});return l.current=z,z.socket.addEventListener("close",()=>{var E;const q=u.current,F=_g({isCurrentSocket:((E=l.current)==null?void 0:E.socket)===z.socket,hadViewer:!!i.current,intentionalDisconnect:p.current,userDisconnectedShellId:g.current,shellId:A,hasAttachTimeout:q!==null});Tg({closeApplication:F,shellId:A,attachTimeoutRef:u,socketRef:l,reconnectTimerRef:h,setViewerId:w,setIsConnecting:N,settleAttachPromise:K,onShellUpdate:G,setReconnectKey:S})}),()=>{const q=$g(i),F=Sg({shellId:A,viewerId:q,shellSocket:z,attachRetryTimerRef:m,attachTimeoutRef:u,socketRef:l,openReadyState:WebSocket.OPEN});Eg({cleanupAction:F,shellSocket:z,attachRetryTimerRef:m,attachTimeoutRef:u,socketRef:l,intentionalDisconnectRef:p,setViewerId:w,setIsConnecting:N,settleAttachPromise:K})}},[m,u,n,p,f,x,G,v,o,h,C,P,N,S,T,w,K,J,A,r,d,b,y,l,k,a,s,g,i])}function wn(e){return e.current}var Ls=c.forwardRef(function({paneId:r,shell:n,isActive:a,isVisible:o,isMobileShell:s,effectiveTheme:l,workspacePathMissing:i,shellAdapter:d,onActivate:h,onShellUpdate:u,onRuntimeStateChange:m,onFeedback:f},p){const g=c.useRef(null),b=c.useRef(null),v=c.useRef(null),x=c.useRef(null),y=c.useRef(null),k=c.useRef(null),S=c.useRef(null),w=c.useRef(null),N=c.useRef(!1),C=c.useRef(null),T=c.useRef(""),P=c.useRef(null),K=c.useRef(""),G=c.useRef(null),A=c.useRef(null),J=c.useRef({cursorX:void 0,cursorY:void 0,paneHeight:void 0}),Z=c.useRef(!1),D=c.useRef(null),te=c.useRef(o),oe=c.useRef(s),_=c.useRef(()=>!1),Y=c.useRef(()=>null),z=c.useRef(()=>{}),q=c.useRef(gg({clearTimeout:window.clearTimeout})),[F,E]=c.useState(null),[W,H]=c.useState(!1),[j,L]=c.useState(null),[U,X]=c.useState(!1),[se,Q]=c.useState(null),[de,re]=c.useState(null),[ue,be]=c.useState(!1),[ve,Pe]=c.useState(0),le=(n==null?void 0:n.status)??"not_created",Ne=xg({shell:n,workspacePathMissing:i}),we=c.useMemo(()=>aa(Zr(n==null?void 0:n.cwd),null),[n==null?void 0:n.cwd]),O=de??we,ce=c.useCallback(R=>{x.current=R,L(R)},[]),xe=c.useCallback(R=>{q.current.settle(R)},[]);c.useEffect(()=>{te.current=o},[o]),c.useEffect(()=>{oe.current=s},[s]),c.useEffect(()=>{y.current=(n==null?void 0:n.id)??null},[n==null?void 0:n.id]);const ye=c.useCallback(R=>{const pe=v.current,M=y.current,$=x.current;return!pe||!M||!$?!1:(pe.send({type:"shell.input",shellId:M,viewerId:$,data:R}),!0)},[]);c.useEffect(()=>{_.current=ye},[ye]);const Me=c.useCallback(()=>{const R=v.current,pe=y.current,M=x.current;return!R||!pe||!M?!1:(R.send({type:"shell.clear",shellId:pe,viewerId:M}),!0)},[]),_e=c.useCallback(()=>{if(!o||!F)return!1;const R=F.getBoundingClientRect();return R.width>0&&R.height>0},[o,F]),Te=c.useCallback(R=>{const pe=g.current,M=b.current;if(!pe||!M||!_e()||(M.fit(),pe.cols<=0||pe.rows<=0))return null;const $={cols:pe.cols,rows:pe.rows},ee=ug({size:$,previousSize:A.current,shellId:y.current,viewerId:x.current,syncBackendSize:(R==null?void 0:R.syncBackendSize)!==!1});return(R==null?void 0:R.syncBackendSize)===!1||(A.current=ee.nextLastSentSize,!ee.message)||v.current&&v.current.send(ee.message),$},[_e]);c.useEffect(()=>{Y.current=Te},[Te]);const $e=c.useCallback(R=>{const pe=g.current;!pe||!_e()||(Te((R==null?void 0:R.syncBackendSize)===void 0?void 0:{syncBackendSize:R.syncBackendSize}),T.current&&!Ts(F)?xl(pe,T.current,J.current.cursorX,J.current.cursorY,J.current.paneHeight):pe.scrollToBottom(),R!=null&&R.focus&&!s&&pe.focus())},[s,_e,Te,F]);return c.useEffect(()=>{z.current=()=>$e()},[$e]),c.useEffect(()=>{m({status:j?"attached":le,shellInputEnabled:!!(j&&n),isConnecting:U,isCommandRunning:ue,promptLabel:O,error:se,hasShell:!!n})},[se,U,ue,m,O,n,le,j]),c.useEffect(()=>{if(!F||g.current||Z.current)return;let R=!1;return Z.current=!0,(async()=>{const[{Terminal:pe},{FitAddon:M}]=await Promise.all([qe(()=>import("./terminal-vendor-B365Go3Z.js").then(me=>me.x),__vite__mapDeps([6,2,7])),qe(()=>import("./terminal-vendor-B365Go3Z.js").then(me=>me.a),__vite__mapDeps([6,2,7]))]);if(R||!F){Z.current=!1;return}const $=new pe({cursorBlink:!0,disableStdin:oe.current,fontFamily:"IBM Plex Mono, SFMono-Regular, Menlo, monospace",fontSize:13,lineHeight:1.25,scrollback:3e3,theme:Cs(l)}),ee=new M;$.loadAddon(ee),$.open(F),g.current=$,b.current=ee,Y.current(),$.attachCustomKeyEventHandler(me=>{if(oe.current||me.type!=="keydown")return!0;if(me.ctrlKey&&!me.altKey&&!me.metaKey&&!me.shiftKey){const ke=Of(me.key);if(!ke)return!0;if(_.current(ke))return me.preventDefault(),!1}return!0}),H(!0),Z.current=!1,G.current=new ResizeObserver(()=>{z.current()}),G.current.observe(F),D.current=$.onData(me=>{oe.current||_.current(me)})})(),()=>{var pe,M,$;R=!0,Z.current=!1,(pe=D.current)==null||pe.dispose(),D.current=null,(M=G.current)==null||M.disconnect(),G.current=null,H(!1),($=g.current)==null||$.dispose(),g.current=null,b.current=null,A.current=null}},[l,F]),c.useEffect(()=>{var pe;const R=ig({hasShell:!!n});R&&(ce(R.viewerId),X(R.isConnecting),xe(R.settleAttachPromise),Q(R.connectionError),re(R.runtimePromptLabel),be(R.isCommandRunning),T.current=R.shellSnapshot,K.current=R.lastCommandOutput,P.current=R.pendingCommand,R.shouldResetTerminal&&((pe=g.current)==null||pe.reset()))},[ce,xe,n]),c.useEffect(()=>{const R=g.current;R&&(R.options.theme=Cs(l))},[l]),c.useEffect(()=>{const R=g.current;R&&(R.options.disableStdin=s)},[s]),c.useEffect(()=>{if(!o||!W)return;const R=window.requestAnimationFrame(()=>{$e({focus:a,syncBackendSize:!1}),!v.current&&(n!=null&&n.id)&&C.current!==n.id&&Pe(pe=>pe+1)});return()=>{window.cancelAnimationFrame(R)}},[a,o,$e,n==null?void 0:n.id,W]),Dg({shell:n,shellAdapter:d,canAttachShell:Ne,terminalReady:W,reconnectKey:ve,terminalRef:g,socketRef:v,viewerIdRef:x,shellIdRef:y,reconnectTimerRef:k,attachTimeoutRef:S,attachRetryTimerRef:w,isVisibleRef:te,intentionalDisconnectRef:N,userDisconnectedShellIdRef:C,shellSnapshotRef:T,pendingCommandRef:P,lastCommandOutputRef:K,snapshotCursorRef:J,syncTerminalSizeRef:Y,setReconnectKey:Pe,setViewerId:ce,setIsConnecting:X,setConnectionError:Q,setRuntimePromptLabel:re,setIsCommandRunning:be,settleAttachPromise:xe,onShellUpdate:u}),c.useEffect(()=>()=>{const R=wn(k),pe=wn(S),M=wn(w),$=dg({hasReconnectTimer:R!==null,hasAttachTimeout:pe!==null,hasAttachRetry:M!==null});$.shouldClearReconnectTimer&&R!==null&&window.clearTimeout(R),$.shouldClearAttachTimeout&&pe!==null&&window.clearTimeout(pe),$.shouldClearAttachRetry&&M!==null&&window.clearTimeout(M),xe($.settleAttachPromise)},[xe]),c.useImperativeHandle(p,()=>({disconnect(){const R=v.current,pe=y.current,M=x.current,$=cg({shellId:pe,viewerId:M,hasSocket:!!R});C.current=$.userDisconnectedShellId,N.current=$.intentionalDisconnect,R&&$.detachMessage&&R.send($.detachMessage),ce(null),X(!1),xe(!1),$.shouldCloseSocket&&(R==null||R.socket.close()),v.current=null,A.current=null,$.shouldDetachShell&&pe&&u(pe,ee=>({...ee,status:"detached",attachedViewerId:null}),"detached")},reconnect(){const R=og({hasShellId:!!y.current,terminalReady:W,workspacePathMissing:i,hasViewer:!!x.current,hasPendingAttach:q.current.hasPending()});if(R.type==="reject")return Promise.resolve(!1);if(R.type==="alreadyConnected")return Promise.resolve(!0);if(R.type==="joinPending")return q.current.joinPending();const pe=q.current.start({timeoutMs:Qf,setTimeout:window.setTimeout,onTimeout:()=>{X(!1)}}),M=lg({shellId:y.current,userDisconnectedShellId:C.current});return M.shouldClearUserDisconnectedShellId&&(C.current=null),N.current=M.intentionalDisconnect,Q(M.connectionError),X(M.isConnecting),Pe($=>$+1),pe},sendInput(R){return ye(R)},sendCommand(R){const pe={command:R,beforeSnapshot:T.current};if(P.current=pe,R.trim()==="clear"){const ee=Me();return!ee&&P.current===pe&&(P.current=null),ee}const M=R.endsWith(`
|
|
3664
|
+
`)?R:`${R}
|
|
3665
|
+
`,$=ye(M);return!$&&P.current===pe&&(P.current=null),$},sendControl(R){return R==="clear"?Me():ye(Kf(R))},async copyLastCommandOutput(){const R=K.current.trim()||Ts(F);if(!R)return f==null||f("failed","Nothing to copy"),!1;try{return await navigator.clipboard.writeText(R),f==null||f("done","Copied"),!0}catch{return f==null||f("failed","Copy failed"),!1}},focus(){var R;(R=g.current)==null||R.focus()},refreshLayout(R){$e(R)}}),[f,u,$e,Me,ye,ce,xe,F,W,i]),t.jsxs("div",{className:`relative min-h-0 flex-1 overflow-hidden ${a?"shell-pane-active":""}`,onMouseDown:h,"data-pane-id":r,children:[t.jsx("div",{ref:E,className:`h-full w-full px-2 py-2 sm:px-3 sm:py-3 ${s?"mobile-shell-selectable":""}`,onMouseDown:()=>{var R;h(),(R=g.current)==null||R.focus()}}),a&&t.jsx("div",{className:"pointer-events-none absolute right-2 top-2 rounded-md border border-sky-300/30 bg-sky-300/10 px-2 py-1 text-[10px] uppercase tracking-[0.12em] text-sky-100",children:"Active"})]})}),Bg=c.forwardRef(function({threadId:r,shellAdapter:n,isVisible:a=!0,showHeader:o=!0,showFloatingToolbox:s=!0,effectiveTheme:l="dark",loadSplitRatio:i,saveSplitRatio:d,onStateChange:h},u){const m=c.useRef(null),f=c.useRef(null),p=c.useRef(null),g=c.useRef(null),b=c.useRef(null),v=c.useRef(!1),[x,y]=c.useState(null),[k,S]=c.useState(!0),[w,N]=c.useState(!1),[C,T]=c.useState(null),[P,K]=c.useState("primary"),[G,A]=c.useState(null),[J,Z]=c.useState(null),[D,te]=c.useState("single"),[oe,_]=c.useState(50),[Y,z]=c.useState(null),[q,F]=c.useState(""),[E,W]=c.useState(!1),[H,j]=c.useState(!1),[L,U]=c.useState(!1),[X,se]=c.useState({primary:Es,secondary:Es}),[Q,de]=c.useState(null),re=(x==null?void 0:x.state)??"not_created",ue=c.useMemo(()=>(x==null?void 0:x.shells)??[],[x==null?void 0:x.shells]),be=c.useMemo(()=>ue.filter(mt),[ue]),ve=c.useMemo(()=>be.find(I=>I.id===G)??null,[be,G]),Pe=c.useMemo(()=>be.find(I=>I.id===J)??null,[be,J]),le=P==="secondary"?Pe:ve,Ne=X[P],we=(x==null?void 0:x.workspacePathStatus)==="missing",O=P==="secondary"?f:m,ce=kg({activeRuntime:Ne,activeShell:le,busy:w,loading:k,status:re,workspacePathMissing:we}),xe=ce.disabled,ye=ce.label,Me=ce.className,_e=(Q==null?void 0:Q.tone)==="done"?"shell-floating-feedback shell-floating-feedback-done":(Q==null?void 0:Q.tone)==="failed"?"shell-floating-feedback shell-floating-feedback-failed":"shell-floating-feedback",Te=c.useCallback((I,V)=>{de({tone:I,text:V}),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{de(null),p.current=null},1800)},[]),$e=c.useCallback((I,V,fe)=>{y(Le=>{var Ge;if(!Le)return Le;const ne=Le.shells.map(Ae=>Ae.id===I?V(Ae):Ae),Fe=((Ge=Le.shell)==null?void 0:Ge.id)===I?V(Le.shell):ne.find(Ae=>{var Xe;return Ae.id===((Xe=Le.shell)==null?void 0:Xe.id)})??Le.shell;return{...Le,...fe?{state:fe}:{},shell:Fe,shells:ne}})},[]),R=c.useCallback(async()=>{S(!0);try{const I=await n.fetchState(r);y(I),T(null)}catch(I){T(I instanceof Error?I.message:"Unable to load shell state.")}finally{S(!1)}},[n,r]);c.useEffect(()=>{R()},[R]),c.useEffect(()=>{const I=i==null?void 0:i(r);if(I==null){_(50);return}const V=typeof I=="number"?I:Number.parseFloat(String(I));_(Number.isFinite(V)?vn(V):50)},[i,r]),c.useEffect(()=>{if(!x){A(null),Z(null);return}const I=vg(x);A(V=>V&&x.shells.some(fe=>fe.id===V&&mt(fe))?V:(I==null?void 0:I.id)??null),Z(V=>{if(D!=="columns")return null;if(V&&x.shells.some(Le=>Le.id===V&&mt(Le)))return V;const fe=x.shells.find(Le=>mt(Le)&&Le.id!==(I==null?void 0:I.id));return(fe==null?void 0:fe.id)??null})},[x,D]),c.useEffect(()=>{D!=="columns"&&(K("primary"),Z(null))},[D]),c.useEffect(()=>{if(D!=="columns"||J||be.length<2)return;const I=be.find(V=>V.id!==(ve==null?void 0:ve.id))??null;I&&Z(I.id)},[be,ve==null?void 0:ve.id,J,D]),c.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const I=window.matchMedia("(max-width: 767px), (hover: none) and (pointer: coarse)"),V=()=>{W(I.matches),I.matches||(U(!1),j(!1))};return V(),I.addEventListener("change",V),()=>{I.removeEventListener("change",V)}},[]),c.useEffect(()=>()=>{p.current!==null&&window.clearTimeout(p.current),b.current!==null&&window.cancelAnimationFrame(b.current)},[]);const pe=c.useCallback((I,V)=>{se(fe=>{const Le=fe[I];return bg(Le,V)?fe:{...fe,[I]:V}})},[]),M=c.useCallback(I=>pe("primary",I),[pe]),$=c.useCallback(I=>pe("secondary",I),[pe]),ee=c.useCallback(I=>{var fe;if((fe=I.label)!=null&&fe.trim())return I.label.trim();const V=ue.findIndex(Le=>Le.id===I.id);return`Shell ${V>=0?V+1:""}`.trim()},[ue]),me=c.useCallback(I=>{var V;z(I.id),F(((V=I.label)==null?void 0:V.trim())||ee(I))},[ee]),ke=c.useCallback(()=>{z(null),F("")},[]),Re=c.useCallback(async()=>{if(Y){N(!0);try{const I=q.trim(),V=await n.updateShell(Y,{label:I.length>0?I:null});y(fe=>{var Le;return fe&&{...fe,state:fe.activeShellId===V.id?V.status:fe.state,shell:((Le=fe.shell)==null?void 0:Le.id)===V.id?V:fe.shell,shells:fe.shells.map(ne=>ne.id===V.id?V:ne)}}),z(null),F(""),T(null)}catch(I){T(I instanceof Error?I.message:"Unable to rename shell.")}finally{N(!1)}}},[q,Y,n]),je=c.useCallback((I,V)=>{if(I==="primary"){A(V),Z(fe=>fe===V?null:fe);return}Z(V),A(fe=>fe===V?null:fe)},[]),De=c.useCallback(I=>{var V,fe;if(I==="primary"){(V=m.current)==null||V.disconnect(),A(null),D==="columns"&&K("secondary");return}(fe=f.current)==null||fe.disconnect(),Z(null),K("primary"),te("single")},[D]),Ve=c.useCallback((I,V=P)=>{const fe=D==="columns"?V:"primary";je(fe,I.id),D!=="columns"&&Z(null),K(fe)},[P,je,D]),Qe=c.useCallback(async(I=P)=>{var V;if(!v.current){v.current=!0,N(!0);try{const fe=await n.createShell(r);y(fe);const Le=fe.activeShellId??((V=fe.shell)==null?void 0:V.id)??null;if(Le){const ne=D==="columns"?I:"primary";je(ne,Le),D!=="columns"&&Z(null),K(ne)}T(null)}catch(fe){T(fe instanceof Error?fe.message:"Unable to create shell.")}finally{v.current=!1,N(!1)}}},[P,je,n,D,r]);c.useEffect(()=>{!a||!x||k||w||we||re==="creating"||be.length>0||Qe("primary")},[w,Qe,a,be.length,k,x,re,we]);const at=c.useCallback(async(I=(le==null?void 0:le.id)??"")=>{if(I){N(!0);try{await n.terminateShell(I),A(V=>V===I?null:V),Z(V=>V===I?null:V),await R(),T(null)}catch(V){T(V instanceof Error?V.message:"Unable to terminate shell.")}finally{N(!1)}}},[le==null?void 0:le.id,R,n]),rt=c.useCallback(async()=>{var I,V;if(!xe){if(Ne.shellInputEnabled){(I=O.current)==null||I.disconnect();return}if(!le||le.status==="exited"||le.status==="not_found"){await Qe(P);return}await((V=O.current)==null?void 0:V.reconnect())}},[P,O,Ne.shellInputEnabled,le,xe,Qe]),lt=c.useCallback(I=>{typeof window>"u"||d==null||d(r,vn(I))},[d,r]),it=c.useCallback(()=>{var I,V;(I=m.current)==null||I.refreshLayout({syncBackendSize:!0}),(V=f.current)==null||V.refreshLayout({syncBackendSize:!0})},[]),He=c.useCallback(I=>{var Fe,Ge;if(D!=="columns")return;const V=g.current;if(!V)return;I.preventDefault(),(Ge=(Fe=I.currentTarget).setPointerCapture)==null||Ge.call(Fe,I.pointerId);const fe=Ae=>{const Xe=V.getBoundingClientRect();if(Xe.width<=0)return;const st=vn((Ae-Xe.left)/Xe.width*100);_(st),b.current!==null&&window.cancelAnimationFrame(b.current),b.current=window.requestAnimationFrame(()=>{b.current=null,it()})},Le=Ae=>{fe(Ae.clientX)},ne=Ae=>{fe(Ae.clientX);const Xe=V.getBoundingClientRect();Xe.width>0&<((Ae.clientX-Xe.left)/Xe.width*100),window.removeEventListener("pointermove",Le),window.removeEventListener("pointerup",ne)};window.addEventListener("pointermove",Le),window.addEventListener("pointerup",ne,{once:!0})},[lt,it,D]),Oe=c.useCallback((I,V)=>{je(V,I.id),K(V)},[je]),We=c.useCallback(async()=>{var V;return await((V=O.current)==null?void 0:V.copyLastCommandOutput())?!0:(Te("failed","Nothing to copy"),!1)},[O,Te]);c.useEffect(()=>{h==null||h(wg({activeRuntime:Ne,activeShell:le,connectionButtonDisabled:xe,connectionButtonLabel:ye,isMobileShell:E,busy:w,loading:k,error:C}))},[Ne,le,w,xe,ye,C,E,k,h]),c.useImperativeHandle(u,()=>({async toggleConnection(){await rt()},sendInput(I){var V;return((V=O.current)==null?void 0:V.sendInput(I))??!1},sendCommand(I){var V;return((V=O.current)==null?void 0:V.sendCommand(I))??!1},sendControl(I){var V;return((V=O.current)==null?void 0:V.sendControl(I))??!1},async copyLastCommandOutput(){var I;return await((I=O.current)==null?void 0:I.copyLastCommandOutput())??!1},async terminate(){await at()},focus(){var I;(I=O.current)==null||I.focus()},refreshLayout(I){var V,fe;(V=m.current)==null||V.refreshLayout(I),D==="columns"&&((fe=f.current)==null||fe.refreshLayout(I))}}),[O,rt,at,D]);const tt=I=>t.jsx("div",{className:`rounded-md border px-2 py-1.5 text-xs ${I.id===(le==null?void 0:le.id)?"border-sky-300/40 bg-sky-300/12 text-sky-50":"border-stone-800 bg-stone-900/40 text-stone-300"}`,children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[Y===I.id?t.jsx("form",{className:"min-w-0 flex-1",onSubmit:V=>{V.preventDefault(),Re()},children:t.jsx("input",{value:q,onChange:V=>F(V.currentTarget.value),onKeyDown:V=>{V.key==="Escape"&&(V.preventDefault(),ke())},autoFocus:!0,className:"w-full rounded border border-sky-300/35 bg-stone-950/70 px-2 py-1 text-xs text-stone-100 outline-none","aria-label":"Shell name"})}):t.jsxs("button",{type:"button",onClick:()=>Ve(I),onDoubleClick:()=>me(I),className:"min-w-0 flex-1 text-left",title:I.tmuxSessionName,children:[t.jsx("span",{className:"block truncate",children:ee(I)}),t.jsxs("span",{className:"block truncate text-[10px] text-[var(--theme-fg-muted)]",children:[bn(I.status)," · ",Zr(I.cwd)||I.cwd]})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Y===I.id?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>void Re(),className:"rounded border border-sky-300/35 bg-sky-300/12 px-1.5 py-1 text-[10px] text-sky-50",title:"Save shell name",children:"Save"}),t.jsx("button",{type:"button",onClick:ke,className:"rounded border border-stone-700 px-1.5 py-1 text-[10px] text-stone-200",title:"Cancel rename",children:"Cancel"})]}):t.jsx("button",{type:"button",onClick:()=>me(I),className:"rounded border border-stone-700 px-1.5 py-1 text-[10px] text-stone-200 hover:border-sky-300/40",title:"Rename shell",children:"Rename"}),D==="columns"&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>Oe(I,"primary"),className:"rounded border border-stone-700 px-1.5 py-1 text-[10px] text-stone-200 hover:border-sky-300/40",title:"Open in left pane",children:"L"}),t.jsx("button",{type:"button",onClick:()=>Oe(I,"secondary"),className:"rounded border border-stone-700 px-1.5 py-1 text-[10px] text-stone-200 hover:border-sky-300/40",title:"Open in right pane",children:"R"})]}),t.jsx("button",{type:"button",disabled:w,onClick:()=>void at(I.id),className:"rounded border border-rose-300/35 bg-rose-300/12 px-1.5 py-1 text-[10px] text-rose-100 disabled:cursor-not-allowed disabled:opacity-50",title:"Kill shell process",children:"Kill"})]})]})},I.id);return t.jsxs("div",{className:"shell-panel flex min-h-0 flex-1 flex-col",children:[o&&t.jsxs("div",{className:"shell-header shrink-0 border-b px-3 py-3 sm:px-5",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Shell"}),t.jsx("p",{className:"mt-1 truncate text-sm text-[var(--theme-fg-soft)]",children:Ne.promptLabel??(le==null?void 0:le.cwd)??"Create a terminal for this thread."})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("button",{type:"button","aria-label":ye,title:`${ye} (${bn(Ne.status)})`,disabled:xe,onClick:()=>void rt(),className:`inline-flex h-10 w-10 items-center justify-center rounded-full border shadow-lg shadow-stone-950/25 transition disabled:cursor-not-allowed disabled:opacity-60 ${Me}`,children:t.jsx(Xf,{connected:Ne.shellInputEnabled})}),le&&t.jsx("button",{type:"button",disabled:w,onClick:()=>void at(le.id),className:"rounded-full border border-rose-300/35 bg-rose-300/12 px-3 py-2 text-sm text-rose-600 transition hover:bg-rose-300/18 dark:text-rose-100 disabled:cursor-not-allowed disabled:opacity-60",children:"Terminate"})]})]}),(C||k||we)&&t.jsxs("div",{className:"shell-banner mt-3 rounded-2xl border px-3 py-3 text-sm",children:[k&&t.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!k&&we&&t.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!k&&C&&t.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:C})]})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsxs("div",{className:"shell-terminal-bar flex shrink-0 items-center gap-2 border-b px-2 py-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-1",children:[t.jsx("span",{className:"min-w-0 truncate text-xs text-[var(--theme-fg-soft)]",children:le?ee(le):"No live shell process"}),le&&t.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-[0.12em] text-[var(--theme-fg-muted)]",children:bn(Ne.status)})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t.jsxs("span",{className:"hidden text-xs text-[var(--theme-fg-muted)] sm:inline",children:["Live ",be.length]}),t.jsx("button",{type:"button","aria-expanded":H,"aria-label":H?"Hide shell processes":"Show shell processes",onClick:()=>j(I=>!I),className:"rounded-md border border-stone-700/80 bg-stone-900/50 px-2.5 py-1.5 text-xs text-stone-200 sm:hidden",children:"Processes"})]})]}),H&&t.jsxs("div",{className:"shrink-0 border-b border-stone-800/80 bg-stone-950/55 p-2 sm:hidden",children:[t.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[t.jsx("p",{className:"text-xs uppercase tracking-[0.16em] text-[var(--theme-fg-muted)]",children:"Processes"}),t.jsxs("span",{className:"text-[10px] text-[var(--theme-fg-muted)]",children:[be.length," live"]})]}),t.jsxs("div",{className:"max-h-52 space-y-1 overflow-y-auto",children:[be.map(tt),be.length===0&&t.jsx("p",{className:"px-2 py-3 text-xs text-[var(--theme-fg-muted)]",children:"No live shell processes"})]}),t.jsx("div",{className:"mt-2 flex justify-end border-t border-stone-800/80 pt-2",children:t.jsx("button",{type:"button","aria-label":"New shell",title:"New shell",disabled:w||k||we,onClick:()=>void Qe(P),className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-sky-300/35 bg-sky-300/12 text-base leading-none text-sky-50 disabled:cursor-not-allowed disabled:opacity-50",children:"+"})})]}),re==="not_created"||we?t.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:t.jsxs("div",{className:"shell-empty-state max-w-md rounded-[1.6rem] border px-6 py-8",children:[t.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Durable thread shell"}),t.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-muted)]",children:"The shell runs under a supervisor-managed PTY and reconnects after browser disconnects. Create it explicitly when you want to inspect or take over the workspace."}),!we&&t.jsx("button",{type:"button",disabled:w||k,onClick:()=>void Qe("primary"),className:"mt-5 rounded-md border border-sky-300/35 bg-sky-300/12 px-3 py-2 text-sm text-sky-50 disabled:cursor-not-allowed disabled:opacity-50",children:"New Shell"})]})}):t.jsxs("div",{className:"grid h-full min-h-0 grid-cols-1 gap-2 p-2 sm:grid-cols-[minmax(0,1fr)_16rem] sm:p-3",children:[t.jsxs("div",{className:"shell-terminal-frame relative min-h-0 overflow-hidden rounded-[1.4rem] border shadow-inner",children:[!o&&(C||k||we)&&t.jsxs("div",{className:"shell-banner absolute left-2 right-2 top-2 z-10 rounded-2xl border px-3 py-3 text-sm backdrop-blur sm:left-3 sm:right-3 sm:top-3",children:[k&&t.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!k&&we&&t.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!k&&C&&t.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:C})]}),t.jsxs("div",{ref:g,className:`relative grid h-full min-h-0 ${D==="columns"?"grid-cols-1 sm:grid-cols-[var(--shell-left)_0.35rem_var(--shell-right)]":"grid-cols-1"}`,style:D==="columns"?{"--shell-left":`${oe}fr`,"--shell-right":`${100-oe}fr`}:void 0,"data-shell-split-ratio":oe,children:[t.jsx(Ls,{ref:m,paneId:"primary",shell:ve,isActive:P==="primary",isVisible:a,isMobileShell:E,effectiveTheme:l,workspacePathMissing:we,shellAdapter:n,onActivate:()=>K("primary"),onShellUpdate:$e,onRuntimeStateChange:M,onFeedback:Te}),D==="columns"&&t.jsx("button",{type:"button",onClick:()=>De("primary"),className:"absolute left-2 top-2 z-10 rounded-md border border-stone-700/80 bg-stone-950/70 px-2 py-1 text-[10px] text-stone-200 hover:border-rose-300/40",title:"Close left pane",children:"Close"}),D==="columns"&&t.jsx("button",{type:"button","aria-label":"Resize shell panes",title:"Resize shell panes",onPointerDown:He,className:"hidden cursor-col-resize border-x border-stone-800/80 bg-stone-900/60 transition hover:border-sky-300/40 hover:bg-sky-300/10 sm:block"}),D==="columns"&&t.jsxs("div",{className:"relative min-h-0 border-t border-stone-800/80 sm:border-l sm:border-t-0",children:[t.jsx(Ls,{ref:f,paneId:"secondary",shell:Pe,isActive:P==="secondary",isVisible:a,isMobileShell:E,effectiveTheme:l,workspacePathMissing:we,shellAdapter:n,onActivate:()=>K("secondary"),onShellUpdate:$e,onRuntimeStateChange:$,onFeedback:Te}),t.jsx("button",{type:"button",onClick:()=>De("secondary"),className:"absolute left-2 top-2 z-10 rounded-md border border-stone-700/80 bg-stone-950/70 px-2 py-1 text-[10px] text-stone-200 hover:border-rose-300/40",title:"Close right pane",children:"Close"})]})]}),s&&E&&t.jsxs("div",{className:"pointer-events-none absolute bottom-3 right-3 z-20 flex flex-col items-end gap-2",children:[Q&&t.jsx("div",{className:`pointer-events-auto rounded-full border px-3 py-1.5 text-[11px] shadow-lg shadow-stone-950/30 backdrop-blur ${_e}`,children:Q.text}),L&&t.jsx("div",{className:"shell-toolbox pointer-events-auto rounded-[1.2rem] border p-2 shadow-2xl backdrop-blur",children:t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsx("button",{type:"button",onClick:()=>{Te("idle","Use the prompt box tools to paste")},className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2.5 py-2 text-sky-600 dark:text-sky-50",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(Ss,{}),t.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Paste"})]})}),t.jsx("button",{type:"button",onClick:()=>void We(),className:"shell-toolbox-copy inline-flex items-center justify-center rounded-full border px-2.5 py-2",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(Ss,{}),t.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Copy"})]})}),t.jsx("button",{type:"button",disabled:!Ne.shellInputEnabled,onClick:()=>{var I;(I=O.current)!=null&&I.sendControl("clear")?Te("done","Cleared"):Te("failed","Connect the shell first")},className:"disabled:opacity-45",children:t.jsx(kn,{label:"CLEAR",tone:"sky"})}),t.jsx("button",{type:"button",disabled:!Ne.shellInputEnabled||!Ne.isCommandRunning,onClick:()=>{var I;(I=O.current)!=null&&I.sendInput("")?Te("done","Sent Ctrl-C"):Te("failed","Connect the shell first")},className:"disabled:opacity-45",children:t.jsx(kn,{label:"CTRL-C",tone:"rose"})}),["ctrl_d","esc","tab","up","down"].map(I=>t.jsx("button",{type:"button",disabled:!Ne.shellInputEnabled,onClick:()=>{var V;(V=O.current)!=null&&V.sendControl(I)?Te("done",`Sent ${I.toUpperCase().replace("_","-")}`):Te("failed","Connect the shell first")},className:"disabled:opacity-45",children:t.jsx(kn,{label:I.toUpperCase().replace("_","-"),tone:"stone"})},I))]})}),t.jsx("button",{type:"button","aria-expanded":L,"aria-label":L?"Close shell tools":"Open shell tools",onClick:()=>U(I=>!I),className:"shell-toolbox-trigger pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-2xl backdrop-blur transition",children:t.jsx(qf,{})})]})]}),t.jsxs("aside",{className:"hidden min-h-0 overflow-hidden rounded-[1rem] border border-stone-800/80 bg-stone-950/30 p-2 sm:flex sm:flex-col",children:[t.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[t.jsx("p",{className:"text-xs uppercase tracking-[0.16em] text-[var(--theme-fg-muted)]",children:"Processes"}),t.jsxs("span",{className:"text-[10px] text-[var(--theme-fg-muted)]",children:[be.length," live"]})]}),t.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto",children:[be.map(tt),be.length===0&&t.jsx("p",{className:"px-2 py-3 text-xs text-[var(--theme-fg-muted)]",children:"No live shell processes"})]}),t.jsx("div",{className:"mt-2 flex justify-end border-t border-stone-800/80 pt-2",children:t.jsx("button",{type:"button","aria-label":"New shell",title:"New shell",disabled:w||k||we,onClick:()=>void Qe(P),className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-sky-300/35 bg-sky-300/12 text-base leading-none text-sky-50 disabled:cursor-not-allowed disabled:opacity-50",children:"+"})})]})]})]})})]})}),Gg=c.lazy(async()=>({default:(await Promise.resolve().then(()=>(Qh(),Vo))).ThreadGraphWorkspacePanel}));function Fg(){return t.jsx("div",{className:"flex h-full min-h-0 flex-1 items-center justify-center px-4 text-sm text-[var(--theme-fg-muted)]",children:"Loading workspace..."})}function bl(e){return t.jsx(c.Suspense,{fallback:t.jsx(Fg,{}),children:t.jsx(Gg,{...e})})}c.memo(bl);function sx({open:e,title:r,description:n,confirmLabel:a="Delete",busy:o=!1,onCancel:s,onConfirm:l}){return c.useEffect(()=>{if(!e)return;function i(d){d.key==="Escape"&&!o&&s()}return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[o,s,e]),e?Br.createPortal(t.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[t.jsx("button",{type:"button","aria-label":"Close confirmation dialog",onClick:s,disabled:o,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":r,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium text-stone-100",children:r}),t.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]}),t.jsx("button",{type:"button","aria-label":"Close dialog",onClick:s,disabled:o,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:t.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),t.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[t.jsx("button",{type:"button",onClick:s,disabled:o,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),t.jsx("button",{type:"button",onClick:()=>void l(),disabled:o,className:"ui-action-danger rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:o?"Deleting...":a})]})]})]}),document.body):null}function Hg(e){if(!e)return"No time";const r=new Date(e);return Number.isNaN(r.getTime())?e:r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Og(e){switch(e){case"inProgress":return"running";case"completed":return"completed";case"interrupted":return"interrupted";case"failed":return"failed"}}function Wg(e){switch(e){case"latest-3":return"Latest 3";case"latest-10":return"Latest 10";case"latest-20":return"Latest 20";case"all-loaded":return"All loaded";case"custom":return"Custom"}}function Ug(e){switch(e){case"latest-3":return 3;case"latest-10":return 10;case"latest-20":return 20;default:return null}}function Vg(e){return e==="read"?"View only":"Collaborator"}function Kg(e){switch(e){case"write":return"Workspace write";case"read":return"Workspace read";case"none":default:return"No workspace"}}function ox({open:e,busy:r=!1,turnsState:n,shareAvailable:a=!1,shareUnavailableMessage:o="Relay sharing will be enabled after the relay permission model is connected.",shareState:s,initialMode:l="pdf",onCancel:i,onLoadTurns:d,onExport:h,onCreateShare:u,onRevokeShare:m}){var E,W,H;const f=c.useMemo(()=>{var j;return((j=n.data)==null?void 0:j.turns)??[]},[(E=n.data)==null?void 0:E.turns]),[p,g]=c.useState(l),[b,v]=c.useState("latest-10"),[x,y]=c.useState(()=>new Set),[k,S]=c.useState(!0),[w,N]=c.useState(""),[C,T]=c.useState("read"),[P,K]=c.useState("none"),[G,A]=c.useState(""),[J,Z]=c.useState(()=>typeof document<"u"&&!document.documentElement.classList.contains("dark")?"light":"dark");if(c.useEffect(()=>{e&&(g(l),v("latest-10"),S(!0),N(""),T("read"),K("none"),A(""),d())},[l,d,e]),c.useEffect(()=>{e&&f.length>0&&y(new Set(f.slice(0,10).map(j=>j.turnId)))},[e,f]),c.useEffect(()=>{if(!e)return;function j(L){L.key==="Escape"&&!r&&i()}return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[r,i,e]),c.useEffect(()=>{if(!e)return;const j=document.querySelector(".thread-ui-shell"),L=()=>j?j.getAttribute("data-theme-effective")==="dark"||j.classList.contains("dark")||j.classList.contains("thread-ui-theme-dark")?"dark":"light":document.documentElement.classList.contains("dark")?"dark":"light";if(Z(L()),!j)return;const U=new MutationObserver(()=>Z(L()));return U.observe(j,{attributes:!0,attributeFilter:["class","data-theme-effective"]}),()=>U.disconnect()},[e]),!e)return null;const D=Ug(b),te=D!==null?Math.min(D,((W=n.data)==null?void 0:W.totalTurnCount)??D):b==="all-loaded"?f.length:x.size,oe=!r&&p!=="share"&&(D!==null||b==="all-loaded"||x.size>0),_=!r&&a&&!!u&&w.trim().length>0;function Y(j){y(L=>{const U=new Set(L);return U.has(j)?U.delete(j):U.add(j),U})}function z(){if(p==="share")return;const j={format:p,...D!==null?{mode:"latest",limit:D}:b==="all-loaded"?{mode:"selected",turnIds:f.map(L=>L.turnId)}:{mode:"selected",turnIds:[...x]},profile:"review",options:{includeTokenAndPrice:k}};h(j)}function q(j){j.preventDefault(),_&&(u==null||u({targetIdentifier:w.trim(),threadAccess:C,workspaceAccess:P,label:G.trim()||null}))}const F=[{mode:"pdf",label:"PDF"},{mode:"html",label:"HTML"},{mode:"share",label:"Share"}];return Br.createPortal(t.jsxs("div",{className:`thread-export-dialog-root thread-ui-theme-${J} fixed inset-0 z-[96] flex items-end justify-center p-0 sm:items-center sm:p-6`,"data-theme-effective":J,children:[t.jsx("button",{type:"button","aria-label":"Close thread actions",onClick:i,disabled:r,className:"thread-export-dialog-backdrop absolute inset-0 backdrop-blur-sm disabled:cursor-not-allowed"}),t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Thread actions",className:"thread-export-dialog-panel relative z-[1] flex max-h-[min(48rem,calc(100vh-1rem))] w-full max-w-2xl flex-col rounded-t-[1.6rem] border shadow-2xl sm:rounded-[1.6rem]",children:[t.jsxs("div",{className:"thread-export-dialog-header flex items-start justify-between gap-3 border-b px-5 py-4",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"thread-export-dialog-title text-sm font-semibold",children:"Thread actions"}),t.jsx("p",{className:"thread-export-dialog-subtitle mt-1 text-xs",children:"Export a review copy or share this relay session."})]}),t.jsx("button",{type:"button","aria-label":"Close dialog",onClick:i,disabled:r,className:"thread-export-dialog-icon-button inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border transition disabled:cursor-not-allowed disabled:opacity-60",children:t.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:t.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:[t.jsx("div",{className:"thread-export-dialog-segment inline-flex rounded-full border p-1",children:F.map(j=>t.jsx("button",{type:"button",onClick:()=>g(j.mode),className:`rounded-full px-3 py-1.5 text-sm transition ${p===j.mode?"ui-status-warning":"thread-export-dialog-muted-action"}`,children:j.label},j.mode))}),p==="share"?t.jsxs("form",{id:"thread-actions-share-form",className:"mt-4 space-y-4",onSubmit:q,children:[a?null:t.jsx("p",{className:"thread-export-dialog-box thread-export-dialog-subtitle rounded-2xl border px-3 py-3 text-sm",children:o}),t.jsxs("label",{className:"thread-export-dialog-body-text block text-sm",children:["Relay identifier",t.jsx("input",{className:"thread-export-dialog-box mt-2 w-full rounded-xl border bg-transparent px-3 py-2 outline-none",disabled:!a||r,onChange:j=>N(j.target.value),placeholder:"username or email",value:w})]}),t.jsxs("fieldset",{className:"thread-export-dialog-box rounded-2xl border p-3",children:[t.jsx("legend",{className:"thread-export-dialog-subtitle px-1 text-xs",children:"Thread access"}),t.jsx("div",{className:"mt-2 grid gap-2 sm:grid-cols-2",children:[["read","View only"],["control","Collaborator"]].map(([j,L])=>t.jsxs("label",{className:"thread-export-dialog-turn-row flex items-center gap-2 rounded-xl px-2.5 py-2 text-sm",children:[t.jsx("input",{type:"radio",checked:C===j,disabled:!a||r,onChange:()=>T(j)}),L]},j))})]}),t.jsxs("fieldset",{className:"thread-export-dialog-box rounded-2xl border p-3",children:[t.jsx("legend",{className:"thread-export-dialog-subtitle px-1 text-xs",children:"Workspace"}),t.jsx("div",{className:"mt-2 grid gap-2 sm:grid-cols-3",children:[["none","No access"],["read","Read files"],["write","Read and edit"]].map(([j,L])=>t.jsxs("label",{className:"thread-export-dialog-turn-row flex items-center gap-2 rounded-xl px-2.5 py-2 text-sm",children:[t.jsx("input",{type:"radio",checked:P===j,disabled:!a||r,onChange:()=>K(j)}),L]},j))})]}),t.jsxs("label",{className:"thread-export-dialog-body-text block text-sm",children:["Label",t.jsx("input",{className:"thread-export-dialog-box mt-2 w-full rounded-xl border bg-transparent px-3 py-2 outline-none",disabled:!a||r,onChange:j=>A(j.target.value),placeholder:"optional",value:G})]}),t.jsxs("div",{className:"thread-export-dialog-box rounded-2xl border",children:[t.jsxs("div",{className:"thread-export-dialog-box-header flex items-center justify-between border-b px-3 py-2.5",children:[t.jsx("p",{className:"thread-export-dialog-strong text-sm font-medium",children:"Shared by me"}),t.jsx("span",{className:"thread-export-dialog-status-pill rounded-full border px-2 py-0.5 text-[10px]",children:(s==null?void 0:s.shares.length)??0})]}),(s==null?void 0:s.status)==="failed"?t.jsx("p",{className:"px-3 py-3 text-sm text-rose-500 dark:text-rose-200",children:s.error}):s!=null&&s.shares.length?t.jsx("div",{className:"divide-y",children:s.shares.map(j=>t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2.5 text-sm",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"thread-export-dialog-strong truncate font-medium",children:j.targetUsername}),t.jsxs("p",{className:"thread-export-dialog-subtitle mt-0.5 text-xs",children:[j.label?`${j.label} · `:"",Vg(j.threadAccess)," / ",Kg(j.workspaceAccess)]})]}),m?t.jsx("button",{type:"button",className:"thread-export-dialog-secondary-button rounded-full border px-3 py-1.5 text-xs transition",disabled:r,onClick:()=>void m(j.id),children:"Revoke"}):null]},j.id))}):t.jsx("p",{className:"thread-export-dialog-subtitle px-3 py-3 text-sm",children:"No active shares for this thread."})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"thread-export-dialog-body-text mt-4 block text-sm",children:["Turns",t.jsx("select",{className:"thread-export-dialog-box mt-2 w-full rounded-xl border bg-transparent px-3 py-2 outline-none",value:b,onChange:j=>v(j.target.value),children:["latest-3","latest-10","latest-20","all-loaded","custom"].map(j=>t.jsx("option",{value:j,children:Wg(j)},j))})]}),b==="custom"?t.jsxs("div",{className:"thread-export-dialog-box mt-4 rounded-2xl border",children:[t.jsxs("div",{className:"thread-export-dialog-box-header flex flex-wrap items-center justify-between gap-2 border-b px-3 py-2.5",children:[t.jsxs("p",{className:"thread-export-dialog-subtitle text-xs",children:["Selected ",x.size," of ",((H=n.data)==null?void 0:H.totalTurnCount)??f.length]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{type:"button",onClick:()=>y(new Set(f.map(j=>j.turnId))),className:"thread-export-dialog-secondary-button rounded-full border px-2.5 py-1 text-xs transition",children:"Select all"}),t.jsx("button",{type:"button",onClick:()=>y(new Set),className:"thread-export-dialog-secondary-button rounded-full border px-2.5 py-1 text-xs transition",children:"Clear"})]})]}),n.status==="loading"?t.jsx("p",{className:"thread-export-dialog-subtitle px-3 py-6 text-sm",children:"Loading turns..."}):n.status==="failed"?t.jsx("p",{className:"px-3 py-6 text-sm text-rose-500 dark:text-rose-200",children:n.error}):t.jsx("div",{className:"max-h-80 overflow-auto p-2",children:f.map(j=>t.jsxs("label",{className:"thread-export-dialog-turn-row flex cursor-pointer items-center gap-3 rounded-xl px-2.5 py-2 text-sm transition",children:[t.jsx("input",{type:"checkbox",checked:x.has(j.turnId),onChange:()=>Y(j.turnId),className:"thread-export-dialog-checkbox h-4 w-4"}),t.jsxs("span",{className:"thread-export-dialog-strong shrink-0 text-xs font-medium",children:["Turn ",j.turnNumber]}),t.jsx("span",{className:"thread-export-dialog-subtitle shrink-0 text-xs",children:Hg(j.startedAt)}),t.jsx("span",{className:"thread-export-dialog-body-text min-w-0 flex-1 truncate text-left",children:j.userPromptPreview}),t.jsx("span",{className:"thread-export-dialog-status-pill hidden shrink-0 rounded-full border px-2 py-0.5 text-[10px] sm:inline",children:Og(j.status)})]},j.turnId))})]}):null,t.jsxs("div",{className:"thread-export-dialog-body-text mt-4 grid gap-2 text-sm sm:grid-cols-2",children:[t.jsxs("label",{className:"thread-export-dialog-box flex items-center gap-2 rounded-xl border px-3 py-2",children:[t.jsx("input",{type:"checkbox",checked:k,onChange:j=>S(j.target.checked),className:"thread-export-dialog-checkbox h-4 w-4"}),"Token and price"]}),t.jsx("p",{className:"thread-export-dialog-box thread-export-dialog-subtitle flex items-center rounded-xl border px-3 py-2 text-xs",children:p==="html"?"HTML keeps the chat timeline styling and omits raw command output.":"Review exports keep message text readable and omit tool activity."})]})]})]}),t.jsxs("div",{className:"thread-export-dialog-footer flex items-center justify-between gap-3 border-t px-5 py-4",children:[t.jsx("p",{className:"thread-export-dialog-subtitle min-w-0 text-xs",children:p==="share"?a?"Share access is enforced by the relay server.":"Share permissions are not wired yet.":`${te} ${te===1?"turn":"turns"} selected.`}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{type:"button",onClick:i,disabled:r,className:"thread-export-dialog-secondary-button rounded-full border px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),p==="share"?t.jsx("button",{type:"submit",form:"thread-actions-share-form",disabled:!_,className:"ui-status-warning rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:r?"Sharing...":"Share session"}):t.jsx("button",{type:"button",onClick:z,disabled:!oe,className:"ui-status-warning rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:r?"Exporting...":`Export ${p.toUpperCase()}`})]})]})]})]}),document.body)}function yn(e){if(e===void 0)return"-";if(Math.abs(e)>1e4){const r=Math.abs(e)>=1e5?0:1;return`${(e/1e3).toLocaleString(void 0,{maximumFractionDigits:r})}k`}return e.toLocaleString()}function qg(e){return`in ${yn(e.input)} / out ${yn(e.output)} / cache ${yn(e.cache)}`}function Xg({detail:e,adapter:r,timelineAdapter:n,TimelineComponent:a=pl,liveOutput:o="",beforeTimelineContent:s,composerProps:l,timelineProps:i,threadUsageSummary:d,transcriptItemCount:h,useFloatingMobileComposer:u=!1,floatingMobileComposerBottomOffset:m=0,composerHostRef:f}){const[p,g]=c.useState(!1),[b,v]=c.useState(0),[x,y]=c.useState(0),[k,S]=c.useState(0),[w,N]=c.useState(!1),C=c.useRef(null),T=i==null?void 0:i.onTailVisibilityChange,P=e.pendingRequests.length>0,K=c.useCallback(Y=>{T==null||T(Y)},[T]);c.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const Y=window.matchMedia("(max-width: 639px)"),z=()=>g(Y.matches);return z(),Y.addEventListener("change",z),()=>{Y.removeEventListener("change",z)}},[]),c.useEffect(()=>{var z,q;if(typeof window>"u")return;const Y=()=>{const F=window.visualViewport,E=F?Math.max(0,Math.round(window.innerHeight-F.height-F.offsetTop)):0,W=F?Math.max(0,Math.round(window.innerHeight-F.height)):E,H=Math.min(E,W),j=Math.max(0,Math.round(window.innerHeight*.52));S(Math.min(H,j))};return Y(),(z=window.visualViewport)==null||z.addEventListener("resize",Y),(q=window.visualViewport)==null||q.addEventListener("scroll",Y),window.addEventListener("resize",Y),()=>{var F,E;(F=window.visualViewport)==null||F.removeEventListener("resize",Y),(E=window.visualViewport)==null||E.removeEventListener("scroll",Y),window.removeEventListener("resize",Y)}},[]),c.useLayoutEffect(()=>{const Y=C.current;if(!Y||!p){v(0);return}const z=()=>{v(Math.ceil(Y.getBoundingClientRect().height))};if(z(),typeof ResizeObserver>"u")return;const q=new ResizeObserver(z);return q.observe(Y),()=>{q.disconnect()}},[p,l,P]),c.useLayoutEffect(()=>{var F,E;const Y=C.current;if(!Y||!p){y(0);return}const z=()=>{const W=Y.getBoundingClientRect();y(Math.max(0,Math.ceil(window.innerHeight-W.top)))};z(),window.addEventListener("resize",z),(F=window.visualViewport)==null||F.addEventListener("resize",z),(E=window.visualViewport)==null||E.addEventListener("scroll",z);let q=null;return typeof ResizeObserver<"u"&&(q=new ResizeObserver(z),q.observe(Y)),()=>{var W,H;window.removeEventListener("resize",z),(W=window.visualViewport)==null||W.removeEventListener("resize",z),(H=window.visualViewport)==null||H.removeEventListener("scroll",z),q==null||q.disconnect()}},[p,k,w,l,P]),c.useEffect(()=>{if(!p){N(!1);return}const Y=q=>{var E;const F=q.target;F instanceof HTMLElement&&((E=C.current)!=null&&E.contains(F))&&N(!0)},z=q=>{var E;const F=q.relatedTarget;F instanceof HTMLElement&&((E=C.current)!=null&&E.contains(F))||N(!1)};return document.addEventListener("focusin",Y),document.addEventListener("focusout",z),()=>{document.removeEventListener("focusin",Y),document.removeEventListener("focusout",z)}},[p]);const G=c.useCallback(Y=>{C.current=Y,f&&(f.current=Y)},[f]),A=p&&w?Math.max(0,k-m):0,J=Math.max(b,144),Z=Math.max(x,J+A),D=p?Z+12:0,te=D>0?{"--thread-graph-chat-scroll-bottom-spacer":`${D}px`}:void 0,oe=u&&p?{bottom:`${m+A}px`,paddingBottom:"max(env(safe-area-inset-bottom), var(--android-safe-area-bottom, 0px))"}:void 0,_=c.useMemo(()=>{const Y=e.thread.status==="running"||e.thread.activeTurnId!==null;return t.jsx(a,{threadId:e.thread.id,turns:e.turns,totalTurnCount:e.totalTurnCount??e.turns.length,pendingRequests:e.pendingRequests,activeTurnId:e.thread.activeTurnId,threadRunning:Y,liveOutput:o,className:"thread-timeline-surface min-h-0 flex-1",...i,adapter:n,onOpenThread:(i==null?void 0:i.onOpenThread)??r.openThread,onTailVisibilityChange:K})},[a,r.openThread,e.pendingRequests,e.thread.activeTurnId,e.thread.id,e.thread.status,e.totalTurnCount,e.turns,K,o,n,i]);return t.jsxs("div",{"data-testid":"chat-panel",className:"thread-graph-chat-panel relative flex h-full min-h-0 flex-col",style:te,children:[s,_,t.jsxs("div",{className:"thread-chat-usage-footer hidden shrink-0 items-center justify-between gap-3 px-4 py-1 text-[10px] leading-4 sm:flex",children:[t.jsxs("span",{className:"min-w-0 truncate",children:[e.turns.length," turn",e.turns.length!==1?"s":"",t.jsx("span",{className:"mx-1 text-[var(--theme-border-contrast)]",children:"|"}),h," item",h!==1?"s":""]}),t.jsxs("span",{className:"shrink-0",children:["Usage"," ",d&&d.turns>0?qg(d):"waiting for agent usage"]})]}),l?u?t.jsx("div",{ref:G,className:"fixed inset-x-0 bottom-0 z-50 overflow-visible sm:hidden",style:oe??{bottom:`${m}px`,paddingBottom:"max(env(safe-area-inset-bottom), var(--android-safe-area-bottom, 0px))"},children:t.jsx($n,{...l,activeView:"chat",edgeToEdgeMobile:!0,onSubmit:r.sendPrompt})}):t.jsx("div",{ref:G,className:"thread-graph-composer-host shrink-0",children:t.jsx($n,{...l,activeView:"chat",onSubmit:r.sendPrompt})}):null]})}function Yg(e){return e.turns.reduce((r,n)=>{var o;const a=(o=n.tokenUsage)==null?void 0:o.total;return a?{input:r.input+a.inputTokens,output:r.output+a.outputTokens,cache:r.cache+a.cachedInputTokens,turns:r.turns+1}:r},{input:0,output:0,cache:0,turns:0})}function jn(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?"0":e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}m`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(Math.round(e))}function Zg(e){return!e||e.turns<=0?"waiting for agent usage":`in ${jn(e.input)} / out ${jn(e.output)} / cache ${jn(e.cache)}`}function lx({threads:e,detail:r,loading:n,error:a,status:o=null,plugins:s,adapter:l,metaContent:i,settingsContent:d,globalSettingsContent:h,settingsDialogOpen:u,onSettingsDialogOpenChange:m,mobileHeaderAction:f,appMenuButton:p,appNavigationMenu:g,workspaceReturnHref:b,onWorkspaceReturn:v,threadActionsButton:x,surfaceActions:y,floatingPanel:k,workspaceContent:S,workspaceTitle:w,workspaceActions:N,workspaceFeatures:C,workspaceFocusPathRequest:T=null,onNewThreadTitle:P,beforeTimelineContent:K,errorContent:G,workspaceMissingContent:A,dialogs:J,currentThreadId:Z,currentWorkspaceId:D,currentWorkspaceLabel:te,onCloseAppNavigation:oe,className:_="thread-detail-surface relative flex h-full min-h-0 flex-1 flex-col overflow-hidden",activeView:Y="chat",liveOutput:z="",timelineProps:q,composerProps:F,shellComposerProps:E,useFloatingMobileComposer:W=!1,floatingMobileComposerBottomOffset:H=0,composerHostRef:j,shellPanelRef:L,shellEffectiveTheme:U="dark",shellThemeMode:X=U,onShellThemeModeChange:se,onShellStateChange:Q,shellUnavailableContent:de,shellDisconnectedContent:re,timelineComponent:ue=pl,shellPanelComponent:be=Bg,shellContent:ve,loadingContent:Pe,emptyContent:le}){const Ne=ra(),we=s??Ne??ea(),{getImageAssetUrl:O,loadHistoryItemDetail:ce,openWorkspaceFile:xe,openThread:ye,cancelPendingSteer:Me}=l,_e=c.useMemo(()=>({...O?{getImageAssetUrl:me=>O(me.path)}:{},onOpenLinkedThread:ye,...xe?{onOpenWorkspaceFile:xe}:{},...ce?{onLoadHistoryItemDetail:ce}:{},...Me?{cancelPendingSteer:Me}:{}}),[Me,O,ce,xe,ye]),Te=we.getThreadPanels().some(me=>me.kind==="terminal"),$e=c.useMemo(()=>r?Yg(r):null,[r]),R=c.useMemo(()=>Zg($e),[$e]),pe=c.useMemo(()=>{var me;return r?r.turns.reduce((ke,Re)=>ke+Re.items.length,((me=r.liveItems)==null?void 0:me.items.length)??0):0},[r]),M=S??(r?t.jsx(bl,{detail:r,status:o,plugins:we,workspaceAdapter:l.workspace??null,metaContent:i,settingsContent:d,activeView:Y,features:C,focusPathRequest:T}):null),$=n?Pe??t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-[var(--theme-fg-muted)]",children:"Loading thread detail..."}):r?t.jsxs("div",{className:_,children:[k?t.jsx("div",{className:"fixed right-3 top-20 z-50 lg:absolute lg:right-4 lg:top-16",children:k}):null,a&&!n&&(G??t.jsx("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:a})),r.workspacePathStatus==="missing"&&(A??t.jsxs("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:[t.jsx("p",{className:"font-medium text-rose-50",children:"Workspace path missing"}),t.jsx("p",{className:"mt-1 break-words text-rose-100/90",children:r.workspace.absPath})]})),t.jsx("div",{className:Y==="chat"?"flex min-h-0 flex-1 flex-col":"hidden",children:t.jsx(Xg,{detail:r,adapter:l,timelineAdapter:_e,TimelineComponent:ue,liveOutput:z,threadUsageSummary:$e,transcriptItemCount:pe,useFloatingMobileComposer:W,floatingMobileComposerBottomOffset:H,...K?{beforeTimelineContent:K}:{},...F?{composerProps:F}:{},...q?{timelineProps:q}:{},...j?{composerHostRef:j}:{}})}),t.jsxs("div",{className:Y==="shell"?"flex min-h-0 flex-1 flex-col":"hidden",children:[ve??(r.thread.isLoaded&&Te&&l.shell?t.jsx(be,{ref:L,threadId:r.thread.id,shellAdapter:l.shell,effectiveTheme:U,isVisible:Y==="shell",showHeader:!1,showFloatingToolbox:!1,...Q?{onStateChange:Q}:{}}):r.thread.isLoaded&&!Te?de??t.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-4 sm:p-6",children:t.jsxs("div",{className:"thread-empty-surface max-w-md rounded-[1.6rem] border px-6 py-8 text-center",children:[t.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Terminal plugin disabled"}),t.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-muted)]",children:"Enable the Terminal plugin in Settings to use the shell panel."})]})}):re??t.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-4 sm:p-6",children:t.jsxs("div",{className:"thread-empty-surface max-w-md rounded-[1.6rem] border px-6 py-8 text-center",children:[t.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Thread disconnected"}),t.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Reconnect this thread before creating or attaching a shell."})]})})),Y==="shell"&&E&&!ve?t.jsx($n,{...E,activeView:"shell",onSubmit:l.sendPrompt}):null]}),J]}):le??t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-[var(--theme-fg-muted)]",children:"Select a thread to inspect."}),ee=t.jsx(qm,{threads:e,status:o,loading:n,error:n?null:a,viewportConstrained:!0,currentThreadId:Z??(r==null?void 0:r.thread.id),currentThreadLabel:r==null?void 0:r.thread.title,currentWorkspaceId:D??(r==null?void 0:r.thread.workspaceId),currentWorkspaceLabel:te??(r==null?void 0:r.workspace.label),sessionLabel:(r==null?void 0:r.thread.providerSessionId)??(r==null?void 0:r.thread.id),usageLabel:R,threadActionsButton:x,topbarActions:y,metaContent:i,settingsContent:d,globalSettingsContent:h,...u!==void 0?{settingsDialogOpen:u}:{},...m?{onSettingsDialogOpenChange:m}:{},mobileHeaderAction:f,effectiveTheme:U,themeMode:X,appMenuButton:p,appNavigationMenu:g,workspaceReturnHref:b,...v?{onWorkspaceReturn:v}:{},showMobileAppMenu:!!p,showMobileThreadNavToggle:!0,showMobileNewThreadShortcut:!1,onOpenThread:l.openThread,workspaceContent:M,workspaceTitle:w??"Workspace",workspaceActions:N,...P?{onNewThreadTitle:P}:{},...oe?{onCloseAppNavigation:oe}:{},...se?{onThemeModeChange:se}:{},...l.getThreadHref?{getThreadHref:l.getThreadHref}:{},...l.getNewThreadHref?{getNewThreadHref:l.getNewThreadHref}:{},...l.renameThread?{onRenameThread:l.renameThread}:{},...l.deleteThread?{onDeleteThread:l.deleteThread}:{},children:$});return s?t.jsx(ta.Provider,{value:we,children:ee}):ee}var Jg={},Qg=[];function ix({adapter:e=Jg,builtinPlugins:r=Qg,children:n}){const[a,o]=c.useState(()=>Dn(r,[])),[s,l]=c.useState(!1),[i,d]=c.useState(null),h=c.useCallback(async()=>{l(!0),d(null);try{const k=e.fetchPlugins?await e.fetchPlugins():[];o(Dn(r,k))}catch(k){d(k instanceof Error?k.message:"Unable to load plugins.")}finally{l(!1)}},[e,r]);c.useEffect(()=>{h()},[h]);const u=c.useCallback(async(k,S)=>{if(e.updatePlugin){const w=await e.updatePlugin(k,{enabled:S});o(N=>N.map(C=>C.id===w.id?w:C));return}o(w=>w.map(N=>N.id===k?{...N,enabled:S}:N))},[e]),m=c.useCallback(async k=>{if(!e.importPlugin)throw new Error("Plugin import is not available.");const S=await e.importPlugin(k);o(w=>[...w.filter(C=>C.id!==S.id),S])},[e]),f=c.useCallback(async k=>{if(!e.deletePlugin)throw new Error("Plugin uninstall is not available.");const S=await e.deletePlugin(k);o(w=>w.filter(N=>N.id!==S.id))},[e]),p=c.useMemo(()=>{const k=new Set(a.filter(S=>S.enabled).map(S=>S.id));return r.filter(S=>k.has(S.manifest.id))},[r,a]),g=c.useCallback(k=>{var w;const S=p.find(N=>N.renderArtifact&&N.manifest.capabilities.artifactTypes.some(C=>C.type===k.artifact.type));return((w=S==null?void 0:S.renderArtifact)==null?void 0:w.call(S,k))??null},[p]),b=c.useCallback(k=>{for(const S of p)for(const w of S.inlineCodeRenderers??[]){if(!w.languages.includes(k.language.trim().toLowerCase()))continue;const N=w.render(k);if(N)return N}return null},[p]),v=c.useCallback(k=>p.some(S=>!!S.renderArtifact&&S.manifest.capabilities.artifactTypes.some(w=>w.type===k.type)),[p]),x=c.useCallback(()=>p.flatMap(k=>k.threadPanels??[]),[p]),y=c.useMemo(()=>({plugins:a,loading:s,error:i,refresh:h,importPluginManifest:m,setPluginEnabled:u,uninstallPlugin:f,renderArtifact:g,renderInlineCode:b,hasRendererForArtifact:v,getThreadPanels:x}),[i,x,v,m,s,a,h,g,b,u,f]);return t.jsx(ta.Provider,{value:y,children:n})}export{zm as A,sx as C,Xm as L,ix as P,ox as T,ra as a,lx as b,Bg as c,pl as d,qm as e,Qt as f,Km as g,Rm as t,Zo as u};
|