@shawnstack/quickforge 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/README.md +10 -10
  2. package/dist/assets/{AgentProfilesPage-DUmXUxjA.js → AgentProfilesPage-BIwd5Nzg.js} +1 -1
  3. package/dist/assets/{ChatPanelHost-Syx0SSLe.js → ChatPanelHost-De-DMjx5.js} +16 -16
  4. package/dist/assets/{PluginsPage-kiBq0gOT.js → PluginsPage-kRzB5k8J.js} +1 -1
  5. package/dist/assets/{ScheduledTasksPage-Dw4-tgp9.js → ScheduledTasksPage-ZnjohaPS.js} +2 -2
  6. package/dist/assets/SharedConversationPage-EQdZgWCM.js +1 -0
  7. package/dist/assets/TerminalDock-P2pJH_tx.js +2 -0
  8. package/dist/assets/WorkspaceInspector-CkLAqYQ6.js +3 -0
  9. package/dist/assets/{WorkspaceReaderDialog-BJo_KEWi.js → WorkspaceReaderDialog-BwzZ8Tgv.js} +1 -1
  10. package/dist/assets/diff-line-counts-CeZC7b0z.js +10 -0
  11. package/dist/assets/icons-DJqt-rnw.js +1 -0
  12. package/dist/assets/index-CcGy4TXo.js +1354 -0
  13. package/dist/assets/index-DuTUuAMk.css +3 -0
  14. package/dist/assets/{monaco-CGq6uVF1.js → monaco-CNEfYIy1.js} +1 -1
  15. package/dist/assets/{react-vendor-DunfCFfp.js → react-vendor-CZCcjpSR.js} +1 -1
  16. package/dist/index.html +4 -4
  17. package/package.json +1 -1
  18. package/server/agent-manager.mjs +2 -2
  19. package/server/routes/workspace.mjs +8 -24
  20. package/server/tools/index.mjs +5 -2
  21. package/server/utils/workspace.mjs +1 -1
  22. package/dist/assets/SharedConversationPage-CaE9bNb9.js +0 -1
  23. package/dist/assets/TerminalDock-BYJcp8Ts.js +0 -2
  24. package/dist/assets/WorkspaceInspector-Bzmv8Cvi.js +0 -3
  25. package/dist/assets/diff-line-counts-BZoYp5ai.js +0 -10
  26. package/dist/assets/icons-47L5YLKz.js +0 -1
  27. package/dist/assets/index-CqfScETb.js +0 -1200
  28. package/dist/assets/index-DzkBgHZf.css +0 -3
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{F as t,St as n,i as r,l as i,r as a,v as o,y as s}from"./icons-47L5YLKz.js";import{n as c}from"./react-vendor-DunfCFfp.js";import{A as l,M as u,N as d,j as f}from"./index-CqfScETb.js";import{n as p,r as m,t as h}from"./plugin-api-YfYj_Bd7.js";var g=e(n(),1),_=c();function v(e){return e===`loaded`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`error`?`bg-destructive/10 text-destructive`:`bg-muted text-muted-foreground`}function y(e){return e===`loaded`?d(`pluginStatusLoaded`):e===`disabled`?d(`pluginStatusDisabled`):e===`error`?d(`pluginStatusError`):e}function b(e){switch(e){case`openai-documents`:return{label:d(`pluginOpenaiDocumentsName`),description:d(`pluginOpenaiDocumentsDescription`)};case`openai-spreadsheets`:return{label:d(`pluginOpenaiSpreadsheetsName`),description:d(`pluginOpenaiSpreadsheetsDescription`)};case`openai-presentations`:return{label:d(`pluginOpenaiPresentationsName`),description:d(`pluginOpenaiPresentationsDescription`)};default:return null}}function x(e){return b(e.name)?.label||(e.displayName||e.name).replace(/^OpenAI\s+/i,``)}function S(e){return b(e.name)?.description||e.description||d(`noDescription`)}function C(e){return(e.label||e.name||e.quickForgeName).replace(/^OpenAI\s+/i,``)}function w({onChanged:e}){let[n,c]=(0,g.useState)(null),[b,w]=(0,g.useState)(!0),[T,E]=(0,g.useState)(null),[D,O]=(0,g.useState)(null),[k,A]=(0,g.useState)(null),j=(0,g.useCallback)(async(t=`load`)=>{A(null),w(!0);try{c(t===`reload`?await p():await h()),t===`reload`&&e?.()}catch(e){A(e instanceof Error?e.message:d(`pluginsLoadFailed`))}finally{w(!1)}},[e]);(0,g.useEffect)(()=>{let e=!1;return h().then(t=>{e||c(t)}).catch(t=>{e||A(t instanceof Error?t.message:d(`pluginsLoadFailed`))}).finally(()=>{e||w(!1)}),()=>{e=!0}},[]);let M=(0,g.useMemo)(()=>{let e=n?.plugins||[];return{total:e.length,enabled:e.filter(e=>e.enabled).length,tools:e.reduce((e,t)=>e+t.tools.length,0)}},[n]),N=(0,g.useMemo)(()=>D&&(n?.plugins||[]).find(e=>e.name===D)||null,[n,D]),P=async(t,n)=>{E(t),A(null);try{c(await m(t,n)),e?.()}catch(e){A(e instanceof Error?e.message:d(`pluginsSaveFailed`))}finally{E(null)}};return(0,_.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,_.jsxs)(`div`,{className:`border-b border-border px-6 py-5`,children:[(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,_.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-2xl bg-primary/10 text-primary`,children:(0,_.jsx)(s,{className:`size-5`})}),(0,_.jsx)(`div`,{children:(0,_.jsxs)(`h1`,{className:`inline-flex items-center gap-1.5 text-lg font-semibold text-foreground`,children:[d(`plugins`),(0,_.jsx)(l,{label:d(`pluginsDescription`)})]})})]}),(0,_.jsxs)(f,{variant:`outline`,size:`sm`,onClick:()=>void j(`reload`),disabled:b,children:[b?(0,_.jsx)(t,{className:`mr-2 size-4 animate-spin`}):(0,_.jsx)(o,{className:`mr-2 size-4`}),d(`pluginsReload`)]})]}),(0,_.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[(0,_.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5`,children:d(`pluginsCount`,M)}),(0,_.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5`,children:d(`pluginToolsCount`,{count:M.tools})})]})]}),(0,_.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,_.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:[k?(0,_.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:k}):null,n?.errors?.length?(0,_.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-amber-500/30 bg-amber-500/8 p-3 text-sm`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-amber-700 dark:text-amber-300`,children:[(0,_.jsx)(r,{className:`size-4`}),d(`pluginDiscoveryErrors`)]}),n.errors.map((e,t)=>(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[(0,_.jsx)(`span`,{className:`font-mono text-xs`,children:e.dir}),`: `,e.error]},`${e.dir}-${t}`))]}):null,b&&!n?(0,_.jsxs)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:[(0,_.jsx)(t,{className:`mr-2 size-4 animate-spin`}),d(`loadingPlugins`)]}):null,!b&&n&&n.plugins.length===0?(0,_.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/15 p-4 text-xs text-muted-foreground/55`,children:[(0,_.jsx)(`div`,{className:`text-base font-medium text-foreground`,children:d(`noPlugins`)}),(0,_.jsx)(`p`,{className:`mt-2`,children:d(`noPluginsDescription`)}),(0,_.jsx)(`div`,{className:`mt-4 space-y-1`,children:(n.searchPaths||[]).map(e=>(0,_.jsx)(`div`,{className:`font-mono text-xs`,children:e},e))})]}):null,(0,_.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:(n?.plugins||[]).map(e=>(0,_.jsxs)(`article`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,_.jsx)(`h2`,{className:`truncate text-sm font-medium text-foreground/90`,children:x(e)}),(0,_.jsxs)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground`,children:[`v`,e.version]}),(0,_.jsx)(`span`,{className:u(`rounded-full px-2 py-0.5 text-xs`,v(e.status)),children:y(e.status)})]}),(0,_.jsx)(`p`,{className:`mt-2 line-clamp-2 text-sm text-muted-foreground`,children:S(e)})]}),(0,_.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1.5`,children:[(0,_.jsxs)(f,{variant:e.enabled?`outline`:`default`,size:`sm`,disabled:T===e.name,onClick:()=>void P(e.name,!e.enabled),children:[T===e.name?(0,_.jsx)(t,{className:`mr-2 size-4 animate-spin`}):null,e.enabled?d(`disablePlugin`):d(`enablePlugin`)]}),(0,_.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>O(e.name),children:d(`viewDetails`)})]})]}),e.error?(0,_.jsx)(`div`,{className:`mt-3 rounded-lg border border-destructive/30 bg-destructive/8 px-3 py-2 text-sm text-destructive`,children:e.error}):null,(0,_.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 border-t border-border pt-3 text-xs text-muted-foreground`,children:[(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,_.jsx)(a,{className:`size-3`}),d(`pluginToolsCount`,{count:e.tools.length})]}),(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,_.jsx)(i,{className:`size-3`}),d(`pluginPermissionsCount`,{count:e.permissions.length})]}),(0,_.jsx)(`span`,{children:e.enabled?d(`enabled`):d(`disabled`)})]})]},e.name))})]})}),N?(0,_.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onMouseDown:e=>{e.target===e.currentTarget&&O(null)},children:(0,_.jsxs)(`div`,{className:`flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,onMouseDown:e=>e.stopPropagation(),children:[(0,_.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-border px-5 py-4`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:d(`pluginDetails`)}),(0,_.jsx)(`p`,{className:`mt-1 truncate text-sm text-muted-foreground`,children:x(N)})]}),(0,_.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>O(null),children:d(`close`)})]}),(0,_.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,_.jsxs)(`div`,{className:`space-y-4`,children:[N.error?(0,_.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/8 px-3 py-2 text-sm text-destructive`,children:N.error}):null,(0,_.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:S(N)}),(0,_.jsxs)(`div`,{className:`mt-3 grid gap-2 border-t border-border pt-3 text-xs text-muted-foreground sm:grid-cols-2`,children:[(0,_.jsxs)(`span`,{children:[d(`pluginVersion`),`:`,N.version]}),(0,_.jsxs)(`span`,{children:[d(`status`),`:`,y(N.status)]}),(0,_.jsx)(`span`,{children:d(`pluginToolsCount`,{count:N.tools.length})}),(0,_.jsx)(`span`,{children:N.enabled?d(`enabled`):d(`disabled`)})]})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,_.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,_.jsx)(a,{className:`size-4 text-muted-foreground`}),d(`pluginTools`)]}),N.tools.length?(0,_.jsx)(`div`,{className:`space-y-2`,children:N.tools.map(e=>(0,_.jsxs)(`div`,{className:`rounded-xl bg-muted/30 px-3 py-2`,children:[(0,_.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:C(e)}),e.description?(0,_.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.description}):null]},e.quickForgeName))}):(0,_.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:d(`pluginNoTools`)})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,_.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,_.jsx)(i,{className:`size-4 text-muted-foreground`}),d(`pluginPermissions`)]}),N.permissions.length?(0,_.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:N.permissions.map(e=>(0,_.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground`,children:e},e))}):(0,_.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:d(`pluginNoPermissions`)}),(0,_.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground/80`,children:d(`pluginTrustedNotice`)})]})]})})]})}):null]})}export{w as PluginsPage};
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{Ct as t,F as n,i as r,l as i,r as a,v as o,y as s}from"./icons-DJqt-rnw.js";import{n as c}from"./react-vendor-CZCcjpSR.js";import{F as l,I as u,N as d,P as f}from"./index-CcGy4TXo.js";import{n as p,r as m,t as h}from"./plugin-api-YfYj_Bd7.js";var g=e(t(),1),_=c();function v(e){return e===`loaded`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`error`?`bg-destructive/10 text-destructive`:`bg-muted text-muted-foreground`}function y(e){return e===`loaded`?u(`pluginStatusLoaded`):e===`disabled`?u(`pluginStatusDisabled`):e===`error`?u(`pluginStatusError`):e}function b(e){switch(e){case`openai-documents`:return{label:u(`pluginOpenaiDocumentsName`),description:u(`pluginOpenaiDocumentsDescription`)};case`openai-spreadsheets`:return{label:u(`pluginOpenaiSpreadsheetsName`),description:u(`pluginOpenaiSpreadsheetsDescription`)};case`openai-presentations`:return{label:u(`pluginOpenaiPresentationsName`),description:u(`pluginOpenaiPresentationsDescription`)};default:return null}}function x(e){return b(e.name)?.label||(e.displayName||e.name).replace(/^OpenAI\s+/i,``)}function S(e){return b(e.name)?.description||e.description||u(`noDescription`)}function C(e){return(e.label||e.name||e.quickForgeName).replace(/^OpenAI\s+/i,``)}function w({onChanged:e}){let[t,c]=(0,g.useState)(null),[b,w]=(0,g.useState)(!0),[T,E]=(0,g.useState)(null),[D,O]=(0,g.useState)(null),[k,A]=(0,g.useState)(null),j=(0,g.useCallback)(async(t=`load`)=>{A(null),w(!0);try{c(t===`reload`?await p():await h()),t===`reload`&&e?.()}catch(e){A(e instanceof Error?e.message:u(`pluginsLoadFailed`))}finally{w(!1)}},[e]);(0,g.useEffect)(()=>{let e=!1;return h().then(t=>{e||c(t)}).catch(t=>{e||A(t instanceof Error?t.message:u(`pluginsLoadFailed`))}).finally(()=>{e||w(!1)}),()=>{e=!0}},[]);let M=(0,g.useMemo)(()=>{let e=t?.plugins||[];return{total:e.length,enabled:e.filter(e=>e.enabled).length,tools:e.reduce((e,t)=>e+t.tools.length,0)}},[t]),N=(0,g.useMemo)(()=>D&&(t?.plugins||[]).find(e=>e.name===D)||null,[t,D]),P=async(t,n)=>{E(t),A(null);try{c(await m(t,n)),e?.()}catch(e){A(e instanceof Error?e.message:u(`pluginsSaveFailed`))}finally{E(null)}};return(0,_.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,_.jsxs)(`div`,{className:`border-b border-border px-6 py-5`,children:[(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,_.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-2xl bg-primary/10 text-primary`,children:(0,_.jsx)(s,{className:`size-5`})}),(0,_.jsx)(`div`,{children:(0,_.jsxs)(`h1`,{className:`inline-flex items-center gap-1.5 text-lg font-semibold text-foreground`,children:[u(`plugins`),(0,_.jsx)(d,{label:u(`pluginsDescription`)})]})})]}),(0,_.jsxs)(f,{variant:`outline`,size:`sm`,onClick:()=>void j(`reload`),disabled:b,children:[b?(0,_.jsx)(n,{className:`mr-2 size-4 animate-spin`}):(0,_.jsx)(o,{className:`mr-2 size-4`}),u(`pluginsReload`)]})]}),(0,_.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[(0,_.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5`,children:u(`pluginsCount`,M)}),(0,_.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5`,children:u(`pluginToolsCount`,{count:M.tools})})]})]}),(0,_.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,_.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:[k?(0,_.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:k}):null,t?.errors?.length?(0,_.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-amber-500/30 bg-amber-500/8 p-3 text-sm`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-amber-700 dark:text-amber-300`,children:[(0,_.jsx)(r,{className:`size-4`}),u(`pluginDiscoveryErrors`)]}),t.errors.map((e,t)=>(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[(0,_.jsx)(`span`,{className:`font-mono text-xs`,children:e.dir}),`: `,e.error]},`${e.dir}-${t}`))]}):null,b&&!t?(0,_.jsxs)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:[(0,_.jsx)(n,{className:`mr-2 size-4 animate-spin`}),u(`loadingPlugins`)]}):null,!b&&t&&t.plugins.length===0?(0,_.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/15 p-4 text-xs text-muted-foreground/55`,children:[(0,_.jsx)(`div`,{className:`text-base font-medium text-foreground`,children:u(`noPlugins`)}),(0,_.jsx)(`p`,{className:`mt-2`,children:u(`noPluginsDescription`)}),(0,_.jsx)(`div`,{className:`mt-4 space-y-1`,children:(t.searchPaths||[]).map(e=>(0,_.jsx)(`div`,{className:`font-mono text-xs`,children:e},e))})]}):null,(0,_.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:(t?.plugins||[]).map(e=>(0,_.jsxs)(`article`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,_.jsx)(`h2`,{className:`truncate text-sm font-medium text-foreground/90`,children:x(e)}),(0,_.jsxs)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground`,children:[`v`,e.version]}),(0,_.jsx)(`span`,{className:l(`rounded-full px-2 py-0.5 text-xs`,v(e.status)),children:y(e.status)})]}),(0,_.jsx)(`p`,{className:`mt-2 line-clamp-2 text-sm text-muted-foreground`,children:S(e)})]}),(0,_.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1.5`,children:[(0,_.jsxs)(f,{variant:e.enabled?`outline`:`default`,size:`sm`,disabled:T===e.name,onClick:()=>void P(e.name,!e.enabled),children:[T===e.name?(0,_.jsx)(n,{className:`mr-2 size-4 animate-spin`}):null,e.enabled?u(`disablePlugin`):u(`enablePlugin`)]}),(0,_.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>O(e.name),children:u(`viewDetails`)})]})]}),e.error?(0,_.jsx)(`div`,{className:`mt-3 rounded-lg border border-destructive/30 bg-destructive/8 px-3 py-2 text-sm text-destructive`,children:e.error}):null,(0,_.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 border-t border-border pt-3 text-xs text-muted-foreground`,children:[(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,_.jsx)(a,{className:`size-3`}),u(`pluginToolsCount`,{count:e.tools.length})]}),(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,_.jsx)(i,{className:`size-3`}),u(`pluginPermissionsCount`,{count:e.permissions.length})]}),(0,_.jsx)(`span`,{children:e.enabled?u(`enabled`):u(`disabled`)})]})]},e.name))})]})}),N?(0,_.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onMouseDown:e=>{e.target===e.currentTarget&&O(null)},children:(0,_.jsxs)(`div`,{className:`flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,onMouseDown:e=>e.stopPropagation(),children:[(0,_.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-border px-5 py-4`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:u(`pluginDetails`)}),(0,_.jsx)(`p`,{className:`mt-1 truncate text-sm text-muted-foreground`,children:x(N)})]}),(0,_.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>O(null),children:u(`close`)})]}),(0,_.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,_.jsxs)(`div`,{className:`space-y-4`,children:[N.error?(0,_.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/8 px-3 py-2 text-sm text-destructive`,children:N.error}):null,(0,_.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:S(N)}),(0,_.jsxs)(`div`,{className:`mt-3 grid gap-2 border-t border-border pt-3 text-xs text-muted-foreground sm:grid-cols-2`,children:[(0,_.jsxs)(`span`,{children:[u(`pluginVersion`),`:`,N.version]}),(0,_.jsxs)(`span`,{children:[u(`status`),`:`,y(N.status)]}),(0,_.jsx)(`span`,{children:u(`pluginToolsCount`,{count:N.tools.length})}),(0,_.jsx)(`span`,{children:N.enabled?u(`enabled`):u(`disabled`)})]})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,_.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,_.jsx)(a,{className:`size-4 text-muted-foreground`}),u(`pluginTools`)]}),N.tools.length?(0,_.jsx)(`div`,{className:`space-y-2`,children:N.tools.map(e=>(0,_.jsxs)(`div`,{className:`rounded-xl bg-muted/30 px-3 py-2`,children:[(0,_.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:C(e)}),e.description?(0,_.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.description}):null]},e.quickForgeName))}):(0,_.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:u(`pluginNoTools`)})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,_.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,_.jsx)(i,{className:`size-4 text-muted-foreground`}),u(`pluginPermissions`)]}),N.permissions.length?(0,_.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:N.permissions.map(e=>(0,_.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground`,children:e},e))}):(0,_.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:u(`pluginNoPermissions`)}),(0,_.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground/80`,children:u(`pluginTrustedNotice`)})]})]})})]})}):null]})}export{w as PluginsPage};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{$ as t,B as n,St as r,T as i,a as ee,bt as te,c as a,h as ne,lt as re,n as ie,st as ae,t as oe,tt as se,vt as ce,yt as le}from"./icons-47L5YLKz.js";import{n as o}from"./react-vendor-DunfCFfp.js";import{A as s,C as ue,E as de,M as c,N as l,S as fe,T as pe,j as u,k as me,w as he}from"./index-CqfScETb.js";var d=e(r(),1),f=o(),ge=[{value:`off`,label:()=>l(`thinkingOff`)},{value:`low`,label:()=>l(`thinkingLow`)},{value:`medium`,label:()=>l(`thinkingMedium`)},{value:`high`,label:()=>l(`thinkingHigh`)},{value:`xhigh`,label:()=>l(`thinkingXHigh`)}];function _e(e){return`${e.provider} / ${e.id}`}function ve(e,t){return!!(e&&t&&e.api===t.api&&e.provider===t.provider&&e.id===t.id)}function p(e){return String(e).padStart(2,`0`)}function m(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.getTime())?`-`:`${t.getFullYear()}-${p(t.getMonth()+1)}-${p(t.getDate())} ${p(t.getHours())}:${p(t.getMinutes())}`}function ye(e,t=20){let n=String(e||``).trim();return n.length>t?`${n.slice(0,t)}...`:n}function be(){return{scheduleText:``,title:``,instruction:``,cronExpression:``,scheduleRule:``,nextRunAt:``,enabled:!0,agentId:``,executionMode:`serial`}}function h(){return{taskId:``,status:``,trigger:``,keyword:``,startedFrom:``,startedTo:``,page:1,pageSize:10}}function xe(e){return{scheduleText:[e.scheduleRule,e.instruction].filter(Boolean).join(`
2
- `),title:e.title,instruction:e.instruction,cronExpression:e.cronExpression??``,scheduleRule:e.scheduleRule,nextRunAt:e.nextRunAt,enabled:e.status!==`paused`,agentId:e.agentId??``,executionMode:e.executionMode??`serial`}}function Se(e,t){return{...t,title:e.title,instruction:e.instruction,cronExpression:e.cronExpression??``,scheduleRule:e.scheduleRule,nextRunAt:e.nextRunAt,enabled:t.enabled}}function Ce(e){return{title:e.title.trim(),instruction:e.instruction.trim(),scheduleType:`cron`,scheduleRule:e.scheduleRule.trim()||e.cronExpression.trim(),cronExpression:e.cronExpression.trim(),nextRunAt:e.nextRunAt,enabled:e.enabled,agentId:e.agentId||null,executionMode:e.executionMode}}function g(e){return!!(e.currentRunId||e.currentRunIds?.length)}function we(e){return(e.executionMode??`serial`)===`parallel`||!g(e)}function Te(e){return l(e===`parallel`?`taskExecutionModeParallel`:`taskExecutionModeSerial`)}function Ee(e){return!!(e.title.trim()&&e.instruction.trim()&&e.cronExpression.trim())}function De(e){return l(e===`enabled`?`taskEnabled`:e===`running`?`taskRunning`:e===`paused`?`taskPaused`:e===`completed`?`taskFinished`:e===`success`?`executionSuccess`:`taskFailed`)}function Oe(e){return e===`enabled`||e===`success`?`bg-emerald-500/10 text-emerald-700`:e===`running`?`bg-blue-500/10 text-blue-700`:e===`paused`?`bg-amber-500/10 text-amber-700`:`bg-muted text-muted-foreground`}async function _(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||`请求失败`);return r}function v({onOpenSession:e}){let[r,o]=(0,d.useState)([]),[p,v]=(0,d.useState)(`tasks`),[y,b]=(0,d.useState)(()=>be()),[x,ke]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(null),[Ae,E]=(0,d.useState)(!1),[D,O]=(0,d.useState)(null),[je,k]=(0,d.useState)(``),[A,j]=(0,d.useState)(!1),[M,N]=(0,d.useState)(``),[P,Me]=(0,d.useState)([]),[F,I]=(0,d.useState)(),[L,R]=(0,d.useState)(`off`),[z,Ne]=(0,d.useState)([]),[Pe,B]=(0,d.useState)(``),[V,H]=(0,d.useState)(()=>h()),[U,W]=(0,d.useState)(()=>h()),[G,Fe]=(0,d.useState)({runs:[],total:0,page:1,pageSize:10}),[Ie,Le]=(0,d.useState)(!1),[Re,ze]=(0,d.useState)(null),[Be,Ve]=(0,d.useState)([]),He=z[0]?.id??``;(0,d.useEffect)(()=>{if(!w)return;let e=()=>T(null);return window.addEventListener(`click`,e),window.addEventListener(`blur`,e),()=>{window.removeEventListener(`click`,e),window.removeEventListener(`blur`,e)}},[w]);async function Ue(){o((await _(`/api/scheduled-tasks`)).tasks)}async function K(e=U){Le(!0),N(``);try{let t=new URLSearchParams;t.set(`page`,String(e.page)),t.set(`pageSize`,String(e.pageSize)),e.taskId&&t.set(`taskId`,e.taskId),e.status&&t.set(`status`,e.status),e.trigger&&t.set(`trigger`,e.trigger),e.keyword.trim()&&t.set(`keyword`,e.keyword.trim()),e.startedFrom&&t.set(`startedFrom`,e.startedFrom),e.startedTo&&t.set(`startedTo`,e.startedTo),Fe(await _(`/api/scheduled-tasks/runs?${t.toString()}`))}catch(e){N(e instanceof Error?e.message:l(`requestFailed`))}finally{Le(!1)}}(0,d.useEffect)(()=>{let e=!1;async function t(){try{let t=await _(`/api/project`);if(e)return;Ne(t.projects??[])}catch{}}return t(),()=>{e=!0}},[]),(0,d.useEffect)(()=>{let e=!1;async function t(){try{let t=await he(),n=await ue(t),r=await pe(t),i=r.model??await de(t)??n[0];if(e)return;Me(n),I(i),R(r.thinkingLevel??fe(i))}catch(t){e||N(t instanceof Error?t.message:l(`requestFailed`))}}return t(),()=>{e=!0}},[]),(0,d.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await _(`/api/scheduled-tasks`);e||o(t.tasks)}catch(t){e||N(t instanceof Error?t.message:l(`requestFailed`))}};t();let n=window.setInterval(t,10*1e3);return()=>{e=!0,window.clearInterval(n)}},[]),(0,d.useEffect)(()=>{let e=!1;async function t(){try{let t=await _(`/api/agent-profiles`);if(e)return;Ve(t.agents)}catch(t){e||N(t instanceof Error?t.message:l(`requestFailed`))}}return t(),()=>{e=!0}},[]);let We=(0,d.useMemo)(()=>r.find(e=>e.id===x),[x,r]),q=(0,d.useMemo)(()=>r.find(e=>e.id===S)??null,[S,r]),Ge=(0,d.useMemo)(()=>r.filter(e=>e.status===`enabled`).length,[r]),J=Math.max(1,Math.ceil(G.total/G.pageSize));function Y(e){return e?Be.find(t=>t.id===e||t.name===e)?.label??e:l(`defaultAgent`)}function X(e,t){b(n=>({...n,[e]:t}))}function Z(e,t){H(n=>({...n,[e]:t}))}function Ke(){ke(null),B(He),b(be()),O(null),k(``),N(``)}function qe(){Ke(),E(!0)}function Q(){A||(E(!1),Ke())}function Je(){let e={...V,page:1};H(e),W(e),K(e)}function Ye(){let e=h();H(e),W(e),K(e)}function Xe(e){let t=Math.min(Math.max(1,e),J),n={...U,page:t};H(n),W(n),K(n)}function Ze(e){let t={...U,page:1,pageSize:e};H(t),W(t),K(t)}async function Qe(){let e=y.scheduleText.trim();if(e){j(!0),N(``);try{let t=await _(`/api/scheduled-tasks/parse`,{method:`POST`,body:JSON.stringify({instruction:e,model:F,thinkingLevel:L})});if(t.needMoreInfo||!t.task){k(t.question||`请补充任务信息。`),O(null);return}let n=t.task;k(``),O(n),b(e=>Se(n,e))}catch(e){N(e instanceof Error?e.message:l(`requestFailed`))}finally{j(!1)}}}async function $e(){if(Ee(y)){j(!0),N(``);try{let e=z.find(e=>e.id===Pe),t={task:Ce(y),model:F,thinkingLevel:L,projectId:e?.id,projectName:e?.name};x?await _(`/api/scheduled-tasks/${encodeURIComponent(x)}`,{method:`PUT`,body:JSON.stringify(t)}):await _(`/api/scheduled-tasks`,{method:`POST`,body:JSON.stringify(t)}),Q(),await Ue(),p===`history`&&await K(U)}catch(e){N(e instanceof Error?e.message:l(`requestFailed`))}finally{j(!1)}}}function et(e){T(null),ke(e.id),b(xe(e)),O(null),k(``),N(``),B(e.projectId??``),e.model&&I(e.model),e.thinkingLevel&&R(e.thinkingLevel),E(!0)}async function $(e,t){if(N(``),T(null),!(t===`delete`&&!await me({description:l(`confirmDeleteTask`),confirmLabel:l(`confirmDelete`),cancelLabel:l(`cancel`),variant:`destructive`})))try{t===`delete`?(await _(`/api/scheduled-tasks/${encodeURIComponent(e)}`,{method:`DELETE`}),x===e&&Q(),S===e&&C(null)):await _(`/api/scheduled-tasks/${encodeURIComponent(e)}/${t}`,{method:`POST`}),await Ue(),p===`history`&&await K(U)}catch(e){N(e instanceof Error?e.message:l(`requestFailed`))}}function tt(t){return(0,f.jsxs)(`div`,{className:`mt-2 space-y-2 text-xs text-muted-foreground`,children:[t.sessionId?(0,f.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>e?.(t.sessionId),children:l(`viewConversation`)}):null,(0,f.jsxs)(`div`,{children:[l(`executionAgent`),t.agentLabel||Y(t.agentId)]}),t.warning?(0,f.jsx)(`div`,{className:`text-amber-600`,children:t.warning}):null,t.inputContent?(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`font-medium text-foreground`,children:l(`runInputContent`)}),(0,f.jsx)(`pre`,{className:`mt-1 max-h-32 overflow-auto whitespace-pre-wrap`,children:t.inputContent})]}):null,t.aiResult||t.result?(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`font-medium text-foreground`,children:l(`runAiResult`)}),(0,f.jsx)(`pre`,{className:`mt-1 max-h-48 overflow-auto whitespace-pre-wrap`,children:t.aiResult||t.result})]}):null,t.errorMessage?(0,f.jsx)(`div`,{className:`text-destructive`,children:t.errorMessage}):null,t.durationMs?(0,f.jsxs)(`div`,{children:[l(`runDuration`),t.durationMs,`ms`]}):null]})}return(0,f.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,f.jsxs)(`div`,{className:`border-b border-border px-6 py-5`,children:[(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,f.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-2xl bg-primary/10 text-primary`,children:(0,f.jsx)(ce,{className:`size-5`})}),(0,f.jsx)(`div`,{children:(0,f.jsxs)(`h1`,{className:`inline-flex items-center gap-1.5 text-lg font-semibold text-foreground`,children:[l(`scheduledTasks`),(0,f.jsx)(s,{label:l(`scheduledTasksDescription`)})]})})]}),(0,f.jsx)(u,{onClick:qe,children:l(`createTask`)})]}),(0,f.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,f.jsxs)(`button`,{type:`button`,className:c(`rounded-full px-4 py-2 text-sm font-medium transition-colors`,p===`tasks`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:text-foreground`),onClick:()=>v(`tasks`),children:[l(`taskListTab`),` `,(0,f.jsx)(`span`,{className:`opacity-80`,children:r.length})]}),(0,f.jsx)(`button`,{type:`button`,className:c(`rounded-full px-4 py-2 text-sm font-medium transition-colors`,p===`history`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:text-foreground`),onClick:()=>{v(`history`),K(U)},children:l(`executionHistoryTab`)})]})]}),(0,f.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,f.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:[M&&!Ae?(0,f.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:M}):null,p===`tasks`?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:(0,f.jsx)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:l(`taskList`)}),(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l(`tasksCount`,{total:r.length,enabled:Ge})})]})})}),(0,f.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:r.length===0?(0,f.jsx)(`div`,{className:`rounded-lg px-3 py-3 text-center text-xs text-muted-foreground/55 md:col-span-2`,children:l(`noScheduledTasks`)}):r.map(e=>{let n=e.status===`enabled`,r=e.status===`completed`,a=g(e);return(0,f.jsxs)(`div`,{className:`relative cursor-pointer rounded-xl border border-border bg-card p-4 transition-colors hover:bg-muted/15`,onClick:()=>C(e.id),children:[(0,f.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,f.jsxs)(`div`,{className:`min-w-0`,children:[(0,f.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,f.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground/90`,children:e.title})}),(0,f.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:ye(e.instruction,20)})]}),(0,f.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,onClick:e=>e.stopPropagation(),children:[(0,f.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":n,disabled:r,className:c(`relative h-6 w-11 rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-60`,n?`bg-emerald-500`:`bg-muted-foreground/30`),onClick:()=>void $(e.id,e.status===`paused`?`resume`:`pause`),title:e.status===`paused`?l(`enable`):l(`pauseTask`),children:(0,f.jsx)(`span`,{className:c(`absolute left-0.5 top-0.5 size-5 rounded-full bg-white shadow transition-transform`,n?`translate-x-5`:`translate-x-0`)})}),(0,f.jsxs)(`div`,{className:`relative`,children:[(0,f.jsx)(u,{variant:`ghost`,size:`icon`,onClick:()=>T(w===e.id?null:e.id),title:l(`moreActions`),children:(0,f.jsx)(se,{className:`size-4`})}),w===e.id?(0,f.jsxs)(`div`,{className:`absolute right-0 z-20 mt-1 w-36 overflow-hidden rounded-xl border border-border bg-popover py-1 text-sm shadow-quickforge`,children:[(0,f.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:!we(e),onClick:()=>void $(e.id,`run`),children:[(0,f.jsx)(oe,{className:`size-3.5`}),l(`executeNow`)]}),(0,f.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:a,onClick:()=>et(e),children:[(0,f.jsx)(i,{className:`size-3.5`}),l(`editTask`)]}),(0,f.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted`,onClick:()=>{T(null),C(e.id)},children:[(0,f.jsx)(t,{className:`size-3.5`}),l(`viewDetails`)]}),(0,f.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left text-destructive hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:a,onClick:()=>void $(e.id,`delete`),children:[(0,f.jsx)(ee,{className:`size-3.5`}),l(`deleteTask`)]})]}):null]})]})]}),(0,f.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,f.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,f.jsx)(ae,{className:`size-3`}),e.scheduleRule]}),(0,f.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,f.jsx)(te,{className:`size-3`}),Y(e.agentId)]}),(0,f.jsxs)(`span`,{children:[l(`taskExecutionMode`),`:`,Te(e.executionMode)]}),e.projectName?(0,f.jsxs)(`span`,{children:[l(`taskProject`),e.projectName]}):null]}),(0,f.jsxs)(`div`,{className:`mt-4 grid gap-2 border-t border-border pt-3 text-xs text-muted-foreground sm:grid-cols-2`,children:[(0,f.jsxs)(`span`,{children:[l(`lastExecution`),m(e.lastRunAt)]}),(0,f.jsxs)(`span`,{children:[l(`nextExecution`),m(e.nextRunAt)]})]})]},e.id)})})]}):(0,f.jsxs)(`div`,{className:`space-y-4`,children:[(0,f.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,f.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,f.jsx)(ne,{className:`size-4`}),l(`historyFilters`)]}),(0,f.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[l(`taskName`),(0,f.jsxs)(`select`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.taskId,onChange:e=>Z(`taskId`,e.target.value),children:[(0,f.jsx)(`option`,{value:``,children:l(`allTasks`)}),r.map(e=>(0,f.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]}),(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[l(`status`),(0,f.jsxs)(`select`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.status,onChange:e=>Z(`status`,e.target.value),children:[(0,f.jsx)(`option`,{value:``,children:l(`allStatuses`)}),(0,f.jsx)(`option`,{value:`running`,children:l(`executionRunning`)}),(0,f.jsx)(`option`,{value:`success`,children:l(`executionSuccess`)}),(0,f.jsx)(`option`,{value:`failed`,children:l(`taskFailed`)})]})]}),(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[l(`triggerType`),(0,f.jsxs)(`select`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.trigger,onChange:e=>Z(`trigger`,e.target.value),children:[(0,f.jsx)(`option`,{value:``,children:l(`allTriggers`)}),(0,f.jsx)(`option`,{value:`schedule`,children:l(`autoRun`)}),(0,f.jsx)(`option`,{value:`manual`,children:l(`manualRun`)})]})]}),(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[l(`startTime`),(0,f.jsx)(`input`,{type:`datetime-local`,className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.startedFrom,onChange:e=>Z(`startedFrom`,e.target.value)})]}),(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[l(`endTime`),(0,f.jsx)(`input`,{type:`datetime-local`,className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.startedTo,onChange:e=>Z(`startedTo`,e.target.value)})]}),(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[l(`keyword`),(0,f.jsx)(`input`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.keyword,onChange:e=>Z(`keyword`,e.target.value),placeholder:l(`keywordPlaceholder`)})]})]}),(0,f.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2`,children:[(0,f.jsx)(u,{variant:`outline`,onClick:Ye,children:l(`reset`)}),(0,f.jsx)(u,{onClick:Je,children:l(`query`)})]})]}),(0,f.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-card`,children:[(0,f.jsxs)(`div`,{className:`grid grid-cols-[1.3fr_0.7fr_0.7fr_1fr_0.7fr] gap-3 border-b border-border px-4 py-3 text-xs font-medium text-muted-foreground`,children:[(0,f.jsx)(`span`,{children:l(`taskName`)}),(0,f.jsx)(`span`,{children:l(`status`)}),(0,f.jsx)(`span`,{children:l(`triggerType`)}),(0,f.jsx)(`span`,{children:l(`startTime`)}),(0,f.jsx)(`span`,{children:l(`runDuration`)})]}),Ie?(0,f.jsx)(`div`,{className:`p-8 text-center text-sm text-muted-foreground`,children:l(`loading`)}):G.runs.length===0?(0,f.jsx)(`div`,{className:`p-8 text-center text-sm text-muted-foreground`,children:l(`noExecutionHistory`)}):G.runs.map(e=>(0,f.jsxs)(`div`,{className:`border-b border-border last:border-b-0`,children:[(0,f.jsxs)(`button`,{type:`button`,className:`grid w-full grid-cols-[1.3fr_0.7fr_0.7fr_1fr_0.7fr] gap-3 px-4 py-3 text-left text-sm hover:bg-muted/40`,onClick:()=>ze(Re===e.id?null:e.id),children:[(0,f.jsx)(`span`,{className:`min-w-0 truncate text-foreground`,children:e.taskTitle}),(0,f.jsx)(`span`,{children:(0,f.jsx)(`span`,{className:c(`rounded-full px-2 py-0.5 text-xs`,Oe(e.status)),children:De(e.status)})}),(0,f.jsx)(`span`,{className:`text-muted-foreground`,children:e.trigger===`manual`?l(`manualRun`):l(`autoRun`)}),(0,f.jsx)(`span`,{className:`text-muted-foreground`,children:m(e.startedAt)}),(0,f.jsx)(`span`,{className:`text-muted-foreground`,children:e.durationMs?`${e.durationMs}ms`:`-`})]}),Re===e.id?(0,f.jsx)(`div`,{className:`border-t border-border bg-muted/20 px-4 py-3`,children:tt(e)}):null]},`${e.taskId}:${e.id}`)),(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3 text-sm text-muted-foreground`,children:[(0,f.jsx)(`span`,{children:l(`paginationSummary`,{page:G.page,pages:J,total:G.total})}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(`select`,{className:`h-8 rounded-md border border-input bg-background px-2 text-sm`,value:G.pageSize,onChange:e=>Ze(Number(e.target.value)),children:[10,20,50,100].map(e=>(0,f.jsx)(`option`,{value:e,children:l(`pageSize`,{size:e})},e))}),(0,f.jsx)(u,{variant:`outline`,size:`sm`,disabled:G.page<=1,onClick:()=>Xe(G.page-1),children:l(`previousPage`)}),(0,f.jsx)(u,{variant:`outline`,size:`sm`,disabled:G.page>=J,onClick:()=>Xe(G.page+1),children:l(`nextPage`)})]})]})]})]})]})}),q?(0,f.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onMouseDown:e=>{e.target===e.currentTarget&&C(null)},children:(0,f.jsxs)(`div`,{className:`flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,onMouseDown:e=>e.stopPropagation(),children:[(0,f.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-border px-5 py-4`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,f.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:q.title})}),(0,f.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:q.scheduleRule})]}),(0,f.jsx)(u,{variant:`ghost`,size:`icon`,onClick:()=>C(null),children:(0,f.jsx)(ie,{className:`size-4`})})]}),(0,f.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,f.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`mb-1 font-medium text-foreground`,children:l(`taskContent`)}),(0,f.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap rounded-xl border border-border bg-muted/20 p-3 text-muted-foreground`,children:q.instruction})]}),(0,f.jsxs)(`div`,{className:`grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,f.jsxs)(`div`,{children:[l(`executionRule`),(0,f.jsx)(`span`,{className:`text-foreground`,children:q.scheduleRule})]}),(0,f.jsxs)(`div`,{children:[l(`taskExecutionMode`),`:`,(0,f.jsx)(`span`,{className:`text-foreground`,children:Te(q.executionMode)})]}),(0,f.jsxs)(`div`,{children:[`cron:`,(0,f.jsx)(`span`,{className:`font-mono text-foreground`,children:q.cronExpression??`-`})]}),(0,f.jsxs)(`div`,{children:[l(`lastExecution`),(0,f.jsx)(`span`,{className:`text-foreground`,children:m(q.lastRunAt)})]}),(0,f.jsxs)(`div`,{children:[l(`nextExecution`),(0,f.jsx)(`span`,{className:`text-foreground`,children:m(q.nextRunAt)})]}),(0,f.jsxs)(`div`,{children:[l(`executionAgent`),(0,f.jsx)(`span`,{className:`text-foreground`,children:Y(q.agentId)})]}),q.projectName?(0,f.jsxs)(`div`,{children:[l(`taskProject`),(0,f.jsx)(`span`,{className:`text-foreground`,children:q.projectName})]}):null,q.model?(0,f.jsxs)(`div`,{children:[l(`taskModel`),`:`,(0,f.jsx)(`span`,{className:`text-foreground`,children:_e(q.model)})]}):null,q.thinkingLevel?(0,f.jsxs)(`div`,{children:[l(`taskThinkingLevel`),(0,f.jsx)(`span`,{className:`text-foreground`,children:ge.find(e=>e.value===q.thinkingLevel)?.label()??q.thinkingLevel})]}):null,(0,f.jsxs)(`div`,{children:[l(`createdAt`),`:`,(0,f.jsx)(`span`,{className:`text-foreground`,children:m(q.createdAt)})]})]}),q.runs?.length>0?(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`mb-2 font-medium text-foreground`,children:l(`recentExecutions`)}),(0,f.jsx)(`div`,{className:`space-y-2`,children:q.runs.slice(0,5).map(e=>(0,f.jsxs)(`details`,{className:`rounded-lg border border-border bg-muted/20 p-2 text-xs text-muted-foreground`,children:[(0,f.jsxs)(`summary`,{className:`cursor-pointer text-foreground`,children:[m(e.startedAt),` · `,e.trigger===`manual`?l(`manualRun`):l(`autoRun`),` · `,De(e.status)]}),tt(e)]},e.id))})]}):null]})}),(0,f.jsx)(`div`,{className:`shrink-0 border-t border-border px-5 py-4`,children:(0,f.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[q.lastSessionId?(0,f.jsx)(u,{variant:`outline`,onClick:()=>e?.(q.lastSessionId),children:l(`viewConversation`)}):null,(0,f.jsxs)(u,{variant:`outline`,disabled:!we(q),onClick:()=>void $(q.id,`run`),children:[(0,f.jsx)(oe,{className:`mr-1 size-3.5`}),l(`executeNow`)]}),(0,f.jsxs)(u,{variant:`outline`,disabled:g(q),onClick:()=>et(q),children:[(0,f.jsx)(i,{className:`mr-1 size-3.5`}),l(`editTask`)]}),(0,f.jsxs)(u,{variant:`destructive`,disabled:g(q),onClick:()=>void $(q.id,`delete`),children:[(0,f.jsx)(ee,{className:`mr-1 size-3.5`}),l(`deleteTask`)]})]})})]})}):null,Ae?(0,f.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onMouseDown:e=>{e.target===e.currentTarget&&Q()},children:(0,f.jsxs)(`div`,{className:`flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,onMouseDown:e=>e.stopPropagation(),children:[(0,f.jsx)(`div`,{className:`shrink-0 border-b border-border px-5 py-4`,children:(0,f.jsxs)(`h2`,{className:`inline-flex items-center gap-1.5 text-base font-semibold text-foreground`,children:[l(We?`editTask`:`createTask`),(0,f.jsx)(s,{label:l(`quickAiParseTask`)})]})}),(0,f.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,f.jsxs)(`div`,{className:`space-y-4`,children:[(0,f.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[l(`taskScheduleDescriptionLabel`),(0,f.jsx)(`textarea`,{className:`mt-1 min-h-24 w-full resize-y rounded-xl border border-input bg-background px-3 py-2 text-sm outline-none transition-colors placeholder:text-muted-foreground/65 focus:border-ring`,value:y.scheduleText,onChange:e=>X(`scheduleText`,e.target.value),placeholder:l(`taskScheduleDescriptionPlaceholder`)})]}),(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,f.jsxs)(u,{onClick:Qe,disabled:A||!F||!y.scheduleText.trim(),children:[(0,f.jsx)(a,{className:`mr-1 size-3.5`}),l(`aiParseTask`)]}),je?(0,f.jsx)(`span`,{className:`text-sm text-amber-600`,children:je}):null]}),(0,f.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,f.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[l(`taskTitleLabel`),(0,f.jsx)(`input`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring`,value:y.title,onChange:e=>X(`title`,e.target.value),placeholder:l(`taskTitlePlaceholder`)})]}),(0,f.jsxs)(`div`,{className:`block text-sm font-medium text-foreground`,children:[l(`executionRule`),(0,f.jsx)(`div`,{className:`mt-1 flex h-10 items-center rounded-md border border-input bg-muted/20 px-3 text-sm text-muted-foreground`,children:y.scheduleRule||`-`})]}),(0,f.jsxs)(`div`,{className:`block text-sm font-medium text-foreground`,children:[`cron`,(0,f.jsx)(`div`,{className:`mt-1 flex h-10 items-center rounded-md border border-input bg-muted/20 px-3 font-mono text-sm text-muted-foreground`,children:y.cronExpression||`-`})]}),(0,f.jsxs)(`div`,{className:`block text-sm font-medium text-foreground`,children:[l(`nextExecutionTime`),(0,f.jsx)(`div`,{className:`mt-1 flex h-10 items-center rounded-md border border-input bg-muted/20 px-3 text-sm text-muted-foreground`,children:m(y.nextRunAt)})]}),(0,f.jsxs)(`label`,{className:`block text-sm font-medium text-foreground sm:col-span-2`,children:[(0,f.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[l(`taskExecutionMode`),(0,f.jsx)(s,{label:l(`taskExecutionModeHelp`)})]}),(0,f.jsxs)(`select`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:border-ring`,value:y.executionMode,onChange:e=>X(`executionMode`,e.target.value),children:[(0,f.jsx)(`option`,{value:`serial`,children:l(`taskExecutionModeSerial`)}),(0,f.jsx)(`option`,{value:`parallel`,children:l(`taskExecutionModeParallel`)})]})]}),(0,f.jsxs)(`label`,{className:`block text-sm font-medium text-foreground sm:col-span-2`,children:[l(`promptContentLabel`),(0,f.jsx)(`textarea`,{className:`mt-1 min-h-28 w-full resize-y rounded-xl border border-input bg-background px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground/65 focus:border-ring`,value:y.instruction,onChange:e=>X(`instruction`,e.target.value),placeholder:l(`promptContentPlaceholder`)})]})]}),(0,f.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground`,children:[(0,f.jsx)(`input`,{type:`checkbox`,checked:y.enabled,onChange:e=>X(`enabled`,e.target.checked)}),l(`taskEnabledSwitch`)]}),(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-xl border border-border bg-muted/20 px-2 py-2`,children:[(0,f.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,f.jsx)(a,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,f.jsxs)(`select`,{className:`h-8 max-w-[240px] rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:F?`${F.provider}\u0000${F.id}`:``,onChange:e=>{let t=P.find(t=>`${t.provider}\u0000${t.id}`===e.target.value);I(t),R(fe(t))},title:l(`taskModel`),children:[P.length===0?(0,f.jsx)(`option`,{value:``,children:l(`noModelAvailable`)}):null,P.map(e=>(0,f.jsxs)(`option`,{value:`${e.provider}\u0000${e.id}`,children:[_e(e),ve(e,F)?` ✓`:``]},`${e.provider}:${e.id}`))]})]}),(0,f.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,f.jsx)(le,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,f.jsx)(`select`,{className:`h-8 rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:L,onChange:e=>R(e.target.value),title:l(`taskThinking`),children:ge.map(e=>(0,f.jsx)(`option`,{value:e.value,children:e.label()},e.value))})]}),(0,f.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,f.jsx)(n,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,f.jsxs)(`select`,{className:`h-8 max-w-[220px] rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:Pe,onChange:e=>B(e.target.value),title:l(`taskProjectLabel`),children:[(0,f.jsx)(`option`,{value:``,children:l(`noProjectBound`)}),z.map(e=>(0,f.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,f.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,f.jsx)(te,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,f.jsxs)(`select`,{className:`h-8 max-w-[220px] rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:y.agentId,onChange:e=>X(`agentId`,e.target.value),title:l(`executionAgent`),children:[(0,f.jsx)(`option`,{value:``,children:l(`defaultAgent`)}),Be.map(e=>(0,f.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]})]}),D?(0,f.jsxs)(`div`,{className:`rounded-xl border border-border bg-muted/30 p-3 text-sm`,children:[(0,f.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 font-medium text-foreground`,children:[(0,f.jsx)(re,{className:`size-4 text-emerald-600`}),l(`aiParsed`)]}),(0,f.jsxs)(`div`,{className:`grid gap-2 text-muted-foreground sm:grid-cols-2`,children:[(0,f.jsxs)(`div`,{children:[l(`taskName`),(0,f.jsx)(`span`,{className:`text-foreground`,children:D.title})]}),(0,f.jsxs)(`div`,{children:[l(`executionRule`),(0,f.jsx)(`span`,{className:`text-foreground`,children:D.scheduleRule})]}),(0,f.jsxs)(`div`,{children:[`cron:`,(0,f.jsx)(`span`,{className:`font-mono text-foreground`,children:D.cronExpression??`-`})]}),(0,f.jsxs)(`div`,{children:[l(`nextExecutionTime`),(0,f.jsx)(`span`,{className:`text-foreground`,children:m(D.nextRunAt)})]}),(0,f.jsxs)(`div`,{className:`sm:col-span-2`,children:[l(`aiInstruction`),(0,f.jsx)(`span`,{className:`text-foreground`,children:D.instruction})]})]})]}):null,M?(0,f.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:M}):null]})}),(0,f.jsx)(`div`,{className:`shrink-0 border-t border-border px-5 py-4`,children:(0,f.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,f.jsx)(u,{variant:`outline`,onClick:Q,disabled:A,children:l(`cancel`)}),(0,f.jsx)(u,{onClick:$e,disabled:A||!F||!Ee(y),children:l(We?`saveTask`:`confirmCreate`)})]})})]})}):null]})}export{v as ScheduledTasksPage};
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{$ as t,B as n,Ct as r,T as i,a as ee,bt as a,c as te,ct as ne,h as re,n as ie,t as ae,tt as oe,ut as se,xt as ce,yt as le}from"./icons-DJqt-rnw.js";import{n as o}from"./react-vendor-CZCcjpSR.js";import{D as ue,E as de,F as s,I as c,M as fe,N as l,O as pe,P as u,T as me,k as he}from"./index-CcGy4TXo.js";var d=e(r(),1),f=o(),ge=[{value:`off`,label:()=>c(`thinkingOff`)},{value:`low`,label:()=>c(`thinkingLow`)},{value:`medium`,label:()=>c(`thinkingMedium`)},{value:`high`,label:()=>c(`thinkingHigh`)},{value:`xhigh`,label:()=>c(`thinkingXHigh`)}];function _e(e){return`${e.provider} / ${e.id}`}function ve(e,t){return!!(e&&t&&e.api===t.api&&e.provider===t.provider&&e.id===t.id)}function p(e){return String(e).padStart(2,`0`)}function m(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.getTime())?`-`:`${t.getFullYear()}-${p(t.getMonth()+1)}-${p(t.getDate())} ${p(t.getHours())}:${p(t.getMinutes())}`}function ye(e,t=20){let n=String(e||``).trim();return n.length>t?`${n.slice(0,t)}...`:n}function be(){return{scheduleText:``,title:``,instruction:``,cronExpression:``,scheduleRule:``,nextRunAt:``,enabled:!0,agentId:``,executionMode:`serial`}}function h(){return{taskId:``,status:``,trigger:``,keyword:``,startedFrom:``,startedTo:``,page:1,pageSize:10}}function xe(e){return{scheduleText:[e.scheduleRule,e.instruction].filter(Boolean).join(`
2
+ `),title:e.title,instruction:e.instruction,cronExpression:e.cronExpression??``,scheduleRule:e.scheduleRule,nextRunAt:e.nextRunAt,enabled:e.status!==`paused`,agentId:e.agentId??``,executionMode:e.executionMode??`serial`}}function Se(e,t){return{...t,title:e.title,instruction:e.instruction,cronExpression:e.cronExpression??``,scheduleRule:e.scheduleRule,nextRunAt:e.nextRunAt,enabled:t.enabled}}function Ce(e){return{title:e.title.trim(),instruction:e.instruction.trim(),scheduleType:`cron`,scheduleRule:e.scheduleRule.trim()||e.cronExpression.trim(),cronExpression:e.cronExpression.trim(),nextRunAt:e.nextRunAt,enabled:e.enabled,agentId:e.agentId||null,executionMode:e.executionMode}}function g(e){return!!(e.currentRunId||e.currentRunIds?.length)}function we(e){return(e.executionMode??`serial`)===`parallel`||!g(e)}function Te(e){return c(e===`parallel`?`taskExecutionModeParallel`:`taskExecutionModeSerial`)}function Ee(e){return!!(e.title.trim()&&e.instruction.trim()&&e.cronExpression.trim())}function De(e){return c(e===`enabled`?`taskEnabled`:e===`running`?`taskRunning`:e===`paused`?`taskPaused`:e===`completed`?`taskFinished`:e===`success`?`executionSuccess`:`taskFailed`)}function Oe(e){return e===`enabled`||e===`success`?`bg-emerald-500/10 text-emerald-700`:e===`running`?`bg-blue-500/10 text-blue-700`:e===`paused`?`bg-amber-500/10 text-amber-700`:`bg-muted text-muted-foreground`}async function _(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||`请求失败`);return r}function v({onOpenSession:e}){let[r,o]=(0,d.useState)([]),[p,v]=(0,d.useState)(`tasks`),[y,b]=(0,d.useState)(()=>be()),[x,ke]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(null),[Ae,E]=(0,d.useState)(!1),[D,O]=(0,d.useState)(null),[je,k]=(0,d.useState)(``),[A,j]=(0,d.useState)(!1),[M,N]=(0,d.useState)(``),[P,Me]=(0,d.useState)([]),[F,I]=(0,d.useState)(),[L,R]=(0,d.useState)(`off`),[z,Ne]=(0,d.useState)([]),[Pe,B]=(0,d.useState)(``),[V,H]=(0,d.useState)(()=>h()),[U,W]=(0,d.useState)(()=>h()),[G,Fe]=(0,d.useState)({runs:[],total:0,page:1,pageSize:10}),[Ie,Le]=(0,d.useState)(!1),[Re,ze]=(0,d.useState)(null),[Be,Ve]=(0,d.useState)([]),He=z[0]?.id??``;(0,d.useEffect)(()=>{if(!w)return;let e=()=>T(null);return window.addEventListener(`click`,e),window.addEventListener(`blur`,e),()=>{window.removeEventListener(`click`,e),window.removeEventListener(`blur`,e)}},[w]);async function Ue(){o((await _(`/api/scheduled-tasks`)).tasks)}async function K(e=U){Le(!0),N(``);try{let t=new URLSearchParams;t.set(`page`,String(e.page)),t.set(`pageSize`,String(e.pageSize)),e.taskId&&t.set(`taskId`,e.taskId),e.status&&t.set(`status`,e.status),e.trigger&&t.set(`trigger`,e.trigger),e.keyword.trim()&&t.set(`keyword`,e.keyword.trim()),e.startedFrom&&t.set(`startedFrom`,e.startedFrom),e.startedTo&&t.set(`startedTo`,e.startedTo),Fe(await _(`/api/scheduled-tasks/runs?${t.toString()}`))}catch(e){N(e instanceof Error?e.message:c(`requestFailed`))}finally{Le(!1)}}(0,d.useEffect)(()=>{let e=!1;async function t(){try{let t=await _(`/api/project`);if(e)return;Ne(t.projects??[])}catch{}}return t(),()=>{e=!0}},[]),(0,d.useEffect)(()=>{let e=!1;async function t(){try{let t=await ue(),n=await de(t),r=await pe(t),i=r.model??await he(t)??n[0];if(e)return;Me(n),I(i),R(r.thinkingLevel??me(i))}catch(t){e||N(t instanceof Error?t.message:c(`requestFailed`))}}return t(),()=>{e=!0}},[]),(0,d.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await _(`/api/scheduled-tasks`);e||o(t.tasks)}catch(t){e||N(t instanceof Error?t.message:c(`requestFailed`))}};t();let n=window.setInterval(t,10*1e3);return()=>{e=!0,window.clearInterval(n)}},[]),(0,d.useEffect)(()=>{let e=!1;async function t(){try{let t=await _(`/api/agent-profiles`);if(e)return;Ve(t.agents)}catch(t){e||N(t instanceof Error?t.message:c(`requestFailed`))}}return t(),()=>{e=!0}},[]);let We=(0,d.useMemo)(()=>r.find(e=>e.id===x),[x,r]),q=(0,d.useMemo)(()=>r.find(e=>e.id===S)??null,[S,r]),Ge=(0,d.useMemo)(()=>r.filter(e=>e.status===`enabled`).length,[r]),J=Math.max(1,Math.ceil(G.total/G.pageSize));function Y(e){return e?Be.find(t=>t.id===e||t.name===e)?.label??e:c(`defaultAgent`)}function X(e,t){b(n=>({...n,[e]:t}))}function Z(e,t){H(n=>({...n,[e]:t}))}function Ke(){ke(null),B(He),b(be()),O(null),k(``),N(``)}function qe(){Ke(),E(!0)}function Q(){A||(E(!1),Ke())}function Je(){let e={...V,page:1};H(e),W(e),K(e)}function Ye(){let e=h();H(e),W(e),K(e)}function Xe(e){let t=Math.min(Math.max(1,e),J),n={...U,page:t};H(n),W(n),K(n)}function Ze(e){let t={...U,page:1,pageSize:e};H(t),W(t),K(t)}async function Qe(){let e=y.scheduleText.trim();if(e){j(!0),N(``);try{let t=await _(`/api/scheduled-tasks/parse`,{method:`POST`,body:JSON.stringify({instruction:e,model:F,thinkingLevel:L})});if(t.needMoreInfo||!t.task){k(t.question||`请补充任务信息。`),O(null);return}let n=t.task;k(``),O(n),b(e=>Se(n,e))}catch(e){N(e instanceof Error?e.message:c(`requestFailed`))}finally{j(!1)}}}async function $e(){if(Ee(y)){j(!0),N(``);try{let e=z.find(e=>e.id===Pe),t={task:Ce(y),model:F,thinkingLevel:L,projectId:e?.id,projectName:e?.name};x?await _(`/api/scheduled-tasks/${encodeURIComponent(x)}`,{method:`PUT`,body:JSON.stringify(t)}):await _(`/api/scheduled-tasks`,{method:`POST`,body:JSON.stringify(t)}),Q(),await Ue(),p===`history`&&await K(U)}catch(e){N(e instanceof Error?e.message:c(`requestFailed`))}finally{j(!1)}}}function et(e){T(null),ke(e.id),b(xe(e)),O(null),k(``),N(``),B(e.projectId??``),e.model&&I(e.model),e.thinkingLevel&&R(e.thinkingLevel),E(!0)}async function $(e,t){if(N(``),T(null),!(t===`delete`&&!await fe({description:c(`confirmDeleteTask`),confirmLabel:c(`confirmDelete`),cancelLabel:c(`cancel`),variant:`destructive`})))try{t===`delete`?(await _(`/api/scheduled-tasks/${encodeURIComponent(e)}`,{method:`DELETE`}),x===e&&Q(),S===e&&C(null)):await _(`/api/scheduled-tasks/${encodeURIComponent(e)}/${t}`,{method:`POST`}),await Ue(),p===`history`&&await K(U)}catch(e){N(e instanceof Error?e.message:c(`requestFailed`))}}function tt(t){return(0,f.jsxs)(`div`,{className:`mt-2 space-y-2 text-xs text-muted-foreground`,children:[t.sessionId?(0,f.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>e?.(t.sessionId),children:c(`viewConversation`)}):null,(0,f.jsxs)(`div`,{children:[c(`executionAgent`),t.agentLabel||Y(t.agentId)]}),t.warning?(0,f.jsx)(`div`,{className:`text-amber-600`,children:t.warning}):null,t.inputContent?(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`font-medium text-foreground`,children:c(`runInputContent`)}),(0,f.jsx)(`pre`,{className:`mt-1 max-h-32 overflow-auto whitespace-pre-wrap`,children:t.inputContent})]}):null,t.aiResult||t.result?(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`font-medium text-foreground`,children:c(`runAiResult`)}),(0,f.jsx)(`pre`,{className:`mt-1 max-h-48 overflow-auto whitespace-pre-wrap`,children:t.aiResult||t.result})]}):null,t.errorMessage?(0,f.jsx)(`div`,{className:`text-destructive`,children:t.errorMessage}):null,t.durationMs?(0,f.jsxs)(`div`,{children:[c(`runDuration`),t.durationMs,`ms`]}):null]})}return(0,f.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,f.jsxs)(`div`,{className:`border-b border-border px-6 py-5`,children:[(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,f.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-2xl bg-primary/10 text-primary`,children:(0,f.jsx)(le,{className:`size-5`})}),(0,f.jsx)(`div`,{children:(0,f.jsxs)(`h1`,{className:`inline-flex items-center gap-1.5 text-lg font-semibold text-foreground`,children:[c(`scheduledTasks`),(0,f.jsx)(l,{label:c(`scheduledTasksDescription`)})]})})]}),(0,f.jsx)(u,{onClick:qe,children:c(`createTask`)})]}),(0,f.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,f.jsxs)(`button`,{type:`button`,className:s(`rounded-full px-4 py-2 text-sm font-medium transition-colors`,p===`tasks`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:text-foreground`),onClick:()=>v(`tasks`),children:[c(`taskListTab`),` `,(0,f.jsx)(`span`,{className:`opacity-80`,children:r.length})]}),(0,f.jsx)(`button`,{type:`button`,className:s(`rounded-full px-4 py-2 text-sm font-medium transition-colors`,p===`history`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:text-foreground`),onClick:()=>{v(`history`),K(U)},children:c(`executionHistoryTab`)})]})]}),(0,f.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,f.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:[M&&!Ae?(0,f.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:M}):null,p===`tasks`?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:(0,f.jsx)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:c(`taskList`)}),(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c(`tasksCount`,{total:r.length,enabled:Ge})})]})})}),(0,f.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:r.length===0?(0,f.jsx)(`div`,{className:`rounded-lg px-3 py-3 text-center text-xs text-muted-foreground/55 md:col-span-2`,children:c(`noScheduledTasks`)}):r.map(e=>{let n=e.status===`enabled`,r=e.status===`completed`,a=g(e);return(0,f.jsxs)(`div`,{className:`relative cursor-pointer rounded-xl border border-border bg-card p-4 transition-colors hover:bg-muted/15`,onClick:()=>C(e.id),children:[(0,f.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,f.jsxs)(`div`,{className:`min-w-0`,children:[(0,f.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,f.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground/90`,children:e.title})}),(0,f.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:ye(e.instruction,20)})]}),(0,f.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,onClick:e=>e.stopPropagation(),children:[(0,f.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":n,disabled:r,className:s(`relative h-6 w-11 rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-60`,n?`bg-emerald-500`:`bg-muted-foreground/30`),onClick:()=>void $(e.id,e.status===`paused`?`resume`:`pause`),title:e.status===`paused`?c(`enable`):c(`pauseTask`),children:(0,f.jsx)(`span`,{className:s(`absolute left-0.5 top-0.5 size-5 rounded-full bg-white shadow transition-transform`,n?`translate-x-5`:`translate-x-0`)})}),(0,f.jsxs)(`div`,{className:`relative`,children:[(0,f.jsx)(u,{variant:`ghost`,size:`icon`,onClick:()=>T(w===e.id?null:e.id),title:c(`moreActions`),children:(0,f.jsx)(oe,{className:`size-4`})}),w===e.id?(0,f.jsxs)(`div`,{className:`absolute right-0 z-20 mt-1 w-36 overflow-hidden rounded-xl border border-border bg-popover py-1 text-sm shadow-quickforge`,children:[(0,f.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:!we(e),onClick:()=>void $(e.id,`run`),children:[(0,f.jsx)(ae,{className:`size-3.5`}),c(`executeNow`)]}),(0,f.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:a,onClick:()=>et(e),children:[(0,f.jsx)(i,{className:`size-3.5`}),c(`editTask`)]}),(0,f.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted`,onClick:()=>{T(null),C(e.id)},children:[(0,f.jsx)(t,{className:`size-3.5`}),c(`viewDetails`)]}),(0,f.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left text-destructive hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:a,onClick:()=>void $(e.id,`delete`),children:[(0,f.jsx)(ee,{className:`size-3.5`}),c(`deleteTask`)]})]}):null]})]})]}),(0,f.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,f.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,f.jsx)(ne,{className:`size-3`}),e.scheduleRule]}),(0,f.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,f.jsx)(ce,{className:`size-3`}),Y(e.agentId)]}),(0,f.jsxs)(`span`,{children:[c(`taskExecutionMode`),`:`,Te(e.executionMode)]}),e.projectName?(0,f.jsxs)(`span`,{children:[c(`taskProject`),e.projectName]}):null]}),(0,f.jsxs)(`div`,{className:`mt-4 grid gap-2 border-t border-border pt-3 text-xs text-muted-foreground sm:grid-cols-2`,children:[(0,f.jsxs)(`span`,{children:[c(`lastExecution`),m(e.lastRunAt)]}),(0,f.jsxs)(`span`,{children:[c(`nextExecution`),m(e.nextRunAt)]})]})]},e.id)})})]}):(0,f.jsxs)(`div`,{className:`space-y-4`,children:[(0,f.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,f.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,f.jsx)(re,{className:`size-4`}),c(`historyFilters`)]}),(0,f.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[c(`taskName`),(0,f.jsxs)(`select`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.taskId,onChange:e=>Z(`taskId`,e.target.value),children:[(0,f.jsx)(`option`,{value:``,children:c(`allTasks`)}),r.map(e=>(0,f.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]}),(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[c(`status`),(0,f.jsxs)(`select`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.status,onChange:e=>Z(`status`,e.target.value),children:[(0,f.jsx)(`option`,{value:``,children:c(`allStatuses`)}),(0,f.jsx)(`option`,{value:`running`,children:c(`executionRunning`)}),(0,f.jsx)(`option`,{value:`success`,children:c(`executionSuccess`)}),(0,f.jsx)(`option`,{value:`failed`,children:c(`taskFailed`)})]})]}),(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[c(`triggerType`),(0,f.jsxs)(`select`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.trigger,onChange:e=>Z(`trigger`,e.target.value),children:[(0,f.jsx)(`option`,{value:``,children:c(`allTriggers`)}),(0,f.jsx)(`option`,{value:`schedule`,children:c(`autoRun`)}),(0,f.jsx)(`option`,{value:`manual`,children:c(`manualRun`)})]})]}),(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[c(`startTime`),(0,f.jsx)(`input`,{type:`datetime-local`,className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.startedFrom,onChange:e=>Z(`startedFrom`,e.target.value)})]}),(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[c(`endTime`),(0,f.jsx)(`input`,{type:`datetime-local`,className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.startedTo,onChange:e=>Z(`startedTo`,e.target.value)})]}),(0,f.jsxs)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:[c(`keyword`),(0,f.jsx)(`input`,{className:`mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground`,value:V.keyword,onChange:e=>Z(`keyword`,e.target.value),placeholder:c(`keywordPlaceholder`)})]})]}),(0,f.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2`,children:[(0,f.jsx)(u,{variant:`outline`,onClick:Ye,children:c(`reset`)}),(0,f.jsx)(u,{onClick:Je,children:c(`query`)})]})]}),(0,f.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-card`,children:[(0,f.jsxs)(`div`,{className:`grid grid-cols-[1.3fr_0.7fr_0.7fr_1fr_0.7fr] gap-3 border-b border-border px-4 py-3 text-xs font-medium text-muted-foreground`,children:[(0,f.jsx)(`span`,{children:c(`taskName`)}),(0,f.jsx)(`span`,{children:c(`status`)}),(0,f.jsx)(`span`,{children:c(`triggerType`)}),(0,f.jsx)(`span`,{children:c(`startTime`)}),(0,f.jsx)(`span`,{children:c(`runDuration`)})]}),Ie?(0,f.jsx)(`div`,{className:`p-8 text-center text-sm text-muted-foreground`,children:c(`loading`)}):G.runs.length===0?(0,f.jsx)(`div`,{className:`p-8 text-center text-sm text-muted-foreground`,children:c(`noExecutionHistory`)}):G.runs.map(e=>(0,f.jsxs)(`div`,{className:`border-b border-border last:border-b-0`,children:[(0,f.jsxs)(`button`,{type:`button`,className:`grid w-full grid-cols-[1.3fr_0.7fr_0.7fr_1fr_0.7fr] gap-3 px-4 py-3 text-left text-sm hover:bg-muted/40`,onClick:()=>ze(Re===e.id?null:e.id),children:[(0,f.jsx)(`span`,{className:`min-w-0 truncate text-foreground`,children:e.taskTitle}),(0,f.jsx)(`span`,{children:(0,f.jsx)(`span`,{className:s(`rounded-full px-2 py-0.5 text-xs`,Oe(e.status)),children:De(e.status)})}),(0,f.jsx)(`span`,{className:`text-muted-foreground`,children:e.trigger===`manual`?c(`manualRun`):c(`autoRun`)}),(0,f.jsx)(`span`,{className:`text-muted-foreground`,children:m(e.startedAt)}),(0,f.jsx)(`span`,{className:`text-muted-foreground`,children:e.durationMs?`${e.durationMs}ms`:`-`})]}),Re===e.id?(0,f.jsx)(`div`,{className:`border-t border-border bg-muted/20 px-4 py-3`,children:tt(e)}):null]},`${e.taskId}:${e.id}`)),(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3 text-sm text-muted-foreground`,children:[(0,f.jsx)(`span`,{children:c(`paginationSummary`,{page:G.page,pages:J,total:G.total})}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(`select`,{className:`h-8 rounded-md border border-input bg-background px-2 text-sm`,value:G.pageSize,onChange:e=>Ze(Number(e.target.value)),children:[10,20,50,100].map(e=>(0,f.jsx)(`option`,{value:e,children:c(`pageSize`,{size:e})},e))}),(0,f.jsx)(u,{variant:`outline`,size:`sm`,disabled:G.page<=1,onClick:()=>Xe(G.page-1),children:c(`previousPage`)}),(0,f.jsx)(u,{variant:`outline`,size:`sm`,disabled:G.page>=J,onClick:()=>Xe(G.page+1),children:c(`nextPage`)})]})]})]})]})]})}),q?(0,f.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onMouseDown:e=>{e.target===e.currentTarget&&C(null)},children:(0,f.jsxs)(`div`,{className:`flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,onMouseDown:e=>e.stopPropagation(),children:[(0,f.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-border px-5 py-4`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,f.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:q.title})}),(0,f.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:q.scheduleRule})]}),(0,f.jsx)(u,{variant:`ghost`,size:`icon`,onClick:()=>C(null),children:(0,f.jsx)(ie,{className:`size-4`})})]}),(0,f.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,f.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`mb-1 font-medium text-foreground`,children:c(`taskContent`)}),(0,f.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap rounded-xl border border-border bg-muted/20 p-3 text-muted-foreground`,children:q.instruction})]}),(0,f.jsxs)(`div`,{className:`grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,f.jsxs)(`div`,{children:[c(`executionRule`),(0,f.jsx)(`span`,{className:`text-foreground`,children:q.scheduleRule})]}),(0,f.jsxs)(`div`,{children:[c(`taskExecutionMode`),`:`,(0,f.jsx)(`span`,{className:`text-foreground`,children:Te(q.executionMode)})]}),(0,f.jsxs)(`div`,{children:[`cron:`,(0,f.jsx)(`span`,{className:`font-mono text-foreground`,children:q.cronExpression??`-`})]}),(0,f.jsxs)(`div`,{children:[c(`lastExecution`),(0,f.jsx)(`span`,{className:`text-foreground`,children:m(q.lastRunAt)})]}),(0,f.jsxs)(`div`,{children:[c(`nextExecution`),(0,f.jsx)(`span`,{className:`text-foreground`,children:m(q.nextRunAt)})]}),(0,f.jsxs)(`div`,{children:[c(`executionAgent`),(0,f.jsx)(`span`,{className:`text-foreground`,children:Y(q.agentId)})]}),q.projectName?(0,f.jsxs)(`div`,{children:[c(`taskProject`),(0,f.jsx)(`span`,{className:`text-foreground`,children:q.projectName})]}):null,q.model?(0,f.jsxs)(`div`,{children:[c(`taskModel`),`:`,(0,f.jsx)(`span`,{className:`text-foreground`,children:_e(q.model)})]}):null,q.thinkingLevel?(0,f.jsxs)(`div`,{children:[c(`taskThinkingLevel`),(0,f.jsx)(`span`,{className:`text-foreground`,children:ge.find(e=>e.value===q.thinkingLevel)?.label()??q.thinkingLevel})]}):null,(0,f.jsxs)(`div`,{children:[c(`createdAt`),`:`,(0,f.jsx)(`span`,{className:`text-foreground`,children:m(q.createdAt)})]})]}),q.runs?.length>0?(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`div`,{className:`mb-2 font-medium text-foreground`,children:c(`recentExecutions`)}),(0,f.jsx)(`div`,{className:`space-y-2`,children:q.runs.slice(0,5).map(e=>(0,f.jsxs)(`details`,{className:`rounded-lg border border-border bg-muted/20 p-2 text-xs text-muted-foreground`,children:[(0,f.jsxs)(`summary`,{className:`cursor-pointer text-foreground`,children:[m(e.startedAt),` · `,e.trigger===`manual`?c(`manualRun`):c(`autoRun`),` · `,De(e.status)]}),tt(e)]},e.id))})]}):null]})}),(0,f.jsx)(`div`,{className:`shrink-0 border-t border-border px-5 py-4`,children:(0,f.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[q.lastSessionId?(0,f.jsx)(u,{variant:`outline`,onClick:()=>e?.(q.lastSessionId),children:c(`viewConversation`)}):null,(0,f.jsxs)(u,{variant:`outline`,disabled:!we(q),onClick:()=>void $(q.id,`run`),children:[(0,f.jsx)(ae,{className:`mr-1 size-3.5`}),c(`executeNow`)]}),(0,f.jsxs)(u,{variant:`outline`,disabled:g(q),onClick:()=>et(q),children:[(0,f.jsx)(i,{className:`mr-1 size-3.5`}),c(`editTask`)]}),(0,f.jsxs)(u,{variant:`destructive`,disabled:g(q),onClick:()=>void $(q.id,`delete`),children:[(0,f.jsx)(ee,{className:`mr-1 size-3.5`}),c(`deleteTask`)]})]})})]})}):null,Ae?(0,f.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onMouseDown:e=>{e.target===e.currentTarget&&Q()},children:(0,f.jsxs)(`div`,{className:`flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,onMouseDown:e=>e.stopPropagation(),children:[(0,f.jsx)(`div`,{className:`shrink-0 border-b border-border px-5 py-4`,children:(0,f.jsxs)(`h2`,{className:`inline-flex items-center gap-1.5 text-base font-semibold text-foreground`,children:[c(We?`editTask`:`createTask`),(0,f.jsx)(l,{label:c(`quickAiParseTask`)})]})}),(0,f.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,f.jsxs)(`div`,{className:`space-y-4`,children:[(0,f.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[c(`taskScheduleDescriptionLabel`),(0,f.jsx)(`textarea`,{className:`mt-1 min-h-24 w-full resize-y rounded-xl border border-input bg-background px-3 py-2 text-sm outline-none transition-colors placeholder:text-muted-foreground/65 focus:border-ring`,value:y.scheduleText,onChange:e=>X(`scheduleText`,e.target.value),placeholder:c(`taskScheduleDescriptionPlaceholder`)})]}),(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,f.jsxs)(u,{onClick:Qe,disabled:A||!F||!y.scheduleText.trim(),children:[(0,f.jsx)(te,{className:`mr-1 size-3.5`}),c(`aiParseTask`)]}),je?(0,f.jsx)(`span`,{className:`text-sm text-amber-600`,children:je}):null]}),(0,f.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,f.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[c(`taskTitleLabel`),(0,f.jsx)(`input`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring`,value:y.title,onChange:e=>X(`title`,e.target.value),placeholder:c(`taskTitlePlaceholder`)})]}),(0,f.jsxs)(`div`,{className:`block text-sm font-medium text-foreground`,children:[c(`executionRule`),(0,f.jsx)(`div`,{className:`mt-1 flex h-10 items-center rounded-md border border-input bg-muted/20 px-3 text-sm text-muted-foreground`,children:y.scheduleRule||`-`})]}),(0,f.jsxs)(`div`,{className:`block text-sm font-medium text-foreground`,children:[`cron`,(0,f.jsx)(`div`,{className:`mt-1 flex h-10 items-center rounded-md border border-input bg-muted/20 px-3 font-mono text-sm text-muted-foreground`,children:y.cronExpression||`-`})]}),(0,f.jsxs)(`div`,{className:`block text-sm font-medium text-foreground`,children:[c(`nextExecutionTime`),(0,f.jsx)(`div`,{className:`mt-1 flex h-10 items-center rounded-md border border-input bg-muted/20 px-3 text-sm text-muted-foreground`,children:m(y.nextRunAt)})]}),(0,f.jsxs)(`label`,{className:`block text-sm font-medium text-foreground sm:col-span-2`,children:[(0,f.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[c(`taskExecutionMode`),(0,f.jsx)(l,{label:c(`taskExecutionModeHelp`)})]}),(0,f.jsxs)(`select`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:border-ring`,value:y.executionMode,onChange:e=>X(`executionMode`,e.target.value),children:[(0,f.jsx)(`option`,{value:`serial`,children:c(`taskExecutionModeSerial`)}),(0,f.jsx)(`option`,{value:`parallel`,children:c(`taskExecutionModeParallel`)})]})]}),(0,f.jsxs)(`label`,{className:`block text-sm font-medium text-foreground sm:col-span-2`,children:[c(`promptContentLabel`),(0,f.jsx)(`textarea`,{className:`mt-1 min-h-28 w-full resize-y rounded-xl border border-input bg-background px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground/65 focus:border-ring`,value:y.instruction,onChange:e=>X(`instruction`,e.target.value),placeholder:c(`promptContentPlaceholder`)})]})]}),(0,f.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground`,children:[(0,f.jsx)(`input`,{type:`checkbox`,checked:y.enabled,onChange:e=>X(`enabled`,e.target.checked)}),c(`taskEnabledSwitch`)]}),(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-xl border border-border bg-muted/20 px-2 py-2`,children:[(0,f.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,f.jsx)(te,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,f.jsxs)(`select`,{className:`h-8 max-w-[240px] rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:F?`${F.provider}\u0000${F.id}`:``,onChange:e=>{let t=P.find(t=>`${t.provider}\u0000${t.id}`===e.target.value);I(t),R(me(t))},title:c(`taskModel`),children:[P.length===0?(0,f.jsx)(`option`,{value:``,children:c(`noModelAvailable`)}):null,P.map(e=>(0,f.jsxs)(`option`,{value:`${e.provider}\u0000${e.id}`,children:[_e(e),ve(e,F)?` ✓`:``]},`${e.provider}:${e.id}`))]})]}),(0,f.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,f.jsx)(a,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,f.jsx)(`select`,{className:`h-8 rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:L,onChange:e=>R(e.target.value),title:c(`taskThinking`),children:ge.map(e=>(0,f.jsx)(`option`,{value:e.value,children:e.label()},e.value))})]}),(0,f.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,f.jsx)(n,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,f.jsxs)(`select`,{className:`h-8 max-w-[220px] rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:Pe,onChange:e=>B(e.target.value),title:c(`taskProjectLabel`),children:[(0,f.jsx)(`option`,{value:``,children:c(`noProjectBound`)}),z.map(e=>(0,f.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,f.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,f.jsx)(ce,{className:`pointer-events-none absolute left-2 size-3.5 text-muted-foreground/70`}),(0,f.jsxs)(`select`,{className:`h-8 max-w-[220px] rounded-md border border-transparent bg-transparent pl-7 pr-2 text-xs text-muted-foreground outline-none hover:bg-background focus:border-ring`,value:y.agentId,onChange:e=>X(`agentId`,e.target.value),title:c(`executionAgent`),children:[(0,f.jsx)(`option`,{value:``,children:c(`defaultAgent`)}),Be.map(e=>(0,f.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]})]}),D?(0,f.jsxs)(`div`,{className:`rounded-xl border border-border bg-muted/30 p-3 text-sm`,children:[(0,f.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 font-medium text-foreground`,children:[(0,f.jsx)(se,{className:`size-4 text-emerald-600`}),c(`aiParsed`)]}),(0,f.jsxs)(`div`,{className:`grid gap-2 text-muted-foreground sm:grid-cols-2`,children:[(0,f.jsxs)(`div`,{children:[c(`taskName`),(0,f.jsx)(`span`,{className:`text-foreground`,children:D.title})]}),(0,f.jsxs)(`div`,{children:[c(`executionRule`),(0,f.jsx)(`span`,{className:`text-foreground`,children:D.scheduleRule})]}),(0,f.jsxs)(`div`,{children:[`cron:`,(0,f.jsx)(`span`,{className:`font-mono text-foreground`,children:D.cronExpression??`-`})]}),(0,f.jsxs)(`div`,{children:[c(`nextExecutionTime`),(0,f.jsx)(`span`,{className:`text-foreground`,children:m(D.nextRunAt)})]}),(0,f.jsxs)(`div`,{className:`sm:col-span-2`,children:[c(`aiInstruction`),(0,f.jsx)(`span`,{className:`text-foreground`,children:D.instruction})]})]})]}):null,M?(0,f.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:M}):null]})}),(0,f.jsx)(`div`,{className:`shrink-0 border-t border-border px-5 py-4`,children:(0,f.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,f.jsx)(u,{variant:`outline`,onClick:Q,disabled:A,children:c(`cancel`)}),(0,f.jsx)(u,{onClick:$e,disabled:A||!F||!Ee(y),children:c(We?`saveTask`:`confirmCreate`)})]})})]})}):null]})}export{v as ScheduledTasksPage};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{Ct as t,i as n,it as r}from"./icons-DJqt-rnw.js";import{n as i}from"./react-vendor-CZCcjpSR.js";import{f as a,i as o,n as s,r as c,t as l,u}from"./pi-web-ui-CBet4bMl.js";import{p as d}from"./pi-ai-Cx633yhb.js";import{t as f}from"./logger-B65Akg8A.js";import{A as p,C as m,F as h,I as g,P as _,S as v,T as y,b,d as x,f as S,j as C,m as w,p as T,v as E,w as D,y as O}from"./index-CcGy4TXo.js";import{ChatPanelHost as k}from"./ChatPanelHost-De-DMjx5.js";var A=e(t(),1),j=`quickforgeClientMessageId`;function M(e){let t=e?.metadata;return t&&typeof t==`object`&&!Array.isArray(t)?t:void 0}function N(e){let t=M(e)?.[j];return typeof t==`string`&&t?t:void 0}function P(){return`qfcm_${typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}`}function F(e){let t=N(e);if(t)return{message:e,clientMessageId:t};let n=P();return{message:{...e,metadata:{...M(e),[j]:n}},clientMessageId:n}}function I(e){return typeof e==`string`?e:Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.type===`text`).map(e=>e.text).filter(e=>typeof e==`string`).join(``):``}function L(e,t){if(!e||!t||e.role!==t.role)return!1;let n=N(e),r=N(t);return n&&r?n===r:I(e.content)===I(t.content)}async function R(e,t){let n=await fetch(e,{...t,cache:`no-store`,headers:{...t?.body?{"content-type":`application/json`}:void 0,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||`Request failed: ${n.status}`);return r}var z=class e{state;streamFn=d;getApiKey;sessionId;shareId;permission;listeners=new Set;eventSource=null;disposed=!1;reconnectTimer=null;reconnectDelay=1e3;baseUrl=``;syncingThinkingLevel=!1;planMode=!1;onPlanModeConsumed;constructor(e,t){this.shareId=e,this.sessionId=t.sessionId||t.id||e,this.permission=t.permission??`read`;let n={systemPrompt:t.systemPrompt??``,model:t.model??{provider:`shared`,id:`shared`},thinkingLevel:t.thinkingLevel??`off`,messages:t.messages?.slice()??[],tools:t.tools??[],isStreaming:!!t.isStreaming,streamingMessage:void 0,pendingToolCalls:new Set,errorMessage:t.errorMessage,contextCompaction:t.contextCompaction??null,contextUsage:t.contextUsage??null};this.state=new Proxy(n,{set:(e,t,n)=>{let r=e[t];return e[t]=n,t===`thinkingLevel`&&!this.syncingThinkingLevel&&n!==r&&this.updateThinkingLevel(n).catch(e=>{f.error(`Failed to update shared thinking level:`,e)}),!0}}),this.connectEvents()}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setNextPromptCapabilities(){}setPlanMode(e,t){this.planMode=e,this.onPlanModeConsumed=e?t:void 0}async prompt(e){if(this.disposed||this.permission!==`operate`)return;let{message:t,clientMessageId:n}=F(this.normalizeInput(e)),r=this.planMode?{type:`plan`}:void 0;if(this.planMode){this.planMode=!1;let e=this.onPlanModeConsumed;this.onPlanModeConsumed=void 0,e?.()}this.state.messages=[...this.state.messages,t],this.emit({type:`message_start`,message:t}),this.state.isStreaming||(this.state.isStreaming=!0,this.state.errorMessage=void 0,this.emit({type:`agent_start`}));try{await R(`/api/shared/${encodeURIComponent(this.shareId)}/message`,{method:`POST`,body:JSON.stringify({message:t,clientMessageId:n,command:r})})}catch(e){let t=e instanceof Error?e.message:String(e);throw this.state.errorMessage=t,this.state.isStreaming=!1,this.emit({type:`error`,error:t}),this.emit({type:`agent_end`,messages:this.state.messages}),e}}async updateModel(e){if(!(this.disposed||this.permission!==`operate`)){this.state.model=e;try{let t=await R(`/api/shared/${encodeURIComponent(this.shareId)}/model`,{method:`POST`,body:JSON.stringify({model:e})});t.model&&(this.state.model=t.model)}catch(e){let t=e instanceof Error?e.message:String(e);throw this.state.errorMessage=t,this.emit({type:`error`,error:t}),e}}}async updateThinkingLevel(e){if(!(this.disposed||this.permission!==`operate`)){!this.syncingThinkingLevel&&this.state.thinkingLevel!==e&&(this.state.thinkingLevel=e);try{let t=await R(`/api/shared/${encodeURIComponent(this.shareId)}/thinking-level`,{method:`POST`,body:JSON.stringify({thinkingLevel:e})});t.thinkingLevel&&(this.state.thinkingLevel=t.thinkingLevel)}catch(e){let t=e instanceof Error?e.message:String(e);throw this.state.errorMessage=t,this.emit({type:`error`,error:t}),e}}}abort(){this.permission===`operate`&&fetch(`/api/shared/${encodeURIComponent(this.shareId)}/abort`,{method:`POST`}).catch(e=>{f.error(`Failed to abort shared conversation:`,e)})}steer(){}followUp(){}reset(){this.state.messages=[],this.state.errorMessage=void 0,this.state.isStreaming=!1,this.state.streamingMessage=void 0,this.state.pendingToolCalls=new Set}async rollback(e){if(this.permission!==`operate`)return;let t=await R(`/api/shared/${encodeURIComponent(this.shareId)}/rollback`,{method:`POST`,body:JSON.stringify({messageIndex:e})});return this.applyState(t.session),this.emit({type:`messages_replaced`,messages:this.state.messages}),t}dispose(){this.disposed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.eventSource?.close(),this.eventSource=null,this.listeners.clear()}static async loadState(e){return R(`/api/shared/${encodeURIComponent(e)}/session`)}static async create(t){return new e(t,await e.loadState(t))}normalizeInput(e){return typeof e==`string`?{role:`user`,content:e,timestamp:Date.now()}:Array.isArray(e)?[...e].reverse().find(e=>e.role===`user`||e.role===`user-with-attachments`)??e[e.length-1]:e}connectEvents(){this.disposed||(this.eventSource?.close(),this.baseUrl=``,this.openEventSource())}openEventSource(){if(this.disposed)return;let e=`${this.baseUrl}/api/shared/${encodeURIComponent(this.shareId)}/events`;this.eventSource=new EventSource(e,{withCredentials:!0}),this.eventSource.onopen=()=>{this.reconnectDelay=1e3};let t=[`state`,`agent_start`,`agent_end`,`message_start`,`message_end`,`turn_start`,`turn_end`,`message_update`,`tool_execution_start`,`tool_execution_update`,`tool_execution_end`,`error`,`title_updated`,`messages_replaced`,`auto_compact_completed`],n=e=>t=>{try{let n=JSON.parse(t.data);this.handleEvent(e?{type:e,...n}:n)}catch{}};this.eventSource.onmessage=n();for(let e of t)this.eventSource.addEventListener(e,n(e));this.eventSource.onerror=()=>{this.eventSource?.close(),this.eventSource=null,this.scheduleReconnect()}}scheduleReconnect(){this.disposed||this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.reconnectDelay=Math.min(this.reconnectDelay*2,3e4),this.openEventSource()},this.reconnectDelay))}handleEvent(e){if(e.type){switch(e.type){case`state`:this.applyState(e);break;case`agent_start`:this.state.isStreaming=!0,this.state.errorMessage=void 0;break;case`agent_end`:this.state.isStreaming=!1,this.state.streamingMessage=void 0;break;case`message_start`:if(e.message){let t=this.state.messages.findIndex(t=>L(t,e.message));if(t>=0){let n=this.state.messages.slice();n[t]=e.message,this.state.messages=n}else this.state.messages=[...this.state.messages,e.message];this.state.contextUsage=null}break;case`message_update`:e.message&&(this.state.streamingMessage=e.message);break;case`message_end`:e.message&&(this.state.messages=m(this.state.messages,e.message)),this.state.contextUsage=`contextUsage`in e?e.contextUsage:null,this.state.streamingMessage=void 0;break;case`messages_replaced`:e.messages&&(this.state.messages=e.messages,this.state.streamingMessage=void 0),`contextCompaction`in e&&(this.state.contextCompaction=e.contextCompaction),`contextUsage`in e&&(this.state.contextUsage=e.contextUsage);break;case`auto_compact_completed`:`contextCompaction`in e&&(this.state.contextCompaction=e.contextCompaction),`contextUsage`in e&&(this.state.contextUsage=e.contextUsage);break;case`tool_execution_start`:{let t=e;t.toolCallId&&(this.state.messages=D(this.state.messages,v(t),!0),this.state.pendingToolCalls=new Set([...this.state.pendingToolCalls,t.toolCallId]));break}case`tool_execution_update`:{let t=e;this.state.messages=D(this.state.messages,t,!0),t.toolCallId&&(this.state.pendingToolCalls=new Set([...this.state.pendingToolCalls,t.toolCallId]));break}case`tool_execution_end`:{let t=e;if(this.state.messages=D(this.state.messages,t,!1),t.toolCallId){let e=new Set(this.state.pendingToolCalls);e.delete(t.toolCallId),this.state.pendingToolCalls=e}break}case`error`:this.state.errorMessage=typeof e.error==`string`?e.error:`Unknown error`,this.state.isStreaming=!1;break}this.emit(e)}}applyState(e){this.sessionId=e.sessionId||e.id||this.sessionId,e.messages&&(this.state.messages=e.messages,this.state.contextUsage=e.contextUsage===void 0?null:e.contextUsage),e.systemPrompt!==void 0&&(this.state.systemPrompt=e.systemPrompt),e.model&&(this.state.model=e.model),e.thinkingLevel&&(this.syncingThinkingLevel=!0,this.state.thinkingLevel=e.thinkingLevel,this.syncingThinkingLevel=!1),e.tools&&(this.state.tools=e.tools),e.isStreaming!==void 0&&(this.state.isStreaming=!!e.isStreaming),e.errorMessage!==void 0&&(this.state.errorMessage=e.errorMessage),e.contextCompaction!==void 0&&(this.state.contextCompaction=e.contextCompaction),e.contextUsage!==void 0&&(this.state.contextUsage=e.contextUsage)}emit(e){for(let t of this.listeners)try{t(e)}catch{}}},B=i();function V(e){return{id:`shared-${e.provider}`,name:e.provider,type:e.api,baseUrl:e.baseUrl??``,models:[e]}}async function H(e,t){try{let t=await S(e);if(t.providers?.length)return t.providers}catch{}return t?[V(t)]:[]}function U(e,t){let n=t.model??{provider:`shared`,id:`shared`};return new z(e,{...t,model:n,thinkingLevel:t.thinkingLevel??y(n)})}function W(e,t){let n={settings:new l,providerKeys:new c,sessions:new s,customProviders:new o},r=new p(``,{blockedStores:[`sessions`,`provider-keys`],fakeProviderKeys:t?[t.provider]:void 0,storeOverrides:t?{"custom-providers":{keys:async()=>(await H(e,t)).map(e=>e.name),get:async n=>(await H(e,t)).find(e=>e.name===n)??null,has:async n=>(await H(e,t)).some(e=>e.name===n)}}:void 0});n.settings.setBackend(r),n.providerKeys.setBackend(r),n.sessions.setBackend(r),n.customProviders.setBackend(r),a(new u(n.settings,n.providerKeys,n.sessions,n.customProviders,r))}function G({shareId:e}){let[t,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(null),[s,c]=(0,A.useState)(`read`),[l,u]=(0,A.useState)(`QuickForge 分享对话`),[d,p]=(0,A.useState)(),[m,v]=(0,A.useState)(!1),[y,S]=(0,A.useState)(),D=(0,A.useRef)(!1),j=s===`operate`,M=!!a,N=!!a?.state.tools?.length;(0,A.useEffect)(()=>{W(e,a?.state.model)},[a?.state.model,e]),(0,A.useEffect)(()=>()=>a?.dispose(),[a]);let P=(0,A.useCallback)(async(n=t.trim())=>{p(void 0),v(!0);try{let t=await T(e,n);c(t.permission),u(t.title||t.share.titleSnapshot||`QuickForge 分享对话`);let r=await z.loadState(e);W(e,r.model),o(U(e,r))}catch(e){p(e instanceof Error?e.message:`Failed to unlock shared conversation`)}finally{v(!1)}},[t,e]);(0,A.useEffect)(()=>{if(M||m||D.current)return;D.current=!0;let t=window.setTimeout(()=>{(async()=>{try{(await x(e)).share.hasPassword||await P(``)}catch(e){p(e instanceof Error?e.message:`Failed to load shared conversation`)}})()},0);return()=>window.clearTimeout(t)},[m,e,P,M]);let F=(0,A.useCallback)(async e=>{await E(e)},[]),I=(0,A.useCallback)(async()=>{if(!(!a||a.permission!==`operate`))try{let t=(await H(e,a.state.model)).flatMap(e=>e.models??[]);if(!t.length)return;w(a.state.model,t,t=>{!t.reasoning&&a.state.thinkingLevel!==`off`&&a.updateThinkingLevel(`off`).catch(e=>{f.error(`Failed to update shared thinking level:`,e)}),W(e,t),a.updateModel(t).catch(e=>{p(e instanceof Error?e.message:`Failed to update model`)})},void 0,{thinkingLevel:a.state.thinkingLevel,onThinkingLevelSelect:e=>{a.updateThinkingLevel(e).catch(e=>{f.error(`Failed to update shared thinking level:`,e),p(e instanceof Error?e.message:`Failed to update thinking level`)})}})}catch(e){p(e instanceof Error?e.message:`Failed to load models`)}},[a,e]),L=(0,A.useCallback)(async e=>{if(!a||a.permission!==`operate`)return;if(p(void 0),a.state.isStreaming){C(g(`generationStillRunning`));return}let t=b(a.state.messages,e),n=t>=0?a.state.messages[t]:void 0;if(!n){C(g(`noConversationTurnToRollback`));return}try{await a.rollback(e),S({id:Date.now(),sessionId:a.sessionId,text:O(n),attachments:n.role===`user-with-attachments`?n.attachments:void 0})}catch(e){p(e instanceof Error?e.message:`Failed to roll back`)}},[a]);return M?(0,B.jsxs)(`div`,{className:`flex h-screen min-h-0 flex-col bg-background text-foreground`,children:[(0,B.jsx)(`header`,{className:h(`shrink-0 border-b px-4 py-3`,j?`border-red-300 bg-red-50 text-red-950`:`border-border bg-background`),children:(0,B.jsxs)(`div`,{className:`mx-auto flex max-w-4xl items-start gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:l}),(0,B.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs`,children:[(0,B.jsxs)(`span`,{className:h(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 font-medium`,j?`bg-red-100 text-red-700`:`bg-muted text-muted-foreground`),children:[j?(0,B.jsx)(n,{className:`size-3.5`}):null,j?`高危可操作`:`只读分享`]}),(0,B.jsx)(`span`,{className:h(j?`text-red-800`:`text-muted-foreground`),children:j?`正在操作分享者的原始对话`:`只能查看,不能发送或修改`})]}),j?null:(0,B.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:`界面与正常对话保持一致`})]}),(0,B.jsxs)(_,{variant:`ghost`,size:`sm`,className:h(`shrink-0`,j?`text-red-700 hover:bg-red-100 hover:text-red-800`:void 0),onClick:()=>void E(window.location.href),"aria-label":j?`复制高危分享链接`:`复制分享链接`,title:j?`复制高危分享链接`:`复制分享链接`,children:[(0,B.jsx)(r,{className:`size-4`}),(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:j?`复制高危链接`:`复制链接`})]})]})}),d?(0,B.jsx)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-2 text-sm text-destructive`,children:d}):null,(0,B.jsx)(k,{agent:a,revision:0,agentAccessMode:N?`full-access`:`default`,workspaceToolsEnabled:N,onModelSelect:I,onAccessModeChange:()=>void 0,onRollbackFromMessage:L,onRetryFromMessage:()=>void 0,onCopyAnswer:F,onForkFromMessage:()=>void 0,onApproveToolCall:()=>void 0,onRejectToolCall:()=>void 0,disableFork:!0,rollbackConfirmTitle:g(`sharedRollbackConfirmTitle`),rollbackConfirmDescription:g(`sharedRollbackConfirm`),readOnly:!j,restoredDraft:y,bypassClientApiKeyCheck:!0})]}):(0,B.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-6 text-foreground`,children:(0,B.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-border bg-background p-6 shadow-quickforge`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-base font-semibold`,children:[(0,B.jsx)(n,{className:`size-5 text-amber-500`}),`QuickForge 局域网对话分享`]}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`如果分享者设置了密码,请输入密码。未设置密码的链接会自动打开。`}),(0,B.jsx)(`input`,{type:`password`,value:t,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&P()},className:`mt-5 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-primary`,placeholder:`密码`,autoFocus:!0}),d?(0,B.jsx)(`div`,{className:`mt-3 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:d}):null,(0,B.jsx)(_,{className:`mt-5 w-full`,onClick:()=>void P(),disabled:m||!t.trim(),children:m?g(`loading`):`用密码打开分享对话`})]})})}export{G as SharedConversationPage};
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{Ct as t,F as n,P as r,_t as i,b as a,k as o,n as s,s as c}from"./icons-DJqt-rnw.js";import{n as l}from"./react-vendor-CZCcjpSR.js";import{F as u,I as d,P as f}from"./index-CcGy4TXo.js";import{n as p,t as m}from"./xterm-5XDrJ343.js";var h=e(t(),1);async function g(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 _(){return g(`/api/terminal/capabilities`)}function v(e){return g(`/api/terminal/sessions${e?`?projectId=${encodeURIComponent(e)}`:``}`)}function y(e){return g(`/api/terminal/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}function b(e){return g(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:`DELETE`})}function x(e,t){return g(`/api/terminal/sessions/${encodeURIComponent(e)}/input`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({data:t})})}function S(){return``}function C(){let e=S();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 w=l();function ee({session:e,active:t,height:n,onReady:r,onExited:i,onConnectionError:a}){let o=(0,h.useRef)(null),s=(0,h.useRef)(null),c=(0,h.useRef)(null),l=(0,h.useRef)(null),u=(0,h.useRef)(null),f=(0,h.useRef)(null);return(0,h.useEffect)(()=>{let t=o.current;if(!t)return;let n=!1,h=!1,g=!1,_=!1,v=t=>{n||g||_||(_=!0,a(e.id,t))},y=new p({cursorBlink:!0,convertEol:!1,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,fontSize:12,lineHeight:1.2,scrollback:5e3,theme:{background:`#ffffff`,foreground:`#1f2937`,cursor:`#1f2937`,selectionBackground:`#dbeafe`}}),b=new m;y.loadAddon(b),y.open(t),y.writeln(`\x1b[2mConnected to ${e.cwd}\x1b[0m`),s.current=y,c.current=b;let x=()=>{if(t.isConnected)try{b.fit();let{cols:e,rows:t}=y,n=l.current;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:`resize`,cols:e,rows:t}))}catch{}},S=new WebSocket(`${C()}/api/terminal/sessions/${encodeURIComponent(e.id)}/ws`);l.current=S,S.addEventListener(`open`,()=>{h=!0,_=!1,a(e.id,void 0),u.current=y.onData(e=>{S.readyState===WebSocket.OPEN&&S.send(JSON.stringify({type:`input`,data:e}))}),window.setTimeout(x,0)}),S.addEventListener(`message`,t=>{try{let n=JSON.parse(String(t.data));n.type===`ready`?r(e.id):n.type===`output`?y.write(n.data):n.type===`exit`?(g=!0,y.writeln(``),y.writeln(`\x1b[33m[process exited with code ${n.exitCode??`unknown`}]\x1b[0m`),i(e.id)):n.type===`error`&&y.writeln(`\x1b[31m${n.message}\x1b[0m`)}catch{}}),S.addEventListener(`error`,()=>{v(d(h?`terminalConnectionClosedUnexpectedly`:`terminalConnectionFailed`))}),S.addEventListener(`close`,e=>{u.current?.dispose(),u.current=null,!(n||g)&&(!e.wasClean||e.code!==1e3)&&v(d(h?`terminalConnectionClosedUnexpectedly`:`terminalConnectionFailed`))});let w=new ResizeObserver(()=>x());return w.observe(t),f.current=w,window.setTimeout(x,50),()=>{n=!0,w.disconnect(),f.current=null,u.current?.dispose(),u.current=null,S.close(),l.current=null,y.dispose(),s.current=null,c.current=null}},[a,i,r,e.cwd,e.id]),(0,h.useEffect)(()=>{if(!t)return;let e=c.current,n=s.current;window.setTimeout(()=>{try{e?.fit(),n?.focus()}catch{}},0)},[t,n]),(0,w.jsx)(`div`,{ref:o,className:t?`h-full min-h-0 w-full`:`hidden`,"aria-hidden":!t})}var te=180,ne=.7,re=320;function T(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 E(e,t){let n=e?.terminalShellProfiles||[],r=t||e?.defaultTerminalShellProfileId||``;return n.find(e=>e.id===r)||n[0]}function D({project:e,onCollapse:t,pendingCommand:l,onPendingCommandHandled:p}){let[m,g]=(0,h.useState)(null),[S,C]=(0,h.useState)([]),[D,O]=(0,h.useState)(),[k,ie]=(0,h.useState)(re),[A,j]=(0,h.useState)(!0),[M,ae]=(0,h.useState)(!1),[oe,N]=(0,h.useState)(),[se,P]=(0,h.useState)({}),[F,I]=(0,h.useState)(!1),[L,R]=(0,h.useState)(!1),z=(0,h.useRef)(!1),B=(0,h.useRef)(new Set),V=(0,h.useRef)(l),H=(0,h.useRef)(new Set),U=(0,h.useRef)(new Set),W=(0,h.useRef)(new Map),G=(0,h.useRef)(!0),[K,q]=(0,h.useState)(()=>new Set),J=(0,h.useRef)(null),Y=(0,h.useRef)(null),X=e?.id,Z=(0,h.useMemo)(()=>S.find(e=>e.id===D)??S[0],[D,S]);(0,h.useEffect)(()=>{V.current=l},[l]),(0,h.useEffect)(()=>()=>{G.current=!1},[]);let ce=(0,h.useCallback)(async()=>{let e=await v(X);return C(e.sessions),O(t=>t&&e.sessions.some(e=>e.id===t)?t:e.sessions[0]?.id),e.sessions},[X]),le=(0,h.useCallback)(async(e,t)=>{if(z.current)return;let n=E(m,t);z.current=!0,ae(!0),N(void 0),P({});try{let t=await y({projectId:X,name:T(e,n),cols:120,rows:30,shellProfileId:n?.id,shellProfileName:n?.name});C(e=>[...e,t]),O(t.id)}catch(e){N(e instanceof Error?e.message:d(`terminalCreateFailed`))}finally{z.current=!1,ae(!1)}},[m,X]);(0,h.useEffect)(()=>{let e=!1;return(async()=>{j(!0),N(void 0);try{let[t,n]=await Promise.all([_(),v(X)]);if(e)return;if(g(t),C(n.sessions),O(n.sessions[0]?.id),t.enabled&&n.sessions.length===0&&!V.current){let n=E(t);y({projectId:X,name:T([],n),cols:120,rows:30,shellProfileId:n?.id,shellProfileName:n?.name}).then(t=>{if(e){b(t.id).catch(()=>{});return}C([t]),O(t.id)}).catch(t=>{e||N(t instanceof Error?t.message:d(`terminalCreateFailed`))})}}catch(t){e||N(t instanceof Error?t.message:d(`terminalUnavailable`))}finally{e||j(!1)}})(),()=>{e=!0}},[X]),(0,h.useEffect)(()=>{if(!F)return;let e=e=>{Y.current?.contains(e.target)||I(!1)},t=e=>{e.key===`Escape`&&I(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[F]),(0,h.useEffect)(()=>{if(!L)return;let e=e=>{e.key===`Escape`&&R(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[L]),(0,h.useEffect)(()=>{if(!l||B.current.has(l.id)||W.current.has(l.id)||H.current.has(l.id)||A||M||!m)return;if(!m.enabled){B.current.add(l.id),window.setTimeout(()=>{N(m.reason||d(`terminalUnavailable`)),p?.(l.id)},0);return}let e=Z&&!Z.exited?Z:S.find(e=>!e.exited);if(e){W.current.set(l.id,e.id),window.setTimeout(()=>{G.current&&O(e.id)},0);return}H.current.add(l.id),window.setTimeout(()=>{G.current&&N(void 0)},0);let t=E(m);y({projectId:X,name:T(S,t),cols:120,rows:30,shellProfileId:t?.id,shellProfileName:t?.name}).then(e=>{if(!G.current){b(e.id).catch(()=>{});return}W.current.set(l.id,e.id),C(t=>t.some(t=>t.id===e.id)?t:[...t,e]),O(e.id)}).catch(e=>{G.current&&(N(e instanceof Error?e.message:d(`terminalCommandExecuteFailed`)),B.current.add(l.id),p?.(l.id))}).finally(()=>{H.current.delete(l.id)})},[Z,m,M,A,p,l,X,S]),(0,h.useEffect)(()=>{if(!l||B.current.has(l.id)||U.current.has(l.id))return;let e=W.current.get(l.id),t=e?S.find(t=>t.id===e):Z&&!Z.exited?Z:S.find(e=>!e.exited);!t||t.exited||!K.has(t.id)||(U.current.add(l.id),window.setTimeout(()=>{G.current&&(O(t.id),N(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 x(t.id,n.join(``))}else await x(t.id,l.command)}catch(e){G.current&&N(e instanceof Error?e.message:d(`terminalCommandExecuteFailed`))}finally{B.current.add(l.id),U.current.delete(l.id),W.current.delete(l.id),G.current&&p?.(l.id)}})())},[Z,p,l,K,S]);let ue=async e=>{N(void 0),P(t=>{if(!t[e])return t;let n={...t};return delete n[e],n});let t=S.filter(t=>t.id!==e);C(t),D===e&&O(t[0]?.id);try{await b(e)}catch(e){N(e instanceof Error?e.message:d(`terminalCloseFailed`)),ce().catch(()=>{})}},de=(0,h.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,h.useCallback)(e=>{q(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),pe=(0,h.useCallback)((e,t)=>{P(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:k},e.currentTarget.setPointerCapture(e.pointerId)},he=e=>{let t=J.current;if(!t)return;let n=Math.max(te,Math.floor(window.innerHeight*ne));ie(Math.min(n,Math.max(te,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&&S.length>=m.maxSessions),be=M||ye,xe=Z?se[Z.id]:void 0,$=oe??xe,Se=L?$?`calc(100% - 4.25rem)`:`calc(100% - 2.25rem)`:$?k-72:k-45;return(0,w.jsxs)(`div`,{className:u(`shrink-0 border-t border-border bg-background`,L&&`absolute inset-0 z-30 flex flex-col border-t-0`),style:L?void 0:{height:k},children:[L?null:(0,w.jsx)(`div`,{className:`h-1 cursor-row-resize bg-transparent hover:bg-border`,onPointerDown:me,onPointerMove:he,onPointerUp:ge,onPointerCancel:ge}),(0,w.jsxs)(`div`,{className:`flex h-9 items-center gap-1 border-b border-border px-2`,children:[(0,w.jsx)(c,{className:`size-4 shrink-0 text-muted-foreground/60`}),(0,w.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-x-auto`,children:S.map(e=>(0,w.jsxs)(`button`,{type:`button`,className:u(`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:()=>O(e.id),title:`${e.name} — ${e.cwd}`,children:[(0,w.jsx)(`span`,{className:u(`size-1.5 rounded-full`,e.exited?`bg-muted-foreground/40`:`bg-emerald-500/80`)}),(0,w.jsx)(`span`,{className:`truncate`,children:e.name}),(0,w.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":d(`terminalCloseSession`,{name:e.name}),children:(0,w.jsx)(s,{className:`size-3`})})]},e.id))}),(0,w.jsxs)(`div`,{className:`relative shrink-0`,ref:Y,children:[(0,w.jsxs)(`div`,{className:`flex items-center overflow-hidden rounded-md border border-border bg-background`,children:[(0,w.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(S),disabled:be,title:ve?d(`terminalNewWithProfile`,{name:ve.name}):d(`terminalNew`),"aria-label":d(`terminalNew`),children:M?(0,w.jsx)(n,{className:`size-3.5 animate-spin`}):(0,w.jsx)(a,{className:`size-3.5`})}),Q.length>0?(0,w.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:()=>I(e=>!e),disabled:be,title:d(`terminalSelectShell`),"aria-label":d(`terminalSelectShell`),"aria-expanded":F,children:(0,w.jsx)(i,{className:`size-3.5`})}):null]}),F?(0,w.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,w.jsx)(`div`,{className:`px-2 pb-1.5 pt-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60`,children:d(`terminalNewWith`)}),Q.map(e=>(0,w.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:()=>{I(!1),le(S,e.id)},children:[(0,w.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,w.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`span`,{className:`block truncate font-medium`,children:e.name}),(0,w.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground/55`,children:e.command})]})]},e.id))]}):null]}),(0,w.jsx)(f,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:()=>R(e=>!e),title:d(L?`terminalExitFullscreen`:`terminalFullscreen`),"aria-label":d(L?`terminalExitFullscreen`:`terminalFullscreen`),children:L?(0,w.jsx)(o,{className:`size-3.5`}):(0,w.jsx)(r,{className:`size-3.5`})}),(0,w.jsx)(f,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:t,title:d(`terminalCollapse`),"aria-label":d(`terminalCollapse`),children:(0,w.jsx)(i,{className:`size-3.5`})})]}),$?(0,w.jsx)(`div`,{className:`border-b border-border px-3 py-1.5 text-xs text-destructive`,children:$}):null,(0,w.jsx)(`div`,{className:`min-h-0 bg-background`,style:{height:Se},children:A?(0,w.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-xs text-muted-foreground/60`,children:[(0,w.jsx)(n,{className:`size-4 animate-spin`}),` `,d(`terminalStarting`)]}):m&&!m.enabled?(0,w.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-xs text-muted-foreground/60`,children:m.reason||d(`terminalUnavailable`)}):S.length===0?(0,w.jsx)(`div`,{className:`flex h-full items-center justify-center text-xs text-muted-foreground/60`,children:d(`terminalNoSessions`)}):S.map(e=>(0,w.jsx)(ee,{session:e,active:e.id===Z?.id,height:L?window.innerHeight-36:k,onReady:fe,onExited:de,onConnectionError:pe},e.id))})]})}export{D as TerminalDock};
@@ -0,0 +1,3 @@
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{$ as t,A as n,B as r,Ct as i,G as a,H as o,I as s,J as c,K as l,L as u,P as d,Q as f,R as p,St as m,U as h,W as g,X as _,Y as v,Z as ee,_t as y,at as te,et as b,g as ne,h as re,ht as ie,it as ae,k as oe,n as x,nt as S,o as C,ot as w,pt as se,q as T,rt as E,v as ce,vt as D}from"./icons-DJqt-rnw.js";import{n as O}from"./react-vendor-CZCcjpSR.js";import{F as k,I as A,P as j,a as le,c as ue,i as de,l as fe,n as pe,o as me,r as he,s as ge,t as M,u as _e}from"./index-CcGy4TXo.js";import{i as ve,n as N,r as ye,t as be}from"./diff-line-counts-CeZC7b0z.js";var P=e(i(),1),F=O();function I(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 L(e){let t=e.trim().replace(/\\/g,`/`);return t.startsWith(`/`)||/^[a-zA-Z]:\//.test(t)}function R(e,t){let n=e.trim();if(!t||!I(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 xe(e,t){let n=e.trim();if(!n)return{url:``,displayUrl:``,error:``};if(I(n)){let e=new URL(n,window.location.origin);return{url:`${e.pathname}${e.search}${e.hash}`,displayUrl:R(n,t),error:``}}if(t&&L(n))return{url:me(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 Se({url:e,onUrlChange:t,projectId:n}){let r=(0,P.useMemo)(()=>xe(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=xe(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)(j,{type:`submit`,variant:`outline`,size:`sm`,className:`h-8 shrink-0 px-3 text-xs`,children:A(`openPreview`)}),(0,F.jsx)(j,{variant:`ghost`,size:`icon`,onClick:m,disabled:!u,"aria-label":A(`refreshPreview`),title:A(`refreshPreview`),children:(0,F.jsx)(ce,{className:`size-4`})}),(0,F.jsx)(j,{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 z={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 B(e){let t=e.split(`/`).pop()?.toLowerCase()??``;return t===`dockerfile`||t.endsWith(`.dockerfile`)?`dockerfile`:z[t.includes(`.`)?t.split(`.`).pop()??``:t]??`plaintext`}function Ce(e){return e.slice(e.lastIndexOf(`/`)+1)}function V(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t+1):``}var H={typescript:{Icon:_,className:`text-sky-500 dark:text-sky-400`},javascript:{Icon:_,className:`text-amber-500 dark:text-amber-400`},python:{Icon:_,className:`text-blue-600 dark:text-blue-400`},go:{Icon:_,className:`text-cyan-600 dark:text-cyan-400`},rust:{Icon:_,className:`text-orange-600 dark:text-orange-400`},java:{Icon:_,className:`text-red-500 dark:text-red-400`},c:{Icon:_,className:`text-blue-500 dark:text-blue-400`},cpp:{Icon:_,className:`text-indigo-500 dark:text-indigo-400`},csharp:{Icon:_,className:`text-violet-500 dark:text-violet-400`},php:{Icon:_,className:`text-indigo-500 dark:text-indigo-400`},ruby:{Icon:_,className:`text-rose-500 dark:text-rose-400`},swift:{Icon:_,className:`text-orange-500 dark:text-orange-400`},kotlin:{Icon:_,className:`text-violet-500 dark:text-violet-400`},shell:{Icon:_,className:`text-green-600 dark:text-green-400`},powershell:{Icon:_,className:`text-blue-600 dark:text-blue-400`},json:{Icon:ee,className:`text-amber-600 dark:text-amber-400`},css:{Icon:u,className:`text-sky-500 dark:text-sky-400`},scss:{Icon:u,className:`text-pink-500 dark:text-pink-400`},less:{Icon:u,className:`text-sky-500 dark:text-sky-400`},html:{Icon:S,className:`text-orange-500 dark:text-orange-400`},markdown:{Icon:a,className:`text-slate-500 dark:text-slate-400`},yaml:{Icon:v,className:`text-slate-500 dark:text-slate-400`},toml:{Icon:v,className:`text-slate-500 dark:text-slate-400`},ini:{Icon:v,className:`text-slate-500 dark:text-slate-400`},xml:{Icon:_,className:`text-slate-500 dark:text-slate-400`},sql:{Icon:E,className:`text-indigo-500 dark:text-indigo-400`},dockerfile:{Icon:te,className:`text-sky-600 dark:text-sky-400`},plaintext:{Icon:a,className:`text-slate-500 dark:text-slate-400`}},U=new Set([`png`,`jpg`,`jpeg`,`gif`,`svg`,`ico`,`webp`,`bmp`,`avif`]),W=new Set([`zip`,`tar`,`gz`,`tgz`,`rar`,`7z`,`bz2`,`xz`]),G=new Set([`csv`,`tsv`,`xls`,`xlsx`]);function K(e){if(e===`readme`||e.startsWith(`readme.`))return{Icon:m,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:ne,className:`text-slate-500 dark:text-slate-400`};if(e===`makefile`||e.startsWith(`makefile.`))return{Icon:C,className:`text-slate-500 dark:text-slate-400`};if(e.startsWith(`docker-compose`))return{Icon:te,className:`text-sky-600 dark:text-sky-400`};if(e===`.gitignore`||e===`.gitattributes`||e===`.gitmodules`)return{Icon:ne,className:`text-orange-500 dark:text-orange-400`};if(e===`.env`||e.startsWith(`.env.`))return{Icon:v,className:`text-slate-500 dark:text-slate-400`};if(e.endsWith(`.lock`)||e.endsWith(`-lock.json`)||e.endsWith(`-lock.yaml`))return{Icon:T,className:`text-slate-500 dark:text-slate-400`}}function we(e){let t=Ce(e).toLowerCase(),n=K(t);if(n)return n;let r=V(t);return U.has(r)?{Icon:c,className:`text-purple-500 dark:text-purple-400`}:W.has(r)?{Icon:f,className:`text-slate-500 dark:text-slate-400`}:G.has(r)?{Icon:l,className:`text-green-600 dark:text-green-400`}:H[B(e)]||{Icon:g,className:`text-slate-500 dark:text-slate-400`}}function Te(e,t){let n=e.toLowerCase();return n===`.git`||n===`.svn`||n===`.hg`?{Icon:h,className:`text-orange-500 dark:text-orange-400`}:{Icon:t?o:r,className:`text-slate-500 dark:text-slate-400`}}function q({path:e,className:t=`size-3.5`}){let{Icon:n,className:r}=we(e);return(0,F.jsx)(n,{className:`${r} ${t}`})}function J({name:e,open:t,className:n=`size-3.5`}){let{Icon:r,className:i}=Te(e,t);return(0,F.jsx)(r,{className:`${i} ${n}`})}function Ee(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 De({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=Ee(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)(q,{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 Oe(e){return e?e.status===`added`?`A`:e.status===`deleted`?`D`:e.status===`renamed`?`R`:e.status===`untracked`?`U`:`M`:``}function ke({projectId:e,path:t}){let[n,r]=(0,P.useState)(!1);return n?(0,F.jsx)(q,{path:t,className:`size-3.5 shrink-0`}):(0,F.jsx)(`img`,{src:me(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 Ae({node:e,depth:n,selectedPath:r,gitStatuses:i,onSelectFile:a,onPreviewFile:o,projectId:s}){let[c,l]=(0,P.useState)(n<1),u=e.type===`directory`,d=r===e.path,f=Oe(i[e.path]),p=(u?void 0:pe(e.path))===`image`,m=!!s&&p,h=!!o&&(p||de(e.path));function g(){o?.(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 ${d?`bg-muted/28 text-foreground/90`:`text-muted-foreground/72 hover:bg-muted/20 hover:text-foreground/85`}`,style:{paddingLeft:`${.5+n*.75}rem`},onClick:()=>{u?l(e=>!e):p&&o?g():a(e.path)},title:e.path,children:[u?(0,F.jsx)(ie,{className:`size-3 shrink-0 transition-transform ${c?`rotate-90`:``}`}):(0,F.jsx)(`span`,{className:`w-3 shrink-0`}),u?(0,F.jsx)(J,{name:e.name,open:c,className:`size-3.5 shrink-0`}):m?(0,F.jsx)(ke,{projectId:s,path:e.path}):(0,F.jsx)(q,{path:e.path,className:`size-3.5 shrink-0`}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),f?(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[0.68rem] text-emerald-600 dark:text-emerald-500`,children:f}):null,h?(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(),g()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),g())},children:(0,F.jsx)(t,{className:`size-3.5`})}):null]}),u&&c?(0,F.jsx)(`div`,{children:(e.children??[]).map(e=>(0,F.jsx)(Ae,{node:e,depth:n+1,selectedPath:r,gitStatuses:i,onSelectFile:a,onPreviewFile:o,projectId:s},e.path))}):null]})}function je({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)(Ae,{node:e,depth:0,selectedPath:t,gitStatuses:n,onSelectFile:r,onPreviewFile:i,projectId:a},e.path))})}function Me(e,t){return e===`browser`?`browser`:`${e}:${t}`}var Ne=[{view:`overview`,label:A(`workspaceOverview`),icon:s},{view:`files`,label:A(`workspaceFiles`),icon:r},{view:`changes`,label:A(`workspaceChanges`),icon:p},{view:`browser`,label:A(`workspaceBrowser`),icon:S}],Y=380,X=480,Z=800,Pe=`quickforge_workspaceInspectorWidth`,Fe=140,Ie=200,Le=400;function Re(){if(typeof window>`u`)return X;try{let e=window.localStorage.getItem(Pe);if(!e)return X;let t=Number(e);return Number.isFinite(t)?Math.min(Z,Math.max(Y,t)):X}catch{return X}}function ze(e,t){let n=t.trim().toLowerCase();return n?e.flatMap(e=>{let t=e.children?ze(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 Be(e){return A(`workspaceReviewPrompt`,{list:e.map(e=>`- ${e.status}: ${e.oldPath?`${e.oldPath} -> `:``}${e.path}`).join(`
2
+ `)})}function Ve(e){return A(`workspaceCommitMessagePrompt`,{list:e.map(e=>`- ${e.status}: ${e.oldPath?`${e.oldPath} -> `:``}${e.path}`).join(`
3
+ `)})}function He(e,t){let n=[`${A(`workspaceCurrentBranch`)}: ${e||A(`unknown`)}`];return t?.total&&n.push(`${t.total} ${A(`workspaceChangeCount`)}`),n.join(` · `)}function Ue({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)(De,{files:t,selectedPath:n,onSelectFile:r})]})}function We({view:e,changesCount:t,open:n,onOpenChange:r,onViewChange:i}){let a=Ne.find(t=>t.view===e)??Ne[0],o=a.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:()=>r(!n),"aria-haspopup":`menu`,"aria-expanded":n,children:[(0,F.jsx)(o,{className:`size-4 shrink-0 text-foreground/75`}),(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:a.label}),(0,F.jsx)(y,{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:Ne.map(n=>{let a=n.icon,o=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`,o?`bg-muted/28 text-foreground/90`:`text-foreground/80 hover:bg-muted/20 hover:text-foreground/90`),onClick:()=>{i(n.view),r(!1)},children:[(0,F.jsx)(a,{className:`size-4 shrink-0`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[n.label,n.view===`changes`&&t?` ${t}`:``]}),o?(0,F.jsx)(D,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-500`}):null]},n.view)})}):null]})}function Q(e){return e?e.language===`markdown`||/\.(md|markdown)$/i.test(e.path):!1}function Ge(e,t=!1){return A(t?`readerFileMarkdownPrompt`:`readerFilePrompt`,{path:e})}function Ke(e){return A(`readerDiffPrompt`,{path:e})}function $(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 qe({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 i=e.id===t,a=e.mode===`browser`,o=a?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`,i?`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`,i?`bg-primary/10 text-primary`:`bg-muted/30 text-muted-foreground/60`),children:e.loading?(0,F.jsx)(d,{className:`size-2.5 animate-spin`}):a?(0,F.jsx)(S,{className:`size-2.5`}):c===`md`||c===`markdown`?(0,F.jsx)(s,{className:`size-2.5`}):(0,F.jsx)(_,{className:`size-2.5`})}),(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:o}),(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`,i&&`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 Je({mode:e,file:t,diff:r,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:r?.path,m=e===`file`&&Q(t),h=e===`file`?t?.content:r?$(r):void 0,g=e===`file`&&t?Ge(t.path,m):e===`diff`&&r?Ke(r.path):void 0,_=(0,P.useMemo)(()=>e===`diff`&&r?be(r.oldContent,r.newContent):void 0,[e,r]);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)(j,{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)(D,{className:`size-3.5`}):(0,F.jsx)(ae,{className:`size-3.5`})}),(0,F.jsx)(j,{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)(D,{className:`size-3.5`}):(0,F.jsx)(ae,{className:`size-3.5`})}),(0,F.jsx)(j,{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)(n,{className:`size-3.5`})}),(0,F.jsx)(j,{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)(ye,{path:t.path,content:t.content,language:t.language,mode:u},t.path):(0,F.jsx)(ve,{path:t.path,content:t.content,language:t.language}):null,!i&&!a&&e===`diff`&&r?(0,F.jsx)(N,{path:r.path,oldContent:r.oldContent,newContent:r.newContent,language:r.language,status:r.status}):null]})]})}function Ye({project:e,artifacts:n,changesCount:r,changedPaths:i,isGitRepository:a,gitBranch:o,onSelectFile:s,onSelectDiff:c,onPreviewFile:l}){let[u,d]=(0,P.useState)(!1),[f,p]=(0,P.useState)(()=>new Set),m=le(n),h=n.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-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:a?`${A(`workspaceCurrentBranch`)}: ${o||A(`unknown`)} · ${r} ${A(`workspaceChangeCount`)}`:A(`workspaceNotGitRepository`)})]}),(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)(w,{className:`size-3.5 text-emerald-600 dark:text-emerald-500`}),A(`workspaceCurrentArtifacts`)]}),n.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 n=e.path,r=he(n),a=i.has(n),o=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:()=>r?l(n):a?c(n):s(n),title:n,children:e.title||M(n)}),o?(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}),r?(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:()=>l(n),"aria-label":A(`previewArtifact`),title:A(`previewArtifact`),children:(0,F.jsx)(t,{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:()=>a?c(n):s(n),children:A(a?`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:()=>d(e=>!e),"aria-expanded":u,children:[(0,F.jsx)(y,{className:k(`size-3.5 transition-transform`,u?``:`-rotate-90`)}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[A(`workspaceCommands`),` `,h.length]})]}),u?(0,F.jsx)(`div`,{className:`space-y-1`,children:h.map((e,t)=>{let n=f.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)(y,{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]})]})]})}function Xe({project:e,open:t,view:r,onViewChange:i,onPreviewArtifact:a,onDraftRequest:o,focusTarget:s,previewUrl:c,onPreviewUrlChange:l,artifacts:u=[]}){let[f,p]=(0,P.useState)([]),[m,h]=(0,P.useState)([]),[g,_]=(0,P.useState)(),[v,ee]=(0,P.useState)(),[y,te]=(0,P.useState)(!1),[b,ne]=(0,P.useState)(!1),[ie,ae]=(0,P.useState)(),[x,S]=(0,P.useState)(``),[C,w]=(0,P.useState)([]),[T,E]=(0,P.useState)(),[ce,D]=(0,P.useState)(!1),[O,le]=(0,P.useState)(Ie),[de,pe]=(0,P.useState)(!1),[me,he]=(0,P.useState)(t),[M,ve]=(0,P.useState)(!1),[N,ye]=(0,P.useState)(Re),[be,I]=(0,P.useState)(!1),[L,R]=(0,P.useState)(!1),[xe,z]=(0,P.useState)(!1),B=(0,P.useRef)(null),Ce=(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),K=(0,P.useRef)(null),we=(0,P.useRef)(void 0),Te=(0,P.useRef)(void 0),q=e?.id,J=(0,P.useMemo)(()=>C.find(e=>e.id===T),[T,C]),Ee=J?.mode===`browser`,De=!!(J&&J.mode!==`browser`),Oe=r===`browser`?`files`:r,ke=J?.id,Ae=(0,P.useMemo)(()=>{let e={};for(let t of m)e[t.path]=t;return e},[m]),Ne=(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]),X=(0,P.useMemo)(()=>ze(f,x),[x,f]),Q=(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||(he(!0),window.requestAnimationFrame(()=>{e||ve(!0)}))}),()=>{e=!0}}let e=!1;queueMicrotask(()=>{e||ve(!1)});let n=window.setTimeout(()=>he(!1),180);return()=>{e=!0,window.clearTimeout(n)}},[t]),(0,P.useEffect)(()=>{if(!ce)return;let e=e=>{Ce.current?.contains(e.target)||D(!1)},t=e=>{e.key===`Escape`&&D(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[ce]),(0,P.useEffect)(()=>{let e=!1;return!t||!s||queueMicrotask(()=>{e||(i(s.tab===`git`?`changes`:`files`),s.filePath&&we.current?.(s.filePath))}),()=>{e=!0}},[s,i,t]),(0,P.useEffect)(()=>{if(!t)return;let e=C.find(e=>e.mode===`browser`);if(r===`browser`){if(!e){let e=Me(`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 J?.mode===`browser`&&E(C.find(e=>e.mode!==`browser`)?.id)},[r,t,T,J,C]),(0,P.useEffect)(()=>{try{window.localStorage.setItem(Pe,String(N))}catch{}},[N]);let Ge=(0,P.useCallback)(()=>{ye(e=>e<Z?Z:e)},[]);(0,P.useEffect)(()=>{!M||L||(r===`browser`||r!==`overview`&&ke)&&Ge()},[ke,r,M,L,Ge]),(0,P.useEffect)(()=>{let e=!1;if(!(!q||!t))return queueMicrotask(()=>{e||(ne(!0),ae(void 0),Promise.all([_e(q),ue(q)]).then(([t,n])=>{e||(p(t.tree),h(n.files),_(n.branch),ee(n.counts),te(n.isGitRepository))}).catch(t=>{e||ae(t instanceof Error?t.message:A(`workspaceLoadFailed`))}).finally(()=>{e||ne(!1)}))}),()=>{e=!0}},[t,q]),(0,P.useEffect)(()=>{let e=Te.current;Te.current=q,!(e===void 0||e===q)&&(w([]),E(void 0))},[q]);function Ke(e){if(a){a(e);return}$(e)}async function $(e){if(!q)return;i(`files`);let t=Me(`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 fe(q,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))}}we.current=$;function Xe(){let e=Me(`browser`,``);if(C.some(t=>t.id===e)){E(e),i(`browser`);return}let t={id:e,mode:`browser`,path:``,loading:!1};w(e=>[...e,t]),E(e),i(`browser`)}async function Ze(e,t){if(!q)return;t&&i(`changes`);let n=Me(`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 ge(q,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 Qe(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(e){await Ze(e,!0)}async function et(e){await Ze(e,!1)}function tt(e){U.current={startX:e.clientX,startWidth:N,currentWidth:N},K.current={cursor:document.body.style.cursor,userSelect:document.body.style.userSelect},document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,I(!0),e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}}function nt(e){let t=U.current,n=B.current;!t||!n||(t.currentWidth=Math.min(Z,Math.max(Y,t.startWidth+t.startX-e.clientX)),W.current===null&&(W.current=window.requestAnimationFrame(()=>{W.current=null;let e=U.current;!e||!B.current||(B.current.style.width=`${e.currentWidth}px`)})))}function rt(e){let t=U.current?.currentWidth;U.current=null,W.current!==null&&(window.cancelAnimationFrame(W.current),W.current=null),typeof t==`number`&&(B.current&&(B.current.style.width=`${t}px`),ye(t));let n=K.current;n&&(document.body.style.cursor=n.cursor,document.body.style.userSelect=n.userSelect,K.current=null),I(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}}function it(e){V.current={startX:e.clientX,startWidth:O,currentWidth:O},document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,pe(!0),e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}}function at(e){let t=V.current;t&&(t.currentWidth=Math.min(Le,Math.max(Fe,t.startWidth+e.clientX-t.startX)),H.current===null&&(H.current=window.requestAnimationFrame(()=>{H.current=null;let e=V.current;e&&le(e.currentWidth)})))}function ot(e){let t=V.current?.currentWidth;V.current=null,H.current!==null&&(window.cancelAnimationFrame(H.current),H.current=null),typeof t==`number`&&le(t),document.body.style.cursor=``,document.body.style.userSelect=``,pe(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}}let st=(0,P.useCallback)(()=>{let e=B.current;if(!e){R(e=>!e);return}G.current?.cancel();let t=e.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=`cubic-bezier(0.22, 1, 0.36, 1)`;if(z(!0),!L){window.requestAnimationFrame(()=>{let e=B.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 a=e.animate([{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`},{left:`0px`,top:`0px`,width:`${n}px`,height:`${r}px`}],{duration:240,easing:i,fill:`forwards`});G.current=a,a.onfinish=()=>{G.current=null,R(!0),window.requestAnimationFrame(()=>{a.cancel(),e.removeAttribute(`style`),window.requestAnimationFrame(()=>z(!1))})},a.oncancel=()=>{G.current=null,z(!1)}});return}window.requestAnimationFrame(()=>{let e=B.current;if(!e)return;Object.assign(e.style,{position:`fixed`,left:`0px`,top:`0px`,right:`auto`,bottom:`auto`,width:`${t.width}px`,height:`${t.height}px`,zIndex:`40`});let a=n-N,o=e.animate([{left:`0px`,top:`0px`,width:`${t.width}px`,height:`${t.height}px`},{left:`${a}px`,top:`0px`,width:`${N}px`,height:`${r}px`}],{duration:240,easing:i,fill:`forwards`});G.current=o,o.onfinish=()=>{G.current=null,R(!1),window.requestAnimationFrame(()=>{o.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=`${N}px`,e.style.minWidth=`${Y}px`,e.style.maxWidth=`${Z}px`,window.requestAnimationFrame(()=>z(!1))})},o.oncancel=()=>{G.current=null,z(!1)}})},[L,N]);return(0,P.useEffect)(()=>{if(!L)return;let e=e=>{e.key===`Escape`&&R(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[L]),(0,P.useEffect)(()=>()=>{W.current!==null&&window.cancelAnimationFrame(W.current),H.current!==null&&window.cancelAnimationFrame(H.current),G.current?.cancel(),B.current&&B.current.removeAttribute(`style`);let e=K.current;e&&(document.body.style.cursor=e.cursor,document.body.style.userSelect=e.userSelect)},[]),me?(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`aside`,{ref:B,className:k(`relative hidden shrink-0 overflow-hidden flex-col border-l border-border bg-background transition-[width,min-width,max-width,opacity,transform] duration-200 ease-out will-change-[width,opacity,transform] lg:flex`,M?`translate-x-0 opacity-100`:`w-0 min-w-0 max-w-0 translate-x-4 opacity-0`,be?`transition-none`:``,L?`fixed inset-0 z-40 border-l-0`:``),style:M?L?void 0:{width:N,minWidth:Y,maxWidth:Z}:void 0,children:[M&&!L?(0,F.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":Y,"aria-valuemax":Z,"aria-valuenow":N,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`,be?`bg-border/45`:``),onPointerDown:tt,onPointerMove:nt,onPointerUp:rt,onPointerCancel:rt,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`,be?`opacity-100`:`group-hover:opacity-100`),children:(0,F.jsx)(se,{className:`size-3`})})}):null,(0,F.jsxs)(`div`,{className:k(`flex h-14 shrink-0 items-center gap-2 border-b border-border bg-muted/20 px-3 pr-20 transition-opacity duration-150`,xe?`opacity-0`:`opacity-100`),children:[(0,F.jsx)(`div`,{ref:Ce,className:`shrink-0`,children:(0,F.jsx)(We,{view:r,changesCount:m.length,open:ce,onOpenChange:D,onViewChange:e=>{e===`browser`?Xe():i(e)}})}),(0,F.jsx)(`div`,{className:`h-5 w-px shrink-0 bg-border/60`}),(0,F.jsx)(qe,{tabs:C,activeId:T,onSelect:e=>{E(e),C.find(t=>t.id===e)?.mode===`browser`?r!==`browser`&&i(`browser`):r===`browser`&&i(`files`)},onClose:Qe}),(0,F.jsx)(j,{variant:`ghost`,size:`icon`,className:`shrink-0`,onClick:st,"aria-label":A(L?`workspaceExitFullscreen`:`workspaceFullscreen`),title:A(L?`workspaceExitFullscreen`:`workspaceFullscreen`),children:L?(0,F.jsx)(oe,{className:`size-4`}):(0,F.jsx)(d,{className:`size-4`})})]}),(0,F.jsx)(`div`,{className:k(`flex min-h-0 flex-1 transition-opacity duration-150`,xe?`opacity-0`:`opacity-100`),children:e?.id?Ee?(0,F.jsx)(Se,{url:c,onUrlChange:l,projectId:e.id}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:k(`flex min-h-0 flex-col bg-muted/20`,De?`shrink-0 border-r border-border`:`flex-1`),style:De?{width:O,minWidth:Fe,maxWidth:Le}:void 0,children:ie?(0,F.jsx)(`div`,{className:`p-4 text-sm text-destructive`,children:ie}):(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&&Oe===`overview`?(0,F.jsx)(Ye,{project:e,artifacts:u,changesCount:m.length,changedPaths:Ne,isGitRepository:y,gitBranch:g,onSelectFile:$,onSelectDiff:et,onPreviewFile:Ke}):null,!b&&Oe===`files`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`label`,{className:`mb-2 flex items-center gap-2 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)(re,{className:`size-3.5 shrink-0`}),(0,F.jsx)(`input`,{value:x,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)(je,{tree:X,selectedPath:void 0,gitStatuses:Ae,onSelectFile:$,onPreviewFile:Ke,projectId:q})]}):null,!b&&Oe===`changes`?y?(0,F.jsxs)(`div`,{className:`space-y-3`,children:[(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:He(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&&o?(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:()=>o(Be(m)),children:[(0,F.jsx)(n,{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:()=>o(Ve(m)),children:[(0,F.jsx)(n,{className:`size-3`}),A(`workspaceCommitMessage`)]})]}):null]}),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)(Ue,{title:A(`workspaceConflicts`),files:Q.conflicts,selectedPath:void 0,onSelectFile:$e}),(0,F.jsx)(Ue,{title:A(`workspaceStagedChanges`),files:Q.staged,selectedPath:void 0,onSelectFile:$e}),(0,F.jsx)(Ue,{title:A(`workspaceChanges`),files:Q.unstaged,selectedPath:void 0,onSelectFile:$e}),(0,F.jsx)(Ue,{title:A(`workspaceUntracked`),files:Q.untracked,selectedPath:void 0,onSelectFile:$e})]})]}):(0,F.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground/70`,children:A(`workspaceNotGitRepository`)}):null]})}),De?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":Fe,"aria-valuemax":Le,"aria-valuenow":O,className:k(`group relative z-10 w-1.5 shrink-0 cursor-col-resize bg-transparent transition-colors`,de?`bg-primary/30`:`hover:bg-border/60`),onPointerDown:it,onPointerMove:at,onPointerUp:ot,onPointerCancel:ot}),(0,F.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col bg-background`,children:J?(0,F.jsx)(Je,{mode:J.mode,file:J.file,diff:J.diff,loading:J.loading,error:J.error,onClose:()=>Qe(J.id),onDraftRequest:o}):null})]}):null]}):(0,F.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground/70`,children:A(`workspaceSelectProject`)})})]})}):null}export{Xe as WorkspaceInspector};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,St as n,_t as r,it as i,n as a}from"./icons-47L5YLKz.js";import{i as o,n as s}from"./react-vendor-DunfCFfp.js";import{N as c,j as l}from"./index-CqfScETb.js";import{i as u,n as d,r as f,t as p}from"./diff-line-counts-BZoYp5ai.js";var m=e(n(),1),h=o(),g=s();function _(e){return Number.isFinite(e)?e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`:``}function v(e){return e?e.status===`added`?c(`workspaceStatusAdded`):e.status===`deleted`?c(`workspaceStatusDeleted`):e.status===`renamed`?c(`workspaceStatusRenamed`):e.status===`untracked`?c(`workspaceStatusUntracked`):c(`workspaceStatusModified`):``}function y(e){return e?e.language===`markdown`||/\.(md|markdown)$/i.test(e.path):!1}function b(e,t=!1){return c(t?`readerFileMarkdownPrompt`:`readerFilePrompt`,{path:e})}function x(e){return c(`readerDiffPrompt`,{path:e})}function S(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 C({open:e,mode:n,file:o,diff:s,loading:C,error:w,onOpenChange:T,onDraftRequest:E}){let[D,O]=(0,m.useState)(),[k,A]=(0,m.useState)(`preview`);async function j(e,t){t&&(await navigator.clipboard.writeText(t),O(e),window.setTimeout(()=>O(void 0),1200))}(0,m.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&T(!1)};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[T,e]);let M=(0,m.useMemo)(()=>n===`diff`&&s?p(s.oldContent,s.newContent):void 0,[n,s]);if(!e)return null;let N=n===`file`?o?.path:s?.path,P=n===`file`&&y(o),F=n===`file`?o?.content:s?S(s):void 0,I=n===`file`&&o?b(o.path,P):n===`diff`&&s?x(s.path):void 0,L=n===`file`&&o?`${o.language} · ${_(o.size)}`:n===`diff`&&s?`${v(s)} · ${s.language}`:``;return(0,h.createPortal)((0,g.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/65 px-4 py-6 backdrop-blur-sm`,role:`dialog`,"aria-modal":`true`,children:[(0,g.jsx)(`button`,{type:`button`,className:`absolute inset-0 cursor-default`,"aria-label":c(`close`),onClick:()=>T(!1)}),(0,g.jsxs)(`div`,{className:`relative flex h-[min(88vh,900px)] w-[min(92vw,1280px)] min-w-0 flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,children:[(0,g.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 border-b border-border px-4`,children:[(0,g.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,g.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground/90`,children:N??(n===`file`?`Code reader`:`Diff reader`)}),L?(0,g.jsx)(`div`,{className:`truncate text-xs text-muted-foreground/65`,children:L}):null]}),P?(0,g.jsx)(`div`,{className:`inline-flex shrink-0 rounded-full bg-muted/25 p-1 text-xs`,children:[`preview`,`source`].map(e=>(0,g.jsx)(`button`,{type:`button`,className:e===k?`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:()=>A(e),children:c(e===`preview`?`markdownPreview`:`markdownSource`)},e))}):null,M?(0,g.jsxs)(`span`,{className:`shrink-0 font-mono text-xs font-medium`,children:[(0,g.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:[`+`,M.added]}),(0,g.jsxs)(`span`,{className:`ml-1.5 text-red-600 dark:text-red-400`,children:[`-`,M.removed]})]}):null,(0,g.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>void j(`path`,N),disabled:!N,"aria-label":c(`copyPath`),title:c(`copyPath`),children:D===`path`?(0,g.jsx)(r,{className:`size-4`}):(0,g.jsx)(i,{className:`size-4`})}),(0,g.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>void j(`content`,F),disabled:!F,"aria-label":c(`copyContent`),title:c(n===`file`?`copyContent`:`copyDiffContent`),children:D===`content`?(0,g.jsx)(r,{className:`size-4`}):(0,g.jsx)(i,{className:`size-4`})}),(0,g.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>I&&E?.(I),disabled:!I||!E,"aria-label":c(`askAiAboutThis`),title:c(`askAiAboutThis`),children:(0,g.jsx)(t,{className:`size-4`})}),(0,g.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>T(!1),"aria-label":c(`close`),title:c(`close`),children:(0,g.jsx)(a,{className:`size-4`})})]}),(0,g.jsxs)(`div`,{className:`min-h-0 flex-1 bg-background`,children:[C?(0,g.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground/70`,children:c(`openingReader`)}):null,!C&&w?(0,g.jsx)(`div`,{className:`p-4 text-sm text-destructive`,children:w}):null,!C&&!w&&n===`file`&&o?P?(0,g.jsx)(f,{path:o.path,content:o.content,language:o.language,mode:k},o.path):(0,g.jsx)(u,{path:o.path,content:o.content,language:o.language}):null,!C&&!w&&n===`diff`&&s?(0,g.jsx)(d,{path:s.path,oldContent:s.oldContent,newContent:s.newContent,language:s.language,status:s.status}):null]})]})]}),document.body)}export{C as WorkspaceReaderDialog};
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ct as n,it as r,n as i,vt as a}from"./icons-DJqt-rnw.js";import{i as o,n as s}from"./react-vendor-CZCcjpSR.js";import{I as c,P as l}from"./index-CcGy4TXo.js";import{i as u,n as d,r as f,t as p}from"./diff-line-counts-CeZC7b0z.js";var m=e(n(),1),h=o(),g=s();function _(e){return Number.isFinite(e)?e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`:``}function v(e){return e?e.status===`added`?c(`workspaceStatusAdded`):e.status===`deleted`?c(`workspaceStatusDeleted`):e.status===`renamed`?c(`workspaceStatusRenamed`):e.status===`untracked`?c(`workspaceStatusUntracked`):c(`workspaceStatusModified`):``}function y(e){return e?e.language===`markdown`||/\.(md|markdown)$/i.test(e.path):!1}function b(e,t=!1){return c(t?`readerFileMarkdownPrompt`:`readerFilePrompt`,{path:e})}function x(e){return c(`readerDiffPrompt`,{path:e})}function S(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 C({open:e,mode:n,file:o,diff:s,loading:C,error:w,onOpenChange:T,onDraftRequest:E}){let[D,O]=(0,m.useState)(),[k,A]=(0,m.useState)(`preview`);async function j(e,t){t&&(await navigator.clipboard.writeText(t),O(e),window.setTimeout(()=>O(void 0),1200))}(0,m.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&T(!1)};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[T,e]);let M=(0,m.useMemo)(()=>n===`diff`&&s?p(s.oldContent,s.newContent):void 0,[n,s]);if(!e)return null;let N=n===`file`?o?.path:s?.path,P=n===`file`&&y(o),F=n===`file`?o?.content:s?S(s):void 0,I=n===`file`&&o?b(o.path,P):n===`diff`&&s?x(s.path):void 0,L=n===`file`&&o?`${o.language} · ${_(o.size)}`:n===`diff`&&s?`${v(s)} · ${s.language}`:``;return(0,h.createPortal)((0,g.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/65 px-4 py-6 backdrop-blur-sm`,role:`dialog`,"aria-modal":`true`,children:[(0,g.jsx)(`button`,{type:`button`,className:`absolute inset-0 cursor-default`,"aria-label":c(`close`),onClick:()=>T(!1)}),(0,g.jsxs)(`div`,{className:`relative flex h-[min(88vh,900px)] w-[min(92vw,1280px)] min-w-0 flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,children:[(0,g.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 border-b border-border px-4`,children:[(0,g.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,g.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground/90`,children:N??(n===`file`?`Code reader`:`Diff reader`)}),L?(0,g.jsx)(`div`,{className:`truncate text-xs text-muted-foreground/65`,children:L}):null]}),P?(0,g.jsx)(`div`,{className:`inline-flex shrink-0 rounded-full bg-muted/25 p-1 text-xs`,children:[`preview`,`source`].map(e=>(0,g.jsx)(`button`,{type:`button`,className:e===k?`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:()=>A(e),children:c(e===`preview`?`markdownPreview`:`markdownSource`)},e))}):null,M?(0,g.jsxs)(`span`,{className:`shrink-0 font-mono text-xs font-medium`,children:[(0,g.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:[`+`,M.added]}),(0,g.jsxs)(`span`,{className:`ml-1.5 text-red-600 dark:text-red-400`,children:[`-`,M.removed]})]}):null,(0,g.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>void j(`path`,N),disabled:!N,"aria-label":c(`copyPath`),title:c(`copyPath`),children:D===`path`?(0,g.jsx)(a,{className:`size-4`}):(0,g.jsx)(r,{className:`size-4`})}),(0,g.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>void j(`content`,F),disabled:!F,"aria-label":c(`copyContent`),title:c(n===`file`?`copyContent`:`copyDiffContent`),children:D===`content`?(0,g.jsx)(a,{className:`size-4`}):(0,g.jsx)(r,{className:`size-4`})}),(0,g.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>I&&E?.(I),disabled:!I||!E,"aria-label":c(`askAiAboutThis`),title:c(`askAiAboutThis`),children:(0,g.jsx)(t,{className:`size-4`})}),(0,g.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>T(!1),"aria-label":c(`close`),title:c(`close`),children:(0,g.jsx)(i,{className:`size-4`})})]}),(0,g.jsxs)(`div`,{className:`min-h-0 flex-1 bg-background`,children:[C?(0,g.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground/70`,children:c(`openingReader`)}):null,!C&&w?(0,g.jsx)(`div`,{className:`p-4 text-sm text-destructive`,children:w}):null,!C&&!w&&n===`file`&&o?P?(0,g.jsx)(f,{path:o.path,content:o.content,language:o.language,mode:k},o.path):(0,g.jsx)(u,{path:o.path,content:o.content,language:o.language}):null,!C&&!w&&n===`diff`&&s?(0,g.jsx)(d,{path:s.path,oldContent:s.oldContent,newContent:s.newContent,language:s.language,status:s.status}):null]})]})]}),document.body)}export{C as WorkspaceReaderDialog};
@@ -0,0 +1,10 @@
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{Ct as t}from"./icons-DJqt-rnw.js";import{n}from"./react-vendor-CZCcjpSR.js";import{h as r}from"./index-CcGy4TXo.js";import{n as i,t as a}from"./monaco-CNEfYIy1.js";var o=e(t(),1);function s(){let[e,t]=(0,o.useState)(()=>r());return(0,o.useEffect)(()=>{if(typeof document>`u`)return;let e=document.documentElement,n=()=>t(r());n();let i=new MutationObserver(n);return i.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>i.disconnect()},[]),e}var c=n();function l({path:e,content:t,language:n}){return(0,c.jsx)(a,{value:t,language:n,theme:s()===`dark`?`vs-dark`:`vs`,options:{readOnly:!0,contextmenu:!1,automaticLayout:!0,minimap:{enabled:!1},fontSize:13,lineHeight:20,lineNumbers:`on`,scrollBeyondLastLine:!1,wordWrap:`off`,renderLineHighlight:`line`,folding:!1,glyphMargin:!1,scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8}}},e)}function u(e){let t=e.trim();if(t&&!/^(javascript|data|vbscript):/i.test(t)&&/^(https?:|mailto:|#|\/|\.\.?\/)/i.test(t))return t}function d(e,t){let n=[],r=/`([^`]+)`|\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|\*\*([^*]+)\*\*|__([^_]+)__|\*([^*\n]+)\*|_([^_\n]+)_/g,i=0,a=0,o;for(;o=r.exec(e);){o.index>i&&n.push(e.slice(i,o.index));let s=`${t}-inline-${a++}`;if(o[1])n.push((0,c.jsx)(`code`,{className:`rounded bg-muted/35 px-1 py-0.5 font-mono text-[0.85em] text-foreground/90`,children:o[1]},s));else if(o[2]&&o[3]){let e=u(o[3]);n.push(e?(0,c.jsx)(`a`,{className:`text-primary underline-offset-4 hover:underline`,href:e,target:e.startsWith(`http`)?`_blank`:void 0,rel:`noreferrer`,children:o[2]},s):`[${o[2]}](${o[3]})`)}else o[4]||o[5]?n.push((0,c.jsx)(`strong`,{className:`font-semibold text-foreground/95`,children:o[4]||o[5]},s)):(o[6]||o[7])&&n.push((0,c.jsx)(`em`,{className:`italic`,children:o[6]||o[7]},s));i=r.lastIndex}return i<e.length&&n.push(e.slice(i)),n.length?n:[e]}function f(e,t){return e.split(`
2
+ `).flatMap((e,n)=>{let r=d(e,`${t}-line-${n}`);return n===0?r:[(0,c.jsx)(`br`,{},`${t}-br-${n}`),...r]})}function p(e){return/^\s*(```|~~~)/.test(e)}function m(e){return/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(e)}function h(e,t){return!!(e[t]?.includes(`|`)&&e[t+1]&&m(e[t+1]))}function g(e,t){let n=e[t]??``;return p(n)||h(e,t)||/^\s{0,3}#{1,6}\s+/.test(n)||/^\s{0,3}([-*_])(?:\s*\1){2,}\s*$/.test(n)||/^\s{0,3}>\s?/.test(n)||/^\s{0,3}[-*+]\s+/.test(n)||/^\s{0,3}\d+[.)]\s+/.test(n)}function _(e){return e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim())}function v(e){let t=e.replace(/\r\n?/g,`
3
+ `).split(`
4
+ `),n=[],r=0,i=0;for(;r<t.length;){let e=t[r],a=`markdown-block-${i++}`;if(!e.trim()){r+=1;continue}if(p(e)){let i=e.match(/^\s*(```|~~~)\s*([^`]*)$/),o=i?.[1]??"```",s=i?.[2]?.trim(),l=[];for(r+=1;r<t.length&&!t[r].trimStart().startsWith(o);)l.push(t[r]),r+=1;r<t.length&&(r+=1),n.push((0,c.jsxs)(`figure`,{className:`my-5 overflow-hidden rounded-xl border border-border bg-muted/20`,children:[s?(0,c.jsx)(`figcaption`,{className:`border-b border-border px-3 py-1.5 font-mono text-[11px] text-muted-foreground/65`,children:s}):null,(0,c.jsx)(`pre`,{className:`overflow-auto p-4 text-[12px] leading-5`,children:(0,c.jsx)(`code`,{children:l.join(`
5
+ `)})})]},a));continue}let o=e.match(/^\s{0,3}(#{1,6})\s+(.+?)\s*#*\s*$/);if(o){let e=o[1].length,t=o[2],i=[`mt-8 mb-3 border-border text-foreground/95`,e===1?`border-b pb-3 text-3xl font-semibold tracking-tight`:``,e===2?`border-b pb-2 text-2xl font-semibold tracking-tight`:``,e===3?`text-xl font-semibold`:``,e===4?`text-lg font-semibold`:``,e>=5?`text-base font-semibold`:``].filter(Boolean).join(` `),s=d(t,`${a}-heading`);e===1?n.push((0,c.jsx)(`h1`,{className:i,children:s},a)):e===2?n.push((0,c.jsx)(`h2`,{className:i,children:s},a)):e===3?n.push((0,c.jsx)(`h3`,{className:i,children:s},a)):e===4?n.push((0,c.jsx)(`h4`,{className:i,children:s},a)):e===5?n.push((0,c.jsx)(`h5`,{className:i,children:s},a)):n.push((0,c.jsx)(`h6`,{className:i,children:s},a)),r+=1;continue}if(/^\s{0,3}([-*_])(?:\s*\1){2,}\s*$/.test(e)){n.push((0,c.jsx)(`hr`,{className:`my-6 border-border`},a)),r+=1;continue}if(h(t,r)){let e=_(t[r]);r+=2;let i=[];for(;r<t.length&&t[r].includes(`|`)&&t[r].trim();)i.push(_(t[r])),r+=1;n.push((0,c.jsx)(`div`,{className:`my-5 overflow-auto rounded-xl border border-border`,children:(0,c.jsxs)(`table`,{className:`w-full border-collapse text-left text-sm`,children:[(0,c.jsx)(`thead`,{className:`bg-muted/25 text-foreground/90`,children:(0,c.jsx)(`tr`,{children:e.map((e,t)=>(0,c.jsx)(`th`,{className:`border-b border-border px-3 py-2 font-semibold`,children:d(e,`${a}-th-${t}`)},`${a}-th-${t}`))})}),(0,c.jsx)(`tbody`,{children:i.map((t,n)=>(0,c.jsx)(`tr`,{className:`border-t border-border/70`,children:e.map((e,r)=>(0,c.jsx)(`td`,{className:`px-3 py-2 align-top text-foreground/85`,children:d(t[r]??``,`${a}-td-${n}-${r}`)},`${a}-td-${n}-${r}`))},`${a}-row-${n}`))})]})},a));continue}if(/^\s{0,3}>\s?/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}>\s?/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}>\s?/,``)),r+=1;n.push((0,c.jsx)(`blockquote`,{className:`my-4 border-l-2 border-border pl-4 text-muted-foreground/85`,children:f(e.join(`
6
+ `),`${a}-quote`)},a));continue}if(/^\s{0,3}[-*+]\s+/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}[-*+]\s+/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}[-*+]\s+/,``)),r+=1;n.push((0,c.jsx)(`ul`,{className:`my-4 list-disc space-y-1 pl-6`,children:e.map((e,t)=>(0,c.jsx)(`li`,{children:d(e,`${a}-li-${t}`)},`${a}-li-${t}`))},a));continue}if(/^\s{0,3}\d+[.)]\s+/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}\d+[.)]\s+/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}\d+[.)]\s+/,``)),r+=1;n.push((0,c.jsx)(`ol`,{className:`my-4 list-decimal space-y-1 pl-6`,children:e.map((e,t)=>(0,c.jsx)(`li`,{children:d(e,`${a}-li-${t}`)},`${a}-li-${t}`))},a));continue}let s=[];for(;r<t.length&&t[r].trim()&&!g(t,r);)s.push(t[r].trim()),r+=1;n.push((0,c.jsx)(`p`,{className:`my-4 text-foreground/86`,children:d(s.join(` `),`${a}-p`)},a))}return n}function y({path:e,content:t,language:n,mode:r}){let i=(0,o.useMemo)(()=>v(t),[t]);return(0,c.jsx)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,children:(0,c.jsx)(`div`,{className:`min-h-0 flex-1`,children:r===`source`?(0,c.jsx)(l,{path:e,content:t,language:n}):(0,c.jsx)(`div`,{className:`h-full overflow-auto bg-background`,children:(0,c.jsx)(`article`,{className:`quickforge-markdown-reader mx-auto max-w-3xl px-8 py-7 text-sm leading-7 text-foreground/88`,children:i.length?i:(0,c.jsx)(`p`,{className:`text-muted-foreground/70`,children:`This Markdown file is empty.`})})})})})}function b({path:e,oldContent:t,newContent:n,language:r,status:a}){return(0,c.jsx)(i,{original:t,modified:n,language:r,theme:s()===`dark`?`vs-dark`:`vs`,options:{readOnly:!0,contextmenu:!1,automaticLayout:!0,renderSideBySide:!0,minimap:{enabled:!1},fontSize:13,lineHeight:20,scrollBeyondLastLine:!1,ignoreTrimWhitespace:!1,folding:!1,glyphMargin:!1,scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8}}},`${a}:${e}`)}function x(e,t){let n=e.replace(/\r\n?/g,`
7
+ `).split(`
8
+ `),r=t.replace(/\r\n?/g,`
9
+ `).split(`
10
+ `),i=n.length,a=r.length;if(i*a>4e6)return;let o=Array(a+1).fill(0),s=Array(a+1).fill(0);for(let e=1;e<=i;e++){let t=n[e-1];for(let e=1;e<=a;e++)s[e]=t===r[e-1]?o[e-1]+1:Math.max(o[e],s[e-1]);let i=o;o=s,s=i}let c=o[a];return{added:a-c,removed:i-c}}export{l as i,b as n,y as r,x as t};
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./rolldown-runtime-DWdDZTNf.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),r=t(((e,t)=>{t.exports=n()})),i=e(r(),1),a=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),o=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),s=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),c=e=>{let t=s(e);return t.charAt(0).toUpperCase()+t.slice(1)},l={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},u=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},d=(0,i.createContext)({}),f=()=>(0,i.useContext)(d),p=(0,i.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:o=``,children:s,iconNode:c,...d},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=f()??{},y=r??g?Number(n??h)*24/Number(t??m):n??h;return(0,i.createElement)(`svg`,{ref:p,...l,width:t??m??l.width,height:t??m??l.height,stroke:e??_,strokeWidth:y,className:a(`lucide`,v,o),...!s&&!u(d)&&{"aria-hidden":`true`},...d},[...c.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(s)?s:[s]])}),m=(e,t)=>{let n=(0,i.forwardRef)(({className:n,...r},s)=>(0,i.createElement)(p,{ref:s,iconNode:t,className:a(`lucide-${o(c(e))}`,`lucide-${e}`,n),...r}));return n.displayName=c(e),n},h=m(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),g=m(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),_=m(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),v=m(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),y=m(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),b=m(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),x=m(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),S=m(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),C=m(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),w=m(`chevrons-left-right`,[[`path`,{d:`m9 7-5 5 5 5`,key:`j5w590`}],[`path`,{d:`m15 7 5 5-5 5`,key:`1bl6da`}]]),T=m(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),E=m(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),D=m(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),O=m(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),k=m(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),A=m(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),j=m(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),M=m(`container`,[[`path`,{d:`M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z`,key:`1t2lqe`}],[`path`,{d:`M10 21.9V14L2.1 9.1`,key:`o7czzq`}],[`path`,{d:`m10 14 11.9-6.9`,key:`zm5e20`}],[`path`,{d:`M14 19.8v-8.1`,key:`159ecu`}],[`path`,{d:`M18 17.5V9.4`,key:`11uown`}]]),N=m(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),P=m(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),F=m(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),I=m(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),L=m(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ee=m(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),te=m(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),R=m(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),z=m(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),B=m(`file-cog`,[[`path`,{d:`M15 8a1 1 0 0 1-1-1V2a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8z`,key:`1ckgky`}],[`path`,{d:`M20 8v12a2 2 0 0 1-2 2h-4.182`,key:`1726p0`}],[`path`,{d:`m3.305 19.53.923-.382`,key:`ao1pio`}],[`path`,{d:`M4 10.592V4a2 2 0 0 1 2-2h8`,key:`1foop0`}],[`path`,{d:`m4.228 16.852-.924-.383`,key:`1fv9zy`}],[`path`,{d:`m5.852 15.228-.383-.923`,key:`1a9hc2`}],[`path`,{d:`m5.852 20.772-.383.924`,key:`1sh9ke`}],[`path`,{d:`m8.148 15.228.383-.923`,key:`4yu6lf`}],[`path`,{d:`m8.53 21.696-.382-.924`,key:`18b0s9`}],[`path`,{d:`m9.773 16.852.922-.383`,key:`ti6xop`}],[`path`,{d:`m9.773 19.148.922.383`,key:`rws47d`}],[`circle`,{cx:`7`,cy:`18`,r:`3`,key:`lvkj7j`}]]),V=m(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),H=m(`file-lock`,[[`path`,{d:`M4 9.8V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3`,key:`1432pc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 17v-2a2 2 0 0 0-4 0v2`,key:`168m41`}],[`rect`,{width:`8`,height:`5`,x:`3`,y:`17`,rx:`1`,key:`o8vfew`}]]),U=m(`file-spreadsheet`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),W=m(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),G=m(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),K=m(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),q=m(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),J=m(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Y=m(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),X=m(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Z=m(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Q=m(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),ne=m(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),re=m(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ie=m(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ae=m(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),oe=m(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),se=m(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),ce=m(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),le=m(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),ue=m(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),de=m(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),fe=m(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),pe=m(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),me=m(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),he=m(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),ge=m(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),_e=m(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),ve=m(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ye=m(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),be=m(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),xe=m(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Se=m(`scroll`,[[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),Ce=m(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),we=m(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Te=m(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ee=m(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),De=m(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),$=m(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Oe=m(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),ke=m(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Ae=m(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),je=m(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Me=m(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ne=m(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Pe=m(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Fe=m(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ie=m(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);export{ee as $,ce as A,Y as B,he as C,r as Ct,de as D,fe as E,re as F,W as G,q as H,ne as I,V as J,U as K,Q as L,oe as M,ae as N,ue as O,ie as P,te as Q,Z as R,ge as S,h as St,pe as T,K as U,J as V,G as W,z as X,B as Y,R as Z,xe as _,b as _t,Me as a,M as at,ve as b,_ as bt,ke as c,k as ct,De as d,E as dt,L as et,Ee as f,T as ft,Se as g,x as gt,Ce as h,S as ht,Ne as i,N as it,se as j,le as k,Oe as l,O as lt,we as m,C as mt,Fe as n,F as nt,je as o,j as ot,Te as p,w as pt,H as q,Pe as r,P as rt,Ae as s,A as st,Ie as t,I as tt,$ as u,D as ut,be as v,y as vt,me as w,_e as x,g as xt,ye as y,v as yt,X as z};