@glwhappen/web-code 1.32.0 → 1.32.1

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.
Files changed (51) hide show
  1. package/dist/assets/{index-u6XmIqLb.js → index-CfT-2Nkf.js} +2 -2
  2. package/dist/index.html +1 -1
  3. package/dist-server/server/cursor-cli.js +33 -15
  4. package/dist-server/server/cursor-cli.js.map +1 -1
  5. package/dist-server/server/gemini-cli.js +48 -29
  6. package/dist-server/server/gemini-cli.js.map +1 -1
  7. package/dist-server/server/index.js +20 -17
  8. package/dist-server/server/index.js.map +1 -1
  9. package/dist-server/server/modules/database/repositories/push-subscriptions.js +11 -5
  10. package/dist-server/server/modules/database/repositories/push-subscriptions.js.map +1 -1
  11. package/dist-server/server/modules/projects/projects.routes.js +14 -0
  12. package/dist-server/server/modules/projects/projects.routes.js.map +1 -1
  13. package/dist-server/server/modules/projects/services/project-authorization.service.js +54 -0
  14. package/dist-server/server/modules/projects/services/project-authorization.service.js.map +1 -0
  15. package/dist-server/server/modules/projects/services/project-clone.service.js +13 -4
  16. package/dist-server/server/modules/projects/services/project-clone.service.js.map +1 -1
  17. package/dist-server/server/modules/projects/services/project-management.service.js +4 -2
  18. package/dist-server/server/modules/projects/services/project-management.service.js.map +1 -1
  19. package/dist-server/server/modules/projects/tests/project-authorization.service.test.js +51 -0
  20. package/dist-server/server/modules/projects/tests/project-authorization.service.test.js.map +1 -0
  21. package/dist-server/server/modules/projects/tests/project-clone.service.test.js +10 -1
  22. package/dist-server/server/modules/projects/tests/project-clone.service.test.js.map +1 -1
  23. package/dist-server/server/modules/projects/tests/project-management.service.test.js +31 -10
  24. package/dist-server/server/modules/projects/tests/project-management.service.test.js.map +1 -1
  25. package/dist-server/server/modules/websocket/services/chat-websocket.service.js +77 -13
  26. package/dist-server/server/modules/websocket/services/chat-websocket.service.js.map +1 -1
  27. package/dist-server/server/routes/agent.js +35 -7
  28. package/dist-server/server/routes/agent.js.map +1 -1
  29. package/dist-server/server/routes/settings.js +1 -1
  30. package/dist-server/server/routes/settings.js.map +1 -1
  31. package/dist-server/server/services/notification-orchestrator.js +1 -1
  32. package/dist-server/server/services/notification-orchestrator.js.map +1 -1
  33. package/dist-server/server/shared/utils.js +60 -9
  34. package/dist-server/server/shared/utils.js.map +1 -1
  35. package/package.json +1 -1
  36. package/server/cursor-cli.js +33 -15
  37. package/server/gemini-cli.js +48 -28
  38. package/server/index.js +21 -17
  39. package/server/modules/database/repositories/push-subscriptions.ts +14 -5
  40. package/server/modules/projects/projects.routes.ts +16 -0
  41. package/server/modules/projects/services/project-authorization.service.ts +70 -0
  42. package/server/modules/projects/services/project-clone.service.ts +18 -4
  43. package/server/modules/projects/services/project-management.service.ts +12 -3
  44. package/server/modules/projects/tests/project-authorization.service.test.ts +68 -0
  45. package/server/modules/projects/tests/project-clone.service.test.ts +11 -1
  46. package/server/modules/projects/tests/project-management.service.test.ts +38 -10
  47. package/server/modules/websocket/services/chat-websocket.service.ts +87 -19
  48. package/server/routes/agent.js +34 -7
  49. package/server/routes/settings.js +1 -1
  50. package/server/services/notification-orchestrator.js +1 -1
  51. package/server/shared/utils.ts +70 -9
