@overlordai/server 1.0.102 → 1.0.103

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 (79) hide show
  1. package/package.json +4 -4
  2. package/public/assets/{AccessTokensPage-D1UA8WwD.js → AccessTokensPage-DYW95oYn.js} +1 -1
  3. package/public/assets/{AdminPage-BiQv-DBz.js → AdminPage-CmzgxmfL.js} +1 -1
  4. package/public/assets/{ApiReferencePage-B8T47k7e.js → ApiReferencePage-k0qwCqrg.js} +1 -1
  5. package/public/assets/{ArchitecturePage-SMQtJF5K.js → ArchitecturePage-CZdIr5OG.js} +1 -1
  6. package/public/assets/{AuditLogPage-DQLZJtz9.js → AuditLogPage-B46ZPniK.js} +1 -1
  7. package/public/assets/{BindPlatformPage-C_Ksgwwa.js → BindPlatformPage-CiTvVM38.js} +1 -1
  8. package/public/assets/{BotIntegrationPage-AmhFuRqL.js → BotIntegrationPage-DWUypE3E.js} +1 -1
  9. package/public/assets/{BotManage-BLG4cJJD.js → BotManage-BgzStyGf.js} +1 -1
  10. package/public/assets/{BotSetupPage-AsIfBCJ_.js → BotSetupPage-GNWFUbvf.js} +1 -1
  11. package/public/assets/{ChangelogPage-02X-jebe.js → ChangelogPage-BjXBiyw2.js} +1 -1
  12. package/public/assets/{CliReferencePage-DU2fjiUE.js → CliReferencePage-l1Msp1MO.js} +1 -1
  13. package/public/assets/{DeploymentPage-DXAAXZ0o.js → DeploymentPage-dKYl9mAA.js} +1 -1
  14. package/public/assets/{DevWorkflowPage-BPtySJfp.js → DevWorkflowPage-BoQ2X_5v.js} +1 -1
  15. package/public/assets/{DeveloperManage-C7ndCnpl.js → DeveloperManage-DCXu9nL7.js} +1 -1
  16. package/public/assets/{DeveloperSetupPage-Dv72Bl6n.js → DeveloperSetupPage-gVXD6Xl2.js} +1 -1
  17. package/public/assets/{DocsIndexPage-B-4AcFGv.js → DocsIndexPage-B34B9w-e.js} +1 -1
  18. package/public/assets/{DocsLayout-BAJM4ClE.js → DocsLayout-BjOXe_bC.js} +1 -1
  19. package/public/assets/{DocsPrimitives-B5AB_da7.js → DocsPrimitives-8sNjBDJg.js} +1 -1
  20. package/public/assets/{EditProjectPage-DpDa9_IE.js → EditProjectPage-CBxwr2NU.js} +1 -1
  21. package/public/assets/{EmptyState-Dib-wBQq.js → EmptyState-Cc8AT_UZ.js} +1 -1
  22. package/public/assets/{EnvVariablesPage-CTKKeZCG.js → EnvVariablesPage-C6MCWAeN.js} +1 -1
  23. package/public/assets/{HomePage-G4Ps95Ct.js → HomePage-dOxzI3Gt.js} +1 -1
  24. package/public/assets/{InfoRow-DhvGe8vw.js → InfoRow-BhSkV-4a.js} +1 -1
  25. package/public/assets/{InstallationPage-eYlU9yX-.js → InstallationPage-Dorh05Cd.js} +1 -1
  26. package/public/assets/{LandingPage-JAVdoyx8.js → LandingPage-C7_v2JNK.js} +1 -1
  27. package/public/assets/{LocalDevelopmentPage-B9V7vq2L.js → LocalDevelopmentPage-IzSDZ8WW.js} +1 -1
  28. package/public/assets/{LoginPage-CgeicODU.js → LoginPage-CZz5g9sU.js} +1 -1
  29. package/public/assets/{MetricBar-BYFKj8TH.js → MetricBar-q2ffYwIO.js} +1 -1
  30. package/public/assets/{NotFoundPage-DOd4f9i6.js → NotFoundPage-CZEX5gr6.js} +1 -1
  31. package/public/assets/{OnboardingGuide-BrMti0Y7.js → OnboardingGuide-C1FUVjMo.js} +1 -1
  32. package/public/assets/{PermissionsPage-CAVOvSdc.js → PermissionsPage-CfFekX2i.js} +1 -1
  33. package/public/assets/{PipelineConfigPage-DP4pgiU9.js → PipelineConfigPage-6tfkv6hj.js} +1 -1
  34. package/public/assets/{PipelineEditorPage--hPt9dkd.js → PipelineEditorPage-XxZdswLa.js} +1 -1
  35. package/public/assets/{ProfilePage-CX3ccSje.js → ProfilePage-KG0GogCa.js} +1 -1
  36. package/public/assets/{ProjectDetailPage-BnVFOUrR.js → ProjectDetailPage-iQzJH48J.js} +1 -1
  37. package/public/assets/{ProjectListPage-CCH8vc8a.js → ProjectListPage-D0LAZZsK.js} +1 -1
  38. package/public/assets/{PtyTerminal-D4Pnvckz.js → PtyTerminal-BArxYF4R.js} +1 -1
  39. package/public/assets/{QuickAuth-qJkvo4wj.js → QuickAuth-fWoVJHZd.js} +1 -1
  40. package/public/assets/{RemoveMemberConfirmDialog-frlalQgu.js → RemoveMemberConfirmDialog-D0MNaqua.js} +1 -1
  41. package/public/assets/{Select-DTkOfpR5.js → Select-Bb1Om6Pn.js} +1 -1
  42. package/public/assets/{SettingsPage-DS9j5JYv.js → SettingsPage-Y6Uo5-cT.js} +1 -1
  43. package/public/assets/{Skeleton-BoaO_-xm.js → Skeleton-BnZTI3PM.js} +1 -1
  44. package/public/assets/{SkillPage-sQoDAszL.js → SkillPage-DPXfneXB.js} +1 -1
  45. package/public/assets/{TaskDetailPage-D9NCpc4q.js → TaskDetailPage-DxS8IX_H.js} +1 -1
  46. package/public/assets/{TaskListPage-BefLQS7l.js → TaskListPage-kOQDNqdP.js} +1 -1
  47. package/public/assets/{TaskStatusBadge-CzINJb--.js → TaskStatusBadge-CAzEbP55.js} +1 -1
  48. package/public/assets/{TerminalHomePage-B98Srq3u.js → TerminalHomePage-CajSNUCs.js} +1 -1
  49. package/public/assets/{TokenManage-BX9WomWe.js → TokenManage-DLqC8Oiq.js} +1 -1
  50. package/public/assets/{TotpSetupPage-Dg294iM7.js → TotpSetupPage-XFWUwLmD.js} +1 -1
  51. package/public/assets/{WorkerDetailPage-B-WHlPNN.js → WorkerDetailPage-ze7Anqi8.js} +1 -1
  52. package/public/assets/{WorkerListPage-CT4D8nJJ.js → WorkerListPage-DHcw_qVO.js} +1 -1
  53. package/public/assets/{WorkerOperationsPage-CYgcirPe.js → WorkerOperationsPage-BKYGuZT9.js} +1 -1
  54. package/public/assets/{WorkerSetupGuidePage-B2_w9huT.js → WorkerSetupGuidePage-BBjUnfoc.js} +1 -1
  55. package/public/assets/{WorkerSetupPage-4YF10ee7.js → WorkerSetupPage-CllS2_5z.js} +1 -1
  56. package/public/assets/{arrow-left-Ca2TWedN.js → arrow-left-eknrcEhw.js} +1 -1
  57. package/public/assets/{arrow-right-BPEXs9t1.js → arrow-right-BoqEsRZm.js} +1 -1
  58. package/public/assets/{bot-B1x-Apdu.js → bot-C76OsRmU.js} +1 -1
  59. package/public/assets/{chevron-right-CzgBJ-6A.js → chevron-right-qJP2MWRS.js} +1 -1
  60. package/public/assets/{copy-C5fJs6wk.js → copy-Bmiw8s-G.js} +1 -1
  61. package/public/assets/{download-rRbLHSmW.js → download-DNT6K4MW.js} +1 -1
  62. package/public/assets/{external-link-CQmnVK5q.js → external-link-DBXYeKLc.js} +1 -1
  63. package/public/assets/{index-DksvkOu1.js → index-IU_JgZB6.js} +5 -5
  64. package/public/assets/{key-BJMLbnC-.js → key-BUcjEzf-.js} +1 -1
  65. package/public/assets/{loader-circle-Cij6Q2M6.js → loader-circle-Bw10cLrR.js} +1 -1
  66. package/public/assets/{pencil-DkFLak5k.js → pencil-DzScLBmG.js} +1 -1
  67. package/public/assets/{plus-Yj9sfbGn.js → plus-o_FzgRCv.js} +1 -1
  68. package/public/assets/{rotate-ccw-DmNaE4D9.js → rotate-ccw-BlXPBXyn.js} +1 -1
  69. package/public/assets/{scroll-text-8Nj0pGeQ.js → scroll-text-CFVr0o0Z.js} +1 -1
  70. package/public/assets/{settings-DAF9PKLv.js → settings-Dy8YWweC.js} +1 -1
  71. package/public/assets/{status-colors-DxK9REYI.js → status-colors-D6drermf.js} +1 -1
  72. package/public/assets/{task-constants-Bcmf335C.js → task-constants-CO2WGgG-.js} +1 -1
  73. package/public/assets/{trash-2-CVZEb49O.js → trash-2-HeC4Exog.js} +1 -1
  74. package/public/assets/{useFetch-BYpadpHB.js → useFetch-BTCOsmJx.js} +1 -1
  75. package/public/assets/{users-c9hLNA7b.js → users-C4psfHHj.js} +1 -1
  76. package/public/assets/{wifi-BRfoRdKc.js → wifi-D342KBoS.js} +1 -1
  77. package/public/assets/{workflow-B336nw8s.js → workflow-DsuYDF_6.js} +1 -1
  78. package/public/index.html +1 -1
  79. package/public/sw.js +1 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-JAVdoyx8.js","assets/arrow-right-BPEXs9t1.js","assets/bot-B1x-Apdu.js","assets/workflow-B336nw8s.js","assets/users-c9hLNA7b.js","assets/copy-C5fJs6wk.js","assets/HomePage-G4Ps95Ct.js","assets/TaskStatusBadge-CzINJb--.js","assets/status-colors-DxK9REYI.js","assets/Skeleton-BoaO_-xm.js","assets/OnboardingGuide-BrMti0Y7.js","assets/chevron-right-CzgBJ-6A.js","assets/date-BdNtiQTP.js","assets/string-B39tzdVK.js","assets/useFetch-BYpadpHB.js","assets/TerminalHomePage-B98Srq3u.js","assets/task-constants-Bcmf335C.js","assets/PtyTerminal-D4Pnvckz.js","assets/PtyTerminal-Beg8tuEN.css","assets/Select-DTkOfpR5.js","assets/plus-Yj9sfbGn.js","assets/rotate-ccw-DmNaE4D9.js","assets/wifi-BRfoRdKc.js","assets/TaskListPage-BefLQS7l.js","assets/EmptyState-Dib-wBQq.js","assets/TaskDetailPage-D9NCpc4q.js","assets/arrow-left-Ca2TWedN.js","assets/external-link-CQmnVK5q.js","assets/loader-circle-Cij6Q2M6.js","assets/WorkerListPage-CT4D8nJJ.js","assets/MetricBar-BYFKj8TH.js","assets/WorkerSetupGuidePage-B2_w9huT.js","assets/key-BJMLbnC-.js","assets/download-rRbLHSmW.js","assets/settings-DAF9PKLv.js","assets/WorkerDetailPage-B-WHlPNN.js","assets/InfoRow-DhvGe8vw.js","assets/trash-2-CVZEb49O.js","assets/ProjectListPage-CCH8vc8a.js","assets/ProjectDetailPage-BnVFOUrR.js","assets/RemoveMemberConfirmDialog-frlalQgu.js","assets/pencil-DkFLak5k.js","assets/EditProjectPage-DpDa9_IE.js","assets/PipelineEditorPage--hPt9dkd.js","assets/ProfilePage-CX3ccSje.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-D1UA8WwD.js","assets/CliReferencePage-DU2fjiUE.js","assets/QuickAuth-qJkvo4wj.js","assets/ApiReferencePage-B8T47k7e.js","assets/SkillPage-sQoDAszL.js","assets/DocsPrimitives-B5AB_da7.js","assets/DocsLayout-BAJM4ClE.js","assets/InstallationPage-eYlU9yX-.js","assets/DeveloperSetupPage-Dv72Bl6n.js","assets/WorkerSetupPage-4YF10ee7.js","assets/BotSetupPage-AsIfBCJ_.js","assets/LocalDevelopmentPage-B9V7vq2L.js","assets/DeploymentPage-DXAAXZ0o.js","assets/PipelineConfigPage-DP4pgiU9.js","assets/DevWorkflowPage-BPtySJfp.js","assets/ArchitecturePage-SMQtJF5K.js","assets/DocsIndexPage-B-4AcFGv.js","assets/AdminPage-BiQv-DBz.js","assets/scroll-text-8Nj0pGeQ.js","assets/DeveloperManage-C7ndCnpl.js","assets/BotManage-BLG4cJJD.js","assets/TokenManage-BX9WomWe.js","assets/AuditLogPage-DQLZJtz9.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-C7_v2JNK.js","assets/arrow-right-BoqEsRZm.js","assets/bot-C76OsRmU.js","assets/workflow-DsuYDF_6.js","assets/users-C4psfHHj.js","assets/copy-Bmiw8s-G.js","assets/HomePage-dOxzI3Gt.js","assets/TaskStatusBadge-CAzEbP55.js","assets/status-colors-D6drermf.js","assets/Skeleton-BnZTI3PM.js","assets/OnboardingGuide-C1FUVjMo.js","assets/chevron-right-qJP2MWRS.js","assets/date-BdNtiQTP.js","assets/string-B39tzdVK.js","assets/useFetch-BTCOsmJx.js","assets/TerminalHomePage-CajSNUCs.js","assets/task-constants-CO2WGgG-.js","assets/PtyTerminal-BArxYF4R.js","assets/PtyTerminal-Beg8tuEN.css","assets/Select-Bb1Om6Pn.js","assets/plus-o_FzgRCv.js","assets/rotate-ccw-BlXPBXyn.js","assets/wifi-D342KBoS.js","assets/TaskListPage-kOQDNqdP.js","assets/EmptyState-Cc8AT_UZ.js","assets/TaskDetailPage-DxS8IX_H.js","assets/arrow-left-eknrcEhw.js","assets/external-link-DBXYeKLc.js","assets/loader-circle-Bw10cLrR.js","assets/WorkerListPage-DHcw_qVO.js","assets/MetricBar-q2ffYwIO.js","assets/WorkerSetupGuidePage-BBjUnfoc.js","assets/key-BUcjEzf-.js","assets/download-DNT6K4MW.js","assets/settings-Dy8YWweC.js","assets/WorkerDetailPage-ze7Anqi8.js","assets/InfoRow-BhSkV-4a.js","assets/trash-2-HeC4Exog.js","assets/ProjectListPage-D0LAZZsK.js","assets/ProjectDetailPage-iQzJH48J.js","assets/RemoveMemberConfirmDialog-D0MNaqua.js","assets/pencil-DzScLBmG.js","assets/EditProjectPage-CBxwr2NU.js","assets/PipelineEditorPage-XxZdswLa.js","assets/ProfilePage-KG0GogCa.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-DYW95oYn.js","assets/CliReferencePage-l1Msp1MO.js","assets/QuickAuth-fWoVJHZd.js","assets/ApiReferencePage-k0qwCqrg.js","assets/SkillPage-DPXfneXB.js","assets/DocsPrimitives-8sNjBDJg.js","assets/DocsLayout-BjOXe_bC.js","assets/InstallationPage-Dorh05Cd.js","assets/DeveloperSetupPage-gVXD6Xl2.js","assets/WorkerSetupPage-CllS2_5z.js","assets/BotSetupPage-GNWFUbvf.js","assets/LocalDevelopmentPage-IzSDZ8WW.js","assets/DeploymentPage-dKYl9mAA.js","assets/PipelineConfigPage-6tfkv6hj.js","assets/DevWorkflowPage-BoQ2X_5v.js","assets/ArchitecturePage-CZdIr5OG.js","assets/DocsIndexPage-B34B9w-e.js","assets/AdminPage-CmzgxmfL.js","assets/scroll-text-CFVr0o0Z.js","assets/DeveloperManage-DCXu9nL7.js","assets/BotManage-BgzStyGf.js","assets/TokenManage-DLqC8Oiq.js","assets/AuditLogPage-B46ZPniK.js"])))=>i.map(i=>d[i]);
