@overlordai/server 1.0.13 → 1.0.15

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 (59) hide show
  1. package/dist/auth/auth.module.js +1 -1
  2. package/dist/auth/auth.module.js.map +1 -1
  3. package/dist/common/error-filter.d.ts.map +1 -1
  4. package/dist/common/error-filter.js +16 -0
  5. package/dist/common/error-filter.js.map +1 -1
  6. package/dist/main.js +3 -2
  7. package/dist/main.js.map +1 -1
  8. package/package.json +4 -3
  9. package/public/assets/AccessTokensPage-BNaz9M2D.js +1 -0
  10. package/public/assets/AdminPage-BK3yXUTo.js +1 -0
  11. package/public/assets/ApiReferencePage-B5840y13.js +1 -0
  12. package/public/assets/AuditLogPage-CTyPeBTm.js +11 -0
  13. package/public/assets/BotManage-CfcannzE.js +6 -0
  14. package/public/assets/CliReferencePage-BkFni7kH.js +4 -0
  15. package/public/assets/DeveloperManage-qek3ScKE.js +16 -0
  16. package/public/assets/EditProjectPage-BJ1h9Teb.js +2 -0
  17. package/public/assets/EmptyState-BPAoLpts.js +6 -0
  18. package/public/assets/HomePage-BolSOHNk.js +1 -0
  19. package/public/assets/LandingPage-Bd51R0zG.js +26 -0
  20. package/public/assets/LoginPage-pvTUbSIt.js +1 -0
  21. package/public/assets/MachineDetailPage-BH-KZK-O.js +1 -0
  22. package/public/assets/MachineListPage-DKuE_lOr.js +6 -0
  23. package/public/assets/NotFoundPage-CEkbHGWM.js +1 -0
  24. package/public/assets/PipelineEditorPage-C-PHUced.js +3 -0
  25. package/public/assets/ProfilePage-9A1i3I4h.js +1 -0
  26. package/public/assets/ProjectDetailPage-DFmRizSR.js +7 -0
  27. package/public/assets/ProjectListPage-Dbj2OlMz.js +6 -0
  28. package/public/assets/QuickAuth-DRYnjdDV.js +1 -0
  29. package/public/assets/RemoveMemberConfirmDialog-B1Wfe6qD.js +6 -0
  30. package/public/assets/Select-Coph7K6I.js +6 -0
  31. package/public/assets/SettingsPage-YG6bu8P-.js +6 -0
  32. package/public/assets/Skeleton-DTD8fr3E.js +1 -0
  33. package/public/assets/TaskDetailPage-Beg8tuEN.css +32 -0
  34. package/public/assets/TaskDetailPage-DXSxtOVO.js +44 -0
  35. package/public/assets/TaskListPage-t4Dv8BDy.js +1 -0
  36. package/public/assets/TaskStatusBadge-CTYxCsEO.js +1 -0
  37. package/public/assets/TokenManage-CUQ3wwfj.js +1 -0
  38. package/public/assets/TotpSetupPage--DR3X8Ic.js +9 -0
  39. package/public/assets/WorkerSetupGuidePage-HEUz68fc.js +16 -0
  40. package/public/assets/arrow-left-EPKSp1wq.js +6 -0
  41. package/public/assets/arrow-right-CW48svkF.js +6 -0
  42. package/public/assets/bot-BlE3obwB.js +6 -0
  43. package/public/assets/copy-CljRO0MZ.js +6 -0
  44. package/public/assets/external-link-BOPlNQYO.js +6 -0
  45. package/public/assets/index-CluWJF_4.js +207 -0
  46. package/public/assets/index-DeEHxWoz.css +1 -0
  47. package/public/assets/key-OMhi1y8r.js +6 -0
  48. package/public/assets/loader-circle-DEx7RlNw.js +6 -0
  49. package/public/assets/pencil-BgpOCLzp.js +6 -0
  50. package/public/assets/plus-DMsT-oJS.js +6 -0
  51. package/public/assets/protocol-C4f2G7mk.js +1 -0
  52. package/public/assets/rotate-ccw-D8Wc0cH7.js +6 -0
  53. package/public/assets/scroll-text-B0kPxzfj.js +6 -0
  54. package/public/assets/settings-D3F-dJby.js +6 -0
  55. package/public/assets/task.store-bgSaXfA1.js +1 -0
  56. package/public/assets/trash-2-CpNRRu-J.js +6 -0
  57. package/public/assets/users-D0C2zcU6.js +6 -0
  58. package/public/favicon.svg +4 -0
  59. package/public/index.html +20 -0
