adam-agent-server 1.7.0 → 1.8.0

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 (55) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +16 -13
  3. package/package.json +1 -1
  4. package/web/dist/assets/AlertDialog-B1zj0Qs3.js +51 -0
  5. package/web/dist/assets/{Button-DuQctNms.js → Button-BehrGSvy.js} +1 -1
  6. package/web/dist/assets/{Card-rKfViPS2.js → Card-B5E56u94.js} +1 -1
  7. package/web/dist/assets/ChannelDetail-BaSlX2yb.js +1 -0
  8. package/web/dist/assets/{Channels-dod8Q4oq.js → Channels-CLhgGEmS.js} +2 -2
  9. package/web/dist/assets/Chat-BZpf1DSF.js +2 -0
  10. package/web/dist/assets/{Dashboard-Dl0vA6Ky.js → Dashboard-HR4Qmdwg.js} +1 -1
  11. package/web/dist/assets/{EmptyState-CIdIlMbn.js → EmptyState-tTclFq_B.js} +1 -1
  12. package/web/dist/assets/EnvVarEditor-BzJNsDt0.js +1 -0
  13. package/web/dist/assets/EventDefDetail-CjoqsH0e.js +1 -0
  14. package/web/dist/assets/Events-IeznRpCj.js +1 -0
  15. package/web/dist/assets/Evolution-CUn8g34X.js +6 -0
  16. package/web/dist/assets/GoalDetail-DgPvXb6z.js +1 -0
  17. package/web/dist/assets/Goals-DYrggK-M.js +1 -0
  18. package/web/dist/assets/{Logs-6rf0KT0z.js → Logs-CvFC-GbD.js} +1 -1
  19. package/web/dist/assets/Memories-B5pvI6Oj.js +1 -0
  20. package/web/dist/assets/{PageHeader-CHSgtxPw.js → PageHeader-B2CgcZ-t.js} +1 -1
  21. package/web/dist/assets/Plugins-BuE7GImW.js +1 -0
  22. package/web/dist/assets/{RoleDetail-DJc4CWFN.js → RoleDetail-BBJxaZip.js} +2 -2
  23. package/web/dist/assets/{Roles-6pmjn04G.js → Roles-C5eVA6LM.js} +1 -1
  24. package/web/dist/assets/{SectionHeader-C2WpiwJ5.js → SectionHeader-CmXz6PM3.js} +1 -1
  25. package/web/dist/assets/Settings-BblOdOih.js +1 -0
  26. package/web/dist/assets/{Strategies-Bmke6qZo.js → Strategies-Ddb5HiUS.js} +1 -1
  27. package/web/dist/assets/{Switch-CfTpXW9_.js → Switch-yrTepsdl.js} +1 -1
  28. package/web/dist/assets/{Table-DuOLbyJQ.js → Table-CXAcZ8Ru.js} +1 -1
  29. package/web/dist/assets/TaskDetail-CHwHgfZq.js +2 -0
  30. package/web/dist/assets/Work-Corw0ITh.js +1 -0
  31. package/web/dist/assets/api-Bux34u4-.js +1 -0
  32. package/web/dist/assets/{dist-Bdqp1ixJ.js → dist-CgGno8kE.js} +1 -1
  33. package/web/dist/assets/index-B3_4_qY6.js +2 -0
  34. package/web/dist/assets/index-Cu5neZGw.css +2 -0
  35. package/web/dist/index.html +6 -5
  36. package/web/dist/assets/AlertDialog-CfeiyMrc.js +0 -51
  37. package/web/dist/assets/ChannelDetail-DnL0_h8q.js +0 -1
  38. package/web/dist/assets/Chat-Dv_Izjx3.js +0 -1
  39. package/web/dist/assets/EnvVarEditor-C-gErAzC.js +0 -1
  40. package/web/dist/assets/EventDefDetail-BhJZGNlX.js +0 -1
  41. package/web/dist/assets/Events-DnNZ9-BN.js +0 -1
  42. package/web/dist/assets/Evolution-BBWmrrnr.js +0 -6
  43. package/web/dist/assets/GoalDetail-uqWQCOj3.js +0 -1
  44. package/web/dist/assets/Goals-CylKmR9j.js +0 -1
  45. package/web/dist/assets/Memories-CrBTujU7.js +0 -1
  46. package/web/dist/assets/Plugins-VKUSUcSE.js +0 -1
  47. package/web/dist/assets/Settings-DW1jmrNj.js +0 -1
  48. package/web/dist/assets/TaskDetail-CwJ_UKgt.js +0 -2
  49. package/web/dist/assets/Work-DVdWNBEm.js +0 -1
  50. package/web/dist/assets/index-D4IubNPI.css +0 -2
  51. package/web/dist/assets/index-DYsO5Awn.js +0 -2
  52. /package/web/dist/assets/{NotFound-DitXhq_y.js → NotFound-D-OII_Lp.js} +0 -0
  53. /package/web/dist/assets/{format-CHfBBLog.js → format-BUYXZqDw.js} +0 -0
  54. /package/web/dist/assets/{ui-B_uMx2Fy.js → ui-CerQw0jA.js} +0 -0
  55. /package/web/dist/assets/{useIsMobileLayout-C6KIQjuh.js → useIsMobileLayout-dYzXP1EC.js} +0 -0
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{S as t,ct as n,n as r,y as i}from"./vendor-icons-Dk0hMuJz.js";import{r as a,t as o}from"./vendor-react-C6faO6LO.js";import{t as s}from"./Button-DuQctNms.js";import{i as c,r as l,t as u}from"./index-DYsO5Awn.js";import{t as d}from"./Card-rKfViPS2.js";import{t as f}from"./PageHeader-CHSgtxPw.js";import{t as p}from"./SectionHeader-C2WpiwJ5.js";import{a as m}from"./format-CHfBBLog.js";import{t as h}from"./EmptyState-CIdIlMbn.js";import{t as g}from"./useIsMobileLayout-C6KIQjuh.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./Table-DuOLbyJQ.js";var C=e(n(),1),w=o();function T(){let e=l(e=>e.roles),n=l(e=>e.fetchRoles),o=l(e=>e.createRole),[T,E]=(0,C.useState)(!1),[D,O]=(0,C.useState)(!1),[k,A]=(0,C.useState)(``),[j,M]=(0,C.useState)(``),[N,P]=(0,C.useState)(!1),[F,I]=(0,C.useState)(null),L=g(),R=(0,C.useCallback)(async()=>{E(!0),await n(),E(!1)},[n]),z=()=>{A(``),M(``),I(null),P(!1)},B=async()=>{let e=k.trim();if(!e){I(`Name is required.`);return}P(!0),I(null);try{await o({name:e,cagPrompt:j.trim()}),await n(),O(!1),z(),c.success(`Role created`)}catch(e){I(e instanceof Error?e.message:`Failed to create role`)}finally{P(!1)}};(0,C.useEffect)(()=>{R()},[R]);let V=e=>e===`active`?`success`:e===`inactive`?`secondary`:e===`retired`?`destructive`:e===`probation`?`warning`:`secondary`,H=e.filter(e=>e.status===`active`).length,U=e.filter(e=>e.status===`probation`).length,W=e.filter(e=>e.memoryStreamId).length;return(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsx)(f,{eyebrow:`Identities`,title:`Roles`,description:`Registry for role status, memory linkage, and edit actions.`,metrics:[{label:`Active`,value:H},{label:`Probation`,value:U},{label:`Linked Memory`,value:W}],compact:!0,actions:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>void R(),disabled:T,children:(0,w.jsx)(i,{size:14,className:T?`animate-spin`:``})}),(0,w.jsxs)(s,{size:`sm`,onClick:()=>O(!0),children:[(0,w.jsx)(t,{size:14}),`New Role`]})]})}),(0,w.jsx)(p,{title:`Registry`,description:`Open a role to inspect prompts, performance, and bindings.`,compact:!0,action:(0,w.jsxs)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[e.length,` role`,e.length===1?``:`s`]})}),e.length===0&&!T?(0,w.jsx)(d,{children:(0,w.jsx)(h,{title:`No roles yet`,description:`Create a role to define agent behavior and bind plugins.`})}):L?(0,w.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,w.jsxs)(d,{children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,w.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,w.jsx)(a,{to:`/roles/${e.id}`,className:`font-medium text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:e.name}),(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:m(e.createdAt)})]}),(0,w.jsx)(u,{variant:V(e.status),children:e.status})]}),(0,w.jsxs)(`div`,{className:`mt-4 grid gap-2 text-xs text-[var(--app-text-subtle)] sm:grid-cols-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Score`}),(0,w.jsx)(`div`,{className:`mt-1 font-mono text-[var(--app-text)]`,children:e.performanceScore==null?`—`:`${(e.performanceScore*100).toFixed(0)}%`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Memory`}),(0,w.jsx)(`div`,{className:`mt-1 text-[var(--app-text)]`,children:e.memoryStreamId?e.memoryStreamId.slice(0,8):`—`})]})]})]},e.id))}):(0,w.jsx)(d,{padding:!1,children:(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{children:`Name`}),(0,w.jsx)(v,{children:`Status`}),(0,w.jsx)(v,{children:`Score`}),(0,w.jsx)(v,{children:`Memories`}),(0,w.jsx)(v,{children:`Created`})]})}),(0,w.jsx)(y,{children:e.map(e=>(0,w.jsxs)(b,{children:[(0,w.jsx)(x,{children:(0,w.jsx)(a,{to:`/roles/${e.id}`,className:`font-medium text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:e.name})}),(0,w.jsx)(x,{children:(0,w.jsx)(u,{variant:V(e.status),children:e.status})}),(0,w.jsx)(x,{children:e.performanceScore==null?(0,w.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`—`}):(0,w.jsxs)(`span`,{className:`font-mono text-xs text-[var(--app-text)]`,children:[(e.performanceScore*100).toFixed(0),`%`]})}),(0,w.jsx)(x,{children:(0,w.jsx)(`span`,{className:`text-sm text-[var(--app-text-muted)]`,children:e.memoryStreamId?e.memoryStreamId.slice(0,8):`—`})}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-subtle)]`,children:m(e.createdAt)})]},e.id))})]})}),D&&(0,w.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60`,onClick:e=>{e.target===e.currentTarget&&(O(!1),z())},children:(0,w.jsxs)(`div`,{className:`w-full max-w-md rounded-lg border border-[var(--app-border)] bg-[var(--app-panel)] p-6 shadow-lg`,children:[(0,w.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,w.jsx)(`h2`,{className:`text-lg font-semibold text-[var(--app-text)]`,children:`Create Role`}),(0,w.jsx)(`button`,{className:`text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,onClick:()=>{O(!1),z()},children:(0,w.jsx)(r,{size:16})})]}),(0,w.jsxs)(`div`,{className:`space-y-4`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`label`,{className:`mb-1 block text-sm font-medium text-[var(--app-text)]`,htmlFor:`role-name`,children:[`Name `,(0,w.jsx)(`span`,{className:`text-[var(--app-danger)]`,children:`*`})]}),(0,w.jsx)(`input`,{id:`role-name`,className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-2 text-sm text-[var(--app-text)] placeholder-slate-500 focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`e.g. Engineer, Reviewer`,value:k,onChange:e=>A(e.target.value),onKeyDown:e=>{e.key===`Enter`&&B()},autoFocus:!0})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-[var(--app-text)]`,htmlFor:`role-cag-prompt`,children:`CAG Prompt`}),(0,w.jsx)(`textarea`,{id:`role-cag-prompt`,className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-2 text-sm text-[var(--app-text)] placeholder-slate-500 focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Character and Guidance prompt for this role...`,rows:5,value:j,onChange:e=>M(e.target.value)})]}),F&&(0,w.jsx)(`p`,{className:`text-sm text-[var(--app-danger)]`,children:F}),(0,w.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,w.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>{O(!1),z()},children:`Cancel`}),(0,w.jsx)(s,{size:`sm`,onClick:()=>void B(),disabled:N,children:N?`Creating...`:`Create`})]})]})]})})]})}export{T as Roles};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{S as t,ct as n,n as r,y as i}from"./vendor-icons-Dk0hMuJz.js";import{r as a,t as o}from"./vendor-react-C6faO6LO.js";import{t as s}from"./Button-BehrGSvy.js";import{i as c,r as l,t as u}from"./index-B3_4_qY6.js";import{t as d}from"./Card-B5E56u94.js";import{t as f}from"./PageHeader-B2CgcZ-t.js";import{t as p}from"./SectionHeader-CmXz6PM3.js";import{a as m}from"./format-BUYXZqDw.js";import{t as h}from"./EmptyState-tTclFq_B.js";import{t as g}from"./useIsMobileLayout-dYzXP1EC.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./Table-CXAcZ8Ru.js";var C=e(n(),1),w=o();function T(){let e=l(e=>e.roles),n=l(e=>e.fetchRoles),o=l(e=>e.createRole),[T,E]=(0,C.useState)(!1),[D,O]=(0,C.useState)(!1),[k,A]=(0,C.useState)(``),[j,M]=(0,C.useState)(``),[N,P]=(0,C.useState)(!1),[F,I]=(0,C.useState)(null),L=g(),R=(0,C.useCallback)(async()=>{E(!0),await n(),E(!1)},[n]),z=()=>{A(``),M(``),I(null),P(!1)},B=async()=>{let e=k.trim();if(!e){I(`Name is required.`);return}P(!0),I(null);try{await o({name:e,cagPrompt:j.trim()}),await n(),O(!1),z(),c.success(`Role created`)}catch(e){I(e instanceof Error?e.message:`Failed to create role`)}finally{P(!1)}};(0,C.useEffect)(()=>{R()},[R]);let V=e=>e===`active`?`success`:e===`inactive`?`secondary`:e===`retired`?`destructive`:e===`probation`?`warning`:`secondary`,H=e.filter(e=>e.status===`active`).length,U=e.filter(e=>e.status===`probation`).length,W=e.filter(e=>e.memoryStreamId).length;return(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsx)(f,{eyebrow:`Identities`,title:`Roles`,description:`Registry for role status, memory linkage, and edit actions.`,metrics:[{label:`Active`,value:H},{label:`Probation`,value:U},{label:`Linked Memory`,value:W}],compact:!0,actions:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>void R(),disabled:T,children:(0,w.jsx)(i,{size:14,className:T?`animate-spin`:``})}),(0,w.jsxs)(s,{size:`sm`,onClick:()=>O(!0),children:[(0,w.jsx)(t,{size:14}),`New Role`]})]})}),(0,w.jsx)(p,{title:`Registry`,description:`Open a role to inspect prompts, performance, and bindings.`,compact:!0,action:(0,w.jsxs)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[e.length,` role`,e.length===1?``:`s`]})}),e.length===0&&!T?(0,w.jsx)(d,{children:(0,w.jsx)(h,{title:`No roles yet`,description:`Create a role to define agent behavior and bind plugins.`})}):L?(0,w.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,w.jsxs)(d,{children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,w.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,w.jsx)(a,{to:`/roles/${e.id}`,className:`font-medium text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:e.name}),(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:m(e.createdAt)})]}),(0,w.jsx)(u,{variant:V(e.status),children:e.status})]}),(0,w.jsxs)(`div`,{className:`mt-4 grid gap-2 text-xs text-[var(--app-text-subtle)] sm:grid-cols-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Score`}),(0,w.jsx)(`div`,{className:`mt-1 font-mono text-[var(--app-text)]`,children:e.performanceScore==null?`—`:`${(e.performanceScore*100).toFixed(0)}%`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Memory`}),(0,w.jsx)(`div`,{className:`mt-1 text-[var(--app-text)]`,children:e.memoryStreamId?e.memoryStreamId.slice(0,8):`—`})]})]})]},e.id))}):(0,w.jsx)(d,{padding:!1,children:(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{children:`Name`}),(0,w.jsx)(v,{children:`Status`}),(0,w.jsx)(v,{children:`Score`}),(0,w.jsx)(v,{children:`Memories`}),(0,w.jsx)(v,{children:`Created`})]})}),(0,w.jsx)(y,{children:e.map(e=>(0,w.jsxs)(b,{children:[(0,w.jsx)(x,{children:(0,w.jsx)(a,{to:`/roles/${e.id}`,className:`font-medium text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:e.name})}),(0,w.jsx)(x,{children:(0,w.jsx)(u,{variant:V(e.status),children:e.status})}),(0,w.jsx)(x,{children:e.performanceScore==null?(0,w.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`—`}):(0,w.jsxs)(`span`,{className:`font-mono text-xs text-[var(--app-text)]`,children:[(e.performanceScore*100).toFixed(0),`%`]})}),(0,w.jsx)(x,{children:(0,w.jsx)(`span`,{className:`text-sm text-[var(--app-text-muted)]`,children:e.memoryStreamId?e.memoryStreamId.slice(0,8):`—`})}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-subtle)]`,children:m(e.createdAt)})]},e.id))})]})}),D&&(0,w.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60`,onClick:e=>{e.target===e.currentTarget&&(O(!1),z())},children:(0,w.jsxs)(`div`,{className:`w-full max-w-md rounded-lg border border-[var(--app-border)] bg-[var(--app-panel)] p-6 shadow-lg`,children:[(0,w.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,w.jsx)(`h2`,{className:`text-lg font-semibold text-[var(--app-text)]`,children:`Create Role`}),(0,w.jsx)(`button`,{className:`text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,onClick:()=>{O(!1),z()},children:(0,w.jsx)(r,{size:16})})]}),(0,w.jsxs)(`div`,{className:`space-y-4`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`label`,{className:`mb-1 block text-sm font-medium text-[var(--app-text)]`,htmlFor:`role-name`,children:[`Name `,(0,w.jsx)(`span`,{className:`text-[var(--app-danger)]`,children:`*`})]}),(0,w.jsx)(`input`,{id:`role-name`,className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-2 text-sm text-[var(--app-text)] placeholder-slate-500 focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`e.g. Engineer, Reviewer`,value:k,onChange:e=>A(e.target.value),onKeyDown:e=>{e.key===`Enter`&&B()},autoFocus:!0})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{className:`mb-1 block text-sm font-medium text-[var(--app-text)]`,htmlFor:`role-cag-prompt`,children:`CAG Prompt`}),(0,w.jsx)(`textarea`,{id:`role-cag-prompt`,className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-2 text-sm text-[var(--app-text)] placeholder-slate-500 focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Character and Guidance prompt for this role...`,rows:5,value:j,onChange:e=>M(e.target.value)})]}),F&&(0,w.jsx)(`p`,{className:`text-sm text-[var(--app-danger)]`,children:F}),(0,w.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,w.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>{O(!1),z()},children:`Cancel`}),(0,w.jsx)(s,{size:`sm`,onClick:()=>void B(),disabled:N,children:N?`Creating...`:`Create`})]})]})]})})]})}export{T as Roles};
@@ -1 +1 @@
1
- import{t as e}from"./vendor-react-C6faO6LO.js";import{i as t}from"./dist-Bdqp1ixJ.js";var n=e();function r({title:e,description:r,action:i,compact:a=!1,className:o}){return(0,n.jsxs)(`div`,{className:t(`flex flex-col sm:flex-row sm:justify-between`,a?`gap-2 sm:items-start`:`gap-3 sm:items-end`,o),children:[(0,n.jsxs)(`div`,{className:t(a?`space-y-0.5`:`space-y-1`),children:[(0,n.jsx)(`p`,{className:`text-section-label`,children:e}),r?(0,n.jsx)(`p`,{className:t(`text-sm text-[var(--app-text-muted)]`,a?`leading-5`:`leading-6`),children:r}):null]}),i?(0,n.jsx)(`div`,{className:`flex items-center gap-2`,children:i}):null]})}export{r as t};
1
+ import{t as e}from"./vendor-react-C6faO6LO.js";import{n as t}from"./dist-CgGno8kE.js";var n=e();function r({title:e,description:r,action:i,compact:a=!1,className:o}){return(0,n.jsxs)(`div`,{className:t(`flex flex-col sm:flex-row sm:justify-between`,a?`gap-2 sm:items-start`:`gap-3 sm:items-end`,o),children:[(0,n.jsxs)(`div`,{className:t(a?`space-y-0.5`:`space-y-1`),children:[(0,n.jsx)(`p`,{className:`text-section-label`,children:e}),r?(0,n.jsx)(`p`,{className:t(`text-sm text-[var(--app-text-muted)]`,a?`leading-5`:`leading-6`),children:r}):null]}),i?(0,n.jsx)(`div`,{className:`flex items-center gap-2`,children:i}):null]})}export{r as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{_ as t,ct as n,j as r,m as i,n as a,y as o}from"./vendor-icons-Dk0hMuJz.js";import{l as s,t as c}from"./vendor-react-C6faO6LO.js";import{a as l,c as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./AlertDialog-B1zj0Qs3.js";import{t as _}from"./Button-BehrGSvy.js";import{a as v,c as y,o as b,r as x,s as S,t as C}from"./api-Bux34u4-.js";import{r as w}from"./index-B3_4_qY6.js";import{t as T}from"./Card-B5E56u94.js";import{t as E}from"./PageHeader-B2CgcZ-t.js";import{t as D}from"./SectionHeader-CmXz6PM3.js";import{i as O}from"./format-BUYXZqDw.js";import{t as k}from"./EmptyState-tTclFq_B.js";import{t as A}from"./ui-CerQw0jA.js";import{t as j}from"./EnvVarEditor-BzJNsDt0.js";var M=e(n(),1),N=c(),P={anthropic:{label:`Anthropic`,paths:[`anthropic.apiKey`,`anthropic.baseUrl`,`anthropic.model`,`anthropic.defaultOpusModel`,`anthropic.defaultSonnetModel`,`anthropic.defaultHaikuModel`,`anthropic.smallFastModel`]},defaults:{label:`Defaults`,paths:[`defaults.model`,`defaults.effort`,`defaults.maxTurns`,`defaults.maxBudgetUsd`,`defaults.timeout`,`defaults.approvalTimeout`]},server:{label:`Server`,paths:[`server.port`,`server.host`],mutablePaths:[`server.timezone`]},logging:{label:`Logging`,paths:[`logging.level`]},evolution:{label:`Evolution`,paths:[`roles.evolution.triggerEvery`,`roles.evolution.reflectionThreshold`]},chat:{label:`Chat`,paths:[`chat.sessionTimeoutMinutes`,`chat.maxSessionTurns`,`chat.autoTitle`,`chat.archiveExtractMemory`]},workflow:{label:`Workflow`,paths:[`watchdog.rules.artifactCleanup.enabled`,`watchdog.rules.artifactCleanup.ttlDays`,`watchdog.rules.artifactCleanup.orphanGcMinAgeHours`]}},F={anthropic:`Model endpoints and provider-specific defaults.`,defaults:`Global execution defaults applied when a role does not override them.`,server:`Network surface and host-level configuration.`,logging:`Verbosity and runtime observability controls.`,evolution:`Thresholds that govern role adaptation over time.`,chat:`Session lifecycle and archive behavior for chat mode.`,workflow:`Cleanup rules and artifact retention for background work.`},I=[`defaults.deniedReadPaths`,`defaults.approvalRequired`],L=new Set([`anthropic.apiKey`,`server.apiKey`]),R={"anthropic.apiKey":`API Key`,"anthropic.baseUrl":`Base URL`,"anthropic.model":`Model`,"anthropic.defaultOpusModel":`Default Opus Model`,"anthropic.defaultSonnetModel":`Default Sonnet Model`,"anthropic.defaultHaikuModel":`Default Haiku Model`,"anthropic.smallFastModel":`Small Fast Model`,"defaults.model":`Default Model`,"defaults.effort":`Effort Level`,"defaults.maxTurns":`Max Turns`,"defaults.maxBudgetUsd":`Max Budget (USD)`,"defaults.timeout":`Timeout (seconds)`,"defaults.approvalTimeout":`Approval Timeout (seconds)`,"server.port":`Port`,"server.host":`Host`,"server.apiKey":`API Key (server auth)`,"server.timezone":`Timezone`,"logging.level":`Log Level`,"roles.evolution.triggerEvery":`Evolution Trigger Every (tasks)`,"roles.evolution.reflectionThreshold":`Reflection Threshold (tokens)`,"chat.sessionTimeoutMinutes":`Session Timeout (minutes)`,"chat.maxSessionTurns":`Max Session Turns`,"chat.autoTitle":`Auto-generate Session Title`,"chat.archiveExtractMemory":`Extract Memory on Archive`,"watchdog.rules.artifactCleanup.enabled":`Workflow Artifact Cleanup Enabled`,"watchdog.rules.artifactCleanup.ttlDays":`Artifact Retention (days)`,"watchdog.rules.artifactCleanup.orphanGcMinAgeHours":`Orphan File GC Min Age (hours)`},z={"defaults.effort":[`low`,`medium`,`high`,`max`],"logging.level":[`debug`,`info`,`warn`,`error`],"server.timezone":[`system`,`Asia/Shanghai`,`Asia/Tokyo`,`Asia/Singapore`,`America/New_York`,`America/Los_Angeles`,`America/Chicago`,`Europe/London`,`Europe/Berlin`,`Europe/Paris`,`UTC`]};function B(){let[e,n]=(0,M.useState)({}),[a,c]=(0,M.useState)([]),[v,y]=(0,M.useState)({}),[b,x]=(0,M.useState)(new Set),[S,A]=(0,M.useState)(!1),[B,U]=(0,M.useState)(null),[ee,te]=(0,M.useState)(!0),[W,G]=(0,M.useState)(null),[K,q]=(0,M.useState)({}),[J,Y]=(0,M.useState)(new Set),[ne,re]=(0,M.useState)({}),X=w(e=>e.configVersion);(0,M.useEffect)(()=>{if(b.size===0)return;let e=e=>{e.preventDefault()};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[b.size]);let Z=s(({currentLocation:e,nextLocation:t})=>b.size>0&&e.pathname!==t.pathname),Q=(0,M.useCallback)(async()=>{try{let e=await C(`/config`);n(e.config),c(e.mutable);let t={};for(let[n,r]of Object.entries(e.config))t[n]=String(r.value??``);y(t),x(new Set);let r=e.config[`server.timezone`]?.value;r&&O(r);let i={};for(let t of I){let n=e.config[t];n&&(i[t]=Array.isArray(n.value)?n.value:[])}q(i),Y(new Set),G(await C(`/config/env-diff`)),re((await C(`/config/env`)).env)}catch(e){U({type:`error`,text:e instanceof Error?e.message:`Failed to load config`})}finally{te(!1)}},[]);(0,M.useEffect)(()=>{Q()},[Q]),(0,M.useEffect)(()=>{X>0&&Q()},[X,Q]);let ie=async()=>{await C(`/config/sync-to-env`,{method:`POST`}),U({type:`success`,text:`Synced DB values to .env`}),G(null)},ae=async()=>{await C(`/config/load-from-env`,{method:`POST`}),U({type:`success`,text:`Loaded .env values to DB`}),Q()},$=(e,t)=>{y(n=>({...n,[e]:t})),x(t=>new Set(t).add(e)),U(null)},oe=async()=>{if(b.size!==0){A(!0),U(null);try{let t={};for(let n of b){let r=e[n],i=v[n];if(r&&typeof r.value==`number`&&(i=Number(i),isNaN(i))){U({type:`error`,text:`"${R[n]??n}" must be a number`}),A(!1);return}t[n]=i}let n=await C(`/config`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,...Object.fromEntries(Array.from(J).map(e=>[e,K[e]??[]]))})});if(n.updated.length>0&&(U({type:`success`,text:`Updated ${n.updated.length} setting(s)`}),n.updated.includes(`server.timezone`))){let e=v[`server.timezone`];O(e)}n.errors.length>0&&U({type:`error`,text:n.errors.join(`; `)}),x(new Set),Q()}catch(e){U({type:`error`,text:e instanceof Error?e.message:`Save failed`})}finally{A(!1)}}};return ee?(0,N.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,N.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-[var(--app-border)] border-t-[var(--app-accent)]`})}):Object.keys(e).length===0?(0,N.jsx)(k,{icon:(0,N.jsx)(i,{size:32}),title:`No configuration`,description:`Config API not available`}):(0,N.jsxs)(`div`,{className:`space-y-5`,children:[(0,N.jsx)(E,{eyebrow:`Configuration`,title:`Settings`,compact:!0,description:`Mutable fields, pending edits, and environment drift.`,metrics:[{label:`Editable`,value:a.length},{label:`Pending`,value:b.size+J.size},{label:`Env Drift`,value:W?.diffs.length??0}],actions:(0,N.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,N.jsx)(_,{variant:`ghost`,size:`sm`,onClick:()=>void Q(),children:(0,N.jsx)(o,{size:14})}),b.size>0&&(0,N.jsxs)(_,{size:`sm`,onClick:()=>void oe(),disabled:S,children:[(0,N.jsx)(t,{size:14}),S?`Saving...`:`Save (${b.size})`]})]})}),(0,N.jsx)(D,{title:`Configuration Groups`,compact:!0,description:`Fields stay in place while changeable, restart-required, and pending state are clarified.`}),B&&(0,N.jsx)(`div`,{className:`rounded-lg border px-4 py-3 text-sm ${B.type===`success`?`border-[var(--app-success-soft-border)] bg-[var(--app-success-soft-bg)] text-[var(--app-success-soft-text)]`:`border-[var(--app-danger-soft-border)] bg-[var(--app-danger-soft-bg)] text-[var(--app-danger-soft-text)]`}`,children:B.text}),W&&W.diffs.length>0&&(0,N.jsx)(T,{className:`surface-accent`,children:(0,N.jsxs)(`div`,{className:`flex flex-col gap-3 md:flex-row md:items-start md:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`p`,{className:`text-sm font-medium text-[var(--app-text)]`,children:[`.env and DB have `,W.diffs.length,` different value(s)`]}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-[var(--app-text-muted)]`,children:W.diffs.map(e=>e.envKey).join(`, `)})]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap gap-2 md:justify-end`,children:[(0,N.jsx)(_,{variant:`ghost`,size:`sm`,onClick:ie,children:`Sync DB → .env`}),(0,N.jsx)(_,{variant:`ghost`,size:`sm`,onClick:ae,children:`Load .env → DB`})]})]})}),Object.entries(P).map(([t,{label:n,paths:i,mutablePaths:o}])=>{let s=[...i,...o??[]],c=s.filter(e=>a.includes(e)).length;return(0,N.jsxs)(T,{children:[(0,N.jsxs)(`div`,{className:`mb-4 flex items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{className:`text-sm font-medium text-[var(--app-text)]`,children:n}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-[var(--app-text-muted)]`,children:F[t]??`Configuration values for this system area.`})]}),(0,N.jsxs)(`div`,{className:`rounded-full border border-[var(--app-border)] bg-black/10 px-3 py-1.5 text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:[c,`/`,s.length,` editable`]})]}),(0,N.jsx)(`div`,{className:`space-y-3`,children:s.map(t=>{let n=e[t];if(!n)return null;let i=a.includes(t),o=R[t]??t,s=v[t]??String(n.value??``),c=b.has(t),l=z[t];return(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-[var(--app-border)] bg-black/10 px-3 py-3 md:flex-row md:items-center md:gap-3`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 md:w-56 md:shrink-0`,children:[!i&&(0,N.jsx)(r,{size:12,className:`text-[var(--app-text-subtle)]`}),(0,N.jsx)(`label`,{className:`text-sm text-[var(--app-text-muted)]`,children:o}),!i&&(0,N.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`restart required`})]}),(0,N.jsx)(`div`,{className:`min-w-0 flex-1`,children:l?(0,N.jsx)(`select`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none disabled:opacity-50`,value:s,onChange:e=>$(t,e.target.value),disabled:!i,children:l.map(e=>(0,N.jsx)(`option`,{value:e,children:e},e))}):(0,N.jsx)(`input`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none disabled:opacity-50`,type:L.has(t)?`password`:`text`,value:s,onChange:e=>$(t,e.target.value),disabled:!i,placeholder:L.has(t)?`Enter to update`:void 0})}),(0,N.jsx)(`div`,{className:`text-left md:w-16 md:text-right`,children:c&&i&&(0,N.jsx)(`span`,{className:`text-[10px] text-[var(--app-warning)]`,children:`modified`})})]},t)})})]},t)}),(0,N.jsx)(j,{envVars:ne,onSave:()=>void Q(),mode:`global`,title:`Environment Variables`}),(0,N.jsx)(H,{}),(0,N.jsx)(V,{mutablePaths:a,listValues:K,listDirty:J,setListValues:q,setListDirty:e=>Y(e),dirty:b}),(0,N.jsx)(g,{open:Z.state===`blocked`,children:(0,N.jsxs)(d,{children:[(0,N.jsxs)(h,{children:[(0,N.jsx)(u,{children:`Unsaved Changes`}),(0,N.jsxs)(l,{children:[`You have `,b.size+J.size,` unsaved change(s). Discard and leave?`]})]}),(0,N.jsxs)(p,{children:[(0,N.jsx)(m,{onClick:()=>Z.reset?.(),children:`Stay`}),(0,N.jsx)(f,{onClick:()=>Z.proceed?.(),children:`Discard`})]})]})})]})}function V({mutablePaths:e,listValues:t,listDirty:n,setListValues:i,setListDirty:o,dirty:s}){let[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(``),f=e.includes(`defaults.deniedReadPaths`),p=e.includes(`defaults.approvalRequired`),m=t[`defaults.deniedReadPaths`]??[],h=t[`defaults.approvalRequired`]??[],g=[`~/.ssh`,`~/.aws`,`~/.gnupg`,`/etc/shadow`],v=[`rm -rf *`,`git push*`,`git reset*`,`curl * -X POST*`,`curl * --request POST*`],y=e=>g.some(t=>e===(t.startsWith(`~/`),t)||e===t),b=e=>v.includes(e),x=()=>{let e=c.trim();!e||m.includes(e)||(i(t=>({...t,"defaults.deniedReadPaths":[...m,e]})),o(e=>new Set(e).add(`defaults.deniedReadPaths`)),l(``))},S=e=>{y(e)||(i(t=>({...t,"defaults.deniedReadPaths":m.filter(t=>t!==e)})),o(e=>new Set(e).add(`defaults.deniedReadPaths`)))},C=()=>{let e=u.trim();!e||h.includes(e)||(i(t=>({...t,"defaults.approvalRequired":[...h,e]})),o(e=>new Set(e).add(`defaults.approvalRequired`)),d(``))},w=e=>{b(e)||(i(t=>({...t,"defaults.approvalRequired":h.filter(t=>t!==e)})),o(e=>new Set(e).add(`defaults.approvalRequired`)))},E=s.size+n.size;return(0,N.jsxs)(T,{children:[(0,N.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-medium text-[var(--app-text)]`,children:`Advanced`}),E>0&&(0,N.jsxs)(`span`,{className:`text-[10px] text-[var(--app-warning)]`,children:[n.size,` modified`]})]}),(0,N.jsxs)(`div`,{className:`mb-6`,children:[(0,N.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,N.jsx)(`h3`,{className:`text-xs font-medium text-[var(--app-text-muted)]`,children:`Denied Read Paths`}),!f&&(0,N.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[(0,N.jsx)(r,{size:A.xs}),` restart required`]})]}),(0,N.jsxs)(`p`,{className:`mb-2 text-xs text-[var(--app-text-subtle)]`,children:[`Paths blocked at both the SDK and OS layer for all roles. System defaults (locked) cannot be removed. Uses `,(0,N.jsx)(`code`,{className:`text-[var(--app-text-muted)]`,children:`*`}),` as wildcard.`]}),(0,N.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:m.map(e=>{let t=y(e);return(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border px-2 py-0.5 text-xs ${t?`border-[var(--app-border)] bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)]`:`border-[var(--app-danger-soft-border)] bg-[var(--app-danger-soft-bg)] text-[var(--app-danger-soft-text)]`}`,children:[t&&(0,N.jsx)(r,{size:A.xs}),e,!t&&f&&(0,N.jsx)(`button`,{type:`button`,className:`ml-0.5 text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,onClick:()=>S(e),children:(0,N.jsx)(a,{size:A.xs})})]},e)})}),f&&(0,N.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,N.jsx)(`input`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1 text-xs text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`/absolute/path or ~/path`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),x())}}),(0,N.jsx)(_,{variant:`ghost`,size:`sm`,className:`scale-75`,onClick:()=>x(),children:`Add`})]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,N.jsx)(`h3`,{className:`text-xs font-medium text-[var(--app-text-muted)]`,children:`Approval Required Patterns`}),!p&&(0,N.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[(0,N.jsx)(r,{size:A.xs}),` restart required`]})]}),(0,N.jsxs)(`p`,{className:`mb-2 text-xs text-[var(--app-text-subtle)]`,children:[`Operations matching these glob patterns require user approval before execution. Uses SDK Permission Rule glob syntax (`,(0,N.jsx)(`code`,{className:`text-[var(--app-text-muted)]`,children:`*`}),` = wildcard, e.g.,`,` `,(0,N.jsx)(`code`,{className:`text-[var(--app-text-muted)]`,children:`rm -rf *`}),`).`]}),(0,N.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:h.map(e=>{let t=b(e);return(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border px-2 py-0.5 text-xs ${t?`border-[var(--app-border)] bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)]`:`border-[var(--app-warning-soft-border)] bg-[var(--app-warning-soft-bg)] text-[var(--app-warning-soft-text)]`}`,children:[t&&(0,N.jsx)(r,{size:A.xs}),e,!t&&p&&(0,N.jsx)(`button`,{type:`button`,className:`ml-0.5 text-[var(--app-warning)] hover:text-[var(--app-warning-soft-text)]`,onClick:()=>w(e),children:(0,N.jsx)(a,{size:A.xs})})]},e)})}),p&&(0,N.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,N.jsx)(`input`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1 text-xs text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`e.g. "curl * --request POST *"`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),C())}}),(0,N.jsx)(_,{variant:`ghost`,size:`sm`,className:`scale-75`,onClick:()=>C(),children:`Add`})]})]})]})}function H(){let e=v()??``,[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)(!1),[s,c]=(0,M.useState)(!1),[C,w]=(0,M.useState)(null),[E,O]=(0,M.useState)(null),k=e.length>12?e.slice(0,4)+`****`+e.slice(-4):`(no key in localStorage)`;async function j(){i(!0),O(null);try{let e=await S();y(e),w(e),c(!1)}catch(e){O(e instanceof Error?e.message:String(e)),c(!1)}finally{i(!1)}}function P(){x(),b()}return(0,N.jsxs)(T,{children:[(0,N.jsx)(D,{title:`Adam API Key`,description:`Rotate or sign out`}),(0,N.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,N.jsx)(`code`,{className:`flex-1 rounded bg-[var(--app-bg)] px-3 py-2 font-mono text-sm`,children:t?e||`(no key)`:k}),(0,N.jsx)(_,{variant:`ghost`,size:`sm`,onClick:()=>n(e=>!e),children:t?`Hide`:`Show`})]}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsxs)(_,{variant:`outline`,size:`sm`,onClick:()=>c(!0),disabled:r,children:[(0,N.jsx)(o,{size:A.xs,className:`mr-1`}),`Rotate key`]}),(0,N.jsxs)(_,{variant:`ghost`,size:`sm`,onClick:P,children:[(0,N.jsx)(a,{size:A.xs,className:`mr-1`}),`Log out`]})]}),E&&(0,N.jsx)(`div`,{className:`rounded border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-400`,children:E}),(0,N.jsxs)(`p`,{className:`text-xs text-[var(--app-muted)]`,children:[`Rotating generates a new key, writes it to `,(0,N.jsx)(`code`,{children:`~/.adam/adam.key`}),`, and invalidates the old key on every device that uses the Adam API (Web UI, TUI, other browsers). Channel adapters (WeChat, Telegram, Discord) keep their own credentials and are NOT affected. Only external callers of your `,(0,N.jsx)(`code`,{children:`/webhooks/:name`}),` endpoints need the new key.`]})]}),(0,N.jsx)(g,{open:s,children:(0,N.jsxs)(d,{children:[(0,N.jsxs)(h,{children:[(0,N.jsx)(u,{children:`Rotate API key?`}),(0,N.jsxs)(l,{children:[`The old key stops working immediately. Other browsers/TUI sessions and any external callers of `,(0,N.jsx)(`code`,{children:`/webhooks/:name`}),` will return 401 until updated. Channel adapters (WeChat, Telegram, Discord) use their own credentials and are not affected.`]})]}),(0,N.jsxs)(p,{children:[(0,N.jsx)(m,{onClick:()=>c(!1),children:`Cancel`}),(0,N.jsx)(f,{onClick:j,disabled:r,children:r?`Rotating...`:`Rotate`})]})]})}),(0,N.jsx)(g,{open:!!C,children:(0,N.jsxs)(d,{children:[(0,N.jsxs)(h,{children:[(0,N.jsx)(u,{children:`New API key`}),(0,N.jsx)(l,{children:`Save this somewhere safe. Other devices and channels need to be updated with this key.`})]}),(0,N.jsx)(`code`,{className:`mt-2 block break-all rounded bg-[var(--app-bg)] p-3 font-mono text-xs`,children:C}),(0,N.jsxs)(p,{children:[(0,N.jsx)(f,{onClick:()=>{C&&navigator.clipboard.writeText(C)},children:`Copy`}),(0,N.jsx)(f,{onClick:()=>w(null),children:`Done`})]})]})})]})}export{B as Settings};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{P as t,ct as n,y as r}from"./vendor-icons-Dk0hMuJz.js";import{t as i}from"./vendor-react-C6faO6LO.js";import{t as a}from"./Button-DuQctNms.js";import{r as o,t as s}from"./index-DYsO5Awn.js";import{t as c}from"./Card-rKfViPS2.js";import{t as l}from"./PageHeader-CHSgtxPw.js";import{a as u}from"./format-CHfBBLog.js";import{t as d}from"./EmptyState-CIdIlMbn.js";import{a as f,i as p,n as m,o as h,r as g,t as _}from"./Table-DuOLbyJQ.js";var v=e(n(),1),y=i(),b={engineer:`info`,analyst:`warning`,content_creator:`success`,reviewer:`muted`};function x(){let e=o(e=>e.strategies),n=o(e=>e.fetchStrategies);(0,v.useEffect)(()=>{n()},[n]);let i=new Map;for(let t of e){let e=i.get(t.roleId)??[];e.push(t),i.set(t.roleId,e)}return(0,y.jsxs)(`div`,{className:`space-y-5`,children:[(0,y.jsx)(l,{compact:!0,title:`Strategies`,description:`Bandit strategies grouped by role.`,metrics:[{label:`Catalog`,value:e.length},{label:`Roles`,value:i.size},{label:`Mature`,value:e.filter(e=>e.totalTrials>=10).length}],className:`px-4 py-3 lg:px-4 lg:py-3`,actions:(0,y.jsx)(a,{variant:`ghost`,size:`sm`,onClick:()=>void n(),children:(0,y.jsx)(r,{size:14})})}),e.length===0?(0,y.jsx)(c,{className:`p-4`,children:(0,y.jsx)(d,{icon:(0,y.jsx)(t,{size:32}),title:`No strategies`,description:`Strategies are created by the Thompson Sampling engine as agents process tasks.`,compact:!0})}):Array.from(i.entries()).map(([e,t])=>(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(s,{variant:b[e]??`muted`,children:e}),(0,y.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[t.length,` strategies`]})]}),(0,y.jsx)(c,{padding:!1,children:(0,y.jsxs)(_,{children:[(0,y.jsx)(f,{children:(0,y.jsxs)(h,{children:[(0,y.jsx)(p,{children:`Name`}),(0,y.jsx)(p,{children:`Task Type`}),(0,y.jsx)(p,{children:`Alpha`}),(0,y.jsx)(p,{children:`Beta`}),(0,y.jsx)(p,{children:`Trials`}),(0,y.jsx)(p,{children:`Avg Reward`}),(0,y.jsx)(p,{children:`Created`})]})}),(0,y.jsx)(m,{children:t.map(e=>(0,y.jsxs)(h,{children:[(0,y.jsx)(g,{className:`font-medium text-[var(--app-text)]`,children:e.name}),(0,y.jsx)(g,{children:(0,y.jsx)(`span`,{className:`rounded bg-[var(--app-panel-elevated)] px-1.5 py-0.5 font-mono text-[10px] text-[var(--app-text-muted)]`,children:e.taskType})}),(0,y.jsx)(g,{className:`font-mono text-xs`,children:e.alpha.toFixed(2)}),(0,y.jsx)(g,{className:`font-mono text-xs`,children:e.beta.toFixed(2)}),(0,y.jsx)(g,{className:`font-mono text-xs`,children:e.totalTrials}),(0,y.jsx)(g,{className:`font-mono text-xs`,children:e.avgReward==null?`—`:e.avgReward.toFixed(3)}),(0,y.jsx)(g,{className:`text-xs text-[var(--app-text-subtle)]`,children:u(e.createdAt)})]},e.id))})]})})]},e))]})}export{x as Strategies};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{P as t,ct as n,y as r}from"./vendor-icons-Dk0hMuJz.js";import{t as i}from"./vendor-react-C6faO6LO.js";import{t as a}from"./Button-BehrGSvy.js";import{r as o,t as s}from"./index-B3_4_qY6.js";import{t as c}from"./Card-B5E56u94.js";import{t as l}from"./PageHeader-B2CgcZ-t.js";import{a as u}from"./format-BUYXZqDw.js";import{t as d}from"./EmptyState-tTclFq_B.js";import{a as f,i as p,n as m,o as h,r as g,t as _}from"./Table-CXAcZ8Ru.js";var v=e(n(),1),y=i(),b={engineer:`info`,analyst:`warning`,content_creator:`success`,reviewer:`muted`};function x(){let e=o(e=>e.strategies),n=o(e=>e.fetchStrategies);(0,v.useEffect)(()=>{n()},[n]);let i=new Map;for(let t of e){let e=i.get(t.roleId)??[];e.push(t),i.set(t.roleId,e)}return(0,y.jsxs)(`div`,{className:`space-y-5`,children:[(0,y.jsx)(l,{compact:!0,title:`Strategies`,description:`Bandit strategies grouped by role.`,metrics:[{label:`Catalog`,value:e.length},{label:`Roles`,value:i.size},{label:`Mature`,value:e.filter(e=>e.totalTrials>=10).length}],className:`px-4 py-3 lg:px-4 lg:py-3`,actions:(0,y.jsx)(a,{variant:`ghost`,size:`sm`,onClick:()=>void n(),children:(0,y.jsx)(r,{size:14})})}),e.length===0?(0,y.jsx)(c,{className:`p-4`,children:(0,y.jsx)(d,{icon:(0,y.jsx)(t,{size:32}),title:`No strategies`,description:`Strategies are created by the Thompson Sampling engine as agents process tasks.`,compact:!0})}):Array.from(i.entries()).map(([e,t])=>(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(s,{variant:b[e]??`muted`,children:e}),(0,y.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[t.length,` strategies`]})]}),(0,y.jsx)(c,{padding:!1,children:(0,y.jsxs)(_,{children:[(0,y.jsx)(f,{children:(0,y.jsxs)(h,{children:[(0,y.jsx)(p,{children:`Name`}),(0,y.jsx)(p,{children:`Task Type`}),(0,y.jsx)(p,{children:`Alpha`}),(0,y.jsx)(p,{children:`Beta`}),(0,y.jsx)(p,{children:`Trials`}),(0,y.jsx)(p,{children:`Avg Reward`}),(0,y.jsx)(p,{children:`Created`})]})}),(0,y.jsx)(m,{children:t.map(e=>(0,y.jsxs)(h,{children:[(0,y.jsx)(g,{className:`font-medium text-[var(--app-text)]`,children:e.name}),(0,y.jsx)(g,{children:(0,y.jsx)(`span`,{className:`rounded bg-[var(--app-panel-elevated)] px-1.5 py-0.5 font-mono text-[10px] text-[var(--app-text-muted)]`,children:e.taskType})}),(0,y.jsx)(g,{className:`font-mono text-xs`,children:e.alpha.toFixed(2)}),(0,y.jsx)(g,{className:`font-mono text-xs`,children:e.beta.toFixed(2)}),(0,y.jsx)(g,{className:`font-mono text-xs`,children:e.totalTrials}),(0,y.jsx)(g,{className:`font-mono text-xs`,children:e.avgReward==null?`—`:e.avgReward.toFixed(3)}),(0,y.jsx)(g,{className:`text-xs text-[var(--app-text-subtle)]`,children:u(e.createdAt)})]},e.id))})]})})]},e))]})}export{x as Strategies};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{ct as t}from"./vendor-icons-Dk0hMuJz.js";import{t as n}from"./vendor-react-C6faO6LO.js";import{i as r}from"./dist-Bdqp1ixJ.js";import{_ as i,b as a,u as o,x as s}from"./AlertDialog-CfeiyMrc.js";import{i as c}from"./Button-DuQctNms.js";import{a as l}from"./index-DYsO5Awn.js";var u=e(t(),1);function d(e){let t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var f=n(),p=`Switch`,[m,h]=a(p),[g,_]=m(p),v=u.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:a,defaultChecked:l,required:d,disabled:m,value:h=`on`,onCheckedChange:_,form:v,...y}=e,[b,x]=u.useState(null),w=c(t,e=>x(e)),T=u.useRef(!1),E=b?v||!!b.closest(`form`):!0,[D,O]=o({prop:a,defaultProp:l??!1,onChange:_,caller:p});return(0,f.jsxs)(g,{scope:n,checked:D,disabled:m,children:[(0,f.jsx)(i.button,{type:`button`,role:`switch`,"aria-checked":D,"aria-required":d,"data-state":C(D),"data-disabled":m?``:void 0,disabled:m,value:h,...y,ref:w,onClick:s(e.onClick,e=>{O(e=>!e),E&&(T.current=e.isPropagationStopped(),T.current||e.stopPropagation())})}),E&&(0,f.jsx)(S,{control:b,bubbles:!T.current,name:r,value:h,checked:D,required:d,disabled:m,form:v,style:{transform:`translateX(-100%)`}})]})});v.displayName=p;var y=`SwitchThumb`,b=u.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,a=_(y,n);return(0,f.jsx)(i.span,{"data-state":C(a.checked),"data-disabled":a.disabled?``:void 0,...r,ref:t})});b.displayName=y;var x=`SwitchBubbleInput`,S=u.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=u.useRef(null),s=c(o,a),p=d(n),m=l(t);return u.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(p!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[p,n,r]),(0,f.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...m,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});S.displayName=x;function C(e){return e?`checked`:`unchecked`}var w=v,T=b,E=u.forwardRef(({className:e,...t},n)=>(0,f.jsx)(w,{className:r(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--app-canvas)] disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[var(--app-accent)] data-[state=unchecked]:bg-[var(--app-panel-muted)]`,e),...t,ref:n,children:(0,f.jsx)(T,{className:r(`pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`)})}));E.displayName=w.displayName;export{E as t};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{ct as t}from"./vendor-icons-Dk0hMuJz.js";import{t as n}from"./vendor-react-C6faO6LO.js";import{n as r}from"./dist-CgGno8kE.js";import{_ as i,b as a,u as o,x as s}from"./AlertDialog-B1zj0Qs3.js";import{i as c}from"./Button-BehrGSvy.js";import{a as l}from"./index-B3_4_qY6.js";var u=e(t(),1);function d(e){let t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var f=n(),p=`Switch`,[m,h]=a(p),[g,_]=m(p),v=u.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:a,defaultChecked:l,required:d,disabled:m,value:h=`on`,onCheckedChange:_,form:v,...y}=e,[b,x]=u.useState(null),w=c(t,e=>x(e)),T=u.useRef(!1),E=b?v||!!b.closest(`form`):!0,[D,O]=o({prop:a,defaultProp:l??!1,onChange:_,caller:p});return(0,f.jsxs)(g,{scope:n,checked:D,disabled:m,children:[(0,f.jsx)(i.button,{type:`button`,role:`switch`,"aria-checked":D,"aria-required":d,"data-state":C(D),"data-disabled":m?``:void 0,disabled:m,value:h,...y,ref:w,onClick:s(e.onClick,e=>{O(e=>!e),E&&(T.current=e.isPropagationStopped(),T.current||e.stopPropagation())})}),E&&(0,f.jsx)(S,{control:b,bubbles:!T.current,name:r,value:h,checked:D,required:d,disabled:m,form:v,style:{transform:`translateX(-100%)`}})]})});v.displayName=p;var y=`SwitchThumb`,b=u.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,a=_(y,n);return(0,f.jsx)(i.span,{"data-state":C(a.checked),"data-disabled":a.disabled?``:void 0,...r,ref:t})});b.displayName=y;var x=`SwitchBubbleInput`,S=u.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=u.useRef(null),s=c(o,a),p=d(n),m=l(t);return u.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(p!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[p,n,r]),(0,f.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...m,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});S.displayName=x;function C(e){return e?`checked`:`unchecked`}var w=v,T=b,E=u.forwardRef(({className:e,...t},n)=>(0,f.jsx)(w,{className:r(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--app-canvas)] disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[var(--app-accent)] data-[state=unchecked]:bg-[var(--app-panel-muted)]`,e),...t,ref:n,children:(0,f.jsx)(T,{className:r(`pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`)})}));E.displayName=w.displayName;export{E as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{ct as t}from"./vendor-icons-Dk0hMuJz.js";import{t as n}from"./vendor-react-C6faO6LO.js";import{i as r}from"./dist-Bdqp1ixJ.js";var i=e(t(),1),a=n(),o=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`div`,{className:`overflow-x-auto`,children:(0,a.jsx)(`table`,{ref:n,className:r(`w-full text-sm`,e),...t})}));o.displayName=`Table`;var s=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`thead`,{ref:n,className:r(`border-b border-[var(--app-border)]`,e),...t}));s.displayName=`TableHeader`;var c=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`tbody`,{ref:n,className:r(`divide-y divide-[var(--app-border)]`,e),...t}));c.displayName=`TableBody`;var l=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`tr`,{ref:n,className:r(`transition-colors hover:bg-white/[0.04]`,e),...t}));l.displayName=`TableRow`;var u=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`th`,{ref:n,className:r(`px-3 py-2.5 text-left text-[11px] font-semibold uppercase tracking-[var(--app-tracking-micro)] text-[var(--app-text-subtle)]`,e),...t}));u.displayName=`TableHead`;var d=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`td`,{ref:n,className:r(`px-3 py-2.5 align-top text-[var(--app-text)]`,e),...t}));d.displayName=`TableCell`;var f=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`caption`,{ref:n,className:r(`mt-2 text-xs text-[var(--app-text-subtle)]`,e),...t}));f.displayName=`TableCaption`;var p=s,m=c,h=l,g=u,_=d;export{p as a,g as i,m as n,h as o,_ as r,o as t};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{ct as t}from"./vendor-icons-Dk0hMuJz.js";import{t as n}from"./vendor-react-C6faO6LO.js";import{n as r}from"./dist-CgGno8kE.js";var i=e(t(),1),a=n(),o=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`div`,{className:`overflow-x-auto`,children:(0,a.jsx)(`table`,{ref:n,className:r(`w-full text-sm`,e),...t})}));o.displayName=`Table`;var s=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`thead`,{ref:n,className:r(`border-b border-[var(--app-border)]`,e),...t}));s.displayName=`TableHeader`;var c=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`tbody`,{ref:n,className:r(`divide-y divide-[var(--app-border)]`,e),...t}));c.displayName=`TableBody`;var l=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`tr`,{ref:n,className:r(`transition-colors hover:bg-white/[0.04]`,e),...t}));l.displayName=`TableRow`;var u=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`th`,{ref:n,className:r(`px-3 py-2.5 text-left text-[11px] font-semibold uppercase tracking-[var(--app-tracking-micro)] text-[var(--app-text-subtle)]`,e),...t}));u.displayName=`TableHead`;var d=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`td`,{ref:n,className:r(`px-3 py-2.5 align-top text-[var(--app-text)]`,e),...t}));d.displayName=`TableCell`;var f=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`caption`,{ref:n,className:r(`mt-2 text-xs text-[var(--app-text-subtle)]`,e),...t}));f.displayName=`TableCaption`;var p=s,m=c,h=l,g=u,_=d;export{p as a,g as i,m as n,h as o,_ as r,o as t};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{B as t,I as n,K as r,L as i,Y as a,a as o,at as s,ct as c,it as l,p as u,q as d}from"./vendor-icons-Dk0hMuJz.js";import{f,r as p,t as m}from"./vendor-react-C6faO6LO.js";import{t as h}from"./Button-BehrGSvy.js";import{i as g,t as _}from"./api-Bux34u4-.js";import{n as v,t as y}from"./index-B3_4_qY6.js";import{i as b,n as x,r as S,t as C}from"./Card-B5E56u94.js";import{t as w}from"./PageHeader-B2CgcZ-t.js";import{t as T}from"./SectionHeader-CmXz6PM3.js";import{a as E,n as D,r as O,t as k}from"./format-BUYXZqDw.js";import{t as A}from"./ui-CerQw0jA.js";var j=e(c(),1),M=m(),N={reasoning:`text-[var(--app-accent)]`,tool_call:`text-[var(--app-accent-strong)]`,tool_result:`text-[var(--app-success)]`,approval_request:`text-[var(--app-warning)]`,approval_response:`text-[var(--app-warning-strong)]`,permission_denied:`text-[var(--app-indicator-alert)]`,error:`text-[var(--app-danger)]`,plugin_error:`text-[var(--app-danger)]`};function P({logs:e}){let[t,n]=(0,j.useState)(new Set);return e.length===0?(0,M.jsx)(`p`,{className:`text-sm text-[var(--app-text-subtle)]`,children:`No execution steps yet.`}):(0,M.jsx)(`div`,{className:`space-y-0`,children:e.map((r,i)=>{let o=i>0?e[i-1].timestamp:null,s=o?r.timestamp-o:null,c=r.type===`plugin_error`,l=t.has(i)?r.content:r.content.length>200?r.content.slice(0,200)+`...`:r.content;return(0,M.jsxs)(`div`,{className:`flex gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,M.jsx)(a,{size:10,className:`mt-1.5 flex-shrink-0 fill-current ${N[r.type]??`text-[var(--app-text-subtle)]`} ${c?`rounded-full ring-2 ring-[var(--app-danger)]`:``}`}),i<e.length-1&&(0,M.jsx)(`div`,{className:`mt-0.5 w-0.5 flex-1 bg-[var(--app-border)]`})]}),(0,M.jsxs)(`div`,{className:`flex-1 pb-4 ${c?`rounded-lg border border-[var(--app-danger)]/40 bg-[var(--app-danger-soft-bg-subtle)] p-3`:``}`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,M.jsxs)(`span`,{className:`text-xs font-mono text-[var(--app-text-subtle)]`,children:[`#`,r.index]}),(0,M.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:r.toolName??r.type}),c&&(0,M.jsx)(y,{variant:`destructive`,children:`Plugin Error`}),(0,M.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:E(r.timestamp)}),s!=null&&s>0&&(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`+`,s,`ms`]}),r.truncated&&(0,M.jsx)(y,{variant:`outline`,children:`truncated`})]}),l&&(0,M.jsx)(`button`,{className:`mt-2 w-full rounded-lg border border-[var(--app-border)] bg-white/[0.03] px-3 py-3 text-left font-mono text-xs text-[var(--app-text-muted)] transition-colors hover:border-[var(--app-border-strong)] hover:text-[var(--app-text)]`,onClick:()=>{n(e=>{let t=new Set(e);return t.has(i)?t.delete(i):t.add(i),t})},children:l})]})]},r.id)})})}function F(){let{id:e}=f(),[a,c]=(0,j.useState)(null),[m,E]=(0,j.useState)([]),[N,F]=(0,j.useState)([]),[R,z]=(0,j.useState)([]),[B,V]=(0,j.useState)(null),[H,U]=(0,j.useState)(null),[W,G]=(0,j.useState)(!1),[K,q]=(0,j.useState)(!1),[J,Y]=(0,j.useState)(!1),[X,Z]=(0,j.useState)(!1),Q=(0,j.useMemo)(()=>{if(!a)return`No diagnostics yet`;let e=[];return a.error&&e.push(`error`),N.length>0&&e.push(`${N.length} steps`),R.length>0&&e.push(`${R.length} delivery events`),e.length>0?e.join(` · `):`No diagnostics yet`},[R.length,N.length,a]);(0,j.useEffect)(()=>{if(!e)return;let t=!1,n=async()=>{if(!t)try{let n=await _(`/tasks/${e}`);if(t)return;c(n.task),U(null)}catch(e){if(t)return;U(e instanceof Error?e.message:`Failed to load task`)}};n(),_(`/tasks/${e}/plan`).then(e=>{t||E(e.plans)}).catch(()=>{t||E([])}),_(`/tasks/${e}/logs?limit=200`).then(e=>{t||F(e.logs)}).catch(()=>{t||F([])}),g(e).then(e=>{t||z(e)}).catch(()=>{t||z([])});let r=setInterval(n,3e3);return()=>{t=!0,clearInterval(r)}},[e]),(0,j.useEffect)(()=>{if(!a?.roleId||!e)return;let t=!1;return _(`/roles/${a.roleId}/scores?limit=100`).then(n=>{t||V(n.scores.find(t=>t.taskId===e)??null)}).catch(()=>{t||V(null)}),()=>{t=!0}},[a?.roleId,e]);let $=async()=>{if(e){G(!0);try{await _(`/tasks/${e}/cancel`,{method:`POST`}),c(e=>e&&{...e,status:`cancelled`})}finally{G(!1)}}};if(H)return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsxs)(p,{to:`/work`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,M.jsx)(s,{size:A.sm}),` Back to Tasks`]}),(0,M.jsx)(C,{className:`text-center text-[var(--app-danger)]`,children:H})]});if(!a)return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsxs)(p,{to:`/work`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,M.jsx)(s,{size:A.sm}),` Back to Tasks`]}),(0,M.jsx)(C,{className:`text-center text-[var(--app-text-subtle)]`,children:`Loading...`})]});let ee=[`running`,`queued`,`pending`,`paused`].includes(a.status);return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(w,{eyebrow:`Task`,title:`Task Detail`,compact:!0,description:`Summary, execution, result, and diagnostics.`,metrics:[{label:`Status`,value:(0,M.jsx)(y,{variant:v(a.status),children:a.status})},{label:`Task`,value:a.id.slice(0,8)},{label:`Elapsed`,value:a.totalDurationMs?O(a.totalDurationMs):a.startedAt?O(Date.now()-a.startedAt):`—`},{label:`Spend`,value:a.costUsd==null?`—`:k(a.costUsd)}],actions:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(p,{to:`/work`,className:`inline-flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,M.jsx)(s,{size:A.sm}),` Back to Tasks`]}),ee&&(0,M.jsxs)(h,{variant:`destructive`,size:`sm`,onClick:()=>void $(),disabled:W,children:[(0,M.jsx)(l,{size:A.sm}),W?`Cancelling...`:`Cancel Task`]})]})}),(0,M.jsx)(C,{className:`surface-accent text-white`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`p`,{className:`text-kicker text-white/70`,children:`Summary`}),(0,M.jsx)(`p`,{className:`mt-2 text-base leading-7 text-white`,children:a.prompt.length>220&&!K?`${a.prompt.slice(0,220)}…`:a.prompt})]}),(0,M.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[a.prompt.length>220?(0,M.jsxs)(h,{variant:`secondary`,size:`sm`,onClick:()=>q(e=>!e),children:[(0,M.jsx)(t,{size:A.sm}),K?`Collapse prompt`:`Show full prompt`]}):null,(0,M.jsxs)(h,{variant:`secondary`,size:`sm`,onClick:()=>Z(e=>!e),children:[(0,M.jsx)(u,{size:A.sm}),X?`Hide diagnostics`:`Show diagnostics`]})]})]})}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,M.jsx)(L,{icon:d,label:`Created`,value:D(a.createdAt)}),(0,M.jsx)(L,{icon:d,label:`Duration`,value:a.totalDurationMs?O(a.totalDurationMs):a.startedAt?O(Date.now()-a.startedAt):`—`}),(0,M.jsx)(L,{icon:r,label:`Cost`,value:a.costUsd==null?`—`:k(a.costUsd)}),(0,M.jsx)(L,{icon:i,label:`Turns`,value:String(a.numTurns??`—`)})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,M.jsx)(L,{icon:o,label:`Role`,value:a.roleId??`—`,mono:!0}),(0,M.jsx)(L,{icon:n,label:`Parent`,value:a.parentId??`—`,mono:!0}),a.templateId?(0,M.jsxs)(p,{to:`/work`,className:`block`,children:[(0,M.jsx)(L,{icon:n,label:`Template`,value:a.templateId,mono:!0}),(0,M.jsx)(`span`,{className:`mt-0.5 block text-xs text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:`View in Automations →`})]}):(0,M.jsx)(L,{icon:n,label:`Template`,value:`—`,mono:!0}),a.sourceSessionId&&(0,M.jsx)(L,{icon:i,label:`Source Session`,value:a.sourceSessionId.slice(0,8),mono:!0})]}),(a.deliverTo||a.reportTo)&&(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Delivery Targets`}),(0,M.jsx)(x,{children:`Where results and status updates are sent after execution.`})]})}),(0,M.jsxs)(`div`,{className:`space-y-3`,children:[a.deliverTo&&a.deliverTo.length>0&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] mb-1`,children:`Output`}),(0,M.jsx)(`div`,{className:`space-y-1`,children:a.deliverTo.map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-[var(--app-text)]`,children:[(0,M.jsx)(y,{variant:`outline`,children:e.type===`channel`?`Channel`:`Session`}),e.type===`channel`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`session `,e.sessionId?.slice(0,8)]})]},`d-${t}`))})]}),a.reportTo&&a.reportTo.length>0&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] mb-1`,children:`Status Reports`}),(0,M.jsx)(`div`,{className:`space-y-1`,children:a.reportTo.map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-[var(--app-text)]`,children:[(0,M.jsx)(y,{variant:`outline`,children:e.type===`channel`?`Channel`:`Session`}),e.type===`channel`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`session `,e.sessionId?.slice(0,8)]})]},`r-${t}`))})]})]})]}),B&&(a.status===`completed`||a.status===`failed`)&&(0,M.jsx)(I,{score:B}),a.tokenUsage&&(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Token Usage`}),(0,M.jsx)(x,{children:`Input and output token totals for this execution.`})]})}),(0,M.jsxs)(`div`,{className:`flex gap-6 text-sm`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Input:`}),` `,(0,M.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:a.tokenUsage.input.toLocaleString()})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Output:`}),` `,(0,M.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:a.tokenUsage.output.toLocaleString()})]})]})]}),m.length>0&&(()=>{let e=m[0],t=e.plan.overallRisk===`high`?`destructive`:e.plan.overallRisk===`medium`?`warning`:`secondary`;return(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Execution Plan`}),(0,M.jsx)(x,{children:`Expected steps, risk, and permissions before execution.`})]}),(0,M.jsxs)(y,{variant:t,children:[e.plan.overallRisk.toUpperCase(),` RISK`]}),(0,M.jsx)(y,{variant:`outline`,children:e.status})]})}),(0,M.jsxs)(`h4`,{className:`text-sm font-medium text-[var(--app-text)] mb-2`,children:[`Plan Steps (`,e.plan.steps.length,`)`]}),(0,M.jsx)(`div`,{className:`space-y-2`,children:e.plan.steps.map(e=>(0,M.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)]/50 p-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsxs)(`span`,{className:`text-xs font-mono text-[var(--app-text-subtle)]`,children:[`#`,e.index]}),(0,M.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:e.description})]}),(0,M.jsx)(y,{variant:e.riskLevel===`high`?`destructive`:e.riskLevel===`medium`?`warning`:`secondary`,children:e.riskLevel})]}),(0,M.jsxs)(`div`,{className:`mt-1 text-xs text-[var(--app-text-muted)]`,children:[`Tools: `,e.toolsNeeded.join(`, `)||`none`]}),e.expectedOutput&&(0,M.jsxs)(`div`,{className:`mt-0.5 text-xs text-[var(--app-text-subtle)]`,children:[`Expected: `,e.expectedOutput]})]},e.index))}),Object.keys(e.plan.requiredPermissions).length>0&&(0,M.jsxs)(`div`,{className:`mt-2`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)] mb-1`,children:`Required Permissions`}),(0,M.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:Object.keys(e.plan.requiredPermissions).map(e=>(0,M.jsx)(y,{variant:`secondary`,children:e},e))})]}),e.deviationReport&&(0,M.jsxs)(`div`,{className:`mt-3 rounded-md border border-[var(--app-warning-soft-border)] bg-[var(--app-warning-soft-bg-subtle)] p-3`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-warning)] mb-2`,children:`Deviation Report`}),(0,M.jsxs)(`div`,{className:`text-xs text-[var(--app-text-muted)] mb-2`,children:[`Planned: `,e.deviationReport.stepsPlanned,` | Executed: `,e.deviationReport.stepsExecuted,` | Accuracy: `,(e.deviationReport.overallAccuracy*100).toFixed(0),`%`]}),e.deviationReport.deviations.length>0&&(0,M.jsx)(`div`,{className:`space-y-1`,children:e.deviationReport.deviations.map((e,t)=>(0,M.jsxs)(`div`,{className:`text-xs`,children:[(0,M.jsxs)(`span`,{className:`text-[var(--app-warning)] font-mono`,children:[`[`,e.deviationType,`]`]}),(0,M.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[` Step `,e.stepIndex,`: `]}),(0,M.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.actual})]},t))})]}),e.learnedRules&&e.learnedRules.length>0&&(0,M.jsxs)(`div`,{className:`mt-3`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)] mb-2`,children:`Learned Rules`}),(0,M.jsx)(`ul`,{className:`space-y-1`,children:e.learnedRules.map((e,t)=>(0,M.jsxs)(`li`,{className:`text-xs text-[var(--app-text-muted)] flex items-start gap-1.5`,children:[(0,M.jsx)(`span`,{className:`text-[var(--app-accent)] mt-0.5`,children:`*`}),e]},t))})]})]})})(),N.length>0&&(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(b,{children:[`Execution Timeline (`,N.length,` steps)`]}),(0,M.jsx)(x,{children:`Ordered execution events, tool calls, and error markers.`})]})}),(0,M.jsx)(P,{logs:N})]}),a.result&&(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-3`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Result`}),(0,M.jsx)(x,{children:`The final task output. Raw text stays collapsed until needed.`})]}),a.result.length>360?(0,M.jsx)(h,{variant:`ghost`,size:`sm`,onClick:()=>Y(e=>!e),children:J?`Collapse`:`Expand`}):null]})}),(0,M.jsx)(`pre`,{className:`max-h-96 overflow-auto whitespace-pre-wrap rounded-md bg-[var(--app-panel-elevated)] p-3 font-mono text-xs text-[var(--app-text)]`,children:a.result.length>360&&!J?`${a.result.slice(0,360)}…`:a.result})]}),a.error&&(()=>{let e=[`plugin`,`--plugin-dir`,`failed to load plugin`],t=a.error.toLowerCase(),n=e.some(e=>t.includes(e)),r=n?a.error.split(`
2
+ `).find(t=>e.some(e=>t.toLowerCase().includes(e))):null;return(0,M.jsxs)(C,{className:n?`border-[var(--app-danger)]`:``,children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Error`}),(0,M.jsx)(x,{children:`Execution failed or returned an error condition.`})]}),n&&(0,M.jsx)(y,{variant:`warning`,children:`Plugin Issue`})]})}),n&&r&&(0,M.jsx)(`div`,{className:`mb-2 rounded bg-[var(--app-warning-soft-bg-subtle)] px-2 py-1 text-xs text-[var(--app-warning)]`,children:r}),(0,M.jsx)(`pre`,{className:`max-h-96 overflow-auto whitespace-pre-wrap rounded-md bg-[var(--app-danger-soft-bg-subtle)] p-3 font-mono text-xs text-[var(--app-danger)]`,children:a.error})]})})(),(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Diagnostics`}),(0,M.jsx)(x,{children:Q})]})}),X?R.length>0?(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(T,{title:`Delivery Log`,description:`Recent delivery attempts and outcomes.`}),(0,M.jsx)(`div`,{className:`space-y-2`,children:R.map(e=>{let t=e.status===`delivered`?`success`:e.status===`pending`?`secondary`:`destructive`,n=e.target.type===`webhook`?e.target.webhookUrl:e.target.type===`channel`?`channel ${e.target.channelId.slice(0,8)}`:`session ${e.target.sessionId?.slice(0,8)}`;return(0,M.jsxs)(`div`,{className:`surface-panel-muted rounded-lg px-3 py-3 text-sm`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(y,{variant:t,children:e.status}),(0,M.jsx)(`span`,{className:`font-mono text-xs text-[var(--app-text-subtle)]`,children:n}),e.messageType?(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`(`,e.messageType,`)`]}):null]}),e.error?(0,M.jsx)(`p`,{className:`mt-2 text-xs text-[var(--app-danger-soft-text)]`,children:e.error}):null,(0,M.jsxs)(`p`,{className:`mt-2 text-xs text-[var(--app-text-subtle)]`,children:[D(e.createdAt),e.deliveredAt&&` \u2192 ${D(e.deliveredAt)}`]})]},e.id)})})]}):(0,M.jsx)(`div`,{className:`surface-panel-muted rounded-lg px-4 py-4 text-sm text-[var(--app-text-subtle)]`,children:`No delivery events recorded yet.`}):(0,M.jsx)(`div`,{className:`surface-panel-muted rounded-lg px-4 py-4 text-sm text-[var(--app-text-subtle)]`,children:`Diagnostics are hidden by default because this section can contain raw execution details and operational data.`})]})]})}function I({score:e}){let t=[{label:`Task Success`,value:e.scores.taskSuccess,weight:`30%`},{label:`Plan Accuracy`,value:e.scores.planAccuracy,weight:`25%`},{label:`Permission Compliance`,value:e.scores.permissionCompliance,weight:`25%`},{label:`Efficiency`,value:e.scores.efficiency,weight:`20%`}];return(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsx)(b,{children:`Quality Score`})}),(0,M.jsxs)(`div`,{className:`space-y-3`,children:[t.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-xs`,children:[(0,M.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[e.label,` `,(0,M.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`(`,e.weight,`)`]})]}),(0,M.jsxs)(`span`,{className:`font-mono text-[var(--app-text)]`,children:[(e.value*100).toFixed(0),`%`]})]}),(0,M.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-[var(--app-panel-elevated)]`,children:(0,M.jsx)(`div`,{className:`h-full rounded-full ${e.value<.4?`bg-[var(--app-danger)]`:`bg-[var(--app-accent)]`}`,style:{width:`${e.value*100}%`}})})]},e.label)),(0,M.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-[var(--app-border)] pt-2`,children:[(0,M.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:`Weighted Score`}),(0,M.jsxs)(`span`,{className:`font-mono text-sm font-semibold text-[var(--app-text)]`,children:[(e.scores.weighted*100).toFixed(0),`%`]})]}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:`EMA (after this task)`}),(0,M.jsxs)(`span`,{className:`font-mono text-sm font-semibold ${e.emaScore<.4?`text-[var(--app-danger)]`:`text-[var(--app-success)]`}`,children:[(e.emaScore*100).toFixed(0),`%`]})]})]})]})}function L({icon:e,label:t,value:n,mono:r}){return(0,M.jsxs)(C,{className:`flex flex-col gap-1`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[var(--app-text-subtle)]`,children:[(0,M.jsx)(e,{size:12}),(0,M.jsx)(`span`,{className:`text-xs`,children:t})]}),(0,M.jsx)(`span`,{className:`text-sm text-[var(--app-text)] truncate ${r?`font-mono text-xs`:``}`,children:n})]})}export{F as TaskDetail};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{$ as t,E as n,N as r,S as i,T as a,V as o,ct as s,et as c,it as l,s as u,tt as d,y as f}from"./vendor-icons-Dk0hMuJz.js";import{r as p,t as m}from"./vendor-react-C6faO6LO.js";import{n as h}from"./dist-CgGno8kE.js";import{_ as g,a as _,b as v,c as y,d as b,g as ee,i as te,n as x,o as ne,p as S,r as re,s as ie,t as ae,u as oe,v as se,x as C}from"./AlertDialog-B1zj0Qs3.js";import{i as w,t as T}from"./Button-BehrGSvy.js";import{t as ce}from"./vendor-state-DahK0J-G.js";import{t as E}from"./api-Bux34u4-.js";import{i as D,n as O,r as k,t as A}from"./index-B3_4_qY6.js";import{t as j}from"./Card-B5E56u94.js";import{t as M}from"./PageHeader-B2CgcZ-t.js";import{t as le}from"./SectionHeader-CmXz6PM3.js";import{a as ue,o as de,t as fe}from"./format-BUYXZqDw.js";import{t as pe}from"./EmptyState-tTclFq_B.js";import{t as me}from"./ui-CerQw0jA.js";import{t as he}from"./useIsMobileLayout-dYzXP1EC.js";import{a as ge,i as N,n as _e,o as ve,r as P,t as ye}from"./Table-CXAcZ8Ru.js";import{t as be}from"./Switch-yrTepsdl.js";import{Goals as xe,t as Se}from"./Goals-DYrggK-M.js";var F=e(s(),1),I=m();function Ce(e){let t=e+`CollectionProvider`,[n,r]=v(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=F.useRef(null),a=F.useRef(new Map).current;return(0,I.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=se(s),l=F.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,I.jsx)(c,{ref:w(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=se(u),p=F.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=F.useRef(null),s=w(t,o),c=a(u,n);return F.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,I.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return F.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var L=F.createContext(void 0);function R(e){let t=F.useContext(L);return e||t||`ltr`}var z=`rovingFocusGroup.onEntryFocus`,we={bubbles:!1,cancelable:!0},B=`RovingFocusGroup`,[V,Te,H]=Ce(B),[Ee,De]=v(B,[H]),[U,Oe]=Ee(B),W=F.forwardRef((e,t)=>(0,I.jsx)(V.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(V.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(ke,{...e,ref:t})})}));W.displayName=B;var ke=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=F.useRef(null),p=w(t,f),m=R(a),[h,_]=oe({prop:o,defaultProp:s??null,onChange:c,caller:B}),[v,y]=F.useState(!1),b=ee(l),te=Te(n),x=F.useRef(!1),[ne,S]=F.useState(0);return F.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(z,b),()=>e.removeEventListener(z,b)},[b]),(0,I.jsx)(U,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:F.useCallback(e=>_(e),[_]),onItemShiftTab:F.useCallback(()=>y(!0),[]),onFocusableItemAdd:F.useCallback(()=>S(e=>e+1),[]),onFocusableItemRemove:F.useCallback(()=>S(e=>e-1),[]),children:(0,I.jsx)(g.div,{tabIndex:v||ne===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:C(e.onMouseDown,()=>{x.current=!0}),onFocus:C(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(z,we);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=te().filter(e=>e.focusable);Pe([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:C(e.onBlur,()=>y(!1))})})}),G=`RovingFocusGroupItem`,Ae=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=S(),l=a||c,u=Oe(G,n),d=u.currentTabStopId===l,f=Te(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return F.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,I.jsx)(V.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,I.jsx)(g.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:C(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:C(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:C(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ne(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Fe(n,r+1):n.slice(r+1)}setTimeout(()=>Pe(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Ae.displayName=G;var je={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Me(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Ne(e,t,n){let r=Me(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return je[r]}function Pe(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Fe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ie=W,Le=Ae,K=`Tabs`,[Re,ze]=v(K,[De]),Be=De(),[Ve,q]=Re(K),J=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=R(s),[d,f]=oe({prop:r,onChange:i,defaultProp:a??``,caller:K});return(0,I.jsx)(Ve,{scope:n,baseId:S(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(g.div,{dir:u,"data-orientation":o,...l,ref:t})})});J.displayName=K;var He=`TabsList`,Ue=F.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=q(He,n),o=Be(n);return(0,I.jsx)(Ie,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(g.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Ue.displayName=He;var We=`TabsTrigger`,Ge=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=q(We,n),s=Be(n),c=X(o.baseId,r),l=qe(o.baseId,r),u=r===o.value;return(0,I.jsx)(Le,{asChild:!0,...s,focusable:!i,active:u,children:(0,I.jsx)(g.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:C(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:C(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:C(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});Ge.displayName=We;var Y=`TabsContent`,Ke=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=q(Y,n),c=X(s.baseId,r),l=qe(s.baseId,r),u=r===s.value,d=F.useRef(u);return F.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.jsx)(b,{present:i||u,children:({present:n})=>(0,I.jsx)(g.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});Ke.displayName=Y;function X(e,t){return`${e}-trigger-${t}`}function qe(e,t){return`${e}-content-${t}`}var Je=J,Ye=Ue,Xe=Ge,Ze=Ke,Qe=Je,$e=F.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Ye,{ref:n,className:h(`surface-panel-muted inline-flex min-h-11 items-center justify-center gap-1 rounded-full p-1 text-[var(--app-text-muted)]`,e),...t}));$e.displayName=Ye.displayName;var Z=F.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Xe,{ref:n,className:h(`inline-flex items-center justify-center whitespace-nowrap rounded-full px-4 py-2 text-sm font-medium ring-offset-[var(--app-canvas)] transition-[background-color,color,box-shadow] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:surface-panel data-[state=active]:text-[var(--app-text)] data-[state=active]:shadow-[var(--app-shadow-sm)]`,e),...t}));Z.displayName=Xe.displayName;var Q=F.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Ze,{ref:n,className:h(`mt-4 ring-offset-[var(--app-canvas)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2`,e),...t}));Q.displayName=Ze.displayName;var et=[{label:`All`,value:`all`},{label:`Running`,value:`running`},{label:`Pending`,value:`pending`},{label:`Completed`,value:`completed`},{label:`Failed`,value:`failed`},{label:`Cancelled`,value:`cancelled`},{label:`Blocked`,value:`blocked`}],$=new Set([`pending`,`queued`,`running`,`paused`]);function tt(){let e=k(e=>e.tasks),t=k(e=>e.fetchTasks),[n,a]=(0,F.useState)(`all`),[o,s]=(0,F.useState)(!1),[c,u]=(0,F.useState)(``),[m,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(new Set),[v,y]=(0,F.useState)(!1),b=he();(0,F.useEffect)(()=>{let e=n===`all`?void 0:n;t(e);let r=setInterval(()=>void t(e),5e3);return()=>clearInterval(r)},[t,n]),(0,F.useEffect)(()=>{_(new Set)},[n]);let ee=async()=>{if(c.trim()){h(!0);try{await E(`/tasks`,{method:`POST`,body:JSON.stringify({prompt:c.trim()})}),u(``),s(!1),t(n===`all`?void 0:n)}finally{h(!1)}}},te=e=>{_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},x=()=>{let e=S.filter(e=>$.has(e.status)).map(e=>e.id);_(new Set(e))},ne=async()=>{if(g.size!==0){y(!0);try{await E(`/tasks/batch-cancel`,{method:`POST`,body:JSON.stringify({taskIds:Array.from(g)})}),_(new Set),t(n===`all`?void 0:n)}finally{y(!1)}}},S=[...e].sort((e,t)=>t.createdAt-e.createdAt),re=Array.from(g).filter(t=>{let n=e.find(e=>e.id===t);return n&&$.has(n.status)});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(le,{title:`Tasks`,description:`Review active execution, cancel work, or create the next task.`,compact:!0,action:(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[g.size>0&&(0,I.jsxs)(T,{variant:`destructive`,size:`sm`,onClick:()=>void ne(),disabled:v||re.length===0,children:[(0,I.jsx)(l,{size:me.sm}),v?`Cancelling...`:`Cancel ${re.length} task${re.length===1?``:`s`}`]}),(0,I.jsx)(T,{variant:`ghost`,size:`sm`,onClick:()=>void t(n===`all`?void 0:n),children:(0,I.jsx)(f,{size:me.sm})}),(0,I.jsxs)(T,{size:`sm`,onClick:()=>s(!o),children:[(0,I.jsx)(i,{size:me.sm}),`New Task`]})]})}),o&&(0,I.jsxs)(j,{className:`flex gap-2`,children:[(0,I.jsx)(`input`,{className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Enter task prompt...`,value:c,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&ee()}}),(0,I.jsx)(T,{onClick:()=>void ee(),disabled:m||!c.trim(),children:m?`Creating...`:`Create`}),(0,I.jsx)(T,{variant:`ghost`,onClick:()=>s(!1),children:`Cancel`})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:justify-between`,children:[(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:et.map(e=>(0,I.jsx)(`button`,{onClick:()=>a(e.value),className:`rounded-md px-2.5 py-1 text-xs font-medium transition-colors ${n===e.value?`bg-[var(--app-panel-elevated)] text-[var(--app-text)]`:`text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:e.label},e.value))}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[S.some(e=>$.has(e.status))&&(0,I.jsx)(`button`,{onClick:x,className:`text-xs text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:`Select all cancellable`}),g.size>0&&(0,I.jsxs)(`button`,{onClick:()=>_(new Set),className:`text-xs text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:[`Clear selection (`,g.size,`)`]})]})]}),S.length===0?(0,I.jsx)(j,{padding:!1,children:(0,I.jsx)(pe,{icon:(0,I.jsx)(r,{size:32}),title:`No tasks found`,description:n===`all`?`Create a task to get started`:`No tasks with status "${n}"`})}):b?(0,I.jsx)(`div`,{className:`space-y-3`,children:S.map(e=>(0,I.jsx)(j,{className:g.has(e.id)?`border-[var(--app-accent)]/40 bg-[var(--app-accent)]/8`:``,children:(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(`div`,{className:`pt-1`,children:$.has(e.status)?(0,I.jsx)(`button`,{onClick:()=>te(e.id),className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${g.has(e.id)?`border-[var(--app-accent-strong)] bg-[var(--app-accent)] text-white`:`border-[var(--app-border-strong)] bg-transparent hover:border-[var(--app-text-muted)]`}`,children:g.has(e.id)&&(0,I.jsx)(d,{size:12})}):(0,I.jsx)(`span`,{className:`inline-block h-4 w-4`})}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,I.jsx)(p,{to:`/tasks/${e.id}`,className:`break-all font-mono text-xs text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:e.id.slice(0,8)}),(0,I.jsx)(`p`,{className:`break-words text-sm font-medium leading-6 text-[var(--app-text)]`,children:de(e.prompt,140)})]}),(0,I.jsx)(A,{variant:O(e.status),children:e.status})]}),(0,I.jsxs)(`div`,{className:`grid gap-2 text-xs text-[var(--app-text-subtle)] sm:grid-cols-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Role`}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[var(--app-text)]`,children:e.roleId?e.roleId.slice(0,12):`—`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Cost`}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[var(--app-text)]`,children:e.costUsd==null?`—`:fe(e.costUsd)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Created`}),(0,I.jsx)(`div`,{className:`mt-1 text-[var(--app-text)]`,children:ue(e.createdAt)})]})]})]})]})},e.id))}):(0,I.jsx)(j,{padding:!1,children:(0,I.jsxs)(ye,{children:[(0,I.jsx)(ge,{children:(0,I.jsxs)(ve,{children:[(0,I.jsx)(N,{className:`w-8`,children:(0,I.jsx)(`button`,{onClick:()=>{g.size>0&&g.size===S.filter(e=>$.has(e.status)).length?_(new Set):x()},className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${g.size>0&&g.size===S.filter(e=>$.has(e.status)).length?`border-[var(--app-accent-strong)] bg-[var(--app-accent)] text-white`:`border-[var(--app-border-strong)] bg-transparent hover:border-[var(--app-text-muted)]`}`,children:g.size>0&&g.size===S.filter(e=>$.has(e.status)).length&&(0,I.jsx)(d,{size:12})})}),(0,I.jsx)(N,{children:`ID`}),(0,I.jsx)(N,{children:`Prompt`}),(0,I.jsx)(N,{children:`Status`}),(0,I.jsx)(N,{children:`Role`}),(0,I.jsx)(N,{children:`Cost`}),(0,I.jsx)(N,{children:`Created`})]})}),(0,I.jsx)(_e,{children:S.map(e=>(0,I.jsxs)(ve,{className:g.has(e.id)?`bg-[var(--app-panel-elevated)]/50`:``,children:[(0,I.jsx)(P,{children:$.has(e.status)?(0,I.jsx)(`button`,{onClick:()=>te(e.id),className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${g.has(e.id)?`border-[var(--app-accent-strong)] bg-[var(--app-accent)] text-white`:`border-[var(--app-border-strong)] bg-transparent hover:border-[var(--app-text-muted)]`}`,children:g.has(e.id)&&(0,I.jsx)(d,{size:12})}):(0,I.jsx)(`span`,{className:`inline-block w-4`})}),(0,I.jsx)(P,{children:(0,I.jsx)(p,{to:`/tasks/${e.id}`,className:`font-mono text-xs text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:e.id.slice(0,8)})}),(0,I.jsx)(P,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`break-words font-medium text-[var(--app-text)]`,children:de(e.prompt,120)}),(0,I.jsxs)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[e.totalDurationMs?fe(e.costUsd??0):`Awaiting completion`,` · `,ue(e.createdAt)]})]})}),(0,I.jsx)(P,{children:(0,I.jsx)(A,{variant:O(e.status),children:e.status})}),(0,I.jsx)(P,{children:(0,I.jsx)(`span`,{className:`font-mono text-xs text-[var(--app-text-subtle)]`,children:e.roleId?e.roleId.slice(0,12):`—`})}),(0,I.jsx)(P,{className:`font-mono text-xs`,children:e.costUsd==null?`—`:fe(e.costUsd)}),(0,I.jsx)(P,{className:`text-xs text-[var(--app-text-subtle)]`,children:ue(e.createdAt)})]},e.id))})]})})]})}function nt(e){return`step-${e+1}`}function rt(){let e=k(e=>e.templates),r=k(e=>e.fetchTemplates),s=k(e=>e.goals),l=k(e=>e.fetchGoals),d=k(e=>e.roles),p=k(e=>e.fetchRoles),[m,h]=(0,F.useState)(!1),[g,v]=(0,F.useState)(``),[b,ee]=(0,F.useState)(`manual`),[S,oe]=(0,F.useState)(``),[se,C]=(0,F.useState)(``),[w,ce]=(0,F.useState)(``),[O,M]=(0,F.useState)([{id:`step-1`,prompt:``}]),[de,fe]=(0,F.useState)(!1),[me,he]=(0,F.useState)(!1),[xe,Ce]=(0,F.useState)(null),[L,R]=(0,F.useState)(null),[z,we]=(0,F.useState)(null),[B,V]=(0,F.useState)(null),[Te,H]=(0,F.useState)(`template_only`),[Ee,De]=(0,F.useState)(!1),[U,Oe]=(0,F.useState)(null),[W,ke]=(0,F.useState)(``),[G,Ae]=(0,F.useState)(`manual`),[je,Me]=(0,F.useState)(``),[Ne,Pe]=(0,F.useState)(``),[Fe,Ie]=(0,F.useState)(``),[Le,K]=(0,F.useState)(``),[Re,ze]=(0,F.useState)(``),[Be,Ve]=(0,F.useState)([]),[q,J]=(0,F.useState)([]),[He,Ue]=(0,F.useState)(!1),[We,Ge]=(0,F.useState)(!1),[Y,Ke]=(0,F.useState)(`prompt`),[X,qe]=(0,F.useState)([]),[Je,Ye]=(0,F.useState)([]),[Xe,Ze]=(0,F.useState)([]),[Qe,$e]=(0,F.useState)(null),[Z,Q]=(0,F.useState)([]),[et,$]=(0,F.useState)(!1),tt=(0,F.useCallback)(async e=>{$(!0);try{let t=await E(`/workflow-executions?templateId=${e}&limit=5`);Q(await Promise.all(t.executions.map(async e=>{try{let t=await E(`/workflow-executions/${e.id}`);return{...t.execution,stepTasks:t.stepTasks}}catch{return{...e,stepTasks:[]}}})))}catch{Q([])}finally{$(!1)}},[]),rt=(0,F.useCallback)(e=>{Qe===e?($e(null),Q([])):($e(e),tt(e))},[Qe,tt]),it=(0,F.useMemo)(()=>Object.fromEntries(e.map(e=>[e.id,e.name])),[e]),at=e=>e.type===`cron`?`Cron: ${e.cron??`—`}`:e.type===`once`?`Once at ${e.runAt?new Date(e.runAt).toLocaleString():`—`}`:e.type===`template_complete`?`When template '${it[e.event?.split(`:`)[1]??``]??`[deleted template]`}' completes`:e.type===`event`?`On event '${Be.find(t=>t.id===e.eventDefId)?.name??`[deleted event]`}'`:e.type;(0,F.useEffect)(()=>{r(),l(),p(),(async()=>{try{Ve(await E(`/event-defs`))}catch{}})()},[r,l,p]);let ot=async()=>{if(g.trim()&&!(Y===`prompt`&&O.every(e=>!e.prompt.trim()))&&!(Y===`goal`&&X.length===0)){he(!0);try{let e={name:g.trim(),trigger:{type:b,...b===`cron`&&se?{cron:se}:{},...b===`once`&&w?{runAt:new Date(w).toISOString()}:{},...b===`template_complete`&&S?{event:`template_complete:${S}`}:{},...b===`event`&&Le?{eventDefId:Le}:{}},enabled:!0,...Je.length>0?{deliverTo:Je}:{},...de?{config:{continueOnError:!0}}:{}};Y===`prompt`?e.steps=O.filter(e=>e.prompt.trim()).map((e,t)=>({id:e.id||nt(t),prompt:e.prompt.trim(),...e.roleId?{roleId:e.roleId}:{},...e.dependsOn&&e.dependsOn.length>0?{dependsOn:e.dependsOn}:{},...e.config&&(e.config.timeout!==void 0||e.config.maxTurns!==void 0)?{config:e.config}:{}})):(e.goalIds=X,e.steps=[]),await E(`/task-templates`,{method:`POST`,body:JSON.stringify(e)}),v(``),M([{id:`step-1`,prompt:``}]),C(``),ce(``),oe(``),K(``),qe([]),Ye([]),h(!1),r()}finally{he(!1)}}},st=async t=>{let n=e.find(e=>e.id===t);Ce(t);try{await E(`/task-templates/${t}/run`,{method:`POST`}),D.success(`Triggered: ${n?.name??t}`)}catch(e){let t=e instanceof Error?e.message:`Failed to trigger template`;D.error(`Trigger failed: ${t}`)}finally{Ce(null)}},ct=async e=>{we(e),H(`template_only`),V(null);try{V((await E(`/task-templates/${e}/dependents`)).dependents)}catch{V({executionCount:0,taskCount:0})}},lt=async(t,n)=>{let i=e.find(e=>e.id===t);De(!0);try{let e=await E(`/task-templates/${t}?mode=${n}`,{method:`DELETE`}),a=[];e.deletedCounts.workflowExecutions>0&&a.push(`${e.deletedCounts.workflowExecutions} execution${e.deletedCounts.workflowExecutions===1?``:`s`}`),e.deletedCounts.tasks>0&&a.push(`${e.deletedCounts.tasks} task${e.deletedCounts.tasks===1?``:`s`}`);let o=a.length?` (+ ${a.join(`, `)})`:``;D.success(`Deleted: ${i?.name??t}${o}`),r()}catch(e){let t=e instanceof Error?e.message:`Failed to delete template`;D.error(`Delete failed: ${t}`)}finally{De(!1)}},ut=async t=>{let n=e.find(e=>e.id===t);if(!n)return;if(![`cron`,`once`,`template_complete`].includes(n.trigger.type)){D.error(`Toggle not applicable for manual triggers`);return}let i=!n.enabled;try{await E(`/task-templates/${t}`,{method:`PATCH`,body:JSON.stringify({enabled:i})}),D.success(`${n.name} ${i?`enabled`:`disabled`}`),r()}catch(e){let t=e instanceof Error?e.message:`Failed to toggle template`;D.error(`Toggle failed: ${t}`)}},dt=e=>{Oe(e.id),ke(e.name),Ae(e.trigger.type===`workflow_complete`?`template_complete`:e.trigger.type),Me(e.trigger.cron??``),Pe(e.trigger.runAt?new Date(e.trigger.runAt).toISOString().slice(0,16):``),J(e.steps.map(e=>({id:e.id,prompt:e.prompt,roleId:e.roleId,dependsOn:e.dependsOn,config:e.config}))),Ue(e.config?.continueOnError??!1),Ze(e.deliverTo??[]),Ie(e.trigger.type===`template_complete`||e.trigger.type===`workflow_complete`?e.trigger.event?.split(`:`)[1]??``:``),ze(e.trigger.eventDefId??``)},ft=async()=>{if(!(!U||!W.trim()||q.every(e=>!e.prompt.trim()))){Ge(!0);try{await E(`/task-templates/${U}`,{method:`PATCH`,body:JSON.stringify({name:W.trim(),trigger:{type:G,...G===`cron`&&je?{cron:je}:{},...G===`once`&&Ne?{runAt:new Date(Ne).toISOString()}:{},...G===`template_complete`&&Fe?{event:`template_complete:${Fe}`}:{},...G===`event`&&Re?{eventDefId:Re}:{}},steps:q.filter(e=>e.prompt.trim()).map((e,t)=>({id:e.id||nt(t),prompt:e.prompt.trim(),...e.roleId?{roleId:e.roleId}:{},...e.dependsOn&&e.dependsOn.length>0?{dependsOn:e.dependsOn}:{},...e.config&&(e.config.timeout!==void 0||e.config.maxTurns!==void 0)?{config:e.config}:{}})),enabled:e.find(e=>e.id===U)?.enabled??!0,...He?{config:{continueOnError:!0}}:{config:{}},deliverTo:Xe.length>0?Xe:void 0})}),Oe(null),r(),D.success(`Template updated`)}catch(e){let t=e instanceof Error?e.message:`Failed to update template`;D.error(t)}finally{Ge(!1)}}},pt=e.find(e=>e.id===L),mt=e.find(e=>e.id===z);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(le,{title:`Automations`,description:`Reusable workflows, manual triggers, and recent workflow runs.`,compact:!0,action:(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(T,{variant:`ghost`,size:`sm`,onClick:()=>void r(),children:(0,I.jsx)(f,{size:14})}),(0,I.jsxs)(T,{size:`sm`,onClick:()=>h(!m),children:[(0,I.jsx)(i,{size:14}),`New Automation`]})]})}),m&&(0,I.jsxs)(j,{className:`space-y-3`,children:[(0,I.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Template name`,value:g,onChange:e=>v(e.target.value)}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Triggered by:`}),(0,I.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:b,onChange:e=>ee(e.target.value),children:[(0,I.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,I.jsx)(`option`,{value:`cron`,children:`Schedule (Cron)`}),(0,I.jsx)(`option`,{value:`once`,children:`One-time`}),(0,I.jsx)(`option`,{value:`template_complete`,children:`Template completion`}),(0,I.jsx)(`option`,{value:`event`,children:`Event (definition)`})]}),b===`template_complete`&&(0,I.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:S,onChange:e=>oe(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select target template --`}),e.filter(e=>e.id!==U).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),b===`event`&&(0,I.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:Le,onChange:e=>K(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select event --`}),Be.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),b===`cron`&&(0,I.jsx)(`input`,{className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Cron expression (e.g. */5 * * * *)`,value:se,onChange:e=>C(e.target.value)}),b===`once`&&(0,I.jsx)(`input`,{type:`datetime-local`,className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:w,onChange:e=>ce(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Action type:`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>Ke(`prompt`),className:`rounded px-2 py-1 text-xs ${Y===`prompt`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:text-[var(--app-text)]`}`,children:`Custom Prompt`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>Ke(`goal`),className:`rounded px-2 py-1 text-xs ${Y===`goal`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:text-[var(--app-text)]`}`,children:`Goal Reference`})]})]}),Y===`prompt`?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Steps`}),(0,I.jsxs)(T,{variant:`ghost`,size:`sm`,onClick:()=>M([...O,{id:nt(O.length),prompt:``}]),children:[(0,I.jsx)(i,{size:12}),` Add Step`]})]}),O.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] p-2 space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--app-text-subtle)]`,children:e.id}),(0,I.jsxs)(`select`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-xs text-[var(--app-text)]`,value:e.roleId??``,onChange:n=>{let r=[...O];r[t]={...e,roleId:n.target.value||void 0},M(r)},children:[(0,I.jsx)(`option`,{value:``,children:`Role (template default)`}),d.filter(e=>e.source!==`system`).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),O.length>1&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>M(O.filter((e,n)=>n!==t)),className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,children:(0,I.jsx)(u,{size:12})})]}),(0,I.jsx)(`textarea`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Step ${t+1} prompt${t>0?` (use {{`+O[t-1].id+`.result}} for prev output)`:``}`,rows:2,value:e.prompt,onChange:n=>{let r=[...O];r[t]={...e,prompt:n.target.value},M(r)}}),t>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`depends on:`}),O.slice(0,t).map(n=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>{let r=e.dependsOn??[],i=[...O];i[t]={...e,dependsOn:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},M(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.dependsOn??[]).includes(n.id)?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:n.id},n.id))]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`timeout(s):`,(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`default`,className:`w-20 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)]`,value:e.config?.timeout??``,onChange:n=>{let r=[...O],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,timeout:i}},M(r)}})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`max turns:`,(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`default`,className:`w-20 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)]`,value:e.config?.maxTurns??``,onChange:n=>{let r=[...O],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,maxTurns:i}},M(r)}})]})]})]},e.id))]}):(0,I.jsx)(`div`,{className:`space-y-1`,children:s.length===0?(0,I.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`No goals available`}):s.map(e=>(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] hover:text-[var(--app-text)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:X.includes(e.id),onChange:t=>{t.target.checked?qe([...X,e.id]):qe(X.filter(t=>t!==e.id))},className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-elevated)]`}),(0,I.jsx)(`span`,{className:`truncate`,children:e.name}),(0,I.jsx)(A,{variant:`muted`,className:`text-[10px]`,children:e.status})]},e.id))}),O.length>1&&(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:de,onChange:e=>fe(e.target.checked),className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-elevated)]`}),`Continue on error (skip failed step dependents, run independent steps)`]}),(0,I.jsx)(Se,{value:Je,onChange:Ye}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(T,{onClick:()=>void ot(),disabled:me||!g.trim()||Y===`prompt`&&O.every(e=>!e.prompt.trim())||Y===`goal`&&X.length===0||b===`template_complete`&&!S,children:me?`Creating...`:`Create`}),(0,I.jsx)(T,{variant:`ghost`,onClick:()=>h(!1),children:`Cancel`})]})]}),U!==null&&(0,I.jsxs)(j,{className:`space-y-3`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:`Edit Automation`}),(0,I.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Template name`,value:W,onChange:e=>ke(e.target.value)}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Triggered by:`}),(0,I.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:G,onChange:e=>Ae(e.target.value),children:[(0,I.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,I.jsx)(`option`,{value:`cron`,children:`Schedule (Cron)`}),(0,I.jsx)(`option`,{value:`once`,children:`One-time`}),(0,I.jsx)(`option`,{value:`template_complete`,children:`Template completion`}),(0,I.jsx)(`option`,{value:`event`,children:`Event (definition)`})]}),G===`template_complete`&&(0,I.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:Fe,onChange:e=>Ie(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select target template --`}),e.filter(e=>e.id!==U).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),G===`event`&&(0,I.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:Re,onChange:e=>ze(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select event --`}),Be.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),G===`cron`&&(0,I.jsx)(`input`,{className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Cron expression`,value:je,onChange:e=>Me(e.target.value)}),G===`once`&&(0,I.jsx)(`input`,{type:`datetime-local`,className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:Ne,onChange:e=>Pe(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Steps`}),(0,I.jsxs)(T,{variant:`ghost`,size:`sm`,onClick:()=>J([...q,{id:nt(q.length),prompt:``}]),children:[(0,I.jsx)(i,{size:12}),` Add Step`]})]}),q.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] p-2 space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--app-text-subtle)]`,children:e.id}),(0,I.jsxs)(`select`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-xs text-[var(--app-text)]`,value:e.roleId??``,onChange:n=>{let r=[...q];r[t]={...e,roleId:n.target.value||void 0},J(r)},children:[(0,I.jsx)(`option`,{value:``,children:`Role (template default)`}),d.filter(e=>e.source!==`system`).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),q.length>1&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>J(q.filter((e,n)=>n!==t)),className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,children:(0,I.jsx)(u,{size:12})})]}),(0,I.jsx)(`textarea`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Step ${t+1} prompt`,rows:2,value:e.prompt,onChange:n=>{let r=[...q];r[t]={...e,prompt:n.target.value},J(r)}}),t>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`depends on:`}),q.slice(0,t).map(n=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>{let r=e.dependsOn??[],i=[...q];i[t]={...e,dependsOn:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},J(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.dependsOn??[]).includes(n.id)?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:n.id},n.id))]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`timeout(s):`,(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`default`,className:`w-20 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)]`,value:e.config?.timeout??``,onChange:n=>{let r=[...q],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,timeout:i}},J(r)}})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`max turns:`,(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`default`,className:`w-20 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)]`,value:e.config?.maxTurns??``,onChange:n=>{let r=[...q],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,maxTurns:i}},J(r)}})]})]})]},e.id))]}),q.length>1&&(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:He,onChange:e=>Ue(e.target.checked),className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-elevated)]`}),`Continue on error`]}),(0,I.jsx)(Se,{value:Xe,onChange:Ze}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(T,{onClick:()=>void ft(),disabled:We||!W.trim()||q.every(e=>!e.prompt.trim()),children:We?`Saving...`:`Save`}),(0,I.jsx)(T,{variant:`ghost`,onClick:()=>Oe(null),children:`Cancel`})]})]}),(0,I.jsx)(j,{padding:!1,children:e.length===0?(0,I.jsx)(pe,{icon:(0,I.jsx)(o,{size:32}),title:`No automations`,description:`Create an automation to run recurring tasks`}):(0,I.jsxs)(ye,{children:[(0,I.jsx)(ge,{children:(0,I.jsxs)(ve,{children:[(0,I.jsx)(N,{children:`Name`}),(0,I.jsx)(N,{children:`Trigger`}),(0,I.jsx)(N,{children:`Schedule`}),(0,I.jsx)(N,{children:`Steps`}),(0,I.jsx)(N,{children:`Enabled`}),(0,I.jsx)(N,{children:`Created`}),(0,I.jsx)(N,{children:`Webhook URL`}),(0,I.jsx)(N,{children:`Actions`})]})}),(0,I.jsx)(_e,{children:e.map(e=>(0,I.jsxs)(F.Fragment,{children:[(0,I.jsxs)(ve,{children:[(0,I.jsx)(P,{className:`font-medium text-[var(--app-text)]`,children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>rt(e.id),className:`flex items-center gap-1 hover:text-[var(--app-accent)] transition-colors`,children:[Qe===e.id?(0,I.jsx)(c,{size:12}):(0,I.jsx)(t,{size:12}),e.name]})}),(0,I.jsx)(P,{children:(0,I.jsx)(A,{variant:e.trigger.type===`cron`?`info`:(e.trigger.type,`muted`),children:at(e.trigger)})}),(0,I.jsx)(P,{className:`font-mono text-xs`,children:e.trigger.type===`once`&&e.trigger.runAt?new Date(e.trigger.runAt).toLocaleString():e.trigger.cron??`—`}),(0,I.jsx)(P,{className:`font-mono text-xs`,children:e.goalIds&&e.goalIds.length>0?`Goals: ${e.goalIds.length}`:(()=>{let t=new Set(e.steps.filter(e=>e.roleId).map(e=>e.roleId));return t.size>0?`${e.steps.length} steps / ${t.size} roles`:String(e.steps.length)})()}),(0,I.jsx)(P,{children:[`cron`,`once`,`template_complete`].every(t=>e.trigger.type!==t)?(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`—`}):(0,I.jsx)(be,{checked:e.enabled,onCheckedChange:()=>void ut(e.id),"aria-label":`Toggle ${e.name}`})}),(0,I.jsx)(P,{className:`text-xs text-[var(--app-text-subtle)]`,children:e.createdAt?ue(e.createdAt):`—`}),(0,I.jsx)(P,{className:`font-mono text-xs text-[var(--app-text-muted)]`,children:e.enabled?`POST /webhooks/${e.id}`:`—`}),(0,I.jsx)(P,{children:(0,I.jsxs)(`div`,{className:`flex gap-1`,children:[(0,I.jsx)(T,{variant:`ghost`,size:`sm`,onClick:()=>dt(e),title:`Edit`,children:(0,I.jsx)(n,{size:12})}),(0,I.jsx)(T,{variant:`ghost`,size:`sm`,onClick:()=>R(e.id),disabled:xe===e.id,title:`Run now`,children:(0,I.jsx)(a,{size:12})}),(0,I.jsx)(T,{variant:`ghost`,size:`sm`,className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,onClick:()=>{ct(e.id)},title:`Delete`,children:(0,I.jsx)(u,{size:12})})]})})]}),Qe===e.id&&(0,I.jsx)(ve,{children:(0,I.jsxs)(P,{colSpan:8,className:`bg-[var(--app-panel)]/50 p-3`,children:[(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-muted)] mb-2 font-medium`,children:`Recent Executions`}),et?(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Loading...`}):Z.length===0?(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`No executions yet`}):(0,I.jsx)(`div`,{className:`space-y-1.5`,children:Z.map(t=>{let n=Object.entries(t.stepStatuses),r=n.filter(([,e])=>e.status===`completed`).length,i=n.filter(([,e])=>e.status===`failed`).length,a=n.filter(([,e])=>e.status===`skipped`).length,o=n.filter(([,e])=>e.status===`cancelled`).length,s=n.length,c=new Map(t.stepTasks.filter(e=>e.stepId).map(e=>[e.stepId,e])),l=[...e.steps.map(e=>e.id),...Object.keys(t.stepStatuses).filter(t=>!e.steps.some(e=>e.id===t))];return(0,I.jsxs)(`div`,{className:`rounded border border-[var(--app-border)] bg-[var(--app-canvas)]/50 p-2.5 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(A,{variant:t.status===`completed`?`success`:t.status===`failed`?`destructive`:t.status===`partial`?`warning`:t.status===`cancelled`?`secondary`:`muted`,children:t.status}),(0,I.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:new Date(t.startedAt).toLocaleString()}),s>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[r,`/`,s,` steps`,(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[i>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-danger)]`,children:[i,` failed`]}),a>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-warning)]`,children:[a,` skipped`]}),o>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text)]`,children:[o,` cancelled`]})]})]}),t.completedAt&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[Math.round((t.completedAt-t.startedAt)/1e3),`s`]}),(0,I.jsx)(`span`,{className:`font-mono text-[var(--app-text-subtle)] truncate max-w-[120px]`,children:t.id.slice(0,8)})]}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:l.map(n=>{let r=t.stepStatuses[n];if(!r)return null;let i=e.steps.find(e=>e.id===n),a=c.get(n),o=a?.roleId??r.roleId??i?.roleId,s=d.find(e=>e.id===o)?.name??o,l=a?.error??r.error??a?.result??r.result;return(0,I.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto_auto] gap-2 rounded bg-[var(--app-panel)]/60 px-2 py-1.5 text-xs`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:n}),s&&(0,I.jsxs)(`span`,{className:`text-[var(--app-warning-soft-text)]`,children:[`@`,s]}),i?.dependsOn&&i.dependsOn.length>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`after `,i.dependsOn.join(`, `)]})]}),l&&(0,I.jsx)(`div`,{className:`mt-1 truncate ${r.status===`failed`?`text-[var(--app-danger-soft-text)]`:r.status===`skipped`?`text-[var(--app-warning-soft-text)]`:r.status===`cancelled`?`text-[var(--app-text)]`:`text-[var(--app-text-muted)]`}`,children:l})]}),(0,I.jsx)(A,{variant:r.status===`completed`?`success`:r.status===`failed`?`destructive`:r.status===`skipped`?`warning`:r.status===`cancelled`?`secondary`:`muted`,children:r.status}),(0,I.jsxs)(`div`,{className:`text-right text-[var(--app-text-subtle)]`,children:[a?.completedAt&&(0,I.jsxs)(`div`,{children:[Math.max(0,Math.round((a.completedAt-a.createdAt)/1e3)),`s`]}),a?.id&&(0,I.jsx)(`div`,{className:`font-mono`,children:a.id.slice(0,8)})]})]},`${t.id}-${n}`)})})]},t.id)})})]})})]},e.id))})]})}),(0,I.jsx)(ae,{open:L!==null,onOpenChange:e=>{e||R(null)},children:(0,I.jsxs)(te,{children:[(0,I.jsxs)(ie,{children:[(0,I.jsx)(y,{children:`Run Template`}),(0,I.jsxs)(_,{children:[`Run “`,pt?.name,`” now? This will execute the template immediately.`]})]}),(0,I.jsxs)(ne,{children:[(0,I.jsx)(re,{children:`Cancel`}),(0,I.jsx)(x,{onClick:()=>{L&&st(L),R(null)},children:`Run Now`})]})]})}),(0,I.jsx)(ae,{open:z!==null,onOpenChange:e=>{e||(we(null),V(null),H(`template_only`))},children:(0,I.jsxs)(te,{children:[(0,I.jsxs)(ie,{children:[(0,I.jsx)(y,{children:`Delete Template`}),(0,I.jsx)(_,{children:B===null?(0,I.jsx)(I.Fragment,{children:`Loading…`}):B.taskCount===0&&B.executionCount===0?(0,I.jsxs)(I.Fragment,{children:[`Delete “`,mt?.name,`”? This action cannot be undone.`]}):B.taskCount===0?(0,I.jsxs)(I.Fragment,{children:[`“`,mt?.name,`” has `,B.executionCount,` execution`,B.executionCount===1?``:`s`,` which will be removed. Delete?`]}):(0,I.jsxs)(I.Fragment,{children:[`“`,mt?.name,`” has`,` `,B.executionCount>0&&(0,I.jsxs)(I.Fragment,{children:[B.executionCount,` execution`,B.executionCount===1?``:`s`]}),B.executionCount>0&&B.taskCount>0&&` and `,B.taskCount,` task`,B.taskCount===1?``:`s`,`. Choose what to delete:`]})})]}),B!==null&&B.taskCount>0&&(0,I.jsxs)(`div`,{className:`space-y-2 px-1`,children:[(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,I.jsx)(`input`,{type:`radio`,name:`deleteMode`,value:`template_only`,checked:Te===`template_only`,onChange:()=>H(`template_only`),className:`mt-1`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Template only`}),(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Removes the automation. Tasks remain under the Tasks tab as history.`})]})]}),(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,I.jsx)(`input`,{type:`radio`,name:`deleteMode`,value:`with_tasks`,checked:Te===`with_tasks`,onChange:()=>H(`with_tasks`),className:`mt-1`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Template and its tasks`}),(0,I.jsxs)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`Also deletes `,B.taskCount,` task`,B.taskCount===1?``:`s`,` and their score history. Cannot be undone.`]})]})]})]}),(0,I.jsxs)(ne,{children:[(0,I.jsx)(re,{disabled:Ee,children:`Cancel`}),(0,I.jsx)(x,{className:`bg-[var(--app-danger)] hover:bg-[var(--app-danger)]`,disabled:Ee||B===null,onClick:()=>{z&&lt(z,B&&B.taskCount>0?Te:`template_only`),we(null),V(null),H(`template_only`)},children:`Delete`})]})]})})]})}function it(){let{tasks:e,templates:t,goals:n}=k(ce(e=>({tasks:e.tasks,templates:e.templates,goals:e.goals}))),r=k(e=>e.fetchTasks),i=k(e=>e.fetchTemplates),a=k(e=>e.fetchGoals);return(0,F.useEffect)(()=>{r(),i(),a()},[r,i,a]),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(M,{eyebrow:`Operations`,title:`Work`,description:`Tasks, automations, and goals in one place.`,metrics:[{label:`Running`,value:e.filter(e=>e.status===`running`).length},{label:`Automations`,value:t.length},{label:`Goals`,value:n.length}],compact:!0}),(0,I.jsxs)(Qe,{defaultValue:`tasks`,children:[(0,I.jsxs)($e,{children:[(0,I.jsx)(Z,{value:`tasks`,children:`Tasks`}),(0,I.jsx)(Z,{value:`automations`,children:`Automations`}),(0,I.jsx)(Z,{value:`goals`,children:`Goals`})]}),(0,I.jsx)(Q,{value:`tasks`,children:(0,I.jsx)(tt,{})}),(0,I.jsx)(Q,{value:`automations`,children:(0,I.jsx)(rt,{})}),(0,I.jsx)(Q,{value:`goals`,children:(0,I.jsx)(xe,{})})]})]})}export{it as Work};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-Dw2cE7zH.js";var t=e({AUTH_STORAGE_KEY:()=>r,ApiError:()=>n,api:()=>c,clearStoredApiKey:()=>o,fetchDeliveryLog:()=>l,getStoredApiKey:()=>i,redirectToLogin:()=>s,rotateApiKey:()=>d,setStoredApiKey:()=>a,verifyApiKey:()=>u}),n=class extends Error{status;code;constructor(e,t,n){super(n),this.name=`ApiError`,this.status=e,this.code=t}},r=`adam_api_key`;function i(){return typeof localStorage<`u`?localStorage.getItem(r):null}function a(e){localStorage.setItem(r,e)}function o(){localStorage.removeItem(r)}function s(){if(typeof window>`u`||window.location.pathname===`/ui/login`)return;let e=encodeURIComponent(window.location.pathname+window.location.search);window.location.href=`/ui/login?returnTo=${e}`}async function c(e,t){let r=i(),a={...t?.headers,...r?{"x-api-key":r}:{}};t?.body&&(a[`Content-Type`]??=`application/json`);let c=await fetch(e,{...t,headers:a});if(!c.ok){let e=`UNKNOWN_ERROR`,t=c.statusText;try{let n=await c.json();e=n.code??e,t=n.message??t}catch{}throw c.status===401&&(o(),s()),new n(c.status,e,t)}if(c.status!==204)return c.json()}async function l(e,t=50){return(await c(`/tasks/${e}/delivery-log?limit=${t}`)).logs}async function u(e){return(await fetch(`/auth/verify`,{headers:{"x-api-key":e}})).ok}async function d(){return(await c(`/auth/rotate`,{method:`POST`})).apiKey}export{i as a,a as c,l as i,u as l,t as n,s as o,o as r,d as s,c as t};
@@ -1 +1 @@
1
- function e(t){var n,r,i=``;if(typeof t==`string`||typeof t==`number`)i+=t;else if(typeof t==`object`)if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=` `),i+=r)}else for(r in t)t[r]&&(i&&(i+=` `),i+=r);return i}function t(){for(var t,n,r=0,i=``,a=arguments.length;r<a;r++)(t=arguments[r])&&(n=e(t))&&(i&&(i+=` `),i+=n);return i}var n=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},r=(e,t)=>({classGroupId:e,validator:t}),i=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),a=`-`,o=[],s=`arbitrary..`,c=e=>{let t=ee(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return u(e);let n=e.split(a);return l(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=i[e],a=r[e];return t?a?n(a,t):t:a||o}return r[e]||o}}},l=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=l(e,t+1,i);if(n)return n}let o=n.validators;if(o===null)return;let s=t===0?e.join(a):e.slice(t).join(a),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.validator(s))return t.classGroupId}},u=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?s+r:void 0})(),ee=e=>{let{theme:t,classGroups:n}=e;return d(n,t)},d=(e,t)=>{let n=i();for(let r in e){let i=e[r];f(i,n,r,t)}return n},f=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];p(i,t,n,r)}},p=(e,t,n,r)=>{if(typeof e==`string`){m(e,t,n);return}if(typeof e==`function`){h(e,t,n,r);return}g(e,t,n,r)},m=(e,t,n)=>{let r=e===``?t:_(t,e);r.classGroupId=n},h=(e,t,n,i)=>{if(v(e)){f(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(r(n,e))},g=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];f(o,_(t,a),n,r)}},_=(e,t)=>{let n=e,r=t.split(a),o=r.length;for(let e=0;e<o;e++){let t=r[e],a=n.nextPart.get(t);a||(a=i(),n.nextPart.set(t,a)),n=a}return n},v=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,y=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},b=`!`,x=`:`,S=[],C=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),w=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===x){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(b)?(c=s.slice(0,-1),l=!0):s.startsWith(b)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return C(t,l,c,u)};if(t){let e=t+x,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):C(S,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},te=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ne=e=>({cache:y(e.cacheSize),parseClassName:w(e),sortModifiers:te(e),...c(e)}),T=/\s+/,re=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(T),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:ee,baseClassName:d,maybePostfixModifierPosition:f}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let p=!!f,m=r(p?d.substring(0,f):d);if(!m){if(!p){c=t+(c.length>0?` `+c:c);continue}if(m=r(d),!m){c=t+(c.length>0?` `+c:c);continue}p=!1}let h=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),g=ee?h+b:h,_=g+m;if(o.indexOf(_)>-1)continue;o.push(_);let v=i(m,p);for(let e=0;e<v.length;++e){let t=v[e];o.push(g+t)}c=t+(c.length>0?` `+c:c)}return c},E=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=D(n))&&(i&&(i+=` `),i+=r);return i},D=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=D(e[r]))&&(n&&(n+=` `),n+=t);return n},O=(e,...t)=>{let n,r,i,a,o=o=>(n=ne(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=re(e,n);return i(e,a),a};return a=o,(...e)=>a(E(...e))},k=[],A=e=>{let t=t=>t[e]||k;return t.isThemeGetter=!0,t},j=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M=/^\((?:(\w[\w-]*):)?(.+)\)$/i,N=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ae=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,oe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,P=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I=e=>N.test(e),L=e=>!!e&&!Number.isNaN(Number(e)),R=e=>!!e&&Number.isInteger(Number(e)),se=e=>e.endsWith(`%`)&&L(e.slice(0,-1)),z=e=>ie.test(e),ce=()=>!0,B=e=>ae.test(e)&&!oe.test(e),V=()=>!1,le=e=>P.test(e),H=e=>F.test(e),ue=e=>!U(e)&&!K(e),de=e=>Y(e,$,V),U=e=>j.test(e),W=e=>Y(e,Se,B),fe=e=>Y(e,Ce,L),pe=e=>Y(e,Te,ce),me=e=>Y(e,we,V),he=e=>Y(e,Z,V),ge=e=>Y(e,Q,H),G=e=>Y(e,Ee,le),K=e=>M.test(e),q=e=>X(e,Se),_e=e=>X(e,we),ve=e=>X(e,Z),ye=e=>X(e,$),be=e=>X(e,Q),J=e=>X(e,Ee,!0),xe=e=>X(e,Te,!0),Y=(e,t,n)=>{let r=j.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},X=(e,t,n=!1)=>{let r=M.exec(e);return r?r[1]?t(r[1]):n:!1},Z=e=>e===`position`||e===`percentage`,Q=e=>e===`image`||e===`url`,$=e=>e===`length`||e===`size`||e===`bg-size`,Se=e=>e===`length`,Ce=e=>e===`number`,we=e=>e===`family-name`,Te=e=>e===`number`||e===`weight`,Ee=e=>e===`shadow`,De=O(()=>{let e=A(`color`),t=A(`font`),n=A(`text`),r=A(`font-weight`),i=A(`tracking`),a=A(`leading`),o=A(`breakpoint`),s=A(`container`),c=A(`spacing`),l=A(`radius`),u=A(`shadow`),ee=A(`inset-shadow`),d=A(`text-shadow`),f=A(`drop-shadow`),p=A(`blur`),m=A(`perspective`),h=A(`aspect`),g=A(`ease`),_=A(`animate`),v=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],y=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],b=()=>[...y(),K,U],x=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[K,U,c],w=()=>[I,`full`,`auto`,...C()],te=()=>[R,`none`,`subgrid`,K,U],ne=()=>[`auto`,{span:[`full`,R,K,U]},R,K,U],T=()=>[R,`auto`,K,U],re=()=>[`auto`,`min`,`max`,`fr`,K,U],E=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],D=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],O=()=>[`auto`,...C()],k=()=>[I,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],j=()=>[I,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],M=()=>[I,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],N=()=>[e,K,U],ie=()=>[...y(),ve,he,{position:[K,U]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,ye,de,{size:[K,U]}],P=()=>[se,q,W],F=()=>[``,`none`,`full`,l,K,U],B=()=>[``,L,q,W],V=()=>[`solid`,`dashed`,`dotted`,`double`],le=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],H=()=>[L,se,ve,he],Y=()=>[``,`none`,p,K,U],X=()=>[`none`,L,K,U],Z=()=>[`none`,L,K,U],Q=()=>[L,K,U],$=()=>[I,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[z],breakpoint:[z],color:[ce],container:[z],"drop-shadow":[z],ease:[`in`,`out`,`in-out`],font:[ue],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[z],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[z],shadow:[z],spacing:[`px`,L],text:[z],"text-shadow":[z],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,I,U,K,h]}],container:[`container`],columns:[{columns:[L,U,K,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[R,`auto`,K,U]}],basis:[{basis:[I,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[L,I,`auto`,`initial`,`none`,U]}],grow:[{grow:[``,L,K,U]}],shrink:[{shrink:[``,L,K,U]}],order:[{order:[R,`first`,`last`,`none`,K,U]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...E(),`normal`]}],"justify-items":[{"justify-items":[...D(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...D()]}],"align-content":[{content:[`normal`,...E()]}],"align-items":[{items:[...D(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...D(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...D(),`baseline`]}],"place-self":[{"place-self":[`auto`,...D()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:k()}],"inline-size":[{inline:[`auto`,...j()]}],"min-inline-size":[{"min-inline":[`auto`,...j()]}],"max-inline-size":[{"max-inline":[`none`,...j()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...k()]}],"min-w":[{"min-w":[s,`screen`,`none`,...k()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...k()]}],h:[{h:[`screen`,`lh`,...k()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...k()]}],"max-h":[{"max-h":[`screen`,`lh`,...k()]}],"font-size":[{text:[`base`,n,q,W]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,xe,pe]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,se,U]}],"font-family":[{font:[_e,me,t]}],"font-features":[{"font-features":[U]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,K,U]}],"line-clamp":[{"line-clamp":[L,`none`,K,fe]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,K,U]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,U]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...V(),`wavy`]}],"text-decoration-thickness":[{decoration:[L,`from-font`,`auto`,K,W]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[L,`auto`,K,U]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,U]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,U]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},R,K,U],radial:[``,K,U],conic:[R,K,U]},be,ge]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-bs":[{"border-bs":B()}],"border-w-be":[{"border-be":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":B()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...V(),`hidden`,`none`]}],"divide-style":[{divide:[...V(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...V(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[L,K,U]}],"outline-w":[{outline:[``,L,q,W]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,J,G]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,ee,J,G]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:B()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[L,W]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,d,J,G]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[L,K,U]}],"mix-blend":[{"mix-blend":[...le(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[L]}],"mask-image-linear-from-pos":[{"mask-linear-from":H()}],"mask-image-linear-to-pos":[{"mask-linear-to":H()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":H()}],"mask-image-t-to-pos":[{"mask-t-to":H()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":H()}],"mask-image-r-to-pos":[{"mask-r-to":H()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":H()}],"mask-image-b-to-pos":[{"mask-b-to":H()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":H()}],"mask-image-l-to-pos":[{"mask-l-to":H()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":H()}],"mask-image-x-to-pos":[{"mask-x-to":H()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":H()}],"mask-image-y-to-pos":[{"mask-y-to":H()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[K,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":H()}],"mask-image-radial-to-pos":[{"mask-radial-to":H()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[L]}],"mask-image-conic-from-pos":[{"mask-conic-from":H()}],"mask-image-conic-to-pos":[{"mask-conic-to":H()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,U]}],filter:[{filter:[``,`none`,K,U]}],blur:[{blur:Y()}],brightness:[{brightness:[L,K,U]}],contrast:[{contrast:[L,K,U]}],"drop-shadow":[{"drop-shadow":[``,`none`,f,J,G]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,L,K,U]}],"hue-rotate":[{"hue-rotate":[L,K,U]}],invert:[{invert:[``,L,K,U]}],saturate:[{saturate:[L,K,U]}],sepia:[{sepia:[``,L,K,U]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,U]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[L,K,U]}],"backdrop-contrast":[{"backdrop-contrast":[L,K,U]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,L,K,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[L,K,U]}],"backdrop-invert":[{"backdrop-invert":[``,L,K,U]}],"backdrop-opacity":[{"backdrop-opacity":[L,K,U]}],"backdrop-saturate":[{"backdrop-saturate":[L,K,U]}],"backdrop-sepia":[{"backdrop-sepia":[``,L,K,U]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,U]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[L,`initial`,K,U]}],ease:[{ease:[`linear`,`initial`,g,K,U]}],delay:[{delay:[L,K,U]}],animate:[{animate:[`none`,_,K,U]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[m,K,U]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":[`scale-3d`],skew:[{skew:Q()}],"skew-x":[{"skew-x":Q()}],"skew-y":[{"skew-y":Q()}],transform:[{transform:[K,U,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:$()}],"translate-x":[{"translate-x":$()}],"translate-y":[{"translate-y":$()}],"translate-z":[{"translate-z":$()}],"translate-none":[`translate-none`],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,U]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,K,U]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[L,q,W,fe]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Oe(...e){return De(t(e))}var ke=class extends Error{status;code;constructor(e,t,n){super(n),this.name=`ApiError`,this.status=e,this.code=t}};async function Ae(e,t){let n=typeof localStorage<`u`?localStorage.getItem(`adam_api_key`):null,r={...t?.headers,...n?{"x-api-key":n}:{}};t?.body&&(r[`Content-Type`]??=`application/json`);let i=await fetch(e,{...t,headers:r});if(!i.ok){let e=`UNKNOWN_ERROR`,t=i.statusText;try{let n=await i.json();e=n.code??e,t=n.message??t}catch{}throw new ke(i.status,e,t)}if(i.status!==204)return i.json()}async function je(e,t=50){return(await Ae(`/tasks/${e}/delivery-log?limit=${t}`)).logs}var Me=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ne=t,Pe=(e,t)=>n=>{if(t?.variants==null)return Ne(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Me(t)||Me(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ne(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};export{t as a,Oe as i,Ae as n,je as r,Pe as t};
1
+ function e(t){var n,r,i=``;if(typeof t==`string`||typeof t==`number`)i+=t;else if(typeof t==`object`)if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=` `),i+=r)}else for(r in t)t[r]&&(i&&(i+=` `),i+=r);return i}function t(){for(var t,n,r=0,i=``,a=arguments.length;r<a;r++)(t=arguments[r])&&(n=e(t))&&(i&&(i+=` `),i+=n);return i}var n=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},r=(e,t)=>({classGroupId:e,validator:t}),i=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),a=`-`,o=[],s=`arbitrary..`,c=e=>{let t=ee(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return u(e);let n=e.split(a);return l(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=i[e],a=r[e];return t?a?n(a,t):t:a||o}return r[e]||o}}},l=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=l(e,t+1,i);if(n)return n}let o=n.validators;if(o===null)return;let s=t===0?e.join(a):e.slice(t).join(a),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.validator(s))return t.classGroupId}},u=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?s+r:void 0})(),ee=e=>{let{theme:t,classGroups:n}=e;return d(n,t)},d=(e,t)=>{let n=i();for(let r in e){let i=e[r];f(i,n,r,t)}return n},f=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];p(i,t,n,r)}},p=(e,t,n,r)=>{if(typeof e==`string`){m(e,t,n);return}if(typeof e==`function`){h(e,t,n,r);return}g(e,t,n,r)},m=(e,t,n)=>{let r=e===``?t:_(t,e);r.classGroupId=n},h=(e,t,n,i)=>{if(v(e)){f(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(r(n,e))},g=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];f(o,_(t,a),n,r)}},_=(e,t)=>{let n=e,r=t.split(a),o=r.length;for(let e=0;e<o;e++){let t=r[e],a=n.nextPart.get(t);a||(a=i(),n.nextPart.set(t,a)),n=a}return n},v=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,y=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},b=`!`,x=`:`,S=[],C=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),w=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===x){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(b)?(c=s.slice(0,-1),l=!0):s.startsWith(b)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return C(t,l,c,u)};if(t){let e=t+x,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):C(S,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},te=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ne=e=>({cache:y(e.cacheSize),parseClassName:w(e),sortModifiers:te(e),...c(e)}),T=/\s+/,re=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(T),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:ee,baseClassName:d,maybePostfixModifierPosition:f}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let p=!!f,m=r(p?d.substring(0,f):d);if(!m){if(!p){c=t+(c.length>0?` `+c:c);continue}if(m=r(d),!m){c=t+(c.length>0?` `+c:c);continue}p=!1}let h=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),g=ee?h+b:h,_=g+m;if(o.indexOf(_)>-1)continue;o.push(_);let v=i(m,p);for(let e=0;e<v.length;++e){let t=v[e];o.push(g+t)}c=t+(c.length>0?` `+c:c)}return c},E=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=D(n))&&(i&&(i+=` `),i+=r);return i},D=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=D(e[r]))&&(n&&(n+=` `),n+=t);return n},O=(e,...t)=>{let n,r,i,a,o=o=>(n=ne(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=re(e,n);return i(e,a),a};return a=o,(...e)=>a(E(...e))},k=[],A=e=>{let t=t=>t[e]||k;return t.isThemeGetter=!0,t},j=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M=/^\((?:(\w[\w-]*):)?(.+)\)$/i,N=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ae=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,oe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,P=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I=e=>N.test(e),L=e=>!!e&&!Number.isNaN(Number(e)),R=e=>!!e&&Number.isInteger(Number(e)),se=e=>e.endsWith(`%`)&&L(e.slice(0,-1)),z=e=>ie.test(e),ce=()=>!0,B=e=>ae.test(e)&&!oe.test(e),V=()=>!1,le=e=>P.test(e),H=e=>F.test(e),ue=e=>!U(e)&&!K(e),de=e=>Y(e,$,V),U=e=>j.test(e),W=e=>Y(e,Se,B),fe=e=>Y(e,Ce,L),pe=e=>Y(e,Te,ce),me=e=>Y(e,we,V),he=e=>Y(e,Z,V),ge=e=>Y(e,Q,H),G=e=>Y(e,Ee,le),K=e=>M.test(e),q=e=>X(e,Se),_e=e=>X(e,we),ve=e=>X(e,Z),ye=e=>X(e,$),be=e=>X(e,Q),J=e=>X(e,Ee,!0),xe=e=>X(e,Te,!0),Y=(e,t,n)=>{let r=j.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},X=(e,t,n=!1)=>{let r=M.exec(e);return r?r[1]?t(r[1]):n:!1},Z=e=>e===`position`||e===`percentage`,Q=e=>e===`image`||e===`url`,$=e=>e===`length`||e===`size`||e===`bg-size`,Se=e=>e===`length`,Ce=e=>e===`number`,we=e=>e===`family-name`,Te=e=>e===`number`||e===`weight`,Ee=e=>e===`shadow`,De=O(()=>{let e=A(`color`),t=A(`font`),n=A(`text`),r=A(`font-weight`),i=A(`tracking`),a=A(`leading`),o=A(`breakpoint`),s=A(`container`),c=A(`spacing`),l=A(`radius`),u=A(`shadow`),ee=A(`inset-shadow`),d=A(`text-shadow`),f=A(`drop-shadow`),p=A(`blur`),m=A(`perspective`),h=A(`aspect`),g=A(`ease`),_=A(`animate`),v=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],y=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],b=()=>[...y(),K,U],x=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[K,U,c],w=()=>[I,`full`,`auto`,...C()],te=()=>[R,`none`,`subgrid`,K,U],ne=()=>[`auto`,{span:[`full`,R,K,U]},R,K,U],T=()=>[R,`auto`,K,U],re=()=>[`auto`,`min`,`max`,`fr`,K,U],E=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],D=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],O=()=>[`auto`,...C()],k=()=>[I,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],j=()=>[I,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],M=()=>[I,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],N=()=>[e,K,U],ie=()=>[...y(),ve,he,{position:[K,U]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,ye,de,{size:[K,U]}],P=()=>[se,q,W],F=()=>[``,`none`,`full`,l,K,U],B=()=>[``,L,q,W],V=()=>[`solid`,`dashed`,`dotted`,`double`],le=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],H=()=>[L,se,ve,he],Y=()=>[``,`none`,p,K,U],X=()=>[`none`,L,K,U],Z=()=>[`none`,L,K,U],Q=()=>[L,K,U],$=()=>[I,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[z],breakpoint:[z],color:[ce],container:[z],"drop-shadow":[z],ease:[`in`,`out`,`in-out`],font:[ue],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[z],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[z],shadow:[z],spacing:[`px`,L],text:[z],"text-shadow":[z],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,I,U,K,h]}],container:[`container`],columns:[{columns:[L,U,K,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[R,`auto`,K,U]}],basis:[{basis:[I,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[L,I,`auto`,`initial`,`none`,U]}],grow:[{grow:[``,L,K,U]}],shrink:[{shrink:[``,L,K,U]}],order:[{order:[R,`first`,`last`,`none`,K,U]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...E(),`normal`]}],"justify-items":[{"justify-items":[...D(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...D()]}],"align-content":[{content:[`normal`,...E()]}],"align-items":[{items:[...D(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...D(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...D(),`baseline`]}],"place-self":[{"place-self":[`auto`,...D()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:k()}],"inline-size":[{inline:[`auto`,...j()]}],"min-inline-size":[{"min-inline":[`auto`,...j()]}],"max-inline-size":[{"max-inline":[`none`,...j()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...k()]}],"min-w":[{"min-w":[s,`screen`,`none`,...k()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...k()]}],h:[{h:[`screen`,`lh`,...k()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...k()]}],"max-h":[{"max-h":[`screen`,`lh`,...k()]}],"font-size":[{text:[`base`,n,q,W]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,xe,pe]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,se,U]}],"font-family":[{font:[_e,me,t]}],"font-features":[{"font-features":[U]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,K,U]}],"line-clamp":[{"line-clamp":[L,`none`,K,fe]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,K,U]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,U]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...V(),`wavy`]}],"text-decoration-thickness":[{decoration:[L,`from-font`,`auto`,K,W]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[L,`auto`,K,U]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,U]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,U]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},R,K,U],radial:[``,K,U],conic:[R,K,U]},be,ge]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-bs":[{"border-bs":B()}],"border-w-be":[{"border-be":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":B()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...V(),`hidden`,`none`]}],"divide-style":[{divide:[...V(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...V(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[L,K,U]}],"outline-w":[{outline:[``,L,q,W]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,J,G]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,ee,J,G]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:B()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[L,W]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,d,J,G]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[L,K,U]}],"mix-blend":[{"mix-blend":[...le(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[L]}],"mask-image-linear-from-pos":[{"mask-linear-from":H()}],"mask-image-linear-to-pos":[{"mask-linear-to":H()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":H()}],"mask-image-t-to-pos":[{"mask-t-to":H()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":H()}],"mask-image-r-to-pos":[{"mask-r-to":H()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":H()}],"mask-image-b-to-pos":[{"mask-b-to":H()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":H()}],"mask-image-l-to-pos":[{"mask-l-to":H()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":H()}],"mask-image-x-to-pos":[{"mask-x-to":H()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":H()}],"mask-image-y-to-pos":[{"mask-y-to":H()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[K,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":H()}],"mask-image-radial-to-pos":[{"mask-radial-to":H()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[L]}],"mask-image-conic-from-pos":[{"mask-conic-from":H()}],"mask-image-conic-to-pos":[{"mask-conic-to":H()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,U]}],filter:[{filter:[``,`none`,K,U]}],blur:[{blur:Y()}],brightness:[{brightness:[L,K,U]}],contrast:[{contrast:[L,K,U]}],"drop-shadow":[{"drop-shadow":[``,`none`,f,J,G]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,L,K,U]}],"hue-rotate":[{"hue-rotate":[L,K,U]}],invert:[{invert:[``,L,K,U]}],saturate:[{saturate:[L,K,U]}],sepia:[{sepia:[``,L,K,U]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,U]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[L,K,U]}],"backdrop-contrast":[{"backdrop-contrast":[L,K,U]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,L,K,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[L,K,U]}],"backdrop-invert":[{"backdrop-invert":[``,L,K,U]}],"backdrop-opacity":[{"backdrop-opacity":[L,K,U]}],"backdrop-saturate":[{"backdrop-saturate":[L,K,U]}],"backdrop-sepia":[{"backdrop-sepia":[``,L,K,U]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,U]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[L,`initial`,K,U]}],ease:[{ease:[`linear`,`initial`,g,K,U]}],delay:[{delay:[L,K,U]}],animate:[{animate:[`none`,_,K,U]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[m,K,U]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":[`scale-3d`],skew:[{skew:Q()}],"skew-x":[{"skew-x":Q()}],"skew-y":[{"skew-y":Q()}],transform:[{transform:[K,U,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:$()}],"translate-x":[{"translate-x":$()}],"translate-y":[{"translate-y":$()}],"translate-z":[{"translate-z":$()}],"translate-none":[`translate-none`],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,U]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,K,U]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[L,q,W,fe]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Oe(...e){return De(t(e))}var ke=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ae=t,je=(e,t)=>n=>{if(t?.variants==null)return Ae(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ke(t)||ke(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ae(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};export{Oe as n,t as r,je as t};