2
2
  var $g=Object.defineProperty;var Pm=r=>{throw TypeError(r)};var Wg=(r,u,s)=>u in r?$g(r,u,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[u]=s;var Ve=(r,u,s)=>Wg(r,typeof u!="symbol"?u+"":u,s),gs=(r,u,s)=>u.has(r)||Pm("Cannot "+s);var U=(r,u,s)=>(gs(r,u,"read from private field"),s?s.call(r):u.get(r)),Pt=(r,u,s)=>u.has(r)?Pm("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(r):u.set(r,s),Kt=(r,u,s,o)=>(gs(r,u,"write to private field"),o?o.call(r,s):u.set(r,s),s),ke=(r,u,s)=>(gs(r,u,"access private method"),s);var eh=(r,u,s,o)=>({set _(f){Kt(r,u,f,s)},get _(){return U(r,u,o)}});(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const p of h.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function s(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(f){if(f.ep)return;f.ep=!0;const h=s(f);fetch(f.href,h)}})();function Fg(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ys={exports:{}},ti={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -56,9 +56,9 @@ Error generating stack: `+n.message+`
56
56
  * LICENSE.md file in the root directory of this source tree.
57
57
  *
58
58
  * @license MIT
59
- */var dh="popstate";function mh(r){return typeof r=="object"&&r!=null&&"pathname"in r&&"search"in r&&"hash"in r&&"state"in r&&"key"in r}function cy(r={}){function u(o,f){var _;let h=(_=f.state)==null?void 0:_.masked,{pathname:p,search:b,hash:y}=h||o.location;return Os("",{pathname:p,search:b,hash:y},f.state&&f.state.usr||null,f.state&&f.state.key||"default",h?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function s(o,f){return typeof f=="string"?f:ui(f)}return dy(u,s,null,r)}function Ue(r,u){if(r===!1||r===null||typeof r>"u")throw new Error(u)}function Yt(r,u){if(!r){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function fy(){return Math.random().toString(36).substring(2,10)}function hh(r,u){return{usr:r.state,key:r.key,idx:u,masked:r.unstable_mask?{pathname:r.pathname,search:r.search,hash:r.hash}:void 0}}function Os(r,u,s=null,o,f){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof u=="string"?il(u):u,state:s,key:u&&u.key||o||fy(),unstable_mask:f}}function ui({pathname:r="/",search:u="",hash:s=""}){return u&&u!=="?"&&(r+=u.charAt(0)==="?"?u:"?"+u),s&&s!=="#"&&(r+=s.charAt(0)==="#"?s:"#"+s),r}function il(r){let u={};if(r){let s=r.indexOf("#");s>=0&&(u.hash=r.substring(s),r=r.substring(0,s));let o=r.indexOf("?");o>=0&&(u.search=r.substring(o),r=r.substring(0,o)),r&&(u.pathname=r)}return u}function dy(r,u,s,o={}){let{window:f=document.defaultView,v5Compat:h=!1}=o,p=f.history,b="POP",y=null,_=w();_==null&&(_=0,p.replaceState({...p.state,idx:_},""));function w(){return(p.state||{idx:null}).idx}function k(){b="POP";let L=w(),B=L==null?null:L-_;_=L,y&&y({action:b,location:q.location,delta:B})}function M(L,B){b="PUSH";let G=mh(L)?L:Os(q.location,L,B);_=w()+1;let J=hh(G,_),se=q.createHref(G.unstable_mask||G);try{p.pushState(J,"",se)}catch(ce){if(ce instanceof DOMException&&ce.name==="DataCloneError")throw ce;f.location.assign(se)}h&&y&&y({action:b,location:q.location,delta:1})}function Y(L,B){b="REPLACE";let G=mh(L)?L:Os(q.location,L,B);_=w();let J=hh(G,_),se=q.createHref(G.unstable_mask||G);p.replaceState(J,"",se),h&&y&&y({action:b,location:q.location,delta:0})}function H(L){return my(L)}let q={get action(){return b},get location(){return r(f,p)},listen(L){if(y)throw new Error("A history only accepts one active listener");return f.addEventListener(dh,k),y=L,()=>{f.removeEventListener(dh,k),y=null}},createHref(L){return u(f,L)},createURL:H,encodeLocation(L){let B=H(L);return{pathname:B.pathname,search:B.search,hash:B.hash}},push:M,replace:Y,go(L){return p.go(L)}};return q}function my(r,u=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),Ue(s,"No window.location.(origin|href) available to create URL");let o=typeof r=="string"?r:ui(r);return o=o.replace(/ $/,"%20"),!u&&o.startsWith("//")&&(o=s+o),new URL(o,s)}function Dh(r,u,s="/"){return hy(r,u,s,!1)}function hy(r,u,s,o){let f=typeof u=="string"?il(u):u,h=Sa(f.pathname||"/",s);if(h==null)return null;let p=Nh(r);py(p);let b=null;for(let y=0;b==null&&y<p.length;++y){let _=Ty(h);b=Ey(p[y],_,o)}return b}function Nh(r,u=[],s=[],o="",f=!1){let h=(p,b,y=f,_)=>{let w={relativePath:_===void 0?p.path||"":_,caseSensitive:p.caseSensitive===!0,childrenIndex:b,route:p};if(w.relativePath.startsWith("/")){if(!w.relativePath.startsWith(o)&&y)return;Ue(w.relativePath.startsWith(o),`Absolute route path "${w.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),w.relativePath=w.relativePath.slice(o.length)}let k=ta([o,w.relativePath]),M=s.concat(w);p.children&&p.children.length>0&&(Ue(p.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${k}".`),Nh(p.children,u,M,k,y)),!(p.path==null&&!p.index)&&u.push({path:k,score:Sy(k,p.index),routesMeta:M})};return r.forEach((p,b)=>{var y;if(p.path===""||!((y=p.path)!=null&&y.includes("?")))h(p,b);else for(let _ of Mh(p.path))h(p,b,!0,_)}),u}function Mh(r){let u=r.split("/");if(u.length===0)return[];let[s,...o]=u,f=s.endsWith("?"),h=s.replace(/\?$/,"");if(o.length===0)return f?[h,""]:[h];let p=Mh(o.join("/")),b=[];return b.push(...p.map(y=>y===""?h:[h,y].join("/"))),f&&b.push(...p),b.map(y=>r.startsWith("/")&&y===""?"/":y)}function py(r){r.sort((u,s)=>u.score!==s.score?s.score-u.score:ky(u.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}var _y=/^:[\w-]+$/,gy=3,yy=2,vy=1,by=10,xy=-2,ph=r=>r==="*";function Sy(r,u){let s=r.split("/"),o=s.length;return s.some(ph)&&(o+=xy),u&&(o+=yy),s.filter(f=>!ph(f)).reduce((f,h)=>f+(_y.test(h)?gy:h===""?vy:by),o)}function ky(r,u){return r.length===u.length&&r.slice(0,-1).every((o,f)=>o===u[f])?r[r.length-1]-u[u.length-1]:0}function Ey(r,u,s=!1){let{routesMeta:o}=r,f={},h="/",p=[];for(let b=0;b<o.length;++b){let y=o[b],_=b===o.length-1,w=h==="/"?u:u.slice(h.length)||"/",k=Qr({path:y.relativePath,caseSensitive:y.caseSensitive,end:_},w),M=y.route;if(!k&&_&&s&&!o[o.length-1].route.index&&(k=Qr({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},w)),!k)return null;Object.assign(f,k.params),p.push({params:f,pathname:ta([h,k.pathname]),pathnameBase:zy(ta([h,k.pathnameBase])),route:M}),k.pathnameBase!=="/"&&(h=ta([h,k.pathnameBase]))}return p}function Qr(r,u){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[s,o]=wy(r.path,r.caseSensitive,r.end),f=u.match(s);if(!f)return null;let h=f[0],p=h.replace(/(.)\/+$/,"$1"),b=f.slice(1);return{params:o.reduce((_,{paramName:w,isOptional:k},M)=>{if(w==="*"){let H=b[M]||"";p=h.slice(0,h.length-H.length).replace(/(.)\/+$/,"$1")}const Y=b[M];return k&&!Y?_[w]=void 0:_[w]=(Y||"").replace(/%2F/g,"/"),_},{}),pathname:h,pathnameBase:p,pattern:r}}function wy(r,u=!1,s=!0){Yt(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let o=[],f="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(p,b,y,_,w)=>{if(o.push({paramName:b,isOptional:y!=null}),y){let k=w.charAt(_+p.length);return k&&k!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(o.push({paramName:"*"}),f+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?f+="\\/*$":r!==""&&r!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,u?void 0:"i"),o]}function Ty(r){try{return r.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return Yt(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${u}).`),r}}function Sa(r,u){if(u==="/")return r;if(!r.toLowerCase().startsWith(u.toLowerCase()))return null;let s=u.endsWith("/")?u.length-1:u.length,o=r.charAt(s);return o&&o!=="/"?null:r.slice(s)||"/"}var jy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Ry(r,u="/"){let{pathname:s,search:o="",hash:f=""}=typeof r=="string"?il(r):r,h;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?h=_h(s.substring(1),"/"):h=_h(s,u)):h=u,{pathname:h,search:Oy(o),hash:Cy(f)}}function _h(r,u){let s=u.replace(/\/+$/,"").split("/");return r.split("/").forEach(f=>{f===".."?s.length>1&&s.pop():f!=="."&&s.push(f)}),s.length>1?s.join("/"):"/"}function Es(r,u,s,o){return`Cannot include a '${r}' character in a manually specified \`to.${u}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ay(r){return r.filter((u,s)=>s===0||u.route.path&&u.route.path.length>0)}function Gs(r){let u=Ay(r);return u.map((s,o)=>o===u.length-1?s.pathname:s.pathnameBase)}function Jr(r,u,s,o=!1){let f;typeof r=="string"?f=il(r):(f={...r},Ue(!f.pathname||!f.pathname.includes("?"),Es("?","pathname","search",f)),Ue(!f.pathname||!f.pathname.includes("#"),Es("#","pathname","hash",f)),Ue(!f.search||!f.search.includes("#"),Es("#","search","hash",f)));let h=r===""||f.pathname==="",p=h?"/":f.pathname,b;if(p==null)b=s;else{let k=u.length-1;if(!o&&p.startsWith("..")){let M=p.split("/");for(;M[0]==="..";)M.shift(),k-=1;f.pathname=M.join("/")}b=k>=0?u[k]:"/"}let y=Ry(f,b),_=p&&p!=="/"&&p.endsWith("/"),w=(h||p===".")&&s.endsWith("/");return!y.pathname.endsWith("/")&&(_||w)&&(y.pathname+="/"),y}var ta=r=>r.join("/").replace(/\/\/+/g,"/"),zy=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Oy=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Cy=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,Dy=class{constructor(r,u,s,o=!1){this.status=r,this.statusText=u||"",this.internal=o,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Ny(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function My(r){return r.map(u=>u.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Uh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qh(r,u){let s=r;if(typeof s!="string"||!jy.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let o=s,f=!1;if(Uh)try{let h=new URL(window.location.href),p=s.startsWith("//")?new URL(h.protocol+s):new URL(s),b=Sa(p.pathname,u);p.origin===h.origin&&b!=null?s=b+p.search+p.hash:f=!0}catch{Yt(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:f,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Lh=["POST","PUT","PATCH","DELETE"];new Set(Lh);var Uy=["GET",...Lh];new Set(Uy);var rl=g.createContext(null);rl.displayName="DataRouter";var $r=g.createContext(null);$r.displayName="DataRouterState";var qy=g.createContext(!1),Hh=g.createContext({isTransitioning:!1});Hh.displayName="ViewTransition";var Ly=g.createContext(new Map);Ly.displayName="Fetchers";var Hy=g.createContext(null);Hy.displayName="Await";var Rt=g.createContext(null);Rt.displayName="Navigation";var oi=g.createContext(null);oi.displayName="Location";var Gt=g.createContext({outlet:null,matches:[],isDataRoute:!1});Gt.displayName="Route";var Vs=g.createContext(null);Vs.displayName="RouteError";var Bh="REACT_ROUTER_ERROR",By="REDIRECT",Yy="ROUTE_ERROR_RESPONSE";function Gy(r){if(r.startsWith(`${Bh}:${By}:{`))try{let u=JSON.parse(r.slice(28));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string"&&typeof u.location=="string"&&typeof u.reloadDocument=="boolean"&&typeof u.replace=="boolean")return u}catch{}}function Vy(r){if(r.startsWith(`${Bh}:${Yy}:{`))try{let u=JSON.parse(r.slice(40));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string")return new Dy(u.status,u.statusText,u.data)}catch{}}function Xy(r,{relative:u}={}){Ue(ul(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:o}=g.useContext(Rt),{hash:f,pathname:h,search:p}=si(r,{relative:u}),b=h;return s!=="/"&&(b=h==="/"?s:ta([s,h])),o.createHref({pathname:b,search:p,hash:f})}function ul(){return g.useContext(oi)!=null}function gt(){return Ue(ul(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(oi).location}var Yh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gh(r){g.useContext(Rt).static||g.useLayoutEffect(r)}function Fa(){let{isDataRoute:r}=g.useContext(Gt);return r?iv():Qy()}function Qy(){Ue(ul(),"useNavigate() may be used only in the context of a <Router> component.");let r=g.useContext(rl),{basename:u,navigator:s}=g.useContext(Rt),{matches:o}=g.useContext(Gt),{pathname:f}=gt(),h=JSON.stringify(Gs(o)),p=g.useRef(!1);return Gh(()=>{p.current=!0}),g.useCallback((y,_={})=>{if(Yt(p.current,Yh),!p.current)return;if(typeof y=="number"){s.go(y);return}let w=Jr(y,JSON.parse(h),f,_.relative==="path");r==null&&u!=="/"&&(w.pathname=w.pathname==="/"?u:ta([u,w.pathname])),(_.replace?s.replace:s.push)(w,_.state,_)},[u,s,h,f,r])}var Zy=g.createContext(null);function Ky(r){let u=g.useContext(Gt).outlet;return g.useMemo(()=>u&&g.createElement(Zy.Provider,{value:r},u),[u,r])}function k1(){let{matches:r}=g.useContext(Gt),u=r[r.length-1];return u?u.params:{}}function si(r,{relative:u}={}){let{matches:s}=g.useContext(Gt),{pathname:o}=gt(),f=JSON.stringify(Gs(s));return g.useMemo(()=>Jr(r,JSON.parse(f),o,u==="path"),[r,f,o,u])}function Jy(r,u){return Vh(r,u)}function Vh(r,u,s){var L;Ue(ul(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=g.useContext(Rt),{matches:f}=g.useContext(Gt),h=f[f.length-1],p=h?h.params:{},b=h?h.pathname:"/",y=h?h.pathnameBase:"/",_=h&&h.route;{let B=_&&_.path||"";Qh(b,!_||B.endsWith("*")||B.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${B}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+ */var dh="popstate";function mh(r){return typeof r=="object"&&r!=null&&"pathname"in r&&"search"in r&&"hash"in r&&"state"in r&&"key"in r}function cy(r={}){function u(o,f){var _;let h=(_=f.state)==null?void 0:_.masked,{pathname:p,search:b,hash:y}=h||o.location;return Os("",{pathname:p,search:b,hash:y},f.state&&f.state.usr||null,f.state&&f.state.key||"default",h?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function s(o,f){return typeof f=="string"?f:ui(f)}return dy(u,s,null,r)}function Ue(r,u){if(r===!1||r===null||typeof r>"u")throw new Error(u)}function Yt(r,u){if(!r){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function fy(){return Math.random().toString(36).substring(2,10)}function hh(r,u){return{usr:r.state,key:r.key,idx:u,masked:r.unstable_mask?{pathname:r.pathname,search:r.search,hash:r.hash}:void 0}}function Os(r,u,s=null,o,f){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof u=="string"?il(u):u,state:s,key:u&&u.key||o||fy(),unstable_mask:f}}function ui({pathname:r="/",search:u="",hash:s=""}){return u&&u!=="?"&&(r+=u.charAt(0)==="?"?u:"?"+u),s&&s!=="#"&&(r+=s.charAt(0)==="#"?s:"#"+s),r}function il(r){let u={};if(r){let s=r.indexOf("#");s>=0&&(u.hash=r.substring(s),r=r.substring(0,s));let o=r.indexOf("?");o>=0&&(u.search=r.substring(o),r=r.substring(0,o)),r&&(u.pathname=r)}return u}function dy(r,u,s,o={}){let{window:f=document.defaultView,v5Compat:h=!1}=o,p=f.history,b="POP",y=null,_=w();_==null&&(_=0,p.replaceState({...p.state,idx:_},""));function w(){return(p.state||{idx:null}).idx}function k(){b="POP";let L=w(),B=L==null?null:L-_;_=L,y&&y({action:b,location:q.location,delta:B})}function M(L,B){b="PUSH";let G=mh(L)?L:Os(q.location,L,B);_=w()+1;let J=hh(G,_),se=q.createHref(G.unstable_mask||G);try{p.pushState(J,"",se)}catch(ce){if(ce instanceof DOMException&&ce.name==="DataCloneError")throw ce;f.location.assign(se)}h&&y&&y({action:b,location:q.location,delta:1})}function Y(L,B){b="REPLACE";let G=mh(L)?L:Os(q.location,L,B);_=w();let J=hh(G,_),se=q.createHref(G.unstable_mask||G);p.replaceState(J,"",se),h&&y&&y({action:b,location:q.location,delta:0})}function H(L){return my(L)}let q={get action(){return b},get location(){return r(f,p)},listen(L){if(y)throw new Error("A history only accepts one active listener");return f.addEventListener(dh,k),y=L,()=>{f.removeEventListener(dh,k),y=null}},createHref(L){return u(f,L)},createURL:H,encodeLocation(L){let B=H(L);return{pathname:B.pathname,search:B.search,hash:B.hash}},push:M,replace:Y,go(L){return p.go(L)}};return q}function my(r,u=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),Ue(s,"No window.location.(origin|href) available to create URL");let o=typeof r=="string"?r:ui(r);return o=o.replace(/ $/,"%20"),!u&&o.startsWith("//")&&(o=s+o),new URL(o,s)}function Dh(r,u,s="/"){return hy(r,u,s,!1)}function hy(r,u,s,o){let f=typeof u=="string"?il(u):u,h=Sa(f.pathname||"/",s);if(h==null)return null;let p=Nh(r);py(p);let b=null;for(let y=0;b==null&&y<p.length;++y){let _=Ty(h);b=Ey(p[y],_,o)}return b}function Nh(r,u=[],s=[],o="",f=!1){let h=(p,b,y=f,_)=>{let w={relativePath:_===void 0?p.path||"":_,caseSensitive:p.caseSensitive===!0,childrenIndex:b,route:p};if(w.relativePath.startsWith("/")){if(!w.relativePath.startsWith(o)&&y)return;Ue(w.relativePath.startsWith(o),`Absolute route path "${w.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),w.relativePath=w.relativePath.slice(o.length)}let k=ta([o,w.relativePath]),M=s.concat(w);p.children&&p.children.length>0&&(Ue(p.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${k}".`),Nh(p.children,u,M,k,y)),!(p.path==null&&!p.index)&&u.push({path:k,score:Sy(k,p.index),routesMeta:M})};return r.forEach((p,b)=>{var y;if(p.path===""||!((y=p.path)!=null&&y.includes("?")))h(p,b);else for(let _ of Mh(p.path))h(p,b,!0,_)}),u}function Mh(r){let u=r.split("/");if(u.length===0)return[];let[s,...o]=u,f=s.endsWith("?"),h=s.replace(/\?$/,"");if(o.length===0)return f?[h,""]:[h];let p=Mh(o.join("/")),b=[];return b.push(...p.map(y=>y===""?h:[h,y].join("/"))),f&&b.push(...p),b.map(y=>r.startsWith("/")&&y===""?"/":y)}function py(r){r.sort((u,s)=>u.score!==s.score?s.score-u.score:ky(u.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}var _y=/^:[\w-]+$/,gy=3,yy=2,vy=1,by=10,xy=-2,ph=r=>r==="*";function Sy(r,u){let s=r.split("/"),o=s.length;return s.some(ph)&&(o+=xy),u&&(o+=yy),s.filter(f=>!ph(f)).reduce((f,h)=>f+(_y.test(h)?gy:h===""?vy:by),o)}function ky(r,u){return r.length===u.length&&r.slice(0,-1).every((o,f)=>o===u[f])?r[r.length-1]-u[u.length-1]:0}function Ey(r,u,s=!1){let{routesMeta:o}=r,f={},h="/",p=[];for(let b=0;b<o.length;++b){let y=o[b],_=b===o.length-1,w=h==="/"?u:u.slice(h.length)||"/",k=Qr({path:y.relativePath,caseSensitive:y.caseSensitive,end:_},w),M=y.route;if(!k&&_&&s&&!o[o.length-1].route.index&&(k=Qr({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},w)),!k)return null;Object.assign(f,k.params),p.push({params:f,pathname:ta([h,k.pathname]),pathnameBase:zy(ta([h,k.pathnameBase])),route:M}),k.pathnameBase!=="/"&&(h=ta([h,k.pathnameBase]))}return p}function Qr(r,u){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[s,o]=wy(r.path,r.caseSensitive,r.end),f=u.match(s);if(!f)return null;let h=f[0],p=h.replace(/(.)\/+$/,"$1"),b=f.slice(1);return{params:o.reduce((_,{paramName:w,isOptional:k},M)=>{if(w==="*"){let H=b[M]||"";p=h.slice(0,h.length-H.length).replace(/(.)\/+$/,"$1")}const Y=b[M];return k&&!Y?_[w]=void 0:_[w]=(Y||"").replace(/%2F/g,"/"),_},{}),pathname:h,pathnameBase:p,pattern:r}}function wy(r,u=!1,s=!0){Yt(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let o=[],f="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(p,b,y,_,w)=>{if(o.push({paramName:b,isOptional:y!=null}),y){let k=w.charAt(_+p.length);return k&&k!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(o.push({paramName:"*"}),f+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?f+="\\/*$":r!==""&&r!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,u?void 0:"i"),o]}function Ty(r){try{return r.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return Yt(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${u}).`),r}}function Sa(r,u){if(u==="/")return r;if(!r.toLowerCase().startsWith(u.toLowerCase()))return null;let s=u.endsWith("/")?u.length-1:u.length,o=r.charAt(s);return o&&o!=="/"?null:r.slice(s)||"/"}var jy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Ry(r,u="/"){let{pathname:s,search:o="",hash:f=""}=typeof r=="string"?il(r):r,h;return s?(s=s.replace(/\/\/+/g,"/"),s.startsWith("/")?h=_h(s.substring(1),"/"):h=_h(s,u)):h=u,{pathname:h,search:Oy(o),hash:Cy(f)}}function _h(r,u){let s=u.replace(/\/+$/,"").split("/");return r.split("/").forEach(f=>{f===".."?s.length>1&&s.pop():f!=="."&&s.push(f)}),s.length>1?s.join("/"):"/"}function Es(r,u,s,o){return`Cannot include a '${r}' character in a manually specified \`to.${u}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ay(r){return r.filter((u,s)=>s===0||u.route.path&&u.route.path.length>0)}function Gs(r){let u=Ay(r);return u.map((s,o)=>o===u.length-1?s.pathname:s.pathnameBase)}function Jr(r,u,s,o=!1){let f;typeof r=="string"?f=il(r):(f={...r},Ue(!f.pathname||!f.pathname.includes("?"),Es("?","pathname","search",f)),Ue(!f.pathname||!f.pathname.includes("#"),Es("#","pathname","hash",f)),Ue(!f.search||!f.search.includes("#"),Es("#","search","hash",f)));let h=r===""||f.pathname==="",p=h?"/":f.pathname,b;if(p==null)b=s;else{let k=u.length-1;if(!o&&p.startsWith("..")){let M=p.split("/");for(;M[0]==="..";)M.shift(),k-=1;f.pathname=M.join("/")}b=k>=0?u[k]:"/"}let y=Ry(f,b),_=p&&p!=="/"&&p.endsWith("/"),w=(h||p===".")&&s.endsWith("/");return!y.pathname.endsWith("/")&&(_||w)&&(y.pathname+="/"),y}var ta=r=>r.join("/").replace(/\/\/+/g,"/"),zy=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Oy=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Cy=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,Dy=class{constructor(r,u,s,o=!1){this.status=r,this.statusText=u||"",this.internal=o,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Ny(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function My(r){return r.map(u=>u.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Uh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qh(r,u){let s=r;if(typeof s!="string"||!jy.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let o=s,f=!1;if(Uh)try{let h=new URL(window.location.href),p=s.startsWith("//")?new URL(h.protocol+s):new URL(s),b=Sa(p.pathname,u);p.origin===h.origin&&b!=null?s=b+p.search+p.hash:f=!0}catch{Yt(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:f,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Lh=["POST","PUT","PATCH","DELETE"];new Set(Lh);var Uy=["GET",...Lh];new Set(Uy);var rl=g.createContext(null);rl.displayName="DataRouter";var $r=g.createContext(null);$r.displayName="DataRouterState";var qy=g.createContext(!1),Hh=g.createContext({isTransitioning:!1});Hh.displayName="ViewTransition";var Ly=g.createContext(new Map);Ly.displayName="Fetchers";var Hy=g.createContext(null);Hy.displayName="Await";var Rt=g.createContext(null);Rt.displayName="Navigation";var oi=g.createContext(null);oi.displayName="Location";var Gt=g.createContext({outlet:null,matches:[],isDataRoute:!1});Gt.displayName="Route";var Vs=g.createContext(null);Vs.displayName="RouteError";var Bh="REACT_ROUTER_ERROR",By="REDIRECT",Yy="ROUTE_ERROR_RESPONSE";function Gy(r){if(r.startsWith(`${Bh}:${By}:{`))try{let u=JSON.parse(r.slice(28));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string"&&typeof u.location=="string"&&typeof u.reloadDocument=="boolean"&&typeof u.replace=="boolean")return u}catch{}}function Vy(r){if(r.startsWith(`${Bh}:${Yy}:{`))try{let u=JSON.parse(r.slice(40));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string")return new Dy(u.status,u.statusText,u.data)}catch{}}function Xy(r,{relative:u}={}){Ue(ul(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:o}=g.useContext(Rt),{hash:f,pathname:h,search:p}=si(r,{relative:u}),b=h;return s!=="/"&&(b=h==="/"?s:ta([s,h])),o.createHref({pathname:b,search:p,hash:f})}function ul(){return g.useContext(oi)!=null}function gt(){return Ue(ul(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(oi).location}var Yh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gh(r){g.useContext(Rt).static||g.useLayoutEffect(r)}function Fa(){let{isDataRoute:r}=g.useContext(Gt);return r?iv():Qy()}function Qy(){Ue(ul(),"useNavigate() may be used only in the context of a <Router> component.");let r=g.useContext(rl),{basename:u,navigator:s}=g.useContext(Rt),{matches:o}=g.useContext(Gt),{pathname:f}=gt(),h=JSON.stringify(Gs(o)),p=g.useRef(!1);return Gh(()=>{p.current=!0}),g.useCallback((y,_={})=>{if(Yt(p.current,Yh),!p.current)return;if(typeof y=="number"){s.go(y);return}let w=Jr(y,JSON.parse(h),f,_.relative==="path");r==null&&u!=="/"&&(w.pathname=w.pathname==="/"?u:ta([u,w.pathname])),(_.replace?s.replace:s.push)(w,_.state,_)},[u,s,h,f,r])}var Zy=g.createContext(null);function Ky(r){let u=g.useContext(Gt).outlet;return g.useMemo(()=>u&&g.createElement(Zy.Provider,{value:r},u),[u,r])}function j1(){let{matches:r}=g.useContext(Gt),u=r[r.length-1];return u?u.params:{}}function si(r,{relative:u}={}){let{matches:s}=g.useContext(Gt),{pathname:o}=gt(),f=JSON.stringify(Gs(s));return g.useMemo(()=>Jr(r,JSON.parse(f),o,u==="path"),[r,f,o,u])}function Jy(r,u){return Vh(r,u)}function Vh(r,u,s){var L;Ue(ul(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=g.useContext(Rt),{matches:f}=g.useContext(Gt),h=f[f.length-1],p=h?h.params:{},b=h?h.pathname:"/",y=h?h.pathnameBase:"/",_=h&&h.route;{let B=_&&_.path||"";Qh(b,!_||B.endsWith("*")||B.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${B}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
60
 
61
- Please change the parent <Route path="${B}"> to <Route path="${B==="/"?"*":`${B}/*`}">.`)}let w=gt(),k;if(u){let B=typeof u=="string"?il(u):u;Ue(y==="/"||((L=B.pathname)==null?void 0:L.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${B.pathname}" was given in the \`location\` prop.`),k=B}else k=w;let M=k.pathname||"/",Y=M;if(y!=="/"){let B=y.replace(/^\//,"").split("/");Y="/"+M.replace(/^\//,"").split("/").slice(B.length).join("/")}let H=Dh(r,{pathname:Y});Yt(_||H!=null,`No routes matched location "${k.pathname}${k.search}${k.hash}" `),Yt(H==null||H[H.length-1].route.element!==void 0||H[H.length-1].route.Component!==void 0||H[H.length-1].route.lazy!==void 0,`Matched leaf route at location "${k.pathname}${k.search}${k.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let q=Py(H&&H.map(B=>Object.assign({},B,{params:Object.assign({},p,B.params),pathname:ta([y,o.encodeLocation?o.encodeLocation(B.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:B.pathname]),pathnameBase:B.pathnameBase==="/"?y:ta([y,o.encodeLocation?o.encodeLocation(B.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:B.pathnameBase])})),f,s);return u&&q?g.createElement(oi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...k},navigationType:"POP"}},q):q}function $y(){let r=lv(),u=Ny(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),s=r instanceof Error?r.stack:null,o="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:o},h={padding:"2px 4px",backgroundColor:o},p=null;return console.error("Error handled by React Router default ErrorBoundary:",r),p=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:h},"ErrorBoundary")," or"," ",g.createElement("code",{style:h},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},u),s?g.createElement("pre",{style:f},s):null,p)}var Wy=g.createElement($y,null),Xh=class extends g.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,u){return u.location!==r.location||u.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:u.error,location:u.location,revalidation:r.revalidation||u.revalidation}}componentDidCatch(r,u){this.props.onError?this.props.onError(r,u):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const s=Vy(r.digest);s&&(r=s)}let u=r!==void 0?g.createElement(Gt.Provider,{value:this.props.routeContext},g.createElement(Vs.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?g.createElement(Fy,{error:r},u):u}};Xh.contextType=qy;var ws=new WeakMap;function Fy({children:r,error:u}){let{basename:s}=g.useContext(Rt);if(typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){let o=Gy(u.digest);if(o){let f=ws.get(u);if(f)throw f;let h=qh(o.location,s);if(Uh&&!ws.get(u))if(h.isExternal||o.reloadDocument)window.location.href=h.absoluteURL||h.to;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(h.to,{replace:o.replace}));throw ws.set(u,p),p}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h.absoluteURL||h.to}`})}}return r}function Iy({routeContext:r,match:u,children:s}){let o=g.useContext(rl);return o&&o.static&&o.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=u.route.id),g.createElement(Gt.Provider,{value:r},s)}function Py(r,u=[],s){let o=s==null?void 0:s.state;if(r==null){if(!o)return null;if(o.errors)r=o.matches;else if(u.length===0&&!o.initialized&&o.matches.length>0)r=o.matches;else return null}let f=r,h=o==null?void 0:o.errors;if(h!=null){let w=f.findIndex(k=>k.route.id&&(h==null?void 0:h[k.route.id])!==void 0);Ue(w>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),f=f.slice(0,Math.min(f.length,w+1))}let p=!1,b=-1;if(s&&o){p=o.renderFallback;for(let w=0;w<f.length;w++){let k=f[w];if((k.route.HydrateFallback||k.route.hydrateFallbackElement)&&(b=w),k.route.id){let{loaderData:M,errors:Y}=o,H=k.route.loader&&!M.hasOwnProperty(k.route.id)&&(!Y||Y[k.route.id]===void 0);if(k.route.lazy||H){s.isStatic&&(p=!0),b>=0?f=f.slice(0,b+1):f=[f[0]];break}}}}let y=s==null?void 0:s.onError,_=o&&y?(w,k)=>{var M,Y;y(w,{location:o.location,params:((Y=(M=o.matches)==null?void 0:M[0])==null?void 0:Y.params)??{},unstable_pattern:My(o.matches),errorInfo:k})}:void 0;return f.reduceRight((w,k,M)=>{let Y,H=!1,q=null,L=null;o&&(Y=h&&k.route.id?h[k.route.id]:void 0,q=k.route.errorElement||Wy,p&&(b<0&&M===0?(Qh("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),H=!0,L=null):b===M&&(H=!0,L=k.route.hydrateFallbackElement||null)));let B=u.concat(f.slice(0,M+1)),G=()=>{let J;return Y?J=q:H?J=L:k.route.Component?J=g.createElement(k.route.Component,null):k.route.element?J=k.route.element:J=w,g.createElement(Iy,{match:k,routeContext:{outlet:w,matches:B,isDataRoute:o!=null},children:J})};return o&&(k.route.ErrorBoundary||k.route.errorElement||M===0)?g.createElement(Xh,{location:o.location,revalidation:o.revalidation,component:q,error:Y,children:G(),routeContext:{outlet:null,matches:B,isDataRoute:!0},onError:_}):G()},null)}function Xs(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ev(r){let u=g.useContext(rl);return Ue(u,Xs(r)),u}function tv(r){let u=g.useContext($r);return Ue(u,Xs(r)),u}function av(r){let u=g.useContext(Gt);return Ue(u,Xs(r)),u}function Qs(r){let u=av(r),s=u.matches[u.matches.length-1];return Ue(s.route.id,`${r} can only be used on routes that contain a unique "id"`),s.route.id}function nv(){return Qs("useRouteId")}function lv(){var o;let r=g.useContext(Vs),u=tv("useRouteError"),s=Qs("useRouteError");return r!==void 0?r:(o=u.errors)==null?void 0:o[s]}function iv(){let{router:r}=ev("useNavigate"),u=Qs("useNavigate"),s=g.useRef(!1);return Gh(()=>{s.current=!0}),g.useCallback(async(f,h={})=>{Yt(s.current,Yh),s.current&&(typeof f=="number"?await r.navigate(f):await r.navigate(f,{fromRouteId:u,...h}))},[r,u])}var gh={};function Qh(r,u,s){!u&&!gh[r]&&(gh[r]=!0,Yt(!1,s))}g.memo(rv);function rv({routes:r,future:u,state:s,isStatic:o,onError:f}){return Vh(r,void 0,{state:s,isStatic:o,onError:f})}function ll({to:r,replace:u,state:s,relative:o}){Ue(ul(),"<Navigate> may be used only in the context of a <Router> component.");let{static:f}=g.useContext(Rt);Yt(!f,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:h}=g.useContext(Gt),{pathname:p}=gt(),b=Fa(),y=Jr(r,Gs(h),p,o==="path"),_=JSON.stringify(y);return g.useEffect(()=>{b(JSON.parse(_),{replace:u,state:s,relative:o})},[b,_,o,u,s]),null}function uv(r){return Ky(r.context)}function te(r){Ue(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ov({basename:r="/",children:u=null,location:s,navigationType:o="POP",navigator:f,static:h=!1,unstable_useTransitions:p}){Ue(!ul(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let b=r.replace(/^\/*/,"/"),y=g.useMemo(()=>({basename:b,navigator:f,static:h,unstable_useTransitions:p,future:{}}),[b,f,h,p]);typeof s=="string"&&(s=il(s));let{pathname:_="/",search:w="",hash:k="",state:M=null,key:Y="default",unstable_mask:H}=s,q=g.useMemo(()=>{let L=Sa(_,b);return L==null?null:{location:{pathname:L,search:w,hash:k,state:M,key:Y,unstable_mask:H},navigationType:o}},[b,_,w,k,M,Y,o,H]);return Yt(q!=null,`<Router basename="${b}"> is not able to match the URL "${_}${w}${k}" because it does not start with the basename, so the <Router> won't render anything.`),q==null?null:g.createElement(Rt.Provider,{value:y},g.createElement(oi.Provider,{children:u,value:q}))}function sv({children:r,location:u}){return Jy(Cs(r),u)}function Cs(r,u=[]){let s=[];return g.Children.forEach(r,(o,f)=>{if(!g.isValidElement(o))return;let h=[...u,f];if(o.type===g.Fragment){s.push.apply(s,Cs(o.props.children,h));return}Ue(o.type===te,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ue(!o.props.index||!o.props.children,"An index route cannot have child routes.");let p={id:o.props.id||h.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(p.children=Cs(o.props.children,h)),s.push(p)}),s}var Lr="get",Hr="application/x-www-form-urlencoded";function Wr(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function cv(r){return Wr(r)&&r.tagName.toLowerCase()==="button"}function fv(r){return Wr(r)&&r.tagName.toLowerCase()==="form"}function dv(r){return Wr(r)&&r.tagName.toLowerCase()==="input"}function mv(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function hv(r,u){return r.button===0&&(!u||u==="_self")&&!mv(r)}function Ds(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((u,s)=>{let o=r[s];return u.concat(Array.isArray(o)?o.map(f=>[s,f]):[[s,o]])},[]))}function pv(r,u){let s=Ds(r);return u&&u.forEach((o,f)=>{s.has(f)||u.getAll(f).forEach(h=>{s.append(f,h)})}),s}var Ar=null;function _v(){if(Ar===null)try{new FormData(document.createElement("form"),0),Ar=!1}catch{Ar=!0}return Ar}var gv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ts(r){return r!=null&&!gv.has(r)?(Yt(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hr}"`),null):r}function yv(r,u){let s,o,f,h,p;if(fv(r)){let b=r.getAttribute("action");o=b?Sa(b,u):null,s=r.getAttribute("method")||Lr,f=Ts(r.getAttribute("enctype"))||Hr,h=new FormData(r)}else if(cv(r)||dv(r)&&(r.type==="submit"||r.type==="image")){let b=r.form;if(b==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=r.getAttribute("formaction")||b.getAttribute("action");if(o=y?Sa(y,u):null,s=r.getAttribute("formmethod")||b.getAttribute("method")||Lr,f=Ts(r.getAttribute("formenctype"))||Ts(b.getAttribute("enctype"))||Hr,h=new FormData(b,r),!_v()){let{name:_,type:w,value:k}=r;if(w==="image"){let M=_?`${_}.`:"";h.append(`${M}x`,"0"),h.append(`${M}y`,"0")}else _&&h.append(_,k)}}else{if(Wr(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Lr,o=null,f=Hr,p=r}return h&&f==="text/plain"&&(p=h,h=void 0),{action:o,method:s.toLowerCase(),encType:f,formData:h,body:p}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Zs(r,u){if(r===!1||r===null||typeof r>"u")throw new Error(u)}function vv(r,u,s,o){let f=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return s?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${o}`:f.pathname=`${f.pathname}.${o}`:f.pathname==="/"?f.pathname=`_root.${o}`:u&&Sa(f.pathname,u)==="/"?f.pathname=`${u.replace(/\/$/,"")}/_root.${o}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${o}`,f}async function bv(r,u){if(r.id in u)return u[r.id];try{let s=await import(r.module);return u[r.id]=s,s}catch(s){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function xv(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function Sv(r,u,s){let o=await Promise.all(r.map(async f=>{let h=u.routes[f.route.id];if(h){let p=await bv(h,s);return p.links?p.links():[]}return[]}));return Tv(o.flat(1).filter(xv).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function yh(r,u,s,o,f,h){let p=(y,_)=>s[_]?y.route.id!==s[_].route.id:!0,b=(y,_)=>{var w;return s[_].pathname!==y.pathname||((w=s[_].route.path)==null?void 0:w.endsWith("*"))&&s[_].params["*"]!==y.params["*"]};return h==="assets"?u.filter((y,_)=>p(y,_)||b(y,_)):h==="data"?u.filter((y,_)=>{var k;let w=o.routes[y.route.id];if(!w||!w.hasLoader)return!1;if(p(y,_)||b(y,_))return!0;if(y.route.shouldRevalidate){let M=y.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((k=s[0])==null?void 0:k.params)||{},nextUrl:new URL(r,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof M=="boolean")return M}return!0}):[]}function kv(r,u,{includeHydrateFallback:s}={}){return Ev(r.map(o=>{let f=u.routes[o.route.id];if(!f)return[];let h=[f.module];return f.clientActionModule&&(h=h.concat(f.clientActionModule)),f.clientLoaderModule&&(h=h.concat(f.clientLoaderModule)),s&&f.hydrateFallbackModule&&(h=h.concat(f.hydrateFallbackModule)),f.imports&&(h=h.concat(f.imports)),h}).flat(1))}function Ev(r){return[...new Set(r)]}function wv(r){let u={},s=Object.keys(r).sort();for(let o of s)u[o]=r[o];return u}function Tv(r,u){let s=new Set;return new Set(u),r.reduce((o,f)=>{let h=JSON.stringify(wv(f));return s.has(h)||(s.add(h),o.push({key:h,link:f})),o},[])}function Zh(){let r=g.useContext(rl);return Zs(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function jv(){let r=g.useContext($r);return Zs(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var Ks=g.createContext(void 0);Ks.displayName="FrameworkContext";function Kh(){let r=g.useContext(Ks);return Zs(r,"You must render this element inside a <HydratedRouter> element"),r}function Rv(r,u){let s=g.useContext(Ks),[o,f]=g.useState(!1),[h,p]=g.useState(!1),{onFocus:b,onBlur:y,onMouseEnter:_,onMouseLeave:w,onTouchStart:k}=u,M=g.useRef(null);g.useEffect(()=>{if(r==="render"&&p(!0),r==="viewport"){let q=B=>{B.forEach(G=>{p(G.isIntersecting)})},L=new IntersectionObserver(q,{threshold:.5});return M.current&&L.observe(M.current),()=>{L.disconnect()}}},[r]),g.useEffect(()=>{if(o){let q=setTimeout(()=>{p(!0)},100);return()=>{clearTimeout(q)}}},[o]);let Y=()=>{f(!0)},H=()=>{f(!1),p(!1)};return s?r!=="intent"?[h,M,{}]:[h,M,{onFocus:ni(b,Y),onBlur:ni(y,H),onMouseEnter:ni(_,Y),onMouseLeave:ni(w,H),onTouchStart:ni(k,Y)}]:[!1,M,{}]}function ni(r,u){return s=>{r&&r(s),s.defaultPrevented||u(s)}}function Av({page:r,...u}){let{router:s}=Zh(),o=g.useMemo(()=>Dh(s.routes,r,s.basename),[s.routes,r,s.basename]);return o?g.createElement(Ov,{page:r,matches:o,...u}):null}function zv(r){let{manifest:u,routeModules:s}=Kh(),[o,f]=g.useState([]);return g.useEffect(()=>{let h=!1;return Sv(r,u,s).then(p=>{h||f(p)}),()=>{h=!0}},[r,u,s]),o}function Ov({page:r,matches:u,...s}){let o=gt(),{future:f,manifest:h,routeModules:p}=Kh(),{basename:b}=Zh(),{loaderData:y,matches:_}=jv(),w=g.useMemo(()=>yh(r,u,_,h,o,"data"),[r,u,_,h,o]),k=g.useMemo(()=>yh(r,u,_,h,o,"assets"),[r,u,_,h,o]),M=g.useMemo(()=>{if(r===o.pathname+o.search+o.hash)return[];let q=new Set,L=!1;if(u.forEach(G=>{var se;let J=h.routes[G.route.id];!J||!J.hasLoader||(!w.some(ce=>ce.route.id===G.route.id)&&G.route.id in y&&((se=p[G.route.id])!=null&&se.shouldRevalidate)||J.hasClientLoader?L=!0:q.add(G.route.id))}),q.size===0)return[];let B=vv(r,b,f.unstable_trailingSlashAwareDataRequests,"data");return L&&q.size>0&&B.searchParams.set("_routes",u.filter(G=>q.has(G.route.id)).map(G=>G.route.id).join(",")),[B.pathname+B.search]},[b,f.unstable_trailingSlashAwareDataRequests,y,o,h,w,u,r,p]),Y=g.useMemo(()=>kv(k,h),[k,h]),H=zv(k);return g.createElement(g.Fragment,null,M.map(q=>g.createElement("link",{key:q,rel:"prefetch",as:"fetch",href:q,...s})),Y.map(q=>g.createElement("link",{key:q,rel:"modulepreload",href:q,...s})),H.map(({key:q,link:L})=>g.createElement("link",{key:q,nonce:s.nonce,...L,crossOrigin:L.crossOrigin??s.crossOrigin})))}function Cv(...r){return u=>{r.forEach(s=>{typeof s=="function"?s(u):s!=null&&(s.current=u)})}}var Dv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Dv&&(window.__reactRouterVersion="7.13.1")}catch{}function Nv({basename:r,children:u,unstable_useTransitions:s,window:o}){let f=g.useRef();f.current==null&&(f.current=cy({window:o,v5Compat:!0}));let h=f.current,[p,b]=g.useState({action:h.action,location:h.location}),y=g.useCallback(_=>{s===!1?b(_):g.startTransition(()=>b(_))},[s]);return g.useLayoutEffect(()=>h.listen(y),[h,y]),g.createElement(ov,{basename:r,children:u,location:p.location,navigationType:p.action,navigator:h,unstable_useTransitions:s})}var Jh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$h=g.forwardRef(function({onClick:u,discover:s="render",prefetch:o="none",relative:f,reloadDocument:h,replace:p,unstable_mask:b,state:y,target:_,to:w,preventScrollReset:k,viewTransition:M,unstable_defaultShouldRevalidate:Y,...H},q){let{basename:L,navigator:B,unstable_useTransitions:G}=g.useContext(Rt),J=typeof w=="string"&&Jh.test(w),se=qh(w,L);w=se.to;let ce=Xy(w,{relative:f}),_e=gt(),F=null;if(b){let Ne=Jr(b,[],_e.unstable_mask?_e.unstable_mask.pathname:"/",!0);L!=="/"&&(Ne.pathname=Ne.pathname==="/"?L:ta([L,Ne.pathname])),F=B.createHref(Ne)}let[W,oe,Pe]=Rv(o,H),Je=qv(w,{replace:p,unstable_mask:b,state:y,target:_,preventScrollReset:k,relative:f,viewTransition:M,unstable_defaultShouldRevalidate:Y,unstable_useTransitions:G});function qe(Ne){u&&u(Ne),Ne.defaultPrevented||Je(Ne)}let At=!(se.isExternal||h),ut=g.createElement("a",{...H,...Pe,href:(At?F:void 0)||se.absoluteURL||ce,onClick:At?qe:u,ref:Cv(q,oe),target:_,"data-discover":!J&&s==="render"?"true":void 0});return W&&!J?g.createElement(g.Fragment,null,ut,g.createElement(Av,{page:ce})):ut});$h.displayName="Link";var Js=g.forwardRef(function({"aria-current":u="page",caseSensitive:s=!1,className:o="",end:f=!1,style:h,to:p,viewTransition:b,children:y,..._},w){let k=si(p,{relative:_.relative}),M=gt(),Y=g.useContext($r),{navigator:H,basename:q}=g.useContext(Rt),L=Y!=null&&Gv(k)&&b===!0,B=H.encodeLocation?H.encodeLocation(k).pathname:k.pathname,G=M.pathname,J=Y&&Y.navigation&&Y.navigation.location?Y.navigation.location.pathname:null;s||(G=G.toLowerCase(),J=J?J.toLowerCase():null,B=B.toLowerCase()),J&&q&&(J=Sa(J,q)||J);const se=B!=="/"&&B.endsWith("/")?B.length-1:B.length;let ce=G===B||!f&&G.startsWith(B)&&G.charAt(se)==="/",_e=J!=null&&(J===B||!f&&J.startsWith(B)&&J.charAt(B.length)==="/"),F={isActive:ce,isPending:_e,isTransitioning:L},W=ce?u:void 0,oe;typeof o=="function"?oe=o(F):oe=[o,ce?"active":null,_e?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let Pe=typeof h=="function"?h(F):h;return g.createElement($h,{..._,"aria-current":W,className:oe,ref:w,style:Pe,to:p,viewTransition:b},typeof y=="function"?y(F):y)});Js.displayName="NavLink";var Mv=g.forwardRef(({discover:r="render",fetcherKey:u,navigate:s,reloadDocument:o,replace:f,state:h,method:p=Lr,action:b,onSubmit:y,relative:_,preventScrollReset:w,viewTransition:k,unstable_defaultShouldRevalidate:M,...Y},H)=>{let{unstable_useTransitions:q}=g.useContext(Rt),L=Bv(),B=Yv(b,{relative:_}),G=p.toLowerCase()==="get"?"get":"post",J=typeof b=="string"&&Jh.test(b),se=ce=>{if(y&&y(ce),ce.defaultPrevented)return;ce.preventDefault();let _e=ce.nativeEvent.submitter,F=(_e==null?void 0:_e.getAttribute("formmethod"))||p,W=()=>L(_e||ce.currentTarget,{fetcherKey:u,method:F,navigate:s,replace:f,state:h,relative:_,preventScrollReset:w,viewTransition:k,unstable_defaultShouldRevalidate:M});q&&s!==!1?g.startTransition(()=>W()):W()};return g.createElement("form",{ref:H,method:G,action:B,onSubmit:o?y:se,...Y,"data-discover":!J&&r==="render"?"true":void 0})});Mv.displayName="Form";function Uv(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wh(r){let u=g.useContext(rl);return Ue(u,Uv(r)),u}function qv(r,{target:u,replace:s,unstable_mask:o,state:f,preventScrollReset:h,relative:p,viewTransition:b,unstable_defaultShouldRevalidate:y,unstable_useTransitions:_}={}){let w=Fa(),k=gt(),M=si(r,{relative:p});return g.useCallback(Y=>{if(hv(Y,u)){Y.preventDefault();let H=s!==void 0?s:ui(k)===ui(M),q=()=>w(r,{replace:H,unstable_mask:o,state:f,preventScrollReset:h,relative:p,viewTransition:b,unstable_defaultShouldRevalidate:y});_?g.startTransition(()=>q()):q()}},[k,w,M,s,o,f,u,r,h,p,b,y,_])}function E1(r){Yt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let u=g.useRef(Ds(r)),s=g.useRef(!1),o=gt(),f=g.useMemo(()=>pv(o.search,s.current?null:u.current),[o.search]),h=Fa(),p=g.useCallback((b,y)=>{const _=Ds(typeof b=="function"?b(new URLSearchParams(f)):b);s.current=!0,h("?"+_,y)},[h,f]);return[f,p]}var Lv=0,Hv=()=>`__${String(++Lv)}__`;function Bv(){let{router:r}=Wh("useSubmit"),{basename:u}=g.useContext(Rt),s=nv(),o=r.fetch,f=r.navigate;return g.useCallback(async(h,p={})=>{let{action:b,method:y,encType:_,formData:w,body:k}=yv(h,u);if(p.navigate===!1){let M=p.fetcherKey||Hv();await o(M,s,p.action||b,{unstable_defaultShouldRevalidate:p.unstable_defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:w,body:k,formMethod:p.method||y,formEncType:p.encType||_,flushSync:p.flushSync})}else await f(p.action||b,{unstable_defaultShouldRevalidate:p.unstable_defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:w,body:k,formMethod:p.method||y,formEncType:p.encType||_,replace:p.replace,state:p.state,fromRouteId:s,flushSync:p.flushSync,viewTransition:p.viewTransition})},[o,f,u,s])}function Yv(r,{relative:u}={}){let{basename:s}=g.useContext(Rt),o=g.useContext(Gt);Ue(o,"useFormAction must be used inside a RouteContext");let[f]=o.matches.slice(-1),h={...si(r||".",{relative:u})},p=gt();if(r==null){h.search=p.search;let b=new URLSearchParams(h.search),y=b.getAll("index");if(y.some(w=>w==="")){b.delete("index"),y.filter(k=>k).forEach(k=>b.append("index",k));let w=b.toString();h.search=w?`?${w}`:""}}return(!r||r===".")&&f.route.index&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(h.pathname=h.pathname==="/"?s:ta([s,h.pathname])),ui(h)}function Gv(r,{relative:u}={}){let s=g.useContext(Hh);Ue(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Wh("useViewTransitionState"),f=si(r,{relative:u});if(!s.isTransitioning)return!1;let h=Sa(s.currentLocation.pathname,o)||s.currentLocation.pathname,p=Sa(s.nextLocation.pathname,o)||s.nextLocation.pathname;return Qr(f.pathname,p)!=null||Qr(f.pathname,h)!=null}/**
61
+ Please change the parent <Route path="${B}"> to <Route path="${B==="/"?"*":`${B}/*`}">.`)}let w=gt(),k;if(u){let B=typeof u=="string"?il(u):u;Ue(y==="/"||((L=B.pathname)==null?void 0:L.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${B.pathname}" was given in the \`location\` prop.`),k=B}else k=w;let M=k.pathname||"/",Y=M;if(y!=="/"){let B=y.replace(/^\//,"").split("/");Y="/"+M.replace(/^\//,"").split("/").slice(B.length).join("/")}let H=Dh(r,{pathname:Y});Yt(_||H!=null,`No routes matched location "${k.pathname}${k.search}${k.hash}" `),Yt(H==null||H[H.length-1].route.element!==void 0||H[H.length-1].route.Component!==void 0||H[H.length-1].route.lazy!==void 0,`Matched leaf route at location "${k.pathname}${k.search}${k.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let q=Py(H&&H.map(B=>Object.assign({},B,{params:Object.assign({},p,B.params),pathname:ta([y,o.encodeLocation?o.encodeLocation(B.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:B.pathname]),pathnameBase:B.pathnameBase==="/"?y:ta([y,o.encodeLocation?o.encodeLocation(B.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:B.pathnameBase])})),f,s);return u&&q?g.createElement(oi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...k},navigationType:"POP"}},q):q}function $y(){let r=lv(),u=Ny(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),s=r instanceof Error?r.stack:null,o="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:o},h={padding:"2px 4px",backgroundColor:o},p=null;return console.error("Error handled by React Router default ErrorBoundary:",r),p=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:h},"ErrorBoundary")," or"," ",g.createElement("code",{style:h},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},u),s?g.createElement("pre",{style:f},s):null,p)}var Wy=g.createElement($y,null),Xh=class extends g.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,u){return u.location!==r.location||u.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:u.error,location:u.location,revalidation:r.revalidation||u.revalidation}}componentDidCatch(r,u){this.props.onError?this.props.onError(r,u):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const s=Vy(r.digest);s&&(r=s)}let u=r!==void 0?g.createElement(Gt.Provider,{value:this.props.routeContext},g.createElement(Vs.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?g.createElement(Fy,{error:r},u):u}};Xh.contextType=qy;var ws=new WeakMap;function Fy({children:r,error:u}){let{basename:s}=g.useContext(Rt);if(typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){let o=Gy(u.digest);if(o){let f=ws.get(u);if(f)throw f;let h=qh(o.location,s);if(Uh&&!ws.get(u))if(h.isExternal||o.reloadDocument)window.location.href=h.absoluteURL||h.to;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(h.to,{replace:o.replace}));throw ws.set(u,p),p}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h.absoluteURL||h.to}`})}}return r}function Iy({routeContext:r,match:u,children:s}){let o=g.useContext(rl);return o&&o.static&&o.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=u.route.id),g.createElement(Gt.Provider,{value:r},s)}function Py(r,u=[],s){let o=s==null?void 0:s.state;if(r==null){if(!o)return null;if(o.errors)r=o.matches;else if(u.length===0&&!o.initialized&&o.matches.length>0)r=o.matches;else return null}let f=r,h=o==null?void 0:o.errors;if(h!=null){let w=f.findIndex(k=>k.route.id&&(h==null?void 0:h[k.route.id])!==void 0);Ue(w>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),f=f.slice(0,Math.min(f.length,w+1))}let p=!1,b=-1;if(s&&o){p=o.renderFallback;for(let w=0;w<f.length;w++){let k=f[w];if((k.route.HydrateFallback||k.route.hydrateFallbackElement)&&(b=w),k.route.id){let{loaderData:M,errors:Y}=o,H=k.route.loader&&!M.hasOwnProperty(k.route.id)&&(!Y||Y[k.route.id]===void 0);if(k.route.lazy||H){s.isStatic&&(p=!0),b>=0?f=f.slice(0,b+1):f=[f[0]];break}}}}let y=s==null?void 0:s.onError,_=o&&y?(w,k)=>{var M,Y;y(w,{location:o.location,params:((Y=(M=o.matches)==null?void 0:M[0])==null?void 0:Y.params)??{},unstable_pattern:My(o.matches),errorInfo:k})}:void 0;return f.reduceRight((w,k,M)=>{let Y,H=!1,q=null,L=null;o&&(Y=h&&k.route.id?h[k.route.id]:void 0,q=k.route.errorElement||Wy,p&&(b<0&&M===0?(Qh("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),H=!0,L=null):b===M&&(H=!0,L=k.route.hydrateFallbackElement||null)));let B=u.concat(f.slice(0,M+1)),G=()=>{let J;return Y?J=q:H?J=L:k.route.Component?J=g.createElement(k.route.Component,null):k.route.element?J=k.route.element:J=w,g.createElement(Iy,{match:k,routeContext:{outlet:w,matches:B,isDataRoute:o!=null},children:J})};return o&&(k.route.ErrorBoundary||k.route.errorElement||M===0)?g.createElement(Xh,{location:o.location,revalidation:o.revalidation,component:q,error:Y,children:G(),routeContext:{outlet:null,matches:B,isDataRoute:!0},onError:_}):G()},null)}function Xs(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ev(r){let u=g.useContext(rl);return Ue(u,Xs(r)),u}function tv(r){let u=g.useContext($r);return Ue(u,Xs(r)),u}function av(r){let u=g.useContext(Gt);return Ue(u,Xs(r)),u}function Qs(r){let u=av(r),s=u.matches[u.matches.length-1];return Ue(s.route.id,`${r} can only be used on routes that contain a unique "id"`),s.route.id}function nv(){return Qs("useRouteId")}function lv(){var o;let r=g.useContext(Vs),u=tv("useRouteError"),s=Qs("useRouteError");return r!==void 0?r:(o=u.errors)==null?void 0:o[s]}function iv(){let{router:r}=ev("useNavigate"),u=Qs("useNavigate"),s=g.useRef(!1);return Gh(()=>{s.current=!0}),g.useCallback(async(f,h={})=>{Yt(s.current,Yh),s.current&&(typeof f=="number"?await r.navigate(f):await r.navigate(f,{fromRouteId:u,...h}))},[r,u])}var gh={};function Qh(r,u,s){!u&&!gh[r]&&(gh[r]=!0,Yt(!1,s))}g.memo(rv);function rv({routes:r,future:u,state:s,isStatic:o,onError:f}){return Vh(r,void 0,{state:s,isStatic:o,onError:f})}function ll({to:r,replace:u,state:s,relative:o}){Ue(ul(),"<Navigate> may be used only in the context of a <Router> component.");let{static:f}=g.useContext(Rt);Yt(!f,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:h}=g.useContext(Gt),{pathname:p}=gt(),b=Fa(),y=Jr(r,Gs(h),p,o==="path"),_=JSON.stringify(y);return g.useEffect(()=>{b(JSON.parse(_),{replace:u,state:s,relative:o})},[b,_,o,u,s]),null}function uv(r){return Ky(r.context)}function te(r){Ue(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ov({basename:r="/",children:u=null,location:s,navigationType:o="POP",navigator:f,static:h=!1,unstable_useTransitions:p}){Ue(!ul(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let b=r.replace(/^\/*/,"/"),y=g.useMemo(()=>({basename:b,navigator:f,static:h,unstable_useTransitions:p,future:{}}),[b,f,h,p]);typeof s=="string"&&(s=il(s));let{pathname:_="/",search:w="",hash:k="",state:M=null,key:Y="default",unstable_mask:H}=s,q=g.useMemo(()=>{let L=Sa(_,b);return L==null?null:{location:{pathname:L,search:w,hash:k,state:M,key:Y,unstable_mask:H},navigationType:o}},[b,_,w,k,M,Y,o,H]);return Yt(q!=null,`<Router basename="${b}"> is not able to match the URL "${_}${w}${k}" because it does not start with the basename, so the <Router> won't render anything.`),q==null?null:g.createElement(Rt.Provider,{value:y},g.createElement(oi.Provider,{children:u,value:q}))}function sv({children:r,location:u}){return Jy(Cs(r),u)}function Cs(r,u=[]){let s=[];return g.Children.forEach(r,(o,f)=>{if(!g.isValidElement(o))return;let h=[...u,f];if(o.type===g.Fragment){s.push.apply(s,Cs(o.props.children,h));return}Ue(o.type===te,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ue(!o.props.index||!o.props.children,"An index route cannot have child routes.");let p={id:o.props.id||h.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(p.children=Cs(o.props.children,h)),s.push(p)}),s}var Lr="get",Hr="application/x-www-form-urlencoded";function Wr(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function cv(r){return Wr(r)&&r.tagName.toLowerCase()==="button"}function fv(r){return Wr(r)&&r.tagName.toLowerCase()==="form"}function dv(r){return Wr(r)&&r.tagName.toLowerCase()==="input"}function mv(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function hv(r,u){return r.button===0&&(!u||u==="_self")&&!mv(r)}function Ds(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((u,s)=>{let o=r[s];return u.concat(Array.isArray(o)?o.map(f=>[s,f]):[[s,o]])},[]))}function pv(r,u){let s=Ds(r);return u&&u.forEach((o,f)=>{s.has(f)||u.getAll(f).forEach(h=>{s.append(f,h)})}),s}var Ar=null;function _v(){if(Ar===null)try{new FormData(document.createElement("form"),0),Ar=!1}catch{Ar=!0}return Ar}var gv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ts(r){return r!=null&&!gv.has(r)?(Yt(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hr}"`),null):r}function yv(r,u){let s,o,f,h,p;if(fv(r)){let b=r.getAttribute("action");o=b?Sa(b,u):null,s=r.getAttribute("method")||Lr,f=Ts(r.getAttribute("enctype"))||Hr,h=new FormData(r)}else if(cv(r)||dv(r)&&(r.type==="submit"||r.type==="image")){let b=r.form;if(b==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=r.getAttribute("formaction")||b.getAttribute("action");if(o=y?Sa(y,u):null,s=r.getAttribute("formmethod")||b.getAttribute("method")||Lr,f=Ts(r.getAttribute("formenctype"))||Ts(b.getAttribute("enctype"))||Hr,h=new FormData(b,r),!_v()){let{name:_,type:w,value:k}=r;if(w==="image"){let M=_?`${_}.`:"";h.append(`${M}x`,"0"),h.append(`${M}y`,"0")}else _&&h.append(_,k)}}else{if(Wr(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Lr,o=null,f=Hr,p=r}return h&&f==="text/plain"&&(p=h,h=void 0),{action:o,method:s.toLowerCase(),encType:f,formData:h,body:p}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Zs(r,u){if(r===!1||r===null||typeof r>"u")throw new Error(u)}function vv(r,u,s,o){let f=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return s?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${o}`:f.pathname=`${f.pathname}.${o}`:f.pathname==="/"?f.pathname=`_root.${o}`:u&&Sa(f.pathname,u)==="/"?f.pathname=`${u.replace(/\/$/,"")}/_root.${o}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${o}`,f}async function bv(r,u){if(r.id in u)return u[r.id];try{let s=await import(r.module);return u[r.id]=s,s}catch(s){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function xv(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function Sv(r,u,s){let o=await Promise.all(r.map(async f=>{let h=u.routes[f.route.id];if(h){let p=await bv(h,s);return p.links?p.links():[]}return[]}));return Tv(o.flat(1).filter(xv).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function yh(r,u,s,o,f,h){let p=(y,_)=>s[_]?y.route.id!==s[_].route.id:!0,b=(y,_)=>{var w;return s[_].pathname!==y.pathname||((w=s[_].route.path)==null?void 0:w.endsWith("*"))&&s[_].params["*"]!==y.params["*"]};return h==="assets"?u.filter((y,_)=>p(y,_)||b(y,_)):h==="data"?u.filter((y,_)=>{var k;let w=o.routes[y.route.id];if(!w||!w.hasLoader)return!1;if(p(y,_)||b(y,_))return!0;if(y.route.shouldRevalidate){let M=y.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((k=s[0])==null?void 0:k.params)||{},nextUrl:new URL(r,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof M=="boolean")return M}return!0}):[]}function kv(r,u,{includeHydrateFallback:s}={}){return Ev(r.map(o=>{let f=u.routes[o.route.id];if(!f)return[];let h=[f.module];return f.clientActionModule&&(h=h.concat(f.clientActionModule)),f.clientLoaderModule&&(h=h.concat(f.clientLoaderModule)),s&&f.hydrateFallbackModule&&(h=h.concat(f.hydrateFallbackModule)),f.imports&&(h=h.concat(f.imports)),h}).flat(1))}function Ev(r){return[...new Set(r)]}function wv(r){let u={},s=Object.keys(r).sort();for(let o of s)u[o]=r[o];return u}function Tv(r,u){let s=new Set;return new Set(u),r.reduce((o,f)=>{let h=JSON.stringify(wv(f));return s.has(h)||(s.add(h),o.push({key:h,link:f})),o},[])}function Zh(){let r=g.useContext(rl);return Zs(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function jv(){let r=g.useContext($r);return Zs(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var Ks=g.createContext(void 0);Ks.displayName="FrameworkContext";function Kh(){let r=g.useContext(Ks);return Zs(r,"You must render this element inside a <HydratedRouter> element"),r}function Rv(r,u){let s=g.useContext(Ks),[o,f]=g.useState(!1),[h,p]=g.useState(!1),{onFocus:b,onBlur:y,onMouseEnter:_,onMouseLeave:w,onTouchStart:k}=u,M=g.useRef(null);g.useEffect(()=>{if(r==="render"&&p(!0),r==="viewport"){let q=B=>{B.forEach(G=>{p(G.isIntersecting)})},L=new IntersectionObserver(q,{threshold:.5});return M.current&&L.observe(M.current),()=>{L.disconnect()}}},[r]),g.useEffect(()=>{if(o){let q=setTimeout(()=>{p(!0)},100);return()=>{clearTimeout(q)}}},[o]);let Y=()=>{f(!0)},H=()=>{f(!1),p(!1)};return s?r!=="intent"?[h,M,{}]:[h,M,{onFocus:ni(b,Y),onBlur:ni(y,H),onMouseEnter:ni(_,Y),onMouseLeave:ni(w,H),onTouchStart:ni(k,Y)}]:[!1,M,{}]}function ni(r,u){return s=>{r&&r(s),s.defaultPrevented||u(s)}}function Av({page:r,...u}){let{router:s}=Zh(),o=g.useMemo(()=>Dh(s.routes,r,s.basename),[s.routes,r,s.basename]);return o?g.createElement(Ov,{page:r,matches:o,...u}):null}function zv(r){let{manifest:u,routeModules:s}=Kh(),[o,f]=g.useState([]);return g.useEffect(()=>{let h=!1;return Sv(r,u,s).then(p=>{h||f(p)}),()=>{h=!0}},[r,u,s]),o}function Ov({page:r,matches:u,...s}){let o=gt(),{future:f,manifest:h,routeModules:p}=Kh(),{basename:b}=Zh(),{loaderData:y,matches:_}=jv(),w=g.useMemo(()=>yh(r,u,_,h,o,"data"),[r,u,_,h,o]),k=g.useMemo(()=>yh(r,u,_,h,o,"assets"),[r,u,_,h,o]),M=g.useMemo(()=>{if(r===o.pathname+o.search+o.hash)return[];let q=new Set,L=!1;if(u.forEach(G=>{var se;let J=h.routes[G.route.id];!J||!J.hasLoader||(!w.some(ce=>ce.route.id===G.route.id)&&G.route.id in y&&((se=p[G.route.id])!=null&&se.shouldRevalidate)||J.hasClientLoader?L=!0:q.add(G.route.id))}),q.size===0)return[];let B=vv(r,b,f.unstable_trailingSlashAwareDataRequests,"data");return L&&q.size>0&&B.searchParams.set("_routes",u.filter(G=>q.has(G.route.id)).map(G=>G.route.id).join(",")),[B.pathname+B.search]},[b,f.unstable_trailingSlashAwareDataRequests,y,o,h,w,u,r,p]),Y=g.useMemo(()=>kv(k,h),[k,h]),H=zv(k);return g.createElement(g.Fragment,null,M.map(q=>g.createElement("link",{key:q,rel:"prefetch",as:"fetch",href:q,...s})),Y.map(q=>g.createElement("link",{key:q,rel:"modulepreload",href:q,...s})),H.map(({key:q,link:L})=>g.createElement("link",{key:q,nonce:s.nonce,...L,crossOrigin:L.crossOrigin??s.crossOrigin})))}function Cv(...r){return u=>{r.forEach(s=>{typeof s=="function"?s(u):s!=null&&(s.current=u)})}}var Dv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Dv&&(window.__reactRouterVersion="7.13.1")}catch{}function Nv({basename:r,children:u,unstable_useTransitions:s,window:o}){let f=g.useRef();f.current==null&&(f.current=cy({window:o,v5Compat:!0}));let h=f.current,[p,b]=g.useState({action:h.action,location:h.location}),y=g.useCallback(_=>{s===!1?b(_):g.startTransition(()=>b(_))},[s]);return g.useLayoutEffect(()=>h.listen(y),[h,y]),g.createElement(ov,{basename:r,children:u,location:p.location,navigationType:p.action,navigator:h,unstable_useTransitions:s})}var Jh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$h=g.forwardRef(function({onClick:u,discover:s="render",prefetch:o="none",relative:f,reloadDocument:h,replace:p,unstable_mask:b,state:y,target:_,to:w,preventScrollReset:k,viewTransition:M,unstable_defaultShouldRevalidate:Y,...H},q){let{basename:L,navigator:B,unstable_useTransitions:G}=g.useContext(Rt),J=typeof w=="string"&&Jh.test(w),se=qh(w,L);w=se.to;let ce=Xy(w,{relative:f}),_e=gt(),F=null;if(b){let Ne=Jr(b,[],_e.unstable_mask?_e.unstable_mask.pathname:"/",!0);L!=="/"&&(Ne.pathname=Ne.pathname==="/"?L:ta([L,Ne.pathname])),F=B.createHref(Ne)}let[W,oe,Pe]=Rv(o,H),Je=qv(w,{replace:p,unstable_mask:b,state:y,target:_,preventScrollReset:k,relative:f,viewTransition:M,unstable_defaultShouldRevalidate:Y,unstable_useTransitions:G});function qe(Ne){u&&u(Ne),Ne.defaultPrevented||Je(Ne)}let At=!(se.isExternal||h),ut=g.createElement("a",{...H,...Pe,href:(At?F:void 0)||se.absoluteURL||ce,onClick:At?qe:u,ref:Cv(q,oe),target:_,"data-discover":!J&&s==="render"?"true":void 0});return W&&!J?g.createElement(g.Fragment,null,ut,g.createElement(Av,{page:ce})):ut});$h.displayName="Link";var Js=g.forwardRef(function({"aria-current":u="page",caseSensitive:s=!1,className:o="",end:f=!1,style:h,to:p,viewTransition:b,children:y,..._},w){let k=si(p,{relative:_.relative}),M=gt(),Y=g.useContext($r),{navigator:H,basename:q}=g.useContext(Rt),L=Y!=null&&Gv(k)&&b===!0,B=H.encodeLocation?H.encodeLocation(k).pathname:k.pathname,G=M.pathname,J=Y&&Y.navigation&&Y.navigation.location?Y.navigation.location.pathname:null;s||(G=G.toLowerCase(),J=J?J.toLowerCase():null,B=B.toLowerCase()),J&&q&&(J=Sa(J,q)||J);const se=B!=="/"&&B.endsWith("/")?B.length-1:B.length;let ce=G===B||!f&&G.startsWith(B)&&G.charAt(se)==="/",_e=J!=null&&(J===B||!f&&J.startsWith(B)&&J.charAt(B.length)==="/"),F={isActive:ce,isPending:_e,isTransitioning:L},W=ce?u:void 0,oe;typeof o=="function"?oe=o(F):oe=[o,ce?"active":null,_e?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let Pe=typeof h=="function"?h(F):h;return g.createElement($h,{..._,"aria-current":W,className:oe,ref:w,style:Pe,to:p,viewTransition:b},typeof y=="function"?y(F):y)});Js.displayName="NavLink";var Mv=g.forwardRef(({discover:r="render",fetcherKey:u,navigate:s,reloadDocument:o,replace:f,state:h,method:p=Lr,action:b,onSubmit:y,relative:_,preventScrollReset:w,viewTransition:k,unstable_defaultShouldRevalidate:M,...Y},H)=>{let{unstable_useTransitions:q}=g.useContext(Rt),L=Bv(),B=Yv(b,{relative:_}),G=p.toLowerCase()==="get"?"get":"post",J=typeof b=="string"&&Jh.test(b),se=ce=>{if(y&&y(ce),ce.defaultPrevented)return;ce.preventDefault();let _e=ce.nativeEvent.submitter,F=(_e==null?void 0:_e.getAttribute("formmethod"))||p,W=()=>L(_e||ce.currentTarget,{fetcherKey:u,method:F,navigate:s,replace:f,state:h,relative:_,preventScrollReset:w,viewTransition:k,unstable_defaultShouldRevalidate:M});q&&s!==!1?g.startTransition(()=>W()):W()};return g.createElement("form",{ref:H,method:G,action:B,onSubmit:o?y:se,...Y,"data-discover":!J&&r==="render"?"true":void 0})});Mv.displayName="Form";function Uv(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wh(r){let u=g.useContext(rl);return Ue(u,Uv(r)),u}function qv(r,{target:u,replace:s,unstable_mask:o,state:f,preventScrollReset:h,relative:p,viewTransition:b,unstable_defaultShouldRevalidate:y,unstable_useTransitions:_}={}){let w=Fa(),k=gt(),M=si(r,{relative:p});return g.useCallback(Y=>{if(hv(Y,u)){Y.preventDefault();let H=s!==void 0?s:ui(k)===ui(M),q=()=>w(r,{replace:H,unstable_mask:o,state:f,preventScrollReset:h,relative:p,viewTransition:b,unstable_defaultShouldRevalidate:y});_?g.startTransition(()=>q()):q()}},[k,w,M,s,o,f,u,r,h,p,b,y,_])}function R1(r){Yt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let u=g.useRef(Ds(r)),s=g.useRef(!1),o=gt(),f=g.useMemo(()=>pv(o.search,s.current?null:u.current),[o.search]),h=Fa(),p=g.useCallback((b,y)=>{const _=Ds(typeof b=="function"?b(new URLSearchParams(f)):b);s.current=!0,h("?"+_,y)},[h,f]);return[f,p]}var Lv=0,Hv=()=>`__${String(++Lv)}__`;function Bv(){let{router:r}=Wh("useSubmit"),{basename:u}=g.useContext(Rt),s=nv(),o=r.fetch,f=r.navigate;return g.useCallback(async(h,p={})=>{let{action:b,method:y,encType:_,formData:w,body:k}=yv(h,u);if(p.navigate===!1){let M=p.fetcherKey||Hv();await o(M,s,p.action||b,{unstable_defaultShouldRevalidate:p.unstable_defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:w,body:k,formMethod:p.method||y,formEncType:p.encType||_,flushSync:p.flushSync})}else await f(p.action||b,{unstable_defaultShouldRevalidate:p.unstable_defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:w,body:k,formMethod:p.method||y,formEncType:p.encType||_,replace:p.replace,state:p.state,fromRouteId:s,flushSync:p.flushSync,viewTransition:p.viewTransition})},[o,f,u,s])}function Yv(r,{relative:u}={}){let{basename:s}=g.useContext(Rt),o=g.useContext(Gt);Ue(o,"useFormAction must be used inside a RouteContext");let[f]=o.matches.slice(-1),h={...si(r||".",{relative:u})},p=gt();if(r==null){h.search=p.search;let b=new URLSearchParams(h.search),y=b.getAll("index");if(y.some(w=>w==="")){b.delete("index"),y.filter(k=>k).forEach(k=>b.append("index",k));let w=b.toString();h.search=w?`?${w}`:""}}return(!r||r===".")&&f.route.index&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(h.pathname=h.pathname==="/"?s:ta([s,h.pathname])),ui(h)}function Gv(r,{relative:u}={}){let s=g.useContext(Hh);Ue(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Wh("useViewTransitionState"),f=si(r,{relative:u});if(!s.isTransitioning)return!1;let h=Sa(s.currentLocation.pathname,o)||s.currentLocation.pathname,p=Sa(s.nextLocation.pathname,o)||s.nextLocation.pathname;return Qr(f.pathname,p)!=null||Qr(f.pathname,h)!=null}/**
62
62
  * @license lucide-react v0.469.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
@@ -233,8 +233,8 @@ Please change the parent <Route path="${B}"> to <Route path="${B==="/"?"*":`${B}
233
233
  *
234
234
  * This source code is licensed under the ISC license.
235
235
  * See the LICENSE file in the root directory of this source tree.
236
- */const lp=xe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vh=r=>{let u;const s=new Set,o=(_,w)=>{const k=typeof _=="function"?_(u):_;if(!Object.is(k,u)){const M=u;u=w??(typeof k!="object"||k===null)?k:Object.assign({},u,k),s.forEach(Y=>Y(u,M))}},f=()=>u,b={setState:o,getState:f,getInitialState:()=>y,subscribe:_=>(s.add(_),()=>s.delete(_))},y=u=r(o,f,b);return b},pb=(r=>r?vh(r):vh),_b=r=>r;function gb(r,u=_b){const s=Rr.useSyncExternalStore(r.subscribe,Rr.useCallback(()=>u(r.getState()),[r,u]),Rr.useCallback(()=>u(r.getInitialState()),[r,u]));return Rr.useDebugValue(s),s}const bh=r=>{const u=pb(r),s=o=>gb(u,o);return Object.assign(s,u),s},Fr=(r=>r?bh(r):bh),zr="overlord-access-token",Or="overlord-refresh-token",We={getAccessToken(){return localStorage.getItem(zr)},setAccessToken(r){localStorage.setItem(zr,r)},getRefreshToken(){return localStorage.getItem(Or)},setRefreshToken(r){localStorage.setItem(Or,r)},setTokens(r,u){localStorage.setItem(zr,r),localStorage.setItem(Or,u)},clearTokens(){localStorage.removeItem(zr),localStorage.removeItem(Or)},parseToken(r){try{const u=r.split(".")[1];return JSON.parse(atob(u))}catch{return null}},hasScope(r,u){const s=We.parseToken(r);return s?s.scope===u:!1},isExpired(r){const u=We.parseToken(r);return!u||typeof u.exp!="number"?!0:Date.now()/1e3>u.exp-30}};function js(r){const u=We.parseToken(r);if(!u)return null;const s=u.name??"";return{id:u.sub,username:s,display_name:s,role:u.role}}const xa=Fr((r,u)=>({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1,initializing:!0,initialize:()=>{const s=We.getAccessToken();s&&!We.isExpired(s)?r({accessToken:s,user:js(s),requireTotpSetup:We.hasScope(s,"totp_setup"),initializing:!1}):We.getRefreshToken()?u().refresh().catch(()=>{We.clearTokens()}).finally(()=>{r({initializing:!1})}):r({initializing:!1})},login:async s=>{var h;const o=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok){const p=await o.json().catch(()=>({message:"Login failed"})),b=((h=p.error)==null?void 0:h.message)??p.message??"Login failed";throw new Error(b)}const f=await o.json();if(f.totpSetup){We.setAccessToken(f.accessToken),r({accessToken:f.accessToken,user:null,requireTotpSetup:!0});return}We.setTokens(f.accessToken,f.refreshToken),r({accessToken:f.accessToken,user:js(f.accessToken),requireTotpSetup:!1,sessionExpired:!1})},logout:()=>{const s=We.getRefreshToken();s&&fetch("/api/auth/logout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:s})}).catch(()=>{}),We.clearTokens(),r({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1})},refresh:(()=>{let s=null;return async()=>s||(s=(async()=>{const o=We.getRefreshToken();if(!o)throw We.clearTokens(),r({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("No refresh token");const f=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:o})});if(!f.ok)throw We.clearTokens(),r({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("Refresh failed");const h=await f.json();We.setTokens(h.accessToken,h.refreshToken),r({accessToken:h.accessToken,user:js(h.accessToken)})})().finally(()=>{s=null}),s)})(),setSessionExpired:s=>{r({sessionExpired:s})}})),w1={QUEUED:"QUEUED",ASSIGNED:"ASSIGNED",RUNNING:"RUNNING",SUSPENDED:"SUSPENDED",COMPLETED:"COMPLETED",FAILED:"FAILED",CANCELLED:"CANCELLED"},T1={ONLINE:"online",OFFLINE:"offline",DRAINING:"draining",DECOMMISSIONED:"decommissioned"},ip={DEVELOPER:"developer",LEAD:"lead",ADMIN:"admin"},j1={MAINTAINER:"maintainer",MEMBER:"member"},R1={CLAUDE:"claude",CURSOR:"cursor",CODEX:"codex",CUSTOM:"custom"},A1={ACTIVE:"active",USED:"used",REVOKED:"revoked",EXPIRED:"expired"},z1={GITLAB:"gitlab",GITHUB:"github",GITEA:"gitea"},O1={ACTIVE:"active",DISABLED:"disabled"},C1={ACTIVE:"active"},D1={IDLE:"IDLE",STARTING:"STARTING",CONNECTED:"CONNECTED",EXPIRED:"EXPIRED",CLOSING:"CLOSING",CLOSED:"CLOSED"};function yb(){return xa(r=>{var u;return((u=r.user)==null?void 0:u.role)===ip.ADMIN})??!1}const rp="overlord-sidebar-collapsed";function vb(){try{return localStorage.getItem(rp)==="true"}catch{return!1}}const bb=Fr((r,u)=>({sidebarCollapsed:vb(),toggleSidebar:()=>{const s=!u().sidebarCollapsed;try{localStorage.setItem(rp,String(s))}catch{}r({sidebarCollapsed:s})}}));class xb{constructor(){Ve(this,"ws",null);Ve(this,"reconnectAttempts",0);Ve(this,"maxReconnectAttempts",15);Ve(this,"reconnectTimer",null);Ve(this,"disposed",!1);Ve(this,"authenticated",!1);Ve(this,"eventHandlers",new Set);Ve(this,"statusHandlers",new Set)}onEvent(u){return this.eventHandlers.add(u),()=>this.eventHandlers.delete(u)}onStatus(u){return this.statusHandlers.add(u),()=>this.statusHandlers.delete(u)}get isConnected(){var u;return this.authenticated&&((u=this.ws)==null?void 0:u.readyState)===WebSocket.OPEN}connect(){var f,h;if(this.disposed||((f=this.ws)==null?void 0:f.readyState)===WebSocket.OPEN||((h=this.ws)==null?void 0:h.readyState)===WebSocket.CONNECTING)return;const u=We.getAccessToken();if(!u||We.isExpired(u))return;const o=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`;this.notifyStatus("connecting"),this.authenticated=!1,this.ws=new WebSocket(o),this.ws.onopen=()=>{var b,y;const p=We.getAccessToken();p?(b=this.ws)==null||b.send(JSON.stringify({type:"auth",token:p})):(y=this.ws)==null||y.close()},this.ws.onmessage=p=>{var b;if(typeof p.data=="string")try{const y=JSON.parse(p.data);if(y.type==="auth_ok"){this.authenticated=!0,this.reconnectAttempts=0,this.notifyStatus("connected");return}if(y.type==="auth_error"){(b=this.ws)==null||b.close();return}if(y.type==="event")for(const _ of this.eventHandlers)try{_(y)}catch{}}catch{}},this.ws.onclose=()=>{this.authenticated=!1,this.notifyStatus("disconnected"),this.scheduleReconnect()},this.ws.onerror=()=>{var p;(p=this.ws)==null||p.close()}}disconnect(){var u;this.clearReconnectTimer(),this.authenticated=!1,(u=this.ws)==null||u.close(),this.ws=null}dispose(){this.disposed=!0,this.disconnect(),this.eventHandlers.clear(),this.statusHandlers.clear()}reconnect(){this.disconnect(),this.reconnectAttempts=0,this.connect()}scheduleReconnect(){if(this.disposed||this.reconnectAttempts>=this.maxReconnectAttempts)return;const u=Math.min(1e3*2**this.reconnectAttempts,3e4);this.reconnectAttempts++,this.reconnectTimer=setTimeout(()=>{this.disposed||this.connect()},u)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}notifyStatus(u){for(const s of this.statusHandlers)try{s(u)}catch{}}}const Cr=new xb,Sb=Fr(r=>({status:"disconnected",lastEvent:null,eventSeq:0,taskSeq:0,workerSeq:0,init:()=>{const u=Cr.onEvent(o=>{const f=o.event==="task_status_changed"||o.event==="task_created",h=o.event==="worker_status_changed";r(p=>({lastEvent:o,eventSeq:p.eventSeq+1,...f&&{taskSeq:p.taskSeq+1},...h&&{workerSeq:p.workerSeq+1}}))}),s=Cr.onStatus(o=>{r({status:o})});return Cr.connect(),()=>{u(),s(),Cr.disconnect()}}})),up="overlord-theme";function kb(){try{const r=localStorage.getItem(up);if(r==="light"||r==="dark"||r==="system")return r}catch{}return"dark"}function xh(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const op=Fr(r=>{const u=kb(),s=u==="system"?xh():u;return{theme:u,resolved:s,setTheme:o=>{localStorage.setItem(up,o);const f=o==="system"?xh():o;r({theme:o,resolved:f})},setResolved:o=>{r({resolved:o})}}}),Eb={common:{cancel:"cancel",confirm:"confirm",save:"save",delete:"delete",edit:"edit",create:"create",copy:"copy",copied:"copied",close:"close",back:"back",back_to_site:"back to site",go_back:"go back",go_home:"go home",dismiss:"dismiss",retry:"retry",loading:"// loading...",processing:"processing...",creating:"creating...",saving:"saving...",updating:"updating...",verifying:"verifying...",signing_in:"signing in...",just_now:"just now",never:"never",previous:"previous",next:"next",error:"error",success:"success",failed:"failed",active:"active",inactive:"inactive",enabled:"enabled",disabled:"disabled",showing_entries:"showing {start}-{end} of {total}",no_results:"no results found",runtime_error:"// runtime error",an_unexpected_error_occurred:"an unexpected error occurred",reload:"reload",not_found:"404",page_not_found:"// page not found",the_page_does_not_exist:"the page you are looking for does not exist or has been moved.",not_found_terminal_error:"error: requested not found - page does not exist",not_set:"not set",view_all:"view all",discard:"discard",save_changes:"save changes",add:"add",remove:"remove",search:"search",actions:"actions",name:"name",status:"status",role:"role",description:"description",type:"type",created_at:"created at",ago:"{time} ago",m_ago:"{n}m ago",h_ago:"{n}h ago",d_ago:"{n}d ago",navigation:"// navigation",docs_section:"// docs",admin_section:"// admin",overlord:"overlord",logout:"logout",logout_title:"// logout",logout_message:"are you sure you want to log out?",log_out:"log out",profile:"profile",search_placeholder:"search",search_input_placeholder:"search tasks, workers, projects...",no_search_results:'// no results for "{query}"',navigate_hint:"navigate",select_hint:"select",close_hint:"close",notifications:"notifications",mark_all_read:"mark all read",no_notifications:"// no notifications",mark_as_read:"mark as read",switch_to_light:"switch to light mode",switch_to_dark:"switch to dark mode",light_mode:"light mode",dark_mode:"dark mode",dismiss_notification:"dismiss",breadcrumb_terminal:"terminal",breadcrumb_terminal_sub:"active sessions",breadcrumb_dashboard:"dashboard",breadcrumb_dashboard_sub:"active overview",breadcrumb_tasks:"tasks",breadcrumb_tasks_sub:"queue management",breadcrumb_workers:"workers",breadcrumb_workers_sub:"fleet status",breadcrumb_projects:"projects",breadcrumb_projects_sub:"repository index",breadcrumb_admin:"admin",breadcrumb_admin_sub:"system control",breadcrumb_profile:"profile",breadcrumb_profile_sub:"user settings",breadcrumb_tokens:"tokens",breadcrumb_tokens_sub:"personal api tokens",breadcrumb_docs:"docs",breadcrumb_docs_sub:"documentation",breadcrumb_docs_cli:"docs",breadcrumb_docs_cli_sub:"cli",breadcrumb_docs_api:"docs",breadcrumb_docs_api_sub:"api",breadcrumb_docs_skill:"docs",breadcrumb_docs_skill_sub:"skill",breadcrumb_docs_bot_sub:"bot",breadcrumb_docs_all_sub:"all",error_default_title:"something went wrong",error_default_message:"an unexpected error occurred. please try again."},auth:{sign_in:"sign in",username:"username",enter_username:"enter username",password:"password",enter_password:"enter password",ai_powered_development_system:"// ai-powered development system",username_and_password_required:"username and password are required.",login_failed:"login failed",invalid_totp_code:"invalid totp code",two_factor_verification:"// 2fa verification",enter_totp_code:"enter your totp code",please_enter_valid_6_digit_code:"please enter a valid 6-digit code.",session_expired:"session expired",session_expired_message:"// your session has expired. please log in again.",go_to_login:"go to login",totp_setup_title:"2FA setup",totp_setup_subtitle:"// scan the qr code with your authenticator app",scan_with_authenticator:"scan this qr code with your authenticator app (google authenticator, authy, etc.)",manual_entry_key:"manual entry key",enter_verification_code:"enter the 6-digit verification code from your authenticator app",verification_code:"verification code",enter_6_digit_code:"enter 6-digit code",verify_and_enable:"verify and enable",totp_setup_complete:"2fa setup complete",totp_setup_complete_login_again:"2fa setup complete! please log in again.",totp_setup_failed:"verification failed. please try again.",totp_setup_footer:"// you must complete this setup before accessing the application",totp_manual_entry:"// or enter this key manually",verify:"verify",initializing:"// initializing...",failed_to_init_totp:"failed to initialize totp setup"},dashboard:{title:"dashboard",subtitle:"// system overview",active_tasks:"active tasks",queued_tasks:"queued tasks",online_workers:"online workers",completed_today:"completed today",task_success_rate:"> task success rate",last_7_days:"last 7 days",recent_tasks:"> recent tasks",no_tasks_yet:"// no tasks yet",worker_status:"> worker status",no_workers_registered:"// no workers registered",recent_activity:"> recent activity",no_recent_activity:"// no recent activity",daily_breakdown_not_available:"// daily breakdown not available",slots:"slots",online:"online",idle:"idle",offline:"offline"},tasks:{title:"tasks",subtitle:"// queue management",create_task:"create task",new_task:"new task",task_description:"task description",describe_task_placeholder:"describe the development task in detail...",project:"project",select_project:"select project...",task_type:"type",branch_slug:"branch name (optional)",branch_slug_placeholder:"auto-generated from description",target_worker:"target worker (optional)",any_able:"any able",assign_developer:"assign developer (admin only)",select_developer:"select developer...",search_tasks:"search tasks...",id:"id",description_col:"description",status_col:"status",project_col:"project",assignee:"assignee",worker:"worker",time:"time",stage:"stage",no_tasks_found:"no tasks found",try_adjusting_search:"try adjusting your search query",create_first_task:"create your first task to get started",tab_all:"all",tab_running:"running",tab_queued:"queued",tab_completed:"completed",tab_failed:"failed",tab_cancelled:"cancelled",status_queued:"queued",status_assigned:"assigned",status_running:"running",status_suspended:"suspended",status_completed:"completed",status_failed:"failed",status_cancelled:"cancelled",similar_task_exists:"a similar task already exists.",confirm_create_similar:"are you sure you want to create this task?",view_existing:"view existing",force_create:"force create",cancel_task:"cancel",retry_task:"retry",cursor_tunnel:"IDE tunnel",skip_stage:"skip stage",take_over:"take over",release_control:"release control",connected:"connected",disconnected:"disconnected",connecting:"connecting",terminal:"terminal",pipeline_tab:"pipeline",logs:"logs",task_not_found:"// task not found",task_does_not_exist:"this task does not exist or has been deleted.",back_to_tasks:"back to tasks",task_detail_subtitle:"#{id} {desc}",cancel_task_title:"cancel task",task_cancelled:"task cancelled.",failed_to_cancel_task:"failed to cancel task.",task_retried:"task has been retried.",failed_to_retry_task:"failed to retry task.",retry_mr_title:"retry MR",retry_mr_confirm:"retry creating the merge request for task #{id}?",mr_retry_submitted:"mr retry submitted.",failed_to_retry_mr:"failed to retry mr.",activity_log:"> activity log",pipeline_section:"> pipeline",no_pipeline:"// no pipeline configured",no_activity:"// no activity yet",confirm_stage:"confirm stage",confirm_stage_message:'confirm execution of stage "{name}"? this will proceed with the pipeline.',stage_confirmed:"stage confirmed.",failed_to_confirm_stage:"failed to confirm stage.",loading_task:"// loading task...",task_suspended_banner:"// task suspended — waiting for user confirmation",pending_confirmation:"> pending confirmation",pipeline_requires_confirmation:"the pipeline requires confirmation before proceeding.",confirm_and_proceed:"confirm and proceed",confirm_failed:"failed to confirm stage",reject:"reject",pty_terminal:"// pty terminal",view_terminal:"switch to terminal tab",restore_auto:"restore auto",requesting_takeover:"requesting...",pipeline_stages:"// pipeline stages",task_info:"> task info",stage_timeline:"> stage timeline",workspace_section:"> workspace",mr_link:"MR link",no_worker_assigned:"// no worker assigned",no_output:"// no output",pty_output:"> PTY output",stage_progress:"> stage progress",task_logs:"> task logs",search_logs:"search logs...",no_log_entries:"// no log entries",prev:"prev",cursor_tunnel_section:"> IDE tunnel",auto_pipeline:"auto pipeline",auto_mode:"auto mode",manual_takeover:"manual takeover",takeover_denied:"takeover denied",requesting_takeover_ellipsis:"requesting takeover...",take_over_label:"take over",release_label:"release",create_task_page_title:"// create task",create_task_page_subtitle:"// submit a new task for processing",form_project_label:"project",form_description_label:"description",form_description_placeholder:"describe the task for the ai agent...",form_worker_preference:"worker preference",form_worker_placeholder:"optional: worker id or name (--on)",form_worker_hint:"leave empty for automatic worker selection.",form_agent_type:"agent type",form_agent_type_placeholder:"default (from project config)",form_select_project:"select a project",form_create_task:"create task",project_and_description_required:"project and description are required.",failed_to_create_task:"failed to create task.",tunnel_idle:"idle",tunnel_starting:"starting...",tunnel_connected:"connected",tunnel_expired:"expired",tunnel_closing:"closing...",tunnel_start:"start",tunnel_open_in_cursor:"open in IDE",tunnel_header:"> IDE tunnel",tunnel_copied:"// copied to clipboard",tunnel_waiting:"// waiting for connection url...",tunnel_start_button:"> start tunnel",tunnel_starting_button:"// starting...",tunnel_stopping:"// stopping...",tunnel_cancel:"> cancel",tunnel_open_cursor:"> open in IDE",tunnel_open_vscode:"> open in vscode",tunnel_stop:"> stop tunnel",tunnel_restart:"> restart tunnel",tunnel_copy_url:"copy url",tunnel_expires_hm:"expires in {h}h {m}m",tunnel_expires_m:"expires in {m}m",tunnel_start_failed:"failed to start tunnel",tunnel_install_code_hint:'install the VS Code CLI ("code" command) to enable tunnels',dedup_title:"> similar task exists",dedup_description:"// a similar task was found that may already address your request",dedup_create_anyway:"create anyway",stage_choose_option:"// choose an option",stage_your_response:"your response",stage_type_answer:"type your answer...",stage_submitting:"submitting...",stage_continue:"continue",stage_submit:"submit",cancel_task_message:"are you sure you want to cancel task #{id}? this will terminate the running agent and cannot be undone.",cancel_task_confirm_label:"cancel task",retry_title:"retry task",retry_confirm_label:"retry",retry_message_with_mr:"task #{id} has an existing mr ({url}). retrying will create a new attempt on the same branch. continue?",retry_message_without_mr:"are you sure you want to retry task #{id}? this will create a new execution attempt."},workers:{title:"workers",subtitle:"// fleet status",fleet:"fleet",setup_guide:"setup guide",all_statuses:"all",register_worker:"register worker",no_workers_found:"no workers found",no_workers_registered:"no workers have registered yet",try_changing_status_filter:"try changing the status filter",view_setup_guide:"view setup guide",online:"online",offline:"offline",draining:"draining",cpu:"cpu",mem:"mem",disk:"disk",tasks_slots:"tasks: {active}/{max} slots",back_to_workers:"back to workers",drain:"drain",undrain:"undrain",last_heartbeat:"last heartbeat: {time}",resource_usage:"> resource usage",connection_info:"> connection info",capabilities:"> capabilities",current_tasks:"> current tasks",no_capabilities:"// no capabilities reported",no_running_tasks:"// no running tasks",host:"host",port:"port",os:"os",cpu_model:"CPU model",cpu_cores:"CPU cores",memory:"memory",total_slots:"total slots",confirm_drain:"drain worker",confirm_drain_message:'drain worker "{name}"? it will finish current tasks but accept no new ones.',worker_drained:"worker drain initiated.",worker_undrained:"worker undrain initiated.",failed_to_update_worker:"failed to update worker status.",worker_setup_title:"worker setup guide",worker_setup_subtitle:"// register a new worker with overlord",step_1_title:"01. generate a registration token",step_1_desc:"generate a one-time registration token from the admin panel.",step_2_title:"02. install the worker cli",step_2_desc:"install the overlord worker cli on the target worker.",step_3_title:"03. register the worker",step_3_desc:"run the register command with your token and server url.",step_4_title:"04. start the worker",step_4_desc:"start the worker daemon. it will connect to overlord and begin accepting tasks.",generate_token:"generate token",worker_token_modal_title:"worker registration token",worker_token_modal_message:"// copy this token now. it will not be shown again.",loading_worker:"// loading worker...",worker_not_found:"// worker not found",draining_warning:"// this worker is draining — no new tasks will be assigned",draining_active_tasks:"active tasks will continue to run until completion",active_tasks:"> active tasks",no_active_tasks:"// no active tasks on this worker",worker_info:"> worker info",unknown:"unknown",n_a:"n/a",id:"id",description:"description",stage:"stage",no_capabilities_short:"// no capabilities",slots:"slots",status_label:"status",undrain_worker_title:"> undrain worker",drain_worker_title:"> drain worker",undrain_confirm:"are you sure you want to undrain {name}? the worker will start accepting new tasks again.",drain_confirm:"are you sure you want to drain {name}? running tasks will complete, but no new tasks will be assigned until the worker is undrained.",decommission:"decommission",decommission_title:"> decommission worker",decommission_confirm:'permanently decommission "{name}"? active tasks will be failed or re-queued, and the worker will be disconnected. this cannot be undone.',decommissioned:"decommissioned",worker_id:"worker ID",setup_header_desc:"// follow these steps to add a new worker to your overlord cluster.",prerequisites:"// prerequisites",prereq_machine:"linux or macos machine with at least 2 cpu cores and 4gb ram",prereq_node:"node.js 18+ and pnpm installed",prereq_git:"git installed (2.25+)",prereq_network:"network access to the overlord server",prereq_token:"admin-generated worker registration token",step_generate_token:"generate worker token",step_generate_token_desc:"// create a one-time registration token from the admin panel. each token can register exactly one worker.",go_to_token_management:"go to token management",step_install_worker:"install worker package",step_install_worker_desc:"// install the overlord worker package globally via npm.",step_configure_env:"configure environment",step_configure_env_desc:"// create a .env file in ~/.overlord-worker/ or set environment variables.",env_host:"overlord server address (required)",env_worker_token:"one-time registration token (required for first run)",env_worker_name:"display name (defaults to hostname)",env_workspace_root:"task workspace directory (defaults to ~/.overlord-worker/workspaces)",env_max_slots:"max concurrent tasks (defaults to 2)",step_start_worker:"start worker",step_start_worker_desc:"// start the worker process. it will register with the server and begin accepting tasks.",or_run_as_service:"// or run as a system service for auto-restart:",setup_wizard_option:"// option a: interactive setup wizard (recommended)",manual_config_option:"// option b: manual configuration",start_note_setup_wizard:"// if you used the setup wizard, the worker may already be running.",step_verify_connection:"verify connection",step_verify_connection_desc:'// once the worker connects, it will appear in the workers list with a "healthy" status.',verify_how_to:"// how to verify:",verify_check_workers:"check the workers page for your new worker",verify_status:'status should show "healthy" within 30 seconds',verify_capabilities:"worker capabilities are auto-detected on first heartbeat",last_heartbeat_label:"last heartbeat",worker_version:"worker version",reg_title:"// worker registration",reg_subtitle:"> register a new worker node",reg_step_generate_token:"generate token",reg_step_install_worker:"install worker",reg_step_waiting_activation:"waiting activation",reg_step_activated:"activated",reg_click_to_generate:"// click to generate a one-time registration token",reg_token_generated:"// token generated successfully",reg_install_command:"// install cli & worker:",reg_run_setup:"// run setup on worker:",reg_running_installation:"// running installation on target worker",reg_installed_wait:"i've installed → wait for activation",reg_listening_for_worker:"listening for worker connection...",reg_worker_connected:"// worker connected",reg_waiting_for_worker:"// waiting for worker to connect...",reg_worker_activated:"worker {name} activated!",reg_worker_registered:"// worker successfully registered",reg_done:"done",reg_completed:"// completed"},projects:{title:"projects",subtitle:"// repository index",create_project:"create project",no_projects_yet:"no projects yet",create_first_project:"create your first project to get started",key:"key",name:"name",repository:"repository",agent:"agent",project_info:"> project info",repo_url:"repo URL",default_branch:"default branch",git_platform:"git platform",agent_type:"agent type",max_turns:"max turns",allowed_tools:"allowed tools",default_project:"default project",tasks_count:"tasks",last_activity:"last activity",members:"> members",developer:"developer",role:"role",added_at:"added at",add_member:"add member",remove_member:"remove member",remove_member_confirm:"remove {name} from this project?",member_added:"member added.",member_removed:"member removed.",failed_to_add_member:"failed to add member.",member_already_exists:"this developer is already a member of this project.",failed_to_remove_member:"failed to remove member.",pipeline:"> pipeline",add_stage:"+ add stage",recent_tasks:"> recent tasks",no_recent_tasks:"// no recent tasks",edit_project:"edit project",delete_project:"delete project",delete_project_confirm:'delete project "{name}"? this cannot be undone.',project_deleted:"project deleted.",failed_to_delete_project:"failed to delete project.",project_name:"project name",project_name_placeholder:"my awesome project",project_key:"project key",project_key_placeholder:"my-project",project_key_hint:"// unique identifier (lowercase, alphanumeric, hyphens)",ssh_url:"SSH URL",ssh_url_placeholder:"git@github.com:org/repo.git",ssh_url_hint:"// optional — workers prefer ssh for git operations",repo_url_placeholder:"https://github.com/org/repo.git",main:"main",github:"github",gitlab:"gitlab",gitea:"gitea",claude:"claude",cursor:"cursor",codex:"codex",custom:"custom",tools_placeholder:"tool1, tool2, ...",add_project_desc:"// add a new project to overlord",project_created:"project created.",failed_to_create_project:"failed to create project.",update_project_desc:"// update project configuration",save_changes:"save changes",basic_info:"> basic info",agent_config:"> agent config",security:"> security",git_token:"> git token",git_token_label:"current token",git_token_hint:"// personal access token for git operations (push, clone, etc.)",git_token_set:"set token",git_token_clear:"clear token",git_token_saved:"git token saved.",git_token_cleared:"git token cleared.",git_token_failed:"failed to update git token.",pipeline_section:"> pipeline",edit_pipeline:"> edit pipeline",pty_output_filter:"PTY output filter",workspace_root:"workspace root",agent_command:"agent command",member_role:"member",maintainer_role:"maintainer",select_developer:"select developer...",select_role:"select role...",adding:"adding...",project_not_found:"// project not found",back_to_projects:"back to projects",no_members_yet:"// no members yet",no_tasks_for_project:"// no tasks for this project yet",no_pipeline_configured:"// no pipeline configured",confirm_label:"confirm",id:"id",description:"description",status:"status",created:"created",project_saved:"project saved",failed_to_save_project:"failed to save project",invalid_pipeline_json:"invalid pipeline json",setup_commands:"setup commands",post_command:"post command",environment:"> environment",add_member_title:"// add member",edit_project_title:"edit project"},pipeline:{title:"pipeline editor",subtitle:"-- {key}",save:"save",cancel:"cancel",json_toggle:"json",add_stage:"add stage",stage_properties:"> stage properties",stage_name:"stage name",timeout:"timeout",confirm_required:"confirm required",on_failure:"on failure",goto:"goto",max_loops:"max loops",stop:"stop",no_stages:"// no stages defined",select_stage:"// select a stage to edit properties",saved:"pipeline saved",failed_to_save:"failed to save pipeline",failed_to_load:"failed to load pipeline.",loading_pipeline:"// loading pipeline...",unnamed:"unnamed",editing:"// editing: {name}",name:"name",on_failure_section:"// on failure",goto_stage:"goto stage",up:"up",down:"down",failed_to_load_project:"failed to load project",delete_stage:"delete stage"},profile:{title:"profile",subtitle:"// user settings",profile_info:"> profile info",username:"username",git_name:"git name",git_email:"git email",status:"status",created_at:"created at",edit_git_info:"edit git info",change_password:"> change password",current_password:"current password",new_password:"new password",confirm_password:"confirm password",current_password_required:"current password is required.",new_password_required:"new password is required.",passwords_do_not_match:"new passwords do not match.",password_changed:"password changed successfully.",failed_to_change_password:"failed to change password.",update_password:"update password",two_factor_auth:"> two-factor authentication",two_fa_enabled:"2fa is enabled",two_fa_not_setup:"2fa is not set up",regenerate_2fa_warning:`// regenerating 2fa will invalidate your current authenticator app setup.
236
+ */const lp=xe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vh=r=>{let u;const s=new Set,o=(_,w)=>{const k=typeof _=="function"?_(u):_;if(!Object.is(k,u)){const M=u;u=w??(typeof k!="object"||k===null)?k:Object.assign({},u,k),s.forEach(Y=>Y(u,M))}},f=()=>u,b={setState:o,getState:f,getInitialState:()=>y,subscribe:_=>(s.add(_),()=>s.delete(_))},y=u=r(o,f,b);return b},pb=(r=>r?vh(r):vh),_b=r=>r;function gb(r,u=_b){const s=Rr.useSyncExternalStore(r.subscribe,Rr.useCallback(()=>u(r.getState()),[r,u]),Rr.useCallback(()=>u(r.getInitialState()),[r,u]));return Rr.useDebugValue(s),s}const bh=r=>{const u=pb(r),s=o=>gb(u,o);return Object.assign(s,u),s},Fr=(r=>r?bh(r):bh),zr="overlord-access-token",Or="overlord-refresh-token",We={getAccessToken(){return localStorage.getItem(zr)},setAccessToken(r){localStorage.setItem(zr,r)},getRefreshToken(){return localStorage.getItem(Or)},setRefreshToken(r){localStorage.setItem(Or,r)},setTokens(r,u){localStorage.setItem(zr,r),localStorage.setItem(Or,u)},clearTokens(){localStorage.removeItem(zr),localStorage.removeItem(Or)},parseToken(r){try{const u=r.split(".")[1];return JSON.parse(atob(u))}catch{return null}},hasScope(r,u){const s=We.parseToken(r);return s?s.scope===u:!1},isExpired(r){const u=We.parseToken(r);return!u||typeof u.exp!="number"?!0:Date.now()/1e3>u.exp-30}};function js(r){const u=We.parseToken(r);if(!u)return null;const s=u.name??"";return{id:u.sub,username:s,display_name:s,role:u.role}}const xa=Fr((r,u)=>({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1,initializing:!0,initialize:()=>{const s=We.getAccessToken();s&&!We.isExpired(s)?r({accessToken:s,user:js(s),requireTotpSetup:We.hasScope(s,"totp_setup"),initializing:!1}):We.getRefreshToken()?u().refresh().catch(()=>{We.clearTokens()}).finally(()=>{r({initializing:!1})}):r({initializing:!1})},login:async s=>{var h;const o=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok){const p=await o.json().catch(()=>({message:"Login failed"})),b=((h=p.error)==null?void 0:h.message)??p.message??"Login failed";throw new Error(b)}const f=await o.json();if(f.totpSetup){We.setAccessToken(f.accessToken),r({accessToken:f.accessToken,user:null,requireTotpSetup:!0});return}We.setTokens(f.accessToken,f.refreshToken),r({accessToken:f.accessToken,user:js(f.accessToken),requireTotpSetup:!1,sessionExpired:!1})},logout:()=>{const s=We.getRefreshToken();s&&fetch("/api/auth/logout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:s})}).catch(()=>{}),We.clearTokens(),r({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1})},refresh:(()=>{let s=null;return async()=>s||(s=(async()=>{const o=We.getRefreshToken();if(!o)throw We.clearTokens(),r({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("No refresh token");const f=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:o})});if(!f.ok)throw We.clearTokens(),r({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!0}),new Error("Refresh failed");const h=await f.json();We.setTokens(h.accessToken,h.refreshToken),r({accessToken:h.accessToken,user:js(h.accessToken)})})().finally(()=>{s=null}),s)})(),setSessionExpired:s=>{r({sessionExpired:s})}})),A1={QUEUED:"QUEUED",ASSIGNED:"ASSIGNED",RUNNING:"RUNNING",SUSPENDED:"SUSPENDED",COMPLETED:"COMPLETED",FAILED:"FAILED",CANCELLED:"CANCELLED"},z1={ONLINE:"online",OFFLINE:"offline",DRAINING:"draining",DECOMMISSIONED:"decommissioned"},ip={DEVELOPER:"developer",LEAD:"lead",ADMIN:"admin"},O1={MAINTAINER:"maintainer",MEMBER:"member"},C1={CLAUDE:"claude",CURSOR:"cursor",CODEX:"codex",CUSTOM:"custom"},D1={ACTIVE:"active",USED:"used",REVOKED:"revoked",EXPIRED:"expired"},N1={GITLAB:"gitlab",GITHUB:"github",GITEA:"gitea"},M1={ACTIVE:"active",DISABLED:"disabled"},U1={ACTIVE:"active"},q1={IDLE:"IDLE",STARTING:"STARTING",CONNECTED:"CONNECTED",EXPIRED:"EXPIRED",CLOSING:"CLOSING",CLOSED:"CLOSED"};function yb(){return xa(r=>{var u;return((u=r.user)==null?void 0:u.role)===ip.ADMIN})??!1}const rp="overlord-sidebar-collapsed";function vb(){try{return localStorage.getItem(rp)==="true"}catch{return!1}}const bb=Fr((r,u)=>({sidebarCollapsed:vb(),toggleSidebar:()=>{const s=!u().sidebarCollapsed;try{localStorage.setItem(rp,String(s))}catch{}r({sidebarCollapsed:s})}}));class xb{constructor(){Ve(this,"ws",null);Ve(this,"reconnectAttempts",0);Ve(this,"maxReconnectAttempts",15);Ve(this,"reconnectTimer",null);Ve(this,"disposed",!1);Ve(this,"authenticated",!1);Ve(this,"eventHandlers",new Set);Ve(this,"statusHandlers",new Set)}onEvent(u){return this.eventHandlers.add(u),()=>this.eventHandlers.delete(u)}onStatus(u){return this.statusHandlers.add(u),()=>this.statusHandlers.delete(u)}get isConnected(){var u;return this.authenticated&&((u=this.ws)==null?void 0:u.readyState)===WebSocket.OPEN}connect(){var f,h;if(this.disposed||((f=this.ws)==null?void 0:f.readyState)===WebSocket.OPEN||((h=this.ws)==null?void 0:h.readyState)===WebSocket.CONNECTING)return;const u=We.getAccessToken();if(!u||We.isExpired(u))return;const o=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`;this.notifyStatus("connecting"),this.authenticated=!1,this.ws=new WebSocket(o),this.ws.onopen=()=>{var b,y;const p=We.getAccessToken();p?(b=this.ws)==null||b.send(JSON.stringify({type:"auth",token:p})):(y=this.ws)==null||y.close()},this.ws.onmessage=p=>{var b;if(typeof p.data=="string")try{const y=JSON.parse(p.data);if(y.type==="auth_ok"){this.authenticated=!0,this.reconnectAttempts=0,this.notifyStatus("connected");return}if(y.type==="auth_error"){(b=this.ws)==null||b.close();return}if(y.type==="event")for(const _ of this.eventHandlers)try{_(y)}catch{}}catch{}},this.ws.onclose=()=>{this.authenticated=!1,this.notifyStatus("disconnected"),this.scheduleReconnect()},this.ws.onerror=()=>{var p;(p=this.ws)==null||p.close()}}disconnect(){var u;this.clearReconnectTimer(),this.authenticated=!1,(u=this.ws)==null||u.close(),this.ws=null}dispose(){this.disposed=!0,this.disconnect(),this.eventHandlers.clear(),this.statusHandlers.clear()}reconnect(){this.disconnect(),this.reconnectAttempts=0,this.connect()}scheduleReconnect(){if(this.disposed||this.reconnectAttempts>=this.maxReconnectAttempts)return;const u=Math.min(1e3*2**this.reconnectAttempts,3e4);this.reconnectAttempts++,this.reconnectTimer=setTimeout(()=>{this.disposed||this.connect()},u)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}notifyStatus(u){for(const s of this.statusHandlers)try{s(u)}catch{}}}const Cr=new xb,Sb=Fr(r=>({status:"disconnected",lastEvent:null,eventSeq:0,taskSeq:0,workerSeq:0,init:()=>{const u=Cr.onEvent(o=>{const f=o.event==="task_status_changed"||o.event==="task_created",h=o.event==="worker_status_changed";r(p=>({lastEvent:o,eventSeq:p.eventSeq+1,...f&&{taskSeq:p.taskSeq+1},...h&&{workerSeq:p.workerSeq+1}}))}),s=Cr.onStatus(o=>{r({status:o})});return Cr.connect(),()=>{u(),s(),Cr.disconnect()}}})),up="overlord-theme";function kb(){try{const r=localStorage.getItem(up);if(r==="light"||r==="dark"||r==="system")return r}catch{}return"dark"}function xh(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const op=Fr(r=>{const u=kb(),s=u==="system"?xh():u;return{theme:u,resolved:s,setTheme:o=>{localStorage.setItem(up,o);const f=o==="system"?xh():o;r({theme:o,resolved:f})},setResolved:o=>{r({resolved:o})}}}),Eb={common:{cancel:"cancel",confirm:"confirm",save:"save",delete:"delete",edit:"edit",create:"create",copy:"copy",copied:"copied",close:"close",back:"back",back_to_site:"back to site",go_back:"go back",go_home:"go home",dismiss:"dismiss",retry:"retry",loading:"// loading...",processing:"processing...",creating:"creating...",saving:"saving...",updating:"updating...",verifying:"verifying...",signing_in:"signing in...",just_now:"just now",never:"never",previous:"previous",next:"next",error:"error",success:"success",failed:"failed",active:"active",inactive:"inactive",enabled:"enabled",disabled:"disabled",showing_entries:"showing {start}-{end} of {total}",no_results:"no results found",runtime_error:"// runtime error",an_unexpected_error_occurred:"an unexpected error occurred",reload:"reload",not_found:"404",page_not_found:"// page not found",the_page_does_not_exist:"the page you are looking for does not exist or has been moved.",not_found_terminal_error:"error: requested not found - page does not exist",not_set:"not set",view_all:"view all",discard:"discard",save_changes:"save changes",add:"add",remove:"remove",search:"search",actions:"actions",name:"name",status:"status",role:"role",description:"description",type:"type",created_at:"created at",ago:"{time} ago",m_ago:"{n}m ago",h_ago:"{n}h ago",d_ago:"{n}d ago",navigation:"// navigation",docs_section:"// docs",admin_section:"// admin",overlord:"overlord",logout:"logout",logout_title:"// logout",logout_message:"are you sure you want to log out?",log_out:"log out",profile:"profile",search_placeholder:"search",search_input_placeholder:"search tasks, workers, projects...",no_search_results:'// no results for "{query}"',navigate_hint:"navigate",select_hint:"select",close_hint:"close",notifications:"notifications",mark_all_read:"mark all read",no_notifications:"// no notifications",mark_as_read:"mark as read",switch_to_light:"switch to light mode",switch_to_dark:"switch to dark mode",light_mode:"light mode",dark_mode:"dark mode",dismiss_notification:"dismiss",breadcrumb_terminal:"terminal",breadcrumb_terminal_sub:"active sessions",breadcrumb_dashboard:"dashboard",breadcrumb_dashboard_sub:"active overview",breadcrumb_tasks:"tasks",breadcrumb_tasks_sub:"queue management",breadcrumb_workers:"workers",breadcrumb_workers_sub:"fleet status",breadcrumb_projects:"projects",breadcrumb_projects_sub:"repository index",breadcrumb_admin:"admin",breadcrumb_admin_sub:"system control",breadcrumb_profile:"profile",breadcrumb_profile_sub:"user settings",breadcrumb_tokens:"tokens",breadcrumb_tokens_sub:"personal api tokens",breadcrumb_docs:"docs",breadcrumb_docs_sub:"documentation",breadcrumb_docs_cli:"docs",breadcrumb_docs_cli_sub:"cli",breadcrumb_docs_api:"docs",breadcrumb_docs_api_sub:"api",breadcrumb_docs_skill:"docs",breadcrumb_docs_skill_sub:"skill",breadcrumb_docs_bot_sub:"bot",breadcrumb_docs_all_sub:"all",error_default_title:"something went wrong",error_default_message:"an unexpected error occurred. please try again."},auth:{sign_in:"sign in",username:"username",enter_username:"enter username",password:"password",enter_password:"enter password",ai_powered_development_system:"// ai-powered development system",username_and_password_required:"username and password are required.",login_failed:"login failed",invalid_totp_code:"invalid totp code",two_factor_verification:"// 2fa verification",enter_totp_code:"enter your totp code",please_enter_valid_6_digit_code:"please enter a valid 6-digit code.",session_expired:"session expired",session_expired_message:"// your session has expired. please log in again.",go_to_login:"go to login",totp_setup_title:"2FA setup",totp_setup_subtitle:"// scan the qr code with your authenticator app",scan_with_authenticator:"scan this qr code with your authenticator app (google authenticator, authy, etc.)",manual_entry_key:"manual entry key",enter_verification_code:"enter the 6-digit verification code from your authenticator app",verification_code:"verification code",enter_6_digit_code:"enter 6-digit code",verify_and_enable:"verify and enable",totp_setup_complete:"2fa setup complete",totp_setup_complete_login_again:"2fa setup complete! please log in again.",totp_setup_failed:"verification failed. please try again.",totp_setup_footer:"// you must complete this setup before accessing the application",totp_manual_entry:"// or enter this key manually",verify:"verify",initializing:"// initializing...",failed_to_init_totp:"failed to initialize totp setup"},dashboard:{title:"dashboard",subtitle:"// system overview",active_tasks:"active tasks",queued_tasks:"queued tasks",online_workers:"online workers",completed_today:"completed today",task_success_rate:"> task success rate",last_7_days:"last 7 days",recent_tasks:"> recent tasks",no_tasks_yet:"// no tasks yet",worker_status:"> worker status",no_workers_registered:"// no workers registered",recent_activity:"> recent activity",no_recent_activity:"// no recent activity",daily_breakdown_not_available:"// daily breakdown not available",slots:"slots",online:"online",idle:"idle",offline:"offline"},tasks:{title:"tasks",subtitle:"// queue management",create_task:"create task",new_task:"new task",task_description:"task description",describe_task_placeholder:"describe the development task in detail...",project:"project",select_project:"select project...",task_type:"type",branch_slug:"branch name (optional)",branch_slug_placeholder:"auto-generated from description",target_worker:"target worker (optional)",any_able:"any able",assign_developer:"assign developer (admin only)",select_developer:"select developer...",search_tasks:"search tasks...",id:"id",description_col:"description",status_col:"status",project_col:"project",assignee:"assignee",worker:"worker",time:"time",stage:"stage",no_tasks_found:"no tasks found",try_adjusting_search:"try adjusting your search query",create_first_task:"create your first task to get started",tab_all:"all",tab_running:"running",tab_queued:"queued",tab_completed:"completed",tab_failed:"failed",tab_cancelled:"cancelled",status_queued:"queued",status_assigned:"assigned",status_running:"running",status_suspended:"suspended",status_completed:"completed",status_failed:"failed",status_cancelled:"cancelled",similar_task_exists:"a similar task already exists.",confirm_create_similar:"are you sure you want to create this task?",view_existing:"view existing",force_create:"force create",cancel_task:"cancel",retry_task:"retry",cursor_tunnel:"IDE tunnel",skip_stage:"skip stage",take_over:"take over",release_control:"release control",connected:"connected",disconnected:"disconnected",connecting:"connecting",terminal:"terminal",pipeline_tab:"pipeline",logs:"logs",task_not_found:"// task not found",task_does_not_exist:"this task does not exist or has been deleted.",back_to_tasks:"back to tasks",task_detail_subtitle:"#{id} {desc}",cancel_task_title:"cancel task",task_cancelled:"task cancelled.",failed_to_cancel_task:"failed to cancel task.",task_retried:"task has been retried.",failed_to_retry_task:"failed to retry task.",retry_mr_title:"retry MR",retry_mr_confirm:"retry creating the merge request for task #{id}?",mr_retry_submitted:"mr retry submitted.",failed_to_retry_mr:"failed to retry mr.",activity_log:"> activity log",pipeline_section:"> pipeline",no_pipeline:"// no pipeline configured",no_activity:"// no activity yet",confirm_stage:"confirm stage",confirm_stage_message:'confirm execution of stage "{name}"? this will proceed with the pipeline.',stage_confirmed:"stage confirmed.",failed_to_confirm_stage:"failed to confirm stage.",loading_task:"// loading task...",task_suspended_banner:"// task suspended — waiting for user confirmation",pending_confirmation:"> pending confirmation",pipeline_requires_confirmation:"the pipeline requires confirmation before proceeding.",confirm_and_proceed:"confirm and proceed",confirm_failed:"failed to confirm stage",reject:"reject",pty_terminal:"// pty terminal",view_terminal:"switch to terminal tab",restore_auto:"restore auto",requesting_takeover:"requesting...",pipeline_stages:"// pipeline stages",task_info:"> task info",stage_timeline:"> stage timeline",workspace_section:"> workspace",mr_link:"MR link",no_worker_assigned:"// no worker assigned",no_output:"// no output",pty_output:"> PTY output",stage_progress:"> stage progress",task_logs:"> task logs",search_logs:"search logs...",no_log_entries:"// no log entries",prev:"prev",cursor_tunnel_section:"> IDE tunnel",auto_pipeline:"auto pipeline",auto_mode:"auto mode",manual_takeover:"manual takeover",takeover_denied:"takeover denied",requesting_takeover_ellipsis:"requesting takeover...",take_over_label:"take over",release_label:"release",create_task_page_title:"// create task",create_task_page_subtitle:"// submit a new task for processing",form_project_label:"project",form_description_label:"description",form_description_placeholder:"describe the task for the ai agent...",form_worker_preference:"worker preference",form_worker_placeholder:"optional: worker id or name (--on)",form_worker_hint:"leave empty for automatic worker selection.",form_agent_type:"agent type",form_agent_type_placeholder:"default (from project config)",form_select_project:"select a project",form_create_task:"create task",project_and_description_required:"project and description are required.",failed_to_create_task:"failed to create task.",tunnel_idle:"idle",tunnel_starting:"starting...",tunnel_connected:"connected",tunnel_expired:"expired",tunnel_closing:"closing...",tunnel_start:"start",tunnel_open_in_cursor:"open in IDE",tunnel_header:"> IDE tunnel",tunnel_copied:"// copied to clipboard",tunnel_waiting:"// waiting for connection url...",tunnel_start_button:"> start tunnel",tunnel_starting_button:"// starting...",tunnel_stopping:"// stopping...",tunnel_cancel:"> cancel",tunnel_open_cursor:"> open in IDE",tunnel_open_vscode:"> open in vscode",tunnel_stop:"> stop tunnel",tunnel_restart:"> restart tunnel",tunnel_copy_url:"copy url",tunnel_expires_hm:"expires in {h}h {m}m",tunnel_expires_m:"expires in {m}m",tunnel_start_failed:"failed to start tunnel",tunnel_install_code_hint:'install the VS Code CLI ("code" command) to enable tunnels',dedup_title:"> similar task exists",dedup_description:"// a similar task was found that may already address your request",dedup_create_anyway:"create anyway",stage_choose_option:"// choose an option",stage_your_response:"your response",stage_type_answer:"type your answer...",stage_submitting:"submitting...",stage_continue:"continue",stage_submit:"submit",cancel_task_message:"are you sure you want to cancel task #{id}? this will terminate the running agent and cannot be undone.",cancel_task_confirm_label:"cancel task",retry_title:"retry task",retry_confirm_label:"retry",retry_message_with_mr:"task #{id} has an existing mr ({url}). retrying will create a new attempt on the same branch. continue?",retry_message_without_mr:"are you sure you want to retry task #{id}? this will create a new execution attempt."},workers:{title:"workers",subtitle:"// fleet status",fleet:"fleet",setup_guide:"setup guide",all_statuses:"all",register_worker:"register worker",no_workers_found:"no workers found",no_workers_registered:"no workers have registered yet",try_changing_status_filter:"try changing the status filter",view_setup_guide:"view setup guide",online:"online",offline:"offline",draining:"draining",cpu:"cpu",mem:"mem",disk:"disk",tasks_slots:"tasks: {active}/{max} slots",back_to_workers:"back to workers",drain:"drain",undrain:"undrain",last_heartbeat:"last heartbeat: {time}",resource_usage:"> resource usage",connection_info:"> connection info",capabilities:"> capabilities",current_tasks:"> current tasks",no_capabilities:"// no capabilities reported",no_running_tasks:"// no running tasks",host:"host",port:"port",os:"os",cpu_model:"CPU model",cpu_cores:"CPU cores",memory:"memory",total_slots:"total slots",confirm_drain:"drain worker",confirm_drain_message:'drain worker "{name}"? it will finish current tasks but accept no new ones.',worker_drained:"worker drain initiated.",worker_undrained:"worker undrain initiated.",failed_to_update_worker:"failed to update worker status.",worker_setup_title:"worker setup guide",worker_setup_subtitle:"// register a new worker with overlord",step_1_title:"01. generate a registration token",step_1_desc:"generate a one-time registration token from the admin panel.",step_2_title:"02. install the worker cli",step_2_desc:"install the overlord worker cli on the target worker.",step_3_title:"03. register the worker",step_3_desc:"run the register command with your token and server url.",step_4_title:"04. start the worker",step_4_desc:"start the worker daemon. it will connect to overlord and begin accepting tasks.",generate_token:"generate token",worker_token_modal_title:"worker registration token",worker_token_modal_message:"// copy this token now. it will not be shown again.",loading_worker:"// loading worker...",worker_not_found:"// worker not found",draining_warning:"// this worker is draining — no new tasks will be assigned",draining_active_tasks:"active tasks will continue to run until completion",active_tasks:"> active tasks",no_active_tasks:"// no active tasks on this worker",worker_info:"> worker info",unknown:"unknown",n_a:"n/a",id:"id",description:"description",stage:"stage",no_capabilities_short:"// no capabilities",slots:"slots",status_label:"status",undrain_worker_title:"> undrain worker",drain_worker_title:"> drain worker",undrain_confirm:"are you sure you want to undrain {name}? the worker will start accepting new tasks again.",drain_confirm:"are you sure you want to drain {name}? running tasks will complete, but no new tasks will be assigned until the worker is undrained.",decommission:"decommission",decommission_title:"> decommission worker",decommission_confirm:'permanently decommission "{name}"? active tasks will be failed or re-queued, and the worker will be disconnected. this cannot be undone.',decommissioned:"decommissioned",worker_id:"worker ID",setup_header_desc:"// follow these steps to add a new worker to your overlord cluster.",prerequisites:"// prerequisites",prereq_machine:"linux or macos machine with at least 2 cpu cores and 4gb ram",prereq_node:"node.js 18+ and pnpm installed",prereq_git:"git installed (2.25+)",prereq_network:"network access to the overlord server",prereq_token:"admin-generated worker registration token",step_generate_token:"generate worker token",step_generate_token_desc:"// create a one-time registration token from the admin panel. each token can register exactly one worker.",go_to_token_management:"go to token management",step_install_worker:"install worker package",step_install_worker_desc:"// install the overlord worker package globally via npm.",step_configure_env:"configure environment",step_configure_env_desc:"// create a .env file in ~/.overlord-worker/ or set environment variables.",env_host:"overlord server address (required)",env_worker_token:"one-time registration token (required for first run)",env_worker_name:"display name (defaults to hostname)",env_workspace_root:"task workspace directory (defaults to ~/.overlord-worker/workspaces)",env_max_slots:"max concurrent tasks (defaults to 2)",step_start_worker:"start worker",step_start_worker_desc:"// start the worker process. it will register with the server and begin accepting tasks.",or_run_as_service:"// or run as a system service for auto-restart:",setup_wizard_option:"// option a: interactive setup wizard (recommended)",manual_config_option:"// option b: manual configuration",start_note_setup_wizard:"// if you used the setup wizard, the worker may already be running.",step_verify_connection:"verify connection",step_verify_connection_desc:'// once the worker connects, it will appear in the workers list with a "healthy" status.',verify_how_to:"// how to verify:",verify_check_workers:"check the workers page for your new worker",verify_status:'status should show "healthy" within 30 seconds',verify_capabilities:"worker capabilities are auto-detected on first heartbeat",last_heartbeat_label:"last heartbeat",worker_version:"worker version",reg_title:"// worker registration",reg_subtitle:"> register a new worker node",reg_step_generate_token:"generate token",reg_step_install_worker:"install worker",reg_step_waiting_activation:"waiting activation",reg_step_activated:"activated",reg_click_to_generate:"// click to generate a one-time registration token",reg_token_generated:"// token generated successfully",reg_install_command:"// install cli & worker:",reg_run_setup:"// run setup on worker:",reg_running_installation:"// running installation on target worker",reg_installed_wait:"i've installed → wait for activation",reg_listening_for_worker:"listening for worker connection...",reg_worker_connected:"// worker connected",reg_waiting_for_worker:"// waiting for worker to connect...",reg_worker_activated:"worker {name} activated!",reg_worker_registered:"// worker successfully registered",reg_done:"done",reg_completed:"// completed"},projects:{title:"projects",subtitle:"// repository index",create_project:"create project",no_projects_yet:"no projects yet",create_first_project:"create your first project to get started",key:"key",name:"name",repository:"repository",agent:"agent",project_info:"> project info",repo_url:"repo URL",default_branch:"default branch",git_platform:"git platform",agent_type:"agent type",max_turns:"max turns",allowed_tools:"allowed tools",default_project:"default project",tasks_count:"tasks",last_activity:"last activity",members:"> members",developer:"developer",role:"role",added_at:"added at",add_member:"add member",remove_member:"remove member",remove_member_confirm:"remove {name} from this project?",member_added:"member added.",member_removed:"member removed.",failed_to_add_member:"failed to add member.",member_already_exists:"this developer is already a member of this project.",failed_to_remove_member:"failed to remove member.",pipeline:"> pipeline",add_stage:"+ add stage",recent_tasks:"> recent tasks",no_recent_tasks:"// no recent tasks",edit_project:"edit project",delete_project:"delete project",delete_project_confirm:'delete project "{name}"? this cannot be undone.',project_deleted:"project deleted.",failed_to_delete_project:"failed to delete project.",project_name:"project name",project_name_placeholder:"my awesome project",project_key:"project key",project_key_placeholder:"my-project",project_key_hint:"// unique identifier (lowercase, alphanumeric, hyphens)",ssh_url:"SSH URL",ssh_url_placeholder:"git@github.com:org/repo.git",ssh_url_hint:"// optional — workers prefer ssh for git operations",repo_url_placeholder:"https://github.com/org/repo.git",main:"main",github:"github",gitlab:"gitlab",gitea:"gitea",claude:"claude",cursor:"cursor",codex:"codex",custom:"custom",tools_placeholder:"tool1, tool2, ...",add_project_desc:"// add a new project to overlord",project_created:"project created.",failed_to_create_project:"failed to create project.",update_project_desc:"// update project configuration",save_changes:"save changes",basic_info:"> basic info",agent_config:"> agent config",security:"> security",git_token:"> git token",git_token_label:"current token",git_token_hint:"// personal access token for git operations (push, clone, etc.)",git_token_set:"set token",git_token_clear:"clear token",git_token_saved:"git token saved.",git_token_cleared:"git token cleared.",git_token_failed:"failed to update git token.",pipeline_section:"> pipeline",edit_pipeline:"> edit pipeline",pty_output_filter:"PTY output filter",workspace_root:"workspace root",agent_command:"agent command",member_role:"member",maintainer_role:"maintainer",select_developer:"select developer...",select_role:"select role...",adding:"adding...",project_not_found:"// project not found",back_to_projects:"back to projects",no_members_yet:"// no members yet",no_tasks_for_project:"// no tasks for this project yet",no_pipeline_configured:"// no pipeline configured",confirm_label:"confirm",id:"id",description:"description",status:"status",created:"created",project_saved:"project saved",failed_to_save_project:"failed to save project",invalid_pipeline_json:"invalid pipeline json",setup_commands:"setup commands",post_command:"post command",environment:"> environment",add_member_title:"// add member",edit_project_title:"edit project"},pipeline:{title:"pipeline editor",subtitle:"-- {key}",save:"save",cancel:"cancel",json_toggle:"json",add_stage:"add stage",stage_properties:"> stage properties",stage_name:"stage name",timeout:"timeout",confirm_required:"confirm required",on_failure:"on failure",goto:"goto",max_loops:"max loops",stop:"stop",no_stages:"// no stages defined",select_stage:"// select a stage to edit properties",saved:"pipeline saved",failed_to_save:"failed to save pipeline",failed_to_load:"failed to load pipeline.",loading_pipeline:"// loading pipeline...",unnamed:"unnamed",editing:"// editing: {name}",name:"name",on_failure_section:"// on failure",goto_stage:"goto stage",up:"up",down:"down",failed_to_load_project:"failed to load project",delete_stage:"delete stage"},profile:{title:"profile",subtitle:"// user settings",profile_info:"> profile info",username:"username",git_name:"git name",git_email:"git email",status:"status",created_at:"created at",edit_git_info:"edit git info",change_password:"> change password",current_password:"current password",new_password:"new password",confirm_password:"confirm password",current_password_required:"current password is required.",new_password_required:"new password is required.",passwords_do_not_match:"new passwords do not match.",password_changed:"password changed successfully.",failed_to_change_password:"failed to change password.",update_password:"update password",two_factor_auth:"> two-factor authentication",two_fa_enabled:"2fa is enabled",two_fa_not_setup:"2fa is not set up",regenerate_2fa_warning:`// regenerating 2fa will invalidate your current authenticator app setup.
237
237
  you will need to set up 2fa again on your next login.`,regenerate_2fa:"regenerate 2FA",regenerating:"regenerating...",access_tokens:"access tokens",access_tokens_desc:"// manage personal access tokens for cli & api",git_info_updated:"git info updated.",failed_to_update_git_info:"failed to update git info.",two_fa_reset:"2fa has been reset. please set up your authenticator again on next login.",failed_to_regenerate_2fa:"failed to regenerate 2fa.",failed_to_load_profile:"failed to load profile.",unable_to_load_profile:"// unable to load profile information",personal_settings:"// personal settings",password_length_10_20:"password must be between 10 and 20 characters.",password_hint_10_20:"// 10-20 characters, letters, numbers, and special characters",current_totp_code:"current TOTP code",totp_code_placeholder:"6-digit code",totp_code_required:"please enter your current 6-digit totp code to regenerate 2fa.",two_fa_regenerated:"2fa regenerated. you will need to set it up again on next login.",totp_code_invalid:"invalid totp code or failed to regenerate 2fa.",platform_accounts:"platform accounts",not_linked:"not linked",bind_hint:'send "bind" to the bot in lark or slack to link your account.'},access_tokens:{title:"access tokens",subtitle:"// personal access tokens",create_token:"create token",no_tokens:"no personal access tokens",create_token_desc:"create a token to authenticate with the cli or api",copy_token_warning:"// copy your token now. you will not be able to see it again.",token_name:"token name",token_name_placeholder:"my-cli-token",expires_in:"expires in",days_30:"30 days",days_90:"90 days",days_365:"365 days",no_expiry:"no expiry",token_created:"token created.",failed_to_create_token:"failed to create token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",failed_to_load_tokens:"failed to load tokens.",revoke:"revoke",revoke_token:"revoke token",last_used:"last used",expires_at:"expires at",token:"token",created:"created",expires:"expires",revoke_confirm:'are you sure you want to revoke "{name}"? this action cannot be undone.',create_personal_access_token:"// create personal access token",tokens_authenticate_desc:"// tokens authenticate the ov cli and api requests",revoke_token_title:"// revoke token",token_label_required:"token label is required."},admin:{title:"admin",subtitle:"// system control",tab_developers:"developers",tab_bots:"bots",tab_tokens:"worker tokens",tab_audit_logs:"audit logs",tab_settings:"settings",developers_title:"admin / developers",developers_subtitle:"// developer account management",create_developer:"create developer",search_developers:"search developers...",no_matching_developers:"no matching developers",no_developers_found:"no developers found",try_adjusting_search:"try adjusting your search query",username:"username",display_name:"display name",role:"role",status:"status",two_fa_status:"2FA status",dev_name:"dev name",totp:"totp",reset_2fa:"reset 2fa",deactivate:"deactivate",activate:"activate",create_developer_title:"create developer",create_developer_desc:"// add a new developer account",edit_developer_title:"edit developer",edit_developer_desc:"// update developer account settings",developer_created:"developer created.",developer_updated:"developer updated.",failed_to_create_developer:"failed to create developer",failed_to_update_developer:"failed to update developer",confirm_reset_2fa:'reset 2fa for "{name}"? they will need to set up 2fa again on next login.',two_fa_reset:"2fa has been reset.",failed_to_reset_2fa:"failed to reset 2fa",confirm_deactivate:'deactivate "{name}"? they will not be able to log in.',confirm_activate:'activate "{name}"?',developer_deactivated:"developer deactivated.",developer_activated:"developer activated.",failed_to_update_status:"failed to update developer status.",create_first_developer:"create your first developer to get started",all_fields_required:"all fields are required.",password_length_error:"password must be between 10 and 20 characters.",password_complexity_error:"password must contain at least one letter, one digit, and one special character.",password_hint:"// must be 10-20 characters with letters, digits, and special characters.",display_name_required:"display name is required.",demote_self_warning:"you are about to demote yourself from admin. the system must have at least one admin. please verify another admin exists before proceeding.",demote_self_inline_warning:"// warning: you are demoting yourself from admin. ensure at least one other admin exists.",lark_uid:"lark open ID",slack_uid:"slack user ID",platform_accounts:"platform accounts",reset_2fa_confirm_message:"are you sure you want to reset two-factor authentication for",reset_2fa_audit_note:"// the user will be required to set up 2fa again on their next login. this action is recorded in the audit log.",resetting:"resetting...",bots_title:"admin / bots",bots_subtitle:"// bot instance management",create_bot:"create bot",no_bots_configured:"no bots configured",add_bot_desc:"add a bot instance to enable chat integrations with lark or slack",bot_name:"bot name",platform:"platform",app_id:"app ID",lark:"lark",slack:"slack",delete_bot:"delete bot",delete_bot_confirm:'delete bot "{name}"? this cannot be undone.',bot_deleted:"bot deleted.",failed_to_delete_bot:"failed to delete bot.",bot_created:"bot created.",failed_to_create_bot:"failed to create bot",chat_bindings:"chat bindings",chat_bindings_subtitle:"// all integrations",no_chat_bindings:"// no chat bindings configured",chat_id:"chat ID",chat_name:"chat name",project:"project",bot:"bot",edit_bot:"edit bot",name_and_app_id_required:"name and app id are required.",app_secret_required:"app secret is required for new bots.",app_secret:"app secret",app_secret_keep_current:"app secret (leave empty to keep current)",webhook_url_optional:"webhook URL (optional)",lark_feishu:"lark (feishu)",failed_to_update_bot:"failed to update bot",bot_token:"bot token",bot_token_keep_current:"bot token (leave empty to keep current)",bot_token_placeholder:"xoxb-...",bot_token_hint:"// OAuth & Permissions → Bot User OAuth Token",signing_secret:"signing secret",signing_secret_keep_current:"signing secret (leave empty to keep current)",signing_secret_placeholder:"your signing secret",signing_secret_hint:"// Basic Information → App Credentials → Signing Secret",app_secret_hint_lark:"// lark open platform → app credentials → app secret",app_id_hint_slack:"// Basic Information → App ID",app_id_hint_lark:"// lark open platform → app id",webhook_config:"// webhook configuration",webhook_config_hint_slack:"// copy these URLs to your Slack app settings",webhook_config_hint_lark:"// copy this URL to event subscriptions → request url",webhook_events_url:"events url",webhook_interact_url:"interactivity url",webhook_commands_url:"slash commands url",webhook_request_url:"request url",slack_events_hint:"// paste in Event Subscriptions → Request URL",slack_interact_hint:"// paste in Interactivity & Shortcuts → Request URL",slack_commands_hint:"// paste in Slash Commands → Request URL",invalid_bot_token:"// bot token must start with xoxb-",signing_secret_required:"// signing secret is required for Slack bots",no_chat_bindings_for_bot:"// no chat bindings configured for this bot.",add_chat_binding_desc:"// add chat binding",add_binding:"add binding",failed_to_add_binding:"failed to add binding",tokens_title:"admin / worker tokens",tokens_subtitle:"// worker registration token management",generate_token:"generate token",no_worker_tokens:"no worker tokens",generate_token_desc:"generate a token to register a new worker",label:"label",purpose:"purpose",expires_at:"expires at",token_generated:"token generated.",failed_to_generate_token:"failed to generate token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",revoke_token:"revoke token",revoke_token_confirm:'revoke token "{label}"? this cannot be undone.',show_revoked:"show revoked",hide_revoked:"hide revoked",audit_title:"admin / audit logs",audit_subtitle:"// system activity audit trail",all_actions:"all actions",filter_by_user:"filter by user...",no_audit_entries:"no audit log entries",audit_logs_appear:"audit logs will appear here as actions are performed in the system",timestamp:"timestamp",user_id:"user ID",action:"action",resource:"resource",detail:"detail",ip:"ip",action_login:"login",action_logout:"logout",action_create:"create",action_update:"update",action_delete:"delete",action_revoke:"revoke",action_reset_2fa:"reset 2FA",action_generate_token:"generate token",showing_entries:"showing {count} entries",revoke:"revoke",generate_worker_token_title:"> generate worker token",create_one_time_token:"// create a one-time registration token",label_identifies_worker:"// identifies which worker this token is for",generating:"generating...",generate:"generate",worker_registered:"> worker registered",worker_token_generated:"> worker token generated",run_command_desc:"// run this command on the target machine to register the worker",token_shown_once:"// this token will only be shown once. copy the command before closing.",setup_command:"setup command",waiting_for_worker:"// waiting for worker to register...",token_not_yet_used:"// token not yet used. the worker can still register later using this token.",worker_registered_success:"// worker registered successfully",worker:"worker",copied_wait_for_worker:"copied — wait for worker",close_worker_can_register:"close // worker can still register",view_worker:"view worker",label_required:"label is required.",settings_title:"admin / settings",settings_subtitle:"// global system configuration",save_settings:"save settings",settings_saved:"settings saved",failed_to_save_settings:"failed to save settings",loading_settings:"// loading settings...",scheduling:"> scheduling",heartbeat:"> heartbeat",output:"> output",defaults:"> defaults",max_concurrent_tasks:"max concurrent tasks per worker",max_concurrent_tasks_desc:"// maximum number of tasks a single worker can run simultaneously",task_timeout:"task timeout minutes",task_timeout_desc:"// auto-cancel tasks after this many minutes of inactivity",heartbeat_interval:"heartbeat interval seconds",heartbeat_interval_desc:"// expected interval between worker heartbeats",worker_offline_threshold:"worker offline threshold seconds",worker_offline_threshold_desc:"// mark worker offline after missing heartbeats for this duration",default_agent_type:"default agent type",default_agent_type_desc:"// default agent type for new projects",server_url:"server URL",server_url_desc:"// public server url used in worker setup instructions",chat_binding_title:"// chat bindings — {name}",chat_binding_no_bindings:"// no chat bindings configured for this bot.",chat_binding_add:"// add chat binding",chat_binding_id_placeholder:"platform chat/group id",chat_binding_name_placeholder:"display name for the chat",chat_binding_select_project:"select project...",chat_binding_all_fields_required:"all fields are required.",chat_binding_adding:"adding...",pat_label_required:"label is required.",pat_failed_to_generate:"failed to generate token",pat_label_placeholder:"e.g. build-server-03"},landing:{overlord:"overlord",version_badge:"self-hosted · bring your own subscriptions and machines",hero_line1:"turn your subscriptions / machines into",hero_turn_your:"turn your",hero_into:"into",hero_word_subscriptions:"subscriptions",hero_word_machines:"machines",hero_highlight:"a dev team that never sleeps.",hero_desc:"dispatch coding tasks across your machine fleet. ai agents execute in parallel — you watch, jump in, or come back to finished pull requests.",get_started:"get started",read_docs:"read docs",how_it_works:"how it works",three_steps:"from task description to merged pull request.",step_n:"step {n}",step_define:"connect your fleet",step_define_desc:"register your machines as workers. each one runs ai agents — claude code, cursor, codex — using your existing subscriptions.",step_dispatch:"send a task",step_dispatch_desc:"describe what you want from slack, lark, cli, or the web dashboard. overlord finds the best available machine and starts the ai agent automatically.",step_monitor:"watch or walk away",step_monitor_desc:"live terminal streams agent output to your browser. jump in to guide the agent, or come back later to a finished pull request.",everything_you_need:"everything you need",complete_platform:"self-hosted. your machines, your ai subscriptions, your control.",feature_terminal:"real-time pty terminal",feature_terminal_desc:"stream live agent output directly in the browser. full xterm.js integration with scrollback and search.",feature_multi_agent:"multi-agent support",feature_multi_agent_desc:"first-class support for claude code, cursor, and codex. route tasks to the right agent automatically.",feature_routing:"smart task routing",feature_routing_desc:"intelligent scheduling across your machine fleet. tasks land on the best available worker every time.",feature_pipeline:"pipeline automation",feature_pipeline_desc:"chain tasks into multi-stage pipelines. build, test, and deploy in one continuous flow.",feature_collab:"team collaboration",feature_collab_desc:"project-level permissions, audit logs, and shared dashboards. keep your whole team in sync.",feature_pool:"pool subscriptions, maximize value",feature_pool_desc:"every team member's ai subscription goes into a shared pool — everyone can use any seat. no idle subscriptions, no duplicate costs. the bigger your team, the more you save.",feature_trigger:"trigger from everywhere",feature_trigger_desc:"slack message, lark bot, cli command, or web dashboard — create tasks from whatever tool you already use. phone, laptop, tablet, it all works.",feature_remote:"code from anywhere",feature_remote_desc:"on the bus, at a café, or away from your desk — dispatch tasks from your phone or laptop and your fleet keeps coding. come back to finished pull requests.",feature_security:"secure by design",feature_security_desc:"totp two-factor auth, scoped api tokens, and full audit trail. enterprise-ready from day one.",install_title:"get up and running",install_desc:"three components, three commands. deploy in minutes.",install_command:"npm install -g @overlordai/developer-cli",setup_step_1_title:"deploy the server",setup_step_1_desc:"install overlord and start the central server. it manages all tasks, authentication, and real-time communication.",setup_step_1_command:`npm install -g @overlordai/cli @overlordai/server
238
238
  overlord install`,setup_step_1_link:"installation guide",setup_step_2_title:"register workers",setup_step_2_desc:"set up worker machines that execute tasks. each worker runs ai agents in isolated workspaces with full git integration.",setup_step_2_command:`npm install -g @overlordai/cli @overlordai/worker
239
239
  overlord setup worker`,setup_step_2_link:"worker setup guide",setup_step_3_title:"connect as developer",setup_step_3_desc:"install the developer cli to create tasks, attach to running sessions, and monitor progress from your terminal.",setup_step_3_command:`npm install -g @overlordai/developer-cli
240
- ov login https://overlord.yourdomain.com`,setup_step_3_link:"development workflow",go_to_app:"open app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli",cli_subtitle:"// command-line tools",api_reference:"api",api_subtitle:"// rest api endpoints",quick_start:"// quick start",developer_cli:"developer cli (ov)",admin_cli:"admin cli (overlord)",authentication:"// authentication",usage:"usage",flags:"flags",example:"example",request_body:"request body",response:"response",quick_start_with_token:"// quick start with your token",replace_token_hint:"// replace <your-token> with the actual token value from your access tokens page",cli_tools_desc:"// overlord provides two cli tools: {ov} (developer cli) and {overlord} (admin/ops cli)",api_base_url_desc:"// base url: {url} · all endpoints return json · auth via bearer token in authorization header",docs_nav_getting_started:"// getting started",docs_nav_guides:"// guides",docs_nav_reference:"// reference",docs_nav_other:"// other",docs_installation:"installation",docs_developer_setup:"developer setup",docs_worker_setup:"worker setup",docs_bot_setup:"bot setup",docs_local_dev:"local development",docs_worker_ops:"worker operations",docs_deployment:"deployment",docs_bot_integration:"bot integration",docs_pipeline:"pipeline config",docs_dev_workflow:"dev workflow",docs_cli:"cli reference",docs_api:"api reference",docs_skill:"skill reference",docs_permissions:"permissions & roles",docs_env_vars:"environment variables",docs_architecture:"architecture",docs_changelog:"changelog",docs_menu:"docs menu",docs_back:"< back",docs_all_title:"// all documentation",docs_all_subtitle:"browse all guides, references, and resources",docs_desc_installation:"install overlord server and cli tools",docs_desc_developer_setup:"set up your local development environment",docs_desc_worker_setup:"register and configure worker machines",docs_desc_bot_setup:"connect lark or slack bots to overlord",docs_desc_local_dev:"run and debug overlord locally",docs_desc_worker_ops:"manage worker lifecycle and monitoring",docs_desc_deployment:"deploy overlord to production servers",docs_desc_bot_integration:"interactive cards, adapter pattern, troubleshooting",docs_desc_pipeline:"define multi-stage task pipelines",docs_desc_dev_workflow:"git workflow, branching, and merge requests",docs_desc_cli:"cli command reference",docs_desc_api:"http api endpoint reference",docs_desc_skill:"custom skill definitions and configuration",docs_desc_permissions:"roles, access control, and authorization",docs_desc_env_vars:"environment variables for server and worker",docs_desc_architecture:"system architecture and component overview",docs_desc_changelog:"version history and release notes"},onboarding:{getting_started:"// getting started",completed_count:"{done}/{total} completed",dismiss:"dismiss",all_done:"all set! you're ready to go.",admin_create_project_title:"create your first project",admin_create_project_desc:"set up a project with a git repo and pipeline",admin_register_worker_title:"register a worker",admin_register_worker_desc:"generate a token and set up a worker to run tasks",admin_create_developer_title:"create a developer account",admin_create_developer_desc:"add team members who can create and monitor tasks",admin_configure_bot_title:"configure a chat bot",admin_configure_bot_desc:"register a Lark or Slack bot to enable task management via chat",admin_first_task_title:"create your first task",admin_first_task_desc:"verify the full pipeline works end-to-end",lead_view_projects_title:"view your projects",lead_view_projects_desc:"check the projects assigned to you",lead_configure_pipeline_title:"configure a pipeline",lead_configure_pipeline_desc:"set up stages for your project workflow",lead_add_member_title:"add a team member",lead_add_member_desc:"invite developers to your project",lead_first_task_title:"create your first task",lead_first_task_desc:"submit a task and watch it execute",dev_install_cli_title:"install the ov cli",dev_install_cli_desc:"npm install -g @overlordai/developer-cli",dev_setup_cli_title:"run ov setup",dev_setup_cli_desc:"connect to the server and authenticate",dev_link_chat_title:"link your chat account",dev_link_chat_desc:'send "bind" to the bot in Lark or Slack to connect your account',dev_view_projects_title:"explore projects",dev_view_projects_desc:"browse available projects and their pipelines",dev_first_task_title:"create your first task",dev_first_task_desc:"submit a task via web or cli",go_to_projects:"go to projects",go_to_workers:"go to workers",go_to_tasks:"go to tasks",go_to_bots:"manage bots",manage_developers:"manage developers",cli:"cli",setup_guide:"setup guide"},bind:{title:"// link platform account",linking:"linking your account...",success:"account linked successfully!",success_detail:"your {platform} account has been connected. you can now use bot commands.",error:"failed to link account",invalid_token:'this link is invalid or has expired. send "bind" to the bot again to get a new link.',back_to_home:"go to dashboard",no_token:"no bind token provided."},pwa_install:{title:"overlord://install",command:"overlord --install",desc_1:"add to home screen for standalone app experience",desc_2:"works offline · full-screen · instant launch",install:"y — install",skip:"n — skip",ios_command:"install --manual",ios_step_1:"tap share button in safari toolbar",ios_step_2:'scroll down → tap "add to home screen"',ios_step_3:'tap "add" to confirm'},pwa_update:{message:"new version available",reload:"reload"},terminal_home:{title:"terminal",select_project:"project...",all_projects:"all projects",task_description_placeholder:"describe the task...",new_task:"new task",no_active_tasks:"no active tasks",create_task_hint:"create a task using the bar above to get started"}};function wb(r,u){const s=u.split(".");let o=r;for(const f of s){if(o==null||typeof o!="object")return u;o=o[f]}return typeof o=="string"?o:u}function Tb(r,u){return u?r.replace(/\{(\w+)\}/g,(s,o)=>u[o]!=null?String(u[o]):`{${o}}`):r}function Br(r,u){return Tb(wb(Eb,r),u)}function Vt(){return{t:g.useCallback((u,s)=>Br(u,s),[])}}function sp(){const{theme:r,setTheme:u}=op(),{t:s}=Vt(),o=r==="dark"||r==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){u(o?"light":"dark")}return m.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":s(o?"common.switch_to_light":"common.switch_to_dark"),title:s(o?"common.light_mode":"common.dark_mode"),children:o?m.jsx(mb,{size:16}):m.jsx(ob,{size:16})})}class Ns extends Error{constructor(s,o,f){const h=s.status||s.status===0?s.status:"",p=s.statusText??"",b=`${h} ${p}`.trim(),y=b?`status code ${b}`:"an unknown error";super(`Request failed with ${y}: ${o.method} ${o.url}`);Ve(this,"response");Ve(this,"request");Ve(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class cp extends Error{constructor(s){let o="Non-error value was thrown";try{typeof s=="string"?o=s:s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&(o=s.message)}catch{}super(o);Ve(this,"name","NonError");Ve(this,"value");this.value=s}}class Rs extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new cp(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Ve(this,"name","ForceRetryError");Ve(this,"customDelay");Ve(this,"code");Ve(this,"customRequest");this.customDelay=s==null?void 0:s.delay,this.code=s==null?void 0:s.code,this.customRequest=s==null?void 0:s.request}}const Sh=(()=>{let r=!1,u=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{u=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return r&&!u})(),jb=typeof globalThis.AbortController=="function",fp=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Rb=typeof globalThis.ReadableStream=="function",Ab=typeof globalThis.FormData=="function",dp=["get","post","put","patch","head","delete"],zb={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},As=2147483647,Ob=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,mp=Symbol("stop");class hp{constructor(u){Ve(this,"options");this.options=u}}const Cb=r=>new hp(r),Db={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Nb={next:!0},Mb={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ub=r=>{if(!r)return 0;if(r instanceof FormData){let u=0;for(const[s,o]of r)u+=Ob,u+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,u+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return u}if(r instanceof Blob)return r.size;if(r instanceof ArrayBuffer)return r.byteLength;if(typeof r=="string")return new TextEncoder().encode(r).length;if(r instanceof URLSearchParams)return new TextEncoder().encode(r.toString()).length;if("byteLength"in r)return r.byteLength;if(typeof r=="object"&&r!==null)try{const u=JSON.stringify(r);return new TextEncoder().encode(u).length}catch{return 0}return 0},pp=(r,u,s)=>{let o,f=0;return r.pipeThrough(new TransformStream({transform(h,p){if(p.enqueue(h),o){f+=o.byteLength;let b=u===0?0:f/u;b>=1&&(b=1-Number.EPSILON),s==null||s({percent:b,totalBytes:Math.max(u,f),transferredBytes:f},o)}o=h},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(u,f),transferredBytes:f},o))}}))},qb=(r,u)=>{if(!r.body)return r;if(r.status===204)return new Response(null,{status:r.status,statusText:r.statusText,headers:r.headers});const s=Math.max(0,Number(r.headers.get("content-length"))||0);return new Response(pp(r.body,s,u),{status:r.status,statusText:r.statusText,headers:r.headers})},Lb=(r,u,s)=>{if(!r.body)return r;const o=Ub(s??r.body);return new Request(r,{duplex:"half",body:pp(r.body,o,u)})},yn=r=>r!==null&&typeof r=="object",Dr=(...r)=>{for(const u of r)if((!yn(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Ws({},...r)},_p=(r={},u={})=>{const s=new globalThis.Headers(r),o=u instanceof globalThis.Headers,f=new globalThis.Headers(u);for(const[h,p]of f.entries())o&&p==="undefined"||p===void 0?s.delete(h):s.set(h,p);return s};function Nr(r,u,s){return Object.hasOwn(u,s)&&u[s]===void 0?[]:Ws(r[s]??[],u[s]??[])}const gp=(r={},u={})=>({beforeRequest:Nr(r,u,"beforeRequest"),beforeRetry:Nr(r,u,"beforeRetry"),afterResponse:Nr(r,u,"afterResponse"),beforeError:Nr(r,u,"beforeError")}),Hb=(r,u)=>{const s=new URLSearchParams;for(const o of[r,u])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,h]of o.entries())s.append(f,h);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(f[0]),String(f[1]))}else if(yn(o))for(const[f,h]of Object.entries(o))h!==void 0&&s.append(f,String(h));else{const f=new URLSearchParams(o);for(const[h,p]of f.entries())s.append(h,p)}return s},Ws=(...r)=>{let u={},s={},o={},f;const h=[];for(const p of r)if(Array.isArray(p))Array.isArray(u)||(u=[]),u=[...u,...p];else if(yn(p)){for(let[b,y]of Object.entries(p)){if(b==="signal"&&y instanceof globalThis.AbortSignal){h.push(y);continue}if(b==="context"){if(y!=null&&(!yn(y)||Array.isArray(y)))throw new TypeError("The `context` option must be an object");u={...u,context:y==null?{}:{...u.context,...y}};continue}if(b==="searchParams"){y==null?f=void 0:f=f===void 0?y:Hb(f,y);continue}yn(y)&&b in u&&(y=Ws(u[b],y)),u={...u,[b]:y}}yn(p.hooks)&&(o=gp(o,p.hooks),u.hooks=o),yn(p.headers)&&(s=_p(s,p.headers),u.headers=s)}return f!==void 0&&(u.searchParams=f),h.length>0&&(h.length===1?u.signal=h[0]:fp?u.signal=AbortSignal.any(h):u.signal=h.at(-1)),u},Bb=r=>dp.includes(r)?r.toUpperCase():r,Yb=["get","put","head","delete","options","trace"],Gb=[408,413,429,500,502,503,504],Vb=[413,429,503],kh={limit:2,methods:Yb,statusCodes:Gb,afterStatusCodes:Vb,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:r=>.3*2**(r-1)*1e3,jitter:void 0,retryOnTimeout:!1},Xb=(r={})=>{if(typeof r=="number")return{...kh,limit:r};if(r.methods&&!Array.isArray(r.methods))throw new Error("retry.methods must be an array");if(r.methods&&(r.methods=r.methods.map(s=>s.toLowerCase())),r.statusCodes&&!Array.isArray(r.statusCodes))throw new Error("retry.statusCodes must be an array");const u=Object.fromEntries(Object.entries(r).filter(([,s])=>s!==void 0));return{...kh,...u}};class Ms extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Ve(this,"request");this.name="TimeoutError",this.request=s}}async function Qb(r,u,s,o){return new Promise((f,h)=>{const p=setTimeout(()=>{s&&s.abort(),h(new Ms(r))},o.timeout);o.fetch(r,u).then(f).catch(h).then(()=>{clearTimeout(p)})})}async function Zb(r,{signal:u}){return new Promise((s,o)=>{u&&(u.throwIfAborted(),u.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(h),o(u.reason)}const h=setTimeout(()=>{u==null||u.removeEventListener("abort",f),s()},r)})}const Kb=(r,u)=>{const s={};for(const o in u)Object.hasOwn(u,o)&&!(o in Mb)&&!(o in Db)&&(!(o in r)||o in Nb)&&(s[o]=u[o]);return s},Jb=r=>r===void 0?!1:Array.isArray(r)?r.length>0:r instanceof URLSearchParams?r.size>0:typeof r=="object"?Object.keys(r).length>0:typeof r=="string"?r.trim().length>0:!!r;function $b(r){return r instanceof Ns||(r==null?void 0:r.name)===Ns.name}function Wb(r){return r instanceof Ms||(r==null?void 0:r.name)===Ms.name}var Kr,yp,Jt,Bt,rt,Q,$a,ea,vn,ue,Yr,vp,Us,Gr,Ja,qs,bp,ii,Vr,Ls;const ri=class ri{constructor(u,s={}){Pt(this,ue);Ve(this,"request");Pt(this,Jt);Pt(this,Bt,0);Pt(this,rt);Pt(this,Q);Pt(this,$a);Pt(this,ea);Pt(this,vn);var f,h,p;if(Kt(this,rt,u),Kt(this,Q,{...s,headers:_p(U(this,rt).headers,s.headers),hooks:gp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Bb(s.method??U(this,rt).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:Xb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof U(this,rt)!="string"&&!(U(this,rt)instanceof URL||U(this,rt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(U(this,Q).prefixUrl&&typeof U(this,rt)=="string"){if(U(this,rt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");U(this,Q).prefixUrl.endsWith("/")||(U(this,Q).prefixUrl+="/"),Kt(this,rt,U(this,Q).prefixUrl+U(this,rt))}jb&&fp&&(Kt(this,ea,U(this,Q).signal??U(this,rt).signal),Kt(this,Jt,new globalThis.AbortController),U(this,Q).signal=U(this,ea)?AbortSignal.any([U(this,ea),U(this,Jt).signal]):U(this,Jt).signal),Sh&&(U(this,Q).duplex="half"),U(this,Q).json!==void 0&&(U(this,Q).body=((h=(f=U(this,Q)).stringifyJson)==null?void 0:h.call(f,U(this,Q).json))??JSON.stringify(U(this,Q).json),U(this,Q).headers.set("content-type",U(this,Q).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(U(this,rt)instanceof globalThis.Request&&(Ab&&U(this,Q).body instanceof globalThis.FormData||U(this,Q).body instanceof URLSearchParams)&&!o&&U(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(U(this,rt),U(this,Q)),Jb(U(this,Q).searchParams)){const y="?"+(typeof U(this,Q).searchParams=="string"?U(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ke(p=ri,Kr,yp).call(p,U(this,Q).searchParams)).toString()),_=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,y);this.request=new globalThis.Request(_,U(this,Q))}if(U(this,Q).onUploadProgress){if(typeof U(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Sh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ke(this,ue,Ls).call(this,this.request,U(this,Q).body??void 0)}}static create(u,s){var p,b,y;const o=new ri(u,s),f=async()=>{var w,k,M,Y,H,q,L,B,G,J,se,ce;if(typeof U(o,Q).timeout=="number"&&U(o,Q).timeout>As)throw new RangeError(`The \`timeout\` option cannot be greater than ${As}`);await Promise.resolve();let _=await ke(w=o,ue,bp).call(w);for(const _e of U(o,Q).hooks.afterResponse){const F=ke(k=o,ue,Us).call(k,_.clone());let W;try{W=await _e(o.request,ke(M=o,ue,ii).call(M),F,{retryCount:U(o,Bt)})}catch(Pe){throw ke(Y=o,ue,Ja).call(Y,F),ke(H=o,ue,Ja).call(H,_),Pe}if(W instanceof hp)throw ke(q=o,ue,Ja).call(q,F),ke(L=o,ue,Ja).call(L,_),new Rs(W.options);const oe=W instanceof globalThis.Response?W:_;F!==oe&&ke(B=o,ue,Ja).call(B,F),_!==oe&&ke(G=o,ue,Ja).call(G,_),_=oe}if(ke(J=o,ue,Us).call(J,_),!_.ok&&(typeof U(o,Q).throwHttpErrors=="function"?U(o,Q).throwHttpErrors(_.status):U(o,Q).throwHttpErrors)){let _e=new Ns(_,o.request,ke(se=o,ue,ii).call(se));for(const F of U(o,Q).hooks.beforeError)_e=await F(_e,{retryCount:U(o,Bt)});throw _e}if(U(o,Q).onDownloadProgress){if(typeof U(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Rb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const _e=_.clone();return ke(ce=o,ue,Ja).call(ce,_),qb(_e,U(o,Q).onDownloadProgress)}return _},h=ke(p=o,ue,qs).call(p,f).finally(()=>{var w,k;const _=U(o,$a);ke(w=o,ue,Gr).call(w,(_==null?void 0:_.body)??void 0),ke(k=o,ue,Gr).call(k,o.request.body??void 0)});for(const[_,w]of Object.entries(zb))_==="bytes"&&typeof((y=(b=globalThis.Response)==null?void 0:b.prototype)==null?void 0:y.bytes)!="function"||(h[_]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||w);const k=await h;if(_==="json"){if(k.status===204)return"";const M=await k.text();return M===""?"":s.parseJson?s.parseJson(M):JSON.parse(M)}return k[_]()});return h}};Kr=new WeakSet,yp=function(u){return u&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof URLSearchParams)?Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0)):u},Jt=new WeakMap,Bt=new WeakMap,rt=new WeakMap,Q=new WeakMap,$a=new WeakMap,ea=new WeakMap,vn=new WeakMap,ue=new WeakSet,Yr=function(){const u=U(this,Q).retry.delay(U(this,Bt));let s=u;U(this,Q).retry.jitter===!0?s=Math.random()*u:typeof U(this,Q).retry.jitter=="function"&&(s=U(this,Q).retry.jitter(u),(!Number.isFinite(s)||s<0)&&(s=u));const o=U(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},vp=async function(u){if(eh(this,Bt)._++,U(this,Bt)>U(this,Q).retry.limit)throw u;const s=u instanceof Error?u:new cp(u);if(s instanceof Rs)return s.customDelay??ke(this,ue,Yr).call(this);if(!U(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw u;if(U(this,Q).retry.shouldRetry!==void 0){const o=await U(this,Q).retry.shouldRetry({error:s,retryCount:U(this,Bt)});if(o===!1)throw u;if(o===!0)return ke(this,ue,Yr).call(this)}if(Wb(u)&&!U(this,Q).retry.retryOnTimeout)throw u;if($b(u)){if(!U(this,Q).retry.statusCodes.includes(u.response.status))throw u;const o=u.response.headers.get("Retry-After")??u.response.headers.get("RateLimit-Reset")??u.response.headers.get("X-RateLimit-Retry-After")??u.response.headers.get("X-RateLimit-Reset")??u.response.headers.get("X-Rate-Limit-Reset");if(o&&U(this,Q).retry.afterStatusCodes.includes(u.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const h=U(this,Q).retry.maxRetryAfter??f;return f<h?f:h}if(u.response.status===413)throw u}return ke(this,ue,Yr).call(this)},Us=function(u){return U(this,Q).parseJson&&(u.json=async()=>U(this,Q).parseJson(await u.text())),u},Gr=function(u){u&&u.cancel().catch(()=>{})},Ja=function(u){ke(this,ue,Gr).call(this,u.body??void 0)},qs=async function(u){try{return await u()}catch(s){const o=Math.min(await ke(this,ue,vp).call(this,s),As);if(U(this,Bt)<1)throw s;if(await Zb(o,U(this,ea)?{signal:U(this,ea)}:{}),s instanceof Rs&&s.customRequest){const f=U(this,Q).signal?new globalThis.Request(s.customRequest,{signal:U(this,Q).signal}):new globalThis.Request(s.customRequest);ke(this,ue,Vr).call(this,f)}for(const f of U(this,Q).hooks.beforeRetry){const h=await f({request:this.request,options:ke(this,ue,ii).call(this),error:s,retryCount:U(this,Bt)});if(h instanceof globalThis.Request){ke(this,ue,Vr).call(this,h);break}if(h instanceof globalThis.Response)return h;if(h===mp)return}return ke(this,ue,qs).call(this,u)}},bp=async function(){var s;(s=U(this,Jt))!=null&&s.signal.aborted&&(Kt(this,Jt,new globalThis.AbortController),U(this,Q).signal=U(this,ea)?AbortSignal.any([U(this,ea),U(this,Jt).signal]):U(this,Jt).signal,this.request=new globalThis.Request(this.request,{signal:U(this,Q).signal}));for(const o of U(this,Q).hooks.beforeRequest){const f=await o(this.request,ke(this,ue,ii).call(this),{retryCount:U(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ke(this,ue,Vr).call(this,f);break}}const u=Kb(this.request,U(this,Q));return Kt(this,$a,this.request),this.request=U(this,$a).clone(),U(this,Q).timeout===!1?U(this,Q).fetch(U(this,$a),u):Qb(U(this,$a),u,U(this,Jt),U(this,Q))},ii=function(){if(!U(this,vn)){const{hooks:u,...s}=U(this,Q);Kt(this,vn,Object.freeze(s))}return U(this,vn)},Vr=function(u){Kt(this,vn,void 0),this.request=ke(this,ue,Ls).call(this,u)},Ls=function(u,s){return!U(this,Q).onUploadProgress||!u.body?u:Lb(u,U(this,Q).onUploadProgress,s??U(this,Q).body??void 0)},Pt(ri,Kr);let Zr=ri;/*! MIT License © Sindre Sorhus */const Hs=r=>{const u=(s,o)=>Zr.create(s,Dr(r,o));for(const s of dp)u[s]=(o,f)=>Zr.create(o,Dr(r,f,{method:s}));return u.create=s=>Hs(Dr(s)),u.extend=s=>(typeof s=="function"&&(s=s(r??{})),Hs(Dr(r,s))),u.stop=mp,u.retry=Cb,u},Eh=Hs();let Mr=null;const Xr=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[r=>{const u=xa.getState().accessToken;u&&r.headers.set("Authorization",`Bearer ${u}`)}],afterResponse:[async(r,u,s)=>{if(s.status===401&&!r.headers.has("X-Retry-After-Refresh")){Mr||(Mr=xa.getState().refresh().finally(()=>{Mr=null}));try{await Mr}catch{throw s}const o=xa.getState().accessToken;return o&&r.headers.set("Authorization",`Bearer ${o}`),r.headers.set("X-Retry-After-Refresh","1"),Eh(r,u)}}]}}),Fb=3e4;function Ib(r){if(r.link)return r.link;const u=(r.title+" "+r.body).match(/task\s*#?(\d+)/i);if(u)return`/tasks/${u[1]}`;const s=(r.title+" "+r.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function xp(){const r=Fa(),[u,s]=g.useState([]),[o,f]=g.useState(0),[h,p]=g.useState(!1),[b,y]=g.useState(!1),_=g.useRef(null),{t:w}=Vt(),k=g.useRef(async()=>{try{y(!0);const q=(await Xr.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,L=q.filter(B=>!B.isRead).length;s(B=>B.length===q.length&&B.every((G,J)=>G.id===q[J].id&&G.isRead===q[J].isRead)?B:q),f(B=>B===L?B:L)}catch{}finally{y(!1)}});g.useEffect(()=>{k.current();const H=setInterval(()=>k.current(),Fb);return()=>clearInterval(H)},[]),g.useEffect(()=>{function H(q){_.current&&!_.current.contains(q.target)&&p(!1)}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);async function M(H){try{await Xr.post(`web/notifications/${H}/read`),s(q=>q.map(L=>L.id===H?{...L,isRead:!0}:L)),f(q=>Math.max(0,q-1))}catch{}}async function Y(){try{await Xr.post("web/notifications/read-all"),s(H=>H.map(q=>({...q,isRead:!0}))),f(0)}catch{}}return m.jsxs("div",{className:"relative",ref:_,children:[m.jsxs("button",{type:"button",onClick:()=>p(H=>!H),"aria-label":w("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[m.jsx(Zv,{size:16}),o>0&&m.jsx("span",{className:"absolute right-0 top-0 flex h-3 min-w-3 items-center justify-center rounded-full bg-[var(--destructive)] px-0.5 text-[8px] font-semibold leading-none text-white",children:o})]}),h&&m.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-[min(320px,calc(100vw-2rem))] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[m.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[m.jsx("span",{className:"text-sm font-semibold",children:w("common.notifications")}),o>0&&m.jsxs("button",{type:"button",onClick:Y,"aria-label":w("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[m.jsx(Kv,{className:"h-3.5 w-3.5"}),w("common.mark_all_read")]})]}),m.jsx("div",{className:"max-h-80 overflow-y-auto",children:b&&u.length===0?m.jsx("div",{className:"flex justify-center py-8",children:m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):u.length===0?m.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[m.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),m.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:w("common.no_notifications")})]}):u.map(H=>{const q=Ib(H);return m.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${q?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${H.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{q&&(H.isRead||M(H.id),p(!1),r(q))},children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:"text-sm font-medium",children:H.title}),m.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:H.body}),m.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(H.createdAt).toLocaleString()})]}),!H.isRead&&m.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),M(H.id)},"aria-label":w("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:m.jsx(Jv,{className:"h-3.5 w-3.5"})})]},H.id)})})]})]})}function Pb(r){return{tasks:r.tasks.map(u=>({type:"task",id:u.id,title:`#${u.id} ${u.description}`,subtitle:`${u.status} · ${u.project_key}`})),workers:(r.workers??[]).map(u=>({type:"worker",id:u.id,title:u.name,subtitle:`${u.hostname} · ${u.status}`})),projects:r.projects.map(u=>({type:"project",id:u.key,title:u.name,subtitle:u.repository}))}}const e0=300,wh={tasks:db,workers:ap,projects:eb},t0={tasks:"tasks",workers:"workers",projects:"projects"};function Sp({renderTrigger:r}={}){const[u,s]=g.useState(""),[o,f]=g.useState({tasks:[],workers:[],projects:[]}),[h,p]=g.useState(!1),[b,y]=g.useState(!1),[_,w]=g.useState(0),k=g.useRef(null),M=g.useRef(null),Y=g.useRef(void 0),H=g.useRef(void 0),q=Fa(),{t:L}=Vt(),B=g.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),G=g.useCallback(async W=>{var Pe;if(!W.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=H.current)==null||Pe.abort();const oe=new AbortController;H.current=oe;try{p(!0);const Je=await Xr.get("web/search",{searchParams:{q:W},signal:oe.signal}).json();f(Pb(Je)),w(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{oe.signal.aborted||p(!1)}},[]);g.useEffect(()=>(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>G(u),e0),()=>{Y.current&&clearTimeout(Y.current)}),[u,G]),g.useEffect(()=>{function W(oe){oe.key==="/"&&!b&&!(oe.target instanceof HTMLInputElement||oe.target instanceof HTMLTextAreaElement)&&(oe.preventDefault(),y(!0)),oe.key==="Escape"&&b&&(oe.preventDefault(),J())}return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[b]),g.useEffect(()=>{b&&setTimeout(()=>{var W;return(W=M.current)==null?void 0:W.focus()},50)},[b]);function J(){y(!1),s(""),f({tasks:[],workers:[],projects:[]}),w(0)}function se(W){switch(J(),W.type){case"task":q(`/tasks/${W.id}`);break;case"worker":q(`/workers/${W.id}`);break;case"project":q(`/projects/${W.id}`);break}}function ce(W){W.key==="ArrowDown"?(W.preventDefault(),w(oe=>Math.min(oe+1,B.length-1))):W.key==="ArrowUp"?(W.preventDefault(),w(oe=>Math.max(oe-1,0))):W.key==="Enter"&&B[_]&&(W.preventDefault(),se(B[_]))}const _e=B.length>0;let F=0;return m.jsxs(m.Fragment,{children:[r?r(()=>y(!0)):m.jsxs("button",{type:"button",onClick:()=>y(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[m.jsx(tp,{className:"h-3.5 w-3.5"}),m.jsx("span",{children:L("common.search_placeholder")}),m.jsx("kbd",{className:"ml-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:"/"})]}),b&&m.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[calc(var(--safe-area-top,0px)+16px)] md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:W=>{W.target===k.current&&J()},children:m.jsxs("div",{className:"mx-3 w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl sm:mx-4 md:mx-0",children:[m.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[m.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),m.jsx("input",{ref:M,type:"text",placeholder:L("common.search_input_placeholder"),value:u,onChange:W=>s(W.target.value),onKeyDown:ce,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),h&&m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),m.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:u.trim()&&!_e&&!h?m.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:L("common.no_search_results",{query:u})}):Object.keys(wh).map(W=>{const oe=o[W];if(oe.length===0)return null;const Pe=wh[W],Je=F;return F+=oe.length,m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[m.jsx(Pe,{className:"h-3 w-3"}),m.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:t0[W]})]}),oe.map((qe,At)=>{const ut=Je+At,Ne=ut===_;return m.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${Ne?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>se(qe),onMouseEnter:()=>w(ut),children:[m.jsx("span",{className:`text-xs ${Ne?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:Ne?">":" "}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:"truncate text-sm",children:qe.title}),qe.subtitle&&m.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",children:qe.subtitle})]})]},`${qe.type}-${qe.id}`)})]},W)})}),m.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",L("common.navigate_hint")]}),m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",L("common.select_hint")]}),m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",L("common.close_hint")]})]})]})})]})}const a0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"},Th="confirm-dialog-title";function jh(r){return Array.from(r.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function n0({isOpen:r,onClose:u,onConfirm:s,title:o,message:f,confirmVariant:h="danger",isLoading:p,...b}){const{t:y}=Vt(),_=b.confirmLabel??y("common.confirm"),w=b.cancelLabel??y("common.cancel"),k=g.useRef(null),M=g.useRef(null),Y=a0[h];g.useEffect(()=>{if(!r)return;M.current=document.activeElement;const q=requestAnimationFrame(()=>{if(k.current){const L=jh(k.current);L.length>0&&L[0].focus()}});return()=>{var L;cancelAnimationFrame(q),(L=M.current)==null||L.focus()}},[r]);const H=g.useCallback(q=>{if(q.key==="Tab"&&k.current){const L=jh(k.current);if(L.length===0)return;const B=L[0],G=L[L.length-1];q.shiftKey?document.activeElement===B&&(q.preventDefault(),G.focus()):document.activeElement===G&&(q.preventDefault(),B.focus())}},[]);return r?m.jsx("div",{onClick:u,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"max(1rem, 10vh)",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:m.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-labelledby":Th,onClick:q=>q.stopPropagation(),onKeyDown:H,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[m.jsx("div",{style:{marginBottom:"1.25rem"},children:m.jsxs("div",{id:Th,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[m.jsx(np,{style:{width:"1rem",height:"1rem"}}),o]})}),m.jsx("div",{style:{marginBottom:"1.25rem"},children:m.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f})}),m.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[m.jsx("button",{type:"button",onClick:u,disabled:p,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",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,transition:"color 0.15s, border-color 0.15s"},children:w}),m.jsx("button",{type:"button",onClick:s,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:Y,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:p?"not-allowed":"pointer",opacity:p?.7:1},children:p?y("common.processing"):_})]})]})}):null}const Rh="overlord-pwa-install-dismissed";function l0(){const r=navigator.userAgent;return/iP(hone|od|ad)/.test(r)&&/WebKit/.test(r)&&!/(CriOS|FxiOS|OPiOS|mercury)/.test(r)}function i0(){return navigator.standalone===!0||window.matchMedia("(display-mode: standalone)").matches}function r0(){const{t:r}=Vt(),[u,s]=g.useState("hidden"),[o,f]=g.useState(!1),h=g.useRef(null),p=g.useRef(void 0);g.useEffect(()=>{if(i0()||localStorage.getItem(Rh)||window.innerWidth>=768)return;const _=k=>{k.preventDefault(),h.current=k};window.addEventListener("beforeinstallprompt",_);const w=setTimeout(()=>s("visible"),1e3);return()=>{window.removeEventListener("beforeinstallprompt",_),clearTimeout(w),clearTimeout(p.current)}},[]);function b(){localStorage.setItem(Rh,"1"),s("dismissing"),p.current=setTimeout(()=>s("hidden"),200)}async function y(){if(h.current){await h.current.prompt();const{outcome:_}=await h.current.userChoice;_==="accepted"&&b(),h.current=null}else l0()&&f(!0)}return u==="hidden"?null:m.jsx("div",{className:`fixed bottom-4 left-4 right-4 z-40 md:hidden ${u==="dismissing"?"animate-slide-down":"animate-slide-up"}`,role:"dialog","aria-label":r("pwa_install.title"),children:m.jsxs("div",{className:"overflow-hidden rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[m.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--accent)]/20 bg-[var(--accent)]/[0.06] px-3 py-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-[var(--accent)]"}),m.jsx("span",{className:"text-[9px] font-medium text-[var(--accent)]",children:r("pwa_install.title")})]}),m.jsx("button",{onClick:b,className:"p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:m.jsx(lp,{size:14})})]}),m.jsx("div",{className:"px-3.5 py-3",children:o?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[m.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",r("pwa_install.ios_command")]}),m.jsx("div",{className:"mt-2.5 flex flex-col gap-2.5",children:[r("pwa_install.ios_step_1"),r("pwa_install.ios_step_2"),r("pwa_install.ios_step_3")].map((_,w)=>m.jsxs("div",{className:"flex items-center gap-2.5",children:[m.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] bg-[var(--accent)]/[0.08]",children:m.jsx("span",{className:"text-xs font-semibold text-[var(--accent)]",children:w+1})}),m.jsxs("span",{className:"text-[10px] leading-snug text-[var(--text-secondary)]",children:[w===0&&m.jsx(sb,{size:12,className:"mr-1 inline-block align-text-bottom text-[var(--text-muted)]"}),_]})]},w))})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[m.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",r("pwa_install.command")]}),m.jsxs("div",{className:"mt-1.5 text-[10px] leading-relaxed text-[var(--text-secondary)]",children:["→ ",r("pwa_install.desc_1"),m.jsx("br",{}),"→ ",r("pwa_install.desc_2")]}),m.jsxs("div",{className:"mt-2.5 flex gap-2",children:[m.jsx("button",{onClick:y,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:r("pwa_install.install")}),m.jsx("button",{onClick:b,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[10px] text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:r("pwa_install.skip")})]})]})})]})})}function u0(){const{t:r}=Vt(),[u,s]=g.useState(!1);return g.useEffect(()=>{if(!("serviceWorker"in navigator))return;let o=!1;function f(){o||s(!0)}navigator.serviceWorker.addEventListener("controllerchange",f);function h(b){if(b.waiting){s(!0);return}b.addEventListener("updatefound",()=>{const y=b.installing;y&&y.addEventListener("statechange",()=>{y.state==="installed"&&navigator.serviceWorker.controller&&(o||s(!0))})})}navigator.serviceWorker.getRegistration().then(b=>{b&&!o&&h(b)});const p=setInterval(()=>{navigator.serviceWorker.getRegistration().then(b=>{!b||o||(b.update().catch(()=>{}),b.waiting&&s(!0))})},3e4);return()=>{o=!0,clearInterval(p),navigator.serviceWorker.removeEventListener("controllerchange",f)}},[]),u?m.jsx("div",{className:"animate-slide-up fixed bottom-20 left-4 right-4 z-50 md:bottom-4 md:left-auto md:right-4 md:w-80",children:m.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] px-3.5 py-3 shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[m.jsx(ep,{size:14,className:"shrink-0 text-[var(--accent)]"}),m.jsx("span",{className:"flex-1 text-[10px] text-[var(--text-secondary)]",children:r("pwa_update.message")}),m.jsx("button",{onClick:()=>window.location.reload(),className:"shrink-0 rounded-[4px] bg-[var(--accent)] px-3 py-1 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:r("pwa_update.reload")})]})}):null}const Ur=64,o0=96,Ah=32;function s0({children:r,className:u}){const s=g.useRef(null),o=g.useRef(0),f=g.useRef(0),h=g.useRef("idle"),[p,b]=g.useState(0),[y,_]=g.useState("idle"),w=g.useCallback(G=>{h.current=G,_(G)},[]),k=g.useCallback(()=>{const G=s.current;return G?G.scrollTop<=0:!0},[]),M=g.useCallback(G=>{k()&&(o.current=G.touches[0].clientY,f.current=G.touches[0].clientY)},[k]),Y=g.useCallback(G=>{if(h.current==="refreshing"||o.current===0)return;const J=G.touches[0].clientY,se=J-o.current;if(se<=0){h.current!=="idle"&&(b(0),w("idle"));return}if(!k())return;G.preventDefault();const ce=Math.min(se*.5,o0);f.current=J,b(ce),w(ce>=Ur?"ready":"pulling")},[k,w]),H=g.useCallback(()=>{h.current!=="refreshing"&&(h.current==="ready"?(w("refreshing"),b(Ur),setTimeout(()=>{window.location.reload()},300)):(b(0),w("idle")),o.current=0)},[w]);g.useEffect(()=>{const G=s.current;if(G)return G.addEventListener("touchstart",M,{passive:!0}),G.addEventListener("touchmove",Y,{passive:!1}),G.addEventListener("touchend",H,{passive:!0}),()=>{G.removeEventListener("touchstart",M),G.removeEventListener("touchmove",Y),G.removeEventListener("touchend",H)}},[M,Y,H]);const q=Math.min(p/Ur,1),L=y==="refreshing"?0:p/Ur*180,B=p>0||y==="refreshing";return m.jsxs("div",{ref:s,className:u,style:{overscrollBehaviorY:"contain"},children:[B&&m.jsx("div",{className:"pointer-events-none flex items-center justify-center md:hidden",style:{height:p,transition:y==="idle"?"height 200ms ease-out":void 0},children:m.jsx("div",{className:"flex items-center justify-center rounded-full bg-[var(--bg-card)] border border-[var(--border)]",style:{width:Ah,height:Ah,opacity:q,transition:y==="idle"?"opacity 200ms ease-out":void 0},children:y==="refreshing"?m.jsxs("svg",{width:16,height:16,viewBox:"0 0 16 16",className:"animate-spin",style:{color:"var(--accent)"},children:[m.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),m.jsx("path",{d:"M8 2a6 6 0 0 1 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}):m.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",style:{color:y==="ready"?"var(--accent)":"var(--text-muted)",transform:`rotate(${L}deg)`,transition:"color 150ms"},children:m.jsx("path",{d:"M8 3v8M5 8l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),r]})}const kp=g.createContext({setActions:()=>{}});function N1(r){const{setActions:u}=g.useContext(kp);g.useEffect(()=>(u(r),()=>u(null)),[r,u])}const Ep=g.createContext({setSubtitle:()=>{}});function M1(r){const{setSubtitle:u}=g.useContext(Ep);g.useEffect(()=>(u(r),()=>u(null)),[r,u])}const c0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih},{to:"/workers",label:"workers",icon:ap},{to:"/projects",label:"projects",icon:tb},{to:"/access-tokens",label:"tokens",icon:nb}],f0=[{to:"/docs/cli",label:"cli",icon:$s},{to:"/docs/api",label:"api",icon:Pv},{to:"/docs/bot",label:"bot",icon:ub},{to:"/docs/skill",label:"skill",icon:fb},{to:"/docs/all",label:"all",icon:lb}],d0=[{to:"/admin",label:"admin",icon:cb}],m0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih}],qr={"/home":{title:"common.breadcrumb_terminal",subtitle:"common.breadcrumb_terminal_sub"},"/dashboard":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/workers":{title:"common.breadcrumb_workers",subtitle:"common.breadcrumb_workers_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_tokens",subtitle:"common.breadcrumb_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"},"/docs/bot":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_bot_sub"},"/docs/all":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_all_sub"}};function h0(r){const{t:u}=Vt();if(qr[r]){const o=qr[r];return{title:u(o.title),subtitle:u(o.subtitle)}}const s="/"+r.split("/").filter(Boolean)[0];if(qr[s]){const o=qr[s],f=r.split("/").filter(Boolean).slice(1).join(" / ");return{title:u(o.title),subtitle:f||u(o.subtitle)}}return{title:r.slice(1).replace(/\//g," // ")||"home"}}function p0(r,u){return r==="/home"?u==="/home":r==="/dashboard"?u==="/dashboard":u.startsWith(r)}function _0(){const r=gt(),{t:u}=Vt(),s={terminal:u("terminal_home.title"),dashboard:u("dashboard.title"),tasks:u("tasks.title"),workers:u("workers.title")};return m.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)]",style:{height:48,paddingTop:4},children:[m0.map(({to:o,label:f,icon:h})=>{const p=p0(o,r.pathname);return m.jsxs(Js,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[m.jsx(h,{size:18,className:p?"text-[var(--accent)]":"text-[var(--text-muted)]"}),m.jsx("span",{className:`text-[11px] lowercase ${p?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),m.jsx(Sp,{renderTrigger:o=>m.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[m.jsx(tp,{size:18,className:"text-[var(--text-muted)]"}),m.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:u("common.search_placeholder")})]})})]})}function g0(){const r=Fa(),{t:u}=Vt();return m.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:"calc(56px + env(safe-area-inset-top, 0px))",minHeight:"calc(56px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[m.jsxs("button",{onClick:()=>r("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[m.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:m.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),m.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:u("common.overlord")})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{onClick:()=>r("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":u("common.profile"),children:m.jsx(hb,{size:18})}),m.jsx(xp,{}),m.jsx(sp,{})]})]})}function zs({label:r,items:u,collapsed:s}){return m.jsxs("div",{className:"mt-4 first:mt-0",children:[!s&&m.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:r}),u.map(({to:o,label:f,icon:h})=>m.jsx(Js,{to:o,className:({isActive:p})=>`flex items-center text-sm lowercase transition-colors ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${p?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:p})=>m.jsxs(m.Fragment,{children:[m.jsx(h,{size:14,style:{flexShrink:0}}),!s&&m.jsx("span",{children:p?`> ${f}`:` ${f}`})]})},o))]})}function y0(){const{user:r,logout:u}=xa(),s=Fa(),[o,f]=g.useState(!1),h=yb(),{t:p}=Vt(),{sidebarCollapsed:b,toggleSidebar:y}=bb();function _(){u(),s("/login")}return m.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:b?56:240,minWidth:b?56:240,backgroundColor:"var(--bg-card)"},children:[m.jsx("div",{className:"flex items-center px-5",style:{height:48},children:m.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[m.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:m.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!b&&m.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:p("common.overlord")})]})}),m.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[m.jsx(zs,{label:p("common.navigation"),items:c0,collapsed:b}),m.jsx(zs,{label:p("common.docs_section"),items:f0,collapsed:b}),h&&m.jsx(zs,{label:p("common.admin_section"),items:d0,collapsed:b})]}),m.jsx("div",{className:`px-3 py-1 ${b?"flex justify-center":""}`,children:m.jsx("button",{onClick:y,className:"flex items-center justify-center w-full py-1.5 rounded-[4px] text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)] hover:bg-[var(--accent)]/5","aria-label":b?"expand sidebar":"collapse sidebar",children:b?m.jsx(Wv,{size:14}):m.jsx($v,{size:14})})}),m.jsx("div",{className:"border-t border-[var(--border)] p-3",children:m.jsxs("div",{className:`flex items-center py-2 ${b?"justify-center":"gap-3 px-3"}`,children:[m.jsx("button",{onClick:()=>s("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:p("common.profile"),children:((r==null?void 0:r.username)??"u")[0].toUpperCase()}),!b&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:p("common.profile"),children:[m.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(r==null?void 0:r.username)??"user"}),m.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(r==null?void 0:r.role)??"user"})]}),m.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":p("common.log_out"),children:m.jsx(rb,{size:14})})]})]})}),m.jsx(n0,{isOpen:o,onClose:()=>f(!1),onConfirm:_,title:p("common.logout_title"),message:p("common.logout_message"),confirmLabel:p("common.logout"),confirmVariant:"warning"})]})}function v0({headerActions:r,subtitleOverride:u}){const s=gt(),{title:o,subtitle:f}=h0(s.pathname),h=u??f;return m.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[m.jsxs("div",{className:"text-sm lowercase",children:[m.jsx("span",{style:{color:"var(--text-primary)"},children:o}),h&&m.jsxs("span",{style:{color:"var(--text-muted)"},children:[" ","// ",h]})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[r,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(Sp,{}),m.jsx(xp,{}),m.jsx(sp,{})]})]})]})}function b0(){const[r,u]=g.useState(null),[s,o]=g.useState(null),f=gt(),h=f.pathname==="/home",p=f.pathname.startsWith("/docs");return g.useEffect(()=>Sb.getState().init(),[]),m.jsxs("div",{className:"fixed inset-x-0 top-0 flex w-full overflow-hidden font-mono md:flex-row",style:{height:"var(--app-height, 100dvh)",minHeight:"var(--app-height, 100dvh)"},children:[m.jsx(y0,{}),m.jsxs("div",{"data-testid":"app-main-column",className:"flex min-h-0 flex-1 flex-col overflow-hidden pb-[calc(48px+var(--safe-area-bottom,0px))] md:pb-0",children:[m.jsx(g0,{}),!p&&m.jsx(v0,{headerActions:r,subtitleOverride:s}),m.jsx(s0,{className:h?"min-h-0 flex-1 overflow-hidden bg-[var(--bg-primary)]":"min-h-0 flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-6 md:p-6 md:pb-6",children:m.jsx(kp.Provider,{value:{setActions:u},children:m.jsx(Ep.Provider,{value:{setSubtitle:o},children:m.jsx(uv,{})})})}),m.jsx(r0,{}),m.jsx(u0,{}),m.jsx("div",{className:"safe-area-bottom-fill fixed inset-x-0 bottom-0 z-30 bg-[var(--bg-card)] md:hidden",children:m.jsx(_0,{})})]})]})}function zh(r){var s;const u=(s=r.state)==null?void 0:s.from;return u?{from:u}:{from:{pathname:r.pathname,search:r.search}}}function li({children:r,requireAdmin:u=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:h}=xa(),p=gt();if(h)return m.jsx("div",{className:"flex h-screen items-center justify-center",children:m.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return m.jsx(ll,{to:"/login",state:zh(p),replace:!0});if(f){const b=zh(p);return p.pathname!=="/totp-setup"&&p.pathname!=="/bind"?m.jsx(ll,{to:"/totp-setup",state:b,replace:!0}):p.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(b.from)),m.jsx(ll,{to:"/totp-setup",state:b,replace:!0})):m.jsx(m.Fragment,{children:r})}return u&&(o==null?void 0:o.role)!==ip.ADMIN?m.jsx(ll,{to:"/home",replace:!0}):m.jsx(m.Fragment,{children:r})}function x0({children:r}){const{theme:u,resolved:s,setResolved:o}=op();return g.useEffect(()=>{if(u!=="system"){o(u);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const h=p=>o(p.matches?"dark":"light");return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[u,o]),g.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),m.jsx(m.Fragment,{children:r})}class S0 extends g.Component{constructor(u){super(u),this.state={hasError:!1,error:null}}static getDerivedStateFromError(u){return{hasError:!0,error:u}}render(){var u;return this.state.hasError?m.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[m.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Br("common.runtime_error")}),m.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((u=this.state.error)==null?void 0:u.message)||Br("common.an_unexpected_error_occurred")}),m.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[m.jsx(ep,{className:"h-3.5 w-3.5"}),Br("common.reload")]})]}):this.props.children}}function k0({isOpen:r}){const u=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=Vt();function h(){s(),o(!1),u("/login")}return r?m.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[m.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),m.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:m.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[m.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:m.jsx(ib,{className:"h-7 w-7 text-[var(--warning)]"})}),m.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),m.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),m.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:h,children:f("auth.go_to_login")})]})})]}):null}const Oh=5;let ba=[];const Bs=new Set;function wp(){Bs.forEach(r=>r())}function E0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(r,u,s=4e3){const o=E0();return ba=[...ba,{id:o,variant:r,message:u,duration:s}],ba.length>Oh&&(ba=ba.slice(ba.length-Oh)),wp(),o}Wa.success=(r,u)=>Wa("success",r,u);Wa.error=(r,u)=>Wa("error",r,u);Wa.warning=(r,u)=>Wa("warning",r,u);Wa.info=(r,u)=>Wa("info",r,u);function w0(r){ba=ba.filter(u=>u.id!==r),wp()}function T0(){const[,r]=g.useState(0);return g.useEffect(()=>{const u=()=>r(s=>s+1);return Bs.add(u),()=>{Bs.delete(u)}},[]),ba}const j0={success:{icon:Fv,borderColor:"var(--accent)"},error:{icon:Iv,borderColor:"var(--destructive)"},warning:{icon:np,borderColor:"var(--warning)"},info:{icon:ab,borderColor:"var(--info)"}};function R0({item:r}){const u=j0[r.variant],s=u.icon,{t:o}=Vt(),f=g.useCallback(()=>w0(r.id),[r.id]);return g.useEffect(()=>{if(!r.duration)return;const h=setTimeout(f,r.duration);return()=>clearTimeout(h)},[r.duration,f]),m.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${u.borderColor}`},role:"alert",children:[m.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:u.borderColor}}),m.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:r.message}),m.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:m.jsx(lp,{className:"h-3.5 w-3.5"})})]})}function A0(){const r=T0();return r.length===0?null:m.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:r.map(u=>m.jsx("div",{className:"pointer-events-auto",children:m.jsx(R0,{item:u})},u.id))})}const z0=g.lazy(()=>ne(()=>import("./LandingPage-JAVdoyx8.js"),__vite__mapDeps([0,1,2,3,4,5]))),O0=g.lazy(()=>ne(()=>import("./LoginPage-CgeicODU.js"),[])),C0=g.lazy(()=>ne(()=>import("./TotpSetupPage-Dg294iM7.js"),[])),D0=g.lazy(()=>ne(()=>import("./NotFoundPage-DOd4f9i6.js"),[])),N0=g.lazy(()=>ne(()=>import("./HomePage-G4Ps95Ct.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),M0=g.lazy(()=>ne(()=>import("./TerminalHomePage-B98Srq3u.js"),__vite__mapDeps([15,16,17,18,10,11,19,8,12,14,20,21,22]))),U0=g.lazy(()=>ne(()=>import("./TaskListPage-BefLQS7l.js"),__vite__mapDeps([23,16,7,8,12,13,19,5,24,9,20]))),q0=g.lazy(()=>ne(()=>import("./TaskDetailPage-D9NCpc4q.js"),__vite__mapDeps([25,16,17,18,12,19,8,26,21,27,28]))),L0=g.lazy(()=>ne(()=>import("./WorkerListPage-CT4D8nJJ.js"),__vite__mapDeps([29,8,30,31,32,33,34,22,5,28,19,24,9,14,20]))),H0=g.lazy(()=>ne(()=>import("./WorkerDetailPage-B-WHlPNN.js"),__vite__mapDeps([35,12,8,36,30,14,37,26]))),B0=g.lazy(()=>ne(()=>import("./WorkerSetupGuidePage-B2_w9huT.js"),__vite__mapDeps([31,32,33,34,22]))),Y0=g.lazy(()=>ne(()=>import("./ProjectListPage-CCH8vc8a.js"),__vite__mapDeps([38,19,24,9,12,14,20]))),G0=g.lazy(()=>ne(()=>import("./ProjectDetailPage-BnVFOUrR.js"),__vite__mapDeps([39,40,19,12,8,36,14,41,37,20]))),V0=g.lazy(()=>ne(()=>import("./EditProjectPage-DpDa9_IE.js"),__vite__mapDeps([42,19,40,20]))),X0=g.lazy(()=>ne(()=>import("./PipelineEditorPage--hPt9dkd.js"),__vite__mapDeps([43,19,13]))),Q0=g.lazy(()=>ne(()=>import("./ProfilePage-CX3ccSje.js"),__vite__mapDeps([44,45,36,14]))),Z0=g.lazy(()=>ne(()=>import("./BindPlatformPage-C_Ksgwwa.js"),[])),K0=g.lazy(()=>ne(()=>import("./AccessTokensPage-D1UA8WwD.js"),__vite__mapDeps([46,19,24,9,12,14,20,5,37]))),J0=g.lazy(()=>ne(()=>import("./CliReferencePage-DU2fjiUE.js"),__vite__mapDeps([47,48,5,20]))),$0=g.lazy(()=>ne(()=>import("./ApiReferencePage-B8T47k7e.js"),__vite__mapDeps([49,48,5,20]))),W0=g.lazy(()=>ne(()=>import("./SkillPage-sQoDAszL.js"),__vite__mapDeps([50,51,5,27]))),F0=g.lazy(()=>ne(()=>import("./DocsLayout-BAJM4ClE.js"),__vite__mapDeps([52,26]))),I0=g.lazy(()=>ne(()=>import("./InstallationPage-eYlU9yX-.js"),__vite__mapDeps([53,51,5]))),P0=g.lazy(()=>ne(()=>import("./DeveloperSetupPage-Dv72Bl6n.js"),__vite__mapDeps([54,51,5]))),e1=g.lazy(()=>ne(()=>import("./WorkerSetupPage-4YF10ee7.js"),__vite__mapDeps([55,51,5]))),t1=g.lazy(()=>ne(()=>import("./BotSetupPage-AsIfBCJ_.js"),__vite__mapDeps([56,51,5]))),a1=g.lazy(()=>ne(()=>import("./LocalDevelopmentPage-B9V7vq2L.js"),__vite__mapDeps([57,51,5]))),n1=g.lazy(()=>ne(()=>import("./WorkerOperationsPage-CYgcirPe.js"),[])),l1=g.lazy(()=>ne(()=>import("./DeploymentPage-DXAAXZ0o.js"),__vite__mapDeps([58,51,5]))),Ch=g.lazy(()=>ne(()=>import("./BotIntegrationPage-AmhFuRqL.js"),[])),i1=g.lazy(()=>ne(()=>import("./PipelineConfigPage-DP4pgiU9.js"),__vite__mapDeps([59,51,5]))),r1=g.lazy(()=>ne(()=>import("./DevWorkflowPage-BPtySJfp.js"),__vite__mapDeps([60,51,5]))),u1=g.lazy(()=>ne(()=>import("./PermissionsPage-CAVOvSdc.js"),[])),o1=g.lazy(()=>ne(()=>import("./EnvVariablesPage-CTKKeZCG.js"),[])),s1=g.lazy(()=>ne(()=>import("./ArchitecturePage-SMQtJF5K.js"),__vite__mapDeps([61,51,5]))),c1=g.lazy(()=>ne(()=>import("./ChangelogPage-02X-jebe.js"),[])),f1=g.lazy(()=>ne(()=>import("./DocsIndexPage-B-4AcFGv.js"),__vite__mapDeps([62,33,2,3,34]))),d1=g.lazy(()=>ne(()=>import("./AdminPage-BiQv-DBz.js"),__vite__mapDeps([63,4,2,64,34]))),m1=g.lazy(()=>ne(()=>import("./DeveloperManage-C7ndCnpl.js"),__vite__mapDeps([65,19,45,24,9,14,8,20,4,41,21]))),h1=g.lazy(()=>ne(()=>import("./BotManage-BLG4cJJD.js"),__vite__mapDeps([66,19,51,5,37,20,24,9,14,8,2,41]))),p1=g.lazy(()=>ne(()=>import("./TokenManage-BX9WomWe.js"),__vite__mapDeps([67,32,5,27,24,9,14,8,20]))),_1=g.lazy(()=>ne(()=>import("./AuditLogPage-DQLZJtz9.js"),__vite__mapDeps([68,19,24,9,64,11]))),g1=g.lazy(()=>ne(()=>import("./SettingsPage-DS9j5JYv.js"),[]));function y1(){return m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function v1(){const r=xa(u=>u.sessionExpired);return m.jsxs(x0,{children:[m.jsx(A0,{}),m.jsx(S0,{children:m.jsxs(Nv,{children:[m.jsx(k0,{isOpen:r}),m.jsx(g.Suspense,{fallback:m.jsx(y1,{}),children:m.jsxs(sv,{children:[m.jsx(te,{path:"/",element:m.jsx(z0,{})}),m.jsx(te,{path:"/login",element:m.jsx(O0,{})}),m.jsx(te,{path:"/totp-setup",element:m.jsx(li,{children:m.jsx(C0,{})})}),m.jsx(te,{path:"/bind",element:m.jsx(li,{children:m.jsx(Z0,{})})}),m.jsxs(te,{element:m.jsx(li,{children:m.jsx(b0,{})}),children:[m.jsx(te,{path:"/home",element:m.jsx(M0,{})}),m.jsx(te,{path:"/dashboard",element:m.jsx(N0,{})}),m.jsx(te,{path:"/tasks",element:m.jsx(U0,{})}),m.jsx(te,{path:"/tasks/:id",element:m.jsx(q0,{})}),m.jsx(te,{path:"/workers",element:m.jsx(L0,{})}),m.jsx(te,{path:"/workers/setup",element:m.jsx(li,{requireAdmin:!0,children:m.jsx(B0,{})})}),m.jsx(te,{path:"/workers/:id",element:m.jsx(H0,{})}),m.jsx(te,{path:"/projects",element:m.jsx(Y0,{})}),m.jsx(te,{path:"/projects/:key",element:m.jsx(G0,{})}),m.jsx(te,{path:"/projects/:key/edit",element:m.jsx(V0,{})}),m.jsx(te,{path:"/projects/:key/pipeline",element:m.jsx(X0,{})}),m.jsx(te,{path:"/profile",element:m.jsx(Q0,{})}),m.jsx(te,{path:"/access-tokens",element:m.jsx(K0,{})}),m.jsxs(te,{path:"/docs",element:m.jsx(F0,{}),children:[m.jsx(te,{index:!0,element:m.jsx(ll,{to:"cli",replace:!0})}),m.jsx(te,{path:"cli",element:m.jsx(J0,{})}),m.jsx(te,{path:"api",element:m.jsx($0,{})}),m.jsx(te,{path:"bot",element:m.jsx(Ch,{})}),m.jsx(te,{path:"all",element:m.jsx(f1,{})}),m.jsx(te,{path:"skill",element:m.jsx(W0,{})}),m.jsx(te,{path:"installation",element:m.jsx(I0,{})}),m.jsx(te,{path:"developer-setup",element:m.jsx(P0,{})}),m.jsx(te,{path:"worker-setup",element:m.jsx(e1,{})}),m.jsx(te,{path:"bot-setup",element:m.jsx(t1,{})}),m.jsx(te,{path:"local-development",element:m.jsx(a1,{})}),m.jsx(te,{path:"worker-operations",element:m.jsx(n1,{})}),m.jsx(te,{path:"deployment",element:m.jsx(l1,{})}),m.jsx(te,{path:"bot-integration",element:m.jsx(Ch,{})}),m.jsx(te,{path:"pipeline-config",element:m.jsx(i1,{})}),m.jsx(te,{path:"dev-workflow",element:m.jsx(r1,{})}),m.jsx(te,{path:"permissions",element:m.jsx(u1,{})}),m.jsx(te,{path:"env-variables",element:m.jsx(o1,{})}),m.jsx(te,{path:"architecture",element:m.jsx(s1,{})}),m.jsx(te,{path:"changelog",element:m.jsx(c1,{})})]}),m.jsxs(te,{path:"/admin",element:m.jsx(li,{requireAdmin:!0,children:m.jsx(d1,{})}),children:[m.jsx(te,{index:!0,element:m.jsx(ll,{to:"developers",replace:!0})}),m.jsx(te,{path:"developers",element:m.jsx(m1,{})}),m.jsx(te,{path:"bots",element:m.jsx(h1,{})}),m.jsx(te,{path:"tokens",element:m.jsx(p1,{})}),m.jsx(te,{path:"audit-logs",element:m.jsx(_1,{})}),m.jsx(te,{path:"settings",element:m.jsx(g1,{})})]})]}),m.jsx(te,{path:"*",element:m.jsx(D0,{})})]})})]})})]})}function b1(r=window,u=document){const s=u.documentElement,o=r.visualViewport??null,f=()=>{const h=Math.round((o==null?void 0:o.height)??r.innerHeight);s.style.setProperty("--app-height",`${h}px`)};return f(),r.addEventListener("resize",f),r.addEventListener("orientationchange",f),o==null||o.addEventListener("resize",f),o==null||o.addEventListener("scroll",f),()=>{r.removeEventListener("resize",f),r.removeEventListener("orientationchange",f),o==null||o.removeEventListener("resize",f),o==null||o.removeEventListener("scroll",f)}}xa.getState().initialize();b1(window,document);const x1=window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0;if(x1){document.documentElement.classList.add("pwa-standalone");const r=window.matchMedia("(prefers-color-scheme: dark)").matches,u=localStorage.getItem("overlord-theme"),s=u==="dark"||u!=="light"&&r;document.body.style.backgroundColor=s?"#171717":"#FFFFFF",new MutationObserver(()=>{const o=document.documentElement.classList.contains("dark");document.body.style.backgroundColor=o?"#171717":"#FFFFFF"}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}uy.createRoot(document.getElementById("root")).render(m.jsx(g.StrictMode,{children:m.jsx(v1,{})}));export{R1 as A,ep as B,Jv as C,ip as D,rb as E,E1 as F,z1 as G,Ns as H,A1 as I,Pv as J,nb as K,$h as L,ub as M,ll as N,fb as O,r0 as P,Js as Q,Rr as R,ap as S,sp as T,uv as U,O1 as V,T1 as W,lp as X,C1 as Y,Iv as Z,Vt as a,$s as b,xe as c,cb as d,lb as e,Fa as f,gt as g,Xr as h,yb as i,m as j,Sb as k,Fr as l,w1 as m,M1 as n,N1 as o,tp as p,Ph as q,g as r,D1 as s,Wa as t,xa as u,n0 as v,k1 as w,Fv as x,np as y,j1 as z};
240
+ ov login https://overlord.yourdomain.com`,setup_step_3_link:"development workflow",go_to_app:"open app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli",cli_subtitle:"// command-line tools",api_reference:"api",api_subtitle:"// rest api endpoints",quick_start:"// quick start",developer_cli:"developer cli (ov)",admin_cli:"admin cli (overlord)",authentication:"// authentication",usage:"usage",flags:"flags",example:"example",request_body:"request body",response:"response",quick_start_with_token:"// quick start with your token",replace_token_hint:"// replace <your-token> with the actual token value from your access tokens page",cli_tools_desc:"// overlord provides two cli tools: {ov} (developer cli) and {overlord} (admin/ops cli)",api_base_url_desc:"// base url: {url} · all endpoints return json · auth via bearer token in authorization header",docs_nav_getting_started:"// getting started",docs_nav_guides:"// guides",docs_nav_reference:"// reference",docs_nav_other:"// other",docs_installation:"installation",docs_developer_setup:"developer setup",docs_worker_setup:"worker setup",docs_bot_setup:"bot setup",docs_local_dev:"local development",docs_worker_ops:"worker operations",docs_deployment:"deployment",docs_bot_integration:"bot integration",docs_pipeline:"pipeline config",docs_dev_workflow:"dev workflow",docs_cli:"cli reference",docs_api:"api reference",docs_skill:"skill reference",docs_permissions:"permissions & roles",docs_env_vars:"environment variables",docs_architecture:"architecture",docs_changelog:"changelog",docs_menu:"docs menu",docs_back:"< back",docs_all_title:"// all documentation",docs_all_subtitle:"browse all guides, references, and resources",docs_desc_installation:"install overlord server and cli tools",docs_desc_developer_setup:"set up your local development environment",docs_desc_worker_setup:"register and configure worker machines",docs_desc_bot_setup:"connect lark or slack bots to overlord",docs_desc_local_dev:"run and debug overlord locally",docs_desc_worker_ops:"manage worker lifecycle and monitoring",docs_desc_deployment:"deploy overlord to production servers",docs_desc_bot_integration:"interactive cards, adapter pattern, troubleshooting",docs_desc_pipeline:"define multi-stage task pipelines",docs_desc_dev_workflow:"git workflow, branching, and merge requests",docs_desc_cli:"cli command reference",docs_desc_api:"http api endpoint reference",docs_desc_skill:"custom skill definitions and configuration",docs_desc_permissions:"roles, access control, and authorization",docs_desc_env_vars:"environment variables for server and worker",docs_desc_architecture:"system architecture and component overview",docs_desc_changelog:"version history and release notes"},onboarding:{getting_started:"// getting started",completed_count:"{done}/{total} completed",dismiss:"dismiss",all_done:"all set! you're ready to go.",admin_create_project_title:"create your first project",admin_create_project_desc:"set up a project with a git repo and pipeline",admin_register_worker_title:"register a worker",admin_register_worker_desc:"generate a token and set up a worker to run tasks",admin_create_developer_title:"create a developer account",admin_create_developer_desc:"add team members who can create and monitor tasks",admin_configure_bot_title:"configure a chat bot",admin_configure_bot_desc:"register a Lark or Slack bot to enable task management via chat",admin_first_task_title:"create your first task",admin_first_task_desc:"verify the full pipeline works end-to-end",lead_view_projects_title:"view your projects",lead_view_projects_desc:"check the projects assigned to you",lead_configure_pipeline_title:"configure a pipeline",lead_configure_pipeline_desc:"set up stages for your project workflow",lead_add_member_title:"add a team member",lead_add_member_desc:"invite developers to your project",lead_first_task_title:"create your first task",lead_first_task_desc:"submit a task and watch it execute",dev_install_cli_title:"install the ov cli",dev_install_cli_desc:"npm install -g @overlordai/developer-cli",dev_setup_cli_title:"run ov setup",dev_setup_cli_desc:"connect to the server and authenticate",dev_link_chat_title:"link your chat account",dev_link_chat_desc:'send "bind" to the bot in Lark or Slack to connect your account',dev_view_projects_title:"explore projects",dev_view_projects_desc:"browse available projects and their pipelines",dev_first_task_title:"create your first task",dev_first_task_desc:"submit a task via web or cli",go_to_projects:"go to projects",go_to_workers:"go to workers",go_to_tasks:"go to tasks",go_to_bots:"manage bots",manage_developers:"manage developers",cli:"cli",setup_guide:"setup guide"},bind:{title:"// link platform account",linking:"linking your account...",success:"account linked successfully!",success_detail:"your {platform} account has been connected. you can now use bot commands.",error:"failed to link account",invalid_token:'this link is invalid or has expired. send "bind" to the bot again to get a new link.',back_to_home:"go to dashboard",no_token:"no bind token provided."},pwa_install:{title:"overlord://install",command:"overlord --install",desc_1:"add to home screen for standalone app experience",desc_2:"works offline · full-screen · instant launch",install:"y — install",skip:"n — skip",ios_command:"install --manual",ios_step_1:"tap share button in safari toolbar",ios_step_2:'scroll down → tap "add to home screen"',ios_step_3:'tap "add" to confirm'},pwa_update:{message:"new version available",reload:"reload"},terminal_home:{title:"terminal",select_project:"project...",all_projects:"all projects",task_description_placeholder:"describe the task...",new_task:"new task",no_active_tasks:"no active tasks",create_task_hint:"create a task using the bar above to get started"}};function wb(r,u){const s=u.split(".");let o=r;for(const f of s){if(o==null||typeof o!="object")return u;o=o[f]}return typeof o=="string"?o:u}function Tb(r,u){return u?r.replace(/\{(\w+)\}/g,(s,o)=>u[o]!=null?String(u[o]):`{${o}}`):r}function Br(r,u){return Tb(wb(Eb,r),u)}function Vt(){return{t:g.useCallback((u,s)=>Br(u,s),[])}}function sp(){const{theme:r,setTheme:u}=op(),{t:s}=Vt(),o=r==="dark"||r==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){u(o?"light":"dark")}return m.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":s(o?"common.switch_to_light":"common.switch_to_dark"),title:s(o?"common.light_mode":"common.dark_mode"),children:o?m.jsx(mb,{size:16}):m.jsx(ob,{size:16})})}class Ns extends Error{constructor(s,o,f){const h=s.status||s.status===0?s.status:"",p=s.statusText??"",b=`${h} ${p}`.trim(),y=b?`status code ${b}`:"an unknown error";super(`Request failed with ${y}: ${o.method} ${o.url}`);Ve(this,"response");Ve(this,"request");Ve(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class cp extends Error{constructor(s){let o="Non-error value was thrown";try{typeof s=="string"?o=s:s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&(o=s.message)}catch{}super(o);Ve(this,"name","NonError");Ve(this,"value");this.value=s}}class Rs extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new cp(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Ve(this,"name","ForceRetryError");Ve(this,"customDelay");Ve(this,"code");Ve(this,"customRequest");this.customDelay=s==null?void 0:s.delay,this.code=s==null?void 0:s.code,this.customRequest=s==null?void 0:s.request}}const Sh=(()=>{let r=!1,u=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{u=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return r&&!u})(),jb=typeof globalThis.AbortController=="function",fp=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Rb=typeof globalThis.ReadableStream=="function",Ab=typeof globalThis.FormData=="function",dp=["get","post","put","patch","head","delete"],zb={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},As=2147483647,Ob=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,mp=Symbol("stop");class hp{constructor(u){Ve(this,"options");this.options=u}}const Cb=r=>new hp(r),Db={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Nb={next:!0},Mb={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ub=r=>{if(!r)return 0;if(r instanceof FormData){let u=0;for(const[s,o]of r)u+=Ob,u+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,u+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return u}if(r instanceof Blob)return r.size;if(r instanceof ArrayBuffer)return r.byteLength;if(typeof r=="string")return new TextEncoder().encode(r).length;if(r instanceof URLSearchParams)return new TextEncoder().encode(r.toString()).length;if("byteLength"in r)return r.byteLength;if(typeof r=="object"&&r!==null)try{const u=JSON.stringify(r);return new TextEncoder().encode(u).length}catch{return 0}return 0},pp=(r,u,s)=>{let o,f=0;return r.pipeThrough(new TransformStream({transform(h,p){if(p.enqueue(h),o){f+=o.byteLength;let b=u===0?0:f/u;b>=1&&(b=1-Number.EPSILON),s==null||s({percent:b,totalBytes:Math.max(u,f),transferredBytes:f},o)}o=h},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(u,f),transferredBytes:f},o))}}))},qb=(r,u)=>{if(!r.body)return r;if(r.status===204)return new Response(null,{status:r.status,statusText:r.statusText,headers:r.headers});const s=Math.max(0,Number(r.headers.get("content-length"))||0);return new Response(pp(r.body,s,u),{status:r.status,statusText:r.statusText,headers:r.headers})},Lb=(r,u,s)=>{if(!r.body)return r;const o=Ub(s??r.body);return new Request(r,{duplex:"half",body:pp(r.body,o,u)})},yn=r=>r!==null&&typeof r=="object",Dr=(...r)=>{for(const u of r)if((!yn(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Ws({},...r)},_p=(r={},u={})=>{const s=new globalThis.Headers(r),o=u instanceof globalThis.Headers,f=new globalThis.Headers(u);for(const[h,p]of f.entries())o&&p==="undefined"||p===void 0?s.delete(h):s.set(h,p);return s};function Nr(r,u,s){return Object.hasOwn(u,s)&&u[s]===void 0?[]:Ws(r[s]??[],u[s]??[])}const gp=(r={},u={})=>({beforeRequest:Nr(r,u,"beforeRequest"),beforeRetry:Nr(r,u,"beforeRetry"),afterResponse:Nr(r,u,"afterResponse"),beforeError:Nr(r,u,"beforeError")}),Hb=(r,u)=>{const s=new URLSearchParams;for(const o of[r,u])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,h]of o.entries())s.append(f,h);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(f[0]),String(f[1]))}else if(yn(o))for(const[f,h]of Object.entries(o))h!==void 0&&s.append(f,String(h));else{const f=new URLSearchParams(o);for(const[h,p]of f.entries())s.append(h,p)}return s},Ws=(...r)=>{let u={},s={},o={},f;const h=[];for(const p of r)if(Array.isArray(p))Array.isArray(u)||(u=[]),u=[...u,...p];else if(yn(p)){for(let[b,y]of Object.entries(p)){if(b==="signal"&&y instanceof globalThis.AbortSignal){h.push(y);continue}if(b==="context"){if(y!=null&&(!yn(y)||Array.isArray(y)))throw new TypeError("The `context` option must be an object");u={...u,context:y==null?{}:{...u.context,...y}};continue}if(b==="searchParams"){y==null?f=void 0:f=f===void 0?y:Hb(f,y);continue}yn(y)&&b in u&&(y=Ws(u[b],y)),u={...u,[b]:y}}yn(p.hooks)&&(o=gp(o,p.hooks),u.hooks=o),yn(p.headers)&&(s=_p(s,p.headers),u.headers=s)}return f!==void 0&&(u.searchParams=f),h.length>0&&(h.length===1?u.signal=h[0]:fp?u.signal=AbortSignal.any(h):u.signal=h.at(-1)),u},Bb=r=>dp.includes(r)?r.toUpperCase():r,Yb=["get","put","head","delete","options","trace"],Gb=[408,413,429,500,502,503,504],Vb=[413,429,503],kh={limit:2,methods:Yb,statusCodes:Gb,afterStatusCodes:Vb,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:r=>.3*2**(r-1)*1e3,jitter:void 0,retryOnTimeout:!1},Xb=(r={})=>{if(typeof r=="number")return{...kh,limit:r};if(r.methods&&!Array.isArray(r.methods))throw new Error("retry.methods must be an array");if(r.methods&&(r.methods=r.methods.map(s=>s.toLowerCase())),r.statusCodes&&!Array.isArray(r.statusCodes))throw new Error("retry.statusCodes must be an array");const u=Object.fromEntries(Object.entries(r).filter(([,s])=>s!==void 0));return{...kh,...u}};class Ms extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Ve(this,"request");this.name="TimeoutError",this.request=s}}async function Qb(r,u,s,o){return new Promise((f,h)=>{const p=setTimeout(()=>{s&&s.abort(),h(new Ms(r))},o.timeout);o.fetch(r,u).then(f).catch(h).then(()=>{clearTimeout(p)})})}async function Zb(r,{signal:u}){return new Promise((s,o)=>{u&&(u.throwIfAborted(),u.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(h),o(u.reason)}const h=setTimeout(()=>{u==null||u.removeEventListener("abort",f),s()},r)})}const Kb=(r,u)=>{const s={};for(const o in u)Object.hasOwn(u,o)&&!(o in Mb)&&!(o in Db)&&(!(o in r)||o in Nb)&&(s[o]=u[o]);return s},Jb=r=>r===void 0?!1:Array.isArray(r)?r.length>0:r instanceof URLSearchParams?r.size>0:typeof r=="object"?Object.keys(r).length>0:typeof r=="string"?r.trim().length>0:!!r;function $b(r){return r instanceof Ns||(r==null?void 0:r.name)===Ns.name}function Wb(r){return r instanceof Ms||(r==null?void 0:r.name)===Ms.name}var Kr,yp,Jt,Bt,rt,Q,$a,ea,vn,ue,Yr,vp,Us,Gr,Ja,qs,bp,ii,Vr,Ls;const ri=class ri{constructor(u,s={}){Pt(this,ue);Ve(this,"request");Pt(this,Jt);Pt(this,Bt,0);Pt(this,rt);Pt(this,Q);Pt(this,$a);Pt(this,ea);Pt(this,vn);var f,h,p;if(Kt(this,rt,u),Kt(this,Q,{...s,headers:_p(U(this,rt).headers,s.headers),hooks:gp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Bb(s.method??U(this,rt).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:Xb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof U(this,rt)!="string"&&!(U(this,rt)instanceof URL||U(this,rt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(U(this,Q).prefixUrl&&typeof U(this,rt)=="string"){if(U(this,rt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");U(this,Q).prefixUrl.endsWith("/")||(U(this,Q).prefixUrl+="/"),Kt(this,rt,U(this,Q).prefixUrl+U(this,rt))}jb&&fp&&(Kt(this,ea,U(this,Q).signal??U(this,rt).signal),Kt(this,Jt,new globalThis.AbortController),U(this,Q).signal=U(this,ea)?AbortSignal.any([U(this,ea),U(this,Jt).signal]):U(this,Jt).signal),Sh&&(U(this,Q).duplex="half"),U(this,Q).json!==void 0&&(U(this,Q).body=((h=(f=U(this,Q)).stringifyJson)==null?void 0:h.call(f,U(this,Q).json))??JSON.stringify(U(this,Q).json),U(this,Q).headers.set("content-type",U(this,Q).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(U(this,rt)instanceof globalThis.Request&&(Ab&&U(this,Q).body instanceof globalThis.FormData||U(this,Q).body instanceof URLSearchParams)&&!o&&U(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(U(this,rt),U(this,Q)),Jb(U(this,Q).searchParams)){const y="?"+(typeof U(this,Q).searchParams=="string"?U(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ke(p=ri,Kr,yp).call(p,U(this,Q).searchParams)).toString()),_=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,y);this.request=new globalThis.Request(_,U(this,Q))}if(U(this,Q).onUploadProgress){if(typeof U(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Sh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ke(this,ue,Ls).call(this,this.request,U(this,Q).body??void 0)}}static create(u,s){var p,b,y;const o=new ri(u,s),f=async()=>{var w,k,M,Y,H,q,L,B,G,J,se,ce;if(typeof U(o,Q).timeout=="number"&&U(o,Q).timeout>As)throw new RangeError(`The \`timeout\` option cannot be greater than ${As}`);await Promise.resolve();let _=await ke(w=o,ue,bp).call(w);for(const _e of U(o,Q).hooks.afterResponse){const F=ke(k=o,ue,Us).call(k,_.clone());let W;try{W=await _e(o.request,ke(M=o,ue,ii).call(M),F,{retryCount:U(o,Bt)})}catch(Pe){throw ke(Y=o,ue,Ja).call(Y,F),ke(H=o,ue,Ja).call(H,_),Pe}if(W instanceof hp)throw ke(q=o,ue,Ja).call(q,F),ke(L=o,ue,Ja).call(L,_),new Rs(W.options);const oe=W instanceof globalThis.Response?W:_;F!==oe&&ke(B=o,ue,Ja).call(B,F),_!==oe&&ke(G=o,ue,Ja).call(G,_),_=oe}if(ke(J=o,ue,Us).call(J,_),!_.ok&&(typeof U(o,Q).throwHttpErrors=="function"?U(o,Q).throwHttpErrors(_.status):U(o,Q).throwHttpErrors)){let _e=new Ns(_,o.request,ke(se=o,ue,ii).call(se));for(const F of U(o,Q).hooks.beforeError)_e=await F(_e,{retryCount:U(o,Bt)});throw _e}if(U(o,Q).onDownloadProgress){if(typeof U(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Rb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const _e=_.clone();return ke(ce=o,ue,Ja).call(ce,_),qb(_e,U(o,Q).onDownloadProgress)}return _},h=ke(p=o,ue,qs).call(p,f).finally(()=>{var w,k;const _=U(o,$a);ke(w=o,ue,Gr).call(w,(_==null?void 0:_.body)??void 0),ke(k=o,ue,Gr).call(k,o.request.body??void 0)});for(const[_,w]of Object.entries(zb))_==="bytes"&&typeof((y=(b=globalThis.Response)==null?void 0:b.prototype)==null?void 0:y.bytes)!="function"||(h[_]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||w);const k=await h;if(_==="json"){if(k.status===204)return"";const M=await k.text();return M===""?"":s.parseJson?s.parseJson(M):JSON.parse(M)}return k[_]()});return h}};Kr=new WeakSet,yp=function(u){return u&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof URLSearchParams)?Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0)):u},Jt=new WeakMap,Bt=new WeakMap,rt=new WeakMap,Q=new WeakMap,$a=new WeakMap,ea=new WeakMap,vn=new WeakMap,ue=new WeakSet,Yr=function(){const u=U(this,Q).retry.delay(U(this,Bt));let s=u;U(this,Q).retry.jitter===!0?s=Math.random()*u:typeof U(this,Q).retry.jitter=="function"&&(s=U(this,Q).retry.jitter(u),(!Number.isFinite(s)||s<0)&&(s=u));const o=U(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},vp=async function(u){if(eh(this,Bt)._++,U(this,Bt)>U(this,Q).retry.limit)throw u;const s=u instanceof Error?u:new cp(u);if(s instanceof Rs)return s.customDelay??ke(this,ue,Yr).call(this);if(!U(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw u;if(U(this,Q).retry.shouldRetry!==void 0){const o=await U(this,Q).retry.shouldRetry({error:s,retryCount:U(this,Bt)});if(o===!1)throw u;if(o===!0)return ke(this,ue,Yr).call(this)}if(Wb(u)&&!U(this,Q).retry.retryOnTimeout)throw u;if($b(u)){if(!U(this,Q).retry.statusCodes.includes(u.response.status))throw u;const o=u.response.headers.get("Retry-After")??u.response.headers.get("RateLimit-Reset")??u.response.headers.get("X-RateLimit-Retry-After")??u.response.headers.get("X-RateLimit-Reset")??u.response.headers.get("X-Rate-Limit-Reset");if(o&&U(this,Q).retry.afterStatusCodes.includes(u.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const h=U(this,Q).retry.maxRetryAfter??f;return f<h?f:h}if(u.response.status===413)throw u}return ke(this,ue,Yr).call(this)},Us=function(u){return U(this,Q).parseJson&&(u.json=async()=>U(this,Q).parseJson(await u.text())),u},Gr=function(u){u&&u.cancel().catch(()=>{})},Ja=function(u){ke(this,ue,Gr).call(this,u.body??void 0)},qs=async function(u){try{return await u()}catch(s){const o=Math.min(await ke(this,ue,vp).call(this,s),As);if(U(this,Bt)<1)throw s;if(await Zb(o,U(this,ea)?{signal:U(this,ea)}:{}),s instanceof Rs&&s.customRequest){const f=U(this,Q).signal?new globalThis.Request(s.customRequest,{signal:U(this,Q).signal}):new globalThis.Request(s.customRequest);ke(this,ue,Vr).call(this,f)}for(const f of U(this,Q).hooks.beforeRetry){const h=await f({request:this.request,options:ke(this,ue,ii).call(this),error:s,retryCount:U(this,Bt)});if(h instanceof globalThis.Request){ke(this,ue,Vr).call(this,h);break}if(h instanceof globalThis.Response)return h;if(h===mp)return}return ke(this,ue,qs).call(this,u)}},bp=async function(){var s;(s=U(this,Jt))!=null&&s.signal.aborted&&(Kt(this,Jt,new globalThis.AbortController),U(this,Q).signal=U(this,ea)?AbortSignal.any([U(this,ea),U(this,Jt).signal]):U(this,Jt).signal,this.request=new globalThis.Request(this.request,{signal:U(this,Q).signal}));for(const o of U(this,Q).hooks.beforeRequest){const f=await o(this.request,ke(this,ue,ii).call(this),{retryCount:U(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ke(this,ue,Vr).call(this,f);break}}const u=Kb(this.request,U(this,Q));return Kt(this,$a,this.request),this.request=U(this,$a).clone(),U(this,Q).timeout===!1?U(this,Q).fetch(U(this,$a),u):Qb(U(this,$a),u,U(this,Jt),U(this,Q))},ii=function(){if(!U(this,vn)){const{hooks:u,...s}=U(this,Q);Kt(this,vn,Object.freeze(s))}return U(this,vn)},Vr=function(u){Kt(this,vn,void 0),this.request=ke(this,ue,Ls).call(this,u)},Ls=function(u,s){return!U(this,Q).onUploadProgress||!u.body?u:Lb(u,U(this,Q).onUploadProgress,s??U(this,Q).body??void 0)},Pt(ri,Kr);let Zr=ri;/*! MIT License © Sindre Sorhus */const Hs=r=>{const u=(s,o)=>Zr.create(s,Dr(r,o));for(const s of dp)u[s]=(o,f)=>Zr.create(o,Dr(r,f,{method:s}));return u.create=s=>Hs(Dr(s)),u.extend=s=>(typeof s=="function"&&(s=s(r??{})),Hs(Dr(r,s))),u.stop=mp,u.retry=Cb,u},Eh=Hs();let Mr=null;const Xr=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[r=>{const u=xa.getState().accessToken;u&&r.headers.set("Authorization",`Bearer ${u}`)}],afterResponse:[async(r,u,s)=>{if(s.status===401&&!r.headers.has("X-Retry-After-Refresh")){Mr||(Mr=xa.getState().refresh().finally(()=>{Mr=null}));try{await Mr}catch{throw s}const o=xa.getState().accessToken;return o&&r.headers.set("Authorization",`Bearer ${o}`),r.headers.set("X-Retry-After-Refresh","1"),Eh(r,u)}}]}}),Fb=3e4;function Ib(r){if(r.link)return r.link;const u=(r.title+" "+r.body).match(/task\s*#?(\d+)/i);if(u)return`/tasks/${u[1]}`;const s=(r.title+" "+r.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function xp(){const r=Fa(),[u,s]=g.useState([]),[o,f]=g.useState(0),[h,p]=g.useState(!1),[b,y]=g.useState(!1),_=g.useRef(null),{t:w}=Vt(),k=g.useRef(async()=>{try{y(!0);const q=(await Xr.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,L=q.filter(B=>!B.isRead).length;s(B=>B.length===q.length&&B.every((G,J)=>G.id===q[J].id&&G.isRead===q[J].isRead)?B:q),f(B=>B===L?B:L)}catch{}finally{y(!1)}});g.useEffect(()=>{k.current();const H=setInterval(()=>k.current(),Fb);return()=>clearInterval(H)},[]),g.useEffect(()=>{function H(q){_.current&&!_.current.contains(q.target)&&p(!1)}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);async function M(H){try{await Xr.post(`web/notifications/${H}/read`),s(q=>q.map(L=>L.id===H?{...L,isRead:!0}:L)),f(q=>Math.max(0,q-1))}catch{}}async function Y(){try{await Xr.post("web/notifications/read-all"),s(H=>H.map(q=>({...q,isRead:!0}))),f(0)}catch{}}return m.jsxs("div",{className:"relative",ref:_,children:[m.jsxs("button",{type:"button",onClick:()=>p(H=>!H),"aria-label":w("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[m.jsx(Zv,{size:16}),o>0&&m.jsx("span",{className:"absolute right-0 top-0 flex h-3 min-w-3 items-center justify-center rounded-full bg-[var(--destructive)] px-0.5 text-[8px] font-semibold leading-none text-white",children:o})]}),h&&m.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-[min(320px,calc(100vw-2rem))] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[m.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[m.jsx("span",{className:"text-sm font-semibold",children:w("common.notifications")}),o>0&&m.jsxs("button",{type:"button",onClick:Y,"aria-label":w("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[m.jsx(Kv,{className:"h-3.5 w-3.5"}),w("common.mark_all_read")]})]}),m.jsx("div",{className:"max-h-80 overflow-y-auto",children:b&&u.length===0?m.jsx("div",{className:"flex justify-center py-8",children:m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):u.length===0?m.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[m.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),m.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:w("common.no_notifications")})]}):u.map(H=>{const q=Ib(H);return m.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${q?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${H.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{q&&(H.isRead||M(H.id),p(!1),r(q))},children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:"text-sm font-medium",children:H.title}),m.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:H.body}),m.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(H.createdAt).toLocaleString()})]}),!H.isRead&&m.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),M(H.id)},"aria-label":w("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:m.jsx(Jv,{className:"h-3.5 w-3.5"})})]},H.id)})})]})]})}function Pb(r){return{tasks:r.tasks.map(u=>({type:"task",id:u.id,title:`#${u.id} ${u.description}`,subtitle:`${u.status} · ${u.project_key}`})),workers:(r.workers??[]).map(u=>({type:"worker",id:u.id,title:u.name,subtitle:`${u.hostname} · ${u.status}`})),projects:r.projects.map(u=>({type:"project",id:u.key,title:u.name,subtitle:u.repository}))}}const e0=300,wh={tasks:db,workers:ap,projects:eb},t0={tasks:"tasks",workers:"workers",projects:"projects"};function Sp({renderTrigger:r}={}){const[u,s]=g.useState(""),[o,f]=g.useState({tasks:[],workers:[],projects:[]}),[h,p]=g.useState(!1),[b,y]=g.useState(!1),[_,w]=g.useState(0),k=g.useRef(null),M=g.useRef(null),Y=g.useRef(void 0),H=g.useRef(void 0),q=Fa(),{t:L}=Vt(),B=g.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),G=g.useCallback(async W=>{var Pe;if(!W.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=H.current)==null||Pe.abort();const oe=new AbortController;H.current=oe;try{p(!0);const Je=await Xr.get("web/search",{searchParams:{q:W},signal:oe.signal}).json();f(Pb(Je)),w(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{oe.signal.aborted||p(!1)}},[]);g.useEffect(()=>(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>G(u),e0),()=>{Y.current&&clearTimeout(Y.current)}),[u,G]),g.useEffect(()=>{function W(oe){oe.key==="/"&&!b&&!(oe.target instanceof HTMLInputElement||oe.target instanceof HTMLTextAreaElement)&&(oe.preventDefault(),y(!0)),oe.key==="Escape"&&b&&(oe.preventDefault(),J())}return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[b]),g.useEffect(()=>{b&&setTimeout(()=>{var W;return(W=M.current)==null?void 0:W.focus()},50)},[b]);function J(){y(!1),s(""),f({tasks:[],workers:[],projects:[]}),w(0)}function se(W){switch(J(),W.type){case"task":q(`/tasks/${W.id}`);break;case"worker":q(`/workers/${W.id}`);break;case"project":q(`/projects/${W.id}`);break}}function ce(W){W.key==="ArrowDown"?(W.preventDefault(),w(oe=>Math.min(oe+1,B.length-1))):W.key==="ArrowUp"?(W.preventDefault(),w(oe=>Math.max(oe-1,0))):W.key==="Enter"&&B[_]&&(W.preventDefault(),se(B[_]))}const _e=B.length>0;let F=0;return m.jsxs(m.Fragment,{children:[r?r(()=>y(!0)):m.jsxs("button",{type:"button",onClick:()=>y(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[m.jsx(tp,{className:"h-3.5 w-3.5"}),m.jsx("span",{children:L("common.search_placeholder")}),m.jsx("kbd",{className:"ml-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:"/"})]}),b&&m.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[calc(var(--safe-area-top,0px)+16px)] md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:W=>{W.target===k.current&&J()},children:m.jsxs("div",{className:"mx-3 w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl sm:mx-4 md:mx-0",children:[m.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[m.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),m.jsx("input",{ref:M,type:"text",placeholder:L("common.search_input_placeholder"),value:u,onChange:W=>s(W.target.value),onKeyDown:ce,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),h&&m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),m.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:u.trim()&&!_e&&!h?m.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:L("common.no_search_results",{query:u})}):Object.keys(wh).map(W=>{const oe=o[W];if(oe.length===0)return null;const Pe=wh[W],Je=F;return F+=oe.length,m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[m.jsx(Pe,{className:"h-3 w-3"}),m.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:t0[W]})]}),oe.map((qe,At)=>{const ut=Je+At,Ne=ut===_;return m.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${Ne?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>se(qe),onMouseEnter:()=>w(ut),children:[m.jsx("span",{className:`text-xs ${Ne?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:Ne?">":" "}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:"truncate text-sm",children:qe.title}),qe.subtitle&&m.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",children:qe.subtitle})]})]},`${qe.type}-${qe.id}`)})]},W)})}),m.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",L("common.navigate_hint")]}),m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",L("common.select_hint")]}),m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",L("common.close_hint")]})]})]})})]})}const a0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"},Th="confirm-dialog-title";function jh(r){return Array.from(r.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function n0({isOpen:r,onClose:u,onConfirm:s,title:o,message:f,confirmVariant:h="danger",isLoading:p,...b}){const{t:y}=Vt(),_=b.confirmLabel??y("common.confirm"),w=b.cancelLabel??y("common.cancel"),k=g.useRef(null),M=g.useRef(null),Y=a0[h];g.useEffect(()=>{if(!r)return;M.current=document.activeElement;const q=requestAnimationFrame(()=>{if(k.current){const L=jh(k.current);L.length>0&&L[0].focus()}});return()=>{var L;cancelAnimationFrame(q),(L=M.current)==null||L.focus()}},[r]);const H=g.useCallback(q=>{if(q.key==="Tab"&&k.current){const L=jh(k.current);if(L.length===0)return;const B=L[0],G=L[L.length-1];q.shiftKey?document.activeElement===B&&(q.preventDefault(),G.focus()):document.activeElement===G&&(q.preventDefault(),B.focus())}},[]);return r?m.jsx("div",{onClick:u,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"max(1rem, 10vh)",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:m.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-labelledby":Th,onClick:q=>q.stopPropagation(),onKeyDown:H,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[m.jsx("div",{style:{marginBottom:"1.25rem"},children:m.jsxs("div",{id:Th,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[m.jsx(np,{style:{width:"1rem",height:"1rem"}}),o]})}),m.jsx("div",{style:{marginBottom:"1.25rem"},children:m.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f})}),m.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[m.jsx("button",{type:"button",onClick:u,disabled:p,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",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,transition:"color 0.15s, border-color 0.15s"},children:w}),m.jsx("button",{type:"button",onClick:s,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:Y,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:p?"not-allowed":"pointer",opacity:p?.7:1},children:p?y("common.processing"):_})]})]})}):null}const Rh="overlord-pwa-install-dismissed";function l0(){const r=navigator.userAgent;return/iP(hone|od|ad)/.test(r)&&/WebKit/.test(r)&&!/(CriOS|FxiOS|OPiOS|mercury)/.test(r)}function i0(){return navigator.standalone===!0||window.matchMedia("(display-mode: standalone)").matches}function r0(){const{t:r}=Vt(),[u,s]=g.useState("hidden"),[o,f]=g.useState(!1),h=g.useRef(null),p=g.useRef(void 0);g.useEffect(()=>{if(i0()||localStorage.getItem(Rh)||window.innerWidth>=768)return;const _=k=>{k.preventDefault(),h.current=k};window.addEventListener("beforeinstallprompt",_);const w=setTimeout(()=>s("visible"),1e3);return()=>{window.removeEventListener("beforeinstallprompt",_),clearTimeout(w),clearTimeout(p.current)}},[]);function b(){localStorage.setItem(Rh,"1"),s("dismissing"),p.current=setTimeout(()=>s("hidden"),200)}async function y(){if(h.current){await h.current.prompt();const{outcome:_}=await h.current.userChoice;_==="accepted"&&b(),h.current=null}else l0()&&f(!0)}return u==="hidden"?null:m.jsx("div",{className:`fixed bottom-4 left-4 right-4 z-40 md:hidden ${u==="dismissing"?"animate-slide-down":"animate-slide-up"}`,role:"dialog","aria-label":r("pwa_install.title"),children:m.jsxs("div",{className:"overflow-hidden rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[m.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--accent)]/20 bg-[var(--accent)]/[0.06] px-3 py-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-[var(--accent)]"}),m.jsx("span",{className:"text-[9px] font-medium text-[var(--accent)]",children:r("pwa_install.title")})]}),m.jsx("button",{onClick:b,className:"p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:m.jsx(lp,{size:14})})]}),m.jsx("div",{className:"px-3.5 py-3",children:o?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[m.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",r("pwa_install.ios_command")]}),m.jsx("div",{className:"mt-2.5 flex flex-col gap-2.5",children:[r("pwa_install.ios_step_1"),r("pwa_install.ios_step_2"),r("pwa_install.ios_step_3")].map((_,w)=>m.jsxs("div",{className:"flex items-center gap-2.5",children:[m.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] bg-[var(--accent)]/[0.08]",children:m.jsx("span",{className:"text-xs font-semibold text-[var(--accent)]",children:w+1})}),m.jsxs("span",{className:"text-[10px] leading-snug text-[var(--text-secondary)]",children:[w===0&&m.jsx(sb,{size:12,className:"mr-1 inline-block align-text-bottom text-[var(--text-muted)]"}),_]})]},w))})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[m.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",r("pwa_install.command")]}),m.jsxs("div",{className:"mt-1.5 text-[10px] leading-relaxed text-[var(--text-secondary)]",children:["→ ",r("pwa_install.desc_1"),m.jsx("br",{}),"→ ",r("pwa_install.desc_2")]}),m.jsxs("div",{className:"mt-2.5 flex gap-2",children:[m.jsx("button",{onClick:y,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:r("pwa_install.install")}),m.jsx("button",{onClick:b,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[10px] text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:r("pwa_install.skip")})]})]})})]})})}function u0(){const{t:r}=Vt(),[u,s]=g.useState(!1);return g.useEffect(()=>{if(!("serviceWorker"in navigator))return;let o=!1;function f(){o||s(!0)}navigator.serviceWorker.addEventListener("controllerchange",f);function h(b){if(b.waiting){s(!0);return}b.addEventListener("updatefound",()=>{const y=b.installing;y&&y.addEventListener("statechange",()=>{y.state==="installed"&&navigator.serviceWorker.controller&&(o||s(!0))})})}navigator.serviceWorker.getRegistration().then(b=>{b&&!o&&h(b)});const p=setInterval(()=>{navigator.serviceWorker.getRegistration().then(b=>{!b||o||(b.update().catch(()=>{}),b.waiting&&s(!0))})},3e4);return()=>{o=!0,clearInterval(p),navigator.serviceWorker.removeEventListener("controllerchange",f)}},[]),u?m.jsx("div",{className:"animate-slide-up fixed bottom-20 left-4 right-4 z-50 md:bottom-4 md:left-auto md:right-4 md:w-80",children:m.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] px-3.5 py-3 shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[m.jsx(ep,{size:14,className:"shrink-0 text-[var(--accent)]"}),m.jsx("span",{className:"flex-1 text-[10px] text-[var(--text-secondary)]",children:r("pwa_update.message")}),m.jsx("button",{onClick:()=>window.location.reload(),className:"shrink-0 rounded-[4px] bg-[var(--accent)] px-3 py-1 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:r("pwa_update.reload")})]})}):null}const Ur=64,o0=96,Ah=32;function s0({children:r,className:u}){const s=g.useRef(null),o=g.useRef(0),f=g.useRef(0),h=g.useRef("idle"),[p,b]=g.useState(0),[y,_]=g.useState("idle"),w=g.useCallback(G=>{h.current=G,_(G)},[]),k=g.useCallback(()=>{const G=s.current;return G?G.scrollTop<=0:!0},[]),M=g.useCallback(G=>{k()&&(o.current=G.touches[0].clientY,f.current=G.touches[0].clientY)},[k]),Y=g.useCallback(G=>{if(h.current==="refreshing"||o.current===0)return;const J=G.touches[0].clientY,se=J-o.current;if(se<=0){h.current!=="idle"&&(b(0),w("idle"));return}if(!k())return;G.preventDefault();const ce=Math.min(se*.5,o0);f.current=J,b(ce),w(ce>=Ur?"ready":"pulling")},[k,w]),H=g.useCallback(()=>{h.current!=="refreshing"&&(h.current==="ready"?(w("refreshing"),b(Ur),setTimeout(()=>{window.location.reload()},300)):(b(0),w("idle")),o.current=0)},[w]);g.useEffect(()=>{const G=s.current;if(G)return G.addEventListener("touchstart",M,{passive:!0}),G.addEventListener("touchmove",Y,{passive:!1}),G.addEventListener("touchend",H,{passive:!0}),()=>{G.removeEventListener("touchstart",M),G.removeEventListener("touchmove",Y),G.removeEventListener("touchend",H)}},[M,Y,H]);const q=Math.min(p/Ur,1),L=y==="refreshing"?0:p/Ur*180,B=p>0||y==="refreshing";return m.jsxs("div",{ref:s,className:u,style:{overscrollBehaviorY:"contain"},children:[B&&m.jsx("div",{className:"pointer-events-none flex items-center justify-center md:hidden",style:{height:p,transition:y==="idle"?"height 200ms ease-out":void 0},children:m.jsx("div",{className:"flex items-center justify-center rounded-full bg-[var(--bg-card)] border border-[var(--border)]",style:{width:Ah,height:Ah,opacity:q,transition:y==="idle"?"opacity 200ms ease-out":void 0},children:y==="refreshing"?m.jsxs("svg",{width:16,height:16,viewBox:"0 0 16 16",className:"animate-spin",style:{color:"var(--accent)"},children:[m.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),m.jsx("path",{d:"M8 2a6 6 0 0 1 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}):m.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",style:{color:y==="ready"?"var(--accent)":"var(--text-muted)",transform:`rotate(${L}deg)`,transition:"color 150ms"},children:m.jsx("path",{d:"M8 3v8M5 8l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),r]})}const kp=g.createContext({setActions:()=>{}});function L1(r){const{setActions:u}=g.useContext(kp);g.useEffect(()=>(u(r),()=>u(null)),[r,u])}const Ep=g.createContext({setSubtitle:()=>{}});function H1(r){const{setSubtitle:u}=g.useContext(Ep);g.useEffect(()=>(u(r),()=>u(null)),[r,u])}const c0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih},{to:"/workers",label:"workers",icon:ap},{to:"/projects",label:"projects",icon:tb},{to:"/access-tokens",label:"tokens",icon:nb}],f0=[{to:"/docs/cli",label:"cli",icon:$s},{to:"/docs/api",label:"api",icon:Pv},{to:"/docs/bot",label:"bot",icon:ub},{to:"/docs/skill",label:"skill",icon:fb},{to:"/docs/all",label:"all",icon:lb}],d0=[{to:"/admin",label:"admin",icon:cb}],m0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih}],qr={"/home":{title:"common.breadcrumb_terminal",subtitle:"common.breadcrumb_terminal_sub"},"/dashboard":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/workers":{title:"common.breadcrumb_workers",subtitle:"common.breadcrumb_workers_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_tokens",subtitle:"common.breadcrumb_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"},"/docs/bot":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_bot_sub"},"/docs/all":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_all_sub"}};function h0(r){const{t:u}=Vt();if(qr[r]){const o=qr[r];return{title:u(o.title),subtitle:u(o.subtitle)}}const s="/"+r.split("/").filter(Boolean)[0];if(qr[s]){const o=qr[s],f=r.split("/").filter(Boolean).slice(1).join(" / ");return{title:u(o.title),subtitle:f||u(o.subtitle)}}return{title:r.slice(1).replace(/\//g," // ")||"home"}}function p0(r,u){return r==="/home"?u==="/home":r==="/dashboard"?u==="/dashboard":u.startsWith(r)}function _0(){const r=gt(),{t:u}=Vt(),s={terminal:u("terminal_home.title"),dashboard:u("dashboard.title"),tasks:u("tasks.title"),workers:u("workers.title")};return m.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)]",style:{height:48,paddingTop:4},children:[m0.map(({to:o,label:f,icon:h})=>{const p=p0(o,r.pathname);return m.jsxs(Js,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[m.jsx(h,{size:18,className:p?"text-[var(--accent)]":"text-[var(--text-muted)]"}),m.jsx("span",{className:`text-[11px] lowercase ${p?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),m.jsx(Sp,{renderTrigger:o=>m.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[m.jsx(tp,{size:18,className:"text-[var(--text-muted)]"}),m.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:u("common.search_placeholder")})]})})]})}function g0(){const r=Fa(),{t:u}=Vt();return m.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:"calc(56px + env(safe-area-inset-top, 0px))",minHeight:"calc(56px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[m.jsxs("button",{onClick:()=>r("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[m.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:m.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),m.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:u("common.overlord")})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{onClick:()=>r("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":u("common.profile"),children:m.jsx(hb,{size:18})}),m.jsx(xp,{}),m.jsx(sp,{})]})]})}function zs({label:r,items:u,collapsed:s}){return m.jsxs("div",{className:"mt-4 first:mt-0",children:[!s&&m.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:r}),u.map(({to:o,label:f,icon:h})=>m.jsx(Js,{to:o,className:({isActive:p})=>`flex items-center text-sm lowercase transition-colors ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${p?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:p})=>m.jsxs(m.Fragment,{children:[m.jsx(h,{size:14,style:{flexShrink:0}}),!s&&m.jsx("span",{children:p?`> ${f}`:` ${f}`})]})},o))]})}function y0(){const{user:r,logout:u}=xa(),s=Fa(),[o,f]=g.useState(!1),h=yb(),{t:p}=Vt(),{sidebarCollapsed:b,toggleSidebar:y}=bb();function _(){u(),s("/login")}return m.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:b?56:240,minWidth:b?56:240,backgroundColor:"var(--bg-card)"},children:[m.jsx("div",{className:"flex items-center px-5",style:{height:48},children:m.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[m.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:m.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!b&&m.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:p("common.overlord")})]})}),m.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[m.jsx(zs,{label:p("common.navigation"),items:c0,collapsed:b}),m.jsx(zs,{label:p("common.docs_section"),items:f0,collapsed:b}),h&&m.jsx(zs,{label:p("common.admin_section"),items:d0,collapsed:b})]}),m.jsx("div",{className:`px-3 py-1 ${b?"flex justify-center":""}`,children:m.jsx("button",{onClick:y,className:"flex items-center justify-center w-full py-1.5 rounded-[4px] text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)] hover:bg-[var(--accent)]/5","aria-label":b?"expand sidebar":"collapse sidebar",children:b?m.jsx(Wv,{size:14}):m.jsx($v,{size:14})})}),m.jsx("div",{className:"border-t border-[var(--border)] p-3",children:m.jsxs("div",{className:`flex items-center py-2 ${b?"justify-center":"gap-3 px-3"}`,children:[m.jsx("button",{onClick:()=>s("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:p("common.profile"),children:((r==null?void 0:r.username)??"u")[0].toUpperCase()}),!b&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:p("common.profile"),children:[m.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(r==null?void 0:r.username)??"user"}),m.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(r==null?void 0:r.role)??"user"})]}),m.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":p("common.log_out"),children:m.jsx(rb,{size:14})})]})]})}),m.jsx(n0,{isOpen:o,onClose:()=>f(!1),onConfirm:_,title:p("common.logout_title"),message:p("common.logout_message"),confirmLabel:p("common.logout"),confirmVariant:"warning"})]})}function v0({headerActions:r,subtitleOverride:u}){const s=gt(),{title:o,subtitle:f}=h0(s.pathname),h=u??f;return m.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[m.jsxs("div",{className:"text-sm lowercase",children:[m.jsx("span",{style:{color:"var(--text-primary)"},children:o}),h&&m.jsxs("span",{style:{color:"var(--text-muted)"},children:[" ","// ",h]})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[r,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(Sp,{}),m.jsx(xp,{}),m.jsx(sp,{})]})]})]})}function b0(){const[r,u]=g.useState(null),[s,o]=g.useState(null),f=gt(),h=f.pathname==="/home",p=f.pathname.startsWith("/docs");return g.useEffect(()=>Sb.getState().init(),[]),m.jsxs("div",{className:"fixed inset-x-0 top-0 flex w-full overflow-hidden font-mono md:flex-row",style:{height:"var(--app-height, 100dvh)",minHeight:"var(--app-height, 100dvh)"},children:[m.jsx(y0,{}),m.jsxs("div",{"data-testid":"app-main-column",className:"flex min-h-0 flex-1 flex-col overflow-hidden pb-[calc(48px+var(--safe-area-bottom,0px))] md:pb-0",children:[m.jsx(g0,{}),!p&&m.jsx(v0,{headerActions:r,subtitleOverride:s}),m.jsx(s0,{className:h?"min-h-0 flex-1 overflow-hidden bg-[var(--bg-primary)]":"min-h-0 flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-6 md:p-6 md:pb-6",children:m.jsx(kp.Provider,{value:{setActions:u},children:m.jsx(Ep.Provider,{value:{setSubtitle:o},children:m.jsx(uv,{})})})}),m.jsx(r0,{}),m.jsx(u0,{}),m.jsx("div",{className:"safe-area-bottom-fill fixed inset-x-0 bottom-0 z-30 bg-[var(--bg-card)] md:hidden",children:m.jsx(_0,{})})]})]})}function zh(r){var s;const u=(s=r.state)==null?void 0:s.from;return u?{from:u}:{from:{pathname:r.pathname,search:r.search}}}function li({children:r,requireAdmin:u=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:h}=xa(),p=gt();if(h)return m.jsx("div",{className:"flex h-screen items-center justify-center",children:m.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return m.jsx(ll,{to:"/login",state:zh(p),replace:!0});if(f){const b=zh(p);return p.pathname!=="/totp-setup"&&p.pathname!=="/bind"?m.jsx(ll,{to:"/totp-setup",state:b,replace:!0}):p.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(b.from)),m.jsx(ll,{to:"/totp-setup",state:b,replace:!0})):m.jsx(m.Fragment,{children:r})}return u&&(o==null?void 0:o.role)!==ip.ADMIN?m.jsx(ll,{to:"/home",replace:!0}):m.jsx(m.Fragment,{children:r})}function x0({children:r}){const{theme:u,resolved:s,setResolved:o}=op();return g.useEffect(()=>{if(u!=="system"){o(u);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const h=p=>o(p.matches?"dark":"light");return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[u,o]),g.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),m.jsx(m.Fragment,{children:r})}class S0 extends g.Component{constructor(u){super(u),this.state={hasError:!1,error:null}}static getDerivedStateFromError(u){return{hasError:!0,error:u}}render(){var u;return this.state.hasError?m.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[m.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Br("common.runtime_error")}),m.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((u=this.state.error)==null?void 0:u.message)||Br("common.an_unexpected_error_occurred")}),m.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[m.jsx(ep,{className:"h-3.5 w-3.5"}),Br("common.reload")]})]}):this.props.children}}function k0({isOpen:r}){const u=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=Vt();function h(){s(),o(!1),u("/login")}return r?m.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[m.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),m.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:m.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[m.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:m.jsx(ib,{className:"h-7 w-7 text-[var(--warning)]"})}),m.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),m.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),m.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:h,children:f("auth.go_to_login")})]})})]}):null}const Oh=5;let ba=[];const Bs=new Set;function wp(){Bs.forEach(r=>r())}function E0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(r,u,s=4e3){const o=E0();return ba=[...ba,{id:o,variant:r,message:u,duration:s}],ba.length>Oh&&(ba=ba.slice(ba.length-Oh)),wp(),o}Wa.success=(r,u)=>Wa("success",r,u);Wa.error=(r,u)=>Wa("error",r,u);Wa.warning=(r,u)=>Wa("warning",r,u);Wa.info=(r,u)=>Wa("info",r,u);function w0(r){ba=ba.filter(u=>u.id!==r),wp()}function T0(){const[,r]=g.useState(0);return g.useEffect(()=>{const u=()=>r(s=>s+1);return Bs.add(u),()=>{Bs.delete(u)}},[]),ba}const j0={success:{icon:Fv,borderColor:"var(--accent)"},error:{icon:Iv,borderColor:"var(--destructive)"},warning:{icon:np,borderColor:"var(--warning)"},info:{icon:ab,borderColor:"var(--info)"}};function R0({item:r}){const u=j0[r.variant],s=u.icon,{t:o}=Vt(),f=g.useCallback(()=>w0(r.id),[r.id]);return g.useEffect(()=>{if(!r.duration)return;const h=setTimeout(f,r.duration);return()=>clearTimeout(h)},[r.duration,f]),m.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${u.borderColor}`},role:"alert",children:[m.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:u.borderColor}}),m.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:r.message}),m.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:m.jsx(lp,{className:"h-3.5 w-3.5"})})]})}function A0(){const r=T0();return r.length===0?null:m.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:r.map(u=>m.jsx("div",{className:"pointer-events-auto",children:m.jsx(R0,{item:u})},u.id))})}const z0=g.lazy(()=>ne(()=>import("./LandingPage-C7_v2JNK.js"),__vite__mapDeps([0,1,2,3,4,5]))),O0=g.lazy(()=>ne(()=>import("./LoginPage-CZz5g9sU.js"),[])),C0=g.lazy(()=>ne(()=>import("./TotpSetupPage-XFWUwLmD.js"),[])),D0=g.lazy(()=>ne(()=>import("./NotFoundPage-CZEX5gr6.js"),[])),N0=g.lazy(()=>ne(()=>import("./HomePage-dOxzI3Gt.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),M0=g.lazy(()=>ne(()=>import("./TerminalHomePage-CajSNUCs.js"),__vite__mapDeps([15,16,17,18,10,11,19,8,12,14,20,21,22]))),U0=g.lazy(()=>ne(()=>import("./TaskListPage-kOQDNqdP.js"),__vite__mapDeps([23,16,7,8,12,13,19,5,24,9,20]))),q0=g.lazy(()=>ne(()=>import("./TaskDetailPage-DxS8IX_H.js"),__vite__mapDeps([25,16,17,18,12,19,8,26,21,27,28]))),L0=g.lazy(()=>ne(()=>import("./WorkerListPage-DHcw_qVO.js"),__vite__mapDeps([29,8,30,31,32,33,34,22,5,28,19,24,9,14,20]))),H0=g.lazy(()=>ne(()=>import("./WorkerDetailPage-ze7Anqi8.js"),__vite__mapDeps([35,12,8,36,30,14,37,26]))),B0=g.lazy(()=>ne(()=>import("./WorkerSetupGuidePage-BBjUnfoc.js"),__vite__mapDeps([31,32,33,34,22]))),Y0=g.lazy(()=>ne(()=>import("./ProjectListPage-D0LAZZsK.js"),__vite__mapDeps([38,19,24,9,12,14,20]))),G0=g.lazy(()=>ne(()=>import("./ProjectDetailPage-iQzJH48J.js"),__vite__mapDeps([39,40,19,12,8,36,14,41,37,20]))),V0=g.lazy(()=>ne(()=>import("./EditProjectPage-CBxwr2NU.js"),__vite__mapDeps([42,19,40,20]))),X0=g.lazy(()=>ne(()=>import("./PipelineEditorPage-XxZdswLa.js"),__vite__mapDeps([43,19,13]))),Q0=g.lazy(()=>ne(()=>import("./ProfilePage-KG0GogCa.js"),__vite__mapDeps([44,45,36,14]))),Z0=g.lazy(()=>ne(()=>import("./BindPlatformPage-CiTvVM38.js"),[])),K0=g.lazy(()=>ne(()=>import("./AccessTokensPage-DYW95oYn.js"),__vite__mapDeps([46,19,24,9,12,14,20,5,37]))),J0=g.lazy(()=>ne(()=>import("./CliReferencePage-l1Msp1MO.js"),__vite__mapDeps([47,48,5,20]))),$0=g.lazy(()=>ne(()=>import("./ApiReferencePage-k0qwCqrg.js"),__vite__mapDeps([49,48,5,20]))),W0=g.lazy(()=>ne(()=>import("./SkillPage-DPXfneXB.js"),__vite__mapDeps([50,51,5,27]))),F0=g.lazy(()=>ne(()=>import("./DocsLayout-BjOXe_bC.js"),__vite__mapDeps([52,26]))),I0=g.lazy(()=>ne(()=>import("./InstallationPage-Dorh05Cd.js"),__vite__mapDeps([53,51,5]))),P0=g.lazy(()=>ne(()=>import("./DeveloperSetupPage-gVXD6Xl2.js"),__vite__mapDeps([54,51,5]))),e1=g.lazy(()=>ne(()=>import("./WorkerSetupPage-CllS2_5z.js"),__vite__mapDeps([55,51,5]))),t1=g.lazy(()=>ne(()=>import("./BotSetupPage-GNWFUbvf.js"),__vite__mapDeps([56,51,5]))),a1=g.lazy(()=>ne(()=>import("./LocalDevelopmentPage-IzSDZ8WW.js"),__vite__mapDeps([57,51,5]))),n1=g.lazy(()=>ne(()=>import("./WorkerOperationsPage-BKYGuZT9.js"),[])),l1=g.lazy(()=>ne(()=>import("./DeploymentPage-dKYl9mAA.js"),__vite__mapDeps([58,51,5]))),Ch=g.lazy(()=>ne(()=>import("./BotIntegrationPage-DWUypE3E.js"),[])),i1=g.lazy(()=>ne(()=>import("./PipelineConfigPage-6tfkv6hj.js"),__vite__mapDeps([59,51,5]))),r1=g.lazy(()=>ne(()=>import("./DevWorkflowPage-BoQ2X_5v.js"),__vite__mapDeps([60,51,5]))),u1=g.lazy(()=>ne(()=>import("./PermissionsPage-CfFekX2i.js"),[])),o1=g.lazy(()=>ne(()=>import("./EnvVariablesPage-C6MCWAeN.js"),[])),s1=g.lazy(()=>ne(()=>import("./ArchitecturePage-CZdIr5OG.js"),__vite__mapDeps([61,51,5]))),c1=g.lazy(()=>ne(()=>import("./ChangelogPage-BjXBiyw2.js"),[])),f1=g.lazy(()=>ne(()=>import("./DocsIndexPage-B34B9w-e.js"),__vite__mapDeps([62,33,2,3,34]))),d1=g.lazy(()=>ne(()=>import("./AdminPage-CmzgxmfL.js"),__vite__mapDeps([63,4,2,64,34]))),m1=g.lazy(()=>ne(()=>import("./DeveloperManage-DCXu9nL7.js"),__vite__mapDeps([65,19,45,24,9,14,8,20,4,41,21]))),h1=g.lazy(()=>ne(()=>import("./BotManage-BgzStyGf.js"),__vite__mapDeps([66,19,51,5,37,20,24,9,14,8,2,41]))),p1=g.lazy(()=>ne(()=>import("./TokenManage-DLqC8Oiq.js"),__vite__mapDeps([67,32,5,27,24,9,14,8,20]))),_1=g.lazy(()=>ne(()=>import("./AuditLogPage-B46ZPniK.js"),__vite__mapDeps([68,19,24,9,64,11]))),g1=g.lazy(()=>ne(()=>import("./SettingsPage-Y6Uo5-cT.js"),[]));function y1(){return m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function v1(){const r=xa(u=>u.sessionExpired);return m.jsxs(x0,{children:[m.jsx(A0,{}),m.jsx(S0,{children:m.jsxs(Nv,{children:[m.jsx(k0,{isOpen:r}),m.jsx(g.Suspense,{fallback:m.jsx(y1,{}),children:m.jsxs(sv,{children:[m.jsx(te,{path:"/",element:m.jsx(z0,{})}),m.jsx(te,{path:"/login",element:m.jsx(O0,{})}),m.jsx(te,{path:"/totp-setup",element:m.jsx(li,{children:m.jsx(C0,{})})}),m.jsx(te,{path:"/bind",element:m.jsx(li,{children:m.jsx(Z0,{})})}),m.jsxs(te,{element:m.jsx(li,{children:m.jsx(b0,{})}),children:[m.jsx(te,{path:"/home",element:m.jsx(M0,{})}),m.jsx(te,{path:"/dashboard",element:m.jsx(N0,{})}),m.jsx(te,{path:"/tasks",element:m.jsx(U0,{})}),m.jsx(te,{path:"/tasks/:id",element:m.jsx(q0,{})}),m.jsx(te,{path:"/workers",element:m.jsx(L0,{})}),m.jsx(te,{path:"/workers/setup",element:m.jsx(li,{requireAdmin:!0,children:m.jsx(B0,{})})}),m.jsx(te,{path:"/workers/:id",element:m.jsx(H0,{})}),m.jsx(te,{path:"/projects",element:m.jsx(Y0,{})}),m.jsx(te,{path:"/projects/:key",element:m.jsx(G0,{})}),m.jsx(te,{path:"/projects/:key/edit",element:m.jsx(V0,{})}),m.jsx(te,{path:"/projects/:key/pipeline",element:m.jsx(X0,{})}),m.jsx(te,{path:"/profile",element:m.jsx(Q0,{})}),m.jsx(te,{path:"/access-tokens",element:m.jsx(K0,{})}),m.jsxs(te,{path:"/docs",element:m.jsx(F0,{}),children:[m.jsx(te,{index:!0,element:m.jsx(ll,{to:"cli",replace:!0})}),m.jsx(te,{path:"cli",element:m.jsx(J0,{})}),m.jsx(te,{path:"api",element:m.jsx($0,{})}),m.jsx(te,{path:"bot",element:m.jsx(Ch,{})}),m.jsx(te,{path:"all",element:m.jsx(f1,{})}),m.jsx(te,{path:"skill",element:m.jsx(W0,{})}),m.jsx(te,{path:"installation",element:m.jsx(I0,{})}),m.jsx(te,{path:"developer-setup",element:m.jsx(P0,{})}),m.jsx(te,{path:"worker-setup",element:m.jsx(e1,{})}),m.jsx(te,{path:"bot-setup",element:m.jsx(t1,{})}),m.jsx(te,{path:"local-development",element:m.jsx(a1,{})}),m.jsx(te,{path:"worker-operations",element:m.jsx(n1,{})}),m.jsx(te,{path:"deployment",element:m.jsx(l1,{})}),m.jsx(te,{path:"bot-integration",element:m.jsx(Ch,{})}),m.jsx(te,{path:"pipeline-config",element:m.jsx(i1,{})}),m.jsx(te,{path:"dev-workflow",element:m.jsx(r1,{})}),m.jsx(te,{path:"permissions",element:m.jsx(u1,{})}),m.jsx(te,{path:"env-variables",element:m.jsx(o1,{})}),m.jsx(te,{path:"architecture",element:m.jsx(s1,{})}),m.jsx(te,{path:"changelog",element:m.jsx(c1,{})})]}),m.jsxs(te,{path:"/admin",element:m.jsx(li,{requireAdmin:!0,children:m.jsx(d1,{})}),children:[m.jsx(te,{index:!0,element:m.jsx(ll,{to:"developers",replace:!0})}),m.jsx(te,{path:"developers",element:m.jsx(m1,{})}),m.jsx(te,{path:"bots",element:m.jsx(h1,{})}),m.jsx(te,{path:"tokens",element:m.jsx(p1,{})}),m.jsx(te,{path:"audit-logs",element:m.jsx(_1,{})}),m.jsx(te,{path:"settings",element:m.jsx(g1,{})})]})]}),m.jsx(te,{path:"*",element:m.jsx(D0,{})})]})})]})})]})}function b1(r){var u,s;return((u=r.matchMedia)==null?void 0:u.call(r,"(display-mode: standalone)").matches)===!0||((s=r.navigator)==null?void 0:s.standalone)===!0}function x1(r){var s,o;const u=((s=r.navigator)==null?void 0:s.userAgent)??"";return/iPhone|iPad|iPod/i.test(u)||/Macintosh/i.test(u)&&(((o=r.navigator)==null?void 0:o.maxTouchPoints)??0)>1}function S1(r){const u=r.activeElement;if(!(u instanceof HTMLElement))return!1;const s=u.tagName;return u.isContentEditable||s==="INPUT"||s==="TEXTAREA"||s==="SELECT"}function k1(r){const u=r.screen;if(!u)return null;const s=Math.round(u.width),o=Math.round(u.height);return r.innerHeight>=r.innerWidth?Math.max(s,o):Math.min(s,o)}function E1(r=window,u=document){const s=u.documentElement,o=r.visualViewport??null,f=()=>{const h=Math.round((o==null?void 0:o.height)??0),p=Math.round(r.innerHeight);let b=h>0?h:p;if(b1(r)&&x1(r)&&!S1(u)){const y=k1(r);y!==null&&(b=Math.max(b,p,y))}s.style.setProperty("--app-height",`${b}px`)};return f(),r.addEventListener("resize",f),r.addEventListener("orientationchange",f),o==null||o.addEventListener("resize",f),o==null||o.addEventListener("scroll",f),()=>{r.removeEventListener("resize",f),r.removeEventListener("orientationchange",f),o==null||o.removeEventListener("resize",f),o==null||o.removeEventListener("scroll",f)}}xa.getState().initialize();E1(window,document);const w1=window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0;if(w1){document.documentElement.classList.add("pwa-standalone");const r=window.matchMedia("(prefers-color-scheme: dark)").matches,u=localStorage.getItem("overlord-theme"),s=u==="dark"||u!=="light"&&r;document.body.style.backgroundColor=s?"#171717":"#FFFFFF",new MutationObserver(()=>{const o=document.documentElement.classList.contains("dark");document.body.style.backgroundColor=o?"#171717":"#FFFFFF"}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}uy.createRoot(document.getElementById("root")).render(m.jsx(g.StrictMode,{children:m.jsx(v1,{})}));export{C1 as A,ep as B,Jv as C,ip as D,rb as E,R1 as F,N1 as G,Ns as H,D1 as I,Pv as J,nb as K,$h as L,ub as M,ll as N,fb as O,r0 as P,Js as Q,Rr as R,ap as S,sp as T,uv as U,M1 as V,z1 as W,lp as X,U1 as Y,Iv as Z,Vt as a,$s as b,xe as c,cb as d,lb as e,Fa as f,gt as g,Xr as h,yb as i,m as j,Sb as k,Fr as l,A1 as m,H1 as n,L1 as o,tp as p,Ph as q,g as r,q1 as s,Wa as t,xa as u,n0 as v,j1 as w,Fv as x,np as y,O1 as z};