1import{r as s,j as n}from"./react-vendor-DbzdS4FP.js";import{a4 as y}from"./index-C6K6UUCj.js";import{eh as b,d$ as E,cn as S}from"./ui-vendor-Bg5EyMZm.js";import"./i18n-vendor-BrUIoOSg.js";import"./dnd-vendor-DdAwup11.js";import"./markdown-vendor-DonjKQI4.js";const A="index-module__chatName__gCvzh",M="index-module__marquee__cKpyD",R="index-module__chatNameCoding__00Wfc",q="index-module__trigger__0lP8g",k="index-module__sessionDropdown__1oI-C",D="index-module__menuItem__qyJ1p",z="index-module__menuItemName__4zTxF",L="index-module__menuItemActive__UcP06",t={chatName:A,marquee:M,chatNameCoding:R,trigger:q,sessionDropdown:k,menuItem:D,menuItemName:z,menuItemActive:L},B=480,X=()=>{const{sessions:a,currentSessionId:m,setCurrentSessionId:x}=b(),{codingMode:r}=y(),i=a.find(e=>e.id===m),o=(i==null?void 0:i.name)||"New Chat",[c,d]=s.useState(!1),u=s.useRef(null),l=s.useRef(null),[f,h]=s.useState(!1);s.useEffect(()=>{const e=()=>{var g,N;if(!((typeof window<"u"?window.innerWidth:Number.MAX_VALUE)<=B)){h(!1);return}const v=((g=u.current)==null?void 0:g.getBoundingClientRect().width)??0,j=((N=l.current)==null?void 0:N.getBoundingClientRect().width)??0;h(j>v+2)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[o,r]);const w=e=>{x(e),d(!1)},C=a.map(e=>({key:e.id,label:n.jsxs("div",{className:t.menuItem,children:[n.jsx("span",{className:t.menuItemName,children:e.name||"New Chat"}),e.id===m&&n.jsx(E,{className:t.menuItemActive,size:16,"aria-hidden":!0})]}),onClick:()=>w(e.id)})),I=r?`${t.chatName} ${t.chatNameCoding}`:t.chatName,p=n.jsx("span",{className:I,ref:u,children:f?n.jsx("span",{className:t.marquee,children:o}):o}),_=n.jsx("span",{ref:l,"aria-hidden":"true",style:{position:"absolute",visibility:"hidden",whiteSpace:"nowrap",pointerEvents:"none"},children:o});return a.length<=1?n.jsxs(n.Fragment,{children:[p,_]}):n.jsx(S,{menu:{items:C},open:c,onOpenChange:d,trigger:["click"],placement:"bottomLeft",overlayClassName:t.sessionDropdown,children:n.jsxs("button",{type:"button",className:t.trigger,"aria-haspopup":"menu","aria-expanded":c,children:[p,_]})})};export{X as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.