@@ -716,7 +716,7 @@ import{j as s,_ as BI,a as $I,m as uC,E as zr,R as dC,o as pC,T as mC,P as hC,S
716
716
  .xterm-screen:focus {
717
717
  outline: none !important;
718
718
  }
719
- `;function xD(){if(typeof document>"u"||document.getElementById(ny))return;const e=document.createElement("style");e.id=ny,e.type="text/css",e.innerText=bD,document.head.appendChild(e)}function yD({terminalContainerRef:e,terminalRef:t,fitAddonRef:r,wsRef:n,selectedProject:a,minimal:i,isRestarting:o,initialCommandRef:l,isPlainShellRef:c,authUrlRef:u,copyAuthUrlToClipboard:d,closeSocket:p}){const[h,m]=f.useState(!1),g=f.useRef(null),b=a?.fullPath||a?.path||"",x=!!a;f.useEffect(()=>{xD()},[]);const y=f.useCallback(()=>{t.current&&(t.current.clear(),t.current.write("\x1B[2J\x1B[H"))},[t]),v=f.useCallback(()=>{t.current&&(t.current.dispose(),t.current=null),r.current=null,m(!1)},[r,t]);return f.useEffect(()=>{if(!e.current||!x||o||t.current)return;const w=new hD.Terminal(nD);t.current=w;const S=new uD.FitAddon;r.current=S,w.loadAddon(S),i||w.loadAddon(new pD.WebLinksAddon);try{w.loadAddon(new mD.WebglAddon)}catch{console.warn("[Shell] WebGL renderer unavailable, using Canvas fallback")}w.open(e.current);const T=async()=>{const N=w.getSelection();return N?hn(N):!1},k=N=>{if(!w.hasSelection())return;const I=w.getSelection();if(I){if(N.preventDefault(),N.clipboardData){N.clipboardData.setData("text/plain",I);return}hn(I)}};e.current.addEventListener("copy",k),w.attachCustomKeyEventHandler(N=>{const I=YC(l.current)?WC:u.current;return N.type==="keydown"&&i&&c.current&&I&&!N.ctrlKey&&!N.metaKey&&!N.altKey&&N.key?.toLowerCase()==="c"?(N.preventDefault(),N.stopPropagation(),d(I),!1):N.type==="keydown"&&(N.ctrlKey||N.metaKey)&&N.key?.toLowerCase()==="c"&&w.hasSelection()?(N.preventDefault(),N.stopPropagation(),T(),!1):N.type==="keydown"&&(N.ctrlKey||N.metaKey)&&N.key?.toLowerCase()==="v"?(N.preventDefault(),N.stopPropagation(),typeof navigator<"u"&&navigator.clipboard?.readText&&navigator.clipboard.readText().then(D=>{wa(n.current,{type:"input",data:D})}).catch(()=>{}),!1):!0}),window.setTimeout(()=>{const N=r.current,I=t.current;!N||!I||(N.fit(),wa(n.current,{type:"resize",cols:I.cols,rows:I.rows}))},KC),m(!0);const C=w.onData(N=>{wa(n.current,{type:"input",data:N})}),A=new ResizeObserver(()=>{g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{const N=r.current,I=t.current;!N||!I||(N.fit(),wa(n.current,{type:"resize",cols:I.cols,rows:I.rows}))},X8)});return A.observe(e.current),()=>{e.current?.removeEventListener("copy",k),A.disconnect(),g.current!==null&&(window.clearTimeout(g.current),g.current=null),C.dispose(),p(),v()}},[u,p,d,v,r,l,c,o,i,x,b,e,t,n]),{isInitialized:h,clearTerminalScreen:y,disposeTerminal:v}}function vD({selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:n,minimal:a,autoConnect:i,isRestarting:o,onProcessComplete:l,onOutputRef:c}){const u=f.useRef(null),d=f.useRef(null),p=f.useRef(null),h=f.useRef(null),[m,g]=f.useState(""),[b,x]=f.useState(0),y=f.useRef(e),v=f.useRef(t),w=f.useRef(r),S=f.useRef(n),T=f.useRef(l),k=f.useRef(""),C=f.useRef(t?.id??null);f.useEffect(()=>{y.current=e,v.current=t,w.current=r,S.current=n,T.current=l},[e,t,r,n,l]);const A=f.useCallback(q=>{k.current=q,g(q),x(O=>O+1)},[]),N=f.useCallback(()=>{const q=h.current;q&&((q.readyState===WebSocket.OPEN||q.readyState===WebSocket.CONNECTING)&&q.close(),h.current=null)},[]),I=f.useCallback((q=k.current)=>{if(!q)return!1;const O=window.open(q,"_blank");if(O){try{O.opener=null}catch{}return!0}return!1},[]),D=f.useCallback(async(q=k.current)=>q?hn(q):!1,[]),{isInitialized:j,clearTerminalScreen:F,disposeTerminal:E}=yD({terminalContainerRef:u,terminalRef:d,fitAddonRef:p,wsRef:h,selectedProject:e,minimal:a,isRestarting:o,initialCommandRef:w,isPlainShellRef:S,authUrlRef:k,copyAuthUrlToClipboard:D,closeSocket:N}),{isConnected:$,isConnecting:G,connectToShell:V,disconnectFromShell:K}=cD({wsRef:h,terminalRef:d,fitAddonRef:p,selectedProjectRef:y,selectedSessionRef:v,initialCommandRef:w,isPlainShellRef:S,onProcessCompleteRef:T,isInitialized:j,autoConnect:i,closeSocket:N,clearTerminalScreen:F,setAuthUrl:A,onOutputRef:c});return f.useEffect(()=>{o&&(K(),E())},[K,E,o]),f.useEffect(()=>{e||(K(),E())},[K,E,e]),f.useEffect(()=>{const q=t?.id??null;C.current!==q&&j&&K(),C.current=q},[K,j,t?.id]),{terminalContainerRef:u,terminalRef:d,wsRef:h,isConnected:$,isInitialized:j,isConnecting:G,authUrl:m,authUrlVersion:b,connectToShell:V,disconnectFromShell:K,openAuthUrlInBrowser:I,copyAuthUrlToClipboard:D}}function kD({mode:e,description:t,loadingLabel:r,connectLabel:n,connectTitle:a,connectingLabel:i,onConnect:o}){return e==="loading"?s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90",children:s.jsx("div",{className:"text-white",children:r})}):e==="connect"?s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90 p-4",children:s.jsxs("div",{className:"w-full max-w-sm text-center",children:[s.jsxs("button",{onClick:o,className:"flex w-full items-center justify-center space-x-2 rounded-lg bg-green-600 px-6 py-3 text-base font-medium text-white transition-colors hover:bg-green-700 sm:w-auto",title:a,children:[s.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),s.jsx("span",{children:n})]}),s.jsx("p",{className:"mt-3 px-2 text-sm text-gray-400",children:t})]})}):s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90 p-4",children:s.jsxs("div",{className:"w-full max-w-sm text-center",children:[s.jsxs("div",{className:"flex items-center justify-center space-x-3 text-yellow-400",children:[s.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-yellow-400 border-t-transparent"}),s.jsx("span",{className:"text-base font-medium",children:i})]}),s.jsx("p",{className:"mt-3 px-2 text-sm text-gray-400",children:t})]})})}function wD({title:e,description:t}){return s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[s.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800",children:s.jsx("svg",{className:"h-8 w-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2z"})})}),s.jsx("h3",{className:"mb-2 text-lg font-semibold",children:e}),s.jsx("p",{children:t})]})})}function SD({isConnected:e,isInitialized:t,isRestarting:r,hasSession:n,sessionDisplayNameShort:a,onDisconnect:i,onRestart:o,statusNewSessionText:l,statusInitializingText:c,statusRestartingText:u,disconnectLabel:d,disconnectTitle:p,restartLabel:h,restartTitle:m,disableRestart:g}){return s.jsx("div",{className:"flex-shrink-0 border-b border-gray-700 bg-gray-800 px-4 py-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:`h-2 w-2 rounded-full ${e?"bg-green-500":"bg-red-500"}`}),n&&a&&s.jsxs("span",{className:"text-xs text-blue-300",children:["(",a,"...)"]}),!n&&s.jsx("span",{className:"text-xs text-gray-400",children:l}),!t&&s.jsx("span",{className:"text-xs text-yellow-400",children:c}),r&&s.jsx("span",{className:"text-xs text-blue-400",children:u})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[e&&s.jsxs("button",{onClick:i,className:"flex items-center space-x-1 rounded bg-red-600 px-3 py-1 text-xs text-white hover:bg-red-700",title:p,children:[s.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),s.jsx("span",{children:d})]}),s.jsxs("button",{onClick:o,disabled:g,className:"flex items-center space-x-1 text-xs text-gray-400 hover:text-white disabled:cursor-not-allowed disabled:opacity-50",title:m,children:[s.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),s.jsx("span",{children:h})]})]})]})})}function ED({terminalContainerRef:e,authUrl:t,authUrlVersion:r,initialCommand:n,isConnected:a,openAuthUrlInBrowser:i,copyAuthUrlToClipboard:o}){const[l,c]=f.useState("idle"),[u,d]=f.useState(!1),p=f.useMemo(()=>fD(n,t),[t,n]);f.useEffect(()=>{c("idle"),d(!1)},[r,p,a]);const h=!!p,m=h&&!u,g=h&&u;return s.jsxs("div",{className:"relative h-full w-full bg-gray-900",children:[s.jsx("div",{ref:e,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),m&&s.jsx("div",{className:"absolute inset-x-0 bottom-14 z-20 border-t border-gray-700/80 bg-gray-900/95 p-3 backdrop-blur-sm md:hidden",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-xs text-gray-300",children:"Open or copy the login URL:"}),s.jsx("button",{type:"button",onClick:()=>d(!0),className:"rounded bg-gray-700 px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-gray-100 hover:bg-gray-600",children:"Hide"})]}),s.jsx("input",{type:"text",value:p,readOnly:!0,onClick:b=>b.currentTarget.select(),className:"w-full rounded border border-gray-600 bg-gray-800 px-2 py-1 text-xs text-gray-100 focus:outline-none focus:ring-1 focus:ring-blue-500","aria-label":"Authentication URL"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>{i(p)},className:"flex-1 rounded bg-blue-600 px-3 py-2 text-xs font-medium text-white hover:bg-blue-700",children:"Open URL"}),s.jsx("button",{type:"button",onClick:async()=>{const b=await o(p);c(b?"copied":"failed")},className:"flex-1 rounded bg-gray-700 px-3 py-2 text-xs font-medium text-white hover:bg-gray-600",children:l==="copied"?"Copied":"Copy URL"})]})]})}),g&&s.jsx("div",{className:"absolute bottom-14 right-3 z-20 md:hidden",children:s.jsx("button",{type:"button",onClick:()=>d(!1),className:"rounded bg-gray-800/95 px-3 py-2 text-xs font-medium text-gray-100 shadow-lg backdrop-blur-sm hover:bg-gray-700",children:"Show login URL"})})]})}const ND=[{type:"key",id:"esc",label:"Esc",sequence:"\x1B"},{type:"key",id:"tab",label:"Tab",sequence:" "},{type:"key",id:"shift-tab",label:"⇧Tab",sequence:"\x1B[Z"},{type:"modifier",id:"ctrl",label:"CTRL",modifier:"ctrl"},{type:"modifier",id:"alt",label:"ALT",modifier:"alt"},{type:"arrow",id:"arrow-up",sequence:"\x1B[A",icon:"up"},{type:"arrow",id:"arrow-down",sequence:"\x1B[B",icon:"down"},{type:"arrow",id:"arrow-left",sequence:"\x1B[D",icon:"left"},{type:"arrow",id:"arrow-right",sequence:"\x1B[C",icon:"right"}],CD={up:_C,down:_l,left:j7,right:Fg},Ui=e=>e.preventDefault(),ay="shrink-0 rounded-md border border-gray-600 bg-gray-700 px-2.5 py-1.5 text-xs font-medium text-gray-100 transition-colors select-none active:bg-blue-600 active:text-white active:border-blue-600 disabled:cursor-not-allowed disabled:opacity-40",TD="shrink-0 rounded-md border border-blue-500 bg-blue-600 px-2.5 py-1.5 text-xs font-medium text-white transition-colors select-none disabled:cursor-not-allowed disabled:opacity-40",wc="shrink-0 rounded-md border border-gray-600 bg-gray-700 p-1.5 text-gray-100 transition-colors select-none active:bg-blue-600 active:text-white active:border-blue-600 disabled:cursor-not-allowed disabled:opacity-40";function iy({wsRef:e,terminalRef:t,isConnected:r,bottomOffset:n="bottom-0"}){const{t:a}=Fe("settings"),[i,o]=f.useState(!1),[l,c]=f.useState(!1),u=f.useCallback(m=>{wa(e.current,{type:"input",data:m})},[e]),d=f.useCallback(()=>{t.current?.scrollToBottom()},[t]),p=f.useCallback(async()=>{if(!(typeof navigator>"u"||!navigator.clipboard?.readText))try{const m=await navigator.clipboard.readText();m.length>0&&u(m)}catch{}},[u]),h=f.useCallback(m=>{let g=m;if(i&&m.length===1){const b=m.toLowerCase().charCodeAt(0);b>=97&&b<=122&&(g=String.fromCharCode(b-96)),o(!1)}l&&m.length===1&&(g="\x1B"+g,c(!1)),u(g)},[i,l,u]);return s.jsx("div",{className:`pointer-events-none fixed inset-x-0 ${n} z-20 px-2 md:hidden`,children:s.jsxs("div",{className:"pointer-events-auto flex items-center gap-1 overflow-x-auto rounded-lg border border-gray-700/80 bg-gray-900/95 px-1.5 py-1.5 shadow-lg backdrop-blur-sm [-webkit-overflow-scrolling:touch] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx("button",{type:"button",onPointerDown:Ui,onClick:()=>{p()},disabled:!r,className:wc,title:a("terminalShortcuts.paste",{defaultValue:"Paste"}),"aria-label":a("terminalShortcuts.paste",{defaultValue:"Paste"}),children:s.jsx(xR,{className:"h-4 w-4"})}),ND.map(m=>{if(m.type==="modifier"){const g=m.modifier==="ctrl"?i:l,b=m.modifier==="ctrl"?()=>o(x=>!x):()=>c(x=>!x);return s.jsx("button",{type:"button",onPointerDown:Ui,onClick:b,disabled:!r,className:g?TD:ay,children:m.label},m.id)}if(m.type==="arrow"){const g=CD[m.icon];return s.jsx("button",{type:"button",onPointerDown:Ui,onClick:()=>u(m.sequence),disabled:!r,className:wc,children:s.jsx(g,{className:"h-4 w-4"})},m.id)}return s.jsx("button",{type:"button",onPointerDown:Ui,onClick:()=>h(m.sequence),disabled:!r,className:ay,children:m.label},m.id)}),s.jsx("button",{type:"button",onPointerDown:Ui,onClick:d,disabled:!r,className:wc,title:a("terminalShortcuts.scrollDown"),"aria-label":a("terminalShortcuts.scrollDown"),children:s.jsx(RC,{className:"h-4 w-4"})})]})})}function ZC({selectedProject:e=null,selectedSession:t=null,initialCommand:r=null,isPlainShell:n=!1,onProcessComplete:a=null,minimal:i=!1,autoConnect:o=!1,isActive:l=!0}){const{t:c}=Fe("chat"),[u,d]=f.useState(!1),[p,h]=f.useState(null),m=f.useRef(null),g=f.useRef(null),{terminalContainerRef:b,terminalRef:x,wsRef:y,isConnected:v,isInitialized:w,isConnecting:S,authUrl:T,authUrlVersion:k,connectToShell:C,disconnectFromShell:A,openAuthUrlInBrowser:N,copyAuthUrlToClipboard:I}=vD({selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:n,minimal:i,autoConnect:o,isRestarting:u,onProcessComplete:a,onOutputRef:g}),D=f.useCallback(()=>{const M=x.current;if(!M)return;const P=M.buffer.active,Y=P.baseY+P.cursorY,Z=Math.min(P.baseY+P.length-1,Y+10),ie=Math.max(0,Y-Q8),J=[];for(let we=ie;we<=Z;we++){const Ee=P.getLine(we);Ee&&J.push(Ee.translateToString().trimEnd())}let pe=-1;for(let we=J.length-1;we>=0;we--)if(/esc to cancel/i.test(J[we])||/enter to select/i.test(J[we])){pe=we;break}if(pe===-1){h(null);return}const de=new Map,be=Math.max(0,pe-eD);for(let we=pe-1;we>=be;we--){const Ee=J[we].match(/^\s*[❯›>]?\s*(\d+)\.\s+(.+)/);if(Ee){const L=Ee[1],ce=Ee[2].trim();parseInt(L,10)<=tD&&ce.length>0&&!de.has(L)&&de.set(L,ce)}}const ke=[];for(let we=1;we<=de.size&&de.has(String(we));we++)ke.push({number:String(we),label:de.get(String(we))});h(ke.length>=rD?ke:null)},[x]),j=f.useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(D,J8)},[D]);f.useEffect(()=>{g.current=j},[j]),f.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),f.useEffect(()=>{v||(m.current&&(clearTimeout(m.current),m.current=null),h(null))},[v]),f.useEffect(()=>{if(!l||!w||!v)return;const M=()=>{x.current?.focus()},P=window.requestAnimationFrame(M),Y=window.setTimeout(M,0);return()=>{window.cancelAnimationFrame(P),window.clearTimeout(Y)}},[l,v,w,x]);const F=f.useCallback(M=>{wa(y.current,{type:"input",data:M})},[y]),E=f.useMemo(()=>gD(t),[t]),$=f.useMemo(()=>E?E.slice(0,30):null,[E]),G=f.useMemo(()=>E?E.slice(0,50):null,[E]),V=f.useCallback(()=>{d(!0),window.setTimeout(()=>{d(!1)},Z8)},[]);if(!e)return s.jsx(wD,{title:c("shell.selectProject.title"),description:c("shell.selectProject.description")});if(i)return s.jsxs(s.Fragment,{children:[s.jsx(ED,{terminalContainerRef:b,authUrl:T,authUrlVersion:k,initialCommand:r,isConnected:v,openAuthUrlInBrowser:N,copyAuthUrlToClipboard:I}),s.jsx(iy,{wsRef:y,terminalRef:x,isConnected:v,bottomOffset:"bottom-0"})]});const K=n?c("shell.runCommand",{command:r||c("shell.defaultCommand"),projectName:e.displayName}):t?c("shell.resumeSession",{displayName:G}):c("shell.startSession"),q=n?c("shell.runCommand",{command:r||c("shell.defaultCommand"),projectName:e.displayName}):c("shell.startCli",{projectName:e.displayName}),O=w?S?"connecting":v?null:"connect":"loading",z=O==="connecting"?q:K;return s.jsxs("div",{className:"flex h-full w-full flex-col bg-gray-900",children:[s.jsx(SD,{isConnected:v,isInitialized:w,isRestarting:u,hasSession:!!t,sessionDisplayNameShort:$,onDisconnect:A,onRestart:V,statusNewSessionText:c("shell.status.newSession"),statusInitializingText:c("shell.status.initializing"),statusRestartingText:c("shell.status.restarting"),disconnectLabel:c("shell.actions.disconnect"),disconnectTitle:c("shell.actions.disconnectTitle"),restartLabel:c("shell.actions.restart"),restartTitle:c("shell.actions.restartTitle"),disableRestart:u||v}),s.jsxs("div",{className:"relative flex-1 overflow-hidden p-2",children:[s.jsx("div",{ref:b,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),O&&s.jsx(kD,{mode:O,description:z,loadingLabel:c("shell.loading"),connectLabel:c("shell.actions.connect"),connectTitle:c("shell.actions.connectTitle"),connectingLabel:c("shell.connecting"),onConnect:C}),p&&v&&s.jsx("div",{className:"absolute inset-x-0 bottom-0 z-10 border-t border-gray-700/80 bg-gray-800/95 px-3 py-2 backdrop-blur-sm",onMouseDown:M=>M.preventDefault(),children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.map(M=>s.jsxs("button",{type:"button",onClick:()=>{F(M.number),h(null)},className:"max-w-36 truncate rounded bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-700",title:`${M.number}. ${M.label}`,children:[M.number,". ",M.label]},M.number)),s.jsx("button",{type:"button",onClick:()=>{F("\x1B"),h(null)},className:"rounded bg-gray-700 px-3 py-1.5 text-xs font-medium text-gray-200 transition-colors hover:bg-gray-600",children:"Esc"})]})})]}),s.jsx(iy,{wsRef:y,terminalRef:x,isConnected:v})]})}function AD({className:e}){return s.jsx("div",{className:`flex h-full items-center justify-center ${e}`,children:s.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[s.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800",children:s.jsx("svg",{className:"h-8 w-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 002 2z"})})}),s.jsx("h3",{className:"mb-2 text-lg font-semibold",children:"No Project Selected"}),s.jsx("p",{children:"A project is required to open a shell"})]})})}function ID({title:e,isCompleted:t,onClose:r=null}){return s.jsx("div",{className:"flex-shrink-0 border-b border-gray-700 bg-gray-800 px-4 py-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-200",children:e}),t&&s.jsx("span",{className:"text-xs text-green-400",children:"(Completed)"})]}),r&&s.jsx("button",{onClick:r,className:"text-gray-400 hover:text-white",title:"Close",children:s.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})}function XC({project:e=null,session:t=null,command:r=null,isPlainShell:n=null,isActive:a=!0,autoConnect:i=!0,onComplete:o=null,onClose:l=null,title:c=null,className:u="",showHeader:d=!0,compact:p=!1,minimal:h=!1}){const[m,g]=f.useState(!1),b=n!==null?n:r!==null,x=f.useCallback(y=>{g(!0),o?.(y)},[o]);return e?s.jsxs("div",{className:`flex h-full w-full flex-col ${u}`,children:[!h&&d&&c&&s.jsx(ID,{title:c,isCompleted:m,onClose:l}),s.jsx("div",{className:"min-h-0 w-full flex-1",children:s.jsx(ZC,{selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:b,isActive:a,onProcessComplete:x,minimal:h,autoConnect:h?!0:i})})]}):s.jsx(AD,{className:u})}const jD=({provider:e,customCommand:t,isAuthenticated:r})=>t||(e==="claude"?"claude --dangerously-skip-permissions /login":e==="cursor"?"cursor-agent login":e==="codex"?"codex login":"gemini status"),RD=e=>e==="claude"?"Claude CLI Login":e==="cursor"?"Cursor CLI Login":e==="codex"?"Codex CLI Login":"Gemini CLI Configuration";function JC({isOpen:e,onClose:t,provider:r="claude",onComplete:n,customCommand:a,isAuthenticated:i=!1}){if(!e)return null;const o=jD({provider:r,customCommand:a,isAuthenticated:i}),l=RD(r),c=u=>{n?.(u)};return s.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black bg-opacity-50 max-md:items-stretch max-md:justify-stretch",children:s.jsxs("div",{className:"flex h-3/4 w-full max-w-4xl flex-col rounded-lg bg-white shadow-xl dark:bg-gray-800 max-md:m-0 max-md:h-full max-md:max-w-none max-md:rounded-none md:m-4 md:h-3/4 md:max-w-4xl md:rounded-lg",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 p-4 dark:border-gray-700",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:l}),s.jsx("button",{onClick:t,className:"text-gray-400 transition-colors hover:text-gray-600 dark:hover:text-gray-300","aria-label":"Close login modal",children:s.jsx(gt,{className:"h-6 w-6"})})]}),s.jsx("div",{className:"flex-1 overflow-hidden",children:r==="gemini"?s.jsxs("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-8 text-center dark:bg-gray-900/50",children:[s.jsx("div",{className:"mb-6 flex h-16 w-16 items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30",children:s.jsx(PC,{className:"h-8 w-8 text-blue-600 dark:text-blue-400"})}),s.jsx("h4",{className:"mb-3 text-xl font-medium text-gray-900 dark:text-white",children:"Setup Gemini API Access"}),s.jsx("p",{className:"mb-8 max-w-md text-gray-600 dark:text-gray-400",children:"The Gemini CLI requires an API key to function. Configure it in your terminal first."}),s.jsx("div",{className:"w-full max-w-lg rounded-xl border border-gray-200 bg-white p-6 text-left shadow-sm dark:border-gray-700 dark:bg-gray-800",children:s.jsxs("ol",{className:"space-y-4",children:[s.jsxs("li",{className:"flex gap-4",children:[s.jsx("div",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-blue-100 text-sm font-medium text-blue-600 dark:bg-blue-900/50 dark:text-blue-400",children:"1"}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-1 text-sm font-medium text-gray-900 dark:text-white",children:"Get your API key"}),s.jsxs("a",{href:"https://aistudio.google.com/app/apikey",target:"_blank",rel:"noreferrer",className:"flex inline-flex items-center gap-1 text-sm text-blue-600 hover:underline dark:text-blue-400",children:["Google AI Studio ",s.jsx(Yr,{className:"h-3 w-3"})]})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("div",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-blue-100 text-sm font-medium text-blue-600 dark:bg-blue-900/50 dark:text-blue-400",children:"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-1 text-sm font-medium text-gray-900 dark:text-white",children:"Run configuration"}),s.jsx("p",{className:"mb-2 text-sm text-gray-600 dark:text-gray-400",children:"Open your terminal and run:"}),s.jsx("code",{className:"block rounded bg-gray-100 px-3 py-2 font-mono text-sm text-pink-600 dark:bg-gray-900 dark:text-pink-400",children:"gemini config set api_key YOUR_KEY"})]})]})]})}),s.jsx("button",{onClick:t,className:"mt-8 rounded-lg bg-blue-600 px-6 py-2.5 font-medium text-white transition-colors hover:bg-blue-700",children:"Done"})]}):s.jsx(XC,{project:g7,command:o,onComplete:c,minimal:!0})})]})})}const _D=({className:e="w-5 h-5"})=>s.jsx("img",{src:"/icons/claude-ai-icon.svg",alt:"Claude",className:e}),DD=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Ra();return s.jsx("img",{src:t?"/icons/codex-white.svg":"/icons/codex.svg",alt:"Codex",className:e})},MD=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Ra();return s.jsx("img",{src:t?"/icons/cursor-white.svg":"/icons/cursor.svg",alt:"Cursor",className:e})},OD=({className:e="w-5 h-5"})=>s.jsx("img",{src:"/icons/gemini-ai-icon.svg",alt:"Gemini",className:e});function $r({provider:e="claude",className:t="w-5 h-5"}){return e==="cursor"?s.jsx(MD,{className:t}):e==="codex"?s.jsx(DD,{className:t}):e==="gemini"?s.jsx(OD,{className:t}):s.jsx(_D,{className:t})}function LD({provider:e,title:t,status:r,connectedClassName:n,iconContainerClassName:a,loginButtonClassName:i,onLogin:o}){const l=r.authenticated?n:"border-border bg-card",c=r.loading?"Checking...":r.authenticated?r.email||"Connected":r.error||"Not connected";return s.jsx("div",{className:`rounded-lg border p-4 transition-colors ${l}`,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-full ${a}`,children:s.jsx($r,{provider:e,className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 font-medium text-foreground",children:[t,r.authenticated&&s.jsx(rr,{className:"h-4 w-4 text-green-500"})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:c})]})]}),!r.authenticated&&!r.loading&&s.jsx("button",{onClick:o,className:`${i} rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors`,children:"Login"})]})})}const PD=[{provider:"claude",title:"Claude Code",connectedClassName:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",iconContainerClassName:"bg-blue-100 dark:bg-blue-900/30",loginButtonClassName:"bg-blue-600 hover:bg-blue-700"},{provider:"cursor",title:"Cursor",connectedClassName:"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-800",iconContainerClassName:"bg-purple-100 dark:bg-purple-900/30",loginButtonClassName:"bg-purple-600 hover:bg-purple-700"},{provider:"codex",title:"OpenAI Codex",connectedClassName:"bg-gray-100 dark:bg-gray-800/50 border-gray-300 dark:border-gray-600",iconContainerClassName:"bg-gray-100 dark:bg-gray-800",loginButtonClassName:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600"},{provider:"gemini",title:"Gemini",connectedClassName:"bg-teal-50 dark:bg-teal-900/20 border-teal-200 dark:border-teal-800",iconContainerClassName:"bg-teal-100 dark:bg-teal-900/30",loginButtonClassName:"bg-teal-600 hover:bg-teal-700"}];function FD({providerStatuses:e,onOpenProviderLogin:t}){return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"mb-6 text-center",children:[s.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",children:"Connect Your AI Agents"}),s.jsx("p",{className:"text-muted-foreground",children:"Login to one or more AI coding assistants. All are optional."})]}),s.jsx("div",{className:"space-y-3",children:PD.map(r=>s.jsx(LD,{provider:r.provider,title:r.title,status:e[r.provider],connectedClassName:r.connectedClassName,iconContainerClassName:r.iconContainerClassName,loginButtonClassName:r.loginButtonClassName,onLogin:()=>t(r.provider)},r.provider))}),s.jsx("div",{className:"pt-2 text-center text-sm text-muted-foreground",children:s.jsx("p",{children:"You can configure these later in Settings."})})]})}function zD({gitName:e,gitEmail:t,isSubmitting:r,onGitNameChange:n,onGitEmailChange:a}){return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"mb-8 text-center",children:[s.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30",children:s.jsx(mr,{className:"h-8 w-8 text-blue-600 dark:text-blue-400"})}),s.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",children:"Git Configuration"}),s.jsx("p",{className:"text-muted-foreground",children:"Configure your git identity to ensure proper attribution for commits."})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"gitName",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[s.jsx(HC,{className:"h-4 w-4"}),"Git Name ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("input",{type:"text",id:"gitName",value:e,onChange:i=>n(i.target.value),className:"w-full rounded-lg border border-border bg-background px-4 py-3 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"John Doe",required:!0,disabled:r}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.name`."})]}),s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"gitEmail",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[s.jsx(T_,{className:"h-4 w-4"}),"Git Email ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("input",{type:"email",id:"gitEmail",value:t,onChange:i=>a(i.target.value),className:"w-full rounded-lg border border-border bg-background px-4 py-3 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"john@example.com",required:!0,disabled:r}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.email`."})]})]})]})}const sy=[{title:"Git Configuration",icon:mr,required:!0},{title:"Connect Agents",icon:BC,required:!1}];function BD({currentStep:e}){return s.jsx("div",{className:"mb-8",children:s.jsx("div",{className:"flex items-center justify-between",children:sy.map((t,r)=>{const n=r<e,a=r===e,i=t.icon;return s.jsxs("div",{className:"contents",children:[s.jsxs("div",{className:"flex flex-1 flex-col items-center",children:[s.jsx("div",{className:`flex h-12 w-12 items-center justify-center rounded-full border-2 transition-colors duration-200 ${n?"border-green-500 bg-green-500 text-white":a?"border-blue-600 bg-blue-600 text-white":"border-border bg-background text-muted-foreground"}`,children:n?s.jsx(rr,{className:"h-6 w-6"}):s.jsx(i,{className:"h-6 w-6"})}),s.jsxs("div",{className:"mt-2 text-center",children:[s.jsx("p",{className:`text-sm font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:t.title}),t.required&&s.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),r<sy.length-1&&s.jsx("div",{className:`mx-2 h-0.5 flex-1 transition-colors duration-200 ${n?"bg-green-500":"bg-border"}`})]},t.title)})})})}const oy=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ly=async(e,t)=>{try{return(await e.json()).error||t}catch{return t}};function $D({onComplete:e}){const[t,r]=f.useState(0),[n,a]=f.useState(""),[i,o]=f.useState(""),[l,c]=f.useState(!1),[u,d]=f.useState(""),[p,h]=f.useState(null),{providerAuthStatus:m,checkProviderAuthStatus:g,refreshProviderAuthStatuses:b}=VC(),x=f.useRef(void 0),y=f.useCallback(async()=>{try{const A=await Ce("/api/user/git-config");if(!A.ok)return;const N=await A.json();N.gitName&&a(N.gitName),N.gitEmail&&o(N.gitEmail)}catch(A){console.error("Error loading git config:",A)}},[]);f.useEffect(()=>{y(),b()},[y,b]),f.useEffect(()=>{const A=x.current;x.current=p,A!=null&&p===null&&b()},[p,b]);const v=A=>{h(A)},w=A=>{A===0&&p&&g(p)},S=async()=>{if(d(""),t!==0){r(A=>A+1);return}if(!n.trim()||!i.trim()){d("Both git name and email are required.");return}if(!oy.test(i)){d("Please enter a valid email address.");return}c(!0);try{const A=await Ce("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:n,gitEmail:i})});if(!A.ok){const N=await ly(A,"Failed to save git configuration");throw new Error(N)}r(N=>N+1)}catch(A){d(A instanceof Error?A.message:"Failed to save git configuration")}finally{c(!1)}},T=()=>{d(""),r(A=>A-1)},k=async()=>{c(!0),d("");try{const A=await Ce("/api/user/complete-onboarding",{method:"POST"});if(!A.ok){const N=await ly(A,"Failed to complete onboarding");throw new Error(N)}await e?.()}catch(A){d(A instanceof Error?A.message:"Failed to complete onboarding")}finally{c(!1)}},C=t===0?!!(n.trim()&&i.trim()&&oy.test(i)):!0;return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs("div",{className:"w-full max-w-2xl",children:[s.jsx(BD,{currentStep:t}),s.jsxs("div",{className:"rounded-lg border border-border bg-card p-8 shadow-lg",children:[t===0?s.jsx(zD,{gitName:n,gitEmail:i,isSubmitting:l,onGitNameChange:a,onGitEmailChange:o}):s.jsx(FD,{providerStatuses:m,onOpenProviderLogin:v}),u&&s.jsx("div",{className:"mt-6 rounded-lg border border-red-300 bg-red-100 p-4 dark:border-red-800 dark:bg-red-900/20",children:s.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:u})}),s.jsxs("div",{className:"mt-8 flex items-center justify-between border-t border-border pt-6",children:[s.jsxs("button",{onClick:T,disabled:t===0||l,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground transition-colors duration-200 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",children:[s.jsx(Bg,{className:"h-4 w-4"}),"Previous"]}),s.jsx("div",{className:"flex items-center gap-3",children:t<1?s.jsx("button",{onClick:S,disabled:!C||l,className:"flex items-center gap-2 rounded-lg bg-blue-600 px-6 py-3 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-400",children:l?s.jsxs(s.Fragment,{children:[s.jsx(tr,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):s.jsxs(s.Fragment,{children:["Next",s.jsx(Br,{className:"h-4 w-4"})]})}):s.jsx("button",{onClick:k,disabled:l,className:"flex items-center gap-2 rounded-lg bg-green-600 px-6 py-3 font-medium text-white transition-colors duration-200 hover:bg-green-700 disabled:cursor-not-allowed disabled:bg-green-400",children:l?s.jsxs(s.Fragment,{children:[s.jsx(tr,{className:"h-4 w-4 animate-spin"}),"Completing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(rr,{className:"h-4 w-4"}),"Complete Setup"]})})})]})]})]})}),p&&s.jsx(JC,{isOpen:!!p,onClose:()=>h(null),provider:p,onComplete:w})]})}const UD=["0s","0.1s","0.2s"];function GD(){return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"mb-4 flex justify-center",children:s.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:s.jsx(pn,{className:"h-8 w-8 text-primary-foreground"})})}),s.jsx("h1",{className:"mb-2 text-2xl font-bold text-foreground",children:"CloudCLI"}),s.jsx("div",{className:"flex items-center justify-center space-x-2",children:UD.map(e=>s.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-blue-500",style:{animationDelay:e}},e))}),s.jsx("p",{className:"mt-2 text-muted-foreground",children:"Loading..."})]})})}function QC({errorMessage:e}){return e?s.jsx("div",{className:"rounded-md border border-red-300 bg-red-100 p-3 dark:border-red-800 dark:bg-red-900/20",children:s.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:e})}):null}function ps({id:e,label:t,value:r,onChange:n,placeholder:a,isDisabled:i,type:o="text",name:l,autoComplete:c}){return s.jsxs("div",{children:[s.jsx("label",{htmlFor:e,className:"mb-1 block text-sm font-medium text-foreground",children:t}),s.jsx("input",{id:e,type:o,name:l??e,autoComplete:c,value:r,onChange:u=>n(u.target.value),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:a,required:!0,disabled:i})]})}function e5({title:e,description:t,children:r,footerText:n,logo:a}){return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsx("div",{className:"w-full max-w-md",children:s.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-8 shadow-lg",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"mb-4 flex justify-center",children:a??s.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:s.jsx(pn,{className:"h-8 w-8 text-primary-foreground"})})}),s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:e}),s.jsx("p",{className:"mt-2 text-muted-foreground",children:t})]}),r,s.jsx("div",{className:"text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:n})}),s.jsxs("div",{className:"flex items-center justify-center gap-1.5 pt-2",children:[s.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),s.jsx("a",{href:"https://github.com/siteboon/claudecodeui",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground/50 transition-colors hover:text-muted-foreground",children:"CloudCLI is open source"})]})]})})})}const qD={username:"",password:""};function HD(){const{t:e}=Fe("auth"),{login:t}=_a(),[r,n]=f.useState(qD),[a,i]=f.useState(""),[o,l]=f.useState(!1),c=f.useCallback((d,p)=>{n(h=>({...h,[d]:p}))},[]),u=f.useCallback(async d=>{if(d.preventDefault(),i(""),!r.username.trim()||!r.password){i(e("login.errors.requiredFields"));return}l(!0);const p=await t(r.username.trim(),r.password);p.success||i(p.error),l(!1)},[r.password,r.username,t,e]);return s.jsx(e5,{title:e("login.title"),description:e("login.description"),footerText:"Enter your credentials to access CloudCLI",children:s.jsxs("form",{onSubmit:u,className:"space-y-4",children:[s.jsx(ps,{id:"username",label:e("login.username"),value:r.username,onChange:d=>c("username",d),placeholder:e("login.placeholders.username"),isDisabled:o,autoComplete:"username"}),s.jsx(ps,{id:"password",label:e("login.password"),value:r.password,onChange:d=>c("password",d),placeholder:e("login.placeholders.password"),isDisabled:o,type:"password",autoComplete:"current-password"}),s.jsx(QC,{errorMessage:a}),s.jsx("button",{type:"submit",disabled:o,className:"w-full rounded-md bg-blue-600 px-4 py-2 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:bg-blue-400",children:e(o?"login.loading":"login.submit")})]})})}const VD={username:"",password:"",confirmPassword:""};function WD(e){return!e.username.trim()||!e.password||!e.confirmPassword?"Please fill in all fields.":e.username.trim().length<3?"Username must be at least 3 characters long.":e.password.length<6?"Password must be at least 6 characters long.":e.password!==e.confirmPassword?"Passwords do not match.":null}function KD(){const{register:e}=_a(),[t,r]=f.useState(VD),[n,a]=f.useState(""),[i,o]=f.useState(!1),l=f.useCallback((u,d)=>{r(p=>({...p,[u]:d}))},[]),c=f.useCallback(async u=>{u.preventDefault(),a("");const d=WD(t);if(d){a(d);return}o(!0);const p=await e(t.username.trim(),t.password);p.success||a(p.error),o(!1)},[t,e]);return s.jsx(e5,{title:"Welcome to CloudCLI",description:"Set up your account to get started",footerText:"Create the administrator account to get started. Additional users can be invited later.",logo:s.jsx("img",{src:"/logo.svg",alt:"CloudCLI",className:"h-16 w-16"}),children:s.jsxs("form",{onSubmit:c,className:"space-y-4",children:[s.jsx(ps,{id:"username",name:"username",label:"Username",value:t.username,onChange:u=>l("username",u),placeholder:"Enter your username",isDisabled:i,autoComplete:"username"}),s.jsx(ps,{id:"password",name:"password",label:"Password",value:t.password,onChange:u=>l("password",u),placeholder:"Enter your password",isDisabled:i,type:"password",autoComplete:"new-password"}),s.jsx(ps,{id:"confirmPassword",name:"confirmPassword",label:"Confirm Password",value:t.confirmPassword,onChange:u=>l("confirmPassword",u),placeholder:"Confirm your password",isDisabled:i,type:"password",autoComplete:"new-password"}),s.jsx(QC,{errorMessage:n}),s.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-md bg-blue-600 px-4 py-2 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:bg-blue-400",children:i?"Setting up...":"Create Account"})]})})}function YD({children:e}){const{user:t,isLoading:r,needsSetup:n,hasCompletedOnboarding:a,refreshOnboardingStatus:i}=_a();return r?s.jsx(GD,{}):n?s.jsx(KD,{}):t?a?s.jsx(s.Fragment,{children:e}):s.jsx($D,{onComplete:i}):s.jsx(HD,{})}const t5=f.createContext(null),r5=()=>{const e=f.useContext(t5);if(!e)throw new Error("useWebSocket must be used within a WebSocketProvider");return e},ZD=e=>{const t=window.location.protocol==="https:"?"wss:":"ws:";return e?`${t}//${window.location.host}/ws?token=${encodeURIComponent(e)}`:null},XD=()=>{const e=f.useRef(null),t=f.useRef(!1),r=f.useRef(!1),[n,a]=f.useState(null),[i,o]=f.useState(!1),l=f.useRef(null),{token:c}=_a();f.useEffect(()=>(u(),()=>{t.current=!0,l.current&&clearTimeout(l.current),e.current&&e.current.close()}),[c]);const u=f.useCallback(()=>{if(!t.current)try{const h=ZD(c);if(!h)return console.warn("No authentication token found for WebSocket connection");const m=new WebSocket(h);m.onopen=()=>{o(!0),e.current=m,r.current&&a({type:"websocket-reconnected",timestamp:Date.now()}),r.current=!0},m.onmessage=g=>{try{const b=JSON.parse(g.data);a(b)}catch(b){console.error("Error parsing WebSocket message:",b)}},m.onclose=()=>{o(!1),e.current=null,l.current=setTimeout(()=>{t.current||u()},3e3)},m.onerror=g=>{console.error("WebSocket error:",g)}}catch(h){console.error("Error creating WebSocket connection:",h)}},[c]),d=f.useCallback(h=>{const m=e.current;m&&m.readyState===WebSocket.OPEN?m.send(JSON.stringify(h)):console.warn("WebSocket not connected")},[]);return f.useMemo(()=>({ws:e.current,sendMessage:d,latestMessage:n,isConnected:i}),[d,n,i])},JD=({children:e})=>{const t=XD();return s.jsx(t5.Provider,{value:t,children:e})},n5=f.createContext(null);function QD(e,t){return{message:t instanceof Error?t.message:`Failed to ${e}`,context:e,timestamp:new Date().toISOString()}}function qa(e){return{...e,taskMasterConfigured:e.taskmaster?.hasTaskmaster??!1,taskMasterStatus:e.taskmaster?.status??"not-configured",taskCount:Number(e.taskmaster?.metadata?.taskCount??0),completedCount:Number(e.taskmaster?.metadata?.completed??0)}}function eM(e){return e.find(t=>t.status==="pending"||t.status==="in-progress")??null}function tM(e){return e?.type?e.type.startsWith("taskmaster-"):!1}function Ai(){const e=f.useContext(n5);if(!e)throw new Error("useTaskMaster must be used within a TaskMasterProvider");return e}function rM({children:e}){const{latestMessage:t}=r5(),{user:r,token:n,isLoading:a}=_a(),[i,o]=f.useState([]),[l,c]=f.useState(null),[u,d]=f.useState(null),[p,h]=f.useState(null),[m,g]=f.useState([]),[b,x]=f.useState(null),[y,v]=f.useState(!1),[w,S]=f.useState(!1),[T,k]=f.useState(!1),[C,A]=f.useState(null),N=f.useRef(null),I=f.useRef(null),D=f.useRef(0);f.useEffect(()=>{N.current=l?.projectId??null},[l?.projectId]),f.useEffect(()=>{I.current=u},[u]);const j=f.useCallback(()=>{A(null)},[]),F=f.useCallback((z,M)=>{console.error(`TaskMaster ${z} error:`,M),A(QD(z,M))},[]),E=f.useCallback((z,M)=>{d(M),o(P=>P.map(Y=>Y.projectId!==z?Y:qa({...Y,taskmaster:M??void 0}))),c(P=>!P||P.projectId!==z?P:qa({...P,taskmaster:M??void 0}))},[]),$=f.useCallback(async z=>{if(!z||!r||!n)return;const M=++D.current;try{const P=await Ye.projectTaskmaster(z);if(!P.ok)throw new Error(`Failed to fetch TaskMaster details: ${P.status}`);const Z=(await P.json()).taskmaster??null;if(M!==D.current||N.current!==z)return;E(z,Z)}catch(P){if(M!==D.current||N.current!==z)return;F("load selected project TaskMaster info",P)}},[E,F,n,r]),G=f.useCallback(z=>{const M=z?qa(z):null;if(c(M),d(M?.taskmaster??null),g([]),x(null),!M?.projectId){D.current+=1;return}$(M.projectId)},[$]),V=f.useCallback(async()=>{if(!r||!n){o([]),c(null),d(null),g([]),x(null);return}try{v(!0),j();const z=await Ye.get("/projects");if(!z.ok)throw new Error(`Failed to fetch projects: ${z.status}`);const M=await z.json(),Y=(Array.isArray(M)?M:[]).map(pe=>qa(pe));o(pe=>{const de=new Map(pe.filter(be=>!!be.taskmaster).map(be=>[be.projectId,be.taskmaster]));return Y.map(be=>{const ke=de.get(be.projectId);return ke?qa({...be,taskmaster:ke}):be})});const Z=N.current;if(!Z)return;const ie=Y.find(pe=>pe.projectId===Z)??null;if(!ie){D.current+=1,c(null),d(null),g([]),x(null);return}const J=ie.taskmaster??I.current??null;c(J?qa({...ie,taskmaster:J}):ie),d(J),$(Z)}catch(z){F("load projects",z)}finally{v(!1)}},[j,F,$,n,r]),K=f.useCallback(async()=>{const z=l?.projectId;if(!z||!r||!n){g([]),x(null);return}try{S(!0),j();const M=await Ye.get(`/taskmaster/tasks/${encodeURIComponent(z)}`);if(!M.ok){const Z=await M.json();throw new Error(Z.message??"Failed to load tasks")}const P=await M.json(),Y=Array.isArray(P.tasks)?P.tasks:[];g(Y),x(eM(Y))}catch(M){F("load tasks",M),g([]),x(null)}finally{S(!1)}},[j,l?.projectId,F,n,r]),q=f.useCallback(async()=>{if(!r||!n){h(null);return}try{k(!0),j();const z=await Ye.get("/mcp-utils/taskmaster-server");if(!z.ok)throw new Error(`Failed to load MCP status: ${z.status}`);const M=await z.json();h(M)}catch(z){F("check MCP server status",z),h(null)}finally{k(!1)}},[j,F,n,r]);f.useEffect(()=>{!a&&r&&n&&(V(),q())},[a,q,V,n,r]),f.useEffect(()=>{l?.projectId&&r&&n&&K()},[l?.projectId,K,n,r]),f.useEffect(()=>{const z=t;if(tM(z)){if(z.type==="taskmaster-project-updated"&&z.projectId){z.projectId===N.current&&$(z.projectId),V();return}if(z.type==="taskmaster-tasks-updated"&&z.projectId===l?.projectId){K();return}z.type==="taskmaster-mcp-status-changed"&&q()}},[l?.projectId,t,$,q,V,K]);const O=f.useMemo(()=>({projects:i,currentProject:l,projectTaskMaster:u,mcpServerStatus:p,tasks:m,nextTask:b,isLoading:y,isLoadingTasks:w,isLoadingMCP:T,error:C,refreshProjects:V,setCurrentProject:G,refreshTasks:K,refreshMCPStatus:q,clearError:j}),[j,l,C,y,T,w,p,b,u,i,q,V,K,G,m]);return s.jsx(n5.Provider,{value:O,children:e})}const a5=f.createContext({tasksEnabled:!0,setTasksEnabled:()=>{},toggleTasksEnabled:()=>{},isTaskMasterInstalled:null,isTaskMasterReady:null,installationStatus:null,isCheckingInstallation:!0}),Pl=()=>{const e=f.useContext(a5);if(!e)throw new Error("useTasksSettings must be used within a TasksSettingsProvider");return e},nM=({children:e})=>{const[t,r]=f.useState(()=>{const m=localStorage.getItem("tasks-enabled");return m!==null?JSON.parse(m):!0}),[n,a]=f.useState(null),[i,o]=f.useState(null),[l,c]=f.useState(null),[u,d]=f.useState(!0);f.useEffect(()=>{localStorage.setItem("tasks-enabled",JSON.stringify(t))},[t]),f.useEffect(()=>{setTimeout(async()=>{try{const g=await Ye.get("/taskmaster/installation-status");if(g.ok){const b=await g.json();c(b),a(b.installation?.isInstalled||!1),o(b.isReady||!1);const x=localStorage.getItem("tasks-enabled");!b.installation?.isInstalled&&!x&&r(!1)}else console.error("Failed to check TaskMaster installation status"),a(!1),o(!1)}catch(g){console.error("Error checking TaskMaster installation:",g),a(!1),o(!1)}finally{d(!1)}},0)},[]);const h={tasksEnabled:t,setTasksEnabled:r,toggleTasksEnabled:()=>{r(m=>!m)},isTaskMasterInstalled:n,isTaskMasterReady:i,installationStatus:l,isCheckingInstallation:u};return s.jsx(a5.Provider,{value:h,children:e})},i5=f.createContext(null);function Fl(){const e=f.useContext(i5);if(!e)throw new Error("usePlugins must be used within a PluginsProvider");return e}function aM({children:e}){const[t,r]=f.useState([]),[n,a]=f.useState(!0),[i,o]=f.useState(null),l=f.useCallback(async()=>{try{const h=await Ce("/api/plugins");if(h.ok){const m=await h.json();r(m.plugins||[]),o(null)}else{let m=`Failed to fetch plugins (${h.status})`;try{const g=await h.json();m=g.details||g.error||m}catch{m=h.statusText||m}o(m)}}catch(h){const m=h instanceof Error?h.message:"Failed to fetch plugins";o(m),console.error("[Plugins] Failed to fetch plugins:",h)}finally{a(!1)}},[]);f.useEffect(()=>{l()},[l]);const c=f.useCallback(async h=>{try{const m=await Ce("/api/plugins/install",{method:"POST",body:JSON.stringify({url:h})}),g=await m.json();return m.ok?(await l(),{success:!0}):{success:!1,error:g.details||g.error||"Install failed"}}catch(m){return{success:!1,error:m instanceof Error?m.message:"Install failed"}}},[l]),u=f.useCallback(async h=>{try{const m=await Ce(`/api/plugins/${encodeURIComponent(h)}`,{method:"DELETE"}),g=await m.json();return m.ok?(await l(),{success:!0}):{success:!1,error:g.details||g.error||"Uninstall failed"}}catch(m){return{success:!1,error:m instanceof Error?m.message:"Uninstall failed"}}},[l]),d=f.useCallback(async h=>{try{const m=await Ce(`/api/plugins/${encodeURIComponent(h)}/update`,{method:"POST"}),g=await m.json();return m.ok?(await l(),{success:!0}):{success:!1,error:g.details||g.error||"Update failed"}}catch(m){return{success:!1,error:m instanceof Error?m.message:"Update failed"}}},[l]),p=f.useCallback(async(h,m)=>{try{const g=await Ce(`/api/plugins/${encodeURIComponent(h)}/enable`,{method:"PUT",body:JSON.stringify({enabled:m})});if(!g.ok){let b=`Toggle failed (${g.status})`;try{const x=await g.json();b=x.details||x.error||b}catch{b=g.statusText||b}return{success:!1,error:b}}return await l(),{success:!0,error:null}}catch(g){return{success:!1,error:g instanceof Error?g.message:"Toggle failed"}}},[l]);return s.jsx(i5.Provider,{value:{plugins:t,loading:n,pluginsError:i,refreshPlugins:l,installPlugin:c,uninstallPlugin:u,updatePlugin:d,togglePlugin:p},children:e})}const cy=e=>typeof window>"u"?!1:window.innerWidth<e,uy=()=>{if(typeof window>"u")return!1;const e=window.navigator;return window.matchMedia("(display-mode: standalone)").matches||!!e.standalone||document.referrer.includes("android-app://")};function Wg(e={}){const{mobileBreakpoint:t=768,trackMobile:r=!0,trackPWA:n=!0}=e,[a,i]=f.useState(()=>r?cy(t):!1),[o,l]=f.useState(()=>n?uy():!1);return f.useEffect(()=>{if(!r||typeof window>"u")return;const c=()=>{i(cy(t))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[t,r]),f.useEffect(()=>{if(!n||typeof window>"u")return;const c=window.matchMedia("(display-mode: standalone)"),u=()=>{l(uy())};return u(),typeof c.addEventListener=="function"?(c.addEventListener("change",u),()=>{c.removeEventListener("change",u)}):(c.addListener(u),()=>{c.removeListener(u)})},[n]),{isMobile:a,isPWA:o}}const dy="1.32.0",iM=(e,t)=>{const r=e.split(".").map(Number),n=t.split(".").map(Number);for(let a=0;a<Math.max(r.length,n.length);a++){const i=r[a]||0,o=n[a]||0;if(i!==o)return i-o}return 0},s5=(e,t)=>{const[r,n]=f.useState(!1),[a,i]=f.useState(null),[o,l]=f.useState(null),[c,u]=f.useState("git");return f.useEffect(()=>{(async()=>{try{const h=await(await fetch("/health")).json();(h.installMode==="npm"||h.installMode==="git")&&u(h.installMode)}catch{}})()},[]),f.useEffect(()=>{const d=async()=>{try{const m=await(await fetch(`https://api.github.com/repos/${e}/${t}/releases/latest`)).json();if(m.tag_name){const g=m.tag_name.replace(/^v/,"");i(g),n(iM(g,dy)>0),l({title:m.name||m.tag_name,body:m.body||"",htmlUrl:m.html_url||`https://github.com/${e}/${t}/releases/latest`,publishedAt:m.published_at})}else n(!1),i(null),l(null)}catch(h){console.error("Version check failed:",h),n(!1),i(null),l(null)}};d();const p=setInterval(d,300*1e3);return()=>clearInterval(p)},[e,t]),{updateAvailable:r,latestVersion:a,currentVersion:dy,releaseInfo:o,installMode:c}},ya={autoExpandTools:!1,showRawParameters:!1,showThinking:!0,autoScrollToBottom:!0,sendByCtrlEnter:!1,sidebarVisible:!0},al=Object.keys(ya),sM=new Set(al),Sc="ui-preferences:sync",il=(e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1}return t},oM=(e,t)=>{try{const r=localStorage.getItem(e);if(r===null)return t;const n=JSON.parse(r);return il(n,t)}catch{return t}},lM=e=>{if(typeof window>"u")return ya;try{const t=localStorage.getItem(e);if(t){const r=JSON.parse(t);if(r&&typeof r=="object"&&!Array.isArray(r)){const n=r;return al.reduce((a,i)=>(a[i]=il(n[i],ya[i]),a),{...ya})}}}catch{}return al.reduce((t,r)=>(t[r]=oM(r,ya[r]),t),{...ya})};function cM(e,t){switch(t.type){case"set":{const{key:r,value:n}=t;if(!sM.has(r))return e;const a=il(n,e[r]);return e[r]===a?e:{...e,[r]:a}}case"set_many":{const r=t.value||{};let n=!1;const a={...e};for(const i of al){if(!(i in r))continue;const o=r[i],l=il(o,e[i]);a[i]!==l&&(a[i]=l,n=!0)}return n?a:e}case"reset":return{...ya,...t.value||{}};default:return e}}function Kg(e="uiPreferences"){const t=f.useRef(`ui-preferences-${Math.random().toString(36).slice(2)}`),[r,n]=f.useReducer(cM,e,lM);return f.useEffect(()=>{typeof window>"u"||(localStorage.setItem(e,JSON.stringify(r)),window.dispatchEvent(new CustomEvent(Sc,{detail:{storageKey:e,sourceId:t.current,value:r}})))},[r,e]),f.useEffect(()=>{if(typeof window>"u")return;const l=d=>{!d||typeof d!="object"||Array.isArray(d)||n({type:"set_many",value:d})},c=d=>{if(!(d.key!==e||d.newValue===null))try{const p=JSON.parse(d.newValue);l(p)}catch{}},u=d=>{const h=d.detail;!h||h.storageKey!==e||h.sourceId===t.current||l(h.value)};return window.addEventListener("storage",c),window.addEventListener(Sc,u),()=>{window.removeEventListener("storage",c),window.removeEventListener(Sc,u)}},[e]),{preferences:r,setPreference:(l,c)=>{n({type:"set",key:l,value:c})},setPreferences:l=>{n({type:"set_many",value:l})},resetPreferences:l=>{n({type:"reset",value:l})},dispatch:n}}const Yg=f.createContext(null),Ec={openFile:()=>{},openSettings:()=>{},refreshProjects:()=>{}};function uM({children:e}){const t=f.useRef({});return s.jsx(Yg.Provider,{value:t,children:e})}function Ds(){const e=f.useContext(Yg);return f.useMemo(()=>({openFile:t=>(e?.current.openFile??Ec.openFile)(t),openSettings:t=>(e?.current.openSettings??Ec.openSettings)(t),refreshProjects:()=>(e?.current.refreshProjects??Ec.refreshProjects)()}),[e])}function o5(e){const t=f.useContext(Yg),{openFile:r,openSettings:n,refreshProjects:a}=e;f.useEffect(()=>{if(!t)return;const i={...t.current};return r&&(t.current.openFile=r),n&&(t.current.openSettings=n),a&&(t.current.refreshProjects=a),()=>{r&&t.current.openFile===r&&(t.current.openFile=i.openFile),n&&t.current.openSettings===n&&(t.current.openSettings=i.openSettings),a&&t.current.refreshProjects===a&&(t.current.refreshProjects=i.refreshProjects)}},[t,r,n,a])}const dM=()=>{try{const e=localStorage.getItem("claude-settings");return e&&JSON.parse(e).projectSortOrder==="date"?"date":"name"}catch{return"name"}},l5="starredProjects",pM=()=>{try{const e=localStorage.getItem(l5);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.map(r=>String(r).trim()).filter(r=>r.length>0):[]}catch{return[]}},mM=()=>{try{localStorage.removeItem(l5)}catch{}},c5=e=>String(e.createdAt||e.created_at||""),u5=e=>String(e.lastActivity||""),sl=e=>new Date(u5(e)||c5(e)||0),hM=(e,t)=>e.summary||e.name||t("projects.newSession"),fM=e=>u5(e)||c5(e),gM=(e,t,r)=>{const n=sl(e),a=Math.floor((t.getTime()-n.getTime())/(1e3*60));return{isCursorSession:e.__provider==="cursor",isCodexSession:e.__provider==="codex",isGeminiSession:e.__provider==="gemini",isActive:a<10,sessionName:hM(e,r),sessionTime:fM(e),messageCount:Number(e.messageCount||0)}},ol=e=>{const t=[...e.sessions||[]].map(i=>({...i,__provider:"claude"})),r=(e.cursorSessions||[]).map(i=>({...i,__provider:"cursor"})),n=(e.codexSessions||[]).map(i=>({...i,__provider:"codex"})),a=(e.geminiSessions||[]).map(i=>({...i,__provider:"gemini"}));return[...t,...r,...n,...a].sort((i,o)=>sl(o).getTime()-sl(i).getTime())},py=e=>{const t=ol(e);return t.length===0?new Date(0):t.reduce((r,n)=>{const a=sl(n);return a>r?a:r},new Date(0))},bM=(e,t)=>{const r=[...e];return r.sort((n,a)=>{const i=!!n.isStarred,o=!!a.isStarred;return i&&!o?-1:!i&&o?1:t==="date"?py(a).getTime()-py(n).getTime():(n.displayName||n.projectId).localeCompare(a.displayName||a.projectId)}),r},xM=(e,t)=>{const r=t.trim().toLowerCase();return r?e.filter(n=>{const a=(n.displayName||n.projectId).toLowerCase(),i=(n.path||n.fullPath||"").toLowerCase();return a.includes(r)||i.includes(r)}):e},yM=(e,t)=>{const r=!!e.taskmaster?.hasTaskmaster,n=!!(t?.hasMCPServer&&t?.isConfigured);return r&&n?"fully-configured":r?"taskmaster-only":n?"mcp-only":"not-configured"},vM=e=>{const t=typeof e.fullPath=="string"&&e.fullPath.length>0?e.fullPath:typeof e.path=="string"?e.path:"";return{name:e.projectId,displayName:typeof e.displayName=="string"&&e.displayName.trim().length>0?e.displayName:e.projectId,fullPath:t,path:typeof e.path=="string"&&e.path.length>0?e.path:t}};function kM({projects:e,selectedProject:t,selectedSession:r,isLoading:n,isMobile:a,t:i,onRefresh:o,onProjectSelect:l,onSessionSelect:c,onSessionDelete:u,onLoadMoreSessions:d,onProjectDelete:p,setCurrentProject:h,setSidebarVisible:m,sidebarVisible:g}){const b=Ds(),[x,y]=f.useState(new Set),[v,w]=f.useState(null),[S,T]=f.useState(!1),[k,C]=f.useState(""),[A,N]=f.useState(new Set),[I,D]=f.useState(new Date),[j,F]=f.useState("name"),[E,$]=f.useState(!1),[G,V]=f.useState(null),[K,q]=f.useState(""),[O,z]=f.useState(""),[M,P]=f.useState(new Set),[Y,Z]=f.useState(null),[ie,J]=f.useState(null),[pe,de]=f.useState(!1),[be,ke]=f.useState("projects"),[we,Ee]=f.useState(null),[L,ce]=f.useState(!1),[se,W]=f.useState(null),[H,ne]=f.useState([]),[he,me]=f.useState([]),[oe,xe]=f.useState(!1),[Q,re]=f.useState(""),[X,le]=f.useState(new Map),[ge,_e]=f.useState(new Set),Oe=f.useRef(0),Ve=f.useRef(null),st=f.useRef(new Map),Ke=f.useRef(!1),et=f.useRef(o),pt=!a&&!g;f.useEffect(()=>{const ye=setInterval(()=>{D(new Date)},6e4);return()=>clearInterval(ye)},[]),f.useEffect(()=>{N(new Set)},[e]),f.useEffect(()=>{const ye=t?.projectId;ye&&y(Ne=>{if(Ne.has(ye))return Ne;const $e=new Set(Ne);return $e.add(ye),$e})},[t?.projectId]),f.useEffect(()=>{if(e.length>0&&!n){const ye=new Set;e.forEach(Ne=>{Ne.sessions&&Ne.sessions.length>=0&&ye.add(Ne.projectId)}),N(ye)}},[e,n]),f.useEffect(()=>{const ye=()=>{F(dM())};ye();const Ne=He=>{He.key==="claude-settings"&&ye()};window.addEventListener("storage",Ne);const $e=setInterval(()=>{document.hasFocus()&&ye()},1e3);return()=>{window.removeEventListener("storage",Ne),clearInterval($e)}},[]),f.useEffect(()=>{et.current=o},[o]);const We=f.useCallback(async()=>{xe(!0);try{const[ye,Ne]=await Promise.all([Ye.archivedProjects(),Ye.getArchivedSessions()]);if(!ye.ok)throw new Error(`Failed to load archived projects: ${ye.status}`);if(!Ne.ok)throw new Error(`Failed to load archived sessions: ${Ne.status}`);const $e=await ye.json(),He=await Ne.json(),wt=Array.isArray($e.data?.projects)?$e.data.projects:[],bt=new Set(wt.map(Wt=>Wt.projectId)),sr=Array.isArray(He.data?.sessions)?He.data.sessions.filter(Wt=>!Wt.projectId||!bt.has(Wt.projectId)):[];ne(wt),me(sr)}catch(ye){console.error("[Sidebar] Failed to load archived sessions:",ye)}finally{xe(!1)}},[]);f.useEffect(()=>{if(Ke.current)return;const ye=pM();if(ye.length===0)return;Ke.current=!0,(async()=>{try{await Ye.migrateLegacyProjectStars(ye),await et.current()}catch($e){console.error("[Sidebar] Failed to migrate legacy starred projects:",$e)}finally{mM()}})()},[o]),f.useEffect(()=>{We()},[We]),f.useEffect(()=>{be==="archived"&&We()},[We,be]),f.useEffect(()=>{le(ye=>{if(ye.size===0)return ye;const Ne=new Map(ye);let $e=!1;for(const[He,wt]of ye.entries()){const bt=e.find(sr=>sr.projectId===He);if(!bt){Ne.delete(He),$e=!0;continue}!!bt.isStarred===wt&&(Ne.delete(He),$e=!0)}return $e?Ne:ye})},[e]),f.useEffect(()=>{const ye=setTimeout(()=>{re(O.trim())},300);return()=>{clearTimeout(ye)}},[O]),f.useEffect(()=>{Ve.current&&(Ve.current.close(),Ve.current=null);const ye=Q;if(be!=="conversations"||ye.length<2){Oe.current+=1,Ee(null),W(null),ce(!1);return}ce(!0);const Ne=++Oe.current;if(Ne!==Oe.current)return;const $e=Ye.searchConversationsUrl(ye),He=new EventSource($e);Ve.current=He;const wt=[];let bt=0;return He.addEventListener("result",sr=>{if(Ne!==Oe.current){He.close();return}try{const Wt=JSON.parse(sr.data);wt.push(Wt.projectResult),bt=Wt.totalMatches,Ee({results:[...wt],totalMatches:bt,query:ye}),W({scannedProjects:Wt.scannedProjects,totalProjects:Wt.totalProjects})}catch{}}),He.addEventListener("progress",sr=>{if(Ne!==Oe.current){He.close();return}try{const Wt=JSON.parse(sr.data);bt=Wt.totalMatches,W({scannedProjects:Wt.scannedProjects,totalProjects:Wt.totalProjects})}catch{}}),He.addEventListener("done",()=>{if(Ne!==Oe.current){He.close();return}He.close(),Ve.current=null,ce(!1),W(null),wt.length===0&&Ee({results:[],totalMatches:0,query:ye})}),He.addEventListener("error",()=>{if(Ne!==Oe.current){He.close();return}He.close(),Ve.current=null,ce(!1),W(null),wt.length===0&&Ee({results:[],totalMatches:0,query:ye})}),()=>{Ve.current&&(Ve.current.close(),Ve.current=null)}},[Q,be]);const xt=f.useCallback(ye=>{y(Ne=>{const $e=new Set;return Ne.has(ye)||$e.add(ye),$e})},[]),mt=f.useCallback((ye,Ne)=>{c({...ye,__projectId:Ne})},[c]),kt=f.useCallback(ye=>X.has(ye)?!!X.get(ye):e.some(Ne=>Ne.projectId===ye&&!!Ne.isStarred),[X,e]),ct=f.useCallback(ye=>{const Ne=kt(ye),$e=!Ne,He=(st.current.get(ye)??0)+1;st.current.set(ye,He),le(bt=>{const sr=new Map(bt);return sr.set(ye,$e),sr}),(async()=>{try{const bt=await Ye.toggleProjectStar(ye);if(!bt.ok){const Wr=(await bt.json()).error,pc=typeof Wr=="string"?Wr:Wr&&typeof Wr=="object"&&Wr.message?Wr.message:i("messages.updateProjectError");throw new Error(pc)}const sr=await bt.json();if(!(st.current.get(ye)===He))return;le(pa=>{const Wr=new Map(pa);return Wr.set(ye,!!sr.isStarred),Wr})}catch(bt){if(!(st.current.get(ye)===He))return;le(Wt=>{const pa=new Map(Wt);return pa.set(ye,Ne),pa}),console.error("[Sidebar] Failed to toggle project star:",bt),alert(i("messages.updateProjectError"))}})()},[kt,i]),Ut=f.useCallback(ye=>kt(ye),[kt]),Gt=f.useCallback(ye=>ol(ye),[]),je=f.useCallback(async ye=>{if(!d)return;let Ne=!1;if(_e($e=>{if($e.has(ye))return $e;Ne=!0;const He=new Set($e);return He.add(ye),He}),!!Ne)try{await d(ye)}catch($e){console.error("[Sidebar] Failed to load more sessions:",$e),alert(i("messages.refreshError"))}finally{_e($e=>{const He=new Set($e);return He.delete(ye),He})}},[d,i]),rt=f.useMemo(()=>X.size===0?e:e.map(ye=>{const Ne=X.get(ye.projectId);return Ne===void 0||!!ye.isStarred===Ne?ye:{...ye,isStarred:Ne}}),[X,e]),tt=f.useMemo(()=>bM(rt,j),[j,rt]),ut=f.useMemo(()=>xM(tt,Q),[Q,tt]),Ct=f.useMemo(()=>{const ye=Q.trim().toLowerCase();return ye?he.filter(Ne=>[Ne.sessionTitle,Ne.projectDisplayName,Ne.projectPath??"",Ne.provider].some(He=>He.toLowerCase().includes(ye))):he},[he,Q]),Rt=f.useMemo(()=>{const ye=Q.trim().toLowerCase();return ye?H.filter(Ne=>[Ne.displayName,Ne.fullPath||""].some(He=>He.toLowerCase().includes(ye))?!0:ol(Ne).some(He=>[typeof He.summary=="string"&&He.summary.trim().length>0?He.summary:typeof He.name=="string"?He.name:"",He.__provider].some(bt=>bt.toLowerCase().includes(ye)))):H},[H,Q]),Qr=f.useCallback(ye=>{w(ye.projectId),C(ye.displayName)},[]),fr=f.useCallback(()=>{w(null),C("")},[]),Mr=f.useCallback(async ye=>{try{(await Ye.renameProject(ye,k)).ok?await b.refreshProjects():console.error("Failed to rename project")}catch(Ne){console.error("Error renaming project:",Ne)}finally{w(null),C("")}},[k,b]),Me=f.useCallback((ye,Ne,$e,He="claude",wt={})=>{J({projectId:ye,sessionId:Ne,sessionTitle:$e,provider:He,isArchived:!!wt.isArchived})},[]),Le=f.useCallback(async(ye=!1)=>{if(!ie)return;const{sessionId:Ne}=ie;J(null);try{const $e=await Ye.deleteSession(Ne,ye);if($e.ok)u?.(Ne),await We();else{const He=await $e.text();console.error("[Sidebar] Failed to delete session:",{status:$e.status,error:He}),alert(i("messages.deleteSessionFailed"))}}catch($e){console.error("[Sidebar] Error deleting session:",$e),alert(i("messages.deleteSessionError"))}},[We,u,ie,i]),De=f.useCallback(ye=>{Z({project:ye,sessionCount:Gt(ye).length})},[Gt]),nt=f.useCallback(async(ye=!1)=>{if(!Y)return;const{project:Ne}=Y;Z(null),P($e=>new Set([...$e,Ne.projectId]));try{const $e=await Ye.deleteProject(Ne.projectId,ye);if($e.ok)p?.(Ne.projectId);else{const wt=(await $e.json()).error,bt=typeof wt=="string"?wt:wt&&typeof wt=="object"&&wt.message?wt.message:i("messages.deleteProjectFailed");alert(bt)}}catch($e){console.error("Error deleting project:",$e),alert(i("messages.deleteProjectError"))}finally{P($e=>{const He=new Set($e);return He.delete(Ne.projectId),He})}},[Y,p,i]),Tt=f.useCallback(ye=>{l(ye),h(ye)},[l,h]),Xt=f.useCallback(ye=>{const Ne=ye.projectId?e.find(bt=>bt.projectId===ye.projectId):null,$e=ye.projectId?H.find(bt=>bt.projectId===ye.projectId):null,He=Ne??$e??null,wt={id:ye.sessionId,summary:ye.sessionTitle,__provider:ye.provider,__projectId:He?.projectId??ye.projectId??void 0};He&&Tt(He),c(wt)},[H,Tt,c,e]),yt=f.useCallback(async ye=>{try{const Ne=await Ye.restoreProject(ye);if(!Ne.ok){const $e=await Ne.text();console.error("[Sidebar] Failed to restore project:",{status:Ne.status,error:$e}),alert(i("messages.restoreProjectFailed","Failed to restore project. Please try again."));return}await Promise.all([Promise.resolve(o()),We()])}catch(Ne){console.error("[Sidebar] Error restoring project:",Ne),alert(i("messages.restoreProjectError","Error restoring project. Please try again."))}},[We,o,i]),ar=f.useCallback(async ye=>{try{const Ne=await Ye.restoreSession(ye);if(!Ne.ok){const $e=await Ne.text();console.error("[Sidebar] Failed to restore session:",{status:Ne.status,error:$e}),alert(i("messages.restoreSessionFailed","Failed to restore session. Please try again."));return}await Promise.all([Promise.resolve(o()),We()])}catch(Ne){console.error("[Sidebar] Error restoring session:",Ne),alert(i("messages.restoreSessionError","Error restoring session. Please try again."))}},[We,o,i]),Hr=f.useCallback(async()=>{$(!0);try{await Promise.all([Promise.resolve(o()),We()])}finally{$(!1)}},[We,o]),gr=f.useCallback(async(ye,Ne,$e,He)=>{const wt=$e.trim();if(!wt){V(null),q("");return}try{const bt=await Ye.renameSession(Ne,wt);bt.ok?await o():(console.error("[Sidebar] Failed to rename session:",bt.status),alert(i("messages.renameSessionFailed")))}catch(bt){console.error("[Sidebar] Error renaming session:",bt),alert(i("messages.renameSessionError"))}finally{V(null),q("")}},[o,i]),ir=f.useCallback(()=>{m(!1)},[m]),Vr=f.useCallback(()=>{m(!0)},[m]);return{isSidebarCollapsed:pt,expandedProjects:x,editingProject:v,showNewProject:S,editingName:k,initialSessionsLoaded:A,currentTime:I,projectSortOrder:j,isRefreshing:E,editingSession:G,editingSessionName:K,searchFilter:O,deletingProjects:M,loadingMoreProjects:ge,deleteConfirmation:Y,sessionDeleteConfirmation:ie,showVersionModal:pe,filteredProjects:ut,archivedProjects:Rt,archivedSessions:Ct,archivedSessionsCount:H.length+he.length,isArchivedSessionsLoading:oe,toggleProject:xt,handleSessionClick:mt,toggleStarProject:ct,isProjectStarred:Ut,getProjectSessions:Gt,loadMoreSessionsForProject:je,startEditing:Qr,cancelEditing:fr,saveProjectName:Mr,showDeleteSessionConfirmation:Me,confirmDeleteSession:Le,requestProjectDelete:De,confirmDeleteProject:nt,handleProjectSelect:Tt,openArchivedSession:Xt,restoreArchivedProject:yt,restoreArchivedSession:ar,refreshProjects:Hr,updateSessionSummary:gr,collapseSidebar:ir,expandSidebar:Vr,setShowNewProject:T,setEditingName:C,setEditingSession:V,setEditingSessionName:q,searchMode:be,setSearchMode:ke,conversationResults:we,isSearching:L,searchProgress:se,clearConversationResults:f.useCallback(()=>{Oe.current+=1,Ve.current&&(Ve.current.close(),Ve.current=null),ce(!1),W(null),Ee(null)},[]),setSearchFilter:z,setDeleteConfirmation:Z,setSessionDeleteConfirmation:J,setShowVersionModal:de}}const wM="https://discord.gg/buxwujPNRE",SM="https://github.com/siteboon/claudecodeui/issues/new";function EM({className:e}){return s.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}function NM({onExpand:e,onShowSettings:t,updateAvailable:r,onShowVersionModal:n,t:a}){return s.jsxs("div",{className:"flex h-full w-12 flex-col items-center gap-1 bg-background/80 py-3 backdrop-blur-sm",children:[s.jsx("button",{onClick:e,className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("common:versionUpdate.ariaLabels.showSidebar"),title:a("common:versionUpdate.ariaLabels.showSidebar"),children:s.jsx(G_,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),s.jsx("div",{className:"nav-divider my-1 w-6"}),s.jsx("button",{onClick:t,className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.settings"),title:a("actions.settings"),children:s.jsx(vt,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),s.jsx("a",{href:SM,target:"_blank",rel:"noopener noreferrer",className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.reportIssue"),title:a("actions.reportIssue"),children:s.jsx(R0,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),s.jsx("a",{href:wM,target:"_blank",rel:"noopener noreferrer",className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.joinCommunity"),title:a("actions.joinCommunity"),children:s.jsx(EM,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),r&&s.jsxs("button",{onClick:n,className:"relative flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("common:versionUpdate.ariaLabels.updateAvailable"),title:a("common:versionUpdate.ariaLabels.updateAvailable"),children:[s.jsx(ta,{className:"h-4 w-4 text-blue-500"}),s.jsx("span",{className:"absolute right-1.5 top-1.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]})]})}function d5(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=d5(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function p5(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=d5(e))&&(n&&(n+=" "),n+=t);return n}const my=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hy=p5,Zg=(e,t)=>r=>{var n;if(t?.variants==null)return hy(e,r?.class,r?.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(u=>{const d=r?.[u],p=i?.[u];if(d===null)return null;const h=my(d)||my(p);return a[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[p,h]=d;return h===void 0||(u[p]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:p,className:h,...m}=d;return Object.entries(m).every(g=>{let[b,x]=g;return Array.isArray(x)?x.includes({...i,...l}[b]):{...i,...l}[b]===x})?[...u,p,h]:u},[]);return hy(e,o,c,r?.class,r?.className)},Xg="-",CM=e=>{const t=AM(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Xg);return l[0]===""&&l.length!==1&&l.shift(),m5(l,t)||TM(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},m5=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?m5(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Xg);return t.validators.find(({validator:o})=>o(i))?.classGroupId},fy=/^\[(.+)\]$/,TM=e=>{if(fy.test(e)){const t=fy.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},AM=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const a in r)P0(r[a],n,a,t);return n},P0=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:gy(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(IM(a)){P0(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{P0(o,gy(t,i),r,n)})})},gy=(e,t)=>{let r=e;return t.split(Xg).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},IM=e=>e.isThemeGetter,jM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},F0="!",z0=":",RM=z0.length,_M=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const i=[];let o=0,l=0,c=0,u;for(let g=0;g<a.length;g++){let b=a[g];if(o===0&&l===0){if(b===z0){i.push(a.slice(c,g)),c=g+RM;continue}if(b==="/"){u=g;continue}}b==="["?o++:b==="]"?o--:b==="("?l++:b===")"&&l--}const d=i.length===0?a:a.substring(c),p=DM(d),h=p!==d,m=u&&u>c?u-c:void 0;return{modifiers:i,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}};if(t){const a=t+z0,i=n;n=o=>o.startsWith(a)?i(o.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},DM=e=>e.endsWith(F0)?e.substring(0,e.length-1):e.startsWith(F0)?e.substring(1):e,MM=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let i=[];return n.forEach(o=>{o[0]==="["||t[o]?(a.push(...i.sort(),o),i=[]):i.push(o)}),a.push(...i.sort()),a}},OM=e=>({cache:jM(e.cacheSize),parseClassName:_M(e),sortModifiers:MM(e),...CM(e)}),LM=/\s+/,PM=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=t,o=[],l=e.trim().split(LM);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:p,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:b}=r(d);if(p){c=d+(c.length>0?" "+c:c);continue}let x=!!b,y=n(x?g.substring(0,b):g);if(!y){if(!x){c=d+(c.length>0?" "+c:c);continue}if(y=n(g),!y){c=d+(c.length>0?" "+c:c);continue}x=!1}const v=i(h).join(":"),w=m?v+F0:v,S=w+y;if(o.includes(S))continue;o.push(S);const T=a(y,x);for(let k=0;k<T.length;++k){const C=T[k];o.push(w+C)}c=d+(c.length>0?" "+c:c)}return c};function FM(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=h5(t))&&(n&&(n+=" "),n+=r);return n}const h5=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=h5(e[n]))&&(r&&(r+=" "),r+=t);return r};function zM(e,...t){let r,n,a,i=o;function o(c){const u=t.reduce((d,p)=>p(d),e());return r=OM(u),n=r.cache.get,a=r.cache.set,i=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=PM(c,r);return a(c,d),d}return function(){return i(FM.apply(null,arguments))}}const qt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},f5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,g5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,BM=/^\d+\/\d+$/,$M=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,UM=/\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$/,GM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,HM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ha=e=>BM.test(e),ot=e=>!!e&&!Number.isNaN(Number(e)),zn=e=>!!e&&Number.isInteger(Number(e)),Nc=e=>e.endsWith("%")&&ot(e.slice(0,-1)),yn=e=>$M.test(e),VM=()=>!0,WM=e=>UM.test(e)&&!GM.test(e),b5=()=>!1,KM=e=>qM.test(e),YM=e=>HM.test(e),ZM=e=>!Ue(e)&&!Ge(e),XM=e=>Ii(e,v5,b5),Ue=e=>f5.test(e),ha=e=>Ii(e,k5,WM),Cc=e=>Ii(e,rO,ot),by=e=>Ii(e,x5,b5),JM=e=>Ii(e,y5,YM),Ws=e=>Ii(e,w5,KM),Ge=e=>g5.test(e),Gi=e=>ji(e,k5),QM=e=>ji(e,nO),xy=e=>ji(e,x5),eO=e=>ji(e,v5),tO=e=>ji(e,y5),Ks=e=>ji(e,w5,!0),Ii=(e,t,r)=>{const n=f5.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},ji=(e,t,r=!1)=>{const n=g5.exec(e);return n?n[1]?t(n[1]):r:!1},x5=e=>e==="position"||e==="percentage",y5=e=>e==="image"||e==="url",v5=e=>e==="length"||e==="size"||e==="bg-size",k5=e=>e==="length",rO=e=>e==="number",nO=e=>e==="family-name",w5=e=>e==="shadow",aO=()=>{const e=qt("color"),t=qt("font"),r=qt("text"),n=qt("font-weight"),a=qt("tracking"),i=qt("leading"),o=qt("breakpoint"),l=qt("container"),c=qt("spacing"),u=qt("radius"),d=qt("shadow"),p=qt("inset-shadow"),h=qt("text-shadow"),m=qt("drop-shadow"),g=qt("blur"),b=qt("perspective"),x=qt("aspect"),y=qt("ease"),v=qt("animate"),w=()=>["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"],T=()=>[...S(),Ge,Ue],k=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],A=()=>[Ge,Ue,c],N=()=>[Ha,"full","auto",...A()],I=()=>[zn,"none","subgrid",Ge,Ue],D=()=>["auto",{span:["full",zn,Ge,Ue]},zn,Ge,Ue],j=()=>[zn,"auto",Ge,Ue],F=()=>["auto","min","max","fr",Ge,Ue],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...A()],V=()=>[Ha,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],K=()=>[e,Ge,Ue],q=()=>[...S(),xy,by,{position:[Ge,Ue]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",eO,XM,{size:[Ge,Ue]}],M=()=>[Nc,Gi,ha],P=()=>["","none","full",u,Ge,Ue],Y=()=>["",ot,Gi,ha],Z=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[ot,Nc,xy,by],pe=()=>["","none",g,Ge,Ue],de=()=>["none",ot,Ge,Ue],be=()=>["none",ot,Ge,Ue],ke=()=>[ot,Ge,Ue],we=()=>[Ha,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yn],breakpoint:[yn],color:[VM],container:[yn],"drop-shadow":[yn],ease:["in","out","in-out"],font:[ZM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yn],shadow:[yn],spacing:["px",ot],text:[yn],"text-shadow":[yn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ha,Ue,Ge,x]}],container:["container"],columns:[{columns:[ot,Ue,Ge,l]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:T()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{start:N()}],end:[{end:N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[zn,"auto",Ge,Ue]}],basis:[{basis:[Ha,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ot,Ha,"auto","initial","none",Ue]}],grow:[{grow:["",ot,Ge,Ue]}],shrink:[{shrink:["",ot,Ge,Ue]}],order:[{order:[zn,"first","last","none",Ge,Ue]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[l,"screen",...V()]}],"min-w":[{"min-w":[l,"screen","none",...V()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",r,Gi,ha]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Ge,Cc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nc,Ue]}],"font-family":[{font:[QM,Ue,t]}],"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:[a,Ge,Ue]}],"line-clamp":[{"line-clamp":[ot,"none",Ge,Cc]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",Ge,Ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,Ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[ot,"from-font","auto",Ge,ha]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[ot,"auto",Ge,Ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,Ue]}],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",Ge,Ue]}],"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:O()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},zn,Ge,Ue],radial:["",Ge,Ue],conic:[zn,Ge,Ue]},tO,JM]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:M()}],"gradient-via-pos":[{via:M()}],"gradient-to-pos":[{to:M()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ot,Ge,Ue]}],"outline-w":[{outline:["",ot,Gi,ha]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",d,Ks,Ws]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",p,Ks,Ws]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[ot,ha]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",h,Ks,Ws]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[ot,Ge,Ue]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"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":[ot]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[Ge,Ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"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":[ot]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,Ue]}],filter:[{filter:["","none",Ge,Ue]}],blur:[{blur:pe()}],brightness:[{brightness:[ot,Ge,Ue]}],contrast:[{contrast:[ot,Ge,Ue]}],"drop-shadow":[{"drop-shadow":["","none",m,Ks,Ws]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",ot,Ge,Ue]}],"hue-rotate":[{"hue-rotate":[ot,Ge,Ue]}],invert:[{invert:["",ot,Ge,Ue]}],saturate:[{saturate:[ot,Ge,Ue]}],sepia:[{sepia:["",ot,Ge,Ue]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,Ue]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[ot,Ge,Ue]}],"backdrop-contrast":[{"backdrop-contrast":[ot,Ge,Ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ot,Ge,Ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ot,Ge,Ue]}],"backdrop-invert":[{"backdrop-invert":["",ot,Ge,Ue]}],"backdrop-opacity":[{"backdrop-opacity":[ot,Ge,Ue]}],"backdrop-saturate":[{"backdrop-saturate":[ot,Ge,Ue]}],"backdrop-sepia":[{"backdrop-sepia":["",ot,Ge,Ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,Ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ot,"initial",Ge,Ue]}],ease:[{ease:["linear","initial",y,Ge,Ue]}],delay:[{delay:[ot,Ge,Ue]}],animate:[{animate:["none",v,Ge,Ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ge,Ue]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:ke()}],"skew-x":[{"skew-x":ke()}],"skew-y":[{"skew-y":ke()}],transform:[{transform:[Ge,Ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:we()}],"translate-x":[{"translate-x":we()}],"translate-y":[{"translate-y":we()}],"translate-z":[{"translate-z":we()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"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",Ge,Ue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Ge,Ue]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[ot,Gi,ha,Cc]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},iO=zM(aO);function ve(...e){return iO(p5(e))}function sO(e){if(!e||typeof e!="string")return null;try{return JSON.parse(e)}catch{return null}}const oO=Zg("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}}),S5=f.forwardRef(({className:e,variant:t,...r},n)=>s.jsx("div",{ref:n,role:"alert","data-slot":"alert",className:ve(oO({variant:t}),e),...r}));S5.displayName="Alert";const lO=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-slot":"alert-title",className:ve("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t}));lO.displayName="AlertTitle";const cO=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-slot":"alert-description",className:ve("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t}));cO.displayName="AlertDescription";const uO=Zg("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Xn({className:e,variant:t,...r}){return s.jsx("div",{className:ve(uO({variant:t}),e),...r})}const dO=Zg("inline-flex touch-manipulation items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 active:bg-primary/80",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 active:bg-destructive/80",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground active:bg-accent/80",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 active:bg-secondary/70",ghost:"hover:bg-accent hover:text-accent-foreground active:bg-accent/80",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3 text-sm",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Be=f.forwardRef(({className:e,variant:t,size:r,...n},a)=>s.jsx("button",{className:ve(dO({variant:t,size:r,className:e})),ref:a,...n}));Be.displayName="Button";const E5=f.createContext(null),N5=()=>{const e=f.useContext(E5);if(!e)throw new Error("Confirmation components must be used within Confirmation");return e},C5=({className:e,approval:t="pending",children:r,...n})=>{const a=f.useMemo(()=>({approval:t}),[t]);return s.jsx(E5.Provider,{value:a,children:s.jsx(S5,{className:ve("flex flex-col gap-2",e),...n,children:r})})};C5.displayName="Confirmation";const T5=({className:e,...t})=>s.jsx("div",{"data-slot":"confirmation-title",className:ve("text-muted-foreground inline text-sm",e),...t});T5.displayName="ConfirmationTitle";const A5=({children:e})=>{const{approval:t}=N5();return t!=="pending"?null:s.jsx(s.Fragment,{children:e})};A5.displayName="ConfirmationRequest";const I5=({className:e,...t})=>{const{approval:r}=N5();return r!=="pending"?null:s.jsx("div",{"data-slot":"confirmation-actions",className:ve("flex items-center justify-end gap-2 self-end",e),...t})};I5.displayName="ConfirmationActions";const Mo=({variant:e="default",...t})=>s.jsx(Be,{className:"h-8 px-3 text-sm",variant:e,type:"button",...t});Mo.displayName="ConfirmationAction";const Jg=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ve("rounded-xl border bg-card text-card-foreground shadow-sm",e),...t}));Jg.displayName="Card";const j5=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ve("flex flex-col space-y-1.5 p-4",e),...t}));j5.displayName="CardHeader";const R5=f.forwardRef(({className:e,...t},r)=>s.jsx("h3",{ref:r,className:ve("font-semibold leading-none tracking-tight",e),...t}));R5.displayName="CardTitle";const pO=f.forwardRef(({className:e,...t},r)=>s.jsx("p",{ref:r,className:ve("text-sm text-muted-foreground",e),...t}));pO.displayName="CardDescription";const _5=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ve("p-4 pt-0",e),...t}));_5.displayName="CardContent";const D5=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ve("flex items-center p-4 pt-0",e),...t}));D5.displayName="CardFooter";const mO=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ve("ml-auto shrink-0",e),...t}));mO.displayName="CardAction";const M5=f.createContext(null);function O5(){const e=f.useContext(M5);if(!e)throw new Error("Collapsible components must be used within <Collapsible>");return e}const Na=f.forwardRef(({defaultOpen:e=!1,open:t,onOpenChange:r,className:n,children:a,...i},o)=>{const[l,c]=f.useState(e),u=t!==void 0,d=u?t:l,p=f.useCallback(m=>{u||c(m),r?.(m)},[u,r]),h=f.useMemo(()=>({open:d,onOpenChange:p}),[d,p]);return s.jsx(M5.Provider,{value:h,children:s.jsx("div",{ref:o,"data-state":d?"open":"closed",className:n,...i,children:a})})});Na.displayName="Collapsible";const ra=f.forwardRef(({onClick:e,children:t,className:r,...n},a)=>{const{open:i,onOpenChange:o}=O5(),l=f.useCallback(c=>{o(!i),e?.(c)},[i,o,e]);return s.jsx("button",{ref:a,type:"button","aria-expanded":i,"data-state":i?"open":"closed",onClick:l,className:r,...n,children:t})});ra.displayName="CollapsibleTrigger";const Ca=f.forwardRef(({className:e,children:t,...r},n)=>{const{open:a}=O5();return s.jsx("div",{ref:n,"data-state":a?"open":"closed",className:ve("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),...r,children:s.jsx("div",{className:"overflow-hidden",children:t})})});Ca.displayName="CollapsibleContent";var yy=1,hO=.9,fO=.8,gO=.17,Tc=.1,Ac=.999,bO=.9999,xO=.99,yO=/[\\\/_+.#"@\[\(\{&]/,vO=/[\\\/_+.#"@\[\(\{&]/g,kO=/[\s-]/,L5=/[\s-]/g;function B0(e,t,r,n,a,i,o){if(i===t.length)return a===e.length?yy:xO;var l=`${a},${i}`;if(o[l]!==void 0)return o[l];for(var c=n.charAt(i),u=r.indexOf(c,a),d=0,p,h,m,g;u>=0;)p=B0(e,t,r,n,u+1,i+1,o),p>d&&(u===a?p*=yy:yO.test(e.charAt(u-1))?(p*=fO,m=e.slice(a,u-1).match(vO),m&&a>0&&(p*=Math.pow(Ac,m.length))):kO.test(e.charAt(u-1))?(p*=hO,g=e.slice(a,u-1).match(L5),g&&a>0&&(p*=Math.pow(Ac,g.length))):(p*=gO,a>0&&(p*=Math.pow(Ac,u-a))),e.charAt(u)!==t.charAt(i)&&(p*=bO)),(p<Tc&&r.charAt(u-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(u-1)!==n.charAt(i))&&(h=B0(e,t,r,n,u+1,i+2,o),h*Tc>p&&(p=h*Tc)),p>d&&(d=p),u=r.indexOf(c,u+1);return o[l]=d,d}function vy(e){return e.toLowerCase().replace(L5," ")}function wO(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,B0(e,t,vy(e),vy(t),0,0,{})}function Jn(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),r===!1||!a.defaultPrevented)return t?.(a)}}function ky(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function na(...e){return t=>{let r=!1;const n=e.map(a=>{const i=ky(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():ky(e[a],null)}}}}function Ma(...e){return f.useCallback(na(...e),e)}function SO(e,t){const r=f.createContext(t),n=i=>{const{children:o,...l}=i,c=f.useMemo(()=>l,Object.values(l));return s.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function a(i){const o=f.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function EO(e,t=[]){let r=[];function n(i,o){const l=f.createContext(o),c=r.length;r=[...r,o];const u=p=>{const{scope:h,children:m,...g}=p,b=h?.[e]?.[c]||l,x=f.useMemo(()=>g,Object.values(g));return s.jsx(b.Provider,{value:x,children:m})};u.displayName=i+"Provider";function d(p,h){const m=h?.[e]?.[c]||l,g=f.useContext(m);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[u,d]}const a=()=>{const i=r.map(o=>f.createContext(o));return function(l){const c=l?.[e]||i;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,NO(a,...t)]}function NO(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const p=c(i)[`__scope${u}`];return{...l,...p}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var vs=globalThis?.document?f.useLayoutEffect:()=>{},CO=Dg[" useId ".trim().toString()]||(()=>{}),TO=0;function An(e){const[t,r]=f.useState(CO());return vs(()=>{r(n=>n??String(TO++))},[e]),t?`radix-${t}`:""}var AO=Dg[" useInsertionEffect ".trim().toString()]||vs;function IO({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,i,o]=jO({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:a;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const p=d.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,n])}const u=f.useCallback(d=>{if(l){const p=RO(d)?d(e):d;p!==e&&o.current?.(p)}else i(d)},[l,e,i,o]);return[c,u]}function jO({defaultProp:e,onChange:t}){const[r,n]=f.useState(e),a=f.useRef(r),i=f.useRef(t);return AO(()=>{i.current=t},[t]),f.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}function RO(e){return typeof e=="function"}function Ms(e){const t=_O(e),r=f.forwardRef((n,a)=>{const{children:i,...o}=n,l=f.Children.toArray(i),c=l.find(MO);if(c){const u=c.props.children,d=l.map(p=>p===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:p);return s.jsx(t,{...o,ref:a,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function _O(e){const t=f.forwardRef((r,n)=>{const{children:a,...i}=r;if(f.isValidElement(a)){const o=LO(a),l=OO(i,a.props);return a.type!==f.Fragment&&(l.ref=n?na(n,o):o),f.cloneElement(a,l)}return f.Children.count(a)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DO=Symbol("radix.slottable");function MO(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DO}function OO(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function LO(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var PO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],P5=PO.reduce((e,t)=>{const r=Ms(`Primitive.${t}`),n=f.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function FO(e,t){e&&Il.flushSync(()=>e.dispatchEvent(t))}function ks(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>t.current?.(...r),[])}function zO(e,t=globalThis?.document){const r=ks(e);f.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var BO="DismissableLayer",$0="dismissableLayer.update",$O="dismissableLayer.pointerDownOutside",UO="dismissableLayer.focusOutside",wy,F5=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),z5=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=f.useContext(F5),[d,p]=f.useState(null),h=d?.ownerDocument??globalThis?.document,[,m]=f.useState({}),g=Ma(t,C=>p(C)),b=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(x),v=d?b.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=v>=y,T=HO(C=>{const A=C.target,N=[...u.branches].some(I=>I.contains(A));!S||N||(a?.(C),o?.(C),C.defaultPrevented||l?.())},h),k=VO(C=>{const A=C.target;[...u.branches].some(I=>I.contains(A))||(i?.(C),o?.(C),C.defaultPrevented||l?.())},h);return zO(C=>{v===u.layers.size-1&&(n?.(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},h),f.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wy=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Sy(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=wy)}},[d,h,r,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Sy())},[d,u]),f.useEffect(()=>{const C=()=>m({});return document.addEventListener($0,C),()=>document.removeEventListener($0,C)},[]),s.jsx(P5.div,{...c,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Jn(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Jn(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Jn(e.onPointerDownCapture,T.onPointerDownCapture)})});z5.displayName=BO;var GO="DismissableLayerBranch",qO=f.forwardRef((e,t)=>{const r=f.useContext(F5),n=f.useRef(null),a=Ma(t,n);return f.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),s.jsx(P5.div,{...e,ref:a})});qO.displayName=GO;function HO(e,t=globalThis?.document){const r=ks(e),n=f.useRef(!1),a=f.useRef(()=>{});return f.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){B5($O,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function VO(e,t=globalThis?.document){const r=ks(e),n=f.useRef(!1);return f.useEffect(()=>{const a=i=>{i.target&&!n.current&&B5(UO,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Sy(){const e=new CustomEvent($0);document.dispatchEvent(e)}function B5(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?FO(a,i):a.dispatchEvent(i)}var WO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],KO=WO.reduce((e,t)=>{const r=Ms(`Primitive.${t}`),n=f.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ic="focusScope.autoFocusOnMount",jc="focusScope.autoFocusOnUnmount",Ey={bubbles:!1,cancelable:!0},YO="FocusScope",$5=f.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=f.useState(null),u=ks(a),d=ks(i),p=f.useRef(null),h=Ma(t,b=>c(b)),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(n){let b=function(w){if(m.paused||!l)return;const S=w.target;l.contains(S)?p.current=S:Hn(p.current,{select:!0})},x=function(w){if(m.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||Hn(p.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&Hn(l)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const v=new MutationObserver(y);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),v.disconnect()}}},[n,l,m.paused]),f.useEffect(()=>{if(l){Cy.add(m);const b=document.activeElement;if(!l.contains(b)){const y=new CustomEvent(Ic,Ey);l.addEventListener(Ic,u),l.dispatchEvent(y),y.defaultPrevented||(ZO(t9(U5(l)),{select:!0}),document.activeElement===b&&Hn(l))}return()=>{l.removeEventListener(Ic,u),setTimeout(()=>{const y=new CustomEvent(jc,Ey);l.addEventListener(jc,d),l.dispatchEvent(y),y.defaultPrevented||Hn(b??document.body,{select:!0}),l.removeEventListener(jc,d),Cy.remove(m)},0)}}},[l,u,d,m]);const g=f.useCallback(b=>{if(!r&&!n||m.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,y=document.activeElement;if(x&&y){const v=b.currentTarget,[w,S]=XO(v);w&&S?!b.shiftKey&&y===S?(b.preventDefault(),r&&Hn(w,{select:!0})):b.shiftKey&&y===w&&(b.preventDefault(),r&&Hn(S,{select:!0})):y===v&&b.preventDefault()}},[r,n,m.paused]);return s.jsx(KO.div,{tabIndex:-1,...o,ref:h,onKeyDown:g})});$5.displayName=YO;function ZO(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Hn(n,{select:t}),document.activeElement!==r)return}function XO(e){const t=U5(e),r=Ny(t,e),n=Ny(t.reverse(),e);return[r,n]}function U5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ny(e,t){for(const r of e)if(!JO(r,{upTo:t}))return r}function JO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function QO(e){return e instanceof HTMLInputElement&&"select"in e}function Hn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&QO(e)&&t&&e.select()}}var Cy=e9();function e9(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Ty(e,t),e.unshift(t)},remove(t){e=Ty(e,t),e[0]?.resume()}}}function Ty(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function t9(e){return e.filter(t=>t.tagName!=="A")}var r9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],n9=r9.reduce((e,t)=>{const r=Ms(`Primitive.${t}`),n=f.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),a9="Portal",G5=f.forwardRef((e,t)=>{const{container:r,...n}=e,[a,i]=f.useState(!1);vs(()=>i(!0),[]);const o=r||a&&globalThis?.document?.body;return o?Qi.createPortal(s.jsx(n9.div,{...n,ref:t}),o):null});G5.displayName=a9;function i9(e,t){return f.useReducer((r,n)=>t[r][n]??r,e)}var zl=e=>{const{present:t,children:r}=e,n=s9(t),a=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),i=Ma(n.ref,o9(a));return typeof r=="function"||n.isPresent?f.cloneElement(a,{ref:i}):null};zl.displayName="Presence";function s9(e){const[t,r]=f.useState(),n=f.useRef(null),a=f.useRef(e),i=f.useRef("none"),o=e?"mounted":"unmounted",[l,c]=i9(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=Ys(n.current);i.current=l==="mounted"?u:"none"},[l]),vs(()=>{const u=n.current,d=a.current;if(d!==e){const h=i.current,m=Ys(u);e?c("MOUNT"):m==="none"||u?.display==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),vs(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,p=m=>{const b=Ys(n.current).includes(CSS.escape(m.animationName));if(m.target===t&&b&&(c("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=m=>{m.target===t&&(i.current=Ys(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Ys(e){return e?.animationName||"none"}function o9(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var l9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Os=l9.reduce((e,t)=>{const r=Ms(`Primitive.${t}`),n=f.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Rc=0;function c9(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ay()),document.body.insertAdjacentElement("beforeend",e[1]??Ay()),Rc++,()=>{Rc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rc--}},[])}function Ay(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ln=function(){return ln=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},ln.apply(this,arguments)};function q5(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function Oa(e,t,r,n){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(d){try{u(n.next(d))}catch(p){o(p)}}function c(d){try{u(n.throw(d))}catch(p){o(p)}}function u(d){d.done?i(d.value):a(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}function u9(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var Oo="right-scroll-bar-position",Lo="width-before-scroll-bar",d9="with-scroll-bars-hidden",p9="--removed-body-scroll-bar-size";function _c(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function m9(e,t){var r=f.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=t,r.facade}var h9=typeof window<"u"?f.useLayoutEffect:f.useEffect,Iy=new WeakMap;function f9(e,t){var r=m9(null,function(n){return e.forEach(function(a){return _c(a,n)})});return h9(function(){var n=Iy.get(r);if(n){var a=new Set(n),i=new Set(e),o=r.current;a.forEach(function(l){i.has(l)||_c(l,null)}),i.forEach(function(l){a.has(l)||_c(l,o)})}Iy.set(r,e)},[e]),r}function g9(e){return e}function b9(e,t){t===void 0&&(t=g9);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var o=t(i,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(i),o=r}var c=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),r}}}};return a}function x9(e){e===void 0&&(e={});var t=b9(null);return t.options=ln({async:!0,ssr:!1},e),t}var H5=function(e){var t=e.sideCar,r=q5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return f.createElement(n,ln({},r))};H5.isSideCarExport=!0;function y9(e,t){return e.useMedium(t),H5}var V5=x9(),Dc=function(){},Bl=f.forwardRef(function(e,t){var r=f.useRef(null),n=f.useState({onScrollCapture:Dc,onWheelCapture:Dc,onTouchMoveCapture:Dc}),a=n[0],i=n[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,m=e.noRelative,g=e.noIsolation,b=e.inert,x=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,w=e.gapMode,S=q5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,k=f9([r,t]),C=ln(ln({},S),a);return f.createElement(f.Fragment,null,d&&f.createElement(T,{sideCar:V5,removeScrollBar:u,shards:p,noRelative:m,noIsolation:g,inert:b,setCallbacks:i,allowPinchZoom:!!x,lockRef:r,gapMode:w}),o?f.cloneElement(f.Children.only(l),ln(ln({},C),{ref:k})):f.createElement(v,ln({},C,{className:c,ref:k}),l))});Bl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bl.classNames={fullWidth:Lo,zeroRight:Oo};var v9=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function k9(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=v9();return t&&e.setAttribute("nonce",t),e}function w9(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function S9(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var E9=function(){var e=0,t=null;return{add:function(r){e==0&&(t=k9())&&(w9(t,r),S9(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},N9=function(){var e=E9();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},W5=function(){var e=N9(),t=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return t},C9={left:0,top:0,right:0,gap:0},Mc=function(e){return parseInt(e||"",10)||0},T9=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Mc(r),Mc(n),Mc(a)]},A9=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return C9;var t=T9(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},I9=W5(),hi="data-scroll-locked",j9=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),`
719
+ `;function xD(){if(typeof document>"u"||document.getElementById(ny))return;const e=document.createElement("style");e.id=ny,e.type="text/css",e.innerText=bD,document.head.appendChild(e)}function yD({terminalContainerRef:e,terminalRef:t,fitAddonRef:r,wsRef:n,selectedProject:a,minimal:i,isRestarting:o,initialCommandRef:l,isPlainShellRef:c,authUrlRef:u,copyAuthUrlToClipboard:d,closeSocket:p}){const[h,m]=f.useState(!1),g=f.useRef(null),b=a?.fullPath||a?.path||"",x=!!a;f.useEffect(()=>{xD()},[]);const y=f.useCallback(()=>{t.current&&(t.current.clear(),t.current.write("\x1B[2J\x1B[H"))},[t]),v=f.useCallback(()=>{t.current&&(t.current.dispose(),t.current=null),r.current=null,m(!1)},[r,t]);return f.useEffect(()=>{if(!e.current||!x||o||t.current)return;const w=new hD.Terminal(nD);t.current=w;const S=new uD.FitAddon;r.current=S,w.loadAddon(S),i||w.loadAddon(new pD.WebLinksAddon);try{w.loadAddon(new mD.WebglAddon)}catch{console.warn("[Shell] WebGL renderer unavailable, using Canvas fallback")}w.open(e.current);const T=async()=>{const N=w.getSelection();return N?hn(N):!1},k=N=>{if(!w.hasSelection())return;const I=w.getSelection();if(I){if(N.preventDefault(),N.clipboardData){N.clipboardData.setData("text/plain",I);return}hn(I)}};e.current.addEventListener("copy",k),w.attachCustomKeyEventHandler(N=>{const I=YC(l.current)?WC:u.current;return N.type==="keydown"&&i&&c.current&&I&&!N.ctrlKey&&!N.metaKey&&!N.altKey&&N.key?.toLowerCase()==="c"?(N.preventDefault(),N.stopPropagation(),d(I),!1):N.type==="keydown"&&(N.ctrlKey||N.metaKey)&&N.key?.toLowerCase()==="c"&&w.hasSelection()?(N.preventDefault(),N.stopPropagation(),T(),!1):N.type==="keydown"&&(N.ctrlKey||N.metaKey)&&N.key?.toLowerCase()==="v"?(N.preventDefault(),N.stopPropagation(),typeof navigator<"u"&&navigator.clipboard?.readText&&navigator.clipboard.readText().then(D=>{wa(n.current,{type:"input",data:D})}).catch(()=>{}),!1):!0}),window.setTimeout(()=>{const N=r.current,I=t.current;!N||!I||(N.fit(),wa(n.current,{type:"resize",cols:I.cols,rows:I.rows}))},KC),m(!0);const C=w.onData(N=>{wa(n.current,{type:"input",data:N})}),A=new ResizeObserver(()=>{g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{const N=r.current,I=t.current;!N||!I||(N.fit(),wa(n.current,{type:"resize",cols:I.cols,rows:I.rows}))},X8)});return A.observe(e.current),()=>{e.current?.removeEventListener("copy",k),A.disconnect(),g.current!==null&&(window.clearTimeout(g.current),g.current=null),C.dispose(),p(),v()}},[u,p,d,v,r,l,c,o,i,x,b,e,t,n]),{isInitialized:h,clearTerminalScreen:y,disposeTerminal:v}}function vD({selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:n,minimal:a,autoConnect:i,isRestarting:o,onProcessComplete:l,onOutputRef:c}){const u=f.useRef(null),d=f.useRef(null),p=f.useRef(null),h=f.useRef(null),[m,g]=f.useState(""),[b,x]=f.useState(0),y=f.useRef(e),v=f.useRef(t),w=f.useRef(r),S=f.useRef(n),T=f.useRef(l),k=f.useRef(""),C=f.useRef(t?.id??null);f.useEffect(()=>{y.current=e,v.current=t,w.current=r,S.current=n,T.current=l},[e,t,r,n,l]);const A=f.useCallback(q=>{k.current=q,g(q),x(O=>O+1)},[]),N=f.useCallback(()=>{const q=h.current;q&&((q.readyState===WebSocket.OPEN||q.readyState===WebSocket.CONNECTING)&&q.close(),h.current=null)},[]),I=f.useCallback((q=k.current)=>{if(!q)return!1;const O=window.open(q,"_blank");if(O){try{O.opener=null}catch{}return!0}return!1},[]),D=f.useCallback(async(q=k.current)=>q?hn(q):!1,[]),{isInitialized:j,clearTerminalScreen:F,disposeTerminal:E}=yD({terminalContainerRef:u,terminalRef:d,fitAddonRef:p,wsRef:h,selectedProject:e,minimal:a,isRestarting:o,initialCommandRef:w,isPlainShellRef:S,authUrlRef:k,copyAuthUrlToClipboard:D,closeSocket:N}),{isConnected:$,isConnecting:G,connectToShell:V,disconnectFromShell:K}=cD({wsRef:h,terminalRef:d,fitAddonRef:p,selectedProjectRef:y,selectedSessionRef:v,initialCommandRef:w,isPlainShellRef:S,onProcessCompleteRef:T,isInitialized:j,autoConnect:i,closeSocket:N,clearTerminalScreen:F,setAuthUrl:A,onOutputRef:c});return f.useEffect(()=>{o&&(K(),E())},[K,E,o]),f.useEffect(()=>{e||(K(),E())},[K,E,e]),f.useEffect(()=>{const q=t?.id??null;C.current!==q&&j&&K(),C.current=q},[K,j,t?.id]),{terminalContainerRef:u,terminalRef:d,wsRef:h,isConnected:$,isInitialized:j,isConnecting:G,authUrl:m,authUrlVersion:b,connectToShell:V,disconnectFromShell:K,openAuthUrlInBrowser:I,copyAuthUrlToClipboard:D}}function kD({mode:e,description:t,loadingLabel:r,connectLabel:n,connectTitle:a,connectingLabel:i,onConnect:o}){return e==="loading"?s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90",children:s.jsx("div",{className:"text-white",children:r})}):e==="connect"?s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90 p-4",children:s.jsxs("div",{className:"w-full max-w-sm text-center",children:[s.jsxs("button",{onClick:o,className:"flex w-full items-center justify-center space-x-2 rounded-lg bg-green-600 px-6 py-3 text-base font-medium text-white transition-colors hover:bg-green-700 sm:w-auto",title:a,children:[s.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),s.jsx("span",{children:n})]}),s.jsx("p",{className:"mt-3 px-2 text-sm text-gray-400",children:t})]})}):s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90 p-4",children:s.jsxs("div",{className:"w-full max-w-sm text-center",children:[s.jsxs("div",{className:"flex items-center justify-center space-x-3 text-yellow-400",children:[s.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-yellow-400 border-t-transparent"}),s.jsx("span",{className:"text-base font-medium",children:i})]}),s.jsx("p",{className:"mt-3 px-2 text-sm text-gray-400",children:t})]})})}function wD({title:e,description:t}){return s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[s.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800",children:s.jsx("svg",{className:"h-8 w-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2z"})})}),s.jsx("h3",{className:"mb-2 text-lg font-semibold",children:e}),s.jsx("p",{children:t})]})})}function SD({isConnected:e,isInitialized:t,isRestarting:r,hasSession:n,sessionDisplayNameShort:a,onDisconnect:i,onRestart:o,statusNewSessionText:l,statusInitializingText:c,statusRestartingText:u,disconnectLabel:d,disconnectTitle:p,restartLabel:h,restartTitle:m,disableRestart:g}){return s.jsx("div",{className:"flex-shrink-0 border-b border-gray-700 bg-gray-800 px-4 py-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:`h-2 w-2 rounded-full ${e?"bg-green-500":"bg-red-500"}`}),n&&a&&s.jsxs("span",{className:"text-xs text-blue-300",children:["(",a,"...)"]}),!n&&s.jsx("span",{className:"text-xs text-gray-400",children:l}),!t&&s.jsx("span",{className:"text-xs text-yellow-400",children:c}),r&&s.jsx("span",{className:"text-xs text-blue-400",children:u})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[e&&s.jsxs("button",{onClick:i,className:"flex items-center space-x-1 rounded bg-red-600 px-3 py-1 text-xs text-white hover:bg-red-700",title:p,children:[s.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),s.jsx("span",{children:d})]}),s.jsxs("button",{onClick:o,disabled:g,className:"flex items-center space-x-1 text-xs text-gray-400 hover:text-white disabled:cursor-not-allowed disabled:opacity-50",title:m,children:[s.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),s.jsx("span",{children:h})]})]})]})})}function ED({terminalContainerRef:e,authUrl:t,authUrlVersion:r,initialCommand:n,isConnected:a,openAuthUrlInBrowser:i,copyAuthUrlToClipboard:o}){const[l,c]=f.useState("idle"),[u,d]=f.useState(!1),p=f.useMemo(()=>fD(n,t),[t,n]);f.useEffect(()=>{c("idle"),d(!1)},[r,p,a]);const h=!!p,m=h&&!u,g=h&&u;return s.jsxs("div",{className:"relative h-full w-full bg-gray-900",children:[s.jsx("div",{ref:e,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),m&&s.jsx("div",{className:"absolute inset-x-0 bottom-14 z-20 border-t border-gray-700/80 bg-gray-900/95 p-3 backdrop-blur-sm md:hidden",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-xs text-gray-300",children:"Open or copy the login URL:"}),s.jsx("button",{type:"button",onClick:()=>d(!0),className:"rounded bg-gray-700 px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-gray-100 hover:bg-gray-600",children:"Hide"})]}),s.jsx("input",{type:"text",value:p,readOnly:!0,onClick:b=>b.currentTarget.select(),className:"w-full rounded border border-gray-600 bg-gray-800 px-2 py-1 text-xs text-gray-100 focus:outline-none focus:ring-1 focus:ring-blue-500","aria-label":"Authentication URL"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>{i(p)},className:"flex-1 rounded bg-blue-600 px-3 py-2 text-xs font-medium text-white hover:bg-blue-700",children:"Open URL"}),s.jsx("button",{type:"button",onClick:async()=>{const b=await o(p);c(b?"copied":"failed")},className:"flex-1 rounded bg-gray-700 px-3 py-2 text-xs font-medium text-white hover:bg-gray-600",children:l==="copied"?"Copied":"Copy URL"})]})]})}),g&&s.jsx("div",{className:"absolute bottom-14 right-3 z-20 md:hidden",children:s.jsx("button",{type:"button",onClick:()=>d(!1),className:"rounded bg-gray-800/95 px-3 py-2 text-xs font-medium text-gray-100 shadow-lg backdrop-blur-sm hover:bg-gray-700",children:"Show login URL"})})]})}const ND=[{type:"key",id:"esc",label:"Esc",sequence:"\x1B"},{type:"key",id:"tab",label:"Tab",sequence:" "},{type:"key",id:"shift-tab",label:"⇧Tab",sequence:"\x1B[Z"},{type:"modifier",id:"ctrl",label:"CTRL",modifier:"ctrl"},{type:"modifier",id:"alt",label:"ALT",modifier:"alt"},{type:"arrow",id:"arrow-up",sequence:"\x1B[A",icon:"up"},{type:"arrow",id:"arrow-down",sequence:"\x1B[B",icon:"down"},{type:"arrow",id:"arrow-left",sequence:"\x1B[D",icon:"left"},{type:"arrow",id:"arrow-right",sequence:"\x1B[C",icon:"right"}],CD={up:_C,down:_l,left:j7,right:Fg},Ui=e=>e.preventDefault(),ay="shrink-0 rounded-md border border-gray-600 bg-gray-700 px-2.5 py-1.5 text-xs font-medium text-gray-100 transition-colors select-none active:bg-blue-600 active:text-white active:border-blue-600 disabled:cursor-not-allowed disabled:opacity-40",TD="shrink-0 rounded-md border border-blue-500 bg-blue-600 px-2.5 py-1.5 text-xs font-medium text-white transition-colors select-none disabled:cursor-not-allowed disabled:opacity-40",wc="shrink-0 rounded-md border border-gray-600 bg-gray-700 p-1.5 text-gray-100 transition-colors select-none active:bg-blue-600 active:text-white active:border-blue-600 disabled:cursor-not-allowed disabled:opacity-40";function iy({wsRef:e,terminalRef:t,isConnected:r,bottomOffset:n="bottom-0"}){const{t:a}=Fe("settings"),[i,o]=f.useState(!1),[l,c]=f.useState(!1),u=f.useCallback(m=>{wa(e.current,{type:"input",data:m})},[e]),d=f.useCallback(()=>{t.current?.scrollToBottom()},[t]),p=f.useCallback(async()=>{if(!(typeof navigator>"u"||!navigator.clipboard?.readText))try{const m=await navigator.clipboard.readText();m.length>0&&u(m)}catch{}},[u]),h=f.useCallback(m=>{let g=m;if(i&&m.length===1){const b=m.toLowerCase().charCodeAt(0);b>=97&&b<=122&&(g=String.fromCharCode(b-96)),o(!1)}l&&m.length===1&&(g="\x1B"+g,c(!1)),u(g)},[i,l,u]);return s.jsx("div",{className:`pointer-events-none fixed inset-x-0 ${n} z-20 px-2 md:hidden`,children:s.jsxs("div",{className:"pointer-events-auto flex items-center gap-1 overflow-x-auto rounded-lg border border-gray-700/80 bg-gray-900/95 px-1.5 py-1.5 shadow-lg backdrop-blur-sm [-webkit-overflow-scrolling:touch] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx("button",{type:"button",onPointerDown:Ui,onClick:()=>{p()},disabled:!r,className:wc,title:a("terminalShortcuts.paste",{defaultValue:"Paste"}),"aria-label":a("terminalShortcuts.paste",{defaultValue:"Paste"}),children:s.jsx(xR,{className:"h-4 w-4"})}),ND.map(m=>{if(m.type==="modifier"){const g=m.modifier==="ctrl"?i:l,b=m.modifier==="ctrl"?()=>o(x=>!x):()=>c(x=>!x);return s.jsx("button",{type:"button",onPointerDown:Ui,onClick:b,disabled:!r,className:g?TD:ay,children:m.label},m.id)}if(m.type==="arrow"){const g=CD[m.icon];return s.jsx("button",{type:"button",onPointerDown:Ui,onClick:()=>u(m.sequence),disabled:!r,className:wc,children:s.jsx(g,{className:"h-4 w-4"})},m.id)}return s.jsx("button",{type:"button",onPointerDown:Ui,onClick:()=>h(m.sequence),disabled:!r,className:ay,children:m.label},m.id)}),s.jsx("button",{type:"button",onPointerDown:Ui,onClick:d,disabled:!r,className:wc,title:a("terminalShortcuts.scrollDown"),"aria-label":a("terminalShortcuts.scrollDown"),children:s.jsx(RC,{className:"h-4 w-4"})})]})})}function ZC({selectedProject:e=null,selectedSession:t=null,initialCommand:r=null,isPlainShell:n=!1,onProcessComplete:a=null,minimal:i=!1,autoConnect:o=!1,isActive:l=!0}){const{t:c}=Fe("chat"),[u,d]=f.useState(!1),[p,h]=f.useState(null),m=f.useRef(null),g=f.useRef(null),{terminalContainerRef:b,terminalRef:x,wsRef:y,isConnected:v,isInitialized:w,isConnecting:S,authUrl:T,authUrlVersion:k,connectToShell:C,disconnectFromShell:A,openAuthUrlInBrowser:N,copyAuthUrlToClipboard:I}=vD({selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:n,minimal:i,autoConnect:o,isRestarting:u,onProcessComplete:a,onOutputRef:g}),D=f.useCallback(()=>{const M=x.current;if(!M)return;const P=M.buffer.active,Y=P.baseY+P.cursorY,Z=Math.min(P.baseY+P.length-1,Y+10),ie=Math.max(0,Y-Q8),J=[];for(let we=ie;we<=Z;we++){const Ee=P.getLine(we);Ee&&J.push(Ee.translateToString().trimEnd())}let pe=-1;for(let we=J.length-1;we>=0;we--)if(/esc to cancel/i.test(J[we])||/enter to select/i.test(J[we])){pe=we;break}if(pe===-1){h(null);return}const de=new Map,be=Math.max(0,pe-eD);for(let we=pe-1;we>=be;we--){const Ee=J[we].match(/^\s*[❯›>]?\s*(\d+)\.\s+(.+)/);if(Ee){const L=Ee[1],ce=Ee[2].trim();parseInt(L,10)<=tD&&ce.length>0&&!de.has(L)&&de.set(L,ce)}}const ke=[];for(let we=1;we<=de.size&&de.has(String(we));we++)ke.push({number:String(we),label:de.get(String(we))});h(ke.length>=rD?ke:null)},[x]),j=f.useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(D,J8)},[D]);f.useEffect(()=>{g.current=j},[j]),f.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),f.useEffect(()=>{v||(m.current&&(clearTimeout(m.current),m.current=null),h(null))},[v]),f.useEffect(()=>{if(!l||!w||!v)return;const M=()=>{x.current?.focus()},P=window.requestAnimationFrame(M),Y=window.setTimeout(M,0);return()=>{window.cancelAnimationFrame(P),window.clearTimeout(Y)}},[l,v,w,x]);const F=f.useCallback(M=>{wa(y.current,{type:"input",data:M})},[y]),E=f.useMemo(()=>gD(t),[t]),$=f.useMemo(()=>E?E.slice(0,30):null,[E]),G=f.useMemo(()=>E?E.slice(0,50):null,[E]),V=f.useCallback(()=>{d(!0),window.setTimeout(()=>{d(!1)},Z8)},[]);if(!e)return s.jsx(wD,{title:c("shell.selectProject.title"),description:c("shell.selectProject.description")});if(i)return s.jsxs(s.Fragment,{children:[s.jsx(ED,{terminalContainerRef:b,authUrl:T,authUrlVersion:k,initialCommand:r,isConnected:v,openAuthUrlInBrowser:N,copyAuthUrlToClipboard:I}),s.jsx(iy,{wsRef:y,terminalRef:x,isConnected:v,bottomOffset:"bottom-0"})]});const K=n?c("shell.runCommand",{command:r||c("shell.defaultCommand"),projectName:e.displayName}):t?c("shell.resumeSession",{displayName:G}):c("shell.startSession"),q=n?c("shell.runCommand",{command:r||c("shell.defaultCommand"),projectName:e.displayName}):c("shell.startCli",{projectName:e.displayName}),O=w?S?"connecting":v?null:"connect":"loading",z=O==="connecting"?q:K;return s.jsxs("div",{className:"flex h-full w-full flex-col bg-gray-900",children:[s.jsx(SD,{isConnected:v,isInitialized:w,isRestarting:u,hasSession:!!t,sessionDisplayNameShort:$,onDisconnect:A,onRestart:V,statusNewSessionText:c("shell.status.newSession"),statusInitializingText:c("shell.status.initializing"),statusRestartingText:c("shell.status.restarting"),disconnectLabel:c("shell.actions.disconnect"),disconnectTitle:c("shell.actions.disconnectTitle"),restartLabel:c("shell.actions.restart"),restartTitle:c("shell.actions.restartTitle"),disableRestart:u||v}),s.jsxs("div",{className:"relative flex-1 overflow-hidden p-2",children:[s.jsx("div",{ref:b,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),O&&s.jsx(kD,{mode:O,description:z,loadingLabel:c("shell.loading"),connectLabel:c("shell.actions.connect"),connectTitle:c("shell.actions.connectTitle"),connectingLabel:c("shell.connecting"),onConnect:C}),p&&v&&s.jsx("div",{className:"absolute inset-x-0 bottom-0 z-10 border-t border-gray-700/80 bg-gray-800/95 px-3 py-2 backdrop-blur-sm",onMouseDown:M=>M.preventDefault(),children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.map(M=>s.jsxs("button",{type:"button",onClick:()=>{F(M.number),h(null)},className:"max-w-36 truncate rounded bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-700",title:`${M.number}. ${M.label}`,children:[M.number,". ",M.label]},M.number)),s.jsx("button",{type:"button",onClick:()=>{F("\x1B"),h(null)},className:"rounded bg-gray-700 px-3 py-1.5 text-xs font-medium text-gray-200 transition-colors hover:bg-gray-600",children:"Esc"})]})})]}),s.jsx(iy,{wsRef:y,terminalRef:x,isConnected:v})]})}function AD({className:e}){return s.jsx("div",{className:`flex h-full items-center justify-center ${e}`,children:s.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[s.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800",children:s.jsx("svg",{className:"h-8 w-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 002 2z"})})}),s.jsx("h3",{className:"mb-2 text-lg font-semibold",children:"No Project Selected"}),s.jsx("p",{children:"A project is required to open a shell"})]})})}function ID({title:e,isCompleted:t,onClose:r=null}){return s.jsx("div",{className:"flex-shrink-0 border-b border-gray-700 bg-gray-800 px-4 py-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-200",children:e}),t&&s.jsx("span",{className:"text-xs text-green-400",children:"(Completed)"})]}),r&&s.jsx("button",{onClick:r,className:"text-gray-400 hover:text-white",title:"Close",children:s.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})}function XC({project:e=null,session:t=null,command:r=null,isPlainShell:n=null,isActive:a=!0,autoConnect:i=!0,onComplete:o=null,onClose:l=null,title:c=null,className:u="",showHeader:d=!0,compact:p=!1,minimal:h=!1}){const[m,g]=f.useState(!1),b=n!==null?n:r!==null,x=f.useCallback(y=>{g(!0),o?.(y)},[o]);return e?s.jsxs("div",{className:`flex h-full w-full flex-col ${u}`,children:[!h&&d&&c&&s.jsx(ID,{title:c,isCompleted:m,onClose:l}),s.jsx("div",{className:"min-h-0 w-full flex-1",children:s.jsx(ZC,{selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:b,isActive:a,onProcessComplete:x,minimal:h,autoConnect:h?!0:i})})]}):s.jsx(AD,{className:u})}const jD=({provider:e,customCommand:t,isAuthenticated:r})=>t||(e==="claude"?"claude --dangerously-skip-permissions /login":e==="cursor"?"cursor-agent login":e==="codex"?"codex login":"gemini status"),RD=e=>e==="claude"?"Claude CLI Login":e==="cursor"?"Cursor CLI Login":e==="codex"?"Codex CLI Login":"Gemini CLI Configuration";function JC({isOpen:e,onClose:t,provider:r="claude",onComplete:n,customCommand:a,isAuthenticated:i=!1}){if(!e)return null;const o=jD({provider:r,customCommand:a,isAuthenticated:i}),l=RD(r),c=u=>{n?.(u)};return s.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black bg-opacity-50 max-md:items-stretch max-md:justify-stretch",children:s.jsxs("div",{className:"flex h-3/4 w-full max-w-4xl flex-col rounded-lg bg-white shadow-xl dark:bg-gray-800 max-md:m-0 max-md:h-full max-md:max-w-none max-md:rounded-none md:m-4 md:h-3/4 md:max-w-4xl md:rounded-lg",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 p-4 dark:border-gray-700",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:l}),s.jsx("button",{onClick:t,className:"text-gray-400 transition-colors hover:text-gray-600 dark:hover:text-gray-300","aria-label":"Close login modal",children:s.jsx(gt,{className:"h-6 w-6"})})]}),s.jsx("div",{className:"flex-1 overflow-hidden",children:r==="gemini"?s.jsxs("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-8 text-center dark:bg-gray-900/50",children:[s.jsx("div",{className:"mb-6 flex h-16 w-16 items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30",children:s.jsx(PC,{className:"h-8 w-8 text-blue-600 dark:text-blue-400"})}),s.jsx("h4",{className:"mb-3 text-xl font-medium text-gray-900 dark:text-white",children:"Setup Gemini API Access"}),s.jsx("p",{className:"mb-8 max-w-md text-gray-600 dark:text-gray-400",children:"The Gemini CLI requires an API key to function. Configure it in your terminal first."}),s.jsx("div",{className:"w-full max-w-lg rounded-xl border border-gray-200 bg-white p-6 text-left shadow-sm dark:border-gray-700 dark:bg-gray-800",children:s.jsxs("ol",{className:"space-y-4",children:[s.jsxs("li",{className:"flex gap-4",children:[s.jsx("div",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-blue-100 text-sm font-medium text-blue-600 dark:bg-blue-900/50 dark:text-blue-400",children:"1"}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-1 text-sm font-medium text-gray-900 dark:text-white",children:"Get your API key"}),s.jsxs("a",{href:"https://aistudio.google.com/app/apikey",target:"_blank",rel:"noreferrer",className:"flex inline-flex items-center gap-1 text-sm text-blue-600 hover:underline dark:text-blue-400",children:["Google AI Studio ",s.jsx(Yr,{className:"h-3 w-3"})]})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("div",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-blue-100 text-sm font-medium text-blue-600 dark:bg-blue-900/50 dark:text-blue-400",children:"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-1 text-sm font-medium text-gray-900 dark:text-white",children:"Run configuration"}),s.jsx("p",{className:"mb-2 text-sm text-gray-600 dark:text-gray-400",children:"Open your terminal and run:"}),s.jsx("code",{className:"block rounded bg-gray-100 px-3 py-2 font-mono text-sm text-pink-600 dark:bg-gray-900 dark:text-pink-400",children:"gemini config set api_key YOUR_KEY"})]})]})]})}),s.jsx("button",{onClick:t,className:"mt-8 rounded-lg bg-blue-600 px-6 py-2.5 font-medium text-white transition-colors hover:bg-blue-700",children:"Done"})]}):s.jsx(XC,{project:g7,command:o,onComplete:c,minimal:!0})})]})})}const _D=({className:e="w-5 h-5"})=>s.jsx("img",{src:"/icons/claude-ai-icon.svg",alt:"Claude",className:e}),DD=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Ra();return s.jsx("img",{src:t?"/icons/codex-white.svg":"/icons/codex.svg",alt:"Codex",className:e})},MD=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Ra();return s.jsx("img",{src:t?"/icons/cursor-white.svg":"/icons/cursor.svg",alt:"Cursor",className:e})},OD=({className:e="w-5 h-5"})=>s.jsx("img",{src:"/icons/gemini-ai-icon.svg",alt:"Gemini",className:e});function $r({provider:e="claude",className:t="w-5 h-5"}){return e==="cursor"?s.jsx(MD,{className:t}):e==="codex"?s.jsx(DD,{className:t}):e==="gemini"?s.jsx(OD,{className:t}):s.jsx(_D,{className:t})}function LD({provider:e,title:t,status:r,connectedClassName:n,iconContainerClassName:a,loginButtonClassName:i,onLogin:o}){const l=r.authenticated?n:"border-border bg-card",c=r.loading?"Checking...":r.authenticated?r.email||"Connected":r.error||"Not connected";return s.jsx("div",{className:`rounded-lg border p-4 transition-colors ${l}`,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-full ${a}`,children:s.jsx($r,{provider:e,className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 font-medium text-foreground",children:[t,r.authenticated&&s.jsx(rr,{className:"h-4 w-4 text-green-500"})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:c})]})]}),!r.authenticated&&!r.loading&&s.jsx("button",{onClick:o,className:`${i} rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors`,children:"Login"})]})})}const PD=[{provider:"claude",title:"Claude Code",connectedClassName:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",iconContainerClassName:"bg-blue-100 dark:bg-blue-900/30",loginButtonClassName:"bg-blue-600 hover:bg-blue-700"},{provider:"cursor",title:"Cursor",connectedClassName:"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-800",iconContainerClassName:"bg-purple-100 dark:bg-purple-900/30",loginButtonClassName:"bg-purple-600 hover:bg-purple-700"},{provider:"codex",title:"OpenAI Codex",connectedClassName:"bg-gray-100 dark:bg-gray-800/50 border-gray-300 dark:border-gray-600",iconContainerClassName:"bg-gray-100 dark:bg-gray-800",loginButtonClassName:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600"},{provider:"gemini",title:"Gemini",connectedClassName:"bg-teal-50 dark:bg-teal-900/20 border-teal-200 dark:border-teal-800",iconContainerClassName:"bg-teal-100 dark:bg-teal-900/30",loginButtonClassName:"bg-teal-600 hover:bg-teal-700"}];function FD({providerStatuses:e,onOpenProviderLogin:t}){return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"mb-6 text-center",children:[s.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",children:"Connect Your AI Agents"}),s.jsx("p",{className:"text-muted-foreground",children:"Login to one or more AI coding assistants. All are optional."})]}),s.jsx("div",{className:"space-y-3",children:PD.map(r=>s.jsx(LD,{provider:r.provider,title:r.title,status:e[r.provider],connectedClassName:r.connectedClassName,iconContainerClassName:r.iconContainerClassName,loginButtonClassName:r.loginButtonClassName,onLogin:()=>t(r.provider)},r.provider))}),s.jsx("div",{className:"pt-2 text-center text-sm text-muted-foreground",children:s.jsx("p",{children:"You can configure these later in Settings."})})]})}function zD({gitName:e,gitEmail:t,isSubmitting:r,onGitNameChange:n,onGitEmailChange:a}){return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"mb-8 text-center",children:[s.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30",children:s.jsx(mr,{className:"h-8 w-8 text-blue-600 dark:text-blue-400"})}),s.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",children:"Git Configuration"}),s.jsx("p",{className:"text-muted-foreground",children:"Configure your git identity to ensure proper attribution for commits."})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"gitName",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[s.jsx(HC,{className:"h-4 w-4"}),"Git Name ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("input",{type:"text",id:"gitName",value:e,onChange:i=>n(i.target.value),className:"w-full rounded-lg border border-border bg-background px-4 py-3 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"John Doe",required:!0,disabled:r}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.name`."})]}),s.jsxs("div",{children:[s.jsxs("label",{htmlFor:"gitEmail",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[s.jsx(T_,{className:"h-4 w-4"}),"Git Email ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("input",{type:"email",id:"gitEmail",value:t,onChange:i=>a(i.target.value),className:"w-full rounded-lg border border-border bg-background px-4 py-3 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"john@example.com",required:!0,disabled:r}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.email`."})]})]})]})}const sy=[{title:"Git Configuration",icon:mr,required:!0},{title:"Connect Agents",icon:BC,required:!1}];function BD({currentStep:e}){return s.jsx("div",{className:"mb-8",children:s.jsx("div",{className:"flex items-center justify-between",children:sy.map((t,r)=>{const n=r<e,a=r===e,i=t.icon;return s.jsxs("div",{className:"contents",children:[s.jsxs("div",{className:"flex flex-1 flex-col items-center",children:[s.jsx("div",{className:`flex h-12 w-12 items-center justify-center rounded-full border-2 transition-colors duration-200 ${n?"border-green-500 bg-green-500 text-white":a?"border-blue-600 bg-blue-600 text-white":"border-border bg-background text-muted-foreground"}`,children:n?s.jsx(rr,{className:"h-6 w-6"}):s.jsx(i,{className:"h-6 w-6"})}),s.jsxs("div",{className:"mt-2 text-center",children:[s.jsx("p",{className:`text-sm font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:t.title}),t.required&&s.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),r<sy.length-1&&s.jsx("div",{className:`mx-2 h-0.5 flex-1 transition-colors duration-200 ${n?"bg-green-500":"bg-border"}`})]},t.title)})})})}const oy=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ly=async(e,t)=>{try{return(await e.json()).error||t}catch{return t}};function $D({onComplete:e}){const[t,r]=f.useState(0),[n,a]=f.useState(""),[i,o]=f.useState(""),[l,c]=f.useState(!1),[u,d]=f.useState(""),[p,h]=f.useState(null),{providerAuthStatus:m,checkProviderAuthStatus:g,refreshProviderAuthStatuses:b}=VC(),x=f.useRef(void 0),y=f.useCallback(async()=>{try{const A=await Ce("/api/user/git-config");if(!A.ok)return;const N=await A.json();N.gitName&&a(N.gitName),N.gitEmail&&o(N.gitEmail)}catch(A){console.error("Error loading git config:",A)}},[]);f.useEffect(()=>{y(),b()},[y,b]),f.useEffect(()=>{const A=x.current;x.current=p,A!=null&&p===null&&b()},[p,b]);const v=A=>{h(A)},w=A=>{A===0&&p&&g(p)},S=async()=>{if(d(""),t!==0){r(A=>A+1);return}if(!n.trim()||!i.trim()){d("Both git name and email are required.");return}if(!oy.test(i)){d("Please enter a valid email address.");return}c(!0);try{const A=await Ce("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:n,gitEmail:i})});if(!A.ok){const N=await ly(A,"Failed to save git configuration");throw new Error(N)}r(N=>N+1)}catch(A){d(A instanceof Error?A.message:"Failed to save git configuration")}finally{c(!1)}},T=()=>{d(""),r(A=>A-1)},k=async()=>{c(!0),d("");try{const A=await Ce("/api/user/complete-onboarding",{method:"POST"});if(!A.ok){const N=await ly(A,"Failed to complete onboarding");throw new Error(N)}await e?.()}catch(A){d(A instanceof Error?A.message:"Failed to complete onboarding")}finally{c(!1)}},C=t===0?!!(n.trim()&&i.trim()&&oy.test(i)):!0;return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs("div",{className:"w-full max-w-2xl",children:[s.jsx(BD,{currentStep:t}),s.jsxs("div",{className:"rounded-lg border border-border bg-card p-8 shadow-lg",children:[t===0?s.jsx(zD,{gitName:n,gitEmail:i,isSubmitting:l,onGitNameChange:a,onGitEmailChange:o}):s.jsx(FD,{providerStatuses:m,onOpenProviderLogin:v}),u&&s.jsx("div",{className:"mt-6 rounded-lg border border-red-300 bg-red-100 p-4 dark:border-red-800 dark:bg-red-900/20",children:s.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:u})}),s.jsxs("div",{className:"mt-8 flex items-center justify-between border-t border-border pt-6",children:[s.jsxs("button",{onClick:T,disabled:t===0||l,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground transition-colors duration-200 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",children:[s.jsx(Bg,{className:"h-4 w-4"}),"Previous"]}),s.jsx("div",{className:"flex items-center gap-3",children:t<1?s.jsx("button",{onClick:S,disabled:!C||l,className:"flex items-center gap-2 rounded-lg bg-blue-600 px-6 py-3 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-400",children:l?s.jsxs(s.Fragment,{children:[s.jsx(tr,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):s.jsxs(s.Fragment,{children:["Next",s.jsx(Br,{className:"h-4 w-4"})]})}):s.jsx("button",{onClick:k,disabled:l,className:"flex items-center gap-2 rounded-lg bg-green-600 px-6 py-3 font-medium text-white transition-colors duration-200 hover:bg-green-700 disabled:cursor-not-allowed disabled:bg-green-400",children:l?s.jsxs(s.Fragment,{children:[s.jsx(tr,{className:"h-4 w-4 animate-spin"}),"Completing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(rr,{className:"h-4 w-4"}),"Complete Setup"]})})})]})]})]})}),p&&s.jsx(JC,{isOpen:!!p,onClose:()=>h(null),provider:p,onComplete:w})]})}const UD=["0s","0.1s","0.2s"];function GD(){return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"mb-4 flex justify-center",children:s.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:s.jsx(pn,{className:"h-8 w-8 text-primary-foreground"})})}),s.jsx("h1",{className:"mb-2 text-2xl font-bold text-foreground",children:"CloudCLI"}),s.jsx("div",{className:"flex items-center justify-center space-x-2",children:UD.map(e=>s.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-blue-500",style:{animationDelay:e}},e))}),s.jsx("p",{className:"mt-2 text-muted-foreground",children:"Loading..."})]})})}function QC({errorMessage:e}){return e?s.jsx("div",{className:"rounded-md border border-red-300 bg-red-100 p-3 dark:border-red-800 dark:bg-red-900/20",children:s.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:e})}):null}function ps({id:e,label:t,value:r,onChange:n,placeholder:a,isDisabled:i,type:o="text",name:l,autoComplete:c}){return s.jsxs("div",{children:[s.jsx("label",{htmlFor:e,className:"mb-1 block text-sm font-medium text-foreground",children:t}),s.jsx("input",{id:e,type:o,name:l??e,autoComplete:c,value:r,onChange:u=>n(u.target.value),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:a,required:!0,disabled:i})]})}function e5({title:e,description:t,children:r,footerText:n,logo:a}){return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsx("div",{className:"w-full max-w-md",children:s.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-8 shadow-lg",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"mb-4 flex justify-center",children:a??s.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:s.jsx(pn,{className:"h-8 w-8 text-primary-foreground"})})}),s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:e}),s.jsx("p",{className:"mt-2 text-muted-foreground",children:t})]}),r,s.jsx("div",{className:"text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:n})}),s.jsxs("div",{className:"flex items-center justify-center gap-1.5 pt-2",children:[s.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),s.jsx("a",{href:"https://github.com/siteboon/claudecodeui",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground/50 transition-colors hover:text-muted-foreground",children:"CloudCLI is open source"})]})]})})})}const qD={username:"",password:""};function HD(){const{t:e}=Fe("auth"),{login:t}=_a(),[r,n]=f.useState(qD),[a,i]=f.useState(""),[o,l]=f.useState(!1),c=f.useCallback((d,p)=>{n(h=>({...h,[d]:p}))},[]),u=f.useCallback(async d=>{if(d.preventDefault(),i(""),!r.username.trim()||!r.password){i(e("login.errors.requiredFields"));return}l(!0);const p=await t(r.username.trim(),r.password);p.success||i(p.error),l(!1)},[r.password,r.username,t,e]);return s.jsx(e5,{title:e("login.title"),description:e("login.description"),footerText:"Enter your credentials to access CloudCLI",children:s.jsxs("form",{onSubmit:u,className:"space-y-4",children:[s.jsx(ps,{id:"username",label:e("login.username"),value:r.username,onChange:d=>c("username",d),placeholder:e("login.placeholders.username"),isDisabled:o,autoComplete:"username"}),s.jsx(ps,{id:"password",label:e("login.password"),value:r.password,onChange:d=>c("password",d),placeholder:e("login.placeholders.password"),isDisabled:o,type:"password",autoComplete:"current-password"}),s.jsx(QC,{errorMessage:a}),s.jsx("button",{type:"submit",disabled:o,className:"w-full rounded-md bg-blue-600 px-4 py-2 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:bg-blue-400",children:e(o?"login.loading":"login.submit")})]})})}const VD={username:"",password:"",confirmPassword:""};function WD(e){return!e.username.trim()||!e.password||!e.confirmPassword?"Please fill in all fields.":e.username.trim().length<3?"Username must be at least 3 characters long.":e.password.length<6?"Password must be at least 6 characters long.":e.password!==e.confirmPassword?"Passwords do not match.":null}function KD(){const{register:e}=_a(),[t,r]=f.useState(VD),[n,a]=f.useState(""),[i,o]=f.useState(!1),l=f.useCallback((u,d)=>{r(p=>({...p,[u]:d}))},[]),c=f.useCallback(async u=>{u.preventDefault(),a("");const d=WD(t);if(d){a(d);return}o(!0);const p=await e(t.username.trim(),t.password);p.success||a(p.error),o(!1)},[t,e]);return s.jsx(e5,{title:"Welcome to CloudCLI",description:"Set up your account to get started",footerText:"Create the administrator account to get started. Additional users can be invited later.",logo:s.jsx("img",{src:"/logo.svg",alt:"CloudCLI",className:"h-16 w-16"}),children:s.jsxs("form",{onSubmit:c,className:"space-y-4",children:[s.jsx(ps,{id:"username",name:"username",label:"Username",value:t.username,onChange:u=>l("username",u),placeholder:"Enter your username",isDisabled:i,autoComplete:"username"}),s.jsx(ps,{id:"password",name:"password",label:"Password",value:t.password,onChange:u=>l("password",u),placeholder:"Enter your password",isDisabled:i,type:"password",autoComplete:"new-password"}),s.jsx(ps,{id:"confirmPassword",name:"confirmPassword",label:"Confirm Password",value:t.confirmPassword,onChange:u=>l("confirmPassword",u),placeholder:"Confirm your password",isDisabled:i,type:"password",autoComplete:"new-password"}),s.jsx(QC,{errorMessage:n}),s.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-md bg-blue-600 px-4 py-2 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:bg-blue-400",children:i?"Setting up...":"Create Account"})]})})}function YD({children:e}){const{user:t,isLoading:r,needsSetup:n,hasCompletedOnboarding:a,refreshOnboardingStatus:i}=_a();return r?s.jsx(GD,{}):n?s.jsx(KD,{}):t?a?s.jsx(s.Fragment,{children:e}):s.jsx($D,{onComplete:i}):s.jsx(HD,{})}const t5=f.createContext(null),r5=()=>{const e=f.useContext(t5);if(!e)throw new Error("useWebSocket must be used within a WebSocketProvider");return e},ZD=e=>{const t=window.location.protocol==="https:"?"wss:":"ws:";return e?`${t}//${window.location.host}/ws?token=${encodeURIComponent(e)}`:null},XD=()=>{const e=f.useRef(null),t=f.useRef(!1),r=f.useRef(!1),[n,a]=f.useState(null),[i,o]=f.useState(!1),l=f.useRef(null),{token:c}=_a();f.useEffect(()=>(u(),()=>{t.current=!0,l.current&&clearTimeout(l.current),e.current&&e.current.close()}),[c]);const u=f.useCallback(()=>{if(!t.current)try{const h=ZD(c);if(!h)return console.warn("No authentication token found for WebSocket connection");const m=new WebSocket(h);m.onopen=()=>{o(!0),e.current=m,r.current&&a({type:"websocket-reconnected",timestamp:Date.now()}),r.current=!0},m.onmessage=g=>{try{const b=JSON.parse(g.data);a(b)}catch(b){console.error("Error parsing WebSocket message:",b)}},m.onclose=()=>{o(!1),e.current=null,l.current=setTimeout(()=>{t.current||u()},3e3)},m.onerror=g=>{console.error("WebSocket error:",g)}}catch(h){console.error("Error creating WebSocket connection:",h)}},[c]),d=f.useCallback(h=>{const m=e.current;m&&m.readyState===WebSocket.OPEN?m.send(JSON.stringify(h)):console.warn("WebSocket not connected")},[]);return f.useMemo(()=>({ws:e.current,sendMessage:d,latestMessage:n,isConnected:i}),[d,n,i])},JD=({children:e})=>{const t=XD();return s.jsx(t5.Provider,{value:t,children:e})},n5=f.createContext(null);function QD(e,t){return{message:t instanceof Error?t.message:`Failed to ${e}`,context:e,timestamp:new Date().toISOString()}}function qa(e){return{...e,taskMasterConfigured:e.taskmaster?.hasTaskmaster??!1,taskMasterStatus:e.taskmaster?.status??"not-configured",taskCount:Number(e.taskmaster?.metadata?.taskCount??0),completedCount:Number(e.taskmaster?.metadata?.completed??0)}}function eM(e){return e.find(t=>t.status==="pending"||t.status==="in-progress")??null}function tM(e){return e?.type?e.type.startsWith("taskmaster-"):!1}function Ai(){const e=f.useContext(n5);if(!e)throw new Error("useTaskMaster must be used within a TaskMasterProvider");return e}function rM({children:e}){const{latestMessage:t}=r5(),{user:r,token:n,isLoading:a}=_a(),[i,o]=f.useState([]),[l,c]=f.useState(null),[u,d]=f.useState(null),[p,h]=f.useState(null),[m,g]=f.useState([]),[b,x]=f.useState(null),[y,v]=f.useState(!1),[w,S]=f.useState(!1),[T,k]=f.useState(!1),[C,A]=f.useState(null),N=f.useRef(null),I=f.useRef(null),D=f.useRef(0);f.useEffect(()=>{N.current=l?.projectId??null},[l?.projectId]),f.useEffect(()=>{I.current=u},[u]);const j=f.useCallback(()=>{A(null)},[]),F=f.useCallback((z,M)=>{console.error(`TaskMaster ${z} error:`,M),A(QD(z,M))},[]),E=f.useCallback((z,M)=>{d(M),o(P=>P.map(Y=>Y.projectId!==z?Y:qa({...Y,taskmaster:M??void 0}))),c(P=>!P||P.projectId!==z?P:qa({...P,taskmaster:M??void 0}))},[]),$=f.useCallback(async z=>{if(!z||!r||!n)return;const M=++D.current;try{const P=await Ye.projectTaskmaster(z);if(!P.ok)throw new Error(`Failed to fetch TaskMaster details: ${P.status}`);const Z=(await P.json()).taskmaster??null;if(M!==D.current||N.current!==z)return;E(z,Z)}catch(P){if(M!==D.current||N.current!==z)return;F("load selected project TaskMaster info",P)}},[E,F,n,r]),G=f.useCallback(z=>{const M=z?qa(z):null;if(c(M),d(M?.taskmaster??null),g([]),x(null),!M?.projectId){D.current+=1;return}$(M.projectId)},[$]),V=f.useCallback(async()=>{if(!r||!n){o([]),c(null),d(null),g([]),x(null);return}try{v(!0),j();const z=await Ye.get("/projects");if(!z.ok)throw new Error(`Failed to fetch projects: ${z.status}`);const M=await z.json(),Y=(Array.isArray(M)?M:[]).map(pe=>qa(pe));o(pe=>{const de=new Map(pe.filter(be=>!!be.taskmaster).map(be=>[be.projectId,be.taskmaster]));return Y.map(be=>{const ke=de.get(be.projectId);return ke?qa({...be,taskmaster:ke}):be})});const Z=N.current;if(!Z)return;const ie=Y.find(pe=>pe.projectId===Z)??null;if(!ie){D.current+=1,c(null),d(null),g([]),x(null);return}const J=ie.taskmaster??I.current??null;c(J?qa({...ie,taskmaster:J}):ie),d(J),$(Z)}catch(z){F("load projects",z)}finally{v(!1)}},[j,F,$,n,r]),K=f.useCallback(async()=>{const z=l?.projectId;if(!z||!r||!n){g([]),x(null);return}try{S(!0),j();const M=await Ye.get(`/taskmaster/tasks/${encodeURIComponent(z)}`);if(!M.ok){const Z=await M.json();throw new Error(Z.message??"Failed to load tasks")}const P=await M.json(),Y=Array.isArray(P.tasks)?P.tasks:[];g(Y),x(eM(Y))}catch(M){F("load tasks",M),g([]),x(null)}finally{S(!1)}},[j,l?.projectId,F,n,r]),q=f.useCallback(async()=>{if(!r||!n){h(null);return}try{k(!0),j();const z=await Ye.get("/mcp-utils/taskmaster-server");if(!z.ok)throw new Error(`Failed to load MCP status: ${z.status}`);const M=await z.json();h(M)}catch(z){F("check MCP server status",z),h(null)}finally{k(!1)}},[j,F,n,r]);f.useEffect(()=>{!a&&r&&n&&(V(),q())},[a,q,V,n,r]),f.useEffect(()=>{l?.projectId&&r&&n&&K()},[l?.projectId,K,n,r]),f.useEffect(()=>{const z=t;if(tM(z)){if(z.type==="taskmaster-project-updated"&&z.projectId){z.projectId===N.current&&$(z.projectId),V();return}if(z.type==="taskmaster-tasks-updated"&&z.projectId===l?.projectId){K();return}z.type==="taskmaster-mcp-status-changed"&&q()}},[l?.projectId,t,$,q,V,K]);const O=f.useMemo(()=>({projects:i,currentProject:l,projectTaskMaster:u,mcpServerStatus:p,tasks:m,nextTask:b,isLoading:y,isLoadingTasks:w,isLoadingMCP:T,error:C,refreshProjects:V,setCurrentProject:G,refreshTasks:K,refreshMCPStatus:q,clearError:j}),[j,l,C,y,T,w,p,b,u,i,q,V,K,G,m]);return s.jsx(n5.Provider,{value:O,children:e})}const a5=f.createContext({tasksEnabled:!0,setTasksEnabled:()=>{},toggleTasksEnabled:()=>{},isTaskMasterInstalled:null,isTaskMasterReady:null,installationStatus:null,isCheckingInstallation:!0}),Pl=()=>{const e=f.useContext(a5);if(!e)throw new Error("useTasksSettings must be used within a TasksSettingsProvider");return e},nM=({children:e})=>{const[t,r]=f.useState(()=>{const m=localStorage.getItem("tasks-enabled");return m!==null?JSON.parse(m):!0}),[n,a]=f.useState(null),[i,o]=f.useState(null),[l,c]=f.useState(null),[u,d]=f.useState(!0);f.useEffect(()=>{localStorage.setItem("tasks-enabled",JSON.stringify(t))},[t]),f.useEffect(()=>{setTimeout(async()=>{try{const g=await Ye.get("/taskmaster/installation-status");if(g.ok){const b=await g.json();c(b),a(b.installation?.isInstalled||!1),o(b.isReady||!1);const x=localStorage.getItem("tasks-enabled");!b.installation?.isInstalled&&!x&&r(!1)}else console.error("Failed to check TaskMaster installation status"),a(!1),o(!1)}catch(g){console.error("Error checking TaskMaster installation:",g),a(!1),o(!1)}finally{d(!1)}},0)},[]);const h={tasksEnabled:t,setTasksEnabled:r,toggleTasksEnabled:()=>{r(m=>!m)},isTaskMasterInstalled:n,isTaskMasterReady:i,installationStatus:l,isCheckingInstallation:u};return s.jsx(a5.Provider,{value:h,children:e})},i5=f.createContext(null);function Fl(){const e=f.useContext(i5);if(!e)throw new Error("usePlugins must be used within a PluginsProvider");return e}function aM({children:e}){const[t,r]=f.useState([]),[n,a]=f.useState(!0),[i,o]=f.useState(null),l=f.useCallback(async()=>{try{const h=await Ce("/api/plugins");if(h.ok){const m=await h.json();r(m.plugins||[]),o(null)}else{let m=`Failed to fetch plugins (${h.status})`;try{const g=await h.json();m=g.details||g.error||m}catch{m=h.statusText||m}o(m)}}catch(h){const m=h instanceof Error?h.message:"Failed to fetch plugins";o(m),console.error("[Plugins] Failed to fetch plugins:",h)}finally{a(!1)}},[]);f.useEffect(()=>{l()},[l]);const c=f.useCallback(async h=>{try{const m=await Ce("/api/plugins/install",{method:"POST",body:JSON.stringify({url:h})}),g=await m.json();return m.ok?(await l(),{success:!0}):{success:!1,error:g.details||g.error||"Install failed"}}catch(m){return{success:!1,error:m instanceof Error?m.message:"Install failed"}}},[l]),u=f.useCallback(async h=>{try{const m=await Ce(`/api/plugins/${encodeURIComponent(h)}`,{method:"DELETE"}),g=await m.json();return m.ok?(await l(),{success:!0}):{success:!1,error:g.details||g.error||"Uninstall failed"}}catch(m){return{success:!1,error:m instanceof Error?m.message:"Uninstall failed"}}},[l]),d=f.useCallback(async h=>{try{const m=await Ce(`/api/plugins/${encodeURIComponent(h)}/update`,{method:"POST"}),g=await m.json();return m.ok?(await l(),{success:!0}):{success:!1,error:g.details||g.error||"Update failed"}}catch(m){return{success:!1,error:m instanceof Error?m.message:"Update failed"}}},[l]),p=f.useCallback(async(h,m)=>{try{const g=await Ce(`/api/plugins/${encodeURIComponent(h)}/enable`,{method:"PUT",body:JSON.stringify({enabled:m})});if(!g.ok){let b=`Toggle failed (${g.status})`;try{const x=await g.json();b=x.details||x.error||b}catch{b=g.statusText||b}return{success:!1,error:b}}return await l(),{success:!0,error:null}}catch(g){return{success:!1,error:g instanceof Error?g.message:"Toggle failed"}}},[l]);return s.jsx(i5.Provider,{value:{plugins:t,loading:n,pluginsError:i,refreshPlugins:l,installPlugin:c,uninstallPlugin:u,updatePlugin:d,togglePlugin:p},children:e})}const cy=e=>typeof window>"u"?!1:window.innerWidth<e,uy=()=>{if(typeof window>"u")return!1;const e=window.navigator;return window.matchMedia("(display-mode: standalone)").matches||!!e.standalone||document.referrer.includes("android-app://")};function Wg(e={}){const{mobileBreakpoint:t=768,trackMobile:r=!0,trackPWA:n=!0}=e,[a,i]=f.useState(()=>r?cy(t):!1),[o,l]=f.useState(()=>n?uy():!1);return f.useEffect(()=>{if(!r||typeof window>"u")return;const c=()=>{i(cy(t))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[t,r]),f.useEffect(()=>{if(!n||typeof window>"u")return;const c=window.matchMedia("(display-mode: standalone)"),u=()=>{l(uy())};return u(),typeof c.addEventListener=="function"?(c.addEventListener("change",u),()=>{c.removeEventListener("change",u)}):(c.addListener(u),()=>{c.removeListener(u)})},[n]),{isMobile:a,isPWA:o}}const dy="1.32.1",iM=(e,t)=>{const r=e.split(".").map(Number),n=t.split(".").map(Number);for(let a=0;a<Math.max(r.length,n.length);a++){const i=r[a]||0,o=n[a]||0;if(i!==o)return i-o}return 0},s5=(e,t)=>{const[r,n]=f.useState(!1),[a,i]=f.useState(null),[o,l]=f.useState(null),[c,u]=f.useState("git");return f.useEffect(()=>{(async()=>{try{const h=await(await fetch("/health")).json();(h.installMode==="npm"||h.installMode==="git")&&u(h.installMode)}catch{}})()},[]),f.useEffect(()=>{const d=async()=>{try{const m=await(await fetch(`https://api.github.com/repos/${e}/${t}/releases/latest`)).json();if(m.tag_name){const g=m.tag_name.replace(/^v/,"");i(g),n(iM(g,dy)>0),l({title:m.name||m.tag_name,body:m.body||"",htmlUrl:m.html_url||`https://github.com/${e}/${t}/releases/latest`,publishedAt:m.published_at})}else n(!1),i(null),l(null)}catch(h){console.error("Version check failed:",h),n(!1),i(null),l(null)}};d();const p=setInterval(d,300*1e3);return()=>clearInterval(p)},[e,t]),{updateAvailable:r,latestVersion:a,currentVersion:dy,releaseInfo:o,installMode:c}},ya={autoExpandTools:!1,showRawParameters:!1,showThinking:!0,autoScrollToBottom:!0,sendByCtrlEnter:!1,sidebarVisible:!0},al=Object.keys(ya),sM=new Set(al),Sc="ui-preferences:sync",il=(e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1}return t},oM=(e,t)=>{try{const r=localStorage.getItem(e);if(r===null)return t;const n=JSON.parse(r);return il(n,t)}catch{return t}},lM=e=>{if(typeof window>"u")return ya;try{const t=localStorage.getItem(e);if(t){const r=JSON.parse(t);if(r&&typeof r=="object"&&!Array.isArray(r)){const n=r;return al.reduce((a,i)=>(a[i]=il(n[i],ya[i]),a),{...ya})}}}catch{}return al.reduce((t,r)=>(t[r]=oM(r,ya[r]),t),{...ya})};function cM(e,t){switch(t.type){case"set":{const{key:r,value:n}=t;if(!sM.has(r))return e;const a=il(n,e[r]);return e[r]===a?e:{...e,[r]:a}}case"set_many":{const r=t.value||{};let n=!1;const a={...e};for(const i of al){if(!(i in r))continue;const o=r[i],l=il(o,e[i]);a[i]!==l&&(a[i]=l,n=!0)}return n?a:e}case"reset":return{...ya,...t.value||{}};default:return e}}function Kg(e="uiPreferences"){const t=f.useRef(`ui-preferences-${Math.random().toString(36).slice(2)}`),[r,n]=f.useReducer(cM,e,lM);return f.useEffect(()=>{typeof window>"u"||(localStorage.setItem(e,JSON.stringify(r)),window.dispatchEvent(new CustomEvent(Sc,{detail:{storageKey:e,sourceId:t.current,value:r}})))},[r,e]),f.useEffect(()=>{if(typeof window>"u")return;const l=d=>{!d||typeof d!="object"||Array.isArray(d)||n({type:"set_many",value:d})},c=d=>{if(!(d.key!==e||d.newValue===null))try{const p=JSON.parse(d.newValue);l(p)}catch{}},u=d=>{const h=d.detail;!h||h.storageKey!==e||h.sourceId===t.current||l(h.value)};return window.addEventListener("storage",c),window.addEventListener(Sc,u),()=>{window.removeEventListener("storage",c),window.removeEventListener(Sc,u)}},[e]),{preferences:r,setPreference:(l,c)=>{n({type:"set",key:l,value:c})},setPreferences:l=>{n({type:"set_many",value:l})},resetPreferences:l=>{n({type:"reset",value:l})},dispatch:n}}const Yg=f.createContext(null),Ec={openFile:()=>{},openSettings:()=>{},refreshProjects:()=>{}};function uM({children:e}){const t=f.useRef({});return s.jsx(Yg.Provider,{value:t,children:e})}function Ds(){const e=f.useContext(Yg);return f.useMemo(()=>({openFile:t=>(e?.current.openFile??Ec.openFile)(t),openSettings:t=>(e?.current.openSettings??Ec.openSettings)(t),refreshProjects:()=>(e?.current.refreshProjects??Ec.refreshProjects)()}),[e])}function o5(e){const t=f.useContext(Yg),{openFile:r,openSettings:n,refreshProjects:a}=e;f.useEffect(()=>{if(!t)return;const i={...t.current};return r&&(t.current.openFile=r),n&&(t.current.openSettings=n),a&&(t.current.refreshProjects=a),()=>{r&&t.current.openFile===r&&(t.current.openFile=i.openFile),n&&t.current.openSettings===n&&(t.current.openSettings=i.openSettings),a&&t.current.refreshProjects===a&&(t.current.refreshProjects=i.refreshProjects)}},[t,r,n,a])}const dM=()=>{try{const e=localStorage.getItem("claude-settings");return e&&JSON.parse(e).projectSortOrder==="date"?"date":"name"}catch{return"name"}},l5="starredProjects",pM=()=>{try{const e=localStorage.getItem(l5);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.map(r=>String(r).trim()).filter(r=>r.length>0):[]}catch{return[]}},mM=()=>{try{localStorage.removeItem(l5)}catch{}},c5=e=>String(e.createdAt||e.created_at||""),u5=e=>String(e.lastActivity||""),sl=e=>new Date(u5(e)||c5(e)||0),hM=(e,t)=>e.summary||e.name||t("projects.newSession"),fM=e=>u5(e)||c5(e),gM=(e,t,r)=>{const n=sl(e),a=Math.floor((t.getTime()-n.getTime())/(1e3*60));return{isCursorSession:e.__provider==="cursor",isCodexSession:e.__provider==="codex",isGeminiSession:e.__provider==="gemini",isActive:a<10,sessionName:hM(e,r),sessionTime:fM(e),messageCount:Number(e.messageCount||0)}},ol=e=>{const t=[...e.sessions||[]].map(i=>({...i,__provider:"claude"})),r=(e.cursorSessions||[]).map(i=>({...i,__provider:"cursor"})),n=(e.codexSessions||[]).map(i=>({...i,__provider:"codex"})),a=(e.geminiSessions||[]).map(i=>({...i,__provider:"gemini"}));return[...t,...r,...n,...a].sort((i,o)=>sl(o).getTime()-sl(i).getTime())},py=e=>{const t=ol(e);return t.length===0?new Date(0):t.reduce((r,n)=>{const a=sl(n);return a>r?a:r},new Date(0))},bM=(e,t)=>{const r=[...e];return r.sort((n,a)=>{const i=!!n.isStarred,o=!!a.isStarred;return i&&!o?-1:!i&&o?1:t==="date"?py(a).getTime()-py(n).getTime():(n.displayName||n.projectId).localeCompare(a.displayName||a.projectId)}),r},xM=(e,t)=>{const r=t.trim().toLowerCase();return r?e.filter(n=>{const a=(n.displayName||n.projectId).toLowerCase(),i=(n.path||n.fullPath||"").toLowerCase();return a.includes(r)||i.includes(r)}):e},yM=(e,t)=>{const r=!!e.taskmaster?.hasTaskmaster,n=!!(t?.hasMCPServer&&t?.isConfigured);return r&&n?"fully-configured":r?"taskmaster-only":n?"mcp-only":"not-configured"},vM=e=>{const t=typeof e.fullPath=="string"&&e.fullPath.length>0?e.fullPath:typeof e.path=="string"?e.path:"";return{name:e.projectId,displayName:typeof e.displayName=="string"&&e.displayName.trim().length>0?e.displayName:e.projectId,fullPath:t,path:typeof e.path=="string"&&e.path.length>0?e.path:t}};function kM({projects:e,selectedProject:t,selectedSession:r,isLoading:n,isMobile:a,t:i,onRefresh:o,onProjectSelect:l,onSessionSelect:c,onSessionDelete:u,onLoadMoreSessions:d,onProjectDelete:p,setCurrentProject:h,setSidebarVisible:m,sidebarVisible:g}){const b=Ds(),[x,y]=f.useState(new Set),[v,w]=f.useState(null),[S,T]=f.useState(!1),[k,C]=f.useState(""),[A,N]=f.useState(new Set),[I,D]=f.useState(new Date),[j,F]=f.useState("name"),[E,$]=f.useState(!1),[G,V]=f.useState(null),[K,q]=f.useState(""),[O,z]=f.useState(""),[M,P]=f.useState(new Set),[Y,Z]=f.useState(null),[ie,J]=f.useState(null),[pe,de]=f.useState(!1),[be,ke]=f.useState("projects"),[we,Ee]=f.useState(null),[L,ce]=f.useState(!1),[se,W]=f.useState(null),[H,ne]=f.useState([]),[he,me]=f.useState([]),[oe,xe]=f.useState(!1),[Q,re]=f.useState(""),[X,le]=f.useState(new Map),[ge,_e]=f.useState(new Set),Oe=f.useRef(0),Ve=f.useRef(null),st=f.useRef(new Map),Ke=f.useRef(!1),et=f.useRef(o),pt=!a&&!g;f.useEffect(()=>{const ye=setInterval(()=>{D(new Date)},6e4);return()=>clearInterval(ye)},[]),f.useEffect(()=>{N(new Set)},[e]),f.useEffect(()=>{const ye=t?.projectId;ye&&y(Ne=>{if(Ne.has(ye))return Ne;const $e=new Set(Ne);return $e.add(ye),$e})},[t?.projectId]),f.useEffect(()=>{if(e.length>0&&!n){const ye=new Set;e.forEach(Ne=>{Ne.sessions&&Ne.sessions.length>=0&&ye.add(Ne.projectId)}),N(ye)}},[e,n]),f.useEffect(()=>{const ye=()=>{F(dM())};ye();const Ne=He=>{He.key==="claude-settings"&&ye()};window.addEventListener("storage",Ne);const $e=setInterval(()=>{document.hasFocus()&&ye()},1e3);return()=>{window.removeEventListener("storage",Ne),clearInterval($e)}},[]),f.useEffect(()=>{et.current=o},[o]);const We=f.useCallback(async()=>{xe(!0);try{const[ye,Ne]=await Promise.all([Ye.archivedProjects(),Ye.getArchivedSessions()]);if(!ye.ok)throw new Error(`Failed to load archived projects: ${ye.status}`);if(!Ne.ok)throw new Error(`Failed to load archived sessions: ${Ne.status}`);const $e=await ye.json(),He=await Ne.json(),wt=Array.isArray($e.data?.projects)?$e.data.projects:[],bt=new Set(wt.map(Wt=>Wt.projectId)),sr=Array.isArray(He.data?.sessions)?He.data.sessions.filter(Wt=>!Wt.projectId||!bt.has(Wt.projectId)):[];ne(wt),me(sr)}catch(ye){console.error("[Sidebar] Failed to load archived sessions:",ye)}finally{xe(!1)}},[]);f.useEffect(()=>{if(Ke.current)return;const ye=pM();if(ye.length===0)return;Ke.current=!0,(async()=>{try{await Ye.migrateLegacyProjectStars(ye),await et.current()}catch($e){console.error("[Sidebar] Failed to migrate legacy starred projects:",$e)}finally{mM()}})()},[o]),f.useEffect(()=>{We()},[We]),f.useEffect(()=>{be==="archived"&&We()},[We,be]),f.useEffect(()=>{le(ye=>{if(ye.size===0)return ye;const Ne=new Map(ye);let $e=!1;for(const[He,wt]of ye.entries()){const bt=e.find(sr=>sr.projectId===He);if(!bt){Ne.delete(He),$e=!0;continue}!!bt.isStarred===wt&&(Ne.delete(He),$e=!0)}return $e?Ne:ye})},[e]),f.useEffect(()=>{const ye=setTimeout(()=>{re(O.trim())},300);return()=>{clearTimeout(ye)}},[O]),f.useEffect(()=>{Ve.current&&(Ve.current.close(),Ve.current=null);const ye=Q;if(be!=="conversations"||ye.length<2){Oe.current+=1,Ee(null),W(null),ce(!1);return}ce(!0);const Ne=++Oe.current;if(Ne!==Oe.current)return;const $e=Ye.searchConversationsUrl(ye),He=new EventSource($e);Ve.current=He;const wt=[];let bt=0;return He.addEventListener("result",sr=>{if(Ne!==Oe.current){He.close();return}try{const Wt=JSON.parse(sr.data);wt.push(Wt.projectResult),bt=Wt.totalMatches,Ee({results:[...wt],totalMatches:bt,query:ye}),W({scannedProjects:Wt.scannedProjects,totalProjects:Wt.totalProjects})}catch{}}),He.addEventListener("progress",sr=>{if(Ne!==Oe.current){He.close();return}try{const Wt=JSON.parse(sr.data);bt=Wt.totalMatches,W({scannedProjects:Wt.scannedProjects,totalProjects:Wt.totalProjects})}catch{}}),He.addEventListener("done",()=>{if(Ne!==Oe.current){He.close();return}He.close(),Ve.current=null,ce(!1),W(null),wt.length===0&&Ee({results:[],totalMatches:0,query:ye})}),He.addEventListener("error",()=>{if(Ne!==Oe.current){He.close();return}He.close(),Ve.current=null,ce(!1),W(null),wt.length===0&&Ee({results:[],totalMatches:0,query:ye})}),()=>{Ve.current&&(Ve.current.close(),Ve.current=null)}},[Q,be]);const xt=f.useCallback(ye=>{y(Ne=>{const $e=new Set;return Ne.has(ye)||$e.add(ye),$e})},[]),mt=f.useCallback((ye,Ne)=>{c({...ye,__projectId:Ne})},[c]),kt=f.useCallback(ye=>X.has(ye)?!!X.get(ye):e.some(Ne=>Ne.projectId===ye&&!!Ne.isStarred),[X,e]),ct=f.useCallback(ye=>{const Ne=kt(ye),$e=!Ne,He=(st.current.get(ye)??0)+1;st.current.set(ye,He),le(bt=>{const sr=new Map(bt);return sr.set(ye,$e),sr}),(async()=>{try{const bt=await Ye.toggleProjectStar(ye);if(!bt.ok){const Wr=(await bt.json()).error,pc=typeof Wr=="string"?Wr:Wr&&typeof Wr=="object"&&Wr.message?Wr.message:i("messages.updateProjectError");throw new Error(pc)}const sr=await bt.json();if(!(st.current.get(ye)===He))return;le(pa=>{const Wr=new Map(pa);return Wr.set(ye,!!sr.isStarred),Wr})}catch(bt){if(!(st.current.get(ye)===He))return;le(Wt=>{const pa=new Map(Wt);return pa.set(ye,Ne),pa}),console.error("[Sidebar] Failed to toggle project star:",bt),alert(i("messages.updateProjectError"))}})()},[kt,i]),Ut=f.useCallback(ye=>kt(ye),[kt]),Gt=f.useCallback(ye=>ol(ye),[]),je=f.useCallback(async ye=>{if(!d)return;let Ne=!1;if(_e($e=>{if($e.has(ye))return $e;Ne=!0;const He=new Set($e);return He.add(ye),He}),!!Ne)try{await d(ye)}catch($e){console.error("[Sidebar] Failed to load more sessions:",$e),alert(i("messages.refreshError"))}finally{_e($e=>{const He=new Set($e);return He.delete(ye),He})}},[d,i]),rt=f.useMemo(()=>X.size===0?e:e.map(ye=>{const Ne=X.get(ye.projectId);return Ne===void 0||!!ye.isStarred===Ne?ye:{...ye,isStarred:Ne}}),[X,e]),tt=f.useMemo(()=>bM(rt,j),[j,rt]),ut=f.useMemo(()=>xM(tt,Q),[Q,tt]),Ct=f.useMemo(()=>{const ye=Q.trim().toLowerCase();return ye?he.filter(Ne=>[Ne.sessionTitle,Ne.projectDisplayName,Ne.projectPath??"",Ne.provider].some(He=>He.toLowerCase().includes(ye))):he},[he,Q]),Rt=f.useMemo(()=>{const ye=Q.trim().toLowerCase();return ye?H.filter(Ne=>[Ne.displayName,Ne.fullPath||""].some(He=>He.toLowerCase().includes(ye))?!0:ol(Ne).some(He=>[typeof He.summary=="string"&&He.summary.trim().length>0?He.summary:typeof He.name=="string"?He.name:"",He.__provider].some(bt=>bt.toLowerCase().includes(ye)))):H},[H,Q]),Qr=f.useCallback(ye=>{w(ye.projectId),C(ye.displayName)},[]),fr=f.useCallback(()=>{w(null),C("")},[]),Mr=f.useCallback(async ye=>{try{(await Ye.renameProject(ye,k)).ok?await b.refreshProjects():console.error("Failed to rename project")}catch(Ne){console.error("Error renaming project:",Ne)}finally{w(null),C("")}},[k,b]),Me=f.useCallback((ye,Ne,$e,He="claude",wt={})=>{J({projectId:ye,sessionId:Ne,sessionTitle:$e,provider:He,isArchived:!!wt.isArchived})},[]),Le=f.useCallback(async(ye=!1)=>{if(!ie)return;const{sessionId:Ne}=ie;J(null);try{const $e=await Ye.deleteSession(Ne,ye);if($e.ok)u?.(Ne),await We();else{const He=await $e.text();console.error("[Sidebar] Failed to delete session:",{status:$e.status,error:He}),alert(i("messages.deleteSessionFailed"))}}catch($e){console.error("[Sidebar] Error deleting session:",$e),alert(i("messages.deleteSessionError"))}},[We,u,ie,i]),De=f.useCallback(ye=>{Z({project:ye,sessionCount:Gt(ye).length})},[Gt]),nt=f.useCallback(async(ye=!1)=>{if(!Y)return;const{project:Ne}=Y;Z(null),P($e=>new Set([...$e,Ne.projectId]));try{const $e=await Ye.deleteProject(Ne.projectId,ye);if($e.ok)p?.(Ne.projectId);else{const wt=(await $e.json()).error,bt=typeof wt=="string"?wt:wt&&typeof wt=="object"&&wt.message?wt.message:i("messages.deleteProjectFailed");alert(bt)}}catch($e){console.error("Error deleting project:",$e),alert(i("messages.deleteProjectError"))}finally{P($e=>{const He=new Set($e);return He.delete(Ne.projectId),He})}},[Y,p,i]),Tt=f.useCallback(ye=>{l(ye),h(ye)},[l,h]),Xt=f.useCallback(ye=>{const Ne=ye.projectId?e.find(bt=>bt.projectId===ye.projectId):null,$e=ye.projectId?H.find(bt=>bt.projectId===ye.projectId):null,He=Ne??$e??null,wt={id:ye.sessionId,summary:ye.sessionTitle,__provider:ye.provider,__projectId:He?.projectId??ye.projectId??void 0};He&&Tt(He),c(wt)},[H,Tt,c,e]),yt=f.useCallback(async ye=>{try{const Ne=await Ye.restoreProject(ye);if(!Ne.ok){const $e=await Ne.text();console.error("[Sidebar] Failed to restore project:",{status:Ne.status,error:$e}),alert(i("messages.restoreProjectFailed","Failed to restore project. Please try again."));return}await Promise.all([Promise.resolve(o()),We()])}catch(Ne){console.error("[Sidebar] Error restoring project:",Ne),alert(i("messages.restoreProjectError","Error restoring project. Please try again."))}},[We,o,i]),ar=f.useCallback(async ye=>{try{const Ne=await Ye.restoreSession(ye);if(!Ne.ok){const $e=await Ne.text();console.error("[Sidebar] Failed to restore session:",{status:Ne.status,error:$e}),alert(i("messages.restoreSessionFailed","Failed to restore session. Please try again."));return}await Promise.all([Promise.resolve(o()),We()])}catch(Ne){console.error("[Sidebar] Error restoring session:",Ne),alert(i("messages.restoreSessionError","Error restoring session. Please try again."))}},[We,o,i]),Hr=f.useCallback(async()=>{$(!0);try{await Promise.all([Promise.resolve(o()),We()])}finally{$(!1)}},[We,o]),gr=f.useCallback(async(ye,Ne,$e,He)=>{const wt=$e.trim();if(!wt){V(null),q("");return}try{const bt=await Ye.renameSession(Ne,wt);bt.ok?await o():(console.error("[Sidebar] Failed to rename session:",bt.status),alert(i("messages.renameSessionFailed")))}catch(bt){console.error("[Sidebar] Error renaming session:",bt),alert(i("messages.renameSessionError"))}finally{V(null),q("")}},[o,i]),ir=f.useCallback(()=>{m(!1)},[m]),Vr=f.useCallback(()=>{m(!0)},[m]);return{isSidebarCollapsed:pt,expandedProjects:x,editingProject:v,showNewProject:S,editingName:k,initialSessionsLoaded:A,currentTime:I,projectSortOrder:j,isRefreshing:E,editingSession:G,editingSessionName:K,searchFilter:O,deletingProjects:M,loadingMoreProjects:ge,deleteConfirmation:Y,sessionDeleteConfirmation:ie,showVersionModal:pe,filteredProjects:ut,archivedProjects:Rt,archivedSessions:Ct,archivedSessionsCount:H.length+he.length,isArchivedSessionsLoading:oe,toggleProject:xt,handleSessionClick:mt,toggleStarProject:ct,isProjectStarred:Ut,getProjectSessions:Gt,loadMoreSessionsForProject:je,startEditing:Qr,cancelEditing:fr,saveProjectName:Mr,showDeleteSessionConfirmation:Me,confirmDeleteSession:Le,requestProjectDelete:De,confirmDeleteProject:nt,handleProjectSelect:Tt,openArchivedSession:Xt,restoreArchivedProject:yt,restoreArchivedSession:ar,refreshProjects:Hr,updateSessionSummary:gr,collapseSidebar:ir,expandSidebar:Vr,setShowNewProject:T,setEditingName:C,setEditingSession:V,setEditingSessionName:q,searchMode:be,setSearchMode:ke,conversationResults:we,isSearching:L,searchProgress:se,clearConversationResults:f.useCallback(()=>{Oe.current+=1,Ve.current&&(Ve.current.close(),Ve.current=null),ce(!1),W(null),Ee(null)},[]),setSearchFilter:z,setDeleteConfirmation:Z,setSessionDeleteConfirmation:J,setShowVersionModal:de}}const wM="https://discord.gg/buxwujPNRE",SM="https://github.com/siteboon/claudecodeui/issues/new";function EM({className:e}){return s.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}function NM({onExpand:e,onShowSettings:t,updateAvailable:r,onShowVersionModal:n,t:a}){return s.jsxs("div",{className:"flex h-full w-12 flex-col items-center gap-1 bg-background/80 py-3 backdrop-blur-sm",children:[s.jsx("button",{onClick:e,className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("common:versionUpdate.ariaLabels.showSidebar"),title:a("common:versionUpdate.ariaLabels.showSidebar"),children:s.jsx(G_,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),s.jsx("div",{className:"nav-divider my-1 w-6"}),s.jsx("button",{onClick:t,className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.settings"),title:a("actions.settings"),children:s.jsx(vt,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),s.jsx("a",{href:SM,target:"_blank",rel:"noopener noreferrer",className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.reportIssue"),title:a("actions.reportIssue"),children:s.jsx(R0,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),s.jsx("a",{href:wM,target:"_blank",rel:"noopener noreferrer",className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.joinCommunity"),title:a("actions.joinCommunity"),children:s.jsx(EM,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),r&&s.jsxs("button",{onClick:n,className:"relative flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("common:versionUpdate.ariaLabels.updateAvailable"),title:a("common:versionUpdate.ariaLabels.updateAvailable"),children:[s.jsx(ta,{className:"h-4 w-4 text-blue-500"}),s.jsx("span",{className:"absolute right-1.5 top-1.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]})]})}function d5(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=d5(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function p5(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=d5(e))&&(n&&(n+=" "),n+=t);return n}const my=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hy=p5,Zg=(e,t)=>r=>{var n;if(t?.variants==null)return hy(e,r?.class,r?.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(u=>{const d=r?.[u],p=i?.[u];if(d===null)return null;const h=my(d)||my(p);return a[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[p,h]=d;return h===void 0||(u[p]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:p,className:h,...m}=d;return Object.entries(m).every(g=>{let[b,x]=g;return Array.isArray(x)?x.includes({...i,...l}[b]):{...i,...l}[b]===x})?[...u,p,h]:u},[]);return hy(e,o,c,r?.class,r?.className)},Xg="-",CM=e=>{const t=AM(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Xg);return l[0]===""&&l.length!==1&&l.shift(),m5(l,t)||TM(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},m5=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?m5(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Xg);return t.validators.find(({validator:o})=>o(i))?.classGroupId},fy=/^\[(.+)\]$/,TM=e=>{if(fy.test(e)){const t=fy.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},AM=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const a in r)P0(r[a],n,a,t);return n},P0=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:gy(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(IM(a)){P0(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{P0(o,gy(t,i),r,n)})})},gy=(e,t)=>{let r=e;return t.split(Xg).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},IM=e=>e.isThemeGetter,jM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},F0="!",z0=":",RM=z0.length,_M=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const i=[];let o=0,l=0,c=0,u;for(let g=0;g<a.length;g++){let b=a[g];if(o===0&&l===0){if(b===z0){i.push(a.slice(c,g)),c=g+RM;continue}if(b==="/"){u=g;continue}}b==="["?o++:b==="]"?o--:b==="("?l++:b===")"&&l--}const d=i.length===0?a:a.substring(c),p=DM(d),h=p!==d,m=u&&u>c?u-c:void 0;return{modifiers:i,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}};if(t){const a=t+z0,i=n;n=o=>o.startsWith(a)?i(o.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},DM=e=>e.endsWith(F0)?e.substring(0,e.length-1):e.startsWith(F0)?e.substring(1):e,MM=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let i=[];return n.forEach(o=>{o[0]==="["||t[o]?(a.push(...i.sort(),o),i=[]):i.push(o)}),a.push(...i.sort()),a}},OM=e=>({cache:jM(e.cacheSize),parseClassName:_M(e),sortModifiers:MM(e),...CM(e)}),LM=/\s+/,PM=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=t,o=[],l=e.trim().split(LM);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:p,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:b}=r(d);if(p){c=d+(c.length>0?" "+c:c);continue}let x=!!b,y=n(x?g.substring(0,b):g);if(!y){if(!x){c=d+(c.length>0?" "+c:c);continue}if(y=n(g),!y){c=d+(c.length>0?" "+c:c);continue}x=!1}const v=i(h).join(":"),w=m?v+F0:v,S=w+y;if(o.includes(S))continue;o.push(S);const T=a(y,x);for(let k=0;k<T.length;++k){const C=T[k];o.push(w+C)}c=d+(c.length>0?" "+c:c)}return c};function FM(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=h5(t))&&(n&&(n+=" "),n+=r);return n}const h5=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=h5(e[n]))&&(r&&(r+=" "),r+=t);return r};function zM(e,...t){let r,n,a,i=o;function o(c){const u=t.reduce((d,p)=>p(d),e());return r=OM(u),n=r.cache.get,a=r.cache.set,i=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=PM(c,r);return a(c,d),d}return function(){return i(FM.apply(null,arguments))}}const qt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},f5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,g5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,BM=/^\d+\/\d+$/,$M=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,UM=/\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$/,GM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,HM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ha=e=>BM.test(e),ot=e=>!!e&&!Number.isNaN(Number(e)),zn=e=>!!e&&Number.isInteger(Number(e)),Nc=e=>e.endsWith("%")&&ot(e.slice(0,-1)),yn=e=>$M.test(e),VM=()=>!0,WM=e=>UM.test(e)&&!GM.test(e),b5=()=>!1,KM=e=>qM.test(e),YM=e=>HM.test(e),ZM=e=>!Ue(e)&&!Ge(e),XM=e=>Ii(e,v5,b5),Ue=e=>f5.test(e),ha=e=>Ii(e,k5,WM),Cc=e=>Ii(e,rO,ot),by=e=>Ii(e,x5,b5),JM=e=>Ii(e,y5,YM),Ws=e=>Ii(e,w5,KM),Ge=e=>g5.test(e),Gi=e=>ji(e,k5),QM=e=>ji(e,nO),xy=e=>ji(e,x5),eO=e=>ji(e,v5),tO=e=>ji(e,y5),Ks=e=>ji(e,w5,!0),Ii=(e,t,r)=>{const n=f5.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},ji=(e,t,r=!1)=>{const n=g5.exec(e);return n?n[1]?t(n[1]):r:!1},x5=e=>e==="position"||e==="percentage",y5=e=>e==="image"||e==="url",v5=e=>e==="length"||e==="size"||e==="bg-size",k5=e=>e==="length",rO=e=>e==="number",nO=e=>e==="family-name",w5=e=>e==="shadow",aO=()=>{const e=qt("color"),t=qt("font"),r=qt("text"),n=qt("font-weight"),a=qt("tracking"),i=qt("leading"),o=qt("breakpoint"),l=qt("container"),c=qt("spacing"),u=qt("radius"),d=qt("shadow"),p=qt("inset-shadow"),h=qt("text-shadow"),m=qt("drop-shadow"),g=qt("blur"),b=qt("perspective"),x=qt("aspect"),y=qt("ease"),v=qt("animate"),w=()=>["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"],T=()=>[...S(),Ge,Ue],k=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],A=()=>[Ge,Ue,c],N=()=>[Ha,"full","auto",...A()],I=()=>[zn,"none","subgrid",Ge,Ue],D=()=>["auto",{span:["full",zn,Ge,Ue]},zn,Ge,Ue],j=()=>[zn,"auto",Ge,Ue],F=()=>["auto","min","max","fr",Ge,Ue],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...A()],V=()=>[Ha,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],K=()=>[e,Ge,Ue],q=()=>[...S(),xy,by,{position:[Ge,Ue]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",eO,XM,{size:[Ge,Ue]}],M=()=>[Nc,Gi,ha],P=()=>["","none","full",u,Ge,Ue],Y=()=>["",ot,Gi,ha],Z=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[ot,Nc,xy,by],pe=()=>["","none",g,Ge,Ue],de=()=>["none",ot,Ge,Ue],be=()=>["none",ot,Ge,Ue],ke=()=>[ot,Ge,Ue],we=()=>[Ha,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yn],breakpoint:[yn],color:[VM],container:[yn],"drop-shadow":[yn],ease:["in","out","in-out"],font:[ZM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yn],shadow:[yn],spacing:["px",ot],text:[yn],"text-shadow":[yn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ha,Ue,Ge,x]}],container:["container"],columns:[{columns:[ot,Ue,Ge,l]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:T()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{start:N()}],end:[{end:N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[zn,"auto",Ge,Ue]}],basis:[{basis:[Ha,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ot,Ha,"auto","initial","none",Ue]}],grow:[{grow:["",ot,Ge,Ue]}],shrink:[{shrink:["",ot,Ge,Ue]}],order:[{order:[zn,"first","last","none",Ge,Ue]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[l,"screen",...V()]}],"min-w":[{"min-w":[l,"screen","none",...V()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",r,Gi,ha]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Ge,Cc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nc,Ue]}],"font-family":[{font:[QM,Ue,t]}],"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:[a,Ge,Ue]}],"line-clamp":[{"line-clamp":[ot,"none",Ge,Cc]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",Ge,Ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,Ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[ot,"from-font","auto",Ge,ha]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[ot,"auto",Ge,Ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,Ue]}],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",Ge,Ue]}],"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:O()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},zn,Ge,Ue],radial:["",Ge,Ue],conic:[zn,Ge,Ue]},tO,JM]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:M()}],"gradient-via-pos":[{via:M()}],"gradient-to-pos":[{to:M()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ot,Ge,Ue]}],"outline-w":[{outline:["",ot,Gi,ha]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",d,Ks,Ws]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",p,Ks,Ws]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[ot,ha]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",h,Ks,Ws]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[ot,Ge,Ue]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"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":[ot]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[Ge,Ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"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":[ot]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,Ue]}],filter:[{filter:["","none",Ge,Ue]}],blur:[{blur:pe()}],brightness:[{brightness:[ot,Ge,Ue]}],contrast:[{contrast:[ot,Ge,Ue]}],"drop-shadow":[{"drop-shadow":["","none",m,Ks,Ws]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",ot,Ge,Ue]}],"hue-rotate":[{"hue-rotate":[ot,Ge,Ue]}],invert:[{invert:["",ot,Ge,Ue]}],saturate:[{saturate:[ot,Ge,Ue]}],sepia:[{sepia:["",ot,Ge,Ue]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,Ue]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[ot,Ge,Ue]}],"backdrop-contrast":[{"backdrop-contrast":[ot,Ge,Ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ot,Ge,Ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ot,Ge,Ue]}],"backdrop-invert":[{"backdrop-invert":["",ot,Ge,Ue]}],"backdrop-opacity":[{"backdrop-opacity":[ot,Ge,Ue]}],"backdrop-saturate":[{"backdrop-saturate":[ot,Ge,Ue]}],"backdrop-sepia":[{"backdrop-sepia":["",ot,Ge,Ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,Ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ot,"initial",Ge,Ue]}],ease:[{ease:["linear","initial",y,Ge,Ue]}],delay:[{delay:[ot,Ge,Ue]}],animate:[{animate:["none",v,Ge,Ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ge,Ue]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:ke()}],"skew-x":[{"skew-x":ke()}],"skew-y":[{"skew-y":ke()}],transform:[{transform:[Ge,Ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:we()}],"translate-x":[{"translate-x":we()}],"translate-y":[{"translate-y":we()}],"translate-z":[{"translate-z":we()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"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",Ge,Ue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Ge,Ue]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[ot,Gi,ha,Cc]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},iO=zM(aO);function ve(...e){return iO(p5(e))}function sO(e){if(!e||typeof e!="string")return null;try{return JSON.parse(e)}catch{return null}}const oO=Zg("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}}),S5=f.forwardRef(({className:e,variant:t,...r},n)=>s.jsx("div",{ref:n,role:"alert","data-slot":"alert",className:ve(oO({variant:t}),e),...r}));S5.displayName="Alert";const lO=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-slot":"alert-title",className:ve("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t}));lO.displayName="AlertTitle";const cO=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-slot":"alert-description",className:ve("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t}));cO.displayName="AlertDescription";const uO=Zg("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Xn({className:e,variant:t,...r}){return s.jsx("div",{className:ve(uO({variant:t}),e),...r})}const dO=Zg("inline-flex touch-manipulation items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 active:bg-primary/80",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 active:bg-destructive/80",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground active:bg-accent/80",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 active:bg-secondary/70",ghost:"hover:bg-accent hover:text-accent-foreground active:bg-accent/80",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3 text-sm",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Be=f.forwardRef(({className:e,variant:t,size:r,...n},a)=>s.jsx("button",{className:ve(dO({variant:t,size:r,className:e})),ref:a,...n}));Be.displayName="Button";const E5=f.createContext(null),N5=()=>{const e=f.useContext(E5);if(!e)throw new Error("Confirmation components must be used within Confirmation");return e},C5=({className:e,approval:t="pending",children:r,...n})=>{const a=f.useMemo(()=>({approval:t}),[t]);return s.jsx(E5.Provider,{value:a,children:s.jsx(S5,{className:ve("flex flex-col gap-2",e),...n,children:r})})};C5.displayName="Confirmation";const T5=({className:e,...t})=>s.jsx("div",{"data-slot":"confirmation-title",className:ve("text-muted-foreground inline text-sm",e),...t});T5.displayName="ConfirmationTitle";const A5=({children:e})=>{const{approval:t}=N5();return t!=="pending"?null:s.jsx(s.Fragment,{children:e})};A5.displayName="ConfirmationRequest";const I5=({className:e,...t})=>{const{approval:r}=N5();return r!=="pending"?null:s.jsx("div",{"data-slot":"confirmation-actions",className:ve("flex items-center justify-end gap-2 self-end",e),...t})};I5.displayName="ConfirmationActions";const Mo=({variant:e="default",...t})=>s.jsx(Be,{className:"h-8 px-3 text-sm",variant:e,type:"button",...t});Mo.displayName="ConfirmationAction";const Jg=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ve("rounded-xl border bg-card text-card-foreground shadow-sm",e),...t}));Jg.displayName="Card";const j5=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ve("flex flex-col space-y-1.5 p-4",e),...t}));j5.displayName="CardHeader";const R5=f.forwardRef(({className:e,...t},r)=>s.jsx("h3",{ref:r,className:ve("font-semibold leading-none tracking-tight",e),...t}));R5.displayName="CardTitle";const pO=f.forwardRef(({className:e,...t},r)=>s.jsx("p",{ref:r,className:ve("text-sm text-muted-foreground",e),...t}));pO.displayName="CardDescription";const _5=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ve("p-4 pt-0",e),...t}));_5.displayName="CardContent";const D5=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ve("flex items-center p-4 pt-0",e),...t}));D5.displayName="CardFooter";const mO=f.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ve("ml-auto shrink-0",e),...t}));mO.displayName="CardAction";const M5=f.createContext(null);function O5(){const e=f.useContext(M5);if(!e)throw new Error("Collapsible components must be used within <Collapsible>");return e}const Na=f.forwardRef(({defaultOpen:e=!1,open:t,onOpenChange:r,className:n,children:a,...i},o)=>{const[l,c]=f.useState(e),u=t!==void 0,d=u?t:l,p=f.useCallback(m=>{u||c(m),r?.(m)},[u,r]),h=f.useMemo(()=>({open:d,onOpenChange:p}),[d,p]);return s.jsx(M5.Provider,{value:h,children:s.jsx("div",{ref:o,"data-state":d?"open":"closed",className:n,...i,children:a})})});Na.displayName="Collapsible";const ra=f.forwardRef(({onClick:e,children:t,className:r,...n},a)=>{const{open:i,onOpenChange:o}=O5(),l=f.useCallback(c=>{o(!i),e?.(c)},[i,o,e]);return s.jsx("button",{ref:a,type:"button","aria-expanded":i,"data-state":i?"open":"closed",onClick:l,className:r,...n,children:t})});ra.displayName="CollapsibleTrigger";const Ca=f.forwardRef(({className:e,children:t,...r},n)=>{const{open:a}=O5();return s.jsx("div",{ref:n,"data-state":a?"open":"closed",className:ve("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),...r,children:s.jsx("div",{className:"overflow-hidden",children:t})})});Ca.displayName="CollapsibleContent";var yy=1,hO=.9,fO=.8,gO=.17,Tc=.1,Ac=.999,bO=.9999,xO=.99,yO=/[\\\/_+.#"@\[\(\{&]/,vO=/[\\\/_+.#"@\[\(\{&]/g,kO=/[\s-]/,L5=/[\s-]/g;function B0(e,t,r,n,a,i,o){if(i===t.length)return a===e.length?yy:xO;var l=`${a},${i}`;if(o[l]!==void 0)return o[l];for(var c=n.charAt(i),u=r.indexOf(c,a),d=0,p,h,m,g;u>=0;)p=B0(e,t,r,n,u+1,i+1,o),p>d&&(u===a?p*=yy:yO.test(e.charAt(u-1))?(p*=fO,m=e.slice(a,u-1).match(vO),m&&a>0&&(p*=Math.pow(Ac,m.length))):kO.test(e.charAt(u-1))?(p*=hO,g=e.slice(a,u-1).match(L5),g&&a>0&&(p*=Math.pow(Ac,g.length))):(p*=gO,a>0&&(p*=Math.pow(Ac,u-a))),e.charAt(u)!==t.charAt(i)&&(p*=bO)),(p<Tc&&r.charAt(u-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(u-1)!==n.charAt(i))&&(h=B0(e,t,r,n,u+1,i+2,o),h*Tc>p&&(p=h*Tc)),p>d&&(d=p),u=r.indexOf(c,u+1);return o[l]=d,d}function vy(e){return e.toLowerCase().replace(L5," ")}function wO(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,B0(e,t,vy(e),vy(t),0,0,{})}function Jn(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),r===!1||!a.defaultPrevented)return t?.(a)}}function ky(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function na(...e){return t=>{let r=!1;const n=e.map(a=>{const i=ky(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():ky(e[a],null)}}}}function Ma(...e){return f.useCallback(na(...e),e)}function SO(e,t){const r=f.createContext(t),n=i=>{const{children:o,...l}=i,c=f.useMemo(()=>l,Object.values(l));return s.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function a(i){const o=f.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function EO(e,t=[]){let r=[];function n(i,o){const l=f.createContext(o),c=r.length;r=[...r,o];const u=p=>{const{scope:h,children:m,...g}=p,b=h?.[e]?.[c]||l,x=f.useMemo(()=>g,Object.values(g));return s.jsx(b.Provider,{value:x,children:m})};u.displayName=i+"Provider";function d(p,h){const m=h?.[e]?.[c]||l,g=f.useContext(m);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[u,d]}const a=()=>{const i=r.map(o=>f.createContext(o));return function(l){const c=l?.[e]||i;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,NO(a,...t)]}function NO(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const p=c(i)[`__scope${u}`];return{...l,...p}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var vs=globalThis?.document?f.useLayoutEffect:()=>{},CO=Dg[" useId ".trim().toString()]||(()=>{}),TO=0;function An(e){const[t,r]=f.useState(CO());return vs(()=>{r(n=>n??String(TO++))},[e]),t?`radix-${t}`:""}var AO=Dg[" useInsertionEffect ".trim().toString()]||vs;function IO({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,i,o]=jO({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:a;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const p=d.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,n])}const u=f.useCallback(d=>{if(l){const p=RO(d)?d(e):d;p!==e&&o.current?.(p)}else i(d)},[l,e,i,o]);return[c,u]}function jO({defaultProp:e,onChange:t}){const[r,n]=f.useState(e),a=f.useRef(r),i=f.useRef(t);return AO(()=>{i.current=t},[t]),f.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}function RO(e){return typeof e=="function"}function Ms(e){const t=_O(e),r=f.forwardRef((n,a)=>{const{children:i,...o}=n,l=f.Children.toArray(i),c=l.find(MO);if(c){const u=c.props.children,d=l.map(p=>p===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:p);return s.jsx(t,{...o,ref:a,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function _O(e){const t=f.forwardRef((r,n)=>{const{children:a,...i}=r;if(f.isValidElement(a)){const o=LO(a),l=OO(i,a.props);return a.type!==f.Fragment&&(l.ref=n?na(n,o):o),f.cloneElement(a,l)}return f.Children.count(a)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DO=Symbol("radix.slottable");function MO(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DO}function OO(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function LO(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var PO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],P5=PO.reduce((e,t)=>{const r=Ms(`Primitive.${t}`),n=f.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function FO(e,t){e&&Il.flushSync(()=>e.dispatchEvent(t))}function ks(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>t.current?.(...r),[])}function zO(e,t=globalThis?.document){const r=ks(e);f.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var BO="DismissableLayer",$0="dismissableLayer.update",$O="dismissableLayer.pointerDownOutside",UO="dismissableLayer.focusOutside",wy,F5=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),z5=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=f.useContext(F5),[d,p]=f.useState(null),h=d?.ownerDocument??globalThis?.document,[,m]=f.useState({}),g=Ma(t,C=>p(C)),b=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(x),v=d?b.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=v>=y,T=HO(C=>{const A=C.target,N=[...u.branches].some(I=>I.contains(A));!S||N||(a?.(C),o?.(C),C.defaultPrevented||l?.())},h),k=VO(C=>{const A=C.target;[...u.branches].some(I=>I.contains(A))||(i?.(C),o?.(C),C.defaultPrevented||l?.())},h);return zO(C=>{v===u.layers.size-1&&(n?.(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},h),f.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wy=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Sy(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=wy)}},[d,h,r,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Sy())},[d,u]),f.useEffect(()=>{const C=()=>m({});return document.addEventListener($0,C),()=>document.removeEventListener($0,C)},[]),s.jsx(P5.div,{...c,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Jn(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Jn(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Jn(e.onPointerDownCapture,T.onPointerDownCapture)})});z5.displayName=BO;var GO="DismissableLayerBranch",qO=f.forwardRef((e,t)=>{const r=f.useContext(F5),n=f.useRef(null),a=Ma(t,n);return f.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),s.jsx(P5.div,{...e,ref:a})});qO.displayName=GO;function HO(e,t=globalThis?.document){const r=ks(e),n=f.useRef(!1),a=f.useRef(()=>{});return f.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){B5($O,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function VO(e,t=globalThis?.document){const r=ks(e),n=f.useRef(!1);return f.useEffect(()=>{const a=i=>{i.target&&!n.current&&B5(UO,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Sy(){const e=new CustomEvent($0);document.dispatchEvent(e)}function B5(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?FO(a,i):a.dispatchEvent(i)}var WO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],KO=WO.reduce((e,t)=>{const r=Ms(`Primitive.${t}`),n=f.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ic="focusScope.autoFocusOnMount",jc="focusScope.autoFocusOnUnmount",Ey={bubbles:!1,cancelable:!0},YO="FocusScope",$5=f.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=f.useState(null),u=ks(a),d=ks(i),p=f.useRef(null),h=Ma(t,b=>c(b)),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(n){let b=function(w){if(m.paused||!l)return;const S=w.target;l.contains(S)?p.current=S:Hn(p.current,{select:!0})},x=function(w){if(m.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||Hn(p.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&Hn(l)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const v=new MutationObserver(y);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),v.disconnect()}}},[n,l,m.paused]),f.useEffect(()=>{if(l){Cy.add(m);const b=document.activeElement;if(!l.contains(b)){const y=new CustomEvent(Ic,Ey);l.addEventListener(Ic,u),l.dispatchEvent(y),y.defaultPrevented||(ZO(t9(U5(l)),{select:!0}),document.activeElement===b&&Hn(l))}return()=>{l.removeEventListener(Ic,u),setTimeout(()=>{const y=new CustomEvent(jc,Ey);l.addEventListener(jc,d),l.dispatchEvent(y),y.defaultPrevented||Hn(b??document.body,{select:!0}),l.removeEventListener(jc,d),Cy.remove(m)},0)}}},[l,u,d,m]);const g=f.useCallback(b=>{if(!r&&!n||m.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,y=document.activeElement;if(x&&y){const v=b.currentTarget,[w,S]=XO(v);w&&S?!b.shiftKey&&y===S?(b.preventDefault(),r&&Hn(w,{select:!0})):b.shiftKey&&y===w&&(b.preventDefault(),r&&Hn(S,{select:!0})):y===v&&b.preventDefault()}},[r,n,m.paused]);return s.jsx(KO.div,{tabIndex:-1,...o,ref:h,onKeyDown:g})});$5.displayName=YO;function ZO(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Hn(n,{select:t}),document.activeElement!==r)return}function XO(e){const t=U5(e),r=Ny(t,e),n=Ny(t.reverse(),e);return[r,n]}function U5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ny(e,t){for(const r of e)if(!JO(r,{upTo:t}))return r}function JO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function QO(e){return e instanceof HTMLInputElement&&"select"in e}function Hn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&QO(e)&&t&&e.select()}}var Cy=e9();function e9(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Ty(e,t),e.unshift(t)},remove(t){e=Ty(e,t),e[0]?.resume()}}}function Ty(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function t9(e){return e.filter(t=>t.tagName!=="A")}var r9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],n9=r9.reduce((e,t)=>{const r=Ms(`Primitive.${t}`),n=f.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),a9="Portal",G5=f.forwardRef((e,t)=>{const{container:r,...n}=e,[a,i]=f.useState(!1);vs(()=>i(!0),[]);const o=r||a&&globalThis?.document?.body;return o?Qi.createPortal(s.jsx(n9.div,{...n,ref:t}),o):null});G5.displayName=a9;function i9(e,t){return f.useReducer((r,n)=>t[r][n]??r,e)}var zl=e=>{const{present:t,children:r}=e,n=s9(t),a=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),i=Ma(n.ref,o9(a));return typeof r=="function"||n.isPresent?f.cloneElement(a,{ref:i}):null};zl.displayName="Presence";function s9(e){const[t,r]=f.useState(),n=f.useRef(null),a=f.useRef(e),i=f.useRef("none"),o=e?"mounted":"unmounted",[l,c]=i9(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=Ys(n.current);i.current=l==="mounted"?u:"none"},[l]),vs(()=>{const u=n.current,d=a.current;if(d!==e){const h=i.current,m=Ys(u);e?c("MOUNT"):m==="none"||u?.display==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),vs(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,p=m=>{const b=Ys(n.current).includes(CSS.escape(m.animationName));if(m.target===t&&b&&(c("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=m=>{m.target===t&&(i.current=Ys(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Ys(e){return e?.animationName||"none"}function o9(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var l9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Os=l9.reduce((e,t)=>{const r=Ms(`Primitive.${t}`),n=f.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Rc=0;function c9(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ay()),document.body.insertAdjacentElement("beforeend",e[1]??Ay()),Rc++,()=>{Rc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rc--}},[])}function Ay(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ln=function(){return ln=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},ln.apply(this,arguments)};function q5(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function Oa(e,t,r,n){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(d){try{u(n.next(d))}catch(p){o(p)}}function c(d){try{u(n.throw(d))}catch(p){o(p)}}function u(d){d.done?i(d.value):a(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}function u9(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var Oo="right-scroll-bar-position",Lo="width-before-scroll-bar",d9="with-scroll-bars-hidden",p9="--removed-body-scroll-bar-size";function _c(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function m9(e,t){var r=f.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=t,r.facade}var h9=typeof window<"u"?f.useLayoutEffect:f.useEffect,Iy=new WeakMap;function f9(e,t){var r=m9(null,function(n){return e.forEach(function(a){return _c(a,n)})});return h9(function(){var n=Iy.get(r);if(n){var a=new Set(n),i=new Set(e),o=r.current;a.forEach(function(l){i.has(l)||_c(l,null)}),i.forEach(function(l){a.has(l)||_c(l,o)})}Iy.set(r,e)},[e]),r}function g9(e){return e}function b9(e,t){t===void 0&&(t=g9);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var o=t(i,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(i),o=r}var c=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),r}}}};return a}function x9(e){e===void 0&&(e={});var t=b9(null);return t.options=ln({async:!0,ssr:!1},e),t}var H5=function(e){var t=e.sideCar,r=q5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return f.createElement(n,ln({},r))};H5.isSideCarExport=!0;function y9(e,t){return e.useMedium(t),H5}var V5=x9(),Dc=function(){},Bl=f.forwardRef(function(e,t){var r=f.useRef(null),n=f.useState({onScrollCapture:Dc,onWheelCapture:Dc,onTouchMoveCapture:Dc}),a=n[0],i=n[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,m=e.noRelative,g=e.noIsolation,b=e.inert,x=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,w=e.gapMode,S=q5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,k=f9([r,t]),C=ln(ln({},S),a);return f.createElement(f.Fragment,null,d&&f.createElement(T,{sideCar:V5,removeScrollBar:u,shards:p,noRelative:m,noIsolation:g,inert:b,setCallbacks:i,allowPinchZoom:!!x,lockRef:r,gapMode:w}),o?f.cloneElement(f.Children.only(l),ln(ln({},C),{ref:k})):f.createElement(v,ln({},C,{className:c,ref:k}),l))});Bl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bl.classNames={fullWidth:Lo,zeroRight:Oo};var v9=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function k9(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=v9();return t&&e.setAttribute("nonce",t),e}function w9(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function S9(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var E9=function(){var e=0,t=null;return{add:function(r){e==0&&(t=k9())&&(w9(t,r),S9(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},N9=function(){var e=E9();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},W5=function(){var e=N9(),t=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return t},C9={left:0,top:0,right:0,gap:0},Mc=function(e){return parseInt(e||"",10)||0},T9=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Mc(r),Mc(n),Mc(a)]},A9=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return C9;var t=T9(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},I9=W5(),hi="data-scroll-locked",j9=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),`
720
720
  .`.concat(d9,` {
721
721
  overflow: hidden `).concat(n,`;
722
722
  padding-right: `).concat(l,"px ").concat(n,`;
@@ -1343,4 +1343,4 @@ https://github.com/nodeca/pako/blob/main/LICENSE
1343
1343
  "Lütfen Cloudinary kullanarak kullanıcı profil resmi yükleme özelliği için yeni bir görev ekle, en iyi yaklaşımı araştır."`},moreExamples:"Daha fazla örnek ve kullanım deseni →",proTips:{title:"💡 Pro İpuçları",search:"Belirli görevleri hızlıca bulmak için arama çubuğunu kullan",views:"Kanban, Liste ve Izgara görünümleri arasında geçiş yapmak için görünüm düğmelerini kullan",filters:"Belirli görev durumlarına veya önceliklere odaklanmak için filtreleri kullan",details:"Detaylı bilgi görmek ve alt görevleri yönetmek için herhangi bir göreve tıkla"},learnMore:{title:"📚 Daha Fazla Öğren",description:"TaskMaster AI, geliştiriciler için inşa edilmiş ileri seviye bir görev yönetim sistemidir. Dokümantasyona, örneklere bak ve projeye katkıda bulun.",githubButton:"GitHub'da Görüntüle"}},Uye={placeholder:"Görevlerde ara..."},Gye={button:"Filtreler",status:"Durum",priority:"Öncelik",sortBy:"Sıralama",allStatuses:"Tüm Durumlar",allPriorities:"Tüm Öncelikler",showing:"{{total}} görevin {{filtered}} tanesi gösteriliyor",clearFilters:"Filtreleri Temizle"},qye={id:"ID",status:"Durum",priority:"Öncelik",idAsc:"ID (Artan)",idDesc:"ID (Azalan)",titleAsc:"Başlık (A-Z)",titleDesc:"Başlık (Z-A)",statusAsc:"Durum (Önce Bekleyen)",statusDesc:"Durum (Önce Tamamlanan)",priorityAsc:"Öncelik (Önce Yüksek)",priorityDesc:"Öncelik (Önce Düşük)"},Hye={kanban:"Kanban görünümü",list:"Liste görünümü",grid:"Izgara görünümü"},Vye={pending:"📋 Yapılacak",inProgress:"🚀 Sürüyor",done:"✅ Tamamlandı",blocked:"🚫 Engellendi",deferred:"⏳ Ertelendi",cancelled:"❌ İptal Edildi",noTasksYet:"Henüz görev yok",tasksWillAppear:"Görevler burada görünecek",moveTasksHere:"Başlayan görevleri buraya taşı",completedTasksHere:"Tamamlanan görevler burada görünür",statusTasksHere:"Bu durumdaki görevler burada görünecek"},Wye={help:"TaskMaster Başlangıç Rehberi",prds:"PRD'ler",addPRD:"PRD Ekle",addTask:"Görev Ekle",createNewPRD:"Yeni PRD Oluştur",prdsAvailable:"{{count}} PRD mevcut"},Kye={modified:"Değişiklik: {{date}}"},Yye={pending:"Beklemede","in-progress":"Sürüyor",done:"Tamamlandı",blocked:"Engellendi",deferred:"Ertelendi",cancelled:"İptal Edildi"},Zye={high:"Yüksek",medium:"Orta",low:"Düşük"},Xye={title:"Filtrelerine uygun görev yok",description:"Arama veya filtre kriterlerini değiştirmeyi dene."},Jye={notConfigured:Fye,gettingStarted:zye,setupModal:Bye,helpGuide:$ye,search:Uye,filters:Gye,sort:qye,views:Hye,kanban:Vye,buttons:Wye,prd:Kye,statuses:Yye,priorities:Zye,noMatchingTasks:Xye},Qye={save:"Salva",cancel:"Annulla",delete:"Elimina",create:"Crea",edit:"Modifica",close:"Chiudi",confirm:"Conferma",submit:"Invia",retry:"Riprova",refresh:"Aggiorna",search:"Cerca",clear:"Cancella",copy:"Copia",download:"Scarica",upload:"Carica",browse:"Sfoglia"},eve={chat:"Chat",shell:"Terminale",files:"File",git:"Controllo Versione",tasks:"Attività"},tve={loading:"Caricamento...",success:"Completato",error:"Errore",failed:"Fallito",pending:"In attesa",completed:"Completato",inProgress:"In corso"},rve={savedSuccessfully:"Salvato con successo",deletedSuccessfully:"Eliminato con successo",updatedSuccessfully:"Aggiornato con successo",operationFailed:"Operazione fallita",networkError:"Errore di rete. Controlla la tua connessione.",unauthorized:"Non autorizzato. Effettua l'accesso.",notFound:"Non trovato",invalidInput:"Input non valido",requiredField:"Questo campo è obbligatorio",unknownError:"Si è verificato un errore sconosciuto"},nve={settings:"Impostazioni",home:"Home",back:"Indietro",next:"Avanti",previous:"Precedente",logout:"Esci"},ave={language:"Lingua",theme:"Tema",darkMode:"Modalità scura",lightMode:"Modalità chiara",name:"Nome",description:"Descrizione",enabled:"Abilitato",disabled:"Disabilitato",optional:"Opzionale",version:"Versione",select:"Seleziona",selectAll:"Seleziona tutto",deselectAll:"Deseleziona tutto"},ive={justNow:"Adesso",minutesAgo:"{{count}} min fa",hoursAgo:"{{count}} ore fa",daysAgo:"{{count}} giorni fa",yesterday:"Ieri"},sve={newFile:"Nuovo file",newFolder:"Nuova cartella",rename:"Rinomina",move:"Sposta",copyPath:"Copia percorso",openInEditor:"Apri nell'editor"},ove={loading:"Caricamento CloudCLI",settingUpWorkspace:"Preparazione dell'area di lavoro...",chooseProject:"Scegli il tuo progetto",selectProjectDescription:"Seleziona un progetto dalla barra laterale per iniziare a programmare con Claude. Ogni progetto contiene le tue sessioni di chat e la cronologia dei file.",tip:"Suggerimento",createProjectMobile:"Tocca il pulsante menu in alto per accedere ai progetti",createProjectDesktop:"Crea un nuovo progetto cliccando l'icona cartella nella barra laterale",newSession:"Nuova sessione",untitledSession:"Sessione senza titolo",projectFiles:"File del progetto"},lve={loading:"Caricamento file...",files:"File",simpleView:"Vista semplice",compactView:"Vista compatta",detailedView:"Vista dettagliata",searchPlaceholder:"Cerca file e cartelle...",clearSearch:"Cancella ricerca",name:"Nome",size:"Dimensione",modified:"Modificato",permissions:"Permessi",noFilesFound:"Nessun file trovato",checkProjectPath:"Verifica che il percorso del progetto sia accessibile",noMatchesFound:"Nessuna corrispondenza trovata",tryDifferentSearch:"Prova con un termine di ricerca diverso o cancella la ricerca",justNow:"adesso",minAgo:"{{count}} min fa",hoursAgo:"{{count}} ore fa",daysAgo:"{{count}} giorni fa",newFile:"Nuovo file (Cmd+N)",newFolder:"Nuova cartella (Cmd+Shift+N)",refresh:"Aggiorna",collapseAll:"Comprimi tutto",context:{rename:"Rinomina",delete:"Elimina",copyPath:"Copia percorso",download:"Scarica",newFile:"Nuovo file",newFolder:"Nuova cartella",refresh:"Aggiorna",menuLabel:"Menu contestuale file",loading:"Caricamento..."}},cve={title:"Crea nuovo progetto",steps:{type:"Tipo",configure:"Configura",confirm:"Conferma"},step1:{question:"Hai già un'area di lavoro o vuoi crearne una nuova?",existing:{title:"Area di lavoro esistente",description:"Ho già un'area di lavoro sul mio server e devo solo aggiungerla alla lista dei progetti"},new:{title:"Nuova area di lavoro",description:"Crea una nuova area di lavoro, opzionalmente clonando da un repository GitHub"}},step2:{existingPath:"Percorso area di lavoro",newPath:"Percorso area di lavoro",existingPlaceholder:"/percorso/area-di-lavoro/esistente",newPlaceholder:"/percorso/nuova/area-di-lavoro",existingHelp:"Percorso completo della directory dell'area di lavoro esistente",newHelp:"Percorso completo della directory dell'area di lavoro",githubUrl:"URL GitHub (opzionale)",githubPlaceholder:"https://github.com/utente/repository",githubHelp:"Opzionale: fornisci un URL GitHub per clonare un repository",githubAuth:"Autenticazione GitHub (opzionale)",githubAuthHelp:"Richiesta solo per repository privati. I repository pubblici possono essere clonati senza autenticazione.",loadingTokens:"Caricamento token salvati...",storedToken:"Token salvato",newToken:"Nuovo token",nonePublic:"Nessuno (pubblico)",selectToken:"Seleziona token",selectTokenPlaceholder:"-- Seleziona un token --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"Questo token verrà utilizzato solo per questa operazione",publicRepoInfo:"I repository pubblici non richiedono autenticazione. Puoi saltare il token se stai clonando un repository pubblico.",noTokensHelp:"Nessun token salvato disponibile. Puoi aggiungere token in Impostazioni → Chiavi API per un riutilizzo più semplice.",optionalTokenPublic:"Token GitHub (opzionale per repository pubblici)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (lascia vuoto per repository pubblici)"},step3:{reviewConfig:"Rivedi la tua configurazione",existingWorkspace:"Area di lavoro esistente",newWorkspace:"Nuova area di lavoro",path:"Percorso:",cloneFrom:"Clona da:",authentication:"Autenticazione:",usingStoredToken:"Usando token salvato:",usingProvidedToken:"Usando token fornito",noAuthentication:"Nessuna autenticazione",sshKey:"Chiave SSH",existingInfo:"L'area di lavoro verrà aggiunta alla lista dei progetti e sarà disponibile per le sessioni Claude/Cursor.",newWithClone:"Il repository verrà clonato da questa cartella.",newEmpty:"L'area di lavoro verrà aggiunta alla lista dei progetti e sarà disponibile per le sessioni Claude/Cursor.",cloningRepository:"Clonazione repository..."},buttons:{cancel:"Annulla",back:"Indietro",next:"Avanti",createProject:"Crea progetto",creating:"Creazione...",cloning:"Clonazione..."},errors:{selectType:"Seleziona se hai un'area di lavoro esistente o vuoi crearne una nuova",providePath:"Fornisci un percorso per l'area di lavoro",failedToCreate:"Impossibile creare l'area di lavoro",failedToCreateFolder:"Impossibile creare la cartella"}},uve={genericTool:"uno strumento",codes:{generic:{info:{title:"Notifica"}},permission:{required:{title:"Azione richiesta",body:"{{toolName}} è in attesa della tua decisione."}},run:{stopped:{title:"Esecuzione interrotta",body:"Motivo: {{reason}}"},failed:{title:"Esecuzione fallita"}},agent:{notification:{title:"Notifica agente"}}}},dve={title:"Aggiornamento disponibile",newVersionReady:"Una nuova versione è pronta",currentVersion:"Versione attuale",latestVersion:"Ultima versione",whatsNew:"Novità:",viewFullRelease:"Vedi release completa",updateProgress:"Progresso aggiornamento:",manualUpgrade:"Aggiornamento manuale:",npmUpgradeCommand:"npm install -g @cloudcli-ai/cloudcli@latest",manualUpgradeHint:`Oppure clicca "Aggiorna ora" per eseguire l'aggiornamento automaticamente.`,updateCompleted:"Aggiornamento completato con successo!",restartServer:"Riavvia il server per applicare le modifiche.",updateFailed:"Aggiornamento fallito",buttons:{close:"Chiudi",later:"Più tardi",copyCommand:"Copia comando",updateNow:"Aggiorna ora",updating:"Aggiornamento..."},ariaLabels:{closeModal:"Chiudi finestra aggiornamento versione",showSidebar:"Mostra barra laterale",settings:"Impostazioni",updateAvailable:"Aggiornamento disponibile",closeSidebar:"Chiudi barra laterale"}},pve={buttons:Qye,tabs:eve,status:tve,messages:rve,navigation:nve,common:ave,time:ive,fileOperations:sve,mainContent:ove,fileTree:lve,projectWizard:cve,notifications:uve,versionUpdate:dve},mve="Impostazioni",hve={account:"Account",permissions:"Permessi",mcpServers:"Server MCP",appearance:"Aspetto"},fve={title:"Account",language:"Lingua",languageLabel:"Lingua dell'interfaccia",languageDescription:"Scegli la lingua preferita per l'interfaccia",username:"Nome utente",email:"Email",profile:"Profilo",changePassword:"Cambia password"},gve={title:"Server MCP",addServer:"Aggiungi server",editServer:"Modifica server",deleteServer:"Elimina server",serverName:"Nome server",serverType:"Tipo server",config:"Configurazione",testConnection:"Testa connessione",status:"Stato",connected:"Connesso",disconnected:"Disconnesso",scope:{label:"Ambito",user:"Utente",project:"Progetto"}},bve={title:"Aspetto",theme:"Tema",codeEditor:"Editor codice",editorTheme:"Tema editor",wordWrap:"A capo automatico",showMinimap:"Mostra minimappa",lineNumbers:"Numeri di riga",fontSize:"Dimensione carattere"},xve={saveChanges:"Salva modifiche",resetToDefaults:"Ripristina predefiniti",cancelChanges:"Annulla modifiche"},yve={title:"Impostazioni rapide",sections:{appearance:"Aspetto",toolDisplay:"Visualizzazione strumenti",viewOptions:"Opzioni visualizzazione",inputSettings:"Impostazioni input"},darkMode:"Modalità scura",autoExpandTools:"Espandi strumenti automaticamente",showRawParameters:"Mostra parametri grezzi",showThinking:"Mostra ragionamento",autoScrollToBottom:"Scorrimento automatico in basso",sendByCtrlEnter:"Invia con Ctrl+Invio",sendByCtrlEnterDescription:"Se abilitato, premere Ctrl+Invio invierà il messaggio invece di Invio. Utile per gli utenti IME per evitare invii accidentali.",dragHandle:{dragging:"Trascinamento maniglia",closePanel:"Chiudi pannello impostazioni",openPanel:"Apri pannello impostazioni",draggingStatus:"Trascinamento...",toggleAndMove:"Clicca per attivare/disattivare, trascina per spostare"}},vve={title:"Scorciatoie terminale",sectionKeys:"Tasti",sectionNavigation:"Navigazione",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"Freccia su",arrowDown:"Freccia giù",scrollDown:"Scorri giù",handle:{closePanel:"Chiudi pannello scorciatoie",openPanel:"Apri pannello scorciatoie"}},kve={label:"Impostazioni",agents:"Agenti",appearance:"Aspetto",git:"Git",apiTokens:"API e Token",tasks:"Attività",notifications:"Notifiche",plugins:"Plugin",about:"Informazioni"},wve={title:"Notifiche",description:"Controlla quali notifiche ricevere.",webPush:{title:"Notifiche push web",enable:"Abilita notifiche push",disable:"Disabilita notifiche push",enabled:"Le notifiche push sono abilitate",loading:"Aggiornamento...",unsupported:"Le notifiche push non sono supportate in questo browser.",denied:"Le notifiche push sono bloccate. Abilitale nelle impostazioni del browser."},events:{title:"Tipi di evento",actionRequired:"Azione richiesta",stop:"Esecuzione interrotta",error:"Esecuzione fallita"}},Sve={darkMode:{label:"Modalità scura",description:"Alterna tra tema chiaro e scuro"},projectSorting:{label:"Ordinamento progetti",description:"Come vengono ordinati i progetti nella barra laterale",alphabetical:"Alfabetico",recentActivity:"Attività recente"},codeEditor:{title:"Editor codice",theme:{label:"Tema editor",description:"Tema predefinito per l'editor di codice"},wordWrap:{label:"A capo automatico",description:"Abilita il ritorno a capo automatico nell'editor"},showMinimap:{label:"Mostra minimappa",description:"Visualizza una minimappa per facilitare la navigazione nella vista differenze"},lineNumbers:{label:"Mostra numeri di riga",description:"Visualizza i numeri di riga nell'editor"},fontSize:{label:"Dimensione carattere",description:"Dimensione del carattere dell'editor in pixel"}}},Eve={title:{add:"Aggiungi server MCP",edit:"Modifica server MCP"},importMode:{form:"Input modulo",json:"Importa JSON"},scope:{label:"Ambito",userGlobal:"Utente (globale)",projectLocal:"Progetto (locale)",userDescription:"Ambito utente: disponibile in tutti i progetti sulla tua macchina",projectDescription:"Ambito locale: disponibile solo nel progetto selezionato",cannotChange:"L'ambito non può essere modificato quando si modifica un server esistente"},fields:{serverName:"Nome server",transportType:"Tipo di trasporto",command:"Comando",arguments:"Argomenti (uno per riga)",jsonConfig:"Configurazione JSON",url:"URL",envVars:"Variabili d'ambiente (CHIAVE=valore, una per riga)",headers:"Header (CHIAVE=valore, uno per riga)",selectProject:"Seleziona un progetto..."},placeholders:{serverName:"mio-server"},validation:{missingType:"Campo obbligatorio mancante: type",stdioRequiresCommand:"Il tipo stdio richiede un campo command",httpRequiresUrl:"Il tipo {{type}} richiede un campo url",invalidJson:"Formato JSON non valido",jsonHelp:"Incolla la configurazione del server MCP in formato JSON. Esempi di formato:",jsonExampleStdio:'• stdio: {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse: {"type":"http","url":"https://api.example.com/mcp"}'},configDetails:"Dettagli configurazione (da {{configFile}})",projectPath:"Percorso: {{path}}",actions:{cancel:"Annulla",saving:"Salvataggio...",addServer:"Aggiungi server",updateServer:"Aggiorna server"}},Nve={success:"Impostazioni salvate con successo!",error:"Impossibile salvare le impostazioni",saving:"Salvataggio..."},Cve={save:"Salva impostazioni",cancel:"Annulla"},Tve={title:"Configurazione Git",description:"Configura la tua identità git per i commit. Queste impostazioni verranno applicate globalmente tramite git config --global",name:{label:"Nome Git",help:"Il tuo nome per i commit git"},email:{label:"Email Git",help:"La tua email per i commit git"},actions:{save:"Salva configurazione",saving:"Salvataggio..."},status:{success:"Salvato con successo"}},Ave={title:"Chiavi API",description:"Genera chiavi API per accedere all'API esterna da altre applicazioni.",newKey:{alertTitle:"⚠️ Salva la tua chiave API",alertMessage:"Questa è l'unica volta che vedrai questa chiave. Conservala in modo sicuro.",iveSavedIt:"L'ho salvata"},form:{placeholder:"Nome chiave API (es. Server produzione)",createButton:"Crea",cancelButton:"Annulla"},newButton:"Nuova chiave API",empty:"Nessuna chiave API creata.",list:{created:"Creata:",lastUsed:"Ultimo utilizzo:"},confirmDelete:"Sei sicuro di voler eliminare questa chiave API?",status:{active:"Attiva",inactive:"Inattiva"},github:{title:"Token GitHub",description:"Aggiungi token di accesso personale GitHub per clonare repository privati tramite l'API esterna.",descriptionAlt:"Aggiungi token di accesso personale GitHub per clonare repository privati. Puoi anche passare i token direttamente nelle richieste API senza salvarli.",addButton:"Aggiungi token",form:{namePlaceholder:"Nome token (es. Repository personali)",tokenPlaceholder:"Token di accesso personale GitHub (ghp_...)",descriptionPlaceholder:"Descrizione (opzionale)",addButton:"Aggiungi token",cancelButton:"Annulla",howToCreate:"Come creare un token di accesso personale GitHub →"},empty:"Nessun token GitHub aggiunto.",added:"Aggiunto:",confirmDelete:"Sei sicuro di voler eliminare questo token GitHub?"},apiDocsLink:"Documentazione API",documentation:{title:"Documentazione API esterna",description:"Scopri come usare l'API esterna per avviare sessioni Claude/Cursor dalle tue applicazioni.",viewLink:"Vedi documentazione API →"},loading:"Caricamento...",version:{updateAvailable:"Aggiornamento disponibile: v{{version}}"}},Ive={checking:"Verifica installazione TaskMaster...",notInstalled:{title:"TaskMaster AI CLI non installato",description:"TaskMaster CLI è necessario per usare le funzionalità di gestione attività. Installalo per iniziare:",installCommand:"npm install -g task-master-ai",viewOnGitHub:"Vedi su GitHub",afterInstallation:"Dopo l'installazione:",steps:{restart:"Riavvia questa applicazione",autoAvailable:"Le funzionalità TaskMaster saranno automaticamente disponibili",initCommand:"Usa task-master init nella directory del tuo progetto"}},settings:{enableLabel:"Abilita integrazione TaskMaster",enableDescription:"Mostra attività TaskMaster, banner e indicatori nella barra laterale nell'interfaccia"}},jve={authStatus:{checking:"Verifica...",connected:"Connesso",notConnected:"Non connesso",disconnected:"Disconnesso",checkingAuth:"Verifica stato autenticazione...",loggedInAs:"Connesso come {{email}}",authenticatedUser:"utente autenticato"},account:{claude:{description:"Assistente AI Anthropic Claude"},cursor:{description:"Editor di codice potenziato da AI Cursor"},codex:{description:"Assistente AI OpenAI Codex"},gemini:{description:"Assistente AI Google Gemini"}},connectionStatus:"Stato connessione",login:{title:"Accedi",reAuthenticate:"Ri-autenticati",description:"Accedi al tuo account {{agent}} per abilitare le funzionalità AI",reAuthDescription:"Accedi con un account diverso o aggiorna le credenziali",button:"Accedi",reLoginButton:"Ri-accedi"},error:"Errore: {{error}}"},Rve={title:"Impostazioni permessi",skipPermissions:{label:"Salta richieste di permesso (usa con cautela)",claudeDescription:"Equivalente al flag --dangerously-skip-permissions",cursorDescription:"Equivalente al flag -f in Cursor CLI"},allowedTools:{title:"Strumenti consentiti",description:"Strumenti automaticamente consentiti senza richiedere permesso",placeholder:'es. "Bash(git log:*)" o "Write"',quickAdd:"Aggiunta rapida strumenti comuni:",empty:"Nessuno strumento consentito configurato"},blockedTools:{title:"Strumenti bloccati",description:"Strumenti automaticamente bloccati senza richiedere permesso",placeholder:'es. "Bash(rm:*)"',empty:"Nessuno strumento bloccato configurato"},allowedCommands:{title:"Comandi shell consentiti",description:"Comandi shell automaticamente consentiti senza richiedere permesso",placeholder:'es. "Shell(ls)" o "Shell(git status)"',quickAdd:"Aggiunta rapida comandi comuni:",empty:"Nessun comando consentito configurato"},blockedCommands:{title:"Comandi shell bloccati",description:"Comandi shell automaticamente bloccati",placeholder:'es. "Shell(rm -rf)" o "Shell(sudo)"',empty:"Nessun comando bloccato configurato"},toolExamples:{title:"Esempi pattern strumenti:",bashGitLog:"- Consenti tutti i comandi git log",bashGitDiff:"- Consenti tutti i comandi git diff",write:"- Consenti tutti gli utilizzi dello strumento Write",bashRm:"- Blocca tutti i comandi rm (pericoloso)"},shellExamples:{title:"Esempi comandi shell:",ls:"- Consenti comando ls",gitStatus:"- Consenti git status",npmInstall:"- Consenti npm install",rmRf:"- Blocca eliminazione ricorsiva"},codex:{permissionMode:"Modalità permessi",description:"Controlla come Codex gestisce le modifiche ai file e l'esecuzione dei comandi",modes:{default:{title:"Predefinito",description:"Solo i comandi attendibili (ls, cat, grep, git status, ecc.) vengono eseguiti automaticamente. Gli altri comandi vengono saltati. Può scrivere nell'area di lavoro."},acceptEdits:{title:"Accetta modifiche",description:"Tutti i comandi vengono eseguiti automaticamente nell'area di lavoro. Modalità completamente automatica con esecuzione sandboxed."},bypassPermissions:{title:"Ignora permessi",description:"Accesso completo al sistema senza restrizioni. Tutti i comandi vengono eseguiti automaticamente con accesso completo a disco e rete. Usa con cautela."}},technicalDetails:"Dettagli tecnici",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted. Comandi attendibili: cat, cd, grep, head, ls, pwd, tail, git status/log/diff/show, find (senza -exec), ecc.",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never. Tutti i comandi vengono auto-eseguiti nella directory del progetto.",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never. Accesso completo al sistema, usa solo in ambienti attendibili.",overrideNote:"Puoi sovrascrivere questa impostazione per sessione usando il pulsante modalità nell'interfaccia chat."}},actions:{add:"Aggiungi"}},_ve={title:"Server MCP",description:{claude:"I server Model Context Protocol forniscono strumenti e fonti dati aggiuntive a Claude",cursor:"I server Model Context Protocol forniscono strumenti e fonti dati aggiuntive a Cursor",codex:"I server Model Context Protocol forniscono strumenti e fonti dati aggiuntive a Codex"},addButton:"Aggiungi server MCP",empty:"Nessun server MCP configurato",serverType:"Tipo",scope:{local:"locale",user:"utente"},config:{command:"Comando",url:"URL",args:"Argomenti",environment:"Ambiente"},tools:{title:"Strumenti",count:"({{count}}):",more:"+{{count}} altri"},actions:{edit:"Modifica server",delete:"Elimina server"},help:{title:"Informazioni su Codex MCP",description:"Codex supporta server MCP basati su stdio. Puoi aggiungere server che estendono le capacità di Codex con strumenti e risorse aggiuntive."}},Dve={title:"Plugin",description:"Estendi l'interfaccia con plugin personalizzati. Installa da git o inserisci una cartella in ~/.claude-code-ui/plugins/",installPlaceholder:"https://github.com/utente/mio-plugin",installButton:"Installa",installing:"Installazione…",securityWarning:"Installa solo plugin di cui hai verificato il codice sorgente o di autori di cui ti fidi.",scanningPlugins:"Scansione plugin…",noPluginsInstalled:"Nessun plugin installato",pullLatest:"Aggiorna da git",noGitRemote:"Nessun remote git — aggiornamento non disponibile",uninstallPlugin:"Disinstalla plugin",confirmUninstall:"Clicca di nuovo per confermare",confirmUninstallMessage:"Rimuovere {{name}}? Questa azione non può essere annullata.",cancel:"Annulla",remove:"Rimuovi",updateFailed:"Aggiornamento fallito",installFailed:"Installazione fallita",uninstallFailed:"Disinstallazione fallita",toggleFailed:"Attivazione/disattivazione fallita",starterPluginLabel:"Plugin iniziale",starter:"Iniziale",docs:"Documentazione",starterPlugin:{name:"Statistiche progetto",badge:"iniziale",description:"Conteggio file, righe di codice, ripartizione per tipo di file e attività recente per il tuo progetto.",install:"Installa"},terminalPlugin:{name:"Terminale",badge:"ufficiale",description:"Terminale integrato con accesso completo alla shell direttamente nell'interfaccia.",install:"Installa"},morePlugins:"Altri",enable:"Abilita",disable:"Disabilita",installAriaLabel:"URL repository git del plugin",tab:"scheda",runningStatus:"in esecuzione"},Mve={title:mve,tabs:hve,account:fve,mcp:gve,appearance:bve,actions:xve,quickSettings:yve,terminalShortcuts:vve,mainTabs:kve,notifications:wve,appearanceSettings:Sve,mcpForm:Eve,saveStatus:Nve,footerActions:Cve,git:Tve,apiKeys:Ave,tasks:Ive,agents:jve,permissions:Rve,mcpServers:_ve,pluginSettings:Dve},Ove={title:"Bentornato",description:"Accedi al tuo account CloudCLI self-hosted",username:"Nome utente",password:"Password",submit:"Accedi",loading:"Accesso in corso...",errors:{invalidCredentials:"Nome utente o password non validi",requiredFields:"Compila tutti i campi",networkError:"Errore di rete. Riprova."},placeholders:{username:"Inserisci il tuo nome utente",password:"Inserisci la tua password"}},Lve={title:"Crea account",username:"Nome utente",password:"Password",confirmPassword:"Conferma password",submit:"Crea account",loading:"Creazione account...",errors:{passwordMismatch:"Le password non corrispondono",usernameTaken:"Nome utente già in uso",weakPassword:"La password è troppo debole"}},Pve={title:"Disconnetti",confirm:"Sei sicuro di volerti disconnettere?",button:"Disconnetti"},Fve={login:Ove,register:Lve,logout:Pve},zve={title:"Progetti",newProject:"Nuovo progetto",deleteProject:"Rimuovi progetto",renameProject:"Rinomina progetto",noProjects:"Nessun progetto trovato",loadingProjects:"Caricamento progetti...",searchPlaceholder:"Cerca progetti...",projectNamePlaceholder:"Nome progetto",starred:"Preferiti",all:"Tutti",untitledSession:"Sessione senza titolo",newSession:"Nuova sessione",codexSession:"Sessione Codex",fetchingProjects:"Recupero dei tuoi progetti e sessioni Claude",projects:"progetti",noMatchingProjects:"Nessun progetto corrispondente",tryDifferentSearch:"Prova a modificare il termine di ricerca",runClaudeCli:"Esegui Claude CLI in una directory di progetto per iniziare"},Bve={title:"CloudCLI",subtitle:"Interfaccia assistente di programmazione AI"},$ve={title:"Sessioni",newSession:"Nuova sessione",deleteSession:"Elimina sessione",renameSession:"Rinomina sessione",noSessions:"Nessuna sessione",loadingSessions:"Caricamento sessioni...",unnamed:"Senza nome",loading:"Caricamento...",showMore:"Mostra più sessioni"},Uve={viewEnvironments:"Visualizza ambienti",hideSidebar:"Nascondi barra laterale",createProject:"Crea nuovo progetto",refresh:"Aggiorna progetti e sessioni (Ctrl+R)",renameProject:"Rinomina progetto (F2)",deleteProject:"Rimuovi progetto dalla barra laterale (Canc)",addToFavorites:"Aggiungi ai preferiti",removeFromFavorites:"Rimuovi dai preferiti",editSessionName:"Modifica manualmente il nome della sessione",deleteSession:"Elimina questa sessione permanentemente",save:"Salva",cancel:"Annulla",clearSearch:"Cancella ricerca",openCommandPalette:"Apri tavolozza comandi"},Gve={chat:"Chat",files:"File",git:"Git",terminal:"Terminale",tasks:"Attività"},qve={refresh:"Aggiorna",settings:"Impostazioni",collapseAll:"Comprimi tutto",expandAll:"Espandi tutto",cancel:"Annulla",save:"Salva",delete:"Elimina",rename:"Rinomina",joinCommunity:"Unisciti alla community",reportIssue:"Segnala problema",starOnGithub:"Metti stella su GitHub"},Hve={openSource:"Open Source"},Vve={active:"Attivo",inactive:"Inattivo",thinking:"Sto pensando...",error:"Errore",aborted:"Interrotto",unknown:"Sconosciuto"},Wve={justNow:"Adesso",oneMinuteAgo:"1 min fa",minutesAgo:"{{count}} min fa",oneHourAgo:"1 ora fa",hoursAgo:"{{count}} ore fa",oneDayAgo:"1 giorno fa",daysAgo:"{{count}} giorni fa"},Kve={deleteConfirm:"Sei sicuro di voler eliminare questo elemento?",renameSuccess:"Rinominato con successo",deleteSuccess:"Eliminato con successo",errorOccurred:"Si è verificato un errore",deleteSessionConfirm:"Sei sicuro di voler eliminare questa sessione? Questa azione non può essere annullata.",deleteProjectConfirm:"Rimuovere questo progetto dalla barra laterale? I file del progetto, le memorie e i dati delle sessioni non verranno eliminati.",enterProjectPath:"Inserisci un percorso di progetto",deleteSessionFailed:"Impossibile eliminare la sessione. Riprova.",deleteSessionError:"Errore durante l'eliminazione della sessione. Riprova.",renameSessionFailed:"Impossibile rinominare la sessione. Riprova.",renameSessionError:"Errore durante la rinomina della sessione. Riprova.",deleteProjectFailed:"Impossibile rimuovere il progetto. Riprova.",deleteProjectError:"Errore durante la rimozione del progetto. Riprova.",createProjectFailed:"Impossibile creare il progetto. Riprova.",createProjectError:"Errore durante la creazione del progetto. Riprova."},Yve={updateAvailable:"Aggiornamento disponibile"},Zve={modeProjects:"Progetti",modeConversations:"Conversazioni",conversationsPlaceholder:"Cerca nelle conversazioni...",searching:"Ricerca in corso...",noResults:"Nessun risultato trovato",tryDifferentQuery:"Prova con una ricerca diversa",matches_one:"{{count}} corrispondenza",matches_other:"{{count}} corrispondenze",projectsScanned_one:"{{count}} progetto analizzato",projectsScanned_other:"{{count}} progetti analizzati"},Xve={deleteProject:"Rimuovi progetto",deleteSession:"Elimina sessione",confirmDelete:"Cosa vuoi fare con",sessionCount_one:"Questo progetto contiene {{count}} conversazione.",sessionCount_other:"Questo progetto contiene {{count}} conversazioni.",removeFromSidebar:"Rimuovi solo dalla barra laterale",deleteAllData:"Elimina tutti i dati permanentemente",allConversationsDeleted:"Il progetto verrà rimosso dalla barra laterale. I tuoi file, memorie e dati delle sessioni verranno preservati.",cannotUndo:"Puoi riaggiungerlo in seguito."},Jve={projects:zve,app:Bve,sessions:$ve,tooltips:Uve,navigation:Gve,actions:qve,branding:Hve,status:Vve,time:Wve,messages:Kve,version:Yve,search:Zve,deleteConfirmation:Xve},Qve={copy:"Copia",copied:"Copiato",copyCode:"Copia codice"},e1e={copy:"Copia messaggio",copied:"Messaggio copiato",selectFormat:"Seleziona formato copia",copyAsMarkdown:"Copia come markdown",copyAsText:"Copia come testo"},t1e={user:"U",error:"Errore",tool:"Strumento",claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini"},r1e={settings:"Impostazioni strumento",error:"Errore strumento",result:"Risultato strumento",viewParams:"Vedi parametri input",viewRawParams:"Vedi parametri grezzi",viewDiff:"Vedi differenze per",creatingFile:"Creazione nuovo file:",updatingTodo:"Aggiornamento lista attività",read:"Leggi",readFile:"Leggi file",updateTodo:"Aggiorna lista attività",readTodo:"Leggi lista attività",searchResults:"risultati"},n1e={found:"Trovati {{count}} {{type}}",file:"file",files:"file",pattern:"pattern:",in:"in:"},a1e={updated:"File aggiornato con successo",created:"File creato con successo",written:"File scritto con successo",diff:"Differenze",newFile:"Nuovo file",viewContent:"Vedi contenuto file",viewFullOutput:"Vedi output completo ({{count}} caratteri)",contentDisplayed:"Il contenuto del file è visualizzato nella vista differenze sopra"},i1e={title:"Prompt interattivo",waiting:"In attesa della tua risposta nella CLI",instruction:"Seleziona un'opzione nel terminale dove Claude è in esecuzione.",selectedOption:"✓ Claude ha selezionato l'opzione {{number}}",instructionDetail:"Nella CLI, selezioneresti questa opzione interattivamente usando i tasti freccia o digitando il numero."},s1e={title:"Sto pensando...",emoji:"💭 Sto pensando..."},o1e={response:"Risposta JSON"},l1e={grant:"Concedi permesso per {{tool}}",added:"Permesso aggiunto",addTo:"Aggiunge {{entry}} agli strumenti consentiti.",retry:"Permesso salvato. Riprova la richiesta per usare lo strumento.",error:"Impossibile aggiornare i permessi. Riprova.",openSettings:"Apri impostazioni"},c1e={updated:"Lista attività aggiornata con successo",current:"Lista attività corrente"},u1e={viewPlan:"📋 Vedi piano di implementazione",title:"Piano di implementazione"},d1e={resetAt:"Limite di utilizzo Claude raggiunto. Il tuo limite verrà ripristinato alle **{{time}} {{timezone}}** - {{date}}"},p1e={permissionMode:"Modalità permessi",modes:{default:"Modalità predefinita",auto:"Auto Mode",acceptEdits:"Accetta modifiche",bypassPermissions:"Ignora permessi",plan:"Modalità piano"},descriptions:{default:"Solo i comandi attendibili (ls, cat, grep, git status, ecc.) vengono eseguiti automaticamente. Gli altri comandi vengono saltati. Può scrivere nell'area di lavoro.",auto:"A model classifier decides per tool call whether to approve or deny. Hands-off, but safer than Bypass — denials still happen.",acceptEdits:"Tutti i comandi vengono eseguiti automaticamente nell'area di lavoro. Modalità completamente automatica con esecuzione sandboxed.",bypassPermissions:"Accesso completo al sistema senza restrizioni. Tutti i comandi vengono eseguiti automaticamente con accesso completo a disco e rete. Usa con cautela.",plan:"Modalità pianificazione - nessun comando viene eseguito"},technicalDetails:"Dettagli tecnici"},m1e={permissionMode:"Modalità permessi Gemini",description:"Controlla come Gemini CLI gestisce le approvazioni delle operazioni.",modes:{default:{title:"Standard (chiedi approvazione)",description:"Gemini chiederà l'approvazione prima di eseguire comandi, scrivere file e recuperare risorse web."},autoEdit:{title:"Modifica automatica (salta approvazioni file)",description:"Gemini approverà automaticamente modifiche ai file e recupero web, ma chiederà conferma per i comandi shell."},yolo:{title:"YOLO (ignora tutti i permessi)",description:"Gemini eseguirà tutte le operazioni senza chiedere approvazione. Usa con cautela."}}},h1e={placeholder:"Digita / per i comandi, @ per i file, o chiedi qualcosa a {{provider}}...",placeholderDefault:"Scrivi il tuo messaggio...",disabled:"Input disabilitato",attachFiles:"Allega file",attachImages:"Allega immagini",send:"Invia",stop:"Ferma",hintText:{ctrlEnter:"Ctrl+Invio per inviare • Shift+Invio per nuova riga • Tab per cambiare modalità • / per comandi",enter:"Invio per inviare • Shift+Invio per nuova riga • Tab per cambiare modalità • / per comandi"},clickToChangeMode:"Clicca per cambiare modalità permessi (o premi Tab nell'input)",showAllCommands:"Mostra tutti i comandi",clearInput:"Cancella input",scrollToBottom:"Scorri in basso"},f1e={selector:{title:"Modalità ragionamento",description:"Il ragionamento esteso dà a Claude più tempo per valutare le alternative",active:"Attivo",tip:"Modalità di ragionamento più elevate richiedono più tempo ma forniscono un'analisi più approfondita"},modes:{none:{name:"Standard",description:"Risposta Claude normale",prefix:""},think:{name:"Pensa",description:"Ragionamento esteso base",prefix:"think"},thinkHard:{name:"Pensa di più",description:"Valutazione più approfondita",prefix:"think hard"},thinkHarder:{name:"Pensa ancora",description:"Analisi profonda con alternative",prefix:"think harder"},ultrathink:{name:"Ultrapensiero",description:"Budget massimo di ragionamento",prefix:"ultrathink"}},buttonTitle:"Modalità ragionamento: {{mode}}"},g1e={title:"Scegli il tuo assistente AI",description:"Seleziona un provider per iniziare una nuova conversazione",selectModel:"Seleziona modello",providerInfo:{anthropic:"di Anthropic",openai:"di OpenAI",cursorEditor:"Editor codice AI",google:"di Google"},readyPrompt:{claude:"Pronto a usare Claude con {{model}}. Inizia a digitare il tuo messaggio qui sotto.",cursor:"Pronto a usare Cursor con {{model}}. Inizia a digitare il tuo messaggio qui sotto.",codex:"Pronto a usare Codex con {{model}}. Inizia a digitare il tuo messaggio qui sotto.",gemini:"Pronto a usare Gemini con {{model}}. Inizia a digitare il tuo messaggio qui sotto.",default:"Seleziona un provider sopra per iniziare"},pressToSearch:"Premi <kbd>{{shortcut}}</kbd> per cercare sessioni, file e commit"},b1e={continue:{title:"Continua la tua conversazione",description:"Fai domande sul tuo codice, richiedi modifiche o chiedi aiuto con le attività di sviluppo"},loading:{olderMessages:"Caricamento messaggi precedenti...",sessionMessages:"Caricamento messaggi della sessione..."},messages:{showingOf:"Visualizzati {{shown}} di {{total}} messaggi",scrollToLoad:"Scorri in alto per caricare altri",showingLast:"Visualizzati ultimi {{count}} messaggi ({{total}} totali)",loadEarlier:"Carica messaggi precedenti",loadAll:"Carica tutti i messaggi",loadingAll:"Caricamento di tutti i messaggi...",allLoaded:"Tutti i messaggi caricati",perfWarning:'Tutti i messaggi caricati — lo scorrimento potrebbe essere più lento. Clicca "Scorri in basso" per ripristinare le prestazioni.'}},x1e={selectProject:{title:"Seleziona un progetto",description:"Scegli un progetto per aprire una shell interattiva in quella directory"},status:{newSession:"Nuova sessione",initializing:"Inizializzazione...",restarting:"Riavvio..."},actions:{disconnect:"Disconnetti",disconnectTitle:"Disconnetti dalla shell",restart:"Riavvia",restartTitle:"Riavvia shell (disconnetti prima)",connect:"Continua nella shell",connectTitle:"Connetti alla shell"},loading:"Caricamento terminale...",connecting:"Connessione alla shell...",startSession:"Avvia una nuova sessione Claude",resumeSession:"Riprendi sessione: {{displayName}}...",runCommand:"Esegui {{command}} in {{projectName}}",startCli:"Avvio Claude CLI in {{projectName}}",defaultCommand:"comando"},y1e={actions:{thinking:"Ragionamento",processing:"Elaborazione",analyzing:"Analisi",working:"In lavorazione",computing:"Calcolo",reasoning:"Ragionamento"},state:{live:"Attivo",paused:"In pausa"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} trascorsi",startingNow:"Avvio in corso"},controls:{stopGeneration:"Interrompi generazione",pressEscToStop:"Premi Esc in qualsiasi momento per interrompere"},providers:{assistant:"Assistente"}},v1e={startChatWithProvider:"Seleziona un progetto per iniziare a chattare con {{provider}}"},k1e={nextTaskPrompt:"Inizia l'attività successiva"},w1e={codeBlock:Qve,copyMessage:e1e,messageTypes:t1e,tools:r1e,search:n1e,fileOperations:a1e,interactive:i1e,thinking:s1e,json:o1e,permissions:l1e,todo:c1e,plan:u1e,usageLimit:d1e,codex:p1e,gemini:m1e,input:h1e,thinkingMode:f1e,providerSelection:g1e,session:b1e,shell:x1e,claudeStatus:y1e,projectSelection:v1e,tasks:k1e},S1e={changes:"modifiche",previousChange:"Modifica precedente",nextChange:"Modifica successiva",hideDiff:"Nascondi evidenziazione differenze",showDiff:"Mostra evidenziazione differenze",settings:"Impostazioni editor",collapse:"Comprimi editor",expand:"Espandi editor a larghezza piena"},E1e="Caricamento {{fileName}}...",N1e={showingChanges:"Visualizzazione modifiche"},C1e={download:"Scarica file",save:"Salva",saving:"Salvataggio...",saved:"Salvato!",exitFullscreen:"Esci dalla modalità schermo intero",fullscreen:"Schermo intero",close:"Chiudi",previewMarkdown:"Anteprima markdown",editMarkdown:"Modifica markdown"},T1e={lines:"Righe:",characters:"Caratteri:",shortcuts:"Premi Ctrl+S per salvare • Esc per chiudere"},A1e={title:"File binario",message:`Il file "{{fileName}}" non può essere visualizzato nell'editor di testo perché è un file binario.`},I1e={toolbar:S1e,loading:E1e,header:N1e,actions:C1e,footer:T1e,binaryFile:A1e},j1e={title:"TaskMaster AI non è configurato",description:"TaskMaster aiuta a suddividere progetti complessi in attività gestibili con assistenza AI",whatIsTitle:"🎯 Cos'è TaskMaster?",features:{aiPowered:"Gestione attività AI: suddividi progetti complessi in sotto-attività gestibili",prdTemplates:"Template PRD: genera attività da documenti di requisiti del prodotto",dependencyTracking:"Tracciamento dipendenze: comprendi le relazioni tra attività e l'ordine di esecuzione",progressVisualization:"Visualizzazione progresso: board Kanban e analisi dettagliata delle attività",cliIntegration:"Integrazione CLI: usa i comandi taskmaster per flussi di lavoro avanzati"},initializeButton:"Inizializza TaskMaster AI"},R1e={title:"Inizia con TaskMaster",subtitle:"TaskMaster è inizializzato! Ecco cosa fare dopo:",steps:{createPRD:{title:"Crea un documento di requisiti del prodotto (PRD)",description:"Discuti la tua idea di progetto e crea un PRD che descriva cosa vuoi costruire.",addButton:"Aggiungi PRD",existingPRDs:"PRD esistenti:"},generateTasks:{title:"Genera attività dal PRD",description:"Una volta che hai un PRD, chiedi al tuo assistente AI di analizzarlo e TaskMaster lo suddividerà automaticamente in attività gestibili con dettagli di implementazione."},analyzeTasks:{title:"Analizza ed espandi le attività",description:"Chiedi al tuo assistente AI di analizzare la complessità delle attività ed espanderle in sotto-attività dettagliate per un'implementazione più semplice."},startBuilding:{title:"Inizia a costruire",description:"Chiedi al tuo assistente AI di iniziare a lavorare sulle attività, aggiornare il loro stato e aggiungere nuove attività man mano che il tuo progetto evolve."}},tip:"💡 Suggerimento: inizia con un PRD per ottenere il massimo dalla generazione di attività AI di TaskMaster"},_1e={title:"Configurazione TaskMaster",subtitle:"CLI interattiva per {{projectName}}",willStart:"L'inizializzazione di TaskMaster partirà automaticamente",completed:"Configurazione TaskMaster completata! Ora puoi chiudere questa finestra.",closeButton:"Chiudi",closeContinueButton:"Chiudi e continua"},D1e={title:"Inizia con TaskMaster",subtitle:"La tua guida per una gestione produttiva delle attività",examples:{parsePRD:`💬 Esempio:
1344
1344
  "Ho appena inizializzato un nuovo progetto con Claude Task Master. Ho un PRD in .taskmaster/docs/prd.txt. Puoi aiutarmi ad analizzarlo e configurare le attività iniziali?"`,expandTask:`💬 Esempio:
1345
1345
  "L'attività 5 sembra complessa. Puoi suddividerla in sotto-attività?"`,addTask:`💬 Esempio:
1346
- "Per favore aggiungi una nuova attività per implementare il caricamento delle immagini profilo utente usando Cloudinary, ricerca l'approccio migliore."`},moreExamples:"Vedi altri esempi e pattern di utilizzo →",proTips:{title:"💡 Suggerimenti pro",search:"Usa la barra di ricerca per trovare rapidamente attività specifiche",views:"Passa tra le viste Kanban, Lista e Griglia usando i selettori di vista",filters:"Usa i filtri per concentrarti su stati o priorità specifiche delle attività",details:"Clicca su qualsiasi attività per vedere informazioni dettagliate e gestire le sotto-attività"},learnMore:{title:"📚 Per saperne di più",description:"TaskMaster AI è un sistema avanzato di gestione attività pensato per sviluppatori. Trova documentazione, esempi e contribuisci al progetto.",githubButton:"Vedi su GitHub"}},M1e={placeholder:"Cerca attività..."},O1e={button:"Filtri",status:"Stato",priority:"Priorità",sortBy:"Ordina per",allStatuses:"Tutti gli stati",allPriorities:"Tutte le priorità",showing:"Visualizzate {{filtered}} di {{total}} attività",clearFilters:"Cancella filtri"},L1e={id:"ID",status:"Stato",priority:"Priorità",idAsc:"ID (crescente)",idDesc:"ID (decrescente)",titleAsc:"Titolo (A-Z)",titleDesc:"Titolo (Z-A)",statusAsc:"Stato (in attesa prima)",statusDesc:"Stato (completati prima)",priorityAsc:"Priorità (alta prima)",priorityDesc:"Priorità (bassa prima)"},P1e={kanban:"Vista Kanban",list:"Vista lista",grid:"Vista griglia"},F1e={pending:"📋 Da fare",inProgress:"🚀 In corso",done:"✅ Completate",blocked:"🚫 Bloccate",deferred:"⏳ Rimandate",cancelled:"❌ Annullate",noTasksYet:"Nessuna attività",tasksWillAppear:"Le attività appariranno qui",moveTasksHere:"Sposta le attività qui quando iniziate",completedTasksHere:"Le attività completate appariranno qui",statusTasksHere:"Le attività con questo stato appariranno qui"},z1e={help:"Guida introduttiva TaskMaster",prds:"PRD",addPRD:"Aggiungi PRD",addTask:"Aggiungi attività",createNewPRD:"Crea nuovo PRD",prdsAvailable:"{{count}} PRD disponibili"},B1e={modified:"Modificato: {{date}}"},$1e={pending:"In attesa","in-progress":"In corso",done:"Completata",blocked:"Bloccata",deferred:"Rimandata",cancelled:"Annullata"},U1e={high:"Alta",medium:"Media",low:"Bassa"},G1e={title:"Nessuna attività corrisponde ai filtri",description:"Prova a modificare la ricerca o i criteri di filtro."},q1e={notConfigured:j1e,gettingStarted:R1e,setupModal:_1e,helpGuide:D1e,search:M1e,filters:O1e,sort:L1e,views:P1e,kanban:F1e,buttons:z1e,prd:B1e,statuses:$1e,priorities:U1e,noMatchingTasks:G1e},H1e=()=>{try{const e=localStorage.getItem("userLanguage");return e&&Y0.some(t=>t.value===e)?e:"en"}catch{return"en"}};Qt.use(_I).use(i7).init({resources:{en:{common:tce,settings:Sce,auth:Tce,sidebar:$ce,chat:due,codeEditor:xue,tasks:Due},ko:{common:Wue,settings:fde,auth:yde,sidebar:_de,chat:tpe,codeEditor:lpe},"zh-CN":{common:wpe,settings:qpe,auth:Kpe,sidebar:lme,chat:Rme,codeEditor:Fme},ja:{common:Jme,settings:vhe,auth:Ehe,sidebar:Phe,chat:afe,codeEditor:dfe,tasks:Cfe},ru:{common:zfe,settings:s0e,auth:u0e,sidebar:E0e,chat:K0e,codeEditor:tge,tasks:gge},de:{common:Ige,settings:Zge,auth:ebe,sidebar:hbe,chat:Fbe,codeEditor:Hbe,tasks:sxe},tr:{common:vxe,settings:Uxe,auth:Vxe,sidebar:sye,chat:jye,codeEditor:Pye,tasks:Jye},it:{common:pve,settings:Mve,auth:Fve,sidebar:Jve,chat:w1e,codeEditor:I1e,tasks:q1e}},lng:H1e(),fallbackLng:"en",debug:!1,ns:["common","settings","auth","sidebar","chat","codeEditor","tasks"],defaultNS:"common",keySeparator:".",nsSeparator:":",saveMissing:!1,interpolation:{escapeValue:!1},react:{useSuspense:!0,bindI18n:"languageChanged",bindI18nStore:!1},detection:{order:["localStorage"],lookupLocalStorage:"userLanguage",caches:["localStorage"]}});Qt.on("languageChanged",e=>{try{localStorage.setItem("userLanguage",e)}catch(t){console.error("Failed to save language preference:",t)}});function V1e(){return s.jsx(h7,{i18n:Qt,children:s.jsx(f7,{children:s.jsx(v7,{children:s.jsx(JD,{children:s.jsx(aM,{children:s.jsx(nM,{children:s.jsx(rM,{children:s.jsx(YD,{children:s.jsx(lj,{basename:window.__ROUTER_BASENAME__||"",children:s.jsxs(cj,{children:[s.jsx(Cx,{path:"/",element:s.jsx(iC,{})}),s.jsx(Cx,{path:"/session/:sessionId",element:s.jsx(iC,{})})]})})})})})})})})})})}"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(e=>{console.warn("Service worker registration failed:",e)});fj.createRoot(document.getElementById("root")).render(s.jsx(Lr.StrictMode,{children:s.jsx(V1e,{})}));
1346
+ "Per favore aggiungi una nuova attività per implementare il caricamento delle immagini profilo utente usando Cloudinary, ricerca l'approccio migliore."`},moreExamples:"Vedi altri esempi e pattern di utilizzo →",proTips:{title:"💡 Suggerimenti pro",search:"Usa la barra di ricerca per trovare rapidamente attività specifiche",views:"Passa tra le viste Kanban, Lista e Griglia usando i selettori di vista",filters:"Usa i filtri per concentrarti su stati o priorità specifiche delle attività",details:"Clicca su qualsiasi attività per vedere informazioni dettagliate e gestire le sotto-attività"},learnMore:{title:"📚 Per saperne di più",description:"TaskMaster AI è un sistema avanzato di gestione attività pensato per sviluppatori. Trova documentazione, esempi e contribuisci al progetto.",githubButton:"Vedi su GitHub"}},M1e={placeholder:"Cerca attività..."},O1e={button:"Filtri",status:"Stato",priority:"Priorità",sortBy:"Ordina per",allStatuses:"Tutti gli stati",allPriorities:"Tutte le priorità",showing:"Visualizzate {{filtered}} di {{total}} attività",clearFilters:"Cancella filtri"},L1e={id:"ID",status:"Stato",priority:"Priorità",idAsc:"ID (crescente)",idDesc:"ID (decrescente)",titleAsc:"Titolo (A-Z)",titleDesc:"Titolo (Z-A)",statusAsc:"Stato (in attesa prima)",statusDesc:"Stato (completati prima)",priorityAsc:"Priorità (alta prima)",priorityDesc:"Priorità (bassa prima)"},P1e={kanban:"Vista Kanban",list:"Vista lista",grid:"Vista griglia"},F1e={pending:"📋 Da fare",inProgress:"🚀 In corso",done:"✅ Completate",blocked:"🚫 Bloccate",deferred:"⏳ Rimandate",cancelled:"❌ Annullate",noTasksYet:"Nessuna attività",tasksWillAppear:"Le attività appariranno qui",moveTasksHere:"Sposta le attività qui quando iniziate",completedTasksHere:"Le attività completate appariranno qui",statusTasksHere:"Le attività con questo stato appariranno qui"},z1e={help:"Guida introduttiva TaskMaster",prds:"PRD",addPRD:"Aggiungi PRD",addTask:"Aggiungi attività",createNewPRD:"Crea nuovo PRD",prdsAvailable:"{{count}} PRD disponibili"},B1e={modified:"Modificato: {{date}}"},$1e={pending:"In attesa","in-progress":"In corso",done:"Completata",blocked:"Bloccata",deferred:"Rimandata",cancelled:"Annullata"},U1e={high:"Alta",medium:"Media",low:"Bassa"},G1e={title:"Nessuna attività corrisponde ai filtri",description:"Prova a modificare la ricerca o i criteri di filtro."},q1e={notConfigured:j1e,gettingStarted:R1e,setupModal:_1e,helpGuide:D1e,search:M1e,filters:O1e,sort:L1e,views:P1e,kanban:F1e,buttons:z1e,prd:B1e,statuses:$1e,priorities:U1e,noMatchingTasks:G1e},H1e=()=>{try{const e=localStorage.getItem("userLanguage");return e&&Y0.some(t=>t.value===e)?e:"zh-CN"}catch{return"zh-CN"}};Qt.use(_I).use(i7).init({resources:{en:{common:tce,settings:Sce,auth:Tce,sidebar:$ce,chat:due,codeEditor:xue,tasks:Due},ko:{common:Wue,settings:fde,auth:yde,sidebar:_de,chat:tpe,codeEditor:lpe},"zh-CN":{common:wpe,settings:qpe,auth:Kpe,sidebar:lme,chat:Rme,codeEditor:Fme},ja:{common:Jme,settings:vhe,auth:Ehe,sidebar:Phe,chat:afe,codeEditor:dfe,tasks:Cfe},ru:{common:zfe,settings:s0e,auth:u0e,sidebar:E0e,chat:K0e,codeEditor:tge,tasks:gge},de:{common:Ige,settings:Zge,auth:ebe,sidebar:hbe,chat:Fbe,codeEditor:Hbe,tasks:sxe},tr:{common:vxe,settings:Uxe,auth:Vxe,sidebar:sye,chat:jye,codeEditor:Pye,tasks:Jye},it:{common:pve,settings:Mve,auth:Fve,sidebar:Jve,chat:w1e,codeEditor:I1e,tasks:q1e}},lng:H1e(),fallbackLng:"zh-CN",debug:!1,ns:["common","settings","auth","sidebar","chat","codeEditor","tasks"],defaultNS:"common",keySeparator:".",nsSeparator:":",saveMissing:!1,interpolation:{escapeValue:!1},react:{useSuspense:!0,bindI18n:"languageChanged",bindI18nStore:!1},detection:{order:["localStorage"],lookupLocalStorage:"userLanguage",caches:["localStorage"]}});Qt.on("languageChanged",e=>{try{localStorage.setItem("userLanguage",e)}catch(t){console.error("Failed to save language preference:",t)}});function V1e(){return s.jsx(h7,{i18n:Qt,children:s.jsx(f7,{children:s.jsx(v7,{children:s.jsx(JD,{children:s.jsx(aM,{children:s.jsx(nM,{children:s.jsx(rM,{children:s.jsx(YD,{children:s.jsx(lj,{basename:window.__ROUTER_BASENAME__||"",children:s.jsxs(cj,{children:[s.jsx(Cx,{path:"/",element:s.jsx(iC,{})}),s.jsx(Cx,{path:"/session/:sessionId",element:s.jsx(iC,{})})]})})})})})})})})})})}"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(e=>{console.warn("Service worker registration failed:",e)});fj.createRoot(document.getElementById("root")).render(s.jsx(Lr.StrictMode,{children:s.jsx(V1e,{})}));