import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{AZ as t,Dvt as n,Mvt as r,_M as i,bft as a,eD as o,jZ as s,tD as c,vM as l,xft as u}from"./app-initial-BHB6SClA.js";function d(e){let t=(0,g.c)(7),{sections:n,onSelect:r}=e,i;if(t[0]!==r||t[1]!==n){let e;t[3]===r?e=t[4]:(e=e=>(0,_.jsx)(p,{section:e,onSelect:r},e.id),t[3]=r,t[4]=e),i=n.map(e),t[0]=r,t[1]=n,t[2]=i}else i=t[2];let a;return t[5]===i?a=t[6]:(a=(0,_.jsx)(`div`,{className:`h-full min-h-0 overflow-y-auto px-3 py-5`,children:(0,_.jsx)(`div`,{className:`mx-auto w-full max-w-[var(--thread-content-max-width)]`,children:i})}),t[5]=i,t[6]=a),a}function f(e){let n=(0,g.c)(12),{backAriaLabel:r,label:a,seed:o,onBack:s}=e,c;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,_.jsx)(t,{className:`icon-xs`}),n[0]=c):c=n[0];let l;n[1]!==r||n[2]!==s?(l=(0,_.jsx)(`button`,{type:`button`,className:`flex size-6 cursor-interaction items-center justify-center rounded-md text-token-text-secondary hover:bg-token-bg-secondary hover:text-token-foreground focus-visible:bg-token-bg-secondary focus-visible:outline-2 focus-visible:outline-offset-2`,"aria-label":r,onClick:s,children:c}),n[1]=r,n[2]=s,n[3]=l):l=n[3];let u;n[4]===o?u=n[5]:(u=(0,_.jsx)(i,{seed:o,className:`size-6`,"aria-hidden":!0}),n[4]=o,n[5]=u);let d;n[6]===a?d=n[7]:(d=(0,_.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:a}),n[6]=a,n[7]=d);let f;return n[8]!==l||n[9]!==u||n[10]!==d?(f=(0,_.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2 border-b border-token-border-heavy px-4`,children:[l,u,d]}),n[8]=l,n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function p(e){let t=(0,g.c)(14),{section:n,onSelect:r}=e;if(n.items.length===0&&n.emptyState==null)return null;let i;t[0]===n.title?i=t[1]:(i=(0,_.jsx)(`span`,{className:`min-w-0 truncate`,children:n.title}),t[0]=n.title,t[1]=i);let a;t[2]!==n.titleTrailing||t[3]!==i?(a=(0,_.jsxs)(`h2`,{className:`mb-2 flex min-w-0 items-center justify-between gap-3 px-2 text-sm text-token-text-tertiary`,children:[i,n.titleTrailing]}),t[2]=n.titleTrailing,t[3]=i,t[4]=a):a=t[4];let s;t[5]!==r||t[6]!==n.emptyState||t[7]!==n.items||t[8]!==n.visibleItemLimit?(s=n.items.length===0?(0,_.jsx)(`div`,{className:`px-2 py-1 text-sm text-token-text-tertiary`,children:n.emptyState}):(0,_.jsx)(o,{items:n.items,getKey:m,listClassName:`flex flex-col gap-1`,paginationButtonClassName:`mt-2 ms-9`,visibleItemIncrement:n.visibleItemLimit,visibleItemLimit:n.visibleItemLimit,children:e=>(0,_.jsx)(h,{item:e,onSelect:r})}),t[5]=r,t[6]=n.emptyState,t[7]=n.items,t[8]=n.visibleItemLimit,t[9]=s):s=t[9];let c;return t[10]!==n.className||t[11]!==a||t[12]!==s?(c=(0,_.jsxs)(`section`,{className:n.className,children:[a,s]}),t[10]=n.className,t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function m(e){return e.id}function h(e){let t=(0,g.c)(22),{item:n,onSelect:r}=e,o;t[0]!==n.id||t[1]!==r?(o=()=>r(n.id),t[0]=n.id,t[1]=r,t[2]=o):o=t[2];let s;t[3]===n.avatarSeed?s=t[4]:(s=(0,_.jsx)(i,{seed:n.avatarSeed,className:`mt-0.5 size-6`,"aria-hidden":!0}),t[3]=n.avatarSeed,t[4]=s);let c;t[5]===n.label?c=t[6]:(c=(0,_.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-token-foreground`,children:n.label}),t[5]=n.label,t[6]=c);let l;t[7]===n.trailing?l=t[8]:(l=n.trailing==null?null:(0,_.jsx)(`span`,{className:`shrink-0 text-xs whitespace-nowrap text-token-text-tertiary tabular-nums`,children:n.trailing}),t[7]=n.trailing,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,_.jsxs)(`span`,{className:`flex items-baseline gap-2 text-sm`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==n.preview||t[13]!==n.previewLineCount?(d=n.preview==null?null:(0,_.jsx)(`span`,{className:a(`block text-sm leading-5 text-token-text-secondary`,n.previewLineCount===2?`!line-clamp-2`:`truncate`),children:n.preview}),t[12]=n.preview,t[13]=n.previewLineCount,t[14]=d):d=t[14];let f;t[15]!==u||t[16]!==d?(f=(0,_.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[u,d]}),t[15]=u,t[16]=d,t[17]=f):f=t[17];let p;return t[18]!==o||t[19]!==s||t[20]!==f?(p=(0,_.jsxs)(`button`,{type:`button`,className:`flex min-h-10 w-full cursor-interaction items-start gap-3 rounded-lg px-2 py-2 text-start select-none hover:bg-token-bg-secondary focus-visible:bg-token-bg-secondary focus-visible:outline-2 focus-visible:outline-offset-2`,onClick:o,children:[s,f]}),t[18]=o,t[19]=s,t[20]=f,t[21]=p):p=t[21],p}var g,_,v=e((()=>{g=r(),u(),s(),l(),c(),_=n()}));export{d as n,v as r,f as t};
//# sourceMappingURL=subagent-panel-f_gsLZAq.js.map