@shawnstack/quickforge 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +452 -450
  2. package/dist/assets/AgentProfilesPage-BTWTENpJ.js +1 -0
  3. package/dist/assets/{ChatPanelHost-CnQoAfxW.js → ChatPanelHost-DBCQpcp1.js} +1 -1
  4. package/dist/assets/PluginsPage-DRbQLXc6.js +1 -0
  5. package/dist/assets/ScheduledTasksPage-_Te96TTL.js +2 -0
  6. package/dist/assets/SettingsWorkspacePage-B3KByRv9.js +1412 -0
  7. package/dist/assets/{SharedConversationPage-D97o9Ycp.js → SharedConversationPage-CJr-rzR4.js} +1 -1
  8. package/dist/assets/TerminalDock-DSsVoL0f.js +2 -0
  9. package/dist/assets/WorkspaceInspector-HuIqe-Y6.js +3 -0
  10. package/dist/assets/{WorkspaceReaderDialog-B2WEMVuF.js → WorkspaceReaderDialog-au2UL_Ti.js} +1 -1
  11. package/dist/assets/{diff-line-counts-B60LmPZX.js → diff-line-counts-CnZu37tM.js} +1 -1
  12. package/dist/assets/{icons-BlAm_pUr.js → icons-B0ihJZtt.js} +1 -1
  13. package/dist/assets/index-CTo6RkZO.js +63 -0
  14. package/dist/assets/index-hb3vYF5_.css +3 -0
  15. package/dist/assets/mcp-servers-dialog-1Y9X80tB.js +5 -0
  16. package/dist/assets/{monaco-C5Lhy6-h.js → monaco-BKEc9mhB.js} +1 -1
  17. package/dist/assets/{react-vendor--m65aOgw.js → react-vendor-EwqQ8x7m.js} +1 -1
  18. package/dist/assets/skills-dialog-vMwLkH49.js +1 -0
  19. package/dist/assets/{useAppTheme-ChXh3B2c.js → useAppTheme-CG1_MfzA.js} +1 -1
  20. package/dist/index.html +6 -6
  21. package/package.json +1 -1
  22. package/server/agent-manager.mjs +3 -1
  23. package/server/index.mjs +4 -3
  24. package/server/routes/backup.mjs +80 -6
  25. package/server/routes/system.mjs +5 -0
  26. package/server/storage.mjs +6 -5
  27. package/server/utils/package-update.mjs +46 -0
  28. package/dist/assets/AgentProfilesPage-wpt1cJV0.js +0 -1
  29. package/dist/assets/PluginsPage-0wwQydcP.js +0 -1
  30. package/dist/assets/ScheduledTasksPage-qGHyGkjw.js +0 -2
  31. package/dist/assets/SettingsWorkspacePage-CeYg_VJl.js +0 -1320
  32. package/dist/assets/TerminalDock-D4zLoahb.js +0 -2
  33. package/dist/assets/WorkspaceInspector-Bn-am8g6.js +0 -3
  34. package/dist/assets/index-C3bhHGO4.css +0 -3
  35. package/dist/assets/index-C_DXqhW8.js +0 -69
  36. package/dist/assets/mcp-servers-dialog-DEyq3gmP.js +0 -20
  37. package/dist/assets/skills-dialog-CZ3CuVtQ.js +0 -1
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,F as n,L as r,Mt as i,St as a,n as o,s,x as c}from"./icons-BlAm_pUr.js";import{n as l}from"./react-vendor--m65aOgw.js";import{$ as u,et as d,it as f}from"./index-C_DXqhW8.js";import{n as p,t as m}from"./xterm-BtSXYfUR.js";import{t as h}from"./useAppTheme-ChXh3B2c.js";var g=e(i(),1);async function _(e,t){let n=await fetch(e,{cache:`no-store`,...t}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||`Request failed: ${n.status}`);return r}function v(){return _(`/api/terminal/capabilities`)}function y(e){return _(`/api/terminal/sessions${e?`?projectId=${encodeURIComponent(e)}`:``}`)}function b(e){return _(`/api/terminal/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}function x(e){return _(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:`DELETE`})}function S(e,t){return _(`/api/terminal/sessions/${encodeURIComponent(e)}/input`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({data:t})})}function C(){return``}function w(){let e=C();if(e){let t=new URL(e);return t.protocol=t.protocol===`https:`?`wss:`:`ws:`,t.toString().replace(/\/$/,``)}return`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}`}var T=l(),E={light:{background:`#ffffff`,foreground:`#1f2937`,cursor:`#1f2937`,selectionBackground:`#dbeafe`},dark:{background:`#171717`,foreground:`#e5e7eb`,cursor:`#e5e7eb`,selectionBackground:`#3f3f46`}};function ee({session:e,active:t,height:n,onReady:r,onExited:i,onConnectionError:a}){let o=h(),s=E[o],c=(0,g.useRef)(null),l=(0,g.useRef)(null),u=(0,g.useRef)(null),d=(0,g.useRef)(null),_=(0,g.useRef)(null),v=(0,g.useRef)(null);return(0,g.useEffect)(()=>{let t=c.current;if(!t)return;let n=!1,o=!1,h=!1,g=!1,y=t=>{n||h||g||(g=!0,a(e.id,t))},b=new p({cursorBlink:!0,convertEol:!1,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,fontSize:12,lineHeight:1.2,scrollback:5e3,theme:s}),x=new m;b.loadAddon(x),b.open(t),b.writeln(`\x1b[2mConnected to ${e.cwd}\x1b[0m`),l.current=b,u.current=x;let S=()=>{if(t.isConnected)try{x.fit();let{cols:e,rows:t}=b,n=d.current;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:`resize`,cols:e,rows:t}))}catch{}},C=new WebSocket(`${w()}/api/terminal/sessions/${encodeURIComponent(e.id)}/ws`);d.current=C,C.addEventListener(`open`,()=>{o=!0,g=!1,a(e.id,void 0),_.current=b.onData(e=>{C.readyState===WebSocket.OPEN&&C.send(JSON.stringify({type:`input`,data:e}))}),window.setTimeout(S,0)}),C.addEventListener(`message`,t=>{try{let n=JSON.parse(String(t.data));n.type===`ready`?r(e.id):n.type===`output`?b.write(n.data):n.type===`exit`?(h=!0,b.writeln(``),b.writeln(`\x1b[33m[process exited with code ${n.exitCode??`unknown`}]\x1b[0m`),i(e.id)):n.type===`error`&&b.writeln(`\x1b[31m${n.message}\x1b[0m`)}catch{}}),C.addEventListener(`error`,()=>{y(f(o?`terminalConnectionClosedUnexpectedly`:`terminalConnectionFailed`))}),C.addEventListener(`close`,e=>{_.current?.dispose(),_.current=null,!(n||h)&&(!e.wasClean||e.code!==1e3)&&y(f(o?`terminalConnectionClosedUnexpectedly`:`terminalConnectionFailed`))});let T=new ResizeObserver(()=>S());return T.observe(t),v.current=T,window.setTimeout(S,50),()=>{n=!0,T.disconnect(),v.current=null,_.current?.dispose(),_.current=null,C.close(),d.current=null,b.dispose(),l.current=null,u.current=null}},[o,a,i,r,e.cwd,e.id,s]),(0,g.useEffect)(()=>{if(!t)return;let e=u.current,n=l.current;window.setTimeout(()=>{try{e?.fit(),n?.focus()}catch{}},0)},[t,n]),(0,T.jsx)(`div`,{ref:c,className:t?`h-full min-h-0 w-full`:`hidden`,"aria-hidden":!t})}var D=180,te=.7,ne=320;function O(e,t){let n=t?t.name:`Terminal`,r=new Set(e.map(e=>e.name));if(n!==`Terminal`&&!r.has(n))return n;let i=1;for(;r.has(`${n} ${i}`);)i+=1;return`${n} ${i}`}function k(e,t){let n=e?.terminalShellProfiles||[],r=t||e?.defaultTerminalShellProfileId||``;return n.find(e=>e.id===r)||n[0]}function A({project:e,onCollapse:i,pendingCommand:l,onPendingCommandHandled:p}){let[m,h]=(0,g.useState)(null),[_,C]=(0,g.useState)([]),[w,E]=(0,g.useState)(),[A,re]=(0,g.useState)(ne),[j,M]=(0,g.useState)(!0),[N,ie]=(0,g.useState)(!1),[ae,P]=(0,g.useState)(),[oe,F]=(0,g.useState)({}),[I,L]=(0,g.useState)(!1),[R,z]=(0,g.useState)(!1),B=(0,g.useRef)(!1),V=(0,g.useRef)(new Set),se=(0,g.useRef)(l),H=(0,g.useRef)(new Set),U=(0,g.useRef)(new Set),W=(0,g.useRef)(new Map),G=(0,g.useRef)(!0),[K,q]=(0,g.useState)(()=>new Set),J=(0,g.useRef)(null),Y=(0,g.useRef)(null),X=e?.id,Z=(0,g.useMemo)(()=>_.find(e=>e.id===w)??_[0],[w,_]);(0,g.useEffect)(()=>{se.current=l},[l]),(0,g.useEffect)(()=>()=>{G.current=!1},[]);let ce=(0,g.useCallback)(async()=>{let e=await y(X);return C(e.sessions),E(t=>t&&e.sessions.some(e=>e.id===t)?t:e.sessions[0]?.id),e.sessions},[X]),le=(0,g.useCallback)(async(e,t)=>{if(B.current)return;let n=k(m,t);B.current=!0,ie(!0),P(void 0),F({});try{let t=await b({projectId:X,name:O(e,n),cols:120,rows:30,shellProfileId:n?.id,shellProfileName:n?.name});C(e=>[...e,t]),E(t.id)}catch(e){P(e instanceof Error?e.message:f(`terminalCreateFailed`))}finally{B.current=!1,ie(!1)}},[m,X]);(0,g.useEffect)(()=>{let e=!1;return(async()=>{M(!0),P(void 0);try{let[t,n]=await Promise.all([v(),y(X)]);if(e)return;if(h(t),C(n.sessions),E(n.sessions[0]?.id),t.enabled&&n.sessions.length===0&&!se.current){let n=k(t);b({projectId:X,name:O([],n),cols:120,rows:30,shellProfileId:n?.id,shellProfileName:n?.name}).then(t=>{if(e){x(t.id).catch(()=>{});return}C([t]),E(t.id)}).catch(t=>{e||P(t instanceof Error?t.message:f(`terminalCreateFailed`))})}}catch(t){e||P(t instanceof Error?t.message:f(`terminalUnavailable`))}finally{e||M(!1)}})(),()=>{e=!0}},[X]),(0,g.useEffect)(()=>{if(!I)return;let e=e=>{Y.current?.contains(e.target)||L(!1)},t=e=>{e.key===`Escape`&&L(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[I]),(0,g.useEffect)(()=>{if(!R)return;let e=e=>{e.key===`Escape`&&z(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[R]),(0,g.useEffect)(()=>{if(!l||V.current.has(l.id)||W.current.has(l.id)||H.current.has(l.id)||j||N||!m)return;if(!m.enabled){V.current.add(l.id),window.setTimeout(()=>{P(m.reason||f(`terminalUnavailable`)),p?.(l.id)},0);return}let e=Z&&!Z.exited?Z:_.find(e=>!e.exited);if(e){W.current.set(l.id,e.id),window.setTimeout(()=>{G.current&&E(e.id)},0);return}H.current.add(l.id),window.setTimeout(()=>{G.current&&P(void 0)},0);let t=k(m);b({projectId:X,name:O(_,t),cols:120,rows:30,shellProfileId:t?.id,shellProfileName:t?.name}).then(e=>{if(!G.current){x(e.id).catch(()=>{});return}W.current.set(l.id,e.id),C(t=>t.some(t=>t.id===e.id)?t:[...t,e]),E(e.id)}).catch(e=>{G.current&&(P(e instanceof Error?e.message:f(`terminalCommandExecuteFailed`)),V.current.add(l.id),p?.(l.id))}).finally(()=>{H.current.delete(l.id)})},[Z,m,N,j,p,l,X,_]),(0,g.useEffect)(()=>{if(!l||V.current.has(l.id)||U.current.has(l.id))return;let e=W.current.get(l.id),t=e?_.find(t=>t.id===e):Z&&!Z.exited?Z:_.find(e=>!e.exited);!t||t.exited||!K.has(t.id)||(U.current.add(l.id),window.setTimeout(()=>{G.current&&(E(t.id),P(void 0))},0),(async()=>{try{if(l.execute){let e=l.command.split(`
2
- `),n=e.flatMap((t,n)=>n<e.length-1?[t,`\r`]:[t]);n.push(`\r`),await S(t.id,n.join(``))}else await S(t.id,l.command)}catch(e){G.current&&P(e instanceof Error?e.message:f(`terminalCommandExecuteFailed`))}finally{V.current.add(l.id),U.current.delete(l.id),W.current.delete(l.id),G.current&&p?.(l.id)}})())},[Z,p,l,K,_]);let ue=async e=>{P(void 0),F(t=>{if(!t[e])return t;let n={...t};return delete n[e],n});let t=_.filter(t=>t.id!==e);C(t),w===e&&E(t[0]?.id);try{await x(e)}catch(e){P(e instanceof Error?e.message:f(`terminalCloseFailed`)),ce().catch(()=>{})}},de=(0,g.useCallback)(e=>{C(t=>t.map(t=>t.id===e?{...t,exited:!0}:t)),q(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),fe=(0,g.useCallback)(e=>{q(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),pe=(0,g.useCallback)((e,t)=>{F(n=>{if(!t){if(!n[e])return n;let t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}})},[]),me=e=>{J.current={startY:e.clientY,startHeight:A},e.currentTarget.setPointerCapture(e.pointerId)},he=e=>{let t=J.current;if(!t)return;let n=Math.max(D,Math.floor(window.innerHeight*te));re(Math.min(n,Math.max(D,t.startHeight+t.startY-e.clientY)))},ge=e=>{J.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},Q=m?.terminalShellProfiles||[],_e=m?.defaultTerminalShellProfileId||``,ve=Q.find(e=>e.id===_e)||Q[0],ye=!!(m&&_.length>=m.maxSessions),be=N||ye,xe=Z?oe[Z.id]:void 0,$=ae??xe,Se=R?$?`calc(100% - 4.25rem)`:`calc(100% - 2.25rem)`:$?A-72:A-45;return(0,T.jsxs)(`div`,{className:d(`shrink-0 border-t border-border bg-background`,R&&`quickforge-terminal-fullscreen z-40 flex flex-col border-t-0`),style:R?void 0:{height:A},children:[R?null:(0,T.jsx)(`div`,{className:`h-1 cursor-row-resize bg-transparent hover:bg-border`,onPointerDown:me,onPointerMove:he,onPointerUp:ge,onPointerCancel:ge}),(0,T.jsxs)(`div`,{className:`flex h-9 items-center gap-1 border-b border-border px-2`,children:[(0,T.jsx)(s,{className:`size-4 shrink-0 text-muted-foreground/60`}),(0,T.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-x-auto`,children:_.map(e=>(0,T.jsxs)(`button`,{type:`button`,className:d(`group flex max-w-44 shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground/72 hover:bg-muted/20 hover:text-foreground/85`,Z?.id===e.id&&`bg-muted/28 text-foreground/90`),onClick:()=>E(e.id),title:`${e.name} — ${e.cwd}`,children:[(0,T.jsx)(`span`,{className:d(`size-1.5 rounded-full`,e.exited?`bg-muted-foreground/40`:`bg-emerald-500/80`)}),(0,T.jsx)(`span`,{className:`truncate`,children:e.name}),(0,T.jsx)(`span`,{role:`button`,tabIndex:0,className:`ml-1 rounded-sm p-0.5 opacity-60 hover:bg-background hover:opacity-100`,onClick:t=>{t.stopPropagation(),ue(e.id)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),ue(e.id))},"aria-label":f(`terminalCloseSession`,{name:e.name}),children:(0,T.jsx)(o,{className:`size-3`})})]},e.id))}),(0,T.jsxs)(`div`,{className:`relative shrink-0`,ref:Y,children:[(0,T.jsxs)(`div`,{className:`flex items-center overflow-hidden rounded-md border border-border bg-background`,children:[(0,T.jsx)(`button`,{type:`button`,className:`inline-flex h-7 w-7 items-center justify-center text-foreground/85 transition-colors hover:bg-muted/20 disabled:pointer-events-none disabled:opacity-50`,onClick:()=>void le(_),disabled:be,title:ve?f(`terminalNewWithProfile`,{name:ve.name}):f(`terminalNew`),"aria-label":f(`terminalNew`),children:N?(0,T.jsx)(r,{className:`size-3.5 animate-spin`}):(0,T.jsx)(c,{className:`size-3.5`})}),Q.length>0?(0,T.jsx)(`button`,{type:`button`,className:`inline-flex h-7 w-7 items-center justify-center border-l border-border text-muted-foreground/72 transition-colors hover:bg-muted/20 hover:text-foreground/85 disabled:pointer-events-none disabled:opacity-50`,onClick:()=>L(e=>!e),disabled:be,title:f(`terminalSelectShell`),"aria-label":f(`terminalSelectShell`),"aria-expanded":I,children:(0,T.jsx)(a,{className:`size-3.5`})}):null]}),I?(0,T.jsxs)(`div`,{className:`absolute bottom-9 right-0 z-30 w-64 overflow-hidden rounded-lg border border-border bg-background p-1.5 shadow-[0_16px_38px_-22px_rgb(15_23_42_/_0.65)]`,children:[(0,T.jsx)(`div`,{className:`px-2 pb-1.5 pt-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60`,children:f(`terminalNewWith`)}),Q.map(e=>(0,T.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground/80 hover:bg-muted/20 hover:text-foreground/90`,onClick:()=>{L(!1),le(_,e.id)},children:[(0,T.jsx)(`span`,{className:`inline-flex size-5 shrink-0 items-center justify-center rounded bg-muted/20 text-[10px] text-muted-foreground/70`,children:e.name.slice(0,1).toUpperCase()}),(0,T.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,T.jsx)(`span`,{className:`block truncate font-medium`,children:e.name}),(0,T.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground/55`,children:e.command})]})]},e.id))]}):null]}),(0,T.jsx)(u,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:()=>z(e=>!e),title:f(R?`terminalExitFullscreen`:`terminalFullscreen`),"aria-label":f(R?`terminalExitFullscreen`:`terminalFullscreen`),children:R?(0,T.jsx)(t,{className:`size-3.5`}):(0,T.jsx)(n,{className:`size-3.5`})}),(0,T.jsx)(u,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:i,title:f(`terminalCollapse`),"aria-label":f(`terminalCollapse`),children:(0,T.jsx)(a,{className:`size-3.5`})})]}),$?(0,T.jsx)(`div`,{className:`border-b border-border px-3 py-1.5 text-xs text-destructive`,children:$}):null,(0,T.jsx)(`div`,{className:`min-h-0 bg-background`,style:{height:Se},children:j?(0,T.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-xs text-muted-foreground/60`,children:[(0,T.jsx)(r,{className:`size-4 animate-spin`}),` `,f(`terminalStarting`)]}):m&&!m.enabled?(0,T.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-xs text-muted-foreground/60`,children:m.reason||f(`terminalUnavailable`)}):_.length===0?(0,T.jsx)(`div`,{className:`flex h-full items-center justify-center text-xs text-muted-foreground/60`,children:f(`terminalNoSessions`)}):_.map(e=>(0,T.jsx)(ee,{session:e,active:e.id===Z?.id,height:R?window.innerHeight-36:A,onReady:fe,onExited:de,onConnectionError:pe},e.id))})]})}export{A as TerminalDock};
@@ -1,3 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{$ as t,A as n,Ct as r,F as i,H as a,J as o,K as s,Mt as c,Ot as l,Q as u,R as d,St as f,V as p,W as m,X as h,Y as g,Z as _,_ as v,bt as ee,ct as te,et as y,g as ne,it as b,j as re,lt as ie,n as x,nt as ae,o as oe,ot as S,q as C,rt as w,st as T,tt as E,ut as se,vt as ce,y as le}from"./icons-BlAm_pUr.js";import{n as D}from"./react-vendor--m65aOgw.js";import{$ as O,a as ue,c as de,et as k,i as fe,it as A,l as pe,n as me,o as he,r as ge,s as _e,t as j,u as ve}from"./index-C_DXqhW8.js";import{i as ye,n as M,r as be,t as N}from"./diff-line-counts-B60LmPZX.js";var P=e(c(),1),F=D();function xe(e){let t=e.trim();if(!t.startsWith(`/api/workspace/preview/`))return!1;try{let e=new URL(t,window.location.origin);return e.origin===window.location.origin&&e.pathname.startsWith(`/api/workspace/preview/`)}catch{return!1}}function I(e){let t=e.trim().replace(/\\/g,`/`);return t.startsWith(`/`)||/^[a-zA-Z]:\//.test(t)}function L(e,t){let n=e.trim();if(!t||!xe(n))return n;try{let e=new URL(n,window.location.origin),r=`/api/workspace/preview/${encodeURIComponent(t)}/`;return e.pathname.startsWith(r)?e.pathname.slice(r.length).split(`/`).map(e=>decodeURIComponent(e)).join(`/`):n}catch{return n}}function Se(e,t){let n=e.trim();if(!n)return{url:``,displayUrl:``,error:``};if(xe(n)){let e=new URL(n,window.location.origin);return{url:`${e.pathname}${e.search}${e.hash}`,displayUrl:L(n,t),error:``}}if(t&&I(n))return{url:he(t,n),displayUrl:n,error:``};let r=/^https?:\/\//i.test(n)?n:`http://${n}`;try{let e=new URL(r);return e.protocol!==`http:`&&e.protocol!==`https:`?{url:``,displayUrl:n,error:A(`invalidPreviewUrl`)}:{url:e.toString(),displayUrl:e.toString(),error:``}}catch{return{url:``,displayUrl:n,error:A(`invalidPreviewUrl`)}}}function Ce({url:e,onUrlChange:t,projectId:n}){let r=(0,P.useMemo)(()=>Se(e,n),[n,e]),[i,a]=(0,P.useState)({sourceUrl:e,value:r.displayUrl}),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(0),u=r.url,d=u.startsWith(`/api/workspace/preview/`)?`allow-scripts allow-same-origin allow-forms`:`allow-scripts allow-same-origin allow-forms allow-popups allow-downloads allow-modals allow-pointer-lock`,f=i.sourceUrl===e?i.value:r.displayUrl;function p(e=f){let r=Se(e,n);if(r.error){s(r.error);return}s(``),a({sourceUrl:r.displayUrl,value:r.displayUrl}),t(r.displayUrl),r.url&&l(e=>e+1)}function m(){u&&l(e=>e+1)}function h(){u&&window.open(u,`_blank`,`noopener,noreferrer`)}return(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-border p-3`,children:[(0,F.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),p()},children:[(0,F.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center rounded-md border border-border bg-background px-2 py-1.5 text-xs text-muted-foreground/65 focus-within:text-foreground/85`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:A(`previewUrl`)}),(0,F.jsx)(`input`,{value:f,onChange:t=>{a({sourceUrl:e,value:t.target.value}),o&&s(``)},placeholder:A(`previewUrlPlaceholder`),className:`min-w-0 flex-1 bg-transparent text-xs text-foreground/85 outline-none placeholder:text-muted-foreground/50`})]}),(0,F.jsx)(O,{type:`submit`,variant:`outline`,size:`sm`,className:`h-8 shrink-0 px-3 text-xs`,children:A(`openPreview`)}),(0,F.jsx)(O,{variant:`ghost`,size:`icon`,onClick:m,disabled:!u,"aria-label":A(`refreshPreview`),title:A(`refreshPreview`),children:(0,F.jsx)(le,{className:`size-4`})}),(0,F.jsx)(O,{variant:`ghost`,size:`icon`,onClick:h,disabled:!u,"aria-label":A(`openInBrowser`),title:A(`openInBrowser`),children:(0,F.jsx)(b,{className:`size-4`})})]}),o?(0,F.jsx)(`div`,{className:`text-xs text-destructive`,children:o}):null]}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 bg-muted/10`,children:u?(0,F.jsx)(`iframe`,{title:A(`webPreview`),src:u,sandbox:d,className:`h-full w-full border-0 bg-background`},`${u}:${c}`):(0,F.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center px-8 text-center`,children:[(0,F.jsx)(`div`,{className:`rounded-full bg-muted/20 p-3 text-muted-foreground/70`,children:(0,F.jsx)(S,{className:`size-5`})}),(0,F.jsx)(`div`,{className:`mt-4 text-sm font-medium text-foreground/85`,children:A(`noPreviewUrlTitle`)}),(0,F.jsx)(`div`,{className:`mt-2 max-w-xs text-xs leading-5 text-muted-foreground/70`,children:A(`noPreviewUrlDescription`)})]})})]})}var R={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,css:`css`,scss:`scss`,less:`less`,html:`html`,htm:`html`,md:`markdown`,markdown:`markdown`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,swift:`swift`,kt:`kotlin`,kts:`kotlin`,sh:`shell`,bash:`shell`,zsh:`shell`,ps1:`powershell`,yml:`yaml`,yaml:`yaml`,xml:`xml`,sql:`sql`,dockerfile:`dockerfile`,toml:`toml`,ini:`ini`,env:`ini`};function z(e){let t=e.split(`/`).pop()?.toLowerCase()??``;return t===`dockerfile`||t.endsWith(`.dockerfile`)?`dockerfile`:R[t.includes(`.`)?t.split(`.`).pop()??``:t]??`plaintext`}function we(e){return e.slice(e.lastIndexOf(`/`)+1)}function B(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t+1):``}var V={typescript:{Icon:y,className:`text-sky-500 dark:text-sky-400`},javascript:{Icon:y,className:`text-amber-500 dark:text-amber-400`},python:{Icon:y,className:`text-blue-600 dark:text-blue-400`},go:{Icon:y,className:`text-cyan-600 dark:text-cyan-400`},rust:{Icon:y,className:`text-orange-600 dark:text-orange-400`},java:{Icon:y,className:`text-red-500 dark:text-red-400`},c:{Icon:y,className:`text-blue-500 dark:text-blue-400`},cpp:{Icon:y,className:`text-indigo-500 dark:text-indigo-400`},csharp:{Icon:y,className:`text-violet-500 dark:text-violet-400`},php:{Icon:y,className:`text-indigo-500 dark:text-indigo-400`},ruby:{Icon:y,className:`text-rose-500 dark:text-rose-400`},swift:{Icon:y,className:`text-orange-500 dark:text-orange-400`},kotlin:{Icon:y,className:`text-violet-500 dark:text-violet-400`},shell:{Icon:y,className:`text-green-600 dark:text-green-400`},powershell:{Icon:y,className:`text-blue-600 dark:text-blue-400`},json:{Icon:E,className:`text-amber-600 dark:text-amber-400`},css:{Icon:p,className:`text-sky-500 dark:text-sky-400`},scss:{Icon:p,className:`text-pink-500 dark:text-pink-400`},less:{Icon:p,className:`text-sky-500 dark:text-sky-400`},html:{Icon:S,className:`text-orange-500 dark:text-orange-400`},markdown:{Icon:g,className:`text-slate-500 dark:text-slate-400`},yaml:{Icon:t,className:`text-slate-500 dark:text-slate-400`},toml:{Icon:t,className:`text-slate-500 dark:text-slate-400`},ini:{Icon:t,className:`text-slate-500 dark:text-slate-400`},xml:{Icon:y,className:`text-slate-500 dark:text-slate-400`},sql:{Icon:T,className:`text-indigo-500 dark:text-indigo-400`},dockerfile:{Icon:ie,className:`text-sky-600 dark:text-sky-400`},plaintext:{Icon:g,className:`text-slate-500 dark:text-slate-400`}},H=new Set([`png`,`jpg`,`jpeg`,`gif`,`svg`,`ico`,`webp`,`bmp`,`avif`]),U=new Set([`zip`,`tar`,`gz`,`tgz`,`rar`,`7z`,`bz2`,`xz`]),W=new Set([`csv`,`tsv`,`xls`,`xlsx`]);function G(e){if(e===`readme`||e.startsWith(`readme.`))return{Icon:l,className:`text-sky-500 dark:text-sky-400`};if(e===`license`||e.startsWith(`license.`)||e===`licence`||e.startsWith(`licence.`)||e===`copying`||e.startsWith(`copying.`))return{Icon:v,className:`text-slate-500 dark:text-slate-400`};if(e===`makefile`||e.startsWith(`makefile.`))return{Icon:oe,className:`text-slate-500 dark:text-slate-400`};if(e.startsWith(`docker-compose`))return{Icon:ie,className:`text-sky-600 dark:text-sky-400`};if(e===`.gitignore`||e===`.gitattributes`||e===`.gitmodules`)return{Icon:v,className:`text-orange-500 dark:text-orange-400`};if(e===`.env`||e.startsWith(`.env.`))return{Icon:t,className:`text-slate-500 dark:text-slate-400`};if(e.endsWith(`.lock`)||e.endsWith(`-lock.json`)||e.endsWith(`-lock.yaml`))return{Icon:_,className:`text-slate-500 dark:text-slate-400`}}function Te(e){let t=we(e).toLowerCase(),n=G(t);if(n)return n;let r=B(t);return H.has(r)?{Icon:u,className:`text-purple-500 dark:text-purple-400`}:U.has(r)?{Icon:ae,className:`text-slate-500 dark:text-slate-400`}:W.has(r)?{Icon:h,className:`text-green-600 dark:text-green-400`}:V[z(e)]||{Icon:o,className:`text-slate-500 dark:text-slate-400`}}function Ee(e,t){let n=e.toLowerCase();return n===`.git`||n===`.svn`||n===`.hg`?{Icon:C,className:`text-orange-500 dark:text-orange-400`}:{Icon:t?s:m,className:`text-slate-500 dark:text-slate-400`}}function K({path:e,className:t=`size-3.5`}){let{Icon:n,className:r}=Te(e);return(0,F.jsx)(n,{className:`${r} ${t}`})}function q({name:e,open:t,className:n=`size-3.5`}){let{Icon:r,className:i}=Ee(e,t);return(0,F.jsx)(r,{className:`${i} ${n}`})}function De(e){return e===`added`?{label:`A`,text:A(`workspaceStatusAdded`),className:`text-emerald-600 dark:text-emerald-500`}:e===`deleted`?{label:`D`,text:A(`workspaceStatusDeleted`),className:`text-red-600 dark:text-red-500`}:e===`renamed`?{label:`R`,text:A(`workspaceStatusRenamed`),className:`text-blue-600 dark:text-blue-500`}:e===`untracked`?{label:`U`,text:A(`workspaceStatusUntracked`),className:`text-amber-600 dark:text-amber-500`}:e===`conflicted`?{label:`!`,text:A(`workspaceStatusConflict`),className:`text-red-600 dark:text-red-500`}:{label:`M`,text:A(`workspaceStatusModified`),className:`text-emerald-600 dark:text-emerald-500`}}function Oe({files:e,selectedPath:t,onSelectFile:n,emptyMessage:r=A(`workspaceNoWorkingTreeChanges`)}){return e.length===0?(0,F.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:r}):(0,F.jsx)(`div`,{className:`space-y-0.5`,children:e.map(e=>{let r=De(e.status);return(0,F.jsxs)(`button`,{type:`button`,className:`flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-xs transition-colors ${t===e.path?`bg-muted/28 text-foreground/90`:`text-muted-foreground/72 hover:bg-muted/20 hover:text-foreground/85`}`,onClick:()=>n(e.path),title:e.oldPath?`${e.oldPath} → ${e.path}`:e.path,children:[(0,F.jsx)(`span`,{className:`w-4 shrink-0 font-mono text-[0.68rem] font-semibold ${r.className}`,children:r.label}),(0,F.jsx)(K,{path:e.path,className:`size-3.5 shrink-0`}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.path}),typeof e.additions==`number`&&typeof e.deletions==`number`?(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] font-medium`,children:[(0,F.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),(0,F.jsxs)(`span`,{className:`ml-1 text-red-600 dark:text-red-500`,children:[`-`,e.deletions]})]}):null,(0,F.jsx)(`span`,{className:`shrink-0 text-[0.68rem] text-muted-foreground/55`,children:r.text})]},`${e.status}:${e.oldPath??``}:${e.path}`)})})}function ke(e){return e?e.status===`added`?`A`:e.status===`deleted`?`D`:e.status===`renamed`?`R`:e.status===`untracked`?`U`:`M`:``}function Ae({projectId:e,path:t}){let[n,r]=(0,P.useState)(!1);return n?(0,F.jsx)(K,{path:t,className:`size-3.5 shrink-0`}):(0,F.jsx)(`img`,{src:he(e,t),alt:``,"aria-hidden":!0,loading:`lazy`,decoding:`async`,onError:()=>r(!0),className:`size-3.5 shrink-0 rounded-[3px] object-cover ring-1 ring-black/5 dark:ring-white/10`})}function je({node:e,depth:t,selectedPath:n,gitStatuses:r,onSelectFile:i,onPreviewFile:a,projectId:o}){let[s,c]=(0,P.useState)(t<1),l=e.type===`directory`,u=n===e.path,d=ke(r[e.path]),f=(l?void 0:me(e.path))===`image`,p=!!o&&f,m=!!a&&(f||fe(e.path));function h(){a?.(e.path)}return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`button`,{type:`button`,className:`group flex h-7 w-full items-center gap-1.5 rounded-md px-2 text-left text-xs transition-colors ${u?`bg-muted/28 text-foreground/90`:`text-muted-foreground/72 hover:bg-muted/20 hover:text-foreground/85`}`,style:{paddingLeft:`${.5+t*.75}rem`},onClick:()=>{l?c(e=>!e):f&&a?h():i(e.path)},title:e.path,children:[l?(0,F.jsx)(ee,{className:`size-3 shrink-0 transition-transform ${s?`rotate-90`:``}`}):(0,F.jsx)(`span`,{className:`w-3 shrink-0`}),l?(0,F.jsx)(q,{name:e.name,open:s,className:`size-3.5 shrink-0`}):p?(0,F.jsx)(Ae,{projectId:o,path:e.path}):(0,F.jsx)(K,{path:e.path,className:`size-3.5 shrink-0`}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),d?(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[0.68rem] text-emerald-600 dark:text-emerald-500`,children:d}):null,m?(0,F.jsx)(`span`,{role:`button`,tabIndex:0,"aria-label":A(`openPreview`),title:A(`openPreview`),className:`-mr-1 shrink-0 rounded p-0.5 text-muted-foreground/60 opacity-0 transition-opacity hover:bg-muted/40 hover:text-foreground/85 focus-visible:opacity-100 focus-visible:text-foreground/85 focus-visible:outline-none group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),h()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),h())},children:(0,F.jsx)(w,{className:`size-3.5`})}):null]}),l&&s?(0,F.jsx)(`div`,{children:(e.children??[]).map(e=>(0,F.jsx)(je,{node:e,depth:t+1,selectedPath:n,gitStatuses:r,onSelectFile:i,onPreviewFile:a,projectId:o},e.path))}):null]})}function Me({tree:e,selectedPath:t,gitStatuses:n={},onSelectFile:r,onPreviewFile:i,projectId:a}){return e.length===0?(0,F.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:A(`workspaceNoFilesToDisplay`)}):(0,F.jsx)(`div`,{className:`space-y-0.5`,children:e.map(e=>(0,F.jsx)(je,{node:e,depth:0,selectedPath:t,gitStatuses:n,onSelectFile:r,onPreviewFile:i,projectId:a},e.path))})}function Ne(){if(typeof window>`u`)return 0;let e=window.getComputedStyle(document.body).getPropertyValue(`--quickforge-desktop-titlebar-height`).trim();if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Pe(e,t){return e===`browser`?`browser`:`${e}:${t}`}var Fe=[{view:`overview`,label:A(`workspaceOverview`),icon:d},{view:`files`,label:A(`workspaceFiles`),icon:m},{view:`changes`,label:A(`workspaceChanges`),icon:a},{view:`browser`,label:A(`workspaceBrowser`),icon:S}],J=380,Y=480,X=800,Ie=`quickforge_workspaceInspectorWidth`,Le=140,Re=200,ze=400;function Be(){if(typeof window>`u`)return Y;try{let e=window.localStorage.getItem(Ie);if(!e)return Y;let t=Number(e);return Number.isFinite(t)?Math.min(X,Math.max(J,t)):Y}catch{return Y}}function Ve(e,t){let n=t.trim().toLowerCase();return n?e.flatMap(e=>{let t=e.children?Ve(e.children,n):void 0;return!(e.name.toLowerCase().includes(n)||e.path.toLowerCase().includes(n))&&(!t||t.length===0)?[]:[{...e,...t?{children:t}:{}}]}):e}function He(e){return A(`workspaceReviewPrompt`,{list:e.map(e=>`- ${e.status}: ${e.oldPath?`${e.oldPath} -> `:``}${e.path}`).join(`
2
- `)})}function Ue(e){return A(`workspaceCommitMessagePrompt`,{list:e.map(e=>`- ${e.status}: ${e.oldPath?`${e.oldPath} -> `:``}${e.path}`).join(`
3
- `)})}function We(e,t){let n=[`${A(`workspaceCurrentBranch`)}: ${e||A(`unknown`)}`];return t?.total&&n.push(`${t.total} ${A(`workspaceChangeCount`)}`),n.join(` · `)}function Ge({title:e,files:t,selectedPath:n,onSelectFile:r}){return t.length===0?null:(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsxs)(`div`,{className:`px-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60`,children:[e,` `,t.length]}),(0,F.jsx)(Oe,{files:t,selectedPath:n,onSelectFile:r})]})}function Ke({view:e,changesCount:t,open:n,onOpenChange:i,onViewChange:a}){let o=Fe.find(t=>t.view===e)??Fe[0],s=o.icon;return(0,F.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,F.jsxs)(`button`,{type:`button`,className:`flex max-w-full items-center gap-2 rounded-xl bg-muted/20 px-2.5 py-1.5 text-left text-sm font-semibold text-foreground/90 transition-colors hover:bg-muted/28`,onClick:()=>i(!n),"aria-haspopup":`menu`,"aria-expanded":n,children:[(0,F.jsx)(s,{className:`size-4 shrink-0 text-foreground/75`}),(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:o.label}),(0,F.jsx)(f,{className:k(`size-4 shrink-0 text-muted-foreground/65 transition-transform`,n?`rotate-180`:``)})]}),n?(0,F.jsx)(`div`,{className:`absolute left-0 top-11 z-40 w-60 rounded-2xl border border-border bg-popover p-2 shadow-quickforge`,children:Fe.map(n=>{let o=n.icon,s=n.view===e;return(0,F.jsxs)(`button`,{type:`button`,className:k(`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors`,s?`bg-muted/28 text-foreground/90`:`text-foreground/80 hover:bg-muted/20 hover:text-foreground/90`),onClick:()=>{a(n.view),i(!1)},children:[(0,F.jsx)(o,{className:`size-4 shrink-0`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[n.label,n.view===`changes`&&t?` ${t}`:``]}),s?(0,F.jsx)(r,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-500`}):null]},n.view)})}):null]})}function Z(e){return e?e.language===`markdown`||/\.(md|markdown)$/i.test(e.path):!1}function qe(e,t=!1){return A(t?`readerFileMarkdownPrompt`:`readerFilePrompt`,{path:e})}function Je(e){return A(`readerDiffPrompt`,{path:e})}function Q(e){return`Diff for ${e.oldPath?`${e.oldPath} -> ${e.path}`:e.path}\n\n--- OLD\n${e.oldContent}\n\n--- NEW\n${e.newContent}`}function Ye({tabs:e,activeId:t,onSelect:n,onClose:r}){return(0,F.jsx)(`div`,{className:`flex h-full min-w-0 flex-1 items-center gap-0.5 overflow-x-auto px-1.5`,children:e.map(e=>{let a=e.id===t,o=e.mode===`browser`,s=o?A(`workspaceBrowser`):e.path.split(`/`).pop()||e.path,c=e.path.split(`.`).pop()||``;return(0,F.jsxs)(`button`,{type:`button`,className:k(`group flex max-w-44 shrink-0 items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium transition-colors`,a?`bg-background shadow-sm text-foreground`:`text-muted-foreground/70 hover:bg-muted/40 hover:text-foreground/85`),onClick:()=>n(e.id),title:e.path,children:[(0,F.jsx)(`span`,{className:k(`flex size-4 shrink-0 items-center justify-center rounded-sm`,a?`bg-primary/10 text-primary`:`bg-muted/30 text-muted-foreground/60`),children:e.loading?(0,F.jsx)(i,{className:`size-2.5 animate-spin`}):o?(0,F.jsx)(S,{className:`size-2.5`}):c===`md`||c===`markdown`?(0,F.jsx)(d,{className:`size-2.5`}):(0,F.jsx)(y,{className:`size-2.5`})}),(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),(0,F.jsx)(`span`,{role:`button`,tabIndex:0,className:k(`ml-0.5 shrink-0 rounded-sm p-0.5 opacity-0 transition-opacity group-hover:opacity-100 hover:bg-destructive/15 hover:text-destructive`,a&&`opacity-100`),onClick:t=>{t.stopPropagation(),r(e.id)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),r(e.id))},"aria-label":A(`close`),children:(0,F.jsx)(x,{className:`size-3`})})]},e.id)})})}function Xe({mode:e,file:t,diff:n,loading:i,error:a,onClose:o,onDraftRequest:s}){let[c,l]=(0,P.useState)(),[u,d]=(0,P.useState)(`preview`);async function f(e,t){t&&(await navigator.clipboard.writeText(t),l(e),window.setTimeout(()=>l(void 0),1200))}let p=e===`file`?t?.path:n?.path,m=e===`file`&&Z(t),h=e===`file`?t?.content:n?Q(n):void 0,g=e===`file`&&t?qe(t.path,m):e===`diff`&&n?Je(n.path):void 0,_=(0,P.useMemo)(()=>e===`diff`&&n?N(n.oldContent,n.newContent):void 0,[e,n]);return(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border px-3`,children:[m?(0,F.jsx)(`div`,{className:`inline-flex rounded-full bg-muted/25 p-1 text-xs`,children:[`preview`,`source`].map(e=>(0,F.jsx)(`button`,{type:`button`,className:e===u?`rounded-full bg-background px-3 py-1 font-medium text-foreground/90 shadow-[0_8px_20px_-16px_rgb(15_23_42_/_0.42)]`:`rounded-full px-3 py-1 text-muted-foreground/70 hover:text-foreground/85`,onClick:()=>d(e),children:A(e===`preview`?`markdownPreview`:`markdownSource`)},e))}):null,_?(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] font-medium`,children:[(0,F.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:[`+`,_.added]}),(0,F.jsxs)(`span`,{className:`ml-1.5 text-red-600 dark:text-red-400`,children:[`-`,_.removed]})]}):null,(0,F.jsx)(`div`,{className:`flex-1`}),(0,F.jsx)(O,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:()=>void f(`path`,p),disabled:!p,"aria-label":A(`copyPath`),title:A(`copyPath`),children:c===`path`?(0,F.jsx)(r,{className:`size-3.5`}):(0,F.jsx)(te,{className:`size-3.5`})}),(0,F.jsx)(O,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:()=>void f(`content`,h),disabled:!h,"aria-label":A(`copyContent`),title:A(e===`file`?`copyContent`:`copyDiffContent`),children:c===`content`?(0,F.jsx)(r,{className:`size-3.5`}):(0,F.jsx)(te,{className:`size-3.5`})}),(0,F.jsx)(O,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:()=>g&&s?.(g),disabled:!g||!s,"aria-label":A(`askAiAboutThis`),title:A(`askAiAboutThis`),children:(0,F.jsx)(re,{className:`size-3.5`})}),(0,F.jsx)(O,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:o,"aria-label":A(`close`),title:A(`close`),children:(0,F.jsx)(x,{className:`size-3.5`})})]}),(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 bg-background`,children:[i?(0,F.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground/70`,children:A(`openingReader`)}):null,!i&&a?(0,F.jsx)(`div`,{className:`p-4 text-sm text-destructive`,children:a}):null,!i&&!a&&e===`file`&&t?m?(0,F.jsx)(be,{path:t.path,content:t.content,language:t.language,mode:u},t.path):(0,F.jsx)(ye,{path:t.path,content:t.content,language:t.language}):null,!i&&!a&&e===`diff`&&n?(0,F.jsx)(M,{path:n.path,oldContent:n.oldContent,newContent:n.newContent,language:n.language,status:n.status}):null]})]})}function Ze({project:e,artifacts:t,changesCount:n,changedPaths:r,isGitRepository:i,gitBranch:a,onSelectFile:o,onSelectDiff:s,onPreviewFile:c}){let[l,u]=(0,P.useState)(!1),[d,p]=(0,P.useState)(()=>new Set),m=ue(t),h=t.filter(e=>e.command);function g(e){p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,F.jsxs)(`div`,{className:`space-y-3 p-2`,children:[(0,F.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-3 py-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-foreground/90`,children:[(0,F.jsx)(se,{className:`size-3.5 text-emerald-600 dark:text-emerald-500`}),A(`workspaceCurrentArtifacts`)]}),t.length===0?(0,F.jsx)(`div`,{className:`mt-2 text-xs leading-5 text-muted-foreground/70`,children:A(`workspaceNoArtifacts`)}):(0,F.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[m.length?(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsxs)(`div`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60`,children:[A(`workspaceFiles`),` `,m.length]}),m.slice(0,8).map(e=>{let t=e.path,n=ge(t),i=r.has(t),a=typeof e.addedLines==`number`||typeof e.removedLines==`number`;return(0,F.jsxs)(`div`,{className:`group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-xs text-foreground/85 transition-colors hover:bg-muted/20`,children:[(0,F.jsx)(`button`,{type:`button`,className:`min-w-0 flex-1 truncate text-left font-medium`,onClick:()=>n?c(t):i?s(t):o(t),title:t,children:e.title||j(t)}),a?(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] font-medium`,children:[(0,F.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:[`+`,e.addedLines??0]}),(0,F.jsxs)(`span`,{className:`ml-1 text-red-600 dark:text-red-400`,children:[`-`,e.removedLines??0]})]}):null,(0,F.jsx)(`span`,{className:`shrink-0 rounded-full bg-muted/30 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground/70`,children:e.kind}),n?(0,F.jsx)(`button`,{type:`button`,className:`shrink-0 inline-flex size-5 items-center justify-center text-blue-600 opacity-0 transition-opacity hover:bg-blue-500/10 hover:text-blue-700 group-hover:opacity-100 dark:text-blue-400`,onClick:()=>c(t),"aria-label":A(`previewArtifact`),title:A(`previewArtifact`),children:(0,F.jsx)(w,{className:`size-3.5`})}):null,(0,F.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-md px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground/70 opacity-0 transition-opacity hover:bg-muted/25 group-hover:opacity-100`,onClick:()=>i?s(t):o(t),children:A(i?`workspaceViewDiff`:`artifactPreviewViewSource`)})]},e.id)}),m.length>8?(0,F.jsxs)(`div`,{className:`px-2 text-[11px] text-muted-foreground/60`,children:[`+`,m.length-8]}):null]}):null,h.length?(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-1 py-1 text-left text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60 transition-colors hover:bg-muted/15 hover:text-foreground/75`,onClick:()=>u(e=>!e),"aria-expanded":l,children:[(0,F.jsx)(f,{className:k(`size-3.5 transition-transform`,l?``:`-rotate-90`)}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[A(`workspaceCommands`),` `,h.length]})]}),l?(0,F.jsx)(`div`,{className:`space-y-1`,children:h.map((e,t)=>{let n=d.has(e.id);return(0,F.jsxs)(`div`,{className:`rounded-md bg-muted/15 text-[11px] text-muted-foreground/80`,children:[(0,F.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-2 py-1.5 text-left transition-colors hover:bg-muted/20`,onClick:()=>g(e.id),"aria-expanded":n,children:[(0,F.jsx)(f,{className:k(`size-3 shrink-0 transition-transform`,n?``:`-rotate-90`)}),(0,F.jsxs)(`span`,{className:`shrink-0 font-medium text-muted-foreground/65`,children:[`#`,t+1]}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:e.command})]}),n?(0,F.jsxs)(`div`,{className:`space-y-1 px-2 pb-2 pt-1.5`,children:[(0,F.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[11px] leading-5 text-foreground/80`,children:e.command}),e.outputFile?(0,F.jsxs)(`div`,{className:`text-[10px] text-muted-foreground/65`,children:[A(`workspaceCommandOutput`),`: `,(0,F.jsx)(`span`,{className:`font-mono`,children:e.outputFile})]}):null]}):null]},e.id)})}):null]}):null]})]}),(0,F.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/10 px-3 py-3`,children:[(0,F.jsx)(`div`,{className:`text-xs font-medium text-foreground/85`,children:e?.name??A(`noProjectSelected`)}),(0,F.jsx)(`div`,{className:`mt-1 text-[11px] text-muted-foreground/65`,children:i?`${A(`workspaceCurrentBranch`)}: ${a||A(`unknown`)} · ${n} ${A(`workspaceChangeCount`)}`:A(`workspaceNotGitRepository`)})]})]})}function Qe({project:e,open:t,view:r,onViewChange:a,onPreviewArtifact:o,onDraftRequest:s,focusTarget:c,previewUrl:l,onPreviewUrlChange:u,artifacts:d=[]}){let[f,p]=(0,P.useState)([]),[m,h]=(0,P.useState)([]),[g,_]=(0,P.useState)(),[v,ee]=(0,P.useState)(),[te,y]=(0,P.useState)(!1),[b,ie]=(0,P.useState)(!1),[x,ae]=(0,P.useState)(),[oe,S]=(0,P.useState)(``),[C,w]=(0,P.useState)([]),[T,E]=(0,P.useState)(),[se,le]=(0,P.useState)(!1),[D,ue]=(0,P.useState)(Re),[fe,me]=(0,P.useState)(!1),[he,ge]=(0,P.useState)(t),[j,ye]=(0,P.useState)(!1),[M,be]=(0,P.useState)(Be),[N,xe]=(0,P.useState)(!1),[I,L]=(0,P.useState)(!1),[Se,R]=(0,P.useState)(!1),z=(0,P.useRef)(null),we=(0,P.useRef)(null),B=(0,P.useRef)(null),V=(0,P.useRef)(null),H=(0,P.useRef)(null),U=(0,P.useRef)(null),W=(0,P.useRef)(null),G=(0,P.useRef)(null),Te=(0,P.useRef)(void 0),Ee=(0,P.useRef)(void 0),K=e?.id,q=(0,P.useMemo)(()=>C.find(e=>e.id===T),[T,C]),De=q?.mode===`browser`,Oe=!!(q&&q.mode!==`browser`),ke=r===`browser`?`files`:r,Ae=q?.id,je=(0,P.useMemo)(()=>{let e={};for(let t of m)e[t.path]=t;return e},[m]),Fe=(0,P.useMemo)(()=>{let e=new Set;for(let t of m)e.add(t.path),t.oldPath&&e.add(t.oldPath);return e},[m]),Y=(0,P.useMemo)(()=>Ve(f,oe),[oe,f]),Z=(0,P.useMemo)(()=>({conflicts:m.filter(e=>e.conflict||e.status===`conflicted`),staged:m.filter(e=>!e.conflict&&e.status!==`untracked`&&e.staged),unstaged:m.filter(e=>!e.conflict&&e.status!==`untracked`&&e.unstaged),untracked:m.filter(e=>!e.conflict&&e.status===`untracked`)}),[m]);(0,P.useEffect)(()=>{if(t){let e=!1;return queueMicrotask(()=>{e||(ge(!0),window.requestAnimationFrame(()=>{e||ye(!0)}))}),()=>{e=!0}}let e=!1;queueMicrotask(()=>{e||ye(!1)});let n=window.setTimeout(()=>ge(!1),180);return()=>{e=!0,window.clearTimeout(n)}},[t]),(0,P.useEffect)(()=>{if(!se)return;let e=e=>{we.current?.contains(e.target)||le(!1)},t=e=>{e.key===`Escape`&&le(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[se]),(0,P.useEffect)(()=>{let e=!1;return!t||!c||queueMicrotask(()=>{e||(a(c.tab===`git`?`changes`:`files`),c.filePath&&Te.current?.(c.filePath))}),()=>{e=!0}},[c,a,t]),(0,P.useEffect)(()=>{if(!t)return;let e=C.find(e=>e.mode===`browser`);if(r===`browser`){if(!e){let e=Pe(`browser`,``);w(t=>t.some(t=>t.id===e)?t:[...t,{id:e,mode:`browser`,path:``,loading:!1}]),E(e);return}T!==e.id&&E(e.id)}else q?.mode===`browser`&&E(C.find(e=>e.mode!==`browser`)?.id)},[r,t,T,q,C]),(0,P.useEffect)(()=>{try{window.localStorage.setItem(Ie,String(M))}catch{}},[M]);let qe=(0,P.useCallback)(()=>{be(e=>e<X?X:e)},[]);(0,P.useEffect)(()=>{!j||I||(r===`browser`||r!==`overview`&&Ae)&&qe()},[Ae,r,j,I,qe]),(0,P.useEffect)(()=>{let e=!1;if(!(!K||!t))return queueMicrotask(()=>{e||(ie(!0),ae(void 0),Promise.all([ve(K),de(K)]).then(([t,n])=>{e||(p(t.tree),h(n.files),_(n.branch),ee(n.counts),y(n.isGitRepository))}).catch(t=>{e||ae(t instanceof Error?t.message:A(`workspaceLoadFailed`))}).finally(()=>{e||ie(!1)}))}),()=>{e=!0}},[t,K]),(0,P.useEffect)(()=>{let e=Ee.current;Ee.current=K,!(e===void 0||e===K)&&(w([]),E(void 0))},[K]);function Je(e){if(o){o(e);return}Q(e)}async function Q(e){if(!K)return;a(`files`);let t=Pe(`file`,e);if(C.some(e=>e.id===t)){E(t);return}let n={id:t,mode:`file`,path:e,loading:!0};w(e=>[...e,n]),E(t);try{let n=await pe(K,e);w(e=>e.map(e=>e.id===t?{...e,file:n,loading:!1}:e))}catch(e){w(n=>n.map(n=>n.id===t?{...n,loading:!1,error:e instanceof Error?e.message:A(`workspaceOpenFileFailed`)}:n))}}Te.current=Q;function Qe(){let e=Pe(`browser`,``);if(C.some(t=>t.id===e)){E(e),a(`browser`);return}let t={id:e,mode:`browser`,path:``,loading:!1};w(e=>[...e,t]),E(e),a(`browser`)}async function $e(e,t){if(!K)return;t&&a(`changes`);let n=Pe(`diff`,e);if(C.some(e=>e.id===n)){E(n);return}let r={id:n,mode:`diff`,path:e,loading:!0};w(e=>[...e,r]),E(n);try{let t=await _e(K,e);w(e=>e.map(e=>e.id===n?{...e,diff:t,loading:!1}:e))}catch(e){w(t=>t.map(t=>t.id===n?{...t,loading:!1,error:e instanceof Error?e.message:A(`workspaceOpenDiffFailed`)}:t))}}function et(e){w(t=>{let n=t.findIndex(t=>t.id===e),r=t.filter(t=>t.id!==e);return T===e&&E((r[n]??r[n-1])?.id),r})}async function $(e){await $e(e,!0)}async function tt(e){await $e(e,!1)}function nt(e){H.current={startX:e.clientX,startWidth:M,currentWidth:M},G.current={cursor:document.body.style.cursor,userSelect:document.body.style.userSelect},document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,xe(!0),e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}}function rt(e){let t=H.current,n=z.current;!t||!n||(t.currentWidth=Math.min(X,Math.max(J,t.startWidth+t.startX-e.clientX)),U.current===null&&(U.current=window.requestAnimationFrame(()=>{U.current=null;let e=H.current;!e||!z.current||(z.current.style.width=`${e.currentWidth}px`)})))}function it(e){let t=H.current?.currentWidth;H.current=null,U.current!==null&&(window.cancelAnimationFrame(U.current),U.current=null),typeof t==`number`&&(z.current&&(z.current.style.width=`${t}px`),be(t));let n=G.current;n&&(document.body.style.cursor=n.cursor,document.body.style.userSelect=n.userSelect,G.current=null),xe(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}}function at(e){B.current={startX:e.clientX,startWidth:D,currentWidth:D},document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,me(!0),e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}}function ot(e){let t=B.current;t&&(t.currentWidth=Math.min(ze,Math.max(Le,t.startWidth+e.clientX-t.startX)),V.current===null&&(V.current=window.requestAnimationFrame(()=>{V.current=null;let e=B.current;e&&ue(e.currentWidth)})))}function st(e){let t=B.current?.currentWidth;B.current=null,V.current!==null&&(window.cancelAnimationFrame(V.current),V.current=null),typeof t==`number`&&ue(t),document.body.style.cursor=``,document.body.style.userSelect=``,me(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}}let ct=(0,P.useCallback)(()=>{let e=z.current;if(!e){L(e=>!e);return}W.current?.cancel();let t=e.getBoundingClientRect(),n=window.innerWidth,r=Ne(),i=window.innerHeight-r,a=`${r}px`,o=`${i}px`,s=`cubic-bezier(0.22, 1, 0.36, 1)`;if(R(!0),!I){window.requestAnimationFrame(()=>{let e=z.current;if(!e)return;Object.assign(e.style,{position:`fixed`,left:`${t.left}px`,top:`${t.top}px`,right:`auto`,bottom:`auto`,width:`${t.width}px`,height:`${t.height}px`,minWidth:`0px`,maxWidth:`none`,zIndex:`40`});let r=e.animate([{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`},{left:`0px`,top:a,width:`${n}px`,height:o}],{duration:240,easing:s,fill:`forwards`});W.current=r,r.onfinish=()=>{W.current=null,L(!0),window.requestAnimationFrame(()=>{r.cancel(),e.removeAttribute(`style`),window.requestAnimationFrame(()=>R(!1))})},r.oncancel=()=>{W.current=null,R(!1)}});return}window.requestAnimationFrame(()=>{let e=z.current;if(!e)return;Object.assign(e.style,{position:`fixed`,left:`0px`,top:a,right:`auto`,bottom:`auto`,width:`${t.width}px`,height:o,zIndex:`40`});let r=n-M,i=e.animate([{left:`0px`,top:a,width:`${t.width}px`,height:o},{left:`${r}px`,top:a,width:`${M}px`,height:o}],{duration:240,easing:s,fill:`forwards`});W.current=i,i.onfinish=()=>{W.current=null,L(!1),window.requestAnimationFrame(()=>{i.cancel(),e.style.position=``,e.style.left=``,e.style.top=``,e.style.right=``,e.style.bottom=``,e.style.height=``,e.style.zIndex=``,e.style.width=`${M}px`,e.style.minWidth=`${J}px`,e.style.maxWidth=`${X}px`,window.requestAnimationFrame(()=>R(!1))})},i.oncancel=()=>{W.current=null,R(!1)}})},[I,M]);return(0,P.useEffect)(()=>{if(!I)return;let e=e=>{e.key===`Escape`&&L(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[I]),(0,P.useEffect)(()=>()=>{U.current!==null&&window.cancelAnimationFrame(U.current),V.current!==null&&window.cancelAnimationFrame(V.current),W.current?.cancel(),z.current&&z.current.removeAttribute(`style`);let e=G.current;e&&(document.body.style.cursor=e.cursor,document.body.style.userSelect=e.userSelect)},[]),he?(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`aside`,{ref:z,className:k(`relative hidden shrink-0 overflow-hidden flex-col bg-background transition-[width,min-width,max-width,opacity,transform] duration-200 ease-out will-change-[width,opacity,transform] lg:flex`,j?`translate-x-0 opacity-100`:`w-0 min-w-0 max-w-0 translate-x-4 opacity-0`,N?`transition-none`:``,I?`quickforge-workspace-inspector-fullscreen z-40 rounded-none border-l-0`:`lg:rounded-l-2xl`),style:j?I?void 0:{width:M,minWidth:J,maxWidth:X}:void 0,children:[j&&!I?(0,F.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":J,"aria-valuemax":X,"aria-valuenow":M,className:k(`group absolute inset-y-0 -left-2 z-20 flex w-4 cursor-col-resize items-center justify-center bg-transparent transition-colors hover:bg-border/40`,N?`bg-border/45`:``),onPointerDown:nt,onPointerMove:rt,onPointerUp:it,onPointerCancel:it,children:(0,F.jsx)(`div`,{className:k(`flex h-10 w-3 items-center justify-center rounded-full border border-border bg-background text-muted-foreground/60 opacity-0 shadow-sm transition-opacity`,N?`opacity-100`:`group-hover:opacity-100`),children:(0,F.jsx)(ce,{className:`size-3`})})}):null,(0,F.jsxs)(`div`,{className:k(`flex h-14 shrink-0 items-center gap-2 border-b-[0.5px] border-[color-mix(in_oklab,var(--border)_34%,transparent)] bg-muted/20 px-3 pr-20 transition-opacity duration-150`,Se?`opacity-0`:`opacity-100`),children:[(0,F.jsx)(`div`,{ref:we,className:`shrink-0`,children:(0,F.jsx)(Ke,{view:r,changesCount:m.length,open:se,onOpenChange:le,onViewChange:e=>{e===`browser`?Qe():a(e)}})}),(0,F.jsx)(`div`,{className:`h-5 w-px shrink-0 bg-[color-mix(in_oklab,var(--border)_34%,transparent)]`}),(0,F.jsx)(Ye,{tabs:C,activeId:T,onSelect:e=>{E(e),C.find(t=>t.id===e)?.mode===`browser`?r!==`browser`&&a(`browser`):r===`browser`&&a(`files`)},onClose:et}),(0,F.jsx)(O,{variant:`ghost`,size:`icon`,className:`shrink-0`,onClick:ct,"aria-label":A(I?`workspaceExitFullscreen`:`workspaceFullscreen`),title:A(I?`workspaceExitFullscreen`:`workspaceFullscreen`),children:I?(0,F.jsx)(n,{className:`size-4`}):(0,F.jsx)(i,{className:`size-4`})})]}),(0,F.jsx)(`div`,{className:k(`flex min-h-0 flex-1 transition-opacity duration-150`,Se?`opacity-0`:`opacity-100`),children:e?.id?De?(0,F.jsx)(Ce,{url:l,onUrlChange:u,projectId:e.id}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:k(`flex min-h-0 flex-col bg-muted/20`,Oe?`shrink-0 border-r-[0.5px] border-[color-mix(in_oklab,var(--border)_34%,transparent)]`:`flex-1`),style:Oe?{width:D,minWidth:Le,maxWidth:ze}:void 0,children:x?(0,F.jsx)(`div`,{className:`p-4 text-sm text-destructive`,children:x}):(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[b?(0,F.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:A(`workspaceLoading`)}):null,!b&&ke===`overview`?(0,F.jsx)(Ze,{project:e,artifacts:d,changesCount:m.length,changedPaths:Fe,isGitRepository:te,gitBranch:g,onSelectFile:Q,onSelectDiff:tt,onPreviewFile:Je}):null,!b&&ke===`files`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`label`,{className:`mb-2 flex items-center gap-2 rounded-md border-[0.5px] border-[color-mix(in_oklab,var(--border)_34%,transparent)] bg-background px-2 py-1.5 text-xs text-muted-foreground/65 focus-within:text-foreground/85`,children:[(0,F.jsx)(ne,{className:`size-3.5 shrink-0`}),(0,F.jsx)(`input`,{value:oe,onChange:e=>S(e.target.value),placeholder:A(`workspaceFilterFiles`),className:`min-w-0 flex-1 bg-transparent text-xs text-foreground/85 outline-none placeholder:text-muted-foreground/50`})]}),(0,F.jsx)(Me,{tree:Y,selectedPath:void 0,gitStatuses:je,onSelectFile:Q,onPreviewFile:Je,projectId:K})]}):null,!b&&ke===`changes`?te?(0,F.jsxs)(`div`,{className:`space-y-3`,children:[m.length===0?(0,F.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:A(`workspaceNoWorkingTreeChanges`)}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ge,{title:A(`workspaceConflicts`),files:Z.conflicts,selectedPath:void 0,onSelectFile:$}),(0,F.jsx)(Ge,{title:A(`workspaceStagedChanges`),files:Z.staged,selectedPath:void 0,onSelectFile:$}),(0,F.jsx)(Ge,{title:A(`workspaceChanges`),files:Z.unstaged,selectedPath:void 0,onSelectFile:$}),(0,F.jsx)(Ge,{title:A(`workspaceUntracked`),files:Z.untracked,selectedPath:void 0,onSelectFile:$})]}),(0,F.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/10 px-3 py-2`,children:[(0,F.jsx)(`div`,{className:`truncate text-xs font-medium text-foreground/85`,children:We(g,v)}),(0,F.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground/60`,children:[(0,F.jsxs)(`span`,{children:[A(`workspaceStaged`),` `,v?.staged??0]}),(0,F.jsxs)(`span`,{children:[A(`workspaceChanges`),` `,v?.unstaged??0]}),(0,F.jsxs)(`span`,{children:[A(`workspaceUntracked`),` `,v?.untracked??0]}),v?.conflicts?(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-500`,children:[A(`workspaceConflicts`),` `,v.conflicts]}):null]}),m.length>0&&s?(0,F.jsxs)(`div`,{className:`mt-2 flex gap-1.5`,children:[(0,F.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium text-muted-foreground/72 transition-colors hover:bg-muted/20 hover:text-foreground/85`,onClick:()=>s(He(m)),children:[(0,F.jsx)(re,{className:`size-3`}),A(`workspaceReview`)]}),(0,F.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium text-muted-foreground/72 transition-colors hover:bg-muted/20 hover:text-foreground/85`,onClick:()=>s(Ue(m)),children:[(0,F.jsx)(re,{className:`size-3`}),A(`workspaceCommitMessage`)]})]}):null]})]}):(0,F.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:A(`workspaceNotGitRepository`)}):null]})}),Oe?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":Le,"aria-valuemax":ze,"aria-valuenow":D,className:k(`group relative z-10 w-1.5 shrink-0 cursor-col-resize bg-transparent transition-colors`,fe?`bg-primary/30`:`hover:bg-[color-mix(in_oklab,var(--border)_52%,transparent)]`),onPointerDown:at,onPointerMove:ot,onPointerUp:st,onPointerCancel:st}),(0,F.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col bg-background`,children:q?(0,F.jsx)(Xe,{mode:q.mode,file:q.file,diff:q.diff,loading:q.loading,error:q.error,onClose:()=>et(q.id),onDraftRequest:s}):null})]}):null]}):(0,F.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground/70`,children:A(`workspaceSelectProject`)})})]})}):null}export{Qe as WorkspaceInspector};