@@ -0,0 +1 @@
1
+ import{d as I,j as e,g as T,a as P,r as n,X as U,h as O,f as K,H as Q,i as W,k as R}from"./index-CluWJF_4.js";import{u as G}from"./task.store-bgSaXfA1.js";import{T as B}from"./TaskStatusBadge-CTYxCsEO.js";import{S as F}from"./Select-Coph7K6I.js";import{C as V}from"./copy-CljRO0MZ.js";import{E as $}from"./EmptyState-BPAoLpts.js";import{T as z}from"./Skeleton-DTD8fr3E.js";import{P as X}from"./plus-DMsT-oJS.js";function Z(s,t){return s.length<=t?s:s.slice(0,t)+"..."}function Y(s){const t=Date.now(),m=new Date(s).getTime(),d=t-m,c=Math.floor(d/6e4);if(c<1)return T("common.just_now");if(c<60)return T("common.m_ago",{n:c});const o=Math.floor(c/60);if(o<24)return T("common.h_ago",{n:o});const a=Math.floor(o/24);return T("common.d_ago",{n:a})}function ee({task:s}){const t=I();return e.jsxs("tr",{onClick:()=>t(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] transition-colors hover:bg-[var(--bg-input)]",children:[e.jsxs("td",{className:"w-16 py-3 pr-4 font-mono text-xs font-medium text-[var(--text-secondary)] text-right tabular-nums",children:["#",s.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:Z(s.description,80)}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(B,{status:s.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.machineName??"—"}),e.jsx("td",{className:"py-3 font-mono text-xs text-[var(--text-muted)]",children:Y(s.createdAt)})]})}function te({isOpen:s,onClose:t,projects:m,projectsLoading:d,onSubmit:c,isSubmitting:o}){const{t:a}=P(),[l,g]=n.useState(""),[x,u]=n.useState(""),[b,p]=n.useState(""),[M,k]=n.useState(""),[N,f]=n.useState("");n.useEffect(()=>{s&&(g(""),u(""),p(""),k(""),f(""))},[s]),n.useEffect(()=>{if(!s)return;function i(v){v.key==="Escape"&&t()}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[s,t]);async function _(i){if(i.preventDefault(),f(""),!l||!x.trim()){f(a("tasks.project_and_description_required"));return}try{await c({projectKey:l,description:x.trim(),machineId:b||void 0,agentType:void 0})}catch(v){const y=v instanceof Error?v.message:a("tasks.failed_to_create_task");f(y)}}return s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:i=>{i.target===i.currentTarget&&t()},children:e.jsxs("div",{className:"w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:i=>i.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-4",children:[e.jsxs("h2",{className:"text-sm text-[var(--text-primary)]",children:["// ",a("tasks.new_task")]}),e.jsx("button",{onClick:t,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(U,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:_,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_description")}),e.jsx("textarea",{value:x,onChange:i=>u(i.target.value),placeholder:a("tasks.describe_task_placeholder"),rows:4,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.project")}),e.jsx(F,{value:l,onChange:g,options:m.map(i=>({value:i.key,label:i.name})),placeholder:a(d?"common.loading":"tasks.select_project"),disabled:d})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_machine")}),e.jsx("input",{type:"text",value:b,onChange:i=>p(i.target.value),placeholder:a("tasks.any_able"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.assign_developer")}),e.jsx(F,{value:M,onChange:k,options:[],placeholder:a("tasks.select_developer")})]}),N&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:N})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:t,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:o||!l||!x.trim(),className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs text-black transition-opacity hover:opacity-90 disabled:opacity-40",children:a(o?"common.creating":"tasks.create_task")})]})]})]})}):null}function se({isOpen:s,onClose:t,onForceCreate:m,onViewExisting:d,similarTask:c,isLoading:o}){const{t:a}=P();return!c||!s?null:e.jsx("div",{onClick:t,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:l=>l.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(V,{style:{width:"1rem",height:"1rem"}}),a("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:a("tasks.dedup_description")})]}),e.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px",backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"'JetBrains Mono', monospace"},children:["#",c.id," · ",c.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:c.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:t,disabled:o,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:o?"not-allowed":"pointer",opacity:o?.7:1,transition:"color 0.15s, border-color 0.15s"},children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>d(c.id),style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:a("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:m,disabled:o,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--warning)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:o?"not-allowed":"pointer",opacity:o?.7:1},children:a(o?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function re(s){const t=Date.now(),m=new Date(s).getTime(),d=t-m,c=Math.floor(d/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const o=Math.floor(c/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function ae({task:s}){const t=I();return e.jsxs("div",{onClick:()=>t(`/tasks/${s.id}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[10px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",s.id," ",s.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(B,{status:s.status})})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[9px] text-[var(--text-muted)]",children:[e.jsx("span",{children:re(s.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:s.projectKey}),s.machineName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.machineName})]})]})]})}const oe=[{key:"all",labelKey:"tasks.tab_all"},{key:"RUNNING",labelKey:"tasks.tab_running"},{key:"QUEUED",labelKey:"tasks.tab_queued"},{key:"COMPLETED",labelKey:"tasks.tab_completed"},{key:"FAILED",labelKey:"tasks.tab_failed"},{key:"CANCELLED",labelKey:"tasks.tab_cancelled"}],E=20;function ue(){const s=I(),{t}=P(),{tasks:m,loading:d,fetchTasks:c}=G(),[o,a]=n.useState("all"),[l,g]=n.useState(""),[x,u]=n.useState(1),[b,p]=n.useState(!1);O(n.useMemo(()=>e.jsxs("button",{onClick:()=>p(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(X,{className:"h-3.5 w-3.5"}),t("tasks.new_task")]}),[t]));const[M,k]=n.useState([]),[N,f]=n.useState(!1),[_,i]=n.useState(!1),[v,y]=n.useState(!1),[A,q]=n.useState(null),[j,H]=n.useState(null);n.useEffect(()=>{const r={limit:String(E)};o!=="all"&&(r.status=o),c(r),u(1)},[o,c]),n.useEffect(()=>{u(1)},[l]),n.useEffect(()=>{b&&(f(!0),K.get("web/projects").json().then(r=>k(r)).catch(()=>{}).finally(()=>f(!1)))},[b]);const J=n.useCallback(async r=>{i(!0);try{const h=await K.post("web/tasks",{json:{projectKey:r.projectKey,description:r.description,machineId:r.machineId}}).json();p(!1),s(`/tasks/${h.task.id}`)}catch(h){if(h instanceof Q&&h.response.status===409){try{const D=await h.response.json();if(D.confirmRequired){q({id:D.confirmRequired.taskId,description:D.confirmRequired.message,status:"active"}),H(r),p(!1),y(!0);return}}catch{}alert(t("tasks.similar_task_exists"))}else throw h}finally{i(!1)}},[s]),L=n.useCallback(async()=>{if(j){i(!0);try{const r=await K.post("web/tasks",{json:{projectKey:j.projectKey,description:j.description,machineId:j.machineId,force:!0}}).json();y(!1),s(`/tasks/${r.task.id}`)}finally{i(!1)}}},[j,s]),w=l.trim()?m.filter(r=>r.description.toLowerCase().includes(l.toLowerCase())||String(r.id).includes(l)):m,C=Math.max(1,Math.ceil(w.length/E)),S=w.slice((x-1)*E,x*E);return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar",children:oe.map(r=>e.jsx("button",{onClick:()=>a(r.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${o===r.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:t(r.labelKey)},r.key))}),e.jsxs("div",{className:"relative md:ml-auto md:w-64",children:[e.jsx(W,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:t("tasks.search_tasks"),value:l,onChange:r=>g(r.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),l&&e.jsx("button",{onClick:()=>g(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:"x"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:t("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.time")})]})}),e.jsxs("tbody",{children:[d&&S.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"p-4",children:e.jsx(z,{rows:5})})}),!d&&w.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"p-4",children:e.jsx($,{icon:R,title:t("tasks.no_tasks_found"),description:t(l?"tasks.try_adjusting_search":"tasks.create_first_task"),action:l?void 0:e.jsx("button",{onClick:()=>p(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:t("tasks.create_task")})})})}),S.map(r=>e.jsx(ee,{task:r},r.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[d&&S.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(z,{rows:5})}),!d&&w.length===0&&e.jsx($,{icon:R,title:t("tasks.no_tasks_found"),description:t(l?"tasks.try_adjusting_search":"tasks.create_first_task"),action:l?void 0:e.jsx("button",{onClick:()=>p(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:t("tasks.create_task")})}),S.map(r=>e.jsx(ae,{task:r},r.id))]}),C>1&&e.jsxs("div",{className:"mt-6 flex items-center justify-center gap-1",children:[e.jsx("button",{onClick:()=>u(Math.max(1,x-1)),disabled:x===1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] disabled:opacity-30",children:t("tasks.prev")}),Array.from({length:C},(r,h)=>h+1).map(r=>e.jsx("button",{onClick:()=>u(r),className:`rounded-[4px] px-2.5 py-1 text-xs transition-colors ${x===r?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:r},r)),e.jsx("button",{onClick:()=>u(Math.min(C,x+1)),disabled:x===C,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] disabled:opacity-30",children:t("common.next")})]}),e.jsx(te,{isOpen:b,onClose:()=>p(!1),projects:M,projectsLoading:N,onSubmit:J,isSubmitting:_}),e.jsx(se,{isOpen:v,onClose:()=>y(!1),onForceCreate:L,onViewExisting:r=>{y(!1),s(`/tasks/${r}`)},similarTask:A,isLoading:_})]})}export{ue as default};
@@ -0,0 +1 @@
1
+ import{a as n,j as e}from"./index-CluWJF_4.js";const r={QUEUED:{labelKey:"tasks.status_queued",color:"var(--text-muted)"},ASSIGNED:{labelKey:"tasks.status_assigned",color:"#60a5fa"},RUNNING:{labelKey:"tasks.status_running",color:"var(--accent)"},SUSPENDED:{labelKey:"tasks.status_suspended",color:"var(--warning)"},COMPLETED:{labelKey:"tasks.status_completed",color:"var(--accent)"},FAILED:{labelKey:"tasks.status_failed",color:"var(--destructive)"},CANCELLED:{labelKey:"tasks.status_cancelled",color:"var(--text-muted)"}};function u({status:t}){const{t:a}=n(),s=r[t]??null,l=s?a(s.labelKey):t.toLowerCase(),o=(s==null?void 0:s.color)??"var(--text-muted)";return e.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs",style:{color:o},children:[e.jsx("span",{style:{fontSize:"0.6rem"},children:"●"}),l]})}export{u as T};
@@ -0,0 +1 @@
1
+ import{a as _,r as a,j as e,f as N,d as T,o as C,K as L,x as E,l as M}from"./index-CluWJF_4.js";import{K as F}from"./key-OMhi1y8r.js";import{C as D}from"./copy-CljRO0MZ.js";import{E as A}from"./external-link-BOPlNQYO.js";import{E as I}from"./EmptyState-BPAoLpts.js";import{T as O}from"./Skeleton-DTD8fr3E.js";import{P}from"./plus-DMsT-oJS.js";function B({isOpen:r,onClose:h,onCreated:y}){const{t:s}=_(),[t,c]=a.useState(""),[i,x]=a.useState(!1),[m,p]=a.useState(""),u=()=>{c(""),p(""),h()},d=async()=>{if(p(""),!t.trim()){p(s("admin.pat_label_required"));return}try{x(!0);const n=await N.post("admin/worker-tokens",{json:{label:t.trim()}}).json();c(""),y({token:n.token,id:n.id})}catch(n){const l=n instanceof Error?n.message:s("admin.pat_failed_to_generate");p(l)}finally{x(!1)}};return r?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:n=>{n.target===n.currentTarget&&u()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{maxWidth:"480px",borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:[e.jsx(F,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:s("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[m&&e.jsx("div",{className:"border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",style:{borderRadius:"4px"},children:m}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("admin.label")}),e.jsx("input",{type:"text",placeholder:s("admin.pat_label_placeholder"),value:t,onChange:n=>c(n.target.value),className:"w-full border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},onKeyDown:n=>{n.key==="Enter"&&d()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("admin.label_identifies_machine")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[e.jsx("button",{onClick:u,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s("common.cancel")}),e.jsx("button",{onClick:d,disabled:i,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80 disabled:opacity-50",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s(i?"admin.generating":"admin.generate")})]})]})}):null}const J=3e3,K=600*1e3;function $({isOpen:r,token:h,tokenId:y,onClose:s}){const{t}=_(),[c,i]=a.useState("command"),[x,m]=a.useState(!1),[p,u]=a.useState(""),[d,n]=a.useState(null),l=a.useRef(void 0),j=a.useRef(Date.now()),f=T(),k=typeof window<"u"?window.location.origin:"https://overlord.example.com",g=`overlord install --token ${h} --server ${k}`,w=async()=>{try{await navigator.clipboard.writeText(g),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},o=a.useCallback(async()=>{try{const v=await N.get(`admin/worker-tokens/${y}/status`).json();v.status==="used"&&v.machine_name&&(i("success"),u(v.machine_name),n(v.machine_id??null),l.current&&clearInterval(l.current))}catch{}Date.now()-j.current>K&&(i("timeout"),l.current&&clearInterval(l.current))},[y]),S=()=>{i("waiting"),j.current=Date.now(),l.current=setInterval(o,J)};a.useEffect(()=>()=>{l.current&&clearInterval(l.current)},[]);const R=()=>{s(),d&&f(`/machines/${d}`)};if(!r)return null;const b={fontFamily:"'JetBrains Mono', monospace",borderRadius:"4px"};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:v=>{v.target===v.currentTarget&&s()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...b,maxWidth:"480px"},children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:c==="success"?e.jsxs(e.Fragment,{children:[e.jsx(C,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_registered")})]}):e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_token_generated")})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[c!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("admin.run_command_desc")}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-4",style:{borderRadius:"4px"},children:[e.jsx("code",{className:"block break-all pr-20 text-xs text-[var(--text-primary)]",children:g}),e.jsx("button",{onClick:w,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:b,children:x?e.jsxs(e.Fragment,{children:[e.jsx(C,{className:"h-3 w-3 text-[var(--accent)]"}),t("common.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"h-3 w-3"}),t("common.copy")]})})]}),e.jsx("div",{className:"border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-400",style:{borderRadius:"4px"},children:t("admin.token_shown_once")})]}),c==="waiting"&&e.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("admin.waiting_for_worker")})]}),c==="timeout"&&e.jsx("div",{className:"border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3 text-xs text-[var(--text-muted)]",style:{borderRadius:"4px"},children:t("admin.token_not_yet_used")}),c==="success"&&e.jsxs("div",{className:"border border-[var(--accent)]/30 bg-[var(--accent)]/10 px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("p",{className:"text-xs text-[var(--accent)]",children:t("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[t("admin.machine"),": ",e.jsx("span",{className:"text-[var(--accent)]",children:p})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[c==="command"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:b,children:t("common.close")}),e.jsx("button",{onClick:S,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:b,children:t("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:b,children:t("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:b,children:t("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:b,children:t("common.close")}),e.jsxs("button",{onClick:R,className:"flex items-center gap-1.5 bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:b,children:[e.jsx(A,{className:"h-3 w-3"}),t("admin.view_machine")]})]})]})]})})}function H(){const{t:r}=_(),[h,y]=a.useState([]),[s,t]=a.useState(!0),[c,i]=a.useState(!1),[x,m]=a.useState(null),[p,u]=a.useState(!1),[d,n]=a.useState(null),[l,j]=a.useState(!1),f=a.useCallback(async()=>{try{t(!0);const o=await N.get("admin/worker-tokens").json();y(o)}catch{}finally{t(!1)}},[]);a.useEffect(()=>{f()},[f]);const k=async()=>{if(d){j(!0);try{await N.post(`admin/worker-tokens/${d.id}/revoke`),u(!1),n(null),f()}catch{}finally{j(!1)}}},g=o=>{i(!1),m(o),f()},w=o=>{switch(o){case"active":return"text-green-400";case"used":return"text-blue-400";case"revoked":return"text-red-400";case"expired":return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}};return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:r("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("admin.tokens_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>i(!0),children:[e.jsx(P,{className:"h-3.5 w-3.5"}),r("admin.generate_token")]})]}),s?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(O,{rows:3})}):h.length===0?e.jsx(I,{icon:L,title:r("admin.no_worker_tokens"),description:r("admin.generate_token_desc"),actionLabel:r("admin.generate_token"),onAction:()=>i(!0)}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:r("common.actions")})]})}),e.jsx("tbody",{children:h.map(o=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:o.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:o.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:w(o.status),children:o.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(o.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:o.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(o.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:o.status==="active"&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{n(o),u(!0)},children:[e.jsx(E,{className:"h-3.5 w-3.5"}),r("admin.revoke")]})})]},o.id))})]})}),e.jsx(B,{isOpen:c,onClose:()=>i(!1),onCreated:g}),x&&e.jsx($,{isOpen:!!x,token:x.token,tokenId:x.id,onClose:()=>m(null)}),e.jsx(M,{isOpen:p,onClose:()=>{u(!1),n(null)},onConfirm:k,title:r("admin.revoke_token"),message:r("admin.revoke_token_confirm",{label:(d==null?void 0:d.label)??""}),confirmLabel:r("admin.revoke"),confirmVariant:"danger",isLoading:l})]})}export{H as default};
@@ -0,0 +1,9 @@
1
+ import{R as A,d as he,u as Y,a as fe,r as F,j as v,f as J,t as me}from"./index-CluWJF_4.js";var ge=Object.defineProperty,T=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,W=(u,a,i)=>a in u?ge(u,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[a]=i,j=(u,a)=>{for(var i in a||(a={}))V.call(a,i)&&W(u,i,a[i]);if(T)for(var i of T(a))X.call(a,i)&&W(u,i,a[i]);return u},k=(u,a)=>{var i={};for(var c in u)V.call(u,c)&&a.indexOf(c)<0&&(i[c]=u[c]);if(u!=null&&T)for(var c of T(u))a.indexOf(c)<0&&X.call(u,c)&&(i[c]=u[c]);return i};/**
2
+ * @license QR Code generator library (TypeScript)
3
+ * Copyright (c) Project Nayuki.
4
+ * SPDX-License-Identifier: MIT
5
+ */var L;(u=>{const a=class p{constructor(e,t,r,o){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],e<p.MIN_VERSION||e>p.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=e*4+17;let n=[];for(let s=0;s<this.size;s++)n.push(!1);for(let s=0;s<this.size;s++)this.modules.push(n.slice()),this.isFunction.push(n.slice());this.drawFunctionPatterns();const l=this.addEccAndInterleave(r);if(this.drawCodewords(l),o==-1){let s=1e9;for(let f=0;f<8;f++){this.applyMask(f),this.drawFormatBits(f);const h=this.getPenaltyScore();h<s&&(o=f,s=h),this.applyMask(f)}}g(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(e,t){const r=u.QrSegment.makeSegments(e);return p.encodeSegments(r,t)}static encodeBinary(e,t){const r=u.QrSegment.makeBytes(e);return p.encodeSegments([r],t)}static encodeSegments(e,t,r=1,o=40,n=-1,l=!0){if(!(p.MIN_VERSION<=r&&r<=o&&o<=p.MAX_VERSION)||n<-1||n>7)throw new RangeError("Invalid value");let s,f;for(s=r;;s++){const m=p.getNumDataCodewords(s,t)*8,R=S.getTotalBits(e,s);if(R<=m){f=R;break}if(s>=o)throw new RangeError("Data too long")}for(const m of[p.Ecc.MEDIUM,p.Ecc.QUARTILE,p.Ecc.HIGH])l&&f<=p.getNumDataCodewords(s,m)*8&&(t=m);let h=[];for(const m of e){i(m.mode.modeBits,4,h),i(m.numChars,m.mode.numCharCountBits(s),h);for(const R of m.getData())h.push(R)}g(h.length==f);const N=p.getNumDataCodewords(s,t)*8;g(h.length<=N),i(0,Math.min(4,N-h.length),h),i(0,(8-h.length%8)%8,h),g(h.length%8==0);for(let m=236;h.length<N;m^=253)i(m,8,h);let b=[];for(;b.length*8<h.length;)b.push(0);return h.forEach((m,R)=>b[R>>>3]|=m<<7-(R&7)),new p(s,t,b,n)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let r=0;r<this.size;r++)this.setFunctionModule(6,r,r%2==0),this.setFunctionModule(r,6,r%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let r=0;r<t;r++)for(let o=0;o<t;o++)r==0&&o==0||r==0&&o==t-1||r==t-1&&o==0||this.drawAlignmentPattern(e[r],e[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let r=t;for(let n=0;n<10;n++)r=r<<1^(r>>>9)*1335;const o=(t<<10|r)^21522;g(o>>>15==0);for(let n=0;n<=5;n++)this.setFunctionModule(8,n,c(o,n));this.setFunctionModule(8,7,c(o,6)),this.setFunctionModule(8,8,c(o,7)),this.setFunctionModule(7,8,c(o,8));for(let n=9;n<15;n++)this.setFunctionModule(14-n,8,c(o,n));for(let n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,c(o,n));for(let n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,c(o,n));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let r=0;r<12;r++)e=e<<1^(e>>>11)*7973;const t=this.version<<12|e;g(t>>>18==0);for(let r=0;r<18;r++){const o=c(t,r),n=this.size-11+r%3,l=Math.floor(r/3);this.setFunctionModule(n,l,o),this.setFunctionModule(l,n,o)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let o=-4;o<=4;o++){const n=Math.max(Math.abs(o),Math.abs(r)),l=e+o,s=t+r;0<=l&&l<this.size&&0<=s&&s<this.size&&this.setFunctionModule(l,s,n!=2&&n!=4)}}drawAlignmentPattern(e,t){for(let r=-2;r<=2;r++)for(let o=-2;o<=2;o++)this.setFunctionModule(e+o,t+r,Math.max(Math.abs(o),Math.abs(r))!=1)}setFunctionModule(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0}addEccAndInterleave(e){const t=this.version,r=this.errorCorrectionLevel;if(e.length!=p.getNumDataCodewords(t,r))throw new RangeError("Invalid argument");const o=p.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t],n=p.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t],l=Math.floor(p.getNumRawDataModules(t)/8),s=o-l%o,f=Math.floor(l/o);let h=[];const N=p.reedSolomonComputeDivisor(n);for(let m=0,R=0;m<o;m++){let C=e.slice(R,R+f-n+(m<s?0:1));R+=C.length;const M=p.reedSolomonComputeRemainder(C,N);m<s&&C.push(0),h.push(C.concat(M))}let b=[];for(let m=0;m<h[0].length;m++)h.forEach((R,C)=>{(m!=f-n||C>=s)&&b.push(R[m])});return g(b.length==l),b}drawCodewords(e){if(e.length!=Math.floor(p.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let t=0;for(let r=this.size-1;r>=1;r-=2){r==6&&(r=5);for(let o=0;o<this.size;o++)for(let n=0;n<2;n++){const l=r-n,f=(r+1&2)==0?this.size-1-o:o;!this.isFunction[f][l]&&t<e.length*8&&(this.modules[f][l]=c(e[t>>>3],7-(t&7)),t++)}}g(t==e.length*8)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let r=0;r<this.size;r++){let o;switch(e){case 0:o=(r+t)%2==0;break;case 1:o=t%2==0;break;case 2:o=r%3==0;break;case 3:o=(r+t)%3==0;break;case 4:o=(Math.floor(r/3)+Math.floor(t/2))%2==0;break;case 5:o=r*t%2+r*t%3==0;break;case 6:o=(r*t%2+r*t%3)%2==0;break;case 7:o=((r+t)%2+r*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][r]&&o&&(this.modules[t][r]=!this.modules[t][r])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let l=!1,s=0,f=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[n][h]==l?(s++,s==5?e+=p.PENALTY_N1:s>5&&e++):(this.finderPenaltyAddHistory(s,f),l||(e+=this.finderPenaltyCountPatterns(f)*p.PENALTY_N3),l=this.modules[n][h],s=1);e+=this.finderPenaltyTerminateAndCount(l,s,f)*p.PENALTY_N3}for(let n=0;n<this.size;n++){let l=!1,s=0,f=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][n]==l?(s++,s==5?e+=p.PENALTY_N1:s>5&&e++):(this.finderPenaltyAddHistory(s,f),l||(e+=this.finderPenaltyCountPatterns(f)*p.PENALTY_N3),l=this.modules[h][n],s=1);e+=this.finderPenaltyTerminateAndCount(l,s,f)*p.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let l=0;l<this.size-1;l++){const s=this.modules[n][l];s==this.modules[n][l+1]&&s==this.modules[n+1][l]&&s==this.modules[n+1][l+1]&&(e+=p.PENALTY_N2)}let t=0;for(const n of this.modules)t=n.reduce((l,s)=>l+(s?1:0),t);const r=this.size*this.size,o=Math.ceil(Math.abs(t*20-r*10)/r)-1;return g(0<=o&&o<=9),e+=o*p.PENALTY_N4,g(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{const e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2;let r=[6];for(let o=this.size-7;r.length<e;o-=t)r.splice(1,0,o);return r}}static getNumRawDataModules(e){if(e<p.MIN_VERSION||e>p.MAX_VERSION)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const r=Math.floor(e/7)+2;t-=(25*r-10)*r-55,e>=7&&(t-=36)}return g(208<=t&&t<=29648),t}static getNumDataCodewords(e,t){return Math.floor(p.getNumRawDataModules(e)/8)-p.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*p.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let t=[];for(let o=0;o<e-1;o++)t.push(0);t.push(1);let r=1;for(let o=0;o<e;o++){for(let n=0;n<t.length;n++)t[n]=p.reedSolomonMultiply(t[n],r),n+1<t.length&&(t[n]^=t[n+1]);r=p.reedSolomonMultiply(r,2)}return t}static reedSolomonComputeRemainder(e,t){let r=t.map(o=>0);for(const o of e){const n=o^r.shift();r.push(0),t.forEach((l,s)=>r[s]^=p.reedSolomonMultiply(l,n))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");let r=0;for(let o=7;o>=0;o--)r=r<<1^(r>>>7)*285,r^=(t>>>o&1)*e;return g(r>>>8==0),r}finderPenaltyCountPatterns(e){const t=e[1];g(t<=this.size*3);const r=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(r&&e[0]>=t*4&&e[6]>=t?1:0)+(r&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};a.MIN_VERSION=1,a.MAX_VERSION=40,a.PENALTY_N1=3,a.PENALTY_N2=3,a.PENALTY_N3=40,a.PENALTY_N4=10,a.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],a.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],u.QrCode=a;function i(y,e,t){if(e<0||e>31||y>>>e)throw new RangeError("Value out of range");for(let r=e-1;r>=0;r--)t.push(y>>>r&1)}function c(y,e){return(y>>>e&1)!=0}function g(y){if(!y)throw new Error("Assertion error")}const d=class w{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(e){let t=[];for(const r of e)i(r,8,t);return new w(w.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!w.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let r=0;r<e.length;){const o=Math.min(e.length-r,3);i(parseInt(e.substring(r,r+o),10),o*3+1,t),r+=o}return new w(w.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!w.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t=[],r;for(r=0;r+2<=e.length;r+=2){let o=w.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r))*45;o+=w.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r+1)),i(o,11,t)}return r<e.length&&i(w.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r)),6,t),new w(w.Mode.ALPHANUMERIC,e.length,t)}static makeSegments(e){return e==""?[]:w.isNumeric(e)?[w.makeNumeric(e)]:w.isAlphanumeric(e)?[w.makeAlphanumeric(e)]:[w.makeBytes(w.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)i(e,8,t);else if(e<16384)i(2,2,t),i(e,14,t);else if(e<1e6)i(6,3,t),i(e,21,t);else throw new RangeError("ECI assignment value out of range");return new w(w.Mode.ECI,0,t)}static isNumeric(e){return w.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return w.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let r=0;for(const o of e){const n=o.mode.numCharCountBits(t);if(o.numChars>=1<<n)return 1/0;r+=4+n+o.bitData.length}return r}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let r=0;r<e.length;r++)e.charAt(r)!="%"?t.push(e.charCodeAt(r)):(t.push(parseInt(e.substring(r+1,r+3),16)),r+=2);return t}};d.NUMERIC_REGEX=/^[0-9]*$/,d.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,d.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let S=d;u.QrSegment=d})(L||(L={}));(u=>{(a=>{const i=class{constructor(g,d){this.ordinal=g,this.formatBits=d}};i.LOW=new i(0,1),i.MEDIUM=new i(1,0),i.QUARTILE=new i(2,3),i.HIGH=new i(3,2),a.Ecc=i})(u.QrCode||(u.QrCode={}))})(L||(L={}));(u=>{(a=>{const i=class{constructor(g,d){this.modeBits=g,this.numBitsCharCount=d}numCharCountBits(g){return this.numBitsCharCount[Math.floor((g+7)/17)]}};i.NUMERIC=new i(1,[10,12,14]),i.ALPHANUMERIC=new i(2,[9,11,13]),i.BYTE=new i(4,[8,16,16]),i.KANJI=new i(8,[8,10,12]),i.ECI=new i(7,[0,0,0]),a.Mode=i})(u.QrSegment||(u.QrSegment={}))})(L||(L={}));var z=L;/**
6
+ * @license qrcode.react
7
+ * Copyright (c) Paul O'Shannessy
8
+ * SPDX-License-Identifier: ISC
9
+ */var pe={L:z.QrCode.Ecc.LOW,M:z.QrCode.Ecc.MEDIUM,Q:z.QrCode.Ecc.QUARTILE,H:z.QrCode.Ecc.HIGH},K=128,Z="L",q="#FFFFFF",ee="#000000",te=!1,re=1,Ce=4,Ee=0,ye=.1;function oe(u,a=0){const i=[];return u.forEach(function(c,g){let d=null;c.forEach(function(S,y){if(!S&&d!==null){i.push(`M${d+a} ${g+a}h${y-d}v1H${d+a}z`),d=null;return}if(y===c.length-1){if(!S)return;d===null?i.push(`M${y+a},${g+a} h1v1H${y+a}z`):i.push(`M${d+a},${g+a} h${y+1-d}v1H${d+a}z`);return}S&&d===null&&(d=y)})}),i.join("")}function ne(u,a){return u.slice().map((i,c)=>c<a.y||c>=a.y+a.h?i:i.map((g,d)=>d<a.x||d>=a.x+a.w?g:!1))}function ve(u,a,i,c){if(c==null)return null;const g=u.length+i*2,d=Math.floor(a*ye),S=g/a,y=(c.width||d)*S,e=(c.height||d)*S,t=c.x==null?u.length/2-y/2:c.x*S,r=c.y==null?u.length/2-e/2:c.y*S,o=c.opacity==null?1:c.opacity;let n=null;if(c.excavate){let s=Math.floor(t),f=Math.floor(r),h=Math.ceil(y+t-s),N=Math.ceil(e+r-f);n={x:s,y:f,w:h,h:N}}const l=c.crossOrigin;return{x:t,y:r,h:e,w:y,excavation:n,opacity:o,crossOrigin:l}}function Me(u,a){return a!=null?Math.max(Math.floor(a),0):u?Ce:Ee}function ie({value:u,level:a,minVersion:i,includeMargin:c,marginSize:g,imageSettings:d,size:S,boostLevel:y}){let e=A.useMemo(()=>{const s=(Array.isArray(u)?u:[u]).reduce((f,h)=>(f.push(...z.QrSegment.makeSegments(h)),f),[]);return z.QrCode.encodeSegments(s,pe[a],i,void 0,void 0,y)},[u,a,i,y]);const{cells:t,margin:r,numCells:o,calculatedImageSettings:n}=A.useMemo(()=>{let l=e.getModules();const s=Me(c,g),f=l.length+s*2,h=ve(l,S,s,d);return{cells:l,margin:s,numCells:f,calculatedImageSettings:h}},[e,S,d,c,g]);return{qrcode:e,margin:r,cells:t,numCells:o,calculatedImageSettings:n}}var we=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Re=A.forwardRef(function(a,i){const c=a,{value:g,size:d=K,level:S=Z,bgColor:y=q,fgColor:e=ee,includeMargin:t=te,minVersion:r=re,boostLevel:o,marginSize:n,imageSettings:l}=c,f=k(c,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:h}=f,N=k(f,["style"]),b=l==null?void 0:l.src,m=A.useRef(null),R=A.useRef(null),C=A.useCallback(O=>{m.current=O,typeof i=="function"?i(O):i&&(i.current=O)},[i]),[M,E]=A.useState(!1),{margin:P,cells:x,numCells:_,calculatedImageSettings:I}=ie({value:g,level:S,minVersion:r,boostLevel:o,includeMargin:t,marginSize:n,imageSettings:l,size:d});A.useEffect(()=>{if(m.current!=null){const O=m.current,B=O.getContext("2d");if(!B)return;let Q=x;const D=R.current,H=I!=null&&D!==null&&D.complete&&D.naturalHeight!==0&&D.naturalWidth!==0;H&&I.excavation!=null&&(Q=ne(x,I.excavation));const $=window.devicePixelRatio||1;O.height=O.width=d*$;const G=d/_*$;B.scale(G,G),B.fillStyle=y,B.fillRect(0,0,_,_),B.fillStyle=e,we?B.fill(new Path2D(oe(Q,P))):x.forEach(function(le,ce){le.forEach(function(ue,de){ue&&B.fillRect(de+P,ce+P,1,1)})}),I&&(B.globalAlpha=I.opacity),H&&B.drawImage(D,I.x+P,I.y+P,I.w,I.h)}}),A.useEffect(()=>{E(!1)},[b]);const ae=j({height:d,width:d},h);let U=null;return b!=null&&(U=A.createElement("img",{src:b,key:b,style:{display:"none"},onLoad:()=>{E(!0)},ref:R,crossOrigin:I==null?void 0:I.crossOrigin})),A.createElement(A.Fragment,null,A.createElement("canvas",j({style:ae,height:d,width:d,ref:C,role:"img"},N)),U)});Re.displayName="QRCodeCanvas";var se=A.forwardRef(function(a,i){const c=a,{value:g,size:d=K,level:S=Z,bgColor:y=q,fgColor:e=ee,includeMargin:t=te,minVersion:r=re,boostLevel:o,title:n,marginSize:l,imageSettings:s}=c,f=k(c,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:h,cells:N,numCells:b,calculatedImageSettings:m}=ie({value:g,level:S,minVersion:r,boostLevel:o,includeMargin:t,marginSize:l,imageSettings:s,size:d});let R=N,C=null;s!=null&&m!=null&&(m.excavation!=null&&(R=ne(N,m.excavation)),C=A.createElement("image",{href:s.src,height:m.h,width:m.w,x:m.x+h,y:m.y+h,preserveAspectRatio:"none",opacity:m.opacity,crossOrigin:m.crossOrigin}));const M=oe(R,h);return A.createElement("svg",j({height:d,width:d,viewBox:`0 0 ${b} ${b}`,ref:i,role:"img"},f),!!n&&A.createElement("title",null,n),A.createElement("path",{fill:y,d:`M0,0 h${b}v${b}H0z`,shapeRendering:"crispEdges"}),A.createElement("path",{fill:e,d:M,shapeRendering:"crispEdges"}),C)});se.displayName="QRCodeSVG";function Pe(){const u=he(),a=Y(C=>C.logout),{t:i}=fe(),[c,g]=F.useState("loading"),[d,S]=F.useState(""),[y,e]=F.useState(""),[t,r]=F.useState(""),[o,n]=F.useState(!1),[l,s]=F.useState(""),f=F.useRef([]);F.useEffect(()=>{let C=!1;async function M(){try{const E=await J.post("web/profile/totp/setup").json();if(C)return;S(E.secret);const P=Y.getState().accessToken;let x="user";if(P)try{const I=JSON.parse(atob(P.split(".")[1]));I.name&&(x=I.name)}catch{}const _=`otpauth://totp/Overlord:${encodeURIComponent(x)}?secret=${E.secret}&issuer=Overlord&algorithm=SHA1&digits=6&period=30`;e(_),g("scan")}catch(E){if(C)return;const P=E instanceof Error?E.message:i("auth.failed_to_init_totp");s(P),g("scan")}}return M(),()=>{C=!0}},[]);const h=async C=>{if(C.preventDefault(),s(""),!t.trim()||t.trim().length!==6){s(i("auth.please_enter_valid_6_digit_code"));return}n(!0),g("verifying");try{await J.post("web/profile/totp/verify",{json:{code:t.trim()}}).json(),me.success(i("auth.totp_setup_complete_login_again")),setTimeout(()=>{a(),u("/login",{replace:!0})},1500)}catch(M){const E=M instanceof Error?M.message:i("auth.totp_setup_failed");s(E),g("scan")}finally{n(!1)}},N=d.replace(/(.{4})/g,"$1 ").trim(),b=(C,M)=>{var x;const E=M.replace(/\D/g,"").slice(-1),P=t.split("");for(;P.length<6;)P.push("");P[C]=E,r(P.join("")),E&&C<5&&((x=f.current[C+1])==null||x.focus())},m=(C,M)=>{var E;M.key==="Backspace"&&!t[C]&&C>0&&((E=f.current[C-1])==null||E.focus())},R=C=>{var P;C.preventDefault();const M=C.clipboardData.getData("text").replace(/\D/g,"").slice(0,6);r(M);const E=Math.min(M.length,5);(P=f.current[E])==null||P.focus()};return c==="loading"?v.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--bg-primary)",fontFamily:"'JetBrains Mono', monospace"},children:v.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.875rem",animation:"pulse 2s infinite"},children:i("auth.initializing")})}):v.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--bg-primary)",padding:"1rem",fontFamily:"'JetBrains Mono', monospace"},children:v.jsxs("div",{style:{width:"100%",maxWidth:"440px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"2rem"},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.625rem",marginBottom:"0.25rem"},children:[v.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",borderRadius:"4px",backgroundColor:"var(--accent)",fontFamily:"'JetBrains Mono', monospace"},"aria-hidden":!0,children:v.jsx("span",{style:{fontSize:"1.25rem",fontWeight:600,color:"#0C0C0C"},children:"~"})}),v.jsx("span",{style:{fontSize:"1.25rem",fontWeight:700,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:i("landing.overlord")})]}),v.jsx("div",{style:{textAlign:"center",color:"var(--text-muted)",fontSize:"0.75rem",marginBottom:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:i("auth.totp_setup_subtitle")}),l&&v.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",overflowWrap:"break-word",wordBreak:"break-word"},children:l}),y&&v.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:"1.25rem"},children:v.jsx("div",{style:{backgroundColor:"#ffffff",padding:"0.75rem",borderRadius:"4px"},children:v.jsx(se,{value:y,size:200,level:"M",includeMargin:!1})})}),d&&v.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",backgroundColor:"var(--bg-primary)",border:"1px solid var(--border)",borderRadius:"4px",textAlign:"center"},children:[v.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.675rem",marginBottom:"0.375rem",fontFamily:"'JetBrains Mono', monospace"},children:i("auth.totp_manual_entry")}),v.jsx("code",{style:{color:"var(--text-primary)",fontSize:"0.875rem",fontFamily:"'JetBrains Mono', monospace",fontWeight:600,letterSpacing:"0.1em",userSelect:"all"},children:N})]}),v.jsxs("form",{onSubmit:h,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[v.jsxs("div",{children:[v.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.5rem",fontFamily:"'JetBrains Mono', monospace",textAlign:"center"},children:i("auth.verification_code")}),v.jsx("div",{style:{display:"flex",gap:"0.5rem",justifyContent:"center"},onPaste:R,children:Array.from({length:6}).map((C,M)=>v.jsx("input",{ref:E=>{f.current[M]=E},type:"text",inputMode:"numeric",maxLength:1,value:t[M]||"",onChange:E=>b(M,E.target.value),onKeyDown:E=>m(M,E),autoComplete:M===0?"one-time-code":"off",style:{width:"2.75rem",height:"3rem",textAlign:"center",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"1.25rem",fontFamily:"'JetBrains Mono', monospace",fontWeight:600,outline:"none",boxSizing:"border-box"},onFocus:E=>E.target.style.borderColor="var(--accent)",onBlur:E=>E.target.style.borderColor="var(--border)"},M))})]}),v.jsx("button",{type:"submit",disabled:o||t.length!==6,style:{width:"100%",padding:"0.625rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.875rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:o||t.length!==6?"not-allowed":"pointer",opacity:o||t.length!==6?.7:1,marginTop:"0.25rem"},children:i(o?"common.verifying":"auth.verify_and_enable")})]}),v.jsx("button",{type:"button",onClick:()=>{a(),u("/login",{replace:!0})},style:{width:"100%",padding:"0.625rem",backgroundColor:"transparent",color:"var(--text-secondary)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.875rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",marginTop:"0.5rem"},children:i("common.back")}),v.jsx("div",{style:{textAlign:"center",color:"var(--text-muted)",fontSize:"0.675rem",marginTop:"1.25rem",fontFamily:"'JetBrains Mono', monospace",lineHeight:1.5},children:i("auth.totp_setup_footer")})]})})}export{Pe as default};
@@ -0,0 +1,16 @@
1
+ import{c,d as x,a as d,j as e,o as a}from"./index-CluWJF_4.js";import{K as l}from"./key-OMhi1y8r.js";import{S as m}from"./settings-D3F-dJby.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const o=c("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
7
+ * @license lucide-react v0.469.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const p=c("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
12
+ * @license lucide-react v0.469.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const h=c("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);function b(){const n=x(),{t:s}=d(),i=[{number:1,icon:l,title:s("machines.step_generate_token"),description:s("machines.step_generate_token_desc"),content:e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--accent)] px-3 py-1.5 text-xs text-[var(--accent)] hover:bg-[var(--accent)] hover:text-black transition-colors",onClick:()=>n("/admin/tokens"),children:s("machines.go_to_token_management")})},{number:2,icon:o,title:s("machines.step_install_worker"),description:s("machines.step_install_worker_desc"),content:e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"$ "}),"npm install -g @overlordai/cli @overlordai/worker"]})})},{number:3,icon:m,title:s("machines.step_configure_env"),description:s("machines.step_configure_env_desc"),content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-[10px] text-[var(--text-muted)]",children:s("machines.setup_wizard_option")}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"$ "}),"overlord setup worker"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-[10px] text-[var(--text-muted)]",children:s("machines.manual_config_option")}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] space-y-1",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"$ "}),"mkdir -p ~/.overlord-worker"]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"$ "}),"cat > ~/.overlord-worker/.env <<EOF"]}),e.jsx("div",{children:"OVERLORD_HOST=https://overlord.example.com"}),e.jsx("div",{children:"OVERLORD_WORKER_TOKEN=ovw_TOKEN_HERE"}),e.jsx("div",{children:"OVERLORD_MACHINE_NAME=my-worker"}),e.jsx("div",{children:"EOF"})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3 text-xs space-y-1",children:[e.jsxs("p",{className:"text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"OVERLORD_HOST"})," — ",s("machines.env_host")]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_TOKEN"})," — ",s("machines.env_worker_token")]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"OVERLORD_MACHINE_NAME"})," — ",s("machines.env_machine_name")]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"OVERLORD_WORKSPACE_ROOT"})," — ",s("machines.env_workspace_root")]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"OVERLORD_MAX_SLOTS"})," — ",s("machines.env_max_slots")]})]})]})},{number:4,icon:p,title:s("machines.step_start_worker"),description:s("machines.step_start_worker_desc"),content:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[10px] text-[var(--text-muted)]",children:s("machines.start_note_setup_wizard")}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"$ "}),"overlord start worker"]})]})},{number:5,icon:h,title:s("machines.step_verify_connection"),description:s("machines.step_verify_connection_desc"),content:e.jsxs("div",{className:"flex items-start gap-3 rounded-[4px] border border-green-500/20 bg-green-500/5 p-3",children:[e.jsx(a,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-400"}),e.jsxs("div",{className:"text-xs",children:[e.jsx("p",{className:"text-[var(--text-primary)]",children:s("machines.verify_how_to")}),e.jsxs("ul",{className:"mt-1 list-inside list-disc text-[var(--text-muted)]",children:[e.jsx("li",{children:s("machines.verify_check_machines").split("machines").map((t,r)=>r===0?e.jsxs("span",{children:[t,e.jsx("button",{type:"button",className:"text-[var(--accent)] underline",onClick:()=>n("/machines"),children:s("machines.title")})]},r):e.jsx("span",{children:t},r))}),e.jsx("li",{children:s("machines.verify_status")}),e.jsx("li",{children:s("machines.verify_capabilities")})]})]})]})}];return e.jsxs("div",{className:"max-w-3xl font-mono",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("machines.setup_header_desc")})}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-primary)]",children:s("machines.prerequisites")}),e.jsxs("ul",{className:"space-y-2 text-xs text-[var(--text-muted)]",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(a,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),s("machines.prereq_machine")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(a,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),s("machines.prereq_node")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(a,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),s("machines.prereq_git")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(a,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),s("machines.prereq_network")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(a,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),s("machines.prereq_token")]})]})]}),e.jsx("div",{className:"space-y-4",children:i.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)] text-[10px] font-bold text-black",children:t.number}),e.jsx(t.icon,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:t.title})]}),e.jsx("p",{className:"mb-3 text-[10px] text-[var(--text-muted)]",children:t.description}),t.content]},t.number))})]})}export{b as default};
@@ -0,0 +1,6 @@
1
+ import{c as e}from"./index-CluWJF_4.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const t=e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);export{t as A};
@@ -0,0 +1,6 @@
1
+ import{c as r}from"./index-CluWJF_4.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const o=r("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);export{o as A};
@@ -0,0 +1,6 @@
1
+ import{c as t}from"./index-CluWJF_4.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const h=t("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);export{h as B};
@@ -0,0 +1,6 @@
1
+ import{c}from"./index-CluWJF_4.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const t=c("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);export{t as C};
@@ -0,0 +1,6 @@
1
+ import{c as a}from"./index-CluWJF_4.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=a("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);export{e as E};