1import{n as e,o as t}from"./rolldown-runtime-CMxvf4Kt.js";import{Ao as n,Pi as r,jo as i}from"./app-const-BzFqCjOv.js";import{bo as a,vo as o,wo as s}from"./ScrollArea-CdDxdn_v.js";import{gi as c,n as ee,wi as l}from"./es-D7HWafs1.js";import{a as u,d,h as f,l as p,y as m}from"../vendor/vendor-react-Bwss5s6Y.js";import{_t as h,a as g,bt as _,cn as v,n as y,o as b}from"./agent-Dh3-_0ai.js";import{s as x,t as S}from"./selectors-IDJ5-Ts8.js";import{Eo as C,n as w}from"./store-JX60g0Lu.js";import{i as te,n as ne}from"./global-DfKpeTkj.js";import{n as T,t as E}from"./useWorkspaceAwareNavigate--pLVtz2A.js";import{A as D,k as O,n as k,r as A}from"./NavPanel-CkWemAPV.js";import{l as j,t as M}from"./useHotkeys-D39xskQD.js";import{n as N,t as P}from"./useInitAgentConfig-CB4rtUF3.js";import{n as F,r as I}from"./AgentNotFound-DLOg-tEp.js";import{n as L}from"./ProtocolUrlHandler-BiwVUj8d.js";var R,z,B,V=e((()=>{_(),c(),R=t(i()),u(),E(),y(),b(),C(),z=new Set(Object.values(v)),B=()=>{let e=m(),[t]=p(),n=(0,R.useRef)(t);n.current=t;let r=T(),i=f(),a=!!e.aid&&z.has(e.aid),o=g(h.getBuiltinAgentId(a?e.aid:``));(0,R.useEffect)(()=>{if(a&&o){let n=i.pathname.replace(`/agent/${e.aid}`,``),a=t.toString();r(`/agent/${o}${n}${a?`?${a}`:``}`,{replace:!0})}},[a,o,r,t,i.pathname,e.aid]);let s=(0,R.useMemo)(()=>a&&o||e.aid,[a,o,e.aid]),c=l(s);return(0,R.useLayoutEffect)(()=>{s&&(g.getState().activeAgentId!==s&&g.setState({activeAgentId:s},!1,`AgentIdSync/syncAgentId`),w.getState().activeAgentId!==s&&w.setState({activeAgentId:s},!1,`AgentIdSync/syncAgentId`))},[s]),(0,R.useEffect)(()=>{c!==void 0&&c!==s&&(w.getState().clearPortalStack(),(e.topicId??n.current.get(`topic`))||w.getState().switchTopic(null,{skipRefreshMessage:!0}))},[s,c]),(0,R.useLayoutEffect)(()=>()=>{g.setState({activeAgentId:void 0},!1,`AgentIdSync/unmountAgentId`),w.setState({activeAgentId:void 0,activeTopicId:void 0},!1,`AgentIdSync/unmountAgentId`)},[]),null}})),H,U,W=e((()=>{H=t(i()),C(),S(),ne(),U=(0,H.memo)(()=>{let e=w(x.showPortal),t=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let{status:n,toggleLeftPanel:r}=te.getState();e?t.current===null&&(t.current=!!n.showLeftPanel,n.showLeftPanel&&r(!1)):t.current!==null&&(t.current&&r(!0),t.current=null)},[e]),null}),U.displayName=`PortalAutoCollapse`})),G,K,q=e((()=>{G=t(i()),M(),K=(0,G.memo)(()=>(j(),``))})),J,Y,X,re=e((()=>{J=t(i()),A(),D(),Y=t(n()),X=(0,J.memo)(()=>(0,Y.jsx)(k,{navKey:`agent`,children:(0,Y.jsx)(O,{})})),X.displayName=`ChatSidebar`})),Z,ie=e((()=>{a(),Z=s(({css:e,cssVar:t})=>({mainContainer:e` 2 position: relative; 3 overflow: hidden; 4 background: ${t.colorBgContainer}; 5 `}))})),Q,$;e((()=>{ee(),u(),r(),I(),L(),P(),V(),W(),q(),re(),ie(),Q=t(n()),$=()=>(N(),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{}),(0,Q.jsx)(o,{className:Z.mainContainer,flex:1,height:`100%`,children:(0,Q.jsx)(F,{children:(0,Q.jsx)(d,{})})}),(0,Q.jsx)(K,{}),!1,(0,Q.jsx)(B,{}),(0,Q.jsx)(U,{})]}))}))();export{$ 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.