@pixelbyte-software/pixcode 1.50.5 → 1.50.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{index-BSxc8Vid.js → index-DVEXTVKy.js} +3 -3
- package/dist/index.html +1 -1
- package/dist-server/server/index.js +14 -8
- package/dist-server/server/index.js.map +1 -1
- package/dist-server/server/modules/orchestration/hermes/hermes.routes.js +2 -0
- package/dist-server/server/modules/orchestration/hermes/hermes.routes.js.map +1 -1
- package/package.json +1 -1
- package/scripts/hermes/configure-pixcode-mcp.mjs +8 -5
- package/scripts/hermes/pixcode-mcp-server.mjs +37 -11
- package/scripts/smoke/hermes-api-install.mjs +2 -1
- package/scripts/smoke/hermes-rest-codex-launch.mjs +4 -2
- package/scripts/smoke/hermes-settings-commands.mjs +41 -6
- package/scripts/smoke/pixcode-workbench-1-48.mjs +3 -1
- package/scripts/smoke/vscode-workbench-polish.mjs +8 -2
- package/server/index.js +15 -9
- package/server/modules/orchestration/hermes/hermes.routes.ts +3 -0
|
@@ -7,7 +7,7 @@ import{j as i,a as RC,R as LC,o as PC,_ as TI,b as AI,T as DC,P as OC,S as dc,E
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Lw;function F_(){if(Lw)return Np;Lw=1;var e=qI();function t(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function l(p,f){var h=f(),g=n({inst:{value:h,getSnapshot:f}}),b=g[0].inst,x=g[1];return s(function(){b.value=h,b.getSnapshot=f,c(b)&&x({inst:b})},[p,h,f]),a(function(){return c(b)&&x({inst:b}),p(function(){c(b)&&x({inst:b})})},[p]),o(h),h}function c(p){var f=p.getSnapshot;p=p.value;try{var h=f();return!r(p,h)}catch{return!0}}function d(p,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Np.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Np}var Pw;function z_(){return Pw||(Pw=1,Cp.exports=F_()),Cp.exports}var B_=z_();const U_=(e,t)=>{if(us(t))return t;if(T_(t)&&us(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const r=e[e.length-1];return typeof r=="function"?"":r}return e},$_={t:U_,ready:!1},H_=()=>()=>{},Be=(e,t={})=>{const{i18n:r}=t,{i18n:n,defaultNS:a}=m.useContext(VC)||{},s=r||n||D_();s&&!s.reportNamespaces&&(s.reportNamespaces=new M_),s||Oh(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=m.useMemo(()=>({...L_(),...s?.options?.react,...t}),[s,t]),{useSuspense:l,keyPrefix:c}=o,d=e||a||s?.options?.defaultNS,u=us(d)?[d]:d||["translation"],p=m.useMemo(()=>u,u);s?.reportNamespaces?.addUsedNamespaces?.(p);const f=m.useRef(0),h=m.useCallback(E=>{if(!s)return H_;const{bindI18n:T,bindI18nStore:_}=o,I=()=>{f.current+=1,E()};return T&&s.on(T,I),_&&s.store.on(_,I),()=>{T&&T.split(" ").forEach(R=>s.off(R,I)),_&&_.split(" ").forEach(R=>s.store.off(R,I))}},[s,o]),g=m.useRef(),b=m.useCallback(()=>{if(!s)return $_;const E=!!(s.isInitialized||s.initializedStoreOnce)&&p.every(F=>E_(F,s,o)),T=t.lng||s.language,_=f.current,I=g.current;if(I&&I.ready===E&&I.lng===T&&I.keyPrefix===c&&I.revision===_)return I;const S={t:s.getFixedT(T,o.nsMode==="fallback"?p:p[0],c),ready:E,lng:T,keyPrefix:c,revision:_};return g.current=S,S},[s,p,c,o,t.lng]),[x,y]=m.useState(0),{t:v,ready:w}=B_.useSyncExternalStore(h,b,b);m.useEffect(()=>{if(s&&!w&&!l){const E=()=>y(T=>T+1);t.lng?Rw(s,t.lng,p,E):Mh(s,p,E)}},[s,t.lng,p,w,l,x]);const C=s||{},k=m.useRef(null),N=m.useRef(),j=E=>{const T=Object.getOwnPropertyDescriptors(E);T.__original&&delete T.__original;const _=Object.create(Object.getPrototypeOf(E),T);if(!Object.prototype.hasOwnProperty.call(_,"__original"))try{Object.defineProperty(_,"__original",{value:E,writable:!1,enumerable:!1,configurable:!1})}catch{}return _},A=m.useMemo(()=>{const E=C,T=E?.language;let _=E;E&&(k.current&&k.current.__original===E?N.current!==T?(_=j(E),k.current=_,N.current=T):_=k.current:(_=j(E),k.current=_,N.current=T));const I=!w&&!l?(...S)=>(Oh(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),v(...S)):v,R=[I,_,w];return R.t=I,R.i18n=_,R.ready=w,R},[v,C,w,C.resolvedLanguage,C.language,C.languages]);if(s&&l&&!w)throw new Promise(E=>{const T=()=>E();t.lng?Rw(s,t.lng,p,T):Mh(s,p,T)});return A};function G_({i18n:e,defaultNS:t,children:r}){const n=m.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return m.createElement(VC.Provider,{value:n},r)}const WC="pixcode.theme.accent",Dw="pixcode.theme.customLight",Ow="pixcode.theme.customDark",qC="#059669",KC="#10b981",Hl=[{id:"emerald",label:"Emerald",light:"#059669",dark:"#10b981"},{id:"vscode",label:"VS Code",light:"#007acc",dark:"#007acc",darkBackground:"215 28% 7%",darkCard:"215 25% 10%",darkMuted:"215 18% 16%"},{id:"blue",label:"Blue",light:"#2563eb",dark:"#60a5fa"},{id:"violet",label:"Violet",light:"#7c3aed",dark:"#a78bfa"},{id:"amber",label:"Amber",light:"#d97706",dark:"#f59e0b"},{id:"rose",label:"Rose",light:"#e11d48",dark:"#fb7185"},{id:"custom",label:"Custom",light:qC,dark:KC}],V_="emerald";function W_(e){return typeof e=="string"&&Hl.some(t=>t.id===e)}function q_(){const e=localStorage.getItem(WC);return W_(e)?e:V_}function Mw(e,t){const r=localStorage.getItem(e);return r&&/^#[0-9a-fA-F]{6}$/.test(r)?r:t}function K_(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,a=parseInt(t.slice(4,6),16)/255,s=Math.max(r,n,a),o=Math.min(r,n,a);let l=0,c=0;const d=(s+o)/2;if(s!==o){const u=s-o;c=d>.5?u/(2-s-o):u/(s+o),s===r?l=(n-a)/u+(n<a?6:0):s===n?l=(a-r)/u+2:l=(r-n)/u+4,l/=6}return`${Math.round(l*360)} ${Math.round(c*100)}% ${Math.round(d*100)}%`}function Y_(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return(.2126*r+.7152*n+.0722*a)/255>.58?"160 18% 6%":"210 40% 98%"}function Z_(e,t,r,n,a){const s=Hl.find(c=>c.id===t)??Hl[0],o=t==="custom"?r?a:n:r?s.dark:s.light,l=K_(o);return e.style.setProperty("--primary",l),e.style.setProperty("--ring",l),e.style.setProperty("--primary-foreground",Y_(o)),e.style.setProperty("--nav-tab-glow",`${l} / ${r?"0.25":"0.18"}`),e.style.setProperty("--nav-tab-ring",`${l} / ${r?"0.15":"0.10"}`),e.style.setProperty("--nav-input-focus-ring",`${l} / ${r?"0.25":"0.22"}`),r&&s.darkBackground?(e.style.setProperty("--background",s.darkBackground),e.style.setProperty("--card",s.darkCard??s.darkBackground),e.style.setProperty("--popover",s.darkCard??s.darkBackground),e.style.setProperty("--muted",s.darkMuted??s.darkCard??s.darkBackground),e.style.setProperty("--secondary",s.darkMuted??s.darkCard??s.darkBackground),e.style.setProperty("--accent",s.darkMuted??s.darkCard??s.darkBackground)):["--background","--card","--popover","--muted","--secondary","--accent"].forEach(c=>{e.style.removeProperty(c)}),o}const YC=m.createContext(),Fw="codeEditorTheme",X_="codeEditorSettingsChanged",zw=e=>e?"dark":"light",J_=(e,t)=>{const r=zw(e),n=zw(t),a=localStorage.getItem(Fw);(!a||a===r)&&(localStorage.setItem(Fw,n),window.dispatchEvent(new Event(X_)))},Xa=()=>{const e=m.useContext(YC);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},Q_=({children:e})=>{const[t,r]=m.useState(()=>{const g=localStorage.getItem("theme");return g?g==="dark":!0}),[n,a]=m.useState(q_),[s,o]=m.useState(()=>Mw(Dw,qC)),[l,c]=m.useState(()=>Mw(Ow,KC));m.useEffect(()=>{const g=Z_(document.documentElement,n,t,s,l);if(t){document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark");const b=document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');b&&b.setAttribute("content","black-translucent");const x=document.querySelector('meta[name="theme-color"]');x&&x.setAttribute("content",g)}else{document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light");const b=document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');b&&b.setAttribute("content","default");const x=document.querySelector('meta[name="theme-color"]');x&&x.setAttribute("content",g)}},[n,l,s,t]),m.useEffect(()=>{if(!window.matchMedia)return;const g=window.matchMedia("(prefers-color-scheme: dark)"),b=x=>{localStorage.getItem("theme")||r(x.matches)};return g.addEventListener("change",b),()=>g.removeEventListener("change",b)},[]);const h={isDarkMode:t,toggleDarkMode:()=>{r(g=>{const b=!g;return J_(g,b),b})},accentTheme:n,setAccentTheme:g=>{a(g),localStorage.setItem(WC,g)},customLightAccent:s,setCustomLightAccent:g=>{o(g),localStorage.setItem(Dw,g)},customDarkAccent:l,setCustomDarkAccent:g=>{c(g),localStorage.setItem(Ow,g)}};return i.jsx(YC.Provider,{value:h,children:e})},eR=!1,tR={name:"default",displayName:"default",fullPath:"",path:""},Se=(e,t={})=>{const r=localStorage.getItem("auth-token"),n={};return t.body instanceof FormData||(n["Content-Type"]="application/json"),r&&(n.Authorization=`Bearer ${r}`),fetch(e,{...t,headers:{...n,...t.headers}}).then(a=>{const s=a.headers.get("X-Refreshed-Token");return s&&localStorage.setItem("auth-token",s),a})},Lt={auth:{status:()=>fetch("/api/auth/status"),connectionMode:()=>fetch("/api/auth/connection-mode"),updateConnectionMode:e=>fetch("/api/auth/connection-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),login:(e,t)=>fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})}),register:(e,t)=>fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})}),user:()=>Se("/api/auth/user"),logout:()=>Se("/api/auth/logout",{method:"POST"})},publicApiManifest:()=>Se("/api/public/manifest"),diagnostics:()=>Se("/api/diagnostics"),refreshDiagnostics:()=>Se("/api/diagnostics/refresh",{method:"POST"}),remoteConnection:()=>Se("/api/remote/config"),updateRemoteConnection:e=>Se("/api/remote/config",{method:"PUT",body:JSON.stringify(e)}),projects:()=>Se("/api/projects"),sessions:(e,t=5,r=0)=>Se(`/api/projects/${e}/sessions?limit=${t}&offset=${r}`),unifiedSessionMessages:(e,t="claude",{projectName:r="",projectPath:n="",limit:a=null,offset:s=0}={})=>{const o=new URLSearchParams;o.append("provider",t),r&&o.append("projectName",r),n&&o.append("projectPath",n),a!==null&&(o.append("limit",String(a)),o.append("offset",String(s)));const l=o.toString();return Se(`/api/sessions/${encodeURIComponent(e)}/messages${l?`?${l}`:""}`)},renameProject:(e,t)=>Se(`/api/projects/${e}/rename`,{method:"PUT",body:JSON.stringify({displayName:t})}),deleteSession:(e,t)=>Se(`/api/projects/${e}/sessions/${t}`,{method:"DELETE"}),renameSession:(e,t,r)=>Se(`/api/sessions/${e}/rename`,{method:"PUT",body:JSON.stringify({summary:t,provider:r})}),deleteCodexSession:e=>Se(`/api/codex/sessions/${e}`,{method:"DELETE"}),deleteGeminiSession:e=>Se(`/api/gemini/sessions/${e}`,{method:"DELETE"}),deleteQwenSession:e=>Se(`/api/qwen/sessions/${e}`,{method:"DELETE"}),deleteProject:(e,t=!1,r=!1)=>{const n=new URLSearchParams;t&&n.set("force","true"),r&&n.set("deleteData","true");const a=n.toString();return Se(`/api/projects/${e}${a?`?${a}`:""}`,{method:"DELETE"})},searchConversationsUrl:(e,t=50)=>{const r=localStorage.getItem("auth-token"),n=new URLSearchParams({q:e,limit:String(t)});return r&&n.set("token",r),`/api/search/conversations?${n.toString()}`},createWorkspace:e=>Se("/api/projects/create-workspace",{method:"POST",body:JSON.stringify(e)}),quickStartProject:()=>Se("/api/projects/quick-start",{method:"POST",body:"{}"}),readFile:(e,t)=>Se(`/api/projects/${e}/file?filePath=${encodeURIComponent(t)}`),readFileBlob:(e,t)=>Se(`/api/projects/${e}/files/content?path=${encodeURIComponent(t)}`),saveFile:(e,t,r)=>Se(`/api/projects/${e}/file`,{method:"PUT",body:JSON.stringify({filePath:t,content:r})}),getFiles:(e,t={})=>Se(`/api/projects/${e}/files`,t),createFile:(e,{path:t,type:r,name:n})=>Se(`/api/projects/${e}/files/create`,{method:"POST",body:JSON.stringify({path:t,type:r,name:n})}),renameFile:(e,{oldPath:t,newName:r})=>Se(`/api/projects/${e}/files/rename`,{method:"PUT",body:JSON.stringify({oldPath:t,newName:r})}),deleteFile:(e,{path:t,type:r})=>Se(`/api/projects/${e}/files`,{method:"DELETE",body:JSON.stringify({path:t,type:r})}),uploadFiles:(e,t)=>Se(`/api/projects/${e}/files/upload`,{method:"POST",body:t,headers:{}}),browseFilesystem:(e=null)=>{const t=new URLSearchParams;return e&&t.append("path",e),Se(`/api/browse-filesystem?${t}`)},createFolder:e=>Se("/api/create-folder",{method:"POST",body:JSON.stringify({path:e})}),user:{gitConfig:()=>Se("/api/user/git-config"),updateGitConfig:(e,t)=>Se("/api/user/git-config",{method:"POST",body:JSON.stringify({gitName:e,gitEmail:t})}),onboardingStatus:()=>Se("/api/user/onboarding-status"),completeOnboarding:()=>Se("/api/user/complete-onboarding",{method:"POST"})},get:e=>Se(`/api${e}`),post:(e,t)=>Se(`/api${e}`,{method:"POST",...t instanceof FormData?{body:t}:{body:JSON.stringify(t)}}),put:(e,t)=>Se(`/api${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:(e,t={})=>Se(`/api${e}`,{method:"DELETE",...t})},yg="auth-token",zi={authStatusCheckFailed:"Failed to check authentication status",loginFailed:"Login failed",registrationFailed:"Registration failed",networkError:"Network error. Please try again."};async function rl(e){try{return await e.json()}catch{return null}}function Bw(e,t){return e?e.error??e.message??t:t}const ZC=m.createContext(null),rR=()=>localStorage.getItem(yg),nR=e=>{localStorage.setItem(yg,e)},aR=()=>{localStorage.removeItem(yg)};function uc(){const e=m.useContext(ZC);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function iR({children:e}){const[t,r]=m.useState(null),[n,a]=m.useState(()=>rR()),[s,o]=m.useState(!0),[l,c]=m.useState(!1),[d,u]=m.useState(!0),[p,f]=m.useState(null),h=m.useCallback((N,j)=>{r(N),a(j),nR(j)},[]),g=m.useCallback(()=>{r(null),a(null),aR()},[]),b=m.useCallback(async()=>{try{const N=await Lt.user.onboardingStatus();if(!N.ok)return;const j=await rl(N);u(!!j?.hasCompletedOnboarding)}catch(N){console.error("Error checking onboarding status:",N),u(!0)}},[]),x=m.useCallback(async()=>{await b()},[b]),y=m.useCallback(async()=>{try{o(!0),f(null);const N=await Lt.auth.status();if((await rl(N))?.needsSetup){c(!0);return}if(c(!1),!n)return;const A=await Lt.auth.user();if(!A.ok){g();return}const E=await rl(A);if(!E?.user){g();return}r(E.user),await b()}catch(N){console.error("[Auth] Auth status check failed:",N),f(zi.authStatusCheckFailed)}finally{o(!1)}},[b,g,n]);m.useEffect(()=>{y()},[y,b]);const v=m.useCallback(async(N,j)=>{try{f(null);const A=await Lt.auth.login(N,j),E=await rl(A);if(!A.ok||!E?.token||!E.user){const T=Bw(E,zi.loginFailed);return f(T),{success:!1,error:T}}return h(E.user,E.token),c(!1),await b(),{success:!0}}catch(A){return console.error("Login error:",A),f(zi.networkError),{success:!1,error:zi.networkError}}},[b,h]),w=m.useCallback(async(N,j)=>{try{f(null);const A=await Lt.auth.register(N,j),E=await rl(A);if(!A.ok||!E?.token||!E.user){const T=Bw(E,zi.registrationFailed);return f(T),{success:!1,error:T}}return h(E.user,E.token),c(!1),await b(),{success:!0}}catch(A){return console.error("Registration error:",A),f(zi.networkError),{success:!1,error:zi.networkError}}},[b,h]),C=m.useCallback(()=>{const N=n;g(),N&&Lt.auth.logout().catch(j=>{console.error("Logout endpoint error:",j)})},[g,n]),k=m.useMemo(()=>({user:t,token:n,isLoading:s,needsSetup:l,hasCompletedOnboarding:d,error:p,login:v,register:w,logout:C,refreshOnboardingStatus:x}),[p,d,s,v,C,l,x,w,n,t]);return i.jsx(ZC.Provider,{value:k,children:e})}const sR="pixcode.notification.once.",XC="pixcode.notificationPreferences.v1",oR={action_required:"actionRequired","approval.needed":"actionRequired",stop:"stop","chat.done":"stop","orchestration.done":"stop","run.stopped":"stop",error:"error","run.failed":"error","test.failed":"error","live_view.failed":"error",update:"updates",updates:"updates","push.enabled":"updates","app.update.available":"updates","cli.update.available":"updates"};function lR(e="updates"){try{const t=JSON.parse(localStorage.getItem(XC)??"null");return t?.channels?.desktop===!1?!1:t?.events?.[oR[e]||e]!==!1}catch{return!0}}function Ts(e){try{localStorage.setItem(XC,JSON.stringify(e)),window.dispatchEvent(new CustomEvent("pixcode:notification-preferences-changed"))}catch{}}async function JC({key:e,title:t,body:r,tag:n,data:a}){return QC({key:e,title:t,body:r,event:"updates",tag:n,data:a})}async function QC({key:e,title:t,body:r,event:n="updates",tag:a,data:s}){if(typeof window>"u"||!lR(n))return!1;const o=`${sR}${e}`;try{if(localStorage.getItem(o))return!1}catch{}try{if(await window.pixcodeDesktop?.notify({title:t,body:r,event:n,tag:a,data:s})){try{localStorage.setItem(o,new Date().toISOString())}catch{}return!0}}catch(c){console.warn("Desktop notification bridge failed:",c)}if(!("Notification"in window)||Notification.permission!=="granted")return!1;const l={body:r,icon:"/logo-256.png",badge:"/logo-128.png",tag:a,data:s,renotify:!!a};try{const c="serviceWorker"in navigator?await navigator.serviceWorker.ready.catch(()=>null):null;c?.showNotification?await c.showNotification(t,l):new Notification(t,l);try{localStorage.setItem(o,new Date().toISOString())}catch{}return!0}catch(c){return console.warn("Local notification failed:",c),!1}}const eN={claude:"npm install -g @anthropic-ai/claude-code",cursor:"curl https://cursor.com/install -fsSL | bash",codex:"npm install -g @openai/codex",gemini:"npm install -g @google/gemini-cli",qwen:"npm install -g @qwen-code/qwen-code",opencode:"npm install -g opencode-ai"},Kn={claude:"Claude Code",cursor:"Cursor CLI",codex:"OpenAI Codex",gemini:"Gemini CLI",qwen:"Qwen Code",opencode:"OpenCode"},tN=["claude","cursor","codex","gemini","qwen","opencode"],Uw={claude:"/api/providers/claude/auth/status",cursor:"/api/providers/cursor/auth/status",codex:"/api/providers/codex/auth/status",gemini:"/api/providers/gemini/auth/status",qwen:"/api/providers/qwen/auth/status",opencode:"/api/providers/opencode/auth/status"},$w=(e=!0)=>({claude:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},cursor:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},codex:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},gemini:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},qwen:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},opencode:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null}}),cR="Failed to check authentication status",dR="Unknown error",rN="pixcode.providerAuthStatus.cache.v2",Ad=1440*60*1e3,uR=3600*1e3,pR=15e3;let Hw=0;const mR=e=>e instanceof Error?e.message:dR,hR=e=>(e instanceof DOMException||e instanceof Error)&&e.name==="AbortError",fR=(e,t=null)=>({authenticated:!!e.authenticated,installed:typeof e.installed=="boolean"?e.installed:null,email:e.email??null,method:e.method??null,error:e.error??t,loading:!1,checkedAt:e.checkedAt??new Date().toISOString(),installedVersion:e.installedVersion??null,latestVersion:e.latestVersion??null,updateAvailable:!!e.updateAvailable,versionCheckSkipped:e.versionCheckSkipped??null,fromCache:!!e.fromCache});function zh(){try{const e=JSON.parse(localStorage.getItem(rN)??"null");return!e||typeof e.savedAt!="number"||!e.statuses?null:e}catch{return null}}function gR(e){try{localStorage.setItem(rN,JSON.stringify({savedAt:Date.now(),statuses:e}))}catch{}}function bR(e){const t=zh(),r=$w(!1);return t&&Date.now()-t.savedAt<Ad?Object.fromEntries(tN.map(n=>[n,{...r[n],...t.statuses[n],loading:!1,fromCache:!0}])):$w(e)}function Gw(e,t){if(!t.updateAvailable||!t.latestVersion)return;const r=Kn[e]??e,n=t.installedVersion?` ${t.installedVersion}`:"";JC({key:`cli-update:${e}:${t.latestVersion}`,title:`${r} update available`,body:`${r}${n} can update to ${t.latestVersion}.`,tag:`pixcode-cli-update:${e}`,data:{type:"cli-update",provider:e,latestVersion:t.latestVersion}})}function Lu({initialLoading:e=!0}={}){const[t,r]=m.useState(()=>bR(e)),n=m.useCallback(l=>{r(c=>({...c,[l]:{...c[l],loading:!0,error:null}}))},[]),a=m.useCallback((l,c)=>{r(d=>({...d,[l]:c}))},[]),s=m.useCallback(async(l,c={})=>{const d=zh(),u=d?.statuses?.[l];if(!c.force&&d&&u&&Date.now()-d.savedAt<Ad){const h={...u,loading:!1,fromCache:!0};a(l,h),Gw(l,h);return}n(l);const p=new AbortController,f=window.setTimeout(()=>p.abort(),pR);try{const h=c.force?`${Uw[l]}?refresh=1`:Uw[l],g=await Se(h,{cache:"no-store",signal:p.signal});if(!g.ok){a(l,{authenticated:!1,installed:null,email:null,method:null,loading:!1,error:cR});return}const b=await g.json(),x=fR(b.data);Gw(l,x),r(y=>{const v={...y,[l]:x};return gR(v),v})}catch(h){console.error(`Error checking ${l} auth status:`,h),a(l,{authenticated:!1,installed:null,email:null,method:null,loading:!1,error:hR(h)?"Status check timed out":mR(h)})}finally{window.clearTimeout(f)}},[n,a]),o=m.useCallback(async(l=tN,c={})=>{await Promise.all(l.map(d=>s(d,c)))},[s]);return m.useEffect(()=>{const l=window.setInterval(()=>{const c=Date.now();if(c-Hw<Ad)return;const d=zh();d&&c-d.savedAt<Ad||(Hw=c,o())},uR);return()=>window.clearInterval(l)},[o]),{providerAuthStatus:t,setProviderAuthStatus:r,checkProviderAuthStatus:s,refreshProviderAuthStatuses:o}}const nN="https://auth.openai.com/codex/device",xR=200,aN=100,yR=50,vR=500,wR=20,kR=15,SR=5,CR=2,NR={cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',allowProposedApi:!0,allowTransparency:!1,convertEol:!0,scrollback:1e4,tabStopWidth:4,windowsMode:!1,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#ffffff",cursorAccent:"#1e1e1e",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff",extendedAnsi:["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"]}};function ER(e){if(!e||typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.focus(),t.select();let r=!1;try{r=document.execCommand("copy")}catch{r=!1}finally{document.body.removeChild(t)}return r}async function ia(e){if(!e)return!1;let t=!1;try{typeof navigator<"u"&&navigator.clipboard?.writeText&&(await navigator.clipboard.writeText(e),t=!0)}catch{t=!1}return t||(t=ER(e)),t}function TR(){const e=window.location.protocol==="https:"?"wss:":"ws:",t=localStorage.getItem("auth-token");return t?`${e}//${window.location.host}/shell?token=${encodeURIComponent(t)}`:(console.error("No authentication token found for Shell WebSocket connection"),null)}function AR(e){try{return JSON.parse(e)}catch{return null}}function pi(e,t){e&&e.readyState===WebSocket.OPEN&&e.send(JSON.stringify(t))}const iN=/(?:\u001B\[[0-?]*[ -/]*[@-~]|\u009B[0-?]*[ -/]*[@-~]|\u001B\][^\u0007\u001B]*(?:\u0007|\u001B\\)|\u009D[^\u0007\u009C]*(?:\u0007|\u009C)|\u001B[PX^_][^\u001B]*\u001B\\|[\u0090\u0098\u009E\u009F][^\u009C]*\u009C|\u001B[@-Z\\-_])/g,jR=/Process exited with code (\d+)/,IR="permissionMode-global",_R=1400,Vw=6500;function As(e){try{const t=window.localStorage.getItem(e);if(!t)return{};const r=JSON.parse(t);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch{return{}}}function RR(){const e=window.localStorage.getItem(IR);return typeof e=="string"?e:"default"}function LR(e,t){return e==="yolo"||e==="auto_edit"||e==="plan"||e==="default"?e:t==="bypassPermissions"||t==="acceptEdits"?"yolo":t==="plan"?"plan":"default"}function PR(e){const t=RR(),r=t==="bypassPermissions"||t==="acceptEdits";if(e==="plain-shell")return{permissionMode:"default",skipPermissions:!1};if(e==="claude"){const n=As("claude-settings");return{permissionMode:t,skipPermissions:!!n.skipPermissions||r}}if(e==="cursor"){const n={...As("cursor-settings"),...As("cursor-tools-settings")};return{permissionMode:t,skipPermissions:!!n.skipPermissions||r}}if(e==="codex"){const n=As("codex-settings");return{permissionMode:typeof n.permissionMode=="string"?n.permissionMode:t,skipPermissions:!1}}if(e==="gemini"||e==="qwen"){const n=As(`${e}-settings`);return{permissionMode:LR(n.permissionMode,t),skipPermissions:!1}}if(e==="opencode"){const n=As("opencode-settings");return{permissionMode:n.skipPermissions||r?"bypassPermissions":t,skipPermissions:!!n.skipPermissions||r}}return{permissionMode:t,skipPermissions:r}}function DR(e,t){const r=PR(e);if(!t)return r;const a=(typeof t.permissionMode=="string"&&t.permissionMode.trim()?t.permissionMode.trim():"")||(t.skipPermissions?"bypassPermissions":r.permissionMode),s=a==="bypassPermissions"||a==="acceptEdits"||a==="yolo";return{permissionMode:a,skipPermissions:!!t.skipPermissions||r.skipPermissions||s}}function OR(e,t){return`${e.replace(/(?:\r\n|\r|\n)+$/u,"")}\r`}function Ww(e){return e.current?.__provider||window.localStorage.getItem("selected-provider")||"claude"}function MR(e,t){const r=t.replace(iN,"").toLowerCase();return r.trim()?e==="codex"?/openai codex|directory:\s|tip:\s+use \/init|model:\s/.test(r):e==="claude"?/claude code|welcome to claude|cwd:\s|try ['"]?\/init/.test(r):e==="gemini"?/gemini|type a message|ctrl\+/.test(r):e==="qwen"?/qwen code|qwen|type a message/.test(r):e==="opencode"?/opencode|model:\s|session/.test(r):e==="cursor"?/cursor|agent|model:\s/.test(r):r.length>0:!1}function FR({wsRef:e,terminalRef:t,fitAddonRef:r,selectedProjectRef:n,selectedSessionRef:a,initialCommandRef:s,isPlainShellRef:o,forceNewSessionRef:l,startupInputRef:c,hermesLaunchIdRef:d,permissionOverrideRef:u,onProcessCompleteRef:p,isInitialized:f,autoConnect:h,closeSocket:g,clearTerminalScreen:b,setAuthUrl:x,onOutputRef:y}){const[v,w]=m.useState(!1),[C,k]=m.useState(!1),N=m.useRef(!1),j=m.useRef(!1),A=m.useRef(!1),E=m.useRef(""),T=m.useRef(null),_=m.useCallback(()=>{T.current&&(window.clearTimeout(T.current),T.current=null)},[]),I=m.useCallback(V=>{A.current||T.current||o.current||(T.current=window.setTimeout(()=>{T.current=null;const P=c.current,U=e.current;!P||A.current||o.current||U?.readyState!==WebSocket.OPEN||(Ww(a),pi(U,{type:"input",data:OR(P)}),A.current=!0,c.current=null)},V))},[o,a,c,e]),R=m.useCallback(V=>{if(!c.current||A.current||o.current)return;E.current=`${E.current}${V}`.slice(-12e3);const P=Ww(a);if(MR(P,E.current)){_(),I(_R);return}I(Vw)},[_,o,I,a,c]),S=m.useCallback(V=>{if(!o.current||!p.current)return;const U=V.replace(iN,"");if(U.includes("Process exited with code 0")){p.current(0);return}const H=U.match(jR);if(!H)return;const M=Number.parseInt(H[1],10);!Number.isNaN(M)&&M!==0&&p.current(M)},[o,p]),F=m.useCallback(V=>{const P=AR(V);if(!P){console.error("[Shell] Error handling WebSocket message:",V);return}if(P.type==="output"){const U=typeof P.data=="string"?P.data:"";S(U),R(U);const H=t.current;H?.write(U,()=>{H.refresh(0,Math.max(0,H.rows-1))}),y?.current?.();return}if(P.type==="auth_url"||P.type==="url_open"){const U=typeof P.url=="string"?P.url:"";U&&x(U)}},[S,R,y,x,t]),B=m.useCallback((V=!1)=>{if(!(N.current&&!V||C||v))try{const P=TR();if(!P){N.current=!1,k(!1);return}N.current=!0;const U=new WebSocket(P);e.current=U,U.onopen=()=>{w(!0),k(!1),N.current=!1,x(""),window.setTimeout(()=>{const H=t.current,M=r.current,ee=n.current;if(!H||!M||!ee)return;M.fit();const Q=o.current?"plain-shell":a.current?.__provider||localStorage.getItem("selected-provider")||"claude",ge=DR(Q,u.current),se=typeof c.current=="string"&&c.current.trim()?c.current.trim():null,ce=Q==="codex"&&!!se&&!o.current;_(),A.current=!1,E.current="",pi(U,{type:"init",projectPath:ee.fullPath||ee.path||"",sessionId:o.current?null:a.current?.id||null,hasSession:o.current?!1:!!a.current,provider:Q,cols:H.cols,rows:H.rows,initialCommand:s.current,isPlainShell:o.current,forceNewSession:l.current,startupInput:ce?se:null,hermesLaunchId:typeof d.current=="number"?d.current:null,permissionMode:ge.permissionMode,skipPermissions:ge.skipPermissions}),ce?(A.current=!0,c.current=null):c.current&&!o.current&&I(Vw)},aN)},U.onmessage=H=>{const M=typeof H.data=="string"?H.data:String(H.data??"");F(M)},U.onclose=()=>{w(!1),k(!1),N.current=!1,b()},U.onerror=()=>{w(!1),k(!1),N.current=!1}}catch{w(!1),k(!1),N.current=!1}},[b,r,l,d,F,s,v,C,o,u,_,I,n,a,x,c,t,e]),z=m.useCallback(()=>{!f||v||C||N.current||(j.current=!1,N.current=!0,k(!0),B(!0))},[B,v,C,f]),q=m.useCallback((V=!0)=>{V&&(j.current=!0),g(),_(),b(),w(!1),k(!1),N.current=!1,x("")},[_,b,g,x]);return m.useEffect(()=>{!h||j.current||!f||C||v||z()},[h,z,v,C,f]),{isConnected:v,isConnecting:C,closeSocket:g,connectToShell:z,disconnectFromShell:q}}var zR=JI(),Ep={exports:{}},qw;function BR(){return qw||(qw=1,function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(o,l)=>{function c(u){try{const p=new URL(u),f=p.password&&p.username?`${p.protocol}//${p.username}:${p.password}@${p.host}`:p.username?`${p.protocol}//${p.username}@${p.host}`:`${p.protocol}//${p.host}`;return u.toLocaleLowerCase().startsWith(f.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(u,p,f,h={}){this._terminal=u,this._regex=p,this._handler=f,this._options=h}provideLinks(u,p){const f=d.computeLink(u,this._regex,this._terminal,this._handler);p(this._addCallbacks(f))}_addCallbacks(u){return u.map(p=>(p.leave=this._options.leave,p.hover=(f,h)=>{if(this._options.hover){const{range:g}=p;this._options.hover(f,h,g)}},p))}};class d{static computeLink(p,f,h,g){const b=new RegExp(f.source,(f.flags||"")+"g"),[x,y]=d._getWindowedLineStrings(p-1,h),v=x.join("");let w;const C=[];for(;w=b.exec(v);){const k=w[0];if(!c(k))continue;const[N,j]=d._mapStrIdx(h,y,0,w.index),[A,E]=d._mapStrIdx(h,N,j,k.length);if(N===-1||j===-1||A===-1||E===-1)continue;const T={start:{x:j+1,y:N+1},end:{x:E,y:A+1}};C.push({range:T,text:k,activate:g})}return C}static _getWindowedLineStrings(p,f){let h,g=p,b=p,x=0,y="";const v=[];if(h=f.buffer.active.getLine(p)){const w=h.translateToString(!0);if(h.isWrapped&&w[0]!==" "){for(x=0;(h=f.buffer.active.getLine(--g))&&x<2048&&(y=h.translateToString(!0),x+=y.length,v.push(y),h.isWrapped&&y.indexOf(" ")===-1););v.reverse()}for(v.push(w),x=0;(h=f.buffer.active.getLine(++b))&&h.isWrapped&&x<2048&&(y=h.translateToString(!0),x+=y.length,v.push(y),y.indexOf(" ")===-1););}return[v,g]}static _mapStrIdx(p,f,h,g){const b=p.buffer.active,x=b.getNullCell();let y=h;for(;g;){const v=b.getLine(f);if(!v)return[-1,-1];for(let w=y;w<v.length;++w){v.getCell(w,x);const C=x.getChars();if(x.getWidth()&&(g-=C.length||1,w===v.length-1&&C==="")){const k=b.getLine(f+1);k&&k.isWrapped&&(k.getCell(0,x),x.getWidth()===2&&(g+=1))}if(g<0)return[f,w]}f++,y=0}return[f,y]}}l.LinkComputer=d}},n={};function a(o){var l=n[o];if(l!==void 0)return l.exports;var c=n[o]={exports:{}};return r[o](c,c.exports,a),c.exports}var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.WebLinksAddon=void 0;const l=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(u,p){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}o.WebLinksAddon=class{constructor(u=d,p={}){this._handler=u,this._options=p}activate(u){this._terminal=u;const p=this._options,f=p.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,f,this._handler,p))}dispose(){this._linkProvider?.dispose()}}})(),s})())}(Ep)),Ep.exports}var UR=BR(),$R=QI();function sN(e){return typeof e=="string"&&/\bcodex\s+login\b/i.test(e)}function HR(e,t){return sN(e)?nN:t}function GR(e){return e?e.__provider==="cursor"?e.name||"Untitled Session":e.summary||"New Session":null}const Kw="shell-xterm-focus-style",VR=`
|
|
10
|
+
*/var Lw;function F_(){if(Lw)return Np;Lw=1;var e=qI();function t(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function l(p,f){var h=f(),g=n({inst:{value:h,getSnapshot:f}}),b=g[0].inst,x=g[1];return s(function(){b.value=h,b.getSnapshot=f,c(b)&&x({inst:b})},[p,h,f]),a(function(){return c(b)&&x({inst:b}),p(function(){c(b)&&x({inst:b})})},[p]),o(h),h}function c(p){var f=p.getSnapshot;p=p.value;try{var h=f();return!r(p,h)}catch{return!0}}function d(p,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Np.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Np}var Pw;function z_(){return Pw||(Pw=1,Cp.exports=F_()),Cp.exports}var B_=z_();const U_=(e,t)=>{if(us(t))return t;if(T_(t)&&us(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const r=e[e.length-1];return typeof r=="function"?"":r}return e},$_={t:U_,ready:!1},H_=()=>()=>{},Be=(e,t={})=>{const{i18n:r}=t,{i18n:n,defaultNS:a}=m.useContext(VC)||{},s=r||n||D_();s&&!s.reportNamespaces&&(s.reportNamespaces=new M_),s||Oh(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=m.useMemo(()=>({...L_(),...s?.options?.react,...t}),[s,t]),{useSuspense:l,keyPrefix:c}=o,d=e||a||s?.options?.defaultNS,u=us(d)?[d]:d||["translation"],p=m.useMemo(()=>u,u);s?.reportNamespaces?.addUsedNamespaces?.(p);const f=m.useRef(0),h=m.useCallback(E=>{if(!s)return H_;const{bindI18n:T,bindI18nStore:_}=o,I=()=>{f.current+=1,E()};return T&&s.on(T,I),_&&s.store.on(_,I),()=>{T&&T.split(" ").forEach(R=>s.off(R,I)),_&&_.split(" ").forEach(R=>s.store.off(R,I))}},[s,o]),g=m.useRef(),b=m.useCallback(()=>{if(!s)return $_;const E=!!(s.isInitialized||s.initializedStoreOnce)&&p.every(F=>E_(F,s,o)),T=t.lng||s.language,_=f.current,I=g.current;if(I&&I.ready===E&&I.lng===T&&I.keyPrefix===c&&I.revision===_)return I;const S={t:s.getFixedT(T,o.nsMode==="fallback"?p:p[0],c),ready:E,lng:T,keyPrefix:c,revision:_};return g.current=S,S},[s,p,c,o,t.lng]),[x,y]=m.useState(0),{t:v,ready:w}=B_.useSyncExternalStore(h,b,b);m.useEffect(()=>{if(s&&!w&&!l){const E=()=>y(T=>T+1);t.lng?Rw(s,t.lng,p,E):Mh(s,p,E)}},[s,t.lng,p,w,l,x]);const C=s||{},k=m.useRef(null),N=m.useRef(),j=E=>{const T=Object.getOwnPropertyDescriptors(E);T.__original&&delete T.__original;const _=Object.create(Object.getPrototypeOf(E),T);if(!Object.prototype.hasOwnProperty.call(_,"__original"))try{Object.defineProperty(_,"__original",{value:E,writable:!1,enumerable:!1,configurable:!1})}catch{}return _},A=m.useMemo(()=>{const E=C,T=E?.language;let _=E;E&&(k.current&&k.current.__original===E?N.current!==T?(_=j(E),k.current=_,N.current=T):_=k.current:(_=j(E),k.current=_,N.current=T));const I=!w&&!l?(...S)=>(Oh(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),v(...S)):v,R=[I,_,w];return R.t=I,R.i18n=_,R.ready=w,R},[v,C,w,C.resolvedLanguage,C.language,C.languages]);if(s&&l&&!w)throw new Promise(E=>{const T=()=>E();t.lng?Rw(s,t.lng,p,T):Mh(s,p,T)});return A};function G_({i18n:e,defaultNS:t,children:r}){const n=m.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return m.createElement(VC.Provider,{value:n},r)}const WC="pixcode.theme.accent",Dw="pixcode.theme.customLight",Ow="pixcode.theme.customDark",qC="#059669",KC="#10b981",Hl=[{id:"emerald",label:"Emerald",light:"#059669",dark:"#10b981"},{id:"vscode",label:"VS Code",light:"#007acc",dark:"#007acc",darkBackground:"215 28% 7%",darkCard:"215 25% 10%",darkMuted:"215 18% 16%"},{id:"blue",label:"Blue",light:"#2563eb",dark:"#60a5fa"},{id:"violet",label:"Violet",light:"#7c3aed",dark:"#a78bfa"},{id:"amber",label:"Amber",light:"#d97706",dark:"#f59e0b"},{id:"rose",label:"Rose",light:"#e11d48",dark:"#fb7185"},{id:"custom",label:"Custom",light:qC,dark:KC}],V_="emerald";function W_(e){return typeof e=="string"&&Hl.some(t=>t.id===e)}function q_(){const e=localStorage.getItem(WC);return W_(e)?e:V_}function Mw(e,t){const r=localStorage.getItem(e);return r&&/^#[0-9a-fA-F]{6}$/.test(r)?r:t}function K_(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,a=parseInt(t.slice(4,6),16)/255,s=Math.max(r,n,a),o=Math.min(r,n,a);let l=0,c=0;const d=(s+o)/2;if(s!==o){const u=s-o;c=d>.5?u/(2-s-o):u/(s+o),s===r?l=(n-a)/u+(n<a?6:0):s===n?l=(a-r)/u+2:l=(r-n)/u+4,l/=6}return`${Math.round(l*360)} ${Math.round(c*100)}% ${Math.round(d*100)}%`}function Y_(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return(.2126*r+.7152*n+.0722*a)/255>.58?"160 18% 6%":"210 40% 98%"}function Z_(e,t,r,n,a){const s=Hl.find(c=>c.id===t)??Hl[0],o=t==="custom"?r?a:n:r?s.dark:s.light,l=K_(o);return e.style.setProperty("--primary",l),e.style.setProperty("--ring",l),e.style.setProperty("--primary-foreground",Y_(o)),e.style.setProperty("--nav-tab-glow",`${l} / ${r?"0.25":"0.18"}`),e.style.setProperty("--nav-tab-ring",`${l} / ${r?"0.15":"0.10"}`),e.style.setProperty("--nav-input-focus-ring",`${l} / ${r?"0.25":"0.22"}`),r&&s.darkBackground?(e.style.setProperty("--background",s.darkBackground),e.style.setProperty("--card",s.darkCard??s.darkBackground),e.style.setProperty("--popover",s.darkCard??s.darkBackground),e.style.setProperty("--muted",s.darkMuted??s.darkCard??s.darkBackground),e.style.setProperty("--secondary",s.darkMuted??s.darkCard??s.darkBackground),e.style.setProperty("--accent",s.darkMuted??s.darkCard??s.darkBackground)):["--background","--card","--popover","--muted","--secondary","--accent"].forEach(c=>{e.style.removeProperty(c)}),o}const YC=m.createContext(),Fw="codeEditorTheme",X_="codeEditorSettingsChanged",zw=e=>e?"dark":"light",J_=(e,t)=>{const r=zw(e),n=zw(t),a=localStorage.getItem(Fw);(!a||a===r)&&(localStorage.setItem(Fw,n),window.dispatchEvent(new Event(X_)))},Xa=()=>{const e=m.useContext(YC);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},Q_=({children:e})=>{const[t,r]=m.useState(()=>{const g=localStorage.getItem("theme");return g?g==="dark":!0}),[n,a]=m.useState(q_),[s,o]=m.useState(()=>Mw(Dw,qC)),[l,c]=m.useState(()=>Mw(Ow,KC));m.useEffect(()=>{const g=Z_(document.documentElement,n,t,s,l);if(t){document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark");const b=document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');b&&b.setAttribute("content","black-translucent");const x=document.querySelector('meta[name="theme-color"]');x&&x.setAttribute("content",g)}else{document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light");const b=document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');b&&b.setAttribute("content","default");const x=document.querySelector('meta[name="theme-color"]');x&&x.setAttribute("content",g)}},[n,l,s,t]),m.useEffect(()=>{if(!window.matchMedia)return;const g=window.matchMedia("(prefers-color-scheme: dark)"),b=x=>{localStorage.getItem("theme")||r(x.matches)};return g.addEventListener("change",b),()=>g.removeEventListener("change",b)},[]);const h={isDarkMode:t,toggleDarkMode:()=>{r(g=>{const b=!g;return J_(g,b),b})},accentTheme:n,setAccentTheme:g=>{a(g),localStorage.setItem(WC,g)},customLightAccent:s,setCustomLightAccent:g=>{o(g),localStorage.setItem(Dw,g)},customDarkAccent:l,setCustomDarkAccent:g=>{c(g),localStorage.setItem(Ow,g)}};return i.jsx(YC.Provider,{value:h,children:e})},eR=!1,tR={name:"default",displayName:"default",fullPath:"",path:""},Se=(e,t={})=>{const r=localStorage.getItem("auth-token"),n={};return t.body instanceof FormData||(n["Content-Type"]="application/json"),r&&(n.Authorization=`Bearer ${r}`),fetch(e,{...t,headers:{...n,...t.headers}}).then(a=>{const s=a.headers.get("X-Refreshed-Token");return s&&localStorage.setItem("auth-token",s),a})},Lt={auth:{status:()=>fetch("/api/auth/status"),connectionMode:()=>fetch("/api/auth/connection-mode"),updateConnectionMode:e=>fetch("/api/auth/connection-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),login:(e,t)=>fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})}),register:(e,t)=>fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})}),user:()=>Se("/api/auth/user"),logout:()=>Se("/api/auth/logout",{method:"POST"})},publicApiManifest:()=>Se("/api/public/manifest"),diagnostics:()=>Se("/api/diagnostics"),refreshDiagnostics:()=>Se("/api/diagnostics/refresh",{method:"POST"}),remoteConnection:()=>Se("/api/remote/config"),updateRemoteConnection:e=>Se("/api/remote/config",{method:"PUT",body:JSON.stringify(e)}),projects:()=>Se("/api/projects"),sessions:(e,t=5,r=0)=>Se(`/api/projects/${e}/sessions?limit=${t}&offset=${r}`),unifiedSessionMessages:(e,t="claude",{projectName:r="",projectPath:n="",limit:a=null,offset:s=0}={})=>{const o=new URLSearchParams;o.append("provider",t),r&&o.append("projectName",r),n&&o.append("projectPath",n),a!==null&&(o.append("limit",String(a)),o.append("offset",String(s)));const l=o.toString();return Se(`/api/sessions/${encodeURIComponent(e)}/messages${l?`?${l}`:""}`)},renameProject:(e,t)=>Se(`/api/projects/${e}/rename`,{method:"PUT",body:JSON.stringify({displayName:t})}),deleteSession:(e,t)=>Se(`/api/projects/${e}/sessions/${t}`,{method:"DELETE"}),renameSession:(e,t,r)=>Se(`/api/sessions/${e}/rename`,{method:"PUT",body:JSON.stringify({summary:t,provider:r})}),deleteCodexSession:e=>Se(`/api/codex/sessions/${e}`,{method:"DELETE"}),deleteGeminiSession:e=>Se(`/api/gemini/sessions/${e}`,{method:"DELETE"}),deleteQwenSession:e=>Se(`/api/qwen/sessions/${e}`,{method:"DELETE"}),deleteProject:(e,t=!1,r=!1)=>{const n=new URLSearchParams;t&&n.set("force","true"),r&&n.set("deleteData","true");const a=n.toString();return Se(`/api/projects/${e}${a?`?${a}`:""}`,{method:"DELETE"})},searchConversationsUrl:(e,t=50)=>{const r=localStorage.getItem("auth-token"),n=new URLSearchParams({q:e,limit:String(t)});return r&&n.set("token",r),`/api/search/conversations?${n.toString()}`},createWorkspace:e=>Se("/api/projects/create-workspace",{method:"POST",body:JSON.stringify(e)}),quickStartProject:()=>Se("/api/projects/quick-start",{method:"POST",body:"{}"}),readFile:(e,t)=>Se(`/api/projects/${e}/file?filePath=${encodeURIComponent(t)}`),readFileBlob:(e,t)=>Se(`/api/projects/${e}/files/content?path=${encodeURIComponent(t)}`),saveFile:(e,t,r)=>Se(`/api/projects/${e}/file`,{method:"PUT",body:JSON.stringify({filePath:t,content:r})}),getFiles:(e,t={})=>Se(`/api/projects/${e}/files`,t),createFile:(e,{path:t,type:r,name:n})=>Se(`/api/projects/${e}/files/create`,{method:"POST",body:JSON.stringify({path:t,type:r,name:n})}),renameFile:(e,{oldPath:t,newName:r})=>Se(`/api/projects/${e}/files/rename`,{method:"PUT",body:JSON.stringify({oldPath:t,newName:r})}),deleteFile:(e,{path:t,type:r})=>Se(`/api/projects/${e}/files`,{method:"DELETE",body:JSON.stringify({path:t,type:r})}),uploadFiles:(e,t)=>Se(`/api/projects/${e}/files/upload`,{method:"POST",body:t,headers:{}}),browseFilesystem:(e=null)=>{const t=new URLSearchParams;return e&&t.append("path",e),Se(`/api/browse-filesystem?${t}`)},createFolder:e=>Se("/api/create-folder",{method:"POST",body:JSON.stringify({path:e})}),user:{gitConfig:()=>Se("/api/user/git-config"),updateGitConfig:(e,t)=>Se("/api/user/git-config",{method:"POST",body:JSON.stringify({gitName:e,gitEmail:t})}),onboardingStatus:()=>Se("/api/user/onboarding-status"),completeOnboarding:()=>Se("/api/user/complete-onboarding",{method:"POST"})},get:e=>Se(`/api${e}`),post:(e,t)=>Se(`/api${e}`,{method:"POST",...t instanceof FormData?{body:t}:{body:JSON.stringify(t)}}),put:(e,t)=>Se(`/api${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:(e,t={})=>Se(`/api${e}`,{method:"DELETE",...t})},yg="auth-token",zi={authStatusCheckFailed:"Failed to check authentication status",loginFailed:"Login failed",registrationFailed:"Registration failed",networkError:"Network error. Please try again."};async function rl(e){try{return await e.json()}catch{return null}}function Bw(e,t){return e?e.error??e.message??t:t}const ZC=m.createContext(null),rR=()=>localStorage.getItem(yg),nR=e=>{localStorage.setItem(yg,e)},aR=()=>{localStorage.removeItem(yg)};function uc(){const e=m.useContext(ZC);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function iR({children:e}){const[t,r]=m.useState(null),[n,a]=m.useState(()=>rR()),[s,o]=m.useState(!0),[l,c]=m.useState(!1),[d,u]=m.useState(!0),[p,f]=m.useState(null),h=m.useCallback((N,j)=>{r(N),a(j),nR(j)},[]),g=m.useCallback(()=>{r(null),a(null),aR()},[]),b=m.useCallback(async()=>{try{const N=await Lt.user.onboardingStatus();if(!N.ok)return;const j=await rl(N);u(!!j?.hasCompletedOnboarding)}catch(N){console.error("Error checking onboarding status:",N),u(!0)}},[]),x=m.useCallback(async()=>{await b()},[b]),y=m.useCallback(async()=>{try{o(!0),f(null);const N=await Lt.auth.status();if((await rl(N))?.needsSetup){c(!0);return}if(c(!1),!n)return;const A=await Lt.auth.user();if(!A.ok){g();return}const E=await rl(A);if(!E?.user){g();return}r(E.user),await b()}catch(N){console.error("[Auth] Auth status check failed:",N),f(zi.authStatusCheckFailed)}finally{o(!1)}},[b,g,n]);m.useEffect(()=>{y()},[y,b]);const v=m.useCallback(async(N,j)=>{try{f(null);const A=await Lt.auth.login(N,j),E=await rl(A);if(!A.ok||!E?.token||!E.user){const T=Bw(E,zi.loginFailed);return f(T),{success:!1,error:T}}return h(E.user,E.token),c(!1),await b(),{success:!0}}catch(A){return console.error("Login error:",A),f(zi.networkError),{success:!1,error:zi.networkError}}},[b,h]),w=m.useCallback(async(N,j)=>{try{f(null);const A=await Lt.auth.register(N,j),E=await rl(A);if(!A.ok||!E?.token||!E.user){const T=Bw(E,zi.registrationFailed);return f(T),{success:!1,error:T}}return h(E.user,E.token),c(!1),await b(),{success:!0}}catch(A){return console.error("Registration error:",A),f(zi.networkError),{success:!1,error:zi.networkError}}},[b,h]),C=m.useCallback(()=>{const N=n;g(),N&&Lt.auth.logout().catch(j=>{console.error("Logout endpoint error:",j)})},[g,n]),k=m.useMemo(()=>({user:t,token:n,isLoading:s,needsSetup:l,hasCompletedOnboarding:d,error:p,login:v,register:w,logout:C,refreshOnboardingStatus:x}),[p,d,s,v,C,l,x,w,n,t]);return i.jsx(ZC.Provider,{value:k,children:e})}const sR="pixcode.notification.once.",XC="pixcode.notificationPreferences.v1",oR={action_required:"actionRequired","approval.needed":"actionRequired",stop:"stop","chat.done":"stop","orchestration.done":"stop","run.stopped":"stop",error:"error","run.failed":"error","test.failed":"error","live_view.failed":"error",update:"updates",updates:"updates","push.enabled":"updates","app.update.available":"updates","cli.update.available":"updates"};function lR(e="updates"){try{const t=JSON.parse(localStorage.getItem(XC)??"null");return t?.channels?.desktop===!1?!1:t?.events?.[oR[e]||e]!==!1}catch{return!0}}function Ts(e){try{localStorage.setItem(XC,JSON.stringify(e)),window.dispatchEvent(new CustomEvent("pixcode:notification-preferences-changed"))}catch{}}async function JC({key:e,title:t,body:r,tag:n,data:a}){return QC({key:e,title:t,body:r,event:"updates",tag:n,data:a})}async function QC({key:e,title:t,body:r,event:n="updates",tag:a,data:s}){if(typeof window>"u"||!lR(n))return!1;const o=`${sR}${e}`;try{if(localStorage.getItem(o))return!1}catch{}try{if(await window.pixcodeDesktop?.notify({title:t,body:r,event:n,tag:a,data:s})){try{localStorage.setItem(o,new Date().toISOString())}catch{}return!0}}catch(c){console.warn("Desktop notification bridge failed:",c)}if(!("Notification"in window)||Notification.permission!=="granted")return!1;const l={body:r,icon:"/logo-256.png",badge:"/logo-128.png",tag:a,data:s,renotify:!!a};try{const c="serviceWorker"in navigator?await navigator.serviceWorker.ready.catch(()=>null):null;c?.showNotification?await c.showNotification(t,l):new Notification(t,l);try{localStorage.setItem(o,new Date().toISOString())}catch{}return!0}catch(c){return console.warn("Local notification failed:",c),!1}}const eN={claude:"npm install -g @anthropic-ai/claude-code",cursor:"curl https://cursor.com/install -fsSL | bash",codex:"npm install -g @openai/codex",gemini:"npm install -g @google/gemini-cli",qwen:"npm install -g @qwen-code/qwen-code",opencode:"npm install -g opencode-ai"},Kn={claude:"Claude Code",cursor:"Cursor CLI",codex:"OpenAI Codex",gemini:"Gemini CLI",qwen:"Qwen Code",opencode:"OpenCode"},tN=["claude","cursor","codex","gemini","qwen","opencode"],Uw={claude:"/api/providers/claude/auth/status",cursor:"/api/providers/cursor/auth/status",codex:"/api/providers/codex/auth/status",gemini:"/api/providers/gemini/auth/status",qwen:"/api/providers/qwen/auth/status",opencode:"/api/providers/opencode/auth/status"},$w=(e=!0)=>({claude:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},cursor:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},codex:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},gemini:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},qwen:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},opencode:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null}}),cR="Failed to check authentication status",dR="Unknown error",rN="pixcode.providerAuthStatus.cache.v2",Ad=1440*60*1e3,uR=3600*1e3,pR=15e3;let Hw=0;const mR=e=>e instanceof Error?e.message:dR,hR=e=>(e instanceof DOMException||e instanceof Error)&&e.name==="AbortError",fR=(e,t=null)=>({authenticated:!!e.authenticated,installed:typeof e.installed=="boolean"?e.installed:null,email:e.email??null,method:e.method??null,error:e.error??t,loading:!1,checkedAt:e.checkedAt??new Date().toISOString(),installedVersion:e.installedVersion??null,latestVersion:e.latestVersion??null,updateAvailable:!!e.updateAvailable,versionCheckSkipped:e.versionCheckSkipped??null,fromCache:!!e.fromCache});function zh(){try{const e=JSON.parse(localStorage.getItem(rN)??"null");return!e||typeof e.savedAt!="number"||!e.statuses?null:e}catch{return null}}function gR(e){try{localStorage.setItem(rN,JSON.stringify({savedAt:Date.now(),statuses:e}))}catch{}}function bR(e){const t=zh(),r=$w(!1);return t&&Date.now()-t.savedAt<Ad?Object.fromEntries(tN.map(n=>[n,{...r[n],...t.statuses[n],loading:!1,fromCache:!0}])):$w(e)}function Gw(e,t){if(!t.updateAvailable||!t.latestVersion)return;const r=Kn[e]??e,n=t.installedVersion?` ${t.installedVersion}`:"";JC({key:`cli-update:${e}:${t.latestVersion}`,title:`${r} update available`,body:`${r}${n} can update to ${t.latestVersion}.`,tag:`pixcode-cli-update:${e}`,data:{type:"cli-update",provider:e,latestVersion:t.latestVersion}})}function Lu({initialLoading:e=!0}={}){const[t,r]=m.useState(()=>bR(e)),n=m.useCallback(l=>{r(c=>({...c,[l]:{...c[l],loading:!0,error:null}}))},[]),a=m.useCallback((l,c)=>{r(d=>({...d,[l]:c}))},[]),s=m.useCallback(async(l,c={})=>{const d=zh(),u=d?.statuses?.[l];if(!c.force&&d&&u&&Date.now()-d.savedAt<Ad){const h={...u,loading:!1,fromCache:!0};a(l,h),Gw(l,h);return}n(l);const p=new AbortController,f=window.setTimeout(()=>p.abort(),pR);try{const h=c.force?`${Uw[l]}?refresh=1`:Uw[l],g=await Se(h,{cache:"no-store",signal:p.signal});if(!g.ok){a(l,{authenticated:!1,installed:null,email:null,method:null,loading:!1,error:cR});return}const b=await g.json(),x=fR(b.data);Gw(l,x),r(y=>{const v={...y,[l]:x};return gR(v),v})}catch(h){console.error(`Error checking ${l} auth status:`,h),a(l,{authenticated:!1,installed:null,email:null,method:null,loading:!1,error:hR(h)?"Status check timed out":mR(h)})}finally{window.clearTimeout(f)}},[n,a]),o=m.useCallback(async(l=tN,c={})=>{await Promise.all(l.map(d=>s(d,c)))},[s]);return m.useEffect(()=>{const l=window.setInterval(()=>{const c=Date.now();if(c-Hw<Ad)return;const d=zh();d&&c-d.savedAt<Ad||(Hw=c,o())},uR);return()=>window.clearInterval(l)},[o]),{providerAuthStatus:t,setProviderAuthStatus:r,checkProviderAuthStatus:s,refreshProviderAuthStatuses:o}}const nN="https://auth.openai.com/codex/device",xR=200,aN=100,yR=50,vR=500,wR=20,kR=15,SR=5,CR=2,NR={cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',allowProposedApi:!0,allowTransparency:!1,convertEol:!0,scrollback:1e4,tabStopWidth:4,windowsMode:!1,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#ffffff",cursorAccent:"#1e1e1e",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff",extendedAnsi:["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"]}};function ER(e){if(!e||typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.focus(),t.select();let r=!1;try{r=document.execCommand("copy")}catch{r=!1}finally{document.body.removeChild(t)}return r}async function ia(e){if(!e)return!1;let t=!1;try{typeof navigator<"u"&&navigator.clipboard?.writeText&&(await navigator.clipboard.writeText(e),t=!0)}catch{t=!1}return t||(t=ER(e)),t}function TR(){const e=window.location.protocol==="https:"?"wss:":"ws:",t=localStorage.getItem("auth-token");return t?`${e}//${window.location.host}/shell?token=${encodeURIComponent(t)}`:(console.error("No authentication token found for Shell WebSocket connection"),null)}function AR(e){try{return JSON.parse(e)}catch{return null}}function pi(e,t){e&&e.readyState===WebSocket.OPEN&&e.send(JSON.stringify(t))}const iN=/(?:\u001B\[[0-?]*[ -/]*[@-~]|\u009B[0-?]*[ -/]*[@-~]|\u001B\][^\u0007\u001B]*(?:\u0007|\u001B\\)|\u009D[^\u0007\u009C]*(?:\u0007|\u009C)|\u001B[PX^_][^\u001B]*\u001B\\|[\u0090\u0098\u009E\u009F][^\u009C]*\u009C|\u001B[@-Z\\-_])/g,jR=/Process exited with code (\d+)/,IR="permissionMode-global",_R=1400,Vw=6500;function As(e){try{const t=window.localStorage.getItem(e);if(!t)return{};const r=JSON.parse(t);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch{return{}}}function RR(){const e=window.localStorage.getItem(IR);return typeof e=="string"?e:"default"}function LR(e,t){return e==="yolo"||e==="auto_edit"||e==="plan"||e==="default"?e:t==="bypassPermissions"||t==="acceptEdits"?"yolo":t==="plan"?"plan":"default"}function PR(e){const t=RR(),r=t==="bypassPermissions"||t==="acceptEdits";if(e==="plain-shell")return{permissionMode:"default",skipPermissions:!1};if(e==="claude"){const n=As("claude-settings");return{permissionMode:t,skipPermissions:!!n.skipPermissions||r}}if(e==="cursor"){const n={...As("cursor-settings"),...As("cursor-tools-settings")};return{permissionMode:t,skipPermissions:!!n.skipPermissions||r}}if(e==="codex"){const n=As("codex-settings");return{permissionMode:typeof n.permissionMode=="string"?n.permissionMode:t,skipPermissions:!1}}if(e==="gemini"||e==="qwen"){const n=As(`${e}-settings`);return{permissionMode:LR(n.permissionMode,t),skipPermissions:!1}}if(e==="opencode"){const n=As("opencode-settings");return{permissionMode:n.skipPermissions||r?"bypassPermissions":t,skipPermissions:!!n.skipPermissions||r}}return{permissionMode:t,skipPermissions:r}}function DR(e,t){const r=PR(e);if(!t)return r;const a=(typeof t.permissionMode=="string"&&t.permissionMode.trim()?t.permissionMode.trim():"")||(t.skipPermissions?"bypassPermissions":r.permissionMode),s=a==="bypassPermissions"||a==="acceptEdits"||a==="yolo";return{permissionMode:a,skipPermissions:!!t.skipPermissions||r.skipPermissions||s}}function OR(e,t){return`${e.replace(/(?:\r\n|\r|\n)+$/u,"")}\r`}function Ww(e){return e.current?.__provider||window.localStorage.getItem("selected-provider")||"claude"}function MR(e,t){const r=t.replace(iN,"").toLowerCase();return r.trim()?e==="codex"?/openai codex|directory:\s|tip:\s+use \/init|model:\s/.test(r):e==="claude"?/claude code|welcome to claude|cwd:\s|try ['"]?\/init/.test(r):e==="gemini"?/gemini|type a message|ctrl\+/.test(r):e==="qwen"?/qwen code|qwen|type a message/.test(r):e==="opencode"?/opencode|model:\s|session/.test(r):e==="cursor"?/cursor|agent|model:\s/.test(r):r.length>0:!1}function FR({wsRef:e,terminalRef:t,fitAddonRef:r,selectedProjectRef:n,selectedSessionRef:a,initialCommandRef:s,isPlainShellRef:o,forceNewSessionRef:l,startupInputRef:c,hermesLaunchIdRef:d,permissionOverrideRef:u,onProcessCompleteRef:p,isInitialized:f,autoConnect:h,closeSocket:g,clearTerminalScreen:b,setAuthUrl:x,onOutputRef:y}){const[v,w]=m.useState(!1),[C,k]=m.useState(!1),N=m.useRef(!1),j=m.useRef(!1),A=m.useRef(!1),E=m.useRef(""),T=m.useRef(null),_=m.useCallback(()=>{T.current&&(window.clearTimeout(T.current),T.current=null)},[]),I=m.useCallback(V=>{A.current||T.current||o.current||(T.current=window.setTimeout(()=>{T.current=null;const P=c.current,U=e.current;!P||A.current||o.current||U?.readyState!==WebSocket.OPEN||(Ww(a),pi(U,{type:"input",data:OR(P)}),A.current=!0,c.current=null)},V))},[o,a,c,e]),R=m.useCallback(V=>{if(!c.current||A.current||o.current)return;E.current=`${E.current}${V}`.slice(-12e3);const P=Ww(a);if(MR(P,E.current)){_(),I(_R);return}I(Vw)},[_,o,I,a,c]),S=m.useCallback(V=>{if(!o.current||!p.current)return;const U=V.replace(iN,"");if(U.includes("Process exited with code 0")){p.current(0);return}const H=U.match(jR);if(!H)return;const M=Number.parseInt(H[1],10);!Number.isNaN(M)&&M!==0&&p.current(M)},[o,p]),F=m.useCallback(V=>{const P=AR(V);if(!P){console.error("[Shell] Error handling WebSocket message:",V);return}if(P.type==="output"){const U=typeof P.data=="string"?P.data:"";S(U),R(U);const H=t.current;H?.write(U,()=>{H.refresh(0,Math.max(0,H.rows-1))}),y?.current?.();return}if(P.type==="auth_url"||P.type==="url_open"){const U=typeof P.url=="string"?P.url:"";U&&x(U)}},[S,R,y,x,t]),B=m.useCallback((V=!1)=>{if(!(N.current&&!V||C||v))try{const P=TR();if(!P){N.current=!1,k(!1);return}N.current=!0;const U=new WebSocket(P);e.current=U,U.onopen=()=>{w(!0),k(!1),N.current=!1,x(""),window.setTimeout(()=>{const H=t.current,M=r.current,ee=n.current;if(!H||!M||!ee)return;M.fit();const Q=o.current?"plain-shell":a.current?.__provider||localStorage.getItem("selected-provider")||"claude",ge=DR(Q,u.current),se=typeof c.current=="string"&&c.current.trim()?c.current.trim():null,ce=Q==="codex"&&l.current&&!!se&&!o.current;_(),A.current=!1,E.current="",pi(U,{type:"init",projectPath:ee.fullPath||ee.path||"",sessionId:o.current?null:a.current?.id||null,hasSession:o.current?!1:!!a.current,provider:Q,cols:H.cols,rows:H.rows,initialCommand:s.current,isPlainShell:o.current,forceNewSession:l.current,startupInput:ce?se:null,hermesLaunchId:typeof d.current=="number"?d.current:null,permissionMode:ge.permissionMode,skipPermissions:ge.skipPermissions}),ce?(A.current=!0,c.current=null):c.current&&!o.current&&I(Vw)},aN)},U.onmessage=H=>{const M=typeof H.data=="string"?H.data:String(H.data??"");F(M)},U.onclose=()=>{w(!1),k(!1),N.current=!1,b()},U.onerror=()=>{w(!1),k(!1),N.current=!1}}catch{w(!1),k(!1),N.current=!1}},[b,r,l,d,F,s,v,C,o,u,_,I,n,a,x,c,t,e]),z=m.useCallback(()=>{!f||v||C||N.current||(j.current=!1,N.current=!0,k(!0),B(!0))},[B,v,C,f]),q=m.useCallback((V=!0)=>{V&&(j.current=!0),g(),_(),b(),w(!1),k(!1),N.current=!1,x("")},[_,b,g,x]);return m.useEffect(()=>{!h||j.current||!f||C||v||z()},[h,z,v,C,f]),{isConnected:v,isConnecting:C,closeSocket:g,connectToShell:z,disconnectFromShell:q}}var zR=JI(),Ep={exports:{}},qw;function BR(){return qw||(qw=1,function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(o,l)=>{function c(u){try{const p=new URL(u),f=p.password&&p.username?`${p.protocol}//${p.username}:${p.password}@${p.host}`:p.username?`${p.protocol}//${p.username}@${p.host}`:`${p.protocol}//${p.host}`;return u.toLocaleLowerCase().startsWith(f.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(u,p,f,h={}){this._terminal=u,this._regex=p,this._handler=f,this._options=h}provideLinks(u,p){const f=d.computeLink(u,this._regex,this._terminal,this._handler);p(this._addCallbacks(f))}_addCallbacks(u){return u.map(p=>(p.leave=this._options.leave,p.hover=(f,h)=>{if(this._options.hover){const{range:g}=p;this._options.hover(f,h,g)}},p))}};class d{static computeLink(p,f,h,g){const b=new RegExp(f.source,(f.flags||"")+"g"),[x,y]=d._getWindowedLineStrings(p-1,h),v=x.join("");let w;const C=[];for(;w=b.exec(v);){const k=w[0];if(!c(k))continue;const[N,j]=d._mapStrIdx(h,y,0,w.index),[A,E]=d._mapStrIdx(h,N,j,k.length);if(N===-1||j===-1||A===-1||E===-1)continue;const T={start:{x:j+1,y:N+1},end:{x:E,y:A+1}};C.push({range:T,text:k,activate:g})}return C}static _getWindowedLineStrings(p,f){let h,g=p,b=p,x=0,y="";const v=[];if(h=f.buffer.active.getLine(p)){const w=h.translateToString(!0);if(h.isWrapped&&w[0]!==" "){for(x=0;(h=f.buffer.active.getLine(--g))&&x<2048&&(y=h.translateToString(!0),x+=y.length,v.push(y),h.isWrapped&&y.indexOf(" ")===-1););v.reverse()}for(v.push(w),x=0;(h=f.buffer.active.getLine(++b))&&h.isWrapped&&x<2048&&(y=h.translateToString(!0),x+=y.length,v.push(y),y.indexOf(" ")===-1););}return[v,g]}static _mapStrIdx(p,f,h,g){const b=p.buffer.active,x=b.getNullCell();let y=h;for(;g;){const v=b.getLine(f);if(!v)return[-1,-1];for(let w=y;w<v.length;++w){v.getCell(w,x);const C=x.getChars();if(x.getWidth()&&(g-=C.length||1,w===v.length-1&&C==="")){const k=b.getLine(f+1);k&&k.isWrapped&&(k.getCell(0,x),x.getWidth()===2&&(g+=1))}if(g<0)return[f,w]}f++,y=0}return[f,y]}}l.LinkComputer=d}},n={};function a(o){var l=n[o];if(l!==void 0)return l.exports;var c=n[o]={exports:{}};return r[o](c,c.exports,a),c.exports}var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.WebLinksAddon=void 0;const l=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(u,p){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}o.WebLinksAddon=class{constructor(u=d,p={}){this._handler=u,this._options=p}activate(u){this._terminal=u;const p=this._options,f=p.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,f,this._handler,p))}dispose(){this._linkProvider?.dispose()}}})(),s})())}(Ep)),Ep.exports}var UR=BR(),$R=QI();function sN(e){return typeof e=="string"&&/\bcodex\s+login\b/i.test(e)}function HR(e,t){return sN(e)?nN:t}function GR(e){return e?e.__provider==="cursor"?e.name||"Untitled Session":e.summary||"New Session":null}const Kw="shell-xterm-focus-style",VR=`
|
|
11
11
|
.xterm .xterm-screen {
|
|
12
12
|
outline: none !important;
|
|
13
13
|
}
|
|
@@ -217,7 +217,7 @@ import{j as i,a as RC,R as LC,o as PC,_ as TI,b as AI,T as DC,P as OC,S as dc,E
|
|
|
217
217
|
*
|
|
218
218
|
* This source code is licensed under the ISC license.
|
|
219
219
|
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const pD=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],mD=jt("workflow",pD),vN=lN,hD=b7,Zw=m7,fD=a7,wN=c7,gD=oN,Pn=uN,pc=Q7,Dn=t8,bD=n8,Tn=u7,Xn=oN,Kd=f7,kN=o7,Pu=K7,Gl=Z7,vg=y7,it=cN,Ft=cN,mc=S7,SN=w7,xD=oL,Yn=A8,kr=I8,tr=W7,Ua=G7,CN=K8,Fr=EL,hc=fN,yD=fN,Yd=D7,go=i8,Lo=pN,as=d8,bo=v8,jr=k8,$r=B8,On=O8,ki=F8,vD=pL,wD=W8,wg=Q8,kg=vL,kD=N7,SD=M7,CD=zL,NN=hN,Bh=cL,ND=$8,Uh=hN,EN=hL,Zt=gL,Pr=UL,TN=C8,ps=nL,At=gN,$h=gN,fc=LL,Sg=_7,ED=j7,Hh=T7,TD=E8,Mn=dN,AD=dN,jD=HL,ms=VL,Cg=U7,xo=z7,Ng=l8,gc=P8,Eg=R8,fn=G8,Po=pN,bc=mN,ID=mN,AN=X8,kn=tL,jN=iL,Du=g8,IN=ML,_D=xL,Si=CL,RD=kL,Ut=p8,_N=e7,xc=x8,Fn=jL,yi=_L,RN=DL,Xr=h8,Tg=L7,LD=tP,bs=oP,Ag=xN,PD=xN,Hr=$P,jd=GP,Ou=WP,js=QL,Is=nP,DD=iP,xl=cP,no=uP,Xw=hP,yl=gP,nl=vP,OD=kP,LN=PP,Gh=CP,ra=AP,al=EP,Jw=IP,il=RP,Vh=OP,MD=FP,Wh=BP,Xs=ZP,vl=JP,ti=eD,_s=rD,FD=aD,qh=sD,zD=cD,sl=uD,_r=mD,jg=xP,BD=KP,UD=[{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"}],$D={up:hD,down:vN,left:fD,right:wN},ol=e=>e.preventDefault(),Qw="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",HD="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",Tp="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 ek({wsRef:e,terminalRef:t,isConnected:r,bottomOffset:n="bottom-0"}){const{t:a}=Be("settings"),[s,o]=m.useState(!1),[l,c]=m.useState(!1),d=m.useCallback(h=>{pi(e.current,{type:"input",data:h})},[e]),u=m.useCallback(()=>{t.current?.scrollToBottom()},[t]),p=m.useCallback(async()=>{if(!(typeof navigator>"u"||!navigator.clipboard?.readText))try{const h=await navigator.clipboard.readText();h.length>0&&d(h)}catch{}},[d]),f=m.useCallback(h=>{let g=h;if(s&&h.length===1){const b=h.toLowerCase().charCodeAt(0);b>=97&&b<=122&&(g=String.fromCharCode(b-96)),o(!1)}l&&h.length===1&&(g="\x1B"+g,c(!1)),d(g)},[s,l,d]);return i.jsx("div",{className:`pointer-events-none fixed inset-x-0 ${n} z-20 px-2 md:hidden`,children:i.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:[i.jsx("button",{type:"button",onPointerDown:ol,onClick:()=>{p()},disabled:!r,className:Tp,title:a("terminalShortcuts.paste",{defaultValue:"Paste"}),"aria-label":a("terminalShortcuts.paste",{defaultValue:"Paste"}),children:i.jsx(go,{className:"h-4 w-4"})}),UD.map(h=>{if(h.type==="modifier"){const g=h.modifier==="ctrl"?s:l,b=h.modifier==="ctrl"?()=>o(x=>!x):()=>c(x=>!x);return i.jsx("button",{type:"button",onPointerDown:ol,onClick:b,disabled:!r,className:g?HD:Qw,children:h.label},h.id)}if(h.type==="arrow"){const g=$D[h.icon];return i.jsx("button",{type:"button",onPointerDown:ol,onClick:()=>d(h.sequence),disabled:!r,className:Tp,children:i.jsx(g,{className:"h-4 w-4"})},h.id)}return i.jsx("button",{type:"button",onPointerDown:ol,onClick:()=>f(h.sequence),disabled:!r,className:Qw,children:h.label},h.id)}),i.jsx("button",{type:"button",onPointerDown:ol,onClick:u,disabled:!r,className:Tp,title:a("terminalShortcuts.scrollDown"),"aria-label":a("terminalShortcuts.scrollDown"),children:i.jsx(gD,{className:"h-4 w-4"})})]})})}function GD({selectedProject:e=null,selectedSession:t=null,initialCommand:r=null,isPlainShell:n=!1,onProcessComplete:a=null,minimal:s=!1,autoConnect:o=!1,forceNewSession:l=!1,startupInput:c=null,hermesLaunchId:d=null,permissionOverride:u=null,isActive:p=!0,onClose:f=null}){const{t:h}=Be("chat"),[g,b]=m.useState(!1),[x,y]=m.useState(null),v=m.useRef(null),w=m.useRef(null),{terminalContainerRef:C,terminalRef:k,wsRef:N,isConnected:j,isInitialized:A,isConnecting:E,authUrl:T,authUrlVersion:_,connectToShell:I,disconnectFromShell:R,openAuthUrlInBrowser:S,copyAuthUrlToClipboard:F}=KR({selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:n,minimal:s,autoConnect:o,forceNewSession:l,startupInput:c,hermesLaunchId:d,permissionOverride:u,isRestarting:g,onProcessComplete:a,onOutputRef:w}),B=m.useCallback(()=>{const pe=k.current;if(!pe)return;const ve=pe.buffer.active,ue=ve.baseY+ve.cursorY,de=Math.min(ve.baseY+ve.length-1,ue+10),D=Math.max(0,ue-wR),X=[];for(let me=D;me<=de;me++){const we=ve.getLine(me);we&&X.push(we.translateToString().trimEnd())}let oe=-1;for(let me=X.length-1;me>=0;me--)if(/esc to cancel/i.test(X[me])||/enter to select/i.test(X[me])){oe=me;break}if(oe===-1){y(null);return}const K=new Map,W=Math.max(0,oe-kR);for(let me=oe-1;me>=W;me--){const we=X[me].match(/^\s*[❯›>]?\s*(\d+)\.\s+(.+)/);if(we){const le=we[1],Ae=we[2].trim();parseInt(le,10)<=SR&&Ae.length>0&&!K.has(le)&&K.set(le,Ae)}}const ne=[];for(let me=1;me<=K.size&&K.has(String(me));me++)ne.push({number:String(me),label:K.get(String(me))});y(ne.length>=CR?ne:null)},[k]),z=m.useCallback(()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(B,vR)},[B]);m.useEffect(()=>{w.current=z},[z]),m.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]),m.useEffect(()=>{j||(v.current&&(clearTimeout(v.current),v.current=null),y(null))},[j]),m.useEffect(()=>{if(!p||!A||!j)return;const pe=()=>{k.current?.focus()},ve=window.requestAnimationFrame(pe),ue=window.setTimeout(pe,0);return()=>{window.cancelAnimationFrame(ve),window.clearTimeout(ue)}},[p,j,A,k]);const q=m.useCallback(pe=>{pi(N.current,{type:"input",data:pe})},[N]),V=m.useMemo(()=>GR(t),[t]),P=m.useMemo(()=>t?.__provider?t.__provider:window.localStorage.getItem("selected-provider")||"claude",[t?.__provider]),U=Kn[P]??"Claude Code",H=m.useMemo(()=>V?V.slice(0,30):null,[V]),M=m.useMemo(()=>V?V.slice(0,50):null,[V]),ee=m.useCallback(()=>{b(!0),window.setTimeout(()=>{b(!1)},xR)},[]),Q=m.useCallback(()=>{R(),f?.()},[R,f]);if(!e)return i.jsx(ZR,{title:h("shell.selectProject.title"),description:h("shell.selectProject.description")});if(s)return i.jsxs(i.Fragment,{children:[i.jsx(JR,{terminalContainerRef:C,authUrl:T,authUrlVersion:_,initialCommand:r,isConnected:j,openAuthUrlInBrowser:S,copyAuthUrlToClipboard:F}),i.jsx(ek,{wsRef:N,terminalRef:k,isConnected:j,bottomOffset:"bottom-0"})]});const ge=n?h("shell.runCommand",{command:r||h("shell.defaultCommand"),projectName:e.displayName}):t?h("shell.resumeSession",{displayName:M}):h("shell.startProviderSession",{provider:U,defaultValue:"Start a new {{provider}} session"}),se=n?h("shell.runCommand",{command:r||h("shell.defaultCommand"),projectName:e.displayName}):h("shell.startProviderCli",{provider:U,projectName:e.displayName,defaultValue:"Starting {{provider}} in {{projectName}}"}),ce=A?E?"connecting":j?null:"connect":"loading",ye=ce==="connecting"?se:ge;return i.jsxs("div",{className:"flex h-full w-full flex-col bg-gray-900",children:[i.jsx(XR,{isConnected:j,isInitialized:A,isRestarting:g,hasSession:!!t,sessionDisplayNameShort:H,onDisconnect:Q,onRestart:ee,statusNewSessionText:h("shell.status.newSession"),statusInitializingText:h("shell.status.initializing"),statusRestartingText:h("shell.status.restarting"),disconnectLabel:h("shell.actions.disconnect"),disconnectTitle:h("shell.actions.disconnectTitle"),restartLabel:h("shell.actions.restart"),restartTitle:h("shell.actions.restartTitle"),disableRestart:g||j}),i.jsxs("div",{className:"relative flex-1 overflow-hidden p-2",children:[i.jsx("div",{ref:C,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),ce&&i.jsx(YR,{mode:ce,description:ye,loadingLabel:h("shell.loading"),connectLabel:h("shell.actions.connect"),connectTitle:h("shell.actions.connectTitle"),connectingLabel:h("shell.connecting"),onConnect:I}),x&&j&&i.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:pe=>pe.preventDefault(),children:i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x.map(pe=>i.jsxs("button",{type:"button",onClick:()=>{q(`${pe.number}\r`),y(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:`${pe.number}. ${pe.label}`,children:[pe.number,". ",pe.label]},pe.number)),i.jsx("button",{type:"button",onClick:()=>{q("\x1B"),y(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"})]})})]}),i.jsx(ek,{wsRef:N,terminalRef:k,isConnected:j})]})}function VD({className:e}){return i.jsx("div",{className:`flex h-full items-center justify-center ${e}`,children:i.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[i.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:i.jsx("svg",{className:"h-8 w-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.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"})})}),i.jsx("h3",{className:"mb-2 text-lg font-semibold",children:"No Project Selected"}),i.jsx("p",{children:"A project is required to open a shell"})]})})}function WD({title:e,isCompleted:t,onClose:r=null}){return i.jsx("div",{className:"flex-shrink-0 border-b border-gray-700 bg-gray-800 px-4 py-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-200",children:e}),t&&i.jsx("span",{className:"text-xs text-green-400",children:"(Completed)"})]}),r&&i.jsx("button",{onClick:r,className:"text-gray-400 hover:text-white",title:"Close",children:i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})}function Vl({project:e=null,session:t=null,command:r=null,isPlainShell:n=null,isActive:a=!0,autoConnect:s=!0,onComplete:o=null,onClose:l=null,title:c=null,className:d="",showHeader:u=!0,compact:p=!1,minimal:f=!1,forceNewSession:h=!1,startupInput:g=null,hermesLaunchId:b=null,permissionOverride:x=null}){const[y,v]=m.useState(!1),w=n!==null?n:r!==null,C=m.useCallback(k=>{v(!0),o?.(k)},[o]);return e?i.jsxs("div",{className:`flex h-full w-full flex-col ${d}`,children:[!f&&u&&c&&i.jsx(WD,{title:c,isCompleted:y,onClose:l}),i.jsx("div",{className:"min-h-0 w-full flex-1",children:i.jsx(GD,{selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:w,isActive:a,onProcessComplete:C,minimal:f,autoConnect:f?!0:s,forceNewSession:h,startupInput:g,hermesLaunchId:b,permissionOverride:x,onClose:l})})]}):i.jsx(VD,{className:d})}const qD=(e,t)=>t||(e==="claude"?"claude --dangerously-skip-permissions /login":e==="cursor"?"cursor-agent login":e==="codex"?"codex login":e==="qwen"?"qwen auth":e==="opencode"?"opencode auth login":"gemini"),KD={claude:{keyLabel:"Anthropic API Key",keyExample:"sk-ant-...",supportsBaseUrl:!0,baseUrlExample:"https://api.anthropic.com",keyConsoleUrl:"https://console.anthropic.com/settings/keys",keyConsoleLabel:"Anthropic Console"},codex:{keyLabel:"OpenAI API Key",keyExample:"sk-...",supportsBaseUrl:!0,baseUrlExample:"https://api.openai.com/v1",keyConsoleUrl:"https://platform.openai.com/api-keys",keyConsoleLabel:"OpenAI Platform"},gemini:{keyLabel:"Gemini API Key",keyExample:"AI...",supportsBaseUrl:!1,keyConsoleUrl:"https://aistudio.google.com/app/apikey",keyConsoleLabel:"Google AI Studio"},qwen:{keyLabel:"OpenAI-Compatible API Key",keyExample:"sk-... or sk-sp-...",supportsBaseUrl:!0,baseUrlExample:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",keyConsoleUrl:"https://github.com/QwenLM/qwen-code",keyConsoleLabel:"Qwen Code Docs",notes:"Accepts any OpenAI-compatible endpoint — Alibaba Cloud, ModelScope, OpenRouter, self-hosted, etc."},opencode:{keyLabel:"Anthropic API Key (default backend)",keyExample:"sk-ant-...",supportsBaseUrl:!0,baseUrlExample:"https://api.anthropic.com",keyConsoleUrl:"https://console.anthropic.com/settings/keys",keyConsoleLabel:"Anthropic Console",notes:"OpenCode is multi-provider — this sets the Anthropic credentials. Switch providers via `opencode auth login` or opencode.json."}};function tk({active:e,children:t,onClick:r}){return i.jsx("button",{onClick:r,className:`flex-1 border-b-2 px-4 py-2.5 text-sm font-medium transition-colors ${e?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:t})}function YD({provider:e}){const[t,r]=m.useState(""),[n,a]=m.useState(!1),[s,o]=m.useState("idle"),[l,c]=m.useState(null),d=async()=>{const u=t.trim();if(u){a(!0),c(null),o("idle");try{const p=await Se(`/api/providers/${e}/oauth-paste`,{method:"POST",body:JSON.stringify({callbackUrl:u})}),f=await p.json().catch(()=>({}));if(!p.ok||!f?.success)throw new Error(f?.error||`Request failed (${p.status})`);o("ok"),r("")}catch(p){c(p?.message||"Forward failed"),o("error")}finally{a(!1)}}};return i.jsxs("div",{className:"mt-3 rounded-lg border border-border/60 bg-muted/30 p-3 text-sm",children:[i.jsx("div",{className:"mb-2 font-medium text-foreground",children:"Remote login? Paste the callback URL here"}),i.jsxs("p",{className:"mb-3 text-xs text-muted-foreground",children:["When the CLI shows ",i.jsx("code",{className:"rounded bg-background px-1 font-mono text-[11px]",children:"http://127.0.0.1:PORT/…"})," and your browser can't reach it (VPS setups), copy the failing URL from your address bar and paste it below. Pixcode forwards the token exchange to the CLI process on this host."]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",value:t,onChange:u=>r(u.target.value),placeholder:"http://127.0.0.1:49312/callback?code=...",className:"flex-1 rounded-md border border-border bg-background px-3 py-2 font-mono text-xs text-foreground focus:border-primary focus:outline-none",onKeyDown:u=>{u.key==="Enter"&&d()}}),i.jsx("button",{onClick:()=>void d(),disabled:n||!t.trim(),className:"flex items-center gap-1.5 rounded-md bg-foreground px-3 py-2 text-xs font-medium text-background transition-opacity hover:opacity-90 disabled:opacity-40",children:n?i.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin"}):"Forward"})]}),s==="ok"&&i.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-emerald-600 dark:text-emerald-400",children:[i.jsx(tr,{className:"h-3.5 w-3.5"})," Forwarded — check the terminal above for the completion message."]}),s==="error"&&l&&i.jsx("div",{className:"mt-2 text-xs text-red-600 dark:text-red-400",children:l})]})}function ZD({provider:e,onSaved:t}){const r=KD[e],[n,a]=m.useState(""),[s,o]=m.useState(""),[l,c]=m.useState(!1),[d,u]=m.useState("idle"),[p,f]=m.useState(null);m.useEffect(()=>{let g=!1;return(async()=>{try{const x=await(await Se("/api/providers/credentials")).json().catch(()=>({}));if(g||!x?.success)return;const y=x.data?.[e];y?.baseUrl&&o(y.baseUrl)}catch{}})(),()=>{g=!0}},[e]);const h=async()=>{const g=n.trim();if(g){c(!0),f(null),u("idle");try{const b=await Se(`/api/providers/${e}/auth/api-key`,{method:"POST",body:JSON.stringify({apiKey:g,baseUrl:r.supportsBaseUrl&&s.trim()?s.trim():""})}),x=await b.json().catch(()=>({}));if(!b.ok||!x?.success)throw new Error(x?.error||`Request failed (${b.status})`);u("ok"),a(""),t()}catch(b){f(b?.message||"Save failed"),u("error")}finally{c(!1)}}};return r?i.jsx("div",{className:"flex h-full flex-col overflow-y-auto p-6",children:i.jsxs("div",{className:"mx-auto w-full max-w-lg space-y-5",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-muted",children:i.jsx(ID,{className:"h-5 w-5 text-foreground"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-base font-semibold text-foreground",children:r.keyLabel}),i.jsxs("a",{href:r.keyConsoleUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:["Get a key from ",r.keyConsoleLabel,i.jsx(Tn,{className:"h-3 w-3"})]})]})]}),r.notes&&i.jsx("div",{className:"rounded-md border border-border/60 bg-muted/40 p-3 text-xs text-muted-foreground",children:r.notes}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-foreground",children:"API Key"}),i.jsx("input",{type:"password",value:n,onChange:g=>a(g.target.value),placeholder:r.keyExample,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-sm text-foreground focus:border-primary focus:outline-none",autoComplete:"off",spellCheck:!1}),i.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Stored locally at ",i.jsx("code",{className:"rounded bg-muted px-1 font-mono text-[10px]",children:"~/.pixcode/provider-credentials.json"})," with 0600 permissions."]})]}),r.supportsBaseUrl&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs font-medium text-foreground",children:["Base URL ",i.jsx("span",{className:"font-normal text-muted-foreground",children:"(optional — use a custom endpoint)"})]}),i.jsx("input",{type:"url",value:s,onChange:g=>o(g.target.value),placeholder:r.baseUrlExample,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-sm text-foreground focus:border-primary focus:outline-none",autoComplete:"off",spellCheck:!1}),i.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Point at any OpenAI-compatible proxy (OpenRouter, local LLM, self-hosted, budget provider) to cut costs or hit different models."})]}),i.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[i.jsxs("button",{onClick:()=>void h(),disabled:l||!n.trim(),className:"inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background transition-opacity hover:opacity-90 disabled:opacity-40",children:[l?i.jsx(Ft,{className:"h-4 w-4 animate-spin"}):i.jsx(tr,{className:"h-4 w-4"}),"Save API Key"]}),d==="ok"&&i.jsx("span",{className:"text-xs text-emerald-600 dark:text-emerald-400",children:"Saved — reconnect to pick it up."}),d==="error"&&p&&i.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:p})]})]})}):i.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This provider uses OAuth only — use the Browser tab to log in."})}function PN({isOpen:e,onClose:t,provider:r="claude",onComplete:n,customCommand:a,isAuthenticated:s=!1}){const{t:o}=Be("common"),l=r!=="cursor",[c,d]=m.useState(l?"apiKey":"browser");m.useEffect(()=>{e&&d(l?"apiKey":"browser")},[e,r,l]);const u=m.useMemo(()=>`${Kn[r]??r} Login`,[r]);if(!e)return null;const p=qD(r,a),f=h=>n?.(h);return i.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:i.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:[i.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 p-4 dark:border-gray-700",children:[i.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:u}),i.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:i.jsx(At,{className:"h-6 w-6"})})]}),i.jsxs("div",{className:"flex border-b border-gray-200 dark:border-gray-700",children:[i.jsx(tk,{active:c==="browser",onClick:()=>d("browser"),children:"Browser / OAuth"}),l&&i.jsx(tk,{active:c==="apiKey",onClick:()=>d("apiKey"),children:"API Key"})]}),i.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:c==="browser"?i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsx("div",{className:"min-h-0 flex-1",children:i.jsx(Vl,{project:tR,command:p,onComplete:f,minimal:!0})}),i.jsx("div",{className:"border-t border-border/40 bg-background/50 px-4 py-3",children:i.jsx(YD,{provider:r})})]}):i.jsx(ZD,{provider:r,onSaved:()=>f(0)})})]})})}const XD=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/claude-ai-icon.svg",alt:"Claude",className:e}),JD=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Xa();return i.jsx("img",{src:t?"/icons/codex-white.svg":"/icons/codex.svg",alt:"Codex",className:e})},QD=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Xa();return i.jsx("img",{src:t?"/icons/cursor-white.svg":"/icons/cursor.svg",alt:"Cursor",className:e})},eO=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/gemini-ai-icon.svg",alt:"Gemini",className:e}),tO=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Xa(),r=t?"/icons/opencode-logo-dark.svg":"/icons/opencode-logo-light.svg";return i.jsx("img",{src:r,alt:"OpenCode",className:e})},rO=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/qwen-logo.svg",alt:"Qwen Code",className:e});function dr({provider:e="claude",className:t="w-5 h-5"}){return e==="cursor"?i.jsx(QD,{className:t}):e==="codex"?i.jsx(JD,{className:t}):e==="gemini"?i.jsx(eO,{className:t}):e==="qwen"?i.jsx(rO,{className:t}):e==="opencode"?i.jsx(tO,{className:t}):e==="hermes"?i.jsx(_r,{className:t}):i.jsx(XD,{className:t})}function nO({provider:e,title:t,status:r,connectedClassName:n,iconContainerClassName:a,loginButtonClassName:s,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 i.jsx("div",{className:`rounded-lg border p-4 transition-colors ${l}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-full ${a}`,children:i.jsx(dr,{provider:e,className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 font-medium text-foreground",children:[t,r.authenticated&&i.jsx(tr,{className:"h-4 w-4 text-green-500"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:c})]})]}),!r.authenticated&&!r.loading&&i.jsx("button",{onClick:o,className:`${s} rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors`,children:"Login"})]})})}const aO=[{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"},{provider:"qwen",title:"Qwen Code",connectedClassName:"bg-orange-50 dark:bg-orange-900/20 border-orange-200 dark:border-orange-800",iconContainerClassName:"bg-orange-100 dark:bg-orange-900/30",loginButtonClassName:"bg-orange-600 hover:bg-orange-700"}];function rk({providerStatuses:e,onOpenProviderLogin:t}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"mb-6 text-center",children:[i.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",children:"Connect Your AI Agents"}),i.jsx("p",{className:"text-muted-foreground",children:"Login to one or more AI coding assistants. All are optional."})]}),i.jsx("div",{className:"space-y-3",children:aO.map(r=>i.jsx(nO,{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))}),i.jsx("div",{className:"pt-2 text-center text-sm text-muted-foreground",children:i.jsx("p",{children:"You can configure these later in Settings."})})]})}function iO({gitName:e,gitEmail:t,isSubmitting:r,onGitNameChange:n,onGitEmailChange:a}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"mb-8 text-center",children:[i.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:i.jsx(Hr,{className:"h-8 w-8 text-blue-600 dark:text-blue-400"})}),i.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",children:"Git Configuration"}),i.jsx("p",{className:"text-muted-foreground",children:"Configure your git identity to ensure proper attribution for commits."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitName",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[i.jsx(jD,{className:"h-4 w-4"}),"Git Name ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"text",id:"gitName",value:e,onChange:s=>n(s.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}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.name`."})]}),i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitEmail",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[i.jsx(TD,{className:"h-4 w-4"}),"Git Email ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"email",id:"gitEmail",value:t,onChange:s=>a(s.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}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.email`."})]})]})]})}const nk=[{title:"Git Configuration",icon:Hr,required:!0},{title:"Connect Agents",icon:kN,required:!1}];function sO({currentStep:e}){return i.jsx("div",{className:"mb-8",children:i.jsx("div",{className:"flex items-center justify-between",children:nk.map((t,r)=>{const n=r<e,a=r===e,s=t.icon;return i.jsxs("div",{className:"contents",children:[i.jsxs("div",{className:"flex flex-1 flex-col items-center",children:[i.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?i.jsx(tr,{className:"h-6 w-6"}):i.jsx(s,{className:"h-6 w-6"})}),i.jsxs("div",{className:"mt-2 text-center",children:[i.jsx("p",{className:`text-sm font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:t.title}),t.required&&i.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),r<nk.length-1&&i.jsx("div",{className:`mx-2 h-0.5 flex-1 transition-colors duration-200 ${n?"bg-green-500":"bg-border"}`})]},t.title)})})})}const ak=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ik=async(e,t)=>{try{return(await e.json()).error||t}catch{return t}};function oO({onComplete:e}){const[t,r]=m.useState(0),[n,a]=m.useState(""),[s,o]=m.useState(""),[l,c]=m.useState(!1),[d,u]=m.useState(""),[p,f]=m.useState(null),{providerAuthStatus:h,checkProviderAuthStatus:g,refreshProviderAuthStatuses:b}=Lu(),x=m.useRef(void 0),y=m.useCallback(async()=>{try{const A=await Se("/api/user/git-config");if(!A.ok)return;const E=await A.json();E.gitName&&a(E.gitName),E.gitEmail&&o(E.gitEmail)}catch(A){console.error("Error loading git config:",A)}},[]);m.useEffect(()=>{y(),b()},[y,b]),m.useEffect(()=>{const A=x.current;x.current=p,A!=null&&p===null&&b()},[p,b]);const v=A=>{f(A)},w=A=>{A===0&&p&&g(p)},C=async()=>{if(u(""),t!==0){r(A=>A+1);return}if(!n.trim()||!s.trim()){u("Both git name and email are required.");return}if(!ak.test(s)){u("Please enter a valid email address.");return}c(!0);try{const A=await Se("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:n,gitEmail:s})});if(!A.ok){const E=await ik(A,"Failed to save git configuration");throw new Error(E)}r(E=>E+1)}catch(A){u(A instanceof Error?A.message:"Failed to save git configuration")}finally{c(!1)}},k=()=>{u(""),r(A=>A-1)},N=async()=>{c(!0),u("");try{const A=await Se("/api/user/complete-onboarding",{method:"POST"});if(!A.ok){const E=await ik(A,"Failed to complete onboarding");throw new Error(E)}await e?.()}catch(A){u(A instanceof Error?A.message:"Failed to complete onboarding")}finally{c(!1)}},j=t===0?!!(n.trim()&&s.trim()&&ak.test(s)):!0;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"w-full max-w-2xl",children:[i.jsx(sO,{currentStep:t}),i.jsxs("div",{className:"rounded-lg border border-border bg-card p-8 shadow-lg",children:[t===0?i.jsx(iO,{gitName:n,gitEmail:s,isSubmitting:l,onGitNameChange:a,onGitEmailChange:o}):t===1?i.jsx(rk,{providerStatuses:h,onOpenProviderLogin:v}):i.jsx(rk,{providerStatuses:h,onOpenProviderLogin:v}),d&&i.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:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:d})}),i.jsxs("div",{className:"mt-8 flex items-center justify-between border-t border-border pt-6",children:[i.jsxs("button",{onClick:k,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:[i.jsx(pc,{className:"h-4 w-4"}),"Previous"]}),i.jsx("div",{className:"flex items-center gap-3",children:t<1?i.jsx("button",{onClick:C,disabled:!j||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?i.jsxs(i.Fragment,{children:[i.jsx(Ft,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(Dn,{className:"h-4 w-4"})]})}):i.jsx("button",{onClick:N,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?i.jsxs(i.Fragment,{children:[i.jsx(Ft,{className:"h-4 w-4 animate-spin"}),"Completing..."]}):i.jsxs(i.Fragment,{children:[i.jsx(tr,{className:"h-4 w-4"}),"Complete Setup"]})})})]})]})]})}),p&&i.jsx(PN,{isOpen:!!p,onClose:()=>f(null),provider:p,onComplete:w})]})}const lO=["0s","0.1s","0.2s"];function cO(){return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:i.jsx(Mn,{className:"h-8 w-8 text-primary-foreground"})})}),i.jsx("h1",{className:"mb-2 text-2xl font-bold text-foreground",children:"Pixcode"}),i.jsx("div",{className:"flex items-center justify-center space-x-2",children:lO.map(e=>i.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-blue-500",style:{animationDelay:e}},e))}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:"Loading..."})]})})}function DN({errorMessage:e}){return e?i.jsx("div",{className:"rounded-md border border-red-300 bg-red-100 p-3 dark:border-red-800 dark:bg-red-900/20",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:e})}):null}function Xi({id:e,label:t,value:r,onChange:n,placeholder:a,isDisabled:s,type:o="text",name:l,autoComplete:c}){return i.jsxs("div",{children:[i.jsx("label",{htmlFor:e,className:"mb-1 block text-sm font-medium text-foreground",children:t}),i.jsx("input",{id:e,type:o,name:l??e,autoComplete:c,value:r,onChange:d=>n(d.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:s})]})}function ON({title:e,description:t,children:r,footerText:n,logo:a}){return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsx("div",{className:"w-full max-w-md",children:i.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-8 shadow-lg",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:a??i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:i.jsx(Mn,{className:"h-8 w-8 text-primary-foreground"})})}),i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:e}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:t})]}),r,i.jsx("div",{className:"text-center",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:n})}),i.jsxs("div",{className:"flex items-center justify-center gap-1.5 pt-2",children:[i.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.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"})}),i.jsx("a",{href:"https://github.com/alicomert/pixcode",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground/50 transition-colors hover:text-muted-foreground",children:"Pixcode is open source"})]})]})})})}const dO={username:"",password:""};function uO(){const{t:e}=Be("auth"),{login:t}=uc(),[r,n]=m.useState(dO),[a,s]=m.useState(""),[o,l]=m.useState(!1),c=m.useCallback((u,p)=>{n(f=>({...f,[u]:p}))},[]),d=m.useCallback(async u=>{if(u.preventDefault(),s(""),!r.username.trim()||!r.password){s(e("login.errors.requiredFields"));return}l(!0);const p=await t(r.username.trim(),r.password);p.success||s(p.error),l(!1)},[r.password,r.username,t,e]);return i.jsx(ON,{title:e("login.title"),description:e("login.description"),footerText:"Enter your credentials to access Pixcode",children:i.jsxs("form",{onSubmit:d,className:"space-y-4",children:[i.jsx(Xi,{id:"username",label:e("login.username"),value:r.username,onChange:u=>c("username",u),placeholder:e("login.placeholders.username"),isDisabled:o,autoComplete:"username"}),i.jsx(Xi,{id:"password",label:e("login.password"),value:r.password,onChange:u=>c("password",u),placeholder:e("login.placeholders.password"),isDisabled:o,type:"password",autoComplete:"current-password"}),i.jsx(DN,{errorMessage:a}),i.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 pO={username:"",password:"",confirmPassword:"",connectionMode:"local",remoteUrl:"",remoteApiKey:""};function mO(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.":e.connectionMode==="remote"&&!e.remoteUrl.trim()?"Remote Pixcode server URL is required.":null}function hO(){const{register:e}=uc(),[t,r]=m.useState(pO),[n,a]=m.useState(""),[s,o]=m.useState(!1),l=m.useCallback((d,u)=>{r(p=>({...p,[d]:u}))},[]),c=m.useCallback(async d=>{d.preventDefault(),a("");const u=mO(t);if(u){a(u);return}o(!0);const p=await fetch("/api/auth/connection-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:t.connectionMode,remoteUrl:t.connectionMode==="remote"?t.remoteUrl.trim():null,apiKey:t.connectionMode==="remote"?t.remoteApiKey.trim():null})});if(!p.ok){const h=await p.json().catch(()=>null);a(h?.error||"Could not save connection mode."),o(!1);return}const f=await e(t.username.trim(),t.password);f.success||a(f.error),o(!1)},[t,e]);return i.jsx(ON,{title:"Welcome to Pixcode",description:"Set up your account to get started",footerText:"This is a single-user system. Only one account can be created.",logo:i.jsx("img",{src:"/logo.svg",alt:"Pixcode",className:"h-16 w-16"}),children:i.jsxs("form",{onSubmit:c,className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2 rounded-lg border border-border/70 bg-muted/30 p-2 sm:grid-cols-2",children:[i.jsxs("button",{type:"button",onClick:()=>l("connectionMode","local"),disabled:s,className:`rounded-md px-3 py-2 text-left text-sm transition-colors ${t.connectionMode==="local"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-background/60 hover:text-foreground"}`,children:[i.jsx("span",{className:"block font-medium",children:"Use this computer directly"}),i.jsx("span",{className:"block text-xs opacity-80",children:"Run Pixcode and CLIs on this machine."})]}),i.jsxs("button",{type:"button",onClick:()=>l("connectionMode","remote"),disabled:s,className:`rounded-md px-3 py-2 text-left text-sm transition-colors ${t.connectionMode==="remote"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-background/60 hover:text-foreground"}`,children:[i.jsx("span",{className:"block font-medium",children:"Connect to a remote Pixcode server"}),i.jsx("span",{className:"block text-xs opacity-80",children:"Control another always-on Pixcode host by API."})]})]}),t.connectionMode==="remote"&&i.jsxs("div",{className:"space-y-3 rounded-lg border border-border/70 bg-muted/20 p-3",children:[i.jsx(Xi,{id:"remoteUrl",name:"remoteUrl",label:"Remote API URL",value:t.remoteUrl,onChange:d=>l("remoteUrl",d),placeholder:"https://your-server.example.com",isDisabled:s,autoComplete:"url"}),i.jsx(Xi,{id:"remoteApiKey",name:"remoteApiKey",label:"Remote API Key",value:t.remoteApiKey,onChange:d=>l("remoteApiKey",d),placeholder:"px_...",isDisabled:s,type:"password",autoComplete:"off"})]}),i.jsx(Xi,{id:"username",name:"username",label:"Username",value:t.username,onChange:d=>l("username",d),placeholder:"Enter your username",isDisabled:s,autoComplete:"username"}),i.jsx(Xi,{id:"password",name:"password",label:"Password",value:t.password,onChange:d=>l("password",d),placeholder:"Enter your password",isDisabled:s,type:"password",autoComplete:"new-password"}),i.jsx(Xi,{id:"confirmPassword",name:"confirmPassword",label:"Confirm Password",value:t.confirmPassword,onChange:d=>l("confirmPassword",d),placeholder:"Confirm your password",isDisabled:s,type:"password",autoComplete:"new-password"}),i.jsx(DN,{errorMessage:n}),i.jsx("button",{type:"submit",disabled:s,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:s?"Setting up...":"Create Account"})]})})}function fO({children:e}){const{user:t,isLoading:r,needsSetup:n,hasCompletedOnboarding:a,refreshOnboardingStatus:s}=uc();return r?i.jsx(cO,{}):n?i.jsx(hO,{}):t?a?i.jsx(i.Fragment,{children:e}):i.jsx(oO,{onComplete:s}):i.jsx(uO,{})}const MN=m.createContext(null),gO=()=>{const e=m.useContext(MN);if(!e)throw new Error("useWebSocket must be used within a WebSocketProvider");return e},bO=e=>{const t=window.location.protocol==="https:"?"wss:":"ws:";return e?`${t}//${window.location.host}/ws?token=${encodeURIComponent(e)}`:null},xO=()=>{const e=m.useRef(null),t=m.useRef(!1),r=m.useRef(!1),[n,a]=m.useState(null),[s,o]=m.useState(!1),l=m.useRef(null),{token:c}=uc(),d=m.useCallback(()=>{if(!t.current)try{const f=bO(c);if(!f)return console.warn("No authentication token found for WebSocket connection");const h=new WebSocket(f);h.onopen=()=>{o(!0),e.current=h,r.current&&a({type:"websocket-reconnected",timestamp:Date.now()}),r.current=!0},h.onmessage=g=>{try{const b=JSON.parse(g.data);a(b)}catch(b){console.error("Error parsing WebSocket message:",b)}},h.onclose=()=>{o(!1),e.current=null,l.current=setTimeout(()=>{t.current||d()},3e3)},h.onerror=g=>{console.error("WebSocket error:",g)}}catch(f){console.error("Error creating WebSocket connection:",f)}},[c]);m.useEffect(()=>(d(),()=>{t.current=!0,l.current&&clearTimeout(l.current),e.current&&e.current.close()}),[d]);const u=m.useCallback(f=>{const h=e.current;h&&h.readyState===WebSocket.OPEN?h.send(JSON.stringify(f)):console.warn("WebSocket not connected")},[]);return m.useMemo(()=>({ws:e.current,sendMessage:u,latestMessage:n,isConnected:s}),[u,n,s])},yO=({children:e})=>{const t=xO();return i.jsx(MN.Provider,{value:t,children:e})},FN=m.createContext(null);function Mu(){const e=m.useContext(FN);if(!e)throw new Error("usePlugins must be used within a PluginsProvider");return e}function vO({children:e}){const{user:t,token:r,isLoading:n}=uc(),[a,s]=m.useState([]),[o,l]=m.useState(!0),[c,d]=m.useState(null),u=!!(t&&r),p=m.useCallback(async()=>{if(!u){s([]),d(null),l(!1);return}l(!0);try{const x=await Se("/api/plugins");if(x.ok){const y=await x.json();s(y.plugins||[]),d(null)}else{let y=`Failed to fetch plugins (${x.status})`;try{const v=await x.json();y=v.details||v.error||y}catch{y=x.statusText||y}d(y)}}catch(x){const y=x instanceof Error?x.message:"Failed to fetch plugins";d(y),console.error("[Plugins] Failed to fetch plugins:",x)}finally{l(!1)}},[u]);m.useEffect(()=>{n||p()},[n,p]);const f=m.useCallback(async x=>{try{const y=await Se("/api/plugins/install",{method:"POST",body:JSON.stringify({url:x})}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Install failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Install failed"}}},[p]),h=m.useCallback(async x=>{try{const y=await Se(`/api/plugins/${encodeURIComponent(x)}`,{method:"DELETE"}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Uninstall failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Uninstall failed"}}},[p]),g=m.useCallback(async x=>{try{const y=await Se(`/api/plugins/${encodeURIComponent(x)}/update`,{method:"POST"}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Update failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Update failed"}}},[p]),b=m.useCallback(async(x,y)=>{try{const v=await Se(`/api/plugins/${encodeURIComponent(x)}/enable`,{method:"PUT",body:JSON.stringify({enabled:y})});if(!v.ok){let w=`Toggle failed (${v.status})`;try{const C=await v.json();w=C.details||C.error||w}catch{w=v.statusText||w}return{success:!1,error:w}}return await p(),{success:!0,error:null}}catch(v){return{success:!1,error:v instanceof Error?v.message:"Toggle failed"}}},[p]);return i.jsx(FN.Provider,{value:{plugins:a,loading:o,pluginsError:c,refreshPlugins:p,installPlugin:f,uninstallPlugin:h,updatePlugin:g,togglePlugin:b},children:e})}const sk=e=>typeof window>"u"?!1:window.innerWidth<e,ok=()=>{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 Ig(e={}){const{mobileBreakpoint:t=768,trackMobile:r=!0,trackPWA:n=!0}=e,[a,s]=m.useState(()=>r?sk(t):!1),[o,l]=m.useState(()=>n?ok():!1);return m.useEffect(()=>{if(!r||typeof window>"u")return;const c=()=>{s(sk(t))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[t,r]),m.useEffect(()=>{if(!n||typeof window>"u")return;const c=window.matchMedia("(display-mode: standalone)"),d=()=>{l(ok())};return d(),typeof c.addEventListener=="function"?(c.addEventListener("change",d),()=>{c.removeEventListener("change",d)}):(c.addListener(d),()=>{c.removeListener(d)})},[n]),{isMobile:a,isPWA:o}}const _g="pixcode.updateCheck.preferences",Kh="pixcode:update-check-settings-changed",Rg=[{value:"30m",label:"Every 30 minutes",intervalMs:1800*1e3},{value:"24h",label:"Daily",intervalMs:1440*60*1e3},{value:"12h",label:"Every 12 hours",intervalMs:720*60*1e3},{value:"6h",label:"Every 6 hours",intervalMs:360*60*1e3},{value:"7d",label:"Weekly",intervalMs:10080*60*1e3},{value:"off",label:"Manual only",intervalMs:null}],Yh={frequency:"30m"};function lk(e){return Rg.find(t=>t.value===e.frequency)?.intervalMs??null}function zN(e){if(!e||typeof e!="object")return Yh;const t=e.frequency;return Rg.some(r=>r.value===t)?{frequency:t}:Yh}function ck(){try{const e=localStorage.getItem(_g);return zN(e?JSON.parse(e):null)}catch{return Yh}}function wO(e){const t=zN(e);localStorage.setItem(_g,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(Kh,{detail:t}))}const Ap=(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 s=r[a]||0,o=n[a]||0;if(s!==o)return s-o}return 0},kO="1.50.5",Zh="pixcode:update-available",SO=360*60*1e3,jp=new Map;function BN(e,t){return`pixcode.updateCheck.cache.${e}.${t}`}function CO(e,t){try{const r=localStorage.getItem(BN(e,t));if(!r)return null;const n=JSON.parse(r);return{fetchedAt:typeof n.fetchedAt=="number"?n.fetchedAt:null,latestVersion:typeof n.latestVersion=="string"?n.latestVersion:null,releaseInfo:n.releaseInfo??null,rateLimitedUntil:typeof n.rateLimitedUntil=="number"?n.rateLimitedUntil:void 0}}catch{return null}}function dk(e,t,r){localStorage.setItem(BN(e,t),JSON.stringify(r))}function NO(e,t){const r=`${e}/${t}`,n=jp.get(r);if(n)return n;const a=fetch(`https://api.github.com/repos/${e}/${t}/releases/latest`,{cache:"no-store",headers:{Accept:"application/vnd.github+json"}}).then(async s=>({status:s.status,ok:s.ok,data:await s.json().catch(()=>({}))})).finally(()=>{jp.delete(r)});return jp.set(r,a),a}const UN=(e,t)=>{const[r,n]=m.useState(!1),[a,s]=m.useState(null),[o,l]=m.useState(null),[c,d]=m.useState("git"),[u,p]=m.useState("idle"),[f,h]=m.useState(null),[g,b]=m.useState(()=>ck()),[x,y]=m.useState(kO),v=m.useRef(null),w=m.useCallback(k=>{wO(k),b(k)},[]);m.useEffect(()=>{const k=()=>b(ck()),N=j=>{j.key===_g&&k()};return window.addEventListener("storage",N),window.addEventListener(Kh,k),()=>{window.removeEventListener("storage",N),window.removeEventListener(Kh,k)}},[]),m.useEffect(()=>{let k=!1;const N=async()=>{try{const E=await(await fetch("/health",{cache:"no-store"})).json();if(k)return;(E.installMode==="npm"||E.installMode==="git")&&d(E.installMode),typeof E.version=="string"&&/^\d+\.\d+\.\d+/.test(E.version)&&y(E.version)}catch{}};N();const j=()=>{N()};return window.addEventListener("focus",j),()=>{k=!0,window.removeEventListener("focus",j)}},[]),m.useEffect(()=>{if(!x)return;let k=!1;const N=(I,R,S,F)=>({updateAvailable:!!(I&&Ap(I,x)>0),latestVersion:I,releaseInfo:R,currentVersion:x,checkedAt:S,status:F}),j=I=>{!I.updateAvailable||!I.latestVersion||!I.releaseInfo||window.dispatchEvent(new CustomEvent(Zh,{detail:I}))},A=(I,R,S,F="success")=>{if(!I||!R)return n(!1),s(null),l(null),h(S),N(null,null,S,F);s(I),n(Ap(I,x)>0),l(R),h(S);const B=N(I,R,S,F);return j(B),B},E=async({force:I=!1}={})=>{const R=lk(g),S=CO(e,t),F=Date.now();if(!I&&R===null)return p("idle"),A(S?.latestVersion??null,S?.releaseInfo??null,S?.fetchedAt??null,"idle");if(!I&&S?.fetchedAt&&R!==null&&F-S.fetchedAt<R)return p("success"),A(S.latestVersion,S.releaseInfo,S.fetchedAt,"success");if(!I&&S?.rateLimitedUntil&&S.rateLimitedUntil>F)return p("error"),A(S.latestVersion,S.releaseInfo,S.fetchedAt,"error");try{p("checking");const B=await NO(e,t);if(k)return N(S?.latestVersion??null,S?.releaseInfo??null,S?.fetchedAt??null,"idle");const z=B.data;if(!B.ok)return B.status===403&&dk(e,t,{fetchedAt:S?.fetchedAt??null,latestVersion:S?.latestVersion??null,releaseInfo:S?.releaseInfo??null,rateLimitedUntil:F+Math.max(R??0,SO)}),p("error"),A(S?.latestVersion??null,S?.releaseInfo??null,S?.fetchedAt??null,"error");if(z.tag_name){const q=z.tag_name.replace(/^v/,""),V=Ap(q,x)>0,P={title:z.name||z.tag_name,body:z.body||"",htmlUrl:z.html_url||`https://github.com/${e}/${t}/releases/latest`,publishedAt:z.published_at||""};dk(e,t,{fetchedAt:F,latestVersion:q,releaseInfo:P}),s(q),n(V),V&&JC({key:`app-update:${q}`,title:"Pixcode update available",body:`Pixcode ${x} can update to ${q}.`,tag:"pixcode-app-update",data:{type:"app-update",latestVersion:q,installMode:c}}),l(P),p("success"),h(F);const U=N(q,P,F,"success");return j(U),U}else return n(!1),s(null),l(null),p("error"),N(null,null,null,"error")}catch(B){return console.error("Version check failed:",B),n(!1),s(null),l(null),p("error"),N(null,null,null,"error")}};v.current=E,E();const T=lk(g),_=T===null?null:window.setInterval(()=>{E()},T);return()=>{k=!0,_!==null&&window.clearInterval(_)}},[e,t,x,c,g]);const C=m.useCallback(async()=>v.current?await v.current({force:!0}):null,[]);return{updateAvailable:r,latestVersion:a,currentVersion:x,releaseInfo:o,installMode:c,checkStatus:u,lastCheckedAt:f,manualCheck:C,updateCheckPreferences:g,updatePreferences:w}},Ji={autoExpandTools:!1,showRawParameters:!1,showThinking:!0,autoScrollToBottom:!0,sendByCtrlEnter:!1,changeAwareness:!1,sidebarVisible:!0,historyView:"flat"},EO=["flat","grouped"],TO=e=>typeof e=="string"&&EO.includes(e),Zd=Object.keys(Ji),AO=new Set(Zd),Ip="ui-preferences:sync",jO=(e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1}return t},Xd=(e,t,r)=>e==="historyView"?TO(t)?t:r:jO(t,r),IO=(e,t)=>{try{const r=localStorage.getItem(e);if(r===null)return t;const n=JSON.parse(r);return Xd(e,n,t)}catch{return t}},_O=e=>{if(typeof window>"u")return Ji;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 Zd.reduce((a,s)=>(a[s]=Xd(s,n[s],Ji[s]),a),{...Ji})}}}catch{}return Zd.reduce((t,r)=>(t[r]=IO(r,Ji[r]),t),{...Ji})};function RO(e,t){switch(t.type){case"set":{const{key:r,value:n}=t;if(!AO.has(r))return e;const a=Xd(r,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 s of Zd){if(!(s in r))continue;const o=r[s],l=Xd(s,o,e[s]);a[s]!==l&&(a[s]=l,n=!0)}return n?a:e}case"reset":return{...Ji,...t.value||{}};default:return e}}function Lg(e="uiPreferences"){const t=m.useRef(`ui-preferences-${Math.random().toString(36).slice(2)}`),[r,n]=m.useReducer(RO,e,_O);return m.useEffect(()=>{typeof window>"u"||(localStorage.setItem(e,JSON.stringify(r)),window.dispatchEvent(new CustomEvent(Ip,{detail:{storageKey:e,sourceId:t.current,value:r}})))},[r,e]),m.useEffect(()=>{if(typeof window>"u")return;const l=u=>{!u||typeof u!="object"||Array.isArray(u)||n({type:"set_many",value:u})},c=u=>{if(!(u.key!==e||u.newValue===null))try{const p=JSON.parse(u.newValue);l(p)}catch{}},d=u=>{const f=u.detail;!f||f.storageKey!==e||f.sourceId===t.current||l(f.value)};return window.addEventListener("storage",c),window.addEventListener(Ip,d),()=>{window.removeEventListener("storage",c),window.removeEventListener(Ip,d)}},[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 LO=()=>{try{const e=localStorage.getItem("claude-settings");return e&&JSON.parse(e).projectSortOrder==="date"?"date":"name"}catch{return"name"}},PO=()=>{try{const e=localStorage.getItem("starredProjects");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}},DO=e=>{try{localStorage.setItem("starredProjects",JSON.stringify([...e]))}catch{}},uk=(e,t)=>`${e}::${t}`,OO=()=>{try{const e=localStorage.getItem("starredSessions");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}},MO=e=>{try{localStorage.setItem("starredSessions",JSON.stringify([...e]))}catch{}},FO=/(?:^|[\s/\\(\[`"'])([\w./-]+?\.(?:ts|tsx|js|jsx|mjs|cjs|py|rb|go|rs|java|kt|swift|c|cc|cpp|h|hpp|cs|php|sh|bash|zsh|json|ya?ml|toml|md|mdx|html?|css|scss|less|sql|prisma|graphql|gql|vue|svelte|astro|dart|lua|r|pl|ps1|tf|dockerfile|env))(?:$|[\s:,)\]`"'])/i,zO=e=>{if(!e)return[];const t=new Set,r=new RegExp(FO.source,"gi");let n;for(;(n=r.exec(e))!==null;){const a=n[1],s=a.lastIndexOf(".");if(s>-1){const o=a.slice(s+1).toLowerCase();o&&o.length<=10&&t.add(o)}if(t.size>=3)break}return[...t]},is=e=>e.__provider==="cursor"?new Date(e.createdAt||0):e.__provider==="codex"?new Date(e.createdAt||e.lastActivity||0):new Date(e.lastActivity||e.createdAt||0),BO=(e,t)=>e.__provider==="cursor"?e.summary||e.name||t("projects.untitledSession"):e.__provider==="codex"?e.summary||e.name||t("projects.codexSession"):e.__provider==="gemini"||e.__provider==="qwen"||e.__provider==="opencode"?e.summary||e.name||t("projects.newSession"):e.summary||t("projects.newSession"),UO=e=>e.__provider==="cursor"?String(e.createdAt||""):e.__provider==="codex"?String(e.createdAt||e.lastActivity||""):String(e.lastActivity||e.createdAt||""),$O=(e,t,r)=>{const n=is(e),a=Math.floor((t.getTime()-n.getTime())/(1e3*60));return{isCursorSession:e.__provider==="cursor",isCodexSession:e.__provider==="codex",isGeminiSession:e.__provider==="gemini",isQwenSession:e.__provider==="qwen",isOpencodeSession:e.__provider==="opencode",isActive:a<10,sessionName:BO(e,r),sessionTime:UO(e),messageCount:Number(e.messageCount||0)}},$N=(e,t)=>{const r=[...e.sessions||[],...t[e.name]||[]].map(g=>({...g,__provider:"claude"})),n=(e.cursorSessions||[]).map(g=>({...g,__provider:"cursor"})),a=(e.codexSessions||[]).map(g=>({...g,__provider:"codex"})),s=g=>typeof g.id=="string"&&g.id.startsWith("qwen_")||g.provider==="qwen",o=g=>typeof g.id=="string"&&g.id.startsWith("opencode_")||g.provider==="opencode",l=e.geminiSessions||[],c=l.filter(g=>!s(g)&&!o(g)).map(g=>({...g,__provider:"gemini"})),d=l.filter(g=>s(g)).map(g=>({...g,__provider:"qwen"})),u=l.filter(g=>o(g)).map(g=>({...g,__provider:"opencode"})),p=[...(e.qwenSessions||[]).map(g=>({...g,__provider:"qwen"})),...d],f=[...(e.opencodeSessions||[]).map(g=>({...g,__provider:"opencode"})),...u],h=new Map;for(const g of[...r,...n,...a,...c,...p,...f])h.has(g.id)||h.set(g.id,g);return[...h.values()].sort((g,b)=>is(b).getTime()-is(g).getTime())},pk=(e,t)=>{const r=$N(e,t);return r.length===0?new Date(0):r.reduce((n,a)=>{const s=is(a);return s>n?s:n},new Date(0))},HO=(e,t,r,n)=>{const a=[...e];return a.sort((s,o)=>{const l=r.has(s.name),c=r.has(o.name);return l&&!c?-1:!l&&c?1:t==="date"?pk(o,n).getTime()-pk(s,n).getTime():(s.displayName||s.name).localeCompare(o.displayName||o.name)}),a},GO=(e,t)=>{const r=t.trim().toLowerCase();return r?e.filter(n=>{const a=(n.displayName||n.name).toLowerCase(),s=n.name.toLowerCase();return a.includes(r)||s.includes(r)}):e},VO=e=>{const t=typeof e.fullPath=="string"&&e.fullPath.length>0?e.fullPath:typeof e.path=="string"?e.path:"";return{name:e.name,displayName:typeof e.displayName=="string"&&e.displayName.trim().length>0?e.displayName:e.name,fullPath:t,path:typeof e.path=="string"&&e.path.length>0?e.path:t}};function WO({projects:e,selectedProject:t,selectedSession:r,isLoading:n,isMobile:a,t:s,onRefresh:o,onProjectSelect:l,onSessionSelect:c,onSessionDelete:d,onProjectDelete:u,setSidebarVisible:p,sidebarVisible:f}){const[h,g]=m.useState(new Set),[b,x]=m.useState(null),[y,v]=m.useState(!1),[w,C]=m.useState(""),[k,N]=m.useState({}),[j,A]=m.useState({}),[E,T]=m.useState(new Set),[_,I]=m.useState(new Date),[R,S]=m.useState("name"),[F,B]=m.useState(!1),[z,q]=m.useState({}),[V,P]=m.useState(null),[U,H]=m.useState(""),[M,ee]=m.useState(""),[Q,ge]=m.useState(new Set),[se,ce]=m.useState(null),[ye,pe]=m.useState(null),[ve,ue]=m.useState(!1),[de,D]=m.useState(()=>PO()),[X,oe]=m.useState(()=>OO()),[K,W]=m.useState("projects"),[ne,me]=m.useState(null),[we,le]=m.useState(!1),[Ae,te]=m.useState(null),ae=m.useRef(null),J=m.useRef(0),fe=m.useRef(null),Ee=!a&&!f;m.useEffect(()=>{const Fe=setInterval(()=>{I(new Date)},6e4);return()=>clearInterval(Fe)},[]),m.useEffect(()=>{A({}),T(new Set),q({})},[e]),m.useEffect(()=>{t&&g(Fe=>{if(Fe.has(t.name))return Fe;const qe=new Set(Fe);return qe.add(t.name),qe})},[r,t]),m.useEffect(()=>{if(e.length>0&&!n){const Fe=new Set;e.forEach(qe=>{qe.sessions&&qe.sessions.length>=0&&Fe.add(qe.name)}),T(Fe)}},[e,n]),m.useEffect(()=>{const Fe=()=>{S(LO())};Fe();const qe=et=>{et.key==="claude-settings"&&Fe()},ht=()=>Fe();return window.addEventListener("storage",qe),window.addEventListener("pixcode:settings-changed",ht),()=>{window.removeEventListener("storage",qe),window.removeEventListener("pixcode:settings-changed",ht)}},[]),m.useEffect(()=>{ae.current&&clearTimeout(ae.current),fe.current&&(fe.current.close(),fe.current=null);const Fe=M.trim();if(K!=="conversations"||Fe.length<2){J.current+=1,me(null),te(null),le(!1);return}le(!0);const qe=++J.current;return ae.current=setTimeout(()=>{if(qe!==J.current)return;const ht=Lt.searchConversationsUrl(Fe),et=new EventSource(ht);fe.current=et;const vt=[];let Xt=0;et.addEventListener("result",Z=>{if(qe!==J.current){et.close();return}try{const Te=JSON.parse(Z.data);vt.push(Te.projectResult),Xt=Te.totalMatches,me({results:[...vt],totalMatches:Xt,query:Fe}),te({scannedProjects:Te.scannedProjects,totalProjects:Te.totalProjects})}catch{}}),et.addEventListener("progress",Z=>{if(qe!==J.current){et.close();return}try{const Te=JSON.parse(Z.data);Xt=Te.totalMatches,te({scannedProjects:Te.scannedProjects,totalProjects:Te.totalProjects})}catch{}}),et.addEventListener("done",()=>{if(qe!==J.current){et.close();return}et.close(),fe.current=null,le(!1),te(null),vt.length===0&&me({results:[],totalMatches:0,query:Fe})}),et.addEventListener("error",()=>{if(qe!==J.current){et.close();return}et.close(),fe.current=null,le(!1),te(null),vt.length===0&&me({results:[],totalMatches:0,query:Fe})})},400),()=>{ae.current&&clearTimeout(ae.current),fe.current&&(fe.current.close(),fe.current=null)}},[M,K]);const Me=m.useCallback(Fe=>{g(qe=>{const ht=new Set;return qe.has(Fe)||ht.add(Fe),ht})},[]),Xe=m.useCallback((Fe,qe)=>{c({...Fe,__projectName:qe})},[c]),Je=m.useCallback(Fe=>{D(qe=>{const ht=new Set(qe);return ht.has(Fe)?ht.delete(Fe):ht.add(Fe),DO(ht),ht})},[]),st=m.useCallback(Fe=>de.has(Fe),[de]),tt=m.useCallback((Fe,qe)=>{oe(ht=>{const et=uk(Fe,qe),vt=new Set(ht);return vt.has(et)?vt.delete(et):vt.add(et),MO(vt),vt})},[]),Ct=m.useCallback((Fe,qe)=>X.has(uk(Fe,qe)),[X]),ot=m.useCallback(Fe=>$N(Fe,j),[j]),ut=m.useMemo(()=>e.map(Fe=>{const qe=z[Fe.name];return qe===void 0?Fe:{...Fe,sessionMeta:{...Fe.sessionMeta,hasMore:qe}}}),[z,e]),ft=m.useMemo(()=>HO(ut,R,de,j),[j,R,ut,de]),kt=m.useMemo(()=>GO(ft,M),[M,ft]),$t=m.useCallback(Fe=>{x(Fe.name),C(Fe.displayName)},[]),Mt=m.useCallback(()=>{x(null),C("")},[]),Ot=m.useCallback(async Fe=>{try{(await Lt.renameProject(Fe,w)).ok?window.refreshProjects?await window.refreshProjects():window.location.reload():console.error("Failed to rename project")}catch(qe){console.error("Error renaming project:",qe)}finally{x(null),C("")}},[w]),Ht=m.useCallback((Fe,qe,ht,et="claude")=>{pe({projectName:Fe,sessionId:qe,sessionTitle:ht,provider:et})},[]),Gt=m.useCallback(async()=>{if(!ye)return;const{projectName:Fe,sessionId:qe,provider:ht}=ye;pe(null);try{let et;if(ht==="codex"?et=await Lt.deleteCodexSession(qe):ht==="gemini"?et=await Lt.deleteGeminiSession(qe):ht==="qwen"?et=await Lt.deleteQwenSession(qe):et=await Lt.deleteSession(Fe,qe),et.ok)d?.(qe);else{const vt=await et.text();console.error("[Sidebar] Failed to delete session:",{status:et.status,error:vt}),alert(s("messages.deleteSessionFailed"))}}catch(et){console.error("[Sidebar] Error deleting session:",et),alert(s("messages.deleteSessionError"))}},[d,ye,s]),Ge=m.useCallback(Fe=>{ce({project:Fe,sessionCount:ot(Fe).length})},[ot]),je=m.useCallback(async(Fe=!1)=>{if(!se)return;const{project:qe,sessionCount:ht}=se,et=ht===0;ce(null),ge(vt=>new Set([...vt,qe.name]));try{const vt=await Lt.deleteProject(qe.name,!et,Fe);if(vt.ok)u?.(qe.name);else{const Xt=await vt.json();alert(Xt.error||s("messages.deleteProjectFailed"))}}catch(vt){console.error("Error deleting project:",vt),alert(s("messages.deleteProjectError"))}finally{ge(vt=>{const Xt=new Set(vt);return Xt.delete(qe.name),Xt})}},[se,u,s]),Ue=m.useCallback(async Fe=>{const qe=z[Fe.name];if(!(!(qe!==void 0?qe:Fe.sessionMeta?.hasMore===!0)||k[Fe.name])){N(et=>({...et,[Fe.name]:!0}));try{const et=(Fe.sessions?.length||0)+(j[Fe.name]?.length||0),vt=await Lt.sessions(Fe.name,5,et);if(!vt.ok)return;const Xt=await vt.json();A(Z=>({...Z,[Fe.name]:[...Z[Fe.name]||[],...Xt.sessions||[]]})),Xt.hasMore===!1&&q(Z=>({...Z,[Fe.name]:!1}))}catch(et){console.error("Error loading more sessions:",et)}finally{N(et=>({...et,[Fe.name]:!1}))}}},[j,k,z]),We=m.useCallback(Fe=>{l(Fe)},[l]),lt=m.useCallback(async()=>{B(!0);try{await o()}finally{B(!1)}},[o]),yt=m.useCallback(async(Fe,qe,ht,et)=>{const vt=ht.trim();if(!vt){P(null),H("");return}try{const Xt=await Lt.renameSession(qe,vt,et);Xt.ok?await o():(console.error("[Sidebar] Failed to rename session:",Xt.status),alert(s("messages.renameSessionFailed")))}catch(Xt){console.error("[Sidebar] Error renaming session:",Xt),alert(s("messages.renameSessionError"))}finally{P(null),H("")}},[o,s]),Rt=m.useCallback(()=>{p(!1)},[p]),er=m.useCallback(()=>{p(!0)},[p]);return{isSidebarCollapsed:Ee,expandedProjects:h,editingProject:b,showNewProject:y,editingName:w,loadingSessions:k,additionalSessions:j,initialSessionsLoaded:E,currentTime:_,projectSortOrder:R,isRefreshing:F,editingSession:V,editingSessionName:U,searchFilter:M,deletingProjects:Q,deleteConfirmation:se,sessionDeleteConfirmation:ye,showVersionModal:ve,starredProjects:de,starredSessions:X,filteredProjects:kt,toggleProject:Me,handleSessionClick:Xe,toggleStarProject:Je,isProjectStarred:st,toggleStarSession:tt,isSessionStarred:Ct,getProjectSessions:ot,startEditing:$t,cancelEditing:Mt,saveProjectName:Ot,showDeleteSessionConfirmation:Ht,confirmDeleteSession:Gt,requestProjectDelete:Ge,confirmDeleteProject:je,loadMoreSessions:Ue,handleProjectSelect:We,refreshProjects:lt,updateSessionSummary:yt,collapseSidebar:Rt,expandSidebar:er,setShowNewProject:v,setEditingName:C,setEditingSession:P,setEditingSessionName:H,searchMode:K,setSearchMode:W,conversationResults:ne,isSearching:we,searchProgress:Ae,clearConversationResults:m.useCallback(()=>{J.current+=1,fe.current&&(fe.current.close(),fe.current=null),le(!1),te(null),me(null)},[]),setSearchFilter:ee,setDeleteConfirmation:ce,setSessionDeleteConfirmation:pe,setShowVersionModal:ue}}const qO="https://discord.gg/buxwujPNRE",KO="https://github.com/alicomert/pixcode/issues/new";function YO({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.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 ZO({onExpand:e,onOpenControlRoom:t,onShowSettings:r,updateAvailable:n,onShowVersionModal:a,t:s}){return i.jsxs("div",{className:"flex h-full w-12 flex-col items-center gap-1 bg-background/80 py-3 backdrop-blur-sm",children:[i.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":s("common:versionUpdate.ariaLabels.showSidebar"),title:s("common:versionUpdate.ariaLabels.showSidebar"),children:i.jsx(Gl,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("div",{className:"nav-divider my-1 w-6"}),t&&i.jsx("button",{onClick:t,className:"group flex h-8 w-8 items-center justify-center rounded-lg border border-primary/25 bg-primary/10 transition-colors hover:bg-primary/15","aria-label":s("actions.controlRoom",{defaultValue:"Control Room"}),title:s("actions.controlRoom",{defaultValue:"Control Room"}),children:i.jsx(Fn,{className:"h-4 w-4 text-primary"})}),i.jsx("button",{onClick:r,className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":s("actions.settings"),title:s("actions.settings"),children:i.jsx(Ut,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("a",{href:KO,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":s("actions.reportIssue"),title:s("actions.reportIssue"),children:i.jsx(xo,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("a",{href:qO,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":s("actions.joinCommunity"),title:s("actions.joinCommunity"),children:i.jsx(YO,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),n&&i.jsxs("button",{onClick:a,className:"relative flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":s("common:versionUpdate.ariaLabels.updateAvailable"),title:s("common:versionUpdate.ariaLabels.updateAvailable"),children:[i.jsx(Fn,{className:"h-4 w-4 text-blue-500"}),i.jsx("span",{className:"absolute right-1.5 top-1.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]})]})}function HN(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=HN(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function GN(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=HN(e))&&(n&&(n+=" "),n+=t);return n}const mk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hk=GN,Pg=(e,t)=>r=>{var n;if(t?.variants==null)return hk(e,r?.class,r?.className);const{variants:a,defaultVariants:s}=t,o=Object.keys(a).map(d=>{const u=r?.[d],p=s?.[d];if(u===null)return null;const f=mk(u)||mk(p);return a[d][f]}),l=r&&Object.entries(r).reduce((d,u)=>{let[p,f]=u;return f===void 0||(d[p]=f),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:p,className:f,...h}=u;return Object.entries(h).every(g=>{let[b,x]=g;return Array.isArray(x)?x.includes({...s,...l}[b]):{...s,...l}[b]===x})?[...d,p,f]:d},[]);return hk(e,o,c,r?.class,r?.className)},Dg="-",XO=e=>{const t=QO(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Dg);return l[0]===""&&l.length!==1&&l.shift(),VN(l,t)||JO(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},VN=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?VN(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const s=e.join(Dg);return t.validators.find(({validator:o})=>o(s))?.classGroupId},fk=/^\[(.+)\]$/,JO=e=>{if(fk.test(e)){const t=fk.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},QO=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const a in r)Xh(r[a],n,a,t);return n},Xh=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:gk(t,a);s.classGroupId=r;return}if(typeof a=="function"){if(eM(a)){Xh(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([s,o])=>{Xh(o,gk(t,s),r,n)})})},gk=(e,t)=>{let r=e;return t.split(Dg).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},eM=e=>e.isThemeGetter,tM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(s,o)=>{r.set(s,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let o=r.get(s);if(o!==void 0)return o;if((o=n.get(s))!==void 0)return a(s,o),o},set(s,o){r.has(s)?r.set(s,o):a(s,o)}}},Jh="!",Qh=":",rM=Qh.length,nM=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const s=[];let o=0,l=0,c=0,d;for(let g=0;g<a.length;g++){let b=a[g];if(o===0&&l===0){if(b===Qh){s.push(a.slice(c,g)),c=g+rM;continue}if(b==="/"){d=g;continue}}b==="["?o++:b==="]"?o--:b==="("?l++:b===")"&&l--}const u=s.length===0?a:a.substring(c),p=aM(u),f=p!==u,h=d&&d>c?d-c:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}};if(t){const a=t+Qh,s=n;n=o=>o.startsWith(a)?s(o.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=s=>r({className:s,parseClassName:a})}return n},aM=e=>e.endsWith(Jh)?e.substring(0,e.length-1):e.startsWith(Jh)?e.substring(1):e,iM=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let s=[];return n.forEach(o=>{o[0]==="["||t[o]?(a.push(...s.sort(),o),s=[]):s.push(o)}),a.push(...s.sort()),a}},sM=e=>({cache:tM(e.cacheSize),parseClassName:nM(e),sortModifiers:iM(e),...XO(e)}),oM=/\s+/,lM=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=t,o=[],l=e.trim().split(oM);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:p,modifiers:f,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:b}=r(u);if(p){c=u+(c.length>0?" "+c:c);continue}let x=!!b,y=n(x?g.substring(0,b):g);if(!y){if(!x){c=u+(c.length>0?" "+c:c);continue}if(y=n(g),!y){c=u+(c.length>0?" "+c:c);continue}x=!1}const v=s(f).join(":"),w=h?v+Jh:v,C=w+y;if(o.includes(C))continue;o.push(C);const k=a(y,x);for(let N=0;N<k.length;++N){const j=k[N];o.push(w+j)}c=u+(c.length>0?" "+c:c)}return c};function cM(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=WN(t))&&(n&&(n+=" "),n+=r);return n}const WN=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=WN(e[n]))&&(r&&(r+=" "),r+=t);return r};function dM(e,...t){let r,n,a,s=o;function o(c){const d=t.reduce((u,p)=>p(u),e());return r=sM(d),n=r.cache.get,a=r.cache.set,s=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=lM(c,r);return a(c,u),u}return function(){return s(cM.apply(null,arguments))}}const Cr=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},qN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,KN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,uM=/^\d+\/\d+$/,pM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mM=/\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$/,hM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rs=e=>uM.test(e),St=e=>!!e&&!Number.isNaN(Number(e)),ri=e=>!!e&&Number.isInteger(Number(e)),_p=e=>e.endsWith("%")&&St(e.slice(0,-1)),ja=e=>pM.test(e),bM=()=>!0,xM=e=>mM.test(e)&&!hM.test(e),YN=()=>!1,yM=e=>fM.test(e),vM=e=>gM.test(e),wM=e=>!Ye(e)&&!Ze(e),kM=e=>Do(e,JN,YN),Ye=e=>qN.test(e),Bi=e=>Do(e,QN,xM),Rp=e=>Do(e,TM,St),bk=e=>Do(e,ZN,YN),SM=e=>Do(e,XN,vM),Bc=e=>Do(e,eE,yM),Ze=e=>KN.test(e),ll=e=>Oo(e,QN),CM=e=>Oo(e,AM),xk=e=>Oo(e,ZN),NM=e=>Oo(e,JN),EM=e=>Oo(e,XN),Uc=e=>Oo(e,eE,!0),Do=(e,t,r)=>{const n=qN.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Oo=(e,t,r=!1)=>{const n=KN.exec(e);return n?n[1]?t(n[1]):r:!1},ZN=e=>e==="position"||e==="percentage",XN=e=>e==="image"||e==="url",JN=e=>e==="length"||e==="size"||e==="bg-size",QN=e=>e==="length",TM=e=>e==="number",AM=e=>e==="family-name",eE=e=>e==="shadow",jM=()=>{const e=Cr("color"),t=Cr("font"),r=Cr("text"),n=Cr("font-weight"),a=Cr("tracking"),s=Cr("leading"),o=Cr("breakpoint"),l=Cr("container"),c=Cr("spacing"),d=Cr("radius"),u=Cr("shadow"),p=Cr("inset-shadow"),f=Cr("text-shadow"),h=Cr("drop-shadow"),g=Cr("blur"),b=Cr("perspective"),x=Cr("aspect"),y=Cr("ease"),v=Cr("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...C(),Ze,Ye],N=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],A=()=>[Ze,Ye,c],E=()=>[Rs,"full","auto",...A()],T=()=>[ri,"none","subgrid",Ze,Ye],_=()=>["auto",{span:["full",ri,Ze,Ye]},ri,Ze,Ye],I=()=>[ri,"auto",Ze,Ye],R=()=>["auto","min","max","fr",Ze,Ye],S=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...A()],z=()=>[Rs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],q=()=>[e,Ze,Ye],V=()=>[...C(),xk,bk,{position:[Ze,Ye]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",NM,kM,{size:[Ze,Ye]}],H=()=>[_p,ll,Bi],M=()=>["","none","full",d,Ze,Ye],ee=()=>["",St,ll,Bi],Q=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[St,_p,xk,bk],ce=()=>["","none",g,Ze,Ye],ye=()=>["none",St,Ze,Ye],pe=()=>["none",St,Ze,Ye],ve=()=>[St,Ze,Ye],ue=()=>[Rs,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ja],breakpoint:[ja],color:[bM],container:[ja],"drop-shadow":[ja],ease:["in","out","in-out"],font:[wM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ja],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ja],shadow:[ja],spacing:["px",St],text:[ja],"text-shadow":[ja],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rs,Ye,Ze,x]}],container:["container"],columns:[{columns:[St,Ye,Ze,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:k()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[ri,"auto",Ze,Ye]}],basis:[{basis:[Rs,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[St,Rs,"auto","initial","none",Ye]}],grow:[{grow:["",St,Ze,Ye]}],shrink:[{shrink:["",St,Ze,Ye]}],order:[{order:[ri,"first","last","none",Ze,Ye]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...S(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...S()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":S()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],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:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,ll,Bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Ze,Rp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_p,Ye]}],"font-family":[{font:[CM,Ye,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,Ze,Ye]}],"line-clamp":[{"line-clamp":[St,"none",Ze,Rp]}],leading:[{leading:[s,...A()]}],"list-image":[{"list-image":["none",Ze,Ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,Ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[St,"from-font","auto",Ze,Bi]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[St,"auto",Ze,Ye]}],"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",Ze,Ye]}],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",Ze,Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ri,Ze,Ye],radial:["",Ze,Ye],conic:[ri,Ze,Ye]},EM,SM]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[St,Ze,Ye]}],"outline-w":[{outline:["",St,ll,Bi]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",u,Uc,Bc]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",p,Uc,Bc]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[St,Bi]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",f,Uc,Bc]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[St,Ze,Ye]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[St]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Ze,Ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[St]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,Ye]}],filter:[{filter:["","none",Ze,Ye]}],blur:[{blur:ce()}],brightness:[{brightness:[St,Ze,Ye]}],contrast:[{contrast:[St,Ze,Ye]}],"drop-shadow":[{"drop-shadow":["","none",h,Uc,Bc]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",St,Ze,Ye]}],"hue-rotate":[{"hue-rotate":[St,Ze,Ye]}],invert:[{invert:["",St,Ze,Ye]}],saturate:[{saturate:[St,Ze,Ye]}],sepia:[{sepia:["",St,Ze,Ye]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,Ye]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[St,Ze,Ye]}],"backdrop-contrast":[{"backdrop-contrast":[St,Ze,Ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",St,Ze,Ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[St,Ze,Ye]}],"backdrop-invert":[{"backdrop-invert":["",St,Ze,Ye]}],"backdrop-opacity":[{"backdrop-opacity":[St,Ze,Ye]}],"backdrop-saturate":[{"backdrop-saturate":[St,Ze,Ye]}],"backdrop-sepia":[{"backdrop-sepia":["",St,Ze,Ye]}],"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",Ze,Ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[St,"initial",Ze,Ye]}],ease:[{ease:["linear","initial",y,Ze,Ye]}],delay:[{delay:[St,Ze,Ye]}],animate:[{animate:["none",v,Ze,Ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ze,Ye]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[Ze,Ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"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",Ze,Ye]}],"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",Ze,Ye]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[St,ll,Bi,Rp]}],stroke:[{stroke:["none",...q()]}],"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"]}},IM=dM(jM);function xe(...e){return IM(GN(e))}function _M(e){if(!e||typeof e!="string")return null;try{return JSON.parse(e)}catch{return null}}const RM=Pg("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}}),tE=m.forwardRef(({className:e,variant:t,...r},n)=>i.jsx("div",{ref:n,role:"alert","data-slot":"alert",className:xe(RM({variant:t}),e),...r}));tE.displayName="Alert";const LM=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"alert-title",className:xe("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t}));LM.displayName="AlertTitle";const PM=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"alert-description",className:xe("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t}));PM.displayName="AlertDescription";const DM=Pg("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 Et({className:e,variant:t,...r}){return i.jsx("div",{className:xe(DM({variant:t}),e),...r})}const OM=Pg("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"}}),Ne=m.forwardRef(({className:e,variant:t,size:r,...n},a)=>i.jsx("button",{className:xe(OM({variant:t,size:r,className:e})),ref:a,...n}));Ne.displayName="Button";const rE=m.createContext(null),nE=()=>{const e=m.useContext(rE);if(!e)throw new Error("Confirmation components must be used within Confirmation");return e},aE=({className:e,approval:t="pending",children:r,...n})=>{const a=m.useMemo(()=>({approval:t}),[t]);return i.jsx(rE.Provider,{value:a,children:i.jsx(tE,{className:xe("flex flex-col gap-2",e),...n,children:r})})};aE.displayName="Confirmation";const iE=({className:e,...t})=>i.jsx("div",{"data-slot":"confirmation-title",className:xe("text-muted-foreground inline text-sm",e),...t});iE.displayName="ConfirmationTitle";const sE=({children:e})=>{const{approval:t}=nE();return t!=="pending"?null:i.jsx(i.Fragment,{children:e})};sE.displayName="ConfirmationRequest";const oE=({className:e,...t})=>{const{approval:r}=nE();return r!=="pending"?null:i.jsx("div",{"data-slot":"confirmation-actions",className:xe("flex items-center justify-end gap-2 self-end",e),...t})};oE.displayName="ConfirmationActions";const Id=({variant:e="default",...t})=>i.jsx(Ne,{className:"h-8 px-3 text-sm",variant:e,type:"button",...t});Id.displayName="ConfirmationAction";const lE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("rounded-xl border bg-card text-card-foreground shadow-sm",e),...t}));lE.displayName="Card";const cE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("flex flex-col space-y-1.5 p-4",e),...t}));cE.displayName="CardHeader";const dE=m.forwardRef(({className:e,...t},r)=>i.jsx("h3",{ref:r,className:xe("font-semibold leading-none tracking-tight",e),...t}));dE.displayName="CardTitle";const MM=m.forwardRef(({className:e,...t},r)=>i.jsx("p",{ref:r,className:xe("text-sm text-muted-foreground",e),...t}));MM.displayName="CardDescription";const uE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("p-4 pt-0",e),...t}));uE.displayName="CardContent";const pE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("flex items-center p-4 pt-0",e),...t}));pE.displayName="CardFooter";const FM=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("ml-auto shrink-0",e),...t}));FM.displayName="CardAction";const mE=m.createContext(null);function hE(){const e=m.useContext(mE);if(!e)throw new Error("Collapsible components must be used within <Collapsible>");return e}const Ci=m.forwardRef(({defaultOpen:e=!1,open:t,onOpenChange:r,className:n,children:a,...s},o)=>{const[l,c]=m.useState(e),d=t!==void 0,u=d?t:l,p=m.useCallback(h=>{d||c(h),r?.(h)},[d,r]),f=m.useMemo(()=>({open:u,onOpenChange:p}),[u,p]);return i.jsx(mE.Provider,{value:f,children:i.jsx("div",{ref:o,"data-state":u?"open":"closed",className:n,...s,children:a})})});Ci.displayName="Collapsible";const $a=m.forwardRef(({onClick:e,children:t,className:r,...n},a)=>{const{open:s,onOpenChange:o}=hE(),l=m.useCallback(c=>{o(!s),e?.(c)},[s,o,e]);return i.jsx("button",{ref:a,type:"button","aria-expanded":s,"data-state":s?"open":"closed",onClick:l,className:r,...n,children:t})});$a.displayName="CollapsibleTrigger";const Ni=m.forwardRef(({className:e,children:t,...r},n)=>{const{open:a}=hE();return i.jsx("div",{ref:n,"data-state":a?"open":"closed",className:xe("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),...r,children:i.jsx("div",{className:"overflow-hidden",children:t})})});Ni.displayName="CollapsibleContent";const fE=m.createContext(null);function Og(){const e=m.useContext(fE);if(!e)throw new Error("Command components must be used within <Command>");return e}const gE=m.forwardRef(({className:e,children:t,...r},n)=>{const[a,s]=m.useState(""),o=m.useRef(new Map),[l,c]=m.useState(0),d=m.useCallback(v=>{o.current.set(v.id,v),c(w=>w+1)},[]),u=m.useCallback(v=>{o.current.delete(v),c(w=>w+1)},[]),p=m.useCallback((v,w)=>{const C=o.current.get(v);C&&Object.assign(C,w)},[]),f=m.useMemo(()=>{const v=a.toLowerCase(),w=new Set;for(const[C,k]of o.current)(!v||k.value.includes(v))&&w.add(C);return w},[a,l]),h=m.useMemo(()=>{const v=[];for(const[,w]of o.current)f.has(w.id)&&v.push(w);return v},[f]),[g,b]=m.useState(null);m.useEffect(()=>{b(h.length>0?h[0].id:null)},[h]);const x=m.useCallback(v=>{if(v.key==="ArrowDown"||v.key==="ArrowUp"||v.key==="Enter")v.preventDefault();else return;const w=h;if(w.length===0)return;if(v.key==="Enter"){w.find(E=>E.id===g)?.onSelect();return}const C=w.findIndex(A=>A.id===g);let k;v.key==="ArrowDown"?k=C<w.length-1?C+1:0:k=C>0?C-1:w.length-1;const N=w[k].id;b(N),w[k].element?.scrollIntoView({block:"nearest"})},[h,g]),y=m.useMemo(()=>({search:a,setSearch:s,visibleIds:f,activeId:g,setActiveId:b,register:d,unregister:u,updateEntry:p}),[a,f,g,d,u,p]);return i.jsx(fE.Provider,{value:y,children:i.jsx("div",{ref:n,role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",className:xe("flex flex-col",e),onKeyDown:x,...r,children:t})})});gE.displayName="Command";const bE=m.forwardRef(({className:e,placeholder:t="Search...",...r},n)=>{const{search:a,setSearch:s}=Og();return i.jsxs("div",{className:"flex items-center border-b px-3",role:"presentation",children:[i.jsx(ps,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),i.jsx("input",{ref:n,type:"text",role:"searchbox","aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:a,onChange:o=>s(o.target.value),placeholder:t,className:xe("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none","placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})});bE.displayName="CommandInput";const xE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,role:"listbox",className:xe("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));xE.displayName="CommandList";const yE=m.forwardRef(({className:e,...t},r)=>{const{search:n,visibleIds:a}=Og();return!n||a.size>0?null:i.jsx("div",{ref:r,className:xe("py-6 text-center text-sm text-muted-foreground",e),...t})});yE.displayName="CommandEmpty";const vE=m.forwardRef(({className:e,heading:t,children:r,...n},a)=>i.jsxs("div",{ref:a,className:xe("overflow-hidden p-1",e),role:"group","aria-label":typeof t=="string"?t:void 0,...n,children:[t&&i.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",role:"presentation",children:t}),r]}));vE.displayName="CommandGroup";const wE=m.forwardRef(({className:e,value:t,onSelect:r,disabled:n,children:a,...s},o)=>{const{visibleIds:l,activeId:c,setActiveId:d,register:u,unregister:p,updateEntry:f}=Og(),h=m.useId(),g=m.useRef(null),b=t||(typeof a=="string"?a:"");m.useEffect(()=>(u({id:h,value:b.toLowerCase(),onSelect:r||(()=>{}),element:g.current}),()=>p(h)),[h,b,u,p]),m.useEffect(()=>{f(h,{onSelect:r||(()=>{})})},[h,r,f]);const x=m.useCallback(v=>{g.current=v,f(h,{element:v}),typeof o=="function"?o(v):o&&(o.current=v)},[h,f,o]);if(!l.has(h))return null;const y=c===h;return i.jsx("div",{ref:x,role:"option","aria-selected":y,"aria-disabled":n||void 0,"data-active":y||void 0,className:xe("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none",y&&"bg-accent text-accent-foreground",n&&"pointer-events-none opacity-50",e),onPointerMove:()=>{!n&&c!==h&&d(h)},onClick:()=>!n&&r?.(),...s,children:a})});wE.displayName="CommandItem";const zM=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("-mx-1 h-px bg-border",e),...t}));zM.displayName="CommandSeparator";function Jd({checked:e,onToggle:t,ariaLabel:r="Toggle dark mode"}){const{isDarkMode:n,toggleDarkMode:a}=Xa(),s=typeof e=="boolean"&&typeof t=="function",o=s?e:n,l=()=>{if(s&&t){t(!o);return}a()};return i.jsxs("button",{onClick:l,className:xe("relative inline-flex h-7 w-12 flex-shrink-0 touch-manipulation cursor-pointer items-center rounded-full border-2 transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",o?"border-primary bg-primary":"border-border bg-muted"),role:"switch","aria-checked":o,"aria-label":r,children:[i.jsx("span",{className:"sr-only",children:r}),i.jsx("span",{className:xe("flex h-5 w-5 transform items-center justify-center rounded-full shadow-sm transition-transform duration-200",o?"translate-x-[22px] bg-white":"translate-x-[2px] bg-foreground/60 dark:bg-foreground/80"),children:o?i.jsx(jN,{className:"h-3 w-3 text-primary"}):i.jsx(RN,{className:"h-3 w-3 text-white dark:text-background"})})]})}const kE=m.createContext(null);function SE(){const e=m.useContext(kE);if(!e)throw new Error("Dialog components must be used within <Dialog>");return e}const CE=({open:e,onOpenChange:t,defaultOpen:r=!1,children:n})=>{const[a,s]=m.useState(r),o=m.useRef(null),l=e!==void 0,c=l?e:a,d=m.useCallback(p=>{l||s(p),t?.(p)},[l,t]),u=m.useMemo(()=>({open:c,onOpenChange:d,triggerRef:o}),[c,d]);return i.jsx(kE.Provider,{value:u,children:n})},BM=m.forwardRef(({onClick:e,children:t,asChild:r,...n},a)=>{const{onOpenChange:s,triggerRef:o}=SE(),l=m.useCallback(c=>{s(!0),e?.(c)},[s,e]);if(r&&m.isValidElement(t)){const c=t;return m.cloneElement(c,{onClick:d=>{s(!0),c.props.onClick?.(d)},ref:d=>{o.current=d,typeof a=="function"?a(d):a&&(a.current=d)}})}return i.jsx("button",{ref:c=>{o.current=c,typeof a=="function"?a(c):a&&(a.current=c)},type:"button",onClick:l,...n,children:t})});BM.displayName="DialogTrigger";const yk='a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Mg=m.forwardRef(({className:e,children:t,onEscapeKeyDown:r,onPointerDownOutside:n,...a},s)=>{const{open:o,onOpenChange:l,triggerRef:c}=SE(),d=m.useRef(null),u=m.useRef(null);return m.useEffect(()=>{o?u.current=document.activeElement:u.current&&((c.current||u.current)?.focus(),u.current=null)},[o,c]),m.useEffect(()=>{if(!o)return;const p=h=>{if(h.key==="Escape"){h.stopPropagation(),r?.(),l(!1);return}if(h.key==="Tab"&&d.current){const g=Array.from(d.current.querySelectorAll(yk));if(g.length===0)return;const b=g[0],x=g[g.length-1];h.shiftKey&&document.activeElement===b?(h.preventDefault(),x.focus()):!h.shiftKey&&document.activeElement===x&&(h.preventDefault(),b.focus())}};document.addEventListener("keydown",p,!0);const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",p,!0),document.body.style.overflow=f}},[o,l,r]),m.useEffect(()=>{o&&d.current&&requestAnimationFrame(()=>{d.current?.querySelector(yk)?.focus()})},[o]),o?_u.createPortal(i.jsxs("div",{className:"fixed inset-0 z-50",children:[i.jsx("div",{className:"fixed inset-0 animate-dialog-overlay-show bg-black/50 backdrop-blur-sm",onClick:()=>{n?.(),l(!1)},"aria-hidden":!0}),i.jsx("div",{ref:p=>{d.current=p,typeof s=="function"?s(p):s&&(s.current=p)},role:"dialog","aria-modal":"true",className:xe("fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2","rounded-xl border bg-popover text-popover-foreground shadow-lg","animate-dialog-content-show",e),...a,children:t})]}),document.body):null});Mg.displayName="DialogContent";const Fg=m.forwardRef(({className:e,...t},r)=>i.jsx("h2",{ref:r,className:xe("sr-only",e),...t}));Fg.displayName="DialogTitle";const Ke=m.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{type:t,className:xe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Ke.displayName="Input";const zg=m.forwardRef(({className:e,contentClassName:t,children:r,...n},a)=>i.jsx("div",{className:xe("relative overflow-hidden",e),...n,children:i.jsx("div",{ref:a,className:xe("h-full w-full overflow-auto rounded-[inherit]",t),style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:r})}));zg.displayName="ScrollArea";const Qd=m.memo(({children:e,className:t,as:r="span"})=>i.jsx(r,{className:xe("animate-shimmer inline-block bg-[length:250%_100%] bg-clip-text text-transparent","bg-[linear-gradient(90deg,transparent_33%,hsl(var(--foreground))_50%,transparent_67%),linear-gradient(hsl(var(--muted-foreground)),hsl(var(--muted-foreground)))]",t),children:e}));Qd.displayName="Shimmer";const NE=m.createContext(null),UM=()=>{const e=m.useContext(NE);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},$M=1e3,HM=1e3,ef=m.memo(({className:e,isStreaming:t=!1,open:r,defaultOpen:n,onOpenChange:a,duration:s,children:o,...l})=>{const c=n??t,d=n===!1,[u,p]=m.useState(c),f=r!==void 0,h=f?r:u,g=m.useCallback(N=>{f||p(N),a?.(N)},[f,a]),[b,x]=m.useState(s),y=m.useRef(t),[v,w]=m.useState(!1),C=m.useRef(null);m.useEffect(()=>{s!==void 0&&x(s)},[s]),m.useEffect(()=>{t?(y.current=!0,C.current===null&&(C.current=Date.now())):C.current!==null&&(x(Math.ceil((Date.now()-C.current)/HM)),C.current=null)},[t]),m.useEffect(()=>{t&&!h&&!d&&g(!0)},[t,h,g,d]),m.useEffect(()=>{if(y.current&&!t&&h&&!v){const N=setTimeout(()=>{g(!1),w(!0)},$M);return()=>clearTimeout(N)}},[t,h,g,v]);const k=m.useMemo(()=>({duration:b,isOpen:h,isStreaming:t,setIsOpen:g}),[b,h,t,g]);return i.jsx(NE.Provider,{value:k,children:i.jsx(Ci,{open:h,onOpenChange:g,className:xe("not-prose",e),...l,children:o})})});ef.displayName="Reasoning";const GM=(e,t)=>e||t===0?i.jsx(Qd,{children:"Thinking..."}):t===void 0?i.jsx("p",{children:"Thought for a few seconds"}):i.jsxs("p",{children:["Thought for ",t," seconds"]}),tf=m.memo(({className:e,children:t,getThinkingMessage:r=GM,...n})=>{const{isStreaming:a,isOpen:s,duration:o}=UM();return i.jsx($a,{className:xe("flex w-full items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground",e),...n,children:t??i.jsxs(i.Fragment,{children:[i.jsx(PD,{className:"h-4 w-4"}),r(a,o),i.jsx(uN,{className:xe("h-4 w-4 transition-transform",s?"rotate-180":"rotate-0")})]})})});tf.displayName="ReasoningTrigger";const rf=m.memo(({className:e,children:t,...r})=>i.jsx(Ni,{className:xe("mt-4 text-sm text-muted-foreground",e),...r,children:t}));rf.displayName="ReasoningContent";function VM(e){switch(e){case"top":return"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900 dark:border-t-gray-100";case"bottom":return"bottom-full left-1/2 transform -translate-x-1/2 border-b-gray-900 dark:border-b-gray-100";case"left":return"left-full top-1/2 transform -translate-y-1/2 border-l-gray-900 dark:border-l-gray-100";case"right":return"right-full top-1/2 transform -translate-y-1/2 border-r-gray-900 dark:border-r-gray-100";default:return"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900 dark:border-t-gray-100"}}function nf({children:e,content:t,position:r="top",className:n="",delay:a=350}){const[s,o]=m.useState(!1),l=m.useRef(null),c=m.useRef(!1),d=m.useRef(null),u=m.useRef(null),[p,f]=m.useState(null),h=m.useCallback(()=>{const w=d.current;if(!w)return;const C=w.getBoundingClientRect(),k=8,N={position:"fixed",zIndex:9999};switch(r){case"bottom":N.left=C.left+C.width/2,N.top=C.bottom+k,N.transform="translateX(-50%)";break;case"left":N.left=C.left-k,N.top=C.top+C.height/2,N.transform="translate(-100%, -50%)";break;case"right":N.left=C.right+k,N.top=C.top+C.height/2,N.transform="translateY(-50%)";break;case"top":default:N.left=C.left+C.width/2,N.top=C.top-k,N.transform="translate(-50%, -100%)";break}f(N)},[r]),g=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},b=()=>{g(),l.current=window.setTimeout(()=>{o(!0)},a)},x=()=>{g(),o(!1)},y=()=>{g(),c.current=!1,l.current=window.setTimeout(()=>{c.current=!0,o(!0)},a)},v=()=>{g(),!c.current&&o(!1)};return m.useEffect(()=>()=>{g()},[]),m.useEffect(()=>{if(!s||typeof document>"u")return;const w=C=>{const k=C.target;k instanceof Node&&d.current?.contains(k)||(o(!1),c.current=!1)};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[s]),m.useEffect(()=>{if(!s){f(null);return}const w=window.requestAnimationFrame(h),C=()=>h();return window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.cancelAnimationFrame(w),window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[s,h]),t?i.jsxs("div",{ref:d,className:"relative inline-block",onMouseEnter:b,onMouseLeave:x,onTouchStart:y,onTouchEnd:v,onTouchCancel:v,children:[e,s&&typeof document<"u"&&_u.createPortal(i.jsxs("div",{ref:u,style:p||{position:"fixed",top:"-9999px",left:"-9999px",opacity:0},className:xe("px-2 py-1 text-xs font-medium text-white bg-gray-900 dark:bg-gray-100 dark:text-gray-900 rounded shadow-lg whitespace-nowrap pointer-events-none","animate-in fade-in-0 zoom-in-95 duration-200",n),children:[t,i.jsx("div",{className:xe("absolute w-0 h-0 border-4 border-transparent",VM(r))})]}),document.body)]}):i.jsx(i.Fragment,{children:e})}const EE=m.createContext(null),TE=m.forwardRef(({className:e,status:t="ready",children:r,...n},a)=>{const s=m.useMemo(()=>({status:t}),[t]);return i.jsx(EE.Provider,{value:s,children:i.jsx("form",{ref:a,"data-slot":"prompt-input",className:xe("relative overflow-hidden rounded-xl border border-border/70 bg-zinc-50/95 shadow-sm shadow-zinc-950/5 backdrop-blur-sm transition-all duration-200 focus-within:border-primary/40 focus-within:shadow-md focus-within:ring-1 focus-within:ring-primary/20 dark:bg-zinc-950/90",e),...n,children:r})})});TE.displayName="PromptInput";const AE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-header",className:xe("px-3 pt-3",e),...t}));AE.displayName="PromptInputHeader";const jE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-body",className:xe("relative",e),...t}));jE.displayName="PromptInputBody";const IE=m.forwardRef(({className:e,...t},r)=>i.jsx("textarea",{ref:r,"data-slot":"prompt-input-textarea",className:xe("chat-input-placeholder block max-h-[40vh] w-full resize-none overflow-y-auto bg-transparent px-4 py-2 font-mono text-sm leading-6 text-foreground placeholder-muted-foreground/50 focus:outline-none sm:max-h-[300px]",e),...t}));IE.displayName="PromptInputTextarea";const _E=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-footer",className:xe("flex items-center justify-between border-t border-border/30 px-3 py-2",e),...t}));_E.displayName="PromptInputFooter";const RE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-tools",className:xe("flex items-center gap-1",e),...t}));RE.displayName="PromptInputTools";const _d=m.forwardRef(({className:e,tooltip:t,children:r,...n},a)=>{const s=i.jsx(Ne,{ref:a,type:"button",variant:"ghost",size:"icon",className:xe("h-8 w-8 [&_svg]:size-4",e),...n,children:r});return t?i.jsx(nf,{content:t.shortcut?i.jsxs("span",{className:"flex items-center gap-1.5",children:[t.content,i.jsx("kbd",{className:"rounded bg-white/20 px-1 text-[10px]",children:t.shortcut})]}):t.content,position:t.side??"top",children:s}):s});_d.displayName="PromptInputButton";const LE=m.forwardRef(({className:e,status:t,children:r,...n},a)=>{const s=m.useContext(EE),o=t??s?.status??"ready",l=o==="submitted"||o==="streaming";return i.jsx(Ne,{ref:a,type:l?"button":"submit",variant:"default",size:"icon",className:xe("h-8 w-8 rounded-lg",e),...n,children:r??(l?i.jsx(fc,{className:"h-3.5 w-3.5 fill-current"}):i.jsx(xD,{className:"h-4 w-4"}))})});LE.displayName="PromptInputSubmit";function Bg({children:e,className:t}){return i.jsx("div",{className:xe("inline-flex items-center gap-[2px] rounded-lg bg-muted/60 p-[3px]",t),children:e})}function Ug({isActive:e,onClick:t,children:r,className:n}){return i.jsx("button",{onClick:t,className:xe("flex touch-manipulation items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-all duration-150",e?"bg-background text-foreground shadow-sm":"text-muted-foreground active:bg-background/50",n),children:r})}const PE=m.createContext(null);function DE(){const e=m.useContext(PE);if(!e)throw new Error("QueueItem sub-components must be used within <QueueItem>");return e}const OE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"queue",role:"list",className:xe("space-y-0.5",e),...t}));OE.displayName="Queue";const ME=m.forwardRef(({status:e="pending",className:t,children:r,...n},a)=>{const s=m.useMemo(()=>({status:e}),[e]);return i.jsx(PE.Provider,{value:s,children:i.jsx("div",{ref:a,"data-slot":"queue-item","data-status":e,role:"listitem",className:xe("flex items-start gap-2 py-0.5",t),...n,children:r})})});ME.displayName="QueueItem";const FE=m.forwardRef(({className:e,...t},r)=>{const{status:n}=DE();return i.jsxs("div",{ref:r,"data-slot":"queue-item-indicator","aria-hidden":"true",className:xe("mt-0.5 flex h-3.5 w-3.5 flex-shrink-0 items-center justify-center",e),...t,children:[n==="completed"&&i.jsx("svg",{className:"h-3.5 w-3.5 text-green-500 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),n==="in_progress"&&i.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-blue-500 dark:bg-blue-400"}),n==="pending"&&i.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("circle",{cx:"12",cy:"12",r:"9",strokeWidth:2})})]})});FE.displayName="QueueItemIndicator";const zE=m.forwardRef(({className:e,children:t,...r},n)=>{const{status:a}=DE();return i.jsx("div",{ref:n,"data-slot":"queue-item-content",className:xe("min-w-0 flex-1 text-xs",a==="completed"&&"text-muted-foreground line-through",a==="in_progress"&&"font-medium text-foreground",a==="pending"&&"text-foreground",e),...r,children:t})});zE.displayName="QueueItemContent";const vk="https://github.com/alicomert/pixcode/issues/new",WM="https://github.com/alicomert/pixcode",wk="https://discord.gg/buxwujPNRE";function kk({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.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 qM({updateAvailable:e,releaseInfo:t,latestVersion:r,currentVersion:n,onShowVersionModal:a,onOpenControlRoom:s,onShowSettings:o,t:l}){return i.jsxs("div",{className:"flex-shrink-0",style:{paddingBottom:"env(safe-area-inset-bottom, 0)"},children:[e&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"nav-divider"}),i.jsx("div",{className:"hidden px-2 py-1.5 md:block",children:i.jsxs("button",{className:"group flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-blue-50/80 dark:hover:bg-blue-900/15",onClick:a,children:[i.jsxs("div",{className:"relative flex-shrink-0",children:[i.jsx(Zw,{className:"h-4 w-4 text-blue-500 dark:text-blue-400"}),i.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-sm font-medium text-blue-600 dark:text-blue-300",children:t?.title||`v${r}`}),i.jsx("span",{className:"text-[10px] text-blue-500/70 dark:text-blue-400/60",children:l("version.updateAvailable")})]})]})}),i.jsx("div",{className:"px-3 py-2 md:hidden",children:i.jsxs("button",{className:"flex h-11 w-full items-center gap-3 rounded-xl border border-blue-200/60 bg-blue-50/80 px-3.5 transition-all active:scale-[0.98] dark:border-blue-700/40 dark:bg-blue-900/15",onClick:a,children:[i.jsxs("div",{className:"relative flex-shrink-0",children:[i.jsx(Zw,{className:"w-4.5 h-4.5 text-blue-500 dark:text-blue-400"}),i.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]}),i.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[i.jsx("span",{className:"block truncate text-sm font-medium text-blue-600 dark:text-blue-300",children:t?.title||`v${r}`}),i.jsx("span",{className:"text-xs text-blue-500/70 dark:text-blue-400/60",children:l("version.updateAvailable")})]})]})})]}),i.jsx("div",{className:"nav-divider"}),i.jsx("div",{className:"hidden px-2 pt-1.5 md:block",children:i.jsxs("a",{href:vk,target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:[i.jsx(xo,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:l("actions.reportIssue")})]})}),i.jsx("div",{className:"hidden px-2 md:block",children:i.jsxs("a",{href:wk,target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:[i.jsx(kk,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:l("actions.joinCommunity")})]})}),s&&i.jsx("div",{className:"hidden px-2 pt-1.5 md:block",children:i.jsxs("button",{className:"group flex w-full items-center gap-2.5 rounded-lg border border-primary/25 bg-primary/5 px-2.5 py-2 text-left transition-colors hover:bg-primary/10",onClick:s,children:[i.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-primary/10 text-primary",children:i.jsx(Fn,{className:"h-3.5 w-3.5"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:l("actions.controlRoom",{defaultValue:"Control Room"})}),i.jsx("span",{className:"block truncate text-[10px] text-muted-foreground",children:l("actions.controlRoomDescription",{defaultValue:"Admin, access, runs"})})]})]})}),i.jsx("div",{className:"hidden px-2 py-1.5 md:block",children:i.jsxs("button",{className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",onClick:o,children:[i.jsx(Ut,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:l("actions.settings")})]})}),i.jsx("div",{className:"hidden px-3 py-2 text-center md:block",children:i.jsxs("a",{href:WM,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-muted-foreground/40 transition-colors hover:text-muted-foreground",children:["Pixcode v",n," – ",l("branding.openSource")]})}),i.jsx("div",{className:"px-3 pt-3 md:hidden",children:i.jsxs("a",{href:vk,target:"_blank",rel:"noopener noreferrer",className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(xo,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:l("actions.reportIssue")})]})}),i.jsx("div",{className:"px-3 pt-2 md:hidden",children:i.jsxs("a",{href:wk,target:"_blank",rel:"noopener noreferrer",className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(kk,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:l("actions.joinCommunity")})]})}),s&&i.jsx("div",{className:"px-3 pt-2 md:hidden",children:i.jsxs("button",{className:"flex h-14 w-full items-center gap-3.5 rounded-xl border border-primary/25 bg-primary/10 px-4 transition-all hover:bg-primary/15 active:scale-[0.98]",onClick:s,children:[i.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-xl bg-primary/15",children:i.jsx(Fn,{className:"w-4.5 h-4.5 text-primary"})}),i.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[i.jsx("span",{className:"block truncate text-base font-semibold text-foreground",children:l("actions.controlRoom",{defaultValue:"Control Room"})}),i.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:l("actions.controlRoomDescription",{defaultValue:"Admin, access, runs"})})]})]})}),i.jsx("div",{className:"px-3 pb-3 pt-2 md:hidden",children:i.jsxs("button",{className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",onClick:o,children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(Ut,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:l("actions.settings")})]})})]})}const Sk="PIXCODE_GITHUB_STARS",Ck="PIXCODE_HIDE_GITHUB_STAR",KM=3600*1e3,YM=(e,t)=>{const[r,n]=m.useState(null),[a,s]=m.useState(()=>{try{return localStorage.getItem(Ck)==="true"}catch{return!1}});m.useEffect(()=>{if(a)return;try{const d=localStorage.getItem(Sk);if(d){const u=JSON.parse(d);if(Date.now()-u.timestamp<KM){n(u.count);return}}}catch{}(async()=>{try{const d=await fetch(`https://api.github.com/repos/${e}/${t}`);if(!d.ok)return;const p=(await d.json()).stargazers_count;if(typeof p=="number"){n(p);try{localStorage.setItem(Sk,JSON.stringify({count:p,timestamp:Date.now()}))}catch{}}}catch{}})()},[e,t,a]);const o=m.useCallback(()=>{s(!0);try{localStorage.setItem(Ck,"true")}catch{}},[]),l=r!==null?r>=1e3?`${(r/1e3).toFixed(1)}k`:`${r}`:null;return{starCount:r,formattedCount:l,isDismissed:a,dismiss:o}},ZM="https://github.com/alicomert/pixcode";function XM({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.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"})})}function JM(){const{formattedCount:e,isDismissed:t,dismiss:r}=YM("alicomert","pixcode");return t?null:i.jsxs("div",{className:"group/star relative hidden md:block",children:[i.jsxs("a",{href:ZM,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg border border-border/50 bg-muted/30 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",children:[i.jsx(XM,{className:"h-3.5 w-3.5"}),i.jsx(yi,{className:"h-3 w-3"}),i.jsx("span",{className:"font-medium",children:"Star"}),e&&i.jsx("span",{className:"border-l border-border/50 pl-1.5 tabular-nums",children:e})]}),i.jsx("button",{onClick:n=>{n.preventDefault(),n.stopPropagation(),r()},className:"absolute -right-1.5 -top-1.5 hidden h-4 w-4 items-center justify-center rounded-full border border-border/50 bg-muted text-muted-foreground transition-colors hover:text-foreground group-hover/star:flex","aria-label":"Dismiss",children:i.jsx(At,{className:"h-2.5 w-2.5"})})]})}function Nk({value:e,onChange:t,t:r}){const n="flex flex-1 items-center justify-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium transition-all";return i.jsxs("div",{role:"tablist","aria-label":r("tooltips.historyView",{defaultValue:"History view"}),className:"flex rounded-lg bg-muted/40 p-0.5",children:[i.jsxs("button",{type:"button",role:"tab","aria-selected":e==="flat",onClick:()=>t("flat"),className:xe(n,e==="flat"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:r("tooltips.historyViewFlat",{defaultValue:"Recent conversations"}),children:[i.jsx(wg,{className:"h-3 w-3"}),r("historyView.flat",{defaultValue:"Recent"})]}),i.jsxs("button",{type:"button",role:"tab","aria-selected":e==="grouped",onClick:()=>t("grouped"),className:xe(n,e==="grouped"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:r("tooltips.historyViewGrouped",{defaultValue:"Grouped by project"}),children:[i.jsx(kD,{className:"h-3 w-3"}),r("historyView.grouped",{defaultValue:"By project"})]})]})}function QM({isPWA:e,isMobile:t,isLoading:r,projectsCount:n,searchFilter:a,onSearchFilterChange:s,onClearSearchFilter:o,searchMode:l,onSearchModeChange:c,onRefresh:d,isRefreshing:u,onCreateProject:p,onQuickStartSession:f,onCollapseSidebar:h,historyView:g,onHistoryViewChange:b,t:x}){const y=()=>i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("svg",{className:"h-6 w-6 flex-shrink-0",viewBox:"0 0 500 500","aria-hidden":"true",children:i.jsx("g",{transform:"translate(250 250) scale(1.25) translate(-250 -250)",children:i.jsxs("g",{transform:"translate(0 500) scale(0.1 -0.1)",fill:"#5C3FFC",children:[i.jsx("path",{d:"M2037 3800 c-104 -40 -191 -134 -231 -250 -23 -67 -20 -82 22 -109 31 -20 287 -177 1009 -618 40 -24 82 -56 93 -70 27 -34 27 -102 0 -136 -11 -13 -106 -78 -212 -143 -106 -64 -201 -124 -210 -132 -16 -14 -18 -41 -18 -302 0 -291 2 -310 38 -310 16 0 267 148 610 359 180 111 270 173 310 213 216 217 215 574 -3 793 -37 38 -107 89 -185 136 -69 42 -253 154 -410 249 -434 264 -509 307 -563 326 -57 20 -191 17 -250 -6z"}),i.jsx("path",{d:"M1803 2994 c-10 -5 -13 -156 -13 -709 0 -671 1 -706 20 -767 27 -89 93 -184 167 -240 89 -67 157 -90 281 -96 92 -4 105 -2 117 14 12 16 14 134 15 735 0 669 -1 718 -17 737 -20 23 -514 322 -541 327 -9 2 -23 2 -29 -1z"})]})})}),i.jsx("h1",{className:"truncate text-sm font-semibold tracking-tight text-foreground",children:x("app.title")})]});return i.jsxs("div",{className:"flex-shrink-0",children:[i.jsxs("div",{className:"hidden px-4 pb-3 pt-4 md:block",style:{},children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx(y,{}),i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-0.5",children:[i.jsx(Ne,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:d,disabled:u,title:x("tooltips.refresh"),children:i.jsx(it,{className:`h-4 w-4 ${u?"animate-spin":""}`})}),i.jsx(Ne,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:p,title:x("tooltips.createProject"),children:i.jsx(Zt,{className:"h-4 w-4"})}),i.jsx(Ne,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:h,title:x("tooltips.hideSidebar"),children:i.jsx(Pu,{className:"h-4 w-4"})})]})]}),i.jsx(JM,{}),f&&i.jsxs("button",{type:"button",onClick:()=>{f()},className:"mt-2.5 flex w-full items-center justify-center gap-2 rounded-lg border border-primary/20 bg-primary/5 px-3 py-2 text-sm font-medium text-primary transition-colors hover:bg-primary/10",children:[i.jsx(Fn,{className:"h-4 w-4"}),x("sidebar.newChat",{defaultValue:"New chat"})]}),n>0&&!r&&i.jsxs("div",{className:"mt-2.5 space-y-2",children:[i.jsx(Nk,{value:g,onChange:b,t:x}),i.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-0.5",children:[i.jsxs("button",{onClick:()=>c("projects"),"aria-pressed":l==="projects",className:xe("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="projects"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx($r,{className:"h-3 w-3"}),x("search.modeProjects")]}),i.jsxs("button",{onClick:()=>c("conversations"),"aria-pressed":l==="conversations",className:xe("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="conversations"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(Mn,{className:"h-3 w-3"}),x("search.modeConversations")]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(ps,{className:"pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/50"}),i.jsx(Ke,{type:"text",placeholder:x(l==="conversations"?"search.conversationsPlaceholder":"projects.searchPlaceholder"),value:a,onChange:v=>s(v.target.value),className:"nav-search-input h-9 rounded-xl border-0 pl-9 pr-8 text-sm transition-all duration-200 placeholder:text-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0"}),a&&i.jsx("button",{onClick:o,"aria-label":x("tooltips.clearSearch"),className:"absolute right-2.5 top-1/2 -translate-y-1/2 rounded-md p-0.5 hover:bg-accent",children:i.jsx(At,{className:"h-3 w-3 text-muted-foreground"})})]})]})]}),i.jsx("div",{className:"nav-divider hidden md:block"}),i.jsxs("div",{className:"p-3 pb-2 md:hidden",style:e&&t?{paddingTop:"16px"}:{},children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(y,{}),i.jsxs("div",{className:"flex flex-shrink-0 gap-1.5",children:[i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-muted/50 transition-all active:scale-95",onClick:d,disabled:u,children:i.jsx(it,{className:`h-4 w-4 text-muted-foreground ${u?"animate-spin":""}`})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/90 text-primary-foreground transition-all active:scale-95",onClick:p,children:i.jsx(ki,{className:"h-4 w-4"})})]})]}),n>0&&!r&&i.jsxs("div",{className:"mt-2.5 space-y-2",children:[l==="projects"&&i.jsx(Nk,{value:g,onChange:b,t:x}),i.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-0.5",children:[i.jsxs("button",{onClick:()=>c("projects"),"aria-pressed":l==="projects",className:xe("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="projects"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx($r,{className:"h-3 w-3"}),x("search.modeProjects")]}),i.jsxs("button",{onClick:()=>c("conversations"),"aria-pressed":l==="conversations",className:xe("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="conversations"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(Mn,{className:"h-3 w-3"}),x("search.modeConversations")]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(ps,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/50"}),i.jsx(Ke,{type:"text",placeholder:x(l==="conversations"?"search.conversationsPlaceholder":"projects.searchPlaceholder"),value:a,onChange:v=>s(v.target.value),className:"nav-search-input h-10 rounded-xl border-0 pl-10 pr-9 text-sm transition-all duration-200 placeholder:text-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0"}),a&&i.jsx("button",{onClick:o,"aria-label":x("tooltips.clearSearch"),className:"absolute right-2.5 top-1/2 -translate-y-1/2 rounded-md p-1 hover:bg-accent",children:i.jsx(At,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})]})]}),i.jsx("div",{className:"nav-divider md:hidden"})]})}const e9=160,Ek=180;function BE({actions:e,className:t,triggerLabel:r}){const[n,a]=m.useState(!1),[s,o]=m.useState(null),l=m.useRef(null),c=m.useRef(null);m.useLayoutEffect(()=>{if(!n||!l.current)return;const u=l.current.getBoundingClientRect();let p=u.right-e9;p<8&&(p=8);let f=u.bottom+4;f+Ek>window.innerHeight&&(f=Math.max(8,u.top-4-Ek)),o({top:f,left:p})},[n]),m.useEffect(()=>{if(!n)return;const u=h=>{const g=h.target;l.current?.contains(g)||c.current?.contains(g)||a(!1)},p=h=>{h.key==="Escape"&&a(!1)},f=()=>a(!1);return document.addEventListener("mousedown",u),document.addEventListener("keydown",p),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",p),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[n]);const d=u=>p=>{p.stopPropagation(),p.preventDefault(),a(!1),u.onClick()};return i.jsxs(i.Fragment,{children:[i.jsx("button",{ref:l,type:"button","aria-haspopup":"menu","aria-expanded":n,"aria-label":r||"Actions",title:r||"Actions",onClick:u=>{u.stopPropagation(),u.preventDefault(),a(p=>!p)},className:xe("flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground","opacity-0 transition-all duration-150 hover:bg-accent hover:text-foreground","group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary","touch:opacity-100",n&&"bg-accent text-foreground opacity-100",t),children:i.jsx(TN,{className:"h-3.5 w-3.5"})}),n&&s&&_u.createPortal(i.jsx("div",{ref:c,role:"menu",style:{position:"fixed",top:s.top,left:s.left,zIndex:9999},className:xe("w-40 rounded-xl border border-border/60 bg-popover p-1 shadow-lg","animate-in fade-in-0 zoom-in-95 duration-100"),onClick:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),children:e.map((u,p)=>{const f=u.icon,h=e[p-1],g=p>0&&u.danger&&!h?.danger;return i.jsxs("div",{children:[g&&i.jsx("div",{className:"my-1 h-px bg-border/60"}),i.jsxs("button",{type:"button",role:"menuitem",onClick:d(u),className:xe("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs",u.danger?"text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20":"text-foreground hover:bg-accent"),children:[i.jsx(f,{className:"h-3 w-3"}),u.label]})]},u.id)})}),document.body)]})}const t9=(e,t,r)=>{const n=new Date(e),a=t;if(isNaN(n.getTime()))return r?r("status.unknown"):"Unknown";const s=a.getTime()-n.getTime(),o=Math.floor(s/1e3),l=Math.floor(s/(1e3*60)),c=Math.floor(s/(1e3*60*60)),d=Math.floor(s/(1e3*60*60*24));return o<60?r?r("time.justNow"):"Just now":l===1?r?r("time.oneMinuteAgo"):"1 min ago":l<60?r?r("time.minutesAgo",{count:l}):`${l} mins ago`:c===1?r?r("time.oneHourAgo"):"1 hour ago":c<24?r?r("time.hoursAgo",{count:c}):`${c} hours ago`:d===1?r?r("time.oneDayAgo"):"1 day ago":d<7?r?r("time.daysAgo",{count:d}):`${d} days ago`:n.toLocaleDateString()};function Tk({isStarred:e,canDelete:t,onRename:r,onToggleStar:n,onDelete:a,t:s,className:o}){const l=d=>i.jsx(yi,{className:`${d.className??""} ${e?"fill-yellow-400 text-yellow-500":""}`}),c=[{id:"rename",label:s("actions.rename"),icon:NN,onClick:r},{id:"star",label:e?s("actions.unstarSession",{defaultValue:"Remove star"}):s("actions.starSession",{defaultValue:"Star"}),icon:l,onClick:n}];return t&&c.push({id:"delete",label:s("actions.delete"),icon:Pr,onClick:a,danger:!0}),i.jsx(BE,{actions:c,className:o,triggerLabel:s("tooltips.sessionActions",{defaultValue:"Session actions"})})}const r9={claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code",opencode:"OpenCode"},Ak={claude:"bg-orange-500/10 text-orange-600 dark:bg-orange-400/10 dark:text-orange-300 ring-1 ring-orange-500/15",cursor:"bg-sky-500/10 text-sky-600 dark:bg-sky-400/10 dark:text-sky-300 ring-1 ring-sky-500/15",codex:"bg-violet-500/10 text-violet-600 dark:bg-violet-400/10 dark:text-violet-300 ring-1 ring-violet-500/15",gemini:"bg-emerald-500/10 text-emerald-600 dark:bg-emerald-400/10 dark:text-emerald-300 ring-1 ring-emerald-500/15",qwen:"bg-amber-500/10 text-amber-600 dark:bg-amber-400/10 dark:text-amber-300 ring-1 ring-amber-500/15",opencode:"bg-teal-500/10 text-teal-600 dark:bg-teal-400/10 dark:text-teal-300 ring-1 ring-teal-500/15"};function UE({project:e,session:t,selectedSession:r,currentTime:n,editingSession:a,editingSessionName:s,isStarred:o,compact:l=!1,onEditingSessionNameChange:c,onStartEditingSession:d,onCancelEditingSession:u,onSaveEditingSession:p,onToggleStarSession:f,onProjectSelect:h,onSessionSelect:g,onDeleteSession:b,t:x}){const y=$O(t,n,x),v=r?.id===t.id,w=a===t.id,C=t.__provider,k=r9[C]??C,N=Ak[C]??Ak.claude,j=zO(y.sessionName),A=()=>{h(e),g(t,e.name)},E=()=>{p(e.name,t.id,s,C)},T=()=>{b(e.name,t.id,y.sessionName,C)},_=()=>d(t.id,y.sessionName),I=()=>f(e.name,t.id),R=i.jsxs("div",{className:"mt-0.5 flex min-w-0 flex-wrap items-center gap-1 text-[10px] leading-tight",children:[i.jsxs("span",{className:xe("inline-flex items-center gap-1 rounded-full px-1.5 py-px font-medium",N),children:[i.jsx(dr,{provider:C,className:"h-2.5 w-2.5"}),k]}),i.jsx("span",{className:"text-muted-foreground/80",children:t9(y.sessionTime,n,x)}),y.isActive&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[i.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),x("status.active",{defaultValue:"Active"})]}),j.slice(0,3).map(z=>i.jsxs("span",{className:"rounded-md bg-muted/60 px-1 py-px font-mono text-[9px] uppercase tracking-wide text-muted-foreground ring-1 ring-border/40",children:[".",z]},z))]}),S=i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",value:s,onChange:z=>c(z.target.value),onKeyDown:z=>{z.stopPropagation(),z.key==="Enter"?E():z.key==="Escape"&&u()},onClick:z=>z.stopPropagation(),className:"w-full rounded-md border border-primary/40 bg-background px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),i.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-green-50 hover:bg-green-100 dark:bg-green-900/20 dark:hover:bg-green-900/40",onClick:z=>{z.stopPropagation(),E()},title:x("tooltips.save"),children:i.jsx(tr,{className:"h-3 w-3 text-green-600 dark:text-green-400"})}),i.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-gray-50 hover:bg-gray-100 dark:bg-gray-900/20 dark:hover:bg-gray-900/40",onClick:z=>{z.stopPropagation(),u()},title:x("tooltips.cancel"),children:i.jsx(At,{className:"h-3 w-3 text-gray-600 dark:text-gray-400"})})]}),F=i.jsx("div",{className:"md:hidden",children:i.jsx("div",{className:xe("relative mx-3 my-0.5 rounded-lg border border-border/30 bg-card p-2 transition-all duration-150 active:scale-[0.98]",v&&"border-primary/30 bg-primary/5 shadow-sm",!v&&y.isActive&&"border-green-500/25 bg-green-50/5 dark:bg-green-900/5",o&&!v&&"ring-1 ring-yellow-300/50 dark:ring-yellow-500/30"),onClick:w?void 0:A,children:w?i.jsx("div",{className:"flex items-center gap-1",children:S}):i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:xe("flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-md",v?"bg-primary/10":"bg-muted/60"),children:i.jsx(dr,{provider:C,className:"h-3 w-3"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[o&&i.jsx("span",{className:"text-yellow-500","aria-hidden":!0,children:"★"}),i.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:y.sessionName})]}),R]}),i.jsx("div",{className:"flex-shrink-0",onClick:z=>z.stopPropagation(),children:i.jsx(Tk,{isStarred:o,canDelete:!y.isCursorSession,onRename:_,onToggleStar:I,onDelete:T,t:x,className:"!opacity-100"})})]})})}),B=i.jsxs("div",{className:xe("group/item relative hidden md:block"),children:[i.jsxs(Ne,{variant:"ghost",className:xe("relative h-auto w-full justify-start overflow-hidden p-0 text-left font-normal transition-colors duration-150","hover:bg-accent/60",v&&"bg-accent text-accent-foreground",o&&!v&&"bg-yellow-50/40 hover:bg-yellow-100/40 dark:bg-yellow-900/10 dark:hover:bg-yellow-900/20",l?"rounded-xl px-3 py-2.5":"rounded-lg px-3 py-2"),onClick:w?void 0:()=>g(t,e.name),children:[v&&i.jsx("span",{"aria-hidden":!0,className:"absolute left-0 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-r bg-primary"}),!v&&!w&&i.jsx("span",{"aria-hidden":!0,className:"session-item-accent"}),i.jsxs("div",{className:"flex w-full min-w-0 items-start gap-2 pr-6",children:[i.jsx("div",{className:xe("mt-0.5 flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-md",v?"bg-primary/10":"bg-muted/50 group-hover/item:bg-muted/80"),children:i.jsx(dr,{provider:C,className:"h-3 w-3"})}),i.jsx("div",{className:"min-w-0 flex-1",children:w?i.jsx("div",{className:"flex items-center gap-1",children:S}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[o&&i.jsx("span",{className:"flex-shrink-0 text-yellow-500","aria-hidden":!0,children:"★"}),i.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:y.sessionName})]}),R]})})]})]}),!w&&i.jsx("div",{className:"absolute right-1.5 top-1/2 -translate-y-1/2",onClick:z=>z.stopPropagation(),children:i.jsx(Tk,{isStarred:o,canDelete:!y.isCursorSession,onRename:_,onToggleStar:I,onDelete:T,t:x,className:"opacity-0 focus-visible:opacity-100 group-hover/item:opacity-100"})})]});return i.jsxs("div",{className:"group relative",children:[F,B]})}const n9=e=>e==="claude-code"?"claude":e==="codex"?"codex":e==="gemini"?"gemini":e==="qwen"?"qwen":e==="opencode"?"opencode":null;function a9(){return i.jsx(i.Fragment,{children:Array.from({length:3}).map((e,t)=>i.jsx("div",{className:"rounded-md p-2",children:i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("div",{className:"mt-0.5 h-3 w-3 animate-pulse rounded-full bg-muted"}),i.jsxs("div",{className:"flex-1 space-y-1",children:[i.jsx("div",{className:"h-3 animate-pulse rounded bg-muted",style:{width:`${60+t*15}%`}}),i.jsx("div",{className:"h-2 w-1/2 animate-pulse rounded bg-muted"})]})]})},t))})}function i9({project:e,isExpanded:t,sessions:r,selectedSession:n,initialSessionsLoaded:a,isLoadingSessions:s,currentTime:o,editingSession:l,editingSessionName:c,isSessionStarred:d,onEditingSessionNameChange:u,onStartEditingSession:p,onCancelEditingSession:f,onSaveEditingSession:h,onToggleStarSession:g,onProjectSelect:b,onSessionSelect:x,onDeleteSession:y,onLoadMoreSessions:v,onNewSession:w,onOpenOrchestration:C,t:k}){const[N,j]=m.useState([]);if(m.useEffect(()=>{if(!t)return;let T=!1;const _=async()=>{const R=await Se(`/api/orchestration/workflows/runs?projectId=${encodeURIComponent(e.name)}`);if(!R.ok)return;const S=await R.json();T||j((S.runs??[]).slice(0,5))};_();const I=window.setInterval(()=>{_()},15e3);return()=>{T=!0,window.clearInterval(I)}},[t,e.name]),!t)return null;const A=r.length>0,E=e.sessionMeta?.hasMore===!0;return i.jsxs("div",{className:"ml-3 space-y-1 border-l border-border pl-3",children:[i.jsx("div",{className:"px-3 pb-1 pt-1 md:hidden",children:i.jsxs("button",{className:"flex h-8 w-full items-center justify-center gap-2 rounded-md bg-primary text-xs font-medium text-primary-foreground transition-all duration-150 hover:bg-primary/90 active:scale-[0.98]",onClick:()=>{b(e),w(e)},children:[i.jsx(Zt,{className:"h-3 w-3"}),k("sessions.newSession")]})}),i.jsxs(Ne,{variant:"default",size:"sm",className:"hidden h-8 w-full justify-start gap-2 bg-primary text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 md:flex",onClick:()=>w(e),children:[i.jsx(Zt,{className:"h-3 w-3"}),k("sessions.newSession")]}),N.length>0&&i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-1 px-3 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[i.jsx(_r,{className:"h-3 w-3"}),k("orchestration.section")]}),N.map(T=>{const _=[...new Set(T.nodeRuns.map(I=>n9(I.adapterId)).filter(Boolean))];return i.jsx("button",{type:"button",onClick:()=>C?.(e,T.id),className:"w-full rounded-lg px-3 py-2 text-left transition-colors hover:bg-accent/60",children:i.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[i.jsx(_r,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-primary"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-xs font-medium text-foreground",children:T.input||k("orchestration.fallbackTitle")}),i.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[_.slice(0,4).map(I=>i.jsx("span",{className:"flex h-4 w-4 items-center justify-center rounded bg-muted",children:i.jsx(dr,{provider:I,className:"h-3 w-3"})},I)),i.jsx("span",{className:"text-[10px] text-muted-foreground",children:k(`common:orchestration.status.${T.status}`,{defaultValue:T.status})})]})]})]})},T.id)})]}),a?!A&&!s?i.jsx("div",{className:"px-3 py-2 text-left",children:i.jsx("p",{className:"text-xs text-muted-foreground",children:k("sessions.noSessions")})}):r.map(T=>i.jsx(UE,{project:e,session:T,selectedSession:n,currentTime:o,editingSession:l,editingSessionName:c,isStarred:d(e.name,T.id),onEditingSessionNameChange:u,onStartEditingSession:p,onCancelEditingSession:f,onSaveEditingSession:h,onToggleStarSession:g,onProjectSelect:b,onSessionSelect:x,onDeleteSession:y,t:k},T.id)):i.jsx(a9,{}),A&&E&&i.jsx(Ne,{variant:"ghost",size:"sm",className:"mt-2 w-full justify-center gap-2 text-muted-foreground",onClick:()=>v(e),disabled:s,children:s?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-3 w-3 animate-spin rounded-full border border-muted-foreground border-t-transparent"}),k("sessions.loading")]}):i.jsxs(i.Fragment,{children:[i.jsx(Pn,{className:"h-3 w-3"}),k("sessions.showMore")]})})]})}const s9=(e,t)=>{const r=e.length;return t&&r>=5?`${r}+`:`${r}`};function o9({project:e,selectedProject:t,selectedSession:r,isExpanded:n,isDeleting:a,isStarred:s,editingProject:o,editingName:l,sessions:c,initialSessionsLoaded:d,isLoadingSessions:u,currentTime:p,editingSession:f,editingSessionName:h,isSessionStarred:g,onEditingNameChange:b,onToggleProject:x,onProjectSelect:y,onToggleStarProject:v,onToggleStarSession:w,onStartEditingProject:C,onCancelEditingProject:k,onSaveProjectName:N,onDeleteProject:j,onSessionSelect:A,onDeleteSession:E,onLoadMoreSessions:T,onNewSession:_,onOpenOrchestration:I,onEditingSessionNameChange:R,onStartEditingSession:S,onCancelEditingSession:F,onSaveEditingSession:B,t:z}){const q=t?.name===e.name,V=o===e.name,P=e.sessionMeta?.hasMore===!0,U=s9(c,P),H=`${U} session${c.length===1?"":"s"}`,M=()=>x(e.name),ee=()=>v(e.name),Q=()=>{N(e.name)},ge=()=>{t?.name!==e.name&&y(e),M()};return i.jsxs("div",{className:xe("md:space-y-1",a&&"opacity-50 pointer-events-none"),children:[i.jsxs("div",{className:"md:group group",children:[i.jsx("div",{className:"md:hidden",children:i.jsx("div",{className:xe("p-3 mx-3 my-1 rounded-lg bg-card border border-border/50 active:scale-[0.98] transition-all duration-150",q&&"bg-primary/5 border-primary/20",s&&!q&&"bg-yellow-50/50 dark:bg-yellow-900/5 border-yellow-200/30 dark:border-yellow-800/30"),onClick:M,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[i.jsx("div",{className:xe("w-8 h-8 rounded-lg flex items-center justify-center transition-colors",n?"bg-primary/10":"bg-muted"),children:n?i.jsx(On,{className:"h-4 w-4 text-primary"}):i.jsx($r,{className:"h-4 w-4 text-muted-foreground"})}),i.jsx("div",{className:"min-w-0 flex-1",children:V?i.jsx("input",{type:"text",value:l,onChange:se=>b(se.target.value),className:"w-full rounded-lg border-2 border-primary/40 bg-background px-3 py-2 text-sm text-foreground shadow-sm transition-all duration-200 focus:border-primary focus:shadow-md focus:outline-none",placeholder:z("projects.projectNamePlaceholder"),autoFocus:!0,autoComplete:"off",onClick:se=>se.stopPropagation(),onKeyDown:se=>{se.key==="Enter"&&Q(),se.key==="Escape"&&k()},style:{fontSize:"16px",WebkitAppearance:"none",borderRadius:"8px"}}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex min-w-0 flex-1 items-center justify-between",children:i.jsx("h3",{className:"truncate text-sm font-medium text-foreground",children:e.displayName})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:H})]})})]}),i.jsx("div",{className:"flex items-center gap-1",children:V?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-green-500 shadow-sm transition-all duration-150 active:scale-90 active:shadow-none dark:bg-green-600",onClick:se=>{se.stopPropagation(),Q()},children:i.jsx(tr,{className:"h-4 w-4 text-white"})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-gray-500 shadow-sm transition-all duration-150 active:scale-90 active:shadow-none dark:bg-gray-600",onClick:se=>{se.stopPropagation(),k()},children:i.jsx(At,{className:"h-4 w-4 text-white"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:xe("w-8 h-8 rounded-lg flex items-center justify-center active:scale-90 transition-all duration-150 border",s?"bg-yellow-500/10 dark:bg-yellow-900/30 border-yellow-200 dark:border-yellow-800":"bg-gray-500/10 dark:bg-gray-900/30 border-gray-200 dark:border-gray-800"),onClick:se=>{se.stopPropagation(),ee()},title:z(s?"tooltips.removeFromFavorites":"tooltips.addToFavorites"),children:i.jsx(yi,{className:xe("w-4 h-4 transition-colors",s?"text-yellow-600 dark:text-yellow-400 fill-current":"text-gray-600 dark:text-gray-400")})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg border border-red-200 bg-red-500/10 active:scale-90 dark:border-red-800 dark:bg-red-900/30",onClick:se=>{se.stopPropagation(),j(e)},children:i.jsx(Pr,{className:"h-4 w-4 text-red-600 dark:text-red-400"})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg border border-primary/20 bg-primary/10 active:scale-90 dark:border-primary/30 dark:bg-primary/20",onClick:se=>{se.stopPropagation(),C(e)},children:i.jsx(Bh,{className:"h-4 w-4 text-primary"})}),i.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-muted/30",children:n?i.jsx(Pn,{className:"h-3 w-3 text-muted-foreground"}):i.jsx(Dn,{className:"h-3 w-3 text-muted-foreground"})})]})})]})})}),i.jsxs(Ne,{variant:"ghost",className:xe("hidden md:flex w-full justify-between p-2 h-auto font-normal hover:bg-accent/50",q&&"bg-accent text-accent-foreground",s&&!q&&"bg-yellow-50/50 dark:bg-yellow-900/10 hover:bg-yellow-100/50 dark:hover:bg-yellow-900/20"),onClick:ge,children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[n?i.jsx(On,{className:"h-4 w-4 flex-shrink-0 text-primary"}):i.jsx($r,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"}),i.jsx("div",{className:"min-w-0 flex-1 text-left",children:V?i.jsxs("div",{className:"space-y-1",children:[i.jsx("input",{type:"text",value:l,onChange:se=>b(se.target.value),className:"w-full rounded border border-border bg-background px-2 py-1 text-sm text-foreground focus:ring-2 focus:ring-primary/20",placeholder:z("projects.projectNamePlaceholder"),autoFocus:!0,onKeyDown:se=>{se.key==="Enter"&&Q(),se.key==="Escape"&&k()}}),i.jsx("div",{className:"truncate text-xs text-muted-foreground",title:e.fullPath,children:e.fullPath})]}):i.jsxs("div",{children:[i.jsx("div",{className:"truncate text-sm font-semibold text-foreground",title:e.displayName,children:e.displayName}),i.jsxs("div",{className:"text-xs text-muted-foreground",children:[U,e.fullPath!==e.displayName&&i.jsxs("span",{className:"ml-1 opacity-60",title:e.fullPath,children:[" - ",e.fullPath.length>25?`...${e.fullPath.slice(-22)}`:e.fullPath]})]})]})})]}),i.jsx("div",{className:"flex flex-shrink-0 items-center gap-1",children:V?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded text-green-600 transition-colors hover:bg-green-50 hover:text-green-700 dark:hover:bg-green-900/20",onClick:se=>{se.stopPropagation(),Q()},children:i.jsx(tr,{className:"h-3 w-3"})}),i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 dark:hover:bg-gray-800",onClick:se=>{se.stopPropagation(),k()},children:i.jsx(At,{className:"h-3 w-3"})})]}):i.jsxs(i.Fragment,{children:[s&&i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded hover:bg-yellow-50 dark:hover:bg-yellow-900/20",onClick:se=>{se.stopPropagation(),ee()},title:z("tooltips.removeFromFavorites"),children:i.jsx(yi,{className:"h-3 w-3 fill-current text-yellow-600 dark:text-yellow-400"})}),i.jsx(BE,{triggerLabel:z("tooltips.projectActions",{defaultValue:"Project actions"}),actions:[{id:"rename",label:z("actions.rename"),icon:Bh,onClick:()=>C(e)},{id:"star",label:z(s?"tooltips.removeFromFavorites":"tooltips.addToFavorites"),icon:yi,onClick:ee},{id:"delete",label:z("actions.delete",{defaultValue:"Delete"}),icon:Pr,onClick:()=>j(e),danger:!0}]}),n?i.jsx(Pn,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"}):i.jsx(Dn,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})]})})]})]}),i.jsx(i9,{project:e,isExpanded:n,sessions:c,selectedSession:r,initialSessionsLoaded:d,isLoadingSessions:u,currentTime:p,editingSession:f,editingSessionName:h,isSessionStarred:g,onEditingSessionNameChange:R,onStartEditingSession:S,onCancelEditingSession:F,onSaveEditingSession:B,onToggleStarSession:w,onProjectSelect:y,onSessionSelect:A,onDeleteSession:E,onLoadMoreSessions:T,onNewSession:_,onOpenOrchestration:I,t:z})]})}function $E({isLoading:e,loadingProgress:t,projectsCount:r,filteredProjectsCount:n,t:a}){return e?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.loadingProjects")}),t&&t.total>0?i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:i.jsx("div",{className:"h-full bg-primary transition-all duration-300 ease-out",style:{width:`${t.current/t.total*100}%`}})}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.current,"/",t.total," ",a("projects.projects")]}),t.currentProject&&i.jsx("p",{className:"mx-auto max-w-[200px] truncate text-xs text-muted-foreground/70",title:t.currentProject,children:t.currentProject.split("-").slice(-2).join("/")})]}):i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.fetchingProjects")})]}):r===0?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx($r,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.noProjects")}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.runClaudeCli")})]}):n===0?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx(ps,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.noMatchingProjects")}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.tryDifferentSearch")})]}):null}function l9({projects:e,filteredProjects:t,selectedProject:r,selectedSession:n,isLoading:a,loadingProgress:s,expandedProjects:o,editingProject:l,editingName:c,loadingSessions:d,initialSessionsLoaded:u,currentTime:p,editingSession:f,editingSessionName:h,deletingProjects:g,getProjectSessions:b,isProjectStarred:x,isSessionStarred:y,onEditingNameChange:v,onToggleProject:w,onProjectSelect:C,onToggleStarProject:k,onToggleStarSession:N,onStartEditingProject:j,onCancelEditingProject:A,onSaveProjectName:E,onDeleteProject:T,onSessionSelect:_,onDeleteSession:I,onLoadMoreSessions:R,onNewSession:S,onOpenOrchestration:F,onEditingSessionNameChange:B,onStartEditingSession:z,onCancelEditingSession:q,onSaveEditingSession:V,t:P}){const U=i.jsx($E,{isLoading:a,loadingProgress:s,projectsCount:e.length,filteredProjectsCount:t.length,t:P});m.useEffect(()=>{let se="Pixcode";const ce=r?.displayName?.trim();ce&&(se=`${ce} - ${se}`),document.title=se},[r]);const H=!a&&e.length>0&&t.length>0,M=se=>se.source==="history"||se.autoDiscovered===!0&&se.isManuallyAdded!==!0,ee=t.filter(se=>!M(se)),Q=t.filter(se=>M(se)),ge=se=>i.jsx(o9,{project:se,selectedProject:r,selectedSession:n,isExpanded:o.has(se.name),isDeleting:g.has(se.name),isStarred:x(se.name),editingProject:l,editingName:c,sessions:b(se),initialSessionsLoaded:u.has(se.name),isLoadingSessions:!!d[se.name],currentTime:p,editingSession:f,editingSessionName:h,isSessionStarred:y,onEditingNameChange:v,onToggleProject:w,onProjectSelect:C,onToggleStarProject:k,onToggleStarSession:N,onStartEditingProject:j,onCancelEditingProject:A,onSaveProjectName:E,onDeleteProject:T,onSessionSelect:_,onDeleteSession:I,onLoadMoreSessions:R,onNewSession:S,onOpenOrchestration:F,onEditingSessionNameChange:B,onStartEditingSession:z,onCancelEditingSession:q,onSaveEditingSession:V,t:P},se.name);return i.jsx("div",{className:"pb-safe-area-inset-bottom md:space-y-1",children:H?i.jsxs(i.Fragment,{children:[ee.map(se=>ge(se)),Q.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"px-3 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:P("projects.detectedFromHistory")}),Q.map(se=>ge(se))]})]}):U})}function Ra(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HE(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}/*!
|
|
220
|
+
*/const pD=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],mD=jt("workflow",pD),vN=lN,hD=b7,Zw=m7,fD=a7,wN=c7,gD=oN,Pn=uN,pc=Q7,Dn=t8,bD=n8,Tn=u7,Xn=oN,Kd=f7,kN=o7,Pu=K7,Gl=Z7,vg=y7,it=cN,Ft=cN,mc=S7,SN=w7,xD=oL,Yn=A8,kr=I8,tr=W7,Ua=G7,CN=K8,Fr=EL,hc=fN,yD=fN,Yd=D7,go=i8,Lo=pN,as=d8,bo=v8,jr=k8,$r=B8,On=O8,ki=F8,vD=pL,wD=W8,wg=Q8,kg=vL,kD=N7,SD=M7,CD=zL,NN=hN,Bh=cL,ND=$8,Uh=hN,EN=hL,Zt=gL,Pr=UL,TN=C8,ps=nL,At=gN,$h=gN,fc=LL,Sg=_7,ED=j7,Hh=T7,TD=E8,Mn=dN,AD=dN,jD=HL,ms=VL,Cg=U7,xo=z7,Ng=l8,gc=P8,Eg=R8,fn=G8,Po=pN,bc=mN,ID=mN,AN=X8,kn=tL,jN=iL,Du=g8,IN=ML,_D=xL,Si=CL,RD=kL,Ut=p8,_N=e7,xc=x8,Fn=jL,yi=_L,RN=DL,Xr=h8,Tg=L7,LD=tP,bs=oP,Ag=xN,PD=xN,Hr=$P,jd=GP,Ou=WP,js=QL,Is=nP,DD=iP,xl=cP,no=uP,Xw=hP,yl=gP,nl=vP,OD=kP,LN=PP,Gh=CP,ra=AP,al=EP,Jw=IP,il=RP,Vh=OP,MD=FP,Wh=BP,Xs=ZP,vl=JP,ti=eD,_s=rD,FD=aD,qh=sD,zD=cD,sl=uD,_r=mD,jg=xP,BD=KP,UD=[{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"}],$D={up:hD,down:vN,left:fD,right:wN},ol=e=>e.preventDefault(),Qw="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",HD="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",Tp="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 ek({wsRef:e,terminalRef:t,isConnected:r,bottomOffset:n="bottom-0"}){const{t:a}=Be("settings"),[s,o]=m.useState(!1),[l,c]=m.useState(!1),d=m.useCallback(h=>{pi(e.current,{type:"input",data:h})},[e]),u=m.useCallback(()=>{t.current?.scrollToBottom()},[t]),p=m.useCallback(async()=>{if(!(typeof navigator>"u"||!navigator.clipboard?.readText))try{const h=await navigator.clipboard.readText();h.length>0&&d(h)}catch{}},[d]),f=m.useCallback(h=>{let g=h;if(s&&h.length===1){const b=h.toLowerCase().charCodeAt(0);b>=97&&b<=122&&(g=String.fromCharCode(b-96)),o(!1)}l&&h.length===1&&(g="\x1B"+g,c(!1)),d(g)},[s,l,d]);return i.jsx("div",{className:`pointer-events-none fixed inset-x-0 ${n} z-20 px-2 md:hidden`,children:i.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:[i.jsx("button",{type:"button",onPointerDown:ol,onClick:()=>{p()},disabled:!r,className:Tp,title:a("terminalShortcuts.paste",{defaultValue:"Paste"}),"aria-label":a("terminalShortcuts.paste",{defaultValue:"Paste"}),children:i.jsx(go,{className:"h-4 w-4"})}),UD.map(h=>{if(h.type==="modifier"){const g=h.modifier==="ctrl"?s:l,b=h.modifier==="ctrl"?()=>o(x=>!x):()=>c(x=>!x);return i.jsx("button",{type:"button",onPointerDown:ol,onClick:b,disabled:!r,className:g?HD:Qw,children:h.label},h.id)}if(h.type==="arrow"){const g=$D[h.icon];return i.jsx("button",{type:"button",onPointerDown:ol,onClick:()=>d(h.sequence),disabled:!r,className:Tp,children:i.jsx(g,{className:"h-4 w-4"})},h.id)}return i.jsx("button",{type:"button",onPointerDown:ol,onClick:()=>f(h.sequence),disabled:!r,className:Qw,children:h.label},h.id)}),i.jsx("button",{type:"button",onPointerDown:ol,onClick:u,disabled:!r,className:Tp,title:a("terminalShortcuts.scrollDown"),"aria-label":a("terminalShortcuts.scrollDown"),children:i.jsx(gD,{className:"h-4 w-4"})})]})})}function GD({selectedProject:e=null,selectedSession:t=null,initialCommand:r=null,isPlainShell:n=!1,onProcessComplete:a=null,minimal:s=!1,autoConnect:o=!1,forceNewSession:l=!1,startupInput:c=null,hermesLaunchId:d=null,permissionOverride:u=null,isActive:p=!0,onClose:f=null}){const{t:h}=Be("chat"),[g,b]=m.useState(!1),[x,y]=m.useState(null),v=m.useRef(null),w=m.useRef(null),{terminalContainerRef:C,terminalRef:k,wsRef:N,isConnected:j,isInitialized:A,isConnecting:E,authUrl:T,authUrlVersion:_,connectToShell:I,disconnectFromShell:R,openAuthUrlInBrowser:S,copyAuthUrlToClipboard:F}=KR({selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:n,minimal:s,autoConnect:o,forceNewSession:l,startupInput:c,hermesLaunchId:d,permissionOverride:u,isRestarting:g,onProcessComplete:a,onOutputRef:w}),B=m.useCallback(()=>{const pe=k.current;if(!pe)return;const ve=pe.buffer.active,ue=ve.baseY+ve.cursorY,de=Math.min(ve.baseY+ve.length-1,ue+10),D=Math.max(0,ue-wR),X=[];for(let me=D;me<=de;me++){const we=ve.getLine(me);we&&X.push(we.translateToString().trimEnd())}let oe=-1;for(let me=X.length-1;me>=0;me--)if(/esc to cancel/i.test(X[me])||/enter to select/i.test(X[me])){oe=me;break}if(oe===-1){y(null);return}const K=new Map,W=Math.max(0,oe-kR);for(let me=oe-1;me>=W;me--){const we=X[me].match(/^\s*[❯›>]?\s*(\d+)\.\s+(.+)/);if(we){const le=we[1],Ae=we[2].trim();parseInt(le,10)<=SR&&Ae.length>0&&!K.has(le)&&K.set(le,Ae)}}const ne=[];for(let me=1;me<=K.size&&K.has(String(me));me++)ne.push({number:String(me),label:K.get(String(me))});y(ne.length>=CR?ne:null)},[k]),z=m.useCallback(()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(B,vR)},[B]);m.useEffect(()=>{w.current=z},[z]),m.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]),m.useEffect(()=>{j||(v.current&&(clearTimeout(v.current),v.current=null),y(null))},[j]),m.useEffect(()=>{if(!p||!A||!j)return;const pe=()=>{k.current?.focus()},ve=window.requestAnimationFrame(pe),ue=window.setTimeout(pe,0);return()=>{window.cancelAnimationFrame(ve),window.clearTimeout(ue)}},[p,j,A,k]);const q=m.useCallback(pe=>{pi(N.current,{type:"input",data:pe})},[N]),V=m.useMemo(()=>GR(t),[t]),P=m.useMemo(()=>t?.__provider?t.__provider:window.localStorage.getItem("selected-provider")||"claude",[t?.__provider]),U=Kn[P]??"Claude Code",H=m.useMemo(()=>V?V.slice(0,30):null,[V]),M=m.useMemo(()=>V?V.slice(0,50):null,[V]),ee=m.useCallback(()=>{b(!0),window.setTimeout(()=>{b(!1)},xR)},[]),Q=m.useCallback(()=>{R(),f?.()},[R,f]);if(!e)return i.jsx(ZR,{title:h("shell.selectProject.title"),description:h("shell.selectProject.description")});if(s)return i.jsxs(i.Fragment,{children:[i.jsx(JR,{terminalContainerRef:C,authUrl:T,authUrlVersion:_,initialCommand:r,isConnected:j,openAuthUrlInBrowser:S,copyAuthUrlToClipboard:F}),i.jsx(ek,{wsRef:N,terminalRef:k,isConnected:j,bottomOffset:"bottom-0"})]});const ge=n?h("shell.runCommand",{command:r||h("shell.defaultCommand"),projectName:e.displayName}):t?h("shell.resumeSession",{displayName:M}):h("shell.startProviderSession",{provider:U,defaultValue:"Start a new {{provider}} session"}),se=n?h("shell.runCommand",{command:r||h("shell.defaultCommand"),projectName:e.displayName}):h("shell.startProviderCli",{provider:U,projectName:e.displayName,defaultValue:"Starting {{provider}} in {{projectName}}"}),ce=A?E?"connecting":j?null:"connect":"loading",ye=ce==="connecting"?se:ge;return i.jsxs("div",{className:"flex h-full w-full flex-col bg-gray-900",children:[i.jsx(XR,{isConnected:j,isInitialized:A,isRestarting:g,hasSession:!!t,sessionDisplayNameShort:H,onDisconnect:Q,onRestart:ee,statusNewSessionText:h("shell.status.newSession"),statusInitializingText:h("shell.status.initializing"),statusRestartingText:h("shell.status.restarting"),disconnectLabel:h("shell.actions.disconnect"),disconnectTitle:h("shell.actions.disconnectTitle"),restartLabel:h("shell.actions.restart"),restartTitle:h("shell.actions.restartTitle"),disableRestart:g||j}),i.jsxs("div",{className:"relative flex-1 overflow-hidden p-2",children:[i.jsx("div",{ref:C,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),ce&&i.jsx(YR,{mode:ce,description:ye,loadingLabel:h("shell.loading"),connectLabel:h("shell.actions.connect"),connectTitle:h("shell.actions.connectTitle"),connectingLabel:h("shell.connecting"),onConnect:I}),x&&j&&i.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:pe=>pe.preventDefault(),children:i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x.map(pe=>i.jsxs("button",{type:"button",onClick:()=>{q(`${pe.number}\r`),y(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:`${pe.number}. ${pe.label}`,children:[pe.number,". ",pe.label]},pe.number)),i.jsx("button",{type:"button",onClick:()=>{q("\x1B"),y(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"})]})})]}),i.jsx(ek,{wsRef:N,terminalRef:k,isConnected:j})]})}function VD({className:e}){return i.jsx("div",{className:`flex h-full items-center justify-center ${e}`,children:i.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[i.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:i.jsx("svg",{className:"h-8 w-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.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"})})}),i.jsx("h3",{className:"mb-2 text-lg font-semibold",children:"No Project Selected"}),i.jsx("p",{children:"A project is required to open a shell"})]})})}function WD({title:e,isCompleted:t,onClose:r=null}){return i.jsx("div",{className:"flex-shrink-0 border-b border-gray-700 bg-gray-800 px-4 py-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-200",children:e}),t&&i.jsx("span",{className:"text-xs text-green-400",children:"(Completed)"})]}),r&&i.jsx("button",{onClick:r,className:"text-gray-400 hover:text-white",title:"Close",children:i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})}function Vl({project:e=null,session:t=null,command:r=null,isPlainShell:n=null,isActive:a=!0,autoConnect:s=!0,onComplete:o=null,onClose:l=null,title:c=null,className:d="",showHeader:u=!0,compact:p=!1,minimal:f=!1,forceNewSession:h=!1,startupInput:g=null,hermesLaunchId:b=null,permissionOverride:x=null}){const[y,v]=m.useState(!1),w=n!==null?n:r!==null,C=m.useCallback(k=>{v(!0),o?.(k)},[o]);return e?i.jsxs("div",{className:`flex h-full w-full flex-col ${d}`,children:[!f&&u&&c&&i.jsx(WD,{title:c,isCompleted:y,onClose:l}),i.jsx("div",{className:"min-h-0 w-full flex-1",children:i.jsx(GD,{selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:w,isActive:a,onProcessComplete:C,minimal:f,autoConnect:f?!0:s,forceNewSession:h,startupInput:g,hermesLaunchId:b,permissionOverride:x,onClose:l})})]}):i.jsx(VD,{className:d})}const qD=(e,t)=>t||(e==="claude"?"claude --dangerously-skip-permissions /login":e==="cursor"?"cursor-agent login":e==="codex"?"codex login":e==="qwen"?"qwen auth":e==="opencode"?"opencode auth login":"gemini"),KD={claude:{keyLabel:"Anthropic API Key",keyExample:"sk-ant-...",supportsBaseUrl:!0,baseUrlExample:"https://api.anthropic.com",keyConsoleUrl:"https://console.anthropic.com/settings/keys",keyConsoleLabel:"Anthropic Console"},codex:{keyLabel:"OpenAI API Key",keyExample:"sk-...",supportsBaseUrl:!0,baseUrlExample:"https://api.openai.com/v1",keyConsoleUrl:"https://platform.openai.com/api-keys",keyConsoleLabel:"OpenAI Platform"},gemini:{keyLabel:"Gemini API Key",keyExample:"AI...",supportsBaseUrl:!1,keyConsoleUrl:"https://aistudio.google.com/app/apikey",keyConsoleLabel:"Google AI Studio"},qwen:{keyLabel:"OpenAI-Compatible API Key",keyExample:"sk-... or sk-sp-...",supportsBaseUrl:!0,baseUrlExample:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",keyConsoleUrl:"https://github.com/QwenLM/qwen-code",keyConsoleLabel:"Qwen Code Docs",notes:"Accepts any OpenAI-compatible endpoint — Alibaba Cloud, ModelScope, OpenRouter, self-hosted, etc."},opencode:{keyLabel:"Anthropic API Key (default backend)",keyExample:"sk-ant-...",supportsBaseUrl:!0,baseUrlExample:"https://api.anthropic.com",keyConsoleUrl:"https://console.anthropic.com/settings/keys",keyConsoleLabel:"Anthropic Console",notes:"OpenCode is multi-provider — this sets the Anthropic credentials. Switch providers via `opencode auth login` or opencode.json."}};function tk({active:e,children:t,onClick:r}){return i.jsx("button",{onClick:r,className:`flex-1 border-b-2 px-4 py-2.5 text-sm font-medium transition-colors ${e?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:t})}function YD({provider:e}){const[t,r]=m.useState(""),[n,a]=m.useState(!1),[s,o]=m.useState("idle"),[l,c]=m.useState(null),d=async()=>{const u=t.trim();if(u){a(!0),c(null),o("idle");try{const p=await Se(`/api/providers/${e}/oauth-paste`,{method:"POST",body:JSON.stringify({callbackUrl:u})}),f=await p.json().catch(()=>({}));if(!p.ok||!f?.success)throw new Error(f?.error||`Request failed (${p.status})`);o("ok"),r("")}catch(p){c(p?.message||"Forward failed"),o("error")}finally{a(!1)}}};return i.jsxs("div",{className:"mt-3 rounded-lg border border-border/60 bg-muted/30 p-3 text-sm",children:[i.jsx("div",{className:"mb-2 font-medium text-foreground",children:"Remote login? Paste the callback URL here"}),i.jsxs("p",{className:"mb-3 text-xs text-muted-foreground",children:["When the CLI shows ",i.jsx("code",{className:"rounded bg-background px-1 font-mono text-[11px]",children:"http://127.0.0.1:PORT/…"})," and your browser can't reach it (VPS setups), copy the failing URL from your address bar and paste it below. Pixcode forwards the token exchange to the CLI process on this host."]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",value:t,onChange:u=>r(u.target.value),placeholder:"http://127.0.0.1:49312/callback?code=...",className:"flex-1 rounded-md border border-border bg-background px-3 py-2 font-mono text-xs text-foreground focus:border-primary focus:outline-none",onKeyDown:u=>{u.key==="Enter"&&d()}}),i.jsx("button",{onClick:()=>void d(),disabled:n||!t.trim(),className:"flex items-center gap-1.5 rounded-md bg-foreground px-3 py-2 text-xs font-medium text-background transition-opacity hover:opacity-90 disabled:opacity-40",children:n?i.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin"}):"Forward"})]}),s==="ok"&&i.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-emerald-600 dark:text-emerald-400",children:[i.jsx(tr,{className:"h-3.5 w-3.5"})," Forwarded — check the terminal above for the completion message."]}),s==="error"&&l&&i.jsx("div",{className:"mt-2 text-xs text-red-600 dark:text-red-400",children:l})]})}function ZD({provider:e,onSaved:t}){const r=KD[e],[n,a]=m.useState(""),[s,o]=m.useState(""),[l,c]=m.useState(!1),[d,u]=m.useState("idle"),[p,f]=m.useState(null);m.useEffect(()=>{let g=!1;return(async()=>{try{const x=await(await Se("/api/providers/credentials")).json().catch(()=>({}));if(g||!x?.success)return;const y=x.data?.[e];y?.baseUrl&&o(y.baseUrl)}catch{}})(),()=>{g=!0}},[e]);const h=async()=>{const g=n.trim();if(g){c(!0),f(null),u("idle");try{const b=await Se(`/api/providers/${e}/auth/api-key`,{method:"POST",body:JSON.stringify({apiKey:g,baseUrl:r.supportsBaseUrl&&s.trim()?s.trim():""})}),x=await b.json().catch(()=>({}));if(!b.ok||!x?.success)throw new Error(x?.error||`Request failed (${b.status})`);u("ok"),a(""),t()}catch(b){f(b?.message||"Save failed"),u("error")}finally{c(!1)}}};return r?i.jsx("div",{className:"flex h-full flex-col overflow-y-auto p-6",children:i.jsxs("div",{className:"mx-auto w-full max-w-lg space-y-5",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-muted",children:i.jsx(ID,{className:"h-5 w-5 text-foreground"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-base font-semibold text-foreground",children:r.keyLabel}),i.jsxs("a",{href:r.keyConsoleUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:["Get a key from ",r.keyConsoleLabel,i.jsx(Tn,{className:"h-3 w-3"})]})]})]}),r.notes&&i.jsx("div",{className:"rounded-md border border-border/60 bg-muted/40 p-3 text-xs text-muted-foreground",children:r.notes}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-foreground",children:"API Key"}),i.jsx("input",{type:"password",value:n,onChange:g=>a(g.target.value),placeholder:r.keyExample,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-sm text-foreground focus:border-primary focus:outline-none",autoComplete:"off",spellCheck:!1}),i.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Stored locally at ",i.jsx("code",{className:"rounded bg-muted px-1 font-mono text-[10px]",children:"~/.pixcode/provider-credentials.json"})," with 0600 permissions."]})]}),r.supportsBaseUrl&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs font-medium text-foreground",children:["Base URL ",i.jsx("span",{className:"font-normal text-muted-foreground",children:"(optional — use a custom endpoint)"})]}),i.jsx("input",{type:"url",value:s,onChange:g=>o(g.target.value),placeholder:r.baseUrlExample,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-sm text-foreground focus:border-primary focus:outline-none",autoComplete:"off",spellCheck:!1}),i.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Point at any OpenAI-compatible proxy (OpenRouter, local LLM, self-hosted, budget provider) to cut costs or hit different models."})]}),i.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[i.jsxs("button",{onClick:()=>void h(),disabled:l||!n.trim(),className:"inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background transition-opacity hover:opacity-90 disabled:opacity-40",children:[l?i.jsx(Ft,{className:"h-4 w-4 animate-spin"}):i.jsx(tr,{className:"h-4 w-4"}),"Save API Key"]}),d==="ok"&&i.jsx("span",{className:"text-xs text-emerald-600 dark:text-emerald-400",children:"Saved — reconnect to pick it up."}),d==="error"&&p&&i.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:p})]})]})}):i.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This provider uses OAuth only — use the Browser tab to log in."})}function PN({isOpen:e,onClose:t,provider:r="claude",onComplete:n,customCommand:a,isAuthenticated:s=!1}){const{t:o}=Be("common"),l=r!=="cursor",[c,d]=m.useState(l?"apiKey":"browser");m.useEffect(()=>{e&&d(l?"apiKey":"browser")},[e,r,l]);const u=m.useMemo(()=>`${Kn[r]??r} Login`,[r]);if(!e)return null;const p=qD(r,a),f=h=>n?.(h);return i.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:i.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:[i.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 p-4 dark:border-gray-700",children:[i.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:u}),i.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:i.jsx(At,{className:"h-6 w-6"})})]}),i.jsxs("div",{className:"flex border-b border-gray-200 dark:border-gray-700",children:[i.jsx(tk,{active:c==="browser",onClick:()=>d("browser"),children:"Browser / OAuth"}),l&&i.jsx(tk,{active:c==="apiKey",onClick:()=>d("apiKey"),children:"API Key"})]}),i.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:c==="browser"?i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsx("div",{className:"min-h-0 flex-1",children:i.jsx(Vl,{project:tR,command:p,onComplete:f,minimal:!0})}),i.jsx("div",{className:"border-t border-border/40 bg-background/50 px-4 py-3",children:i.jsx(YD,{provider:r})})]}):i.jsx(ZD,{provider:r,onSaved:()=>f(0)})})]})})}const XD=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/claude-ai-icon.svg",alt:"Claude",className:e}),JD=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Xa();return i.jsx("img",{src:t?"/icons/codex-white.svg":"/icons/codex.svg",alt:"Codex",className:e})},QD=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Xa();return i.jsx("img",{src:t?"/icons/cursor-white.svg":"/icons/cursor.svg",alt:"Cursor",className:e})},eO=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/gemini-ai-icon.svg",alt:"Gemini",className:e}),tO=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Xa(),r=t?"/icons/opencode-logo-dark.svg":"/icons/opencode-logo-light.svg";return i.jsx("img",{src:r,alt:"OpenCode",className:e})},rO=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/qwen-logo.svg",alt:"Qwen Code",className:e});function dr({provider:e="claude",className:t="w-5 h-5"}){return e==="cursor"?i.jsx(QD,{className:t}):e==="codex"?i.jsx(JD,{className:t}):e==="gemini"?i.jsx(eO,{className:t}):e==="qwen"?i.jsx(rO,{className:t}):e==="opencode"?i.jsx(tO,{className:t}):e==="hermes"?i.jsx(_r,{className:t}):i.jsx(XD,{className:t})}function nO({provider:e,title:t,status:r,connectedClassName:n,iconContainerClassName:a,loginButtonClassName:s,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 i.jsx("div",{className:`rounded-lg border p-4 transition-colors ${l}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-full ${a}`,children:i.jsx(dr,{provider:e,className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 font-medium text-foreground",children:[t,r.authenticated&&i.jsx(tr,{className:"h-4 w-4 text-green-500"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:c})]})]}),!r.authenticated&&!r.loading&&i.jsx("button",{onClick:o,className:`${s} rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors`,children:"Login"})]})})}const aO=[{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"},{provider:"qwen",title:"Qwen Code",connectedClassName:"bg-orange-50 dark:bg-orange-900/20 border-orange-200 dark:border-orange-800",iconContainerClassName:"bg-orange-100 dark:bg-orange-900/30",loginButtonClassName:"bg-orange-600 hover:bg-orange-700"}];function rk({providerStatuses:e,onOpenProviderLogin:t}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"mb-6 text-center",children:[i.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",children:"Connect Your AI Agents"}),i.jsx("p",{className:"text-muted-foreground",children:"Login to one or more AI coding assistants. All are optional."})]}),i.jsx("div",{className:"space-y-3",children:aO.map(r=>i.jsx(nO,{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))}),i.jsx("div",{className:"pt-2 text-center text-sm text-muted-foreground",children:i.jsx("p",{children:"You can configure these later in Settings."})})]})}function iO({gitName:e,gitEmail:t,isSubmitting:r,onGitNameChange:n,onGitEmailChange:a}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"mb-8 text-center",children:[i.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:i.jsx(Hr,{className:"h-8 w-8 text-blue-600 dark:text-blue-400"})}),i.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",children:"Git Configuration"}),i.jsx("p",{className:"text-muted-foreground",children:"Configure your git identity to ensure proper attribution for commits."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitName",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[i.jsx(jD,{className:"h-4 w-4"}),"Git Name ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"text",id:"gitName",value:e,onChange:s=>n(s.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}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.name`."})]}),i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitEmail",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[i.jsx(TD,{className:"h-4 w-4"}),"Git Email ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"email",id:"gitEmail",value:t,onChange:s=>a(s.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}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.email`."})]})]})]})}const nk=[{title:"Git Configuration",icon:Hr,required:!0},{title:"Connect Agents",icon:kN,required:!1}];function sO({currentStep:e}){return i.jsx("div",{className:"mb-8",children:i.jsx("div",{className:"flex items-center justify-between",children:nk.map((t,r)=>{const n=r<e,a=r===e,s=t.icon;return i.jsxs("div",{className:"contents",children:[i.jsxs("div",{className:"flex flex-1 flex-col items-center",children:[i.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?i.jsx(tr,{className:"h-6 w-6"}):i.jsx(s,{className:"h-6 w-6"})}),i.jsxs("div",{className:"mt-2 text-center",children:[i.jsx("p",{className:`text-sm font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:t.title}),t.required&&i.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),r<nk.length-1&&i.jsx("div",{className:`mx-2 h-0.5 flex-1 transition-colors duration-200 ${n?"bg-green-500":"bg-border"}`})]},t.title)})})})}const ak=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ik=async(e,t)=>{try{return(await e.json()).error||t}catch{return t}};function oO({onComplete:e}){const[t,r]=m.useState(0),[n,a]=m.useState(""),[s,o]=m.useState(""),[l,c]=m.useState(!1),[d,u]=m.useState(""),[p,f]=m.useState(null),{providerAuthStatus:h,checkProviderAuthStatus:g,refreshProviderAuthStatuses:b}=Lu(),x=m.useRef(void 0),y=m.useCallback(async()=>{try{const A=await Se("/api/user/git-config");if(!A.ok)return;const E=await A.json();E.gitName&&a(E.gitName),E.gitEmail&&o(E.gitEmail)}catch(A){console.error("Error loading git config:",A)}},[]);m.useEffect(()=>{y(),b()},[y,b]),m.useEffect(()=>{const A=x.current;x.current=p,A!=null&&p===null&&b()},[p,b]);const v=A=>{f(A)},w=A=>{A===0&&p&&g(p)},C=async()=>{if(u(""),t!==0){r(A=>A+1);return}if(!n.trim()||!s.trim()){u("Both git name and email are required.");return}if(!ak.test(s)){u("Please enter a valid email address.");return}c(!0);try{const A=await Se("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:n,gitEmail:s})});if(!A.ok){const E=await ik(A,"Failed to save git configuration");throw new Error(E)}r(E=>E+1)}catch(A){u(A instanceof Error?A.message:"Failed to save git configuration")}finally{c(!1)}},k=()=>{u(""),r(A=>A-1)},N=async()=>{c(!0),u("");try{const A=await Se("/api/user/complete-onboarding",{method:"POST"});if(!A.ok){const E=await ik(A,"Failed to complete onboarding");throw new Error(E)}await e?.()}catch(A){u(A instanceof Error?A.message:"Failed to complete onboarding")}finally{c(!1)}},j=t===0?!!(n.trim()&&s.trim()&&ak.test(s)):!0;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"w-full max-w-2xl",children:[i.jsx(sO,{currentStep:t}),i.jsxs("div",{className:"rounded-lg border border-border bg-card p-8 shadow-lg",children:[t===0?i.jsx(iO,{gitName:n,gitEmail:s,isSubmitting:l,onGitNameChange:a,onGitEmailChange:o}):t===1?i.jsx(rk,{providerStatuses:h,onOpenProviderLogin:v}):i.jsx(rk,{providerStatuses:h,onOpenProviderLogin:v}),d&&i.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:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:d})}),i.jsxs("div",{className:"mt-8 flex items-center justify-between border-t border-border pt-6",children:[i.jsxs("button",{onClick:k,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:[i.jsx(pc,{className:"h-4 w-4"}),"Previous"]}),i.jsx("div",{className:"flex items-center gap-3",children:t<1?i.jsx("button",{onClick:C,disabled:!j||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?i.jsxs(i.Fragment,{children:[i.jsx(Ft,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(Dn,{className:"h-4 w-4"})]})}):i.jsx("button",{onClick:N,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?i.jsxs(i.Fragment,{children:[i.jsx(Ft,{className:"h-4 w-4 animate-spin"}),"Completing..."]}):i.jsxs(i.Fragment,{children:[i.jsx(tr,{className:"h-4 w-4"}),"Complete Setup"]})})})]})]})]})}),p&&i.jsx(PN,{isOpen:!!p,onClose:()=>f(null),provider:p,onComplete:w})]})}const lO=["0s","0.1s","0.2s"];function cO(){return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:i.jsx(Mn,{className:"h-8 w-8 text-primary-foreground"})})}),i.jsx("h1",{className:"mb-2 text-2xl font-bold text-foreground",children:"Pixcode"}),i.jsx("div",{className:"flex items-center justify-center space-x-2",children:lO.map(e=>i.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-blue-500",style:{animationDelay:e}},e))}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:"Loading..."})]})})}function DN({errorMessage:e}){return e?i.jsx("div",{className:"rounded-md border border-red-300 bg-red-100 p-3 dark:border-red-800 dark:bg-red-900/20",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:e})}):null}function Xi({id:e,label:t,value:r,onChange:n,placeholder:a,isDisabled:s,type:o="text",name:l,autoComplete:c}){return i.jsxs("div",{children:[i.jsx("label",{htmlFor:e,className:"mb-1 block text-sm font-medium text-foreground",children:t}),i.jsx("input",{id:e,type:o,name:l??e,autoComplete:c,value:r,onChange:d=>n(d.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:s})]})}function ON({title:e,description:t,children:r,footerText:n,logo:a}){return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsx("div",{className:"w-full max-w-md",children:i.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-8 shadow-lg",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:a??i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:i.jsx(Mn,{className:"h-8 w-8 text-primary-foreground"})})}),i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:e}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:t})]}),r,i.jsx("div",{className:"text-center",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:n})}),i.jsxs("div",{className:"flex items-center justify-center gap-1.5 pt-2",children:[i.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.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"})}),i.jsx("a",{href:"https://github.com/alicomert/pixcode",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground/50 transition-colors hover:text-muted-foreground",children:"Pixcode is open source"})]})]})})})}const dO={username:"",password:""};function uO(){const{t:e}=Be("auth"),{login:t}=uc(),[r,n]=m.useState(dO),[a,s]=m.useState(""),[o,l]=m.useState(!1),c=m.useCallback((u,p)=>{n(f=>({...f,[u]:p}))},[]),d=m.useCallback(async u=>{if(u.preventDefault(),s(""),!r.username.trim()||!r.password){s(e("login.errors.requiredFields"));return}l(!0);const p=await t(r.username.trim(),r.password);p.success||s(p.error),l(!1)},[r.password,r.username,t,e]);return i.jsx(ON,{title:e("login.title"),description:e("login.description"),footerText:"Enter your credentials to access Pixcode",children:i.jsxs("form",{onSubmit:d,className:"space-y-4",children:[i.jsx(Xi,{id:"username",label:e("login.username"),value:r.username,onChange:u=>c("username",u),placeholder:e("login.placeholders.username"),isDisabled:o,autoComplete:"username"}),i.jsx(Xi,{id:"password",label:e("login.password"),value:r.password,onChange:u=>c("password",u),placeholder:e("login.placeholders.password"),isDisabled:o,type:"password",autoComplete:"current-password"}),i.jsx(DN,{errorMessage:a}),i.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 pO={username:"",password:"",confirmPassword:"",connectionMode:"local",remoteUrl:"",remoteApiKey:""};function mO(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.":e.connectionMode==="remote"&&!e.remoteUrl.trim()?"Remote Pixcode server URL is required.":null}function hO(){const{register:e}=uc(),[t,r]=m.useState(pO),[n,a]=m.useState(""),[s,o]=m.useState(!1),l=m.useCallback((d,u)=>{r(p=>({...p,[d]:u}))},[]),c=m.useCallback(async d=>{d.preventDefault(),a("");const u=mO(t);if(u){a(u);return}o(!0);const p=await fetch("/api/auth/connection-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:t.connectionMode,remoteUrl:t.connectionMode==="remote"?t.remoteUrl.trim():null,apiKey:t.connectionMode==="remote"?t.remoteApiKey.trim():null})});if(!p.ok){const h=await p.json().catch(()=>null);a(h?.error||"Could not save connection mode."),o(!1);return}const f=await e(t.username.trim(),t.password);f.success||a(f.error),o(!1)},[t,e]);return i.jsx(ON,{title:"Welcome to Pixcode",description:"Set up your account to get started",footerText:"This is a single-user system. Only one account can be created.",logo:i.jsx("img",{src:"/logo.svg",alt:"Pixcode",className:"h-16 w-16"}),children:i.jsxs("form",{onSubmit:c,className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2 rounded-lg border border-border/70 bg-muted/30 p-2 sm:grid-cols-2",children:[i.jsxs("button",{type:"button",onClick:()=>l("connectionMode","local"),disabled:s,className:`rounded-md px-3 py-2 text-left text-sm transition-colors ${t.connectionMode==="local"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-background/60 hover:text-foreground"}`,children:[i.jsx("span",{className:"block font-medium",children:"Use this computer directly"}),i.jsx("span",{className:"block text-xs opacity-80",children:"Run Pixcode and CLIs on this machine."})]}),i.jsxs("button",{type:"button",onClick:()=>l("connectionMode","remote"),disabled:s,className:`rounded-md px-3 py-2 text-left text-sm transition-colors ${t.connectionMode==="remote"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-background/60 hover:text-foreground"}`,children:[i.jsx("span",{className:"block font-medium",children:"Connect to a remote Pixcode server"}),i.jsx("span",{className:"block text-xs opacity-80",children:"Control another always-on Pixcode host by API."})]})]}),t.connectionMode==="remote"&&i.jsxs("div",{className:"space-y-3 rounded-lg border border-border/70 bg-muted/20 p-3",children:[i.jsx(Xi,{id:"remoteUrl",name:"remoteUrl",label:"Remote API URL",value:t.remoteUrl,onChange:d=>l("remoteUrl",d),placeholder:"https://your-server.example.com",isDisabled:s,autoComplete:"url"}),i.jsx(Xi,{id:"remoteApiKey",name:"remoteApiKey",label:"Remote API Key",value:t.remoteApiKey,onChange:d=>l("remoteApiKey",d),placeholder:"px_...",isDisabled:s,type:"password",autoComplete:"off"})]}),i.jsx(Xi,{id:"username",name:"username",label:"Username",value:t.username,onChange:d=>l("username",d),placeholder:"Enter your username",isDisabled:s,autoComplete:"username"}),i.jsx(Xi,{id:"password",name:"password",label:"Password",value:t.password,onChange:d=>l("password",d),placeholder:"Enter your password",isDisabled:s,type:"password",autoComplete:"new-password"}),i.jsx(Xi,{id:"confirmPassword",name:"confirmPassword",label:"Confirm Password",value:t.confirmPassword,onChange:d=>l("confirmPassword",d),placeholder:"Confirm your password",isDisabled:s,type:"password",autoComplete:"new-password"}),i.jsx(DN,{errorMessage:n}),i.jsx("button",{type:"submit",disabled:s,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:s?"Setting up...":"Create Account"})]})})}function fO({children:e}){const{user:t,isLoading:r,needsSetup:n,hasCompletedOnboarding:a,refreshOnboardingStatus:s}=uc();return r?i.jsx(cO,{}):n?i.jsx(hO,{}):t?a?i.jsx(i.Fragment,{children:e}):i.jsx(oO,{onComplete:s}):i.jsx(uO,{})}const MN=m.createContext(null),gO=()=>{const e=m.useContext(MN);if(!e)throw new Error("useWebSocket must be used within a WebSocketProvider");return e},bO=e=>{const t=window.location.protocol==="https:"?"wss:":"ws:";return e?`${t}//${window.location.host}/ws?token=${encodeURIComponent(e)}`:null},xO=()=>{const e=m.useRef(null),t=m.useRef(!1),r=m.useRef(!1),[n,a]=m.useState(null),[s,o]=m.useState(!1),l=m.useRef(null),{token:c}=uc(),d=m.useCallback(()=>{if(!t.current)try{const f=bO(c);if(!f)return console.warn("No authentication token found for WebSocket connection");const h=new WebSocket(f);h.onopen=()=>{o(!0),e.current=h,r.current&&a({type:"websocket-reconnected",timestamp:Date.now()}),r.current=!0},h.onmessage=g=>{try{const b=JSON.parse(g.data);a(b)}catch(b){console.error("Error parsing WebSocket message:",b)}},h.onclose=()=>{o(!1),e.current=null,l.current=setTimeout(()=>{t.current||d()},3e3)},h.onerror=g=>{console.error("WebSocket error:",g)}}catch(f){console.error("Error creating WebSocket connection:",f)}},[c]);m.useEffect(()=>(d(),()=>{t.current=!0,l.current&&clearTimeout(l.current),e.current&&e.current.close()}),[d]);const u=m.useCallback(f=>{const h=e.current;h&&h.readyState===WebSocket.OPEN?h.send(JSON.stringify(f)):console.warn("WebSocket not connected")},[]);return m.useMemo(()=>({ws:e.current,sendMessage:u,latestMessage:n,isConnected:s}),[u,n,s])},yO=({children:e})=>{const t=xO();return i.jsx(MN.Provider,{value:t,children:e})},FN=m.createContext(null);function Mu(){const e=m.useContext(FN);if(!e)throw new Error("usePlugins must be used within a PluginsProvider");return e}function vO({children:e}){const{user:t,token:r,isLoading:n}=uc(),[a,s]=m.useState([]),[o,l]=m.useState(!0),[c,d]=m.useState(null),u=!!(t&&r),p=m.useCallback(async()=>{if(!u){s([]),d(null),l(!1);return}l(!0);try{const x=await Se("/api/plugins");if(x.ok){const y=await x.json();s(y.plugins||[]),d(null)}else{let y=`Failed to fetch plugins (${x.status})`;try{const v=await x.json();y=v.details||v.error||y}catch{y=x.statusText||y}d(y)}}catch(x){const y=x instanceof Error?x.message:"Failed to fetch plugins";d(y),console.error("[Plugins] Failed to fetch plugins:",x)}finally{l(!1)}},[u]);m.useEffect(()=>{n||p()},[n,p]);const f=m.useCallback(async x=>{try{const y=await Se("/api/plugins/install",{method:"POST",body:JSON.stringify({url:x})}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Install failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Install failed"}}},[p]),h=m.useCallback(async x=>{try{const y=await Se(`/api/plugins/${encodeURIComponent(x)}`,{method:"DELETE"}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Uninstall failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Uninstall failed"}}},[p]),g=m.useCallback(async x=>{try{const y=await Se(`/api/plugins/${encodeURIComponent(x)}/update`,{method:"POST"}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Update failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Update failed"}}},[p]),b=m.useCallback(async(x,y)=>{try{const v=await Se(`/api/plugins/${encodeURIComponent(x)}/enable`,{method:"PUT",body:JSON.stringify({enabled:y})});if(!v.ok){let w=`Toggle failed (${v.status})`;try{const C=await v.json();w=C.details||C.error||w}catch{w=v.statusText||w}return{success:!1,error:w}}return await p(),{success:!0,error:null}}catch(v){return{success:!1,error:v instanceof Error?v.message:"Toggle failed"}}},[p]);return i.jsx(FN.Provider,{value:{plugins:a,loading:o,pluginsError:c,refreshPlugins:p,installPlugin:f,uninstallPlugin:h,updatePlugin:g,togglePlugin:b},children:e})}const sk=e=>typeof window>"u"?!1:window.innerWidth<e,ok=()=>{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 Ig(e={}){const{mobileBreakpoint:t=768,trackMobile:r=!0,trackPWA:n=!0}=e,[a,s]=m.useState(()=>r?sk(t):!1),[o,l]=m.useState(()=>n?ok():!1);return m.useEffect(()=>{if(!r||typeof window>"u")return;const c=()=>{s(sk(t))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[t,r]),m.useEffect(()=>{if(!n||typeof window>"u")return;const c=window.matchMedia("(display-mode: standalone)"),d=()=>{l(ok())};return d(),typeof c.addEventListener=="function"?(c.addEventListener("change",d),()=>{c.removeEventListener("change",d)}):(c.addListener(d),()=>{c.removeListener(d)})},[n]),{isMobile:a,isPWA:o}}const _g="pixcode.updateCheck.preferences",Kh="pixcode:update-check-settings-changed",Rg=[{value:"30m",label:"Every 30 minutes",intervalMs:1800*1e3},{value:"24h",label:"Daily",intervalMs:1440*60*1e3},{value:"12h",label:"Every 12 hours",intervalMs:720*60*1e3},{value:"6h",label:"Every 6 hours",intervalMs:360*60*1e3},{value:"7d",label:"Weekly",intervalMs:10080*60*1e3},{value:"off",label:"Manual only",intervalMs:null}],Yh={frequency:"30m"};function lk(e){return Rg.find(t=>t.value===e.frequency)?.intervalMs??null}function zN(e){if(!e||typeof e!="object")return Yh;const t=e.frequency;return Rg.some(r=>r.value===t)?{frequency:t}:Yh}function ck(){try{const e=localStorage.getItem(_g);return zN(e?JSON.parse(e):null)}catch{return Yh}}function wO(e){const t=zN(e);localStorage.setItem(_g,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(Kh,{detail:t}))}const Ap=(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 s=r[a]||0,o=n[a]||0;if(s!==o)return s-o}return 0},kO="1.50.6",Zh="pixcode:update-available",SO=360*60*1e3,jp=new Map;function BN(e,t){return`pixcode.updateCheck.cache.${e}.${t}`}function CO(e,t){try{const r=localStorage.getItem(BN(e,t));if(!r)return null;const n=JSON.parse(r);return{fetchedAt:typeof n.fetchedAt=="number"?n.fetchedAt:null,latestVersion:typeof n.latestVersion=="string"?n.latestVersion:null,releaseInfo:n.releaseInfo??null,rateLimitedUntil:typeof n.rateLimitedUntil=="number"?n.rateLimitedUntil:void 0}}catch{return null}}function dk(e,t,r){localStorage.setItem(BN(e,t),JSON.stringify(r))}function NO(e,t){const r=`${e}/${t}`,n=jp.get(r);if(n)return n;const a=fetch(`https://api.github.com/repos/${e}/${t}/releases/latest`,{cache:"no-store",headers:{Accept:"application/vnd.github+json"}}).then(async s=>({status:s.status,ok:s.ok,data:await s.json().catch(()=>({}))})).finally(()=>{jp.delete(r)});return jp.set(r,a),a}const UN=(e,t)=>{const[r,n]=m.useState(!1),[a,s]=m.useState(null),[o,l]=m.useState(null),[c,d]=m.useState("git"),[u,p]=m.useState("idle"),[f,h]=m.useState(null),[g,b]=m.useState(()=>ck()),[x,y]=m.useState(kO),v=m.useRef(null),w=m.useCallback(k=>{wO(k),b(k)},[]);m.useEffect(()=>{const k=()=>b(ck()),N=j=>{j.key===_g&&k()};return window.addEventListener("storage",N),window.addEventListener(Kh,k),()=>{window.removeEventListener("storage",N),window.removeEventListener(Kh,k)}},[]),m.useEffect(()=>{let k=!1;const N=async()=>{try{const E=await(await fetch("/health",{cache:"no-store"})).json();if(k)return;(E.installMode==="npm"||E.installMode==="git")&&d(E.installMode),typeof E.version=="string"&&/^\d+\.\d+\.\d+/.test(E.version)&&y(E.version)}catch{}};N();const j=()=>{N()};return window.addEventListener("focus",j),()=>{k=!0,window.removeEventListener("focus",j)}},[]),m.useEffect(()=>{if(!x)return;let k=!1;const N=(I,R,S,F)=>({updateAvailable:!!(I&&Ap(I,x)>0),latestVersion:I,releaseInfo:R,currentVersion:x,checkedAt:S,status:F}),j=I=>{!I.updateAvailable||!I.latestVersion||!I.releaseInfo||window.dispatchEvent(new CustomEvent(Zh,{detail:I}))},A=(I,R,S,F="success")=>{if(!I||!R)return n(!1),s(null),l(null),h(S),N(null,null,S,F);s(I),n(Ap(I,x)>0),l(R),h(S);const B=N(I,R,S,F);return j(B),B},E=async({force:I=!1}={})=>{const R=lk(g),S=CO(e,t),F=Date.now();if(!I&&R===null)return p("idle"),A(S?.latestVersion??null,S?.releaseInfo??null,S?.fetchedAt??null,"idle");if(!I&&S?.fetchedAt&&R!==null&&F-S.fetchedAt<R)return p("success"),A(S.latestVersion,S.releaseInfo,S.fetchedAt,"success");if(!I&&S?.rateLimitedUntil&&S.rateLimitedUntil>F)return p("error"),A(S.latestVersion,S.releaseInfo,S.fetchedAt,"error");try{p("checking");const B=await NO(e,t);if(k)return N(S?.latestVersion??null,S?.releaseInfo??null,S?.fetchedAt??null,"idle");const z=B.data;if(!B.ok)return B.status===403&&dk(e,t,{fetchedAt:S?.fetchedAt??null,latestVersion:S?.latestVersion??null,releaseInfo:S?.releaseInfo??null,rateLimitedUntil:F+Math.max(R??0,SO)}),p("error"),A(S?.latestVersion??null,S?.releaseInfo??null,S?.fetchedAt??null,"error");if(z.tag_name){const q=z.tag_name.replace(/^v/,""),V=Ap(q,x)>0,P={title:z.name||z.tag_name,body:z.body||"",htmlUrl:z.html_url||`https://github.com/${e}/${t}/releases/latest`,publishedAt:z.published_at||""};dk(e,t,{fetchedAt:F,latestVersion:q,releaseInfo:P}),s(q),n(V),V&&JC({key:`app-update:${q}`,title:"Pixcode update available",body:`Pixcode ${x} can update to ${q}.`,tag:"pixcode-app-update",data:{type:"app-update",latestVersion:q,installMode:c}}),l(P),p("success"),h(F);const U=N(q,P,F,"success");return j(U),U}else return n(!1),s(null),l(null),p("error"),N(null,null,null,"error")}catch(B){return console.error("Version check failed:",B),n(!1),s(null),l(null),p("error"),N(null,null,null,"error")}};v.current=E,E();const T=lk(g),_=T===null?null:window.setInterval(()=>{E()},T);return()=>{k=!0,_!==null&&window.clearInterval(_)}},[e,t,x,c,g]);const C=m.useCallback(async()=>v.current?await v.current({force:!0}):null,[]);return{updateAvailable:r,latestVersion:a,currentVersion:x,releaseInfo:o,installMode:c,checkStatus:u,lastCheckedAt:f,manualCheck:C,updateCheckPreferences:g,updatePreferences:w}},Ji={autoExpandTools:!1,showRawParameters:!1,showThinking:!0,autoScrollToBottom:!0,sendByCtrlEnter:!1,changeAwareness:!1,sidebarVisible:!0,historyView:"flat"},EO=["flat","grouped"],TO=e=>typeof e=="string"&&EO.includes(e),Zd=Object.keys(Ji),AO=new Set(Zd),Ip="ui-preferences:sync",jO=(e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1}return t},Xd=(e,t,r)=>e==="historyView"?TO(t)?t:r:jO(t,r),IO=(e,t)=>{try{const r=localStorage.getItem(e);if(r===null)return t;const n=JSON.parse(r);return Xd(e,n,t)}catch{return t}},_O=e=>{if(typeof window>"u")return Ji;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 Zd.reduce((a,s)=>(a[s]=Xd(s,n[s],Ji[s]),a),{...Ji})}}}catch{}return Zd.reduce((t,r)=>(t[r]=IO(r,Ji[r]),t),{...Ji})};function RO(e,t){switch(t.type){case"set":{const{key:r,value:n}=t;if(!AO.has(r))return e;const a=Xd(r,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 s of Zd){if(!(s in r))continue;const o=r[s],l=Xd(s,o,e[s]);a[s]!==l&&(a[s]=l,n=!0)}return n?a:e}case"reset":return{...Ji,...t.value||{}};default:return e}}function Lg(e="uiPreferences"){const t=m.useRef(`ui-preferences-${Math.random().toString(36).slice(2)}`),[r,n]=m.useReducer(RO,e,_O);return m.useEffect(()=>{typeof window>"u"||(localStorage.setItem(e,JSON.stringify(r)),window.dispatchEvent(new CustomEvent(Ip,{detail:{storageKey:e,sourceId:t.current,value:r}})))},[r,e]),m.useEffect(()=>{if(typeof window>"u")return;const l=u=>{!u||typeof u!="object"||Array.isArray(u)||n({type:"set_many",value:u})},c=u=>{if(!(u.key!==e||u.newValue===null))try{const p=JSON.parse(u.newValue);l(p)}catch{}},d=u=>{const f=u.detail;!f||f.storageKey!==e||f.sourceId===t.current||l(f.value)};return window.addEventListener("storage",c),window.addEventListener(Ip,d),()=>{window.removeEventListener("storage",c),window.removeEventListener(Ip,d)}},[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 LO=()=>{try{const e=localStorage.getItem("claude-settings");return e&&JSON.parse(e).projectSortOrder==="date"?"date":"name"}catch{return"name"}},PO=()=>{try{const e=localStorage.getItem("starredProjects");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}},DO=e=>{try{localStorage.setItem("starredProjects",JSON.stringify([...e]))}catch{}},uk=(e,t)=>`${e}::${t}`,OO=()=>{try{const e=localStorage.getItem("starredSessions");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}},MO=e=>{try{localStorage.setItem("starredSessions",JSON.stringify([...e]))}catch{}},FO=/(?:^|[\s/\\(\[`"'])([\w./-]+?\.(?:ts|tsx|js|jsx|mjs|cjs|py|rb|go|rs|java|kt|swift|c|cc|cpp|h|hpp|cs|php|sh|bash|zsh|json|ya?ml|toml|md|mdx|html?|css|scss|less|sql|prisma|graphql|gql|vue|svelte|astro|dart|lua|r|pl|ps1|tf|dockerfile|env))(?:$|[\s:,)\]`"'])/i,zO=e=>{if(!e)return[];const t=new Set,r=new RegExp(FO.source,"gi");let n;for(;(n=r.exec(e))!==null;){const a=n[1],s=a.lastIndexOf(".");if(s>-1){const o=a.slice(s+1).toLowerCase();o&&o.length<=10&&t.add(o)}if(t.size>=3)break}return[...t]},is=e=>e.__provider==="cursor"?new Date(e.createdAt||0):e.__provider==="codex"?new Date(e.createdAt||e.lastActivity||0):new Date(e.lastActivity||e.createdAt||0),BO=(e,t)=>e.__provider==="cursor"?e.summary||e.name||t("projects.untitledSession"):e.__provider==="codex"?e.summary||e.name||t("projects.codexSession"):e.__provider==="gemini"||e.__provider==="qwen"||e.__provider==="opencode"?e.summary||e.name||t("projects.newSession"):e.summary||t("projects.newSession"),UO=e=>e.__provider==="cursor"?String(e.createdAt||""):e.__provider==="codex"?String(e.createdAt||e.lastActivity||""):String(e.lastActivity||e.createdAt||""),$O=(e,t,r)=>{const n=is(e),a=Math.floor((t.getTime()-n.getTime())/(1e3*60));return{isCursorSession:e.__provider==="cursor",isCodexSession:e.__provider==="codex",isGeminiSession:e.__provider==="gemini",isQwenSession:e.__provider==="qwen",isOpencodeSession:e.__provider==="opencode",isActive:a<10,sessionName:BO(e,r),sessionTime:UO(e),messageCount:Number(e.messageCount||0)}},$N=(e,t)=>{const r=[...e.sessions||[],...t[e.name]||[]].map(g=>({...g,__provider:"claude"})),n=(e.cursorSessions||[]).map(g=>({...g,__provider:"cursor"})),a=(e.codexSessions||[]).map(g=>({...g,__provider:"codex"})),s=g=>typeof g.id=="string"&&g.id.startsWith("qwen_")||g.provider==="qwen",o=g=>typeof g.id=="string"&&g.id.startsWith("opencode_")||g.provider==="opencode",l=e.geminiSessions||[],c=l.filter(g=>!s(g)&&!o(g)).map(g=>({...g,__provider:"gemini"})),d=l.filter(g=>s(g)).map(g=>({...g,__provider:"qwen"})),u=l.filter(g=>o(g)).map(g=>({...g,__provider:"opencode"})),p=[...(e.qwenSessions||[]).map(g=>({...g,__provider:"qwen"})),...d],f=[...(e.opencodeSessions||[]).map(g=>({...g,__provider:"opencode"})),...u],h=new Map;for(const g of[...r,...n,...a,...c,...p,...f])h.has(g.id)||h.set(g.id,g);return[...h.values()].sort((g,b)=>is(b).getTime()-is(g).getTime())},pk=(e,t)=>{const r=$N(e,t);return r.length===0?new Date(0):r.reduce((n,a)=>{const s=is(a);return s>n?s:n},new Date(0))},HO=(e,t,r,n)=>{const a=[...e];return a.sort((s,o)=>{const l=r.has(s.name),c=r.has(o.name);return l&&!c?-1:!l&&c?1:t==="date"?pk(o,n).getTime()-pk(s,n).getTime():(s.displayName||s.name).localeCompare(o.displayName||o.name)}),a},GO=(e,t)=>{const r=t.trim().toLowerCase();return r?e.filter(n=>{const a=(n.displayName||n.name).toLowerCase(),s=n.name.toLowerCase();return a.includes(r)||s.includes(r)}):e},VO=e=>{const t=typeof e.fullPath=="string"&&e.fullPath.length>0?e.fullPath:typeof e.path=="string"?e.path:"";return{name:e.name,displayName:typeof e.displayName=="string"&&e.displayName.trim().length>0?e.displayName:e.name,fullPath:t,path:typeof e.path=="string"&&e.path.length>0?e.path:t}};function WO({projects:e,selectedProject:t,selectedSession:r,isLoading:n,isMobile:a,t:s,onRefresh:o,onProjectSelect:l,onSessionSelect:c,onSessionDelete:d,onProjectDelete:u,setSidebarVisible:p,sidebarVisible:f}){const[h,g]=m.useState(new Set),[b,x]=m.useState(null),[y,v]=m.useState(!1),[w,C]=m.useState(""),[k,N]=m.useState({}),[j,A]=m.useState({}),[E,T]=m.useState(new Set),[_,I]=m.useState(new Date),[R,S]=m.useState("name"),[F,B]=m.useState(!1),[z,q]=m.useState({}),[V,P]=m.useState(null),[U,H]=m.useState(""),[M,ee]=m.useState(""),[Q,ge]=m.useState(new Set),[se,ce]=m.useState(null),[ye,pe]=m.useState(null),[ve,ue]=m.useState(!1),[de,D]=m.useState(()=>PO()),[X,oe]=m.useState(()=>OO()),[K,W]=m.useState("projects"),[ne,me]=m.useState(null),[we,le]=m.useState(!1),[Ae,te]=m.useState(null),ae=m.useRef(null),J=m.useRef(0),fe=m.useRef(null),Ee=!a&&!f;m.useEffect(()=>{const Fe=setInterval(()=>{I(new Date)},6e4);return()=>clearInterval(Fe)},[]),m.useEffect(()=>{A({}),T(new Set),q({})},[e]),m.useEffect(()=>{t&&g(Fe=>{if(Fe.has(t.name))return Fe;const qe=new Set(Fe);return qe.add(t.name),qe})},[r,t]),m.useEffect(()=>{if(e.length>0&&!n){const Fe=new Set;e.forEach(qe=>{qe.sessions&&qe.sessions.length>=0&&Fe.add(qe.name)}),T(Fe)}},[e,n]),m.useEffect(()=>{const Fe=()=>{S(LO())};Fe();const qe=et=>{et.key==="claude-settings"&&Fe()},ht=()=>Fe();return window.addEventListener("storage",qe),window.addEventListener("pixcode:settings-changed",ht),()=>{window.removeEventListener("storage",qe),window.removeEventListener("pixcode:settings-changed",ht)}},[]),m.useEffect(()=>{ae.current&&clearTimeout(ae.current),fe.current&&(fe.current.close(),fe.current=null);const Fe=M.trim();if(K!=="conversations"||Fe.length<2){J.current+=1,me(null),te(null),le(!1);return}le(!0);const qe=++J.current;return ae.current=setTimeout(()=>{if(qe!==J.current)return;const ht=Lt.searchConversationsUrl(Fe),et=new EventSource(ht);fe.current=et;const vt=[];let Xt=0;et.addEventListener("result",Z=>{if(qe!==J.current){et.close();return}try{const Te=JSON.parse(Z.data);vt.push(Te.projectResult),Xt=Te.totalMatches,me({results:[...vt],totalMatches:Xt,query:Fe}),te({scannedProjects:Te.scannedProjects,totalProjects:Te.totalProjects})}catch{}}),et.addEventListener("progress",Z=>{if(qe!==J.current){et.close();return}try{const Te=JSON.parse(Z.data);Xt=Te.totalMatches,te({scannedProjects:Te.scannedProjects,totalProjects:Te.totalProjects})}catch{}}),et.addEventListener("done",()=>{if(qe!==J.current){et.close();return}et.close(),fe.current=null,le(!1),te(null),vt.length===0&&me({results:[],totalMatches:0,query:Fe})}),et.addEventListener("error",()=>{if(qe!==J.current){et.close();return}et.close(),fe.current=null,le(!1),te(null),vt.length===0&&me({results:[],totalMatches:0,query:Fe})})},400),()=>{ae.current&&clearTimeout(ae.current),fe.current&&(fe.current.close(),fe.current=null)}},[M,K]);const Me=m.useCallback(Fe=>{g(qe=>{const ht=new Set;return qe.has(Fe)||ht.add(Fe),ht})},[]),Xe=m.useCallback((Fe,qe)=>{c({...Fe,__projectName:qe})},[c]),Je=m.useCallback(Fe=>{D(qe=>{const ht=new Set(qe);return ht.has(Fe)?ht.delete(Fe):ht.add(Fe),DO(ht),ht})},[]),st=m.useCallback(Fe=>de.has(Fe),[de]),tt=m.useCallback((Fe,qe)=>{oe(ht=>{const et=uk(Fe,qe),vt=new Set(ht);return vt.has(et)?vt.delete(et):vt.add(et),MO(vt),vt})},[]),Ct=m.useCallback((Fe,qe)=>X.has(uk(Fe,qe)),[X]),ot=m.useCallback(Fe=>$N(Fe,j),[j]),ut=m.useMemo(()=>e.map(Fe=>{const qe=z[Fe.name];return qe===void 0?Fe:{...Fe,sessionMeta:{...Fe.sessionMeta,hasMore:qe}}}),[z,e]),ft=m.useMemo(()=>HO(ut,R,de,j),[j,R,ut,de]),kt=m.useMemo(()=>GO(ft,M),[M,ft]),$t=m.useCallback(Fe=>{x(Fe.name),C(Fe.displayName)},[]),Mt=m.useCallback(()=>{x(null),C("")},[]),Ot=m.useCallback(async Fe=>{try{(await Lt.renameProject(Fe,w)).ok?window.refreshProjects?await window.refreshProjects():window.location.reload():console.error("Failed to rename project")}catch(qe){console.error("Error renaming project:",qe)}finally{x(null),C("")}},[w]),Ht=m.useCallback((Fe,qe,ht,et="claude")=>{pe({projectName:Fe,sessionId:qe,sessionTitle:ht,provider:et})},[]),Gt=m.useCallback(async()=>{if(!ye)return;const{projectName:Fe,sessionId:qe,provider:ht}=ye;pe(null);try{let et;if(ht==="codex"?et=await Lt.deleteCodexSession(qe):ht==="gemini"?et=await Lt.deleteGeminiSession(qe):ht==="qwen"?et=await Lt.deleteQwenSession(qe):et=await Lt.deleteSession(Fe,qe),et.ok)d?.(qe);else{const vt=await et.text();console.error("[Sidebar] Failed to delete session:",{status:et.status,error:vt}),alert(s("messages.deleteSessionFailed"))}}catch(et){console.error("[Sidebar] Error deleting session:",et),alert(s("messages.deleteSessionError"))}},[d,ye,s]),Ge=m.useCallback(Fe=>{ce({project:Fe,sessionCount:ot(Fe).length})},[ot]),je=m.useCallback(async(Fe=!1)=>{if(!se)return;const{project:qe,sessionCount:ht}=se,et=ht===0;ce(null),ge(vt=>new Set([...vt,qe.name]));try{const vt=await Lt.deleteProject(qe.name,!et,Fe);if(vt.ok)u?.(qe.name);else{const Xt=await vt.json();alert(Xt.error||s("messages.deleteProjectFailed"))}}catch(vt){console.error("Error deleting project:",vt),alert(s("messages.deleteProjectError"))}finally{ge(vt=>{const Xt=new Set(vt);return Xt.delete(qe.name),Xt})}},[se,u,s]),Ue=m.useCallback(async Fe=>{const qe=z[Fe.name];if(!(!(qe!==void 0?qe:Fe.sessionMeta?.hasMore===!0)||k[Fe.name])){N(et=>({...et,[Fe.name]:!0}));try{const et=(Fe.sessions?.length||0)+(j[Fe.name]?.length||0),vt=await Lt.sessions(Fe.name,5,et);if(!vt.ok)return;const Xt=await vt.json();A(Z=>({...Z,[Fe.name]:[...Z[Fe.name]||[],...Xt.sessions||[]]})),Xt.hasMore===!1&&q(Z=>({...Z,[Fe.name]:!1}))}catch(et){console.error("Error loading more sessions:",et)}finally{N(et=>({...et,[Fe.name]:!1}))}}},[j,k,z]),We=m.useCallback(Fe=>{l(Fe)},[l]),lt=m.useCallback(async()=>{B(!0);try{await o()}finally{B(!1)}},[o]),yt=m.useCallback(async(Fe,qe,ht,et)=>{const vt=ht.trim();if(!vt){P(null),H("");return}try{const Xt=await Lt.renameSession(qe,vt,et);Xt.ok?await o():(console.error("[Sidebar] Failed to rename session:",Xt.status),alert(s("messages.renameSessionFailed")))}catch(Xt){console.error("[Sidebar] Error renaming session:",Xt),alert(s("messages.renameSessionError"))}finally{P(null),H("")}},[o,s]),Rt=m.useCallback(()=>{p(!1)},[p]),er=m.useCallback(()=>{p(!0)},[p]);return{isSidebarCollapsed:Ee,expandedProjects:h,editingProject:b,showNewProject:y,editingName:w,loadingSessions:k,additionalSessions:j,initialSessionsLoaded:E,currentTime:_,projectSortOrder:R,isRefreshing:F,editingSession:V,editingSessionName:U,searchFilter:M,deletingProjects:Q,deleteConfirmation:se,sessionDeleteConfirmation:ye,showVersionModal:ve,starredProjects:de,starredSessions:X,filteredProjects:kt,toggleProject:Me,handleSessionClick:Xe,toggleStarProject:Je,isProjectStarred:st,toggleStarSession:tt,isSessionStarred:Ct,getProjectSessions:ot,startEditing:$t,cancelEditing:Mt,saveProjectName:Ot,showDeleteSessionConfirmation:Ht,confirmDeleteSession:Gt,requestProjectDelete:Ge,confirmDeleteProject:je,loadMoreSessions:Ue,handleProjectSelect:We,refreshProjects:lt,updateSessionSummary:yt,collapseSidebar:Rt,expandSidebar:er,setShowNewProject:v,setEditingName:C,setEditingSession:P,setEditingSessionName:H,searchMode:K,setSearchMode:W,conversationResults:ne,isSearching:we,searchProgress:Ae,clearConversationResults:m.useCallback(()=>{J.current+=1,fe.current&&(fe.current.close(),fe.current=null),le(!1),te(null),me(null)},[]),setSearchFilter:ee,setDeleteConfirmation:ce,setSessionDeleteConfirmation:pe,setShowVersionModal:ue}}const qO="https://discord.gg/buxwujPNRE",KO="https://github.com/alicomert/pixcode/issues/new";function YO({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.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 ZO({onExpand:e,onOpenControlRoom:t,onShowSettings:r,updateAvailable:n,onShowVersionModal:a,t:s}){return i.jsxs("div",{className:"flex h-full w-12 flex-col items-center gap-1 bg-background/80 py-3 backdrop-blur-sm",children:[i.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":s("common:versionUpdate.ariaLabels.showSidebar"),title:s("common:versionUpdate.ariaLabels.showSidebar"),children:i.jsx(Gl,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("div",{className:"nav-divider my-1 w-6"}),t&&i.jsx("button",{onClick:t,className:"group flex h-8 w-8 items-center justify-center rounded-lg border border-primary/25 bg-primary/10 transition-colors hover:bg-primary/15","aria-label":s("actions.controlRoom",{defaultValue:"Control Room"}),title:s("actions.controlRoom",{defaultValue:"Control Room"}),children:i.jsx(Fn,{className:"h-4 w-4 text-primary"})}),i.jsx("button",{onClick:r,className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":s("actions.settings"),title:s("actions.settings"),children:i.jsx(Ut,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("a",{href:KO,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":s("actions.reportIssue"),title:s("actions.reportIssue"),children:i.jsx(xo,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("a",{href:qO,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":s("actions.joinCommunity"),title:s("actions.joinCommunity"),children:i.jsx(YO,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),n&&i.jsxs("button",{onClick:a,className:"relative flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":s("common:versionUpdate.ariaLabels.updateAvailable"),title:s("common:versionUpdate.ariaLabels.updateAvailable"),children:[i.jsx(Fn,{className:"h-4 w-4 text-blue-500"}),i.jsx("span",{className:"absolute right-1.5 top-1.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]})]})}function HN(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=HN(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function GN(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=HN(e))&&(n&&(n+=" "),n+=t);return n}const mk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hk=GN,Pg=(e,t)=>r=>{var n;if(t?.variants==null)return hk(e,r?.class,r?.className);const{variants:a,defaultVariants:s}=t,o=Object.keys(a).map(d=>{const u=r?.[d],p=s?.[d];if(u===null)return null;const f=mk(u)||mk(p);return a[d][f]}),l=r&&Object.entries(r).reduce((d,u)=>{let[p,f]=u;return f===void 0||(d[p]=f),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:p,className:f,...h}=u;return Object.entries(h).every(g=>{let[b,x]=g;return Array.isArray(x)?x.includes({...s,...l}[b]):{...s,...l}[b]===x})?[...d,p,f]:d},[]);return hk(e,o,c,r?.class,r?.className)},Dg="-",XO=e=>{const t=QO(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Dg);return l[0]===""&&l.length!==1&&l.shift(),VN(l,t)||JO(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},VN=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?VN(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const s=e.join(Dg);return t.validators.find(({validator:o})=>o(s))?.classGroupId},fk=/^\[(.+)\]$/,JO=e=>{if(fk.test(e)){const t=fk.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},QO=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const a in r)Xh(r[a],n,a,t);return n},Xh=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:gk(t,a);s.classGroupId=r;return}if(typeof a=="function"){if(eM(a)){Xh(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([s,o])=>{Xh(o,gk(t,s),r,n)})})},gk=(e,t)=>{let r=e;return t.split(Dg).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},eM=e=>e.isThemeGetter,tM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(s,o)=>{r.set(s,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let o=r.get(s);if(o!==void 0)return o;if((o=n.get(s))!==void 0)return a(s,o),o},set(s,o){r.has(s)?r.set(s,o):a(s,o)}}},Jh="!",Qh=":",rM=Qh.length,nM=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const s=[];let o=0,l=0,c=0,d;for(let g=0;g<a.length;g++){let b=a[g];if(o===0&&l===0){if(b===Qh){s.push(a.slice(c,g)),c=g+rM;continue}if(b==="/"){d=g;continue}}b==="["?o++:b==="]"?o--:b==="("?l++:b===")"&&l--}const u=s.length===0?a:a.substring(c),p=aM(u),f=p!==u,h=d&&d>c?d-c:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}};if(t){const a=t+Qh,s=n;n=o=>o.startsWith(a)?s(o.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=s=>r({className:s,parseClassName:a})}return n},aM=e=>e.endsWith(Jh)?e.substring(0,e.length-1):e.startsWith(Jh)?e.substring(1):e,iM=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let s=[];return n.forEach(o=>{o[0]==="["||t[o]?(a.push(...s.sort(),o),s=[]):s.push(o)}),a.push(...s.sort()),a}},sM=e=>({cache:tM(e.cacheSize),parseClassName:nM(e),sortModifiers:iM(e),...XO(e)}),oM=/\s+/,lM=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=t,o=[],l=e.trim().split(oM);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:p,modifiers:f,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:b}=r(u);if(p){c=u+(c.length>0?" "+c:c);continue}let x=!!b,y=n(x?g.substring(0,b):g);if(!y){if(!x){c=u+(c.length>0?" "+c:c);continue}if(y=n(g),!y){c=u+(c.length>0?" "+c:c);continue}x=!1}const v=s(f).join(":"),w=h?v+Jh:v,C=w+y;if(o.includes(C))continue;o.push(C);const k=a(y,x);for(let N=0;N<k.length;++N){const j=k[N];o.push(w+j)}c=u+(c.length>0?" "+c:c)}return c};function cM(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=WN(t))&&(n&&(n+=" "),n+=r);return n}const WN=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=WN(e[n]))&&(r&&(r+=" "),r+=t);return r};function dM(e,...t){let r,n,a,s=o;function o(c){const d=t.reduce((u,p)=>p(u),e());return r=sM(d),n=r.cache.get,a=r.cache.set,s=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=lM(c,r);return a(c,u),u}return function(){return s(cM.apply(null,arguments))}}const Cr=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},qN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,KN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,uM=/^\d+\/\d+$/,pM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mM=/\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$/,hM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rs=e=>uM.test(e),St=e=>!!e&&!Number.isNaN(Number(e)),ri=e=>!!e&&Number.isInteger(Number(e)),_p=e=>e.endsWith("%")&&St(e.slice(0,-1)),ja=e=>pM.test(e),bM=()=>!0,xM=e=>mM.test(e)&&!hM.test(e),YN=()=>!1,yM=e=>fM.test(e),vM=e=>gM.test(e),wM=e=>!Ye(e)&&!Ze(e),kM=e=>Do(e,JN,YN),Ye=e=>qN.test(e),Bi=e=>Do(e,QN,xM),Rp=e=>Do(e,TM,St),bk=e=>Do(e,ZN,YN),SM=e=>Do(e,XN,vM),Bc=e=>Do(e,eE,yM),Ze=e=>KN.test(e),ll=e=>Oo(e,QN),CM=e=>Oo(e,AM),xk=e=>Oo(e,ZN),NM=e=>Oo(e,JN),EM=e=>Oo(e,XN),Uc=e=>Oo(e,eE,!0),Do=(e,t,r)=>{const n=qN.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Oo=(e,t,r=!1)=>{const n=KN.exec(e);return n?n[1]?t(n[1]):r:!1},ZN=e=>e==="position"||e==="percentage",XN=e=>e==="image"||e==="url",JN=e=>e==="length"||e==="size"||e==="bg-size",QN=e=>e==="length",TM=e=>e==="number",AM=e=>e==="family-name",eE=e=>e==="shadow",jM=()=>{const e=Cr("color"),t=Cr("font"),r=Cr("text"),n=Cr("font-weight"),a=Cr("tracking"),s=Cr("leading"),o=Cr("breakpoint"),l=Cr("container"),c=Cr("spacing"),d=Cr("radius"),u=Cr("shadow"),p=Cr("inset-shadow"),f=Cr("text-shadow"),h=Cr("drop-shadow"),g=Cr("blur"),b=Cr("perspective"),x=Cr("aspect"),y=Cr("ease"),v=Cr("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...C(),Ze,Ye],N=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],A=()=>[Ze,Ye,c],E=()=>[Rs,"full","auto",...A()],T=()=>[ri,"none","subgrid",Ze,Ye],_=()=>["auto",{span:["full",ri,Ze,Ye]},ri,Ze,Ye],I=()=>[ri,"auto",Ze,Ye],R=()=>["auto","min","max","fr",Ze,Ye],S=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...A()],z=()=>[Rs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],q=()=>[e,Ze,Ye],V=()=>[...C(),xk,bk,{position:[Ze,Ye]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",NM,kM,{size:[Ze,Ye]}],H=()=>[_p,ll,Bi],M=()=>["","none","full",d,Ze,Ye],ee=()=>["",St,ll,Bi],Q=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[St,_p,xk,bk],ce=()=>["","none",g,Ze,Ye],ye=()=>["none",St,Ze,Ye],pe=()=>["none",St,Ze,Ye],ve=()=>[St,Ze,Ye],ue=()=>[Rs,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ja],breakpoint:[ja],color:[bM],container:[ja],"drop-shadow":[ja],ease:["in","out","in-out"],font:[wM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ja],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ja],shadow:[ja],spacing:["px",St],text:[ja],"text-shadow":[ja],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rs,Ye,Ze,x]}],container:["container"],columns:[{columns:[St,Ye,Ze,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:k()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[ri,"auto",Ze,Ye]}],basis:[{basis:[Rs,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[St,Rs,"auto","initial","none",Ye]}],grow:[{grow:["",St,Ze,Ye]}],shrink:[{shrink:["",St,Ze,Ye]}],order:[{order:[ri,"first","last","none",Ze,Ye]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...S(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...S()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":S()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],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:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,ll,Bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Ze,Rp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_p,Ye]}],"font-family":[{font:[CM,Ye,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,Ze,Ye]}],"line-clamp":[{"line-clamp":[St,"none",Ze,Rp]}],leading:[{leading:[s,...A()]}],"list-image":[{"list-image":["none",Ze,Ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,Ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[St,"from-font","auto",Ze,Bi]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[St,"auto",Ze,Ye]}],"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",Ze,Ye]}],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",Ze,Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ri,Ze,Ye],radial:["",Ze,Ye],conic:[ri,Ze,Ye]},EM,SM]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[St,Ze,Ye]}],"outline-w":[{outline:["",St,ll,Bi]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",u,Uc,Bc]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",p,Uc,Bc]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[St,Bi]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",f,Uc,Bc]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[St,Ze,Ye]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[St]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Ze,Ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[St]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,Ye]}],filter:[{filter:["","none",Ze,Ye]}],blur:[{blur:ce()}],brightness:[{brightness:[St,Ze,Ye]}],contrast:[{contrast:[St,Ze,Ye]}],"drop-shadow":[{"drop-shadow":["","none",h,Uc,Bc]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",St,Ze,Ye]}],"hue-rotate":[{"hue-rotate":[St,Ze,Ye]}],invert:[{invert:["",St,Ze,Ye]}],saturate:[{saturate:[St,Ze,Ye]}],sepia:[{sepia:["",St,Ze,Ye]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,Ye]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[St,Ze,Ye]}],"backdrop-contrast":[{"backdrop-contrast":[St,Ze,Ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",St,Ze,Ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[St,Ze,Ye]}],"backdrop-invert":[{"backdrop-invert":["",St,Ze,Ye]}],"backdrop-opacity":[{"backdrop-opacity":[St,Ze,Ye]}],"backdrop-saturate":[{"backdrop-saturate":[St,Ze,Ye]}],"backdrop-sepia":[{"backdrop-sepia":["",St,Ze,Ye]}],"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",Ze,Ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[St,"initial",Ze,Ye]}],ease:[{ease:["linear","initial",y,Ze,Ye]}],delay:[{delay:[St,Ze,Ye]}],animate:[{animate:["none",v,Ze,Ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ze,Ye]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[Ze,Ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"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",Ze,Ye]}],"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",Ze,Ye]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[St,ll,Bi,Rp]}],stroke:[{stroke:["none",...q()]}],"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"]}},IM=dM(jM);function xe(...e){return IM(GN(e))}function _M(e){if(!e||typeof e!="string")return null;try{return JSON.parse(e)}catch{return null}}const RM=Pg("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}}),tE=m.forwardRef(({className:e,variant:t,...r},n)=>i.jsx("div",{ref:n,role:"alert","data-slot":"alert",className:xe(RM({variant:t}),e),...r}));tE.displayName="Alert";const LM=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"alert-title",className:xe("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t}));LM.displayName="AlertTitle";const PM=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"alert-description",className:xe("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t}));PM.displayName="AlertDescription";const DM=Pg("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 Et({className:e,variant:t,...r}){return i.jsx("div",{className:xe(DM({variant:t}),e),...r})}const OM=Pg("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"}}),Ne=m.forwardRef(({className:e,variant:t,size:r,...n},a)=>i.jsx("button",{className:xe(OM({variant:t,size:r,className:e})),ref:a,...n}));Ne.displayName="Button";const rE=m.createContext(null),nE=()=>{const e=m.useContext(rE);if(!e)throw new Error("Confirmation components must be used within Confirmation");return e},aE=({className:e,approval:t="pending",children:r,...n})=>{const a=m.useMemo(()=>({approval:t}),[t]);return i.jsx(rE.Provider,{value:a,children:i.jsx(tE,{className:xe("flex flex-col gap-2",e),...n,children:r})})};aE.displayName="Confirmation";const iE=({className:e,...t})=>i.jsx("div",{"data-slot":"confirmation-title",className:xe("text-muted-foreground inline text-sm",e),...t});iE.displayName="ConfirmationTitle";const sE=({children:e})=>{const{approval:t}=nE();return t!=="pending"?null:i.jsx(i.Fragment,{children:e})};sE.displayName="ConfirmationRequest";const oE=({className:e,...t})=>{const{approval:r}=nE();return r!=="pending"?null:i.jsx("div",{"data-slot":"confirmation-actions",className:xe("flex items-center justify-end gap-2 self-end",e),...t})};oE.displayName="ConfirmationActions";const Id=({variant:e="default",...t})=>i.jsx(Ne,{className:"h-8 px-3 text-sm",variant:e,type:"button",...t});Id.displayName="ConfirmationAction";const lE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("rounded-xl border bg-card text-card-foreground shadow-sm",e),...t}));lE.displayName="Card";const cE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("flex flex-col space-y-1.5 p-4",e),...t}));cE.displayName="CardHeader";const dE=m.forwardRef(({className:e,...t},r)=>i.jsx("h3",{ref:r,className:xe("font-semibold leading-none tracking-tight",e),...t}));dE.displayName="CardTitle";const MM=m.forwardRef(({className:e,...t},r)=>i.jsx("p",{ref:r,className:xe("text-sm text-muted-foreground",e),...t}));MM.displayName="CardDescription";const uE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("p-4 pt-0",e),...t}));uE.displayName="CardContent";const pE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("flex items-center p-4 pt-0",e),...t}));pE.displayName="CardFooter";const FM=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("ml-auto shrink-0",e),...t}));FM.displayName="CardAction";const mE=m.createContext(null);function hE(){const e=m.useContext(mE);if(!e)throw new Error("Collapsible components must be used within <Collapsible>");return e}const Ci=m.forwardRef(({defaultOpen:e=!1,open:t,onOpenChange:r,className:n,children:a,...s},o)=>{const[l,c]=m.useState(e),d=t!==void 0,u=d?t:l,p=m.useCallback(h=>{d||c(h),r?.(h)},[d,r]),f=m.useMemo(()=>({open:u,onOpenChange:p}),[u,p]);return i.jsx(mE.Provider,{value:f,children:i.jsx("div",{ref:o,"data-state":u?"open":"closed",className:n,...s,children:a})})});Ci.displayName="Collapsible";const $a=m.forwardRef(({onClick:e,children:t,className:r,...n},a)=>{const{open:s,onOpenChange:o}=hE(),l=m.useCallback(c=>{o(!s),e?.(c)},[s,o,e]);return i.jsx("button",{ref:a,type:"button","aria-expanded":s,"data-state":s?"open":"closed",onClick:l,className:r,...n,children:t})});$a.displayName="CollapsibleTrigger";const Ni=m.forwardRef(({className:e,children:t,...r},n)=>{const{open:a}=hE();return i.jsx("div",{ref:n,"data-state":a?"open":"closed",className:xe("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),...r,children:i.jsx("div",{className:"overflow-hidden",children:t})})});Ni.displayName="CollapsibleContent";const fE=m.createContext(null);function Og(){const e=m.useContext(fE);if(!e)throw new Error("Command components must be used within <Command>");return e}const gE=m.forwardRef(({className:e,children:t,...r},n)=>{const[a,s]=m.useState(""),o=m.useRef(new Map),[l,c]=m.useState(0),d=m.useCallback(v=>{o.current.set(v.id,v),c(w=>w+1)},[]),u=m.useCallback(v=>{o.current.delete(v),c(w=>w+1)},[]),p=m.useCallback((v,w)=>{const C=o.current.get(v);C&&Object.assign(C,w)},[]),f=m.useMemo(()=>{const v=a.toLowerCase(),w=new Set;for(const[C,k]of o.current)(!v||k.value.includes(v))&&w.add(C);return w},[a,l]),h=m.useMemo(()=>{const v=[];for(const[,w]of o.current)f.has(w.id)&&v.push(w);return v},[f]),[g,b]=m.useState(null);m.useEffect(()=>{b(h.length>0?h[0].id:null)},[h]);const x=m.useCallback(v=>{if(v.key==="ArrowDown"||v.key==="ArrowUp"||v.key==="Enter")v.preventDefault();else return;const w=h;if(w.length===0)return;if(v.key==="Enter"){w.find(E=>E.id===g)?.onSelect();return}const C=w.findIndex(A=>A.id===g);let k;v.key==="ArrowDown"?k=C<w.length-1?C+1:0:k=C>0?C-1:w.length-1;const N=w[k].id;b(N),w[k].element?.scrollIntoView({block:"nearest"})},[h,g]),y=m.useMemo(()=>({search:a,setSearch:s,visibleIds:f,activeId:g,setActiveId:b,register:d,unregister:u,updateEntry:p}),[a,f,g,d,u,p]);return i.jsx(fE.Provider,{value:y,children:i.jsx("div",{ref:n,role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",className:xe("flex flex-col",e),onKeyDown:x,...r,children:t})})});gE.displayName="Command";const bE=m.forwardRef(({className:e,placeholder:t="Search...",...r},n)=>{const{search:a,setSearch:s}=Og();return i.jsxs("div",{className:"flex items-center border-b px-3",role:"presentation",children:[i.jsx(ps,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),i.jsx("input",{ref:n,type:"text",role:"searchbox","aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:a,onChange:o=>s(o.target.value),placeholder:t,className:xe("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none","placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})});bE.displayName="CommandInput";const xE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,role:"listbox",className:xe("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));xE.displayName="CommandList";const yE=m.forwardRef(({className:e,...t},r)=>{const{search:n,visibleIds:a}=Og();return!n||a.size>0?null:i.jsx("div",{ref:r,className:xe("py-6 text-center text-sm text-muted-foreground",e),...t})});yE.displayName="CommandEmpty";const vE=m.forwardRef(({className:e,heading:t,children:r,...n},a)=>i.jsxs("div",{ref:a,className:xe("overflow-hidden p-1",e),role:"group","aria-label":typeof t=="string"?t:void 0,...n,children:[t&&i.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",role:"presentation",children:t}),r]}));vE.displayName="CommandGroup";const wE=m.forwardRef(({className:e,value:t,onSelect:r,disabled:n,children:a,...s},o)=>{const{visibleIds:l,activeId:c,setActiveId:d,register:u,unregister:p,updateEntry:f}=Og(),h=m.useId(),g=m.useRef(null),b=t||(typeof a=="string"?a:"");m.useEffect(()=>(u({id:h,value:b.toLowerCase(),onSelect:r||(()=>{}),element:g.current}),()=>p(h)),[h,b,u,p]),m.useEffect(()=>{f(h,{onSelect:r||(()=>{})})},[h,r,f]);const x=m.useCallback(v=>{g.current=v,f(h,{element:v}),typeof o=="function"?o(v):o&&(o.current=v)},[h,f,o]);if(!l.has(h))return null;const y=c===h;return i.jsx("div",{ref:x,role:"option","aria-selected":y,"aria-disabled":n||void 0,"data-active":y||void 0,className:xe("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none",y&&"bg-accent text-accent-foreground",n&&"pointer-events-none opacity-50",e),onPointerMove:()=>{!n&&c!==h&&d(h)},onClick:()=>!n&&r?.(),...s,children:a})});wE.displayName="CommandItem";const zM=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:xe("-mx-1 h-px bg-border",e),...t}));zM.displayName="CommandSeparator";function Jd({checked:e,onToggle:t,ariaLabel:r="Toggle dark mode"}){const{isDarkMode:n,toggleDarkMode:a}=Xa(),s=typeof e=="boolean"&&typeof t=="function",o=s?e:n,l=()=>{if(s&&t){t(!o);return}a()};return i.jsxs("button",{onClick:l,className:xe("relative inline-flex h-7 w-12 flex-shrink-0 touch-manipulation cursor-pointer items-center rounded-full border-2 transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",o?"border-primary bg-primary":"border-border bg-muted"),role:"switch","aria-checked":o,"aria-label":r,children:[i.jsx("span",{className:"sr-only",children:r}),i.jsx("span",{className:xe("flex h-5 w-5 transform items-center justify-center rounded-full shadow-sm transition-transform duration-200",o?"translate-x-[22px] bg-white":"translate-x-[2px] bg-foreground/60 dark:bg-foreground/80"),children:o?i.jsx(jN,{className:"h-3 w-3 text-primary"}):i.jsx(RN,{className:"h-3 w-3 text-white dark:text-background"})})]})}const kE=m.createContext(null);function SE(){const e=m.useContext(kE);if(!e)throw new Error("Dialog components must be used within <Dialog>");return e}const CE=({open:e,onOpenChange:t,defaultOpen:r=!1,children:n})=>{const[a,s]=m.useState(r),o=m.useRef(null),l=e!==void 0,c=l?e:a,d=m.useCallback(p=>{l||s(p),t?.(p)},[l,t]),u=m.useMemo(()=>({open:c,onOpenChange:d,triggerRef:o}),[c,d]);return i.jsx(kE.Provider,{value:u,children:n})},BM=m.forwardRef(({onClick:e,children:t,asChild:r,...n},a)=>{const{onOpenChange:s,triggerRef:o}=SE(),l=m.useCallback(c=>{s(!0),e?.(c)},[s,e]);if(r&&m.isValidElement(t)){const c=t;return m.cloneElement(c,{onClick:d=>{s(!0),c.props.onClick?.(d)},ref:d=>{o.current=d,typeof a=="function"?a(d):a&&(a.current=d)}})}return i.jsx("button",{ref:c=>{o.current=c,typeof a=="function"?a(c):a&&(a.current=c)},type:"button",onClick:l,...n,children:t})});BM.displayName="DialogTrigger";const yk='a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Mg=m.forwardRef(({className:e,children:t,onEscapeKeyDown:r,onPointerDownOutside:n,...a},s)=>{const{open:o,onOpenChange:l,triggerRef:c}=SE(),d=m.useRef(null),u=m.useRef(null);return m.useEffect(()=>{o?u.current=document.activeElement:u.current&&((c.current||u.current)?.focus(),u.current=null)},[o,c]),m.useEffect(()=>{if(!o)return;const p=h=>{if(h.key==="Escape"){h.stopPropagation(),r?.(),l(!1);return}if(h.key==="Tab"&&d.current){const g=Array.from(d.current.querySelectorAll(yk));if(g.length===0)return;const b=g[0],x=g[g.length-1];h.shiftKey&&document.activeElement===b?(h.preventDefault(),x.focus()):!h.shiftKey&&document.activeElement===x&&(h.preventDefault(),b.focus())}};document.addEventListener("keydown",p,!0);const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",p,!0),document.body.style.overflow=f}},[o,l,r]),m.useEffect(()=>{o&&d.current&&requestAnimationFrame(()=>{d.current?.querySelector(yk)?.focus()})},[o]),o?_u.createPortal(i.jsxs("div",{className:"fixed inset-0 z-50",children:[i.jsx("div",{className:"fixed inset-0 animate-dialog-overlay-show bg-black/50 backdrop-blur-sm",onClick:()=>{n?.(),l(!1)},"aria-hidden":!0}),i.jsx("div",{ref:p=>{d.current=p,typeof s=="function"?s(p):s&&(s.current=p)},role:"dialog","aria-modal":"true",className:xe("fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2","rounded-xl border bg-popover text-popover-foreground shadow-lg","animate-dialog-content-show",e),...a,children:t})]}),document.body):null});Mg.displayName="DialogContent";const Fg=m.forwardRef(({className:e,...t},r)=>i.jsx("h2",{ref:r,className:xe("sr-only",e),...t}));Fg.displayName="DialogTitle";const Ke=m.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{type:t,className:xe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Ke.displayName="Input";const zg=m.forwardRef(({className:e,contentClassName:t,children:r,...n},a)=>i.jsx("div",{className:xe("relative overflow-hidden",e),...n,children:i.jsx("div",{ref:a,className:xe("h-full w-full overflow-auto rounded-[inherit]",t),style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:r})}));zg.displayName="ScrollArea";const Qd=m.memo(({children:e,className:t,as:r="span"})=>i.jsx(r,{className:xe("animate-shimmer inline-block bg-[length:250%_100%] bg-clip-text text-transparent","bg-[linear-gradient(90deg,transparent_33%,hsl(var(--foreground))_50%,transparent_67%),linear-gradient(hsl(var(--muted-foreground)),hsl(var(--muted-foreground)))]",t),children:e}));Qd.displayName="Shimmer";const NE=m.createContext(null),UM=()=>{const e=m.useContext(NE);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},$M=1e3,HM=1e3,ef=m.memo(({className:e,isStreaming:t=!1,open:r,defaultOpen:n,onOpenChange:a,duration:s,children:o,...l})=>{const c=n??t,d=n===!1,[u,p]=m.useState(c),f=r!==void 0,h=f?r:u,g=m.useCallback(N=>{f||p(N),a?.(N)},[f,a]),[b,x]=m.useState(s),y=m.useRef(t),[v,w]=m.useState(!1),C=m.useRef(null);m.useEffect(()=>{s!==void 0&&x(s)},[s]),m.useEffect(()=>{t?(y.current=!0,C.current===null&&(C.current=Date.now())):C.current!==null&&(x(Math.ceil((Date.now()-C.current)/HM)),C.current=null)},[t]),m.useEffect(()=>{t&&!h&&!d&&g(!0)},[t,h,g,d]),m.useEffect(()=>{if(y.current&&!t&&h&&!v){const N=setTimeout(()=>{g(!1),w(!0)},$M);return()=>clearTimeout(N)}},[t,h,g,v]);const k=m.useMemo(()=>({duration:b,isOpen:h,isStreaming:t,setIsOpen:g}),[b,h,t,g]);return i.jsx(NE.Provider,{value:k,children:i.jsx(Ci,{open:h,onOpenChange:g,className:xe("not-prose",e),...l,children:o})})});ef.displayName="Reasoning";const GM=(e,t)=>e||t===0?i.jsx(Qd,{children:"Thinking..."}):t===void 0?i.jsx("p",{children:"Thought for a few seconds"}):i.jsxs("p",{children:["Thought for ",t," seconds"]}),tf=m.memo(({className:e,children:t,getThinkingMessage:r=GM,...n})=>{const{isStreaming:a,isOpen:s,duration:o}=UM();return i.jsx($a,{className:xe("flex w-full items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground",e),...n,children:t??i.jsxs(i.Fragment,{children:[i.jsx(PD,{className:"h-4 w-4"}),r(a,o),i.jsx(uN,{className:xe("h-4 w-4 transition-transform",s?"rotate-180":"rotate-0")})]})})});tf.displayName="ReasoningTrigger";const rf=m.memo(({className:e,children:t,...r})=>i.jsx(Ni,{className:xe("mt-4 text-sm text-muted-foreground",e),...r,children:t}));rf.displayName="ReasoningContent";function VM(e){switch(e){case"top":return"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900 dark:border-t-gray-100";case"bottom":return"bottom-full left-1/2 transform -translate-x-1/2 border-b-gray-900 dark:border-b-gray-100";case"left":return"left-full top-1/2 transform -translate-y-1/2 border-l-gray-900 dark:border-l-gray-100";case"right":return"right-full top-1/2 transform -translate-y-1/2 border-r-gray-900 dark:border-r-gray-100";default:return"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900 dark:border-t-gray-100"}}function nf({children:e,content:t,position:r="top",className:n="",delay:a=350}){const[s,o]=m.useState(!1),l=m.useRef(null),c=m.useRef(!1),d=m.useRef(null),u=m.useRef(null),[p,f]=m.useState(null),h=m.useCallback(()=>{const w=d.current;if(!w)return;const C=w.getBoundingClientRect(),k=8,N={position:"fixed",zIndex:9999};switch(r){case"bottom":N.left=C.left+C.width/2,N.top=C.bottom+k,N.transform="translateX(-50%)";break;case"left":N.left=C.left-k,N.top=C.top+C.height/2,N.transform="translate(-100%, -50%)";break;case"right":N.left=C.right+k,N.top=C.top+C.height/2,N.transform="translateY(-50%)";break;case"top":default:N.left=C.left+C.width/2,N.top=C.top-k,N.transform="translate(-50%, -100%)";break}f(N)},[r]),g=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},b=()=>{g(),l.current=window.setTimeout(()=>{o(!0)},a)},x=()=>{g(),o(!1)},y=()=>{g(),c.current=!1,l.current=window.setTimeout(()=>{c.current=!0,o(!0)},a)},v=()=>{g(),!c.current&&o(!1)};return m.useEffect(()=>()=>{g()},[]),m.useEffect(()=>{if(!s||typeof document>"u")return;const w=C=>{const k=C.target;k instanceof Node&&d.current?.contains(k)||(o(!1),c.current=!1)};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[s]),m.useEffect(()=>{if(!s){f(null);return}const w=window.requestAnimationFrame(h),C=()=>h();return window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.cancelAnimationFrame(w),window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[s,h]),t?i.jsxs("div",{ref:d,className:"relative inline-block",onMouseEnter:b,onMouseLeave:x,onTouchStart:y,onTouchEnd:v,onTouchCancel:v,children:[e,s&&typeof document<"u"&&_u.createPortal(i.jsxs("div",{ref:u,style:p||{position:"fixed",top:"-9999px",left:"-9999px",opacity:0},className:xe("px-2 py-1 text-xs font-medium text-white bg-gray-900 dark:bg-gray-100 dark:text-gray-900 rounded shadow-lg whitespace-nowrap pointer-events-none","animate-in fade-in-0 zoom-in-95 duration-200",n),children:[t,i.jsx("div",{className:xe("absolute w-0 h-0 border-4 border-transparent",VM(r))})]}),document.body)]}):i.jsx(i.Fragment,{children:e})}const EE=m.createContext(null),TE=m.forwardRef(({className:e,status:t="ready",children:r,...n},a)=>{const s=m.useMemo(()=>({status:t}),[t]);return i.jsx(EE.Provider,{value:s,children:i.jsx("form",{ref:a,"data-slot":"prompt-input",className:xe("relative overflow-hidden rounded-xl border border-border/70 bg-zinc-50/95 shadow-sm shadow-zinc-950/5 backdrop-blur-sm transition-all duration-200 focus-within:border-primary/40 focus-within:shadow-md focus-within:ring-1 focus-within:ring-primary/20 dark:bg-zinc-950/90",e),...n,children:r})})});TE.displayName="PromptInput";const AE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-header",className:xe("px-3 pt-3",e),...t}));AE.displayName="PromptInputHeader";const jE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-body",className:xe("relative",e),...t}));jE.displayName="PromptInputBody";const IE=m.forwardRef(({className:e,...t},r)=>i.jsx("textarea",{ref:r,"data-slot":"prompt-input-textarea",className:xe("chat-input-placeholder block max-h-[40vh] w-full resize-none overflow-y-auto bg-transparent px-4 py-2 font-mono text-sm leading-6 text-foreground placeholder-muted-foreground/50 focus:outline-none sm:max-h-[300px]",e),...t}));IE.displayName="PromptInputTextarea";const _E=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-footer",className:xe("flex items-center justify-between border-t border-border/30 px-3 py-2",e),...t}));_E.displayName="PromptInputFooter";const RE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-tools",className:xe("flex items-center gap-1",e),...t}));RE.displayName="PromptInputTools";const _d=m.forwardRef(({className:e,tooltip:t,children:r,...n},a)=>{const s=i.jsx(Ne,{ref:a,type:"button",variant:"ghost",size:"icon",className:xe("h-8 w-8 [&_svg]:size-4",e),...n,children:r});return t?i.jsx(nf,{content:t.shortcut?i.jsxs("span",{className:"flex items-center gap-1.5",children:[t.content,i.jsx("kbd",{className:"rounded bg-white/20 px-1 text-[10px]",children:t.shortcut})]}):t.content,position:t.side??"top",children:s}):s});_d.displayName="PromptInputButton";const LE=m.forwardRef(({className:e,status:t,children:r,...n},a)=>{const s=m.useContext(EE),o=t??s?.status??"ready",l=o==="submitted"||o==="streaming";return i.jsx(Ne,{ref:a,type:l?"button":"submit",variant:"default",size:"icon",className:xe("h-8 w-8 rounded-lg",e),...n,children:r??(l?i.jsx(fc,{className:"h-3.5 w-3.5 fill-current"}):i.jsx(xD,{className:"h-4 w-4"}))})});LE.displayName="PromptInputSubmit";function Bg({children:e,className:t}){return i.jsx("div",{className:xe("inline-flex items-center gap-[2px] rounded-lg bg-muted/60 p-[3px]",t),children:e})}function Ug({isActive:e,onClick:t,children:r,className:n}){return i.jsx("button",{onClick:t,className:xe("flex touch-manipulation items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-all duration-150",e?"bg-background text-foreground shadow-sm":"text-muted-foreground active:bg-background/50",n),children:r})}const PE=m.createContext(null);function DE(){const e=m.useContext(PE);if(!e)throw new Error("QueueItem sub-components must be used within <QueueItem>");return e}const OE=m.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"queue",role:"list",className:xe("space-y-0.5",e),...t}));OE.displayName="Queue";const ME=m.forwardRef(({status:e="pending",className:t,children:r,...n},a)=>{const s=m.useMemo(()=>({status:e}),[e]);return i.jsx(PE.Provider,{value:s,children:i.jsx("div",{ref:a,"data-slot":"queue-item","data-status":e,role:"listitem",className:xe("flex items-start gap-2 py-0.5",t),...n,children:r})})});ME.displayName="QueueItem";const FE=m.forwardRef(({className:e,...t},r)=>{const{status:n}=DE();return i.jsxs("div",{ref:r,"data-slot":"queue-item-indicator","aria-hidden":"true",className:xe("mt-0.5 flex h-3.5 w-3.5 flex-shrink-0 items-center justify-center",e),...t,children:[n==="completed"&&i.jsx("svg",{className:"h-3.5 w-3.5 text-green-500 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),n==="in_progress"&&i.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-blue-500 dark:bg-blue-400"}),n==="pending"&&i.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("circle",{cx:"12",cy:"12",r:"9",strokeWidth:2})})]})});FE.displayName="QueueItemIndicator";const zE=m.forwardRef(({className:e,children:t,...r},n)=>{const{status:a}=DE();return i.jsx("div",{ref:n,"data-slot":"queue-item-content",className:xe("min-w-0 flex-1 text-xs",a==="completed"&&"text-muted-foreground line-through",a==="in_progress"&&"font-medium text-foreground",a==="pending"&&"text-foreground",e),...r,children:t})});zE.displayName="QueueItemContent";const vk="https://github.com/alicomert/pixcode/issues/new",WM="https://github.com/alicomert/pixcode",wk="https://discord.gg/buxwujPNRE";function kk({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.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 qM({updateAvailable:e,releaseInfo:t,latestVersion:r,currentVersion:n,onShowVersionModal:a,onOpenControlRoom:s,onShowSettings:o,t:l}){return i.jsxs("div",{className:"flex-shrink-0",style:{paddingBottom:"env(safe-area-inset-bottom, 0)"},children:[e&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"nav-divider"}),i.jsx("div",{className:"hidden px-2 py-1.5 md:block",children:i.jsxs("button",{className:"group flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-blue-50/80 dark:hover:bg-blue-900/15",onClick:a,children:[i.jsxs("div",{className:"relative flex-shrink-0",children:[i.jsx(Zw,{className:"h-4 w-4 text-blue-500 dark:text-blue-400"}),i.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-sm font-medium text-blue-600 dark:text-blue-300",children:t?.title||`v${r}`}),i.jsx("span",{className:"text-[10px] text-blue-500/70 dark:text-blue-400/60",children:l("version.updateAvailable")})]})]})}),i.jsx("div",{className:"px-3 py-2 md:hidden",children:i.jsxs("button",{className:"flex h-11 w-full items-center gap-3 rounded-xl border border-blue-200/60 bg-blue-50/80 px-3.5 transition-all active:scale-[0.98] dark:border-blue-700/40 dark:bg-blue-900/15",onClick:a,children:[i.jsxs("div",{className:"relative flex-shrink-0",children:[i.jsx(Zw,{className:"w-4.5 h-4.5 text-blue-500 dark:text-blue-400"}),i.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]}),i.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[i.jsx("span",{className:"block truncate text-sm font-medium text-blue-600 dark:text-blue-300",children:t?.title||`v${r}`}),i.jsx("span",{className:"text-xs text-blue-500/70 dark:text-blue-400/60",children:l("version.updateAvailable")})]})]})})]}),i.jsx("div",{className:"nav-divider"}),i.jsx("div",{className:"hidden px-2 pt-1.5 md:block",children:i.jsxs("a",{href:vk,target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:[i.jsx(xo,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:l("actions.reportIssue")})]})}),i.jsx("div",{className:"hidden px-2 md:block",children:i.jsxs("a",{href:wk,target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:[i.jsx(kk,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:l("actions.joinCommunity")})]})}),s&&i.jsx("div",{className:"hidden px-2 pt-1.5 md:block",children:i.jsxs("button",{className:"group flex w-full items-center gap-2.5 rounded-lg border border-primary/25 bg-primary/5 px-2.5 py-2 text-left transition-colors hover:bg-primary/10",onClick:s,children:[i.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-primary/10 text-primary",children:i.jsx(Fn,{className:"h-3.5 w-3.5"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:l("actions.controlRoom",{defaultValue:"Control Room"})}),i.jsx("span",{className:"block truncate text-[10px] text-muted-foreground",children:l("actions.controlRoomDescription",{defaultValue:"Admin, access, runs"})})]})]})}),i.jsx("div",{className:"hidden px-2 py-1.5 md:block",children:i.jsxs("button",{className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",onClick:o,children:[i.jsx(Ut,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:l("actions.settings")})]})}),i.jsx("div",{className:"hidden px-3 py-2 text-center md:block",children:i.jsxs("a",{href:WM,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-muted-foreground/40 transition-colors hover:text-muted-foreground",children:["Pixcode v",n," – ",l("branding.openSource")]})}),i.jsx("div",{className:"px-3 pt-3 md:hidden",children:i.jsxs("a",{href:vk,target:"_blank",rel:"noopener noreferrer",className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(xo,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:l("actions.reportIssue")})]})}),i.jsx("div",{className:"px-3 pt-2 md:hidden",children:i.jsxs("a",{href:wk,target:"_blank",rel:"noopener noreferrer",className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(kk,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:l("actions.joinCommunity")})]})}),s&&i.jsx("div",{className:"px-3 pt-2 md:hidden",children:i.jsxs("button",{className:"flex h-14 w-full items-center gap-3.5 rounded-xl border border-primary/25 bg-primary/10 px-4 transition-all hover:bg-primary/15 active:scale-[0.98]",onClick:s,children:[i.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-xl bg-primary/15",children:i.jsx(Fn,{className:"w-4.5 h-4.5 text-primary"})}),i.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[i.jsx("span",{className:"block truncate text-base font-semibold text-foreground",children:l("actions.controlRoom",{defaultValue:"Control Room"})}),i.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:l("actions.controlRoomDescription",{defaultValue:"Admin, access, runs"})})]})]})}),i.jsx("div",{className:"px-3 pb-3 pt-2 md:hidden",children:i.jsxs("button",{className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",onClick:o,children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(Ut,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:l("actions.settings")})]})})]})}const Sk="PIXCODE_GITHUB_STARS",Ck="PIXCODE_HIDE_GITHUB_STAR",KM=3600*1e3,YM=(e,t)=>{const[r,n]=m.useState(null),[a,s]=m.useState(()=>{try{return localStorage.getItem(Ck)==="true"}catch{return!1}});m.useEffect(()=>{if(a)return;try{const d=localStorage.getItem(Sk);if(d){const u=JSON.parse(d);if(Date.now()-u.timestamp<KM){n(u.count);return}}}catch{}(async()=>{try{const d=await fetch(`https://api.github.com/repos/${e}/${t}`);if(!d.ok)return;const p=(await d.json()).stargazers_count;if(typeof p=="number"){n(p);try{localStorage.setItem(Sk,JSON.stringify({count:p,timestamp:Date.now()}))}catch{}}}catch{}})()},[e,t,a]);const o=m.useCallback(()=>{s(!0);try{localStorage.setItem(Ck,"true")}catch{}},[]),l=r!==null?r>=1e3?`${(r/1e3).toFixed(1)}k`:`${r}`:null;return{starCount:r,formattedCount:l,isDismissed:a,dismiss:o}},ZM="https://github.com/alicomert/pixcode";function XM({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.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"})})}function JM(){const{formattedCount:e,isDismissed:t,dismiss:r}=YM("alicomert","pixcode");return t?null:i.jsxs("div",{className:"group/star relative hidden md:block",children:[i.jsxs("a",{href:ZM,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg border border-border/50 bg-muted/30 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",children:[i.jsx(XM,{className:"h-3.5 w-3.5"}),i.jsx(yi,{className:"h-3 w-3"}),i.jsx("span",{className:"font-medium",children:"Star"}),e&&i.jsx("span",{className:"border-l border-border/50 pl-1.5 tabular-nums",children:e})]}),i.jsx("button",{onClick:n=>{n.preventDefault(),n.stopPropagation(),r()},className:"absolute -right-1.5 -top-1.5 hidden h-4 w-4 items-center justify-center rounded-full border border-border/50 bg-muted text-muted-foreground transition-colors hover:text-foreground group-hover/star:flex","aria-label":"Dismiss",children:i.jsx(At,{className:"h-2.5 w-2.5"})})]})}function Nk({value:e,onChange:t,t:r}){const n="flex flex-1 items-center justify-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium transition-all";return i.jsxs("div",{role:"tablist","aria-label":r("tooltips.historyView",{defaultValue:"History view"}),className:"flex rounded-lg bg-muted/40 p-0.5",children:[i.jsxs("button",{type:"button",role:"tab","aria-selected":e==="flat",onClick:()=>t("flat"),className:xe(n,e==="flat"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:r("tooltips.historyViewFlat",{defaultValue:"Recent conversations"}),children:[i.jsx(wg,{className:"h-3 w-3"}),r("historyView.flat",{defaultValue:"Recent"})]}),i.jsxs("button",{type:"button",role:"tab","aria-selected":e==="grouped",onClick:()=>t("grouped"),className:xe(n,e==="grouped"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:r("tooltips.historyViewGrouped",{defaultValue:"Grouped by project"}),children:[i.jsx(kD,{className:"h-3 w-3"}),r("historyView.grouped",{defaultValue:"By project"})]})]})}function QM({isPWA:e,isMobile:t,isLoading:r,projectsCount:n,searchFilter:a,onSearchFilterChange:s,onClearSearchFilter:o,searchMode:l,onSearchModeChange:c,onRefresh:d,isRefreshing:u,onCreateProject:p,onQuickStartSession:f,onCollapseSidebar:h,historyView:g,onHistoryViewChange:b,t:x}){const y=()=>i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("svg",{className:"h-6 w-6 flex-shrink-0",viewBox:"0 0 500 500","aria-hidden":"true",children:i.jsx("g",{transform:"translate(250 250) scale(1.25) translate(-250 -250)",children:i.jsxs("g",{transform:"translate(0 500) scale(0.1 -0.1)",fill:"#5C3FFC",children:[i.jsx("path",{d:"M2037 3800 c-104 -40 -191 -134 -231 -250 -23 -67 -20 -82 22 -109 31 -20 287 -177 1009 -618 40 -24 82 -56 93 -70 27 -34 27 -102 0 -136 -11 -13 -106 -78 -212 -143 -106 -64 -201 -124 -210 -132 -16 -14 -18 -41 -18 -302 0 -291 2 -310 38 -310 16 0 267 148 610 359 180 111 270 173 310 213 216 217 215 574 -3 793 -37 38 -107 89 -185 136 -69 42 -253 154 -410 249 -434 264 -509 307 -563 326 -57 20 -191 17 -250 -6z"}),i.jsx("path",{d:"M1803 2994 c-10 -5 -13 -156 -13 -709 0 -671 1 -706 20 -767 27 -89 93 -184 167 -240 89 -67 157 -90 281 -96 92 -4 105 -2 117 14 12 16 14 134 15 735 0 669 -1 718 -17 737 -20 23 -514 322 -541 327 -9 2 -23 2 -29 -1z"})]})})}),i.jsx("h1",{className:"truncate text-sm font-semibold tracking-tight text-foreground",children:x("app.title")})]});return i.jsxs("div",{className:"flex-shrink-0",children:[i.jsxs("div",{className:"hidden px-4 pb-3 pt-4 md:block",style:{},children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx(y,{}),i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-0.5",children:[i.jsx(Ne,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:d,disabled:u,title:x("tooltips.refresh"),children:i.jsx(it,{className:`h-4 w-4 ${u?"animate-spin":""}`})}),i.jsx(Ne,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:p,title:x("tooltips.createProject"),children:i.jsx(Zt,{className:"h-4 w-4"})}),i.jsx(Ne,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:h,title:x("tooltips.hideSidebar"),children:i.jsx(Pu,{className:"h-4 w-4"})})]})]}),i.jsx(JM,{}),f&&i.jsxs("button",{type:"button",onClick:()=>{f()},className:"mt-2.5 flex w-full items-center justify-center gap-2 rounded-lg border border-primary/20 bg-primary/5 px-3 py-2 text-sm font-medium text-primary transition-colors hover:bg-primary/10",children:[i.jsx(Fn,{className:"h-4 w-4"}),x("sidebar.newChat",{defaultValue:"New chat"})]}),n>0&&!r&&i.jsxs("div",{className:"mt-2.5 space-y-2",children:[i.jsx(Nk,{value:g,onChange:b,t:x}),i.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-0.5",children:[i.jsxs("button",{onClick:()=>c("projects"),"aria-pressed":l==="projects",className:xe("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="projects"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx($r,{className:"h-3 w-3"}),x("search.modeProjects")]}),i.jsxs("button",{onClick:()=>c("conversations"),"aria-pressed":l==="conversations",className:xe("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="conversations"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(Mn,{className:"h-3 w-3"}),x("search.modeConversations")]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(ps,{className:"pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/50"}),i.jsx(Ke,{type:"text",placeholder:x(l==="conversations"?"search.conversationsPlaceholder":"projects.searchPlaceholder"),value:a,onChange:v=>s(v.target.value),className:"nav-search-input h-9 rounded-xl border-0 pl-9 pr-8 text-sm transition-all duration-200 placeholder:text-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0"}),a&&i.jsx("button",{onClick:o,"aria-label":x("tooltips.clearSearch"),className:"absolute right-2.5 top-1/2 -translate-y-1/2 rounded-md p-0.5 hover:bg-accent",children:i.jsx(At,{className:"h-3 w-3 text-muted-foreground"})})]})]})]}),i.jsx("div",{className:"nav-divider hidden md:block"}),i.jsxs("div",{className:"p-3 pb-2 md:hidden",style:e&&t?{paddingTop:"16px"}:{},children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(y,{}),i.jsxs("div",{className:"flex flex-shrink-0 gap-1.5",children:[i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-muted/50 transition-all active:scale-95",onClick:d,disabled:u,children:i.jsx(it,{className:`h-4 w-4 text-muted-foreground ${u?"animate-spin":""}`})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/90 text-primary-foreground transition-all active:scale-95",onClick:p,children:i.jsx(ki,{className:"h-4 w-4"})})]})]}),n>0&&!r&&i.jsxs("div",{className:"mt-2.5 space-y-2",children:[l==="projects"&&i.jsx(Nk,{value:g,onChange:b,t:x}),i.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-0.5",children:[i.jsxs("button",{onClick:()=>c("projects"),"aria-pressed":l==="projects",className:xe("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="projects"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx($r,{className:"h-3 w-3"}),x("search.modeProjects")]}),i.jsxs("button",{onClick:()=>c("conversations"),"aria-pressed":l==="conversations",className:xe("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="conversations"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(Mn,{className:"h-3 w-3"}),x("search.modeConversations")]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(ps,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/50"}),i.jsx(Ke,{type:"text",placeholder:x(l==="conversations"?"search.conversationsPlaceholder":"projects.searchPlaceholder"),value:a,onChange:v=>s(v.target.value),className:"nav-search-input h-10 rounded-xl border-0 pl-10 pr-9 text-sm transition-all duration-200 placeholder:text-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0"}),a&&i.jsx("button",{onClick:o,"aria-label":x("tooltips.clearSearch"),className:"absolute right-2.5 top-1/2 -translate-y-1/2 rounded-md p-1 hover:bg-accent",children:i.jsx(At,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})]})]}),i.jsx("div",{className:"nav-divider md:hidden"})]})}const e9=160,Ek=180;function BE({actions:e,className:t,triggerLabel:r}){const[n,a]=m.useState(!1),[s,o]=m.useState(null),l=m.useRef(null),c=m.useRef(null);m.useLayoutEffect(()=>{if(!n||!l.current)return;const u=l.current.getBoundingClientRect();let p=u.right-e9;p<8&&(p=8);let f=u.bottom+4;f+Ek>window.innerHeight&&(f=Math.max(8,u.top-4-Ek)),o({top:f,left:p})},[n]),m.useEffect(()=>{if(!n)return;const u=h=>{const g=h.target;l.current?.contains(g)||c.current?.contains(g)||a(!1)},p=h=>{h.key==="Escape"&&a(!1)},f=()=>a(!1);return document.addEventListener("mousedown",u),document.addEventListener("keydown",p),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",p),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[n]);const d=u=>p=>{p.stopPropagation(),p.preventDefault(),a(!1),u.onClick()};return i.jsxs(i.Fragment,{children:[i.jsx("button",{ref:l,type:"button","aria-haspopup":"menu","aria-expanded":n,"aria-label":r||"Actions",title:r||"Actions",onClick:u=>{u.stopPropagation(),u.preventDefault(),a(p=>!p)},className:xe("flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground","opacity-0 transition-all duration-150 hover:bg-accent hover:text-foreground","group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary","touch:opacity-100",n&&"bg-accent text-foreground opacity-100",t),children:i.jsx(TN,{className:"h-3.5 w-3.5"})}),n&&s&&_u.createPortal(i.jsx("div",{ref:c,role:"menu",style:{position:"fixed",top:s.top,left:s.left,zIndex:9999},className:xe("w-40 rounded-xl border border-border/60 bg-popover p-1 shadow-lg","animate-in fade-in-0 zoom-in-95 duration-100"),onClick:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),children:e.map((u,p)=>{const f=u.icon,h=e[p-1],g=p>0&&u.danger&&!h?.danger;return i.jsxs("div",{children:[g&&i.jsx("div",{className:"my-1 h-px bg-border/60"}),i.jsxs("button",{type:"button",role:"menuitem",onClick:d(u),className:xe("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs",u.danger?"text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20":"text-foreground hover:bg-accent"),children:[i.jsx(f,{className:"h-3 w-3"}),u.label]})]},u.id)})}),document.body)]})}const t9=(e,t,r)=>{const n=new Date(e),a=t;if(isNaN(n.getTime()))return r?r("status.unknown"):"Unknown";const s=a.getTime()-n.getTime(),o=Math.floor(s/1e3),l=Math.floor(s/(1e3*60)),c=Math.floor(s/(1e3*60*60)),d=Math.floor(s/(1e3*60*60*24));return o<60?r?r("time.justNow"):"Just now":l===1?r?r("time.oneMinuteAgo"):"1 min ago":l<60?r?r("time.minutesAgo",{count:l}):`${l} mins ago`:c===1?r?r("time.oneHourAgo"):"1 hour ago":c<24?r?r("time.hoursAgo",{count:c}):`${c} hours ago`:d===1?r?r("time.oneDayAgo"):"1 day ago":d<7?r?r("time.daysAgo",{count:d}):`${d} days ago`:n.toLocaleDateString()};function Tk({isStarred:e,canDelete:t,onRename:r,onToggleStar:n,onDelete:a,t:s,className:o}){const l=d=>i.jsx(yi,{className:`${d.className??""} ${e?"fill-yellow-400 text-yellow-500":""}`}),c=[{id:"rename",label:s("actions.rename"),icon:NN,onClick:r},{id:"star",label:e?s("actions.unstarSession",{defaultValue:"Remove star"}):s("actions.starSession",{defaultValue:"Star"}),icon:l,onClick:n}];return t&&c.push({id:"delete",label:s("actions.delete"),icon:Pr,onClick:a,danger:!0}),i.jsx(BE,{actions:c,className:o,triggerLabel:s("tooltips.sessionActions",{defaultValue:"Session actions"})})}const r9={claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code",opencode:"OpenCode"},Ak={claude:"bg-orange-500/10 text-orange-600 dark:bg-orange-400/10 dark:text-orange-300 ring-1 ring-orange-500/15",cursor:"bg-sky-500/10 text-sky-600 dark:bg-sky-400/10 dark:text-sky-300 ring-1 ring-sky-500/15",codex:"bg-violet-500/10 text-violet-600 dark:bg-violet-400/10 dark:text-violet-300 ring-1 ring-violet-500/15",gemini:"bg-emerald-500/10 text-emerald-600 dark:bg-emerald-400/10 dark:text-emerald-300 ring-1 ring-emerald-500/15",qwen:"bg-amber-500/10 text-amber-600 dark:bg-amber-400/10 dark:text-amber-300 ring-1 ring-amber-500/15",opencode:"bg-teal-500/10 text-teal-600 dark:bg-teal-400/10 dark:text-teal-300 ring-1 ring-teal-500/15"};function UE({project:e,session:t,selectedSession:r,currentTime:n,editingSession:a,editingSessionName:s,isStarred:o,compact:l=!1,onEditingSessionNameChange:c,onStartEditingSession:d,onCancelEditingSession:u,onSaveEditingSession:p,onToggleStarSession:f,onProjectSelect:h,onSessionSelect:g,onDeleteSession:b,t:x}){const y=$O(t,n,x),v=r?.id===t.id,w=a===t.id,C=t.__provider,k=r9[C]??C,N=Ak[C]??Ak.claude,j=zO(y.sessionName),A=()=>{h(e),g(t,e.name)},E=()=>{p(e.name,t.id,s,C)},T=()=>{b(e.name,t.id,y.sessionName,C)},_=()=>d(t.id,y.sessionName),I=()=>f(e.name,t.id),R=i.jsxs("div",{className:"mt-0.5 flex min-w-0 flex-wrap items-center gap-1 text-[10px] leading-tight",children:[i.jsxs("span",{className:xe("inline-flex items-center gap-1 rounded-full px-1.5 py-px font-medium",N),children:[i.jsx(dr,{provider:C,className:"h-2.5 w-2.5"}),k]}),i.jsx("span",{className:"text-muted-foreground/80",children:t9(y.sessionTime,n,x)}),y.isActive&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[i.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),x("status.active",{defaultValue:"Active"})]}),j.slice(0,3).map(z=>i.jsxs("span",{className:"rounded-md bg-muted/60 px-1 py-px font-mono text-[9px] uppercase tracking-wide text-muted-foreground ring-1 ring-border/40",children:[".",z]},z))]}),S=i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",value:s,onChange:z=>c(z.target.value),onKeyDown:z=>{z.stopPropagation(),z.key==="Enter"?E():z.key==="Escape"&&u()},onClick:z=>z.stopPropagation(),className:"w-full rounded-md border border-primary/40 bg-background px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),i.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-green-50 hover:bg-green-100 dark:bg-green-900/20 dark:hover:bg-green-900/40",onClick:z=>{z.stopPropagation(),E()},title:x("tooltips.save"),children:i.jsx(tr,{className:"h-3 w-3 text-green-600 dark:text-green-400"})}),i.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-gray-50 hover:bg-gray-100 dark:bg-gray-900/20 dark:hover:bg-gray-900/40",onClick:z=>{z.stopPropagation(),u()},title:x("tooltips.cancel"),children:i.jsx(At,{className:"h-3 w-3 text-gray-600 dark:text-gray-400"})})]}),F=i.jsx("div",{className:"md:hidden",children:i.jsx("div",{className:xe("relative mx-3 my-0.5 rounded-lg border border-border/30 bg-card p-2 transition-all duration-150 active:scale-[0.98]",v&&"border-primary/30 bg-primary/5 shadow-sm",!v&&y.isActive&&"border-green-500/25 bg-green-50/5 dark:bg-green-900/5",o&&!v&&"ring-1 ring-yellow-300/50 dark:ring-yellow-500/30"),onClick:w?void 0:A,children:w?i.jsx("div",{className:"flex items-center gap-1",children:S}):i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:xe("flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-md",v?"bg-primary/10":"bg-muted/60"),children:i.jsx(dr,{provider:C,className:"h-3 w-3"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[o&&i.jsx("span",{className:"text-yellow-500","aria-hidden":!0,children:"★"}),i.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:y.sessionName})]}),R]}),i.jsx("div",{className:"flex-shrink-0",onClick:z=>z.stopPropagation(),children:i.jsx(Tk,{isStarred:o,canDelete:!y.isCursorSession,onRename:_,onToggleStar:I,onDelete:T,t:x,className:"!opacity-100"})})]})})}),B=i.jsxs("div",{className:xe("group/item relative hidden md:block"),children:[i.jsxs(Ne,{variant:"ghost",className:xe("relative h-auto w-full justify-start overflow-hidden p-0 text-left font-normal transition-colors duration-150","hover:bg-accent/60",v&&"bg-accent text-accent-foreground",o&&!v&&"bg-yellow-50/40 hover:bg-yellow-100/40 dark:bg-yellow-900/10 dark:hover:bg-yellow-900/20",l?"rounded-xl px-3 py-2.5":"rounded-lg px-3 py-2"),onClick:w?void 0:()=>g(t,e.name),children:[v&&i.jsx("span",{"aria-hidden":!0,className:"absolute left-0 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-r bg-primary"}),!v&&!w&&i.jsx("span",{"aria-hidden":!0,className:"session-item-accent"}),i.jsxs("div",{className:"flex w-full min-w-0 items-start gap-2 pr-6",children:[i.jsx("div",{className:xe("mt-0.5 flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-md",v?"bg-primary/10":"bg-muted/50 group-hover/item:bg-muted/80"),children:i.jsx(dr,{provider:C,className:"h-3 w-3"})}),i.jsx("div",{className:"min-w-0 flex-1",children:w?i.jsx("div",{className:"flex items-center gap-1",children:S}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[o&&i.jsx("span",{className:"flex-shrink-0 text-yellow-500","aria-hidden":!0,children:"★"}),i.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:y.sessionName})]}),R]})})]})]}),!w&&i.jsx("div",{className:"absolute right-1.5 top-1/2 -translate-y-1/2",onClick:z=>z.stopPropagation(),children:i.jsx(Tk,{isStarred:o,canDelete:!y.isCursorSession,onRename:_,onToggleStar:I,onDelete:T,t:x,className:"opacity-0 focus-visible:opacity-100 group-hover/item:opacity-100"})})]});return i.jsxs("div",{className:"group relative",children:[F,B]})}const n9=e=>e==="claude-code"?"claude":e==="codex"?"codex":e==="gemini"?"gemini":e==="qwen"?"qwen":e==="opencode"?"opencode":null;function a9(){return i.jsx(i.Fragment,{children:Array.from({length:3}).map((e,t)=>i.jsx("div",{className:"rounded-md p-2",children:i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("div",{className:"mt-0.5 h-3 w-3 animate-pulse rounded-full bg-muted"}),i.jsxs("div",{className:"flex-1 space-y-1",children:[i.jsx("div",{className:"h-3 animate-pulse rounded bg-muted",style:{width:`${60+t*15}%`}}),i.jsx("div",{className:"h-2 w-1/2 animate-pulse rounded bg-muted"})]})]})},t))})}function i9({project:e,isExpanded:t,sessions:r,selectedSession:n,initialSessionsLoaded:a,isLoadingSessions:s,currentTime:o,editingSession:l,editingSessionName:c,isSessionStarred:d,onEditingSessionNameChange:u,onStartEditingSession:p,onCancelEditingSession:f,onSaveEditingSession:h,onToggleStarSession:g,onProjectSelect:b,onSessionSelect:x,onDeleteSession:y,onLoadMoreSessions:v,onNewSession:w,onOpenOrchestration:C,t:k}){const[N,j]=m.useState([]);if(m.useEffect(()=>{if(!t)return;let T=!1;const _=async()=>{const R=await Se(`/api/orchestration/workflows/runs?projectId=${encodeURIComponent(e.name)}`);if(!R.ok)return;const S=await R.json();T||j((S.runs??[]).slice(0,5))};_();const I=window.setInterval(()=>{_()},15e3);return()=>{T=!0,window.clearInterval(I)}},[t,e.name]),!t)return null;const A=r.length>0,E=e.sessionMeta?.hasMore===!0;return i.jsxs("div",{className:"ml-3 space-y-1 border-l border-border pl-3",children:[i.jsx("div",{className:"px-3 pb-1 pt-1 md:hidden",children:i.jsxs("button",{className:"flex h-8 w-full items-center justify-center gap-2 rounded-md bg-primary text-xs font-medium text-primary-foreground transition-all duration-150 hover:bg-primary/90 active:scale-[0.98]",onClick:()=>{b(e),w(e)},children:[i.jsx(Zt,{className:"h-3 w-3"}),k("sessions.newSession")]})}),i.jsxs(Ne,{variant:"default",size:"sm",className:"hidden h-8 w-full justify-start gap-2 bg-primary text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 md:flex",onClick:()=>w(e),children:[i.jsx(Zt,{className:"h-3 w-3"}),k("sessions.newSession")]}),N.length>0&&i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-1 px-3 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[i.jsx(_r,{className:"h-3 w-3"}),k("orchestration.section")]}),N.map(T=>{const _=[...new Set(T.nodeRuns.map(I=>n9(I.adapterId)).filter(Boolean))];return i.jsx("button",{type:"button",onClick:()=>C?.(e,T.id),className:"w-full rounded-lg px-3 py-2 text-left transition-colors hover:bg-accent/60",children:i.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[i.jsx(_r,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-primary"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-xs font-medium text-foreground",children:T.input||k("orchestration.fallbackTitle")}),i.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[_.slice(0,4).map(I=>i.jsx("span",{className:"flex h-4 w-4 items-center justify-center rounded bg-muted",children:i.jsx(dr,{provider:I,className:"h-3 w-3"})},I)),i.jsx("span",{className:"text-[10px] text-muted-foreground",children:k(`common:orchestration.status.${T.status}`,{defaultValue:T.status})})]})]})]})},T.id)})]}),a?!A&&!s?i.jsx("div",{className:"px-3 py-2 text-left",children:i.jsx("p",{className:"text-xs text-muted-foreground",children:k("sessions.noSessions")})}):r.map(T=>i.jsx(UE,{project:e,session:T,selectedSession:n,currentTime:o,editingSession:l,editingSessionName:c,isStarred:d(e.name,T.id),onEditingSessionNameChange:u,onStartEditingSession:p,onCancelEditingSession:f,onSaveEditingSession:h,onToggleStarSession:g,onProjectSelect:b,onSessionSelect:x,onDeleteSession:y,t:k},T.id)):i.jsx(a9,{}),A&&E&&i.jsx(Ne,{variant:"ghost",size:"sm",className:"mt-2 w-full justify-center gap-2 text-muted-foreground",onClick:()=>v(e),disabled:s,children:s?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-3 w-3 animate-spin rounded-full border border-muted-foreground border-t-transparent"}),k("sessions.loading")]}):i.jsxs(i.Fragment,{children:[i.jsx(Pn,{className:"h-3 w-3"}),k("sessions.showMore")]})})]})}const s9=(e,t)=>{const r=e.length;return t&&r>=5?`${r}+`:`${r}`};function o9({project:e,selectedProject:t,selectedSession:r,isExpanded:n,isDeleting:a,isStarred:s,editingProject:o,editingName:l,sessions:c,initialSessionsLoaded:d,isLoadingSessions:u,currentTime:p,editingSession:f,editingSessionName:h,isSessionStarred:g,onEditingNameChange:b,onToggleProject:x,onProjectSelect:y,onToggleStarProject:v,onToggleStarSession:w,onStartEditingProject:C,onCancelEditingProject:k,onSaveProjectName:N,onDeleteProject:j,onSessionSelect:A,onDeleteSession:E,onLoadMoreSessions:T,onNewSession:_,onOpenOrchestration:I,onEditingSessionNameChange:R,onStartEditingSession:S,onCancelEditingSession:F,onSaveEditingSession:B,t:z}){const q=t?.name===e.name,V=o===e.name,P=e.sessionMeta?.hasMore===!0,U=s9(c,P),H=`${U} session${c.length===1?"":"s"}`,M=()=>x(e.name),ee=()=>v(e.name),Q=()=>{N(e.name)},ge=()=>{t?.name!==e.name&&y(e),M()};return i.jsxs("div",{className:xe("md:space-y-1",a&&"opacity-50 pointer-events-none"),children:[i.jsxs("div",{className:"md:group group",children:[i.jsx("div",{className:"md:hidden",children:i.jsx("div",{className:xe("p-3 mx-3 my-1 rounded-lg bg-card border border-border/50 active:scale-[0.98] transition-all duration-150",q&&"bg-primary/5 border-primary/20",s&&!q&&"bg-yellow-50/50 dark:bg-yellow-900/5 border-yellow-200/30 dark:border-yellow-800/30"),onClick:M,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[i.jsx("div",{className:xe("w-8 h-8 rounded-lg flex items-center justify-center transition-colors",n?"bg-primary/10":"bg-muted"),children:n?i.jsx(On,{className:"h-4 w-4 text-primary"}):i.jsx($r,{className:"h-4 w-4 text-muted-foreground"})}),i.jsx("div",{className:"min-w-0 flex-1",children:V?i.jsx("input",{type:"text",value:l,onChange:se=>b(se.target.value),className:"w-full rounded-lg border-2 border-primary/40 bg-background px-3 py-2 text-sm text-foreground shadow-sm transition-all duration-200 focus:border-primary focus:shadow-md focus:outline-none",placeholder:z("projects.projectNamePlaceholder"),autoFocus:!0,autoComplete:"off",onClick:se=>se.stopPropagation(),onKeyDown:se=>{se.key==="Enter"&&Q(),se.key==="Escape"&&k()},style:{fontSize:"16px",WebkitAppearance:"none",borderRadius:"8px"}}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex min-w-0 flex-1 items-center justify-between",children:i.jsx("h3",{className:"truncate text-sm font-medium text-foreground",children:e.displayName})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:H})]})})]}),i.jsx("div",{className:"flex items-center gap-1",children:V?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-green-500 shadow-sm transition-all duration-150 active:scale-90 active:shadow-none dark:bg-green-600",onClick:se=>{se.stopPropagation(),Q()},children:i.jsx(tr,{className:"h-4 w-4 text-white"})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-gray-500 shadow-sm transition-all duration-150 active:scale-90 active:shadow-none dark:bg-gray-600",onClick:se=>{se.stopPropagation(),k()},children:i.jsx(At,{className:"h-4 w-4 text-white"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:xe("w-8 h-8 rounded-lg flex items-center justify-center active:scale-90 transition-all duration-150 border",s?"bg-yellow-500/10 dark:bg-yellow-900/30 border-yellow-200 dark:border-yellow-800":"bg-gray-500/10 dark:bg-gray-900/30 border-gray-200 dark:border-gray-800"),onClick:se=>{se.stopPropagation(),ee()},title:z(s?"tooltips.removeFromFavorites":"tooltips.addToFavorites"),children:i.jsx(yi,{className:xe("w-4 h-4 transition-colors",s?"text-yellow-600 dark:text-yellow-400 fill-current":"text-gray-600 dark:text-gray-400")})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg border border-red-200 bg-red-500/10 active:scale-90 dark:border-red-800 dark:bg-red-900/30",onClick:se=>{se.stopPropagation(),j(e)},children:i.jsx(Pr,{className:"h-4 w-4 text-red-600 dark:text-red-400"})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg border border-primary/20 bg-primary/10 active:scale-90 dark:border-primary/30 dark:bg-primary/20",onClick:se=>{se.stopPropagation(),C(e)},children:i.jsx(Bh,{className:"h-4 w-4 text-primary"})}),i.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-muted/30",children:n?i.jsx(Pn,{className:"h-3 w-3 text-muted-foreground"}):i.jsx(Dn,{className:"h-3 w-3 text-muted-foreground"})})]})})]})})}),i.jsxs(Ne,{variant:"ghost",className:xe("hidden md:flex w-full justify-between p-2 h-auto font-normal hover:bg-accent/50",q&&"bg-accent text-accent-foreground",s&&!q&&"bg-yellow-50/50 dark:bg-yellow-900/10 hover:bg-yellow-100/50 dark:hover:bg-yellow-900/20"),onClick:ge,children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[n?i.jsx(On,{className:"h-4 w-4 flex-shrink-0 text-primary"}):i.jsx($r,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"}),i.jsx("div",{className:"min-w-0 flex-1 text-left",children:V?i.jsxs("div",{className:"space-y-1",children:[i.jsx("input",{type:"text",value:l,onChange:se=>b(se.target.value),className:"w-full rounded border border-border bg-background px-2 py-1 text-sm text-foreground focus:ring-2 focus:ring-primary/20",placeholder:z("projects.projectNamePlaceholder"),autoFocus:!0,onKeyDown:se=>{se.key==="Enter"&&Q(),se.key==="Escape"&&k()}}),i.jsx("div",{className:"truncate text-xs text-muted-foreground",title:e.fullPath,children:e.fullPath})]}):i.jsxs("div",{children:[i.jsx("div",{className:"truncate text-sm font-semibold text-foreground",title:e.displayName,children:e.displayName}),i.jsxs("div",{className:"text-xs text-muted-foreground",children:[U,e.fullPath!==e.displayName&&i.jsxs("span",{className:"ml-1 opacity-60",title:e.fullPath,children:[" - ",e.fullPath.length>25?`...${e.fullPath.slice(-22)}`:e.fullPath]})]})]})})]}),i.jsx("div",{className:"flex flex-shrink-0 items-center gap-1",children:V?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded text-green-600 transition-colors hover:bg-green-50 hover:text-green-700 dark:hover:bg-green-900/20",onClick:se=>{se.stopPropagation(),Q()},children:i.jsx(tr,{className:"h-3 w-3"})}),i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 dark:hover:bg-gray-800",onClick:se=>{se.stopPropagation(),k()},children:i.jsx(At,{className:"h-3 w-3"})})]}):i.jsxs(i.Fragment,{children:[s&&i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded hover:bg-yellow-50 dark:hover:bg-yellow-900/20",onClick:se=>{se.stopPropagation(),ee()},title:z("tooltips.removeFromFavorites"),children:i.jsx(yi,{className:"h-3 w-3 fill-current text-yellow-600 dark:text-yellow-400"})}),i.jsx(BE,{triggerLabel:z("tooltips.projectActions",{defaultValue:"Project actions"}),actions:[{id:"rename",label:z("actions.rename"),icon:Bh,onClick:()=>C(e)},{id:"star",label:z(s?"tooltips.removeFromFavorites":"tooltips.addToFavorites"),icon:yi,onClick:ee},{id:"delete",label:z("actions.delete",{defaultValue:"Delete"}),icon:Pr,onClick:()=>j(e),danger:!0}]}),n?i.jsx(Pn,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"}):i.jsx(Dn,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})]})})]})]}),i.jsx(i9,{project:e,isExpanded:n,sessions:c,selectedSession:r,initialSessionsLoaded:d,isLoadingSessions:u,currentTime:p,editingSession:f,editingSessionName:h,isSessionStarred:g,onEditingSessionNameChange:R,onStartEditingSession:S,onCancelEditingSession:F,onSaveEditingSession:B,onToggleStarSession:w,onProjectSelect:y,onSessionSelect:A,onDeleteSession:E,onLoadMoreSessions:T,onNewSession:_,onOpenOrchestration:I,t:z})]})}function $E({isLoading:e,loadingProgress:t,projectsCount:r,filteredProjectsCount:n,t:a}){return e?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.loadingProjects")}),t&&t.total>0?i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:i.jsx("div",{className:"h-full bg-primary transition-all duration-300 ease-out",style:{width:`${t.current/t.total*100}%`}})}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.current,"/",t.total," ",a("projects.projects")]}),t.currentProject&&i.jsx("p",{className:"mx-auto max-w-[200px] truncate text-xs text-muted-foreground/70",title:t.currentProject,children:t.currentProject.split("-").slice(-2).join("/")})]}):i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.fetchingProjects")})]}):r===0?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx($r,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.noProjects")}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.runClaudeCli")})]}):n===0?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx(ps,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.noMatchingProjects")}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.tryDifferentSearch")})]}):null}function l9({projects:e,filteredProjects:t,selectedProject:r,selectedSession:n,isLoading:a,loadingProgress:s,expandedProjects:o,editingProject:l,editingName:c,loadingSessions:d,initialSessionsLoaded:u,currentTime:p,editingSession:f,editingSessionName:h,deletingProjects:g,getProjectSessions:b,isProjectStarred:x,isSessionStarred:y,onEditingNameChange:v,onToggleProject:w,onProjectSelect:C,onToggleStarProject:k,onToggleStarSession:N,onStartEditingProject:j,onCancelEditingProject:A,onSaveProjectName:E,onDeleteProject:T,onSessionSelect:_,onDeleteSession:I,onLoadMoreSessions:R,onNewSession:S,onOpenOrchestration:F,onEditingSessionNameChange:B,onStartEditingSession:z,onCancelEditingSession:q,onSaveEditingSession:V,t:P}){const U=i.jsx($E,{isLoading:a,loadingProgress:s,projectsCount:e.length,filteredProjectsCount:t.length,t:P});m.useEffect(()=>{let se="Pixcode";const ce=r?.displayName?.trim();ce&&(se=`${ce} - ${se}`),document.title=se},[r]);const H=!a&&e.length>0&&t.length>0,M=se=>se.source==="history"||se.autoDiscovered===!0&&se.isManuallyAdded!==!0,ee=t.filter(se=>!M(se)),Q=t.filter(se=>M(se)),ge=se=>i.jsx(o9,{project:se,selectedProject:r,selectedSession:n,isExpanded:o.has(se.name),isDeleting:g.has(se.name),isStarred:x(se.name),editingProject:l,editingName:c,sessions:b(se),initialSessionsLoaded:u.has(se.name),isLoadingSessions:!!d[se.name],currentTime:p,editingSession:f,editingSessionName:h,isSessionStarred:y,onEditingNameChange:v,onToggleProject:w,onProjectSelect:C,onToggleStarProject:k,onToggleStarSession:N,onStartEditingProject:j,onCancelEditingProject:A,onSaveProjectName:E,onDeleteProject:T,onSessionSelect:_,onDeleteSession:I,onLoadMoreSessions:R,onNewSession:S,onOpenOrchestration:F,onEditingSessionNameChange:B,onStartEditingSession:z,onCancelEditingSession:q,onSaveEditingSession:V,t:P},se.name);return i.jsx("div",{className:"pb-safe-area-inset-bottom md:space-y-1",children:H?i.jsxs(i.Fragment,{children:[ee.map(se=>ge(se)),Q.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"px-3 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:P("projects.detectedFromHistory")}),Q.map(se=>ge(se))]})]}):U})}function Ra(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HE(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}/*!
|
|
221
221
|
* GSAP 3.15.0
|
|
222
222
|
* https://gsap.com
|
|
223
223
|
*
|
|
@@ -797,7 +797,7 @@ Build and smoke checks pass`}),[N,j]=m.useState(""),[A,E]=m.useState({title:"",n
|
|
|
797
797
|
`),N+="</div>",N+="</div>",p.innerHTML=N,g){const T=p.querySelector(".cm-diff-nav-prev"),_=p.querySelector(".cm-diff-nav-next");T?.addEventListener("click",()=>{if(x.length===0)return;f=f>0?f-1:x.length-1;const I=x[f];I&&u.dispatch({effects:Zn.scrollIntoView(I.fromB,{y:"center"})}),h()}),_?.addEventListener("click",()=>{if(x.length===0)return;f=f<x.length-1?f+1:0;const I=x[f];I&&u.dispatch({effects:Zn.scrollIntoView(I.fromB,{y:"center"})}),h()})}p.querySelector(".cm-toggle-diff-btn")?.addEventListener("click",a),p.querySelector(".cm-popout-btn")?.addEventListener("click",()=>{s?.()}),p.querySelector(".cm-expand-btn")?.addEventListener("click",()=>{o?.()})};return h(),{top:!0,dom:p,update:h}};return[VI.of(d)]};function vae({content:e,linesLabel:t,charactersLabel:r,shortcutsLabel:n}){return i.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-t border-border bg-muted px-3 py-1.5",children:[i.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-600 dark:text-gray-400",children:[i.jsxs("span",{children:[t," ",e.split(`
|
|
798
798
|
`).length]}),i.jsxs("span",{children:[r," ",e.length]})]}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:n})]})}function wae({file:e,isSidebar:t,isFullscreen:r,isMarkdownFile:n,markdownPreview:a,saving:s,saveSuccess:o,onToggleMarkdownPreview:l,onOpenSettings:c,onDownload:d,onSave:u,onToggleFullscreen:p,onClose:f,labels:h}){const g=o?h.saved:s?h.saving:h.save;return i.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[i.jsx("div",{className:"flex min-w-0 flex-1 shrink items-center gap-2",children:i.jsxs("div",{className:"min-w-0 shrink",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx("h3",{className:"truncate text-sm font-medium text-gray-900 dark:text-white",children:e.name}),e.diffInfo&&i.jsx("span",{className:"shrink-0 whitespace-nowrap rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-600 dark:bg-blue-900 dark:text-blue-300",children:h.showingChanges})]}),i.jsx("p",{className:"truncate text-xs text-gray-500 dark:text-gray-400",children:e.path})]})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[n&&i.jsx("button",{type:"button",onClick:l,className:`flex items-center justify-center rounded-md p-1.5 transition-colors ${a?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400":"text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white"}`,title:a?h.editMarkdown:h.previewMarkdown,children:a?i.jsx(as,{className:"h-4 w-4"}):i.jsx(gc,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:c,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:h.settings,children:i.jsx(Ut,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:d,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:h.download,children:i.jsx(Xn,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:u,disabled:s,className:`flex items-center justify-center rounded-md p-1.5 transition-colors disabled:opacity-50 ${o?"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400":"text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white"}`,title:g,children:o?i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):i.jsx(SD,{className:"h-4 w-4"})}),!t&&i.jsx("button",{type:"button",onClick:p,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:r?h.exitFullscreen:h.fullscreen,children:r?i.jsx(SN,{className:"h-4 w-4"}):i.jsx(mc,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:f,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:h.close,children:i.jsx(At,{className:"h-4 w-4"})})]})]})}function kae({isDarkMode:e,isSidebar:t,loadingText:r}){return i.jsxs(i.Fragment,{children:[i.jsx("style",{children:fae(e)}),t?i.jsx("div",{className:"flex h-full w-full items-center justify-center bg-background",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-b-2 border-blue-600"}),i.jsx("span",{className:"text-gray-900 dark:text-white",children:r})]})}):i.jsx("div",{className:"fixed inset-0 z-[9999] md:flex md:items-center md:justify-center md:bg-black/50",children:i.jsx("div",{className:"code-editor-loading flex h-full w-full items-center justify-center p-8 md:h-auto md:w-auto md:rounded-lg",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-b-2 border-blue-600"}),i.jsx("span",{className:"text-gray-900 dark:text-white",children:r})]})})})]})}function Sae({inline:e,className:t,children:r,node:n,...a}){const[s,o]=m.useState(!1),l=Array.isArray(r)?r.join(""):String(r??""),c=/[\r\n]/.test(l);if(e||!c)return i.jsx("code",{className:`whitespace-pre-wrap break-words rounded-md border border-gray-200 bg-gray-100 px-1.5 py-0.5 font-mono text-[0.9em] text-gray-900 dark:border-gray-700 dark:bg-gray-800/60 dark:text-gray-100 ${t||""}`,...a,children:r});const u=/language-(\w+)/.exec(t||""),p=u?u[1]:"text";return i.jsxs("div",{className:"group relative my-2",children:[p!=="text"&&i.jsx("div",{className:"absolute left-3 top-2 z-10 text-xs font-medium uppercase text-gray-400",children:p}),i.jsx("button",{type:"button",onClick:()=>ia(l).then(f=>{f&&(o(!0),setTimeout(()=>o(!1),2e3))}),className:"absolute right-2 top-2 z-10 rounded-md border border-gray-600 bg-gray-700/80 px-2 py-1 text-xs text-white opacity-0 transition-opacity hover:bg-gray-700 group-hover:opacity-100",children:s?"Copied!":"Copy"}),i.jsx(ew,{language:p,style:l6,customStyle:{margin:0,borderRadius:"0.5rem",fontSize:"0.875rem",padding:p!=="text"?"2rem 1rem 1rem 1rem":"1rem"},children:l})]})}const Cae={code:Sae,blockquote:({children:e})=>i.jsx("blockquote",{className:"my-2 border-l-4 border-gray-300 pl-4 italic text-gray-600 dark:border-gray-600 dark:text-gray-400",children:e}),a:({href:e,children:t})=>i.jsx("a",{href:e,className:"text-blue-600 hover:underline dark:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:t}),table:({children:e})=>i.jsx("div",{className:"my-2 overflow-x-auto",children:i.jsx("table",{className:"min-w-full border-collapse border border-gray-200 dark:border-gray-700",children:e})}),thead:({children:e})=>i.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800",children:e}),th:({children:e})=>i.jsx("th",{className:"border border-gray-200 px-3 py-2 text-left text-sm font-semibold dark:border-gray-700",children:e}),td:({children:e})=>i.jsx("td",{className:"border border-gray-200 px-3 py-2 align-top text-sm dark:border-gray-700",children:e})};function Nae({content:e}){const t=m.useMemo(()=>[VA,$j],[]),r=m.useMemo(()=>[Xj],[]);return i.jsx(vA,{remarkPlugins:t,rehypePlugins:r,components:Cae,children:e})}const Eae=m.lazy(async()=>({default:(await kQ(()=>import("./index-ak1p_4ew.js"),__vite__mapDeps([0,1]))).Editor})),Tae=Zn.theme({"&":{backgroundColor:"#ffffff",color:"#111827"},".cm-scroller":{backgroundColor:"#ffffff"},".cm-content":{caretColor:"#111827"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"#111827"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#bfdbfe"},".cm-gutters":{backgroundColor:"#f8fafc",borderRightColor:"#e5e7eb",color:"#64748b"},".cm-activeLine":{backgroundColor:"#f8fafc"},".cm-activeLineGutter":{backgroundColor:"#eef2ff"},".cm-panels":{backgroundColor:"#ffffff",color:"#111827"},".cm-panels.cm-panels-top":{borderBottomColor:"#e5e7eb"}},{dark:!1});function Aae(e){const t=e.toLowerCase();if(t===".env"||t.startsWith(".env."))return"ini";switch(t.split(".").pop()){case"js":case"jsx":return"javascript";case"ts":case"tsx":return"typescript";case"py":return"python";case"html":case"htm":return"html";case"css":case"scss":case"less":return"css";case"json":return"json";case"md":case"markdown":return"markdown";default:return"plaintext"}}function jae(e,t){return`file:///${(e||t).replace(/\\/g,"/").replace(/^\/+/,"").split("/").filter(Boolean).map(a=>encodeURIComponent(a)).join("/")||encodeURIComponent(t)}`}function Iae({content:e,onChange:t,onSave:r,markdownPreview:n,isMarkdownFile:a,isDarkMode:s,fontSize:o,showLineNumbers:l,wordWrap:c,extensions:d,fileName:u,filePath:p,useMonacoEditor:f}){const h=m.useRef(r);m.useEffect(()=>{h.current=r},[r]);const g=m.useCallback((x,y)=>{const{KeyCode:v,KeyMod:w}=y;x.addCommand(w.CtrlCmd|v.KeyS,()=>{h.current()}),x.focus()},[]),b=m.useMemo(()=>({automaticLayout:!0,contextmenu:!0,copyWithSyntaxHighlighting:!0,cursorBlinking:"blink",folding:!0,fontLigatures:!1,fontSize:o,glyphMargin:!1,lineNumbers:l?"on":"off",minimap:{enabled:!1},mouseWheelZoom:!0,multiCursorModifier:"alt",renderLineHighlight:"all",roundedSelection:!1,scrollBeyondLastLine:!1,selectOnLineNumbers:!0,selectionClipboard:!0,tabCompletion:"on",wordWrap:c?"on":"off"}),[o,l,c]);return n&&a?i.jsx("div",{className:"h-full overflow-y-auto bg-white dark:bg-gray-900",children:i.jsx("div",{className:"prose prose-sm mx-auto max-w-none px-8 py-6 dark:prose-invert prose-headings:font-semibold prose-a:text-blue-600 prose-code:text-sm prose-pre:bg-gray-900 prose-img:rounded-lg dark:prose-a:text-blue-400",children:i.jsx(Nae,{content:e})})}):f?i.jsx("div",{className:"h-full min-h-0 w-full overflow-hidden",children:i.jsx(m.Suspense,{fallback:null,children:i.jsx(Eae,{value:e,onChange:x=>t(x??""),language:Aae(u),path:jae(p,u),theme:s?"vs-dark":"light",height:"100%",width:"100%",options:b,onMount:g,loading:null})})}):i.jsx(LC,{value:e,onChange:t,extensions:d,theme:s?PC:Tae,height:"100%",style:{fontSize:`${o}px`,height:"100%"},basicSetup:{lineNumbers:l,foldGutter:!0,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,highlightSelectionMatches:!0,searchKeymap:!0}})}function _ae({file:e,isSidebar:t,isFullscreen:r,onClose:n,onToggleFullscreen:a,title:s,message:o}){const l=i.jsx("div",{className:"flex h-full w-full flex-col items-center justify-center bg-background p-8 text-muted-foreground",children:i.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:i.jsx("svg",{className:"h-8 w-8 text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-lg font-medium text-foreground",children:s}),i.jsx("p",{className:"text-sm text-muted-foreground",children:o})]}),i.jsx("button",{onClick:n,className:"mt-4 rounded-md bg-primary px-4 py-2 text-sm text-primary-foreground transition-colors hover:bg-primary/90",children:"Close"})]})});if(t)return i.jsxs("div",{className:"flex h-full w-full flex-col bg-background",children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border px-3 py-1.5",children:[i.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:i.jsx("h3",{className:"truncate text-sm font-medium text-gray-900 dark:text-white",children:e.name})}),i.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:"Close",children:i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),l]});const c=r?"fixed inset-0 z-[9999] bg-background flex flex-col":"fixed inset-0 z-[9999] md:bg-black/50 md:flex md:items-center md:justify-center md:p-4",d=r?"bg-background flex flex-col w-full h-full":"bg-background shadow-2xl flex flex-col w-full h-full md:rounded-lg md:shadow-2xl md:w-full md:max-w-2xl md:h-auto md:max-h-[60vh]";return i.jsx("div",{className:c,children:i.jsxs("div",{className:d,children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border px-3 py-1.5",children:[i.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:i.jsx("h3",{className:"truncate text-sm font-medium text-gray-900 dark:text-white",children:e.name})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[i.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:r?"Exit fullscreen":"Fullscreen",children:r?i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 9V4.5M9 9H4.5M9 9L3.5 3.5M9 15v4.5M9 15H4.5M9 15l-5.5 5.5M15 9h4.5M15 9V4.5M15 9l5.5-5.5M15 15h4.5M15 15v4.5m0-4.5l5.5 5.5"})}):i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})})}),i.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:"Close",children:i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),l]})})}function Ul({file:e,onClose:t,projectPath:r,isSidebar:n=!1,isExpanded:a=!1,onToggleExpand:s=null,onPopOut:o=null}){const{t:l}=Be("codeEditor"),[c,d]=m.useState(!1),[u,p]=m.useState(!!e.diffInfo),[f,h]=m.useState(!1),{isDarkMode:g,wordWrap:b,minimapEnabled:x,showLineNumbers:y,fontSize:v}=Xne(),{content:w,setContent:C,loading:k,saving:N,saveSuccess:j,saveError:A,isBinary:E,handleSave:T,handleDownload:_}=Yne({file:e,projectPath:r}),I=m.useMemo(()=>{const P=e.name.split(".").pop()?.toLowerCase();return P==="md"||P==="markdown"},[e.name]),R=m.useMemo(()=>mae({file:e,showDiff:u,minimapEnabled:x,isDarkMode:g}),[e,g,x,u]),S=m.useMemo(()=>hae({file:e,showDiff:u}),[e,u]),F=m.useMemo(()=>yae({file:e,showDiff:u,isSidebar:n,isExpanded:a,onToggleDiff:()=>p(P=>!P),onPopOut:o,onToggleExpand:s,labels:{changes:l("toolbar.changes"),previousChange:l("toolbar.previousChange"),nextChange:l("toolbar.nextChange"),hideDiff:l("toolbar.hideDiff"),showDiff:l("toolbar.showDiff"),collapse:l("toolbar.collapse"),expand:l("toolbar.expand")}}),[e,a,n,o,s,u,l]),B=m.useMemo(()=>{const P=[...pae(e.name),...F];return e.diffInfo&&u&&e.diffInfo.old_string!==void 0&&(P.push(Fne({original:e.diffInfo.old_string,mergeControls:!1,highlightChanges:!0,syntaxHighlightDeletions:!1,gutter:!0})),P.push(...R),P.push(...S)),b&&P.push(Zn.lineWrapping),P},[e.diffInfo,e.name,R,S,u,F,b]),z=!(e.diffInfo&&e.diffInfo.old_string!==void 0);if(Jne({onSave:T,onClose:t,dependency:w}),k)return i.jsx(kae,{isDarkMode:g,isSidebar:n,loadingText:l("loading",{fileName:e.name})});if(E)return i.jsx(_ae,{file:e,isSidebar:n,isFullscreen:c,onClose:t,onToggleFullscreen:()=>d(P=>!P),title:l("binaryFile.title","Binary File"),message:l("binaryFile.message",'The file "{{fileName}}" cannot be displayed in the text editor because it is a binary file.',{fileName:e.name})});const q=n?"w-full h-full flex flex-col":`fixed inset-0 z-[9999] md:bg-black/50 md:flex md:items-center md:justify-center md:p-4 ${c?"md:p-0":""}`,V=n?"bg-background flex flex-col w-full h-full":`bg-background shadow-2xl flex flex-col w-full h-full md:rounded-lg md:shadow-2xl${c?" md:w-full md:h-full md:rounded-none":" md:w-full md:max-w-6xl md:h-[80vh] md:max-h-[80vh]"}`;return i.jsxs(i.Fragment,{children:[i.jsx("style",{children:gae(g)}),i.jsx("div",{className:q,children:i.jsxs("div",{className:V,children:[i.jsx(wae,{file:e,isSidebar:n,isFullscreen:c,isMarkdownFile:I,markdownPreview:f,saving:N,saveSuccess:j,onToggleMarkdownPreview:()=>h(P=>!P),onOpenSettings:()=>window.openSettings?.("appearance"),onDownload:_,onSave:T,onToggleFullscreen:()=>d(P=>!P),onClose:t,labels:{showingChanges:l("header.showingChanges"),editMarkdown:l("actions.editMarkdown"),previewMarkdown:l("actions.previewMarkdown"),settings:l("toolbar.settings"),download:l("actions.download"),save:l("actions.save"),saving:l("actions.saving"),saved:l("actions.saved"),fullscreen:l("actions.fullscreen"),exitFullscreen:l("actions.exitFullscreen"),close:l("actions.close")}}),A&&i.jsx("div",{className:"border-b border-red-200 bg-red-50 px-3 py-1.5 text-xs text-red-700 dark:border-red-900/40 dark:bg-red-900/20 dark:text-red-300",children:A}),i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx(Iae,{content:w,onChange:C,onSave:T,markdownPreview:f,isMarkdownFile:I,isDarkMode:g,fontSize:v,showLineNumbers:y,wordWrap:b,extensions:B,fileName:e.name,filePath:e.path,useMonacoEditor:z})}),i.jsx(vae,{content:w,linesLabel:l("footer.lines"),charactersLabel:l("footer.characters"),shortcutsLabel:l("footer.shortcuts")})]})})]})}const Rae=200,Ah=280;function bC({editingFile:e,isMobile:t,editorExpanded:r,editorWidth:n,hasManualWidth:a,resizeHandleRef:s,onResizeStart:o,onCloseEditor:l,onToggleEditorExpand:c,projectPath:d,fillSpace:u}){const[p,f]=m.useState(!1),h=m.useRef(null),[g,b]=m.useState(n);if(m.useEffect(()=>{if(!e||t||p)return;const y=()=>{if(!h.current)return;const C=h.current.parentElement;if(!C)return;const N=C.clientWidth-Rae;N<Ah?f(!0):n>N?b(N):b(n)};y(),window.addEventListener("resize",y);const v=new ResizeObserver(y),w=h.current?.parentElement;return w&&v.observe(w),()=>{window.removeEventListener("resize",y),v.disconnect()}},[e,t,p,n]),!e)return null;if(t||p)return i.jsx(Ul,{file:e,onClose:()=>{f(!1),l()},projectPath:d,isSidebar:!1});const x=r||u&&!a;return i.jsxs("div",{ref:h,className:`flex h-full min-w-0 flex-shrink-0 ${x?"flex-1":""}`,children:[!r&&i.jsx("div",{ref:s,onMouseDown:o,className:"group relative w-1 flex-shrink-0 cursor-col-resize bg-gray-200 transition-colors hover:bg-blue-500 dark:bg-gray-700 dark:hover:bg-blue-600",title:"Drag to resize",children:i.jsx("div",{className:"absolute inset-y-0 left-1/2 w-1 -translate-x-1/2 bg-blue-500 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-blue-600"})}),i.jsx("div",{className:`h-full overflow-hidden border-l border-gray-200 dark:border-gray-700 ${x?"min-w-0 flex-1":`min-w-[ flex-shrink-0${Ah}px]`}`,style:x?void 0:{width:`${g}px`,minWidth:`${Ah}px`},children:i.jsx(Ul,{file:e,onClose:l,projectPath:d,isSidebar:!0,isExpanded:r,onToggleExpand:c,onPopOut:()=>f(!0)})})]})}function Lae(e){const t=m.useRef(!1),r=m.useCallback(s=>{s&&(s.preventDefault(),s.stopPropagation()),e()},[e]),n=m.useCallback(s=>{t.current=!0,r(s),window.setTimeout(()=>{t.current=!1},350)},[r]);return{handleMobileMenuClick:m.useCallback(s=>{if(t.current){s.preventDefault(),s.stopPropagation();return}r(s)},[r]),handleMobileMenuTouchEnd:n}}function aI({onMenuClick:e,compact:t=!1}){const{handleMobileMenuClick:r,handleMobileMenuTouchEnd:n}=Lae(e),a=t?"p-1.5 text-muted-foreground hover:text-foreground rounded-lg hover:bg-accent/60 pwa-menu-button":"p-1.5 text-muted-foreground hover:text-foreground rounded-lg hover:bg-accent/60 touch-manipulation active:scale-95 pwa-menu-button flex-shrink-0";return i.jsx("button",{onClick:r,onTouchEnd:n,className:a,"aria-label":"Open menu",children:i.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}const Pae=[{kind:"builtin",id:"chat",labelKey:"tabs.chat",icon:Mn},{kind:"builtin",id:"orchestration",labelKey:"tabs.orchestration",icon:_r},{kind:"builtin",id:"remote",labelKey:"tabs.remote",icon:xc},{kind:"builtin",id:"shell",labelKey:"tabs.shell",icon:Xr},{kind:"builtin",id:"files",labelKey:"tabs.files",icon:$r},{kind:"builtin",id:"git",labelKey:"tabs.git",icon:Hr},{kind:"builtin",id:"changes",labelKey:"tabs.changes",icon:ra},{kind:"builtin",id:"liveView",labelKey:"tabs.liveView",icon:fn}],Dae=new Set(["files","shell","git","changes","liveView"]);function Oae({activeTab:e,setActiveTab:t,liveViewAvailable:r=!1,activeSidePanelTab:n,sidePanelMode:a="split",canUseSidePanelSplit:s=!0,isMobile:o=!1,onCloseSidePanel:l}){const{t:c}=Be(),{plugins:d}=Mu(),u=d.filter(f=>f.enabled).map(f=>({kind:"plugin",id:`plugin:${f.name}`,label:f.displayName,pluginName:f.name,iconFile:f.icon})),p=[...Pae,...u];return i.jsx(Bg,{children:p.map(f=>{const h=f.id===e,g=f.kind==="builtin"?c(f.labelKey):f.label,b=!!(!o&&s&&h&&n===f.id&&Dae.has(f.id)),x=a==="split",v=b?`${g} · ${x?"Split":"Full"} view`:g;return i.jsxs("div",{className:"relative inline-flex items-center",children:[i.jsx(nf,{content:v,position:"bottom",children:i.jsxs(Ug,{isActive:h,onClick:()=>t(f.id),className:b?"px-2 py-[5px] pr-7":"px-2.5 py-[5px]",children:[f.kind==="builtin"?i.jsx(f.icon,{className:"h-3.5 w-3.5"}):i.jsx(X3,{pluginName:f.pluginName,iconFile:f.iconFile,className:"flex h-3.5 w-3.5 items-center justify-center [&>svg]:h-full [&>svg]:w-full"}),i.jsx("span",{className:"hidden lg:inline",children:g}),f.id==="liveView"&&r&&i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.75)]","aria-hidden":"true"}),b&&i.jsx("span",{className:`ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded border ${x?"border-foreground/20 bg-foreground/5 text-foreground/70":"border-border bg-muted/60 text-muted-foreground"}`,"aria-hidden":"true",children:x?i.jsx(jg,{className:"h-3 w-3"}):i.jsx(mc,{className:"h-3 w-3"})})]})}),b&&l&&i.jsx(nf,{content:c("tabs.closeSidePanel","Close side panel"),position:"bottom",children:i.jsx("button",{type:"button",className:"absolute right-1 top-1/2 flex h-4 w-4 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onClick:w=>{w.stopPropagation(),l()},"aria-label":c("tabs.closeSidePanel","Close side panel"),title:c("tabs.closeSidePanel","Close side panel"),children:i.jsx(At,{className:"h-3 w-3"})})})]},f.id)})})}function Mae(e,t,r){return e.startsWith("plugin:")&&r?r:e==="files"?t("mainContent.projectFiles"):e==="orchestration"?t("tabs.orchestration"):e==="remote"?t("tabs.remote"):e==="controlRoom"?t("tabs.controlRoom"):e==="git"?t("tabs.git"):e==="changes"?t("tabs.changes"):e==="liveView"?t("tabs.liveView"):"Project"}function Fae(e){return e.__provider==="cursor"?e.name||"Untitled Session":e.summary||e.name||e.title||"New Session"}function zae({activeTab:e,selectedProject:t,selectedSession:r}){const{t:n}=Be(),{plugins:a}=Mu(),s=e.startsWith("plugin:")?a.find(d=>d.name===e.replace("plugin:",""))?.displayName:void 0,o=e==="chat"&&!!r,l=e==="chat"&&!r,c=t?.displayName||"Server";return i.jsxs("div",{className:"scrollbar-hide flex min-w-0 flex-1 items-center gap-2 overflow-x-auto",children:[o&&i.jsx("div",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center",children:i.jsx(dr,{provider:r?.__provider,className:"h-4 w-4"})}),i.jsx("div",{className:"min-w-0 flex-1",children:e==="chat"&&r?i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"scrollbar-hide overflow-x-auto whitespace-nowrap text-sm font-semibold leading-tight text-foreground",children:Fae(r)}),i.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:c})]}):l?i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-base font-semibold leading-tight text-foreground",children:n("mainContent.newSession")}),i.jsx("div",{className:"truncate text-xs leading-tight text-muted-foreground",children:c})]}):i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold leading-tight text-foreground",children:Mae(e,n,s)}),i.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:c})]})})]})}function xC({activeTab:e,setActiveTab:t,selectedProject:r,selectedSession:n,liveViewAvailable:a,activeSidePanelTab:s,sidePanelMode:o,canUseSidePanelSplit:l,isMobile:c,onMenuClick:d,onCloseSidePanel:u}){const p=m.useRef(null),[f,h]=m.useState(!1),[g,b]=m.useState(!1),x=m.useCallback(()=>{const y=p.current;y&&(h(y.scrollLeft>2),b(y.scrollLeft<y.scrollWidth-y.clientWidth-2))},[]);return m.useEffect(()=>{const y=p.current;if(!y)return;x();const v=new ResizeObserver(x);return v.observe(y),()=>v.disconnect()},[x]),i.jsx("div",{className:"pwa-header-safe flex-shrink-0 border-b border-border/60 bg-background px-3 py-1.5 sm:px-4 sm:py-2",children:i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c&&i.jsx(aI,{onMenuClick:d}),i.jsx(zae,{activeTab:e,selectedProject:r,selectedSession:n})]}),e!=="controlRoom"&&i.jsxs("div",{className:"relative min-w-0 flex-shrink overflow-hidden sm:flex-shrink-0",children:[f&&i.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-10 w-6 bg-gradient-to-r from-background to-transparent"}),i.jsxs("div",{className:"relative min-w-0 overflow-hidden",children:[i.jsx("div",{ref:p,onScroll:x,className:"scrollbar-hide overflow-x-auto",children:i.jsx(Oae,{activeTab:e,setActiveTab:t,liveViewAvailable:a,activeSidePanelTab:s,sidePanelMode:o,canUseSidePanelSplit:l,isMobile:c,onCloseSidePanel:u})}),g&&i.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 z-10 w-6 bg-gradient-to-l from-background to-transparent"})]})]})]})})}function mg({mode:e,isMobile:t,onMenuClick:r,onQuickStartSession:n,onQuickStartOrchestration:a,onOpenControlRoom:s}){const{t:o}=Be(),l=e==="loading";return i.jsxs("div",{className:"flex h-full flex-col",children:[t&&i.jsx("div",{className:"pwa-header-safe flex-shrink-0 border-b border-border/50 bg-background/80 p-2 backdrop-blur-sm sm:p-3",children:i.jsx(aI,{onMenuClick:r,compact:!0})}),l?i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsxs("div",{className:"text-center text-muted-foreground",children:[i.jsx("div",{className:"mx-auto mb-4 h-10 w-10",children:i.jsx("div",{className:"h-full w-full rounded-full border-[3px] border-muted border-t-primary",style:{animation:"spin 1s linear infinite",WebkitAnimation:"spin 1s linear infinite",MozAnimation:"spin 1s linear infinite"}})}),i.jsx("h2",{className:"mb-1 text-lg font-semibold text-foreground",children:o("mainContent.loading")}),i.jsx("p",{className:"text-sm",children:o("mainContent.settingUpWorkspace")})]})}):i.jsx("div",{className:"flex flex-1 items-center justify-center overflow-auto p-5",children:i.jsxs("div",{className:"w-full max-w-4xl",children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted/60",children:i.jsx($r,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:o("mainContent.landing.title")}),i.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:o("mainContent.landing.description")})]}),i.jsxs("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,11rem),1fr))] gap-3",children:[i.jsxs("button",{type:"button",onClick:s,className:"rounded-md border border-primary/40 bg-primary/10 p-4 text-left transition-colors hover:bg-primary/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",children:[i.jsx(Fn,{className:"mb-3 h-5 w-5 text-primary"}),i.jsx("div",{className:"text-sm font-semibold",children:o("mainContent.openControlRoom",{defaultValue:"Open Control Room"})}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:o("mainContent.openControlRoomDescription",{defaultValue:"See admin users, team access, production runs, secrets, audits, usage, and remote access in one place."})})]}),i.jsxs("button",{type:"button",onClick:()=>{a?.()},className:"rounded-md border border-primary/30 bg-primary/5 p-4 text-left transition-colors hover:bg-primary/10",children:[i.jsx(_r,{className:"mb-3 h-5 w-5 text-primary"}),i.jsx("div",{className:"text-sm font-semibold",children:o("mainContent.landing.startOrchestration")}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:o("mainContent.landing.startOrchestrationDescription")})]}),i.jsxs("button",{type:"button",onClick:()=>{n?.()},className:"rounded-md border border-border p-4 text-left transition-colors hover:bg-muted/40",children:[i.jsx(Fn,{className:"mb-3 h-5 w-5 text-foreground"}),i.jsx("div",{className:"text-sm font-semibold",children:o("mainContent.landing.startChat")}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:o("mainContent.landing.startChatDescription")})]}),i.jsxs("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("pixcode:create-project")),className:"rounded-md border border-border p-4 text-left transition-colors hover:bg-muted/40",children:[i.jsx(ki,{className:"mb-3 h-5 w-5 text-foreground"}),i.jsx("div",{className:"text-sm font-semibold",children:o("mainContent.landing.createProject",{defaultValue:"Create New Project"})}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:o("mainContent.landing.createProjectDescription",{defaultValue:"Add an existing workspace or create a folder, then open the provider picker for coding."})})]})]}),i.jsx("div",{className:"mt-5 rounded-md border border-border/70 bg-muted/20 p-4 text-sm text-muted-foreground",children:o("mainContent.landing.sidebarHint")})]})})]})}function Bae(e){if(!e||typeof e.new_string!="string")return null;const t=String(e.old_string||"").split(`
|
|
799
799
|
`),r=e.new_string.split(`
|
|
800
|
-
`),n=Math.max(t.length,r.length);for(let a=0;a<n;a+=1)if(t[a]!==r[a])return a+1;return null}function Uae(e,t){const r=encodeURIComponent(e);return t&&t>0?`${r}#L${t}`:r}const $ae={M:"M",A:"A",D:"D",U:"U"},Hae={M:"border-amber-400/40 bg-amber-500/10 text-amber-700 dark:text-amber-200",A:"border-emerald-400/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-200",D:"border-red-400/40 bg-red-500/10 text-red-700 dark:text-red-200",U:"border-sky-400/40 bg-sky-500/10 text-sky-700 dark:text-sky-200"};function Gae(e){return e?new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e):null}function Vae({changedFiles:e,isLoading:t,error:r,latestChangedFilePath:n,lastCheckedAt:a,trackingMode:s,onTrackingModeChange:o,onRefresh:l,onOpenFile:c,variant:d="rail"}){const u=Gae(a),p=d==="panel";return i.jsxs("aside",{className:xe("h-full min-h-0 flex-col overflow-hidden bg-card/45",p?"flex w-full rounded-none border-0":"hidden w-[260px] shrink-0 rounded-lg border border-border/60 shadow-sm xl:flex"),children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border/60 px-3 py-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 shadow-[0_0_10px_rgba(16,185,129,0.75)]"}),"Command Center"]}),i.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:e.length>0?`${e.length} local change${e.length===1?"":"s"}`:"Watching agent writes"})]}),i.jsx("button",{type:"button",onClick:l,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":"Refresh changed files",title:"Refresh changed files",children:t?i.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin"}):i.jsx(it,{className:"h-3.5 w-3.5"})})]}),i.jsx("div",{className:"border-b border-border/60 px-3 py-2",children:i.jsxs("div",{className:"grid grid-cols-2 rounded-md border border-border bg-background p-0.5 text-[11px] font-medium",children:[i.jsx("button",{type:"button",onClick:()=>o("local"),className:`rounded px-2 py-1 transition-colors ${s==="local"?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,title:"Local changes: agent writes and filesystem edits",children:"Local changes"}),i.jsx("button",{type:"button",onClick:()=>o("git"),className:`rounded px-2 py-1 transition-colors ${s==="git"?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,title:"Git changes: git status only",children:"Git changes"})]})}),r&&i.jsx("div",{className:"mx-3 mt-3 rounded-md border border-amber-500/25 bg-amber-500/10 px-2 py-1.5 text-[11px] leading-5 text-amber-700 dark:text-amber-200",children:r}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:e.length===0?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-3 text-center text-muted-foreground",children:[i.jsx(ra,{className:"mb-2 h-8 w-8 opacity-45"}),i.jsx("p",{className:"text-xs font-medium text-foreground",children:"No local changes detected"}),i.jsx("p",{className:"mt-1 text-[11px] leading-5",children:"When an agent writes or edits files, they will appear here."})]}):i.jsxs("div",{className:"space-y-1",children:[e.slice(0,12).map(f=>{const h=n===f.path,g=Bae(f.diffInfo),b=g?`L${g}`:null,x=Uae(f.path,g);return i.jsxs("button",{type:"button",onClick:()=>c(f),className:`group flex w-full items-center gap-2 rounded-md border px-2 py-1.5 text-left transition-all ${h?"changed-file-flash border-emerald-500/60 bg-emerald-500/15":"border-border/60 bg-background/70 hover:border-emerald-500/35 hover:bg-emerald-500/10"}`,title:x,children:[i.jsx("span",{className:`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-[10px] font-semibold ${Hae[f.status]}`,children:$ae[f.status]}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",children:f.path}),b&&i.jsx("span",{className:"shrink-0 rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:b})]},`${f.status}:${f.path}`)}),e.length>12&&i.jsxs("p",{className:"px-1 pt-1 text-[11px] text-muted-foreground",children:["+",e.length-12," more files"]})]})}),u&&i.jsxs("div",{className:"border-t border-border/60 px-3 py-2 text-[10px] text-muted-foreground",children:["Last check ",u]})]})}const Wae=m.createContext(null),jh={didCatch:!1,error:null};let qae=class extends m.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=jh}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:s,reason:"imperative-api"}),this.setState(jh)}}componentDidCatch(t,r){var n,a;(n=(a=this.props).onError)===null||n===void 0||n.call(a,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:a}=this.props;if(n&&r.error!==null&&Kae(t.resetKeys,a)){var s,o;(s=(o=this.props).onReset)===null||s===void 0||s.call(o,{next:a,prev:t.resetKeys,reason:"keys"}),this.setState(jh)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:a}=this.props,{didCatch:s,error:o}=this.state;let l=t;if(s){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")l=r(c);else if(n)l=m.createElement(n,c);else if(a!==void 0)l=a;else throw o}return m.createElement(Wae.Provider,{value:{didCatch:s,error:o,resetErrorBoundary:this.resetErrorBoundary}},l)}};function Kae(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}function Yae(e){return e instanceof Error?`${e.name}: ${e.message}`:String(e)}function Zae({error:e,resetErrorBoundary:t,showDetails:r,componentStack:n}){return i.jsx("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:i.jsxs("div",{className:"max-w-md rounded-lg border border-red-200 bg-red-50 p-6",children:[i.jsxs("div",{className:"mb-4 flex items-center",children:[i.jsx("div",{className:"flex-shrink-0",children:i.jsx("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:i.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),i.jsx("h3",{className:"ml-3 text-sm font-medium text-red-800",children:"Something went wrong"})]}),i.jsxs("div",{className:"text-sm text-red-700",children:[i.jsx("p",{className:"mb-2",children:"An error occurred while loading the chat interface."}),r&&i.jsxs("details",{className:"mt-4",children:[i.jsx("summary",{className:"cursor-pointer font-mono text-xs",children:"Error Details"}),i.jsxs("pre",{className:"mt-2 max-h-40 overflow-auto rounded bg-red-100 p-2 text-xs",children:[Yae(e),n]})]})]}),i.jsx("div",{className:"mt-4",children:i.jsx("button",{onClick:t,className:"rounded bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500",children:"Try Again"})})]})})}function Xae({children:e,showDetails:t=!1,onRetry:r=void 0,resetKeys:n=void 0}){const[a,s]=m.useState(null),o=m.useCallback((d,u)=>{console.error("ErrorBoundary caught an error:",d,u),s(u?.componentStack??null)},[]),l=m.useCallback(()=>{s(null),r?.()},[r]),c=m.useCallback(({error:d,resetErrorBoundary:u})=>i.jsx(Zae,{error:d,resetErrorBoundary:u,showDetails:t,componentStack:a}),[t,a]);return i.jsx(qae,{fallbackRender:c,onError:o,onReset:l,resetKeys:n,children:e})}const Jae=new Set(["files","shell","git","changes","liveView"]),Qae=40,eie=50,tie=46,yC="command-center-tracking-mode";function Cd(e){return Jae.has(e)}function rie(e){return Math.min(eie,Math.max(Qae,e))}function vC(){return typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}function nie({selectedProject:e,selectedSession:t,activeTab:r,setActiveTab:n,ws:a,sendMessage:s,latestMessage:o,isMobile:l,onMenuClick:c,isLoading:d,onInputFocusChange:u,onSessionActive:p,onSessionInactive:f,onSessionProcessing:h,onSessionNotProcessing:g,processingSessions:b,onReplaceTemporarySession:x,onNavigateToSession:y,onShowSettings:v,externalMessageUpdate:w,onQuickStartSession:C,onQuickStartOrchestration:k}){const{preferences:N}=Lg(),{autoExpandTools:j,showRawParameters:A,showThinking:E,autoScrollToBottom:T,sendByCtrlEnter:_}=N,[I,R]=m.useState("split"),[S,F]=m.useState(tie),[B,z]=m.useState(!1),[q,V]=m.useState(!1),[P,U]=m.useState(()=>typeof window>"u"?"local":window.localStorage.getItem(yC)==="git"?"git":"local"),[H,M]=m.useState(()=>Cd(r)?"chat":r),[ee,Q]=m.useState(()=>typeof window<"u"&&window.innerWidth>=1024),ge=Cd(r)?r:null,se=!!(ge&&!l&&ee&&I==="split"),ce=m.useRef(null),ye=m.useRef(null),pe=m.useRef(null),ve=m.useRef(null),ue=m.useRef(null);B3(ce,r);const{editingFile:de,editorWidth:D,editorExpanded:X,hasManualWidth:oe,resizeHandleRef:K,handleFileOpen:W,handleCloseEditor:ne,handleToggleEditorExpand:me,handleResizeStart:we}=bne({selectedProject:e,isMobile:l}),le=H==="orchestration"?"orchestration":"chat",Ae=ge?le:r,te=!!se,ae=!!(ge==="files"&&de&&!l),J=Ae==="chat"&&(!ge||te),fe=Ae==="orchestration"&&te,{changedFiles:Ee,isLoading:Me,error:Xe,lastCheckedAt:Je,latestDetectedFile:st,refresh:tt}=gne(e,!!e,o,P),[Ct,ot]=m.useState(null),ut=m.useRef(0),ft=m.useMemo(()=>Ee.map(Ge=>Ge.path),[Ee]),kt=m.useCallback(async Ge=>{if(Ge.diffInfo)return Ge.diffInfo;if(!e)return null;try{const je=await Se(`/api/git/file-with-diff?project=${encodeURIComponent(e.name)}&file=${encodeURIComponent(Ge.path)}`,{cache:"no-store"}),Ue=await je.json();if(je.ok&&!Ue.error&&typeof Ue.currentContent=="string"&&typeof Ue.oldContent=="string")return{old_string:Ue.oldContent,new_string:Ue.currentContent}}catch{}if(Ge.status==="A"||Ge.status==="U")try{const je=await Lt.readFile(e.name,Ge.path);if(!je.ok)return null;const Ue=await je.json();if(typeof Ue.content=="string")return{old_string:"",new_string:Ue.content}}catch{return null}return null},[e]),$t=m.useCallback(Ge=>{ot(Ge.path),W(Ge.path,Ge.diffInfo??null),!l&&ee&&R("split"),n("files"),Ge.diffInfo||kt(Ge).then(je=>{je&&W(Ge.path,je)})},[ee,W,kt,l,n]),Mt=m.useCallback(()=>{R("split"),n(le)},[n,le]),Ot=Ge=>Ge==="files"?ae?i.jsxs("div",{className:"flex h-full min-w-0 overflow-hidden",children:[!X&&i.jsx("div",{className:"h-full min-w-[220px] max-w-[50%] flex-[0_0_46%] overflow-hidden border-r border-border/60",children:i.jsx(ag,{selectedProject:e,onFileOpen:W,changedFilePaths:ft,focusedFilePath:Ct})}),i.jsx(bC,{editingFile:de,isMobile:l,editorExpanded:X,editorWidth:D,hasManualWidth:oe,resizeHandleRef:K,onResizeStart:we,onCloseEditor:ne,onToggleEditorExpand:me,projectPath:e?.path,fillSpace:!0})]}):i.jsx(ag,{selectedProject:e,onFileOpen:W,changedFilePaths:ft,focusedFilePath:Ct}):Ge==="shell"?i.jsx(Vl,{project:e,session:t,showHeader:!1,isActive:r==="shell"}):Ge==="changes"?i.jsx(Vae,{changedFiles:Ee,isLoading:Me,error:Xe,latestChangedFilePath:st?.path??Ct,lastCheckedAt:Je,trackingMode:P,onTrackingModeChange:U,onRefresh:()=>{tt("manual")},onOpenFile:$t,variant:"panel"}):Ge==="liveView"?e?i.jsx(bre,{selectedProject:e,onAvailabilityChange:V}):null:i.jsx(y6,{selectedProject:e,isMobile:l,onFileOpen:W});m.useEffect(()=>{if(!e){V(!1);return}let Ge=!1;return Se(`/api/live-view/${encodeURIComponent(e.name)}/status`,{cache:"no-store"}).then(je=>je.ok?je.json():null).then(je=>{Ge||V(!!(je?.target?.available||je?.session))}).catch(()=>{Ge||V(!1)}),()=>{Ge=!0}},[e]),m.useEffect(()=>{if(typeof window>"u")return;const Ge=()=>{Q(window.innerWidth>=1024)};return Ge(),window.addEventListener("resize",Ge),()=>{window.removeEventListener("resize",Ge)}},[]),m.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(yC,P)},[P]),m.useEffect(()=>{Cd(r)||M(r)},[r]);const Ht=m.useCallback(Ge=>{const je=typeof Ge=="function"?Ge(r):Ge;!l&&ee&&Cd(je)?r===je?(ue.current=ve.current?.getBoundingClientRect()??null,R(Ue=>Ue==="split"?"full":"split")):R("split"):(R("split"),M(je)),n(je)},[r,ee,l,n]),Gt=m.useCallback(Ge=>{if(!ye.current||!te)return;Ge.preventDefault(),Ge.currentTarget.setPointerCapture?.(Ge.pointerId),z(!0);const je=lt=>{const yt=ye.current?.getBoundingClientRect();if(!yt||yt.width<=0)return;const Rt=(yt.right-lt)/yt.width*100;F(rie(Rt))};je(Ge.clientX);const Ue=lt=>{je(lt.clientX)},We=()=>{z(!1),window.removeEventListener("pointermove",Ue),window.removeEventListener("pointerup",We),window.removeEventListener("pointercancel",We)};window.addEventListener("pointermove",Ue),window.addEventListener("pointerup",We,{once:!0}),window.addEventListener("pointercancel",We,{once:!0})},[te]);return m.useLayoutEffect(()=>{const Ge=ue.current,je=ve.current;if(!Ge||!je||vC()){ue.current=null;return}const Ue=je.getBoundingClientRect();if(Ue.width<=0||Ue.height<=0){ue.current=null;return}const We=Ge.left-Ue.left,lt=Ge.width/Ue.width;In.fromTo(je,{x:We,scaleX:lt,opacity:.94,transformOrigin:"right center"},{x:0,scaleX:1,opacity:1,duration:fr.duration.enter,ease:fr.ease.soft,clearProps:"transform,opacity,transformOrigin"}),ue.current=null},[I,se]),m.useEffect(()=>{se||z(!1)},[se]),m.useEffect(()=>{if(!te||vC())return;const Ge=pe.current,je=ve.current;if(!Ge||!je)return;const Ue=In.context(()=>{In.fromTo(Ge,{opacity:.92,x:-14},{opacity:1,x:0,duration:fr.duration.base,ease:fr.ease.out,clearProps:"transform,opacity"}),In.fromTo(je,{opacity:0,x:28,scaleX:.96,transformOrigin:"right center"},{opacity:1,x:0,scaleX:1,duration:fr.duration.enter,ease:fr.ease.soft,clearProps:"transform,opacity,transformOrigin"})},ye);return()=>Ue.revert()},[ge,te]),m.useEffect(()=>{st&&st.detectedAt!==ut.current&&(ut.current=st.detectedAt,ot(st.path))},[st]),m.useEffect(()=>{if(!Ct)return;const Ge=window.setTimeout(()=>ot(null),7e3);return()=>window.clearTimeout(Ge)},[Ct]),d?i.jsx(mg,{mode:"loading",isMobile:l,onMenuClick:c}):!e&&r==="controlRoom"?i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx(xC,{activeTab:r,setActiveTab:Ht,selectedProject:null,selectedSession:null,liveViewAvailable:!1,activeSidePanelTab:null,sidePanelMode:I,canUseSidePanelSplit:ee,isMobile:l,onMenuClick:c}),i.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:i.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:i.jsx(cg,{selectedProject:null})})})]}):e?i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx(xC,{activeTab:r,setActiveTab:Ht,selectedProject:e,selectedSession:t,liveViewAvailable:q,activeSidePanelTab:ge,sidePanelMode:I,canUseSidePanelSplit:ee,isMobile:l,onCloseSidePanel:ge?Mt:void 0,onMenuClick:c}),i.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[i.jsxs("div",{ref:ce,className:xe("flex min-h-0 min-w-[200px] flex-1 flex-col overflow-hidden",X&&"hidden",!de&&!ge&&!se&&"mx-auto w-full max-w-[1100px] px-4 md:px-8",!de&&ge&&!te&&"w-full px-3 md:px-4",!de&&te&&"w-full px-3 md:px-4",!de&&r==="orchestration"&&"max-w-none px-0 md:px-0",!de&&r==="remote"&&"max-w-none px-0 md:px-0",!de&&r==="controlRoom"&&"max-w-none px-0 md:px-0"),children:[(J||fe||ge)&&i.jsxs("div",{ref:ye,className:xe("h-full min-h-0",te&&"flex overflow-hidden",B&&"select-none"),children:[J&&i.jsx("div",{ref:pe,className:xe("min-h-0 overflow-hidden",te&&"min-w-[320px] flex-none transition-[width,opacity,transform] duration-300 ease-out",B&&"transition-none",!te&&"h-full"),style:te?{width:`${100-S}%`}:void 0,children:i.jsx("div",{className:"flex h-full min-h-0 min-w-0 flex-1",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(Xae,{showDetails:!0,children:i.jsx(Ree,{selectedProject:e,selectedSession:t,ws:a,sendMessage:s,latestMessage:o,onFileOpen:W,onInputFocusChange:u,onSessionActive:p,onSessionInactive:f,onSessionProcessing:h,onSessionNotProcessing:g,processingSessions:b,onReplaceTemporarySession:x,onNavigateToSession:y,onShowSettings:v,autoExpandTools:j,showRawParameters:A,showThinking:E,autoScrollToBottom:T,sendByCtrlEnter:_,externalMessageUpdate:w})})})})}),fe&&i.jsx("div",{ref:pe,className:xe("min-h-0 overflow-hidden",te&&"min-w-[320px] flex-none transition-[width,opacity,transform] duration-300 ease-out",B&&"transition-none"),style:te?{width:`${100-S}%`}:void 0,children:i.jsx("div",{className:"flex h-full min-h-0 min-w-0 flex-1",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(B4,{selectedProject:e})})})}),te&&i.jsxs("button",{type:"button",className:"group relative z-20 mx-1 flex w-3 shrink-0 cursor-col-resize touch-none items-center justify-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onPointerDown:Gt,"aria-label":"Resize side panel",title:"Drag to resize",children:[i.jsx("span",{className:"absolute inset-y-3 -left-2 -right-2 rounded-full"}),i.jsx("span",{className:xe("h-16 w-1 rounded-full bg-border transition-all duration-200 group-hover:h-24 group-hover:bg-foreground/40",B&&"h-28 bg-foreground/55 shadow-[0_0_18px_rgba(120,120,120,0.22)]")})]}),ge&&i.jsx("div",{ref:ve,className:xe("min-h-0 overflow-hidden rounded-lg border border-border/60 bg-card/40",te&&"min-w-[360px] flex-none shadow-sm transition-[width,opacity,transform] duration-300 ease-out",B&&"transition-none",!te&&"h-full w-full"),style:te?{width:`${S}%`}:void 0,children:Ot(ge)})]}),!ge&&r==="orchestration"&&i.jsx("div",{className:"flex h-full min-h-0 min-w-0 overflow-hidden",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(B4,{selectedProject:e})})}),!ge&&r==="remote"&&i.jsx("div",{className:"flex h-full min-h-0 min-w-0 overflow-hidden",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(j6,{})})}),!ge&&r==="controlRoom"&&i.jsx("div",{className:"flex h-full min-h-0 min-w-0 overflow-hidden",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(cg,{selectedProject:e})})}),i.jsx("div",{className:`h-full overflow-hidden ${r==="preview"?"block":"hidden"}`}),r.startsWith("plugin:")&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(P6,{pluginName:r.replace("plugin:",""),selectedProject:e,selectedSession:t})})]}),!ae&&i.jsx(bC,{editingFile:de,isMobile:l,editorExpanded:X,editorWidth:D,hasManualWidth:oe,resizeHandleRef:K,onResizeStart:we,onCloseEditor:ne,onToggleEditorExpand:me,projectPath:e.path,fillSpace:r==="files"})]}),i.jsx(Jre,{})]}):i.jsx(mg,{mode:"empty",isMobile:l,onMenuClick:c,onQuickStartSession:C,onQuickStartOrchestration:k,onOpenControlRoom:()=>n("controlRoom")})}const aie=ln.memo(nie),ui="hermes --yolo",iie="hermes sessions browse",sie=260,oie=520,lie=340,Ih=320,_h=680,cie=420,wC=80,die=150,uie=560,pie=256,mie=34,iI="pixcode.workbench.workspaceTabs.v1",sI="pixcode.workbench.cliState.v1",oI="pixcode.workbench.editorState.v1",lI="pixcode.workbench.hermesState.v1",cw=10,dw=["claude","codex","cursor","gemini","qwen","opencode"],cI=30;function bl(e,t,r){return Math.min(r,Math.max(t,e))}function Nd(e){return e==="remote"||e==="controlRoom"||e.startsWith("plugin:")}function hie(e){return e==="git"||e==="changes"?"sourceControl":"explorer"}function _n(e){return e.fullPath||e.path||e.displayName||e.name}function Tu(e){const t=_n(e),n=t.replace(/\\/g,"/").split("/").filter(Boolean);return n.length===0?t||e.name:`/${n[n.length-1]}`}function dI(e,t){return typeof e!="number"||!Number.isFinite(e)?t("vscodeWorkbench.projects.fileCountPending",{defaultValue:"Files pending"}):t("vscodeWorkbench.projects.fileCount",{count:e,formattedCount:e.toLocaleString(),defaultValue:"{{formattedCount}} files"})}function ns(e){return(e.fullPath||e.path||e.name).replace(/\\/g,"/")}function Zs(e){return e?_n(e).replace(/\\/g,"/"):null}function fie(e){return e?_n(e).replace(/\\/g,"/"):null}function gie(e){return typeof e=="string"&&dw.includes(e)}function bie(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.path=="string"}function xie(){if(typeof window>"u")return[];try{const e=JSON.parse(window.localStorage.getItem(iI)??"[]");return Array.isArray(e)?e.filter(t=>typeof t.id=="string"&&typeof t.projectName=="string").slice(0,cw):[]}catch{return[]}}function yie(e){if(!(typeof window>"u"))try{window.localStorage.setItem(iI,JSON.stringify(e.slice(0,cw)))}catch{}}function uI(){if(typeof window>"u")return{};try{const e=JSON.parse(window.localStorage.getItem(sI)??"{}");return!e||typeof e!="object"||Array.isArray(e)?{}:e}catch{return{}}}function vie(e){if(!e)return null;const t=uI()[e];return!t||!gie(t.provider)?null:{provider:t.provider,isTerminalOpen:!!t.isTerminalOpen,sessionId:typeof t.sessionId=="string"?t.sessionId:null,updatedAt:typeof t.updatedAt=="number"?t.updatedAt:Date.now()}}function wie(e,t){if(!(!e||typeof window>"u"))try{const r=uI();window.localStorage.setItem(sI,JSON.stringify({...r,[e]:t}))}catch{}}function pI(){if(typeof window>"u")return{};try{const e=JSON.parse(window.localStorage.getItem(oI)??"{}");return!e||typeof e!="object"||Array.isArray(e)?{}:e}catch{return{}}}function kie(e){if(!e)return null;const t=pI()[e];if(!t||!Array.isArray(t.tabs))return null;const r=t.tabs.filter(bie).slice(0,cI),n=typeof t.activePath=="string"&&r.some(s=>s.path===t.activePath)?t.activePath:r[0]?.path??null,a=typeof t.splitPath=="string"&&r.some(s=>s.path===t.splitPath)?t.splitPath:null;return{tabs:r,activePath:n,splitPath:a,updatedAt:typeof t.updatedAt=="number"?t.updatedAt:Date.now()}}function Sie(e,t){if(!(!e||typeof window>"u"))try{const r=pI();window.localStorage.setItem(oI,JSON.stringify({...r,[e]:{...t,tabs:t.tabs.slice(0,cI)}}))}catch{}}function mI(){if(typeof window>"u")return{};try{const e=JSON.parse(window.localStorage.getItem(lI)??"{}");return!e||typeof e!="object"||Array.isArray(e)?{}:e}catch{return{}}}function Cie(e){if(!e)return null;const t=mI()[e];return!t||typeof t!="object"?null:{isOpen:!!t.isOpen,isMinimized:!!t.isMinimized,command:typeof t.command=="string"&&t.command.trim()?t.command:ui,title:typeof t.title=="string"&&t.title.trim()?t.title:null,updatedAt:typeof t.updatedAt=="number"?t.updatedAt:Date.now()}}function Ed(e,t){if(!(!e||typeof window>"u"))try{const r=mI();window.localStorage.setItem(lI,JSON.stringify({...r,[e]:t}))}catch{}}function Nie(e,t){return{id:ns(e),projectName:e.name,path:_n(e),label:t,starred:!1}}function hg(e){return typeof e.summary=="string"&&e.summary||typeof e.title=="string"&&e.title||typeof e.name=="string"&&e.name||e.id}function fg(e){return typeof e.updated_at=="string"&&e.updated_at||typeof e.lastActivity=="string"&&e.lastActivity||typeof e.created_at=="string"&&e.created_at||typeof e.createdAt=="string"&&e.createdAt||null}function kC(e){const t=fg(e);if(!t)return"";const r=new Date(t);return Number.isNaN(r.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(r)}function Eie({sidebarProps:e,selectedProject:t,selectedSession:r,activeTab:n,setActiveTab:a,onMenuClick:s,isLoading:o,onShowSettings:l,onQuickStartSession:c}){const{t:d}=Be("common"),u=m.useRef(null),[p,f]=m.useState(lie),[h,g]=m.useState(cie),[b,x]=m.useState(!1),[y,v]=m.useState(!1),[w,C]=m.useState(!1),[k,N]=m.useState("shell"),[j,A]=m.useState(0),[E,T]=m.useState(!1),[_,I]=m.useState(null),[R,S]=m.useState(null),[F,B]=m.useState(null),[z,q]=m.useState(pie),[V,P]=m.useState(!1),[U,H]=m.useState(null),[M,ee]=m.useState(null),[Q,ge]=m.useState({state:"idle",log:"",error:null,jobId:null,startAfterInstall:!1}),[se,ce]=m.useState("projects"),[ye,pe]=m.useState(null),[ve,ue]=m.useState([]),[de,D]=m.useState(null),[X,oe]=m.useState(null),[K,W]=m.useState(null),[ne,me]=m.useState(xie),[we,le]=m.useState(null),[Ae,te]=m.useState(null),ae=m.useRef(null),J=m.useRef(null),fe=m.useRef(!1),Ee=m.useRef(0),Me=m.useMemo(()=>fie(t),[t]),Xe=m.useMemo(()=>Zs(t),[t]),Je=m.useRef(!1),st=m.useRef(null),tt=m.useRef(null);m.useEffect(()=>{Nd(n)||n==="chat"&&se==="projects"||ce(hie(n))},[n,se]),m.useEffect(()=>{if(st.current===Me)return;st.current=Me,Je.current=!0,oe(null),W(null);const Ce=kie(Me),Re=Ce?.tabs??[];ue(Re),D(Ce?.activePath??Re[0]?.path??null),oe(Ce?.splitPath?Re.find(Oe=>Oe.path===Ce.splitPath)??null:null)},[Me]),m.useEffect(()=>{if(Je.current){Je.current=!1;return}if(!Me)return;const Ce=de&&ve.some(Oe=>Oe.path===de)?de:ve[0]?.path??null,Re=X&&ve.some(Oe=>Oe.path===X.path)?X.path:null;Sie(Me,{tabs:ve,activePath:Ce,splitPath:Re,updatedAt:Date.now()})},[de,Me,ve,X]),m.useEffect(()=>{t&&me(Ce=>{const Re=ns(t),Oe=Ce.find(gt=>gt.id===Re);if(Oe)return Ce.map(gt=>gt.id===Re?{...Oe,projectName:t.name,path:_n(t)}:gt);const wt=`Workspace ${Ce.length+1}`;return[...Ce,Nie(t,wt)].slice(-cw)})},[t]),m.useEffect(()=>{yie(ne)},[ne]);const Ct=m.useCallback((Ce,Re=null)=>{const gt={name:Ce.replace(/\\/g,"/").split("/").pop()||Ce,path:Ce,projectName:t?.name,diffInfo:Re};ue(Bt=>{const ur=Bt.findIndex(Kr=>Kr.path===Ce);if(ur===-1)return[...Bt,gt];const rn=[...Bt];return rn[ur]=gt,rn}),D(Ce),a("files")},[t?.name,a]),ot=m.useCallback(Ce=>{ue(Re=>{const Oe=Re.filter(wt=>wt.path!==Ce);return D(wt=>wt!==Ce?wt:Oe[Oe.length-1]?.path??null),Oe})},[]),ut=m.useCallback(()=>{ue([]),D(null),oe(null),W(null)},[]),ft=m.useCallback(Ce=>{navigator.clipboard?.writeText(Ce),W(null)},[]),kt=m.useCallback((Ce,Re=!1)=>{const Oe=ve.find(wt=>wt.path===Ce);Oe&&(oe(Oe),Re&&ue(wt=>{const gt=wt.filter(Bt=>Bt.path!==Ce);return D(Bt=>Bt!==Ce?Bt:gt[gt.length-1]?.path??null),gt}),W(null))},[ve]),$t=m.useCallback((Ce,Re)=>{Ce.preventDefault(),W({filePath:Re,x:Ce.clientX,y:Ce.clientY})},[]),Mt=m.useCallback(Ce=>{ae.current?.scrollBy({left:Ce==="left"?-180:180,behavior:"smooth"})},[]),Ot=m.useCallback((Ce,Re={})=>{const Oe=Re.project??t??null,wt=Ce==="hermes"?Re.command||ui:null,gt=Ce==="hermes"&&Re.title||null;N(Ce),T(!!Re.forceNewSession),I(wt),S(gt),B(Oe),C(!0),P(!1),A(Bt=>Bt+1),Ce==="hermes"&&Ed(Zs(Oe),{isOpen:!0,isMinimized:!1,command:wt,title:gt,updatedAt:Date.now()})},[t]),Ht=m.useCallback(async()=>{try{const Re=await(await Se("/api/orchestration/hermes/install-status")).json();ee({installed:!!Re?.installed,command:typeof Re?.command=="string"?Re.command:null,version:typeof Re?.version=="string"?Re.version:null,error:typeof Re?.error=="string"?Re.error:null})}catch{ee({installed:!1,command:null,version:null,error:null})}},[]),Gt=m.useCallback(async({force:Ce=!1,startAfterInstall:Re=!1}={})=>{try{J.current?.close()}catch{}J.current=null,Ot("hermes-install"),ge({state:"running",log:"",error:null,jobId:null,startAfterInstall:Re});try{const Oe=await Se("/api/orchestration/hermes/install",{method:"POST",body:JSON.stringify({force:Ce,skipBrowser:!0})}),wt=await Oe.json().catch(()=>({}));if(!Oe.ok||!wt?.jobId)throw new Error(wt?.error?.message||wt?.error||`HTTP ${Oe.status}`);const gt=String(wt.jobId);ge(Kr=>({...Kr,jobId:gt}));const Bt=window.localStorage.getItem("auth-token")||"",ur=`/api/orchestration/hermes/install/${encodeURIComponent(gt)}/stream${Bt?`?token=${encodeURIComponent(Bt)}`:""}`,rn=new EventSource(ur);J.current=rn,rn.addEventListener("log",Kr=>{try{const sa=JSON.parse(Kr.data);typeof sa.chunk=="string"&&ge(ei=>({...ei,log:`${ei.log}${sa.chunk}`}))}catch{}}),rn.addEventListener("done",Kr=>{try{const sa=JSON.parse(Kr.data);if(!sa.success)throw new Error(sa.error||d("vscodeWorkbench.hermes.installFailed",{defaultValue:"Hermes install failed."}));ge(ei=>({...ei,state:"done",error:null})),Ht().then(()=>{Re&&Ot("hermes")})}catch(sa){ge(ei=>({...ei,state:"error",error:sa instanceof Error?sa.message:d("vscodeWorkbench.hermes.installFailed",{defaultValue:"Hermes install failed."})}))}finally{try{rn.close()}catch{}J.current=null}}),rn.onerror=()=>{ge(Kr=>Kr.state==="running"?{...Kr,state:"error",error:d("vscodeWorkbench.hermes.installStreamLost",{defaultValue:"Hermes install stream closed early. The install may still be running."})}:Kr)}}catch(Oe){ge({state:"error",log:"",error:Oe instanceof Error?Oe.message:d("vscodeWorkbench.hermes.installFailed",{defaultValue:"Hermes install failed."}),jobId:null,startAfterInstall:Re})}},[Ot,Ht,d]);m.useEffect(()=>()=>{try{J.current?.close()}catch{}},[]),m.useEffect(()=>{Ht()},[Ht]),m.useEffect(()=>{if(tt.current===Xe)return;tt.current=Xe;const Ce=Cie(Xe);if(!Ce?.isOpen){k==="hermes"&&(C(!1),B(t??null));return}N("hermes"),T(!1),I(Ce.command||ui),S(Ce.title),B(t??null),C(!0),P(Ce.isMinimized),A(Re=>Re+1)},[k,t,Xe]),m.useEffect(()=>{!Ae||!t||_n(t)===Ae.projectPath&&(te(null),Ot("hermes",{command:Ae.command,title:Ae.title,forceNewSession:Ae.forceNewSession}))},[Ot,Ae,t]);const Ge=m.useMemo(()=>ve.find(Ce=>Ce.path===de)??ve[0]??null,[de,ve]),je=F??t,Ue=w&&(k==="hermes"||k==="hermes-install"),We=m.useMemo(()=>[{id:"explorer",icon:$r,label:d("vscodeWorkbench.activity.explorer"),tab:"files"},{id:"projects",icon:jr,label:d("vscodeWorkbench.activity.projects"),tab:"chat"},{id:"sourceControl",icon:Hr,label:d("vscodeWorkbench.activity.sourceControl"),tab:"git"},{id:"terminal",icon:Xr,label:d("vscodeWorkbench.activity.terminal"),tab:"shell"}],[d]),lt=m.useMemo(()=>[{id:"controlRoom",icon:Fn,label:d("tabs.controlRoom"),tab:"controlRoom"},{id:"remote",icon:Si,label:d("tabs.remote"),tab:"remote"}],[d]),yt=m.useCallback((Ce,Re)=>{Re.preventDefault(),Re.currentTarget.setPointerCapture?.(Re.pointerId),pe(Ce)},[]);m.useEffect(()=>{if(!ye)return;const Ce=Oe=>{const wt=u.current?.getBoundingClientRect();if(wt){if(ye==="left"){f(bl(Oe.clientX-wt.left,sie,oie));return}if(ye==="bottom"){q(bl(wt.bottom-Oe.clientY,die,uie));return}g(bl(wt.right-Oe.clientX,Ih,_h))}},Re=()=>pe(null);return window.addEventListener("pointermove",Ce),window.addEventListener("pointerup",Re,{once:!0}),window.addEventListener("pointercancel",Re,{once:!0}),document.body.style.cursor=ye==="bottom"?"ns-resize":"col-resize",document.body.style.userSelect="none",()=>{window.removeEventListener("pointermove",Ce),window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re),document.body.style.cursor="",document.body.style.userSelect=""}},[ye]);const Rt=m.useCallback((Ce,Re)=>{if(Ce==="terminal"){if(!t){ce("projects"),a("chat");return}w&&k==="shell"&&V?P(!1):w&&k==="shell"?C(!1):Ot("shell"),n==="shell"&&a("files");return}if(ce(Ce),x(!1),Ce==="projects"){a("chat");return}(Re!=="chat"||!Nd(n))&&a(Re)},[n,k,V,w,Ot,t,a]),er=m.useCallback((Ce={})=>{if(!t){const Re=e.projects[0];if(Re){te({projectPath:_n(Re),command:Ce.command,title:Ce.title,forceNewSession:Ce.forceNewSession}),e.onProjectSelect(Re),ce("explorer"),a("files");return}ce("projects"),a("chat");return}if(M?.installed!==!0){Gt({startAfterInstall:!0});return}Ot("hermes",Ce)},[M?.installed,Ot,t,a,e,Gt]),Fe=m.useCallback(()=>{if(M?.installed!==!0){Gt({startAfterInstall:!0});return}Ot("hermes",{command:ui,forceNewSession:!0,project:F??t})},[F,M?.installed,Ot,t,Gt]),qe=m.useCallback(()=>{if(M?.installed!==!0){Gt({startAfterInstall:!0});return}Ot("hermes",{command:iie,title:d("vscodeWorkbench.hermes.history",{defaultValue:"Hermes history"}),forceNewSession:!0,project:F??t})},[F,M?.installed,Ot,t,Gt,d]),ht=m.useCallback(()=>{Gt({force:!0})},[Gt]),et=m.useCallback(()=>{k==="hermes"&&Ed(Zs(F),{isOpen:!1,isMinimized:!1,command:_||ui,title:R,updatedAt:Date.now()}),C(!1),B(null)},[_,k,F,R]),vt=m.useCallback(()=>{P(!0),k==="hermes"&&Ed(Zs(F),{isOpen:!0,isMinimized:!0,command:_||ui,title:R,updatedAt:Date.now()})},[_,k,F,R]),Xt=m.useCallback(()=>{P(!1),k==="hermes"&&Ed(Zs(F),{isOpen:!0,isMinimized:!1,command:_||ui,title:R,updatedAt:Date.now()})},[_,k,F,R]);m.useEffect(()=>{const Ce=Re=>{const Oe=Re.detail;if(Oe?.mode==="install"){ht();return}if(Oe?.mode==="command"&&Oe.command){er({command:Oe.command,title:Oe.title||Oe.command,forceNewSession:!0});return}er({command:ui})};return window.addEventListener("pixcode:hermes-terminal",Ce),()=>window.removeEventListener("pixcode:hermes-terminal",Ce)},[ht,er]);const Z=m.useCallback(()=>{g(Ce=>bl(Ce-wC,Ih,_h))},[]),Te=m.useCallback(()=>{g(Ce=>bl(Ce+wC,Ih,_h))},[]),be=m.useCallback(Ce=>{a(Ce)},[a]),_e=m.useCallback(Ce=>{window.dispatchEvent(new CustomEvent("pixcode:create-project",{detail:{workspaceType:Ce}}))},[]),$e=m.useCallback(Ce=>{e.onProjectSelect(Ce),ce("explorer"),a("files")},[a,e]),pt=m.useCallback(Ce=>{const Re=e.projects.find(Oe=>Oe.name===Ce.projectName||ns(Oe)===Ce.id);Re&&$e(Re)},[$e,e.projects]),rt=m.useCallback(Ce=>{me(Re=>{const Oe=Re.filter(gt=>gt.id!==Ce);if(t&&ns(t)===Ce){const gt=Oe[Oe.length-1],Bt=gt?e.projects.find(ur=>ur.name===gt.projectName||ns(ur)===gt.id):null;Bt&&window.setTimeout(()=>$e(Bt),0)}return Oe})},[$e,t,e.projects]),Mr=m.useCallback(Ce=>{me(Re=>Re.filter(Oe=>Oe.id===Ce))},[]),zt=m.useCallback(()=>{me([])},[]),yn=m.useCallback((Ce,Re)=>{const Oe=Re.trim();Oe&&me(wt=>wt.map(gt=>gt.id===Ce?{...gt,label:Oe}:gt))},[]),qr=m.useCallback(Ce=>{me(Re=>Re.map(Oe=>Oe.id===Ce?{...Oe,starred:!Oe.starred}:Oe))},[]);m.useEffect(()=>{const Ce=window.localStorage.getItem("auth-token")||"",Re=`/api/orchestration/hermes/terminal-launches/stream?after=${Ee.current}${Ce?`&token=${encodeURIComponent(Ce)}`:""}`,Oe=new EventSource(Re),wt=Bt=>{try{const ur=JSON.parse(Bt.data);if(!ur||typeof ur.id!="number"||ur.id<=Ee.current||(Ee.current=Math.max(Ee.current,ur.id),!fe.current))return;const rn=ur.projectPath?e.projects.find(Kr=>_n(Kr).replace(/\\/g,"/")===ur.projectPath?.replace(/\\/g,"/")):t;rn&&rn!==t&&$e(rn),v(!1),H(ur)}catch{}},gt=Bt=>{try{const ur=JSON.parse(Bt.data);typeof ur.latestId=="number"&&(Ee.current=Math.max(Ee.current,ur.latestId))}catch{}finally{fe.current=!0}};return Oe.addEventListener("terminal-launch",wt),Oe.addEventListener("ready",gt),()=>{Oe.removeEventListener("terminal-launch",wt),Oe.removeEventListener("ready",gt),Oe.close()}},[$e,t,e.projects]);const Aa=()=>se==="projects"?i.jsx(Fie,{projects:e.projects,selectedProject:t,onProjectSelect:$e,onNewSession:e.onNewSession,onOpenProject:()=>_e("existing"),onCloneProject:()=>_e("new"),onRefresh:e.onRefresh,isRefreshing:e.isLoading,t:d}):se==="sourceControl"?i.jsx(y6,{selectedProject:t,isMobile:!1,compact:!0,onFileOpen:Ct}):i.jsx(Lie,{selectedProject:t,onFileOpen:Ct,t:d}),br=()=>o?i.jsx(mg,{mode:"loading",isMobile:!1,onMenuClick:s}):n==="remote"?i.jsx(j6,{}):n==="controlRoom"?i.jsx(cg,{selectedProject:t}):n.startsWith("plugin:")?i.jsx(P6,{pluginName:n.replace("plugin:",""),selectedProject:t,selectedSession:r}):t?Ge?i.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-background",children:[i.jsxs("div",{className:"flex h-9 shrink-0 items-center border-b border-border bg-muted/20",children:[i.jsx("button",{type:"button",className:"flex h-full w-8 shrink-0 items-center justify-center border-r border-border text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>Mt("left"),"aria-label":d("vscodeWorkbench.editor.scrollLeft",{defaultValue:"Scroll tabs left"}),title:d("vscodeWorkbench.editor.scrollLeft",{defaultValue:"Scroll tabs left"}),children:i.jsx(pc,{className:"h-3.5 w-3.5"})}),i.jsx("div",{ref:ae,className:"flex min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:ve.map(Ce=>{const Re=Ce.path===Ge.path;return i.jsxs("button",{type:"button",className:xe("group flex h-9 w-44 shrink-0 items-center gap-2 border-r border-border px-2.5 text-xs transition-colors",Re?"bg-background text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),onClick:()=>D(Ce.path),onContextMenu:Oe=>$t(Oe,Ce.path),title:Ce.path,children:[i.jsx(jr,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:Ce.name}),i.jsx("span",{role:"button",tabIndex:0,className:"rounded p-0.5 text-muted-foreground opacity-70 transition hover:bg-muted hover:text-foreground group-hover:opacity-100",onClick:Oe=>{Oe.stopPropagation(),ot(Ce.path)},onKeyDown:Oe=>{(Oe.key==="Enter"||Oe.key===" ")&&(Oe.preventDefault(),Oe.stopPropagation(),ot(Ce.path))},"aria-label":d("vscodeWorkbench.editor.closeTab",{file:Ce.name,defaultValue:"Close {{file}}"}),title:d("vscodeWorkbench.editor.closeTab",{file:Ce.name,defaultValue:"Close {{file}}"}),children:i.jsx(At,{className:"h-3 w-3"})})]},Ce.path)})}),i.jsx("button",{type:"button",className:"flex h-full w-8 shrink-0 items-center justify-center border-l border-border text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>Mt("right"),"aria-label":d("vscodeWorkbench.editor.scrollRight",{defaultValue:"Scroll tabs right"}),title:d("vscodeWorkbench.editor.scrollRight",{defaultValue:"Scroll tabs right"}),children:i.jsx(Dn,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"flex h-full w-8 shrink-0 items-center justify-center border-l border-border text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>W({filePath:Ge.path,x:window.innerWidth-220,y:84}),"aria-label":d("vscodeWorkbench.editor.moreActions",{defaultValue:"More tab actions"}),title:d("vscodeWorkbench.editor.moreActions",{defaultValue:"More tab actions"}),children:i.jsx(TN,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:X?i.jsxs("div",{className:"flex h-full min-w-0",children:[Ge&&i.jsx("div",{className:"min-w-0 flex-1 border-r border-border",children:i.jsx(Ul,{file:Ge,onClose:()=>ot(Ge.path),projectPath:t.path||t.fullPath,isSidebar:!0})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border bg-muted/20 px-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:[i.jsx(jr,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:X.name})]}),i.jsx("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>oe(null),"aria-label":d("vscodeWorkbench.editor.closeSplit",{defaultValue:"Close split editor"}),title:d("vscodeWorkbench.editor.closeSplit",{defaultValue:"Close split editor"}),children:i.jsx(At,{className:"h-3.5 w-3.5"})})]}),i.jsx("div",{className:"h-[calc(100%-2rem)] min-h-0 overflow-hidden",children:i.jsx(Ul,{file:X,onClose:()=>oe(null),projectPath:t.path||t.fullPath,isSidebar:!0})})]})]}):i.jsx(Ul,{file:Ge,onClose:()=>ot(Ge.path),projectPath:t.path||t.fullPath,isSidebar:!0})}),K&&i.jsx(Iie,{context:K,file:ve.find(Ce=>Ce.path===K.filePath)??null,onClose:()=>W(null),onCloseTab:ot,onCloseAll:ut,onCopyPath:ft,onSplitRight:Ce=>kt(Ce),onSplitMoveRight:Ce=>kt(Ce,!0),t:d})]}):i.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:i.jsxs("div",{className:"max-w-md px-6 text-center",children:[i.jsx(as,{className:"mx-auto mb-4 h-10 w-10 text-muted-foreground/60"}),i.jsx("div",{className:"text-sm font-medium text-foreground",children:d("vscodeWorkbench.editor.emptyTitle")}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:t.displayName||t.name})]})}):i.jsx(Pie,{projects:e.projects,onProjectSelect:$e,onNewSession:e.onNewSession,onOpenProject:()=>_e("existing"),onCloneProject:()=>_e("new"),onQuickStartSession:c,onOpenHermesAgent:er,onShowSettings:l,t:d}),$n=()=>i.jsx(Oie,{project:t,session:r,hermesCliLaunch:U,onSessionSelect:e.onSessionSelect,t:d});return i.jsxs("div",{className:"flex h-full min-w-0 flex-1 flex-col overflow-hidden bg-background text-foreground",children:[i.jsx(nT,{...e,isMobile:!1,modalsOnly:!0}),i.jsx(Tie,{t:d,onOpenProject:_e,onActivityPanel:Rt,onSystemTab:be,onOpenHermesAgent:er,onShowSettings:l,onQuickStartSession:c}),i.jsx(Aie,{tabs:ne,projects:e.projects,selectedProject:t,onSelect:pt,onClose:rt,onCloseOthers:Mr,onCloseAll:zt,onRename:yn,onToggleStar:qr,contextMenu:we,onContextMenuChange:le,onAdd:()=>_e("existing"),isCliPanelCollapsed:y,onToggleCliPanel:()=>v(Ce=>!Ce),t:d}),i.jsxs("div",{ref:u,className:xe("flex min-h-0 min-w-0 flex-1 overflow-hidden",ye&&"select-none"),children:[i.jsxs("aside",{className:"flex h-full w-12 shrink-0 flex-col border-r border-border bg-muted/30",children:[i.jsx("div",{className:"flex h-11 items-center justify-center border-b border-border",children:i.jsx(jg,{className:"h-5 w-5 text-primary"})}),i.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1 py-2",children:[We.map(Ce=>i.jsx(Td,{label:Ce.label,icon:Ce.icon,active:Ce.id==="terminal"?w:!b&&se===Ce.id&&!Nd(n),onClick:()=>Rt(Ce.id,Ce.tab)},Ce.id)),i.jsx(zie,{label:d("vscodeWorkbench.hermes.connect",{defaultValue:"Connect Hermes Agent"}),active:Ue,onClick:er})]}),i.jsxs("div",{className:"flex flex-col items-center gap-1 border-t border-border py-2",children:[lt.map(Ce=>i.jsx(Td,{label:Ce.label,icon:Ce.icon,active:n===Ce.tab,onClick:()=>be(Ce.tab)},Ce.id)),i.jsx(Td,{label:d(b?"vscodeWorkbench.activity.showPanel":"vscodeWorkbench.activity.hidePanel"),icon:b?Gl:Pu,active:!1,onClick:()=>x(Ce=>!Ce)}),i.jsx(Td,{label:d("navigation.settings"),icon:Ut,active:!1,onClick:l})]})]}),!b&&i.jsxs(i.Fragment,{children:[i.jsxs("section",{className:"h-full shrink-0 overflow-hidden border-r border-border bg-background",style:{width:p},children:[i.jsx("div",{className:"flex h-10 items-center justify-between border-b border-border px-3",children:i.jsx("div",{className:"truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d(`vscodeWorkbench.panels.${se}`)})}),i.jsx("div",{className:"h-[calc(100%-2.5rem)] min-h-0 overflow-hidden",children:Aa()})]}),i.jsx(CC,{label:d("vscodeWorkbench.resize.left"),active:ye==="left",onPointerDown:Ce=>yt("left",Ce)})]}),i.jsxs("main",{className:"min-w-0 flex-1 overflow-hidden border-r border-border bg-background",children:[i.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-border px-3",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(Du,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:Nd(n)?d(`tabs.${n==="controlRoom"?"controlRoom":n}`):d("vscodeWorkbench.panels.editor")})]}),i.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t?.displayName||t?.name||d("vscodeWorkbench.noProject")})]}),i.jsxs("div",{className:"flex h-[calc(100%-2.5rem)] min-h-0 flex-col overflow-hidden",children:[i.jsx("div",{className:xe("min-h-0 flex-1 overflow-hidden",w&&"border-b border-border"),children:br()}),w&&i.jsx(_ie,{project:je,mode:k,hermesInstallStatus:M,hermesInstallJob:Q,runId:j,forceNewSession:E,command:_,commandTitle:R,height:z,isMinimized:V,isActive:!0,onResizeStart:Ce=>yt("bottom",Ce),onMinimize:vt,onRestore:Xt,onStartHermes:Fe,onOpenHistory:qe,onInstallHermes:ht,onClose:et,t:d})]})]}),!y&&i.jsxs(i.Fragment,{children:[i.jsx(CC,{label:d("vscodeWorkbench.resize.right"),active:ye==="right",onPointerDown:Ce=>yt("right",Ce)}),i.jsxs("aside",{className:"h-full shrink-0 overflow-hidden bg-background",style:{width:h},children:[i.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-border px-3",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[i.jsx(bs,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("vscodeWorkbench.panels.cli")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx("button",{type:"button",className:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground",onClick:Z,"aria-label":d("vscodeWorkbench.cli.shrinkPanel",{defaultValue:"Shrink CLI panel"}),title:d("vscodeWorkbench.cli.shrinkPanel",{defaultValue:"Shrink CLI panel"}),children:i.jsx(Dn,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground",onClick:Te,"aria-label":d("vscodeWorkbench.cli.expandPanel",{defaultValue:"Expand CLI panel"}),title:d("vscodeWorkbench.cli.expandPanel",{defaultValue:"Expand CLI panel"}),children:i.jsx(mc,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>v(!0),"aria-label":d("vscodeWorkbench.cli.hidePanel",{defaultValue:"Hide CLI panel"}),title:d("vscodeWorkbench.cli.hidePanel",{defaultValue:"Hide CLI panel"}),children:i.jsx(Gl,{className:"h-4 w-4"})})]})]}),i.jsx("div",{className:"h-[calc(100%-2.5rem)] min-h-0 overflow-hidden",children:$n()})]})]})]})]})}function Tie({t:e,onOpenProject:t,onActivityPanel:r,onSystemTab:n,onOpenHermesAgent:a,onShowSettings:s,onQuickStartSession:o}){const[l,c]=m.useState(null),d=m.useMemo(()=>[{label:"File",commands:[{label:e("vscodeWorkbench.menu.openProject",{defaultValue:"Open Project..."}),icon:On,type:"existing"},{label:e("vscodeWorkbench.menu.cloneFromGithub",{defaultValue:"Clone Repository..."}),icon:Ou,type:"new"},{label:e("vscodeWorkbench.menu.newChat",{defaultValue:"New Chat"}),icon:Mn,action:o},{label:e("navigation.settings"),icon:Ut,action:s}]},{label:"Edit",commands:[{label:e("vscodeWorkbench.menu.newChat",{defaultValue:"New Chat"}),icon:Zt,action:o}]},{label:"Selection",commands:[{label:e("vscodeWorkbench.menu.openProjects",{defaultValue:"Open Projects"}),icon:$r,action:()=>r("projects","chat")}]},{label:"View",commands:[{label:e("vscodeWorkbench.activity.explorer"),icon:$r,action:()=>r("explorer","files")},{label:e("vscodeWorkbench.activity.projects"),icon:jr,action:()=>r("projects","chat")},{label:e("vscodeWorkbench.activity.sourceControl"),icon:Hr,action:()=>r("sourceControl","git")}]},{label:"Go",commands:[{label:e("tabs.controlRoom"),icon:Fn,action:()=>n("controlRoom")},{label:e("tabs.remote"),icon:Si,action:()=>n("remote")}]},{label:"Run",commands:[{label:e("vscodeWorkbench.hermes.title",{defaultValue:"Hermes Agent"}),icon:_r,action:a}]},{label:"Terminal",commands:[{label:e("vscodeWorkbench.panels.cli"),icon:bs,action:()=>r("terminal","shell")}]},{label:"Help",commands:[{label:e("navigation.settings"),icon:Ut,action:s}]}],[r,o,a,s,n,e]),u=p=>{if(c(null),p.type){t(p.type);return}p.action?.()};return i.jsx("div",{className:"flex h-8 shrink-0 items-center border-b border-border bg-muted/20 px-2 text-xs text-muted-foreground",children:i.jsx("div",{className:"flex h-full items-center gap-0.5",children:d.map(p=>i.jsxs("div",{className:"relative h-full",children:[i.jsxs("button",{type:"button",className:xe("flex h-full items-center gap-1 rounded px-2 transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",l===p.label&&"bg-muted text-foreground"),onClick:()=>c(f=>f===p.label?null:p.label),children:[p.label,i.jsx(Pn,{className:"h-3 w-3"})]}),l===p.label&&i.jsx("div",{className:"absolute left-0 top-full z-50 mt-1 min-w-52 overflow-hidden rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-xl shadow-black/10",children:p.commands.map(f=>{const h=f.icon;return i.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onClick:()=>u(f),children:[h&&i.jsx(h,{className:"h-3.5 w-3.5 text-muted-foreground"}),i.jsx("span",{className:"truncate",children:f.label})]},f.label)})})]},p.label))})})}function Aie({tabs:e,projects:t,selectedProject:r,onSelect:n,onClose:a,onCloseOthers:s,onCloseAll:o,onRename:l,onToggleStar:c,contextMenu:d,onContextMenuChange:u,onAdd:p,isCliPanelCollapsed:f,onToggleCliPanel:h,t:g}){const b=r?ns(r):null,[x,y]=m.useState(null),[v,w]=m.useState(""),C=m.useRef(null),k=m.useMemo(()=>e.map(_=>({tab:_,project:t.find(I=>I.name===_.projectName||ns(I)===_.id)})).filter(_=>!!_.project),[t,e]),N=_=>{u(null),y(_.id),w(_.label)},j=()=>{x&&(l(x,v),y(null),w(""))},A=(_,I)=>{_.preventDefault(),n(I),u({tabId:I.id,x:_.clientX,y:_.clientY})},E=_=>{C.current?.scrollBy({left:_==="left"?-220:220,behavior:"smooth"})},T=d?k.find(_=>_.tab.id===d.tabId)??null:null;return i.jsxs("div",{className:"relative flex h-9 shrink-0 items-center border-b border-border bg-background text-xs",children:[i.jsx("button",{type:"button",className:"flex h-full w-8 shrink-0 items-center justify-center border-r border-border text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>E("left"),"aria-label":g("vscodeWorkbench.workspace.scrollLeft",{defaultValue:"Scroll workspaces left"}),title:g("vscodeWorkbench.workspace.scrollLeft",{defaultValue:"Scroll workspaces left"}),children:i.jsx(pc,{className:"h-3.5 w-3.5"})}),i.jsxs("div",{ref:C,className:"flex h-full min-w-0 flex-1 items-center overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[k.length===0?i.jsxs("button",{type:"button",onClick:p,className:"flex h-8 min-w-0 items-center gap-2 border-r border-border px-3 text-muted-foreground hover:bg-muted/40 hover:text-foreground",children:[i.jsx(On,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:g("vscodeWorkbench.workspace.openFirst",{defaultValue:"Open a workspace"})})]}):k.map(({tab:_,project:I})=>{const R=_.id===b;return i.jsxs("div",{onContextMenu:S=>A(S,_),className:xe("group relative flex h-8 w-52 shrink-0 items-center border-r border-border px-2 transition-colors",R?"bg-background text-foreground shadow-[inset_0_-2px_0_hsl(var(--primary))]":"text-muted-foreground hover:bg-muted/30 hover:text-foreground"),title:`${_.label} - ${Tu(I)}`,children:[i.jsx("button",{type:"button",onClick:()=>c(_.id),className:xe("mr-1 rounded p-0.5 transition hover:bg-muted",_.starred?"text-amber-500":"text-muted-foreground/60 opacity-0 group-hover:opacity-100"),"aria-label":g("vscodeWorkbench.workspace.toggleStar",{name:_.label,defaultValue:"Star {{name}}"}),title:g("vscodeWorkbench.workspace.toggleStar",{name:_.label,defaultValue:"Star {{name}}"}),children:i.jsx(yi,{className:"h-3.5 w-3.5"})}),x===_.id?i.jsx("input",{value:v,autoFocus:!0,onChange:S=>w(S.target.value),onBlur:j,onKeyDown:S=>{S.key==="Enter"&&j(),S.key==="Escape"&&(y(null),w(""))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-background px-1 py-0.5 text-xs text-foreground outline-none"}):i.jsxs("button",{type:"button",onClick:()=>n(_),onDoubleClick:()=>N(_),className:"min-w-0 flex-1 text-left",children:[i.jsx("div",{className:"truncate font-medium",children:_.label}),i.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:Tu(I)})]}),i.jsx("div",{className:"ml-1 flex shrink-0 items-center gap-0.5 opacity-70 group-hover:opacity-100",children:i.jsx("button",{type:"button",onClick:()=>a(_.id),className:"rounded p-0.5 hover:bg-muted hover:text-foreground","aria-label":g("vscodeWorkbench.workspace.close",{name:_.label,defaultValue:"Close {{name}}"}),title:g("vscodeWorkbench.workspace.close",{name:_.label,defaultValue:"Close {{name}}"}),children:i.jsx(At,{className:"h-3.5 w-3.5"})})})]},_.id)}),i.jsx("button",{type:"button",onClick:p,className:"flex h-8 w-10 shrink-0 items-center justify-center border-r border-border bg-muted/10 text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground","aria-label":g("vscodeWorkbench.workspace.add",{defaultValue:"Add workspace"}),title:g("vscodeWorkbench.workspace.add",{defaultValue:"Add workspace"}),children:i.jsx(Zt,{className:"h-3.5 w-3.5"})})]}),i.jsx("button",{type:"button",className:"flex h-full w-8 shrink-0 items-center justify-center border-l border-border text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>E("right"),"aria-label":g("vscodeWorkbench.workspace.scrollRight",{defaultValue:"Scroll workspaces right"}),title:g("vscodeWorkbench.workspace.scrollRight",{defaultValue:"Scroll workspaces right"}),children:i.jsx(Dn,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:xe("flex h-full w-10 shrink-0 items-center justify-center border-l border-border text-muted-foreground transition hover:bg-muted hover:text-foreground",f&&"bg-muted/40 text-foreground"),onClick:h,"aria-label":f?g("vscodeWorkbench.cli.showPanel",{defaultValue:"Show CLI panel"}):g("vscodeWorkbench.cli.hidePanel",{defaultValue:"Hide CLI panel"}),title:f?g("vscodeWorkbench.cli.showPanel",{defaultValue:"Show CLI panel"}):g("vscodeWorkbench.cli.hidePanel",{defaultValue:"Hide CLI panel"}),children:f?i.jsx(Pu,{className:"h-3.5 w-3.5"}):i.jsx(Gl,{className:"h-3.5 w-3.5"})}),d&&T&&i.jsx(jie,{context:d,tab:T.tab,onClose:()=>u(null),onRename:()=>N(T.tab),onToggleStar:()=>c(T.tab.id),onCloseTab:()=>a(T.tab.id),onCloseOthers:()=>s(T.tab.id),onCloseAll:o,t:g})]})}function jie({context:e,tab:t,onClose:r,onRename:n,onToggleStar:a,onCloseTab:s,onCloseOthers:o,onCloseAll:l,t:c}){m.useEffect(()=>{const u=()=>r(),p=f=>{f.key==="Escape"&&r()};return window.addEventListener("mousedown",u),window.addEventListener("keydown",p),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("keydown",p)}},[r]);const d=u=>p=>{p.stopPropagation(),u(),r()};return i.jsxs("div",{className:"fixed z-50 w-48 overflow-hidden rounded-md border border-border bg-popover py-1 text-xs text-popover-foreground shadow-xl shadow-black/10",style:{left:e.x,top:e.y},onMouseDown:u=>u.stopPropagation(),children:[i.jsxs("button",{type:"button",onClick:d(n),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted",children:[i.jsx(NN,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.workspace.rename",{defaultValue:"Rename"})]}),i.jsxs("button",{type:"button",onClick:d(a),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted",children:[i.jsx(yi,{className:"h-3.5 w-3.5"}),t.starred?c("vscodeWorkbench.workspace.unstar",{defaultValue:"Unstar"}):c("vscodeWorkbench.workspace.star",{defaultValue:"Star"})]}),i.jsx("div",{className:"my-1 border-t border-border"}),i.jsxs("button",{type:"button",onClick:d(s),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted",children:[i.jsx(At,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.workspace.closeAction",{defaultValue:"Close workspace"})]}),i.jsxs("button",{type:"button",onClick:d(o),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted",children:[i.jsx(Pu,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.workspace.closeOthers",{defaultValue:"Close others"})]}),i.jsxs("button",{type:"button",onClick:d(l),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-red-600 hover:bg-muted dark:text-red-300",children:[i.jsx(At,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.workspace.closeAll",{defaultValue:"Close all"})]})]})}function Iie({context:e,file:t,onClose:r,onCloseTab:n,onCloseAll:a,onCopyPath:s,onSplitRight:o,onSplitMoveRight:l,t:c}){if(m.useEffect(()=>{const u=()=>r(),p=f=>{f.key==="Escape"&&r()};return window.addEventListener("click",u),window.addEventListener("keydown",p),()=>{window.removeEventListener("click",u),window.removeEventListener("keydown",p)}},[r]),!t)return null;const d=[{id:"close",label:c("vscodeWorkbench.editor.context.close",{defaultValue:"Close"}),icon:At,action:()=>n(t.path)},{id:"closeAllTabs",label:c("vscodeWorkbench.editor.context.closeAll",{defaultValue:"Close All"}),icon:At,action:a},{id:"copyPath",label:c("vscodeWorkbench.editor.context.copyPath",{defaultValue:"Copy Path"}),icon:bo,action:()=>s(t.path)},{id:"splitRight",label:c("vscodeWorkbench.editor.context.splitRight",{defaultValue:"Split Right"}),icon:jg,action:()=>o(t.path)},{id:"splitMoveRight",label:c("vscodeWorkbench.editor.context.splitMoveRight",{defaultValue:"Split and Move Right"}),icon:Gl,action:()=>l(t.path)}];return i.jsxs("div",{className:"fixed z-[80] w-56 overflow-hidden rounded-md border border-border bg-popover py-1 text-xs text-popover-foreground shadow-xl shadow-black/15",style:{left:e.x,top:e.y},onClick:u=>u.stopPropagation(),children:[i.jsxs("div",{className:"border-b border-border px-3 py-2 text-[11px] text-muted-foreground",children:[i.jsx("div",{className:"truncate font-medium text-foreground",children:t.name}),i.jsx("div",{className:"truncate font-mono",children:t.path})]}),d.map(u=>{const p=u.icon;return i.jsxs("button",{type:"button",onClick:u.action,className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted",children:[i.jsx(p,{className:"h-3.5 w-3.5 text-muted-foreground"}),u.label]},u.id)})]})}function _ie({project:e,mode:t,hermesInstallStatus:r,hermesInstallJob:n,runId:a,forceNewSession:s,command:o,commandTitle:l,height:c,isMinimized:d,isActive:u,onResizeStart:p,onMinimize:f,onRestore:h,onStartHermes:g,onOpenHistory:b,onInstallHermes:x,onClose:y,t:v}){const w=t==="hermes"||t==="hermes-install",C=r?.installed===!0,k=t==="hermes-install"?v("vscodeWorkbench.hermes.installTitle",{defaultValue:"Install Hermes Agent"}):t==="hermes"?l||v("vscodeWorkbench.hermes.title",{defaultValue:"Hermes Agent"}):v("vscodeWorkbench.terminal.title",{defaultValue:"Terminal"}),N=o||"hermes";return i.jsxs("section",{className:"relative shrink-0 overflow-hidden bg-gray-950 text-gray-100",style:{height:d?mie:c},children:[!d&&i.jsx("button",{type:"button",className:"absolute inset-x-0 top-0 z-10 h-1 cursor-ns-resize bg-transparent hover:bg-blue-500/40",onPointerDown:p,"aria-label":v("vscodeWorkbench.terminal.resize",{defaultValue:"Resize terminal"}),title:v("vscodeWorkbench.terminal.resize",{defaultValue:"Resize terminal"})}),i.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-gray-800 bg-gray-900 px-3",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[w?i.jsx(uw,{className:"h-4 w-4"}):i.jsx(Xr,{className:"h-3.5 w-3.5 text-blue-300"}),i.jsx("span",{className:"truncate text-[11px] font-semibold uppercase tracking-wide text-gray-300",children:k}),i.jsx("span",{className:"truncate font-mono text-[10px] text-gray-500",children:e?_n(e):v("vscodeWorkbench.noProject")}),w&&C&&i.jsx("span",{className:"rounded bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-200",children:v("vscodeWorkbench.hermes.mcpLive",{defaultValue:"Pixcode MCP Live"})})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[w&&i.jsxs(i.Fragment,{children:[!C&&i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:x,"aria-label":v("vscodeWorkbench.hermes.install",{defaultValue:"Install"}),title:v("vscodeWorkbench.hermes.install",{defaultValue:"Install"}),children:i.jsx(Xn,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:b,"aria-label":v("vscodeWorkbench.hermes.history",{defaultValue:"Hermes history"}),title:v("vscodeWorkbench.hermes.history",{defaultValue:"Hermes history"}),children:i.jsx(Po,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:g,"aria-label":v("vscodeWorkbench.hermes.newSession",{defaultValue:"New Hermes session"}),title:v("vscodeWorkbench.hermes.newSession",{defaultValue:"New Hermes session"}),children:i.jsx(Zt,{className:"h-3.5 w-3.5"})})]}),d?i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:h,"aria-label":v("vscodeWorkbench.terminal.restore",{defaultValue:"Restore terminal"}),title:v("vscodeWorkbench.terminal.restore",{defaultValue:"Restore terminal"}),children:i.jsx(mc,{className:"h-3.5 w-3.5"})}):i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:f,"aria-label":v("vscodeWorkbench.terminal.minimize",{defaultValue:"Minimize terminal"}),title:v("vscodeWorkbench.terminal.minimize",{defaultValue:"Minimize terminal"}),children:i.jsx(SN,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:y,"aria-label":v("vscodeWorkbench.terminal.close",{defaultValue:"Close terminal"}),title:v("vscodeWorkbench.terminal.close",{defaultValue:"Close terminal"}),children:i.jsx(At,{className:"h-3.5 w-3.5"})})]})]}),!d&&i.jsx("div",{className:"h-[calc(100%-2rem)] min-h-0",children:t==="hermes-install"?i.jsx(Rie,{installJob:n,onRetry:x,onStart:g,t:v}):t==="hermes"?i.jsx(Vl,{project:e,session:null,command:N,isPlainShell:!0,forceNewSession:s,showHeader:!1,autoConnect:!!e,isActive:u,title:k},`hermes-terminal-${e?_n(e):"none"}-${a}`):i.jsx(Vl,{project:e,session:null,isPlainShell:!0,forceNewSession:s,showHeader:!1,autoConnect:!!e,isActive:u,title:k},`bottom-terminal-${t}-${e?_n(e):"none"}-${a}`)})]})}function Rie({installJob:e,onRetry:t,onStart:r,t:n}){const a=e.state==="running",s=e.state==="done",o=e.state==="error",l=m.useRef(null);return m.useEffect(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[e.error,e.log,e.state]),i.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-gray-950",children:[i.jsxs("div",{className:"flex h-9 shrink-0 items-center justify-between border-b border-gray-800 px-3",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-[11px] text-gray-300",children:[a?i.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin text-emerald-300"}):i.jsx(_r,{className:"h-3.5 w-3.5 text-emerald-300"}),i.jsx("span",{className:"truncate",children:a?n("vscodeWorkbench.hermes.installRunning",{defaultValue:"Installing Hermes through Pixcode API..."}):s?n("vscodeWorkbench.hermes.installDone",{defaultValue:"Hermes installed and Pixcode MCP configured."}):o?n("vscodeWorkbench.hermes.installError",{defaultValue:"Hermes install failed."}):n("vscodeWorkbench.hermes.installReady",{defaultValue:"Ready to install Hermes."})})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s&&i.jsx("button",{type:"button",className:"rounded bg-emerald-600 px-2 py-1 text-[11px] font-medium text-white hover:bg-emerald-500",onClick:r,children:n("vscodeWorkbench.hermes.start",{defaultValue:"Start Hermes"})}),o&&i.jsx("button",{type:"button",className:"rounded bg-gray-800 px-2 py-1 text-[11px] font-medium text-gray-100 hover:bg-gray-700",onClick:t,children:n("vscodeWorkbench.hermes.retryInstall",{defaultValue:"Retry install"})})]})]}),e.error&&i.jsx("div",{className:"border-b border-red-900/60 bg-red-950/40 px-3 py-2 text-[11px] text-red-100",children:e.error}),i.jsx("pre",{ref:l,className:"min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-words p-3 font-mono text-[11px] leading-5 text-gray-200",children:e.log||n("vscodeWorkbench.hermes.installWaiting",{defaultValue:"Waiting for Hermes install logs..."})})]})}function Lie({selectedProject:e,onFileOpen:t,t:r}){return i.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:i.jsx(ag,{selectedProject:e,onFileOpen:t})})}function Pie({projects:e,onProjectSelect:t,onNewSession:r,onOpenProject:n,onCloneProject:a,onQuickStartSession:s,onOpenHermesAgent:o,onShowSettings:l,t:c}){const d=e.slice(0,6);return i.jsx("div",{className:"h-full overflow-auto bg-background",children:i.jsx("div",{className:"mx-auto flex max-w-6xl flex-col gap-6 p-4 sm:p-6",children:i.jsxs("section",{className:"min-w-0",children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-primary",children:"Pixcode"}),i.jsx("h2",{className:"mt-2 text-2xl font-semibold text-foreground",children:c("vscodeWorkbench.welcome.title",{defaultValue:"Hoş geldin"})}),i.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:c("vscodeWorkbench.welcome.description",{defaultValue:"Bir proje aç, GitHub’dan klonla veya Hermes’i alt terminalde başlat."})})]}),i.jsxs("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 13rem), 1fr))"},children:[i.jsxs("button",{type:"button",onClick:n,className:"group flex min-h-24 flex-col items-start justify-between rounded-md border border-border bg-card p-4 text-left transition hover:border-primary/50 hover:bg-muted/30",children:[i.jsx(On,{className:"h-5 w-5 text-blue-400"}),i.jsx("span",{className:"mt-4 text-sm font-semibold text-foreground",children:c("vscodeWorkbench.welcome.openProject",{defaultValue:"Proje Aç"})}),i.jsx("span",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:c("vscodeWorkbench.welcome.openProjectDescription",{defaultValue:"Yerel klasörü workspace olarak bağla."})})]}),i.jsxs("button",{type:"button",onClick:a,className:"group flex min-h-24 flex-col items-start justify-between rounded-md border border-border bg-card p-4 text-left transition hover:border-primary/50 hover:bg-muted/30",children:[i.jsx(Ou,{className:"h-5 w-5 text-foreground"}),i.jsx("span",{className:"mt-4 text-sm font-semibold text-foreground",children:c("vscodeWorkbench.welcome.cloneProject",{defaultValue:"Klonla"})}),i.jsx("span",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:c("vscodeWorkbench.welcome.cloneProjectDescription",{defaultValue:"GitHub reposunu seçtiğin klasöre çek."})})]}),i.jsxs("button",{type:"button",onClick:o,className:"group flex min-h-24 flex-col items-start justify-between rounded-md border border-emerald-700/70 bg-emerald-950/20 p-4 text-left transition hover:border-emerald-400/70 hover:bg-emerald-950/30",children:[i.jsx(uw,{className:"h-5 w-5"}),i.jsx("span",{className:"mt-4 text-sm font-semibold text-foreground",children:c("vscodeWorkbench.welcome.startHermes",{defaultValue:"Hermes’i Başlat"})}),i.jsx("span",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:c("vscodeWorkbench.welcome.startHermesDescription",{defaultValue:"Aktif projede agent terminalini aç."})})]})]}),i.jsx("div",{className:"mt-4 rounded-md border border-border bg-card/70 p-3 sm:p-4",children:i.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-sm font-semibold text-foreground",children:c("vscodeWorkbench.welcome.appearanceTitle",{defaultValue:"Görünüm"})}),i.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:c("vscodeWorkbench.welcome.appearanceDescription",{defaultValue:"Pixcode koyu modla başlar; gerekirse açık moda geçebilirsin."})})]}),i.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 rounded border border-border bg-background px-3 py-2",children:[i.jsx("span",{className:"text-xs font-medium text-foreground",children:c("vscodeWorkbench.welcome.darkMode",{defaultValue:"Koyu mod"})}),i.jsx(Jd,{ariaLabel:c("vscodeWorkbench.welcome.themeToggle",{defaultValue:"Tema modunu değiştir"})})]}),i.jsxs("button",{type:"button",onClick:l,className:"inline-flex items-center justify-center gap-2 rounded border border-border px-3 py-2 text-xs font-medium text-foreground hover:bg-muted",children:[i.jsx(Ut,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.welcome.themeSettings",{defaultValue:"Tema ayarları"})]})]})]})}),i.jsxs("div",{className:"mt-7",children:[i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[i.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:c("vscodeWorkbench.welcome.recentProjects",{defaultValue:"Son projeler"})}),s&&i.jsxs("button",{type:"button",onClick:()=>{s()},className:"inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground",children:[i.jsx(Mn,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.welcome.newChat",{defaultValue:"Yeni sohbet"})]})]}),d.length>0?i.jsx("div",{className:"grid gap-2 xl:grid-cols-2",children:d.map(f=>i.jsxs("div",{role:"button",tabIndex:0,className:"cursor-pointer rounded-md border border-border bg-card/60 p-3 text-left transition hover:border-primary/40 hover:bg-muted/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onClick:()=>t(f),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),t(f))},title:_n(f),children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:f.displayName||f.name}),i.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted-foreground",children:Tu(f)})]}),i.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:dI(f.fileCount,c)})]}),i.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[i.jsx("span",{className:"rounded bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary",children:c("vscodeWorkbench.projects.workHere",{defaultValue:"Work in this folder"})}),i.jsx("span",{role:"button",tabIndex:0,className:"rounded border border-border px-2 py-1 text-[11px] text-foreground",onClick:h=>{h.stopPropagation(),t(f),r(f)},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),h.stopPropagation(),t(f),r(f))},children:c("vscodeWorkbench.projects.startChat",{defaultValue:"Chat"})})]})]},f.name))}):i.jsxs("div",{className:"rounded-md border border-dashed border-border p-8 text-center",children:[i.jsx($r,{className:"mx-auto mb-3 h-8 w-8 text-muted-foreground"}),i.jsx("div",{className:"text-sm font-medium text-foreground",children:c("vscodeWorkbench.projects.emptyTitle",{defaultValue:"No project directories yet"})}),i.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:c("vscodeWorkbench.projects.emptyDescription",{defaultValue:"Open a local folder or clone a repository to start."})})]})]})]})})})}const Rh=dw.map(e=>({id:e,label:Kn[e]??e}));function Hs(e,t,r){return(e??[]).map(n=>({...n,__provider:n.__provider??t,__projectName:n.__projectName??r}))}function Die(e){return e?[...Hs(e.sessions,"claude",e.name),...Hs(e.codexSessions,"codex",e.name),...Hs(e.cursorSessions,"cursor",e.name),...Hs(e.geminiSessions,"gemini",e.name),...Hs(e.qwenSessions,"qwen",e.name),...Hs(e.opencodeSessions,"opencode",e.name)]:[]}function Oie({project:e,session:t,hermesCliLaunch:r,onSessionSelect:n,t:a}){const[s,o]=m.useState(()=>{if(typeof window>"u")return"claude";const ue=window.localStorage.getItem("selected-provider");return Rh.some(de=>de.id===ue)?ue:"claude"}),[l,c]=m.useState(!1),[d,u]=m.useState(null),[p,f]=m.useState(!1),[h,g]=m.useState(!1),[b,x]=m.useState("provider"),[y,v]=m.useState(null),[w,C]=m.useState(null),[k,N]=m.useState(null),[j,A]=m.useState({runId:0,forceNewSession:!1}),[E,T]=m.useState({provider:null,state:"idle",log:"",error:null}),_=m.useRef(null),{providerAuthStatus:I,refreshProviderAuthStatuses:R}=Lu({initialLoading:!1}),S=m.useMemo(()=>Die(e),[e]),F=I[s],B=d?.__provider===s?d:null,z=d?.id??t?.id??null,q=!!(e&&F?.installed!==!1&&E.state!=="running"),V=!!(p&&b==="provider"&&q),P=m.useMemo(()=>Zs(e),[e]),U=m.useRef(null),H=m.useRef(0);m.useEffect(()=>{const ue=Rh.map(de=>de.id);R(ue)},[R]),m.useEffect(()=>{if(U.current===P)return;U.current=P,c(!1),g(!1),x("provider"),N(null);const ue=vie(P);if(!ue){f(!1),u(null);return}o(ue.provider),window.localStorage.setItem("selected-provider",ue.provider),u(ue.sessionId?S.find(de=>de.id===ue.sessionId&&de.__provider===ue.provider)??null:null),f(ue.isTerminalOpen),ue.isTerminalOpen&&A(de=>({runId:de.runId+1,forceNewSession:!1}))},[P,S]),m.useEffect(()=>()=>{try{_.current?.close()}catch{}},[]);const M=m.useCallback(ue=>{wie(P,{...ue,updatedAt:Date.now()})},[P]),ee=m.useCallback(ue=>{e&&Se("/api/shell/sessions/terminate",{method:"POST",body:JSON.stringify({projectPath:e.fullPath||e.path||"",provider:ue})}).catch(()=>{})},[e]),Q=m.useCallback(ue=>{I[ue]?.installed!==!1&&(x("provider"),N(null),o(ue),window.localStorage.setItem("selected-provider",ue),M({provider:ue,isTerminalOpen:p,sessionId:d?.id??null}))},[p,M,I,d?.id]),ge=m.useCallback(async ue=>{T({provider:ue,state:"running",log:"",error:null});try{_.current?.close()}catch{}_.current=null;try{const de=await Se(`/api/providers/${ue}/install`,{method:"POST",body:"{}"}),D=await de.json().catch(()=>({}));if(!de.ok||!D?.success)throw new Error(D?.error||`HTTP ${de.status}`);if(D.data?.manual)throw new Error(D.data?.message||a("vscodeWorkbench.cli.manualInstall",{defaultValue:"This CLI needs manual installation."}));const X=D.data?.jobId;if(!X)throw new Error(a("vscodeWorkbench.cli.installNoJob",{defaultValue:"Install did not return a job id."}));const oe=window.localStorage.getItem("auth-token")||"",K=`/api/providers/${ue}/install/${X}/stream${oe?`?token=${encodeURIComponent(oe)}`:""}`,W=new EventSource(K);_.current=W,W.addEventListener("log",ne=>{try{const me=JSON.parse(ne.data);typeof me.chunk=="string"&&T(we=>({...we,log:`${we.log}${me.chunk}`}))}catch{}}),W.addEventListener("done",ne=>{try{const me=JSON.parse(ne.data);if(!me.success)throw new Error(me.error||a("vscodeWorkbench.cli.installFailed",{defaultValue:"Install failed."}));T(we=>({...we,state:"done",error:null})),R([ue],{force:!0}),o(ue),window.localStorage.setItem("selected-provider",ue)}catch(me){T(we=>({...we,state:"error",error:me instanceof Error?me.message:a("vscodeWorkbench.cli.installFailed",{defaultValue:"Install failed."})}))}finally{try{W.close()}catch{}_.current=null}}),W.onerror=()=>{T(ne=>ne.state==="running"?{...ne,state:"error",error:a("vscodeWorkbench.cli.installStreamLost",{defaultValue:"Install stream closed early. The install may still be running."})}:ne)}}catch(de){T({provider:ue,state:"error",log:"",error:de instanceof Error?de.message:a("vscodeWorkbench.cli.installFailed",{defaultValue:"Install failed."})})}},[R,a]),se=m.useCallback(({forceNewSession:ue=!1}={})=>{e&&q&&(x("provider"),v(null),C(null),N(null),u(null),c(!1),g(!1),window.localStorage.setItem("selected-provider",s),f(!0),A(de=>({runId:de.runId+1,forceNewSession:ue})),M({provider:s,isTerminalOpen:!0,sessionId:null}))},[q,M,e,s]),ce=m.useCallback(()=>{se({forceNewSession:h})},[h,se]);m.useEffect(()=>{if(!r||H.current===r.id)return;H.current=r.id;const ue=r.provider;if(!dw.includes(ue))return;const de=r.bypassPermissions===!0||r.skipPermissions===!0,D=typeof r.permissionMode=="string"&&r.permissionMode.trim()?r.permissionMode.trim():de?"bypassPermissions":null;x("provider"),o(ue),v(r.startupInput||null),C(r.id),N(D||de?{permissionMode:D,skipPermissions:de}:null),window.localStorage.setItem("selected-provider",ue),u(null),c(!1),g(!1),f(!0),A(X=>({runId:X.runId+1,forceNewSession:!0})),M({provider:ue,isTerminalOpen:!0,sessionId:null})},[r,M]);const ye=m.useCallback(()=>{ee(s),x("provider"),v(null),C(null),N(null),u(null),c(!1),f(!1),g(!0),M({provider:s,isTerminalOpen:!1,sessionId:null})},[M,s,ee]),pe=m.useCallback(()=>{x("provider"),v(null),C(null),N(null),c(!1),f(!1),g(!1),M({provider:s,isTerminalOpen:!1,sessionId:d?.id??null})},[M,s,d?.id]),ve=m.useCallback(ue=>{const de=ue.__provider??"claude";x("provider"),v(null),C(null),N(null),o(de),window.localStorage.setItem("selected-provider",de),u(ue),n(ue),c(!1),g(!1),f(!0),A(D=>({runId:D.runId+1,forceNewSession:!1})),M({provider:de,isTerminalOpen:!0,sessionId:ue.id})},[n,M]);return p?i.jsxs("div",{className:"relative flex h-full min-h-0 flex-col bg-gray-950 text-gray-100",children:[i.jsx(Mie,{project:e,provider:s,session:B,historyCount:S.length,historyOpen:l,canStart:q,onToggleHistory:()=>c(ue=>!ue),onNewSession:ye,onCloseTerminal:pe,t:a}),l&&i.jsx("div",{className:"absolute inset-x-2 top-10 z-30 max-h-[48%] overflow-hidden rounded-md border border-gray-800 bg-gray-950 shadow-2xl shadow-black/40",children:i.jsx(SC,{sessions:S,activeSessionId:z,onSessionSelect:ve,t:a})}),i.jsx("div",{className:"min-h-0 flex-1",children:i.jsx(Vl,{project:e,session:B,forceNewSession:j.forceNewSession,startupInput:y,hermesLaunchId:w,permissionOverride:k,showHeader:!0,autoConnect:V,isActive:!0,onClose:pe},`${s}-${B?.id||"new"}-${e?.name||"none"}-${j.runId}`)})]}):i.jsx("div",{className:"flex h-full min-h-0 flex-col bg-gray-950 text-gray-100",children:i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-b border-gray-800 bg-gray-900/95 p-2",children:[i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"truncate text-xs font-semibold text-gray-100",children:e?.displayName||e?.name||a("vscodeWorkbench.noProject")}),i.jsx("div",{className:"text-[11px] text-gray-400",children:a("vscodeWorkbench.cli.chooseDescription",{defaultValue:"Choose a CLI, then start a full-height terminal."})})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx("button",{type:"button",className:"rounded border border-gray-700 p-1.5 text-gray-200 hover:bg-gray-800 disabled:opacity-50",disabled:!q,onClick:ce,title:a("vscodeWorkbench.cli.newSession",{defaultValue:"New CLI session"}),"aria-label":a("vscodeWorkbench.cli.newSession",{defaultValue:"New CLI session"}),children:i.jsx(Zt,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:xe("rounded border border-gray-700 p-1.5 text-gray-200 hover:bg-gray-800 disabled:opacity-50",l&&"bg-gray-800"),disabled:!e,onClick:()=>c(ue=>!ue),title:a("vscodeWorkbench.cli.history",{defaultValue:"History"}),"aria-label":a("vscodeWorkbench.cli.history",{defaultValue:"History"}),children:i.jsx(Po,{className:"h-3.5 w-3.5"})})]})]}),i.jsxs("div",{className:"mb-2 flex items-center gap-2 rounded border border-gray-800 bg-gray-950 px-2.5 py-2",children:[i.jsx(Xr,{className:"h-4 w-4 shrink-0 text-blue-300"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-[11px] font-semibold text-gray-200",children:a("vscodeWorkbench.cli.chooseTitle",{defaultValue:"Start a CLI terminal"})}),i.jsx("div",{className:"truncate text-[10px] text-gray-500",children:a("vscodeWorkbench.cli.projectScoped",{defaultValue:"Project-scoped CLI terminal"})})]})]}),i.jsx("div",{className:"grid min-h-0 gap-1.5 overflow-y-auto pr-1",children:Rh.map(ue=>{const de=I[ue.id],D=s===ue.id,X=de?.installed===!1,oe=!!de?.loading,K=E.provider===ue.id&&E.state==="running",W=!!(de?.updateAvailable&&de.latestVersion&&!X),ne=K?a("vscodeWorkbench.cli.installing",{defaultValue:"Installing..."}):oe?a("vscodeWorkbench.cli.checking",{defaultValue:"Checking..."}):X?a("vscodeWorkbench.cli.notInstalled",{defaultValue:"Not installed"}):W?a("vscodeWorkbench.cli.updateAvailable",{version:de?.latestVersion,defaultValue:"Update {{version}}"}):de?.installedVersion||a("vscodeWorkbench.cli.ready",{defaultValue:"Ready"});return i.jsxs("div",{className:xe("group flex min-w-0 items-center gap-2 rounded border px-2 py-2 transition-colors",D&&!X?"border-blue-500 bg-blue-500/15 text-blue-100":"border-gray-800 bg-gray-900 text-gray-300 hover:border-gray-700 hover:bg-gray-800",X&&"border-amber-800/70 bg-amber-950/30 text-amber-100"),children:[i.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left",onClick:()=>{if(X){ge(ue.id);return}Q(ue.id)},title:Kn[ue.id]??ue.label,children:[i.jsx(dr,{provider:ue.id,className:xe("h-4 w-4 shrink-0",X&&"opacity-70 grayscale")}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"truncate text-[11px] font-semibold",children:ue.label}),i.jsx("div",{className:xe("truncate text-[10px]",X?"text-amber-300":W?"text-amber-200":"text-gray-500"),children:ne})]}),D&&!X&&i.jsx(tr,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-blue-200"})]}),(X||W)&&i.jsx("button",{type:"button",disabled:K,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded bg-gray-800 text-amber-200 hover:bg-gray-700 disabled:opacity-50",onClick:()=>void ge(ue.id),"aria-label":X?a("vscodeWorkbench.cli.installProvider",{provider:ue.label,defaultValue:"Install {{provider}}"}):a("vscodeWorkbench.cli.updateProvider",{provider:ue.label,defaultValue:"Update {{provider}}"}),title:X?a("vscodeWorkbench.cli.installProvider",{provider:ue.label,defaultValue:"Install {{provider}}"}):a("vscodeWorkbench.cli.updateProvider",{provider:ue.label,defaultValue:"Update {{provider}}"}),children:K?i.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin"}):X?i.jsx(Xn,{className:"h-3.5 w-3.5"}):i.jsx(it,{className:"h-3.5 w-3.5"})})]},ue.id)})}),l&&i.jsx(SC,{sessions:S,activeSessionId:z,onSessionSelect:ve,t:a}),(E.state==="running"||E.state==="done"||E.state==="error")&&i.jsxs("div",{className:"mt-2 rounded border border-gray-800 bg-gray-950 p-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-gray-300",children:[E.state==="running"&&i.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin text-amber-300"}),E.state==="done"&&i.jsx(tr,{className:"h-3.5 w-3.5 text-emerald-300"}),E.state==="error"&&i.jsx(Yn,{className:"h-3.5 w-3.5 text-red-300"}),i.jsxs("span",{className:"truncate",children:[E.provider?Kn[E.provider]:a("vscodeWorkbench.cli.provider",{defaultValue:"Provider"})," ",E.state==="running"?a("vscodeWorkbench.cli.installRunning",{defaultValue:"is installing"}):E.state==="done"?a("vscodeWorkbench.cli.installDone",{defaultValue:"is ready"}):a("vscodeWorkbench.cli.installError",{defaultValue:"needs attention"})]})]}),E.error&&i.jsx("div",{className:"mt-1 text-[11px] text-red-300",children:E.error}),E.log&&i.jsx("pre",{className:"mt-2 max-h-20 overflow-y-auto rounded bg-black/40 p-2 font-mono text-[10px] leading-relaxed text-gray-300",children:E.log})]}),i.jsxs("button",{type:"button",disabled:!q,onClick:ce,className:"mt-2 flex h-10 w-full items-center justify-center gap-2 rounded bg-blue-600 px-3 text-xs font-semibold text-white transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:bg-gray-800 disabled:text-gray-500",children:[i.jsx(Xr,{className:"h-4 w-4"}),a("vscodeWorkbench.cli.startSelected",{provider:Kn[s]??s,defaultValue:"Start {{provider}}"})]})]})})}function Mie({project:e,provider:t,session:r,historyCount:n,historyOpen:a,canStart:s,onToggleHistory:o,onNewSession:l,onCloseTerminal:c,t:d}){return i.jsxs("div",{className:"flex h-10 shrink-0 items-center justify-between gap-2 border-b border-gray-800 bg-gray-900/95 px-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(dr,{provider:t,className:"h-4 w-4 shrink-0"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"truncate text-[11px] font-semibold text-gray-100",children:Kn[t]??t}),i.jsx("div",{className:"truncate text-[10px] text-gray-500",children:r?hg(r):e?.displayName||e?.name||d("vscodeWorkbench.cli.newSession",{defaultValue:"New CLI session"})})]})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsxs("button",{type:"button",className:xe("relative rounded border border-gray-700 p-1.5 text-gray-200 hover:bg-gray-800 disabled:opacity-50",a&&"bg-gray-800"),disabled:!e,onClick:o,title:d("vscodeWorkbench.cli.history",{defaultValue:"History"}),"aria-label":d("vscodeWorkbench.cli.history",{defaultValue:"History"}),children:[i.jsx(Po,{className:"h-3.5 w-3.5"}),n>0&&i.jsx("span",{className:"absolute -right-1 -top-1 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-blue-600 px-0.5 text-[8px] font-semibold text-white",children:Math.min(n,9)})]}),i.jsx("button",{type:"button",className:"rounded border border-gray-700 p-1.5 text-gray-200 hover:bg-gray-800 disabled:opacity-50",disabled:!s,onClick:l,title:d("vscodeWorkbench.cli.newSession",{defaultValue:"New CLI session"}),"aria-label":d("vscodeWorkbench.cli.newSession",{defaultValue:"New CLI session"}),children:i.jsx(Zt,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"rounded border border-gray-700 p-1.5 text-gray-200 hover:bg-gray-800",onClick:c,title:d("vscodeWorkbench.cli.closeTerminal",{defaultValue:"Close CLI terminal"}),"aria-label":d("vscodeWorkbench.cli.closeTerminal",{defaultValue:"Close CLI terminal"}),children:i.jsx(At,{className:"h-3.5 w-3.5"})})]})]})}function SC({sessions:e,activeSessionId:t,onSessionSelect:r,t:n}){const a=m.useMemo(()=>[...e].sort((s,o)=>{const l=fg(s),c=fg(o);return new Date(c||0).getTime()-new Date(l||0).getTime()}),[e]);return i.jsxs("div",{className:"mt-2 overflow-hidden rounded-md border border-gray-800 bg-gray-950",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-gray-800 px-2.5 py-2",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:n("vscodeWorkbench.cli.projectHistory",{defaultValue:"Project history"})}),i.jsx("span",{className:"rounded bg-gray-800 px-1.5 py-0.5 text-[10px] text-gray-400",children:e.length})]}),i.jsx("div",{className:"max-h-52 overflow-y-auto p-1.5",children:a.length===0?i.jsx("div",{className:"px-3 py-4 text-center text-[11px] leading-5 text-gray-500",children:n("vscodeWorkbench.cli.noHistory",{defaultValue:"No sessions for this project yet."})}):a.map(s=>{const o=t===s.id,l=s.__provider??"claude";return i.jsxs("button",{type:"button",className:xe("flex w-full min-w-0 items-center gap-2 rounded px-2.5 py-2 text-left transition-colors hover:bg-gray-900",o&&"bg-blue-500/15 text-blue-100"),onClick:()=>r(s),title:hg(s),children:[i.jsx(dr,{provider:l,className:"h-4 w-4 shrink-0"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-[11px] font-medium text-gray-200",children:hg(s)}),i.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 text-[10px] text-gray-500",children:[i.jsx("span",{className:"truncate",children:Kn[l]??l}),kC(s)&&i.jsxs("span",{className:"shrink-0",children:["- ",kC(s)]})]})]})]},`${l}-${s.id}`)})})]})}function Fie({projects:e,selectedProject:t,onProjectSelect:r,onNewSession:n,onOpenProject:a,onCloneProject:s,onRefresh:o,isRefreshing:l,t:c}){return i.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.jsx("div",{className:"border-b border-border p-1.5",children:i.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[i.jsxs("button",{type:"button",onClick:a,className:"flex min-w-0 items-center justify-center gap-1 rounded border border-border px-2 py-1 text-[11px] font-medium text-foreground transition-colors hover:bg-muted",children:[i.jsx(On,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:c("vscodeWorkbench.projects.openProject",{defaultValue:"Open Project"})})]}),i.jsxs("button",{type:"button",onClick:s,className:"flex min-w-0 items-center justify-center gap-1 rounded border border-border px-2 py-1 text-[11px] font-medium text-foreground transition-colors hover:bg-muted",children:[i.jsx(Ou,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:c("vscodeWorkbench.projects.cloneFromGithub",{defaultValue:"Clone"})})]})]})}),i.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2.5 py-1.5",children:[i.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:c("vscodeWorkbench.projects.directoryList",{defaultValue:"Directories"})}),i.jsx("button",{type:"button",onClick:()=>{o()},disabled:l,className:"rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",title:c("vscodeWorkbench.projects.refresh",{defaultValue:"Refresh projects"}),"aria-label":c("vscodeWorkbench.projects.refresh",{defaultValue:"Refresh projects"}),children:i.jsx(it,{className:xe("h-3.5 w-3.5",l&&"animate-spin")})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-1.5",children:e.length===0?i.jsx("div",{className:"flex h-full items-center justify-center px-4 text-center",children:i.jsxs("div",{children:[i.jsx($r,{className:"mx-auto mb-3 h-7 w-7 text-muted-foreground/70"}),i.jsx("div",{className:"text-sm font-medium text-foreground",children:c("vscodeWorkbench.projects.emptyTitle",{defaultValue:"No project directories yet"})}),i.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:c("vscodeWorkbench.projects.emptyDescription",{defaultValue:"Open a local folder or clone a repository to start."})})]})}):i.jsx("div",{className:"space-y-0.5",children:e.map(d=>{const u=t?.name===d.name;return i.jsxs("div",{role:"button",tabIndex:0,className:xe("group w-full cursor-pointer rounded border px-2 py-1.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",u?"border-primary/40 bg-primary/10":"border-transparent hover:border-border hover:bg-muted/40"),title:_n(d),onClick:()=>r(d),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),r(d))},children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx("span",{className:xe("h-1.5 w-1.5 shrink-0 rounded-full",u?"bg-primary":"bg-muted-foreground/30 group-hover:bg-muted-foreground/60")}),i.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:d.displayName||d.name})]}),i.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center justify-between gap-2 pl-3.5 text-[10px] text-muted-foreground",children:[i.jsx("span",{className:"truncate font-mono",children:Tu(d)}),i.jsx("span",{className:"shrink-0",children:dI(d.fileCount,c)})]}),i.jsx("div",{className:"mt-1.5 flex justify-end opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",children:i.jsx("button",{type:"button",className:"inline-flex h-6 w-6 items-center justify-center rounded border border-border text-foreground",onClick:p=>{p.stopPropagation(),r(d),n(d)},title:c("vscodeWorkbench.projects.startChat",{defaultValue:"Chat"}),"aria-label":c("vscodeWorkbench.projects.startChat",{defaultValue:"Chat"}),children:i.jsx(Mn,{className:"h-3 w-3"})})})]},d.name)})})})]})}function Td({icon:e,label:t,active:r,onClick:n}){return i.jsxs("button",{type:"button",className:xe("relative flex h-10 w-10 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",r&&"bg-primary/10 text-primary"),"aria-label":t,title:t,onClick:n,children:[r&&i.jsx("span",{className:"absolute left-0 h-5 w-0.5 rounded-r bg-primary"}),i.jsx(e,{className:"h-5 w-5"})]})}function zie({label:e,active:t,onClick:r}){return i.jsxs("button",{type:"button",className:xe("relative flex h-10 w-10 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",t&&"bg-emerald-500/10 text-emerald-500 dark:text-emerald-300"),"aria-label":e,title:e,onClick:r,children:[t&&i.jsx("span",{className:"absolute left-0 h-5 w-0.5 rounded-r bg-emerald-500"}),i.jsx(uw,{className:"h-5 w-5"})]})}function uw({className:e=""}){return i.jsx("img",{src:"/hermes-agent.png",alt:"","aria-hidden":"true",className:xe("rounded object-contain",e)})}function CC({label:e,active:t,onPointerDown:r}){return i.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-label":e,title:e,className:xe("group relative z-10 flex h-full w-2 shrink-0 cursor-col-resize items-center justify-center bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",t&&"bg-primary/5"),onPointerDown:r,children:i.jsx("span",{className:xe("h-full w-px bg-border transition-colors group-hover:bg-primary/60",t&&"bg-primary")})})}const hI="pixcode.inAppNotifications.v1",Bie="pixcode.notificationPreferences.v1",pw=25;function Uie(){try{const e=JSON.parse(localStorage.getItem(hI)??"[]");return Array.isArray(e)?e.slice(0,pw):[]}catch{return[]}}function NC(e){try{localStorage.setItem(hI,JSON.stringify(e.slice(0,pw)))}catch{}}function EC(){try{return JSON.parse(localStorage.getItem(Bie)??"null")?.channels?.inApp!==!1}catch{return!0}}function $ie(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||typeof t.title!="string"||typeof t.body!="string"?null:{id:t.id,title:t.title,body:t.body,eventType:t.eventType,category:t.category,preferenceKey:t.preferenceKey,kind:t.kind,code:t.code,severity:t.severity||"info",provider:t.provider??null,sessionId:t.sessionId??null,createdAt:t.createdAt||new Date().toISOString(),data:t.data}}function Hie(e){return e==="error"?"border-red-500/50 bg-red-50 text-red-950 dark:bg-red-950/35 dark:text-red-50":e==="warning"?"border-amber-500/50 bg-amber-50 text-amber-950 dark:bg-amber-950/35 dark:text-amber-50":"border-border bg-card text-card-foreground"}function Gie(e){if(!e)return"";try{return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return""}}function Vie({latestMessage:e}){const[t,r]=m.useState(()=>typeof window>"u"?[]:Uie()),[n,a]=m.useState(!1),[s,o]=m.useState(()=>new Set),[l,c]=m.useState(()=>typeof window>"u"?!0:EC());m.useEffect(()=>{const f=()=>c(EC());return window.addEventListener("storage",f),window.addEventListener("pixcode:notification-preferences-changed",f),()=>{window.removeEventListener("storage",f),window.removeEventListener("pixcode:notification-preferences-changed",f)}},[]),m.useEffect(()=>{const f=e;if(!f||f.type!=="notification:event")return;const h=$ie(f.notification);h&&(QC({key:h.id,title:h.title,body:h.body,event:h.eventType||h.kind||"updates",tag:typeof h.data?.tag=="string"?h.data.tag:h.id,data:h.data}),l&&(r(g=>{if(g.some(x=>x.id===h.id))return g;const b=[h,...g].slice(0,pw);return NC(b),b}),o(g=>{const b=new Set(g);return b.delete(h.id),b}),a(!0)))},[l,e]);const d=m.useMemo(()=>t.filter(f=>!s.has(f.id)).length,[t,s]),u=m.useCallback(()=>{o(new Set(t.map(f=>f.id)))},[t]),p=m.useCallback(f=>{r(h=>{const g=h.filter(b=>b.id!==f);return NC(g),g}),o(h=>{const g=new Set(h);return g.delete(f),g})},[]);return!l||t.length===0?null:i.jsxs("div",{className:"pointer-events-none fixed bottom-4 right-4 z-40 flex max-w-[calc(100vw-2rem)] flex-col items-end gap-3",children:[n&&i.jsxs("div",{className:"pointer-events-auto w-[min(24rem,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-popover shadow-xl shadow-black/10",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border px-3 py-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(Hh,{className:"h-4 w-4 flex-shrink-0 text-primary"}),i.jsx("span",{className:"truncate text-sm font-medium text-popover-foreground",children:"Notifications"}),d>0&&i.jsx("span",{className:"rounded-full bg-primary px-2 py-0.5 text-xs font-medium text-primary-foreground",children:d})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{type:"button",onClick:u,className:"rounded px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:"Read"}),i.jsx("button",{type:"button",onClick:()=>a(!1),className:"rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":"Close notifications",children:i.jsx(At,{className:"h-4 w-4"})})]})]}),i.jsx("div",{className:"max-h-[22rem] space-y-2 overflow-y-auto p-2",children:t.slice(0,6).map(f=>i.jsx("div",{className:`rounded-md border p-3 shadow-sm ${Hie(f.severity)}`,children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[!s.has(f.id)&&i.jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full bg-primary"}),i.jsx("p",{className:"truncate text-sm font-medium",children:f.title})]}),i.jsx("p",{className:"mt-1 text-sm leading-5 opacity-85",children:f.body}),i.jsx("p",{className:"mt-2 text-xs opacity-60",children:Gie(f.createdAt)})]}),i.jsx("button",{type:"button",onClick:()=>p(f.id),className:"rounded p-1 opacity-60 transition-opacity hover:opacity-100","aria-label":"Dismiss notification",children:i.jsx(At,{className:"h-4 w-4"})})]})},f.id))})]}),i.jsxs("button",{type:"button",onClick:()=>{a(f=>!f),n||u()},className:"pointer-events-auto relative inline-flex h-11 w-11 items-center justify-center rounded-full border border-border bg-card text-card-foreground shadow-lg shadow-black/10 transition-transform hover:scale-105","aria-label":"Open notifications",children:[i.jsx(Sg,{className:"h-5 w-5"}),d>0&&i.jsx("span",{className:"absolute -right-1 -top-1 min-w-5 rounded-full bg-primary px-1.5 py-0.5 text-xs font-semibold text-primary-foreground",children:d>9?"9+":d})]})]})}function Wie(){const[e,t]=m.useState(new Set),[r,n]=m.useState(new Set),a=m.useCallback(d=>{d&&t(u=>new Set([...u,d]))},[]),s=m.useCallback(d=>{d&&t(u=>{const p=new Set(u);return p.delete(d),p})},[]),o=m.useCallback(d=>{d&&n(u=>new Set([...u,d]))},[]),l=m.useCallback(d=>{d&&n(u=>{const p=new Set(u);return p.delete(d),p})},[]),c=m.useCallback(d=>{d&&t(u=>{const p=new Set;for(const f of u)f.startsWith("new-session-")||p.add(f);return p.add(d),p})},[]);return{activeSessions:e,processingSessions:r,markSessionAsActive:a,markSessionAsInactive:s,markSessionAsProcessing:o,markSessionAsNotProcessing:l,replaceTemporarySession:c}}const yr=e=>JSON.stringify(e??null),TC=(e,t,r)=>e.length!==t.length?!0:t.some((n,a)=>{const s=e[a];return!s||n.name!==s.name||n.displayName!==s.displayName||n.fullPath!==s.fullPath||n.fileCount!==s.fileCount||yr(n.sessionMeta)!==yr(s.sessionMeta)||yr(n.sessions)!==yr(s.sessions)?!0:yr(n.cursorSessions)!==yr(s.cursorSessions)||yr(n.codexSessions)!==yr(s.codexSessions)||yr(n.geminiSessions)!==yr(s.geminiSessions)||yr(n.qwenSessions)!==yr(s.qwenSessions)||yr(n.opencodeSessions)!==yr(s.opencodeSessions)}),Gs=(e,t)=>(e??[]).map(r=>({...r,__provider:r.__provider??t})),Au=e=>[...Gs(e.sessions,"claude"),...Gs(e.codexSessions,"codex"),...Gs(e.cursorSessions,"cursor"),...Gs(e.geminiSessions,"gemini"),...Gs(e.qwenSessions,"qwen"),...Gs(e.opencodeSessions,"opencode")],qie=(e,t,r,n)=>{if(!r||!n)return!0;const a=e.find(c=>c.name===r.name),s=t.find(c=>c.name===r.name);if(!a||!s)return!1;const o=Au(a).find(c=>c.id===n.id),l=Au(s).find(c=>c.id===n.id);return!o||!l?!1:o.id===l.id&&o.title===l.title&&o.created_at===l.created_at&&o.updated_at===l.updated_at},Kie=new Set(["chat","orchestration","remote","controlRoom","files","shell","git","changes","liveView","preview"]),Yie=new Set(["controlRoom"]),Zie=e=>Kie.has(e)||e.startsWith("plugin:"),fI=e=>Yie.has(e)?"chat":e,Xie=()=>{if(typeof window<"u"&&window.location.pathname.endsWith("/orchestration"))return"orchestration";try{const e=localStorage.getItem("activeTab");if(e&&Zie(e))return fI(e)}catch{}return"chat"};function Jie({sessionId:e,navigate:t,latestMessage:r,isMobile:n,activeSessions:a}){const[s,o]=m.useState([]),[l,c]=m.useState(null),[d,u]=m.useState(null),[p,f]=m.useState(Xie);m.useEffect(()=>{try{localStorage.setItem("activeTab",fI(p))}catch{}},[p]);const[h,g]=m.useState(!1),[b,x]=m.useState(!0),[y,v]=m.useState(null),[w,C]=m.useState(!1),[k,N]=m.useState(!1),[j,A]=m.useState("agents"),[E,T]=m.useState(0),_=m.useRef(null),I=m.useCallback(async({showLoadingState:ce=!0}={})=>{try{ce&&x(!0);const pe=await(await Lt.projects()).json();o(ve=>ve.length===0||TC(ve,pe,!0)?pe:ve)}catch(ye){console.error("Error fetching projects:",ye)}finally{ce&&x(!1)}},[]),R=m.useCallback(async()=>{await I({showLoadingState:!1})},[I]),S=m.useCallback((ce="tools")=>{A(ce),N(!0)},[]);m.useEffect(()=>{I()},[I]),m.useEffect(()=>{!b&&s.length===1&&!l&&!e&&c(s[0])},[b,s,l,e]),m.useEffect(()=>{if(!r)return;if(r.type==="loading_progress"){_.current&&(clearTimeout(_.current),_.current=null),v(r),r.phase==="complete"&&(_.current=setTimeout(()=>{v(null),_.current=null},500));return}if(r.type!=="projects_updated")return;const ce=r;if(ce.changedFile&&d&&l){const D=ce.changedFile.replace(/\\/g,"/").split("/");D.length>=2&&D[D.length-1].replace(".jsonl","")===d.id&&(a.has(d.id)||T(W=>W+1))}const ye=d&&a.has(d.id)||a.size>0&&Array.from(a).some(de=>de.startsWith("new-session-")),pe=ce.projects;if(ye&&!qie(s,pe,l,d)||(o(pe),!l))return;const ve=pe.find(de=>de.name===l.name);if(!ve||(yr(ve)!==yr(l)&&c(ve),!d))return;Au(ve).find(de=>de.id===d.id)||u(null)},[r,l,d,a,s]),m.useEffect(()=>()=>{_.current&&(clearTimeout(_.current),_.current=null)},[]),m.useEffect(()=>{if(!(!e||s.length===0)){for(const ce of s){const ye=ce.sessions?.find(X=>X.id===e);if(ye){const X=l?.name!==ce.name,oe=d?.id!==e||d.__provider!=="claude";X&&c(ce),oe&&u({...ye,__provider:"claude"});return}const pe=ce.cursorSessions?.find(X=>X.id===e);if(pe){const X=l?.name!==ce.name,oe=d?.id!==e||d.__provider!=="cursor";X&&c(ce),oe&&u({...pe,__provider:"cursor"});return}const ve=ce.codexSessions?.find(X=>X.id===e);if(ve){const X=l?.name!==ce.name,oe=d?.id!==e||d.__provider!=="codex";X&&c(ce),oe&&u({...ve,__provider:"codex"});return}const ue=ce.geminiSessions?.find(X=>X.id===e);if(ue){const X=typeof ue.id=="string"&&ue.id.startsWith("qwen_")||ue.provider==="qwen",K=typeof ue.id=="string"&&ue.id.startsWith("opencode_")||ue.provider==="opencode"?"opencode":X?"qwen":"gemini",W=l?.name!==ce.name,ne=d?.id!==e||d.__provider!==K;W&&c(ce),ne&&u({...ue,__provider:K});return}const de=ce.qwenSessions?.find(X=>X.id===e);if(de){const X=l?.name!==ce.name,oe=d?.id!==e||d.__provider!=="qwen";X&&c(ce),oe&&u({...de,__provider:"qwen"});return}const D=ce.opencodeSessions?.find(X=>X.id===e);if(D){const X=l?.name!==ce.name,oe=d?.id!==e||d.__provider!=="opencode";X&&c(ce),oe&&u({...D,__provider:"opencode"});return}}if(e&&d?.id!==e){const ce=e.startsWith("opencode_")?"opencode":e.startsWith("qwen_")?"qwen":e.startsWith("codex-")||e.startsWith("codex_")?"codex":e.startsWith("gemini_")?"gemini":null,ye=(typeof window<"u"?localStorage.getItem("selected-provider"):null)||"claude";u({id:e,__provider:ce||ye})}}},[e,s,l?.name,d?.id,d?.__provider]);const F=m.useCallback(ce=>{c(ce),u(null),t("/"),n&&g(!1)},[n,t]),B=m.useCallback(ce=>{u(ce),(p==="preview"||p==="liveView"||p==="orchestration")&&f("chat");const ye=ce.__provider||localStorage.getItem("selected-provider")||"claude";if(ce.__provider&&localStorage.setItem("selected-provider",ce.__provider),ye==="cursor"&&sessionStorage.setItem("cursorSessionId",ce.id),n){const pe=ce.__projectName,ve=l?.name;pe!==ve&&g(!1)}t(`/session/${ce.id}`)},[p,n,t,l?.name]),z=m.useCallback(ce=>{o(ye=>{const pe=ye.findIndex(ue=>ue.name===ce.name);if(pe===-1)return[ce,...ye];const ve=[...ye];return ve[pe]={...ve[pe],...ce},ve}),c(ce),u(null),f("chat"),t("/"),n&&g(!1)},[n,t]),q=m.useCallback(ce=>{z(ce)},[z]),V=m.useCallback(async ce=>{try{const ye=await Lt.quickStartProject(),pe=await ye.json().catch(()=>({}));if(!ye.ok||!pe?.project){console.error("[quick-start] failed:",pe);return}const ve=pe.project;if(ce==="chat"){z(ve);return}o(ue=>ue.some(de=>de.name===ve.name)?ue:[ve,...ue]),c(ve),u(null),f(ce),t("/"),n&&g(!1)}catch(ye){console.error("[quick-start] error:",ye)}},[n,t,z]),P=m.useCallback(async()=>{await V("chat")},[V]),U=m.useCallback(async()=>{await V("orchestration")},[V]),H=m.useCallback((ce,ye)=>{c(ce),u(null),f("orchestration"),ye&&localStorage.setItem("pixcode.orchestration.selectedRunId",ye),t("/"),n&&g(!1)},[n,t]),M=m.useCallback(()=>{u(null),f("controlRoom"),t("/"),n&&g(!1)},[n,t]),ee=m.useCallback(ce=>{d?.id===ce&&(u(null),t("/")),o(ye=>ye.map(pe=>({...pe,sessions:pe.sessions?.filter(ve=>ve.id!==ce)??[],sessionMeta:{...pe.sessionMeta,total:Math.max(0,(pe.sessionMeta?.total??0)-1)}})))},[t,d?.id]),Q=m.useCallback(async()=>{try{const ye=await(await Lt.projects()).json();if(o(ue=>TC(ue,ye,!0)?ye:ue),!l)return;const pe=ye.find(ue=>ue.name===l.name);if(!pe||(yr(pe)!==yr(l)&&c(pe),!d))return;const ve=Au(pe).find(ue=>ue.id===d.id);if(ve){const ue=ve.__provider||!d.__provider?ve:{...ve,__provider:d.__provider};yr(ue)!==yr(d)&&u(ue)}}catch(ce){console.error("Error refreshing sidebar:",ce)}},[l,d]),ge=m.useCallback(ce=>{l?.name===ce&&(c(null),u(null),t("/")),o(ye=>ye.filter(pe=>pe.name!==ce))},[t,l?.name]),se=m.useMemo(()=>({projects:s,selectedProject:l,selectedSession:d,onProjectSelect:F,onSessionSelect:B,onNewSession:q,onProjectCreated:z,onQuickStartSession:P,onOpenControlRoom:M,onOpenOrchestration:H,onSessionDelete:ee,onProjectDelete:ge,isLoading:b,loadingProgress:y,onRefresh:Q,onShowSettings:()=>N(!0),showSettings:k,settingsInitialTab:j,onCloseSettings:()=>N(!1),isMobile:n}),[q,M,H,z,P,ge,F,ee,B,Q,b,n,y,s,j,l,d,k]);return{projects:s,selectedProject:l,selectedSession:d,activeTab:p,sidebarOpen:h,isLoadingProjects:b,loadingProgress:y,isInputFocused:w,showSettings:k,settingsInitialTab:j,externalMessageUpdate:E,setActiveTab:f,setSidebarOpen:g,setIsInputFocused:C,setShowSettings:N,openSettings:S,fetchProjects:I,refreshProjectsSilently:R,sidebarSharedProps:se,handleProjectSelect:F,handleSessionSelect:B,handleNewSession:q,handleOpenOrchestration:H,handleQuickStartOrchestration:U,handleSessionDelete:ee,handleProjectDelete:ge,handleSidebarRefresh:Q}}function Lh(){const e=KI(),{sessionId:t}=YI(),{t:r}=Be("common"),{isMobile:n}=Ig({trackPWA:!1}),{ws:a,sendMessage:s,latestMessage:o,isConnected:l}=gO(),c=m.useRef(!1),{activeSessions:d,processingSessions:u,markSessionAsActive:p,markSessionAsInactive:f,markSessionAsProcessing:h,markSessionAsNotProcessing:g,replaceTemporarySession:b}=Wie(),{selectedProject:x,selectedSession:y,activeTab:v,sidebarOpen:w,isLoadingProjects:C,externalMessageUpdate:k,setActiveTab:N,setSidebarOpen:j,setIsInputFocused:A,setShowSettings:E,openSettings:T,refreshProjectsSilently:_,sidebarSharedProps:I,handleQuickStartOrchestration:R}=Jie({sessionId:t,navigate:e,latestMessage:o,isMobile:n,activeSessions:d});return m.useEffect(()=>(window.refreshProjects=_,()=>{window.refreshProjects===_&&delete window.refreshProjects}),[_]),m.useEffect(()=>(window.openSettings=T,()=>{window.openSettings===T&&delete window.openSettings}),[T]),m.useEffect(()=>{if(typeof navigator>"u"||!("serviceWorker"in navigator))return;const S=F=>{const B=F.data;if(!(!B||B.type!=="notification:navigate")){if(typeof B.provider=="string"&&B.provider.trim()&&localStorage.setItem("selected-provider",B.provider),N("chat"),j(!1),_(),typeof B.sessionId=="string"&&B.sessionId){e(`/session/${B.sessionId}`);return}e("/")}};return navigator.serviceWorker.addEventListener("message",S),()=>{navigator.serviceWorker.removeEventListener("message",S)}},[e,_,N,j]),m.useEffect(()=>{l&&!c.current?c.current=!0:l||(c.current=!1),l&&y?.id&&s({type:"get-pending-permissions",sessionId:y.id})},[l,y?.id,s]),m.useEffect(()=>{!o||o.type!=="projects_updated"||window.dispatchEvent(new CustomEvent("pixcode:file-tree-refresh",{detail:{projectName:x?.name??null,changedFile:typeof o.changedFile=="string"?o.changedFile:null}}))},[o,x?.name]),m.useEffect(()=>{const S=window.visualViewport;if(!S)return;const F=()=>{const B=Math.max(0,window.innerHeight-S.height);document.documentElement.style.setProperty("--keyboard-height",`${B}px`)};return S.addEventListener("resize",F),()=>S.removeEventListener("resize",F)},[]),i.jsxs("div",{className:"fixed inset-0 flex bg-background",style:{bottom:"var(--keyboard-height, 0px)"},children:[n?i.jsxs("div",{className:`fixed inset-0 z-50 flex transition-all duration-150 ease-out ${w?"visible opacity-100":"invisible opacity-0"}`,children:[i.jsx("button",{className:"fixed inset-0 bg-background/60 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:S=>{S.stopPropagation(),j(!1)},onTouchStart:S=>{S.preventDefault(),S.stopPropagation(),j(!1)},"aria-label":r("versionUpdate.ariaLabels.closeSidebar")}),i.jsx("div",{className:`relative h-full w-[85vw] max-w-sm transform border-r border-border/40 bg-card transition-transform duration-150 ease-out sm:w-80 ${w?"translate-x-0":"-translate-x-full"}`,onClick:S=>S.stopPropagation(),onTouchStart:S=>S.stopPropagation(),children:i.jsx(nT,{...I})})]}):null,i.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:n?i.jsx(aie,{selectedProject:x,selectedSession:y,activeTab:v,setActiveTab:N,ws:a,sendMessage:s,latestMessage:o,isMobile:n,onMenuClick:()=>j(!0),isLoading:C,onInputFocusChange:A,onSessionActive:p,onSessionInactive:f,onSessionProcessing:h,onSessionNotProcessing:g,processingSessions:u,onReplaceTemporarySession:b,onNavigateToSession:S=>e(`/session/${S}`),onShowSettings:()=>E(!0),externalMessageUpdate:k,onQuickStartSession:I.onQuickStartSession,onQuickStartOrchestration:R}):i.jsx(Eie,{sidebarProps:I,selectedProject:x,selectedSession:y,activeTab:v,setActiveTab:N,ws:a,sendMessage:s,latestMessage:o,isMobile:n,onMenuClick:()=>j(!0),isLoading:C,onInputFocusChange:A,onSessionActive:p,onSessionInactive:f,onSessionProcessing:h,onSessionNotProcessing:g,processingSessions:u,onReplaceTemporarySession:b,onNavigateToSession:S=>e(`/session/${S}`),onShowSettings:()=>E(!0),externalMessageUpdate:k,onQuickStartSession:I.onQuickStartSession,onQuickStartOrchestration:R})}),i.jsx(Vie,{latestMessage:o})]})}const{slice:Qie,forEach:ese}=[];function tse(e){return ese.call(Qie.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}function rse(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(r=>r.test(e))}const AC=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,nse=function(e,t){const n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},a=encodeURIComponent(t);let s=`${e}=${a}`;if(n.maxAge>0){const o=n.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(o)}`}if(n.domain){if(!AC.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!AC.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(s+="; Partitioned"),s},jC={create(e,t,r,n){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+r*60*1e3)),n&&(a.domain=n),document.cookie=nse(e,t,a)},read(e){const t=`${e}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var ase={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return jC.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:n,cookieDomain:a,cookieOptions:s}=t;r&&typeof document<"u"&&jC.create(r,e,n,a,s)}},ise={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,r;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const s=n.substring(1).split("&");for(let o=0;o<s.length;o++){const l=s[o].indexOf("=");l>0&&s[o].substring(0,l)===t&&(r=s[o].substring(l+1))}}return r}},sse={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:r}=e,n;if(typeof window<"u"){const{hash:a}=window.location;if(a&&a.length>2){const s=a.substring(1);if(t){const o=s.split("&");for(let l=0;l<o.length;l++){const c=o[l].indexOf("=");c>0&&o[l].substring(0,c)===t&&(n=o[l].substring(c+1))}}if(n)return n;if(!n&&r>-1){const o=a.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?o[typeof r=="number"?r:0]?.replace("/",""):void 0}}}return n}};let Vs=null;const IC=()=>{if(Vs!==null)return Vs;try{if(Vs=typeof window<"u"&&window.localStorage!==null,!Vs)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Vs=!1}return Vs};var ose={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&IC())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&IC()&&window.localStorage.setItem(r,e)}};let Ws=null;const _C=()=>{if(Ws!==null)return Ws;try{if(Ws=typeof window<"u"&&window.sessionStorage!==null,!Ws)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Ws=!1}return Ws};var lse={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&_C())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&_C()&&window.sessionStorage.setItem(r,e)}},cse={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:a}=navigator;if(r)for(let s=0;s<r.length;s++)t.push(r[s]);n&&t.push(n),a&&t.push(a)}return t.length>0?t:void 0}},dse={name:"htmlTag",lookup(e){let{htmlTag:t}=e,r;const n=t||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},use={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof t=="number"?t:0]?.replace("/",""):void 0}},pse={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const r=typeof t=="number"?t+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}};let gI=!1;try{document.cookie,gI=!0}catch{}const bI=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];gI||bI.splice(1,1);const mse=()=>({order:bI,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class xI{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,r)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=tse(r,this.options||{},mse()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=a=>a.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(ase),this.addDetector(ise),this.addDetector(ose),this.addDetector(lse),this.addDetector(cse),this.addDetector(dse),this.addDetector(use),this.addDetector(pse),this.addDetector(sse)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return t.forEach(n=>{if(this.detectors[n]){let a=this.detectors[n].lookup(this.options);a&&typeof a=="string"&&(a=[a]),a&&(r=r.concat(a))}}),r=r.filter(n=>n!=null&&!rse(n)).map(n=>this.options.convertDetectedLanguage(n)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(t,this.options)}))}}xI.type="languageDetector";const hse={save:"Save",cancel:"Cancel",delete:"Delete",create:"Create",edit:"Edit",close:"Close",confirm:"Confirm",submit:"Submit",retry:"Retry",refresh:"Refresh",search:"Search",clear:"Clear",copy:"Copy",download:"Download",upload:"Upload",browse:"Browse"},fse={chat:"Chat",shell:"Shell",files:"Files",git:"Source Control",changes:"Changes",liveView:"Live View",tasks:"Tasks",remote:"Remote",controlRoom:"Control",orchestration:"Orchestration"},gse={loading:"Loading...",success:"Success",error:"Error",failed:"Failed",pending:"Pending",completed:"Completed",inProgress:"In Progress"},bse={savedSuccessfully:"Saved successfully",deletedSuccessfully:"Deleted successfully",updatedSuccessfully:"Updated successfully",operationFailed:"Operation failed",networkError:"Network error. Please check your connection.",unauthorized:"Unauthorized. Please log in.",notFound:"Not found",invalidInput:"Invalid input",requiredField:"This field is required",unknownError:"An unknown error occurred"},xse={settings:"Settings",home:"Home",back:"Back",next:"Next",previous:"Previous",logout:"Logout"},yse={language:"Language",theme:"Theme",darkMode:"Dark Mode",lightMode:"Light Mode",name:"Name",description:"Description",enabled:"Enabled",disabled:"Disabled",optional:"Optional",version:"Version",select:"Select",selectAll:"Select All",deselectAll:"Deselect All"},vse={justNow:"Just now",minutesAgo:"{{count}} mins ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",yesterday:"Yesterday"},wse={newFile:"New File",newFolder:"New Folder",rename:"Rename",move:"Move",copyPath:"Copy Path",openInEditor:"Open in Editor"},kse={loading:"Loading Pixcode",settingUpWorkspace:"Setting up your workspace...",chooseProject:"Choose Your Project",selectProjectDescription:"Select a project from the sidebar to start coding with Claude. Each project contains your chat sessions and file history.",tip:"Tip",createProjectMobile:"Tap the menu button above to access projects",createProjectDesktop:"Create a new project by clicking the folder icon in the sidebar",newSession:"New Session",untitledSession:"Untitled Session",projectFiles:"Project Files",landing:{title:"Start a Pixcode workspace",description:"Choose a project, start a new chat, or launch Orchestration with one goal. Orchestration manages the CLI agents you select, shows every step, and surfaces errors directly.",startOrchestration:"Start Orchestration",startOrchestrationDescription:"Creates an automatic project and opens the Orchestration screen with agent control and run history.",startChat:"Start a new chat",startChatDescription:"Creates a folder automatically and opens the normal chat screen with one agent.",sidebarHint:"When you select an existing project from the sidebar, chat history, files, git status, tasks, and orchestration stay in the same main screen.",createProject:"Create New Project",createProjectDescription:"Add an existing workspace or create a folder, then open the provider picker for coding."}},Sse={title:"Orchestration",subtitle:"Give one goal inside {{project}}; choose the CLI workers, duplicate any CLI when needed, and assign work directly or let the coordinator split it.",refresh:"Refresh",goal:"Goal",goalPlaceholder:"Example: Fix the auth screen for single-port deployment, capture errors, and verify with lint and typecheck.",mode:"Run mode",systemPlan:"System plan",noMode:"No mode selected",loadingPlan:"Loading agent plan.",start:"Start team",starting:"Starting",stop:"Stop team",stopping:"Stopping",cancelFailed:"Workflow could not be stopped.",linkedTask:"Linked task",replayRun:"Replay",replaying:"Replaying",approveReplay:"Approve replay",replayApprovalRequired:"Replay needs approval before repeating a step with prior shell, network, or file-write activity.",replayFailed:"Workflow replay could not start.",needAgent:"Enable at least one CLI worker.",needRoles:"Assign at least one enabled agent to these role(s) for this mode: {{roles}}.",startFailed:"Workflow could not start.",quickPrompts:{label:"Quick prompt:",liveTrading:{label:"8024 live trading screen",prompt:"Hi, please create a small project and then run it on port 8024. I want a Binance FAPI-connected TradingView-style design with a TradingView chart and a star/favorites system on the left. Split the work logically and manage the process automatically."}},cliControl:"CLI team",enabledCount:"{{count}} enabled",enabled:"Enabled",disabled:"Disabled",history:"History",emptyHistory:"No runs yet. Write a goal and start the agents.",steps:"{{done}}/{{total}} steps",notSelected:"No run selected",notSelectedDescription:"Select a previous run or start a new goal. Agent messages, errors, change summaries, and preview outputs appear here.",loadFailed:"Run details could not be loaded.",loadingRun:"Loading run...",traceTimeline:"Trace timeline",traceFilters:"Filters",traceAll:"All",traceActor:"Actor",traceProvider:"Provider",traceType:"Type",traceSeverity:"Severity",traceDuration:"{{duration}} elapsed",traceEmpty:"No trace events match the current filters.",traceLoadFailed:"Trace timeline could not be loaded.",traceTypes:{run:"Run",node:"Step",provider:"Provider",message:"Message",artifact:"Artifact",file:"File edit",permission_policy:"Permission policy",error:"Error"},traceSeverityLevels:{info:"Info",warning:"Warning",error:"Error"},teamHistory:"Team history",permissionApprovalsPending:"{{count}} permission approval pending",agentSteps:"Agent steps",changeSummary:"Change summary",noChangeSummary:"The final summary is not ready yet. A readable Markdown summary appears here when the agents finish.",prepareTeamFromReport:"Prepare agent team from this report",prepareTeamTitle:"Prepare agent team prompt",prepareTeamDescription:"The debate output was turned into a new Agent Team prompt. Edit it, then move it into Agent Team mode.",usePreparedPrompt:"Use prompt",reportToPromptPrefix:"Prepare and execute an agent team from the following debate/decision report. Split the needs into tasks, propose sensible assignments for the available CLI agents, and start only after user confirmation.",generatedSummaryTitle:"Automatic run summary",summaryStatus:"Overall status",summarySteps:"Completed steps",summaryFailures:"Failed steps",summaryCanceled:"Canceled steps",summaryDiffs:"Diff/change outputs",summaryPreviews:"Preview outputs",summaryErrorPrefix:"Error",assignedWork:"Assigned work",autoAssigned:"Automatic / coordinator decides",noStepOutput:"No step output.",agentMessages:"Agent messages",noAgentMessages:"This agent has not produced a message yet. If the run failed, the real CLI error appears above.",outputs:"Outputs",noOutputs:"No change summary, preview, or command output yet.",open:"Open",artifact:{fileDiff:"Change summary",previewUrl:"Preview",commandOutput:"Command output",handoff:"Handoff artifact"},role:{user:"User",agent:"Agent"},status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed",canceled:"Canceled",skipped:"Skipped"},nodes:{codex_review:"Codex review",gemini_review:"Gemini review",claude_review:"Claude review",claude_code_review:"Claude review",cursor_review:"Cursor review",aggregate:"Aggregate",architect:"Planning",implement:"Implementation",review:"Review",proposal:"Proposal",critique:"Critique",response:"Response",judge:"Decision",coordinator:"Coordinator",final_report:"Final report"},stages:{coordinator:"Coordinator",handoff:"Handoff",backend:"Backend",frontend:"Frontend",implementation:"Implementation",review:"Review",repair:"Repair",proposal:"Proposal",critique:"Critique",response:"Response",decision:"Decision",report:"Report",fallback:"Fallback",final_report:"Final report"},workflows:{multi_model_review:{name:"Multi-model review",description:"Enabled CLI agents review the same goal separately, then one enabled agent aggregates the result."},sequential_handoff:{name:"Sequential handoff",description:"Agents plan, implement, and review in order. Disabled CLI steps are skipped."},adversarial_debate:{name:"Decision debate",description:"Agents propose, critique, respond, and produce a final recommendation."},agent_team:{name:"Agent team",description:"A coordinator reads the goal and active CLI instances, assigns work, then collects the result."}},adapters:{"claude-code":{label:"Claude Code",role:"CLI worker"},cursor:{label:"Cursor",role:"CLI worker"},codex:{label:"Codex",role:"CLI worker"},gemini:{label:"Gemini",role:"CLI worker"},qwen:{label:"Qwen Code",role:"CLI worker"},opencode:{label:"OpenCode",role:"CLI worker"}},activeCount:"{{active}}/{{total}} active",teamHint:"Each row is one CLI worker. You can create multiple Claude, Codex, Cursor, Gemini, Qwen, or OpenCode workers and give each a different assignment.",parallelLimit:"Parallel limit",fallbackAgent:"Fallback CLI",noFallbackAgent:"No automatic fallback",fallbackAgentHint:"If a CLI step fails, Pixcode retries that step with this backup agent.",agentRole:"Stage",agentModel:"Model",agentRoles:{auto:"Auto",backend:"Backend",frontend:"Frontend",review:"Test / review",implementation:"Implementation",proposal:"Proposal",critique:"Critique",response:"Response",decision:"Decision / report",report:"Report",custom:"Custom"},customRolePlaceholder:"Example: Security, Mobile UX, DB architecture",roleHints:{default:"Leave empty and the coordinator assigns this agent from the goal.",agent_team:"Pick backend, frontend, or review stages, or leave agents on auto.",multi_model_review:"Enabled agents review; if a report role is selected, that agent aggregates the final summary.",sequential_handoff:"Agents run in your selected order; assignment text defines each step.",adversarial_debate:"Stage selection is optional in decision debate; if left empty, the system assigns selected agents to Proposal, Critique, and Response in order."},addAgent:"Add {{agent}}",soloAgent:"Run only with {{agent}}",soloAgentShort:"Solo",duplicateAgent:"Duplicate {{agent}}",removeAgent:"Remove {{agent}}",assignment:"Assignment",assignmentPlaceholder:"Optional: tell this worker exactly what to handle. Leave empty for coordinator assignment.",agentInstance:"{{name}} #{{number}}",taskTitle:"Task",taskTitlePlaceholder:"Implement feature",taskDescription:"Description",taskDescriptionPlaceholder:"Scope, constraints, expected output",addTask:"Add",runTask:"Run",cancelTask:"Cancel",dispatchTask:"Dispatch task",adapter:"Adapter",isolation:"Isolation",dispatch:"Dispatch",auto:"Auto",cliSettings:"CLI settings",waitingForStream:"Waiting for stream...",workflow:"Workflow",templates:"Templates",noTemplate:"No template",templateHint:"Pick a starter template to fill the workflow, agent roles, and acceptance criteria before launch.",input:"Input",taskStates:{todo:"To Do",in_progress:"In Progress",in_review:"In Review",done:"Done",failed:"Failed",canceled:"Canceled"},isolationKind:{worktree:"Worktree",host:"Host",docker:"Docker"},workspaceTarget:"Target workspace",workspaceTargets:{selectedProject:"Selected project",pixcodeApp:"Pixcode system",custom:"Custom path"},customWorkspacePlaceholder:"/path/to/project",workspaceTargetHint:"Agents will run in: {{path}}",autoDetect:"auto-detect",needWorkspacePath:"Enter a custom workspace path.",hermesTitle:"Hermes Agent",hermesSubtitle:"Hermes is running inside Pixcode for {{project}} and can coordinate local checks, tests, terminal work, and project operations.",hermesCliControl:"Hermes CLI control"},Cse={loading:"Loading files...",files:"Files",simpleView:"Simple view",compactView:"Compact view",detailedView:"Detailed view",searchPlaceholder:"Search files and folders...",clearSearch:"Clear search",name:"Name",size:"Size",modified:"Modified",permissions:"Permissions",noFilesFound:"No files found",checkProjectPath:"Check if the project path is accessible",noMatchesFound:"No matches found",tryDifferentSearch:"Try a different search term or clear the search",justNow:"just now",minAgo:"{{count}} min ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",newFile:"New File (Cmd+N)",newFolder:"New Folder (Cmd+Shift+N)",refresh:"Refresh",collapseAll:"Collapse All",context:{rename:"Rename",delete:"Delete",copyPath:"Copy Path",download:"Download",newFile:"New File",newFolder:"New Folder",refresh:"Refresh",menuLabel:"File context menu",loading:"Loading..."}},Nse={title:"Create New Project",steps:{type:"Type",configure:"Configure",confirm:"Confirm"},step1:{question:"Do you already have a workspace, or would you like to create a new one?",existing:{title:"Existing Workspace",description:"I already have a workspace on my server and just need to add it to the project list"},new:{title:"New Workspace",description:"Create a new workspace, optionally clone from a GitHub repository"},githubClone:{title:"Clone from GitHub",description:"Pick a target folder and clone a repository into it"},subfolder:{title:"Create Subfolder",description:"Pick a parent folder and create a fresh subfolder inside it"}},step2:{existingPath:"Workspace Path",newPath:"Workspace Path",subfolderParentPath:"Parent Folder",subfolderParentHelp:"Path to the folder where the new subfolder will be created",subfolderName:"Subfolder Name",subfolderNameHelp:"A new folder with this name will be created inside the parent above",existingPlaceholder:"/path/to/existing/workspace",newPlaceholder:"/path/to/new/workspace",existingHelp:"Full path to your existing workspace directory",newHelp:"Full path to your workspace directory",githubUrl:"GitHub URL (Optional)",githubPlaceholder:"https://github.com/username/repository",githubHelp:"Optional: provide a GitHub URL to clone a repository",githubAuth:"GitHub Authentication (Optional)",githubAuthHelp:"Only required for private repositories. Public repos can be cloned without authentication.",loadingTokens:"Loading stored tokens...",storedToken:"Stored Token",newToken:"New Token",nonePublic:"None (Public)",selectToken:"Select Token",selectTokenPlaceholder:"-- Select a token --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"This token will be used only for this operation",publicRepoInfo:"Public repositories don't require authentication. You can skip providing a token if cloning a public repo.",noTokensHelp:"No stored tokens available. You can add tokens in Settings → API Keys for easier reuse.",optionalTokenPublic:"GitHub Token (Optional for Public Repos)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (leave empty for public repos)"},step3:{reviewConfig:"Review Your Configuration",workspaceType:"Workspace Type:",existingWorkspace:"Existing Workspace",newWorkspace:"New Workspace",subfolderWorkspace:"New Subfolder",path:"Path:",parentPath:"Parent Path:",subfolderName:"Subfolder Name:",cloneFrom:"Clone From:",authentication:"Authentication:",usingStoredToken:"Using stored token:",usingProvidedToken:"Using provided token",noAuthentication:"No authentication",sshKey:"SSH Key",existingInfo:"The workspace will be added to your project list and will be available for Claude/Cursor sessions.",newWithClone:"The repository will be cloned from this folder.",newEmpty:"The workspace will be added to your project list and will be available for Claude/Cursor sessions.",subfolderInfo:"A new subfolder will be created inside the parent folder and added to your project list.",cloningRepository:"Cloning repository..."},buttons:{cancel:"Cancel",back:"Back",next:"Next",createProject:"Create Project",creating:"Creating...",cloning:"Cloning..."},errors:{selectType:"Please select whether you have an existing workspace or want to create a new one",providePath:"Please provide a workspace path",provideSubfolderName:"Please provide a name for the subfolder",subfolderNameInvalid:"Subfolder name cannot contain path separators or be . / ..",failedToCreate:"Failed to create workspace",failedToCreateFolder:"Failed to create folder"}},Ese={genericTool:"a tool",codes:{generic:{info:{title:"Notification"}},permission:{required:{title:"Action Required",body:"{{toolName}} is waiting for your decision."}},run:{stopped:{title:"Run Stopped",body:"Reason: {{reason}}"},failed:{title:"Run Failed"}},agent:{notification:{title:"Agent Notification"}}}},Tse={title:"Update Available",newVersionReady:"A new version is ready",currentVersion:"Current Version",latestVersion:"Latest Version",latestRelease:"Latest Release",releaseNotesTitle:"Release Notes",releaseNotesSubtitle:"Latest Pixcode changes",whatsNew:"What's New:",viewFullRelease:"View full release",updateProgress:"Update Progress:",manualUpgrade:"Manual upgrade:",npmUpgradeCommand:"npm install -g @pixelbyte-software/pixcode@latest",pixcodeUpgradeCommand:"pixcode update --restart-daemon",manualUpgradeHint:'Or click "Update Now" to run the update automatically.',updateCompleted:"Update completed successfully!",restartServer:"Please restart the server to apply changes.",updateFailed:"Update failed",buttons:{close:"Close",later:"Later",copyCommand:"Copy Command",updateNow:"Update Now",updating:"Updating..."},ariaLabels:{closeModal:"Close version upgrade modal",showSidebar:"Show sidebar",settings:"Settings",updateAvailable:"Update available",closeSidebar:"Close sidebar"}},Ase={title:"Live View",subtitle:"Run this project locally and share it through the active secure tunnel when one is running.",start:"Start",restart:"Restart",stop:"Stop",runnerError:"Runner error",runnerUnavailable:"Runner unavailable",managedRuntimePreparing:"Pixcode will prepare the runtime",managedRuntimeDescription:"Press Start and Pixcode will prepare the required local runtime automatically.",preparingRuntime:"Preparing runtime…",preparingRuntimeDescription:"Pixcode is downloading and installing the runtime locally. This can take a moment on first use.",runnerErrorFallback:"The runner stopped before the preview became available.",detecting:"Detecting project runner…",noRunner:"No runner detected",staticHint:"Static HTML will be served directly when index.html exists.",customCommand:"Custom command",custom:"Custom",customPlaceholder:"npm run dev, python app.py, go run .",environment:"Environment",environmentLocalProcess:"Local process",environmentStatic:"Static files",environmentUnavailable:"Unavailable",statusLabel:"Status",framework:"Framework",command:"Command",upstream:"Upstream",publicTunnel:"Public tunnel",tunnelActive:"Tunnel active",tunnelLocalOnly:"Local only",diagnostics:"Diagnostics",viewport:"Viewport",viewportDesktop:"Desktop",viewportTablet:"Tablet",viewportMobile:"Mobile",viewportWidth:"Width",viewportHeight:"Height",controls:"Runner, viewport and logs",shareLink:"Share link",starting:"Starting",openExternal:"Open externally",externalActive:"Secure tunnel is active; this link can be shared outside your network.",localOnly:"External Access is off; this link is local to this Pixcode server.",frameTitle:"Project Live View",emptyTitle:"Start Live View",emptyDescription:"Pixcode will detect the project stack, start the local web server, and expose it here."},jse={title:"Control room",subtitle:"Production, platform, admin, audit, and self-hosted access for {{target}}",thisServer:"this server",refresh:"Refresh",nav:{overview:"Overview",production:"Production",admin:"Admin",team:"Team",secrets:"Secrets",marketplace:"Marketplace",eval:"Evaluations",usage:"Usage",security:"Security",access:"Access"},overview:{title:"v1.46 launch surface",description:"Every box below is backed by a v1.44-v1.45 API and is now visible from the UI.",latestAuditEvents:"Latest audit events",remoteAccessOptions:"Remote access options"},metrics:{issueRuns:"Issue-to-PR runs",reviewItems:"Review items",subUsers:"Sub-users",collaborators:"Project collaborators",secrets:"Scoped secrets",marketplace:"Marketplace entries",evalRuns:"Evaluation runs",securityAudits:"Security audits"},sections:{production:{title:"Production loop",description:"Start issue-to-PR runs, parse CI failures, review changes, schedule background jobs, and create checkpoints."},admin:{title:"Admin system",description:"Create sub-users, disable accounts, and inspect activity for a single self-hosted Pixcode server."},team:{title:"Project collaborators",description:"Assign partners, workers, reviewers, and viewers per project without making everyone a global admin."},secrets:{title:"Secret vault",description:"Store scoped env secrets and preview what each provider, project, workflow, Telegram, or API run receives."},marketplace:{title:"MCP/plugin marketplace",description:"Register MCP servers, workflow templates, provider adapters, and notification channels with permission review and health."},eval:{title:"Evaluation harness",description:"Create regression suites and compare provider/model runs with pass rate and latency."},usage:{title:"Cost, token, and latency dashboard",description:"Monitor provider/model/workflow usage for demos and operations."},security:{title:"Security audit mode",description:"Run dependency audit, secret scan, permission audit, and agent output leak detection workflows."},access:{title:"Self-hosted access",description:"Use Tailscale when there is no fixed domain, or configure Cloudflare Tunnel/custom domain for a stable public URL."}},panels:{issueToPr:"Issue-to-PR run",ciRepair:"CI repair parser",reviewQueue:"Review queue",schedulerCheckpoints:"Scheduler and checkpoints",createSubUser:"Create sub-user",rolePermissions:"Role permissions",addCollaborator:"Add collaborator",createSecret:"Create secret",scopedEnvPreview:"Scoped env preview",addMarketplaceEntry:"Add marketplace entry",createSuite:"Create suite",recordRun:"Record run",recordUsageEvent:"Record usage event",createAuditRun:"Create audit run",auditLog:"Audit log",remoteAccessSetup:"Remote access setup"},lists:{recentJobs:"Recent jobs",recentCheckpoints:"Recent checkpoints",subUsers:"Sub-users",collaborators:"Collaborators",includedEnvNames:"Included env names",vaultEntries:"Vault entries",marketplaceEntries:"Marketplace entries",suites:"Suites",runs:"Runs",auditRuns:"Audit runs",configuredAccessPaths:"Configured access paths"},buttons:{queueRun:"Queue run",parseFailure:"Parse failure",createReviewItem:"Create review item",scheduleJob:"Schedule job",createCheckpoint:"Create checkpoint",createUser:"Create user",disable:"Disable",enable:"Enable",addCollaborator:"Add collaborator",storeSecret:"Store secret",previewEnv:"Preview env",saveEntry:"Save entry",markHealthy:"Mark healthy",createSuite:"Create suite",recordRun:"Record run",recordUsage:"Record usage",createAudit:"Create audit",exportJson:"Export JSON",exportCsv:"Export CSV",saveAccessPath:"Save access path",checkUrl:"Check URL",checkTailscale:"Check Tailscale"},placeholders:{githubIssueUrl:"GitHub issue URL",manualTitle:"Manual title fallback",model:"Model",baseBranch:"Base branch",ciLog:"Paste failing CI, lint, typecheck, or build output",reviewTitle:"Review title",notes:"Notes",changedFiles:"Changed files, one per line",jobName:"Job name",cronExpression:"Cron or watch expression",checkpointReason:"Checkpoint reason",backgroundPrompt:"Background agent prompt",checkpointFiles:"Checkpoint changed files, one per line",usernameEmail:"Username or email",temporaryPassword:"Temporary password",userEmailUsername:"User email or username",secretName:"Secret name",envName:"ENV_NAME",secretTarget:"Target project/provider/workflow",secretValue:"Secret value",workflowId:"Workflow id",name:"Name",pluginSource:"Source package or repository",installCommand:"Install command",permissionScopes:"Permission scopes, one per line",suiteName:"Suite name",description:"Description",firstTaskTitle:"First task title",acceptanceCriteria:"Acceptance criteria, one per line",suiteId:"Suite id",latencyMs:"Latency ms",passedCount:"Passed count",failedCount:"Failed count",workflow:"Workflow",inputTokens:"Input tokens",outputTokens:"Output tokens",costUsd:"Cost USD",optionalFindingTitle:"Optional finding title",auditFilter:"Filter audit log by user, project, event, or file",label:"Label",url:"URL",targetPort:"Target port"},labels:{project:"project",path:"path",providerModel:"provider/model",branch:"branch",failedCommands:"Failed commands",files:"Files",lastActive:"Last active",role:"role",tasks:"tasks",pass:"pass",health:"Health",reachable:"reachable",installed:"installed",loggedIn:"logged in"},columns:{provider:"Provider",model:"Model",workflow:"Workflow",runs:"Runs",tokens:"Tokens",cost:"Cost",latency:"Latency",errorRate:"Error rate"},fallback:{selectedProject:"selected project",projectPath:"project path",noneDetected:"none detected",noUrl:"No URL",global:"global",noSource:"No source",regressionSuite:"Regression suite",demoTask:"Demo task",provider:"provider",reviewRequired:"Review required.",notAvailable:"not available"},capabilities:{partner:"can approve actions, manage secrets, and use shell",projectScoped:"project-scoped access only"},teamAccess:{title:"How collaborators get access",stepUsers:"Create a sub-user",stepUsersDescription:"Create the person in Admin system with a global role such as member, viewer, project_worker, or project_partner.",stepRole:"Assign project role",stepRoleDescription:"Add the same user as a project collaborator so they only see and operate on the projects you choose.",stepLink:"Share an access path",stepLinkDescription:"Give them the Tailscale, Cloudflare Tunnel, custom domain, or LAN URL configured in Self-hosted access.",paths:"Available access links"},badges:{public:"public",private:"private"},empty:{noAuditEvents:"No audit events yet.",noRemoteAccessConfigs:"No remote access configs yet.",noReviewItems:"No review items yet.",noRecentJobs:"No recent jobs yet.",noRecentCheckpoints:"No recent checkpoints yet.",noSubUsers:"No sub-users yet.",noCollaborators:"No project collaborators yet.",noAccessPaths:"No access paths configured yet.",noIncludedEnvNames:"No included env names yet.",noSecrets:"No secrets yet.",noMarketplaceEntries:"No marketplace entries yet.",noSuites:"No suites yet.",noRuns:"No runs yet.",usageSummary:"Usage appears here after provider or workflow events are recorded.",noSecurityAudits:"No security audits yet.",noAuditMatches:"No audit entries match the current filter."}},Ise={title:"VS Code Workbench",noProject:"No project selected",activity:{explorer:"Explorer",projects:"Projects",sourceControl:"Source Control",terminal:"Terminal",showPanel:"Show left panel",hidePanel:"Hide left panel"},panels:{explorer:"Explorer",projects:"Projects",sourceControl:"Source Control",terminal:"Terminal",editor:"Editor",cli:"CLI",rightTerminal:"Terminal"},editor:{emptyTitle:"Open a file from Explorer",closeTab:"Close {{file}}",scrollLeft:"Scroll tabs left",scrollRight:"Scroll tabs right",moreActions:"More tab actions",closeSplit:"Close split editor",context:{close:"Close",closeAll:"Close All",copyPath:"Copy Path",splitRight:"Split Right",splitMoveRight:"Split and Move Right"}},resize:{left:"Resize left panel",right:"Resize CLI panel"},menu:{openProject:"Open Project...",cloneFromGithub:"Clone Repository...",newChat:"New Chat",openProjects:"Open Projects"},projects:{openProject:"Open Project",cloneFromGithub:"Clone",directoryList:"Directories",refresh:"Refresh projects",emptyTitle:"No project directories yet",emptyDescription:"Open a local folder or clone a repository to start.",selected:"Selected",startChat:"Chat",fileCount:"{{formattedCount}} files",fileCountPending:"Files pending",startTitle:"Start a Pixcode workspace",startDescription:"Pick a folder and Pixcode will bind the explorer, terminal, and chat history to that workspace.",workHere:"Work in this folder"},workspace:{empty:"Open a project to create Workspace 1.",openFirst:"Open a workspace",add:"Add workspace",scrollLeft:"Scroll workspaces left",scrollRight:"Scroll workspaces right",close:"Close {{name}}",closeAction:"Close workspace",closeOthers:"Close others",closeAll:"Close all",rename:"Rename",star:"Star",unstar:"Unstar",toggleStar:"Star {{name}}",moreActions:"Workspace actions"},cli:{projectScoped:"Project-scoped CLI terminal",chooseTitle:"Start a CLI terminal",chooseDescription:"Choose a CLI, then start a full-height terminal.",startSelected:"Start {{provider}}",newSession:"New CLI session",history:"History",noHistory:"No sessions for this project yet.",projectHistory:"Project history",checking:"Checking...",ready:"Ready",notInstalled:"Not installed",installing:"Installing...",updateAvailable:"Update {{version}}",installProvider:"Install {{provider}}",updateProvider:"Update {{provider}}",manualInstall:"This CLI needs manual installation.",installNoJob:"Install did not return a job id.",installFailed:"Install failed.",installStreamLost:"Install stream closed early. The install may still be running.",provider:"Provider",installRunning:"is installing",installDone:"is ready",installError:"needs attention",showPanel:"Show CLI panel",hidePanel:"Hide CLI panel",close:"Close terminal"},terminal:{title:"Terminal",close:"Close terminal"},hermes:{title:"Hermes Agent",installTitle:"Install Hermes Agent",description:"Project-scoped agent terminal. Installs Hermes when missing, then opens it in this workspace.",start:"Start Hermes",install:"Install",newSession:"New Hermes session",history:"Hermes history",connect:"Connect Hermes Agent",ready:"Ready",installRunning:"Installing Hermes through Pixcode API...",installDone:"Hermes installed and Pixcode MCP configured.",installError:"Hermes install failed.",installReady:"Ready to install Hermes.",installWaiting:"Waiting for Hermes install logs...",retryInstall:"Retry install",installFailed:"Hermes install failed.",installStreamLost:"Hermes install stream closed early. The install may still be running."}},_se={buttons:hse,tabs:fse,status:gse,messages:bse,navigation:xse,common:yse,time:vse,fileOperations:wse,mainContent:kse,orchestration:Sse,fileTree:Cse,projectWizard:Nse,notifications:Ese,versionUpdate:Tse,liveView:Ase,controlRoom:jse,vscodeWorkbench:Ise},Rse="Settings",Lse={account:"Account",permissions:"Permissions",mcpServers:"MCP Servers",pluginsMcp:"Plugins / MCP",configuration:"Configuration",appearance:"Appearance"},Pse={title:"Account",language:"Language",languageLabel:"Display Language",languageDescription:"Choose your preferred language for the interface",username:"Username",email:"Email",profile:"Profile",changePassword:"Change Password"},Dse={title:"MCP Servers",addServer:"Add Server",editServer:"Edit Server",deleteServer:"Delete Server",serverName:"Server Name",serverType:"Server Type",config:"Configuration",testConnection:"Test Connection",status:"Status",connected:"Connected",disconnected:"Disconnected",scope:{label:"Scope",user:"User",project:"Project"}},Ose={title:"Appearance",theme:"Theme",codeEditor:"Code Editor",editorTheme:"Editor Theme",wordWrap:"Word Wrap",showMinimap:"Show Minimap",lineNumbers:"Line Numbers",fontSize:"Font Size"},Mse={saveChanges:"Save Changes",resetToDefaults:"Reset to Defaults",cancelChanges:"Cancel Changes"},Fse={title:"Quick Settings",sections:{appearance:"Appearance",toolDisplay:"Tool Display",viewOptions:"View Options",inputSettings:"Input Settings",changeAwareness:"Command Center"},darkMode:"Dark Mode",autoExpandTools:"Auto-expand tools",showRawParameters:"Show raw parameters",showThinking:"Show thinking",autoScrollToBottom:"Auto-scroll to bottom",sendByCtrlEnter:"Send by Ctrl+Enter",sendByCtrlEnterDescription:"When enabled, pressing Ctrl+Enter will send the message instead of just Enter. This is useful for IME users to avoid accidental sends.",changeAwareness:"Command Center",changedFiles:{title:"Changed files",description:"Tracks local file changes and opens the Files panel when a new change appears.",noProject:"Select a project to track local changes.",refresh:"Refresh changed files",empty:"No local changes detected",disabled:"Enable Command Center to watch local changes.",more:"+{{count}} more files",lastChecked:"Checked {{value}}",guideTitle:"Right panel guide",guideFiles:"Changed files glow green in Files.",guidePanel:"New changes appear beside the active chat.",status:{M:"M",A:"A",D:"D",U:"U"}},dragHandle:{dragging:"Dragging handle",closePanel:"Close settings panel",openPanel:"Open settings panel",draggingStatus:"Dragging...",toggleAndMove:"Click to toggle, drag to move"}},zse={title:"Terminal Shortcuts",sectionKeys:"Keys",sectionNavigation:"Navigation",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"Arrow Up",arrowDown:"Arrow Down",scrollDown:"Scroll Down",handle:{closePanel:"Close shortcuts panel",openPanel:"Open shortcuts panel"}},Bse={label:"Settings",agents:"Agents",hermes:"Hermes Agent",appearance:"Appearance",git:"Git",apiTokens:"API & Tokens",notifications:"Notifications",plugins:"Plugins",mobile:"Use from Mobile",telegram:"Telegram",diagnostics:"Diagnostics",about:"About",access:"Access"},Use={title:"Use from Mobile",description:"Scan a QR code with your phone to open Pixcode on any device in the same network.",refresh:"Refresh",copy:"Copy",copied:"Copied!",loading:"Detecting network addresses…",noEndpoints:"No LAN addresses were detected. Make sure your device is connected to a network.",error:"Could not load network endpoints.",hostLabel:"Host",portLabel:"Port",steps:{sameNetwork:"Connect your phone to the same Wi-Fi network as this computer.",scan:"Open the camera app and scan one of the QR codes below.",login:"Sign in with your Pixcode credentials the first time."},external:{title:"External Access",description:"Expose Pixcode beyond your local network so you can reach it from the internet.",upnpTitle:"Router port mapping (UPnP)",upnpDescription:"One-click port forwarding via your router. Works on most home routers; fails silently on CGNAT or enterprise networks.",upnpEnable:"Enable UPnP",upnpDisable:"Disable UPnP",upnpEnabled:"UPnP mapping active",upnpUnsupported:"UPnP is not available on this network.",tunnelTitle:"Secure tunnel",tunnelDescription:"If UPnP is unavailable, install cloudflared or ngrok and start a tunnel — we'll auto-detect and show the QR here.",tunnelStart:"Start tunnel",tunnelStop:"Stop tunnel",tunnelRunning:"Tunnel running",tunnelUnavailable:"No tunnel binary found on this machine.",externalUrl:"External URL"}},$se={title:"Telegram",description:"Receive task completion notifications and chat with your agents from Telegram.",comingSoon:"Telegram integration is being prepared.",botToken:"Bot Token",botTokenPlaceholder:"123456:ABC-DEF…",botTokenHelp:"Create a bot with @BotFather and paste the token here.",saveToken:"Save & Start Bot",saving:"Saving…",botRunning:"Bot running as @{{username}}",botStopped:"Bot stopped",stopBot:"Stop Bot",removeToken:"Remove Token",pairing:{title:"Pair with your Telegram account",description:"Message your bot, then enter this 6-digit code inside the chat. The code refreshes every 10 minutes.",code:"Pairing Code",regenerate:"Generate new code",verified:"Paired with Telegram account",notPaired:"No Telegram account paired yet."},linkedAccount:{title:"Paired Account",username:"@{{username}}",language:"Replies in {{language}}",unpair:"Unpair"},notifications:{title:"Notifications",description:"Send agent completion and error events to your Telegram chat.",enabled:"Enabled",disabled:"Disabled"},bridge:{title:"Chat Bridge",description:"Messages you send to the bot become prompts for your most recent session. Replies come back to Telegram.",enabled:"Enabled",disabled:"Disabled"},control:{title:"Remote Control",description:"Use Telegram as a full Pixcode control surface for agents, orchestration, provider setup, and run status.",enabled:"Enable Telegram control",enabledDescription:"When enabled, paired Telegram messages can start agent and orchestration work on the selected project.",progressMode:"Progress mode",progressModeDescription:"Choose how much run output Telegram should send back.",progressModes:{final:"Final answer only",steps:"Important steps and final answer",all:"All visible step changes"},selectedProject:"Selected project",selectedProvider:"Selected provider",selectedModel:"Selected model",selectedWorkflow:"Selected workflow"},errors:{invalidToken:"Telegram rejected this bot token.",networkError:"Could not reach Telegram servers."}},Hse={title:"Notifications",description:"Control which notification events you receive.",webPush:{title:"Web Push Notifications",enable:"Enable Push Notifications",disable:"Disable Push Notifications",enabled:"Push notifications are enabled",loading:"Updating...",unsupported:"Push notifications are not supported in this browser.",denied:"Push notifications are blocked. Please allow them in your browser settings."},events:{title:"Event Types",actionRequired:"Action required",stop:"Run stopped",error:"Run failed",updates:"App and CLI updates"}},Gse={darkMode:{label:"Dark Mode",description:"Toggle between light and dark themes"},colorTheme:{title:"Color theme",palette:{label:"Accent palette",description:"Choose the product accent used by buttons, focus rings, navigation, and active states."},custom:{label:"Custom light/dark colors",description:"Pick separate accent colors for light and dark mode. Select Custom above to use them.",light:"Light",dark:"Dark"}},projectSorting:{label:"Project Sorting",description:"How projects are ordered in the sidebar",alphabetical:"Alphabetical",recentActivity:"Recent Activity"},codeEditor:{title:"Code Editor",theme:{label:"Editor Theme",description:"Default theme for the code editor"},wordWrap:{label:"Word Wrap",description:"Enable word wrapping by default in the editor"},showMinimap:{label:"Show Minimap",description:"Display a minimap for easier navigation in diff view"},lineNumbers:{label:"Show Line Numbers",description:"Display line numbers in the editor"},fontSize:{label:"Font Size",description:"Editor font size in pixels"}}},Vse={title:{add:"Add MCP Server",edit:"Edit MCP Server"},importMode:{form:"Form Input",json:"JSON Import"},scope:{label:"Scope",userGlobal:"User (Global)",projectLocal:"Project (Local)",userDescription:"User scope: Available across all projects on your machine",projectDescription:"Local scope: Only available in the selected project",cannotChange:"Scope cannot be changed when editing an existing server"},fields:{serverName:"Server Name",transportType:"Transport Type",command:"Command",arguments:"Arguments (one per line)",jsonConfig:"JSON Configuration",url:"URL",envVars:"Environment Variables (KEY=value, one per line)",headers:"Headers (KEY=value, one per line)",selectProject:"Select a project..."},placeholders:{serverName:"my-server"},validation:{missingType:"Missing required field: type",stdioRequiresCommand:"stdio type requires a command field",httpRequiresUrl:"{{type}} type requires a url field",invalidJson:"Invalid JSON format",jsonHelp:"Paste your MCP server configuration in JSON format. Example formats:",jsonExampleStdio:'• stdio: {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse: {"type":"http","url":"https://api.example.com/mcp"}'},configDetails:"Configuration Details (from {{configFile}})",projectPath:"Path: {{path}}",actions:{cancel:"Cancel",saving:"Saving...",addServer:"Add Server",updateServer:"Update Server"}},Wse={success:"Settings saved successfully!",error:"Failed to save settings",saving:"Saving..."},qse={save:"Save Settings",cancel:"Cancel"},Kse={title:"Git Configuration",description:"Configure your git identity for commits. These settings will be applied globally via git config --global",name:{label:"Git Name",help:"Your name for git commits"},email:{label:"Git Email",help:"Your email for git commits"},actions:{save:"Save Configuration",saving:"Saving..."},status:{success:"Saved successfully"}},Yse={title:"API Keys",description:"Generate API keys to access the external API from other applications.",newKey:{alertTitle:"⚠️ Save Your API Key",alertMessage:"This is the only time you'll see this key. Store it securely.",iveSavedIt:"I've saved it"},form:{placeholder:"API Key Name (e.g., Production Server)",createButton:"Create",cancelButton:"Cancel"},newButton:"New API Key",empty:"No API keys created yet.",list:{created:"Created:",lastUsed:"Last used:"},confirmDelete:"Are you sure you want to delete this API key?",status:{active:"Active",inactive:"Inactive"},github:{title:"GitHub Tokens",description:"Add GitHub Personal Access Tokens to clone private repositories via the external API.",descriptionAlt:"Add GitHub Personal Access Tokens to clone private repositories. You can also pass tokens directly in API requests without storing them.",addButton:"Add Token",form:{namePlaceholder:"Token Name (e.g., Personal Repos)",tokenPlaceholder:"GitHub Personal Access Token (ghp_...)",descriptionPlaceholder:"Description (optional)",addButton:"Add Token",cancelButton:"Cancel",howToCreate:"How to create a GitHub Personal Access Token →"},empty:"No GitHub tokens added yet.",added:"Added:",confirmDelete:"Are you sure you want to delete this GitHub token?"},apiDocsLink:"API Documentation",documentation:{title:"External API Documentation",description:"Learn how to use the external API to trigger Claude/Cursor sessions from your applications.",viewLink:"View API Documentation →"},loading:"Loading...",version:{updateAvailable:"Update available: v{{version}}"}},Zse={status:{title:"CLI status",notChecked:"Not checked yet",lastChecked:"Last checked: {{value}}",updatesFound:"{{count}} update available",refresh:"Refresh CLI status"},config:{blurb:"View or edit the files the {{name}} CLI reads on startup. Saves write directly to your home directory.",refresh:"Refresh",save:"Save",revert:"Revert",saved:"Saved",loading:"Loading…",notCreated:"new",readonly:"read-only",noFiles:"No config files are registered for this agent yet."},cliVersion:{title:"CLI version",installed:"Installed: {{version}}",unknownInstalled:"Installed version unknown",latest:"Latest: {{version}}",checkedAt:"Checked: {{value}}",cached:"cached",updateAvailable:"Update available",refresh:"Refresh",skipped:{external_installer:"External installer",installed_version_unavailable:"Installed version unavailable",latest_version_unavailable:"Latest version unavailable",not_installed:"Not installed"}},authStatus:{checking:"Checking...",connected:"Connected",notConnected:"Not connected",disconnected:"Disconnected",checkingAuth:"Checking authentication status...",loggedInAs:"Logged in as {{email}}",authenticatedUser:"authenticated user"},account:{claude:{description:"Anthropic Claude AI assistant"},cursor:{description:"Cursor AI-powered code editor"},codex:{description:"OpenAI Codex AI assistant"},gemini:{description:"Google Gemini AI assistant"},qwen:{description:"Alibaba Qwen Code CLI (Gemini CLI fork)"},opencode:{description:"Multi-provider terminal coding agent — Claude, OpenAI, Gemini, or local models"}},connectionStatus:"Connection Status",login:{title:"Login",reAuthenticate:"Re-authenticate",description:"Sign in to your {{agent}} account to enable AI features",reAuthDescription:"Sign in with a different account or refresh credentials",button:"Login",reLoginButton:"Re-login"},error:"Error: {{error}}"},Xse={title:"Permission Settings",skipPermissions:{label:"Skip permission prompts (use with caution)",claudeDescription:"Equivalent to --dangerously-skip-permissions flag",cursorDescription:"Equivalent to -f flag in Cursor CLI",opencodeDescription:"Equivalent to --dangerously-skip-permissions flag in OpenCode"},allowedTools:{title:"Allowed Tools",description:"Tools that are automatically allowed without prompting for permission",placeholder:'e.g., "Bash(git log:*)" or "Write"',quickAdd:"Quick add common tools:",empty:"No allowed tools configured"},blockedTools:{title:"Blocked Tools",description:"Tools that are automatically blocked without prompting for permission",placeholder:'e.g., "Bash(rm:*)"',empty:"No blocked tools configured"},allowedCommands:{title:"Allowed Shell Commands",description:"Shell commands that are automatically allowed without prompting",placeholder:'e.g., "Shell(ls)" or "Shell(git status)"',quickAdd:"Quick add common commands:",empty:"No allowed commands configured"},blockedCommands:{title:"Blocked Shell Commands",description:"Shell commands that are automatically blocked",placeholder:'e.g., "Shell(rm -rf)" or "Shell(sudo)"',empty:"No blocked commands configured"},toolExamples:{title:"Tool Pattern Examples:",bashGitLog:"- Allow all git log commands",bashGitDiff:"- Allow all git diff commands",write:"- Allow all Write tool usage",bashRm:"- Block all rm commands (dangerous)"},shellExamples:{title:"Shell Command Examples:",ls:"- Allow ls command",gitStatus:"- Allow git status",npmInstall:"- Allow npm install",rmRf:"- Block recursive delete"},opencodeAllowed:{title:"Allowed Bash Patterns",description:"Bash command patterns OpenCode auto-approves without prompting",placeholder:'e.g., "git *" or "npm test"',quickAdd:"Quick add common patterns:",empty:"No allowed patterns configured"},opencodeBlocked:{title:"Blocked Bash Patterns",description:"Bash command patterns OpenCode always denies",placeholder:'e.g., "rm -rf *" or "sudo *"',empty:"No blocked patterns configured"},opencodeExamples:{title:"Pattern Examples:",gitAll:"- Allow all git commands",gitPush:"- Block git push specifically",rmRf:"- Block recursive delete",npm:"- Allow all npm commands"},codex:{permissionMode:"Permission Mode",description:"Controls how Codex handles file modifications and command execution",modes:{default:{title:"Default",description:"Only trusted commands (ls, cat, grep, git status, etc.) run automatically. Other commands are skipped. Can write to workspace."},acceptEdits:{title:"Accept Edits",description:"All commands run automatically within the workspace. Full auto mode with sandboxed execution."},bypassPermissions:{title:"Bypass Permissions",description:"Full system access with no restrictions. All commands run automatically with full disk and network access. Use with caution."}},technicalDetails:"Technical details",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted. Trusted commands: cat, cd, grep, head, ls, pwd, tail, git status/log/diff/show, find (without -exec), etc.",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never. All commands auto-execute within project directory.",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never. Full system access, use only in trusted environments.",overrideNote:"You can override this per-session using the mode button in the chat interface."}},actions:{add:"Add"}},Jse={title:"MCP Servers",description:{claude:"Model Context Protocol servers provide additional tools and data sources to Claude",cursor:"Model Context Protocol servers provide additional tools and data sources to Cursor",codex:"Model Context Protocol servers provide additional tools and data sources to Codex"},addButton:"Add MCP Server",empty:"No MCP servers configured",serverType:"Type",scope:{local:"local",user:"user"},config:{command:"Command",url:"URL",args:"Args",environment:"Environment"},tools:{title:"Tools",count:"({{count}}):",more:"+{{count}} more"},actions:{edit:"Edit server",delete:"Delete server"},help:{title:"About Codex MCP",description:"Codex supports stdio-based MCP servers. You can add servers that extend Codex's capabilities with additional tools and resources."}},Qse={updateCheckFrequency:"Update check frequency",updateCheckFrequencyHint:"Pixcode caches GitHub release checks locally so shared IPs do not hit GitHub rate limits.",updateCheckFrequencyOptions:{"30m":"Every 30 minutes","6h":"Every 6 hours","12h":"Every 12 hours","24h":"Daily","7d":"Weekly",off:"Manual only"},checkForUpdate:"Check for updates",checkingForUpdate:"Checking...",updateFound:"Update found",upToDate:"Up to date",lastChecked:"Last checked {{when}}",notCheckedYet:"Update check has not completed yet",checkFailed:"check failed or delayed by rate limit"},eoe={title:"Plugins",description:"Extend the interface with custom plugins. Install from git or drop a folder in ~/.pixcode/plugins/",installPlaceholder:"https://github.com/user/my-plugin",installButton:"Install",installing:"Installing…",securityWarning:"Only install plugins whose source code you have reviewed or from authors you trust.",scanningPlugins:"Scanning plugins…",noPluginsInstalled:"No plugins installed",pullLatest:"Pull latest from git",noGitRemote:"No git remote — update not available",uninstallPlugin:"Uninstall plugin",confirmUninstall:"Click again to confirm",confirmUninstallMessage:"Remove {{name}}? This cannot be undone.",cancel:"Cancel",remove:"Remove",updateFailed:"Update failed",installFailed:"Installation failed",uninstallFailed:"Uninstall failed",toggleFailed:"Toggle failed",starterPluginLabel:"Starter Plugin",starter:"Starter",docs:"Docs",starterPlugin:{name:"Project Stats",badge:"starter",description:"File counts, lines of code, file-type breakdown, and recent activity for your project.",install:"Install"},terminalPlugin:{name:"Terminal",badge:"official",description:"Integrated terminal with full shell access directly within the interface.",install:"Install"},morePlugins:"More",enable:"Enable",disable:"Disable",installAriaLabel:"Plugin git repository URL",tab:"tab",runningStatus:"running"},toe={title:"Access",description:"Choose how people reach this self-hosted Pixcode server. Start with the same network, then use a secure tunnel, Tailscale, or your own domain when you need remote access.",refresh:"Refresh",copy:"Copy",copied:"Copied",save:"Save access path",check:"Check URL",qrAlt:"QR for {{url}}",guide:{title:"Pick the connection path first",description:"You do not need to know networking terms. Choose the situation that matches the person connecting, copy the shown link, or scan the QR code from their phone."},options:{sameNetwork:{title:"Same Wi-Fi/LAN",description:"Use this when the device is on the same router or office network as the Pixcode server."},secureTunnel:{title:"Temporary public link",description:"Start a Cloudflare/ngrok tunnel and Pixcode shows a public URL plus QR automatically."},tailscale:{title:"Private team link",description:"Use Tailscale when you want private access without a public domain or router setup."},customDomain:{title:"Own domain",description:"Use this when you already have HTTPS, a reverse proxy, or a Cloudflare Tunnel hostname."}},status:{ready:"Ready",detecting:"Detecting",guided:"Guided",configured:"Configured",optional:"Optional"},links:{title:"Available links",description:"Copy the correct URL for the device or teammate that needs to connect.",local:"Local",tailscale:"Tailscale private link",empty:"No access links detected yet."},local:{title:"Same network access",description:"Best first test: connect from the same Wi-Fi or LAN. Scan a QR code on the phone, or copy the link for a teammate on the same network.",thisDevice:"This computer only",loading:"Detecting same-network links...",empty:"No LAN link detected. Make sure the server is connected to a network and refresh.",saveLabel:"Same network access",save:"Save this LAN link"},tunnel:{title:"Secure tunnel",description:"For remote access without a fixed domain, Pixcode can start cloudflared or ngrok and show the public URL here.",secureLink:"Public link and QR",help:"Click start. If cloudflared or ngrok is installed, Pixcode creates a temporary HTTPS address and QR code automatically.",running:"Tunnel running",start:"Start tunnel",stop:"Stop tunnel",save:"Save this tunnel URL",saveLabel:"Secure tunnel access",qrLabel:"secure tunnel",installTitle:"Tunnel setup needed",installNeeded:"Install cloudflared or ngrok first, then press Start tunnel again."},tailscale:{title:"Tailscale private access",description:"Tailscale is an optional private network app. Install it on the server and user devices, sign in to the same team, then Pixcode can detect a private URL.",save:"Save this Tailscale URL",saveLabel:"Tailscale private access",openInstall:"Open Tailscale install",steps:{installServer:"Install Tailscale on the computer or server running Pixcode.",installUserDevice:"Install Tailscale on the phone, laptop, or teammate device that will open Pixcode.",login:"Sign in to the same Tailscale account or team on both devices.",refresh:"Return here and press Refresh; Pixcode will show the private URL when it is ready."}},advanced:{title:"Advanced: stable domain",description:"Use this when you already have a LAN URL, Tailscale URL, Cloudflare Tunnel hostname, or custom HTTPS domain that should be saved for users.",badge:"Advanced"},setup:{title:"Stable access path",description:"Save the URL your users will use. This can be a LAN address, Tailscale URL, Cloudflare Tunnel URL, or custom domain."},modes:{lan:"LAN",tailscale:"Tailscale",cloudflare_tunnel:"Cloudflare Tunnel",custom_domain:"Custom domain"},fields:{label:"Label",url:"URL",port:"Target port"},health:{reachable:"Pixcode is reachable",unreachable:"Pixcode is not reachable"},configured:{title:"Configured access paths",description:"These paths are available to admins, project partners, and project workers according to their role.",empty:"No configured access paths yet.",noUrl:"No URL",public:"public",private:"private"},team:{title:"How users connect",description:"Create the user in the Admin system, assign their project role in Control Room, then share one of these Access URLs. They do not need to be global admins to reach their assigned project."}},roe={title:"Hermes Agent",description:"Manage Hermes Agent as a Pixcode-controlled project terminal with MCP access to projects, provider status, and visible CLI launches.",statusTitle:"Install status",statusFailed:"Unable to check Hermes Agent.",ready:"Ready",notInstalled:"Not installed",start:"Start Hermes",install:"Install",repair:"Repair command",refresh:"Refresh",gatewayTitle:"REST API gateway",gatewayStatusFailed:"Unable to check Hermes REST gateway.",gatewayStartFailed:"Hermes REST gateway could not be started.",gatewayStopFailed:"Hermes REST gateway could not be stopped.",gatewayProbeFailed:"Hermes REST probe failed.",gatewayRunning:"REST gateway running",gatewayStopped:"REST gateway stopped",gatewayStart:"Start REST",gatewayProbe:"Test REST",gatewayStop:"Stop",gatewayProbeOk:"REST probe passed: health, capabilities, and models responded.",commandsTitle:"Hermes CLI settings",commandsDescription:"Open the real Hermes terminal wizards from Pixcode. Use Model and provider to connect Codex, OpenRouter, Anthropic, Gemini, and other providers.",commandsInstallFirst:"Install Hermes before opening CLI settings.",commands:{model:{title:"Model and provider",description:"Open the interactive provider/model wizard for OAuth, API keys, and default model selection."},auth:{title:"Credentials",description:"Manage OAuth sessions and API key pools for configured providers."},tools:{title:"Tools",description:"Choose which Hermes toolsets are enabled, including Pixcode MCP access."},doctor:{title:"Doctor",description:"Diagnose Hermes config, dependency, and platform problems in a terminal."},status:{title:"Status",description:"Show the current provider, auth, platform, and redacted setup summary."},lsp:{title:"LSP status",description:"Check Hermes language server integration for semantic diagnostics."},skills:{title:"Skills",description:"Browse, install, audit, and configure Hermes skills from the CLI."},sessions:{title:"Sessions",description:"Browse, export, rename, prune, or delete Hermes sessions."}},pixcodeControlTitle:"Pixcode control",pixcodeControlDescription:"Pixcode configures the Hermes MCP server before launch, so Hermes can inspect workspaces and open provider terminals inside the visible Pixcode UI when you ask it to."},noe={title:Rse,tabs:Lse,account:Pse,mcp:Dse,appearance:Ose,actions:Mse,quickSettings:Fse,terminalShortcuts:zse,mainTabs:Bse,mobile:Use,telegram:$se,notifications:Hse,appearanceSettings:Gse,mcpForm:Vse,saveStatus:Wse,footerActions:qse,git:Kse,apiKeys:Yse,agents:Zse,permissions:Xse,mcpServers:Jse,about:Qse,pluginSettings:eoe,access:toe,hermes:roe},aoe={title:"Welcome Back",description:"Sign in to your Pixcode self-hosted account",username:"Username",password:"Password",submit:"Sign In",loading:"Signing in...",errors:{invalidCredentials:"Invalid username or password",requiredFields:"Please fill in all fields",networkError:"Network error. Please try again."},placeholders:{username:"Enter your username",password:"Enter your password"}},ioe={title:"Create Account",username:"Username",password:"Password",confirmPassword:"Confirm Password",submit:"Create Account",loading:"Creating account...",errors:{passwordMismatch:"Passwords do not match",usernameTaken:"Username is already taken",weakPassword:"Password is too weak"}},soe={title:"Sign Out",confirm:"Are you sure you want to sign out?",button:"Sign Out"},ooe={login:aoe,register:ioe,logout:soe},loe={title:"Projects",newProject:"New Project",deleteProject:"Remove Project",renameProject:"Rename Project",noProjects:"No projects found",loadingProjects:"Loading projects...",searchPlaceholder:"Search projects...",projectNamePlaceholder:"Project name",starred:"Starred",all:"All",untitledSession:"Untitled Session",newSession:"New Session",codexSession:"Codex Session",fetchingProjects:"Fetching your Claude projects and sessions",projects:"projects",detectedFromHistory:"Detected from history",noMatchingProjects:"No matching projects",tryDifferentSearch:"Try adjusting your search term",runClaudeCli:"Run Claude CLI in a project directory to get started"},coe={title:"Pixcode",subtitle:"AI coding assistant interface"},doe={title:"Sessions",newSession:"New Session",deleteSession:"Delete Session",renameSession:"Rename Session",noSessions:"No sessions yet",loadingSessions:"Loading sessions...",unnamed:"Unnamed",loading:"Loading...",showMore:"Show more sessions",startToSee:"Start a new session to see it here."},uoe={section:"Orchestration",fallbackTitle:"Orchestration run"},poe={flat:"Recent",grouped:"By project"},moe={viewEnvironments:"View Environments",hideSidebar:"Hide sidebar",createProject:"Create new project",refresh:"Refresh projects and sessions (Ctrl+R)",renameProject:"Rename project (F2)",deleteProject:"Remove project from sidebar (Delete)",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",editSessionName:"Manually edit session name",deleteSession:"Delete this session permanently",sessionActions:"Session actions",historyView:"History view",historyViewFlat:"Recent conversations",historyViewGrouped:"Grouped by project",save:"Save",cancel:"Cancel",clearSearch:"Clear search"},hoe={chat:"Chat",files:"Files",git:"Git",terminal:"Terminal",tasks:"Tasks"},foe={refresh:"Refresh",settings:"Settings",collapseAll:"Collapse All",expandAll:"Expand All",cancel:"Cancel",save:"Save",delete:"Delete",rename:"Rename",starSession:"Star",unstarSession:"Remove star",joinCommunity:"Join Community",reportIssue:"Report Issue",starOnGithub:"Star on GitHub",controlRoom:"Control Room",controlRoomDescription:"Admin, access, runs"},goe={openSource:"Open Source"},boe={active:"Active",inactive:"Inactive",thinking:"Thinking...",error:"Error",aborted:"Aborted",unknown:"Unknown"},xoe={justNow:"Just now",oneMinuteAgo:"1 min ago",minutesAgo:"{{count}} mins ago",oneHourAgo:"1 hour ago",hoursAgo:"{{count}} hours ago",oneDayAgo:"1 day ago",daysAgo:"{{count}} days ago",buckets:{today:"Today",yesterday:"Yesterday",thisWeek:"Previous 7 days",thisMonth:"Previous 30 days",older:"Older"}},yoe={deleteConfirm:"Are you sure you want to delete this?",renameSuccess:"Renamed successfully",deleteSuccess:"Deleted successfully",errorOccurred:"An error occurred",deleteSessionConfirm:"Are you sure you want to delete this session? This action cannot be undone.",deleteProjectConfirm:"Remove this project from the sidebar? Your project files, memories, and session data will not be deleted.",enterProjectPath:"Please enter a project path",deleteSessionFailed:"Failed to delete session. Please try again.",deleteSessionError:"Error deleting session. Please try again.",renameSessionFailed:"Failed to rename session. Please try again.",renameSessionError:"Error renaming session. Please try again.",deleteProjectFailed:"Failed to remove project. Please try again.",deleteProjectError:"Error removing project. Please try again.",createProjectFailed:"Failed to create project. Please try again.",createProjectError:"Error creating project. Please try again."},voe={updateAvailable:"Update available"},woe={modeProjects:"Projects",modeConversations:"Conversations",conversationsPlaceholder:"Search in conversations...",searching:"Searching...",noResults:"No results found",tryDifferentQuery:"Try a different search query",matches_one:"{{count}} match",matches_other:"{{count}} matches",projectsScanned_one:"{{count}} project scanned",projectsScanned_other:"{{count}} projects scanned"},koe={deleteProject:"Remove Project",deleteSession:"Delete Session",confirmDelete:"What would you like to do with",sessionCount_one:"This project contains {{count}} conversation.",sessionCount_other:"This project contains {{count}} conversations.",removeFromSidebar:"Remove from sidebar only",deleteAllData:"Delete all data permanently",allConversationsDeleted:"The project will be removed from the sidebar. Your files, memories, and session data will be preserved.",cannotUndo:"You can re-add the project later."},Soe={projects:loe,app:coe,sessions:doe,orchestration:uoe,historyView:poe,tooltips:moe,navigation:hoe,actions:foe,branding:goe,status:boe,time:xoe,messages:yoe,version:voe,search:woe,deleteConfirmation:koe},Coe={copy:"Copy",copied:"Copied",copyCode:"Copy code"},Noe={copy:"Copy message",copied:"Message copied",selectFormat:"Select copy format",copyAsMarkdown:"Copy as markdown",copyAsText:"Copy as text"},Eoe={user:"U",error:"Error",tool:"Tool",claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code"},Toe={settings:"Tool Settings",error:"Tool Error",result:"Tool Result",viewParams:"View input parameters",viewRawParams:"View raw parameters",viewDiff:"View edit diff for",creatingFile:"Creating new file:",updatingTodo:"Updating Todo List",read:"Read",readFile:"Read file",updateTodo:"Update todo list",readTodo:"Read todo list",searchResults:"results"},Aoe={found:"Found {{count}} {{type}}",file:"file",files:"files",pattern:"pattern:",in:"in:"},joe={updated:"File updated successfully",created:"File created successfully",written:"File written successfully",diff:"Diff",newFile:"New File",viewContent:"View file content",viewFullOutput:"View full output ({{count}} chars)",contentDisplayed:"The file content is displayed in the diff view above"},Ioe={title:"Interactive Prompt",waiting:"Waiting for your response in the CLI",instruction:"Please select an option in your terminal where Claude is running.",selectedOption:"✓ Claude selected option {{number}}",instructionDetail:"In the CLI, you would select this option interactively using arrow keys or by typing the number."},_oe={title:"Thinking...",emoji:"💭 Thinking..."},Roe={response:"JSON Response"},Loe={grant:"Grant permission for {{tool}}",added:"Permission added",addTo:"Adds {{entry}} to Allowed Tools.",retry:"Permission saved. Retry the request to use the tool.",error:"Unable to update permissions. Please try again.",openSettings:"Open settings"},Poe={updated:"Todo list has been updated successfully",current:"Current Todo List"},Doe={viewPlan:"📋 View implementation plan",title:"Implementation Plan"},Ooe={resetAt:"Claude usage limit reached. Your limit will reset at **{{time}} {{timezone}}** - {{date}}"},Moe={permissionMode:"Permission Mode",modes:{default:"Default Mode",acceptEdits:"Accept Edits",bypassPermissions:"Bypass Permissions",plan:"Plan Mode"},descriptions:{default:"Only trusted commands (ls, cat, grep, git status, etc.) run automatically. Other commands are skipped. Can write to workspace.",acceptEdits:"All commands run automatically within the workspace. Full auto mode with sandboxed execution.",bypassPermissions:"Full system access with no restrictions. All commands run automatically with full disk and network access. Use with caution.",plan:"Planning mode - no commands are executed"},technicalDetails:"Technical details"},Foe={permissionMode:"Gemini Permission Mode",description:"Control how Gemini CLI handles operation approvals.",modes:{default:{title:"Standard (Ask for Approval)",description:"Gemini will prompt for approval before executing commands, writing files, and fetching web resources."},autoEdit:{title:"Auto Edit (Skip File Approvals)",description:"Gemini will automatically approve file edits and web fetches, but will still prompt for shell commands."},yolo:{title:"YOLO (Bypass All Permissions)",description:"Gemini will execute all operations without asking for approval. Exercise caution."}}},zoe={permissionMode:"Qwen Permission Mode",description:"Control how Qwen Code handles operation approvals.",modes:{default:{title:"Standard (Ask for Approval)",description:"Qwen Code will prompt for approval before executing commands, writing files, and fetching web resources."},autoEdit:{title:"Auto Edit (Skip File Approvals)",description:"Qwen Code will automatically approve file edits and web fetches, but will still prompt for shell commands."},yolo:{title:"YOLO (Bypass All Permissions)",description:"Qwen Code will execute all operations without asking for approval. Exercise caution."}}},Boe={placeholder:"Type / for commands, @ for files, or ask {{provider}} anything...",placeholderDefault:"Type your message...",disabled:"Input disabled",attachFiles:"Attach files",attachImages:"Attach images",send:"Send",stop:"Stop",clickToChangeMode:"Click to change permission mode (or press Tab in input)",showAllCommands:"Show all commands",clearInput:"Clear input",scrollToBottom:"Scroll to bottom"},Uoe={selector:{title:"Thinking Mode",description:"Extended thinking gives Claude more time to evaluate alternatives",active:"Active",tip:"Higher thinking modes take more time but provide more thorough analysis"},modes:{none:{name:"Standard",description:"Regular Claude response",prefix:""},think:{name:"Think",description:"Basic extended thinking",prefix:"think"},thinkHard:{name:"Think Hard",description:"More thorough evaluation",prefix:"think hard"},thinkHarder:{name:"Think Harder",description:"Deep analysis with alternatives",prefix:"think harder"},ultrathink:{name:"Ultrathink",description:"Maximum thinking budget",prefix:"ultrathink"}},buttonTitle:"Thinking mode: {{mode}}"},$oe={title:"Choose Your AI Assistant",description:"Select a provider to start a new conversation",selectModel:"Select Model",statusUnavailable:"Status unavailable",statusRetryHint:"Could not check this CLI. Tap to retry.",retryStatus:"Retry status",providerInfo:{anthropic:"by Anthropic",openai:"by OpenAI",cursorEditor:"AI Code Editor",google:"by Google"},readyPrompt:{claude:"Ready to use Claude with {{model}}. Start typing your message below.",cursor:"Ready to use Cursor with {{model}}. Start typing your message below.",codex:"Ready to use Codex with {{model}}. Start typing your message below.",gemini:"Ready to use Gemini with {{model}}. Start typing your message below.",default:"Select a provider above to begin"}},Hoe={continue:{title:"Continue your conversation",description:"Ask questions about your code, request changes, or get help with development tasks"},loading:{olderMessages:"Loading older messages...",sessionMessages:"Loading session messages..."},messages:{showingOf:"Showing {{shown}} of {{total}} messages",scrollToLoad:"Scroll up to load more",showingLast:"Showing last {{count}} messages ({{total}} total)",loadEarlier:"Load earlier messages",loadAll:"Load all messages",loadingAll:"Loading all messages...",allLoaded:"All messages loaded",perfWarning:'All messages loaded — scrolling may be slower. Click "Scroll to bottom" to restore performance.'}},Goe={selectProject:{title:"Select a Project",description:"Choose a project to open an interactive shell in that directory"},status:{newSession:"New Session",initializing:"Initializing...",restarting:"Restarting..."},actions:{disconnect:"Disconnect",disconnectTitle:"Disconnect from shell",restart:"Restart",restartTitle:"Restart Shell (disconnect first)",connect:"Continue in Shell",connectTitle:"Connect to shell"},loading:"Loading terminal...",connecting:"Connecting to shell...",startSession:"Start a new Claude session",startProviderSession:"Start a new {{provider}} session",resumeSession:"Resume session: {{displayName}}...",runCommand:"Run {{command}} in {{projectName}}",startCli:"Starting Claude CLI in {{projectName}}",startProviderCli:"Starting {{provider}} in {{projectName}}",defaultCommand:"command"},Voe={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},Woe={startChatWithProvider:"Select a project to start chatting with {{provider}}"},qoe={nextTaskPrompt:"Start the next task"},Koe={codeBlock:Coe,copyMessage:Noe,messageTypes:Eoe,tools:Toe,search:Aoe,fileOperations:joe,interactive:Ioe,thinking:_oe,json:Roe,permissions:Loe,todo:Poe,plan:Doe,usageLimit:Ooe,codex:Moe,gemini:Foe,qwen:zoe,input:Boe,thinkingMode:Uoe,providerSelection:$oe,session:Hoe,shell:Goe,claudeStatus:Voe,projectSelection:Woe,tasks:qoe},Yoe={changes:"changes",previousChange:"Previous change",nextChange:"Next change",hideDiff:"Hide diff highlighting",showDiff:"Show diff highlighting",settings:"Editor Settings",collapse:"Collapse editor",expand:"Expand editor to full width"},Zoe="Loading {{fileName}}...",Xoe={showingChanges:"Showing changes"},Joe={download:"Download file",save:"Save",saving:"Saving...",saved:"Saved!",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",close:"Close",previewMarkdown:"Preview markdown",editMarkdown:"Edit markdown"},Qoe={lines:"Lines:",characters:"Characters:",shortcuts:"Press Ctrl+S to save • Esc to close"},ele={title:"Binary File",message:'The file "{{fileName}}" cannot be displayed in the text editor because it is a binary file.'},tle={toolbar:Yoe,loading:Zoe,header:Xoe,actions:Joe,footer:Qoe,binaryFile:ele},rle={title:"TaskMaster AI is not configured",description:"TaskMaster helps break down complex projects into manageable tasks with AI-powered assistance",whatIsTitle:"🎯 What is TaskMaster?",features:{aiPowered:"AI-Powered Task Management: Break complex projects into manageable subtasks",prdTemplates:"PRD Templates: Generate tasks from Product Requirements Documents",dependencyTracking:"Dependency Tracking: Understand task relationships and execution order",progressVisualization:"Progress Visualization: Kanban boards and detailed task analytics",cliIntegration:"CLI Integration: Use taskmaster commands for advanced workflows"},initializeButton:"Initialize TaskMaster AI"},nle={title:"Getting Started with TaskMaster",subtitle:"TaskMaster is initialized! Here's what to do next:",steps:{createPRD:{title:"Create a Product Requirements Document (PRD)",description:"Discuss your project idea and create a PRD that describes what you want to build.",addButton:"Add PRD",existingPRDs:"Existing PRDs:"},generateTasks:{title:"Generate Tasks from PRD",description:"Once you have a PRD, ask your AI assistant to parse it and TaskMaster will automatically break it down into manageable tasks with implementation details."},analyzeTasks:{title:"Analyze & Expand Tasks",description:"Ask your AI assistant to analyze task complexity and expand them into detailed subtasks for easier implementation."},startBuilding:{title:"Start Building",description:"Ask your AI assistant to begin working on tasks, update their status, and add new tasks as your project evolves."}},tip:"💡 Tip: Start with a PRD to get the most out of TaskMaster's AI-powered task generation"},ale={title:"TaskMaster Setup",subtitle:"Interactive CLI for {{projectName}}",willStart:"TaskMaster initialization will start automatically",completed:"TaskMaster setup completed! You can now close this window.",closeButton:"Close",closeContinueButton:"Close & Continue"},ile={title:"Getting Started with TaskMaster",subtitle:"Your guide to productive task management",examples:{parsePRD:`💬 Example:
|
|
800
|
+
`),n=Math.max(t.length,r.length);for(let a=0;a<n;a+=1)if(t[a]!==r[a])return a+1;return null}function Uae(e,t){const r=encodeURIComponent(e);return t&&t>0?`${r}#L${t}`:r}const $ae={M:"M",A:"A",D:"D",U:"U"},Hae={M:"border-amber-400/40 bg-amber-500/10 text-amber-700 dark:text-amber-200",A:"border-emerald-400/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-200",D:"border-red-400/40 bg-red-500/10 text-red-700 dark:text-red-200",U:"border-sky-400/40 bg-sky-500/10 text-sky-700 dark:text-sky-200"};function Gae(e){return e?new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e):null}function Vae({changedFiles:e,isLoading:t,error:r,latestChangedFilePath:n,lastCheckedAt:a,trackingMode:s,onTrackingModeChange:o,onRefresh:l,onOpenFile:c,variant:d="rail"}){const u=Gae(a),p=d==="panel";return i.jsxs("aside",{className:xe("h-full min-h-0 flex-col overflow-hidden bg-card/45",p?"flex w-full rounded-none border-0":"hidden w-[260px] shrink-0 rounded-lg border border-border/60 shadow-sm xl:flex"),children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border/60 px-3 py-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 shadow-[0_0_10px_rgba(16,185,129,0.75)]"}),"Command Center"]}),i.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:e.length>0?`${e.length} local change${e.length===1?"":"s"}`:"Watching agent writes"})]}),i.jsx("button",{type:"button",onClick:l,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":"Refresh changed files",title:"Refresh changed files",children:t?i.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin"}):i.jsx(it,{className:"h-3.5 w-3.5"})})]}),i.jsx("div",{className:"border-b border-border/60 px-3 py-2",children:i.jsxs("div",{className:"grid grid-cols-2 rounded-md border border-border bg-background p-0.5 text-[11px] font-medium",children:[i.jsx("button",{type:"button",onClick:()=>o("local"),className:`rounded px-2 py-1 transition-colors ${s==="local"?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,title:"Local changes: agent writes and filesystem edits",children:"Local changes"}),i.jsx("button",{type:"button",onClick:()=>o("git"),className:`rounded px-2 py-1 transition-colors ${s==="git"?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,title:"Git changes: git status only",children:"Git changes"})]})}),r&&i.jsx("div",{className:"mx-3 mt-3 rounded-md border border-amber-500/25 bg-amber-500/10 px-2 py-1.5 text-[11px] leading-5 text-amber-700 dark:text-amber-200",children:r}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:e.length===0?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-3 text-center text-muted-foreground",children:[i.jsx(ra,{className:"mb-2 h-8 w-8 opacity-45"}),i.jsx("p",{className:"text-xs font-medium text-foreground",children:"No local changes detected"}),i.jsx("p",{className:"mt-1 text-[11px] leading-5",children:"When an agent writes or edits files, they will appear here."})]}):i.jsxs("div",{className:"space-y-1",children:[e.slice(0,12).map(f=>{const h=n===f.path,g=Bae(f.diffInfo),b=g?`L${g}`:null,x=Uae(f.path,g);return i.jsxs("button",{type:"button",onClick:()=>c(f),className:`group flex w-full items-center gap-2 rounded-md border px-2 py-1.5 text-left transition-all ${h?"changed-file-flash border-emerald-500/60 bg-emerald-500/15":"border-border/60 bg-background/70 hover:border-emerald-500/35 hover:bg-emerald-500/10"}`,title:x,children:[i.jsx("span",{className:`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-[10px] font-semibold ${Hae[f.status]}`,children:$ae[f.status]}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",children:f.path}),b&&i.jsx("span",{className:"shrink-0 rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:b})]},`${f.status}:${f.path}`)}),e.length>12&&i.jsxs("p",{className:"px-1 pt-1 text-[11px] text-muted-foreground",children:["+",e.length-12," more files"]})]})}),u&&i.jsxs("div",{className:"border-t border-border/60 px-3 py-2 text-[10px] text-muted-foreground",children:["Last check ",u]})]})}const Wae=m.createContext(null),jh={didCatch:!1,error:null};let qae=class extends m.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=jh}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:s,reason:"imperative-api"}),this.setState(jh)}}componentDidCatch(t,r){var n,a;(n=(a=this.props).onError)===null||n===void 0||n.call(a,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:a}=this.props;if(n&&r.error!==null&&Kae(t.resetKeys,a)){var s,o;(s=(o=this.props).onReset)===null||s===void 0||s.call(o,{next:a,prev:t.resetKeys,reason:"keys"}),this.setState(jh)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:a}=this.props,{didCatch:s,error:o}=this.state;let l=t;if(s){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")l=r(c);else if(n)l=m.createElement(n,c);else if(a!==void 0)l=a;else throw o}return m.createElement(Wae.Provider,{value:{didCatch:s,error:o,resetErrorBoundary:this.resetErrorBoundary}},l)}};function Kae(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}function Yae(e){return e instanceof Error?`${e.name}: ${e.message}`:String(e)}function Zae({error:e,resetErrorBoundary:t,showDetails:r,componentStack:n}){return i.jsx("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:i.jsxs("div",{className:"max-w-md rounded-lg border border-red-200 bg-red-50 p-6",children:[i.jsxs("div",{className:"mb-4 flex items-center",children:[i.jsx("div",{className:"flex-shrink-0",children:i.jsx("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:i.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),i.jsx("h3",{className:"ml-3 text-sm font-medium text-red-800",children:"Something went wrong"})]}),i.jsxs("div",{className:"text-sm text-red-700",children:[i.jsx("p",{className:"mb-2",children:"An error occurred while loading the chat interface."}),r&&i.jsxs("details",{className:"mt-4",children:[i.jsx("summary",{className:"cursor-pointer font-mono text-xs",children:"Error Details"}),i.jsxs("pre",{className:"mt-2 max-h-40 overflow-auto rounded bg-red-100 p-2 text-xs",children:[Yae(e),n]})]})]}),i.jsx("div",{className:"mt-4",children:i.jsx("button",{onClick:t,className:"rounded bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500",children:"Try Again"})})]})})}function Xae({children:e,showDetails:t=!1,onRetry:r=void 0,resetKeys:n=void 0}){const[a,s]=m.useState(null),o=m.useCallback((d,u)=>{console.error("ErrorBoundary caught an error:",d,u),s(u?.componentStack??null)},[]),l=m.useCallback(()=>{s(null),r?.()},[r]),c=m.useCallback(({error:d,resetErrorBoundary:u})=>i.jsx(Zae,{error:d,resetErrorBoundary:u,showDetails:t,componentStack:a}),[t,a]);return i.jsx(qae,{fallbackRender:c,onError:o,onReset:l,resetKeys:n,children:e})}const Jae=new Set(["files","shell","git","changes","liveView"]),Qae=40,eie=50,tie=46,yC="command-center-tracking-mode";function Cd(e){return Jae.has(e)}function rie(e){return Math.min(eie,Math.max(Qae,e))}function vC(){return typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}function nie({selectedProject:e,selectedSession:t,activeTab:r,setActiveTab:n,ws:a,sendMessage:s,latestMessage:o,isMobile:l,onMenuClick:c,isLoading:d,onInputFocusChange:u,onSessionActive:p,onSessionInactive:f,onSessionProcessing:h,onSessionNotProcessing:g,processingSessions:b,onReplaceTemporarySession:x,onNavigateToSession:y,onShowSettings:v,externalMessageUpdate:w,onQuickStartSession:C,onQuickStartOrchestration:k}){const{preferences:N}=Lg(),{autoExpandTools:j,showRawParameters:A,showThinking:E,autoScrollToBottom:T,sendByCtrlEnter:_}=N,[I,R]=m.useState("split"),[S,F]=m.useState(tie),[B,z]=m.useState(!1),[q,V]=m.useState(!1),[P,U]=m.useState(()=>typeof window>"u"?"local":window.localStorage.getItem(yC)==="git"?"git":"local"),[H,M]=m.useState(()=>Cd(r)?"chat":r),[ee,Q]=m.useState(()=>typeof window<"u"&&window.innerWidth>=1024),ge=Cd(r)?r:null,se=!!(ge&&!l&&ee&&I==="split"),ce=m.useRef(null),ye=m.useRef(null),pe=m.useRef(null),ve=m.useRef(null),ue=m.useRef(null);B3(ce,r);const{editingFile:de,editorWidth:D,editorExpanded:X,hasManualWidth:oe,resizeHandleRef:K,handleFileOpen:W,handleCloseEditor:ne,handleToggleEditorExpand:me,handleResizeStart:we}=bne({selectedProject:e,isMobile:l}),le=H==="orchestration"?"orchestration":"chat",Ae=ge?le:r,te=!!se,ae=!!(ge==="files"&&de&&!l),J=Ae==="chat"&&(!ge||te),fe=Ae==="orchestration"&&te,{changedFiles:Ee,isLoading:Me,error:Xe,lastCheckedAt:Je,latestDetectedFile:st,refresh:tt}=gne(e,!!e,o,P),[Ct,ot]=m.useState(null),ut=m.useRef(0),ft=m.useMemo(()=>Ee.map(Ge=>Ge.path),[Ee]),kt=m.useCallback(async Ge=>{if(Ge.diffInfo)return Ge.diffInfo;if(!e)return null;try{const je=await Se(`/api/git/file-with-diff?project=${encodeURIComponent(e.name)}&file=${encodeURIComponent(Ge.path)}`,{cache:"no-store"}),Ue=await je.json();if(je.ok&&!Ue.error&&typeof Ue.currentContent=="string"&&typeof Ue.oldContent=="string")return{old_string:Ue.oldContent,new_string:Ue.currentContent}}catch{}if(Ge.status==="A"||Ge.status==="U")try{const je=await Lt.readFile(e.name,Ge.path);if(!je.ok)return null;const Ue=await je.json();if(typeof Ue.content=="string")return{old_string:"",new_string:Ue.content}}catch{return null}return null},[e]),$t=m.useCallback(Ge=>{ot(Ge.path),W(Ge.path,Ge.diffInfo??null),!l&&ee&&R("split"),n("files"),Ge.diffInfo||kt(Ge).then(je=>{je&&W(Ge.path,je)})},[ee,W,kt,l,n]),Mt=m.useCallback(()=>{R("split"),n(le)},[n,le]),Ot=Ge=>Ge==="files"?ae?i.jsxs("div",{className:"flex h-full min-w-0 overflow-hidden",children:[!X&&i.jsx("div",{className:"h-full min-w-[220px] max-w-[50%] flex-[0_0_46%] overflow-hidden border-r border-border/60",children:i.jsx(ag,{selectedProject:e,onFileOpen:W,changedFilePaths:ft,focusedFilePath:Ct})}),i.jsx(bC,{editingFile:de,isMobile:l,editorExpanded:X,editorWidth:D,hasManualWidth:oe,resizeHandleRef:K,onResizeStart:we,onCloseEditor:ne,onToggleEditorExpand:me,projectPath:e?.path,fillSpace:!0})]}):i.jsx(ag,{selectedProject:e,onFileOpen:W,changedFilePaths:ft,focusedFilePath:Ct}):Ge==="shell"?i.jsx(Vl,{project:e,session:t,showHeader:!1,isActive:r==="shell"}):Ge==="changes"?i.jsx(Vae,{changedFiles:Ee,isLoading:Me,error:Xe,latestChangedFilePath:st?.path??Ct,lastCheckedAt:Je,trackingMode:P,onTrackingModeChange:U,onRefresh:()=>{tt("manual")},onOpenFile:$t,variant:"panel"}):Ge==="liveView"?e?i.jsx(bre,{selectedProject:e,onAvailabilityChange:V}):null:i.jsx(y6,{selectedProject:e,isMobile:l,onFileOpen:W});m.useEffect(()=>{if(!e){V(!1);return}let Ge=!1;return Se(`/api/live-view/${encodeURIComponent(e.name)}/status`,{cache:"no-store"}).then(je=>je.ok?je.json():null).then(je=>{Ge||V(!!(je?.target?.available||je?.session))}).catch(()=>{Ge||V(!1)}),()=>{Ge=!0}},[e]),m.useEffect(()=>{if(typeof window>"u")return;const Ge=()=>{Q(window.innerWidth>=1024)};return Ge(),window.addEventListener("resize",Ge),()=>{window.removeEventListener("resize",Ge)}},[]),m.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(yC,P)},[P]),m.useEffect(()=>{Cd(r)||M(r)},[r]);const Ht=m.useCallback(Ge=>{const je=typeof Ge=="function"?Ge(r):Ge;!l&&ee&&Cd(je)?r===je?(ue.current=ve.current?.getBoundingClientRect()??null,R(Ue=>Ue==="split"?"full":"split")):R("split"):(R("split"),M(je)),n(je)},[r,ee,l,n]),Gt=m.useCallback(Ge=>{if(!ye.current||!te)return;Ge.preventDefault(),Ge.currentTarget.setPointerCapture?.(Ge.pointerId),z(!0);const je=lt=>{const yt=ye.current?.getBoundingClientRect();if(!yt||yt.width<=0)return;const Rt=(yt.right-lt)/yt.width*100;F(rie(Rt))};je(Ge.clientX);const Ue=lt=>{je(lt.clientX)},We=()=>{z(!1),window.removeEventListener("pointermove",Ue),window.removeEventListener("pointerup",We),window.removeEventListener("pointercancel",We)};window.addEventListener("pointermove",Ue),window.addEventListener("pointerup",We,{once:!0}),window.addEventListener("pointercancel",We,{once:!0})},[te]);return m.useLayoutEffect(()=>{const Ge=ue.current,je=ve.current;if(!Ge||!je||vC()){ue.current=null;return}const Ue=je.getBoundingClientRect();if(Ue.width<=0||Ue.height<=0){ue.current=null;return}const We=Ge.left-Ue.left,lt=Ge.width/Ue.width;In.fromTo(je,{x:We,scaleX:lt,opacity:.94,transformOrigin:"right center"},{x:0,scaleX:1,opacity:1,duration:fr.duration.enter,ease:fr.ease.soft,clearProps:"transform,opacity,transformOrigin"}),ue.current=null},[I,se]),m.useEffect(()=>{se||z(!1)},[se]),m.useEffect(()=>{if(!te||vC())return;const Ge=pe.current,je=ve.current;if(!Ge||!je)return;const Ue=In.context(()=>{In.fromTo(Ge,{opacity:.92,x:-14},{opacity:1,x:0,duration:fr.duration.base,ease:fr.ease.out,clearProps:"transform,opacity"}),In.fromTo(je,{opacity:0,x:28,scaleX:.96,transformOrigin:"right center"},{opacity:1,x:0,scaleX:1,duration:fr.duration.enter,ease:fr.ease.soft,clearProps:"transform,opacity,transformOrigin"})},ye);return()=>Ue.revert()},[ge,te]),m.useEffect(()=>{st&&st.detectedAt!==ut.current&&(ut.current=st.detectedAt,ot(st.path))},[st]),m.useEffect(()=>{if(!Ct)return;const Ge=window.setTimeout(()=>ot(null),7e3);return()=>window.clearTimeout(Ge)},[Ct]),d?i.jsx(mg,{mode:"loading",isMobile:l,onMenuClick:c}):!e&&r==="controlRoom"?i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx(xC,{activeTab:r,setActiveTab:Ht,selectedProject:null,selectedSession:null,liveViewAvailable:!1,activeSidePanelTab:null,sidePanelMode:I,canUseSidePanelSplit:ee,isMobile:l,onMenuClick:c}),i.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:i.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:i.jsx(cg,{selectedProject:null})})})]}):e?i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx(xC,{activeTab:r,setActiveTab:Ht,selectedProject:e,selectedSession:t,liveViewAvailable:q,activeSidePanelTab:ge,sidePanelMode:I,canUseSidePanelSplit:ee,isMobile:l,onCloseSidePanel:ge?Mt:void 0,onMenuClick:c}),i.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[i.jsxs("div",{ref:ce,className:xe("flex min-h-0 min-w-[200px] flex-1 flex-col overflow-hidden",X&&"hidden",!de&&!ge&&!se&&"mx-auto w-full max-w-[1100px] px-4 md:px-8",!de&&ge&&!te&&"w-full px-3 md:px-4",!de&&te&&"w-full px-3 md:px-4",!de&&r==="orchestration"&&"max-w-none px-0 md:px-0",!de&&r==="remote"&&"max-w-none px-0 md:px-0",!de&&r==="controlRoom"&&"max-w-none px-0 md:px-0"),children:[(J||fe||ge)&&i.jsxs("div",{ref:ye,className:xe("h-full min-h-0",te&&"flex overflow-hidden",B&&"select-none"),children:[J&&i.jsx("div",{ref:pe,className:xe("min-h-0 overflow-hidden",te&&"min-w-[320px] flex-none transition-[width,opacity,transform] duration-300 ease-out",B&&"transition-none",!te&&"h-full"),style:te?{width:`${100-S}%`}:void 0,children:i.jsx("div",{className:"flex h-full min-h-0 min-w-0 flex-1",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(Xae,{showDetails:!0,children:i.jsx(Ree,{selectedProject:e,selectedSession:t,ws:a,sendMessage:s,latestMessage:o,onFileOpen:W,onInputFocusChange:u,onSessionActive:p,onSessionInactive:f,onSessionProcessing:h,onSessionNotProcessing:g,processingSessions:b,onReplaceTemporarySession:x,onNavigateToSession:y,onShowSettings:v,autoExpandTools:j,showRawParameters:A,showThinking:E,autoScrollToBottom:T,sendByCtrlEnter:_,externalMessageUpdate:w})})})})}),fe&&i.jsx("div",{ref:pe,className:xe("min-h-0 overflow-hidden",te&&"min-w-[320px] flex-none transition-[width,opacity,transform] duration-300 ease-out",B&&"transition-none"),style:te?{width:`${100-S}%`}:void 0,children:i.jsx("div",{className:"flex h-full min-h-0 min-w-0 flex-1",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(B4,{selectedProject:e})})})}),te&&i.jsxs("button",{type:"button",className:"group relative z-20 mx-1 flex w-3 shrink-0 cursor-col-resize touch-none items-center justify-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onPointerDown:Gt,"aria-label":"Resize side panel",title:"Drag to resize",children:[i.jsx("span",{className:"absolute inset-y-3 -left-2 -right-2 rounded-full"}),i.jsx("span",{className:xe("h-16 w-1 rounded-full bg-border transition-all duration-200 group-hover:h-24 group-hover:bg-foreground/40",B&&"h-28 bg-foreground/55 shadow-[0_0_18px_rgba(120,120,120,0.22)]")})]}),ge&&i.jsx("div",{ref:ve,className:xe("min-h-0 overflow-hidden rounded-lg border border-border/60 bg-card/40",te&&"min-w-[360px] flex-none shadow-sm transition-[width,opacity,transform] duration-300 ease-out",B&&"transition-none",!te&&"h-full w-full"),style:te?{width:`${S}%`}:void 0,children:Ot(ge)})]}),!ge&&r==="orchestration"&&i.jsx("div",{className:"flex h-full min-h-0 min-w-0 overflow-hidden",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(B4,{selectedProject:e})})}),!ge&&r==="remote"&&i.jsx("div",{className:"flex h-full min-h-0 min-w-0 overflow-hidden",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(j6,{})})}),!ge&&r==="controlRoom"&&i.jsx("div",{className:"flex h-full min-h-0 min-w-0 overflow-hidden",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(cg,{selectedProject:e})})}),i.jsx("div",{className:`h-full overflow-hidden ${r==="preview"?"block":"hidden"}`}),r.startsWith("plugin:")&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(P6,{pluginName:r.replace("plugin:",""),selectedProject:e,selectedSession:t})})]}),!ae&&i.jsx(bC,{editingFile:de,isMobile:l,editorExpanded:X,editorWidth:D,hasManualWidth:oe,resizeHandleRef:K,onResizeStart:we,onCloseEditor:ne,onToggleEditorExpand:me,projectPath:e.path,fillSpace:r==="files"})]}),i.jsx(Jre,{})]}):i.jsx(mg,{mode:"empty",isMobile:l,onMenuClick:c,onQuickStartSession:C,onQuickStartOrchestration:k,onOpenControlRoom:()=>n("controlRoom")})}const aie=ln.memo(nie),ui="hermes --yolo --toolsets mcp-pixcode",iie="hermes sessions browse",sie=260,oie=520,lie=340,Ih=320,_h=680,cie=420,wC=80,die=150,uie=560,pie=256,mie=34,iI="pixcode.workbench.workspaceTabs.v1",sI="pixcode.workbench.cliState.v1",oI="pixcode.workbench.editorState.v1",lI="pixcode.workbench.hermesState.v1",cw=10,dw=["claude","codex","cursor","gemini","qwen","opencode"],cI=30;function bl(e,t,r){return Math.min(r,Math.max(t,e))}function Nd(e){return e==="remote"||e==="controlRoom"||e.startsWith("plugin:")}function hie(e){return e==="git"||e==="changes"?"sourceControl":"explorer"}function _n(e){return e.fullPath||e.path||e.displayName||e.name}function Tu(e){const t=_n(e),n=t.replace(/\\/g,"/").split("/").filter(Boolean);return n.length===0?t||e.name:`/${n[n.length-1]}`}function dI(e,t){return typeof e!="number"||!Number.isFinite(e)?t("vscodeWorkbench.projects.fileCountPending",{defaultValue:"Files pending"}):t("vscodeWorkbench.projects.fileCount",{count:e,formattedCount:e.toLocaleString(),defaultValue:"{{formattedCount}} files"})}function ns(e){return(e.fullPath||e.path||e.name).replace(/\\/g,"/")}function Zs(e){return e?_n(e).replace(/\\/g,"/"):null}function fie(e){return e?_n(e).replace(/\\/g,"/"):null}function gie(e){return typeof e=="string"&&dw.includes(e)}function bie(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.path=="string"}function xie(){if(typeof window>"u")return[];try{const e=JSON.parse(window.localStorage.getItem(iI)??"[]");return Array.isArray(e)?e.filter(t=>typeof t.id=="string"&&typeof t.projectName=="string").slice(0,cw):[]}catch{return[]}}function yie(e){if(!(typeof window>"u"))try{window.localStorage.setItem(iI,JSON.stringify(e.slice(0,cw)))}catch{}}function uI(){if(typeof window>"u")return{};try{const e=JSON.parse(window.localStorage.getItem(sI)??"{}");return!e||typeof e!="object"||Array.isArray(e)?{}:e}catch{return{}}}function vie(e){if(!e)return null;const t=uI()[e];return!t||!gie(t.provider)?null:{provider:t.provider,isTerminalOpen:!!t.isTerminalOpen,sessionId:typeof t.sessionId=="string"?t.sessionId:null,updatedAt:typeof t.updatedAt=="number"?t.updatedAt:Date.now()}}function wie(e,t){if(!(!e||typeof window>"u"))try{const r=uI();window.localStorage.setItem(sI,JSON.stringify({...r,[e]:t}))}catch{}}function pI(){if(typeof window>"u")return{};try{const e=JSON.parse(window.localStorage.getItem(oI)??"{}");return!e||typeof e!="object"||Array.isArray(e)?{}:e}catch{return{}}}function kie(e){if(!e)return null;const t=pI()[e];if(!t||!Array.isArray(t.tabs))return null;const r=t.tabs.filter(bie).slice(0,cI),n=typeof t.activePath=="string"&&r.some(s=>s.path===t.activePath)?t.activePath:r[0]?.path??null,a=typeof t.splitPath=="string"&&r.some(s=>s.path===t.splitPath)?t.splitPath:null;return{tabs:r,activePath:n,splitPath:a,updatedAt:typeof t.updatedAt=="number"?t.updatedAt:Date.now()}}function Sie(e,t){if(!(!e||typeof window>"u"))try{const r=pI();window.localStorage.setItem(oI,JSON.stringify({...r,[e]:{...t,tabs:t.tabs.slice(0,cI)}}))}catch{}}function mI(){if(typeof window>"u")return{};try{const e=JSON.parse(window.localStorage.getItem(lI)??"{}");return!e||typeof e!="object"||Array.isArray(e)?{}:e}catch{return{}}}function Cie(e){if(!e)return null;const t=mI()[e];return!t||typeof t!="object"?null:{isOpen:!!t.isOpen,isMinimized:!!t.isMinimized,command:typeof t.command=="string"&&t.command.trim()?t.command:ui,title:typeof t.title=="string"&&t.title.trim()?t.title:null,updatedAt:typeof t.updatedAt=="number"?t.updatedAt:Date.now()}}function Ed(e,t){if(!(!e||typeof window>"u"))try{const r=mI();window.localStorage.setItem(lI,JSON.stringify({...r,[e]:t}))}catch{}}function Nie(e,t){return{id:ns(e),projectName:e.name,path:_n(e),label:t,starred:!1}}function hg(e){return typeof e.summary=="string"&&e.summary||typeof e.title=="string"&&e.title||typeof e.name=="string"&&e.name||e.id}function fg(e){return typeof e.updated_at=="string"&&e.updated_at||typeof e.lastActivity=="string"&&e.lastActivity||typeof e.created_at=="string"&&e.created_at||typeof e.createdAt=="string"&&e.createdAt||null}function kC(e){const t=fg(e);if(!t)return"";const r=new Date(t);return Number.isNaN(r.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(r)}function Eie({sidebarProps:e,selectedProject:t,selectedSession:r,activeTab:n,setActiveTab:a,onMenuClick:s,isLoading:o,onShowSettings:l,onQuickStartSession:c}){const{t:d}=Be("common"),u=m.useRef(null),[p,f]=m.useState(lie),[h,g]=m.useState(cie),[b,x]=m.useState(!1),[y,v]=m.useState(!1),[w,C]=m.useState(!1),[k,N]=m.useState("shell"),[j,A]=m.useState(0),[E,T]=m.useState(!1),[_,I]=m.useState(null),[R,S]=m.useState(null),[F,B]=m.useState(null),[z,q]=m.useState(pie),[V,P]=m.useState(!1),[U,H]=m.useState(null),[M,ee]=m.useState(null),[Q,ge]=m.useState({state:"idle",log:"",error:null,jobId:null,startAfterInstall:!1}),[se,ce]=m.useState("projects"),[ye,pe]=m.useState(null),[ve,ue]=m.useState([]),[de,D]=m.useState(null),[X,oe]=m.useState(null),[K,W]=m.useState(null),[ne,me]=m.useState(xie),[we,le]=m.useState(null),[Ae,te]=m.useState(null),ae=m.useRef(null),J=m.useRef(null),fe=m.useRef(!1),Ee=m.useRef(0),Me=m.useMemo(()=>fie(t),[t]),Xe=m.useMemo(()=>Zs(t),[t]),Je=m.useRef(!1),st=m.useRef(null),tt=m.useRef(null);m.useEffect(()=>{Nd(n)||n==="chat"&&se==="projects"||ce(hie(n))},[n,se]),m.useEffect(()=>{if(st.current===Me)return;st.current=Me,Je.current=!0,oe(null),W(null);const Ce=kie(Me),Re=Ce?.tabs??[];ue(Re),D(Ce?.activePath??Re[0]?.path??null),oe(Ce?.splitPath?Re.find(Oe=>Oe.path===Ce.splitPath)??null:null)},[Me]),m.useEffect(()=>{if(Je.current){Je.current=!1;return}if(!Me)return;const Ce=de&&ve.some(Oe=>Oe.path===de)?de:ve[0]?.path??null,Re=X&&ve.some(Oe=>Oe.path===X.path)?X.path:null;Sie(Me,{tabs:ve,activePath:Ce,splitPath:Re,updatedAt:Date.now()})},[de,Me,ve,X]),m.useEffect(()=>{t&&me(Ce=>{const Re=ns(t),Oe=Ce.find(gt=>gt.id===Re);if(Oe)return Ce.map(gt=>gt.id===Re?{...Oe,projectName:t.name,path:_n(t)}:gt);const wt=`Workspace ${Ce.length+1}`;return[...Ce,Nie(t,wt)].slice(-cw)})},[t]),m.useEffect(()=>{yie(ne)},[ne]);const Ct=m.useCallback((Ce,Re=null)=>{const gt={name:Ce.replace(/\\/g,"/").split("/").pop()||Ce,path:Ce,projectName:t?.name,diffInfo:Re};ue(Bt=>{const ur=Bt.findIndex(Kr=>Kr.path===Ce);if(ur===-1)return[...Bt,gt];const rn=[...Bt];return rn[ur]=gt,rn}),D(Ce),a("files")},[t?.name,a]),ot=m.useCallback(Ce=>{ue(Re=>{const Oe=Re.filter(wt=>wt.path!==Ce);return D(wt=>wt!==Ce?wt:Oe[Oe.length-1]?.path??null),Oe})},[]),ut=m.useCallback(()=>{ue([]),D(null),oe(null),W(null)},[]),ft=m.useCallback(Ce=>{navigator.clipboard?.writeText(Ce),W(null)},[]),kt=m.useCallback((Ce,Re=!1)=>{const Oe=ve.find(wt=>wt.path===Ce);Oe&&(oe(Oe),Re&&ue(wt=>{const gt=wt.filter(Bt=>Bt.path!==Ce);return D(Bt=>Bt!==Ce?Bt:gt[gt.length-1]?.path??null),gt}),W(null))},[ve]),$t=m.useCallback((Ce,Re)=>{Ce.preventDefault(),W({filePath:Re,x:Ce.clientX,y:Ce.clientY})},[]),Mt=m.useCallback(Ce=>{ae.current?.scrollBy({left:Ce==="left"?-180:180,behavior:"smooth"})},[]),Ot=m.useCallback((Ce,Re={})=>{const Oe=Re.project??t??null,wt=Ce==="hermes"?Re.command||ui:null,gt=Ce==="hermes"&&Re.title||null;N(Ce),T(!!Re.forceNewSession),I(wt),S(gt),B(Oe),C(!0),P(!1),A(Bt=>Bt+1),Ce==="hermes"&&Ed(Zs(Oe),{isOpen:!0,isMinimized:!1,command:wt,title:gt,updatedAt:Date.now()})},[t]),Ht=m.useCallback(async()=>{try{const Re=await(await Se("/api/orchestration/hermes/install-status")).json();ee({installed:!!Re?.installed,command:typeof Re?.command=="string"?Re.command:null,version:typeof Re?.version=="string"?Re.version:null,error:typeof Re?.error=="string"?Re.error:null})}catch{ee({installed:!1,command:null,version:null,error:null})}},[]),Gt=m.useCallback(async({force:Ce=!1,startAfterInstall:Re=!1}={})=>{try{J.current?.close()}catch{}J.current=null,Ot("hermes-install"),ge({state:"running",log:"",error:null,jobId:null,startAfterInstall:Re});try{const Oe=await Se("/api/orchestration/hermes/install",{method:"POST",body:JSON.stringify({force:Ce,skipBrowser:!0})}),wt=await Oe.json().catch(()=>({}));if(!Oe.ok||!wt?.jobId)throw new Error(wt?.error?.message||wt?.error||`HTTP ${Oe.status}`);const gt=String(wt.jobId);ge(Kr=>({...Kr,jobId:gt}));const Bt=window.localStorage.getItem("auth-token")||"",ur=`/api/orchestration/hermes/install/${encodeURIComponent(gt)}/stream${Bt?`?token=${encodeURIComponent(Bt)}`:""}`,rn=new EventSource(ur);J.current=rn,rn.addEventListener("log",Kr=>{try{const sa=JSON.parse(Kr.data);typeof sa.chunk=="string"&&ge(ei=>({...ei,log:`${ei.log}${sa.chunk}`}))}catch{}}),rn.addEventListener("done",Kr=>{try{const sa=JSON.parse(Kr.data);if(!sa.success)throw new Error(sa.error||d("vscodeWorkbench.hermes.installFailed",{defaultValue:"Hermes install failed."}));ge(ei=>({...ei,state:"done",error:null})),Ht().then(()=>{Re&&Ot("hermes")})}catch(sa){ge(ei=>({...ei,state:"error",error:sa instanceof Error?sa.message:d("vscodeWorkbench.hermes.installFailed",{defaultValue:"Hermes install failed."})}))}finally{try{rn.close()}catch{}J.current=null}}),rn.onerror=()=>{ge(Kr=>Kr.state==="running"?{...Kr,state:"error",error:d("vscodeWorkbench.hermes.installStreamLost",{defaultValue:"Hermes install stream closed early. The install may still be running."})}:Kr)}}catch(Oe){ge({state:"error",log:"",error:Oe instanceof Error?Oe.message:d("vscodeWorkbench.hermes.installFailed",{defaultValue:"Hermes install failed."}),jobId:null,startAfterInstall:Re})}},[Ot,Ht,d]);m.useEffect(()=>()=>{try{J.current?.close()}catch{}},[]),m.useEffect(()=>{Ht()},[Ht]),m.useEffect(()=>{if(tt.current===Xe)return;tt.current=Xe;const Ce=Cie(Xe);if(!Ce?.isOpen){k==="hermes"&&(C(!1),B(t??null));return}N("hermes"),T(!1),I(Ce.command||ui),S(Ce.title),B(t??null),C(!0),P(Ce.isMinimized),A(Re=>Re+1)},[k,t,Xe]),m.useEffect(()=>{!Ae||!t||_n(t)===Ae.projectPath&&(te(null),Ot("hermes",{command:Ae.command,title:Ae.title,forceNewSession:Ae.forceNewSession}))},[Ot,Ae,t]);const Ge=m.useMemo(()=>ve.find(Ce=>Ce.path===de)??ve[0]??null,[de,ve]),je=F??t,Ue=w&&(k==="hermes"||k==="hermes-install"),We=m.useMemo(()=>[{id:"explorer",icon:$r,label:d("vscodeWorkbench.activity.explorer"),tab:"files"},{id:"projects",icon:jr,label:d("vscodeWorkbench.activity.projects"),tab:"chat"},{id:"sourceControl",icon:Hr,label:d("vscodeWorkbench.activity.sourceControl"),tab:"git"},{id:"terminal",icon:Xr,label:d("vscodeWorkbench.activity.terminal"),tab:"shell"}],[d]),lt=m.useMemo(()=>[{id:"controlRoom",icon:Fn,label:d("tabs.controlRoom"),tab:"controlRoom"},{id:"remote",icon:Si,label:d("tabs.remote"),tab:"remote"}],[d]),yt=m.useCallback((Ce,Re)=>{Re.preventDefault(),Re.currentTarget.setPointerCapture?.(Re.pointerId),pe(Ce)},[]);m.useEffect(()=>{if(!ye)return;const Ce=Oe=>{const wt=u.current?.getBoundingClientRect();if(wt){if(ye==="left"){f(bl(Oe.clientX-wt.left,sie,oie));return}if(ye==="bottom"){q(bl(wt.bottom-Oe.clientY,die,uie));return}g(bl(wt.right-Oe.clientX,Ih,_h))}},Re=()=>pe(null);return window.addEventListener("pointermove",Ce),window.addEventListener("pointerup",Re,{once:!0}),window.addEventListener("pointercancel",Re,{once:!0}),document.body.style.cursor=ye==="bottom"?"ns-resize":"col-resize",document.body.style.userSelect="none",()=>{window.removeEventListener("pointermove",Ce),window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re),document.body.style.cursor="",document.body.style.userSelect=""}},[ye]);const Rt=m.useCallback((Ce,Re)=>{if(Ce==="terminal"){if(!t){ce("projects"),a("chat");return}w&&k==="shell"&&V?P(!1):w&&k==="shell"?C(!1):Ot("shell"),n==="shell"&&a("files");return}if(ce(Ce),x(!1),Ce==="projects"){a("chat");return}(Re!=="chat"||!Nd(n))&&a(Re)},[n,k,V,w,Ot,t,a]),er=m.useCallback((Ce={})=>{if(!t){const Re=e.projects[0];if(Re){te({projectPath:_n(Re),command:Ce.command,title:Ce.title,forceNewSession:Ce.forceNewSession}),e.onProjectSelect(Re),ce("explorer"),a("files");return}ce("projects"),a("chat");return}if(M?.installed!==!0){Gt({startAfterInstall:!0});return}Ot("hermes",Ce)},[M?.installed,Ot,t,a,e,Gt]),Fe=m.useCallback(()=>{if(M?.installed!==!0){Gt({startAfterInstall:!0});return}Ot("hermes",{command:ui,forceNewSession:!0,project:F??t})},[F,M?.installed,Ot,t,Gt]),qe=m.useCallback(()=>{if(M?.installed!==!0){Gt({startAfterInstall:!0});return}Ot("hermes",{command:iie,title:d("vscodeWorkbench.hermes.history",{defaultValue:"Hermes history"}),forceNewSession:!0,project:F??t})},[F,M?.installed,Ot,t,Gt,d]),ht=m.useCallback(()=>{Gt({force:!0})},[Gt]),et=m.useCallback(()=>{k==="hermes"&&Ed(Zs(F),{isOpen:!1,isMinimized:!1,command:_||ui,title:R,updatedAt:Date.now()}),C(!1),B(null)},[_,k,F,R]),vt=m.useCallback(()=>{P(!0),k==="hermes"&&Ed(Zs(F),{isOpen:!0,isMinimized:!0,command:_||ui,title:R,updatedAt:Date.now()})},[_,k,F,R]),Xt=m.useCallback(()=>{P(!1),k==="hermes"&&Ed(Zs(F),{isOpen:!0,isMinimized:!1,command:_||ui,title:R,updatedAt:Date.now()})},[_,k,F,R]);m.useEffect(()=>{const Ce=Re=>{const Oe=Re.detail;if(Oe?.mode==="install"){ht();return}if(Oe?.mode==="command"&&Oe.command){er({command:Oe.command,title:Oe.title||Oe.command,forceNewSession:!0});return}er({command:ui})};return window.addEventListener("pixcode:hermes-terminal",Ce),()=>window.removeEventListener("pixcode:hermes-terminal",Ce)},[ht,er]);const Z=m.useCallback(()=>{g(Ce=>bl(Ce-wC,Ih,_h))},[]),Te=m.useCallback(()=>{g(Ce=>bl(Ce+wC,Ih,_h))},[]),be=m.useCallback(Ce=>{a(Ce)},[a]),_e=m.useCallback(Ce=>{window.dispatchEvent(new CustomEvent("pixcode:create-project",{detail:{workspaceType:Ce}}))},[]),$e=m.useCallback(Ce=>{e.onProjectSelect(Ce),ce("explorer"),a("files")},[a,e]),pt=m.useCallback(Ce=>{const Re=e.projects.find(Oe=>Oe.name===Ce.projectName||ns(Oe)===Ce.id);Re&&$e(Re)},[$e,e.projects]),rt=m.useCallback(Ce=>{me(Re=>{const Oe=Re.filter(gt=>gt.id!==Ce);if(t&&ns(t)===Ce){const gt=Oe[Oe.length-1],Bt=gt?e.projects.find(ur=>ur.name===gt.projectName||ns(ur)===gt.id):null;Bt&&window.setTimeout(()=>$e(Bt),0)}return Oe})},[$e,t,e.projects]),Mr=m.useCallback(Ce=>{me(Re=>Re.filter(Oe=>Oe.id===Ce))},[]),zt=m.useCallback(()=>{me([])},[]),yn=m.useCallback((Ce,Re)=>{const Oe=Re.trim();Oe&&me(wt=>wt.map(gt=>gt.id===Ce?{...gt,label:Oe}:gt))},[]),qr=m.useCallback(Ce=>{me(Re=>Re.map(Oe=>Oe.id===Ce?{...Oe,starred:!Oe.starred}:Oe))},[]);m.useEffect(()=>{const Ce=window.localStorage.getItem("auth-token")||"",Re=`/api/orchestration/hermes/terminal-launches/stream?after=${Ee.current}${Ce?`&token=${encodeURIComponent(Ce)}`:""}`,Oe=new EventSource(Re),wt=Bt=>{try{const ur=JSON.parse(Bt.data);if(!ur||typeof ur.id!="number"||ur.id<=Ee.current||(Ee.current=Math.max(Ee.current,ur.id),!fe.current))return;const rn=ur.projectPath?e.projects.find(Kr=>_n(Kr).replace(/\\/g,"/")===ur.projectPath?.replace(/\\/g,"/")):t;rn&&rn!==t&&$e(rn),v(!1),H(ur)}catch{}},gt=Bt=>{try{const ur=JSON.parse(Bt.data);typeof ur.latestId=="number"&&(Ee.current=Math.max(Ee.current,ur.latestId))}catch{}finally{fe.current=!0}};return Oe.addEventListener("terminal-launch",wt),Oe.addEventListener("ready",gt),()=>{Oe.removeEventListener("terminal-launch",wt),Oe.removeEventListener("ready",gt),Oe.close()}},[$e,t,e.projects]);const Aa=()=>se==="projects"?i.jsx(Fie,{projects:e.projects,selectedProject:t,onProjectSelect:$e,onNewSession:e.onNewSession,onOpenProject:()=>_e("existing"),onCloneProject:()=>_e("new"),onRefresh:e.onRefresh,isRefreshing:e.isLoading,t:d}):se==="sourceControl"?i.jsx(y6,{selectedProject:t,isMobile:!1,compact:!0,onFileOpen:Ct}):i.jsx(Lie,{selectedProject:t,onFileOpen:Ct,t:d}),br=()=>o?i.jsx(mg,{mode:"loading",isMobile:!1,onMenuClick:s}):n==="remote"?i.jsx(j6,{}):n==="controlRoom"?i.jsx(cg,{selectedProject:t}):n.startsWith("plugin:")?i.jsx(P6,{pluginName:n.replace("plugin:",""),selectedProject:t,selectedSession:r}):t?Ge?i.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-background",children:[i.jsxs("div",{className:"flex h-9 shrink-0 items-center border-b border-border bg-muted/20",children:[i.jsx("button",{type:"button",className:"flex h-full w-8 shrink-0 items-center justify-center border-r border-border text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>Mt("left"),"aria-label":d("vscodeWorkbench.editor.scrollLeft",{defaultValue:"Scroll tabs left"}),title:d("vscodeWorkbench.editor.scrollLeft",{defaultValue:"Scroll tabs left"}),children:i.jsx(pc,{className:"h-3.5 w-3.5"})}),i.jsx("div",{ref:ae,className:"flex min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:ve.map(Ce=>{const Re=Ce.path===Ge.path;return i.jsxs("button",{type:"button",className:xe("group flex h-9 w-44 shrink-0 items-center gap-2 border-r border-border px-2.5 text-xs transition-colors",Re?"bg-background text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),onClick:()=>D(Ce.path),onContextMenu:Oe=>$t(Oe,Ce.path),title:Ce.path,children:[i.jsx(jr,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:Ce.name}),i.jsx("span",{role:"button",tabIndex:0,className:"rounded p-0.5 text-muted-foreground opacity-70 transition hover:bg-muted hover:text-foreground group-hover:opacity-100",onClick:Oe=>{Oe.stopPropagation(),ot(Ce.path)},onKeyDown:Oe=>{(Oe.key==="Enter"||Oe.key===" ")&&(Oe.preventDefault(),Oe.stopPropagation(),ot(Ce.path))},"aria-label":d("vscodeWorkbench.editor.closeTab",{file:Ce.name,defaultValue:"Close {{file}}"}),title:d("vscodeWorkbench.editor.closeTab",{file:Ce.name,defaultValue:"Close {{file}}"}),children:i.jsx(At,{className:"h-3 w-3"})})]},Ce.path)})}),i.jsx("button",{type:"button",className:"flex h-full w-8 shrink-0 items-center justify-center border-l border-border text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>Mt("right"),"aria-label":d("vscodeWorkbench.editor.scrollRight",{defaultValue:"Scroll tabs right"}),title:d("vscodeWorkbench.editor.scrollRight",{defaultValue:"Scroll tabs right"}),children:i.jsx(Dn,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"flex h-full w-8 shrink-0 items-center justify-center border-l border-border text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>W({filePath:Ge.path,x:window.innerWidth-220,y:84}),"aria-label":d("vscodeWorkbench.editor.moreActions",{defaultValue:"More tab actions"}),title:d("vscodeWorkbench.editor.moreActions",{defaultValue:"More tab actions"}),children:i.jsx(TN,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:X?i.jsxs("div",{className:"flex h-full min-w-0",children:[Ge&&i.jsx("div",{className:"min-w-0 flex-1 border-r border-border",children:i.jsx(Ul,{file:Ge,onClose:()=>ot(Ge.path),projectPath:t.path||t.fullPath,isSidebar:!0})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border bg-muted/20 px-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:[i.jsx(jr,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:X.name})]}),i.jsx("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>oe(null),"aria-label":d("vscodeWorkbench.editor.closeSplit",{defaultValue:"Close split editor"}),title:d("vscodeWorkbench.editor.closeSplit",{defaultValue:"Close split editor"}),children:i.jsx(At,{className:"h-3.5 w-3.5"})})]}),i.jsx("div",{className:"h-[calc(100%-2rem)] min-h-0 overflow-hidden",children:i.jsx(Ul,{file:X,onClose:()=>oe(null),projectPath:t.path||t.fullPath,isSidebar:!0})})]})]}):i.jsx(Ul,{file:Ge,onClose:()=>ot(Ge.path),projectPath:t.path||t.fullPath,isSidebar:!0})}),K&&i.jsx(Iie,{context:K,file:ve.find(Ce=>Ce.path===K.filePath)??null,onClose:()=>W(null),onCloseTab:ot,onCloseAll:ut,onCopyPath:ft,onSplitRight:Ce=>kt(Ce),onSplitMoveRight:Ce=>kt(Ce,!0),t:d})]}):i.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:i.jsxs("div",{className:"max-w-md px-6 text-center",children:[i.jsx(as,{className:"mx-auto mb-4 h-10 w-10 text-muted-foreground/60"}),i.jsx("div",{className:"text-sm font-medium text-foreground",children:d("vscodeWorkbench.editor.emptyTitle")}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:t.displayName||t.name})]})}):i.jsx(Pie,{projects:e.projects,onProjectSelect:$e,onNewSession:e.onNewSession,onOpenProject:()=>_e("existing"),onCloneProject:()=>_e("new"),onQuickStartSession:c,onOpenHermesAgent:er,onShowSettings:l,t:d}),$n=()=>i.jsx(Oie,{project:t,session:r,hermesCliLaunch:U,onSessionSelect:e.onSessionSelect,t:d});return i.jsxs("div",{className:"flex h-full min-w-0 flex-1 flex-col overflow-hidden bg-background text-foreground",children:[i.jsx(nT,{...e,isMobile:!1,modalsOnly:!0}),i.jsx(Tie,{t:d,onOpenProject:_e,onActivityPanel:Rt,onSystemTab:be,onOpenHermesAgent:er,onShowSettings:l,onQuickStartSession:c}),i.jsx(Aie,{tabs:ne,projects:e.projects,selectedProject:t,onSelect:pt,onClose:rt,onCloseOthers:Mr,onCloseAll:zt,onRename:yn,onToggleStar:qr,contextMenu:we,onContextMenuChange:le,onAdd:()=>_e("existing"),isCliPanelCollapsed:y,onToggleCliPanel:()=>v(Ce=>!Ce),t:d}),i.jsxs("div",{ref:u,className:xe("flex min-h-0 min-w-0 flex-1 overflow-hidden",ye&&"select-none"),children:[i.jsxs("aside",{className:"flex h-full w-12 shrink-0 flex-col border-r border-border bg-muted/30",children:[i.jsx("div",{className:"flex h-11 items-center justify-center border-b border-border",children:i.jsx(jg,{className:"h-5 w-5 text-primary"})}),i.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1 py-2",children:[We.map(Ce=>i.jsx(Td,{label:Ce.label,icon:Ce.icon,active:Ce.id==="terminal"?w:!b&&se===Ce.id&&!Nd(n),onClick:()=>Rt(Ce.id,Ce.tab)},Ce.id)),i.jsx(zie,{label:d("vscodeWorkbench.hermes.connect",{defaultValue:"Connect Hermes Agent"}),active:Ue,onClick:er})]}),i.jsxs("div",{className:"flex flex-col items-center gap-1 border-t border-border py-2",children:[lt.map(Ce=>i.jsx(Td,{label:Ce.label,icon:Ce.icon,active:n===Ce.tab,onClick:()=>be(Ce.tab)},Ce.id)),i.jsx(Td,{label:d(b?"vscodeWorkbench.activity.showPanel":"vscodeWorkbench.activity.hidePanel"),icon:b?Gl:Pu,active:!1,onClick:()=>x(Ce=>!Ce)}),i.jsx(Td,{label:d("navigation.settings"),icon:Ut,active:!1,onClick:l})]})]}),!b&&i.jsxs(i.Fragment,{children:[i.jsxs("section",{className:"h-full shrink-0 overflow-hidden border-r border-border bg-background",style:{width:p},children:[i.jsx("div",{className:"flex h-10 items-center justify-between border-b border-border px-3",children:i.jsx("div",{className:"truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d(`vscodeWorkbench.panels.${se}`)})}),i.jsx("div",{className:"h-[calc(100%-2.5rem)] min-h-0 overflow-hidden",children:Aa()})]}),i.jsx(CC,{label:d("vscodeWorkbench.resize.left"),active:ye==="left",onPointerDown:Ce=>yt("left",Ce)})]}),i.jsxs("main",{className:"min-w-0 flex-1 overflow-hidden border-r border-border bg-background",children:[i.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-border px-3",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(Du,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:Nd(n)?d(`tabs.${n==="controlRoom"?"controlRoom":n}`):d("vscodeWorkbench.panels.editor")})]}),i.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t?.displayName||t?.name||d("vscodeWorkbench.noProject")})]}),i.jsxs("div",{className:"flex h-[calc(100%-2.5rem)] min-h-0 flex-col overflow-hidden",children:[i.jsx("div",{className:xe("min-h-0 flex-1 overflow-hidden",w&&"border-b border-border"),children:br()}),w&&i.jsx(_ie,{project:je,mode:k,hermesInstallStatus:M,hermesInstallJob:Q,runId:j,forceNewSession:E,command:_,commandTitle:R,height:z,isMinimized:V,isActive:!0,onResizeStart:Ce=>yt("bottom",Ce),onMinimize:vt,onRestore:Xt,onStartHermes:Fe,onOpenHistory:qe,onInstallHermes:ht,onClose:et,t:d})]})]}),!y&&i.jsxs(i.Fragment,{children:[i.jsx(CC,{label:d("vscodeWorkbench.resize.right"),active:ye==="right",onPointerDown:Ce=>yt("right",Ce)}),i.jsxs("aside",{className:"h-full shrink-0 overflow-hidden bg-background",style:{width:h},children:[i.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-border px-3",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[i.jsx(bs,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("vscodeWorkbench.panels.cli")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx("button",{type:"button",className:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground",onClick:Z,"aria-label":d("vscodeWorkbench.cli.shrinkPanel",{defaultValue:"Shrink CLI panel"}),title:d("vscodeWorkbench.cli.shrinkPanel",{defaultValue:"Shrink CLI panel"}),children:i.jsx(Dn,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground",onClick:Te,"aria-label":d("vscodeWorkbench.cli.expandPanel",{defaultValue:"Expand CLI panel"}),title:d("vscodeWorkbench.cli.expandPanel",{defaultValue:"Expand CLI panel"}),children:i.jsx(mc,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>v(!0),"aria-label":d("vscodeWorkbench.cli.hidePanel",{defaultValue:"Hide CLI panel"}),title:d("vscodeWorkbench.cli.hidePanel",{defaultValue:"Hide CLI panel"}),children:i.jsx(Gl,{className:"h-4 w-4"})})]})]}),i.jsx("div",{className:"h-[calc(100%-2.5rem)] min-h-0 overflow-hidden",children:$n()})]})]})]})]})}function Tie({t:e,onOpenProject:t,onActivityPanel:r,onSystemTab:n,onOpenHermesAgent:a,onShowSettings:s,onQuickStartSession:o}){const[l,c]=m.useState(null),d=m.useMemo(()=>[{label:"File",commands:[{label:e("vscodeWorkbench.menu.openProject",{defaultValue:"Open Project..."}),icon:On,type:"existing"},{label:e("vscodeWorkbench.menu.cloneFromGithub",{defaultValue:"Clone Repository..."}),icon:Ou,type:"new"},{label:e("vscodeWorkbench.menu.newChat",{defaultValue:"New Chat"}),icon:Mn,action:o},{label:e("navigation.settings"),icon:Ut,action:s}]},{label:"Edit",commands:[{label:e("vscodeWorkbench.menu.newChat",{defaultValue:"New Chat"}),icon:Zt,action:o}]},{label:"Selection",commands:[{label:e("vscodeWorkbench.menu.openProjects",{defaultValue:"Open Projects"}),icon:$r,action:()=>r("projects","chat")}]},{label:"View",commands:[{label:e("vscodeWorkbench.activity.explorer"),icon:$r,action:()=>r("explorer","files")},{label:e("vscodeWorkbench.activity.projects"),icon:jr,action:()=>r("projects","chat")},{label:e("vscodeWorkbench.activity.sourceControl"),icon:Hr,action:()=>r("sourceControl","git")}]},{label:"Go",commands:[{label:e("tabs.controlRoom"),icon:Fn,action:()=>n("controlRoom")},{label:e("tabs.remote"),icon:Si,action:()=>n("remote")}]},{label:"Run",commands:[{label:e("vscodeWorkbench.hermes.title",{defaultValue:"Hermes Agent"}),icon:_r,action:a}]},{label:"Terminal",commands:[{label:e("vscodeWorkbench.panels.cli"),icon:bs,action:()=>r("terminal","shell")}]},{label:"Help",commands:[{label:e("navigation.settings"),icon:Ut,action:s}]}],[r,o,a,s,n,e]),u=p=>{if(c(null),p.type){t(p.type);return}p.action?.()};return i.jsx("div",{className:"flex h-8 shrink-0 items-center border-b border-border bg-muted/20 px-2 text-xs text-muted-foreground",children:i.jsx("div",{className:"flex h-full items-center gap-0.5",children:d.map(p=>i.jsxs("div",{className:"relative h-full",children:[i.jsxs("button",{type:"button",className:xe("flex h-full items-center gap-1 rounded px-2 transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",l===p.label&&"bg-muted text-foreground"),onClick:()=>c(f=>f===p.label?null:p.label),children:[p.label,i.jsx(Pn,{className:"h-3 w-3"})]}),l===p.label&&i.jsx("div",{className:"absolute left-0 top-full z-50 mt-1 min-w-52 overflow-hidden rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-xl shadow-black/10",children:p.commands.map(f=>{const h=f.icon;return i.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onClick:()=>u(f),children:[h&&i.jsx(h,{className:"h-3.5 w-3.5 text-muted-foreground"}),i.jsx("span",{className:"truncate",children:f.label})]},f.label)})})]},p.label))})})}function Aie({tabs:e,projects:t,selectedProject:r,onSelect:n,onClose:a,onCloseOthers:s,onCloseAll:o,onRename:l,onToggleStar:c,contextMenu:d,onContextMenuChange:u,onAdd:p,isCliPanelCollapsed:f,onToggleCliPanel:h,t:g}){const b=r?ns(r):null,[x,y]=m.useState(null),[v,w]=m.useState(""),C=m.useRef(null),k=m.useMemo(()=>e.map(_=>({tab:_,project:t.find(I=>I.name===_.projectName||ns(I)===_.id)})).filter(_=>!!_.project),[t,e]),N=_=>{u(null),y(_.id),w(_.label)},j=()=>{x&&(l(x,v),y(null),w(""))},A=(_,I)=>{_.preventDefault(),n(I),u({tabId:I.id,x:_.clientX,y:_.clientY})},E=_=>{C.current?.scrollBy({left:_==="left"?-220:220,behavior:"smooth"})},T=d?k.find(_=>_.tab.id===d.tabId)??null:null;return i.jsxs("div",{className:"relative flex h-9 shrink-0 items-center border-b border-border bg-background text-xs",children:[i.jsx("button",{type:"button",className:"flex h-full w-8 shrink-0 items-center justify-center border-r border-border text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>E("left"),"aria-label":g("vscodeWorkbench.workspace.scrollLeft",{defaultValue:"Scroll workspaces left"}),title:g("vscodeWorkbench.workspace.scrollLeft",{defaultValue:"Scroll workspaces left"}),children:i.jsx(pc,{className:"h-3.5 w-3.5"})}),i.jsxs("div",{ref:C,className:"flex h-full min-w-0 flex-1 items-center overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[k.length===0?i.jsxs("button",{type:"button",onClick:p,className:"flex h-8 min-w-0 items-center gap-2 border-r border-border px-3 text-muted-foreground hover:bg-muted/40 hover:text-foreground",children:[i.jsx(On,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:g("vscodeWorkbench.workspace.openFirst",{defaultValue:"Open a workspace"})})]}):k.map(({tab:_,project:I})=>{const R=_.id===b;return i.jsxs("div",{onContextMenu:S=>A(S,_),className:xe("group relative flex h-8 w-52 shrink-0 items-center border-r border-border px-2 transition-colors",R?"bg-background text-foreground shadow-[inset_0_-2px_0_hsl(var(--primary))]":"text-muted-foreground hover:bg-muted/30 hover:text-foreground"),title:`${_.label} - ${Tu(I)}`,children:[i.jsx("button",{type:"button",onClick:()=>c(_.id),className:xe("mr-1 rounded p-0.5 transition hover:bg-muted",_.starred?"text-amber-500":"text-muted-foreground/60 opacity-0 group-hover:opacity-100"),"aria-label":g("vscodeWorkbench.workspace.toggleStar",{name:_.label,defaultValue:"Star {{name}}"}),title:g("vscodeWorkbench.workspace.toggleStar",{name:_.label,defaultValue:"Star {{name}}"}),children:i.jsx(yi,{className:"h-3.5 w-3.5"})}),x===_.id?i.jsx("input",{value:v,autoFocus:!0,onChange:S=>w(S.target.value),onBlur:j,onKeyDown:S=>{S.key==="Enter"&&j(),S.key==="Escape"&&(y(null),w(""))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-background px-1 py-0.5 text-xs text-foreground outline-none"}):i.jsxs("button",{type:"button",onClick:()=>n(_),onDoubleClick:()=>N(_),className:"min-w-0 flex-1 text-left",children:[i.jsx("div",{className:"truncate font-medium",children:_.label}),i.jsx("div",{className:"truncate text-[10px] text-muted-foreground",children:Tu(I)})]}),i.jsx("div",{className:"ml-1 flex shrink-0 items-center gap-0.5 opacity-70 group-hover:opacity-100",children:i.jsx("button",{type:"button",onClick:()=>a(_.id),className:"rounded p-0.5 hover:bg-muted hover:text-foreground","aria-label":g("vscodeWorkbench.workspace.close",{name:_.label,defaultValue:"Close {{name}}"}),title:g("vscodeWorkbench.workspace.close",{name:_.label,defaultValue:"Close {{name}}"}),children:i.jsx(At,{className:"h-3.5 w-3.5"})})})]},_.id)}),i.jsx("button",{type:"button",onClick:p,className:"flex h-8 w-10 shrink-0 items-center justify-center border-r border-border bg-muted/10 text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground","aria-label":g("vscodeWorkbench.workspace.add",{defaultValue:"Add workspace"}),title:g("vscodeWorkbench.workspace.add",{defaultValue:"Add workspace"}),children:i.jsx(Zt,{className:"h-3.5 w-3.5"})})]}),i.jsx("button",{type:"button",className:"flex h-full w-8 shrink-0 items-center justify-center border-l border-border text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>E("right"),"aria-label":g("vscodeWorkbench.workspace.scrollRight",{defaultValue:"Scroll workspaces right"}),title:g("vscodeWorkbench.workspace.scrollRight",{defaultValue:"Scroll workspaces right"}),children:i.jsx(Dn,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:xe("flex h-full w-10 shrink-0 items-center justify-center border-l border-border text-muted-foreground transition hover:bg-muted hover:text-foreground",f&&"bg-muted/40 text-foreground"),onClick:h,"aria-label":f?g("vscodeWorkbench.cli.showPanel",{defaultValue:"Show CLI panel"}):g("vscodeWorkbench.cli.hidePanel",{defaultValue:"Hide CLI panel"}),title:f?g("vscodeWorkbench.cli.showPanel",{defaultValue:"Show CLI panel"}):g("vscodeWorkbench.cli.hidePanel",{defaultValue:"Hide CLI panel"}),children:f?i.jsx(Pu,{className:"h-3.5 w-3.5"}):i.jsx(Gl,{className:"h-3.5 w-3.5"})}),d&&T&&i.jsx(jie,{context:d,tab:T.tab,onClose:()=>u(null),onRename:()=>N(T.tab),onToggleStar:()=>c(T.tab.id),onCloseTab:()=>a(T.tab.id),onCloseOthers:()=>s(T.tab.id),onCloseAll:o,t:g})]})}function jie({context:e,tab:t,onClose:r,onRename:n,onToggleStar:a,onCloseTab:s,onCloseOthers:o,onCloseAll:l,t:c}){m.useEffect(()=>{const u=()=>r(),p=f=>{f.key==="Escape"&&r()};return window.addEventListener("mousedown",u),window.addEventListener("keydown",p),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("keydown",p)}},[r]);const d=u=>p=>{p.stopPropagation(),u(),r()};return i.jsxs("div",{className:"fixed z-50 w-48 overflow-hidden rounded-md border border-border bg-popover py-1 text-xs text-popover-foreground shadow-xl shadow-black/10",style:{left:e.x,top:e.y},onMouseDown:u=>u.stopPropagation(),children:[i.jsxs("button",{type:"button",onClick:d(n),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted",children:[i.jsx(NN,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.workspace.rename",{defaultValue:"Rename"})]}),i.jsxs("button",{type:"button",onClick:d(a),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted",children:[i.jsx(yi,{className:"h-3.5 w-3.5"}),t.starred?c("vscodeWorkbench.workspace.unstar",{defaultValue:"Unstar"}):c("vscodeWorkbench.workspace.star",{defaultValue:"Star"})]}),i.jsx("div",{className:"my-1 border-t border-border"}),i.jsxs("button",{type:"button",onClick:d(s),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted",children:[i.jsx(At,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.workspace.closeAction",{defaultValue:"Close workspace"})]}),i.jsxs("button",{type:"button",onClick:d(o),className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted",children:[i.jsx(Pu,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.workspace.closeOthers",{defaultValue:"Close others"})]}),i.jsxs("button",{type:"button",onClick:d(l),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-red-600 hover:bg-muted dark:text-red-300",children:[i.jsx(At,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.workspace.closeAll",{defaultValue:"Close all"})]})]})}function Iie({context:e,file:t,onClose:r,onCloseTab:n,onCloseAll:a,onCopyPath:s,onSplitRight:o,onSplitMoveRight:l,t:c}){if(m.useEffect(()=>{const u=()=>r(),p=f=>{f.key==="Escape"&&r()};return window.addEventListener("click",u),window.addEventListener("keydown",p),()=>{window.removeEventListener("click",u),window.removeEventListener("keydown",p)}},[r]),!t)return null;const d=[{id:"close",label:c("vscodeWorkbench.editor.context.close",{defaultValue:"Close"}),icon:At,action:()=>n(t.path)},{id:"closeAllTabs",label:c("vscodeWorkbench.editor.context.closeAll",{defaultValue:"Close All"}),icon:At,action:a},{id:"copyPath",label:c("vscodeWorkbench.editor.context.copyPath",{defaultValue:"Copy Path"}),icon:bo,action:()=>s(t.path)},{id:"splitRight",label:c("vscodeWorkbench.editor.context.splitRight",{defaultValue:"Split Right"}),icon:jg,action:()=>o(t.path)},{id:"splitMoveRight",label:c("vscodeWorkbench.editor.context.splitMoveRight",{defaultValue:"Split and Move Right"}),icon:Gl,action:()=>l(t.path)}];return i.jsxs("div",{className:"fixed z-[80] w-56 overflow-hidden rounded-md border border-border bg-popover py-1 text-xs text-popover-foreground shadow-xl shadow-black/15",style:{left:e.x,top:e.y},onClick:u=>u.stopPropagation(),children:[i.jsxs("div",{className:"border-b border-border px-3 py-2 text-[11px] text-muted-foreground",children:[i.jsx("div",{className:"truncate font-medium text-foreground",children:t.name}),i.jsx("div",{className:"truncate font-mono",children:t.path})]}),d.map(u=>{const p=u.icon;return i.jsxs("button",{type:"button",onClick:u.action,className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted",children:[i.jsx(p,{className:"h-3.5 w-3.5 text-muted-foreground"}),u.label]},u.id)})]})}function _ie({project:e,mode:t,hermesInstallStatus:r,hermesInstallJob:n,runId:a,forceNewSession:s,command:o,commandTitle:l,height:c,isMinimized:d,isActive:u,onResizeStart:p,onMinimize:f,onRestore:h,onStartHermes:g,onOpenHistory:b,onInstallHermes:x,onClose:y,t:v}){const w=t==="hermes"||t==="hermes-install",C=r?.installed===!0,k=t==="hermes-install"?v("vscodeWorkbench.hermes.installTitle",{defaultValue:"Install Hermes Agent"}):t==="hermes"?l||v("vscodeWorkbench.hermes.title",{defaultValue:"Hermes Agent"}):v("vscodeWorkbench.terminal.title",{defaultValue:"Terminal"}),N=o||"hermes";return i.jsxs("section",{className:"relative shrink-0 overflow-hidden bg-gray-950 text-gray-100",style:{height:d?mie:c},children:[!d&&i.jsx("button",{type:"button",className:"absolute inset-x-0 top-0 z-10 h-1 cursor-ns-resize bg-transparent hover:bg-blue-500/40",onPointerDown:p,"aria-label":v("vscodeWorkbench.terminal.resize",{defaultValue:"Resize terminal"}),title:v("vscodeWorkbench.terminal.resize",{defaultValue:"Resize terminal"})}),i.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-gray-800 bg-gray-900 px-3",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[w?i.jsx(uw,{className:"h-4 w-4"}):i.jsx(Xr,{className:"h-3.5 w-3.5 text-blue-300"}),i.jsx("span",{className:"truncate text-[11px] font-semibold uppercase tracking-wide text-gray-300",children:k}),i.jsx("span",{className:"truncate font-mono text-[10px] text-gray-500",children:e?_n(e):v("vscodeWorkbench.noProject")}),w&&C&&i.jsx("span",{className:"rounded bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-200",children:v("vscodeWorkbench.hermes.mcpLive",{defaultValue:"Pixcode MCP Live"})})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[w&&i.jsxs(i.Fragment,{children:[!C&&i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:x,"aria-label":v("vscodeWorkbench.hermes.install",{defaultValue:"Install"}),title:v("vscodeWorkbench.hermes.install",{defaultValue:"Install"}),children:i.jsx(Xn,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:b,"aria-label":v("vscodeWorkbench.hermes.history",{defaultValue:"Hermes history"}),title:v("vscodeWorkbench.hermes.history",{defaultValue:"Hermes history"}),children:i.jsx(Po,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:g,"aria-label":v("vscodeWorkbench.hermes.newSession",{defaultValue:"New Hermes session"}),title:v("vscodeWorkbench.hermes.newSession",{defaultValue:"New Hermes session"}),children:i.jsx(Zt,{className:"h-3.5 w-3.5"})})]}),d?i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:h,"aria-label":v("vscodeWorkbench.terminal.restore",{defaultValue:"Restore terminal"}),title:v("vscodeWorkbench.terminal.restore",{defaultValue:"Restore terminal"}),children:i.jsx(mc,{className:"h-3.5 w-3.5"})}):i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:f,"aria-label":v("vscodeWorkbench.terminal.minimize",{defaultValue:"Minimize terminal"}),title:v("vscodeWorkbench.terminal.minimize",{defaultValue:"Minimize terminal"}),children:i.jsx(SN,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100",onClick:y,"aria-label":v("vscodeWorkbench.terminal.close",{defaultValue:"Close terminal"}),title:v("vscodeWorkbench.terminal.close",{defaultValue:"Close terminal"}),children:i.jsx(At,{className:"h-3.5 w-3.5"})})]})]}),!d&&i.jsx("div",{className:"h-[calc(100%-2rem)] min-h-0",children:t==="hermes-install"?i.jsx(Rie,{installJob:n,onRetry:x,onStart:g,t:v}):t==="hermes"?i.jsx(Vl,{project:e,session:null,command:N,isPlainShell:!0,forceNewSession:s,showHeader:!1,autoConnect:!!e,isActive:u,title:k},`hermes-terminal-${e?_n(e):"none"}-${a}`):i.jsx(Vl,{project:e,session:null,isPlainShell:!0,forceNewSession:s,showHeader:!1,autoConnect:!!e,isActive:u,title:k},`bottom-terminal-${t}-${e?_n(e):"none"}-${a}`)})]})}function Rie({installJob:e,onRetry:t,onStart:r,t:n}){const a=e.state==="running",s=e.state==="done",o=e.state==="error",l=m.useRef(null);return m.useEffect(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[e.error,e.log,e.state]),i.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-gray-950",children:[i.jsxs("div",{className:"flex h-9 shrink-0 items-center justify-between border-b border-gray-800 px-3",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-[11px] text-gray-300",children:[a?i.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin text-emerald-300"}):i.jsx(_r,{className:"h-3.5 w-3.5 text-emerald-300"}),i.jsx("span",{className:"truncate",children:a?n("vscodeWorkbench.hermes.installRunning",{defaultValue:"Installing Hermes through Pixcode API..."}):s?n("vscodeWorkbench.hermes.installDone",{defaultValue:"Hermes installed and Pixcode MCP configured."}):o?n("vscodeWorkbench.hermes.installError",{defaultValue:"Hermes install failed."}):n("vscodeWorkbench.hermes.installReady",{defaultValue:"Ready to install Hermes."})})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s&&i.jsx("button",{type:"button",className:"rounded bg-emerald-600 px-2 py-1 text-[11px] font-medium text-white hover:bg-emerald-500",onClick:r,children:n("vscodeWorkbench.hermes.start",{defaultValue:"Start Hermes"})}),o&&i.jsx("button",{type:"button",className:"rounded bg-gray-800 px-2 py-1 text-[11px] font-medium text-gray-100 hover:bg-gray-700",onClick:t,children:n("vscodeWorkbench.hermes.retryInstall",{defaultValue:"Retry install"})})]})]}),e.error&&i.jsx("div",{className:"border-b border-red-900/60 bg-red-950/40 px-3 py-2 text-[11px] text-red-100",children:e.error}),i.jsx("pre",{ref:l,className:"min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-words p-3 font-mono text-[11px] leading-5 text-gray-200",children:e.log||n("vscodeWorkbench.hermes.installWaiting",{defaultValue:"Waiting for Hermes install logs..."})})]})}function Lie({selectedProject:e,onFileOpen:t,t:r}){return i.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:i.jsx(ag,{selectedProject:e,onFileOpen:t})})}function Pie({projects:e,onProjectSelect:t,onNewSession:r,onOpenProject:n,onCloneProject:a,onQuickStartSession:s,onOpenHermesAgent:o,onShowSettings:l,t:c}){const d=e.slice(0,6);return i.jsx("div",{className:"h-full overflow-auto bg-background",children:i.jsx("div",{className:"mx-auto flex max-w-6xl flex-col gap-6 p-4 sm:p-6",children:i.jsxs("section",{className:"min-w-0",children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-primary",children:"Pixcode"}),i.jsx("h2",{className:"mt-2 text-2xl font-semibold text-foreground",children:c("vscodeWorkbench.welcome.title",{defaultValue:"Hoş geldin"})}),i.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:c("vscodeWorkbench.welcome.description",{defaultValue:"Bir proje aç, GitHub’dan klonla veya Hermes’i alt terminalde başlat."})})]}),i.jsxs("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 13rem), 1fr))"},children:[i.jsxs("button",{type:"button",onClick:n,className:"group flex min-h-24 flex-col items-start justify-between rounded-md border border-border bg-card p-4 text-left transition hover:border-primary/50 hover:bg-muted/30",children:[i.jsx(On,{className:"h-5 w-5 text-blue-400"}),i.jsx("span",{className:"mt-4 text-sm font-semibold text-foreground",children:c("vscodeWorkbench.welcome.openProject",{defaultValue:"Proje Aç"})}),i.jsx("span",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:c("vscodeWorkbench.welcome.openProjectDescription",{defaultValue:"Yerel klasörü workspace olarak bağla."})})]}),i.jsxs("button",{type:"button",onClick:a,className:"group flex min-h-24 flex-col items-start justify-between rounded-md border border-border bg-card p-4 text-left transition hover:border-primary/50 hover:bg-muted/30",children:[i.jsx(Ou,{className:"h-5 w-5 text-foreground"}),i.jsx("span",{className:"mt-4 text-sm font-semibold text-foreground",children:c("vscodeWorkbench.welcome.cloneProject",{defaultValue:"Klonla"})}),i.jsx("span",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:c("vscodeWorkbench.welcome.cloneProjectDescription",{defaultValue:"GitHub reposunu seçtiğin klasöre çek."})})]}),i.jsxs("button",{type:"button",onClick:o,className:"group flex min-h-24 flex-col items-start justify-between rounded-md border border-emerald-700/70 bg-emerald-950/20 p-4 text-left transition hover:border-emerald-400/70 hover:bg-emerald-950/30",children:[i.jsx(uw,{className:"h-5 w-5"}),i.jsx("span",{className:"mt-4 text-sm font-semibold text-foreground",children:c("vscodeWorkbench.welcome.startHermes",{defaultValue:"Hermes’i Başlat"})}),i.jsx("span",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:c("vscodeWorkbench.welcome.startHermesDescription",{defaultValue:"Aktif projede agent terminalini aç."})})]})]}),i.jsx("div",{className:"mt-4 rounded-md border border-border bg-card/70 p-3 sm:p-4",children:i.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-sm font-semibold text-foreground",children:c("vscodeWorkbench.welcome.appearanceTitle",{defaultValue:"Görünüm"})}),i.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:c("vscodeWorkbench.welcome.appearanceDescription",{defaultValue:"Pixcode koyu modla başlar; gerekirse açık moda geçebilirsin."})})]}),i.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 rounded border border-border bg-background px-3 py-2",children:[i.jsx("span",{className:"text-xs font-medium text-foreground",children:c("vscodeWorkbench.welcome.darkMode",{defaultValue:"Koyu mod"})}),i.jsx(Jd,{ariaLabel:c("vscodeWorkbench.welcome.themeToggle",{defaultValue:"Tema modunu değiştir"})})]}),i.jsxs("button",{type:"button",onClick:l,className:"inline-flex items-center justify-center gap-2 rounded border border-border px-3 py-2 text-xs font-medium text-foreground hover:bg-muted",children:[i.jsx(Ut,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.welcome.themeSettings",{defaultValue:"Tema ayarları"})]})]})]})}),i.jsxs("div",{className:"mt-7",children:[i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[i.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:c("vscodeWorkbench.welcome.recentProjects",{defaultValue:"Son projeler"})}),s&&i.jsxs("button",{type:"button",onClick:()=>{s()},className:"inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground",children:[i.jsx(Mn,{className:"h-3.5 w-3.5"}),c("vscodeWorkbench.welcome.newChat",{defaultValue:"Yeni sohbet"})]})]}),d.length>0?i.jsx("div",{className:"grid gap-2 xl:grid-cols-2",children:d.map(f=>i.jsxs("div",{role:"button",tabIndex:0,className:"cursor-pointer rounded-md border border-border bg-card/60 p-3 text-left transition hover:border-primary/40 hover:bg-muted/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onClick:()=>t(f),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),t(f))},title:_n(f),children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:f.displayName||f.name}),i.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted-foreground",children:Tu(f)})]}),i.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:dI(f.fileCount,c)})]}),i.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[i.jsx("span",{className:"rounded bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary",children:c("vscodeWorkbench.projects.workHere",{defaultValue:"Work in this folder"})}),i.jsx("span",{role:"button",tabIndex:0,className:"rounded border border-border px-2 py-1 text-[11px] text-foreground",onClick:h=>{h.stopPropagation(),t(f),r(f)},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),h.stopPropagation(),t(f),r(f))},children:c("vscodeWorkbench.projects.startChat",{defaultValue:"Chat"})})]})]},f.name))}):i.jsxs("div",{className:"rounded-md border border-dashed border-border p-8 text-center",children:[i.jsx($r,{className:"mx-auto mb-3 h-8 w-8 text-muted-foreground"}),i.jsx("div",{className:"text-sm font-medium text-foreground",children:c("vscodeWorkbench.projects.emptyTitle",{defaultValue:"No project directories yet"})}),i.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:c("vscodeWorkbench.projects.emptyDescription",{defaultValue:"Open a local folder or clone a repository to start."})})]})]})]})})})}const Rh=dw.map(e=>({id:e,label:Kn[e]??e}));function Hs(e,t,r){return(e??[]).map(n=>({...n,__provider:n.__provider??t,__projectName:n.__projectName??r}))}function Die(e){return e?[...Hs(e.sessions,"claude",e.name),...Hs(e.codexSessions,"codex",e.name),...Hs(e.cursorSessions,"cursor",e.name),...Hs(e.geminiSessions,"gemini",e.name),...Hs(e.qwenSessions,"qwen",e.name),...Hs(e.opencodeSessions,"opencode",e.name)]:[]}function Oie({project:e,session:t,hermesCliLaunch:r,onSessionSelect:n,t:a}){const[s,o]=m.useState(()=>{if(typeof window>"u")return"claude";const ue=window.localStorage.getItem("selected-provider");return Rh.some(de=>de.id===ue)?ue:"claude"}),[l,c]=m.useState(!1),[d,u]=m.useState(null),[p,f]=m.useState(!1),[h,g]=m.useState(!1),[b,x]=m.useState("provider"),[y,v]=m.useState(null),[w,C]=m.useState(null),[k,N]=m.useState(null),[j,A]=m.useState({runId:0,forceNewSession:!1}),[E,T]=m.useState({provider:null,state:"idle",log:"",error:null}),_=m.useRef(null),{providerAuthStatus:I,refreshProviderAuthStatuses:R}=Lu({initialLoading:!1}),S=m.useMemo(()=>Die(e),[e]),F=I[s],B=d?.__provider===s?d:null,z=d?.id??t?.id??null,q=!!(e&&F?.installed!==!1&&E.state!=="running"),V=!!(p&&b==="provider"&&q),P=m.useMemo(()=>Zs(e),[e]),U=m.useRef(null),H=m.useRef(0);m.useEffect(()=>{const ue=Rh.map(de=>de.id);R(ue)},[R]),m.useEffect(()=>{if(U.current===P)return;U.current=P,c(!1),g(!1),x("provider"),N(null);const ue=vie(P);if(!ue){f(!1),u(null);return}o(ue.provider),window.localStorage.setItem("selected-provider",ue.provider),u(ue.sessionId?S.find(de=>de.id===ue.sessionId&&de.__provider===ue.provider)??null:null),f(ue.isTerminalOpen),ue.isTerminalOpen&&A(de=>({runId:de.runId+1,forceNewSession:!1}))},[P,S]),m.useEffect(()=>()=>{try{_.current?.close()}catch{}},[]);const M=m.useCallback(ue=>{wie(P,{...ue,updatedAt:Date.now()})},[P]),ee=m.useCallback(ue=>{e&&Se("/api/shell/sessions/terminate",{method:"POST",body:JSON.stringify({projectPath:e.fullPath||e.path||"",provider:ue})}).catch(()=>{})},[e]),Q=m.useCallback(ue=>{I[ue]?.installed!==!1&&(x("provider"),N(null),o(ue),window.localStorage.setItem("selected-provider",ue),M({provider:ue,isTerminalOpen:p,sessionId:d?.id??null}))},[p,M,I,d?.id]),ge=m.useCallback(async ue=>{T({provider:ue,state:"running",log:"",error:null});try{_.current?.close()}catch{}_.current=null;try{const de=await Se(`/api/providers/${ue}/install`,{method:"POST",body:"{}"}),D=await de.json().catch(()=>({}));if(!de.ok||!D?.success)throw new Error(D?.error||`HTTP ${de.status}`);if(D.data?.manual)throw new Error(D.data?.message||a("vscodeWorkbench.cli.manualInstall",{defaultValue:"This CLI needs manual installation."}));const X=D.data?.jobId;if(!X)throw new Error(a("vscodeWorkbench.cli.installNoJob",{defaultValue:"Install did not return a job id."}));const oe=window.localStorage.getItem("auth-token")||"",K=`/api/providers/${ue}/install/${X}/stream${oe?`?token=${encodeURIComponent(oe)}`:""}`,W=new EventSource(K);_.current=W,W.addEventListener("log",ne=>{try{const me=JSON.parse(ne.data);typeof me.chunk=="string"&&T(we=>({...we,log:`${we.log}${me.chunk}`}))}catch{}}),W.addEventListener("done",ne=>{try{const me=JSON.parse(ne.data);if(!me.success)throw new Error(me.error||a("vscodeWorkbench.cli.installFailed",{defaultValue:"Install failed."}));T(we=>({...we,state:"done",error:null})),R([ue],{force:!0}),o(ue),window.localStorage.setItem("selected-provider",ue)}catch(me){T(we=>({...we,state:"error",error:me instanceof Error?me.message:a("vscodeWorkbench.cli.installFailed",{defaultValue:"Install failed."})}))}finally{try{W.close()}catch{}_.current=null}}),W.onerror=()=>{T(ne=>ne.state==="running"?{...ne,state:"error",error:a("vscodeWorkbench.cli.installStreamLost",{defaultValue:"Install stream closed early. The install may still be running."})}:ne)}}catch(de){T({provider:ue,state:"error",log:"",error:de instanceof Error?de.message:a("vscodeWorkbench.cli.installFailed",{defaultValue:"Install failed."})})}},[R,a]),se=m.useCallback(({forceNewSession:ue=!1}={})=>{e&&q&&(x("provider"),v(null),C(null),N(null),u(null),c(!1),g(!1),window.localStorage.setItem("selected-provider",s),f(!0),A(de=>({runId:de.runId+1,forceNewSession:ue})),M({provider:s,isTerminalOpen:!0,sessionId:null}))},[q,M,e,s]),ce=m.useCallback(()=>{se({forceNewSession:h})},[h,se]);m.useEffect(()=>{if(!r||H.current===r.id)return;H.current=r.id;const ue=r.provider;if(!dw.includes(ue))return;const de=r.bypassPermissions===!0||r.skipPermissions===!0,D=typeof r.permissionMode=="string"&&r.permissionMode.trim()?r.permissionMode.trim():de?"bypassPermissions":null;x("provider"),o(ue),v(r.startupInput||null),C(r.id),N(D||de?{permissionMode:D,skipPermissions:de}:null),window.localStorage.setItem("selected-provider",ue),u(null),c(!1),g(!1),f(!0),A(X=>({runId:X.runId+1,forceNewSession:r.forceNewSession===!0})),M({provider:ue,isTerminalOpen:!0,sessionId:null})},[r,M]);const ye=m.useCallback(()=>{ee(s),x("provider"),v(null),C(null),N(null),u(null),c(!1),f(!1),g(!0),M({provider:s,isTerminalOpen:!1,sessionId:null})},[M,s,ee]),pe=m.useCallback(()=>{x("provider"),v(null),C(null),N(null),c(!1),f(!1),g(!1),M({provider:s,isTerminalOpen:!1,sessionId:d?.id??null})},[M,s,d?.id]),ve=m.useCallback(ue=>{const de=ue.__provider??"claude";x("provider"),v(null),C(null),N(null),o(de),window.localStorage.setItem("selected-provider",de),u(ue),n(ue),c(!1),g(!1),f(!0),A(D=>({runId:D.runId+1,forceNewSession:!1})),M({provider:de,isTerminalOpen:!0,sessionId:ue.id})},[n,M]);return p?i.jsxs("div",{className:"relative flex h-full min-h-0 flex-col bg-gray-950 text-gray-100",children:[i.jsx(Mie,{project:e,provider:s,session:B,historyCount:S.length,historyOpen:l,canStart:q,onToggleHistory:()=>c(ue=>!ue),onNewSession:ye,onCloseTerminal:pe,t:a}),l&&i.jsx("div",{className:"absolute inset-x-2 top-10 z-30 max-h-[48%] overflow-hidden rounded-md border border-gray-800 bg-gray-950 shadow-2xl shadow-black/40",children:i.jsx(SC,{sessions:S,activeSessionId:z,onSessionSelect:ve,t:a})}),i.jsx("div",{className:"min-h-0 flex-1",children:i.jsx(Vl,{project:e,session:B,forceNewSession:j.forceNewSession,startupInput:y,hermesLaunchId:w,permissionOverride:k,showHeader:!0,autoConnect:V,isActive:!0,onClose:pe},`${s}-${B?.id||"new"}-${e?.name||"none"}-${j.runId}`)})]}):i.jsx("div",{className:"flex h-full min-h-0 flex-col bg-gray-950 text-gray-100",children:i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-b border-gray-800 bg-gray-900/95 p-2",children:[i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"truncate text-xs font-semibold text-gray-100",children:e?.displayName||e?.name||a("vscodeWorkbench.noProject")}),i.jsx("div",{className:"text-[11px] text-gray-400",children:a("vscodeWorkbench.cli.chooseDescription",{defaultValue:"Choose a CLI, then start a full-height terminal."})})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx("button",{type:"button",className:"rounded border border-gray-700 p-1.5 text-gray-200 hover:bg-gray-800 disabled:opacity-50",disabled:!q,onClick:ce,title:a("vscodeWorkbench.cli.newSession",{defaultValue:"New CLI session"}),"aria-label":a("vscodeWorkbench.cli.newSession",{defaultValue:"New CLI session"}),children:i.jsx(Zt,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:xe("rounded border border-gray-700 p-1.5 text-gray-200 hover:bg-gray-800 disabled:opacity-50",l&&"bg-gray-800"),disabled:!e,onClick:()=>c(ue=>!ue),title:a("vscodeWorkbench.cli.history",{defaultValue:"History"}),"aria-label":a("vscodeWorkbench.cli.history",{defaultValue:"History"}),children:i.jsx(Po,{className:"h-3.5 w-3.5"})})]})]}),i.jsxs("div",{className:"mb-2 flex items-center gap-2 rounded border border-gray-800 bg-gray-950 px-2.5 py-2",children:[i.jsx(Xr,{className:"h-4 w-4 shrink-0 text-blue-300"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-[11px] font-semibold text-gray-200",children:a("vscodeWorkbench.cli.chooseTitle",{defaultValue:"Start a CLI terminal"})}),i.jsx("div",{className:"truncate text-[10px] text-gray-500",children:a("vscodeWorkbench.cli.projectScoped",{defaultValue:"Project-scoped CLI terminal"})})]})]}),i.jsx("div",{className:"grid min-h-0 gap-1.5 overflow-y-auto pr-1",children:Rh.map(ue=>{const de=I[ue.id],D=s===ue.id,X=de?.installed===!1,oe=!!de?.loading,K=E.provider===ue.id&&E.state==="running",W=!!(de?.updateAvailable&&de.latestVersion&&!X),ne=K?a("vscodeWorkbench.cli.installing",{defaultValue:"Installing..."}):oe?a("vscodeWorkbench.cli.checking",{defaultValue:"Checking..."}):X?a("vscodeWorkbench.cli.notInstalled",{defaultValue:"Not installed"}):W?a("vscodeWorkbench.cli.updateAvailable",{version:de?.latestVersion,defaultValue:"Update {{version}}"}):de?.installedVersion||a("vscodeWorkbench.cli.ready",{defaultValue:"Ready"});return i.jsxs("div",{className:xe("group flex min-w-0 items-center gap-2 rounded border px-2 py-2 transition-colors",D&&!X?"border-blue-500 bg-blue-500/15 text-blue-100":"border-gray-800 bg-gray-900 text-gray-300 hover:border-gray-700 hover:bg-gray-800",X&&"border-amber-800/70 bg-amber-950/30 text-amber-100"),children:[i.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left",onClick:()=>{if(X){ge(ue.id);return}Q(ue.id)},title:Kn[ue.id]??ue.label,children:[i.jsx(dr,{provider:ue.id,className:xe("h-4 w-4 shrink-0",X&&"opacity-70 grayscale")}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"truncate text-[11px] font-semibold",children:ue.label}),i.jsx("div",{className:xe("truncate text-[10px]",X?"text-amber-300":W?"text-amber-200":"text-gray-500"),children:ne})]}),D&&!X&&i.jsx(tr,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-blue-200"})]}),(X||W)&&i.jsx("button",{type:"button",disabled:K,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded bg-gray-800 text-amber-200 hover:bg-gray-700 disabled:opacity-50",onClick:()=>void ge(ue.id),"aria-label":X?a("vscodeWorkbench.cli.installProvider",{provider:ue.label,defaultValue:"Install {{provider}}"}):a("vscodeWorkbench.cli.updateProvider",{provider:ue.label,defaultValue:"Update {{provider}}"}),title:X?a("vscodeWorkbench.cli.installProvider",{provider:ue.label,defaultValue:"Install {{provider}}"}):a("vscodeWorkbench.cli.updateProvider",{provider:ue.label,defaultValue:"Update {{provider}}"}),children:K?i.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin"}):X?i.jsx(Xn,{className:"h-3.5 w-3.5"}):i.jsx(it,{className:"h-3.5 w-3.5"})})]},ue.id)})}),l&&i.jsx(SC,{sessions:S,activeSessionId:z,onSessionSelect:ve,t:a}),(E.state==="running"||E.state==="done"||E.state==="error")&&i.jsxs("div",{className:"mt-2 rounded border border-gray-800 bg-gray-950 p-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-gray-300",children:[E.state==="running"&&i.jsx(Ft,{className:"h-3.5 w-3.5 animate-spin text-amber-300"}),E.state==="done"&&i.jsx(tr,{className:"h-3.5 w-3.5 text-emerald-300"}),E.state==="error"&&i.jsx(Yn,{className:"h-3.5 w-3.5 text-red-300"}),i.jsxs("span",{className:"truncate",children:[E.provider?Kn[E.provider]:a("vscodeWorkbench.cli.provider",{defaultValue:"Provider"})," ",E.state==="running"?a("vscodeWorkbench.cli.installRunning",{defaultValue:"is installing"}):E.state==="done"?a("vscodeWorkbench.cli.installDone",{defaultValue:"is ready"}):a("vscodeWorkbench.cli.installError",{defaultValue:"needs attention"})]})]}),E.error&&i.jsx("div",{className:"mt-1 text-[11px] text-red-300",children:E.error}),E.log&&i.jsx("pre",{className:"mt-2 max-h-20 overflow-y-auto rounded bg-black/40 p-2 font-mono text-[10px] leading-relaxed text-gray-300",children:E.log})]}),i.jsxs("button",{type:"button",disabled:!q,onClick:ce,className:"mt-2 flex h-10 w-full items-center justify-center gap-2 rounded bg-blue-600 px-3 text-xs font-semibold text-white transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:bg-gray-800 disabled:text-gray-500",children:[i.jsx(Xr,{className:"h-4 w-4"}),a("vscodeWorkbench.cli.startSelected",{provider:Kn[s]??s,defaultValue:"Start {{provider}}"})]})]})})}function Mie({project:e,provider:t,session:r,historyCount:n,historyOpen:a,canStart:s,onToggleHistory:o,onNewSession:l,onCloseTerminal:c,t:d}){return i.jsxs("div",{className:"flex h-10 shrink-0 items-center justify-between gap-2 border-b border-gray-800 bg-gray-900/95 px-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(dr,{provider:t,className:"h-4 w-4 shrink-0"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"truncate text-[11px] font-semibold text-gray-100",children:Kn[t]??t}),i.jsx("div",{className:"truncate text-[10px] text-gray-500",children:r?hg(r):e?.displayName||e?.name||d("vscodeWorkbench.cli.newSession",{defaultValue:"New CLI session"})})]})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsxs("button",{type:"button",className:xe("relative rounded border border-gray-700 p-1.5 text-gray-200 hover:bg-gray-800 disabled:opacity-50",a&&"bg-gray-800"),disabled:!e,onClick:o,title:d("vscodeWorkbench.cli.history",{defaultValue:"History"}),"aria-label":d("vscodeWorkbench.cli.history",{defaultValue:"History"}),children:[i.jsx(Po,{className:"h-3.5 w-3.5"}),n>0&&i.jsx("span",{className:"absolute -right-1 -top-1 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-blue-600 px-0.5 text-[8px] font-semibold text-white",children:Math.min(n,9)})]}),i.jsx("button",{type:"button",className:"rounded border border-gray-700 p-1.5 text-gray-200 hover:bg-gray-800 disabled:opacity-50",disabled:!s,onClick:l,title:d("vscodeWorkbench.cli.newSession",{defaultValue:"New CLI session"}),"aria-label":d("vscodeWorkbench.cli.newSession",{defaultValue:"New CLI session"}),children:i.jsx(Zt,{className:"h-3.5 w-3.5"})}),i.jsx("button",{type:"button",className:"rounded border border-gray-700 p-1.5 text-gray-200 hover:bg-gray-800",onClick:c,title:d("vscodeWorkbench.cli.closeTerminal",{defaultValue:"Close CLI terminal"}),"aria-label":d("vscodeWorkbench.cli.closeTerminal",{defaultValue:"Close CLI terminal"}),children:i.jsx(At,{className:"h-3.5 w-3.5"})})]})]})}function SC({sessions:e,activeSessionId:t,onSessionSelect:r,t:n}){const a=m.useMemo(()=>[...e].sort((s,o)=>{const l=fg(s),c=fg(o);return new Date(c||0).getTime()-new Date(l||0).getTime()}),[e]);return i.jsxs("div",{className:"mt-2 overflow-hidden rounded-md border border-gray-800 bg-gray-950",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-gray-800 px-2.5 py-2",children:[i.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:n("vscodeWorkbench.cli.projectHistory",{defaultValue:"Project history"})}),i.jsx("span",{className:"rounded bg-gray-800 px-1.5 py-0.5 text-[10px] text-gray-400",children:e.length})]}),i.jsx("div",{className:"max-h-52 overflow-y-auto p-1.5",children:a.length===0?i.jsx("div",{className:"px-3 py-4 text-center text-[11px] leading-5 text-gray-500",children:n("vscodeWorkbench.cli.noHistory",{defaultValue:"No sessions for this project yet."})}):a.map(s=>{const o=t===s.id,l=s.__provider??"claude";return i.jsxs("button",{type:"button",className:xe("flex w-full min-w-0 items-center gap-2 rounded px-2.5 py-2 text-left transition-colors hover:bg-gray-900",o&&"bg-blue-500/15 text-blue-100"),onClick:()=>r(s),title:hg(s),children:[i.jsx(dr,{provider:l,className:"h-4 w-4 shrink-0"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-[11px] font-medium text-gray-200",children:hg(s)}),i.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 text-[10px] text-gray-500",children:[i.jsx("span",{className:"truncate",children:Kn[l]??l}),kC(s)&&i.jsxs("span",{className:"shrink-0",children:["- ",kC(s)]})]})]})]},`${l}-${s.id}`)})})]})}function Fie({projects:e,selectedProject:t,onProjectSelect:r,onNewSession:n,onOpenProject:a,onCloneProject:s,onRefresh:o,isRefreshing:l,t:c}){return i.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.jsx("div",{className:"border-b border-border p-1.5",children:i.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[i.jsxs("button",{type:"button",onClick:a,className:"flex min-w-0 items-center justify-center gap-1 rounded border border-border px-2 py-1 text-[11px] font-medium text-foreground transition-colors hover:bg-muted",children:[i.jsx(On,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:c("vscodeWorkbench.projects.openProject",{defaultValue:"Open Project"})})]}),i.jsxs("button",{type:"button",onClick:s,className:"flex min-w-0 items-center justify-center gap-1 rounded border border-border px-2 py-1 text-[11px] font-medium text-foreground transition-colors hover:bg-muted",children:[i.jsx(Ou,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:c("vscodeWorkbench.projects.cloneFromGithub",{defaultValue:"Clone"})})]})]})}),i.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2.5 py-1.5",children:[i.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:c("vscodeWorkbench.projects.directoryList",{defaultValue:"Directories"})}),i.jsx("button",{type:"button",onClick:()=>{o()},disabled:l,className:"rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",title:c("vscodeWorkbench.projects.refresh",{defaultValue:"Refresh projects"}),"aria-label":c("vscodeWorkbench.projects.refresh",{defaultValue:"Refresh projects"}),children:i.jsx(it,{className:xe("h-3.5 w-3.5",l&&"animate-spin")})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-1.5",children:e.length===0?i.jsx("div",{className:"flex h-full items-center justify-center px-4 text-center",children:i.jsxs("div",{children:[i.jsx($r,{className:"mx-auto mb-3 h-7 w-7 text-muted-foreground/70"}),i.jsx("div",{className:"text-sm font-medium text-foreground",children:c("vscodeWorkbench.projects.emptyTitle",{defaultValue:"No project directories yet"})}),i.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:c("vscodeWorkbench.projects.emptyDescription",{defaultValue:"Open a local folder or clone a repository to start."})})]})}):i.jsx("div",{className:"space-y-0.5",children:e.map(d=>{const u=t?.name===d.name;return i.jsxs("div",{role:"button",tabIndex:0,className:xe("group w-full cursor-pointer rounded border px-2 py-1.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",u?"border-primary/40 bg-primary/10":"border-transparent hover:border-border hover:bg-muted/40"),title:_n(d),onClick:()=>r(d),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),r(d))},children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx("span",{className:xe("h-1.5 w-1.5 shrink-0 rounded-full",u?"bg-primary":"bg-muted-foreground/30 group-hover:bg-muted-foreground/60")}),i.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:d.displayName||d.name})]}),i.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center justify-between gap-2 pl-3.5 text-[10px] text-muted-foreground",children:[i.jsx("span",{className:"truncate font-mono",children:Tu(d)}),i.jsx("span",{className:"shrink-0",children:dI(d.fileCount,c)})]}),i.jsx("div",{className:"mt-1.5 flex justify-end opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",children:i.jsx("button",{type:"button",className:"inline-flex h-6 w-6 items-center justify-center rounded border border-border text-foreground",onClick:p=>{p.stopPropagation(),r(d),n(d)},title:c("vscodeWorkbench.projects.startChat",{defaultValue:"Chat"}),"aria-label":c("vscodeWorkbench.projects.startChat",{defaultValue:"Chat"}),children:i.jsx(Mn,{className:"h-3 w-3"})})})]},d.name)})})})]})}function Td({icon:e,label:t,active:r,onClick:n}){return i.jsxs("button",{type:"button",className:xe("relative flex h-10 w-10 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",r&&"bg-primary/10 text-primary"),"aria-label":t,title:t,onClick:n,children:[r&&i.jsx("span",{className:"absolute left-0 h-5 w-0.5 rounded-r bg-primary"}),i.jsx(e,{className:"h-5 w-5"})]})}function zie({label:e,active:t,onClick:r}){return i.jsxs("button",{type:"button",className:xe("relative flex h-10 w-10 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",t&&"bg-emerald-500/10 text-emerald-500 dark:text-emerald-300"),"aria-label":e,title:e,onClick:r,children:[t&&i.jsx("span",{className:"absolute left-0 h-5 w-0.5 rounded-r bg-emerald-500"}),i.jsx(uw,{className:"h-5 w-5"})]})}function uw({className:e=""}){return i.jsx("img",{src:"/hermes-agent.png",alt:"","aria-hidden":"true",className:xe("rounded object-contain",e)})}function CC({label:e,active:t,onPointerDown:r}){return i.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-label":e,title:e,className:xe("group relative z-10 flex h-full w-2 shrink-0 cursor-col-resize items-center justify-center bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",t&&"bg-primary/5"),onPointerDown:r,children:i.jsx("span",{className:xe("h-full w-px bg-border transition-colors group-hover:bg-primary/60",t&&"bg-primary")})})}const hI="pixcode.inAppNotifications.v1",Bie="pixcode.notificationPreferences.v1",pw=25;function Uie(){try{const e=JSON.parse(localStorage.getItem(hI)??"[]");return Array.isArray(e)?e.slice(0,pw):[]}catch{return[]}}function NC(e){try{localStorage.setItem(hI,JSON.stringify(e.slice(0,pw)))}catch{}}function EC(){try{return JSON.parse(localStorage.getItem(Bie)??"null")?.channels?.inApp!==!1}catch{return!0}}function $ie(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||typeof t.title!="string"||typeof t.body!="string"?null:{id:t.id,title:t.title,body:t.body,eventType:t.eventType,category:t.category,preferenceKey:t.preferenceKey,kind:t.kind,code:t.code,severity:t.severity||"info",provider:t.provider??null,sessionId:t.sessionId??null,createdAt:t.createdAt||new Date().toISOString(),data:t.data}}function Hie(e){return e==="error"?"border-red-500/50 bg-red-50 text-red-950 dark:bg-red-950/35 dark:text-red-50":e==="warning"?"border-amber-500/50 bg-amber-50 text-amber-950 dark:bg-amber-950/35 dark:text-amber-50":"border-border bg-card text-card-foreground"}function Gie(e){if(!e)return"";try{return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return""}}function Vie({latestMessage:e}){const[t,r]=m.useState(()=>typeof window>"u"?[]:Uie()),[n,a]=m.useState(!1),[s,o]=m.useState(()=>new Set),[l,c]=m.useState(()=>typeof window>"u"?!0:EC());m.useEffect(()=>{const f=()=>c(EC());return window.addEventListener("storage",f),window.addEventListener("pixcode:notification-preferences-changed",f),()=>{window.removeEventListener("storage",f),window.removeEventListener("pixcode:notification-preferences-changed",f)}},[]),m.useEffect(()=>{const f=e;if(!f||f.type!=="notification:event")return;const h=$ie(f.notification);h&&(QC({key:h.id,title:h.title,body:h.body,event:h.eventType||h.kind||"updates",tag:typeof h.data?.tag=="string"?h.data.tag:h.id,data:h.data}),l&&(r(g=>{if(g.some(x=>x.id===h.id))return g;const b=[h,...g].slice(0,pw);return NC(b),b}),o(g=>{const b=new Set(g);return b.delete(h.id),b}),a(!0)))},[l,e]);const d=m.useMemo(()=>t.filter(f=>!s.has(f.id)).length,[t,s]),u=m.useCallback(()=>{o(new Set(t.map(f=>f.id)))},[t]),p=m.useCallback(f=>{r(h=>{const g=h.filter(b=>b.id!==f);return NC(g),g}),o(h=>{const g=new Set(h);return g.delete(f),g})},[]);return!l||t.length===0?null:i.jsxs("div",{className:"pointer-events-none fixed bottom-4 right-4 z-40 flex max-w-[calc(100vw-2rem)] flex-col items-end gap-3",children:[n&&i.jsxs("div",{className:"pointer-events-auto w-[min(24rem,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-popover shadow-xl shadow-black/10",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border px-3 py-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(Hh,{className:"h-4 w-4 flex-shrink-0 text-primary"}),i.jsx("span",{className:"truncate text-sm font-medium text-popover-foreground",children:"Notifications"}),d>0&&i.jsx("span",{className:"rounded-full bg-primary px-2 py-0.5 text-xs font-medium text-primary-foreground",children:d})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{type:"button",onClick:u,className:"rounded px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:"Read"}),i.jsx("button",{type:"button",onClick:()=>a(!1),className:"rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":"Close notifications",children:i.jsx(At,{className:"h-4 w-4"})})]})]}),i.jsx("div",{className:"max-h-[22rem] space-y-2 overflow-y-auto p-2",children:t.slice(0,6).map(f=>i.jsx("div",{className:`rounded-md border p-3 shadow-sm ${Hie(f.severity)}`,children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[!s.has(f.id)&&i.jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full bg-primary"}),i.jsx("p",{className:"truncate text-sm font-medium",children:f.title})]}),i.jsx("p",{className:"mt-1 text-sm leading-5 opacity-85",children:f.body}),i.jsx("p",{className:"mt-2 text-xs opacity-60",children:Gie(f.createdAt)})]}),i.jsx("button",{type:"button",onClick:()=>p(f.id),className:"rounded p-1 opacity-60 transition-opacity hover:opacity-100","aria-label":"Dismiss notification",children:i.jsx(At,{className:"h-4 w-4"})})]})},f.id))})]}),i.jsxs("button",{type:"button",onClick:()=>{a(f=>!f),n||u()},className:"pointer-events-auto relative inline-flex h-11 w-11 items-center justify-center rounded-full border border-border bg-card text-card-foreground shadow-lg shadow-black/10 transition-transform hover:scale-105","aria-label":"Open notifications",children:[i.jsx(Sg,{className:"h-5 w-5"}),d>0&&i.jsx("span",{className:"absolute -right-1 -top-1 min-w-5 rounded-full bg-primary px-1.5 py-0.5 text-xs font-semibold text-primary-foreground",children:d>9?"9+":d})]})]})}function Wie(){const[e,t]=m.useState(new Set),[r,n]=m.useState(new Set),a=m.useCallback(d=>{d&&t(u=>new Set([...u,d]))},[]),s=m.useCallback(d=>{d&&t(u=>{const p=new Set(u);return p.delete(d),p})},[]),o=m.useCallback(d=>{d&&n(u=>new Set([...u,d]))},[]),l=m.useCallback(d=>{d&&n(u=>{const p=new Set(u);return p.delete(d),p})},[]),c=m.useCallback(d=>{d&&t(u=>{const p=new Set;for(const f of u)f.startsWith("new-session-")||p.add(f);return p.add(d),p})},[]);return{activeSessions:e,processingSessions:r,markSessionAsActive:a,markSessionAsInactive:s,markSessionAsProcessing:o,markSessionAsNotProcessing:l,replaceTemporarySession:c}}const yr=e=>JSON.stringify(e??null),TC=(e,t,r)=>e.length!==t.length?!0:t.some((n,a)=>{const s=e[a];return!s||n.name!==s.name||n.displayName!==s.displayName||n.fullPath!==s.fullPath||n.fileCount!==s.fileCount||yr(n.sessionMeta)!==yr(s.sessionMeta)||yr(n.sessions)!==yr(s.sessions)?!0:yr(n.cursorSessions)!==yr(s.cursorSessions)||yr(n.codexSessions)!==yr(s.codexSessions)||yr(n.geminiSessions)!==yr(s.geminiSessions)||yr(n.qwenSessions)!==yr(s.qwenSessions)||yr(n.opencodeSessions)!==yr(s.opencodeSessions)}),Gs=(e,t)=>(e??[]).map(r=>({...r,__provider:r.__provider??t})),Au=e=>[...Gs(e.sessions,"claude"),...Gs(e.codexSessions,"codex"),...Gs(e.cursorSessions,"cursor"),...Gs(e.geminiSessions,"gemini"),...Gs(e.qwenSessions,"qwen"),...Gs(e.opencodeSessions,"opencode")],qie=(e,t,r,n)=>{if(!r||!n)return!0;const a=e.find(c=>c.name===r.name),s=t.find(c=>c.name===r.name);if(!a||!s)return!1;const o=Au(a).find(c=>c.id===n.id),l=Au(s).find(c=>c.id===n.id);return!o||!l?!1:o.id===l.id&&o.title===l.title&&o.created_at===l.created_at&&o.updated_at===l.updated_at},Kie=new Set(["chat","orchestration","remote","controlRoom","files","shell","git","changes","liveView","preview"]),Yie=new Set(["controlRoom"]),Zie=e=>Kie.has(e)||e.startsWith("plugin:"),fI=e=>Yie.has(e)?"chat":e,Xie=()=>{if(typeof window<"u"&&window.location.pathname.endsWith("/orchestration"))return"orchestration";try{const e=localStorage.getItem("activeTab");if(e&&Zie(e))return fI(e)}catch{}return"chat"};function Jie({sessionId:e,navigate:t,latestMessage:r,isMobile:n,activeSessions:a}){const[s,o]=m.useState([]),[l,c]=m.useState(null),[d,u]=m.useState(null),[p,f]=m.useState(Xie);m.useEffect(()=>{try{localStorage.setItem("activeTab",fI(p))}catch{}},[p]);const[h,g]=m.useState(!1),[b,x]=m.useState(!0),[y,v]=m.useState(null),[w,C]=m.useState(!1),[k,N]=m.useState(!1),[j,A]=m.useState("agents"),[E,T]=m.useState(0),_=m.useRef(null),I=m.useCallback(async({showLoadingState:ce=!0}={})=>{try{ce&&x(!0);const pe=await(await Lt.projects()).json();o(ve=>ve.length===0||TC(ve,pe,!0)?pe:ve)}catch(ye){console.error("Error fetching projects:",ye)}finally{ce&&x(!1)}},[]),R=m.useCallback(async()=>{await I({showLoadingState:!1})},[I]),S=m.useCallback((ce="tools")=>{A(ce),N(!0)},[]);m.useEffect(()=>{I()},[I]),m.useEffect(()=>{!b&&s.length===1&&!l&&!e&&c(s[0])},[b,s,l,e]),m.useEffect(()=>{if(!r)return;if(r.type==="loading_progress"){_.current&&(clearTimeout(_.current),_.current=null),v(r),r.phase==="complete"&&(_.current=setTimeout(()=>{v(null),_.current=null},500));return}if(r.type!=="projects_updated")return;const ce=r;if(ce.changedFile&&d&&l){const D=ce.changedFile.replace(/\\/g,"/").split("/");D.length>=2&&D[D.length-1].replace(".jsonl","")===d.id&&(a.has(d.id)||T(W=>W+1))}const ye=d&&a.has(d.id)||a.size>0&&Array.from(a).some(de=>de.startsWith("new-session-")),pe=ce.projects;if(ye&&!qie(s,pe,l,d)||(o(pe),!l))return;const ve=pe.find(de=>de.name===l.name);if(!ve||(yr(ve)!==yr(l)&&c(ve),!d))return;Au(ve).find(de=>de.id===d.id)||u(null)},[r,l,d,a,s]),m.useEffect(()=>()=>{_.current&&(clearTimeout(_.current),_.current=null)},[]),m.useEffect(()=>{if(!(!e||s.length===0)){for(const ce of s){const ye=ce.sessions?.find(X=>X.id===e);if(ye){const X=l?.name!==ce.name,oe=d?.id!==e||d.__provider!=="claude";X&&c(ce),oe&&u({...ye,__provider:"claude"});return}const pe=ce.cursorSessions?.find(X=>X.id===e);if(pe){const X=l?.name!==ce.name,oe=d?.id!==e||d.__provider!=="cursor";X&&c(ce),oe&&u({...pe,__provider:"cursor"});return}const ve=ce.codexSessions?.find(X=>X.id===e);if(ve){const X=l?.name!==ce.name,oe=d?.id!==e||d.__provider!=="codex";X&&c(ce),oe&&u({...ve,__provider:"codex"});return}const ue=ce.geminiSessions?.find(X=>X.id===e);if(ue){const X=typeof ue.id=="string"&&ue.id.startsWith("qwen_")||ue.provider==="qwen",K=typeof ue.id=="string"&&ue.id.startsWith("opencode_")||ue.provider==="opencode"?"opencode":X?"qwen":"gemini",W=l?.name!==ce.name,ne=d?.id!==e||d.__provider!==K;W&&c(ce),ne&&u({...ue,__provider:K});return}const de=ce.qwenSessions?.find(X=>X.id===e);if(de){const X=l?.name!==ce.name,oe=d?.id!==e||d.__provider!=="qwen";X&&c(ce),oe&&u({...de,__provider:"qwen"});return}const D=ce.opencodeSessions?.find(X=>X.id===e);if(D){const X=l?.name!==ce.name,oe=d?.id!==e||d.__provider!=="opencode";X&&c(ce),oe&&u({...D,__provider:"opencode"});return}}if(e&&d?.id!==e){const ce=e.startsWith("opencode_")?"opencode":e.startsWith("qwen_")?"qwen":e.startsWith("codex-")||e.startsWith("codex_")?"codex":e.startsWith("gemini_")?"gemini":null,ye=(typeof window<"u"?localStorage.getItem("selected-provider"):null)||"claude";u({id:e,__provider:ce||ye})}}},[e,s,l?.name,d?.id,d?.__provider]);const F=m.useCallback(ce=>{c(ce),u(null),t("/"),n&&g(!1)},[n,t]),B=m.useCallback(ce=>{u(ce),(p==="preview"||p==="liveView"||p==="orchestration")&&f("chat");const ye=ce.__provider||localStorage.getItem("selected-provider")||"claude";if(ce.__provider&&localStorage.setItem("selected-provider",ce.__provider),ye==="cursor"&&sessionStorage.setItem("cursorSessionId",ce.id),n){const pe=ce.__projectName,ve=l?.name;pe!==ve&&g(!1)}t(`/session/${ce.id}`)},[p,n,t,l?.name]),z=m.useCallback(ce=>{o(ye=>{const pe=ye.findIndex(ue=>ue.name===ce.name);if(pe===-1)return[ce,...ye];const ve=[...ye];return ve[pe]={...ve[pe],...ce},ve}),c(ce),u(null),f("chat"),t("/"),n&&g(!1)},[n,t]),q=m.useCallback(ce=>{z(ce)},[z]),V=m.useCallback(async ce=>{try{const ye=await Lt.quickStartProject(),pe=await ye.json().catch(()=>({}));if(!ye.ok||!pe?.project){console.error("[quick-start] failed:",pe);return}const ve=pe.project;if(ce==="chat"){z(ve);return}o(ue=>ue.some(de=>de.name===ve.name)?ue:[ve,...ue]),c(ve),u(null),f(ce),t("/"),n&&g(!1)}catch(ye){console.error("[quick-start] error:",ye)}},[n,t,z]),P=m.useCallback(async()=>{await V("chat")},[V]),U=m.useCallback(async()=>{await V("orchestration")},[V]),H=m.useCallback((ce,ye)=>{c(ce),u(null),f("orchestration"),ye&&localStorage.setItem("pixcode.orchestration.selectedRunId",ye),t("/"),n&&g(!1)},[n,t]),M=m.useCallback(()=>{u(null),f("controlRoom"),t("/"),n&&g(!1)},[n,t]),ee=m.useCallback(ce=>{d?.id===ce&&(u(null),t("/")),o(ye=>ye.map(pe=>({...pe,sessions:pe.sessions?.filter(ve=>ve.id!==ce)??[],sessionMeta:{...pe.sessionMeta,total:Math.max(0,(pe.sessionMeta?.total??0)-1)}})))},[t,d?.id]),Q=m.useCallback(async()=>{try{const ye=await(await Lt.projects()).json();if(o(ue=>TC(ue,ye,!0)?ye:ue),!l)return;const pe=ye.find(ue=>ue.name===l.name);if(!pe||(yr(pe)!==yr(l)&&c(pe),!d))return;const ve=Au(pe).find(ue=>ue.id===d.id);if(ve){const ue=ve.__provider||!d.__provider?ve:{...ve,__provider:d.__provider};yr(ue)!==yr(d)&&u(ue)}}catch(ce){console.error("Error refreshing sidebar:",ce)}},[l,d]),ge=m.useCallback(ce=>{l?.name===ce&&(c(null),u(null),t("/")),o(ye=>ye.filter(pe=>pe.name!==ce))},[t,l?.name]),se=m.useMemo(()=>({projects:s,selectedProject:l,selectedSession:d,onProjectSelect:F,onSessionSelect:B,onNewSession:q,onProjectCreated:z,onQuickStartSession:P,onOpenControlRoom:M,onOpenOrchestration:H,onSessionDelete:ee,onProjectDelete:ge,isLoading:b,loadingProgress:y,onRefresh:Q,onShowSettings:()=>N(!0),showSettings:k,settingsInitialTab:j,onCloseSettings:()=>N(!1),isMobile:n}),[q,M,H,z,P,ge,F,ee,B,Q,b,n,y,s,j,l,d,k]);return{projects:s,selectedProject:l,selectedSession:d,activeTab:p,sidebarOpen:h,isLoadingProjects:b,loadingProgress:y,isInputFocused:w,showSettings:k,settingsInitialTab:j,externalMessageUpdate:E,setActiveTab:f,setSidebarOpen:g,setIsInputFocused:C,setShowSettings:N,openSettings:S,fetchProjects:I,refreshProjectsSilently:R,sidebarSharedProps:se,handleProjectSelect:F,handleSessionSelect:B,handleNewSession:q,handleOpenOrchestration:H,handleQuickStartOrchestration:U,handleSessionDelete:ee,handleProjectDelete:ge,handleSidebarRefresh:Q}}function Lh(){const e=KI(),{sessionId:t}=YI(),{t:r}=Be("common"),{isMobile:n}=Ig({trackPWA:!1}),{ws:a,sendMessage:s,latestMessage:o,isConnected:l}=gO(),c=m.useRef(!1),{activeSessions:d,processingSessions:u,markSessionAsActive:p,markSessionAsInactive:f,markSessionAsProcessing:h,markSessionAsNotProcessing:g,replaceTemporarySession:b}=Wie(),{selectedProject:x,selectedSession:y,activeTab:v,sidebarOpen:w,isLoadingProjects:C,externalMessageUpdate:k,setActiveTab:N,setSidebarOpen:j,setIsInputFocused:A,setShowSettings:E,openSettings:T,refreshProjectsSilently:_,sidebarSharedProps:I,handleQuickStartOrchestration:R}=Jie({sessionId:t,navigate:e,latestMessage:o,isMobile:n,activeSessions:d});return m.useEffect(()=>(window.refreshProjects=_,()=>{window.refreshProjects===_&&delete window.refreshProjects}),[_]),m.useEffect(()=>(window.openSettings=T,()=>{window.openSettings===T&&delete window.openSettings}),[T]),m.useEffect(()=>{if(typeof navigator>"u"||!("serviceWorker"in navigator))return;const S=F=>{const B=F.data;if(!(!B||B.type!=="notification:navigate")){if(typeof B.provider=="string"&&B.provider.trim()&&localStorage.setItem("selected-provider",B.provider),N("chat"),j(!1),_(),typeof B.sessionId=="string"&&B.sessionId){e(`/session/${B.sessionId}`);return}e("/")}};return navigator.serviceWorker.addEventListener("message",S),()=>{navigator.serviceWorker.removeEventListener("message",S)}},[e,_,N,j]),m.useEffect(()=>{l&&!c.current?c.current=!0:l||(c.current=!1),l&&y?.id&&s({type:"get-pending-permissions",sessionId:y.id})},[l,y?.id,s]),m.useEffect(()=>{!o||o.type!=="projects_updated"||window.dispatchEvent(new CustomEvent("pixcode:file-tree-refresh",{detail:{projectName:x?.name??null,changedFile:typeof o.changedFile=="string"?o.changedFile:null}}))},[o,x?.name]),m.useEffect(()=>{const S=window.visualViewport;if(!S)return;const F=()=>{const B=Math.max(0,window.innerHeight-S.height);document.documentElement.style.setProperty("--keyboard-height",`${B}px`)};return S.addEventListener("resize",F),()=>S.removeEventListener("resize",F)},[]),i.jsxs("div",{className:"fixed inset-0 flex bg-background",style:{bottom:"var(--keyboard-height, 0px)"},children:[n?i.jsxs("div",{className:`fixed inset-0 z-50 flex transition-all duration-150 ease-out ${w?"visible opacity-100":"invisible opacity-0"}`,children:[i.jsx("button",{className:"fixed inset-0 bg-background/60 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:S=>{S.stopPropagation(),j(!1)},onTouchStart:S=>{S.preventDefault(),S.stopPropagation(),j(!1)},"aria-label":r("versionUpdate.ariaLabels.closeSidebar")}),i.jsx("div",{className:`relative h-full w-[85vw] max-w-sm transform border-r border-border/40 bg-card transition-transform duration-150 ease-out sm:w-80 ${w?"translate-x-0":"-translate-x-full"}`,onClick:S=>S.stopPropagation(),onTouchStart:S=>S.stopPropagation(),children:i.jsx(nT,{...I})})]}):null,i.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:n?i.jsx(aie,{selectedProject:x,selectedSession:y,activeTab:v,setActiveTab:N,ws:a,sendMessage:s,latestMessage:o,isMobile:n,onMenuClick:()=>j(!0),isLoading:C,onInputFocusChange:A,onSessionActive:p,onSessionInactive:f,onSessionProcessing:h,onSessionNotProcessing:g,processingSessions:u,onReplaceTemporarySession:b,onNavigateToSession:S=>e(`/session/${S}`),onShowSettings:()=>E(!0),externalMessageUpdate:k,onQuickStartSession:I.onQuickStartSession,onQuickStartOrchestration:R}):i.jsx(Eie,{sidebarProps:I,selectedProject:x,selectedSession:y,activeTab:v,setActiveTab:N,ws:a,sendMessage:s,latestMessage:o,isMobile:n,onMenuClick:()=>j(!0),isLoading:C,onInputFocusChange:A,onSessionActive:p,onSessionInactive:f,onSessionProcessing:h,onSessionNotProcessing:g,processingSessions:u,onReplaceTemporarySession:b,onNavigateToSession:S=>e(`/session/${S}`),onShowSettings:()=>E(!0),externalMessageUpdate:k,onQuickStartSession:I.onQuickStartSession,onQuickStartOrchestration:R})}),i.jsx(Vie,{latestMessage:o})]})}const{slice:Qie,forEach:ese}=[];function tse(e){return ese.call(Qie.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}function rse(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(r=>r.test(e))}const AC=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,nse=function(e,t){const n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},a=encodeURIComponent(t);let s=`${e}=${a}`;if(n.maxAge>0){const o=n.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(o)}`}if(n.domain){if(!AC.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!AC.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(s+="; Partitioned"),s},jC={create(e,t,r,n){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+r*60*1e3)),n&&(a.domain=n),document.cookie=nse(e,t,a)},read(e){const t=`${e}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var ase={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return jC.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:n,cookieDomain:a,cookieOptions:s}=t;r&&typeof document<"u"&&jC.create(r,e,n,a,s)}},ise={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,r;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const s=n.substring(1).split("&");for(let o=0;o<s.length;o++){const l=s[o].indexOf("=");l>0&&s[o].substring(0,l)===t&&(r=s[o].substring(l+1))}}return r}},sse={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:r}=e,n;if(typeof window<"u"){const{hash:a}=window.location;if(a&&a.length>2){const s=a.substring(1);if(t){const o=s.split("&");for(let l=0;l<o.length;l++){const c=o[l].indexOf("=");c>0&&o[l].substring(0,c)===t&&(n=o[l].substring(c+1))}}if(n)return n;if(!n&&r>-1){const o=a.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?o[typeof r=="number"?r:0]?.replace("/",""):void 0}}}return n}};let Vs=null;const IC=()=>{if(Vs!==null)return Vs;try{if(Vs=typeof window<"u"&&window.localStorage!==null,!Vs)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Vs=!1}return Vs};var ose={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&IC())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&IC()&&window.localStorage.setItem(r,e)}};let Ws=null;const _C=()=>{if(Ws!==null)return Ws;try{if(Ws=typeof window<"u"&&window.sessionStorage!==null,!Ws)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Ws=!1}return Ws};var lse={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&_C())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&_C()&&window.sessionStorage.setItem(r,e)}},cse={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:a}=navigator;if(r)for(let s=0;s<r.length;s++)t.push(r[s]);n&&t.push(n),a&&t.push(a)}return t.length>0?t:void 0}},dse={name:"htmlTag",lookup(e){let{htmlTag:t}=e,r;const n=t||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},use={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof t=="number"?t:0]?.replace("/",""):void 0}},pse={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const r=typeof t=="number"?t+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}};let gI=!1;try{document.cookie,gI=!0}catch{}const bI=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];gI||bI.splice(1,1);const mse=()=>({order:bI,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class xI{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,r)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=tse(r,this.options||{},mse()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=a=>a.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(ase),this.addDetector(ise),this.addDetector(ose),this.addDetector(lse),this.addDetector(cse),this.addDetector(dse),this.addDetector(use),this.addDetector(pse),this.addDetector(sse)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return t.forEach(n=>{if(this.detectors[n]){let a=this.detectors[n].lookup(this.options);a&&typeof a=="string"&&(a=[a]),a&&(r=r.concat(a))}}),r=r.filter(n=>n!=null&&!rse(n)).map(n=>this.options.convertDetectedLanguage(n)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(t,this.options)}))}}xI.type="languageDetector";const hse={save:"Save",cancel:"Cancel",delete:"Delete",create:"Create",edit:"Edit",close:"Close",confirm:"Confirm",submit:"Submit",retry:"Retry",refresh:"Refresh",search:"Search",clear:"Clear",copy:"Copy",download:"Download",upload:"Upload",browse:"Browse"},fse={chat:"Chat",shell:"Shell",files:"Files",git:"Source Control",changes:"Changes",liveView:"Live View",tasks:"Tasks",remote:"Remote",controlRoom:"Control",orchestration:"Orchestration"},gse={loading:"Loading...",success:"Success",error:"Error",failed:"Failed",pending:"Pending",completed:"Completed",inProgress:"In Progress"},bse={savedSuccessfully:"Saved successfully",deletedSuccessfully:"Deleted successfully",updatedSuccessfully:"Updated successfully",operationFailed:"Operation failed",networkError:"Network error. Please check your connection.",unauthorized:"Unauthorized. Please log in.",notFound:"Not found",invalidInput:"Invalid input",requiredField:"This field is required",unknownError:"An unknown error occurred"},xse={settings:"Settings",home:"Home",back:"Back",next:"Next",previous:"Previous",logout:"Logout"},yse={language:"Language",theme:"Theme",darkMode:"Dark Mode",lightMode:"Light Mode",name:"Name",description:"Description",enabled:"Enabled",disabled:"Disabled",optional:"Optional",version:"Version",select:"Select",selectAll:"Select All",deselectAll:"Deselect All"},vse={justNow:"Just now",minutesAgo:"{{count}} mins ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",yesterday:"Yesterday"},wse={newFile:"New File",newFolder:"New Folder",rename:"Rename",move:"Move",copyPath:"Copy Path",openInEditor:"Open in Editor"},kse={loading:"Loading Pixcode",settingUpWorkspace:"Setting up your workspace...",chooseProject:"Choose Your Project",selectProjectDescription:"Select a project from the sidebar to start coding with Claude. Each project contains your chat sessions and file history.",tip:"Tip",createProjectMobile:"Tap the menu button above to access projects",createProjectDesktop:"Create a new project by clicking the folder icon in the sidebar",newSession:"New Session",untitledSession:"Untitled Session",projectFiles:"Project Files",landing:{title:"Start a Pixcode workspace",description:"Choose a project, start a new chat, or launch Orchestration with one goal. Orchestration manages the CLI agents you select, shows every step, and surfaces errors directly.",startOrchestration:"Start Orchestration",startOrchestrationDescription:"Creates an automatic project and opens the Orchestration screen with agent control and run history.",startChat:"Start a new chat",startChatDescription:"Creates a folder automatically and opens the normal chat screen with one agent.",sidebarHint:"When you select an existing project from the sidebar, chat history, files, git status, tasks, and orchestration stay in the same main screen.",createProject:"Create New Project",createProjectDescription:"Add an existing workspace or create a folder, then open the provider picker for coding."}},Sse={title:"Orchestration",subtitle:"Give one goal inside {{project}}; choose the CLI workers, duplicate any CLI when needed, and assign work directly or let the coordinator split it.",refresh:"Refresh",goal:"Goal",goalPlaceholder:"Example: Fix the auth screen for single-port deployment, capture errors, and verify with lint and typecheck.",mode:"Run mode",systemPlan:"System plan",noMode:"No mode selected",loadingPlan:"Loading agent plan.",start:"Start team",starting:"Starting",stop:"Stop team",stopping:"Stopping",cancelFailed:"Workflow could not be stopped.",linkedTask:"Linked task",replayRun:"Replay",replaying:"Replaying",approveReplay:"Approve replay",replayApprovalRequired:"Replay needs approval before repeating a step with prior shell, network, or file-write activity.",replayFailed:"Workflow replay could not start.",needAgent:"Enable at least one CLI worker.",needRoles:"Assign at least one enabled agent to these role(s) for this mode: {{roles}}.",startFailed:"Workflow could not start.",quickPrompts:{label:"Quick prompt:",liveTrading:{label:"8024 live trading screen",prompt:"Hi, please create a small project and then run it on port 8024. I want a Binance FAPI-connected TradingView-style design with a TradingView chart and a star/favorites system on the left. Split the work logically and manage the process automatically."}},cliControl:"CLI team",enabledCount:"{{count}} enabled",enabled:"Enabled",disabled:"Disabled",history:"History",emptyHistory:"No runs yet. Write a goal and start the agents.",steps:"{{done}}/{{total}} steps",notSelected:"No run selected",notSelectedDescription:"Select a previous run or start a new goal. Agent messages, errors, change summaries, and preview outputs appear here.",loadFailed:"Run details could not be loaded.",loadingRun:"Loading run...",traceTimeline:"Trace timeline",traceFilters:"Filters",traceAll:"All",traceActor:"Actor",traceProvider:"Provider",traceType:"Type",traceSeverity:"Severity",traceDuration:"{{duration}} elapsed",traceEmpty:"No trace events match the current filters.",traceLoadFailed:"Trace timeline could not be loaded.",traceTypes:{run:"Run",node:"Step",provider:"Provider",message:"Message",artifact:"Artifact",file:"File edit",permission_policy:"Permission policy",error:"Error"},traceSeverityLevels:{info:"Info",warning:"Warning",error:"Error"},teamHistory:"Team history",permissionApprovalsPending:"{{count}} permission approval pending",agentSteps:"Agent steps",changeSummary:"Change summary",noChangeSummary:"The final summary is not ready yet. A readable Markdown summary appears here when the agents finish.",prepareTeamFromReport:"Prepare agent team from this report",prepareTeamTitle:"Prepare agent team prompt",prepareTeamDescription:"The debate output was turned into a new Agent Team prompt. Edit it, then move it into Agent Team mode.",usePreparedPrompt:"Use prompt",reportToPromptPrefix:"Prepare and execute an agent team from the following debate/decision report. Split the needs into tasks, propose sensible assignments for the available CLI agents, and start only after user confirmation.",generatedSummaryTitle:"Automatic run summary",summaryStatus:"Overall status",summarySteps:"Completed steps",summaryFailures:"Failed steps",summaryCanceled:"Canceled steps",summaryDiffs:"Diff/change outputs",summaryPreviews:"Preview outputs",summaryErrorPrefix:"Error",assignedWork:"Assigned work",autoAssigned:"Automatic / coordinator decides",noStepOutput:"No step output.",agentMessages:"Agent messages",noAgentMessages:"This agent has not produced a message yet. If the run failed, the real CLI error appears above.",outputs:"Outputs",noOutputs:"No change summary, preview, or command output yet.",open:"Open",artifact:{fileDiff:"Change summary",previewUrl:"Preview",commandOutput:"Command output",handoff:"Handoff artifact"},role:{user:"User",agent:"Agent"},status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed",canceled:"Canceled",skipped:"Skipped"},nodes:{codex_review:"Codex review",gemini_review:"Gemini review",claude_review:"Claude review",claude_code_review:"Claude review",cursor_review:"Cursor review",aggregate:"Aggregate",architect:"Planning",implement:"Implementation",review:"Review",proposal:"Proposal",critique:"Critique",response:"Response",judge:"Decision",coordinator:"Coordinator",final_report:"Final report"},stages:{coordinator:"Coordinator",handoff:"Handoff",backend:"Backend",frontend:"Frontend",implementation:"Implementation",review:"Review",repair:"Repair",proposal:"Proposal",critique:"Critique",response:"Response",decision:"Decision",report:"Report",fallback:"Fallback",final_report:"Final report"},workflows:{multi_model_review:{name:"Multi-model review",description:"Enabled CLI agents review the same goal separately, then one enabled agent aggregates the result."},sequential_handoff:{name:"Sequential handoff",description:"Agents plan, implement, and review in order. Disabled CLI steps are skipped."},adversarial_debate:{name:"Decision debate",description:"Agents propose, critique, respond, and produce a final recommendation."},agent_team:{name:"Agent team",description:"A coordinator reads the goal and active CLI instances, assigns work, then collects the result."}},adapters:{"claude-code":{label:"Claude Code",role:"CLI worker"},cursor:{label:"Cursor",role:"CLI worker"},codex:{label:"Codex",role:"CLI worker"},gemini:{label:"Gemini",role:"CLI worker"},qwen:{label:"Qwen Code",role:"CLI worker"},opencode:{label:"OpenCode",role:"CLI worker"}},activeCount:"{{active}}/{{total}} active",teamHint:"Each row is one CLI worker. You can create multiple Claude, Codex, Cursor, Gemini, Qwen, or OpenCode workers and give each a different assignment.",parallelLimit:"Parallel limit",fallbackAgent:"Fallback CLI",noFallbackAgent:"No automatic fallback",fallbackAgentHint:"If a CLI step fails, Pixcode retries that step with this backup agent.",agentRole:"Stage",agentModel:"Model",agentRoles:{auto:"Auto",backend:"Backend",frontend:"Frontend",review:"Test / review",implementation:"Implementation",proposal:"Proposal",critique:"Critique",response:"Response",decision:"Decision / report",report:"Report",custom:"Custom"},customRolePlaceholder:"Example: Security, Mobile UX, DB architecture",roleHints:{default:"Leave empty and the coordinator assigns this agent from the goal.",agent_team:"Pick backend, frontend, or review stages, or leave agents on auto.",multi_model_review:"Enabled agents review; if a report role is selected, that agent aggregates the final summary.",sequential_handoff:"Agents run in your selected order; assignment text defines each step.",adversarial_debate:"Stage selection is optional in decision debate; if left empty, the system assigns selected agents to Proposal, Critique, and Response in order."},addAgent:"Add {{agent}}",soloAgent:"Run only with {{agent}}",soloAgentShort:"Solo",duplicateAgent:"Duplicate {{agent}}",removeAgent:"Remove {{agent}}",assignment:"Assignment",assignmentPlaceholder:"Optional: tell this worker exactly what to handle. Leave empty for coordinator assignment.",agentInstance:"{{name}} #{{number}}",taskTitle:"Task",taskTitlePlaceholder:"Implement feature",taskDescription:"Description",taskDescriptionPlaceholder:"Scope, constraints, expected output",addTask:"Add",runTask:"Run",cancelTask:"Cancel",dispatchTask:"Dispatch task",adapter:"Adapter",isolation:"Isolation",dispatch:"Dispatch",auto:"Auto",cliSettings:"CLI settings",waitingForStream:"Waiting for stream...",workflow:"Workflow",templates:"Templates",noTemplate:"No template",templateHint:"Pick a starter template to fill the workflow, agent roles, and acceptance criteria before launch.",input:"Input",taskStates:{todo:"To Do",in_progress:"In Progress",in_review:"In Review",done:"Done",failed:"Failed",canceled:"Canceled"},isolationKind:{worktree:"Worktree",host:"Host",docker:"Docker"},workspaceTarget:"Target workspace",workspaceTargets:{selectedProject:"Selected project",pixcodeApp:"Pixcode system",custom:"Custom path"},customWorkspacePlaceholder:"/path/to/project",workspaceTargetHint:"Agents will run in: {{path}}",autoDetect:"auto-detect",needWorkspacePath:"Enter a custom workspace path.",hermesTitle:"Hermes Agent",hermesSubtitle:"Hermes is running inside Pixcode for {{project}} and can coordinate local checks, tests, terminal work, and project operations.",hermesCliControl:"Hermes CLI control"},Cse={loading:"Loading files...",files:"Files",simpleView:"Simple view",compactView:"Compact view",detailedView:"Detailed view",searchPlaceholder:"Search files and folders...",clearSearch:"Clear search",name:"Name",size:"Size",modified:"Modified",permissions:"Permissions",noFilesFound:"No files found",checkProjectPath:"Check if the project path is accessible",noMatchesFound:"No matches found",tryDifferentSearch:"Try a different search term or clear the search",justNow:"just now",minAgo:"{{count}} min ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",newFile:"New File (Cmd+N)",newFolder:"New Folder (Cmd+Shift+N)",refresh:"Refresh",collapseAll:"Collapse All",context:{rename:"Rename",delete:"Delete",copyPath:"Copy Path",download:"Download",newFile:"New File",newFolder:"New Folder",refresh:"Refresh",menuLabel:"File context menu",loading:"Loading..."}},Nse={title:"Create New Project",steps:{type:"Type",configure:"Configure",confirm:"Confirm"},step1:{question:"Do you already have a workspace, or would you like to create a new one?",existing:{title:"Existing Workspace",description:"I already have a workspace on my server and just need to add it to the project list"},new:{title:"New Workspace",description:"Create a new workspace, optionally clone from a GitHub repository"},githubClone:{title:"Clone from GitHub",description:"Pick a target folder and clone a repository into it"},subfolder:{title:"Create Subfolder",description:"Pick a parent folder and create a fresh subfolder inside it"}},step2:{existingPath:"Workspace Path",newPath:"Workspace Path",subfolderParentPath:"Parent Folder",subfolderParentHelp:"Path to the folder where the new subfolder will be created",subfolderName:"Subfolder Name",subfolderNameHelp:"A new folder with this name will be created inside the parent above",existingPlaceholder:"/path/to/existing/workspace",newPlaceholder:"/path/to/new/workspace",existingHelp:"Full path to your existing workspace directory",newHelp:"Full path to your workspace directory",githubUrl:"GitHub URL (Optional)",githubPlaceholder:"https://github.com/username/repository",githubHelp:"Optional: provide a GitHub URL to clone a repository",githubAuth:"GitHub Authentication (Optional)",githubAuthHelp:"Only required for private repositories. Public repos can be cloned without authentication.",loadingTokens:"Loading stored tokens...",storedToken:"Stored Token",newToken:"New Token",nonePublic:"None (Public)",selectToken:"Select Token",selectTokenPlaceholder:"-- Select a token --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"This token will be used only for this operation",publicRepoInfo:"Public repositories don't require authentication. You can skip providing a token if cloning a public repo.",noTokensHelp:"No stored tokens available. You can add tokens in Settings → API Keys for easier reuse.",optionalTokenPublic:"GitHub Token (Optional for Public Repos)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (leave empty for public repos)"},step3:{reviewConfig:"Review Your Configuration",workspaceType:"Workspace Type:",existingWorkspace:"Existing Workspace",newWorkspace:"New Workspace",subfolderWorkspace:"New Subfolder",path:"Path:",parentPath:"Parent Path:",subfolderName:"Subfolder Name:",cloneFrom:"Clone From:",authentication:"Authentication:",usingStoredToken:"Using stored token:",usingProvidedToken:"Using provided token",noAuthentication:"No authentication",sshKey:"SSH Key",existingInfo:"The workspace will be added to your project list and will be available for Claude/Cursor sessions.",newWithClone:"The repository will be cloned from this folder.",newEmpty:"The workspace will be added to your project list and will be available for Claude/Cursor sessions.",subfolderInfo:"A new subfolder will be created inside the parent folder and added to your project list.",cloningRepository:"Cloning repository..."},buttons:{cancel:"Cancel",back:"Back",next:"Next",createProject:"Create Project",creating:"Creating...",cloning:"Cloning..."},errors:{selectType:"Please select whether you have an existing workspace or want to create a new one",providePath:"Please provide a workspace path",provideSubfolderName:"Please provide a name for the subfolder",subfolderNameInvalid:"Subfolder name cannot contain path separators or be . / ..",failedToCreate:"Failed to create workspace",failedToCreateFolder:"Failed to create folder"}},Ese={genericTool:"a tool",codes:{generic:{info:{title:"Notification"}},permission:{required:{title:"Action Required",body:"{{toolName}} is waiting for your decision."}},run:{stopped:{title:"Run Stopped",body:"Reason: {{reason}}"},failed:{title:"Run Failed"}},agent:{notification:{title:"Agent Notification"}}}},Tse={title:"Update Available",newVersionReady:"A new version is ready",currentVersion:"Current Version",latestVersion:"Latest Version",latestRelease:"Latest Release",releaseNotesTitle:"Release Notes",releaseNotesSubtitle:"Latest Pixcode changes",whatsNew:"What's New:",viewFullRelease:"View full release",updateProgress:"Update Progress:",manualUpgrade:"Manual upgrade:",npmUpgradeCommand:"npm install -g @pixelbyte-software/pixcode@latest",pixcodeUpgradeCommand:"pixcode update --restart-daemon",manualUpgradeHint:'Or click "Update Now" to run the update automatically.',updateCompleted:"Update completed successfully!",restartServer:"Please restart the server to apply changes.",updateFailed:"Update failed",buttons:{close:"Close",later:"Later",copyCommand:"Copy Command",updateNow:"Update Now",updating:"Updating..."},ariaLabels:{closeModal:"Close version upgrade modal",showSidebar:"Show sidebar",settings:"Settings",updateAvailable:"Update available",closeSidebar:"Close sidebar"}},Ase={title:"Live View",subtitle:"Run this project locally and share it through the active secure tunnel when one is running.",start:"Start",restart:"Restart",stop:"Stop",runnerError:"Runner error",runnerUnavailable:"Runner unavailable",managedRuntimePreparing:"Pixcode will prepare the runtime",managedRuntimeDescription:"Press Start and Pixcode will prepare the required local runtime automatically.",preparingRuntime:"Preparing runtime…",preparingRuntimeDescription:"Pixcode is downloading and installing the runtime locally. This can take a moment on first use.",runnerErrorFallback:"The runner stopped before the preview became available.",detecting:"Detecting project runner…",noRunner:"No runner detected",staticHint:"Static HTML will be served directly when index.html exists.",customCommand:"Custom command",custom:"Custom",customPlaceholder:"npm run dev, python app.py, go run .",environment:"Environment",environmentLocalProcess:"Local process",environmentStatic:"Static files",environmentUnavailable:"Unavailable",statusLabel:"Status",framework:"Framework",command:"Command",upstream:"Upstream",publicTunnel:"Public tunnel",tunnelActive:"Tunnel active",tunnelLocalOnly:"Local only",diagnostics:"Diagnostics",viewport:"Viewport",viewportDesktop:"Desktop",viewportTablet:"Tablet",viewportMobile:"Mobile",viewportWidth:"Width",viewportHeight:"Height",controls:"Runner, viewport and logs",shareLink:"Share link",starting:"Starting",openExternal:"Open externally",externalActive:"Secure tunnel is active; this link can be shared outside your network.",localOnly:"External Access is off; this link is local to this Pixcode server.",frameTitle:"Project Live View",emptyTitle:"Start Live View",emptyDescription:"Pixcode will detect the project stack, start the local web server, and expose it here."},jse={title:"Control room",subtitle:"Production, platform, admin, audit, and self-hosted access for {{target}}",thisServer:"this server",refresh:"Refresh",nav:{overview:"Overview",production:"Production",admin:"Admin",team:"Team",secrets:"Secrets",marketplace:"Marketplace",eval:"Evaluations",usage:"Usage",security:"Security",access:"Access"},overview:{title:"v1.46 launch surface",description:"Every box below is backed by a v1.44-v1.45 API and is now visible from the UI.",latestAuditEvents:"Latest audit events",remoteAccessOptions:"Remote access options"},metrics:{issueRuns:"Issue-to-PR runs",reviewItems:"Review items",subUsers:"Sub-users",collaborators:"Project collaborators",secrets:"Scoped secrets",marketplace:"Marketplace entries",evalRuns:"Evaluation runs",securityAudits:"Security audits"},sections:{production:{title:"Production loop",description:"Start issue-to-PR runs, parse CI failures, review changes, schedule background jobs, and create checkpoints."},admin:{title:"Admin system",description:"Create sub-users, disable accounts, and inspect activity for a single self-hosted Pixcode server."},team:{title:"Project collaborators",description:"Assign partners, workers, reviewers, and viewers per project without making everyone a global admin."},secrets:{title:"Secret vault",description:"Store scoped env secrets and preview what each provider, project, workflow, Telegram, or API run receives."},marketplace:{title:"MCP/plugin marketplace",description:"Register MCP servers, workflow templates, provider adapters, and notification channels with permission review and health."},eval:{title:"Evaluation harness",description:"Create regression suites and compare provider/model runs with pass rate and latency."},usage:{title:"Cost, token, and latency dashboard",description:"Monitor provider/model/workflow usage for demos and operations."},security:{title:"Security audit mode",description:"Run dependency audit, secret scan, permission audit, and agent output leak detection workflows."},access:{title:"Self-hosted access",description:"Use Tailscale when there is no fixed domain, or configure Cloudflare Tunnel/custom domain for a stable public URL."}},panels:{issueToPr:"Issue-to-PR run",ciRepair:"CI repair parser",reviewQueue:"Review queue",schedulerCheckpoints:"Scheduler and checkpoints",createSubUser:"Create sub-user",rolePermissions:"Role permissions",addCollaborator:"Add collaborator",createSecret:"Create secret",scopedEnvPreview:"Scoped env preview",addMarketplaceEntry:"Add marketplace entry",createSuite:"Create suite",recordRun:"Record run",recordUsageEvent:"Record usage event",createAuditRun:"Create audit run",auditLog:"Audit log",remoteAccessSetup:"Remote access setup"},lists:{recentJobs:"Recent jobs",recentCheckpoints:"Recent checkpoints",subUsers:"Sub-users",collaborators:"Collaborators",includedEnvNames:"Included env names",vaultEntries:"Vault entries",marketplaceEntries:"Marketplace entries",suites:"Suites",runs:"Runs",auditRuns:"Audit runs",configuredAccessPaths:"Configured access paths"},buttons:{queueRun:"Queue run",parseFailure:"Parse failure",createReviewItem:"Create review item",scheduleJob:"Schedule job",createCheckpoint:"Create checkpoint",createUser:"Create user",disable:"Disable",enable:"Enable",addCollaborator:"Add collaborator",storeSecret:"Store secret",previewEnv:"Preview env",saveEntry:"Save entry",markHealthy:"Mark healthy",createSuite:"Create suite",recordRun:"Record run",recordUsage:"Record usage",createAudit:"Create audit",exportJson:"Export JSON",exportCsv:"Export CSV",saveAccessPath:"Save access path",checkUrl:"Check URL",checkTailscale:"Check Tailscale"},placeholders:{githubIssueUrl:"GitHub issue URL",manualTitle:"Manual title fallback",model:"Model",baseBranch:"Base branch",ciLog:"Paste failing CI, lint, typecheck, or build output",reviewTitle:"Review title",notes:"Notes",changedFiles:"Changed files, one per line",jobName:"Job name",cronExpression:"Cron or watch expression",checkpointReason:"Checkpoint reason",backgroundPrompt:"Background agent prompt",checkpointFiles:"Checkpoint changed files, one per line",usernameEmail:"Username or email",temporaryPassword:"Temporary password",userEmailUsername:"User email or username",secretName:"Secret name",envName:"ENV_NAME",secretTarget:"Target project/provider/workflow",secretValue:"Secret value",workflowId:"Workflow id",name:"Name",pluginSource:"Source package or repository",installCommand:"Install command",permissionScopes:"Permission scopes, one per line",suiteName:"Suite name",description:"Description",firstTaskTitle:"First task title",acceptanceCriteria:"Acceptance criteria, one per line",suiteId:"Suite id",latencyMs:"Latency ms",passedCount:"Passed count",failedCount:"Failed count",workflow:"Workflow",inputTokens:"Input tokens",outputTokens:"Output tokens",costUsd:"Cost USD",optionalFindingTitle:"Optional finding title",auditFilter:"Filter audit log by user, project, event, or file",label:"Label",url:"URL",targetPort:"Target port"},labels:{project:"project",path:"path",providerModel:"provider/model",branch:"branch",failedCommands:"Failed commands",files:"Files",lastActive:"Last active",role:"role",tasks:"tasks",pass:"pass",health:"Health",reachable:"reachable",installed:"installed",loggedIn:"logged in"},columns:{provider:"Provider",model:"Model",workflow:"Workflow",runs:"Runs",tokens:"Tokens",cost:"Cost",latency:"Latency",errorRate:"Error rate"},fallback:{selectedProject:"selected project",projectPath:"project path",noneDetected:"none detected",noUrl:"No URL",global:"global",noSource:"No source",regressionSuite:"Regression suite",demoTask:"Demo task",provider:"provider",reviewRequired:"Review required.",notAvailable:"not available"},capabilities:{partner:"can approve actions, manage secrets, and use shell",projectScoped:"project-scoped access only"},teamAccess:{title:"How collaborators get access",stepUsers:"Create a sub-user",stepUsersDescription:"Create the person in Admin system with a global role such as member, viewer, project_worker, or project_partner.",stepRole:"Assign project role",stepRoleDescription:"Add the same user as a project collaborator so they only see and operate on the projects you choose.",stepLink:"Share an access path",stepLinkDescription:"Give them the Tailscale, Cloudflare Tunnel, custom domain, or LAN URL configured in Self-hosted access.",paths:"Available access links"},badges:{public:"public",private:"private"},empty:{noAuditEvents:"No audit events yet.",noRemoteAccessConfigs:"No remote access configs yet.",noReviewItems:"No review items yet.",noRecentJobs:"No recent jobs yet.",noRecentCheckpoints:"No recent checkpoints yet.",noSubUsers:"No sub-users yet.",noCollaborators:"No project collaborators yet.",noAccessPaths:"No access paths configured yet.",noIncludedEnvNames:"No included env names yet.",noSecrets:"No secrets yet.",noMarketplaceEntries:"No marketplace entries yet.",noSuites:"No suites yet.",noRuns:"No runs yet.",usageSummary:"Usage appears here after provider or workflow events are recorded.",noSecurityAudits:"No security audits yet.",noAuditMatches:"No audit entries match the current filter."}},Ise={title:"VS Code Workbench",noProject:"No project selected",activity:{explorer:"Explorer",projects:"Projects",sourceControl:"Source Control",terminal:"Terminal",showPanel:"Show left panel",hidePanel:"Hide left panel"},panels:{explorer:"Explorer",projects:"Projects",sourceControl:"Source Control",terminal:"Terminal",editor:"Editor",cli:"CLI",rightTerminal:"Terminal"},editor:{emptyTitle:"Open a file from Explorer",closeTab:"Close {{file}}",scrollLeft:"Scroll tabs left",scrollRight:"Scroll tabs right",moreActions:"More tab actions",closeSplit:"Close split editor",context:{close:"Close",closeAll:"Close All",copyPath:"Copy Path",splitRight:"Split Right",splitMoveRight:"Split and Move Right"}},resize:{left:"Resize left panel",right:"Resize CLI panel"},menu:{openProject:"Open Project...",cloneFromGithub:"Clone Repository...",newChat:"New Chat",openProjects:"Open Projects"},projects:{openProject:"Open Project",cloneFromGithub:"Clone",directoryList:"Directories",refresh:"Refresh projects",emptyTitle:"No project directories yet",emptyDescription:"Open a local folder or clone a repository to start.",selected:"Selected",startChat:"Chat",fileCount:"{{formattedCount}} files",fileCountPending:"Files pending",startTitle:"Start a Pixcode workspace",startDescription:"Pick a folder and Pixcode will bind the explorer, terminal, and chat history to that workspace.",workHere:"Work in this folder"},workspace:{empty:"Open a project to create Workspace 1.",openFirst:"Open a workspace",add:"Add workspace",scrollLeft:"Scroll workspaces left",scrollRight:"Scroll workspaces right",close:"Close {{name}}",closeAction:"Close workspace",closeOthers:"Close others",closeAll:"Close all",rename:"Rename",star:"Star",unstar:"Unstar",toggleStar:"Star {{name}}",moreActions:"Workspace actions"},cli:{projectScoped:"Project-scoped CLI terminal",chooseTitle:"Start a CLI terminal",chooseDescription:"Choose a CLI, then start a full-height terminal.",startSelected:"Start {{provider}}",newSession:"New CLI session",history:"History",noHistory:"No sessions for this project yet.",projectHistory:"Project history",checking:"Checking...",ready:"Ready",notInstalled:"Not installed",installing:"Installing...",updateAvailable:"Update {{version}}",installProvider:"Install {{provider}}",updateProvider:"Update {{provider}}",manualInstall:"This CLI needs manual installation.",installNoJob:"Install did not return a job id.",installFailed:"Install failed.",installStreamLost:"Install stream closed early. The install may still be running.",provider:"Provider",installRunning:"is installing",installDone:"is ready",installError:"needs attention",showPanel:"Show CLI panel",hidePanel:"Hide CLI panel",close:"Close terminal"},terminal:{title:"Terminal",close:"Close terminal"},hermes:{title:"Hermes Agent",installTitle:"Install Hermes Agent",description:"Project-scoped agent terminal. Installs Hermes when missing, then opens it in this workspace.",start:"Start Hermes",install:"Install",newSession:"New Hermes session",history:"Hermes history",connect:"Connect Hermes Agent",ready:"Ready",installRunning:"Installing Hermes through Pixcode API...",installDone:"Hermes installed and Pixcode MCP configured.",installError:"Hermes install failed.",installReady:"Ready to install Hermes.",installWaiting:"Waiting for Hermes install logs...",retryInstall:"Retry install",installFailed:"Hermes install failed.",installStreamLost:"Hermes install stream closed early. The install may still be running."}},_se={buttons:hse,tabs:fse,status:gse,messages:bse,navigation:xse,common:yse,time:vse,fileOperations:wse,mainContent:kse,orchestration:Sse,fileTree:Cse,projectWizard:Nse,notifications:Ese,versionUpdate:Tse,liveView:Ase,controlRoom:jse,vscodeWorkbench:Ise},Rse="Settings",Lse={account:"Account",permissions:"Permissions",mcpServers:"MCP Servers",pluginsMcp:"Plugins / MCP",configuration:"Configuration",appearance:"Appearance"},Pse={title:"Account",language:"Language",languageLabel:"Display Language",languageDescription:"Choose your preferred language for the interface",username:"Username",email:"Email",profile:"Profile",changePassword:"Change Password"},Dse={title:"MCP Servers",addServer:"Add Server",editServer:"Edit Server",deleteServer:"Delete Server",serverName:"Server Name",serverType:"Server Type",config:"Configuration",testConnection:"Test Connection",status:"Status",connected:"Connected",disconnected:"Disconnected",scope:{label:"Scope",user:"User",project:"Project"}},Ose={title:"Appearance",theme:"Theme",codeEditor:"Code Editor",editorTheme:"Editor Theme",wordWrap:"Word Wrap",showMinimap:"Show Minimap",lineNumbers:"Line Numbers",fontSize:"Font Size"},Mse={saveChanges:"Save Changes",resetToDefaults:"Reset to Defaults",cancelChanges:"Cancel Changes"},Fse={title:"Quick Settings",sections:{appearance:"Appearance",toolDisplay:"Tool Display",viewOptions:"View Options",inputSettings:"Input Settings",changeAwareness:"Command Center"},darkMode:"Dark Mode",autoExpandTools:"Auto-expand tools",showRawParameters:"Show raw parameters",showThinking:"Show thinking",autoScrollToBottom:"Auto-scroll to bottom",sendByCtrlEnter:"Send by Ctrl+Enter",sendByCtrlEnterDescription:"When enabled, pressing Ctrl+Enter will send the message instead of just Enter. This is useful for IME users to avoid accidental sends.",changeAwareness:"Command Center",changedFiles:{title:"Changed files",description:"Tracks local file changes and opens the Files panel when a new change appears.",noProject:"Select a project to track local changes.",refresh:"Refresh changed files",empty:"No local changes detected",disabled:"Enable Command Center to watch local changes.",more:"+{{count}} more files",lastChecked:"Checked {{value}}",guideTitle:"Right panel guide",guideFiles:"Changed files glow green in Files.",guidePanel:"New changes appear beside the active chat.",status:{M:"M",A:"A",D:"D",U:"U"}},dragHandle:{dragging:"Dragging handle",closePanel:"Close settings panel",openPanel:"Open settings panel",draggingStatus:"Dragging...",toggleAndMove:"Click to toggle, drag to move"}},zse={title:"Terminal Shortcuts",sectionKeys:"Keys",sectionNavigation:"Navigation",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"Arrow Up",arrowDown:"Arrow Down",scrollDown:"Scroll Down",handle:{closePanel:"Close shortcuts panel",openPanel:"Open shortcuts panel"}},Bse={label:"Settings",agents:"Agents",hermes:"Hermes Agent",appearance:"Appearance",git:"Git",apiTokens:"API & Tokens",notifications:"Notifications",plugins:"Plugins",mobile:"Use from Mobile",telegram:"Telegram",diagnostics:"Diagnostics",about:"About",access:"Access"},Use={title:"Use from Mobile",description:"Scan a QR code with your phone to open Pixcode on any device in the same network.",refresh:"Refresh",copy:"Copy",copied:"Copied!",loading:"Detecting network addresses…",noEndpoints:"No LAN addresses were detected. Make sure your device is connected to a network.",error:"Could not load network endpoints.",hostLabel:"Host",portLabel:"Port",steps:{sameNetwork:"Connect your phone to the same Wi-Fi network as this computer.",scan:"Open the camera app and scan one of the QR codes below.",login:"Sign in with your Pixcode credentials the first time."},external:{title:"External Access",description:"Expose Pixcode beyond your local network so you can reach it from the internet.",upnpTitle:"Router port mapping (UPnP)",upnpDescription:"One-click port forwarding via your router. Works on most home routers; fails silently on CGNAT or enterprise networks.",upnpEnable:"Enable UPnP",upnpDisable:"Disable UPnP",upnpEnabled:"UPnP mapping active",upnpUnsupported:"UPnP is not available on this network.",tunnelTitle:"Secure tunnel",tunnelDescription:"If UPnP is unavailable, install cloudflared or ngrok and start a tunnel — we'll auto-detect and show the QR here.",tunnelStart:"Start tunnel",tunnelStop:"Stop tunnel",tunnelRunning:"Tunnel running",tunnelUnavailable:"No tunnel binary found on this machine.",externalUrl:"External URL"}},$se={title:"Telegram",description:"Receive task completion notifications and chat with your agents from Telegram.",comingSoon:"Telegram integration is being prepared.",botToken:"Bot Token",botTokenPlaceholder:"123456:ABC-DEF…",botTokenHelp:"Create a bot with @BotFather and paste the token here.",saveToken:"Save & Start Bot",saving:"Saving…",botRunning:"Bot running as @{{username}}",botStopped:"Bot stopped",stopBot:"Stop Bot",removeToken:"Remove Token",pairing:{title:"Pair with your Telegram account",description:"Message your bot, then enter this 6-digit code inside the chat. The code refreshes every 10 minutes.",code:"Pairing Code",regenerate:"Generate new code",verified:"Paired with Telegram account",notPaired:"No Telegram account paired yet."},linkedAccount:{title:"Paired Account",username:"@{{username}}",language:"Replies in {{language}}",unpair:"Unpair"},notifications:{title:"Notifications",description:"Send agent completion and error events to your Telegram chat.",enabled:"Enabled",disabled:"Disabled"},bridge:{title:"Chat Bridge",description:"Messages you send to the bot become prompts for your most recent session. Replies come back to Telegram.",enabled:"Enabled",disabled:"Disabled"},control:{title:"Remote Control",description:"Use Telegram as a full Pixcode control surface for agents, orchestration, provider setup, and run status.",enabled:"Enable Telegram control",enabledDescription:"When enabled, paired Telegram messages can start agent and orchestration work on the selected project.",progressMode:"Progress mode",progressModeDescription:"Choose how much run output Telegram should send back.",progressModes:{final:"Final answer only",steps:"Important steps and final answer",all:"All visible step changes"},selectedProject:"Selected project",selectedProvider:"Selected provider",selectedModel:"Selected model",selectedWorkflow:"Selected workflow"},errors:{invalidToken:"Telegram rejected this bot token.",networkError:"Could not reach Telegram servers."}},Hse={title:"Notifications",description:"Control which notification events you receive.",webPush:{title:"Web Push Notifications",enable:"Enable Push Notifications",disable:"Disable Push Notifications",enabled:"Push notifications are enabled",loading:"Updating...",unsupported:"Push notifications are not supported in this browser.",denied:"Push notifications are blocked. Please allow them in your browser settings."},events:{title:"Event Types",actionRequired:"Action required",stop:"Run stopped",error:"Run failed",updates:"App and CLI updates"}},Gse={darkMode:{label:"Dark Mode",description:"Toggle between light and dark themes"},colorTheme:{title:"Color theme",palette:{label:"Accent palette",description:"Choose the product accent used by buttons, focus rings, navigation, and active states."},custom:{label:"Custom light/dark colors",description:"Pick separate accent colors for light and dark mode. Select Custom above to use them.",light:"Light",dark:"Dark"}},projectSorting:{label:"Project Sorting",description:"How projects are ordered in the sidebar",alphabetical:"Alphabetical",recentActivity:"Recent Activity"},codeEditor:{title:"Code Editor",theme:{label:"Editor Theme",description:"Default theme for the code editor"},wordWrap:{label:"Word Wrap",description:"Enable word wrapping by default in the editor"},showMinimap:{label:"Show Minimap",description:"Display a minimap for easier navigation in diff view"},lineNumbers:{label:"Show Line Numbers",description:"Display line numbers in the editor"},fontSize:{label:"Font Size",description:"Editor font size in pixels"}}},Vse={title:{add:"Add MCP Server",edit:"Edit MCP Server"},importMode:{form:"Form Input",json:"JSON Import"},scope:{label:"Scope",userGlobal:"User (Global)",projectLocal:"Project (Local)",userDescription:"User scope: Available across all projects on your machine",projectDescription:"Local scope: Only available in the selected project",cannotChange:"Scope cannot be changed when editing an existing server"},fields:{serverName:"Server Name",transportType:"Transport Type",command:"Command",arguments:"Arguments (one per line)",jsonConfig:"JSON Configuration",url:"URL",envVars:"Environment Variables (KEY=value, one per line)",headers:"Headers (KEY=value, one per line)",selectProject:"Select a project..."},placeholders:{serverName:"my-server"},validation:{missingType:"Missing required field: type",stdioRequiresCommand:"stdio type requires a command field",httpRequiresUrl:"{{type}} type requires a url field",invalidJson:"Invalid JSON format",jsonHelp:"Paste your MCP server configuration in JSON format. Example formats:",jsonExampleStdio:'• stdio: {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse: {"type":"http","url":"https://api.example.com/mcp"}'},configDetails:"Configuration Details (from {{configFile}})",projectPath:"Path: {{path}}",actions:{cancel:"Cancel",saving:"Saving...",addServer:"Add Server",updateServer:"Update Server"}},Wse={success:"Settings saved successfully!",error:"Failed to save settings",saving:"Saving..."},qse={save:"Save Settings",cancel:"Cancel"},Kse={title:"Git Configuration",description:"Configure your git identity for commits. These settings will be applied globally via git config --global",name:{label:"Git Name",help:"Your name for git commits"},email:{label:"Git Email",help:"Your email for git commits"},actions:{save:"Save Configuration",saving:"Saving..."},status:{success:"Saved successfully"}},Yse={title:"API Keys",description:"Generate API keys to access the external API from other applications.",newKey:{alertTitle:"⚠️ Save Your API Key",alertMessage:"This is the only time you'll see this key. Store it securely.",iveSavedIt:"I've saved it"},form:{placeholder:"API Key Name (e.g., Production Server)",createButton:"Create",cancelButton:"Cancel"},newButton:"New API Key",empty:"No API keys created yet.",list:{created:"Created:",lastUsed:"Last used:"},confirmDelete:"Are you sure you want to delete this API key?",status:{active:"Active",inactive:"Inactive"},github:{title:"GitHub Tokens",description:"Add GitHub Personal Access Tokens to clone private repositories via the external API.",descriptionAlt:"Add GitHub Personal Access Tokens to clone private repositories. You can also pass tokens directly in API requests without storing them.",addButton:"Add Token",form:{namePlaceholder:"Token Name (e.g., Personal Repos)",tokenPlaceholder:"GitHub Personal Access Token (ghp_...)",descriptionPlaceholder:"Description (optional)",addButton:"Add Token",cancelButton:"Cancel",howToCreate:"How to create a GitHub Personal Access Token →"},empty:"No GitHub tokens added yet.",added:"Added:",confirmDelete:"Are you sure you want to delete this GitHub token?"},apiDocsLink:"API Documentation",documentation:{title:"External API Documentation",description:"Learn how to use the external API to trigger Claude/Cursor sessions from your applications.",viewLink:"View API Documentation →"},loading:"Loading...",version:{updateAvailable:"Update available: v{{version}}"}},Zse={status:{title:"CLI status",notChecked:"Not checked yet",lastChecked:"Last checked: {{value}}",updatesFound:"{{count}} update available",refresh:"Refresh CLI status"},config:{blurb:"View or edit the files the {{name}} CLI reads on startup. Saves write directly to your home directory.",refresh:"Refresh",save:"Save",revert:"Revert",saved:"Saved",loading:"Loading…",notCreated:"new",readonly:"read-only",noFiles:"No config files are registered for this agent yet."},cliVersion:{title:"CLI version",installed:"Installed: {{version}}",unknownInstalled:"Installed version unknown",latest:"Latest: {{version}}",checkedAt:"Checked: {{value}}",cached:"cached",updateAvailable:"Update available",refresh:"Refresh",skipped:{external_installer:"External installer",installed_version_unavailable:"Installed version unavailable",latest_version_unavailable:"Latest version unavailable",not_installed:"Not installed"}},authStatus:{checking:"Checking...",connected:"Connected",notConnected:"Not connected",disconnected:"Disconnected",checkingAuth:"Checking authentication status...",loggedInAs:"Logged in as {{email}}",authenticatedUser:"authenticated user"},account:{claude:{description:"Anthropic Claude AI assistant"},cursor:{description:"Cursor AI-powered code editor"},codex:{description:"OpenAI Codex AI assistant"},gemini:{description:"Google Gemini AI assistant"},qwen:{description:"Alibaba Qwen Code CLI (Gemini CLI fork)"},opencode:{description:"Multi-provider terminal coding agent — Claude, OpenAI, Gemini, or local models"}},connectionStatus:"Connection Status",login:{title:"Login",reAuthenticate:"Re-authenticate",description:"Sign in to your {{agent}} account to enable AI features",reAuthDescription:"Sign in with a different account or refresh credentials",button:"Login",reLoginButton:"Re-login"},error:"Error: {{error}}"},Xse={title:"Permission Settings",skipPermissions:{label:"Skip permission prompts (use with caution)",claudeDescription:"Equivalent to --dangerously-skip-permissions flag",cursorDescription:"Equivalent to -f flag in Cursor CLI",opencodeDescription:"Equivalent to --dangerously-skip-permissions flag in OpenCode"},allowedTools:{title:"Allowed Tools",description:"Tools that are automatically allowed without prompting for permission",placeholder:'e.g., "Bash(git log:*)" or "Write"',quickAdd:"Quick add common tools:",empty:"No allowed tools configured"},blockedTools:{title:"Blocked Tools",description:"Tools that are automatically blocked without prompting for permission",placeholder:'e.g., "Bash(rm:*)"',empty:"No blocked tools configured"},allowedCommands:{title:"Allowed Shell Commands",description:"Shell commands that are automatically allowed without prompting",placeholder:'e.g., "Shell(ls)" or "Shell(git status)"',quickAdd:"Quick add common commands:",empty:"No allowed commands configured"},blockedCommands:{title:"Blocked Shell Commands",description:"Shell commands that are automatically blocked",placeholder:'e.g., "Shell(rm -rf)" or "Shell(sudo)"',empty:"No blocked commands configured"},toolExamples:{title:"Tool Pattern Examples:",bashGitLog:"- Allow all git log commands",bashGitDiff:"- Allow all git diff commands",write:"- Allow all Write tool usage",bashRm:"- Block all rm commands (dangerous)"},shellExamples:{title:"Shell Command Examples:",ls:"- Allow ls command",gitStatus:"- Allow git status",npmInstall:"- Allow npm install",rmRf:"- Block recursive delete"},opencodeAllowed:{title:"Allowed Bash Patterns",description:"Bash command patterns OpenCode auto-approves without prompting",placeholder:'e.g., "git *" or "npm test"',quickAdd:"Quick add common patterns:",empty:"No allowed patterns configured"},opencodeBlocked:{title:"Blocked Bash Patterns",description:"Bash command patterns OpenCode always denies",placeholder:'e.g., "rm -rf *" or "sudo *"',empty:"No blocked patterns configured"},opencodeExamples:{title:"Pattern Examples:",gitAll:"- Allow all git commands",gitPush:"- Block git push specifically",rmRf:"- Block recursive delete",npm:"- Allow all npm commands"},codex:{permissionMode:"Permission Mode",description:"Controls how Codex handles file modifications and command execution",modes:{default:{title:"Default",description:"Only trusted commands (ls, cat, grep, git status, etc.) run automatically. Other commands are skipped. Can write to workspace."},acceptEdits:{title:"Accept Edits",description:"All commands run automatically within the workspace. Full auto mode with sandboxed execution."},bypassPermissions:{title:"Bypass Permissions",description:"Full system access with no restrictions. All commands run automatically with full disk and network access. Use with caution."}},technicalDetails:"Technical details",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted. Trusted commands: cat, cd, grep, head, ls, pwd, tail, git status/log/diff/show, find (without -exec), etc.",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never. All commands auto-execute within project directory.",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never. Full system access, use only in trusted environments.",overrideNote:"You can override this per-session using the mode button in the chat interface."}},actions:{add:"Add"}},Jse={title:"MCP Servers",description:{claude:"Model Context Protocol servers provide additional tools and data sources to Claude",cursor:"Model Context Protocol servers provide additional tools and data sources to Cursor",codex:"Model Context Protocol servers provide additional tools and data sources to Codex"},addButton:"Add MCP Server",empty:"No MCP servers configured",serverType:"Type",scope:{local:"local",user:"user"},config:{command:"Command",url:"URL",args:"Args",environment:"Environment"},tools:{title:"Tools",count:"({{count}}):",more:"+{{count}} more"},actions:{edit:"Edit server",delete:"Delete server"},help:{title:"About Codex MCP",description:"Codex supports stdio-based MCP servers. You can add servers that extend Codex's capabilities with additional tools and resources."}},Qse={updateCheckFrequency:"Update check frequency",updateCheckFrequencyHint:"Pixcode caches GitHub release checks locally so shared IPs do not hit GitHub rate limits.",updateCheckFrequencyOptions:{"30m":"Every 30 minutes","6h":"Every 6 hours","12h":"Every 12 hours","24h":"Daily","7d":"Weekly",off:"Manual only"},checkForUpdate:"Check for updates",checkingForUpdate:"Checking...",updateFound:"Update found",upToDate:"Up to date",lastChecked:"Last checked {{when}}",notCheckedYet:"Update check has not completed yet",checkFailed:"check failed or delayed by rate limit"},eoe={title:"Plugins",description:"Extend the interface with custom plugins. Install from git or drop a folder in ~/.pixcode/plugins/",installPlaceholder:"https://github.com/user/my-plugin",installButton:"Install",installing:"Installing…",securityWarning:"Only install plugins whose source code you have reviewed or from authors you trust.",scanningPlugins:"Scanning plugins…",noPluginsInstalled:"No plugins installed",pullLatest:"Pull latest from git",noGitRemote:"No git remote — update not available",uninstallPlugin:"Uninstall plugin",confirmUninstall:"Click again to confirm",confirmUninstallMessage:"Remove {{name}}? This cannot be undone.",cancel:"Cancel",remove:"Remove",updateFailed:"Update failed",installFailed:"Installation failed",uninstallFailed:"Uninstall failed",toggleFailed:"Toggle failed",starterPluginLabel:"Starter Plugin",starter:"Starter",docs:"Docs",starterPlugin:{name:"Project Stats",badge:"starter",description:"File counts, lines of code, file-type breakdown, and recent activity for your project.",install:"Install"},terminalPlugin:{name:"Terminal",badge:"official",description:"Integrated terminal with full shell access directly within the interface.",install:"Install"},morePlugins:"More",enable:"Enable",disable:"Disable",installAriaLabel:"Plugin git repository URL",tab:"tab",runningStatus:"running"},toe={title:"Access",description:"Choose how people reach this self-hosted Pixcode server. Start with the same network, then use a secure tunnel, Tailscale, or your own domain when you need remote access.",refresh:"Refresh",copy:"Copy",copied:"Copied",save:"Save access path",check:"Check URL",qrAlt:"QR for {{url}}",guide:{title:"Pick the connection path first",description:"You do not need to know networking terms. Choose the situation that matches the person connecting, copy the shown link, or scan the QR code from their phone."},options:{sameNetwork:{title:"Same Wi-Fi/LAN",description:"Use this when the device is on the same router or office network as the Pixcode server."},secureTunnel:{title:"Temporary public link",description:"Start a Cloudflare/ngrok tunnel and Pixcode shows a public URL plus QR automatically."},tailscale:{title:"Private team link",description:"Use Tailscale when you want private access without a public domain or router setup."},customDomain:{title:"Own domain",description:"Use this when you already have HTTPS, a reverse proxy, or a Cloudflare Tunnel hostname."}},status:{ready:"Ready",detecting:"Detecting",guided:"Guided",configured:"Configured",optional:"Optional"},links:{title:"Available links",description:"Copy the correct URL for the device or teammate that needs to connect.",local:"Local",tailscale:"Tailscale private link",empty:"No access links detected yet."},local:{title:"Same network access",description:"Best first test: connect from the same Wi-Fi or LAN. Scan a QR code on the phone, or copy the link for a teammate on the same network.",thisDevice:"This computer only",loading:"Detecting same-network links...",empty:"No LAN link detected. Make sure the server is connected to a network and refresh.",saveLabel:"Same network access",save:"Save this LAN link"},tunnel:{title:"Secure tunnel",description:"For remote access without a fixed domain, Pixcode can start cloudflared or ngrok and show the public URL here.",secureLink:"Public link and QR",help:"Click start. If cloudflared or ngrok is installed, Pixcode creates a temporary HTTPS address and QR code automatically.",running:"Tunnel running",start:"Start tunnel",stop:"Stop tunnel",save:"Save this tunnel URL",saveLabel:"Secure tunnel access",qrLabel:"secure tunnel",installTitle:"Tunnel setup needed",installNeeded:"Install cloudflared or ngrok first, then press Start tunnel again."},tailscale:{title:"Tailscale private access",description:"Tailscale is an optional private network app. Install it on the server and user devices, sign in to the same team, then Pixcode can detect a private URL.",save:"Save this Tailscale URL",saveLabel:"Tailscale private access",openInstall:"Open Tailscale install",steps:{installServer:"Install Tailscale on the computer or server running Pixcode.",installUserDevice:"Install Tailscale on the phone, laptop, or teammate device that will open Pixcode.",login:"Sign in to the same Tailscale account or team on both devices.",refresh:"Return here and press Refresh; Pixcode will show the private URL when it is ready."}},advanced:{title:"Advanced: stable domain",description:"Use this when you already have a LAN URL, Tailscale URL, Cloudflare Tunnel hostname, or custom HTTPS domain that should be saved for users.",badge:"Advanced"},setup:{title:"Stable access path",description:"Save the URL your users will use. This can be a LAN address, Tailscale URL, Cloudflare Tunnel URL, or custom domain."},modes:{lan:"LAN",tailscale:"Tailscale",cloudflare_tunnel:"Cloudflare Tunnel",custom_domain:"Custom domain"},fields:{label:"Label",url:"URL",port:"Target port"},health:{reachable:"Pixcode is reachable",unreachable:"Pixcode is not reachable"},configured:{title:"Configured access paths",description:"These paths are available to admins, project partners, and project workers according to their role.",empty:"No configured access paths yet.",noUrl:"No URL",public:"public",private:"private"},team:{title:"How users connect",description:"Create the user in the Admin system, assign their project role in Control Room, then share one of these Access URLs. They do not need to be global admins to reach their assigned project."}},roe={title:"Hermes Agent",description:"Manage Hermes Agent as a Pixcode-controlled project terminal with MCP access to projects, provider status, and visible CLI launches.",statusTitle:"Install status",statusFailed:"Unable to check Hermes Agent.",ready:"Ready",notInstalled:"Not installed",start:"Start Hermes",install:"Install",repair:"Repair command",refresh:"Refresh",gatewayTitle:"REST API gateway",gatewayStatusFailed:"Unable to check Hermes REST gateway.",gatewayStartFailed:"Hermes REST gateway could not be started.",gatewayStopFailed:"Hermes REST gateway could not be stopped.",gatewayProbeFailed:"Hermes REST probe failed.",gatewayRunning:"REST gateway running",gatewayStopped:"REST gateway stopped",gatewayStart:"Start REST",gatewayProbe:"Test REST",gatewayStop:"Stop",gatewayProbeOk:"REST probe passed: health, capabilities, and models responded.",commandsTitle:"Hermes CLI settings",commandsDescription:"Open the real Hermes terminal wizards from Pixcode. Use Model and provider to connect Codex, OpenRouter, Anthropic, Gemini, and other providers.",commandsInstallFirst:"Install Hermes before opening CLI settings.",commands:{model:{title:"Model and provider",description:"Open the interactive provider/model wizard for OAuth, API keys, and default model selection."},auth:{title:"Credentials",description:"Manage OAuth sessions and API key pools for configured providers."},tools:{title:"Tools",description:"Choose which Hermes toolsets are enabled, including Pixcode MCP access."},doctor:{title:"Doctor",description:"Diagnose Hermes config, dependency, and platform problems in a terminal."},status:{title:"Status",description:"Show the current provider, auth, platform, and redacted setup summary."},lsp:{title:"LSP status",description:"Check Hermes language server integration for semantic diagnostics."},skills:{title:"Skills",description:"Browse, install, audit, and configure Hermes skills from the CLI."},sessions:{title:"Sessions",description:"Browse, export, rename, prune, or delete Hermes sessions."}},pixcodeControlTitle:"Pixcode control",pixcodeControlDescription:"Pixcode configures the Hermes MCP server before launch, so Hermes can inspect workspaces and open provider terminals inside the visible Pixcode UI when you ask it to."},noe={title:Rse,tabs:Lse,account:Pse,mcp:Dse,appearance:Ose,actions:Mse,quickSettings:Fse,terminalShortcuts:zse,mainTabs:Bse,mobile:Use,telegram:$se,notifications:Hse,appearanceSettings:Gse,mcpForm:Vse,saveStatus:Wse,footerActions:qse,git:Kse,apiKeys:Yse,agents:Zse,permissions:Xse,mcpServers:Jse,about:Qse,pluginSettings:eoe,access:toe,hermes:roe},aoe={title:"Welcome Back",description:"Sign in to your Pixcode self-hosted account",username:"Username",password:"Password",submit:"Sign In",loading:"Signing in...",errors:{invalidCredentials:"Invalid username or password",requiredFields:"Please fill in all fields",networkError:"Network error. Please try again."},placeholders:{username:"Enter your username",password:"Enter your password"}},ioe={title:"Create Account",username:"Username",password:"Password",confirmPassword:"Confirm Password",submit:"Create Account",loading:"Creating account...",errors:{passwordMismatch:"Passwords do not match",usernameTaken:"Username is already taken",weakPassword:"Password is too weak"}},soe={title:"Sign Out",confirm:"Are you sure you want to sign out?",button:"Sign Out"},ooe={login:aoe,register:ioe,logout:soe},loe={title:"Projects",newProject:"New Project",deleteProject:"Remove Project",renameProject:"Rename Project",noProjects:"No projects found",loadingProjects:"Loading projects...",searchPlaceholder:"Search projects...",projectNamePlaceholder:"Project name",starred:"Starred",all:"All",untitledSession:"Untitled Session",newSession:"New Session",codexSession:"Codex Session",fetchingProjects:"Fetching your Claude projects and sessions",projects:"projects",detectedFromHistory:"Detected from history",noMatchingProjects:"No matching projects",tryDifferentSearch:"Try adjusting your search term",runClaudeCli:"Run Claude CLI in a project directory to get started"},coe={title:"Pixcode",subtitle:"AI coding assistant interface"},doe={title:"Sessions",newSession:"New Session",deleteSession:"Delete Session",renameSession:"Rename Session",noSessions:"No sessions yet",loadingSessions:"Loading sessions...",unnamed:"Unnamed",loading:"Loading...",showMore:"Show more sessions",startToSee:"Start a new session to see it here."},uoe={section:"Orchestration",fallbackTitle:"Orchestration run"},poe={flat:"Recent",grouped:"By project"},moe={viewEnvironments:"View Environments",hideSidebar:"Hide sidebar",createProject:"Create new project",refresh:"Refresh projects and sessions (Ctrl+R)",renameProject:"Rename project (F2)",deleteProject:"Remove project from sidebar (Delete)",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",editSessionName:"Manually edit session name",deleteSession:"Delete this session permanently",sessionActions:"Session actions",historyView:"History view",historyViewFlat:"Recent conversations",historyViewGrouped:"Grouped by project",save:"Save",cancel:"Cancel",clearSearch:"Clear search"},hoe={chat:"Chat",files:"Files",git:"Git",terminal:"Terminal",tasks:"Tasks"},foe={refresh:"Refresh",settings:"Settings",collapseAll:"Collapse All",expandAll:"Expand All",cancel:"Cancel",save:"Save",delete:"Delete",rename:"Rename",starSession:"Star",unstarSession:"Remove star",joinCommunity:"Join Community",reportIssue:"Report Issue",starOnGithub:"Star on GitHub",controlRoom:"Control Room",controlRoomDescription:"Admin, access, runs"},goe={openSource:"Open Source"},boe={active:"Active",inactive:"Inactive",thinking:"Thinking...",error:"Error",aborted:"Aborted",unknown:"Unknown"},xoe={justNow:"Just now",oneMinuteAgo:"1 min ago",minutesAgo:"{{count}} mins ago",oneHourAgo:"1 hour ago",hoursAgo:"{{count}} hours ago",oneDayAgo:"1 day ago",daysAgo:"{{count}} days ago",buckets:{today:"Today",yesterday:"Yesterday",thisWeek:"Previous 7 days",thisMonth:"Previous 30 days",older:"Older"}},yoe={deleteConfirm:"Are you sure you want to delete this?",renameSuccess:"Renamed successfully",deleteSuccess:"Deleted successfully",errorOccurred:"An error occurred",deleteSessionConfirm:"Are you sure you want to delete this session? This action cannot be undone.",deleteProjectConfirm:"Remove this project from the sidebar? Your project files, memories, and session data will not be deleted.",enterProjectPath:"Please enter a project path",deleteSessionFailed:"Failed to delete session. Please try again.",deleteSessionError:"Error deleting session. Please try again.",renameSessionFailed:"Failed to rename session. Please try again.",renameSessionError:"Error renaming session. Please try again.",deleteProjectFailed:"Failed to remove project. Please try again.",deleteProjectError:"Error removing project. Please try again.",createProjectFailed:"Failed to create project. Please try again.",createProjectError:"Error creating project. Please try again."},voe={updateAvailable:"Update available"},woe={modeProjects:"Projects",modeConversations:"Conversations",conversationsPlaceholder:"Search in conversations...",searching:"Searching...",noResults:"No results found",tryDifferentQuery:"Try a different search query",matches_one:"{{count}} match",matches_other:"{{count}} matches",projectsScanned_one:"{{count}} project scanned",projectsScanned_other:"{{count}} projects scanned"},koe={deleteProject:"Remove Project",deleteSession:"Delete Session",confirmDelete:"What would you like to do with",sessionCount_one:"This project contains {{count}} conversation.",sessionCount_other:"This project contains {{count}} conversations.",removeFromSidebar:"Remove from sidebar only",deleteAllData:"Delete all data permanently",allConversationsDeleted:"The project will be removed from the sidebar. Your files, memories, and session data will be preserved.",cannotUndo:"You can re-add the project later."},Soe={projects:loe,app:coe,sessions:doe,orchestration:uoe,historyView:poe,tooltips:moe,navigation:hoe,actions:foe,branding:goe,status:boe,time:xoe,messages:yoe,version:voe,search:woe,deleteConfirmation:koe},Coe={copy:"Copy",copied:"Copied",copyCode:"Copy code"},Noe={copy:"Copy message",copied:"Message copied",selectFormat:"Select copy format",copyAsMarkdown:"Copy as markdown",copyAsText:"Copy as text"},Eoe={user:"U",error:"Error",tool:"Tool",claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code"},Toe={settings:"Tool Settings",error:"Tool Error",result:"Tool Result",viewParams:"View input parameters",viewRawParams:"View raw parameters",viewDiff:"View edit diff for",creatingFile:"Creating new file:",updatingTodo:"Updating Todo List",read:"Read",readFile:"Read file",updateTodo:"Update todo list",readTodo:"Read todo list",searchResults:"results"},Aoe={found:"Found {{count}} {{type}}",file:"file",files:"files",pattern:"pattern:",in:"in:"},joe={updated:"File updated successfully",created:"File created successfully",written:"File written successfully",diff:"Diff",newFile:"New File",viewContent:"View file content",viewFullOutput:"View full output ({{count}} chars)",contentDisplayed:"The file content is displayed in the diff view above"},Ioe={title:"Interactive Prompt",waiting:"Waiting for your response in the CLI",instruction:"Please select an option in your terminal where Claude is running.",selectedOption:"✓ Claude selected option {{number}}",instructionDetail:"In the CLI, you would select this option interactively using arrow keys or by typing the number."},_oe={title:"Thinking...",emoji:"💭 Thinking..."},Roe={response:"JSON Response"},Loe={grant:"Grant permission for {{tool}}",added:"Permission added",addTo:"Adds {{entry}} to Allowed Tools.",retry:"Permission saved. Retry the request to use the tool.",error:"Unable to update permissions. Please try again.",openSettings:"Open settings"},Poe={updated:"Todo list has been updated successfully",current:"Current Todo List"},Doe={viewPlan:"📋 View implementation plan",title:"Implementation Plan"},Ooe={resetAt:"Claude usage limit reached. Your limit will reset at **{{time}} {{timezone}}** - {{date}}"},Moe={permissionMode:"Permission Mode",modes:{default:"Default Mode",acceptEdits:"Accept Edits",bypassPermissions:"Bypass Permissions",plan:"Plan Mode"},descriptions:{default:"Only trusted commands (ls, cat, grep, git status, etc.) run automatically. Other commands are skipped. Can write to workspace.",acceptEdits:"All commands run automatically within the workspace. Full auto mode with sandboxed execution.",bypassPermissions:"Full system access with no restrictions. All commands run automatically with full disk and network access. Use with caution.",plan:"Planning mode - no commands are executed"},technicalDetails:"Technical details"},Foe={permissionMode:"Gemini Permission Mode",description:"Control how Gemini CLI handles operation approvals.",modes:{default:{title:"Standard (Ask for Approval)",description:"Gemini will prompt for approval before executing commands, writing files, and fetching web resources."},autoEdit:{title:"Auto Edit (Skip File Approvals)",description:"Gemini will automatically approve file edits and web fetches, but will still prompt for shell commands."},yolo:{title:"YOLO (Bypass All Permissions)",description:"Gemini will execute all operations without asking for approval. Exercise caution."}}},zoe={permissionMode:"Qwen Permission Mode",description:"Control how Qwen Code handles operation approvals.",modes:{default:{title:"Standard (Ask for Approval)",description:"Qwen Code will prompt for approval before executing commands, writing files, and fetching web resources."},autoEdit:{title:"Auto Edit (Skip File Approvals)",description:"Qwen Code will automatically approve file edits and web fetches, but will still prompt for shell commands."},yolo:{title:"YOLO (Bypass All Permissions)",description:"Qwen Code will execute all operations without asking for approval. Exercise caution."}}},Boe={placeholder:"Type / for commands, @ for files, or ask {{provider}} anything...",placeholderDefault:"Type your message...",disabled:"Input disabled",attachFiles:"Attach files",attachImages:"Attach images",send:"Send",stop:"Stop",clickToChangeMode:"Click to change permission mode (or press Tab in input)",showAllCommands:"Show all commands",clearInput:"Clear input",scrollToBottom:"Scroll to bottom"},Uoe={selector:{title:"Thinking Mode",description:"Extended thinking gives Claude more time to evaluate alternatives",active:"Active",tip:"Higher thinking modes take more time but provide more thorough analysis"},modes:{none:{name:"Standard",description:"Regular Claude response",prefix:""},think:{name:"Think",description:"Basic extended thinking",prefix:"think"},thinkHard:{name:"Think Hard",description:"More thorough evaluation",prefix:"think hard"},thinkHarder:{name:"Think Harder",description:"Deep analysis with alternatives",prefix:"think harder"},ultrathink:{name:"Ultrathink",description:"Maximum thinking budget",prefix:"ultrathink"}},buttonTitle:"Thinking mode: {{mode}}"},$oe={title:"Choose Your AI Assistant",description:"Select a provider to start a new conversation",selectModel:"Select Model",statusUnavailable:"Status unavailable",statusRetryHint:"Could not check this CLI. Tap to retry.",retryStatus:"Retry status",providerInfo:{anthropic:"by Anthropic",openai:"by OpenAI",cursorEditor:"AI Code Editor",google:"by Google"},readyPrompt:{claude:"Ready to use Claude with {{model}}. Start typing your message below.",cursor:"Ready to use Cursor with {{model}}. Start typing your message below.",codex:"Ready to use Codex with {{model}}. Start typing your message below.",gemini:"Ready to use Gemini with {{model}}. Start typing your message below.",default:"Select a provider above to begin"}},Hoe={continue:{title:"Continue your conversation",description:"Ask questions about your code, request changes, or get help with development tasks"},loading:{olderMessages:"Loading older messages...",sessionMessages:"Loading session messages..."},messages:{showingOf:"Showing {{shown}} of {{total}} messages",scrollToLoad:"Scroll up to load more",showingLast:"Showing last {{count}} messages ({{total}} total)",loadEarlier:"Load earlier messages",loadAll:"Load all messages",loadingAll:"Loading all messages...",allLoaded:"All messages loaded",perfWarning:'All messages loaded — scrolling may be slower. Click "Scroll to bottom" to restore performance.'}},Goe={selectProject:{title:"Select a Project",description:"Choose a project to open an interactive shell in that directory"},status:{newSession:"New Session",initializing:"Initializing...",restarting:"Restarting..."},actions:{disconnect:"Disconnect",disconnectTitle:"Disconnect from shell",restart:"Restart",restartTitle:"Restart Shell (disconnect first)",connect:"Continue in Shell",connectTitle:"Connect to shell"},loading:"Loading terminal...",connecting:"Connecting to shell...",startSession:"Start a new Claude session",startProviderSession:"Start a new {{provider}} session",resumeSession:"Resume session: {{displayName}}...",runCommand:"Run {{command}} in {{projectName}}",startCli:"Starting Claude CLI in {{projectName}}",startProviderCli:"Starting {{provider}} in {{projectName}}",defaultCommand:"command"},Voe={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},Woe={startChatWithProvider:"Select a project to start chatting with {{provider}}"},qoe={nextTaskPrompt:"Start the next task"},Koe={codeBlock:Coe,copyMessage:Noe,messageTypes:Eoe,tools:Toe,search:Aoe,fileOperations:joe,interactive:Ioe,thinking:_oe,json:Roe,permissions:Loe,todo:Poe,plan:Doe,usageLimit:Ooe,codex:Moe,gemini:Foe,qwen:zoe,input:Boe,thinkingMode:Uoe,providerSelection:$oe,session:Hoe,shell:Goe,claudeStatus:Voe,projectSelection:Woe,tasks:qoe},Yoe={changes:"changes",previousChange:"Previous change",nextChange:"Next change",hideDiff:"Hide diff highlighting",showDiff:"Show diff highlighting",settings:"Editor Settings",collapse:"Collapse editor",expand:"Expand editor to full width"},Zoe="Loading {{fileName}}...",Xoe={showingChanges:"Showing changes"},Joe={download:"Download file",save:"Save",saving:"Saving...",saved:"Saved!",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",close:"Close",previewMarkdown:"Preview markdown",editMarkdown:"Edit markdown"},Qoe={lines:"Lines:",characters:"Characters:",shortcuts:"Press Ctrl+S to save • Esc to close"},ele={title:"Binary File",message:'The file "{{fileName}}" cannot be displayed in the text editor because it is a binary file.'},tle={toolbar:Yoe,loading:Zoe,header:Xoe,actions:Joe,footer:Qoe,binaryFile:ele},rle={title:"TaskMaster AI is not configured",description:"TaskMaster helps break down complex projects into manageable tasks with AI-powered assistance",whatIsTitle:"🎯 What is TaskMaster?",features:{aiPowered:"AI-Powered Task Management: Break complex projects into manageable subtasks",prdTemplates:"PRD Templates: Generate tasks from Product Requirements Documents",dependencyTracking:"Dependency Tracking: Understand task relationships and execution order",progressVisualization:"Progress Visualization: Kanban boards and detailed task analytics",cliIntegration:"CLI Integration: Use taskmaster commands for advanced workflows"},initializeButton:"Initialize TaskMaster AI"},nle={title:"Getting Started with TaskMaster",subtitle:"TaskMaster is initialized! Here's what to do next:",steps:{createPRD:{title:"Create a Product Requirements Document (PRD)",description:"Discuss your project idea and create a PRD that describes what you want to build.",addButton:"Add PRD",existingPRDs:"Existing PRDs:"},generateTasks:{title:"Generate Tasks from PRD",description:"Once you have a PRD, ask your AI assistant to parse it and TaskMaster will automatically break it down into manageable tasks with implementation details."},analyzeTasks:{title:"Analyze & Expand Tasks",description:"Ask your AI assistant to analyze task complexity and expand them into detailed subtasks for easier implementation."},startBuilding:{title:"Start Building",description:"Ask your AI assistant to begin working on tasks, update their status, and add new tasks as your project evolves."}},tip:"💡 Tip: Start with a PRD to get the most out of TaskMaster's AI-powered task generation"},ale={title:"TaskMaster Setup",subtitle:"Interactive CLI for {{projectName}}",willStart:"TaskMaster initialization will start automatically",completed:"TaskMaster setup completed! You can now close this window.",closeButton:"Close",closeContinueButton:"Close & Continue"},ile={title:"Getting Started with TaskMaster",subtitle:"Your guide to productive task management",examples:{parsePRD:`💬 Example:
|
|
801
801
|
"I've just initialized a new project with Claude Task Master. I have a PRD at .taskmaster/docs/prd.txt. Can you help me parse it and set up the initial tasks?"`,expandTask:`💬 Example:
|
|
802
802
|
"Task 5 seems complex. Can you break it down into subtasks?"`,addTask:`💬 Example:
|
|
803
803
|
"Please add a new task to implement user profile image uploads using Cloudinary, research the best approach."`},moreExamples:"View more examples and usage patterns →",proTips:{title:"💡 Pro Tips",search:"Use the search bar to quickly find specific tasks",views:"Switch between Kanban, List, and Grid views using the view toggles",filters:"Use filters to focus on specific task statuses or priorities",details:"Click on any task to view detailed information and manage subtasks"},learnMore:{title:"📚 Learn More",description:"TaskMaster AI is an advanced task management system built for developers. Get documentation, examples, and contribute to the project.",githubButton:"View on GitHub"}},sle={placeholder:"Search tasks..."},ole={button:"Filters",status:"Status",priority:"Priority",sortBy:"Sort By",allStatuses:"All Statuses",allPriorities:"All Priorities",showing:"Showing {{filtered}} of {{total}} tasks",clearFilters:"Clear Filters"},lle={id:"ID",status:"Status",priority:"Priority",idAsc:"ID (Ascending)",idDesc:"ID (Descending)",titleAsc:"Title (A-Z)",titleDesc:"Title (Z-A)",statusAsc:"Status (Pending First)",statusDesc:"Status (Done First)",priorityAsc:"Priority (High First)",priorityDesc:"Priority (Low First)"},cle={kanban:"Kanban view",list:"List view",grid:"Grid view"},dle={pending:"📋 To Do",inProgress:"🚀 In Progress",done:"✅ Done",blocked:"🚫 Blocked",deferred:"⏳ Deferred",cancelled:"❌ Cancelled",noTasksYet:"No tasks yet",tasksWillAppear:"Tasks will appear here",moveTasksHere:"Move tasks here when started",completedTasksHere:"Completed tasks appear here",statusTasksHere:"Tasks with this status will appear here"},ule={help:"TaskMaster Getting Started Guide",prds:"PRDs",addPRD:"Add PRD",addTask:"Add Task",createNewPRD:"Create New PRD",prdsAvailable:"{{count}} PRD(s) available"},ple={modified:"Modified: {{date}}"},mle={pending:"Pending","in-progress":"In Progress",done:"Done",blocked:"Blocked",deferred:"Deferred",cancelled:"Cancelled"},hle={high:"High",medium:"Medium",low:"Low"},fle={title:"No tasks match your filters",description:"Try adjusting your search or filter criteria."},gle={notConfigured:rle,gettingStarted:nle,setupModal:ale,helpGuide:ile,search:sle,filters:ole,sort:lle,views:cle,kanban:dle,buttons:ule,prd:ple,statuses:mle,priorities:hle,noMatchingTasks:fle},ble={save:"저장",cancel:"취소",delete:"삭제",create:"생성",edit:"편집",close:"닫기",confirm:"확인",submit:"제출",retry:"재시도",refresh:"새로고침",search:"검색",clear:"지우기",copy:"복사",download:"다운로드",upload:"업로드",browse:"찾아보기"},xle={chat:"채팅",shell:"Shell",files:"파일",git:"소스 관리",changes:"변경 사항",liveView:"라이브 보기",tasks:"작업",remote:"원격",controlRoom:"제어",orchestration:"오케스트레이션"},yle={loading:"로딩 중...",success:"성공",error:"오류",failed:"실패",pending:"대기 중",completed:"완료",inProgress:"진행 중"},vle={savedSuccessfully:"저장되었습니다",deletedSuccessfully:"삭제되었습니다",updatedSuccessfully:"업데이트되었습니다",operationFailed:"작업 실패",networkError:"네트워크 오류. 연결을 확인해주세요.",unauthorized:"인증되지 않았습니다. 로그인해주세요.",notFound:"찾을 수 없음",invalidInput:"잘못된 입력",requiredField:"필수 항목입니다",unknownError:"알 수 없는 오류가 발생했습니다"},wle={settings:"설정",home:"홈",back:"뒤로",next:"다음",previous:"이전",logout:"로그아웃"},kle={language:"언어",theme:"테마",darkMode:"다크 모드",lightMode:"라이트 모드",name:"이름",description:"설명",enabled:"활성화",disabled:"비활성화",optional:"선택사항",version:"버전",select:"선택",selectAll:"전체 선택",deselectAll:"전체 해제"},Sle={justNow:"방금 전",minutesAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",daysAgo:"{{count}}일 전",yesterday:"어제"},Cle={newFile:"새 파일",newFolder:"새 폴더",rename:"이름 변경",move:"이동",copyPath:"경로 복사",openInEditor:"에디터에서 열기"},Nle={loading:"Pixcode 로딩 중",settingUpWorkspace:"워크스페이스 설정 중...",chooseProject:"프로젝트 선택",selectProjectDescription:"사이드바에서 프로젝트를 선택하여 Claude와 코딩을 시작하세요. 각 프로젝트에는 채팅 세션과 파일 히스토리가 포함됩니다.",tip:"팁",createProjectMobile:"위의 메뉴 버튼을 눌러 프로젝트에 접근하세요",createProjectDesktop:"사이드바의 폴더 아이콘을 클릭하여 새 프로젝트를 생성하세요",newSession:"새 세션",untitledSession:"제목 없는 세션",projectFiles:"프로젝트 파일",landing:{title:"Pixcode 워크스페이스 시작",description:"프로젝트를 선택하거나 새 채팅을 시작하거나 하나의 목표로 오케스트레이션을 실행할 수 있습니다. 오케스트레이션은 선택한 CLI 에이전트를 관리하고 모든 단계와 오류를 보여줍니다.",startOrchestration:"오케스트레이션 시작",startOrchestrationDescription:"프로젝트를 자동 생성하고 에이전트 제어와 실행 기록이 있는 오케스트레이션 화면을 엽니다.",startChat:"새 채팅 시작",startChatDescription:"폴더를 자동 생성하고 단일 에이전트로 일반 채팅 화면을 엽니다.",sidebarHint:"사이드바에서 기존 프로젝트를 선택하면 채팅 기록, 파일, git 상태, 작업, 오케스트레이션이 같은 메인 화면에 유지됩니다."}},Ele={loading:"파일 로딩 중...",files:"파일",simpleView:"간단히 보기",compactView:"컴팩트 보기",detailedView:"상세히 보기",searchPlaceholder:"파일 및 폴더 검색...",clearSearch:"검색 지우기",name:"이름",size:"크기",modified:"수정일",permissions:"권한",noFilesFound:"파일을 찾을 수 없음",checkProjectPath:"프로젝트 경로가 접근 가능한지 확인하세요",noMatchesFound:"일치하는 항목 없음",tryDifferentSearch:"다른 검색어를 시도하거나 검색을 지우세요",justNow:"방금 전",minAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",daysAgo:"{{count}}일 전",newFile:"새 파일 (Cmd+N)",newFolder:"새 폴더 (Cmd+Shift+N)",refresh:"새로고침",collapseAll:"모두 접기",context:{rename:"이름 변경",delete:"삭제",copyPath:"경로 복사",download:"다운로드",newFile:"새 파일",newFolder:"새 폴더",refresh:"새로 고침",menuLabel:"파일 컨텍스트 메뉴",loading:"로딩 중..."}},Tle={title:"새 프로젝트 생성",steps:{type:"유형",configure:"설정",confirm:"확인"},step1:{question:"이미 워크스페이스가 있으신가요, 아니면 새로 생성하시겠습니까?",existing:{title:"기존 워크스페이스",description:"서버에 이미 워크스페이스가 있고 프로젝트 목록에 추가만 하면 됩니다"},new:{title:"새 워크스페이스",description:"새 워크스페이스를 생성하고, 선택적으로 GitHub 저장소에서 clone합니다"},githubClone:{title:"GitHub에서 클론",description:"대상 폴더를 선택하고 저장소를 그 안에 클론"},subfolder:{title:"하위 폴더 만들기",description:"상위 폴더를 선택하고 그 안에 새 하위 폴더 생성"}},step2:{existingPath:"워크스페이스 경로",newPath:"워크스페이스 경로",subfolderParentPath:"상위 폴더",subfolderParentHelp:"새 하위 폴더가 생성될 폴더 경로",subfolderName:"하위 폴더 이름",subfolderNameHelp:"이 이름으로 상위 폴더 안에 새 폴더가 생성됩니다",existingPlaceholder:"/path/to/existing/workspace",newPlaceholder:"/path/to/new/workspace",existingHelp:"기존 워크스페이스 디렉토리의 전체 경로",newHelp:"워크스페이스 디렉토리의 전체 경로",githubUrl:"GitHub URL (선택사항)",githubPlaceholder:"https://github.com/username/repository",githubHelp:"선택사항: 저장소를 clone하려면 GitHub URL을 입력하세요",githubAuth:"GitHub 인증 (선택사항)",githubAuthHelp:"비공개 저장소에만 필요합니다. 공개 저장소는 인증 없이 clone할 수 있습니다.",loadingTokens:"저장된 토큰 로딩 중...",storedToken:"저장된 토큰",newToken:"새 토큰",nonePublic:"없음 (공개)",selectToken:"토큰 선택",selectTokenPlaceholder:"-- 토큰 선택 --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"이 토큰은 이 작업에만 사용됩니다",publicRepoInfo:"공개 저장소는 인증이 필요하지 않습니다. 공개 저장소를 clone하는 경우 토큰을 생략할 수 있습니다.",noTokensHelp:"저장된 토큰이 없습니다. 설정 → API Keys에서 토큰을 추가하면 재사용이 편리합니다.",optionalTokenPublic:"GitHub 토큰 (공개 저장소는 선택사항)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (공개 저장소는 비워두세요)"},step3:{reviewConfig:"설정 검토",workspaceType:"워크스페이스 유형:",existingWorkspace:"기존 워크스페이스",newWorkspace:"새 워크스페이스",subfolderWorkspace:"새 하위 폴더",path:"경로:",parentPath:"상위 경로:",subfolderName:"하위 폴더 이름:",cloneFrom:"Clone 소스:",authentication:"인증:",usingStoredToken:"저장된 토큰 사용:",usingProvidedToken:"제공된 토큰 사용",noAuthentication:"인증 없음",sshKey:"SSH 키",existingInfo:"워크스페이스가 프로젝트 목록에 추가되며 Claude/Cursor 세션에서 사용할 수 있습니다.",newWithClone:"이 폴더에 저장소가 clone됩니다.",newEmpty:"워크스페이스가 프로젝트 목록에 추가되며 Claude/Cursor 세션에서 사용할 수 있습니다.",subfolderInfo:"상위 폴더 안에 새 하위 폴더가 생성되어 프로젝트 목록에 추가됩니다.",cloningRepository:"저장소 clone 중..."},buttons:{cancel:"취소",back:"뒤로",next:"다음",createProject:"프로젝트 생성",creating:"생성 중...",cloning:"Clone 중..."},errors:{selectType:"기존 워크스페이스를 사용할지 새로 생성할지 선택해주세요",providePath:"워크스페이스 경로를 입력해주세요",provideSubfolderName:"하위 폴더 이름을 입력해주세요",subfolderNameInvalid:"하위 폴더 이름에 경로 구분자를 포함할 수 없으며 . / .. 도 허용되지 않습니다",failedToCreate:"워크스페이스 생성 실패",failedToCreateFolder:"폴더 생성 실패"}},Ale={genericTool:"도구",codes:{generic:{info:{title:"알림"}},permission:{required:{title:"작업 필요",body:"{{toolName}} 에 대한 결정을 기다리고 있습니다."}},run:{stopped:{title:"실행이 중지되었습니다",body:"사유: {{reason}}"},failed:{title:"실행 실패"}},agent:{notification:{title:"에이전트 알림"}}}},jle={title:"업데이트 가능",newVersionReady:"새 버전이 준비되었습니다",currentVersion:"현재 버전",latestVersion:"최신 버전",whatsNew:"새로운 기능:",viewFullRelease:"전체 릴리스 보기",updateProgress:"업데이트 진행 상황:",manualUpgrade:"수동 업그레이드:",npmUpgradeCommand:"npm install -g @pixelbyte-software/pixcode@latest",pixcodeUpgradeCommand:"pixcode update --restart-daemon",manualUpgradeHint:'또는 "지금 업데이트"를 클릭하여 자동으로 업데이트합니다.',updateCompleted:"업데이트가 완료되었습니다!",restartServer:"변경사항을 적용하려면 서버를 재시작하세요.",updateFailed:"업데이트 실패",buttons:{close:"닫기",later:"나중에",copyCommand:"명령어 복사",updateNow:"지금 업데이트",updating:"업데이트 중..."},ariaLabels:{closeModal:"버전 업그레이드 모달 닫기",showSidebar:"사이드바 표시",settings:"설정",updateAvailable:"업데이트 가능",closeSidebar:"사이드바 닫기"}},Ile={title:"오케스트레이션",subtitle:"{{project}} 안에서 하나의 목표를 입력하고 CLI 워커를 선택하세요. 필요하면 같은 CLI를 여러 개 만들고 직접 배정하거나 코디네이터가 나누게 할 수 있습니다.",refresh:"새로고침",goal:"목표",goalPlaceholder:"예: 인증 화면을 단일 포트 배포에 맞게 수정하고 오류를 수집한 뒤 lint와 typecheck로 검증합니다.",mode:"실행 모드",systemPlan:"시스템 계획",noMode:"선택된 모드 없음",loadingPlan:"에이전트 계획을 불러오는 중입니다.",start:"팀 시작",starting:"시작 중",needAgent:"CLI 워커를 하나 이상 활성화하세요.",startFailed:"워크플로를 시작할 수 없습니다.",cliControl:"CLI 팀",enabledCount:"{{count}}개 활성",enabled:"활성",disabled:"비활성",history:"기록",emptyHistory:"아직 실행 기록이 없습니다. 목표를 작성하고 에이전트를 시작하세요.",steps:"{{done}}/{{total}} 단계",notSelected:"선택된 실행 없음",notSelectedDescription:"이전 실행을 선택하거나 새 목표를 시작하세요. 에이전트 메시지, 오류, 변경 요약, 미리보기 출력이 여기에 표시됩니다.",loadFailed:"실행 상세를 불러올 수 없습니다.",loadingRun:"실행을 불러오는 중...",agentSteps:"에이전트 단계",noStepOutput:"단계 출력이 없습니다.",agentMessages:"에이전트 메시지",noAgentMessages:"이 에이전트는 아직 메시지를 생성하지 않았습니다. 실행이 실패했다면 실제 CLI 오류가 위에 표시됩니다.",outputs:"출력",noOutputs:"변경 요약, 미리보기 또는 명령 출력이 아직 없습니다.",open:"열기",artifact:{fileDiff:"변경 요약",previewUrl:"미리보기",commandOutput:"명령 출력"},role:{user:"사용자",agent:"에이전트"},status:{queued:"대기 중",running:"실행 중",completed:"완료",failed:"오류",canceled:"취소됨",skipped:"건너뜀"},nodes:{codex_review:"Codex 검토",gemini_review:"Gemini 검토",claude_review:"Claude 검토",claude_code_review:"Claude 검토",cursor_review:"Cursor 검토",aggregate:"집계",architect:"계획",implement:"구현",review:"검토",proposal:"제안",critique:"비판",response:"응답",judge:"결정",coordinator:"코디네이터",final_report:"최종 보고서"},workflows:{multi_model_review:{name:"멀티 모델 검토",description:"활성화된 CLI 에이전트가 같은 목표를 개별 검토한 뒤 활성 에이전트가 결과를 집계합니다."},sequential_handoff:{name:"순차 핸드오프",description:"에이전트가 순서대로 계획, 구현, 검토합니다. 비활성 CLI 단계는 건너뜁니다."},adversarial_debate:{name:"의사결정 토론",description:"에이전트가 제안, 비판, 응답하고 최종 권고를 생성합니다."},agent_team:{name:"에이전트 팀",description:"코디네이터가 목표와 활성 CLI 인스턴스를 읽고 작업을 배정한 뒤 결과를 모읍니다."}},adapters:{"claude-code":{label:"Claude Code",role:"CLI 워커"},cursor:{label:"Cursor",role:"CLI 워커"},codex:{label:"Codex",role:"CLI 워커"},gemini:{label:"Gemini",role:"CLI 워커"},qwen:{label:"Qwen Code",role:"CLI 워커"},opencode:{label:"OpenCode",role:"CLI 워커"}},activeCount:"{{active}}/{{total}} 활성",teamHint:"각 행은 하나의 CLI 워커입니다. Claude, Codex, Cursor, Gemini, Qwen, OpenCode 워커를 여러 개 만들고 각각 다른 작업을 줄 수 있습니다.",parallelLimit:"병렬 제한",addAgent:"{{agent}} 추가",duplicateAgent:"{{agent}} 복제",removeAgent:"{{agent}} 제거",assignment:"배정",assignmentPlaceholder:"선택 사항: 이 워커가 맡을 일을 정확히 적으세요. 비워 두면 코디네이터가 목표에 따라 배정합니다.",agentInstance:"{{name}} #{{number}}",taskTitle:"작업",taskTitlePlaceholder:"기능 구현",taskDescription:"설명",taskDescriptionPlaceholder:"범위, 제약, 기대 출력",addTask:"추가",runTask:"실행",cancelTask:"취소",dispatchTask:"작업 배정",adapter:"어댑터",isolation:"격리",dispatch:"배정",auto:"자동",waitingForStream:"스트림 대기 중...",workflow:"워크플로",input:"입력",taskStates:{todo:"할 일",in_progress:"진행 중",in_review:"검토 중",done:"완료",failed:"실패",canceled:"취소됨"},isolationKind:{worktree:"Worktree",host:"Host",docker:"Docker"},stop:"팀 중지",stopping:"중지 중",cancelFailed:"워크플로를 중지할 수 없습니다.",needRoles:"이 모드에서는 다음 역할에 최소 한 명의 활성 에이전트를 할당해야 합니다: {{roles}}.",quickPrompts:{label:"빠른 프롬프트:",liveTrading:{label:"8024 라이브 트레이딩 화면",prompt:"안녕하세요. 작은 프로젝트를 만들고 이후 8024 포트에서 실행해 주세요. Binance FAPI와 연결된 TradingView 스타일 디자인, TradingView 차트, 왼쪽 별표/즐겨찾기 시스템을 원합니다. 작업을 논리적으로 나누고 프로세스를 자동으로 관리해 주세요."}},teamHistory:"팀 기록",changeSummary:"변경 요약",noChangeSummary:"최종 요약이 아직 준비되지 않았습니다. 에이전트가 완료되면 읽기 쉬운 Markdown 요약이 여기에 표시됩니다.",prepareTeamFromReport:"이 보고서로 에이전트 팀 준비",prepareTeamTitle:"에이전트 팀 프롬프트 준비",prepareTeamDescription:"토론 결과가 새 Agent Team 프롬프트로 변환되었습니다. 수정한 뒤 Agent Team 모드로 이동할 수 있습니다.",usePreparedPrompt:"프롬프트 사용",reportToPromptPrefix:"아래 토론/결정 보고서를 바탕으로 에이전트 팀을 준비하고 실행하세요. 요구사항을 작업으로 나누고 사용 가능한 CLI 에이전트에 적절한 할당을 제안한 뒤, 사용자 확인 후 시작하세요.",generatedSummaryTitle:"자동 실행 요약",summaryStatus:"전체 상태",summarySteps:"완료된 단계",summaryFailures:"실패한 단계",summaryCanceled:"취소된 단계",summaryDiffs:"Diff/변경 출력",summaryPreviews:"미리보기 출력",summaryErrorPrefix:"오류",assignedWork:"할당된 작업",autoAssigned:"자동 / 코디네이터 결정",stages:{coordinator:"코디네이터",handoff:"인계",backend:"백엔드",frontend:"프론트엔드",implementation:"구현",review:"리뷰",repair:"수정",proposal:"제안",critique:"비판",response:"응답",decision:"결정",report:"보고서",final_report:"최종 보고서"},agentRole:"단계",agentRoles:{auto:"자동",backend:"백엔드",frontend:"프론트엔드",review:"테스트 / 리뷰",implementation:"구현",proposal:"제안",critique:"비판",response:"응답",decision:"결정 / 보고서",report:"보고서",custom:"사용자 지정"},customRolePlaceholder:"예: 보안, 모바일 UX, DB 아키텍처",roleHints:{default:"비워두면 코디네이터가 목표에 따라 이 에이전트에 할당합니다.",agent_team:"백엔드, 프론트엔드, 리뷰 단계를 선택하거나 자동으로 둘 수 있습니다.",multi_model_review:"활성 에이전트가 리뷰합니다. 보고서 역할을 선택하면 해당 에이전트가 최종 요약을 모읍니다.",sequential_handoff:"에이전트는 선택한 순서대로 실행됩니다. 작업 문구가 각 단계의 범위를 정의합니다.",adversarial_debate:"결정 토론에서는 단계 선택이 선택사항입니다. 비워두면 시스템이 선택된 에이전트를 순서대로 제안, 비판, 응답에 배정합니다."},soloAgent:"{{agent}}만 실행",soloAgentShort:"단독",cliSettings:"CLI 설정",workspaceTarget:"대상 작업 영역",workspaceTargets:{selectedProject:"선택한 프로젝트",pixcodeApp:"Pixcode 시스템",custom:"사용자 지정 경로"},customWorkspacePlaceholder:"/path/to/project",workspaceTargetHint:"에이전트 실행 위치: {{path}}",autoDetect:"자동 감지",needWorkspacePath:"사용자 지정 작업 영역 경로를 입력하세요.",hermesTitle:"Hermes Agent",hermesSubtitle:"Hermes is running inside Pixcode for {{project}} and can coordinate local checks, tests, terminal work, and project operations.",hermesCliControl:"Hermes CLI control"},_le={title:"컨트롤 룸",subtitle:"{{target}}의 프로덕션, 플랫폼, 관리, 감사, 셀프 호스티드 접근",thisServer:"이 서버",refresh:"새로고침",nav:{overview:"개요",production:"프로덕션",admin:"관리",team:"팀",secrets:"시크릿",marketplace:"마켓플레이스",eval:"평가",usage:"사용량",security:"보안",access:"접근"},overview:{title:"v1.46 launch surface",description:"Every box below is backed by a v1.44-v1.45 API and is now visible from the UI.",latestAuditEvents:"Latest audit events",remoteAccessOptions:"Remote access options"},metrics:{issueRuns:"Issue-to-PR runs",reviewItems:"Review items",subUsers:"Sub-users",collaborators:"Project collaborators",secrets:"Scoped secrets",marketplace:"Marketplace entries",evalRuns:"Evaluation runs",securityAudits:"Security audits"},sections:{production:{title:"Production loop",description:"Start issue-to-PR runs, parse CI failures, review changes, schedule background jobs, and create checkpoints."},admin:{title:"관리 시스템",description:"셀프 호스티드 Pixcode 서버에서 하위 사용자를 만들고 계정을 비활성화하며 활동을 확인합니다."},team:{title:"프로젝트 협업자",description:"모두를 전역 관리자로 만들지 않고 프로젝트별 partner, worker, reviewer, viewer를 지정합니다."},secrets:{title:"Secret vault",description:"Store scoped env secrets and preview what each provider, project, workflow, Telegram, or API run receives."},marketplace:{title:"MCP/plugin marketplace",description:"Register MCP servers, workflow templates, provider adapters, and notification channels with permission review and health."},eval:{title:"Evaluation harness",description:"Create regression suites and compare provider/model runs with pass rate and latency."},usage:{title:"Cost, token, and latency dashboard",description:"Monitor provider/model/workflow usage for demos and operations."},security:{title:"Security audit mode",description:"Run dependency audit, secret scan, permission audit, and agent output leak detection workflows."},access:{title:"셀프 호스티드 접근",description:"고정 도메인이 없으면 Tailscale을 사용하고, 안정적인 공개 URL에는 Cloudflare Tunnel/custom domain을 설정합니다."}},panels:{issueToPr:"Issue-to-PR run",ciRepair:"CI repair parser",reviewQueue:"Review queue",schedulerCheckpoints:"Scheduler and checkpoints",createSubUser:"Create sub-user",rolePermissions:"Role permissions",addCollaborator:"Add collaborator",createSecret:"Create secret",scopedEnvPreview:"Scoped env preview",addMarketplaceEntry:"Add marketplace entry",createSuite:"Create suite",recordRun:"Record run",recordUsageEvent:"Record usage event",createAuditRun:"Create audit run",auditLog:"Audit log",remoteAccessSetup:"Remote access setup"},lists:{recentJobs:"Recent jobs",recentCheckpoints:"Recent checkpoints",subUsers:"Sub-users",collaborators:"Collaborators",includedEnvNames:"Included env names",vaultEntries:"Vault entries",marketplaceEntries:"Marketplace entries",suites:"Suites",runs:"Runs",auditRuns:"Audit runs",configuredAccessPaths:"Configured access paths"},buttons:{queueRun:"Queue run",parseFailure:"Parse failure",createReviewItem:"Create review item",scheduleJob:"Schedule job",createCheckpoint:"Create checkpoint",createUser:"Create user",disable:"Disable",enable:"Enable",addCollaborator:"Add collaborator",storeSecret:"Store secret",previewEnv:"Preview env",saveEntry:"Save entry",markHealthy:"Mark healthy",createSuite:"Create suite",recordRun:"Record run",recordUsage:"Record usage",createAudit:"Create audit",exportJson:"Export JSON",exportCsv:"Export CSV",saveAccessPath:"Save access path",checkUrl:"Check URL",checkTailscale:"Check Tailscale"},placeholders:{githubIssueUrl:"GitHub issue URL",manualTitle:"Manual title fallback",model:"Model",baseBranch:"Base branch",ciLog:"Paste failing CI, lint, typecheck, or build output",reviewTitle:"Review title",notes:"Notes",changedFiles:"Changed files, one per line",jobName:"Job name",cronExpression:"Cron or watch expression",checkpointReason:"Checkpoint reason",backgroundPrompt:"Background agent prompt",checkpointFiles:"Checkpoint changed files, one per line",usernameEmail:"Username or email",temporaryPassword:"Temporary password",userEmailUsername:"User email or username",secretName:"Secret name",envName:"ENV_NAME",secretTarget:"Target project/provider/workflow",secretValue:"Secret value",workflowId:"Workflow id",name:"Name",pluginSource:"Source package or repository",installCommand:"Install command",permissionScopes:"Permission scopes, one per line",suiteName:"Suite name",description:"Description",firstTaskTitle:"First task title",acceptanceCriteria:"Acceptance criteria, one per line",suiteId:"Suite id",latencyMs:"Latency ms",passedCount:"Passed count",failedCount:"Failed count",workflow:"Workflow",inputTokens:"Input tokens",outputTokens:"Output tokens",costUsd:"Cost USD",optionalFindingTitle:"Optional finding title",auditFilter:"Filter audit log by user, project, event, or file",label:"Label",url:"URL",targetPort:"Target port"},labels:{project:"project",path:"path",providerModel:"provider/model",branch:"branch",failedCommands:"Failed commands",files:"Files",lastActive:"Last active",role:"role",tasks:"tasks",pass:"pass",health:"Health",reachable:"reachable",installed:"installed",loggedIn:"logged in"},columns:{provider:"Provider",model:"Model",workflow:"Workflow",runs:"Runs",tokens:"Tokens",cost:"Cost",latency:"Latency",errorRate:"Error rate"},fallback:{selectedProject:"selected project",projectPath:"project path",noneDetected:"none detected",noUrl:"No URL",global:"global",noSource:"No source",regressionSuite:"Regression suite",demoTask:"Demo task",provider:"provider",reviewRequired:"Review required.",notAvailable:"not available"},capabilities:{partner:"can approve actions, manage secrets, and use shell",projectScoped:"project-scoped access only"},teamAccess:{title:"협업자가 접근하는 방법",stepUsers:"하위 사용자 만들기",stepUsersDescription:"Admin system에서 member, viewer, project_worker, project_partner 같은 전역 역할로 사용자를 만듭니다.",stepRole:"프로젝트 역할 지정",stepRoleDescription:"같은 사용자를 프로젝트 협업자로 추가해 선택한 프로젝트만 보고 실행하게 합니다.",stepLink:"접근 경로 공유",stepLinkDescription:"Self-hosted access에 설정된 Tailscale, Cloudflare Tunnel, custom domain 또는 LAN URL을 공유합니다.",paths:"사용 가능한 접근 링크"},badges:{public:"public",private:"private"},empty:{noAuditEvents:"No audit events yet.",noRemoteAccessConfigs:"No remote access configs yet.",noReviewItems:"No review items yet.",noRecentJobs:"No recent jobs yet.",noRecentCheckpoints:"No recent checkpoints yet.",noSubUsers:"No sub-users yet.",noCollaborators:"No project collaborators yet.",noAccessPaths:"No access paths configured yet.",noIncludedEnvNames:"No included env names yet.",noSecrets:"No secrets yet.",noMarketplaceEntries:"No marketplace entries yet.",noSuites:"No suites yet.",noRuns:"No runs yet.",usageSummary:"Usage appears here after provider or workflow events are recorded.",noSecurityAudits:"No security audits yet.",noAuditMatches:"No audit entries match the current filter."}},Rle={title:"VS Code 워크벤치",noProject:"선택된 프로젝트 없음",activity:{explorer:"탐색기",projects:"프로젝트",sourceControl:"소스 제어",terminal:"터미널",showPanel:"왼쪽 패널 표시",hidePanel:"왼쪽 패널 숨기기"},panels:{explorer:"탐색기",projects:"프로젝트",sourceControl:"소스 제어",terminal:"터미널",editor:"편집기",cli:"CLI",rightTerminal:"터미널"},editor:{emptyTitle:"탐색기에서 파일 열기",closeTab:"{{file}} 닫기",scrollLeft:"탭을 왼쪽으로 스크롤",scrollRight:"탭을 오른쪽으로 스크롤",moreActions:"추가 탭 작업",closeSplit:"분할 편집기 닫기",context:{close:"닫기",closeAll:"모두 닫기",copyPath:"경로 복사",splitRight:"오른쪽으로 분할",splitMoveRight:"오른쪽으로 분할 및 이동"}},resize:{left:"왼쪽 패널 크기 조정",right:"CLI 패널 크기 조정"},menu:{openProject:"프로젝트 열기...",cloneFromGithub:"저장소 클론...",newChat:"새 채팅",openProjects:"프로젝트 열기"},projects:{openProject:"프로젝트 열기",cloneFromGithub:"클론",directoryList:"디렉터리",refresh:"프로젝트 새로고침",emptyTitle:"아직 프로젝트 디렉터리가 없습니다",emptyDescription:"로컬 폴더를 열거나 저장소를 클론해서 시작하세요.",selected:"선택됨",startChat:"채팅",fileCount:"{{formattedCount}}개 파일",fileCountPending:"파일 준비 중",startTitle:"Start a Pixcode workspace",startDescription:"Pick a folder and Pixcode will bind the explorer, terminal, and chat history to that workspace.",workHere:"Work in this folder"},workspace:{empty:"Workspace 1을 만들려면 프로젝트를 여세요.",openFirst:"워크스페이스 열기",add:"워크스페이스 추가",scrollLeft:"워크스페이스를 왼쪽으로 스크롤",scrollRight:"워크스페이스를 오른쪽으로 스크롤",close:"{{name}} 닫기",closeAction:"워크스페이스 닫기",closeOthers:"다른 항목 닫기",closeAll:"모두 닫기",rename:"이름 바꾸기",star:"별표",unstar:"별표 해제",toggleStar:"{{name}} 별표",moreActions:"워크스페이스 작업"},cli:{projectScoped:"프로젝트 범위 CLI 터미널",chooseTitle:"CLI 터미널 시작",chooseDescription:"CLI를 선택한 뒤 전체 높이 터미널을 시작합니다.",startSelected:"{{provider}} 시작",newSession:"새 CLI 세션",history:"기록",noHistory:"이 프로젝트에는 아직 세션이 없습니다.",projectHistory:"프로젝트 기록",checking:"확인 중...",ready:"준비됨",notInstalled:"설치되지 않음",installing:"설치 중...",updateAvailable:"{{version}} 업데이트",installProvider:"{{provider}} 설치",updateProvider:"{{provider}} 업데이트",manualInstall:"이 CLI는 수동 설치가 필요합니다.",installNoJob:"설치 작업 ID가 반환되지 않았습니다.",installFailed:"설치 실패.",installStreamLost:"설치 스트림이 일찍 닫혔습니다. 설치가 아직 실행 중일 수 있습니다.",provider:"Provider",installRunning:"설치 중",installDone:"준비됨",installError:"확인이 필요함",showPanel:"CLI 패널 표시",hidePanel:"CLI 패널 숨기기",close:"터미널 닫기"},terminal:{title:"터미널",close:"터미널 닫기"},hermes:{title:"Hermes Agent",installTitle:"Hermes Agent 설치",description:"프로젝트 범위 에이전트 터미널입니다. Hermes가 없으면 설치한 뒤 이 워크스페이스에서 엽니다.",start:"Hermes 시작",install:"설치",newSession:"새 Hermes 세션",history:"Hermes 기록",connect:"Hermes Agent 연결",ready:"준비됨",installRunning:"Pixcode API로 Hermes를 설치하는 중...",installDone:"Hermes가 설치되었고 Pixcode MCP가 구성되었습니다.",installError:"Hermes 설치에 실패했습니다.",installReady:"Hermes 설치 준비 완료.",installWaiting:"Hermes 설치 로그를 기다리는 중...",retryInstall:"설치 다시 시도",installFailed:"Hermes 설치에 실패했습니다.",installStreamLost:"Hermes 설치 스트림이 일찍 닫혔습니다. 설치가 아직 실행 중일 수 있습니다."}},Lle={buttons:ble,tabs:xle,status:yle,messages:vle,navigation:wle,common:kle,time:Sle,fileOperations:Cle,mainContent:Nle,fileTree:Ele,projectWizard:Tle,notifications:Ale,versionUpdate:jle,orchestration:Ile,controlRoom:_le,vscodeWorkbench:Rle},Ple="설정",Dle={account:"계정",permissions:"권한",mcpServers:"MCP 서버",appearance:"외관"},Ole={title:"계정",language:"언어",languageLabel:"표시 언어",languageDescription:"인터페이스에 사용할 언어를 선택하세요",username:"사용자명",email:"이메일",profile:"프로필",changePassword:"비밀번호 변경"},Mle={title:"MCP 서버",addServer:"서버 추가",editServer:"서버 편집",deleteServer:"서버 삭제",serverName:"서버 이름",serverType:"서버 유형",config:"설정",testConnection:"연결 테스트",status:"상태",connected:"연결됨",disconnected:"연결 끊김",scope:{label:"범위",user:"사용자",project:"프로젝트"}},Fle={title:"외관",theme:"테마",codeEditor:"코드 에디터",editorTheme:"에디터 테마",wordWrap:"자동 줄바꿈",showMinimap:"미니맵 표시",lineNumbers:"줄 번호",fontSize:"글꼴 크기"},zle={saveChanges:"변경사항 저장",resetToDefaults:"기본값으로 초기화",cancelChanges:"변경 취소"},Ble={title:"빠른 설정",sections:{appearance:"외관",toolDisplay:"도구 표시",viewOptions:"보기 옵션",inputSettings:"입력 설정",changeAwareness:"제어 센터"},darkMode:"다크 모드",autoExpandTools:"도구 자동 펼치기",showRawParameters:"Raw 파라미터 표시",showThinking:"생각 과정 표시",autoScrollToBottom:"자동 스크롤",sendByCtrlEnter:"Ctrl+Enter로 전송",sendByCtrlEnterDescription:"활성화하면 Enter 대신 Ctrl+Enter로 메시지를 전송합니다. IME 사용자가 실수로 전송하는 것을 방지하는 데 유용합니다.",changeAwareness:"제어 센터",changedFiles:{title:"변경된 파일",description:"로컬 파일 변경을 추적하고 새 변경이 생기면 파일 패널을 엽니다.",noProject:"로컬 변경을 추적할 프로젝트를 선택하세요.",refresh:"변경된 파일 새로고침",empty:"로컬 변경이 없습니다",disabled:"로컬 변경을 보려면 제어 센터를 켜세요.",more:"+{{count}}개 파일 더",lastChecked:"{{value}} 확인",guideTitle:"오른쪽 패널 가이드",guideFiles:"변경된 파일은 파일 패널에서 초록색으로 빛납니다.",guidePanel:"새 변경은 분할 패널을 자동으로 엽니다.",status:{M:"M",A:"A",D:"D",U:"U"}},dragHandle:{dragging:"드래그 핸들",closePanel:"설정 패널 닫기",openPanel:"설정 패널 열기",draggingStatus:"드래그 중...",toggleAndMove:"클릭하여 토글, 드래그하여 이동"}},Ule={title:"터미널 단축키",sectionKeys:"키",sectionNavigation:"탐색",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"위쪽 화살표",arrowDown:"아래쪽 화살표",scrollDown:"아래로 스크롤",handle:{closePanel:"단축키 패널 닫기",openPanel:"단축키 패널 열기"}},$le={label:"설정",agents:"에이전트",hermes:"Hermes Agent",appearance:"외관",git:"Git",apiTokens:"API & 토큰",notifications:"알림",plugins:"플러그인",mobile:"모바일에서 사용",telegram:"Telegram",about:"정보",access:"접근"},Hle={title:"알림",description:"수신할 알림 이벤트를 설정합니다.",webPush:{title:"웹 푸시 알림",enable:"푸시 알림 활성화",disable:"푸시 알림 비활성화",enabled:"푸시 알림이 활성화되었습니다",loading:"업데이트 중...",unsupported:"이 브라우저에서는 푸시 알림이 지원되지 않습니다.",denied:"푸시 알림이 차단되었습니다. 브라우저 설정에서 허용해 주세요."},events:{title:"이벤트 유형",actionRequired:"작업 필요",stop:"실행 중지",error:"실행 실패"}},Gle={darkMode:{label:"다크 모드",description:"라이트/다크 테마 전환"},projectSorting:{label:"프로젝트 정렬",description:"사이드바에서 프로젝트 정렬 방식",alphabetical:"알파벳순",recentActivity:"최근 활동순"},codeEditor:{title:"코드 에디터",theme:{label:"에디터 테마",description:"코드 에디터의 기본 테마"},wordWrap:{label:"자동 줄바꿈",description:"에디터에서 기본적으로 자동 줄바꿈 활성화"},showMinimap:{label:"미니맵 표시",description:"Diff 보기에서 쉬운 탐색을 위한 미니맵 표시"},lineNumbers:{label:"줄 번호 표시",description:"에디터에 줄 번호 표시"},fontSize:{label:"글꼴 크기",description:"에디터 글꼴 크기 (픽셀)"}}},Vle={title:{add:"MCP 서버 추가",edit:"MCP 서버 편집"},importMode:{form:"폼 입력",json:"JSON 가져오기"},scope:{label:"범위",userGlobal:"사용자 (전역)",projectLocal:"프로젝트 (로컬)",userDescription:"사용자 범위: 모든 프로젝트에서 사용 가능",projectDescription:"로컬 범위: 선택한 프로젝트에서만 사용 가능",cannotChange:"기존 서버를 편집할 때는 범위를 변경할 수 없습니다"},fields:{serverName:"서버 이름",transportType:"전송 유형",command:"명령어",arguments:"인수 (한 줄에 하나씩)",jsonConfig:"JSON 설정",url:"URL",envVars:"환경 변수 (KEY=value, 한 줄에 하나씩)",headers:"헤더 (KEY=value, 한 줄에 하나씩)",selectProject:"프로젝트 선택..."},placeholders:{serverName:"my-server"},validation:{missingType:"필수 항목 누락: type",stdioRequiresCommand:"stdio 유형은 command 필드가 필요합니다",httpRequiresUrl:"{{type}} 유형은 url 필드가 필요합니다",invalidJson:"잘못된 JSON 형식",jsonHelp:"MCP 서버 설정을 JSON 형식으로 붙여넣으세요. 예시:",jsonExampleStdio:'• stdio: {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse: {"type":"http","url":"https://api.example.com/mcp"}'},configDetails:"설정 상세 ({{configFile}}에서)",projectPath:"경로: {{path}}",actions:{cancel:"취소",saving:"저장 중...",addServer:"서버 추가",updateServer:"서버 업데이트"}},Wle={success:"설정이 저장되었습니다!",error:"설정 저장 실패",saving:"저장 중..."},qle={save:"설정 저장",cancel:"취소"},Kle={title:"Git 설정",description:"커밋을 위한 Git 정보를 설정합니다. 이 설정은 git config --global로 전역 적용됩니다",name:{label:"Git 이름",help:"Git 커밋에 사용될 이름"},email:{label:"Git 이메일",help:"Git 커밋에 사용될 이메일"},actions:{save:"설정 저장",saving:"저장 중..."},status:{success:"저장 완료"}},Yle={title:"API 키",description:"다른 애플리케이션에서 외부 API에 접근하기 위한 API 키를 생성합니다.",newKey:{alertTitle:"⚠️ API 키를 저장하세요",alertMessage:"이 키는 지금만 볼 수 있습니다. 안전하게 보관하세요.",iveSavedIt:"저장했습니다"},form:{placeholder:"API 키 이름 (예: Production Server)",createButton:"생성",cancelButton:"취소"},newButton:"새 API 키",empty:"생성된 API 키가 없습니다.",list:{created:"생성일:",lastUsed:"마지막 사용:"},confirmDelete:"이 API 키를 삭제하시겠습니까?",status:{active:"활성",inactive:"비활성"},github:{title:"GitHub 토큰",description:"외부 API를 통해 비공개 저장소를 clone하기 위한 GitHub Personal Access Token을 추가합니다.",descriptionAlt:"비공개 저장소를 clone하기 위한 GitHub Personal Access Token을 추가합니다. 저장하지 않고 API 요청에 직접 토큰을 전달할 수도 있습니다.",addButton:"토큰 추가",form:{namePlaceholder:"토큰 이름 (예: Personal Repos)",tokenPlaceholder:"GitHub Personal Access Token (ghp_...)",descriptionPlaceholder:"설명 (선택사항)",addButton:"토큰 추가",cancelButton:"취소",howToCreate:"GitHub Personal Access Token 생성 방법 →"},empty:"추가된 GitHub 토큰이 없습니다.",added:"추가일:",confirmDelete:"이 GitHub 토큰을 삭제하시겠습니까?"},apiDocsLink:"API 문서",documentation:{title:"외부 API 문서",description:"외부 API를 사용하여 애플리케이션에서 Claude/Cursor 세션을 트리거하는 방법을 알아보세요.",viewLink:"API 문서 보기 →"},loading:"로딩 중...",version:{updateAvailable:"업데이트 가능: v{{version}}"}},Zle={authStatus:{checking:"확인 중...",connected:"연결됨",notConnected:"연결되지 않음",disconnected:"연결 끊김",checkingAuth:"인증 상태 확인 중...",loggedInAs:"{{email}}(으)로 로그인됨",authenticatedUser:"인증된 사용자"},account:{claude:{description:"Anthropic Claude AI 어시스턴트"},cursor:{description:"Cursor AI 기반 코드 에디터"},codex:{description:"OpenAI Codex AI 어시스턴트"},gemini:{description:"Google Gemini AI 어시스턴트"},qwen:{description:"Alibaba Qwen Code CLI (Gemini CLI 포크)"}},connectionStatus:"연결 상태",login:{title:"로그인",reAuthenticate:"재인증",description:"AI 기능을 활성화하려면 {{agent}} 계정에 로그인하세요",reAuthDescription:"다른 계정으로 로그인하거나 자격 증명을 새로고침하세요",button:"로그인",reLoginButton:"재로그인"},error:"오류: {{error}}"},Xle={title:"권한 설정",skipPermissions:{label:"권한 확인 건너뛰기 (주의해서 사용)",claudeDescription:"--dangerously-skip-permissions 플래그와 동일",cursorDescription:"Cursor CLI의 -f 플래그와 동일",opencodeDescription:"OpenCode의 --dangerously-skip-permissions 플래그와 동일"},allowedTools:{title:"허용된 도구",description:"권한 확인 없이 자동으로 허용되는 도구",placeholder:'예: "Bash(git log:*)" 또는 "Write"',quickAdd:"자주 쓰는 도구 빠른 추가:",empty:"설정된 허용 도구 없음"},blockedTools:{title:"차단된 도구",description:"권한 확인 없이 자동으로 차단되는 도구",placeholder:'예: "Bash(rm:*)"',empty:"설정된 차단 도구 없음"},allowedCommands:{title:"허용된 Shell 명령어",description:"권한 확인 없이 자동으로 허용되는 Shell 명령어",placeholder:'예: "Shell(ls)" 또는 "Shell(git status)"',quickAdd:"자주 쓰는 명령어 빠른 추가:",empty:"설정된 허용 명령어 없음"},blockedCommands:{title:"차단된 Shell 명령어",description:"자동으로 차단되는 Shell 명령어",placeholder:'예: "Shell(rm -rf)" 또는 "Shell(sudo)"',empty:"설정된 차단 명령어 없음"},toolExamples:{title:"도구 패턴 예시:",bashGitLog:"- 모든 git log 명령어 허용",bashGitDiff:"- 모든 git diff 명령어 허용",write:"- 모든 Write 도구 사용 허용",bashRm:"- 모든 rm 명령어 차단 (위험)"},shellExamples:{title:"Shell 명령어 예시:",ls:"- ls 명령어 허용",gitStatus:"- git status 허용",npmInstall:"- npm install 허용",rmRf:"- 재귀 삭제 차단"},opencodeAllowed:{title:"허용된 Bash 패턴",description:"OpenCode가 확인 없이 자동 승인하는 Bash 명령 패턴",placeholder:'예: "git *" 또는 "npm test"',quickAdd:"자주 쓰는 패턴 빠른 추가:",empty:"허용 패턴이 없습니다"},opencodeBlocked:{title:"차단된 Bash 패턴",description:"OpenCode가 항상 거부하는 Bash 명령 패턴",placeholder:'예: "rm -rf *" 또는 "sudo *"',empty:"차단 패턴이 없습니다"},opencodeExamples:{title:"패턴 예시:",gitAll:"- 모든 git 명령 허용",gitPush:"- git push만 차단",rmRf:"- 재귀 삭제 차단",npm:"- 모든 npm 명령 허용"},codex:{permissionMode:"권한 모드",description:"Codex가 파일 수정 및 명령어 실행을 처리하는 방식을 제어합니다",modes:{default:{title:"기본",description:"신뢰할 수 있는 명령어(ls, cat, grep, git status 등)만 자동 실행됩니다. 다른 명령어는 건너뜁니다. 워크스페이스에 쓰기 가능."},acceptEdits:{title:"편집 허용",description:"워크스페이스 내에서 모든 명령어가 자동 실행됩니다. 샌드박스 내 완전 자동 모드."},bypassPermissions:{title:"권한 우회",description:"제한 없는 전체 시스템 접근. 모든 명령어가 전체 디스크 및 네트워크 접근 권한으로 자동 실행됩니다. 주의해서 사용하세요."}},technicalDetails:"기술 상세",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted. 신뢰할 수 있는 명령어: cat, cd, grep, head, ls, pwd, tail, git status/log/diff/show, find(-exec 제외) 등.",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never. 프로젝트 디렉토리 내에서 모든 명령어 자동 실행.",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never. 전체 시스템 접근, 신뢰할 수 있는 환경에서만 사용하세요.",overrideNote:"채팅 인터페이스의 모드 버튼을 사용하여 세션별로 재정의할 수 있습니다."}},actions:{add:"추가"}},Jle={title:"MCP 서버",description:{claude:"Model Context Protocol 서버는 Claude에 추가 도구와 데이터 소스를 제공합니다",cursor:"Model Context Protocol 서버는 Cursor에 추가 도구와 데이터 소스를 제공합니다",codex:"Model Context Protocol 서버는 Codex에 추가 도구와 데이터 소스를 제공합니다"},addButton:"MCP 서버 추가",empty:"설정된 MCP 서버 없음",serverType:"유형",scope:{local:"로컬",user:"사용자"},config:{command:"명령어",url:"URL",args:"인수",environment:"환경"},tools:{title:"도구",count:"({{count}}):",more:"+{{count}}개 더"},actions:{edit:"서버 편집",delete:"서버 삭제"},help:{title:"Codex MCP 정보",description:"Codex는 stdio 기반 MCP 서버를 지원합니다. 추가 도구와 리소스로 Codex의 기능을 확장하는 서버를 추가할 수 있습니다."}},Qle={title:"플러그인",description:"커스텀 플러그인으로 인터페이스를 확장하세요. git에서 설치하거나 ~/.pixcode/plugins/ 폴더에 직접 추가할 수 있습니다.",installPlaceholder:"https://github.com/user/my-plugin",installButton:"설치",installing:"설치 중…",securityWarning:"소스 코드를 검토했거나 신뢰할 수 있는 작성자의 플러그인만 설치하세요.",scanningPlugins:"플러그인 스캔 중…",noPluginsInstalled:"설치된 플러그인이 없습니다",pullLatest:"git에서 최신 버전 가져오기",noGitRemote:"git 리모트가 없음 — 업데이트 불가",uninstallPlugin:"플러그인 삭제",confirmUninstall:"다시 클릭하여 확인",confirmUninstallMessage:"{{name}} 플러그인을 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",cancel:"취소",remove:"삭제",updateFailed:"업데이트 실패",installFailed:"설치 실패",uninstallFailed:"삭제 실패",toggleFailed:"토글 실패",buildYourOwn:"나만의 플러그인 만들기",starter:"스타터",docs:"문서",starterPlugin:{name:"프로젝트 통계",badge:"스타터",description:"프로젝트의 파일 수, 코드 라인 수, 파일 유형별 분석 및 최근 활동을 확인합니다.",install:"설치"},morePlugins:"더 보기",enable:"활성화",disable:"비활성화",installAriaLabel:"플러그인 git 저장소 URL",tab:"탭",runningStatus:"실행 중"},ece={title:"접속",description:"이 셀프 호스팅 Pixcode 서버에 접속하는 방법을 선택합니다. 먼저 같은 네트워크에서 확인하고, 원격 접속은 보안 터널, Tailscale 또는 자체 도메인을 사용합니다.",refresh:"새로고침",copy:"복사",copied:"복사됨",save:"접속 경로 저장",check:"URL 확인",qrAlt:"{{url}} QR",guide:{title:"먼저 접속 방식을 선택",description:"네트워크 용어를 몰라도 됩니다. 상황에 맞는 항목을 고르고 링크를 복사하거나 휴대폰으로 QR을 스캔하세요."},options:{sameNetwork:{title:"같은 Wi-Fi/LAN",description:"기기가 Pixcode 서버와 같은 공유기 또는 사무실 네트워크에 있을 때 사용합니다."},secureTunnel:{title:"임시 공개 링크",description:"Cloudflare/ngrok 터널을 시작하면 Pixcode가 공개 URL과 QR을 보여줍니다."},tailscale:{title:"비공개 팀 링크",description:"공개 도메인이나 라우터 설정 없이 비공개 접속이 필요할 때 사용합니다."},customDomain:{title:"자체 도메인",description:"HTTPS, 리버스 프록시 또는 Cloudflare Tunnel 호스트명이 이미 있을 때 사용합니다."}},status:{ready:"준비됨",detecting:"감지 중",guided:"가이드",configured:"설정됨",optional:"선택 사항"},links:{title:"사용 가능한 링크",description:"접속할 기기 또는 팀원에게 맞는 URL을 복사합니다.",local:"로컬",tailscale:"Tailscale 비공개 링크",empty:"아직 감지된 접속 링크가 없습니다."},local:{title:"같은 네트워크 접속",description:"첫 테스트에 가장 좋습니다. 같은 Wi-Fi 또는 LAN에서 QR을 스캔하거나 링크를 복사합니다.",thisDevice:"이 컴퓨터에서만",loading:"같은 네트워크 링크 감지 중...",empty:"LAN 링크를 찾지 못했습니다. 네트워크 연결을 확인하고 새로고침하세요.",saveLabel:"같은 네트워크 접속",save:"이 LAN 링크 저장"},tunnel:{title:"보안 터널",description:"고정 도메인이 없어도 Pixcode가 cloudflared 또는 ngrok을 실행하고 공개 URL을 표시할 수 있습니다.",secureLink:"공개 링크와 QR",help:"시작을 누르세요. cloudflared 또는 ngrok이 설치되어 있으면 Pixcode가 임시 HTTPS 주소와 QR을 만듭니다.",running:"터널 실행 중",start:"터널 시작",stop:"터널 중지",save:"이 터널 URL 저장",saveLabel:"보안 터널 접속",qrLabel:"보안 터널",installTitle:"터널 설정 필요",installNeeded:"먼저 cloudflared 또는 ngrok을 설치한 뒤 다시 터널을 시작하세요."},tailscale:{title:"Tailscale 비공개 접속",description:"Tailscale은 선택형 비공개 네트워크 앱입니다. 서버와 사용자 기기에 설치하고 같은 팀으로 로그인하면 Pixcode가 비공개 URL을 감지합니다.",save:"이 Tailscale URL 저장",saveLabel:"Tailscale 비공개 접속",openInstall:"Tailscale 설치 열기",steps:{installServer:"Pixcode가 실행되는 컴퓨터 또는 서버에 Tailscale을 설치합니다.",installUserDevice:"Pixcode를 열 휴대폰, 노트북 또는 팀원 기기에 Tailscale을 설치합니다.",login:"두 기기에서 같은 Tailscale 계정 또는 팀으로 로그인합니다.",refresh:"여기로 돌아와 새로고침을 누르면 Pixcode가 비공개 URL을 보여줍니다."}},advanced:{title:"고급: 고정 도메인",description:"LAN URL, Tailscale URL, Cloudflare Tunnel 호스트명 또는 HTTPS 도메인이 이미 있을 때 저장합니다.",badge:"고급"},setup:{title:"고정 접속 경로",description:"사용자가 사용할 URL을 저장합니다. LAN, Tailscale, Cloudflare Tunnel 또는 자체 도메인이 될 수 있습니다."},modes:{lan:"LAN",tailscale:"Tailscale",cloudflare_tunnel:"Cloudflare Tunnel",custom_domain:"자체 도메인"},fields:{label:"라벨",url:"URL",port:"대상 포트"},health:{reachable:"Pixcode에 접속할 수 있습니다",unreachable:"Pixcode에 접속할 수 없습니다"},configured:{title:"저장된 접속 경로",description:"이 경로는 역할에 따라 관리자, 프로젝트 파트너, 프로젝트 작업자에게 제공됩니다.",empty:"저장된 접속 경로가 없습니다.",noUrl:"URL 없음",public:"공개",private:"비공개"},team:{title:"사용자 접속 방법",description:"Admin system에서 사용자를 만들고 Control Room에서 프로젝트 역할을 지정한 뒤 Access URL을 공유하세요. 지정된 프로젝트에는 전체 관리자 권한이 필요하지 않습니다."}},tce={title:"Hermes Agent",description:"Hermes Agent를 Pixcode가 제어하는 프로젝트 터미널로 관리하고, MCP로 프로젝트, 제공자 상태, 표시되는 CLI 실행에 접근합니다.",statusTitle:"설치 상태",statusFailed:"Hermes Agent를 확인할 수 없습니다.",ready:"준비됨",notInstalled:"설치되지 않음",start:"Hermes 시작",install:"설치",repair:"명령 복구",refresh:"새로 고침",gatewayTitle:"REST API 게이트웨이",gatewayStatusFailed:"Hermes REST 게이트웨이를 확인할 수 없습니다.",gatewayStartFailed:"Hermes REST 게이트웨이를 시작할 수 없습니다.",gatewayStopFailed:"Hermes REST 게이트웨이를 중지할 수 없습니다.",gatewayProbeFailed:"Hermes REST 프로브에 실패했습니다.",gatewayRunning:"REST 게이트웨이 실행 중",gatewayStopped:"REST 게이트웨이 중지됨",gatewayStart:"REST 시작",gatewayProbe:"REST 테스트",gatewayStop:"중지",gatewayProbeOk:"REST 프로브 통과: health, capabilities, models가 응답했습니다.",commandsTitle:"Hermes CLI 설정",commandsDescription:"Pixcode에서 실제 Hermes 터미널 마법사를 엽니다. 모델 및 제공자로 Codex, OpenRouter, Anthropic, Gemini 등 제공자를 연결합니다.",commandsInstallFirst:"CLI 설정을 열기 전에 Hermes를 설치하세요.",commands:{model:{title:"모델 및 제공자",description:"OAuth, API 키, 기본 모델 선택을 위한 대화형 제공자/모델 마법사를 엽니다."},auth:{title:"자격 증명",description:"구성된 제공자의 OAuth 세션과 API 키 풀을 관리합니다."},tools:{title:"도구",description:"Pixcode MCP 접근을 포함해 활성화할 Hermes 도구 세트를 선택합니다."},doctor:{title:"Doctor",description:"터미널에서 Hermes 구성, 의존성, 플랫폼 문제를 진단합니다."},status:{title:"상태",description:"현재 제공자, 인증, 플랫폼, 수정된 설정 요약을 표시합니다."},lsp:{title:"LSP 상태",description:"시맨틱 진단을 위한 Hermes language server 통합을 확인합니다."},skills:{title:"스킬",description:"CLI에서 Hermes 스킬을 탐색, 설치, 감사, 구성합니다."},sessions:{title:"세션",description:"Hermes 세션을 탐색, 내보내기, 이름 변경, 정리, 삭제합니다."}},pixcodeControlTitle:"Pixcode 제어",pixcodeControlDescription:"Pixcode는 실행 전에 Hermes MCP 서버를 구성하므로 Hermes가 워크스페이스를 검사하고 필요할 때 Pixcode UI 안에서 제공자 터미널을 열 수 있습니다."},rce={title:Ple,tabs:Dle,account:Ole,mcp:Mle,appearance:Fle,actions:zle,quickSettings:Ble,terminalShortcuts:Ule,mainTabs:$le,notifications:Hle,appearanceSettings:Gle,mcpForm:Vle,saveStatus:Wle,footerActions:qle,git:Kle,apiKeys:Yle,agents:Zle,permissions:Xle,mcpServers:Jle,pluginSettings:Qle,access:ece,hermes:tce},nce={title:"다시 오신 것을 환영합니다",description:"Pixcode 계정에 로그인하세요",username:"사용자명",password:"비밀번호",submit:"로그인",loading:"로그인 중...",errors:{invalidCredentials:"사용자명 또는 비밀번호가 잘못되었습니다",requiredFields:"모든 항목을 입력해주세요",networkError:"네트워크 오류. 다시 시도해주세요."},placeholders:{username:"사용자명을 입력하세요",password:"비밀번호를 입력하세요"}},ace={title:"계정 생성",username:"사용자명",password:"비밀번호",confirmPassword:"비밀번호 확인",submit:"계정 생성",loading:"계정 생성 중...",errors:{passwordMismatch:"비밀번호가 일치하지 않습니다",usernameTaken:"이미 사용 중인 사용자명입니다",weakPassword:"비밀번호가 너무 약합니다"}},ice={title:"로그아웃",confirm:"정말 로그아웃하시겠습니까?",button:"로그아웃"},sce={login:nce,register:ace,logout:ice},oce={title:"프로젝트",newProject:"새 프로젝트",deleteProject:"프로젝트 제거",renameProject:"프로젝트 이름 변경",noProjects:"프로젝트가 없습니다",loadingProjects:"프로젝트 로딩 중...",searchPlaceholder:"프로젝트 검색...",projectNamePlaceholder:"프로젝트 이름",starred:"즐겨찾기",all:"전체",untitledSession:"제목 없는 세션",newSession:"새 세션",codexSession:"Codex 세션",fetchingProjects:"Claude 프로젝트와 세션을 가져오는 중",projects:"프로젝트",detectedFromHistory:"기록에서 감지됨",noMatchingProjects:"일치하는 프로젝트 없음",tryDifferentSearch:"검색어를 변경해보세요",runClaudeCli:"프로젝트 디렉토리에서 Claude CLI를 실행하여 시작하세요"},lce={title:"Pixcode",subtitle:"AI 코딩 어시스턴트 UI"},cce={title:"세션",newSession:"새 세션",deleteSession:"세션 삭제",renameSession:"세션 이름 변경",noSessions:"세션이 없습니다",loadingSessions:"세션 로딩 중...",unnamed:"이름 없음",loading:"로딩 중...",showMore:"더 많은 세션 보기"},dce={viewEnvironments:"환경 보기",hideSidebar:"사이드바 숨기기",createProject:"새 프로젝트 생성",refresh:"프로젝트 및 세션 새로고침 (Ctrl+R)",renameProject:"프로젝트 이름 변경 (F2)",deleteProject:"사이드바에서 프로젝트 제거 (Delete)",addToFavorites:"즐겨찾기에 추가",removeFromFavorites:"즐겨찾기에서 제거",editSessionName:"세션 이름 직접 편집",deleteSession:"이 세션 영구 삭제",save:"저장",cancel:"취소"},uce={chat:"채팅",files:"파일",git:"Git",terminal:"터미널",tasks:"작업"},pce={refresh:"새로고침",settings:"설정",collapseAll:"모두 접기",expandAll:"모두 펼치기",cancel:"취소",save:"저장",delete:"삭제",rename:"이름 변경",joinCommunity:"커뮤니티 참여",reportIssue:"문제 신고",starOnGithub:"GitHub에서 스타",controlRoom:"컨트롤 룸",controlRoomDescription:"관리, 접근, 실행"},mce={openSource:"오픈 소스"},hce={active:"활성",inactive:"비활성",thinking:"생각 중...",error:"오류",aborted:"중단됨",unknown:"알 수 없음"},fce={justNow:"방금 전",oneMinuteAgo:"1분 전",minutesAgo:"{{count}}분 전",oneHourAgo:"1시간 전",hoursAgo:"{{count}}시간 전",oneDayAgo:"1일 전",daysAgo:"{{count}}일 전"},gce={deleteConfirm:"정말 삭제하시겠습니까?",renameSuccess:"이름이 변경되었습니다",deleteSuccess:"삭제되었습니다",errorOccurred:"오류가 발생했습니다",deleteSessionConfirm:"이 세션을 삭제하시겠습니까? 이 작업은 취소할 수 없습니다.",deleteProjectConfirm:"사이드바에서 이 프로젝트를 제거하시겠습니까? 프로젝트 파일, 메모리 및 세션 데이터는 삭제되지 않습니다.",enterProjectPath:"프로젝트 경로를 입력해주세요",deleteSessionFailed:"세션 삭제 실패. 다시 시도해주세요.",deleteSessionError:"세션 삭제 오류. 다시 시도해주세요.",renameSessionFailed:"세션 이름 변경 실패. 다시 시도해주세요.",renameSessionError:"세션 이름 변경 오류. 다시 시도해주세요.",deleteProjectFailed:"프로젝트 제거 실패. 다시 시도해주세요.",deleteProjectError:"프로젝트 제거 오류. 다시 시도해주세요.",createProjectFailed:"프로젝트 생성 실패. 다시 시도해주세요.",createProjectError:"프로젝트 생성 오류. 다시 시도해주세요."},bce={updateAvailable:"업데이트 가능"},xce={deleteProject:"프로젝트 제거",deleteSession:"세션 삭제",confirmDelete:"이 프로젝트를 어떻게 하시겠습니까:",sessionCount_one:"이 프로젝트에는 {{count}}개의 대화가 있습니다.",sessionCount_other:"이 프로젝트에는 {{count}}개의 대화가 있습니다.",removeFromSidebar:"사이드바에서만 제거",deleteAllData:"모든 데이터 영구 삭제",allConversationsDeleted:"프로젝트가 사이드바에서 제거됩니다. 파일, 메모리 및 세션 데이터는 보존됩니다.",cannotUndo:"나중에 프로젝트를 다시 추가할 수 있습니다."},yce={section:"오케스트레이션",fallbackTitle:"오케스트레이션 실행"},vce={projects:oce,app:lce,sessions:cce,tooltips:dce,navigation:uce,actions:pce,branding:mce,status:hce,time:fce,messages:gce,version:bce,deleteConfirmation:xce,orchestration:yce},wce={copy:"복사",copied:"복사됨",copyCode:"코드 복사"},kce={copy:"메시지 복사",copied:"메시지 복사됨",selectFormat:"복사 형식 선택",copyAsMarkdown:"마크다운으로 복사",copyAsText:"텍스트로 복사"},Sce={user:"U",error:"오류",tool:"도구",claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code"},Cce={settings:"도구 설정",error:"도구 오류",result:"도구 결과",viewParams:"입력 파라미터 보기",viewRawParams:"Raw 파라미터 보기",viewDiff:"편집 Diff 보기:",creatingFile:"새 파일 생성:",updatingTodo:"Todo 리스트 업데이트",read:"읽기",readFile:"파일 읽기",updateTodo:"Todo 리스트 업데이트",readTodo:"Todo 리스트 읽기",searchResults:"결과"},Nce={found:"{{count}}개의 {{type}} 발견",file:"파일",files:"파일",pattern:"패턴:",in:"위치:"},Ece={updated:"파일이 업데이트되었습니다",created:"파일이 생성되었습니다",written:"파일이 작성되었습니다",diff:"Diff",newFile:"새 파일",viewContent:"파일 내용 보기",viewFullOutput:"전체 출력 보기 ({{count}}자)",contentDisplayed:"파일 내용이 위의 Diff 보기에 표시됩니다"},Tce={title:"대화형 프롬프트",waiting:"CLI에서 응답을 기다리는 중",instruction:"Claude가 실행 중인 터미널에서 옵션을 선택해주세요.",selectedOption:"✓ Claude가 옵션 {{number}}을(를) 선택했습니다",instructionDetail:"CLI에서 화살표 키 또는 숫자를 입력하여 이 옵션을 대화형으로 선택합니다."},Ace={title:"생각 중...",emoji:"💭 생각 중..."},jce={response:"JSON 응답"},Ice={grant:"{{tool}}에 대한 권한 부여",added:"권한이 추가되었습니다",addTo:"{{entry}}을(를) 허용된 도구에 추가합니다.",retry:"권한이 저장되었습니다. 도구를 사용하려면 요청을 재시도하세요.",error:"권한을 업데이트할 수 없습니다. 다시 시도해주세요.",openSettings:"설정 열기"},_ce={updated:"Todo 리스트가 업데이트되었습니다",current:"현재 Todo 리스트"},Rce={viewPlan:"📋 구현 계획 보기",title:"구현 계획"},Lce={resetAt:"Claude 사용량 한도에 도달했습니다. 한도는 **{{time}} {{timezone}}** - {{date}}에 초기화됩니다"},Pce={permissionMode:"권한 모드",modes:{default:"기본 모드",acceptEdits:"편집 허용",bypassPermissions:"권한 우회",plan:"Plan 모드"},descriptions:{default:"신뢰할 수 있는 명령어(ls, cat, grep, git status 등)만 자동 실행됩니다. 다른 명령어는 건너뜁니다. 워크스페이스에 쓰기 가능.",acceptEdits:"워크스페이스 내에서 모든 명령어가 자동 실행됩니다. 샌드박스 내 완전 자동 모드.",bypassPermissions:"제한 없는 전체 시스템 접근. 모든 명령어가 전체 디스크 및 네트워크 접근 권한으로 자동 실행됩니다. 주의해서 사용하세요.",plan:"계획 모드 - 명령어가 실행되지 않습니다"},technicalDetails:"기술 상세"},Dce={placeholder:"/를 입력하여 명령어, @를 입력하여 파일, 또는 {{provider}}에게 무엇이든 물어보세요...",placeholderDefault:"메시지를 입력하세요...",disabled:"입력 비활성화",attachFiles:"파일 첨부",attachImages:"이미지 첨부",send:"전송",stop:"중지",clickToChangeMode:"클릭하여 권한 모드 변경 (또는 입력창에서 Tab)",showAllCommands:"모든 명령어 보기",clearInput:"입력 지우기",scrollToBottom:"맨 아래로 스크롤"},Oce={selector:{title:"Thinking 모드",description:"확장된 thinking은 Claude에게 대안을 평가할 시간을 더 줍니다",active:"활성",tip:"높은 thinking 모드는 시간이 더 걸리지만 더 철저한 분석을 제공합니다"},modes:{none:{name:"Standard",description:"일반 Claude 응답",prefix:""},think:{name:"Think",description:"기본 확장 thinking",prefix:"think"},thinkHard:{name:"Think Hard",description:"더 철저한 평가",prefix:"think hard"},thinkHarder:{name:"Think Harder",description:"대안을 포함한 심층 분석",prefix:"think harder"},ultrathink:{name:"Ultrathink",description:"최대 thinking 예산",prefix:"ultrathink"}},buttonTitle:"Thinking 모드: {{mode}}"},Mce={title:"AI 어시스턴트 선택",description:"새 대화를 시작할 프로바이더를 선택하세요",selectModel:"모델 선택",statusUnavailable:"상태를 확인할 수 없음",statusRetryHint:"이 CLI를 확인하지 못했습니다. 다시 시도하려면 누르세요.",retryStatus:"상태 다시 확인",providerInfo:{anthropic:"Anthropic 제공",openai:"OpenAI 제공",cursorEditor:"AI 코드 에디터",google:"Google 제공"},readyPrompt:{claude:"{{model}} 모델로 Claude를 사용할 준비가 되었습니다. 아래에 메시지를 입력하세요.",cursor:"{{model}} 모델로 Cursor를 사용할 준비가 되었습니다. 아래에 메시지를 입력하세요.",codex:"{{model}} 모델로 Codex를 사용할 준비가 되었습니다. 아래에 메시지를 입력하세요.",gemini:"{{model}} 모델로 Gemini를 사용할 준비가 되었습니다. 아래에 메시지를 입력하세요.",default:"시작하려면 위에서 제공자를 선택하세요"}},Fce={continue:{title:"대화 계속하기",description:"코드에 대해 질문하거나, 변경을 요청하거나, 개발 작업에 도움을 받으세요"},loading:{olderMessages:"이전 메시지 로딩 중...",sessionMessages:"세션 메시지 로딩 중..."},messages:{showingOf:"{{total}}개 중 {{shown}}개 표시",scrollToLoad:"위로 스크롤하여 더 로드",showingLast:"마지막 {{count}}개 메시지 표시 (총 {{total}}개)",loadEarlier:"이전 메시지 로드",loadAll:"모든 메시지 로드",loadingAll:"모든 메시지 로딩 중...",allLoaded:"모든 메시지 로드 완료",perfWarning:'모든 메시지가 로드됨 - 스크롤이 느려질 수 있습니다. "맨 아래로 스크롤"을 클릭하면 성능이 복구됩니다.'}},zce={selectProject:{title:"프로젝트 선택",description:"해당 디렉토리에서 대화형 Shell을 열 프로젝트를 선택하세요"},status:{newSession:"새 세션",initializing:"초기화 중...",restarting:"재시작 중..."},actions:{disconnect:"연결 끊기",disconnectTitle:"Shell 연결 끊기",restart:"재시작",restartTitle:"Shell 재시작 (먼저 연결 끊기)",connect:"Shell에서 계속",connectTitle:"Shell에 연결"},loading:"터미널 로딩 중...",connecting:"Shell에 연결 중...",startSession:"새 Claude 세션 시작",startProviderSession:"새 {{provider}} 세션 시작",resumeSession:"세션 재개: {{displayName}}...",runCommand:"{{projectName}}에서 {{command}} 실행",startCli:"{{projectName}}에서 Claude CLI 시작",startProviderCli:"{{projectName}}에서 {{provider}} 시작",defaultCommand:"명령어"},Bce={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},Uce={startChatWithProvider:"{{provider}}와 채팅을 시작하려면 프로젝트를 선택하세요"},$ce={nextTaskPrompt:"다음 작업 시작"},Hce={codeBlock:wce,copyMessage:kce,messageTypes:Sce,tools:Cce,search:Nce,fileOperations:Ece,interactive:Tce,thinking:Ace,json:jce,permissions:Ice,todo:_ce,plan:Rce,usageLimit:Lce,codex:Pce,input:Dce,thinkingMode:Oce,providerSelection:Mce,session:Fce,shell:zce,claudeStatus:Bce,projectSelection:Uce,tasks:$ce},Gce={changes:"변경사항",previousChange:"이전 변경",nextChange:"다음 변경",hideDiff:"Diff 하이라이트 숨기기",showDiff:"Diff 하이라이트 표시",settings:"에디터 설정",collapse:"에디터 접기",expand:"에디터 전체 너비로 펼치기"},Vce="{{fileName}} 로딩 중...",Wce={showingChanges:"변경사항 표시"},qce={download:"파일 다운로드",save:"저장",saving:"저장 중...",saved:"저장됨!",exitFullscreen:"전체화면 종료",fullscreen:"전체화면",close:"닫기"},Kce={lines:"줄:",characters:"문자:",shortcuts:"Ctrl+S로 저장 • Esc로 닫기"},Yce={title:"바이너리 파일",message:'파일 "{{fileName}}"은(는) 바이너리 파일이므로 텍스트 편집기에서 표시할 수 없습니다.'},Zce={toolbar:Gce,loading:Vce,header:Wce,actions:qce,footer:Kce,binaryFile:Yce},Xce={save:"保存",cancel:"取消",delete:"删除",create:"创建",edit:"编辑",close:"关闭",confirm:"确认",submit:"提交",retry:"重试",refresh:"刷新",search:"搜索",clear:"清除",copy:"复制",download:"下载",upload:"上传",browse:"浏览"},Jce={chat:"聊天",shell:"终端",files:"文件",git:"源代码管理",changes:"更改",liveView:"实时预览",tasks:"任务",remote:"远程",controlRoom:"控制",orchestration:"编排"},Qce={loading:"加载中...",success:"成功",error:"错误",failed:"失败",pending:"待处理",completed:"已完成",inProgress:"进行中"},ede={savedSuccessfully:"保存成功",deletedSuccessfully:"删除成功",updatedSuccessfully:"更新成功",operationFailed:"操作失败",networkError:"网络错误,请检查您的连接。",unauthorized:"未授权,请登录。",notFound:"未找到",invalidInput:"输入无效",requiredField:"此字段为必填项",unknownError:"发生未知错误"},tde={settings:"设置",home:"首页",back:"返回",next:"下一步",previous:"上一步",logout:"退出登录"},rde={language:"语言",theme:"主题",darkMode:"深色模式",lightMode:"浅色模式",name:"名称",description:"描述",enabled:"已启用",disabled:"已禁用",optional:"可选",version:"版本",select:"选择",selectAll:"全选",deselectAll:"取消全选"},nde={justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",yesterday:"昨天"},ade={newFile:"新建文件",newFolder:"新建文件夹",rename:"重命名",move:"移动",copyPath:"复制路径",openInEditor:"在编辑器中打开"},ide={loading:"正在加载 Pixcode",settingUpWorkspace:"正在设置您的工作空间...",chooseProject:"选择您的项目",selectProjectDescription:"从侧边栏选择一个项目以开始使用 Claude 进行编程。每个项目包含您的聊天会话和文件历史。",tip:"提示",createProjectMobile:"点击上方的菜单按钮以访问项目",createProjectDesktop:"点击侧边栏中的文件夹图标以创建新项目",newSession:"新会话",untitledSession:"未命名会话",projectFiles:"项目文件",landing:{title:"启动 Pixcode 工作区",description:"选择一个项目、开始新聊天,或用一个目标启动编排。编排会管理你选择的 CLI Agent,显示每一步,并直接展示错误。",startOrchestration:"启动编排",startOrchestrationDescription:"自动创建项目,并打开带有 Agent 控制和运行历史的编排界面。",startChat:"开始新聊天",startChatDescription:"自动创建文件夹,并用单个 Agent 打开普通聊天界面。",sidebarHint:"从侧边栏选择现有项目时,聊天历史、文件、git 状态、任务和编排会保留在同一个主界面中。"}},sde={loading:"正在加载文件...",files:"文件",simpleView:"简单视图",compactView:"紧凑视图",detailedView:"详细视图",searchPlaceholder:"搜索文件和文件夹...",clearSearch:"清除搜索",name:"名称",size:"大小",modified:"修改时间",permissions:"权限",noFilesFound:"未找到文件",checkProjectPath:"检查项目路径是否可访问",noMatchesFound:"未找到匹配项",tryDifferentSearch:"尝试不同的搜索词或清除搜索",justNow:"刚刚",minAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",newFile:"新建文件 (Cmd+N)",newFolder:"新建文件夹 (Cmd+Shift+N)",refresh:"刷新",collapseAll:"全部折叠",context:{rename:"重命名",delete:"删除",copyPath:"复制路径",download:"下载",newFile:"新建文件",newFolder:"新建文件夹",refresh:"刷新",menuLabel:"文件上下文菜单",loading:"加载中..."}},ode={title:"创建新项目",steps:{type:"类型",configure:"配置",confirm:"确认"},step1:{question:"您已经有工作区,还是想创建一个新的工作区?",existing:{title:"现有工作区",description:"我的服务器上已经有工作区,只需要将其添加到项目列表中"},new:{title:"新建工作区",description:"创建一个新工作区,可选择从 GitHub 仓库克隆"},githubClone:{title:"从 GitHub 克隆",description:"选择目标文件夹并将仓库克隆到其中"},subfolder:{title:"创建子文件夹",description:"选择父文件夹并在其中创建新的子文件夹"}},step2:{existingPath:"工作区路径",newPath:"工作区路径",subfolderParentPath:"父文件夹",subfolderParentHelp:"将创建新子文件夹的父文件夹路径",subfolderName:"子文件夹名称",subfolderNameHelp:"将以此名称在父文件夹内创建新文件夹",existingPlaceholder:"/path/to/existing/workspace",newPlaceholder:"/path/to/new/workspace",existingHelp:"您现有工作区目录的完整路径",newHelp:"工作区目录的完整路径",githubUrl:"GitHub URL(可选)",githubPlaceholder:"https://github.com/username/repository",githubHelp:"可选:提供 GitHub URL 以克隆仓库",githubAuth:"GitHub 身份验证(可选)",githubAuthHelp:"仅私有仓库需要。公共仓库无需身份验证即可克隆。",loadingTokens:"正在加载已保存的令牌...",storedToken:"已保存的令牌",newToken:"新令牌",nonePublic:"无(公共)",selectToken:"选择令牌",selectTokenPlaceholder:"-- 选择令牌 --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"此令牌仅用于此操作",publicRepoInfo:"公共仓库不需要身份验证。如果克隆公共仓库,可以跳过提供令牌。",noTokensHelp:"没有可用的已保存令牌。您可以在 设置 → API 密钥 中添加令牌以便重复使用。",optionalTokenPublic:"GitHub 令牌(公共仓库可选)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(公共仓库可留空)"},step3:{reviewConfig:"查看您的配置",workspaceType:"工作区类型:",existingWorkspace:"现有工作区",newWorkspace:"新建工作区",subfolderWorkspace:"新子文件夹",path:"路径:",parentPath:"父路径:",subfolderName:"子文件夹名称:",cloneFrom:"克隆自:",authentication:"身份验证:",usingStoredToken:"使用已保存的令牌:",usingProvidedToken:"使用提供的令牌",noAuthentication:"无身份验证",sshKey:"SSH 密钥",existingInfo:"工作区将被添加到您的项目列表中,并可用于 Claude/Cursor 会话。",newWithClone:"仓库将从此文件夹克隆。",newEmpty:"工作区将被添加到您的项目列表中,并可用于 Claude/Cursor 会话。",subfolderInfo:"将在父文件夹内创建新子文件夹并添加到您的项目列表。",cloningRepository:"正在克隆仓库..."},buttons:{cancel:"取消",back:"返回",next:"下一步",createProject:"创建项目",creating:"创建中...",cloning:"正在克隆..."},errors:{selectType:"请选择您已有现有工作区还是想创建新工作区",providePath:"请提供工作区路径",provideSubfolderName:"请为子文件夹提供一个名称",subfolderNameInvalid:"子文件夹名称不能包含路径分隔符或为 . / ..",failedToCreate:"创建工作区失败",failedToCreateFolder:"创建文件夹失败"}},lde={genericTool:"工具",codes:{generic:{info:{title:"通知"}},permission:{required:{title:"需要处理",body:"{{toolName}} 正在等待你的决策。"}},run:{stopped:{title:"运行已停止",body:"原因:{{reason}}"},failed:{title:"运行失败"}},agent:{notification:{title:"Agent 通知"}}}},cde={title:"有可用更新",newVersionReady:"新版本已准备就绪",currentVersion:"当前版本",latestVersion:"最新版本",whatsNew:"新内容:",viewFullRelease:"查看完整发布",updateProgress:"更新进度:",manualUpgrade:"手动升级:",npmUpgradeCommand:"npm install -g @pixelbyte-software/pixcode@latest",pixcodeUpgradeCommand:"pixcode update --restart-daemon",manualUpgradeHint:"或点击'立即更新'以自动运行更新。",updateCompleted:"更新成功完成!",restartServer:"请重启服务器以应用更改。",updateFailed:"更新失败",buttons:{close:"关闭",later:"稍后",copyCommand:"复制命令",updateNow:"立即更新",updating:"更新中..."},ariaLabels:{closeModal:"关闭版本升级模态框",showSidebar:"显示侧边栏",settings:"设置",updateAvailable:"有可用更新",closeSidebar:"关闭侧边栏"}},dde={title:"编排",subtitle:"在 {{project}} 中输入一个目标;选择 CLI 工作单元,需要时复制同一种 CLI,并直接分配任务或交给协调器拆分。",refresh:"刷新",goal:"目标",goalPlaceholder:"示例:修复认证界面以适配单端口部署,捕获错误,并用 lint 和 typecheck 验证。",mode:"运行模式",systemPlan:"系统计划",noMode:"未选择模式",loadingPlan:"正在加载 Agent 计划。",start:"启动团队",starting:"正在启动",needAgent:"至少启用一个 CLI 工作单元。",startFailed:"无法启动 workflow。",cliControl:"CLI 团队",enabledCount:"已启用 {{count}} 个",enabled:"启用",disabled:"禁用",history:"历史",emptyHistory:"还没有运行记录。输入目标并启动 Agent。",steps:"{{done}}/{{total}} 步",notSelected:"未选择运行",notSelectedDescription:"选择以前的运行或启动新目标。Agent 消息、错误、变更摘要和预览输出会显示在这里。",loadFailed:"无法加载运行详情。",loadingRun:"正在加载运行...",agentSteps:"Agent 步骤",noStepOutput:"没有步骤输出。",agentMessages:"Agent 消息",noAgentMessages:"此 Agent 尚未生成消息。如果运行失败,真实 CLI 错误会显示在上方。",outputs:"输出",noOutputs:"还没有变更摘要、预览或命令输出。",open:"打开",artifact:{fileDiff:"变更摘要",previewUrl:"预览",commandOutput:"命令输出"},role:{user:"用户",agent:"Agent"},status:{queued:"排队中",running:"运行中",completed:"已完成",failed:"错误",canceled:"已取消",skipped:"已跳过"},nodes:{codex_review:"Codex 审查",gemini_review:"Gemini 审查",claude_review:"Claude 审查",claude_code_review:"Claude 审查",cursor_review:"Cursor 审查",aggregate:"汇总",architect:"规划",implement:"实现",review:"审查",proposal:"方案",critique:"批评",response:"回应",judge:"决策",coordinator:"协调器",final_report:"最终报告"},workflows:{multi_model_review:{name:"多模型审查",description:"启用的 CLI Agent 会分别审查同一个目标,然后由一个启用的 Agent 汇总结果。"},sequential_handoff:{name:"顺序交接",description:"Agent 按顺序规划、实现并审查。禁用的 CLI 步骤会被跳过。"},adversarial_debate:{name:"决策辩论",description:"Agent 提出方案、批评、回应,并生成最终建议。"},agent_team:{name:"智能体团队",description:"协调器读取目标和已启用的 CLI 实例,分配工作,然后汇总结果。"}},adapters:{"claude-code":{label:"Claude Code",role:"CLI 工作单元"},cursor:{label:"Cursor",role:"CLI 工作单元"},codex:{label:"Codex",role:"CLI 工作单元"},gemini:{label:"Gemini",role:"CLI 工作单元"},qwen:{label:"Qwen Code",role:"CLI 工作单元"},opencode:{label:"OpenCode",role:"CLI 工作单元"}},activeCount:"{{active}}/{{total}} 已启用",teamHint:"每一行都是一个 CLI 工作单元。你可以创建多个 Claude、Codex、Cursor、Gemini、Qwen 或 OpenCode,并为每个单元写不同任务。",parallelLimit:"并行上限",addAgent:"添加 {{agent}}",duplicateAgent:"复制 {{agent}}",removeAgent:"移除 {{agent}}",assignment:"任务分配",assignmentPlaceholder:"可选:明确写下这个工作单元要处理什么。留空则由协调器按目标分配。",agentInstance:"{{name}} #{{number}}",taskTitle:"任务",taskTitlePlaceholder:"实现功能",taskDescription:"描述",taskDescriptionPlaceholder:"范围、约束、预期输出",addTask:"添加",runTask:"运行",cancelTask:"取消",dispatchTask:"分配任务",adapter:"适配器",isolation:"隔离",dispatch:"分配",auto:"自动",waitingForStream:"等待流输出...",workflow:"工作流",input:"输入",taskStates:{todo:"待办",in_progress:"进行中",in_review:"审核中",done:"完成",failed:"失败",canceled:"已取消"},isolationKind:{worktree:"Worktree",host:"Host",docker:"Docker"},stop:"停止团队",stopping:"正在停止",cancelFailed:"无法停止工作流。",needRoles:"此模式需要至少为以下角色分配一个已启用的 Agent:{{roles}}。",quickPrompts:{label:"快速提示:",liveTrading:{label:"8024 实时交易界面",prompt:"你好,请创建一个小项目,然后在 8024 端口运行。我需要一个连接 Binance FAPI 的 TradingView 风格设计,包含 TradingView 图表以及左侧星标/收藏系统。请合理拆分工作并自动管理流程。"}},teamHistory:"团队历史",changeSummary:"变更摘要",noChangeSummary:"最终摘要尚未生成。Agent 完成后,这里会显示可读的 Markdown 摘要。",prepareTeamFromReport:"用此报告准备 Agent 团队",prepareTeamTitle:"准备 Agent 团队提示词",prepareTeamDescription:"讨论输出已转换为新的 Agent Team 提示词。你可以编辑它,然后切换到 Agent Team 模式。",usePreparedPrompt:"使用提示词",reportToPromptPrefix:"根据以下讨论/决策报告准备并执行一个 Agent 团队。将需求拆分为任务,为可用 CLI Agent 提出合理分配,并在用户确认后启动。",generatedSummaryTitle:"自动运行摘要",summaryStatus:"整体状态",summarySteps:"已完成步骤",summaryFailures:"失败步骤",summaryCanceled:"已取消步骤",summaryDiffs:"Diff/变更输出",summaryPreviews:"预览输出",summaryErrorPrefix:"错误",assignedWork:"已分配工作",autoAssigned:"自动 / 由协调器决定",stages:{coordinator:"协调器",handoff:"交接",backend:"后端",frontend:"前端",implementation:"实现",review:"审查",repair:"修复",proposal:"提案",critique:"批评",response:"回应",decision:"决策",report:"报告",final_report:"最终报告"},agentRole:"阶段",agentRoles:{auto:"自动",backend:"后端",frontend:"前端",review:"测试 / 审查",implementation:"实现",proposal:"提案",critique:"批评",response:"回应",decision:"决策 / 报告",report:"报告",custom:"自定义"},customRolePlaceholder:"例如:安全、移动端 UX、数据库架构",roleHints:{default:"留空时,协调器会根据目标为此 Agent 分配任务。",agent_team:"可选择后端、前端或审查阶段,也可保持自动。",multi_model_review:"已启用的 Agent 会进行审查;如果选择报告角色,该 Agent 会汇总最终摘要。",sequential_handoff:"Agent 按你选择的顺序运行;任务文本定义每一步的范围。",adversarial_debate:"决策讨论中阶段选择是可选的;留空时系统会按顺序将所选 Agent 分配为提案、批评和回应。"},soloAgent:"仅使用 {{agent}} 运行",soloAgentShort:"单独",cliSettings:"CLI 设置",workspaceTarget:"目标工作区",workspaceTargets:{selectedProject:"已选项目",pixcodeApp:"Pixcode 系统",custom:"自定义路径"},customWorkspacePlaceholder:"/path/to/project",workspaceTargetHint:"智能体将在此目录运行:{{path}}",autoDetect:"自动检测",needWorkspacePath:"请输入自定义工作区路径。",hermesTitle:"Hermes Agent",hermesSubtitle:"Hermes is running inside Pixcode for {{project}} and can coordinate local checks, tests, terminal work, and project operations.",hermesCliControl:"Hermes CLI control"},ude={title:"控制室",subtitle:"{{target}} 的生产、平台、管理、审计和自托管访问",thisServer:"此服务器",refresh:"刷新",nav:{overview:"概览",production:"生产",admin:"管理",team:"团队",secrets:"密钥",marketplace:"市场",eval:"评估",usage:"用量",security:"安全",access:"访问"},overview:{title:"v1.46 launch surface",description:"Every box below is backed by a v1.44-v1.45 API and is now visible from the UI.",latestAuditEvents:"Latest audit events",remoteAccessOptions:"Remote access options"},metrics:{issueRuns:"Issue-to-PR runs",reviewItems:"Review items",subUsers:"Sub-users",collaborators:"Project collaborators",secrets:"Scoped secrets",marketplace:"Marketplace entries",evalRuns:"Evaluation runs",securityAudits:"Security audits"},sections:{production:{title:"Production loop",description:"Start issue-to-PR runs, parse CI failures, review changes, schedule background jobs, and create checkpoints."},admin:{title:"管理系统",description:"在单个自托管 Pixcode 服务器中创建子用户、禁用账号并查看活动。"},team:{title:"项目协作者",description:"按项目分配 partner、worker、reviewer 和 viewer,而不是让所有人成为全局管理员。"},secrets:{title:"Secret vault",description:"Store scoped env secrets and preview what each provider, project, workflow, Telegram, or API run receives."},marketplace:{title:"MCP/plugin marketplace",description:"Register MCP servers, workflow templates, provider adapters, and notification channels with permission review and health."},eval:{title:"Evaluation harness",description:"Create regression suites and compare provider/model runs with pass rate and latency."},usage:{title:"Cost, token, and latency dashboard",description:"Monitor provider/model/workflow usage for demos and operations."},security:{title:"Security audit mode",description:"Run dependency audit, secret scan, permission audit, and agent output leak detection workflows."},access:{title:"自托管访问",description:"没有固定域名时使用 Tailscale,或配置 Cloudflare Tunnel/custom domain 获得稳定公开 URL。"}},panels:{issueToPr:"Issue-to-PR run",ciRepair:"CI repair parser",reviewQueue:"Review queue",schedulerCheckpoints:"Scheduler and checkpoints",createSubUser:"Create sub-user",rolePermissions:"Role permissions",addCollaborator:"Add collaborator",createSecret:"Create secret",scopedEnvPreview:"Scoped env preview",addMarketplaceEntry:"Add marketplace entry",createSuite:"Create suite",recordRun:"Record run",recordUsageEvent:"Record usage event",createAuditRun:"Create audit run",auditLog:"Audit log",remoteAccessSetup:"Remote access setup"},lists:{recentJobs:"Recent jobs",recentCheckpoints:"Recent checkpoints",subUsers:"Sub-users",collaborators:"Collaborators",includedEnvNames:"Included env names",vaultEntries:"Vault entries",marketplaceEntries:"Marketplace entries",suites:"Suites",runs:"Runs",auditRuns:"Audit runs",configuredAccessPaths:"Configured access paths"},buttons:{queueRun:"Queue run",parseFailure:"Parse failure",createReviewItem:"Create review item",scheduleJob:"Schedule job",createCheckpoint:"Create checkpoint",createUser:"Create user",disable:"Disable",enable:"Enable",addCollaborator:"Add collaborator",storeSecret:"Store secret",previewEnv:"Preview env",saveEntry:"Save entry",markHealthy:"Mark healthy",createSuite:"Create suite",recordRun:"Record run",recordUsage:"Record usage",createAudit:"Create audit",exportJson:"Export JSON",exportCsv:"Export CSV",saveAccessPath:"Save access path",checkUrl:"Check URL",checkTailscale:"Check Tailscale"},placeholders:{githubIssueUrl:"GitHub issue URL",manualTitle:"Manual title fallback",model:"Model",baseBranch:"Base branch",ciLog:"Paste failing CI, lint, typecheck, or build output",reviewTitle:"Review title",notes:"Notes",changedFiles:"Changed files, one per line",jobName:"Job name",cronExpression:"Cron or watch expression",checkpointReason:"Checkpoint reason",backgroundPrompt:"Background agent prompt",checkpointFiles:"Checkpoint changed files, one per line",usernameEmail:"Username or email",temporaryPassword:"Temporary password",userEmailUsername:"User email or username",secretName:"Secret name",envName:"ENV_NAME",secretTarget:"Target project/provider/workflow",secretValue:"Secret value",workflowId:"Workflow id",name:"Name",pluginSource:"Source package or repository",installCommand:"Install command",permissionScopes:"Permission scopes, one per line",suiteName:"Suite name",description:"Description",firstTaskTitle:"First task title",acceptanceCriteria:"Acceptance criteria, one per line",suiteId:"Suite id",latencyMs:"Latency ms",passedCount:"Passed count",failedCount:"Failed count",workflow:"Workflow",inputTokens:"Input tokens",outputTokens:"Output tokens",costUsd:"Cost USD",optionalFindingTitle:"Optional finding title",auditFilter:"Filter audit log by user, project, event, or file",label:"Label",url:"URL",targetPort:"Target port"},labels:{project:"project",path:"path",providerModel:"provider/model",branch:"branch",failedCommands:"Failed commands",files:"Files",lastActive:"Last active",role:"role",tasks:"tasks",pass:"pass",health:"Health",reachable:"reachable",installed:"installed",loggedIn:"logged in"},columns:{provider:"Provider",model:"Model",workflow:"Workflow",runs:"Runs",tokens:"Tokens",cost:"Cost",latency:"Latency",errorRate:"Error rate"},fallback:{selectedProject:"selected project",projectPath:"project path",noneDetected:"none detected",noUrl:"No URL",global:"global",noSource:"No source",regressionSuite:"Regression suite",demoTask:"Demo task",provider:"provider",reviewRequired:"Review required.",notAvailable:"not available"},capabilities:{partner:"can approve actions, manage secrets, and use shell",projectScoped:"project-scoped access only"},teamAccess:{title:"协作者如何访问",stepUsers:"创建子用户",stepUsersDescription:"在 Admin system 中用 member、viewer、project_worker 或 project_partner 等全局角色创建此人。",stepRole:"分配项目角色",stepRoleDescription:"将同一用户加入项目协作者,让他们只看到并操作你选择的项目。",stepLink:"共享访问路径",stepLinkDescription:"共享 Self-hosted access 中配置的 Tailscale、Cloudflare Tunnel、custom domain 或 LAN URL。",paths:"可用访问链接"},badges:{public:"public",private:"private"},empty:{noAuditEvents:"No audit events yet.",noRemoteAccessConfigs:"No remote access configs yet.",noReviewItems:"No review items yet.",noRecentJobs:"No recent jobs yet.",noRecentCheckpoints:"No recent checkpoints yet.",noSubUsers:"No sub-users yet.",noCollaborators:"No project collaborators yet.",noAccessPaths:"No access paths configured yet.",noIncludedEnvNames:"No included env names yet.",noSecrets:"No secrets yet.",noMarketplaceEntries:"No marketplace entries yet.",noSuites:"No suites yet.",noRuns:"No runs yet.",usageSummary:"Usage appears here after provider or workflow events are recorded.",noSecurityAudits:"No security audits yet.",noAuditMatches:"No audit entries match the current filter."}},pde={title:"VS Code 工作区",noProject:"未选择项目",activity:{explorer:"资源管理器",projects:"项目",sourceControl:"源代码管理",terminal:"终端",showPanel:"显示左侧面板",hidePanel:"隐藏左侧面板"},panels:{explorer:"资源管理器",projects:"项目",sourceControl:"源代码管理",terminal:"终端",editor:"编辑器",cli:"CLI",rightTerminal:"终端"},editor:{emptyTitle:"从资源管理器打开文件",closeTab:"关闭 {{file}}",scrollLeft:"向左滚动标签",scrollRight:"向右滚动标签",moreActions:"更多标签操作",closeSplit:"关闭拆分编辑器",context:{close:"关闭",closeAll:"全部关闭",copyPath:"复制路径",splitRight:"向右拆分",splitMoveRight:"向右拆分并移动"}},resize:{left:"调整左侧面板",right:"调整 CLI 面板"},menu:{openProject:"打开项目...",cloneFromGithub:"克隆仓库...",newChat:"新建聊天",openProjects:"打开项目"},projects:{openProject:"打开项目",cloneFromGithub:"克隆",directoryList:"目录",refresh:"刷新项目",emptyTitle:"还没有项目目录",emptyDescription:"打开本地文件夹或克隆仓库即可开始。",selected:"已选择",startChat:"聊天",fileCount:"{{formattedCount}} 个文件",fileCountPending:"正在准备文件",startTitle:"Start a Pixcode workspace",startDescription:"Pick a folder and Pixcode will bind the explorer, terminal, and chat history to that workspace.",workHere:"Work in this folder"},workspace:{empty:"打开项目以创建 Workspace 1。",openFirst:"打开工作区",add:"添加工作区",scrollLeft:"向左滚动工作区",scrollRight:"向右滚动工作区",close:"关闭 {{name}}",closeAction:"关闭工作区",closeOthers:"关闭其他",closeAll:"全部关闭",rename:"重命名",star:"标星",unstar:"取消标星",toggleStar:"标星 {{name}}",moreActions:"工作区操作"},cli:{projectScoped:"项目范围 CLI 终端",chooseTitle:"启动 CLI 终端",chooseDescription:"选择 CLI,然后启动全高终端。",startSelected:"启动 {{provider}}",newSession:"新建 CLI 会话",history:"历史",noHistory:"此项目还没有会话。",projectHistory:"项目历史",checking:"检查中...",ready:"就绪",notInstalled:"未安装",installing:"安装中...",updateAvailable:"更新到 {{version}}",installProvider:"安装 {{provider}}",updateProvider:"更新 {{provider}}",manualInstall:"此 CLI 需要手动安装。",installNoJob:"安装未返回 job id。",installFailed:"安装失败。",installStreamLost:"安装流过早关闭。安装可能仍在运行。",provider:"提供方",installRunning:"正在安装",installDone:"已就绪",installError:"需要处理",showPanel:"显示 CLI 面板",hidePanel:"隐藏 CLI 面板",close:"关闭终端"},terminal:{title:"终端",close:"关闭终端"},hermes:{title:"Hermes Agent",installTitle:"安装 Hermes Agent",description:"项目范围的代理终端。缺少 Hermes 时会先安装,然后在此工作区中打开。",start:"启动 Hermes",install:"安装",newSession:"新建 Hermes 会话",history:"Hermes 历史记录",connect:"连接 Hermes Agent",ready:"就绪",installRunning:"正在通过 Pixcode API 安装 Hermes...",installDone:"Hermes 已安装,Pixcode MCP 已配置。",installError:"Hermes 安装失败。",installReady:"已准备好安装 Hermes。",installWaiting:"正在等待 Hermes 安装日志...",retryInstall:"重试安装",installFailed:"Hermes 安装失败。",installStreamLost:"Hermes 安装流提前关闭。安装可能仍在运行。"}},mde={buttons:Xce,tabs:Jce,status:Qce,messages:ede,navigation:tde,common:rde,time:nde,fileOperations:ade,mainContent:ide,fileTree:sde,projectWizard:ode,notifications:lde,versionUpdate:cde,orchestration:dde,controlRoom:ude,vscodeWorkbench:pde},hde="设置",fde={account:"账户",permissions:"权限",mcpServers:"MCP 服务器",appearance:"外观"},gde={title:"账户",language:"语言",languageLabel:"显示语言",languageDescription:"选择您偏好的界面语言",username:"用户名",email:"邮箱",profile:"个人资料",changePassword:"修改密码"},bde={title:"MCP 服务器",addServer:"添加服务器",editServer:"编辑服务器",deleteServer:"删除服务器",serverName:"服务器名称",serverType:"服务器类型",config:"配置",testConnection:"测试连接",status:"状态",connected:"已连接",disconnected:"未连接",scope:{label:"范围",user:"用户",project:"项目"}},xde={title:"外观",theme:"主题",codeEditor:"代码编辑器",editorTheme:"编辑器主题",wordWrap:"自动换行",showMinimap:"显示缩略图",lineNumbers:"行号",fontSize:"字体大小"},yde={saveChanges:"保存更改",resetToDefaults:"重置为默认值",cancelChanges:"取消更改"},vde={title:"快速设置",sections:{appearance:"外观",toolDisplay:"工具显示",viewOptions:"视图选项",inputSettings:"输入设置",changeAwareness:"掌控中心"},darkMode:"深色模式",autoExpandTools:"自动展开工具",showRawParameters:"显示原始参数",showThinking:"显示思考过程",autoScrollToBottom:"自动滚动到底部",sendByCtrlEnter:"使用 Ctrl+Enter 发送",sendByCtrlEnterDescription:"启用后,按 Ctrl+Enter 发送消息,而不是仅按 Enter。这对于使用输入法的用户可以避免意外发送。",changeAwareness:"掌控中心",changedFiles:{title:"已更改文件",description:"跟踪本地文件更改,并在出现新更改时打开文件面板。",noProject:"选择一个项目以跟踪本地更改。",refresh:"刷新已更改文件",empty:"未检测到本地更改",disabled:"启用掌控中心以监控本地更改。",more:"还有 {{count}} 个文件",lastChecked:"检查于 {{value}}",guideTitle:"右侧面板指南",guideFiles:"已更改文件会在文件面板中以绿色高亮。",guidePanel:"新更改会自动打开分屏面板。",status:{M:"M",A:"A",D:"D",U:"U"}},dragHandle:{dragging:"正在拖拽手柄",closePanel:"关闭设置面板",openPanel:"打开设置面板",draggingStatus:"正在拖拽...",toggleAndMove:"点击切换,拖拽移动"}},wde={title:"终端快捷键",sectionKeys:"按键",sectionNavigation:"导航",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"上箭头",arrowDown:"下箭头",scrollDown:"滚动到底部",handle:{closePanel:"关闭快捷键面板",openPanel:"打开快捷键面板"}},kde={label:"设置",agents:"智能体",hermes:"Hermes Agent",appearance:"外观",git:"Git",apiTokens:"API 和令牌",notifications:"通知",plugins:"插件",mobile:"移动端使用",telegram:"Telegram",about:"关于",access:"访问"},Sde={title:"通知",description:"控制你希望接收的通知事件。",webPush:{title:"Web 推送通知",enable:"启用推送通知",disable:"关闭推送通知",enabled:"推送通知已启用",loading:"更新中...",unsupported:"此浏览器不支持推送通知。",denied:"推送通知已被阻止,请在浏览器设置中允许。"},events:{title:"事件类型",actionRequired:"需要处理",stop:"运行已停止",error:"运行失败"}},Cde={darkMode:{label:"深色模式",description:"切换浅色和深色主题"},projectSorting:{label:"项目排序",description:"项目在侧边栏中的排列方式",alphabetical:"按字母顺序",recentActivity:"最近活动"},codeEditor:{title:"代码编辑器",theme:{label:"编辑器主题",description:"代码编辑器的默认主题"},wordWrap:{label:"自动换行",description:"在编辑器中默认启用自动换行"},showMinimap:{label:"显示缩略图",description:"在差异视图中显示缩略图以便于导航"},lineNumbers:{label:"显示行号",description:"在编辑器中显示行号"},fontSize:{label:"字体大小",description:"编辑器字体大小(px)"}}},Nde={title:{add:"添加 MCP 服务器",edit:"编辑 MCP 服务器"},importMode:{form:"表单输入",json:"JSON 导入"},scope:{label:"范围",userGlobal:"用户(全局)",projectLocal:"项目(本地)",userDescription:"用户范围:在您机器上的所有项目中可用",projectDescription:"本地范围:仅在选定项目中可用",cannotChange:"编辑现有服务器时无法更改范围"},fields:{serverName:"服务器名称",transportType:"传输类型",command:"命令",arguments:"参数(每行一个)",jsonConfig:"JSON 配置",url:"URL",envVars:"环境变量(KEY=值,每行一个)",headers:"请求头(KEY=值,每行一个)",selectProject:"选择项目..."},placeholders:{serverName:"我的服务"},validation:{missingType:"缺少必填字段:type",stdioRequiresCommand:"stdio 类型需要 command 字段",httpRequiresUrl:"{{type}} 类型需要 url 字段",invalidJson:"无效的 JSON 格式",jsonHelp:"粘贴您的 MCP 服务器配置(JSON 格式)。示例格式:",jsonExampleStdio:'• stdio: {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse: {"type":"http","url":"https://api.example.com/mcp"}'},configDetails:"配置详细信息(来自 {{configFile}})",projectPath:"路径:{{path}}",actions:{cancel:"取消",saving:"保存中...",addServer:"添加服务器",updateServer:"更新服务器"}},Ede={success:"设置保存成功!",error:"保存设置失败",saving:"保存中..."},Tde={save:"保存设置",cancel:"取消"},Ade={title:"Git 配置",description:"配置您的 git 提交身份。这些设置将通过 git config --global 全局应用",name:{label:"Git 名称",help:"您的 git 提交名称"},email:{label:"Git 邮箱",help:"您的 git 提交邮箱"},actions:{save:"保存配置",saving:"保存中..."},status:{success:"保存成功"}},jde={title:"API 密钥",description:"生成 API 密钥以从其他应用访问外部 API。",newKey:{alertTitle:"⚠️ 保存您的 API 密钥",alertMessage:"这是您唯一一次看到此密钥。请妥善保存。",iveSavedIt:"我已保存"},form:{placeholder:"API 密钥名称(例如:生产服务器)",createButton:"创建",cancelButton:"取消"},newButton:"新建 API 密钥",empty:"尚未创建 API 密钥。",list:{created:"创建时间:",lastUsed:"最后使用:"},confirmDelete:"确定要删除此 API 密钥吗?",status:{active:"激活",inactive:"未激活"},github:{title:"GitHub 令牌",description:"添加 GitHub 个人访问令牌以通过外部 API 克隆私有仓库。",descriptionAlt:"添加 GitHub 个人访问令牌以克隆私有仓库。您也可以直接在 API 请求中传递令牌而无需存储。",addButton:"添加令牌",form:{namePlaceholder:"令牌名称(例如:个人仓库)",tokenPlaceholder:"GitHub 个人访问令牌(ghp_...)",descriptionPlaceholder:"描述(可选)",addButton:"添加令牌",cancelButton:"取消",howToCreate:"如何创建 GitHub 个人访问令牌 →"},empty:"尚未添加 GitHub 令牌。",added:"添加时间:",confirmDelete:"确定要删除此 GitHub 令牌吗?"},apiDocsLink:"API 文档",documentation:{title:"外部 API 文档",description:"了解如何使用外部 API 从您的应用程序触发 Claude/Cursor 会话。",viewLink:"查看 API 文档 →"},loading:"加载中...",version:{updateAvailable:"有可用更新:v{{version}}"}},Ide={authStatus:{checking:"检查中...",connected:"已连接",notConnected:"未连接",disconnected:"已断开",checkingAuth:"正在检查认证状态...",loggedInAs:"登录为 {{email}}",authenticatedUser:"已认证用户"},account:{claude:{description:"Anthropic Claude AI 助手"},cursor:{description:"Cursor AI 驱动的代码编辑器"},codex:{description:"OpenAI Codex AI 助手"},gemini:{description:"Google Gemini AI 助手"},qwen:{description:"阿里巴巴 Qwen Code CLI (Gemini CLI 分支)"}},connectionStatus:"连接状态",login:{title:"登录",reAuthenticate:"重新认证",description:"登录您的 {{agent}} 账户以启用 AI 功能",reAuthDescription:"使用其他账户登录或刷新凭据",button:"登录",reLoginButton:"重新登录"},error:"错误:{{error}}"},_de={title:"权限设置",skipPermissions:{label:"跳过权限提示(请谨慎使用)",claudeDescription:"等同于 --dangerously-skip-permissions 标志",cursorDescription:"等同于 Cursor CLI 中的 -f 标志",opencodeDescription:"等同于 OpenCode 的 --dangerously-skip-permissions 标志"},allowedTools:{title:"允许的工具",description:"无需权限提示即可自动使用的工具",placeholder:'例如:"Bash(git log:*)" 或 "Write"',quickAdd:"快速添加常用工具:",empty:"未配置允许的工具"},blockedTools:{title:"禁用的工具",description:"无需权限提示即可自动禁用的工具",placeholder:'例如:"Bash(rm:*)"',empty:"未配置禁用的工具"},allowedCommands:{title:"允许的 Shell 命令",description:"无需权限提示即可自动执行的 Shell 命令",placeholder:'例如:"Shell(ls)" 或 "Shell(git status)"',quickAdd:"快速添加常用命令:",empty:"未配置允许的命令"},blockedCommands:{title:"阻止的 Shell 命令",description:"自动阻止的 Shell 命令",placeholder:'例如:"Shell(rm -rf)" 或 "Shell(sudo)"',empty:"未配置阻止的命令"},toolExamples:{title:"工具模式示例:",bashGitLog:"- 允许所有 git log 命令",bashGitDiff:"- 允许所有 git diff 命令",write:"- 允许所有 Write 工具使用",bashRm:"- 阻止所有 rm 命令(危险)"},shellExamples:{title:"Shell 命令示例:",ls:"- 允许 ls 命令",gitStatus:"- 允许 git status",npmInstall:"- 允许 npm install",rmRf:"- 阻止递归删除"},opencodeAllowed:{title:"允许的 Bash 模式",description:"OpenCode 自动批准、无需提示的 Bash 命令模式",placeholder:'如:"git *" 或 "npm test"',quickAdd:"快速添加常用模式:",empty:"尚未配置允许的模式"},opencodeBlocked:{title:"屏蔽的 Bash 模式",description:"OpenCode 始终拒绝的 Bash 命令模式",placeholder:'如:"rm -rf *" 或 "sudo *"',empty:"尚未配置屏蔽的模式"},opencodeExamples:{title:"模式示例:",gitAll:"- 允许所有 git 命令",gitPush:"- 单独屏蔽 git push",rmRf:"- 屏蔽递归删除",npm:"- 允许所有 npm 命令"},codex:{permissionMode:"权限模式",description:"控制 Codex 如何处理文件修改和命令执行",modes:{default:{title:"默认",description:"只有受信任的命令(ls、cat、grep、git status 等)会自动运行。其他命令将被跳过。可以写入工作区。"},acceptEdits:{title:"接受编辑",description:"所有命令在工作区内自动运行。具有沙箱执行的全自动模式。"},bypassPermissions:{title:"绕过权限",description:"完全系统访问,无任何限制。所有命令自动运行,具有完整的磁盘和网络访问权限。请谨慎使用。"}},technicalDetails:"技术详情",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted。受信任的命令:cat、cd、grep、head、ls、pwd、tail、git status/log/diff/show、find(不带 -exec)等。",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never。所有命令在项目目录内自动执行。",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never。完全系统访问权限,仅在可信环境中使用。",overrideNote:"您可以使用聊天界面中的模式按钮按会话覆盖此设置。"}},actions:{add:"添加"}},Rde={title:"MCP 服务器",description:{claude:"Model Context Protocol 服务器为 Claude 提供额外的工具和数据源",cursor:"Model Context Protocol 服务器为 Cursor 提供额外的工具和数据源",codex:"Model Context Protocol 服务器为 Codex 提供额外的工具和数据源"},addButton:"添加 MCP 服务器",empty:"未配置 MCP 服务器",serverType:"类型",scope:{local:"本地",user:"用户"},config:{command:"命令",url:"URL",args:"参数",environment:"环境变量"},tools:{title:"工具",count:"({{count}}):",more:"还有 {{count}} 个"},actions:{edit:"编辑服务器",delete:"删除服务器"},help:{title:"关于 Codex MCP",description:"Codex 支持基于 stdio 的 MCP 服务器。您可以添加服务器,通过额外的工具和资源来扩展 Codex 的功能。"}},Lde={title:"插件",description:"通过自定义插件扩展界面。从 git 安装或直接将文件夹放入 ~/.pixcode/plugins/",installPlaceholder:"https://github.com/user/my-plugin",installButton:"安装",installing:"安装中…",securityWarning:"仅安装您已审查过源代码或信任作者的插件。",scanningPlugins:"正在扫描插件…",noPluginsInstalled:"未安装插件",pullLatest:"从 git 拉取最新内容",noGitRemote:"无 git 远程仓库 — 无法更新",uninstallPlugin:"卸载插件",confirmUninstall:"再次点击确认",confirmUninstallMessage:"移除 {{name}}?此操作无法撤销。",cancel:"取消",remove:"移除",updateFailed:"更新失败",installFailed:"安装失败",uninstallFailed:"卸载失败",toggleFailed:"切换失败",buildYourOwn:"构建您自己的插件",starter:"入门模板",docs:"文档",starterPlugin:{name:"项目统计",badge:"入门",description:"查看项目的文件数、代码行数、文件类型分布以及最近活动。",install:"安装"},morePlugins:"更多",enable:"启用",disable:"禁用",installAriaLabel:"插件 git 仓库 URL",tab:"标签",runningStatus:"运行中"},Pde={title:"访问",description:"选择用户如何访问这个自托管 Pixcode 服务器。先用同一网络验证;需要远程访问时,再使用安全隧道、Tailscale 或自己的域名。",refresh:"刷新",copy:"复制",copied:"已复制",save:"保存访问路径",check:"检查 URL",qrAlt:"{{url}} 的二维码",guide:{title:"先选择连接方式",description:"不需要懂网络术语。选择符合当前场景的方式,复制链接,或用手机扫描二维码。"},options:{sameNetwork:{title:"同一 Wi-Fi/LAN",description:"设备与 Pixcode 服务器在同一路由器、办公室网络或局域网时使用。"},secureTunnel:{title:"临时公开链接",description:"启动 Cloudflare/ngrok 隧道后,Pixcode 会自动显示公开 URL 和二维码。"},tailscale:{title:"团队私有链接",description:"无需公开域名或路由器设置,即可进行私有团队访问。"},customDomain:{title:"自己的域名",description:"已有 HTTPS、反向代理或 Cloudflare Tunnel 主机名时使用。"}},status:{ready:"就绪",detecting:"检测中",guided:"引导",configured:"已配置",optional:"可选"},links:{title:"可用链接",description:"为需要连接的设备或成员复制正确 URL。",local:"本地",tailscale:"Tailscale 私有链接",empty:"尚未检测到访问链接。"},local:{title:"同一网络访问",description:"最适合第一次测试:从同一 Wi-Fi 或 LAN 连接。手机扫码,或复制链接给同网成员。",thisDevice:"仅此电脑",loading:"正在检测同网链接...",empty:"未检测到 LAN 链接。请确认服务器已联网并刷新。",saveLabel:"同一网络访问",save:"保存此 LAN 链接"},tunnel:{title:"安全隧道",description:"没有固定域名时,Pixcode 可以启动 cloudflared 或 ngrok,并在这里显示公开 URL。",secureLink:"公开链接和二维码",help:"点击启动。如果已安装 cloudflared 或 ngrok,Pixcode 会自动创建临时 HTTPS 地址和二维码。",running:"隧道运行中",start:"启动隧道",stop:"停止隧道",save:"保存此隧道 URL",saveLabel:"安全隧道访问",qrLabel:"安全隧道",installTitle:"需要设置隧道",installNeeded:"请先安装 cloudflared 或 ngrok,然后再次启动隧道。"},tailscale:{title:"Tailscale 私有访问",description:"Tailscale 是可选的私有网络应用。安装到服务器和用户设备,并登录同一团队后,Pixcode 会检测私有 URL。",save:"保存此 Tailscale URL",saveLabel:"Tailscale 私有访问",openInstall:"打开 Tailscale 安装",steps:{installServer:"在运行 Pixcode 的电脑或服务器上安装 Tailscale。",installUserDevice:"在要打开 Pixcode 的手机、笔记本或成员设备上安装 Tailscale。",login:"两台设备登录同一个 Tailscale 账号或团队。",refresh:"回到这里点击刷新;准备好后 Pixcode 会显示私有 URL。"}},advanced:{title:"高级:固定域名",description:"已有 LAN URL、Tailscale URL、Cloudflare Tunnel 主机名或 HTTPS 域名时,在这里保存给用户使用。",badge:"高级"},setup:{title:"固定访问路径",description:"保存用户将使用的 URL。可以是 LAN、Tailscale、Cloudflare Tunnel 或自定义域名。"},modes:{lan:"LAN",tailscale:"Tailscale",cloudflare_tunnel:"Cloudflare Tunnel",custom_domain:"自定义域名"},fields:{label:"标签",url:"URL",port:"目标端口"},health:{reachable:"Pixcode 可访问",unreachable:"Pixcode 不可访问"},configured:{title:"已保存的访问路径",description:"这些路径会按角色提供给管理员、项目伙伴和项目工作人员。",empty:"还没有保存访问路径。",noUrl:"无 URL",public:"公开",private:"私有"},team:{title:"用户如何连接",description:"在 Admin system 创建用户,在 Control Room 分配项目角色,然后分享一个 Access URL。访问已分配项目不需要全局管理员权限。"}},Dde={title:"Hermes Agent",description:"将 Hermes Agent 作为 Pixcode 控制的项目终端管理,并通过 MCP 访问项目、提供商状态和可见的 CLI 启动。",statusTitle:"安装状态",statusFailed:"无法检查 Hermes Agent。",ready:"就绪",notInstalled:"未安装",start:"启动 Hermes",install:"安装",repair:"修复命令",refresh:"刷新",gatewayTitle:"REST API 网关",gatewayStatusFailed:"无法检查 Hermes REST 网关。",gatewayStartFailed:"无法启动 Hermes REST 网关。",gatewayStopFailed:"无法停止 Hermes REST 网关。",gatewayProbeFailed:"Hermes REST 探测失败。",gatewayRunning:"REST 网关运行中",gatewayStopped:"REST 网关已停止",gatewayStart:"启动 REST",gatewayProbe:"测试 REST",gatewayStop:"停止",gatewayProbeOk:"REST 探测通过:health、capabilities 和 models 已响应。",commandsTitle:"Hermes CLI 设置",commandsDescription:"从 Pixcode 打开真正的 Hermes 终端向导。使用模型和提供商连接 Codex、OpenRouter、Anthropic、Gemini 等提供商。",commandsInstallFirst:"打开 CLI 设置前请先安装 Hermes。",commands:{model:{title:"模型和提供商",description:"打开用于 OAuth、API 密钥和默认模型选择的交互式提供商/模型向导。"},auth:{title:"凭据",description:"管理已配置提供商的 OAuth 会话和 API 密钥池。"},tools:{title:"工具",description:"选择启用哪些 Hermes 工具集,包括 Pixcode MCP 访问。"},doctor:{title:"Doctor",description:"在终端中诊断 Hermes 配置、依赖和平台问题。"},status:{title:"状态",description:"显示当前提供商、认证、平台和脱敏后的设置摘要。"},lsp:{title:"LSP 状态",description:"检查 Hermes language server 集成以进行语义诊断。"},skills:{title:"技能",description:"通过 CLI 浏览、安装、审计和配置 Hermes 技能。"},sessions:{title:"会话",description:"浏览、导出、重命名、清理或删除 Hermes 会话。"}},pixcodeControlTitle:"Pixcode 控制",pixcodeControlDescription:"Pixcode 会在启动前配置 Hermes MCP 服务器,因此 Hermes 可以检查工作区,并在需要时在 Pixcode UI 中打开可见的提供商终端。"},Ode={title:hde,tabs:fde,account:gde,mcp:bde,appearance:xde,actions:yde,quickSettings:vde,terminalShortcuts:wde,mainTabs:kde,notifications:Sde,appearanceSettings:Cde,mcpForm:Nde,saveStatus:Ede,footerActions:Tde,git:Ade,apiKeys:jde,agents:Ide,permissions:_de,mcpServers:Rde,pluginSettings:Lde,access:Pde,hermes:Dde},Mde={title:"欢迎回来",description:"登录您的 Pixcode 账户",username:"用户名",password:"密码",submit:"登录",loading:"登录中...",errors:{invalidCredentials:"用户名或密码无效",requiredFields:"请填写所有字段",networkError:"网络错误,请重试。"},placeholders:{username:"输入您的用户名",password:"输入您的密码"}},Fde={title:"创建账户",username:"用户名",password:"密码",confirmPassword:"确认密码",submit:"创建账户",loading:"创建账户中...",errors:{passwordMismatch:"密码不匹配",usernameTaken:"用户名已被占用",weakPassword:"密码强度太弱"}},zde={title:"退出登录",confirm:"确定要退出登录吗?",button:"退出登录"},Bde={login:Mde,register:Fde,logout:zde},Ude={title:"项目",newProject:"新建项目",deleteProject:"移除项目",renameProject:"重命名项目",noProjects:"未找到项目",loadingProjects:"加载项目中...",searchPlaceholder:"搜索项目...",projectNamePlaceholder:"项目名称",starred:"星标",all:"全部",untitledSession:"未命名会话",newSession:"新会话",codexSession:"Codex 会话",fetchingProjects:"正在获取您的 Claude 项目和会话",projects:"项目",detectedFromHistory:"从历史记录检测",noMatchingProjects:"未找到匹配的项目",tryDifferentSearch:"尝试调整您的搜索词",runClaudeCli:"在项目目录中运行 Claude CLI 以开始使用"},$de={title:"Pixcode",subtitle:"AI 编程助手"},Hde={title:"会话",newSession:"新建会话",deleteSession:"删除会话",renameSession:"重命名会话",noSessions:"暂无会话",loadingSessions:"加载会话中...",unnamed:"未命名",loading:"加载中...",showMore:"显示更多会话"},Gde={viewEnvironments:"查看环境",hideSidebar:"隐藏侧边栏",createProject:"创建新项目",refresh:"刷新项目和会话 (Ctrl+R)",renameProject:"重命名项目 (F2)",deleteProject:"从侧边栏移除项目 (Delete)",addToFavorites:"添加到收藏",removeFromFavorites:"从收藏移除",editSessionName:"手动编辑会话名称",deleteSession:"永久删除此会话",save:"保存",cancel:"取消",clearSearch:"清除搜索"},Vde={chat:"聊天",files:"文件",git:"Git",terminal:"终端",tasks:"任务"},Wde={refresh:"刷新",settings:"设置",collapseAll:"全部折叠",expandAll:"全部展开",cancel:"取消",save:"保存",delete:"删除",rename:"重命名",joinCommunity:"加入社区",reportIssue:"报告问题",starOnGithub:"在GitHub上加星",controlRoom:"控制室",controlRoomDescription:"管理、访问、运行"},qde={openSource:"开源"},Kde={active:"活动",inactive:"非活动",thinking:"思考中...",error:"错误",aborted:"已中止",unknown:"未知"},Yde={justNow:"刚刚",oneMinuteAgo:"1 分钟前",minutesAgo:"{{count}} 分钟前",oneHourAgo:"1 小时前",hoursAgo:"{{count}} 小时前",oneDayAgo:"1 天前",daysAgo:"{{count}} 天前"},Zde={deleteConfirm:"确定要删除吗?",renameSuccess:"重命名成功",deleteSuccess:"删除成功",errorOccurred:"发生错误",deleteSessionConfirm:"确定要删除此会话吗?此操作无法撤销。",deleteProjectConfirm:"从侧边栏移除此项目?您的项目文件、记忆和会话数据不会被删除。",enterProjectPath:"请输入项目路径",deleteSessionFailed:"删除会话失败,请重试。",deleteSessionError:"删除会话时出错,请重试。",renameSessionFailed:"重命名会话失败,请重试。",renameSessionError:"重命名会话时出错,请重试。",deleteProjectFailed:"移除项目失败,请重试。",deleteProjectError:"移除项目时出错,请重试。",createProjectFailed:"创建项目失败,请重试。",createProjectError:"创建项目时出错,请重试。"},Xde={updateAvailable:"有可用更新"},Jde={modeProjects:"项目",modeConversations:"对话",conversationsPlaceholder:"搜索对话内容...",searching:"搜索中...",noResults:"未找到结果",tryDifferentQuery:"尝试不同的搜索词",matches_one:"{{count}} 个匹配",matches_other:"{{count}} 个匹配",projectsScanned_one:"{{count}} 个项目已扫描",projectsScanned_other:"{{count}} 个项目已扫描"},Qde={deleteProject:"移除项目",deleteSession:"删除会话",confirmDelete:"您想如何处理",sessionCount_one:"此项目包含 {{count}} 个对话。",sessionCount_other:"此项目包含 {{count}} 个对话。",removeFromSidebar:"仅从侧边栏移除",deleteAllData:"永久删除所有数据",allConversationsDeleted:"项目将从侧边栏中移除。您的文件、记忆和会话数据将会保留。",cannotUndo:"您可以稍后重新添加此项目。"},eue={section:"编排",fallbackTitle:"编排运行"},tue={projects:Ude,app:$de,sessions:Hde,tooltips:Gde,navigation:Vde,actions:Wde,branding:qde,status:Kde,time:Yde,messages:Zde,version:Xde,search:Jde,deleteConfirmation:Qde,orchestration:eue},rue={copy:"复制",copied:"已复制",copyCode:"复制代码"},nue={copy:"复制消息",copied:"消息已复制",selectFormat:"选择复制格式",copyAsMarkdown:"复制为 Markdown",copyAsText:"复制为纯文本"},aue={user:"U",error:"错误",tool:"工具",claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code"},iue={settings:"工具设置",error:"工具错误",result:"工具结果",viewParams:"查看输入参数",viewRawParams:"查看原始参数",viewDiff:"查看编辑差异",creatingFile:"创建新文件:",updatingTodo:"更新待办事项",read:"读取",readFile:"读取文件",updateTodo:"更新待办列表",readTodo:"读取待办列表",searchResults:"结果"},sue={found:"找到 {{count}} 个{{type}}",file:"文件",files:"文件",pattern:"模式:",in:"在:"},oue={updated:"文件更新成功",created:"文件创建成功",written:"文件写入成功",diff:"差异",newFile:"新文件",viewContent:"查看文件内容",viewFullOutput:"查看完整输出({{count}} 个字符)",contentDisplayed:"文件内容显示在上面的差异视图中"},lue={title:"交互式提示",waiting:"等待您在 CLI 中响应",instruction:"请在 Claude 运行的终端中选择一个选项。",selectedOption:"✓ Claude 选择了选项 {{number}}",instructionDetail:"在 CLI 中,您可以使用方向键或输入数字来交互式地选择此选项。"},cue={title:"思考中...",emoji:"💭 思考中..."},due={response:"JSON 响应"},uue={grant:"授予 {{tool}} 权限",added:"权限已添加",addTo:"将 {{entry}} 添加到允许的工具。",retry:"权限已保存。重试请求以使用该工具。",error:"无法更新权限。请重试。",openSettings:"打开设置"},pue={updated:"待办列表已成功更新",current:"当前待办列表"},mue={viewPlan:"📋 查看实施计划",title:"实施计划"},hue={resetAt:"Claude 使用限制已达到。您的限制将在 **{{time}} {{timezone}}** - {{date}} 重置"},fue={permissionMode:"权限模式",modes:{default:"默认模式",acceptEdits:"编辑模式",bypassPermissions:"无限制模式",plan:"计划模式"},descriptions:{default:"只有受信任的命令(ls、cat、grep、git status 等)自动运行。其他命令将被跳过。可以写入工作区。",acceptEdits:"工作区内的所有命令自动运行。完全自动模式,具有沙盒执行功能。",bypassPermissions:"完全的系统访问,无限制。所有命令自动运行,具有完整的磁盘和网络访问权限。请谨慎使用。",plan:"计划模式 - 不执行任何命令"},technicalDetails:"技术细节"},gue={placeholder:"输入 / 调用命令,@ 选择文件,或向 {{provider}} 提问...",placeholderDefault:"输入您的消息...",disabled:"输入已禁用",attachFiles:"附加文件",attachImages:"附加图片",send:"发送",stop:"停止",clickToChangeMode:"点击更改权限模式(或在输入框中按 Tab)",showAllCommands:"显示所有命令",clearInput:"清空输入",scrollToBottom:"滚动到底部"},bue={selector:{title:"思考模式",description:"扩展思考给 Claude 更多时间来评估替代方案",active:"激活",tip:"更高的思考模式需要更多时间,但提供更彻底的分析"},modes:{none:{name:"标准",description:"常规 Claude 响应",prefix:""},think:{name:"思考",description:"基本扩展思考",prefix:"思考"},thinkHard:{name:"深入思考",description:"更彻底的评估",prefix:"深入思考"},thinkHarder:{name:"更深入思考",description:"考虑替代方案的深度分析",prefix:"更深入思考"},ultrathink:{name:"超级思考",description:"最大思考预算",prefix:"超级思考"}},buttonTitle:"思考模式:{{mode}}"},xue={title:"选择您的 AI 助手",description:"选择一个供应商以开始新对话",selectModel:"选择模型",statusUnavailable:"状态不可用",statusRetryHint:"无法检查此 CLI。点击重试。",retryStatus:"重试状态",providerInfo:{anthropic:"由 Anthropic 提供",openai:"由 OpenAI 提供",cursorEditor:"AI 代码编辑器",google:"由 Google 提供"},readyPrompt:{claude:"准备好使用带有 {{model}} 的 Claude。请在下方开始输入您的消息。",cursor:"准备好使用带有 {{model}} 的 Cursor。请在下方开始输入您的消息。",codex:"准备好使用带有 {{model}} 的 Codex。请在下方开始输入您的消息。",gemini:"准备好使用带有 {{model}} 的 Gemini。请在下方开始输入您的消息。",default:"请在上方选择一个提供者以开始"}},yue={continue:{title:"继续您的对话",description:"询问有关代码的问题、请求更改或获取开发任务的帮助"},loading:{olderMessages:"正在加载更早的消息...",sessionMessages:"正在加载会话消息..."},messages:{showingOf:"显示 {{shown}} / {{total}} 条消息",scrollToLoad:"向上滚动以加载更多",showingLast:"显示最近 {{count}} 条消息(共 {{total}} 条)",loadEarlier:"加载更早的消息",loadAll:"加载全部消息",loadingAll:"正在加载全部消息...",allLoaded:"全部消息已加载",perfWarning:"已加载全部消息 - 滚动可能变慢。点击「滚动到底部」恢复性能。"}},vue={selectProject:{title:"选择项目",description:"选择一个项目以在该目录中打开交互式 Shell"},status:{newSession:"新会话",initializing:"初始化中...",restarting:"重启中..."},actions:{disconnect:"断开连接",disconnectTitle:"断开 Shell 连接",restart:"重启",restartTitle:"重启 Shell(请先断开连接)",connect:"在 Shell 中继续",connectTitle:"连接到 Shell"},loading:"正在加载终端...",connecting:"正在连接到 Shell...",startSession:"启动新的 Claude 会话",startProviderSession:"启动新的 {{provider}} 会话",resumeSession:"恢复会话:{{displayName}}...",runCommand:"在 {{projectName}} 中运行 {{command}}",startCli:"在 {{projectName}} 中启动 Claude CLI",startProviderCli:"在 {{projectName}} 中启动 {{provider}}",defaultCommand:"命令"},wue={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},kue={startChatWithProvider:"选择一个项目以开始与 {{provider}} 聊天"},Sue={nextTaskPrompt:"开始下一个任务"},Cue={codeBlock:rue,copyMessage:nue,messageTypes:aue,tools:iue,search:sue,fileOperations:oue,interactive:lue,thinking:cue,json:due,permissions:uue,todo:pue,plan:mue,usageLimit:hue,codex:fue,input:gue,thinkingMode:bue,providerSelection:xue,session:yue,shell:vue,claudeStatus:wue,projectSelection:kue,tasks:Sue},Nue={changes:"个更改",previousChange:"上一个更改",nextChange:"下一个更改",hideDiff:"隐藏差异高亮",showDiff:"显示差异高亮",settings:"编辑器设置",collapse:"折叠编辑器",expand:"展开编辑器到全宽"},Eue="正在加载 {{fileName}}...",Tue={showingChanges:"显示更改"},Aue={download:"下载文件",save:"保存",saving:"保存中...",saved:"已保存!",exitFullscreen:"退出全屏",fullscreen:"全屏",close:"关闭"},jue={lines:"行数:",characters:"字符数:",shortcuts:"按 Ctrl+S 保存 • Esc 关闭"},Iue={title:"二进制文件",message:'文件 "{{fileName}}" 无法在文本编辑器中显示,因为它是二进制文件。'},_ue={toolbar:Nue,loading:Eue,header:Tue,actions:Aue,footer:jue,binaryFile:Iue},Rue={save:"保存",cancel:"キャンセル",delete:"削除",create:"作成",edit:"編集",close:"閉じる",confirm:"確認",submit:"送信",retry:"再試行",refresh:"更新",search:"検索",clear:"クリア",copy:"コピー",download:"ダウンロード",upload:"アップロード",browse:"参照"},Lue={chat:"チャット",shell:"シェル",files:"ファイル",git:"ソース管理",changes:"変更",liveView:"ライブビュー",tasks:"タスク",remote:"リモート",controlRoom:"コントロール",orchestration:"オーケストレーション"},Pue={loading:"読み込み中...",success:"成功",error:"エラー",failed:"失敗",pending:"保留中",completed:"完了",inProgress:"進行中"},Due={savedSuccessfully:"保存しました",deletedSuccessfully:"削除しました",updatedSuccessfully:"更新しました",operationFailed:"操作に失敗しました",networkError:"ネットワークエラー。接続を確認してください。",unauthorized:"認証されていません。ログインしてください。",notFound:"見つかりません",invalidInput:"入力が無効です",requiredField:"この項目は必須です",unknownError:"不明なエラーが発生しました"},Oue={settings:"設定",home:"ホーム",back:"戻る",next:"次へ",previous:"前へ",logout:"ログアウト"},Mue={language:"言語",theme:"テーマ",darkMode:"ダークモード",lightMode:"ライトモード",name:"名前",description:"説明",enabled:"有効",disabled:"無効",optional:"任意",version:"バージョン",select:"選択",selectAll:"すべて選択",deselectAll:"すべて解除"},Fue={justNow:"たった今",minutesAgo:"{{count}}分前",hoursAgo:"{{count}}時間前",daysAgo:"{{count}}日前",yesterday:"昨日"},zue={newFile:"新規ファイル",newFolder:"新規フォルダ",rename:"名前の変更",move:"移動",copyPath:"パスをコピー",openInEditor:"エディタで開く"},Bue={loading:"Pixcode を読み込んでいます",settingUpWorkspace:"ワークスペースを準備しています...",chooseProject:"プロジェクトを選択",selectProjectDescription:"サイドバーからプロジェクトを選択して、Claudeとコーディングを始めましょう。各プロジェクトにはチャットセッションとファイル履歴が含まれています。",tip:"ヒント",createProjectMobile:"上部のメニューボタンからプロジェクトにアクセスできます",createProjectDesktop:"サイドバーのフォルダアイコンをクリックして新しいプロジェクトを作成できます",newSession:"新しいセッション",untitledSession:"無題のセッション",projectFiles:"プロジェクトファイル",landing:{title:"Pixcode ワークスペースを開始",description:"プロジェクトを選ぶか、新しいチャットを始めるか、1つの目標でオーケストレーションを開始できます。オーケストレーションは選択したCLIエージェントを管理し、各ステップとエラーを表示します。",startOrchestration:"オーケストレーションを開始",startOrchestrationDescription:"自動でプロジェクトを作成し、エージェント制御と実行履歴を持つオーケストレーション画面を開きます。",startChat:"新しいチャットを開始",startChatDescription:"フォルダを自動作成し、通常のチャット画面を1つのエージェントで開きます。",sidebarHint:"サイドバーから既存プロジェクトを選ぶと、チャット履歴、ファイル、git状態、タスク、オーケストレーションが同じメイン画面に残ります。"}},Uue={loading:"ファイルを読み込んでいます...",files:"ファイル",simpleView:"シンプル表示",compactView:"コンパクト表示",detailedView:"詳細表示",searchPlaceholder:"ファイルやフォルダを検索...",clearSearch:"検索をクリア",name:"名前",size:"サイズ",modified:"更新日時",permissions:"権限",noFilesFound:"ファイルが見つかりません",checkProjectPath:"プロジェクトのパスがアクセス可能か確認してください",noMatchesFound:"一致するものが見つかりません",tryDifferentSearch:"別の検索語を試すか、検索をクリアしてください",justNow:"たった今",minAgo:"{{count}}分前",hoursAgo:"{{count}}時間前",daysAgo:"{{count}}日前",newFile:"新規ファイル (Cmd+N)",newFolder:"新規フォルダ (Cmd+Shift+N)",refresh:"更新",collapseAll:"すべて折りたたむ",context:{rename:"名前を変更",delete:"削除",copyPath:"パスをコピー",download:"ダウンロード",newFile:"新しいファイル",newFolder:"新しいフォルダ",refresh:"更新",menuLabel:"ファイルのコンテキストメニュー",loading:"読み込み中..."}},$ue={title:"新規プロジェクトを作成",steps:{type:"種類",configure:"設定",confirm:"確認"},step1:{question:"既存のワークスペースがありますか?それとも新しく作成しますか?",existing:{title:"既存のワークスペース",description:"サーバー上に既存のワークスペースがあり、プロジェクト一覧に追加したい"},new:{title:"新しいワークスペース",description:"新しいワークスペースを作成し、必要に応じてGitHubリポジトリからクローンする"},githubClone:{title:"GitHub からクローン",description:"対象フォルダを選び、リポジトリをそこにクローン"},subfolder:{title:"サブフォルダを作成",description:"親フォルダを選び、その中に新しいサブフォルダを作成"}},step2:{existingPath:"ワークスペースのパス",newPath:"ワークスペースのパス",subfolderParentPath:"親フォルダ",subfolderParentHelp:"新しいサブフォルダを作成する親フォルダのパス",subfolderName:"サブフォルダ名",subfolderNameHelp:"この名前のフォルダが親フォルダ内に作成されます",existingPlaceholder:"/path/to/existing/workspace",newPlaceholder:"/path/to/new/workspace",existingHelp:"既存のワークスペースディレクトリのフルパス",newHelp:"ワークスペースディレクトリのフルパス",githubUrl:"GitHub URL(任意)",githubPlaceholder:"https://github.com/username/repository",githubHelp:"任意: リポジトリをクローンするためのGitHub URLを入力してください",githubAuth:"GitHub認証(任意)",githubAuthHelp:"プライベートリポジトリの場合のみ必要です。パブリックリポジトリは認証なしでクローンできます。",loadingTokens:"保存済みトークンを読み込んでいます...",storedToken:"保存済みトークン",newToken:"新しいトークン",nonePublic:"なし(パブリック)",selectToken:"トークンを選択",selectTokenPlaceholder:"-- トークンを選択 --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"このトークンはこの操作にのみ使用されます",publicRepoInfo:"パブリックリポジトリには認証は不要です。パブリックリポジトリをクローンする場合、トークンは省略できます。",noTokensHelp:"保存済みトークンがありません。設定 → APIキーでトークンを追加すると再利用が簡単になります。",optionalTokenPublic:"GitHubトークン(パブリックリポジトリの場合は任意)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(パブリックリポジトリの場合は空欄可)"},step3:{reviewConfig:"設定の確認",workspaceType:"ワークスペースの種類:",existingWorkspace:"既存のワークスペース",newWorkspace:"新しいワークスペース",subfolderWorkspace:"新しいサブフォルダ",path:"パス:",parentPath:"親パス:",subfolderName:"サブフォルダ名:",cloneFrom:"クローン元:",authentication:"認証:",usingStoredToken:"保存済みトークンを使用:",usingProvidedToken:"入力されたトークンを使用",noAuthentication:"認証なし",sshKey:"SSHキー",existingInfo:"ワークスペースがプロジェクト一覧に追加され、Claude/Cursorセッションで使用できるようになります。",newWithClone:"このフォルダからリポジトリがクローンされます。",newEmpty:"ワークスペースがプロジェクト一覧に追加され、Claude/Cursorセッションで使用できるようになります。",subfolderInfo:"親フォルダ内に新しいサブフォルダが作成され、プロジェクト一覧に追加されます。",cloningRepository:"リポジトリをクローンしています..."},buttons:{cancel:"キャンセル",back:"戻る",next:"次へ",createProject:"プロジェクトを作成",creating:"作成中...",cloning:"クローン中..."},errors:{selectType:"既存のワークスペースか新規作成かを選択してください",providePath:"ワークスペースのパスを入力してください",provideSubfolderName:"サブフォルダ名を入力してください",subfolderNameInvalid:"サブフォルダ名にパス区切りを含めることはできず、. / .. もできません",failedToCreate:"ワークスペースの作成に失敗しました",failedToCreateFolder:"フォルダの作成に失敗しました"}},Hue={genericTool:"ツール",codes:{generic:{info:{title:"通知"}},permission:{required:{title:"対応が必要です",body:"{{toolName}} があなたの判断を待っています。"}},run:{stopped:{title:"実行が停止しました",body:"理由: {{reason}}"},failed:{title:"実行に失敗しました"}},agent:{notification:{title:"エージェント通知"}}}},Gue={title:"アップデートのお知らせ",newVersionReady:"新しいバージョンが利用可能です",currentVersion:"現在のバージョン",latestVersion:"最新バージョン",whatsNew:"変更点:",viewFullRelease:"リリース全文を見る",updateProgress:"アップデートの進捗:",manualUpgrade:"手動アップグレード:",npmUpgradeCommand:"npm install -g @pixelbyte-software/pixcode@latest",pixcodeUpgradeCommand:"pixcode update --restart-daemon",manualUpgradeHint:"または「今すぐ更新」をクリックして自動的にアップデートを実行できます。",updateCompleted:"アップデートが完了しました!",restartServer:"変更を適用するにはサーバーを再起動してください。",updateFailed:"アップデートに失敗しました",buttons:{close:"閉じる",later:"後で",copyCommand:"コマンドをコピー",updateNow:"今すぐ更新",updating:"更新中..."},ariaLabels:{closeModal:"バージョンアップグレードモーダルを閉じる",showSidebar:"サイドバーを表示",settings:"設定",updateAvailable:"アップデートあり",closeSidebar:"サイドバーを閉じる"}},Vue={title:"オーケストレーション",subtitle:"{{project}} で1つの目標を入力し、CLIワーカーを選択します。必要なら同じCLIを複製し、直接割り当てるかコーディネーターに分担させます。",refresh:"更新",goal:"目標",goalPlaceholder:"例: 認証画面を単一ポート配信に合わせて修正し、エラーを捕捉し、lint と typecheck で検証する。",mode:"実行モード",systemPlan:"システム計画",noMode:"モード未選択",loadingPlan:"エージェント計画を読み込み中。",start:"チームを開始",starting:"開始中",needAgent:"少なくとも1つのCLIワーカーを有効にしてください。",startFailed:"ワークフローを開始できませんでした。",cliControl:"CLIチーム",enabledCount:"{{count}} 有効",enabled:"有効",disabled:"無効",history:"履歴",emptyHistory:"実行はまだありません。目標を書いてエージェントを開始してください。",steps:"{{done}}/{{total}} ステップ",notSelected:"実行が選択されていません",notSelectedDescription:"過去の実行を選択するか新しい目標を開始してください。エージェントのメッセージ、エラー、変更概要、プレビュー出力がここに表示されます。",loadFailed:"実行詳細を読み込めませんでした。",loadingRun:"実行を読み込み中...",agentSteps:"エージェント手順",noStepOutput:"ステップ出力はありません。",agentMessages:"エージェントメッセージ",noAgentMessages:"このエージェントはまだメッセージを生成していません。失敗した場合、実際のCLIエラーが上に表示されます。",outputs:"出力",noOutputs:"変更概要、プレビュー、コマンド出力はまだありません。",open:"開く",artifact:{fileDiff:"変更概要",previewUrl:"プレビュー",commandOutput:"コマンド出力"},role:{user:"ユーザー",agent:"エージェント"},status:{queued:"待機中",running:"実行中",completed:"完了",failed:"エラー",canceled:"キャンセル",skipped:"スキップ"},nodes:{codex_review:"Codexレビュー",gemini_review:"Geminiレビュー",claude_review:"Claudeレビュー",claude_code_review:"Claudeレビュー",cursor_review:"Cursorレビュー",aggregate:"集約",architect:"計画",implement:"実装",review:"レビュー",proposal:"提案",critique:"批評",response:"応答",judge:"判断",coordinator:"コーディネーター",final_report:"最終レポート"},workflows:{multi_model_review:{name:"マルチモデルレビュー",description:"有効なCLIエージェントが同じ目標を個別にレビューし、その後有効なエージェントが結果を集約します。"},sequential_handoff:{name:"順次ハンドオフ",description:"エージェントが順番に計画、実装、レビューします。無効なCLIステップはスキップされます。"},adversarial_debate:{name:"意思決定ディベート",description:"エージェントが提案、批評、応答し、最終推奨を生成します。"},agent_team:{name:"エージェントチーム",description:"コーディネーターが目標と有効なCLIインスタンスを読み取り、作業を割り当てて結果を集約します。"}},adapters:{"claude-code":{label:"Claude Code",role:"CLIワーカー"},cursor:{label:"Cursor",role:"CLIワーカー"},codex:{label:"Codex",role:"CLIワーカー"},gemini:{label:"Gemini",role:"CLIワーカー"},qwen:{label:"Qwen Code",role:"CLIワーカー"},opencode:{label:"OpenCode",role:"CLIワーカー"}},activeCount:"{{active}}/{{total}} 有効",teamHint:"各行は1つのCLIワーカーです。Claude、Codex、Cursor、Gemini、Qwen、OpenCodeを複数作成し、それぞれに別の割り当てを書けます。",parallelLimit:"並列上限",addAgent:"{{agent}}を追加",duplicateAgent:"{{agent}}を複製",removeAgent:"{{agent}}を削除",assignment:"割り当て",assignmentPlaceholder:"任意: このワーカーが担当する内容を具体的に書きます。空欄ならコーディネーターが割り当てます。",agentInstance:"{{name}} #{{number}}",taskTitle:"タスク",taskTitlePlaceholder:"機能を実装",taskDescription:"説明",taskDescriptionPlaceholder:"範囲、制約、期待する出力",addTask:"追加",runTask:"実行",cancelTask:"キャンセル",dispatchTask:"タスクを割り当て",adapter:"アダプター",isolation:"分離",dispatch:"割り当て",auto:"自動",waitingForStream:"ストリーム待機中...",workflow:"ワークフロー",input:"入力",taskStates:{todo:"未着手",in_progress:"進行中",in_review:"レビュー中",done:"完了",failed:"失敗",canceled:"キャンセル済み"},isolationKind:{worktree:"Worktree",host:"Host",docker:"Docker"},stop:"チームを停止",stopping:"停止中",cancelFailed:"ワークフローを停止できませんでした。",needRoles:"このモードでは、次のロールに少なくとも1つの有効なエージェントを割り当ててください: {{roles}}。",quickPrompts:{label:"クイックプロンプト:",liveTrading:{label:"8024 ライブ取引画面",prompt:"こんにちは。小さなプロジェクトを作成し、その後ポート8024で起動してください。Binance FAPIに接続したTradingView風デザインで、TradingViewチャートと左側のスター/お気に入りシステムが必要です。作業を論理的に分割し、プロセスを自動管理してください。"}},teamHistory:"チーム履歴",changeSummary:"変更概要",noChangeSummary:"最終概要はまだ準備できていません。エージェント完了後、読みやすいMarkdown概要がここに表示されます。",prepareTeamFromReport:"このレポートからエージェントチームを準備",prepareTeamTitle:"エージェントチームのプロンプトを準備",prepareTeamDescription:"議論の出力を新しいAgent Teamプロンプトに変換しました。編集してAgent Teamモードへ移せます。",usePreparedPrompt:"プロンプトを使用",reportToPromptPrefix:"以下の議論/意思決定レポートからエージェントチームを準備して実行してください。必要事項をタスクに分け、利用可能なCLIエージェントへ適切な割り当てを提案し、ユーザー確認後に開始してください。",generatedSummaryTitle:"自動実行概要",summaryStatus:"全体ステータス",summarySteps:"完了ステップ",summaryFailures:"失敗ステップ",summaryCanceled:"キャンセルされたステップ",summaryDiffs:"差分/変更出力",summaryPreviews:"プレビュー出力",summaryErrorPrefix:"エラー",assignedWork:"割り当て作業",autoAssigned:"自動 / コーディネーターが決定",stages:{coordinator:"コーディネーター",handoff:"引き継ぎ",backend:"バックエンド",frontend:"フロントエンド",implementation:"実装",review:"レビュー",repair:"修正",proposal:"提案",critique:"批評",response:"応答",decision:"決定",report:"レポート",final_report:"最終レポート"},agentRole:"フェーズ",agentRoles:{auto:"自動",backend:"バックエンド",frontend:"フロントエンド",review:"テスト / レビュー",implementation:"実装",proposal:"提案",critique:"批評",response:"応答",decision:"決定 / レポート",report:"レポート",custom:"カスタム"},customRolePlaceholder:"例: セキュリティ、モバイルUX、DB設計",roleHints:{default:"空欄にすると、コーディネーターが目標に基づいてこのエージェントへ割り当てます。",agent_team:"バックエンド、フロントエンド、レビューなどのフェーズを選ぶか、自動のままにできます。",multi_model_review:"有効なエージェントがレビューします。レポートロールを選ぶと、そのエージェントが最終概要をまとめます。",sequential_handoff:"エージェントは選択順に実行されます。タスク文が各ステップの範囲を定義します。",adversarial_debate:"意思決定ディベートではフェーズ選択は任意です。未指定の場合、選択されたエージェントを順に提案、批評、必要に応じて応答へ割り当てます。"},soloAgent:"{{agent}} のみで実行",soloAgentShort:"単独",cliSettings:"CLI設定",workspaceTarget:"対象ワークスペース",workspaceTargets:{selectedProject:"選択中のプロジェクト",pixcodeApp:"Pixcode システム",custom:"カスタムパス"},customWorkspacePlaceholder:"/path/to/project",workspaceTargetHint:"エージェントは次で実行されます: {{path}}",autoDetect:"自動検出",needWorkspacePath:"カスタムワークスペースのパスを入力してください。",hermesTitle:"Hermes Agent",hermesSubtitle:"Hermes is running inside Pixcode for {{project}} and can coordinate local checks, tests, terminal work, and project operations.",hermesCliControl:"Hermes CLI control"},Wue={title:"コントロールルーム",subtitle:"{{target}} の本番、プラットフォーム、管理、監査、セルフホストアクセス",thisServer:"このサーバー",refresh:"更新",nav:{overview:"概要",production:"本番",admin:"管理",team:"チーム",secrets:"シークレット",marketplace:"マーケット",eval:"評価",usage:"使用状況",security:"セキュリティ",access:"アクセス"},overview:{title:"v1.46 launch surface",description:"Every box below is backed by a v1.44-v1.45 API and is now visible from the UI.",latestAuditEvents:"Latest audit events",remoteAccessOptions:"Remote access options"},metrics:{issueRuns:"Issue-to-PR runs",reviewItems:"Review items",subUsers:"Sub-users",collaborators:"Project collaborators",secrets:"Scoped secrets",marketplace:"Marketplace entries",evalRuns:"Evaluation runs",securityAudits:"Security audits"},sections:{production:{title:"Production loop",description:"Start issue-to-PR runs, parse CI failures, review changes, schedule background jobs, and create checkpoints."},admin:{title:"管理システム",description:"セルフホストの Pixcode サーバーでサブユーザーの作成、無効化、アクティビティ確認を行います。"},team:{title:"プロジェクト共同作業者",description:"全員をグローバル管理者にせず、プロジェクトごとに partner、worker、reviewer、viewer を割り当てます。"},secrets:{title:"Secret vault",description:"Store scoped env secrets and preview what each provider, project, workflow, Telegram, or API run receives."},marketplace:{title:"MCP/plugin marketplace",description:"Register MCP servers, workflow templates, provider adapters, and notification channels with permission review and health."},eval:{title:"Evaluation harness",description:"Create regression suites and compare provider/model runs with pass rate and latency."},usage:{title:"Cost, token, and latency dashboard",description:"Monitor provider/model/workflow usage for demos and operations."},security:{title:"Security audit mode",description:"Run dependency audit, secret scan, permission audit, and agent output leak detection workflows."},access:{title:"セルフホストアクセス",description:"固定ドメインがない場合は Tailscale を使い、安定した公開 URL には Cloudflare Tunnel や custom domain を設定します。"}},panels:{issueToPr:"Issue-to-PR run",ciRepair:"CI repair parser",reviewQueue:"Review queue",schedulerCheckpoints:"Scheduler and checkpoints",createSubUser:"Create sub-user",rolePermissions:"Role permissions",addCollaborator:"Add collaborator",createSecret:"Create secret",scopedEnvPreview:"Scoped env preview",addMarketplaceEntry:"Add marketplace entry",createSuite:"Create suite",recordRun:"Record run",recordUsageEvent:"Record usage event",createAuditRun:"Create audit run",auditLog:"Audit log",remoteAccessSetup:"Remote access setup"},lists:{recentJobs:"Recent jobs",recentCheckpoints:"Recent checkpoints",subUsers:"Sub-users",collaborators:"Collaborators",includedEnvNames:"Included env names",vaultEntries:"Vault entries",marketplaceEntries:"Marketplace entries",suites:"Suites",runs:"Runs",auditRuns:"Audit runs",configuredAccessPaths:"Configured access paths"},buttons:{queueRun:"Queue run",parseFailure:"Parse failure",createReviewItem:"Create review item",scheduleJob:"Schedule job",createCheckpoint:"Create checkpoint",createUser:"Create user",disable:"Disable",enable:"Enable",addCollaborator:"Add collaborator",storeSecret:"Store secret",previewEnv:"Preview env",saveEntry:"Save entry",markHealthy:"Mark healthy",createSuite:"Create suite",recordRun:"Record run",recordUsage:"Record usage",createAudit:"Create audit",exportJson:"Export JSON",exportCsv:"Export CSV",saveAccessPath:"Save access path",checkUrl:"Check URL",checkTailscale:"Check Tailscale"},placeholders:{githubIssueUrl:"GitHub issue URL",manualTitle:"Manual title fallback",model:"Model",baseBranch:"Base branch",ciLog:"Paste failing CI, lint, typecheck, or build output",reviewTitle:"Review title",notes:"Notes",changedFiles:"Changed files, one per line",jobName:"Job name",cronExpression:"Cron or watch expression",checkpointReason:"Checkpoint reason",backgroundPrompt:"Background agent prompt",checkpointFiles:"Checkpoint changed files, one per line",usernameEmail:"Username or email",temporaryPassword:"Temporary password",userEmailUsername:"User email or username",secretName:"Secret name",envName:"ENV_NAME",secretTarget:"Target project/provider/workflow",secretValue:"Secret value",workflowId:"Workflow id",name:"Name",pluginSource:"Source package or repository",installCommand:"Install command",permissionScopes:"Permission scopes, one per line",suiteName:"Suite name",description:"Description",firstTaskTitle:"First task title",acceptanceCriteria:"Acceptance criteria, one per line",suiteId:"Suite id",latencyMs:"Latency ms",passedCount:"Passed count",failedCount:"Failed count",workflow:"Workflow",inputTokens:"Input tokens",outputTokens:"Output tokens",costUsd:"Cost USD",optionalFindingTitle:"Optional finding title",auditFilter:"Filter audit log by user, project, event, or file",label:"Label",url:"URL",targetPort:"Target port"},labels:{project:"project",path:"path",providerModel:"provider/model",branch:"branch",failedCommands:"Failed commands",files:"Files",lastActive:"Last active",role:"role",tasks:"tasks",pass:"pass",health:"Health",reachable:"reachable",installed:"installed",loggedIn:"logged in"},columns:{provider:"Provider",model:"Model",workflow:"Workflow",runs:"Runs",tokens:"Tokens",cost:"Cost",latency:"Latency",errorRate:"Error rate"},fallback:{selectedProject:"selected project",projectPath:"project path",noneDetected:"none detected",noUrl:"No URL",global:"global",noSource:"No source",regressionSuite:"Regression suite",demoTask:"Demo task",provider:"provider",reviewRequired:"Review required.",notAvailable:"not available"},capabilities:{partner:"can approve actions, manage secrets, and use shell",projectScoped:"project-scoped access only"},teamAccess:{title:"共同作業者のアクセス方法",stepUsers:"サブユーザーを作成",stepUsersDescription:"Admin system で member、viewer、project_worker、project_partner などのロールを付けて作成します。",stepRole:"プロジェクトロールを割り当て",stepRoleDescription:"同じユーザーをプロジェクト共同作業者に追加し、選択したプロジェクトだけを表示・操作できるようにします。",stepLink:"アクセス経路を共有",stepLinkDescription:"Self-hosted access で設定した Tailscale、Cloudflare Tunnel、custom domain、LAN URL を共有します。",paths:"利用可能なアクセスリンク"},badges:{public:"public",private:"private"},empty:{noAuditEvents:"No audit events yet.",noRemoteAccessConfigs:"No remote access configs yet.",noReviewItems:"No review items yet.",noRecentJobs:"No recent jobs yet.",noRecentCheckpoints:"No recent checkpoints yet.",noSubUsers:"No sub-users yet.",noCollaborators:"No project collaborators yet.",noAccessPaths:"No access paths configured yet.",noIncludedEnvNames:"No included env names yet.",noSecrets:"No secrets yet.",noMarketplaceEntries:"No marketplace entries yet.",noSuites:"No suites yet.",noRuns:"No runs yet.",usageSummary:"Usage appears here after provider or workflow events are recorded.",noSecurityAudits:"No security audits yet.",noAuditMatches:"No audit entries match the current filter."}},que={title:"VS Code ワークベンチ",noProject:"プロジェクト未選択",activity:{explorer:"エクスプローラー",projects:"プロジェクト",sourceControl:"ソース管理",terminal:"ターミナル",showPanel:"左パネルを表示",hidePanel:"左パネルを非表示"},panels:{explorer:"エクスプローラー",projects:"プロジェクト",sourceControl:"ソース管理",terminal:"ターミナル",editor:"エディター",cli:"CLI",rightTerminal:"ターミナル"},editor:{emptyTitle:"エクスプローラーからファイルを開く",closeTab:"{{file}} を閉じる",scrollLeft:"タブを左へスクロール",scrollRight:"タブを右へスクロール",moreActions:"その他のタブ操作",closeSplit:"分割エディターを閉じる",context:{close:"閉じる",closeAll:"すべて閉じる",copyPath:"パスをコピー",splitRight:"右に分割",splitMoveRight:"右に分割して移動"}},resize:{left:"左パネルのサイズ変更",right:"CLI パネルのサイズ変更"},menu:{openProject:"プロジェクトを開く...",cloneFromGithub:"リポジトリをクローン...",newChat:"新しいチャット",openProjects:"プロジェクトを開く"},projects:{openProject:"プロジェクトを開く",cloneFromGithub:"クローン",directoryList:"ディレクトリ",refresh:"プロジェクトを更新",emptyTitle:"プロジェクトディレクトリはまだありません",emptyDescription:"ローカルフォルダーを開くか、リポジトリをクローンして開始します。",selected:"選択中",startChat:"チャット",fileCount:"{{formattedCount}} ファイル",fileCountPending:"ファイルを準備中",startTitle:"Start a Pixcode workspace",startDescription:"Pick a folder and Pixcode will bind the explorer, terminal, and chat history to that workspace.",workHere:"Work in this folder"},workspace:{empty:"Workspace 1 を作成するにはプロジェクトを開いてください。",openFirst:"ワークスペースを開く",add:"ワークスペースを追加",scrollLeft:"ワークスペースを左へスクロール",scrollRight:"ワークスペースを右へスクロール",close:"{{name}} を閉じる",closeAction:"ワークスペースを閉じる",closeOthers:"ほかを閉じる",closeAll:"すべて閉じる",rename:"名前を変更",star:"スターを付ける",unstar:"スターを外す",toggleStar:"{{name}} にスターを付ける",moreActions:"ワークスペース操作"},cli:{projectScoped:"プロジェクト単位の CLI ターミナル",chooseTitle:"CLI ターミナルを開始",chooseDescription:"CLI を選んでから、全高のターミナルを開始します。",startSelected:"{{provider}} を開始",newSession:"新しい CLI セッション",history:"履歴",noHistory:"このプロジェクトにはまだセッションがありません。",projectHistory:"プロジェクト履歴",checking:"確認中...",ready:"準備完了",notInstalled:"未インストール",installing:"インストール中...",updateAvailable:"{{version}} に更新",installProvider:"{{provider}} をインストール",updateProvider:"{{provider}} を更新",manualInstall:"この CLI は手動インストールが必要です。",installNoJob:"インストールの job id が返されませんでした。",installFailed:"インストールに失敗しました。",installStreamLost:"インストールストリームが早く閉じました。まだ実行中の可能性があります。",provider:"プロバイダー",installRunning:"インストール中",installDone:"準備完了",installError:"確認が必要",showPanel:"CLI パネルを表示",hidePanel:"CLI パネルを非表示",close:"ターミナルを閉じる"},terminal:{title:"ターミナル",close:"ターミナルを閉じる"},hermes:{title:"Hermes Agent",installTitle:"Hermes Agent をインストール",description:"プロジェクト単位のエージェントターミナルです。Hermes がない場合はインストールして、このワークスペースで開きます。",start:"Hermes を開始",install:"インストール",newSession:"新しい Hermes セッション",history:"Hermes 履歴",connect:"Hermes Agent に接続",ready:"準備完了",installRunning:"Pixcode API で Hermes をインストールしています...",installDone:"Hermes がインストールされ、Pixcode MCP が設定されました。",installError:"Hermes のインストールに失敗しました。",installReady:"Hermes をインストールできます。",installWaiting:"Hermes インストールログを待機中...",retryInstall:"インストールを再試行",installFailed:"Hermes のインストールに失敗しました。",installStreamLost:"Hermes インストールストリームが早期に閉じました。インストールはまだ実行中の可能性があります。"}},Kue={buttons:Rue,tabs:Lue,status:Pue,messages:Due,navigation:Oue,common:Mue,time:Fue,fileOperations:zue,mainContent:Bue,fileTree:Uue,projectWizard:$ue,notifications:Hue,versionUpdate:Gue,orchestration:Vue,controlRoom:Wue,vscodeWorkbench:que},Yue="設定",Zue={account:"アカウント",permissions:"権限",mcpServers:"MCPサーバー",appearance:"外観"},Xue={title:"アカウント",language:"言語",languageLabel:"表示言語",languageDescription:"インターフェースの表示言語を選択してください",username:"ユーザー名",email:"メールアドレス",profile:"プロフィール",changePassword:"パスワードを変更"},Jue={title:"MCPサーバー",addServer:"サーバーを追加",editServer:"サーバーを編集",deleteServer:"サーバーを削除",serverName:"サーバー名",serverType:"サーバーの種類",config:"設定",testConnection:"接続テスト",status:"状態",connected:"接続済み",disconnected:"未接続",scope:{label:"スコープ",user:"ユーザー",project:"プロジェクト"}},Que={title:"外観",theme:"テーマ",codeEditor:"コードエディタ",editorTheme:"エディタのテーマ",wordWrap:"折り返し",showMinimap:"ミニマップを表示",lineNumbers:"行番号",fontSize:"フォントサイズ"},epe={saveChanges:"変更を保存",resetToDefaults:"デフォルトに戻す",cancelChanges:"変更をキャンセル"},tpe={title:"クイック設定",sections:{appearance:"外観",toolDisplay:"ツール表示",viewOptions:"表示オプション",inputSettings:"入力設定",changeAwareness:"コントロール"},darkMode:"ダークモード",autoExpandTools:"ツールを自動展開",showRawParameters:"生パラメータを表示",showThinking:"思考を表示",autoScrollToBottom:"自動スクロール",sendByCtrlEnter:"Ctrl+Enterで送信",sendByCtrlEnterDescription:"有効にすると、Enterではなく Ctrl+Enter でメッセージを送信します。IMEユーザーの誤送信防止に便利です。",changeAwareness:"コントロール",changedFiles:{title:"変更されたファイル",description:"ローカル変更を追跡し、新しい変更が出たらファイルパネルを開きます。",noProject:"ローカル変更を追跡するプロジェクトを選択してください。",refresh:"変更ファイルを更新",empty:"ローカル変更はありません",disabled:"ローカル変更を監視するにはコントロールを有効にしてください。",more:"ほか {{count}} 件",lastChecked:"{{value}} に確認",guideTitle:"右パネルガイド",guideFiles:"変更されたファイルはファイル内で緑に光ります。",guidePanel:"新しい変更で分割パネルが自動的に開きます。",status:{M:"M",A:"A",D:"D",U:"U"}},dragHandle:{dragging:"ドラッグ中",closePanel:"設定パネルを閉じる",openPanel:"設定パネルを開く",draggingStatus:"ドラッグ中...",toggleAndMove:"クリックで切替、ドラッグで移動"}},rpe={title:"ターミナルショートカット",sectionKeys:"キー",sectionNavigation:"ナビゲーション",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"上矢印",arrowDown:"下矢印",scrollDown:"下にスクロール",handle:{closePanel:"ショートカットパネルを閉じる",openPanel:"ショートカットパネルを開く"}},npe={label:"設定",agents:"エージェント",hermes:"Hermes Agent",appearance:"外観",git:"Git",apiTokens:"API & トークン",notifications:"通知",plugins:"プラグイン",mobile:"モバイルで使う",telegram:"Telegram",about:"概要",access:"アクセス"},ape={title:"通知",description:"受信する通知イベントを設定します。",webPush:{title:"Webプッシュ通知",enable:"プッシュ通知を有効にする",disable:"プッシュ通知を無効にする",enabled:"プッシュ通知は有効です",loading:"更新中...",unsupported:"このブラウザではプッシュ通知がサポートされていません。",denied:"プッシュ通知がブロックされています。ブラウザの設定で許可してください。"},events:{title:"イベント種別",actionRequired:"対応が必要",stop:"実行停止",error:"実行失敗"}},ipe={darkMode:{label:"ダークモード",description:"ライトテーマとダークテーマを切り替えます"},projectSorting:{label:"プロジェクトの並び順",description:"サイドバーでのプロジェクトの並び順を設定します",alphabetical:"アルファベット順",recentActivity:"最近のアクティビティ順"},codeEditor:{title:"コードエディタ",theme:{label:"エディタのテーマ",description:"コードエディタのデフォルトテーマ"},wordWrap:{label:"折り返し",description:"エディタでデフォルトで折り返しを有効にします"},showMinimap:{label:"ミニマップを表示",description:"差分ビューでナビゲーション用のミニマップを表示します"},lineNumbers:{label:"行番号を表示",description:"エディタに行番号を表示します"},fontSize:{label:"フォントサイズ",description:"エディタのフォントサイズ(ピクセル)"}}},spe={title:{add:"MCPサーバーを追加",edit:"MCPサーバーを編集"},importMode:{form:"フォーム入力",json:"JSONインポート"},scope:{label:"スコープ",userGlobal:"ユーザー(グローバル)",projectLocal:"プロジェクト(ローカル)",userDescription:"ユーザースコープ: すべてのプロジェクトで利用可能",projectDescription:"ローカルスコープ: 選択したプロジェクトでのみ利用可能",cannotChange:"既存のサーバーを編集する場合、スコープは変更できません"},fields:{serverName:"サーバー名",transportType:"トランスポートの種類",command:"コマンド",arguments:"引数(1行に1つ)",jsonConfig:"JSON設定",url:"URL",envVars:"環境変数(KEY=value、1行に1つ)",headers:"ヘッダー(KEY=value、1行に1つ)",selectProject:"プロジェクトを選択..."},placeholders:{serverName:"my-server"},validation:{missingType:"必須フィールドがありません: type",stdioRequiresCommand:"stdioタイプにはcommandフィールドが必要です",httpRequiresUrl:"{{type}}タイプにはurlフィールドが必要です",invalidJson:"無効なJSON形式です",jsonHelp:"MCPサーバー設定をJSON形式で貼り付けてください。例:",jsonExampleStdio:'• stdio: {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse: {"type":"http","url":"https://api.example.com/mcp"}'},configDetails:"設定の詳細({{configFile}}より)",projectPath:"パス: {{path}}",actions:{cancel:"キャンセル",saving:"保存中...",addServer:"サーバーを追加",updateServer:"サーバーを更新"}},ope={success:"設定を保存しました!",error:"設定の保存に失敗しました",saving:"保存中..."},lpe={save:"設定を保存",cancel:"キャンセル"},cpe={title:"Git設定",description:"コミット用のGit IDを設定します。この設定は git config --global で適用されます",name:{label:"Git名前",help:"コミットに使用する名前"},email:{label:"Gitメールアドレス",help:"コミットに使用するメールアドレス"},actions:{save:"設定を保存",saving:"保存中..."},status:{success:"保存しました"}},dpe={title:"APIキー",description:"外部APIにアクセスするためのAPIキーを生成します。",newKey:{alertTitle:"⚠️ APIキーを保存してください",alertMessage:"このキーが表示されるのは今回限りです。安全な場所に保管してください。",iveSavedIt:"保存しました"},form:{placeholder:"APIキーの名前(例: 本番サーバー)",createButton:"作成",cancelButton:"キャンセル"},newButton:"新しいAPIキー",empty:"APIキーはまだ作成されていません。",list:{created:"作成日:",lastUsed:"最終使用日:"},confirmDelete:"このAPIキーを削除してもよろしいですか?",status:{active:"有効",inactive:"無効"},github:{title:"GitHubトークン",description:"外部APIからプライベートリポジトリをクローンするためのGitHubパーソナルアクセストークンを追加します。",descriptionAlt:"プライベートリポジトリをクローンするためのGitHubパーソナルアクセストークンを追加します。保存せずにAPIリクエストで直接トークンを渡すこともできます。",addButton:"トークンを追加",form:{namePlaceholder:"トークンの名前(例: 個人リポジトリ)",tokenPlaceholder:"GitHubパーソナルアクセストークン(ghp_...)",descriptionPlaceholder:"説明(任意)",addButton:"トークンを追加",cancelButton:"キャンセル",howToCreate:"GitHubパーソナルアクセストークンの作成方法 →"},empty:"GitHubトークンはまだ追加されていません。",added:"追加日:",confirmDelete:"このGitHubトークンを削除してもよろしいですか?"},apiDocsLink:"APIドキュメント",documentation:{title:"外部APIドキュメント",description:"外部APIを使用してアプリケーションからClaude/Cursorセッションを起動する方法を学びます。",viewLink:"APIドキュメントを見る →"},loading:"読み込み中...",version:{updateAvailable:"アップデートあり: v{{version}}"}},upe={authStatus:{checking:"確認中...",connected:"接続済み",notConnected:"未接続",disconnected:"切断",checkingAuth:"認証状態を確認しています...",loggedInAs:"{{email}}でログイン中",authenticatedUser:"認証済みユーザー"},account:{claude:{description:"Anthropic Claude AIアシスタント"},cursor:{description:"Cursor AI搭載コードエディタ"},codex:{description:"OpenAI Codex AIアシスタント"},gemini:{description:"Google Gemini AIアシスタント"},qwen:{description:"Alibaba Qwen Code CLI (Gemini CLI フォーク)"}},connectionStatus:"接続状態",login:{title:"ログイン",reAuthenticate:"再認証",description:"{{agent}}アカウントにサインインしてAI機能を有効にします",reAuthDescription:"別のアカウントでサインインするか、認証情報を更新します",button:"ログイン",reLoginButton:"再ログイン"},error:"エラー: {{error}}"},ppe={title:"権限設定",skipPermissions:{label:"権限プロンプトをスキップ(注意して使用)",claudeDescription:"--dangerously-skip-permissions フラグに相当",cursorDescription:"Cursor CLIの -f フラグに相当",opencodeDescription:"OpenCode の --dangerously-skip-permissions フラグに相当"},allowedTools:{title:"許可されたツール",description:"権限の確認なしに自動的に許可されるツール",placeholder:'例: "Bash(git log:*)" または "Write"',quickAdd:"よく使うツールを追加:",empty:"許可されたツールはありません"},blockedTools:{title:"ブロックされたツール",description:"権限の確認なしに自動的にブロックされるツール",placeholder:'例: "Bash(rm:*)"',empty:"ブロックされたツールはありません"},allowedCommands:{title:"許可されたシェルコマンド",description:"権限の確認なしに自動的に許可されるシェルコマンド",placeholder:'例: "Shell(ls)" または "Shell(git status)"',quickAdd:"よく使うコマンドを追加:",empty:"許可されたコマンドはありません"},blockedCommands:{title:"ブロックされたシェルコマンド",description:"自動的にブロックされるシェルコマンド",placeholder:'例: "Shell(rm -rf)" または "Shell(sudo)"',empty:"ブロックされたコマンドはありません"},toolExamples:{title:"ツールパターンの例:",bashGitLog:"- すべてのgit logコマンドを許可",bashGitDiff:"- すべてのgit diffコマンドを許可",write:"- すべてのWriteツールの使用を許可",bashRm:"- すべてのrmコマンドをブロック(危険)"},shellExamples:{title:"シェルコマンドの例:",ls:"- lsコマンドを許可",gitStatus:"- git statusを許可",npmInstall:"- npm installを許可",rmRf:"- 再帰的削除をブロック"},opencodeAllowed:{title:"許可された Bash パターン",description:"OpenCode が確認せず自動承認する Bash コマンドパターン",placeholder:'例: "git *" または "npm test"',quickAdd:"よく使うパターンを追加:",empty:"許可パターンはありません"},opencodeBlocked:{title:"ブロックされた Bash パターン",description:"OpenCode が常に拒否する Bash コマンドパターン",placeholder:'例: "rm -rf *" または "sudo *"',empty:"ブロックパターンはありません"},opencodeExamples:{title:"パターン例:",gitAll:"- すべての git コマンドを許可",gitPush:"- git push のみをブロック",rmRf:"- 再帰削除をブロック",npm:"- すべての npm コマンドを許可"},codex:{permissionMode:"権限モード",description:"Codexがファイルの変更やコマンドの実行を処理する方法を制御します",modes:{default:{title:"デフォルト",description:"信頼されたコマンド(ls、cat、grep、git statusなど)のみ自動実行。その他のコマンドはスキップ。ワークスペースへの書き込みは可能。"},acceptEdits:{title:"編集を許可",description:"ワークスペース内ですべてのコマンドを自動実行。サンドボックス環境での完全自動モード。"},bypassPermissions:{title:"権限をバイパス",description:"制限なしの完全なシステムアクセス。すべてのコマンドがディスクとネットワークへの完全なアクセスで自動実行されます。注意して使用してください。"}},technicalDetails:"技術的な詳細",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted。信頼されたコマンド: cat, cd, grep, head, ls, pwd, tail, git status/log/diff/show, find(-execなし)など。",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never。すべてのコマンドがプロジェクトディレクトリ内で自動実行。",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never。完全なシステムアクセス。信頼された環境でのみ使用してください。",overrideNote:"チャットインターフェースのモードボタンを使用してセッションごとに上書きできます。"}},actions:{add:"追加"}},mpe={title:"MCPサーバー",description:{claude:"Model Context Protocolサーバーは、Claudeに追加のツールやデータソースを提供します",cursor:"Model Context Protocolサーバーは、Cursorに追加のツールやデータソースを提供します",codex:"Model Context Protocolサーバーは、Codexに追加のツールやデータソースを提供します"},addButton:"MCPサーバーを追加",empty:"MCPサーバーは設定されていません",serverType:"種類",scope:{local:"ローカル",user:"ユーザー"},config:{command:"コマンド",url:"URL",args:"引数",environment:"環境変数"},tools:{title:"ツール",count:"({{count}}):",more:"他{{count}}件"},actions:{edit:"サーバーを編集",delete:"サーバーを削除"},help:{title:"Codex MCPについて",description:"Codexはstdioベースのツールサーバーをサポートしています。追加のツールやリソースでCodexの機能を拡張するサーバーを追加できます。"}},hpe={title:"プラグイン",description:"カスタムプラグインでインターフェースを拡張します。gitからインストールするか、~/.pixcode/plugins/ にフォルダを配置してください。",installPlaceholder:"https://github.com/user/my-plugin",installButton:"インストール",installing:"インストール中…",securityWarning:"信頼できる作成者のプラグイン、またはソースコードを確認済みのプラグインのみをインストールしてください。",scanningPlugins:"プラグインをスキャン中…",noPluginsInstalled:"プラグインがインストールされていません",pullLatest:"gitから最新を取得",noGitRemote:"リモートgitリポジトリがありません — アップデート不可",uninstallPlugin:"プラグインを削除",confirmUninstall:"クリックして確定",confirmUninstallMessage:"{{name}} を削除しますか?この操作は取り消せません。",cancel:"キャンセル",remove:"削除",updateFailed:"アップデートに失敗しました",installFailed:"インストールに失敗しました",uninstallFailed:"削除に失敗しました",toggleFailed:"切り替えに失敗しました",buildYourOwn:"プラグインを自作する",starter:"スターター",docs:"ドキュメント",starterPlugin:{name:"プロジェクト統計",badge:"スターター",description:"プロジェクトのファイル数、コード行数、ファイルタイプの内訳、最近のアクティビティを表示します。",install:"インストール"},morePlugins:"詳細",enable:"有効にする",disable:"無効にする",installAriaLabel:"プラグインのgitリポジトリURL",tab:"タブ",runningStatus:"実行中"},fpe={title:"アクセス",description:"このセルフホスト Pixcode サーバーへ接続する方法を選びます。まず同じネットワークで確認し、リモート接続には安全なトンネル、Tailscale、または独自ドメインを使います。",refresh:"更新",copy:"コピー",copied:"コピー済み",save:"アクセス経路を保存",check:"URL を確認",qrAlt:"{{url}} の QR",guide:{title:"先に接続方法を選ぶ",description:"ネットワーク用語を知らなくても使えます。状況に合う項目を選び、リンクをコピーするかスマホで QR を読み取ります。"},options:{sameNetwork:{title:"同じ Wi-Fi/LAN",description:"端末が Pixcode サーバーと同じルーターや社内ネットワークにある場合に使います。"},secureTunnel:{title:"一時公開リンク",description:"Cloudflare/ngrok トンネルを開始すると、Pixcode が公開 URL と QR を表示します。"},tailscale:{title:"チーム用プライベートリンク",description:"公開ドメインやルーター設定なしでプライベート接続したい場合に使います。"},customDomain:{title:"独自ドメイン",description:"HTTPS、リバースプロキシ、Cloudflare Tunnel ホスト名が既にある場合に使います。"}},status:{ready:"準備完了",detecting:"検出中",guided:"ガイド",configured:"設定済み",optional:"任意"},links:{title:"利用可能なリンク",description:"接続する端末またはメンバー用の正しい URL をコピーします。",local:"ローカル",tailscale:"Tailscale プライベートリンク",empty:"アクセスリンクはまだ検出されていません。"},local:{title:"同じネットワークから接続",description:"最初の確認に最適です。同じ Wi-Fi または LAN から QR を読み取るかリンクをコピーします。",thisDevice:"このコンピューターのみ",loading:"同じネットワークのリンクを検出中...",empty:"LAN リンクが見つかりません。ネットワーク接続を確認して更新してください。",saveLabel:"同じネットワーク接続",save:"この LAN リンクを保存"},tunnel:{title:"安全なトンネル",description:"固定ドメインがなくても、Pixcode が cloudflared または ngrok を起動して公開 URL を表示できます。",secureLink:"公開リンクと QR",help:"開始を押します。cloudflared または ngrok があれば、Pixcode が一時 HTTPS URL と QR を作成します。",running:"トンネル実行中",start:"トンネル開始",stop:"トンネル停止",save:"このトンネル URL を保存",saveLabel:"安全なトンネル接続",qrLabel:"安全なトンネル",installTitle:"トンネル設定が必要",installNeeded:"先に cloudflared または ngrok をインストールしてから、もう一度開始してください。"},tailscale:{title:"Tailscale プライベート接続",description:"Tailscale は任意のプライベートネットワークアプリです。サーバーと利用端末に入れて同じチームでログインすると、Pixcode がプライベート URL を検出します。",save:"この Tailscale URL を保存",saveLabel:"Tailscale プライベート接続",openInstall:"Tailscale インストールを開く",steps:{installServer:"Pixcode を実行しているコンピューターまたはサーバーに Tailscale をインストールします。",installUserDevice:"Pixcode を開くスマホ、ノート PC、またはメンバー端末に Tailscale をインストールします。",login:"両方の端末で同じ Tailscale アカウントまたはチームにログインします。",refresh:"ここに戻って更新を押すと、準備できた private URL が表示されます。"}},advanced:{title:"詳細: 固定ドメイン",description:"LAN URL、Tailscale URL、Cloudflare Tunnel ホスト名、または HTTPS ドメインが既にある場合に保存します。",badge:"詳細"},setup:{title:"固定アクセス経路",description:"ユーザーが使う URL を保存します。LAN、Tailscale、Cloudflare Tunnel、独自ドメインを指定できます。"},modes:{lan:"LAN",tailscale:"Tailscale",cloudflare_tunnel:"Cloudflare Tunnel",custom_domain:"独自ドメイン"},fields:{label:"ラベル",url:"URL",port:"対象ポート"},health:{reachable:"Pixcode に接続できます",unreachable:"Pixcode に接続できません"},configured:{title:"保存済みアクセス経路",description:"これらの経路はロールに応じて管理者、プロジェクトパートナー、プロジェクト作業者が利用できます。",empty:"保存済みのアクセス経路はありません。",noUrl:"URL なし",public:"公開",private:"非公開"},team:{title:"ユーザーの接続方法",description:"Admin system でユーザーを作成し、Control Room でプロジェクトロールを割り当て、この Access URL を共有します。割り当て済みプロジェクトにグローバル管理者権限は不要です。"}},gpe={title:"Hermes Agent",description:"Pixcode が制御するプロジェクト端末として Hermes Agent を管理し、プロジェクト、プロバイダー状態、表示される CLI 起動へ MCP でアクセスします。",statusTitle:"インストール状態",statusFailed:"Hermes Agent を確認できません。",ready:"準備完了",notInstalled:"未インストール",start:"Hermes を開始",install:"インストール",repair:"コマンドを修復",refresh:"更新",gatewayTitle:"REST API ゲートウェイ",gatewayStatusFailed:"Hermes REST ゲートウェイを確認できません。",gatewayStartFailed:"Hermes REST ゲートウェイを開始できません。",gatewayStopFailed:"Hermes REST ゲートウェイを停止できません。",gatewayProbeFailed:"Hermes REST プローブに失敗しました。",gatewayRunning:"REST ゲートウェイ稼働中",gatewayStopped:"REST ゲートウェイ停止中",gatewayStart:"REST 開始",gatewayProbe:"REST テスト",gatewayStop:"停止",gatewayProbeOk:"REST プローブ成功: health、capabilities、models が応答しました。",commandsTitle:"Hermes CLI 設定",commandsDescription:"Pixcode から実際の Hermes ターミナルウィザードを開きます。モデルとプロバイダーで Codex、OpenRouter、Anthropic、Gemini などを接続します。",commandsInstallFirst:"CLI 設定を開く前に Hermes をインストールしてください。",commands:{model:{title:"モデルとプロバイダー",description:"OAuth、API キー、既定モデル選択用の対話型プロバイダー/モデルウィザードを開きます。"},auth:{title:"認証情報",description:"設定済みプロバイダーの OAuth セッションと API キープールを管理します。"},tools:{title:"ツール",description:"Pixcode MCP アクセスを含め、有効にする Hermes ツールセットを選びます。"},doctor:{title:"Doctor",description:"Hermes の設定、依存関係、プラットフォーム問題をターミナルで診断します。"},status:{title:"ステータス",description:"現在のプロバイダー、認証、プラットフォーム、編集済みセットアップ概要を表示します。"},lsp:{title:"LSP ステータス",description:"セマンティック診断用の Hermes language server 連携を確認します。"},skills:{title:"スキル",description:"CLI から Hermes スキルを参照、インストール、監査、設定します。"},sessions:{title:"セッション",description:"Hermes セッションを参照、エクスポート、名前変更、整理、削除します。"}},pixcodeControlTitle:"Pixcode 制御",pixcodeControlDescription:"Pixcode は起動前に Hermes MCP サーバーを設定するため、Hermes はワークスペースを確認し、必要に応じて Pixcode UI 内でプロバイダー端末を開けます。"},bpe={title:Yue,tabs:Zue,account:Xue,mcp:Jue,appearance:Que,actions:epe,quickSettings:tpe,terminalShortcuts:rpe,mainTabs:npe,notifications:ape,appearanceSettings:ipe,mcpForm:spe,saveStatus:ope,footerActions:lpe,git:cpe,apiKeys:dpe,agents:upe,permissions:ppe,mcpServers:mpe,pluginSettings:hpe,access:fpe,hermes:gpe},xpe={title:"おかえりなさい",description:"Pixcodeアカウントにサインイン",username:"ユーザー名",password:"パスワード",submit:"サインイン",loading:"サインイン中...",errors:{invalidCredentials:"ユーザー名またはパスワードが正しくありません",requiredFields:"すべての項目を入力してください",networkError:"ネットワークエラー。もう一度お試しください。"},placeholders:{username:"ユーザー名を入力",password:"パスワードを入力"}},ype={title:"アカウント作成",username:"ユーザー名",password:"パスワード",confirmPassword:"パスワードの確認",submit:"アカウントを作成",loading:"アカウントを作成中...",errors:{passwordMismatch:"パスワードが一致しません",usernameTaken:"このユーザー名は既に使用されています",weakPassword:"パスワードが弱すぎます"}},vpe={title:"サインアウト",confirm:"サインアウトしてもよろしいですか?",button:"サインアウト"},wpe={login:xpe,register:ype,logout:vpe},kpe={title:"プロジェクト",newProject:"新規プロジェクト",deleteProject:"プロジェクトを除去",renameProject:"プロジェクト名を変更",noProjects:"プロジェクトが見つかりません",loadingProjects:"プロジェクトを読み込んでいます...",searchPlaceholder:"プロジェクトを検索...",projectNamePlaceholder:"プロジェクト名",starred:"お気に入り",all:"すべて",untitledSession:"無題のセッション",newSession:"新しいセッション",codexSession:"Codexセッション",fetchingProjects:"Claudeのプロジェクトとセッションを取得しています",projects:"プロジェクト",detectedFromHistory:"履歴から検出",noMatchingProjects:"一致するプロジェクトがありません",tryDifferentSearch:"検索語を変えてお試しください",runClaudeCli:"プロジェクトディレクトリでClaude CLIを実行して始めましょう"},Spe={title:"Pixcode",subtitle:"AIコーディングアシスタント"},Cpe={title:"セッション",newSession:"新しいセッション",deleteSession:"セッションを削除",renameSession:"セッション名を変更",noSessions:"セッションはまだありません",loadingSessions:"セッションを読み込んでいます...",unnamed:"名称未設定",loading:"読み込み中...",showMore:"さらにセッションを表示"},Npe={viewEnvironments:"環境を表示",hideSidebar:"サイドバーを隠す",createProject:"新しいプロジェクトを作成",refresh:"プロジェクトとセッションを更新 (Ctrl+R)",renameProject:"プロジェクト名を変更 (F2)",deleteProject:"サイドバーからプロジェクトを除去 (Delete)",addToFavorites:"お気に入りに追加",removeFromFavorites:"お気に入りから削除",editSessionName:"セッション名を手動で編集",deleteSession:"このセッションを完全に削除",save:"保存",cancel:"キャンセル"},Epe={chat:"チャット",files:"ファイル",git:"Git",terminal:"ターミナル",tasks:"タスク"},Tpe={refresh:"更新",settings:"設定",collapseAll:"すべて折りたたむ",expandAll:"すべて展開",cancel:"キャンセル",save:"保存",delete:"削除",rename:"名前の変更",joinCommunity:"コミュニティに参加",reportIssue:"問題を報告",starOnGithub:"GitHubでスター",controlRoom:"コントロールルーム",controlRoomDescription:"管理、アクセス、実行"},Ape={openSource:"オープンソース"},jpe={active:"アクティブ",inactive:"非アクティブ",thinking:"思考中...",error:"エラー",aborted:"中断",unknown:"不明"},Ipe={justNow:"たった今",oneMinuteAgo:"1分前",minutesAgo:"{{count}}分前",oneHourAgo:"1時間前",hoursAgo:"{{count}}時間前",oneDayAgo:"1日前",daysAgo:"{{count}}日前"},_pe={deleteConfirm:"本当に削除しますか?",renameSuccess:"名前を変更しました",deleteSuccess:"削除しました",errorOccurred:"エラーが発生しました",deleteSessionConfirm:"このセッションを削除してもよろしいですか?この操作は取り消せません。",deleteProjectConfirm:"サイドバーからこのプロジェクトを除去しますか?プロジェクトファイル、メモリ、セッションデータは削除されません。",enterProjectPath:"プロジェクトのパスを入力してください",deleteSessionFailed:"セッションの削除に失敗しました。もう一度お試しください。",deleteSessionError:"セッションの削除でエラーが発生しました。もう一度お試しください。",renameSessionFailed:"セッション名の変更に失敗しました。もう一度お試しください。",renameSessionError:"セッション名の変更でエラーが発生しました。もう一度お試しください。",deleteProjectFailed:"プロジェクトの除去に失敗しました。もう一度お試しください。",deleteProjectError:"プロジェクトの除去でエラーが発生しました。もう一度お試しください。",createProjectFailed:"プロジェクトの作成に失敗しました。もう一度お試しください。",createProjectError:"プロジェクトの作成でエラーが発生しました。もう一度お試しください。"},Rpe={updateAvailable:"アップデートあり"},Lpe={deleteProject:"プロジェクトを除去",deleteSession:"セッションを削除",confirmDelete:"このプロジェクトをどうしますか:",sessionCount:"このプロジェクトには{{count}}件の会話があります。",removeFromSidebar:"サイドバーからのみ除去",deleteAllData:"すべてのデータを完全に削除",allConversationsDeleted:"プロジェクトはサイドバーから除去されます。ファイル、メモリ、セッションデータは保持されます。",cannotUndo:"後からプロジェクトを再追加できます。"},Ppe={section:"オーケストレーション",fallbackTitle:"オーケストレーション実行"},Dpe={projects:kpe,app:Spe,sessions:Cpe,tooltips:Npe,navigation:Epe,actions:Tpe,branding:Ape,status:jpe,time:Ipe,messages:_pe,version:Rpe,deleteConfirmation:Lpe,orchestration:Ppe},Ope={copy:"コピー",copied:"コピーしました",copyCode:"コードをコピー"},Mpe={copy:"メッセージをコピー",copied:"メッセージをコピーしました",selectFormat:"コピー形式を選択",copyAsMarkdown:"Markdownとしてコピー",copyAsText:"テキストとしてコピー"},Fpe={user:"U",error:"エラー",tool:"ツール",claude:"Claude",cursor:"Cursor",codex:"Codex"},zpe={settings:"ツール設定",error:"ツールエラー",result:"ツール結果",viewParams:"入力パラメータを表示",viewRawParams:"生パラメータを表示",viewDiff:"編集差分を表示:",creatingFile:"新規ファイルを作成:",updatingTodo:"Todoリストを更新中",read:"読み取り",readFile:"ファイルを読み取り",updateTodo:"Todoリストを更新",readTodo:"Todoリストを読み取り",searchResults:"件の結果"},Bpe={found:"{{count}}件の{{type}}が見つかりました",file:"ファイル",files:"ファイル",pattern:"パターン:",in:"場所:"},Upe={updated:"ファイルを更新しました",created:"ファイルを作成しました",written:"ファイルを書き込みました",diff:"差分",newFile:"新規ファイル",viewContent:"ファイルの内容を表示",viewFullOutput:"全出力を表示({{count}}文字)",contentDisplayed:"ファイルの内容は上の差分ビューに表示されています"},$pe={title:"インタラクティブプロンプト",waiting:"CLIでの応答を待っています",instruction:"Claudeが実行されているターミナルでオプションを選択してください。",selectedOption:"✓ Claudeがオプション{{number}}を選択しました",instructionDetail:"CLIでは、矢印キーまたは番号を入力してオプションを選択します。"},Hpe={title:"思考中...",emoji:"💭 思考中..."},Gpe={response:"JSONレスポンス"},Vpe={grant:"{{tool}}に権限を付与",added:"権限を追加しました",addTo:"{{entry}}を許可されたツールに追加します。",retry:"権限を保存しました。ツールを使用するにはリクエストを再試行してください。",error:"権限を更新できませんでした。もう一度お試しください。",openSettings:"設定を開く"},Wpe={updated:"Todoリストを更新しました",current:"現在のTodoリスト"},qpe={viewPlan:"📋 実装プランを表示",title:"実装プラン"},Kpe={resetAt:"Claudeの使用制限に達しました。制限は**{{time}} {{timezone}}** - {{date}}にリセットされます"},Ype={permissionMode:"権限モード",modes:{default:"デフォルトモード",acceptEdits:"編集を許可",bypassPermissions:"権限をバイパス",plan:"プランモード"},descriptions:{default:"信頼されたコマンド(ls、cat、grep、git statusなど)のみ自動実行。その他のコマンドはスキップ。ワークスペースへの書き込みは可能。",acceptEdits:"ワークスペース内ですべてのコマンドを自動実行。サンドボックス環境での完全自動モード。",bypassPermissions:"制限なしの完全なシステムアクセス。すべてのコマンドがディスクとネットワークへの完全なアクセスで自動実行されます。注意して使用してください。",plan:"プランニングモード - コマンドは実行されません"},technicalDetails:"技術的な詳細"},Zpe={placeholder:"/ でコマンド、@ でファイル指定、または {{provider}} に何でも聞いてください...",placeholderDefault:"メッセージを入力...",disabled:"入力無効",attachFiles:"ファイルを添付",attachImages:"画像を添付",send:"送信",stop:"停止",clickToChangeMode:"クリックで権限モードを変更(または入力欄でTab)",showAllCommands:"すべてのコマンドを表示"},Xpe={selector:{title:"思考モード",description:"拡張思考によりClaudeがより多くの選択肢を検討できます",active:"有効",tip:"高い思考モードは時間がかかりますが、より深い分析が得られます"},modes:{none:{name:"標準",description:"通常のClaudeの応答",prefix:""},think:{name:"Think",description:"基本的な拡張思考",prefix:"think"},thinkHard:{name:"Think Hard",description:"より深い検討",prefix:"think hard"},thinkHarder:{name:"Think Harder",description:"代替案を含む深い分析",prefix:"think harder"},ultrathink:{name:"Ultrathink",description:"最大限の思考予算",prefix:"ultrathink"}},buttonTitle:"思考モード: {{mode}}"},Jpe={title:"AIアシスタントを選択",description:"新しい会話を始めるプロバイダーを選択してください",selectModel:"モデルを選択",statusUnavailable:"ステータスを取得できません",statusRetryHint:"このCLIを確認できませんでした。タップして再試行してください。",retryStatus:"ステータスを再試行",providerInfo:{anthropic:"by Anthropic",openai:"by OpenAI",cursorEditor:"AIコードエディタ"},readyPrompt:{claude:"{{model}}でClaudeを使用する準備ができました。下にメッセージを入力してください。",cursor:"{{model}}でCursorを使用する準備ができました。下にメッセージを入力してください。",codex:"{{model}}でCodexを使用する準備ができました。下にメッセージを入力してください。",default:"上からプロバイダーを選択して開始してください"}},Qpe={continue:{title:"会話を続ける",description:"コードについて質問したり、変更をリクエストしたり、開発タスクのサポートを受けられます"},loading:{olderMessages:"過去のメッセージを読み込んでいます...",sessionMessages:"セッションメッセージを読み込んでいます..."},messages:{showingOf:"{{total}}件中{{shown}}件を表示",scrollToLoad:"上にスクロールしてさらに読み込む",showingLast:"最新{{count}}件を表示(全{{total}}件)",loadEarlier:"過去のメッセージを読み込む"}},eme={selectProject:{title:"プロジェクトを選択",description:"プロジェクトを選択してそのディレクトリでシェルを開きます"},status:{newSession:"新しいセッション",initializing:"初期化中...",restarting:"再起動中..."},actions:{disconnect:"切断",disconnectTitle:"シェルから切断",restart:"再起動",restartTitle:"シェルを再起動(先に切断してください)",connect:"シェルで続行",connectTitle:"シェルに接続"},loading:"ターミナルを読み込んでいます...",connecting:"シェルに接続しています...",startSession:"新しいClaudeセッションを開始",startProviderSession:"新しい{{provider}}セッションを開始",resumeSession:"セッションを再開: {{displayName}}...",runCommand:"{{projectName}}で{{command}}を実行",startCli:"{{projectName}}でClaude CLIを起動しています",startProviderCli:"{{projectName}}で{{provider}}を起動しています",defaultCommand:"コマンド"},tme={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},rme={codeBlock:Ope,copyMessage:Mpe,messageTypes:Fpe,tools:zpe,search:Bpe,fileOperations:Upe,interactive:$pe,thinking:Hpe,json:Gpe,permissions:Vpe,todo:Wpe,plan:qpe,usageLimit:Kpe,codex:Ype,input:Zpe,thinkingMode:Xpe,providerSelection:Jpe,session:Qpe,shell:eme,claudeStatus:tme},nme={changes:"件の変更",previousChange:"前の変更",nextChange:"次の変更",hideDiff:"差分ハイライトを非表示",showDiff:"差分ハイライトを表示",settings:"エディタ設定",collapse:"エディタを折りたたむ",expand:"エディタを全幅に展開"},ame="{{fileName}}を読み込んでいます...",ime={showingChanges:"変更を表示中"},sme={download:"ファイルをダウンロード",save:"保存",saving:"保存中...",saved:"保存しました!",exitFullscreen:"全画面を終了",fullscreen:"全画面",close:"閉じる"},ome={lines:"行数:",characters:"文字数:",shortcuts:"Ctrl+Sで保存 • Escで閉じる"},lme={title:"バイナリファイル",message:'ファイル "{{fileName}}" はバイナリファイルのため、テキストエディタで表示できません。'},cme={toolbar:nme,loading:ame,header:ime,actions:sme,footer:ome,binaryFile:lme},dme={title:"TaskMaster AIが設定されていません",description:"TaskMasterは、AIを活用した支援により、複雑なプロジェクトを管理しやすいタスクに分解するのに役立ちます",whatIsTitle:"🎯 TaskMasterとは?",features:{aiPowered:"AIを活用したタスク管理:複雑なプロジェクトを管理しやすいサブタスクに分解",prdTemplates:"PRDテンプレート:Product Requirements Documentからタスクを生成",dependencyTracking:"依存関係の追跡:タスクの関係性と実行順序を理解",progressVisualization:"進捗の可視化:カンバンボードと詳細なタスク分析",cliIntegration:"CLI統合:高度なワークフローのためにtaskmasterコマンドを使用"},initializeButton:"TaskMaster AIを初期化"},ume={title:"TaskMasterを始める",subtitle:"TaskMasterが初期化されました!次にすることは:",steps:{createPRD:{title:"Product Requirements Document (PRD) を作成",description:"プロジェクトのアイデアについて話し合い、構築したい内容を説明するPRDを作成します。",addButton:"PRDを追加",existingPRDs:"既存のPRD:"},generateTasks:{title:"PRDからタスクを生成",description:"PRDができたら、AIアシスタントに解析を依頼してください。TaskMasterが自動的に実装の詳細を含む管理しやすいタスクに分解します。"},analyzeTasks:{title:"タスクの分析と展開",description:"AIアシスタントにタスクの複雑さを分析してもらい、より簡単に実装できる詳細なサブタスクに展開します。"},startBuilding:{title:"開発を始める",description:"AIアシスタントにタスクの作業を開始してもらい、ステータスを更新し、プロジェクトの進行に応じて新しいタスクを追加します。"}},tip:"💡 ヒント:TaskMasterのAIを活用したタスク生成を最大限に活用するには、PRDから始めましょう"},pme={title:"TaskMasterのセットアップ",subtitle:"{{projectName}}のインタラクティブCLI",willStart:"TaskMasterの初期化が自動的に開始されます",completed:"TaskMasterのセットアップが完了しました!このウィンドウを閉じることができます。",closeButton:"閉じる",closeContinueButton:"閉じて続ける"},mme={title:"TaskMasterを始める",subtitle:"生産的なタスク管理のガイド",examples:{parsePRD:`💬 例:
|