@ashlr/hub 3.5.1 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/README.md +3 -0
  3. package/dist/build-identity.json +2 -2
  4. package/dist/cli/activation.d.ts +41 -0
  5. package/dist/cli/activation.js +485 -0
  6. package/dist/cli/activation.js.map +1 -0
  7. package/dist/core/daemon/cutoff-checkpoint-scheduler.js +7 -0
  8. package/dist/core/daemon/cutoff-checkpoint-scheduler.js.map +1 -1
  9. package/dist/core/daemon/loop.d.ts +19 -0
  10. package/dist/core/daemon/loop.js +235 -5
  11. package/dist/core/daemon/loop.js.map +1 -1
  12. package/dist/core/daemon/overnight-status.d.ts +152 -0
  13. package/dist/core/daemon/overnight-status.js +275 -0
  14. package/dist/core/daemon/overnight-status.js.map +1 -0
  15. package/dist/core/daemon/post-merge-halt.d.ts +212 -0
  16. package/dist/core/daemon/post-merge-halt.js +503 -0
  17. package/dist/core/daemon/post-merge-halt.js.map +1 -0
  18. package/dist/core/daemon/run-window.d.ts +218 -0
  19. package/dist/core/daemon/run-window.js +420 -0
  20. package/dist/core/daemon/run-window.js.map +1 -0
  21. package/dist/core/fleet/generated-repair-resolution.d.ts +36 -0
  22. package/dist/core/fleet/generated-repair-resolution.js +245 -0
  23. package/dist/core/fleet/generated-repair-resolution.js.map +1 -0
  24. package/dist/core/local-runtime/llama/port.d.ts +17 -0
  25. package/dist/core/local-runtime/llama/port.js +47 -0
  26. package/dist/core/local-runtime/llama/port.js.map +1 -0
  27. package/dist/core/local-runtime/llama/proxy-host.d.ts +54 -0
  28. package/dist/core/local-runtime/llama/proxy-host.js +159 -0
  29. package/dist/core/local-runtime/llama/proxy-host.js.map +1 -0
  30. package/dist/core/local-runtime/llama/proxy-process.d.ts +148 -0
  31. package/dist/core/local-runtime/llama/proxy-process.js +250 -0
  32. package/dist/core/local-runtime/llama/proxy-process.js.map +1 -0
  33. package/dist/core/local-runtime/llama/proxy-record.d.ts +40 -0
  34. package/dist/core/local-runtime/llama/proxy-record.js +133 -0
  35. package/dist/core/local-runtime/llama/proxy-record.js.map +1 -0
  36. package/dist/core/local-runtime/llama/proxy-supervisor.d.ts +118 -0
  37. package/dist/core/local-runtime/llama/proxy-supervisor.js +511 -0
  38. package/dist/core/local-runtime/llama/proxy-supervisor.js.map +1 -0
  39. package/dist/core/web/public/next/assets/{App-BbVoUCIi.js → App-vtaHB9mp.js} +2 -2
  40. package/dist/core/web/public/next/assets/{App-BbVoUCIi.js.map → App-vtaHB9mp.js.map} +1 -1
  41. package/dist/core/web/public/next/assets/{ApprovalsSection-BW9iVjUa.js → ApprovalsSection-B-bFJ0I9.js} +2 -2
  42. package/dist/core/web/public/next/assets/{ApprovalsSection-BW9iVjUa.js.map → ApprovalsSection-B-bFJ0I9.js.map} +1 -1
  43. package/dist/core/web/public/next/assets/{AutonomySection-Cpk_oEhc.css → AutonomySection-CHjxJt2z.css} +1 -1
  44. package/dist/core/web/public/next/assets/AutonomySection-DoqmsCjw.js +2 -0
  45. package/dist/core/web/public/next/assets/AutonomySection-DoqmsCjw.js.map +1 -0
  46. package/dist/core/web/public/next/assets/ChatSection-BfnLe5dT.css +1 -0
  47. package/dist/core/web/public/next/assets/ChatSection-vNPIJffd.js +80 -0
  48. package/dist/core/web/public/next/assets/ChatSection-vNPIJffd.js.map +1 -0
  49. package/dist/core/web/public/next/assets/{ConfirmDialog-CXevY3Au.js → ConfirmDialog-Dd2APQhB.js} +2 -2
  50. package/dist/core/web/public/next/assets/{ConfirmDialog-CXevY3Au.js.map → ConfirmDialog-Dd2APQhB.js.map} +1 -1
  51. package/dist/core/web/public/next/assets/{Dialog-Bn0CgEGz.js → Dialog-CPM9JxBc.js} +2 -2
  52. package/dist/core/web/public/next/assets/{Dialog-Bn0CgEGz.js.map → Dialog-CPM9JxBc.js.map} +1 -1
  53. package/dist/core/web/public/next/assets/{DiffViewer-QKyisN2L.js → DiffViewer-B84qVef9.js} +2 -2
  54. package/dist/core/web/public/next/assets/{DiffViewer-QKyisN2L.js.map → DiffViewer-B84qVef9.js.map} +1 -1
  55. package/dist/core/web/public/next/assets/McpSection-CEUpV_5X.js +2 -0
  56. package/dist/core/web/public/next/assets/McpSection-CEUpV_5X.js.map +1 -0
  57. package/dist/core/web/public/next/assets/McpSection-D88QlDpG.css +1 -0
  58. package/dist/core/web/public/next/assets/Meter--h3MmZS-.js +2 -0
  59. package/dist/core/web/public/next/assets/Meter--h3MmZS-.js.map +1 -0
  60. package/dist/core/web/public/next/assets/Meter-CLcr-4wS.css +1 -0
  61. package/dist/core/web/public/next/assets/{MutationTokenDialog-DbSHPy3w.js → MutationTokenDialog-DA8t97XT.js} +2 -2
  62. package/dist/core/web/public/next/assets/{MutationTokenDialog-DbSHPy3w.js.map → MutationTokenDialog-DA8t97XT.js.map} +1 -1
  63. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-C-PCgCzo.js → ResourcePoolConsoleApp-Bq7Vyud0.js} +2 -2
  64. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-C-PCgCzo.js.map → ResourcePoolConsoleApp-Bq7Vyud0.js.map} +1 -1
  65. package/dist/core/web/public/next/assets/{RouteErrorBoundary-Dw8ZjmkS.js → RouteErrorBoundary-Badio_uO.js} +2 -2
  66. package/dist/core/web/public/next/assets/{RouteErrorBoundary-Dw8ZjmkS.js.map → RouteErrorBoundary-Badio_uO.js.map} +1 -1
  67. package/dist/core/web/public/next/assets/SettingsSection-BwrpQlpP.js +2 -0
  68. package/dist/core/web/public/next/assets/SettingsSection-BwrpQlpP.js.map +1 -0
  69. package/dist/core/web/public/next/assets/{UniverseConsoleApp-Bk5HipM0.js → UniverseConsoleApp-_FSohAdN.js} +2 -2
  70. package/dist/core/web/public/next/assets/{UniverseConsoleApp-Bk5HipM0.js.map → UniverseConsoleApp-_FSohAdN.js.map} +1 -1
  71. package/dist/core/web/public/next/assets/{UniverseView-D8k9q0ce.js → UniverseView-DqcXbed4.js} +2 -2
  72. package/dist/core/web/public/next/assets/{UniverseView-D8k9q0ce.js.map → UniverseView-DqcXbed4.js.map} +1 -1
  73. package/dist/core/web/public/next/assets/{UsageSection-B2E06ZH1.js → UsageSection-Bq6Daaby.js} +2 -2
  74. package/dist/core/web/public/next/assets/{UsageSection-B2E06ZH1.js.map → UsageSection-Bq6Daaby.js.map} +1 -1
  75. package/dist/core/web/public/next/assets/VerseConsoleApp-CMkCizvL.css +1 -0
  76. package/dist/core/web/public/next/assets/VerseConsoleApp-CsIQv9id.js +3 -0
  77. package/dist/core/web/public/next/assets/VerseConsoleApp-CsIQv9id.js.map +1 -0
  78. package/dist/core/web/public/next/assets/{charts-DSUpczxG.js → charts-CTZJ-JrH.js} +2 -2
  79. package/dist/core/web/public/next/assets/{charts-DSUpczxG.js.map → charts-CTZJ-JrH.js.map} +1 -1
  80. package/dist/core/web/public/next/assets/global-D6bTxIRn.js +2 -0
  81. package/dist/core/web/public/next/assets/global-D6bTxIRn.js.map +1 -0
  82. package/dist/core/web/public/next/assets/global-z-JfD3ow.css +1 -0
  83. package/dist/core/web/public/next/assets/{icons-BxOX8-XB.js → icons-D9vlf85u.js} +2 -2
  84. package/dist/core/web/public/next/assets/{icons-BxOX8-XB.js.map → icons-D9vlf85u.js.map} +1 -1
  85. package/dist/core/web/public/next/assets/{index-BMRIET7F.js → index-CZamKRUg.js} +3 -3
  86. package/dist/core/web/public/next/assets/{index-BMRIET7F.js.map → index-CZamKRUg.js.map} +1 -1
  87. package/dist/core/web/public/next/assets/{queries-AxnVa02h.js → queries-B8eBnFox.js} +2 -2
  88. package/dist/core/web/public/next/assets/{queries-AxnVa02h.js.map → queries-B8eBnFox.js.map} +1 -1
  89. package/dist/core/web/public/next/assets/{use-guarded-action-BO6c94Wp.js → use-guarded-action-bzrVVAYq.js} +2 -2
  90. package/dist/core/web/public/next/assets/{use-guarded-action-BO6c94Wp.js.map → use-guarded-action-bzrVVAYq.js.map} +1 -1
  91. package/dist/core/web/public/next/assets/workspace-model-v0a1gl-C.js +2 -0
  92. package/dist/core/web/public/next/assets/workspace-model-v0a1gl-C.js.map +1 -0
  93. package/dist/core/web/public/next/index.html +1 -1
  94. package/dist/release-dependency-inventory.json +1 -1
  95. package/package.json +1 -1
  96. package/dist/core/web/public/next/assets/AutonomySection-CRqHUhED.js +0 -2
  97. package/dist/core/web/public/next/assets/AutonomySection-CRqHUhED.js.map +0 -1
  98. package/dist/core/web/public/next/assets/ChatSection-5irrh6Jw.js +0 -80
  99. package/dist/core/web/public/next/assets/ChatSection-5irrh6Jw.js.map +0 -1
  100. package/dist/core/web/public/next/assets/ChatSection-LQiAn6Eu.css +0 -1
  101. package/dist/core/web/public/next/assets/SettingsSection-CWxtTNlD.js +0 -2
  102. package/dist/core/web/public/next/assets/SettingsSection-CWxtTNlD.js.map +0 -1
  103. package/dist/core/web/public/next/assets/VerseConsoleApp-CRfZUV-T.js +0 -3
  104. package/dist/core/web/public/next/assets/VerseConsoleApp-CRfZUV-T.js.map +0 -1
  105. package/dist/core/web/public/next/assets/VerseConsoleApp-D2E3mU9a.css +0 -1
  106. package/dist/core/web/public/next/assets/global-C4jfYHrj.js +0 -2
  107. package/dist/core/web/public/next/assets/global-C4jfYHrj.js.map +0 -1
  108. package/dist/core/web/public/next/assets/global-D463gG1X.css +0 -1
  109. package/dist/core/web/public/next/assets/workspace-model-cE4LkKpE.js +0 -2
  110. package/dist/core/web/public/next/assets/workspace-model-cE4LkKpE.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import{a as e,i as t,n,o as r,t as i}from"./index-BMRIET7F.js";import{E as a,K as o,M as s,N as c,P as l,U as u,_ as d,a as f,c as p,f as m,g as h,i as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,v as w,x as T,y as ee}from"./global-C4jfYHrj.js";import{t as te}from"./Dialog-Bn0CgEGz.js";import{a as ne,i as E,n as re,o as D,r as ie,t as ae}from"./RouteErrorBoundary-Dw8ZjmkS.js";import{C as O,_ as oe,a as se,b as ce,c as le,d as ue,f as de,g as fe,h as pe,i as me,l as he,m as ge,n as _e,o as ve,p as ye,r as be,s as xe,t as Se,u as Ce,v as we,y as Te}from"./queries-AxnVa02h.js";import{a as Ee,i as De,n as Oe,r as ke,t as Ae}from"./ConfirmDialog-CXevY3Au.js";import{t as je}from"./MutationTokenDialog-DbSHPy3w.js";import{r as Me,t as Ne}from"./UniverseView-D8k9q0ce.js";import{a as Pe,c as Fe,f as Ie,i as Le,l as Re,n as k,r as ze,s as Be,t as Ve}from"./charts-DSUpczxG.js";import{t as He}from"./DiffViewer-QKyisN2L.js";var A=r(e(),1),Ue=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,We=/^[\\/]{2}/;function Ge(e,t){return t+e.replace(/\\/g,`/`)}var Ke=`popstate`;function qe(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Je(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=et(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),Qe(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:$e(t))}function r(e,t){Ye(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return tt(t,n,r,e)}function j(e,t){if(e===!1||e==null)throw Error(t)}function Ye(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Xe(){return Math.random().toString(36).substring(2,10)}function Ze(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Qe(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?et(t):t,state:n,key:t&&t.key||r||Xe(),mask:i}}function $e({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function et(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function tt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=qe(e)?e:Qe(h.location,e,t);n&&n(r,e),l=u()+1;let d=Ze(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=qe(e)?e:Qe(h.location,e,t);n&&n(r,e),l=u();let i=Ze(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return nt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Ke,d),c=e,()=>{i.removeEventListener(Ke,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function nt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),j(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:$e(t);return i=i.replace(/ $/,`%20`),!n&&We.test(i)&&(i=r+i),new URL(i,r)}function rt(e,t,n=`/`){return it(e,t,n,!1)}function it(e,t,n,r,i){let a=Ct((typeof t==`string`?et(t):t).pathname||`/`,n);if(a==null)return null;let o=i??at(e),s=null,c=St(a);for(let e=0;s==null&&e<o.length;++e)s=vt(o[e],c,r);return s}function at(e){let t=ot(e);return ct(t),t}function ot(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;j(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=jt([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(j(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ot(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:gt(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=xt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of st(e.path))a(e,t,!0,n)}),t}function st(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=st(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ct(e){e.sort((e,t)=>e.score===t.score?_t(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var lt=/^:[\w-]+$/,ut=3,dt=2,ft=1,pt=10,mt=-2,ht=e=>e===`*`;function gt(e,t){let n=e.split(`/`),r=n.length;return n.some(ht)&&(r+=mt),t&&(r+=dt),n.filter(e=>!ht(e)).reduce((e,t)=>e+(lt.test(t)?ut:t===``?ft:pt),r)}function _t(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function vt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?bt(u,l,s.matcher,s.compiledParams):yt(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=yt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:jt([a,d.pathname]),pathnameBase:Nt(jt([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=jt([a,d.pathnameBase]))}return o}function yt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=xt(e.path,e.caseSensitive,e.end);return bt(e,t,n,r)}function bt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Mt(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Mt(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function xt(e,t=!1,n=!0){Ye(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function St(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Ye(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ct(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function wt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?et(e):e,a;return n?(n=At(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Tt(n.substring(1),`/`):Tt(n,t)):a=t,{pathname:a,search:Pt(r),hash:Ft(i)}}function Tt(e,t){let n=Mt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Et(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Dt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ot(e){let t=Dt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function kt(e,t,n,r=!1){let i;typeof e==`string`?i=et(e):(i={...e},j(!i.pathname||!i.pathname.includes(`?`),Et(`?`,`pathname`,`search`,i)),j(!i.pathname||!i.pathname.includes(`#`),Et(`#`,`pathname`,`hash`,i)),j(!i.search||!i.search.includes(`#`),Et(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=wt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var At=e=>e.replace(/[\\/]{2,}/g,`/`),jt=e=>At(e.join(`/`));function Mt(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Nt=e=>Mt(e).replace(/^\/*/,`/`),Pt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ft=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,It=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Lt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Rt(e){return jt(e.map(e=>e.route.path).filter(Boolean))||`/`}var zt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Bt(e,t){let n=e;if(typeof n!=`string`||!Ue.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(zt)try{let e=new URL(window.location.href),r=We.test(n)?new URL(Ge(n,e.protocol)):new URL(n),a=Ct(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Ye(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Vt=new URL(`http://localhost`);function Ht(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Vt)}catch{return Vt}}function Ut(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Wt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Gt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Ut(i,n),s=!Ut(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Wt(e,i)||!Ut(i,a)))throw Error(`External navigation is not allowed`)}var Kt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Kt);var qt=[`GET`,...Kt];new Set(qt);var Jt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Yt(e){try{return Jt.includes(new URL(e).protocol)}catch{return!1}}var Xt=A.createContext(null);Xt.displayName=`DataRouter`;var Zt=A.createContext(null);Zt.displayName=`DataRouterState`;var Qt=A.createContext(!1);function $t(){return A.useContext(Qt)}var en=A.createContext({isTransitioning:!1});en.displayName=`ViewTransition`;var tn=A.createContext(new Map);tn.displayName=`Fetchers`;var nn=A.createContext(null);nn.displayName=`Await`;var M=A.createContext(null);M.displayName=`Navigation`;var rn=A.createContext(null);rn.displayName=`Location`;var N=A.createContext({outlet:null,matches:[],isDataRoute:!1});N.displayName=`Route`;var an=A.createContext(null);an.displayName=`RouteError`;var on=`REACT_ROUTER_ERROR`,sn=`REDIRECT`,cn=`ROUTE_ERROR_RESPONSE`;function ln(e){if(e.startsWith(`${on}:${sn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function un(e){if(e.startsWith(`${on}:${cn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new It(t.status,t.statusText,t.data)}catch{}}function dn(e,{relative:t}={}){j(fn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=A.useContext(M),{hash:i,pathname:a,search:o}=bn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:jt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function fn(){return A.useContext(rn)!=null}function P(){return j(fn(),`useLocation() may be used only in the context of a <Router> component.`),A.useContext(rn).location}var pn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function mn(e){A.useContext(M).static||A.useLayoutEffect(e)}function hn(){let{isDataRoute:e}=A.useContext(N);return e?Ln():gn()}function gn(){j(fn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=A.useContext(Xt),{basename:t,navigator:n}=A.useContext(M),{matches:r}=A.useContext(N),{pathname:i}=P(),a=JSON.stringify(Ot(r)),o=A.useRef(!1);return mn(()=>{o.current=!0}),A.useCallback((r,s={})=>{if(Ye(o.current,pn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=kt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:jt([t,c.pathname])),Gt(typeof r==`string`?r:$e(r),n.createHref(c),Ht(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var _n=A.createContext(null);function vn(e){let t=A.useContext(N).outlet;return A.useMemo(()=>t&&A.createElement(_n.Provider,{value:e},t),[t,e])}function yn(){let{matches:e}=A.useContext(N);return e[e.length-1]?.params??{}}function bn(e,{relative:t}={}){let{matches:n}=A.useContext(N),{pathname:r}=P(),i=JSON.stringify(Ot(n));return A.useMemo(()=>kt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function xn(e,t){return Sn(e,t)}function Sn(e,t,n){j(fn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=A.useContext(M),{matches:i}=A.useContext(N),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;zn(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) 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.
1
+ import{a as e,i as t,n,o as r,t as i}from"./index-CZamKRUg.js";import{E as a,K as o,M as s,N as c,P as l,U as u,_ as d,a as f,c as p,f as m,g as h,i as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,v as w,x as T,y as ee}from"./global-D6bTxIRn.js";import{t as te}from"./Dialog-CPM9JxBc.js";import{a as ne,i as E,n as re,o as D,r as ie,t as ae}from"./RouteErrorBoundary-Badio_uO.js";import{C as O,_ as oe,a as se,b as ce,c as le,d as ue,f as de,g as fe,h as pe,i as me,l as he,m as ge,n as _e,o as ve,p as ye,r as be,s as xe,t as Se,u as Ce,v as we,y as Te}from"./queries-B8eBnFox.js";import{a as Ee,i as De,n as Oe,r as ke,t as Ae}from"./ConfirmDialog-Dd2APQhB.js";import{t as je}from"./MutationTokenDialog-DA8t97XT.js";import{r as Me,t as Ne}from"./UniverseView-DqcXbed4.js";import{a as Pe,c as Fe,f as Ie,i as Le,l as Re,n as k,r as ze,s as Be,t as Ve}from"./charts-CTZJ-JrH.js";import{t as He}from"./DiffViewer-B84qVef9.js";var A=r(e(),1),Ue=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,We=/^[\\/]{2}/;function Ge(e,t){return t+e.replace(/\\/g,`/`)}var Ke=`popstate`;function qe(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Je(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=et(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),Qe(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:$e(t))}function r(e,t){Ye(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return tt(t,n,r,e)}function j(e,t){if(e===!1||e==null)throw Error(t)}function Ye(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Xe(){return Math.random().toString(36).substring(2,10)}function Ze(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Qe(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?et(t):t,state:n,key:t&&t.key||r||Xe(),mask:i}}function $e({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function et(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function tt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=qe(e)?e:Qe(h.location,e,t);n&&n(r,e),l=u()+1;let d=Ze(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=qe(e)?e:Qe(h.location,e,t);n&&n(r,e),l=u();let i=Ze(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return nt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Ke,d),c=e,()=>{i.removeEventListener(Ke,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function nt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),j(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:$e(t);return i=i.replace(/ $/,`%20`),!n&&We.test(i)&&(i=r+i),new URL(i,r)}function rt(e,t,n=`/`){return it(e,t,n,!1)}function it(e,t,n,r,i){let a=Ct((typeof t==`string`?et(t):t).pathname||`/`,n);if(a==null)return null;let o=i??at(e),s=null,c=St(a);for(let e=0;s==null&&e<o.length;++e)s=vt(o[e],c,r);return s}function at(e){let t=ot(e);return ct(t),t}function ot(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;j(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=jt([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(j(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ot(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:gt(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=xt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of st(e.path))a(e,t,!0,n)}),t}function st(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=st(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ct(e){e.sort((e,t)=>e.score===t.score?_t(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var lt=/^:[\w-]+$/,ut=3,dt=2,ft=1,pt=10,mt=-2,ht=e=>e===`*`;function gt(e,t){let n=e.split(`/`),r=n.length;return n.some(ht)&&(r+=mt),t&&(r+=dt),n.filter(e=>!ht(e)).reduce((e,t)=>e+(lt.test(t)?ut:t===``?ft:pt),r)}function _t(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function vt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?bt(u,l,s.matcher,s.compiledParams):yt(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=yt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:jt([a,d.pathname]),pathnameBase:Nt(jt([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=jt([a,d.pathnameBase]))}return o}function yt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=xt(e.path,e.caseSensitive,e.end);return bt(e,t,n,r)}function bt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Mt(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Mt(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function xt(e,t=!1,n=!0){Ye(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function St(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Ye(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ct(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function wt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?et(e):e,a;return n?(n=At(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Tt(n.substring(1),`/`):Tt(n,t)):a=t,{pathname:a,search:Pt(r),hash:Ft(i)}}function Tt(e,t){let n=Mt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Et(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Dt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ot(e){let t=Dt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function kt(e,t,n,r=!1){let i;typeof e==`string`?i=et(e):(i={...e},j(!i.pathname||!i.pathname.includes(`?`),Et(`?`,`pathname`,`search`,i)),j(!i.pathname||!i.pathname.includes(`#`),Et(`#`,`pathname`,`hash`,i)),j(!i.search||!i.search.includes(`#`),Et(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=wt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var At=e=>e.replace(/[\\/]{2,}/g,`/`),jt=e=>At(e.join(`/`));function Mt(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Nt=e=>Mt(e).replace(/^\/*/,`/`),Pt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ft=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,It=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Lt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Rt(e){return jt(e.map(e=>e.route.path).filter(Boolean))||`/`}var zt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Bt(e,t){let n=e;if(typeof n!=`string`||!Ue.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(zt)try{let e=new URL(window.location.href),r=We.test(n)?new URL(Ge(n,e.protocol)):new URL(n),a=Ct(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Ye(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Vt=new URL(`http://localhost`);function Ht(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Vt)}catch{return Vt}}function Ut(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Wt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Gt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Ut(i,n),s=!Ut(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Wt(e,i)||!Ut(i,a)))throw Error(`External navigation is not allowed`)}var Kt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Kt);var qt=[`GET`,...Kt];new Set(qt);var Jt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Yt(e){try{return Jt.includes(new URL(e).protocol)}catch{return!1}}var Xt=A.createContext(null);Xt.displayName=`DataRouter`;var Zt=A.createContext(null);Zt.displayName=`DataRouterState`;var Qt=A.createContext(!1);function $t(){return A.useContext(Qt)}var en=A.createContext({isTransitioning:!1});en.displayName=`ViewTransition`;var tn=A.createContext(new Map);tn.displayName=`Fetchers`;var nn=A.createContext(null);nn.displayName=`Await`;var M=A.createContext(null);M.displayName=`Navigation`;var rn=A.createContext(null);rn.displayName=`Location`;var N=A.createContext({outlet:null,matches:[],isDataRoute:!1});N.displayName=`Route`;var an=A.createContext(null);an.displayName=`RouteError`;var on=`REACT_ROUTER_ERROR`,sn=`REDIRECT`,cn=`ROUTE_ERROR_RESPONSE`;function ln(e){if(e.startsWith(`${on}:${sn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function un(e){if(e.startsWith(`${on}:${cn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new It(t.status,t.statusText,t.data)}catch{}}function dn(e,{relative:t}={}){j(fn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=A.useContext(M),{hash:i,pathname:a,search:o}=bn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:jt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function fn(){return A.useContext(rn)!=null}function P(){return j(fn(),`useLocation() may be used only in the context of a <Router> component.`),A.useContext(rn).location}var pn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function mn(e){A.useContext(M).static||A.useLayoutEffect(e)}function hn(){let{isDataRoute:e}=A.useContext(N);return e?Ln():gn()}function gn(){j(fn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=A.useContext(Xt),{basename:t,navigator:n}=A.useContext(M),{matches:r}=A.useContext(N),{pathname:i}=P(),a=JSON.stringify(Ot(r)),o=A.useRef(!1);return mn(()=>{o.current=!0}),A.useCallback((r,s={})=>{if(Ye(o.current,pn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=kt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:jt([t,c.pathname])),Gt(typeof r==`string`?r:$e(r),n.createHref(c),Ht(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var _n=A.createContext(null);function vn(e){let t=A.useContext(N).outlet;return A.useMemo(()=>t&&A.createElement(_n.Provider,{value:e},t),[t,e])}function yn(){let{matches:e}=A.useContext(N);return e[e.length-1]?.params??{}}function bn(e,{relative:t}={}){let{matches:n}=A.useContext(N),{pathname:r}=P(),i=JSON.stringify(Ot(n));return A.useMemo(()=>kt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function xn(e,t){return Sn(e,t)}function Sn(e,t,n){j(fn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=A.useContext(M),{matches:i}=A.useContext(N),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;zn(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) 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.
2
2
 
3
3
  Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=P(),d;if(t){let e=typeof t==`string`?et(t):t;j(c===`/`||e.pathname?.startsWith(c),`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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):rt(e,{pathname:p});Ye(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Ye(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 h=kn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:jt([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:jt([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?A.createElement(rn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Cn(){let e=In(),t=Lt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=A.createElement(A.Fragment,null,A.createElement(`p`,null,`💿 Hey developer 👋`),A.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,A.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,A.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),A.createElement(A.Fragment,null,A.createElement(`h2`,null,`Unexpected Application Error!`),A.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?A.createElement(`pre`,{style:i},n):null,o)}var wn=A.createElement(Cn,null),Tn=class extends A.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=un(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:A.createElement(N.Provider,{value:this.props.routeContext},A.createElement(an.Provider,{value:e,children:this.props.component}));return this.context?A.createElement(Dn,{error:e},t):t}};Tn.contextType=Qt;var En=new WeakMap;function Dn({children:e,error:t}){let{basename:n,navigator:r}=A.useContext(M);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ln(t.digest);if(e){let i=En.get(t);if(i)throw i;let a=Bt(e.location,n),o=a.absoluteURL||a.to;if(Gt(e.location,o,Ht(r),`allow-explicit`),Yt(o))throw Error(`Invalid redirect location`);if(zt&&!En.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw En.set(t,n),n}}return A.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function On({routeContext:e,match:t,children:n}){let r=A.useContext(Xt);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),A.createElement(N.Provider,{value:e},n)}function kn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);j(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Rt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||wn,o&&(s<0&&c===0?(zn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?A.createElement(n.route.Component,null):n.route.element?n.route.element:e,A.createElement(On,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?A.createElement(Tn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function An(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jn(e){let t=A.useContext(Xt);return j(t,An(e)),t}function Mn(e){let t=A.useContext(Zt);return j(t,An(e)),t}function Nn(e){let t=A.useContext(N);return j(t,An(e)),t}function Pn(e){let t=Nn(e),n=t.matches[t.matches.length-1];return j(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Fn(){return Pn(`useRouteId`)}function In(){let e=A.useContext(an),t=Mn(`useRouteError`),n=Pn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ln(){let{router:e}=jn(`useNavigate`),t=Pn(`useNavigate`),n=A.useRef(!1);return mn(()=>{n.current=!0}),A.useCallback(async(r,i={})=>{Ye(n.current,pn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Rn={};function zn(e,t,n){!t&&!Rn[e]&&(Rn[e]=!0,Ye(!1,n))}A.memo(Bn);function Bn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Sn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Vn({to:e,replace:t,state:n,relative:r}){j(fn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=A.useContext(M);Ye(!i,`<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:o}=A.useContext(N),{pathname:s}=P(),c=hn(),l=kt(e,Ot(o),s,r===`path`);Gt(typeof e==`string`?e:$e(e),a.createHref(l),Ht(a),`reject`);let u=JSON.stringify(l);return A.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Hn(e){return vn(e.context)}function F(e){j(!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 Un({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){j(!fn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=A.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=et(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=A.useMemo(()=>{let e=Ct(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Ye(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:A.createElement(M.Provider,{value:c},A.createElement(rn.Provider,{children:t,value:h}))}function Wn({children:e,location:t}){return xn(Gn(e),t)}A.Component;function Gn(e,t=[]){let n=[];return A.Children.forEach(e,(e,r)=>{if(!A.isValidElement(e))return;let i=[...t,r];if(e.type===A.Fragment){n.push.apply(n,Gn(e.props.children,i));return}j(e.type===F,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),j(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Gn(e.props.children,i)),n.push(a)}),n}var Kn=`get`,qn=`application/x-www-form-urlencoded`;function Jn(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Yn(e){return Jn(e)&&e.tagName.toLowerCase()===`button`}function Xn(e){return Jn(e)&&e.tagName.toLowerCase()===`form`}function Zn(e){return Jn(e)&&e.tagName.toLowerCase()===`input`}function Qn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $n(e,t){return e.button===0&&(!t||t===`_self`)&&!Qn(e)}var er=null;function tr(){if(er===null)try{new FormData(document.createElement(`form`),0),er=!1}catch{er=!0}return er}var nr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function rr(e){return e!=null&&!nr.has(e)?(Ye(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${qn}"`),null):e}function ir(e,t){let n,r,i,a,o;if(Xn(e)){let o=e.getAttribute(`action`);r=o?Ct(o,t):null,n=e.getAttribute(`method`)||Kn,i=rr(e.getAttribute(`enctype`))||qn,a=new FormData(e)}else if(Yn(e)||Zn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ct(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Kn,i=rr(e.getAttribute(`formenctype`))||rr(o.getAttribute(`enctype`))||qn,a=new FormData(o,e),!tr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Jn(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Kn,r=null,i=qn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function ar(e,t){if(e===!1||e==null)throw Error(t)}function or(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Ct(i.pathname,t)===`/`?`${Mt(t)}/_root.${r}`:`${Mt(i.pathname)}.${r}`,i}async function sr(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function cr(e){return e!=null&&typeof e.page==`string`}function lr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function ur(e,t,n){return hr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await sr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(lr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function dr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function fr(e,t,{includeHydrateFallback:n}={}){return pr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function pr(e){return[...new Set(e)]}function mr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function hr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!cr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(mr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function gr(){let e=A.useContext(Xt);return ar(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function _r(){let e=A.useContext(Zt);return ar(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var vr=A.createContext(void 0);vr.displayName=`FrameworkContext`;function yr(){let e=A.useContext(vr);return ar(e,`You must render this element inside a <HydratedRouter> element`),e}function br(e,t){let n=A.useContext(vr),[r,i]=A.useState(!1),[a,o]=A.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=A.useRef(null);A.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),A.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:xr(s,p),onBlur:xr(c,m),onMouseEnter:xr(l,p),onMouseLeave:xr(u,m),onTouchStart:xr(d,p)}]:[a,f,{}]:[!1,f,{}]}function xr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Sr({page:e,...t}){let n=$t(),{nonce:r}=yr(),{router:i}=gr(),a=A.useMemo(()=>rt(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?A.createElement(wr,{page:e,matches:a,...t}):A.createElement(Tr,{page:e,matches:a,...t})):null}function Cr(e){let{manifest:t,routeModules:n}=yr(),[r,i]=A.useState([]);return A.useEffect(()=>{let r=!1;return ur(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function wr({page:e,matches:t,...n}){let r=P(),{future:i}=yr(),{basename:a}=gr(),o=A.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=or(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return A.createElement(A.Fragment,null,o.map(e=>A.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Tr({page:e,matches:t,...n}){let r=P(),{future:i,manifest:a,routeModules:o}=yr(),{basename:s}=gr(),{loaderData:c,matches:l}=_r(),u=A.useMemo(()=>dr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=A.useMemo(()=>dr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=A.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=or(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=A.useMemo(()=>fr(d,a),[d,a]),m=Cr(d);return A.createElement(A.Fragment,null,f.map(e=>A.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>A.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>A.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Er(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}A.Component;var Dr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Dr&&(window.__reactRouterVersion=`7.18.4`)}catch{}function Or({basename:e,children:t,useTransitions:n,window:r}){let i=A.useRef();i.current??=Je({window:r,v5Compat:!0});let a=i.current,[o,s]=A.useState({action:a.action,location:a.location}),c=A.useCallback(e=>{n===!1?s(e):A.startTransition(()=>s(e))},[n]);return A.useLayoutEffect(()=>a.listen(c),[a,c]),A.createElement(Un,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var kr=A.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=A.useContext(M),v=typeof l==`string`&&Ue.test(l),y=Bt(l,h);l=y.to;let b=dn(l,{relative:r}),x=P(),S=null;if(o){let e=kt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:jt([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=br(n,p),ee=Pr(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function te(t){e&&e(t),t.defaultPrevented||ee(t)}let ne=!(y.isExternal||i),E=A.createElement(`a`,{...p,...T,href:(ne?S:void 0)||y.absoluteURL||b,onClick:ne?te:e,ref:Er(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?A.createElement(A.Fragment,null,E,A.createElement(Sr,{page:b})):E});kr.displayName=`Link`;var Ar=A.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=bn(a,{relative:c.relative}),d=P(),f=A.useContext(Zt),{navigator:p,basename:m}=A.useContext(M),h=f!=null&&zr(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Ct(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return A.createElement(kr,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Ar.displayName=`NavLink`;var jr=A.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Kn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=A.useContext(M),g=Lr(),_=Rr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Ue.test(s);return A.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?A.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});jr.displayName=`Form`;function Mr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nr(e){let t=A.useContext(Xt);return j(t,Mr(e)),t}function Pr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=hn(),d=P(),f=bn(e,{relative:o});return A.useCallback(p=>{if($n(p,t)){p.preventDefault();let t=n===void 0?$e(d)===$e(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?A.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Fr=0,Ir=()=>`__${String(++Fr)}__`;function Lr(){let{router:e}=Nr(`useSubmit`),{basename:t}=A.useContext(M),n=Fn(),r=e.fetch,i=e.navigate;return A.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ir(e,t);if(a.navigate===!1){let e=a.fetcherKey||Ir();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Rr(e,{relative:t}={}){let{basename:n}=A.useContext(M),r=A.useContext(N);j(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...bn(e||`.`,{relative:t})},o=P();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:jt([n,a.pathname])),$e(a)}function zr(e,{relative:t}={}){let n=A.useContext(en);j(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Nr(`useViewTransitionState`),i=bn(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ct(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ct(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yt(i.pathname,o)!=null||yt(i.pathname,a)!=null}var Br=[{id:`overview`,label:`Overview`,leaves:[{path:`/overview`,label:`Fleet Dashboard`,description:`Repos, activity, runs, swarms, MCP health, genome, and daemon status at a glance.`,implemented:!0},{path:`/agent-os`,label:`Agent OS`,description:`Authenticated, observation-only decision spine for capability runway and value bets.`,implemented:!0},{path:`/universe`,label:`Universe`,description:`Compare experiments, follow variant lineages, and inspect the retained population.`,implemented:!0}]},{id:`journal`,label:`Journal`,leaves:[{path:`/journal`,label:`Work Journal`,description:`Chronological, filterable, scrubable record of runs, merges, judge verdicts, and daemon ticks — with live streaming into any in-progress run.`,implemented:!0}]},{id:`work`,label:`Work`,leaves:[{path:`/work/runs`,label:`Runs`,description:`Dispatched goal runs and their token burn.`,implemented:!0},{path:`/work/swarms`,label:`Swarms`,description:`Multi-task DAG runs with live burndown.`,implemented:!0}]},{id:`inbox`,label:`Inbox`,leaves:[{path:`/inbox`,label:`Proposals`,description:`Review, filter, and approve/reject proposals — including history (rejected/approved).`,implemented:!0}]},{id:`control`,label:`Control`,leaves:[{path:`/control/daemon`,label:`Daemon`,description:`Autonomous operator state, spend, and direction mode.`,implemented:!0},{path:`/control/fleet`,label:`Fleet`,description:`Queue depth, lease health, and the kill switch.`,implemented:!0},{path:`/control/security`,label:`Security`,description:`Supply-chain / binshield findings from the cached backlog.`,implemented:!0}]},{id:`intelligence`,label:`Intelligence`,leaves:[{path:`/intelligence/pulse`,label:`Pulse`,description:`Activity rollups over the dashboard window.`,implemented:!0},{path:`/intelligence/genome`,label:`Genome`,description:`Cross-repo knowledge search and recall.`,implemented:!0},{path:`/intelligence/production`,label:`Production`,description:`Ships-per-day, judge verdicts, auto-merges.`,implemented:!0}]},{id:`portfolio`,label:`Portfolio`,leaves:[{path:`/portfolio`,label:`Portfolio`,description:`Org-level roll-up across enrolled repos.`,implemented:!0}]},{id:`goals`,label:`Goals`,leaves:[{path:`/goals`,label:`Goals`,description:`Active goals and milestone progress.`,implemented:!0}]}],Vr=Br.flatMap(e=>e.leaves),Hr={sidebar:`_sidebar_vbjva_1`,brand:`_brand_vbjva_11`,brandMark:`_brandMark_vbjva_19`,group:`_group_vbjva_23`,groupLabel:`_groupLabel_vbjva_27`,leaves:`_leaves_vbjva_37`,link:`_link_vbjva_43`,active:`_active_vbjva_60`,soon:`_soon_vbjva_66`},I=n();function Ur(){return(0,I.jsxs)(`nav`,{className:Hr.sidebar,"aria-label":`Primary`,children:[(0,I.jsxs)(`div`,{className:Hr.brand,children:[(0,I.jsx)(`span`,{className:Hr.brandMark,"aria-hidden":`true`,children:`▲`}),(0,I.jsx)(`span`,{className:Hr.brandName,children:`ashlr`})]}),Br.map(e=>(0,I.jsxs)(`div`,{className:Hr.group,children:[(0,I.jsx)(`h2`,{className:Hr.groupLabel,children:e.label}),(0,I.jsx)(`ul`,{className:Hr.leaves,children:e.leaves.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(Ar,{to:e.path,className:({isActive:e})=>`${Hr.link} ${e?Hr.active:``}`,children:[e.label,e.implemented?null:(0,I.jsx)(`span`,{className:Hr.soon,children:`soon`})]})},e.path))})]},e.id))]})}var Wr=18e4,Gr=72e5,Kr=864e5;function qr(e){let t=e.toLowerCase();return t.includes(`proposal`)||t.includes(`inbox`)?`/inbox`:t.includes(`security`)||t.includes(`audit`)?`/control/security`:t.includes(`evidence`)||t.includes(`fleet`)||t.includes(`queue`)?`/control/fleet`:`/control/daemon`}function Jr(e){let t=[],n=Date.now();for(let r of e.fleet?.nextActions??[])t.push({id:`next-action-${r.id}`,category:`action-required`,severity:r.priority,title:r.label,detail:r.detail,ts:new Date(n).toISOString(),actionHref:qr(r.id),actionLabel:`Inspect`});let r=e.fleet?.autonomousShipReadiness;r&&(r.verdict===`blocked`&&r.topBlocker?t.push({id:`readiness-blocked-${r.topBlocker.id}`,category:`readiness`,severity:r.topBlocker.severity,title:`Autonomous readiness is blocked`,detail:r.topBlocker.detail,ts:r.freshness.generatedAt,actionHref:`/control/fleet`,actionLabel:`Inspect fleet`}):r.verdict===`unknown`&&t.push({id:`readiness-unknown`,category:`readiness`,severity:`medium`,title:`Autonomous readiness is unknown`,detail:`Fresh, authoritative state is required before autonomous operation can be treated as clear.`,ts:r.freshness.generatedAt,actionHref:`/control/fleet`,actionLabel:`Inspect fleet`}));let i=e.control?.security;if(i?.available){if(i.counts.critical>0){let e=i.findings.find(e=>e.severity===`critical`);t.push({id:`security-critical`,category:`security`,severity:`critical`,title:`${i.counts.critical} critical security finding${i.counts.critical===1?``:`s`}`,detail:e?`${e.repo}: ${e.title}`:`See the security backlog for details.`,ts:new Date(n).toISOString(),actionHref:`/control/security`,actionLabel:`Review findings`})}else if(i.counts.high>0){let e=i.findings.find(e=>e.severity===`high`);t.push({id:`security-high`,category:`security`,severity:`high`,title:`${i.counts.high} high-severity security finding${i.counts.high===1?``:`s`}`,detail:e?`${e.repo}: ${e.title}`:`See the security backlog for details.`,ts:new Date(n).toISOString(),actionHref:`/control/security`,actionLabel:`Review findings`})}}for(let r of e.control?.limits??[])r.standing===`over`?t.push({id:`budget-over-${r.backend}-${r.window}`,category:`budget`,severity:`high`,title:`${r.backend} is over its ${r.window} limit`,detail:`${r.used.toLocaleString()} / ${r.max.toLocaleString()} used.`,ts:new Date(n).toISOString(),actionHref:`/control/daemon`,actionLabel:`Review usage`}):r.standing===`warn`&&t.push({id:`budget-warn-${r.backend}-${r.window}`,category:`budget`,severity:`medium`,title:`${r.backend} is approaching its ${r.window} limit`,detail:`${r.used.toLocaleString()} / ${r.max.toLocaleString()} used.`,ts:new Date(n).toISOString(),actionHref:`/control/daemon`,actionLabel:`Review usage`});let a=e.control?.daemon;if(a&&(a.sourceQuality.sourceState!==`healthy`||a.sourceQuality.complete===!1)){let e=a.sourceQuality.reason;t.push({id:`daemon-health-degraded`,category:`daemon-health`,severity:e===`missing`||e===`unavailable`?`high`:`medium`,title:`Daemon state cannot be confirmed`,detail:e?`Source: ${e}.`:`The daemon state source is degraded or incomplete.`,ts:new Date(n).toISOString(),actionHref:`/control/daemon`,actionLabel:`Inspect daemon`,sourceQuality:a.sourceQuality})}if(e.inbox&&e.inbox.pending>0){let r=e.inbox.proposals.reduce((e,t)=>{let n=new Date(t.createdAt).getTime();return e===null||n<e?n:e},null),i=r===null?0:n-r,a=i>Gr?`high`:`medium`;t.push({id:`proposal-backlog`,category:`proposal`,severity:a,title:`${e.inbox.pending} proposal${e.inbox.pending===1?``:`s`} awaiting review`,detail:i>Gr?`Oldest has been waiting ${Math.round(i/36e5)}h.`:`Approve, reject, or leave for autonomous handling per policy.`,ts:r===null?new Date(n).toISOString():new Date(r).toISOString(),actionHref:`/inbox`,actionLabel:`Open inbox`})}for(let r of e.runs??[]){if(r.status===`failed`||r.status===`aborted`){if(n-new Date(r.updatedAt).getTime()>Kr)continue;t.push({id:`run-failed-${r.id}`,category:`run`,severity:r.status===`failed`?`high`:`medium`,title:`Run ${r.status}: ${r.goal}`,detail:r.result??r.terminationReason??`Run ${r.id} ${r.status}.`,ts:r.updatedAt,actionHref:`/work/runs/${r.id}`,actionLabel:`Open run`});continue}if(r.status===`running`){let e=n-new Date(r.updatedAt).getTime();e>Wr&&t.push({id:`run-stalled-${r.id}`,category:`run`,severity:`medium`,title:`No update from a running run in ${Math.round(e/6e4)}m`,detail:r.goal,ts:r.updatedAt,actionHref:`/work/runs/${r.id}`,actionLabel:`Watch live`})}}return t}function Yr(e){let t={critical:0,high:1,medium:2,low:3,info:4};return[...e].sort((e,n)=>{let r=t[e.severity]-t[n.severity];return r===0?new Date(n.ts).getTime()-new Date(e.ts).getTime():r})}var Xr=`ashlr.notifications.mutedCategories.v1`,Zr=`ashlr.notifications.desktopEnabled.v1`;function Qr(){try{let e=localStorage.getItem(Xr);if(!e)return new Set;let t=JSON.parse(e);if(Array.isArray(t))return new Set(t)}catch{}return new Set}function $r(e){try{localStorage.setItem(Xr,JSON.stringify([...e]))}catch{}}function ei(){try{return localStorage.getItem(Zr)===`1`}catch{return!1}}function ti(){return typeof Notification>`u`?`unsupported`:Notification.permission}var ni=Qr(),ri=[],ii=!1,ai=ei(),oi=new Set,si={items:[],panelOpen:!1,mutedCategories:[...ni],desktopEnabled:ai,desktopPermission:ti()},ci=new Set;function li(){for(let e of ci)e()}function ui(){si={items:Yr(ri.filter(e=>!ni.has(e.category))),panelOpen:ii,mutedCategories:[...ni],desktopEnabled:ai,desktopPermission:ti()},li()}function di(e){return ci.add(e),()=>ci.delete(e)}function fi(){return si}function pi(e){let t=new Set(ri.map(e=>e.id));if(ri=e,ai&&ti()===`granted`){for(let n of e)if(!ni.has(n.category)&&(n.severity===`critical`||n.severity===`high`)&&!(t.has(n.id)||oi.has(n.id))){oi.add(n.id);try{new Notification(n.title,{body:n.detail,tag:n.id})}catch{}}}for(let t of e)oi.add(t.id);ui()}function mi(){ii=!0,ui()}function hi(){ii=!1,ui()}function gi(){ii=!ii,ui()}function _i(e){return ni.has(e)}function vi(e,t){t?ni.add(e):ni.delete(e),$r(ni),ui()}async function yi(){if(typeof Notification>`u`)return`unsupported`;let e=Notification.permission;e==="default"&&(e=await Notification.requestPermission()),ai=e===`granted`;try{localStorage.setItem(Zr,ai?`1`:`0`)}catch{}return ui(),e}function bi(){ai=!1;try{localStorage.setItem(Zr,`0`)}catch{}ui()}function xi(){return(0,A.useSyncExternalStore)(di,fi,fi)}var Si={bell:`_bell_c1uhc_1`,badge:`_badge_c1uhc_25`,badgeUrgent:`_badgeUrgent_c1uhc_41`};function Ci(){let{items:e}=xi(),t=e.filter(e=>e.severity===`critical`||e.severity===`high`).length,n=e.length,r=(0,A.useRef)(t),[i,a]=(0,A.useState)(``);return(0,A.useEffect)(()=>{if(t>r.current){let e=t-r.current;a(`${e} new urgent notification${e===1?``:`s`}, ${t} urgent total.`)}r.current=t},[t]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:Si.bell,onClick:gi,"aria-haspopup":`dialog`,"aria-label":n===0?`Notifications, none open`:`Notifications, ${n} open, ${t} urgent`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`🔔`}),n>0?(0,I.jsx)(`span`,{className:`${Si.badge} ${t>0?Si.badgeUrgent:``}`,"aria-hidden":`true`,children:n>99?`99+`:n}):null]}),(0,I.jsx)(`div`,{"aria-live":`polite`,className:`visually-hidden`,children:i})]})}function wi(e){switch(e){case`critical`:return`danger`;case`high`:return`warning`;case`medium`:return`running`;case`low`:return`neutral`;case`info`:return`info`}}var Ti={"action-required":`Action required`,readiness:`Autonomous readiness`,security:`Security`,budget:`Budget & limits`,"daemon-health":`Daemon health`,proposal:`Proposals`,run:`Runs`,"log-source":`Log source`},Ei={item:`_item_1gxz9_1`,top:`_top_1gxz9_15`,category:`_category_1gxz9_21`,time:`_time_1gxz9_26`,title:`_title_1gxz9_32`,detail:`_detail_1gxz9_39`,actions:`_actions_1gxz9_45`,actionLink:`_actionLink_1gxz9_52`,muteBtn:`_muteBtn_1gxz9_58`};function Di(e){let t=Math.max(0,Math.round((Date.now()-new Date(e).getTime())/1e3));if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.round(t/60);if(n<60)return`${n}m ago`;let r=Math.round(n/60);return r<48?`${r}h ago`:`${Math.round(r/24)}d ago`}function Oi({item:e}){let t=_i(e.category);return(0,I.jsxs)(`article`,{className:Ei.item,"data-focus-key":`notification-${e.id}`,children:[(0,I.jsxs)(`div`,{className:Ei.top,children:[(0,I.jsx)(b,{status:e.severity,tone:wi(e.severity),children:e.severity.toUpperCase()}),(0,I.jsx)(`span`,{className:Ei.category,children:Ti[e.category]}),(0,I.jsx)(`span`,{className:Ei.time,title:new Date(e.ts).toLocaleString(),children:Di(e.ts)})]}),(0,I.jsx)(`h3`,{className:Ei.title,children:e.title}),(0,I.jsx)(`p`,{className:Ei.detail,children:e.sourceQuality?(0,I.jsx)(E,{quality:e.sourceQuality,label:e.title,children:e.detail}):e.detail}),(0,I.jsxs)(`div`,{className:Ei.actions,children:[e.actionHref?(0,I.jsx)(`a`,{className:Ei.actionLink,href:`#${e.actionHref}`,"data-focus-key":`notification-${e.id}-action`,children:e.actionLabel??`Open`}):null,(0,I.jsx)(`button`,{type:`button`,className:Ei.muteBtn,onClick:()=>vi(e.category,!t),"aria-pressed":t,children:t?`Unmute ${Ti[e.category]}`:`Mute ${Ti[e.category]}`})]})]})}function ki(){let e=w(be),t=w(xe),n=w(we),r=w(ue),i=e.data,a=t.data,o=n.data,s=r.data;(0,A.useEffect)(()=>{pi(Jr({control:i,fleet:a,runs:o,inbox:s}))},[i,a,o,s])}var Ai={drawer:`_drawer_itt3q_1`,titleRow:`_titleRow_itt3q_16`,closeBtn:`_closeBtn_itt3q_23`,header:`_header_itt3q_37`,desktopToggle:`_desktopToggle_itt3q_42`,clear:`_clear_itt3q_57`,list:`_list_itt3q_66`,journalLink:`_journalLink_itt3q_77`};function ji(){ki();let{items:e,panelOpen:t,desktopEnabled:n,desktopPermission:r}=xi(),i=(0,A.useRef)(null);async function a(){n?bi():await yi()}return(0,I.jsxs)(te,{open:t,onClose:hi,titleId:`notification-center-title`,title:(0,I.jsxs)(`span`,{className:Ai.titleRow,children:[(0,I.jsx)(`span`,{children:`Notifications`}),(0,I.jsx)(`button`,{type:`button`,ref:i,className:Ai.closeBtn,onClick:hi,"aria-label":`Close notifications`,children:`×`})]}),widthClassName:Ai.drawer,initialFocusRef:i,children:[(0,I.jsx)(`div`,{className:Ai.header,children:(0,I.jsx)(`button`,{type:`button`,className:Ai.desktopToggle,onClick:()=>void a(),disabled:r===`unsupported`||r===`denied`,children:r===`unsupported`?`Desktop alerts not supported in this browser`:r===`denied`?`Desktop alerts blocked in browser settings`:n?`🔔 Desktop alerts on`:`🔕 Desktop alerts off — enable`})}),e.length===0?(0,I.jsxs)(`div`,{className:Ai.clear,children:[(0,I.jsx)(`strong`,{children:`Nothing needs you right now.`}),(0,I.jsx)(`span`,{children:`The fleet is operating within its observed authority.`})]}):(0,I.jsx)(`ul`,{className:Ai.list,children:e.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsx)(Oi,{item:e})},e.id))}),(0,I.jsx)(`a`,{href:`#/journal`,className:Ai.journalLink,onClick:hi,children:`See full history in the Work Journal →`})]})}var Mi={topbar:`_topbar_nwlse_1`,paletteTrigger:`_paletteTrigger_nwlse_12`,kbd:`_kbd_nwlse_32`,actions:`_actions_nwlse_41`,lockedIndicator:`_lockedIndicator_nwlse_47`,lockBtn:`_lockBtn_nwlse_52`,themeBtn:`_themeBtn_nwlse_60`};function Ni({onOpenPalette:e}){let{theme:t,cycle:n}=T(),r=d();return(0,I.jsxs)(`header`,{className:Mi.topbar,children:[(0,I.jsxs)(`button`,{type:`button`,className:Mi.paletteTrigger,onClick:e,children:[(0,I.jsx)(`span`,{children:`Search or run a command`}),(0,I.jsx)(`kbd`,{className:Mi.kbd,children:`⌘K`})]}),(0,I.jsxs)(`div`,{className:Mi.actions,children:[(0,I.jsx)(Ci,{}),r.hasHold?(0,I.jsx)(`button`,{type:`button`,className:Mi.lockBtn,onClick:r.clear,title:`Lock actions now`,children:`🔓 Unlocked`}):(0,I.jsx)(`span`,{className:Mi.lockedIndicator,title:`Actions require the dispatch token`,children:`🔒 Locked`}),(0,I.jsx)(`button`,{type:`button`,className:Mi.themeBtn,onClick:n,"aria-label":`Theme: ${t}`,children:t===`system`?`🖥️`:t===`light`?`☀️`:`🌙`})]}),(0,I.jsx)(ji,{})]})}var Pi=r(t(),1),Fi=Vr.map(e=>({id:`nav:${e.path}`,title:e.label,subtitle:e.description,group:`Navigate`,run:t=>t(e.path)})),Ii=[{id:`action:pause-fleet`,title:`Pause fleet`,subtitle:`Engage the fleet kill switch`,group:`Actions`,keywords:[`stop`,`kill`,`halt`],requiresConfirm:{title:`Pause the fleet?`,body:`This engages the global kill switch. Autonomous dispatch halts fleet-wide until explicitly resumed.`,confirmLabel:`Yes, pause`},requiresMutationToken:!0,run:async()=>{await ke()}},{id:`action:resume-fleet`,title:`Resume fleet`,subtitle:`Clear the fleet kill switch`,group:`Actions`,keywords:[`start`,`unpause`],requiresConfirm:{title:`Resume the fleet?`,body:`This clears the global kill switch. Autonomous dispatch will resume across the fleet.`,confirmLabel:`Yes, resume`},requiresMutationToken:!0,run:async()=>{await Ee()}},{id:`action:open-notifications`,title:`Open notification centre`,subtitle:`What needs you right now, ranked by severity`,group:`Actions`,keywords:[`alerts`,`attention`,`bell`,`needs you`],run:()=>{mi()}},{id:`action:toggle-theme`,title:`Toggle theme`,subtitle:`Cycle system → light → dark`,group:`Actions`,keywords:[`dark mode`,`light mode`,`appearance`,`dark`,`light`],run:()=>{a()}},{id:`action:open-journal-today`,title:`Open journal — today`,subtitle:`Work journal filtered to today`,group:`Actions`,keywords:[`journal`,`today`,`log`,`history`],run:e=>{e(`/journal`,{state:{windowToday:!0}})}}],Li=[...Fi,...Ii];function Ri(){o(we.key,we.fetch),o(he.key,he.fetch);let e=Ce({status:`all`,limit:500});o(e.key,e.fetch)}var zi=5,Bi=2;function Vi(e,t){return e.toLowerCase().includes(t)}function Hi(e){let t=e.trim().toLowerCase();if(t.length<Bi)return[];let n=[],r=u(we.key).data??[];for(let e of r){if(n.length>=zi)break;(Vi(e.id,t)||Vi(e.goal,t))&&n.push({id:`jump:run:${e.id}`,title:e.goal,subtitle:`Run ${e.id} · ${e.status}`,group:`Jump to`,run:t=>t(`/work/runs/${e.id}`)})}let i=u(he.key).data??[],a=0;for(let e of i){if(a>=zi)break;(Vi(e.id,t)||Vi(e.objective,t))&&(a++,n.push({id:`jump:goal:${e.id}`,title:e.objective,subtitle:`Goal ${e.id} · ${e.status}`,group:`Jump to`,run:e=>e(`/goals`)}))}let o=Ce({status:`all`,limit:500}).key,s=u(o).data?.proposals??[],c=0;for(let e of s){if(c>=zi)break;(Vi(e.id,t)||Vi(e.title,t))&&(c++,n.push({id:`jump:proposal:${e.id}`,title:e.title,subtitle:`Proposal ${e.id} · ${e.status}`,group:`Jump to`,run:t=>t(`/inbox/${encodeURIComponent(e.id)}`)}))}return n}var Ui=/^\/inbox\/([^/]+)$/;function Wi(e){let t=Ui.exec(e);if(!t)return[];let n=decodeURIComponent(t[1]),r=u(`proposal-detail-${n}`).data;return!r||r.status!==`pending`?[]:[{id:`action:approve-proposal:${n}`,title:`Approve "${r.title}"`,subtitle:`Writes the diff to disk and dispatches it`,group:`Actions`,keywords:[`approve`,`ship`,`proposal`],requiresConfirm:{title:`Approve this proposal?`,body:`"${r.title}" will be applied. This writes the diff to disk and dispatches it.`,confirmLabel:`Approve`},requiresMutationToken:!0,run:async()=>{await Oe(n)}},{id:`action:reject-proposal:${n}`,title:`Reject "${r.title}"`,subtitle:`Cannot be undone`,group:`Actions`,keywords:[`reject`,`decline`,`proposal`],requiresConfirm:{title:`Reject this proposal?`,body:`"${r.title}" will be rejected. This cannot be undone.`,confirmLabel:`Reject`,destructive:!0},requiresMutationToken:!0,run:async()=>{await De(n)}}]}function Gi(e,t=[]){let n=e.trim().toLowerCase(),r=[...t,...Li];return[...n?r.filter(e=>{let t=[e.title,e.subtitle??``,...e.keywords??[]].join(` `).toLowerCase();return n.split(/\s+/).every(e=>t.includes(e))}):r,...Hi(e)]}var Ki={backdrop:`_backdrop_1odjm_1`,panel:`_panel_1odjm_12`,input:`_input_1odjm_24`,list:`_list_1odjm_37`,item:`_item_1odjm_42`,active:`_active_1odjm_51`,itemTitle:`_itemTitle_1odjm_55`,itemSubtitle:`_itemSubtitle_1odjm_61`,itemGroup:`_itemGroup_1odjm_67`,empty:`_empty_1odjm_75`};function qi(e){(0,A.useEffect)(()=>{function t(t){(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e(!0))}return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e])}function Ji({open:e,onClose:t}){let[n,r]=(0,A.useState)(``),[i,a]=(0,A.useState)(0),[o,s]=(0,A.useState)(null),[l,u]=(0,A.useState)(!1),[d,f]=(0,A.useState)(!1),p=(0,A.useRef)(null),m=(0,A.useId)(),h=hn(),g=P(),_=ie(),v=(0,A.useMemo)(()=>e?Wi(g.pathname):[],[e,g.pathname]),y=(0,A.useMemo)(()=>Gi(n,v),[n,v]);(0,A.useEffect)(()=>{if(!e)return;let t=document.activeElement;r(``),a(0),Ri();let n=requestAnimationFrame(()=>p.current?.focus());return()=>{cancelAnimationFrame(n),t?.focus()}},[e]),(0,A.useEffect)(()=>{a(0)},[n]),(0,A.useEffect)(()=>{a(e=>Math.min(e,Math.max(y.length-1,0)))},[y.length]);async function b(e){try{await e.run((e,t)=>h(e,t))}catch(e){_.show(e instanceof Error?e.message:`Command failed.`,`danger`)}finally{s(null)}}function x(e){if(t(),e.requiresConfirm){s(e),u(!0);return}if(e.requiresMutationToken&&!c()){s(e),f(!0);return}b(e)}function S(){u(!1),o&&(o.requiresMutationToken&&!c()?f(!0):b(o))}function C(){u(!1),s(null)}function w(e){if(e.key===`Escape`){t();return}if(e.key===`Tab`){e.preventDefault();return}if(e.key===`ArrowDown`)e.preventDefault(),a(e=>Math.min(e+1,y.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),a(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=y[i];t&&x(t)}}return(0,I.jsxs)(I.Fragment,{children:[e?(0,Pi.createPortal)((0,I.jsx)(`div`,{className:Ki.backdrop,onMouseDown:e=>e.target===e.currentTarget&&t(),children:(0,I.jsxs)(`div`,{className:Ki.panel,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,children:[(0,I.jsx)(`input`,{ref:p,className:Ki.input,value:n,onChange:e=>r(e.target.value),onKeyDown:w,placeholder:`Navigate or run a command…`,role:`combobox`,"aria-expanded":`true`,"aria-controls":m,"aria-activedescendant":y[i]?`cmd-${y[i].id}`:void 0,autoComplete:`off`}),(0,I.jsx)(`ul`,{id:m,role:`listbox`,className:Ki.list,children:y.length===0?(0,I.jsx)(`li`,{className:Ki.empty,children:`No matching commands.`}):y.map((e,t)=>(0,I.jsxs)(`li`,{id:`cmd-${e.id}`,role:`option`,"aria-selected":t===i,className:`${Ki.item} ${t===i?Ki.active:``}`,onMouseEnter:()=>a(t),onMouseDown:t=>{t.preventDefault(),x(e)},children:[(0,I.jsx)(`span`,{className:Ki.itemTitle,children:e.title}),e.subtitle?(0,I.jsx)(`span`,{className:Ki.itemSubtitle,children:e.subtitle}):null,(0,I.jsx)(`span`,{className:Ki.itemGroup,children:e.group})]},e.id))})]})}),document.body):null,o?.requiresConfirm?(0,I.jsx)(Ae,{open:l,onClose:C,title:o.requiresConfirm.title,body:o.requiresConfirm.body,confirmLabel:o.requiresConfirm.confirmLabel,destructive:o.requiresConfirm.destructive,onConfirm:S}):null,(0,I.jsx)(je,{open:d,onClose:()=>{f(!1),s(null)},onUnlocked:()=>{let e=o;f(!1),s(null),e&&b(e)},reason:o?`"${o.title}" requires the dispatch token.`:void 0})]})}var Yi={shell:`_shell_2db09_1`,body:`_body_2db09_9`,main:`_main_2db09_17`};function Xi(){let e=(0,A.useRef)(null),t=P(),[n,r]=(0,A.useState)(!1);return Me(t.pathname,e),qi(r),(0,I.jsxs)(`div`,{className:Yi.shell,children:[(0,I.jsx)(Ur,{}),(0,I.jsxs)(`div`,{className:Yi.body,children:[(0,I.jsx)(Ni,{onOpenPalette:()=>r(!0)}),(0,I.jsx)(`main`,{ref:e,className:Yi.main,id:`main-content`,tabIndex:-1,children:(0,I.jsx)(ae,{resetKey:t.pathname,children:(0,I.jsx)(Hn,{})})})]}),(0,I.jsx)(Ji,{open:n,onClose:()=>r(!1)})]})}var Zi={wrap:`_wrap_152mr_1`,title:`_title_152mr_6`,description:`_description_152mr_13`,note:`_note_152mr_19`};function Qi({title:e,description:t}){return(0,I.jsxs)(`div`,{className:Zi.wrap,children:[(0,I.jsx)(`h1`,{className:Zi.title,children:e}),(0,I.jsx)(`p`,{className:Zi.description,children:t}),(0,I.jsx)(`p`,{className:Zi.note,children:`Not built yet — this route, its nav entry, and its ⌘K command all already work.`})]})}var $i={grid:`_grid_1exd8_1`,stat:`_stat_1exd8_7`,statLabel:`_statLabel_1exd8_17`,statValue:`_statValue_1exd8_24`,statCaption:`_statCaption_1exd8_30`};function ea(){return(0,I.jsx)(x,{count:6})}function ta({label:e,value:t,caption:n}){return(0,I.jsxs)(`div`,{className:$i.stat,children:[(0,I.jsx)(`span`,{className:$i.statLabel,children:e}),(0,I.jsx)(`span`,{className:$i.statValue,children:t}),n?(0,I.jsx)(`span`,{className:$i.statCaption,children:n}):null]})}function na({snapshot:e}){let t=e.mcp.filter(e=>e.ok).length;return(0,I.jsxs)(`div`,{className:$i.grid,children:[(0,I.jsx)(ta,{label:`Repos`,value:String(e.repos.total),caption:`${e.repos.dirty} dirty · ${e.repos.stale} stale`}),(0,I.jsx)(ta,{label:`Tools`,value:`${e.tools.installed}/${e.tools.total}`,caption:`installed`}),(0,I.jsx)(ta,{label:`Activity`,value:String(e.activity.sessions),caption:`${e.activity.tokens.toLocaleString()} tok · $${e.activity.estCostUsd.toFixed(2)}`}),(0,I.jsx)(ta,{label:`MCP`,value:`${t}/${e.mcp.length}`,caption:`reachable`}),(0,I.jsx)(ta,{label:`Genome`,value:String(e.genome.entries),caption:`${e.genome.projects} projects`}),(0,I.jsx)(ta,{label:`Inbox`,value:String(e.inbox.pending),caption:`pending`})]})}var L={panel:`_panel_1gx0q_3`,panelHeader:`_panelHeader_1gx0q_10`,panelTitle:`_panelTitle_1gx0q_25`,panelBody:`_panelBody_1gx0q_33`,emptyState:`_emptyState_1gx0q_37`},ra={table:`_table_78j3m_1`,statusCol:`_statusCol_78j3m_27`,tokensCol:`_tokensCol_78j3m_31`,goalLink:`_goalLink_78j3m_35`,tokens:`_tokens_78j3m_31`};function ia(){return(0,I.jsxs)(`details`,{className:L.panel,open:!0,"data-state-key":`fleet-dashboard-runs`,children:[(0,I.jsx)(`summary`,{className:L.panelHeader,children:(0,I.jsx)(`span`,{className:L.panelTitle,children:`Recent runs`})}),(0,I.jsxs)(`div`,{className:L.panelBody,children:[(0,I.jsx)(f,{}),(0,I.jsx)(f,{}),(0,I.jsx)(f,{})]})]})}function aa({runs:e}){return(0,I.jsxs)(`details`,{className:L.panel,open:!0,"data-state-key":`fleet-dashboard-runs`,children:[(0,I.jsxs)(`summary`,{className:L.panelHeader,children:[(0,I.jsx)(`span`,{className:L.panelTitle,children:`Recent runs`}),(0,I.jsx)(`span`,{className:`text-tertiary text-xs`,children:e.length})]}),(0,I.jsx)(`div`,{className:L.panelBody,children:e.length===0?(0,I.jsx)(`p`,{className:L.emptyState,children:`No runs yet.`}):(0,I.jsxs)(`table`,{className:ra.table,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:`Goal`}),(0,I.jsx)(`th`,{scope:`col`,className:ra.statusCol,children:`Status`}),(0,I.jsx)(`th`,{scope:`col`,className:ra.tokensCol,children:`Tokens`})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`a`,{href:`#/work/runs/${e.id}`,"data-focus-key":`run-${e.id}`,className:ra.goalLink,title:e.goal,children:e.goal})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(b,{status:e.status})}),(0,I.jsx)(`td`,{className:ra.tokens,children:e.tokens.toLocaleString()})]},e.id))})]})})]})}var oa={list:`_list_1fq6m_1`,item:`_item_1fq6m_7`,itemHeader:`_itemHeader_1fq6m_13`,goal:`_goal_1fq6m_21`,burndown:`_burndown_1fq6m_42`,burndownTrack:`_burndownTrack_1fq6m_48`,burndownFill:`_burndownFill_1fq6m_56`,burndownLabel:`_burndownLabel_1fq6m_63`};function sa({swarms:e}){return(0,I.jsxs)(`details`,{className:L.panel,open:!0,"data-state-key":`fleet-dashboard-swarms`,children:[(0,I.jsxs)(`summary`,{className:L.panelHeader,children:[(0,I.jsx)(`span`,{className:L.panelTitle,children:`Swarms`}),(0,I.jsx)(`span`,{className:`text-tertiary text-xs`,children:e.length})]}),(0,I.jsx)(`div`,{className:L.panelBody,children:e.length===0?(0,I.jsx)(`p`,{className:L.emptyState,children:`No active swarms.`}):(0,I.jsx)(`ul`,{className:oa.list,children:e.map((e,t)=>{let n=e.tasksTotal>0?Math.round(e.tasksDone/e.tasksTotal*100):0;return(0,I.jsxs)(`li`,{className:oa.item,children:[(0,I.jsxs)(`a`,{href:`#/work/swarms/${e.id}`,"data-focus-key":`swarm-${e.id}`,className:oa.itemHeader,title:e.goal,children:[e.phase?(0,I.jsx)(m,{index:t}):null,(0,I.jsx)(`span`,{className:oa.goal,children:e.goal}),(0,I.jsx)(b,{status:e.status})]}),(0,I.jsxs)(`div`,{className:oa.burndown,children:[(0,I.jsx)(`div`,{className:oa.burndownTrack,children:(0,I.jsx)(`div`,{className:oa.burndownFill,style:{width:`${n}%`}})}),(0,I.jsxs)(`span`,{className:oa.burndownLabel,children:[e.tasksDone,`/`,e.tasksTotal,e.phase?` · ${e.phase}`:``]})]})]},e.id)})})})]})}var ca={grid:`_grid_qy4m7_1`};function la(){return(0,I.jsxs)(`details`,{className:L.panel,open:!0,"data-state-key":`fleet-dashboard-daemon`,children:[(0,I.jsx)(`summary`,{className:L.panelHeader,children:(0,I.jsx)(`span`,{className:L.panelTitle,children:`Daemon`})}),(0,I.jsx)(`div`,{className:L.panelBody,children:(0,I.jsx)(g,{width:`40%`})})]})}function ua({daemon:e}){return(0,I.jsxs)(`details`,{className:L.panel,open:!0,"data-state-key":`fleet-dashboard-daemon`,children:[(0,I.jsxs)(`summary`,{className:L.panelHeader,children:[(0,I.jsx)(`span`,{className:L.panelTitle,children:`Daemon`}),(0,I.jsx)(E,{quality:e.sourceQuality,label:`daemon state`,children:(0,I.jsx)(b,{status:e.running?`running`:`pending`,children:e.running?`running`:`stopped`})})]}),(0,I.jsx)(`div`,{className:L.panelBody,children:(0,I.jsxs)(`dl`,{className:ca.grid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Runtime state`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:e.sourceQuality,label:`runtime state`,children:e.runtimeState})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`PID`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:e.sourceQuality,label:`pid`,children:e.pid??`—`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Today's spend`}),(0,I.jsx)(`dd`,{children:(0,I.jsxs)(E,{quality:e.sourceQuality,label:`spend`,children:[`$`,e.todaySpentUsd.toFixed(2)]})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Direction mode`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:e.sourceQuality,label:`direction mode`,children:e.activeDirectionMode??`none`})})]})]})})]})}var da={view:`_view_1nttk_1`,header:`_header_1nttk_8`,title:`_title_1nttk_14`,freshness:`_freshness_1nttk_20`,freshnessLabel:`_freshnessLabel_1nttk_26`,panels:`_panels_1nttk_32`,error:`_error_1nttk_39`};function fa(){let e=w(se),t=w(be);return(0,I.jsxs)(`div`,{className:da.view,children:[(0,I.jsxs)(`header`,{className:da.header,children:[(0,I.jsx)(`h1`,{className:da.title,children:`Fleet Dashboard`}),(0,I.jsxs)(`div`,{className:da.freshness,"aria-live":`polite`,children:[e.status===`refreshing`?(0,I.jsx)(y,{}):null,e.updatedAt?(0,I.jsxs)(`span`,{className:da.freshnessLabel,children:[`Updated `,ma(e.updatedAt)]}):null]})]}),e.status===`loading`?(0,I.jsx)(ea,{}):e.status===`error`?(0,I.jsx)(pa,{message:e.error?.message??`Failed to load snapshot.`}):e.data?(0,I.jsx)(na,{snapshot:e.data}):null,(0,I.jsxs)(`div`,{className:da.panels,children:[e.status===`loading`?(0,I.jsx)(ia,{}):e.data?(0,I.jsx)(aa,{runs:e.data.runs}):null,e.data?(0,I.jsx)(sa,{swarms:e.data.swarms}):null,t.status===`loading`?(0,I.jsx)(la,{}):t.status===`error`?(0,I.jsx)(pa,{message:t.error?.message??`Failed to load control snapshot.`}):t.data?(0,I.jsx)(ua,{daemon:t.data.daemon}):null]})]})}function pa({message:e}){return(0,I.jsx)(`div`,{className:da.error,role:`alert`,children:e})}function ma(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<5?`just now`:t<60?`${t}s ago`:`${Math.round(t/60)}m ago`}var ha={status:`connecting`,chunks:[],outputChunks:[],starts:[],stall:null,runDone:null,version:0};function ga(e){let t=e;try{return JSON.parse(t.data)}catch{return null}}function _a(e,t){let[n,r]=(0,A.useState)(ha);return(0,A.useEffect)(()=>{if(!t){r(ha);return}if(r(ha),typeof EventSource>`u`){r(e=>({...e,status:`unavailable`}));return}let n=`/api/run/${encodeURIComponent(e)}/events?client=${encodeURIComponent(s())}`,i=new EventSource(n,{withCredentials:!0});return i.onopen=()=>{r(e=>e.status===`unavailable`?e:{...e,status:`open`})},i.onerror=()=>{r(e=>e.status===`open`?e:{...e,status:`unavailable`})},i.addEventListener(`step-started`,e=>{let t=ga(e);t&&r(e=>({...e,starts:[...e.starts,t],version:e.version+1}))}),i.addEventListener(`step-output-chunk`,e=>{let t=ga(e);t&&r(e=>({...e,chunks:[...e.chunks,t],version:e.version+1}))}),i.addEventListener(`step-done`,()=>{r(e=>({...e,stall:null,version:e.version+1}))}),i.addEventListener(`output-chunk`,e=>{let t=ga(e);t&&r(e=>({...e,outputChunks:[...e.outputChunks,t],version:e.version+1}))}),i.addEventListener(`stall`,e=>{let t=ga(e);t&&r(e=>({...e,stall:{ageMs:t.ageMs,at:Date.now()},version:e.version+1}))}),i.addEventListener(`run-done`,e=>{let t=ga(e);r(e=>({...e,runDone:t??{status:`done`,result:null,terminationReason:null},stall:null,version:e.version+1}))}),()=>{i.close()}},[e,t]),n}var va=2e3,ya=va*4;function ba(e){return e?`${e.status}:${e.steps.length}:${e.updatedAt}`:null}function xa(e){let t=(0,A.useMemo)(()=>oe(e),[e]),n=w(t),r=ee(t),[i,a]=(0,A.useState)(null),[o,s]=(0,A.useState)(null),[,c]=(0,A.useState)(0),l=n.data?n.data.status!==`running`:!1,u=n.error instanceof S&&n.error.status===404,d=_a(e,!l&&!u),f=d.status===`open`?`sse`:`polling`,p=ba(n.data);(0,A.useEffect)(()=>{p!==null&&a(Date.now())},[p]),(0,A.useEffect)(()=>{if(l||u||f===`sse`)return;let e=setInterval(()=>{r(),s(Date.now()),c(e=>e+1)},va);return()=>clearInterval(e)},[r,l,u,f]),(0,A.useEffect)(()=>{f===`sse`&&d.version!==0&&(r(),s(Date.now()))},[d.version,f,r]);let m=va*6,h=f===`sse`&&d.stall!==null&&Date.now()-d.stall.at<m,g;return g=u?`not-found`:n.status===`error`&&n.data===void 0?`error`:n.status===`loading`?`connecting`:n.data?n.data.status===`running`?f===`sse`?h?`stalled`:`live`:i!==null&&Date.now()-i>ya?`stalled`:`live`:`done`:`connecting`,{phase:g,run:n.data,error:n.error,lastChangedAt:i,lastPolledAt:o,pollNow:()=>{r(),s(Date.now())},transport:f,chunks:d.chunks,outputChunks:d.outputChunks,stallAgeMs:h?d.stall.ageMs:null}}var R={panel:`_panel_z6jlr_1`,header:`_header_z6jlr_12`,headerTop:`_headerTop_z6jlr_18`,title:`_title_z6jlr_25`,statRow:`_statRow_z6jlr_35`,banner:`_banner_z6jlr_53`,bannerWarning:`_bannerWarning_z6jlr_64`,bannerDanger:`_bannerDanger_z6jlr_69`,bannerDot:`_bannerDot_z6jlr_74`,livePulse:`_livePulse_z6jlr_1`,transcriptWrap:`_transcriptWrap_z6jlr_102`,transcript:`_transcript_z6jlr_102`,followButton:`_followButton_z6jlr_122`,empty:`_empty_z6jlr_151`,step:`_step_z6jlr_158`,stepKind:`_stepKind_z6jlr_171`,stepTime:`_stepTime_z6jlr_191`,stepTask:`_stepTask_z6jlr_195`,stepSummary:`_stepSummary_z6jlr_202`,stepUsage:`_stepUsage_z6jlr_207`},Sa={plan:`Plan`,model:`Model`,tool:`Tool`,synthesize:`Synthesize`};function Ca(e,t){let n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),i=Math.max(0,Math.round((r-n)/1e3));return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}function wa(e){try{return new Date(e).toLocaleTimeString(void 0,{hour12:!1})}catch{return e}}function Ta({phase:e,lastChangedAt:t,stallAgeMs:n,transport:r,error:i}){if(e===`connecting`)return(0,I.jsxs)(`div`,{className:R.banner,role:`status`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`connecting`,"aria-hidden":`true`}),`Connecting to run…`]});if(e===`not-found`)return(0,I.jsxs)(`div`,{className:`${R.banner} ${R.bannerDanger}`,role:`alert`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`danger`,"aria-hidden":`true`}),`Run not found. It may have been pruned from disk since this link was opened.`]});if(e===`error`)return(0,I.jsxs)(`div`,{className:`${R.banner} ${R.bannerDanger}`,role:`alert`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`danger`,"aria-hidden":`true`}),`Stream disconnected`,i?`: ${i.message}`:``,`. Retrying every `,va/1e3,`s…`]});if(e===`stalled`){let e=n===null?t===null?null:Math.round((Date.now()-t)/1e3):Math.round(n/1e3);return(0,I.jsxs)(`div`,{className:`${R.banner} ${R.bannerWarning}`,role:`status`,"aria-live":`polite`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`warning`,"aria-hidden":`true`}),`No change observed`,e===null?``:` in ${e}s`,` — this run may be stalled, or is simply quiet between steps. Still `,r===`sse`?`watching`:`polling`,`.`]})}return e===`live`?(0,I.jsxs)(`div`,{className:R.banner,role:`status`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`live`,"aria-hidden":`true`}),r===`sse`?`Live · streaming (server tail ~500ms)`:`Live · polling every ${va/1e3}s (server refresh floor ~1.5s — this cannot be faster than that)`]}):(0,I.jsxs)(`div`,{className:R.banner,role:`status`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`done`,"aria-hidden":`true`}),`Run finished — no longer `,r===`sse`?`streaming`:`polling`,`.`]})}function Ea(){return(0,I.jsxs)(`div`,{className:R.panel,children:[(0,I.jsx)(g,{width:`40%`}),(0,I.jsx)(g,{width:`90%`}),(0,I.jsx)(g,{width:`70%`})]})}function Da({runId:e}){let{phase:t,run:n,error:r,lastChangedAt:i,transport:a,stallAgeMs:o,outputChunks:s}=xa(e),c=(0,A.useRef)(null),l=(0,A.useRef)(!0),[u,d]=(0,A.useState)(!0),f=(0,A.useRef)(null),p=(0,A.useRef)(!0),[m,h]=(0,A.useState)(!0);(0,A.useEffect)(()=>{let e=c.current;e&&l.current&&(e.scrollTop=e.scrollHeight)},[n?.steps.length]),(0,A.useEffect)(()=>{let e=f.current;e&&p.current&&(e.scrollTop=e.scrollHeight)},[s.length]);function g(){let e=c.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<48;l.current=t,d(t)}function _(){let e=f.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<48;p.current=t,h(t)}function v(){l.current=!0,d(!0);let e=c.current;e&&(e.scrollTop=e.scrollHeight)}function y(){p.current=!0,h(!0);let e=f.current;e&&(e.scrollTop=e.scrollHeight)}return!n&&t===`connecting`?(0,I.jsx)(Ea,{}):(0,I.jsxs)(`div`,{className:R.panel,children:[(0,I.jsxs)(`header`,{className:R.header,children:[(0,I.jsxs)(`div`,{className:R.headerTop,children:[(0,I.jsx)(`h3`,{className:R.title,children:n?.goal??`Run ${e}`}),n?(0,I.jsx)(b,{status:n.status}):null]}),n?(0,I.jsxs)(`dl`,{className:R.statRow,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Elapsed`}),(0,I.jsx)(`dd`,{children:Ca(n.createdAt,n.status===`running`?void 0:n.updatedAt)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Tokens`}),(0,I.jsxs)(`dd`,{children:[n.usage.tokensIn.toLocaleString(),` in / `,n.usage.tokensOut.toLocaleString(),` out`]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Cost`}),(0,I.jsxs)(`dd`,{children:[`$`,n.usage.estCostUsd.toFixed(3)]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Steps`}),(0,I.jsx)(`dd`,{children:n.steps.length})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Tasks`}),(0,I.jsxs)(`dd`,{children:[n.tasks.filter(e=>e.status===`done`).length,`/`,n.tasks.length]})]})]}):null]}),(0,I.jsx)(Ta,{phase:t,lastChangedAt:i,stallAgeMs:o,transport:a,error:r}),s.length>0?(0,I.jsxs)(`div`,{className:R.transcriptWrap,children:[(0,I.jsx)(`div`,{ref:f,className:R.transcript,onScroll:_,tabIndex:0,role:`log`,"aria-label":`Live engine output`,"aria-live":m?`polite`:`off`,children:s.map((e,t)=>(0,I.jsxs)(`div`,{className:R.step,"data-focus-key":`run-output-chunk-${t}`,children:[(0,I.jsx)(`span`,{className:R.stepKind,"data-kind":e.kind,children:e.kind}),(0,I.jsx)(`span`,{className:R.stepTime,title:e.ts,children:wa(e.ts)}),(0,I.jsx)(`span`,{className:R.stepTask,children:e.taskId??``}),(0,I.jsx)(`span`,{className:R.stepSummary,children:e.text})]},`${e.ts}-${t}`))}),m?null:(0,I.jsx)(`button`,{type:`button`,className:R.followButton,onClick:y,children:`↓ Follow`})]}):null,(0,I.jsxs)(`div`,{className:R.transcriptWrap,children:[(0,I.jsx)(`div`,{ref:c,className:R.transcript,onScroll:g,tabIndex:0,role:`log`,"aria-label":`Run step transcript`,"aria-live":u?`polite`:`off`,children:!n||n.steps.length===0?(0,I.jsx)(`p`,{className:R.empty,children:`No steps recorded yet.`}):n.steps.map((e,t)=>(0,I.jsxs)(`div`,{className:R.step,"data-focus-key":`run-stream-step-${t}`,children:[(0,I.jsx)(`span`,{className:R.stepKind,"data-kind":e.kind,children:Sa[e.kind]??e.kind}),(0,I.jsx)(`span`,{className:R.stepTime,title:e.ts,children:wa(e.ts)}),(0,I.jsx)(`span`,{className:R.stepTask,children:e.taskId}),(0,I.jsx)(`span`,{className:R.stepSummary,children:e.summary}),e.usage?(0,I.jsxs)(`span`,{className:R.stepUsage,children:[(e.usage.tokensIn+e.usage.tokensOut).toLocaleString(),` tok`]}):null]},`${e.ts}-${t}`))}),u?null:(0,I.jsx)(`button`,{type:`button`,className:R.followButton,onClick:v,children:`↓ Follow`})]})]})}var Oa={strip:`_strip_21e8x_1`,label:`_label_21e8x_11`,list:`_list_21e8x_20`,watchBtn:`_watchBtn_21e8x_29`,pulse:`_pulse_21e8x_46`,dialogWidth:`_dialogWidth_21e8x_70`};function ka(){let e=w(se),[t,n]=(0,A.useState)(null),r=(e.data?.runs??[]).filter(e=>e.status===`running`);return r.length===0?null:(0,I.jsxs)(`div`,{className:Oa.strip,children:[(0,I.jsx)(`span`,{className:Oa.label,children:`Live now`}),(0,I.jsx)(`ul`,{className:Oa.list,"aria-live":`polite`,"aria-label":`Currently running`,children:r.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(`button`,{type:`button`,className:Oa.watchBtn,onClick:()=>n(e.id),children:[(0,I.jsx)(`span`,{className:Oa.pulse,"aria-hidden":`true`}),e.goal]})},e.id))}),(0,I.jsx)(te,{open:t!==null,onClose:()=>n(null),titleId:`live-now-title`,title:`Watching live`,widthClassName:Oa.dialogWidth,children:t?(0,I.jsx)(Da,{runId:t}):null})]})}function Aa(e){switch(e){case`merge`:return`merged`;case`dispatch`:return`running`;case`tick`:return`info`;default:return`pending`}}function ja(e){let t=[];for(let[n,r]of(e.logs?.entries??[]).entries())t.push({id:`log-${r.ts}-${n}`,ts:r.ts,source:`daemon-tick`,title:r.kind===`merge`?`Daemon merge`:r.kind===`dispatch`?`Daemon dispatch`:`Daemon tick`,detail:r.msg+(r.dryRun?` (dry run)`:``),statusLabel:Aa(r.kind),sourceQuality:e.logs?.sourceQuality});for(let[n,r]of(e.fleetActivity?.recentTicks??[]).entries())t.push({id:`fleet-tick-${r.ts}-${n}`,ts:r.ts,source:`daemon-tick`,title:`Fleet tick`,detail:[r.reason,r.directionReason].filter(Boolean).join(` — `)||`${r.merged} merged, $${r.spentUsd.toFixed(2)} spent`,statusLabel:r.dryRun?`pending`:`info`,sourceQuality:e.fleetActivity?.recentTicksSourceQuality});for(let[n,r]of(e.fleetActivity?.recentMerges??[]).entries())t.push({id:`merge-${r.ts}-${n}`,ts:r.ts,source:`merge`,title:`Merged in ${r.repo??`unknown repo`}`,detail:`${r.engine??`unknown engine`}${r.proposalId?` · proposal ${r.proposalId}`:``}`,repo:r.repo??void 0,statusLabel:`merged`,sourceQuality:e.fleetActivity?.recentMergesSourceQuality,drillIn:r.proposalId?{proposalId:r.proposalId}:void 0});for(let[n,r]of(e.fleetActivity?.recentActions??[]).entries())t.push({id:`action-${r.ts}-${n}`,ts:r.ts,source:`agent-action`,title:r.proseDigest??r.summary??r.action,detail:r.summary,repo:r.repo,statusLabel:r.outcome,sourceQuality:e.fleetActivity?.recentActionsSource,drillIn:r.proposalId?{proposalId:r.proposalId}:r.runId?{runId:r.runId}:void 0});for(let n of e.runs??[])t.push({id:`run-${n.id}`,ts:n.updatedAt,source:`run`,title:n.goal,detail:n.result??n.terminationReason??`${n.steps.length} step(s), ${n.tasks.length} task(s)`,statusLabel:n.status,drillIn:{runId:n.id}});for(let n of e.inbox?.proposals??[])t.push({id:`proposal-pending-${n.id}`,ts:n.createdAt,source:`proposal`,title:n.title,detail:`${n.kind} · ${n.origin}`,repo:n.repo,statusLabel:`pending`,drillIn:{proposalId:n.id}});return t.sort((e,t)=>new Date(t.ts).getTime()-new Date(e.ts).getTime()),t}function Ma(e=new Date){let t=new Date(e.getFullYear(),e.getMonth(),e.getDate());return e.getTime()-t.getTime()}function Na(e,t){let n=Date.now(),r=t.query.trim().toLowerCase();return e.filter(e=>!(!t.sources.has(e.source)||t.windowMs!==null&&n-new Date(e.ts).getTime()>t.windowMs||r&&!`${e.title} ${e.detail} ${e.repo??``} ${e.statusLabel}`.toLowerCase().includes(r)))}function Pa(e,t){let n=Date.now(),r=36e5,i=[];for(let e=t-1;e>=0;e--)i.push({bucketStartMs:n-e*r,count:0});for(let a of e){let e=n-new Date(a.ts).getTime();if(e<0||e>t*r)continue;let o=t-1-Math.floor(e/r);o>=0&&o<i.length&&(i[o].count+=1)}return i}var Fa={bar:`_bar_1kce8_1`,search:`_search_1kce8_12`,sources:`_sources_1kce8_28`,sourceOption:`_sourceOption_1kce8_34`,windowSelect:`_windowSelect_1kce8_43`},Ia=[{value:`run`,label:`Runs`},{value:`merge`,label:`Merges`},{value:`proposal`,label:`Proposals`},{value:`agent-action`,label:`Agent actions`},{value:`daemon-tick`,label:`Daemon ticks`}],La=[{value:`1h`,label:`Last hour`,ms:36e5},{value:`today`,label:`Today`,ms:null,dynamic:!0},{value:`24h`,label:`Last 24h`,ms:864e5},{value:`7d`,label:`Last 7 days`,ms:6048e5},{value:`all`,label:`All available`,ms:null}];function Ra({sources:e,onSourcesChange:t,query:n,onQueryChange:r,windowValue:i,onWindowChange:a}){function o(n){let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)}return(0,I.jsxs)(`div`,{className:Fa.bar,children:[(0,I.jsx)(`input`,{type:`search`,className:Fa.search,placeholder:`Search title, detail, repo…`,value:n,onChange:e=>r(e.target.value),"aria-label":`Search the work journal`}),(0,I.jsx)(`div`,{className:Fa.sources,role:`group`,"aria-label":`Filter by source`,children:Ia.map(t=>(0,I.jsxs)(`label`,{className:Fa.sourceOption,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:e.has(t.value),onChange:()=>o(t.value)}),t.label]},t.value))}),(0,I.jsx)(`select`,{className:Fa.windowSelect,value:i,onChange:e=>{let t=La.find(t=>t.value===e.target.value);a(e.target.value,t?.dynamic?Ma():t?.ms??null)},"aria-label":`Time window`,children:La.map(e=>(0,I.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})}var za=new Set(Ia.map(e=>e.value)),Ba={strip:`_strip_h22ae_1`,bar:`_bar_h22ae_12`,fill:`_fill_h22ae_33`};function Va({entries:e,hours:t,onScrubTo:n}){let r=Pa(e,t),i=Math.max(1,...r.map(e=>e.count));return(0,I.jsx)(`div`,{className:Ba.strip,role:`group`,"aria-label":`Activity density over the last ${t} hours`,children:r.map(e=>{let t=Math.round(e.count/i*100),r=new Date(e.bucketStartMs).toLocaleTimeString(void 0,{hour:`numeric`});return(0,I.jsx)(`button`,{type:`button`,className:Ba.bar,onClick:()=>n(e.bucketStartMs),disabled:e.count===0,title:`${r}: ${e.count} entr${e.count===1?`y`:`ies`}`,"aria-label":`${r}: ${e.count} entries`,children:(0,I.jsx)(`span`,{className:Ba.fill,style:{height:`${Math.max(t,e.count>0?8:0)}%`}})},e.bucketStartMs)})})}var Ha={detailBody:`_detailBody_bgyq9_1`,grid:`_grid_bgyq9_10`,rationale:`_rationale_bgyq9_27`,diffDetails:`_diffDetails_bgyq9_34`,diff:`_diff_bgyq9_34`,error:`_error_bgyq9_56`};function Ua({proposalId:e}){let t=w(pe(e));if(t.status===`loading`)return(0,I.jsx)(g,{width:`80%`});if(t.status===`error`)return(0,I.jsxs)(`p`,{className:Ha.error,children:[`Could not load proposal `,e,`: `,t.error?.message??`not found on disk (it may have been pruned).`]});let n=t.data;return n?(0,I.jsxs)(`div`,{className:Ha.detailBody,children:[(0,I.jsxs)(`dl`,{className:Ha.grid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Status`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(b,{status:n.status})})]}),n.riskClass?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Risk`}),(0,I.jsx)(`dd`,{children:n.riskClass})]}):null,n.taste?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Judge verdict`}),(0,I.jsxs)(`dd`,{children:[n.taste.verdict,` · alignment `,n.taste.alignment,`/10 · ambition `,n.taste.ambition,`/10 · design`,` `,n.taste.design,`/10`]})]}):null,n.decisionReason?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Decision`}),(0,I.jsx)(`dd`,{children:n.decisionReason})]}):null,n.learningSource?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Learning source`}),(0,I.jsx)(`dd`,{children:n.learningSource})]}):null]}),n.taste?.rationale?(0,I.jsx)(`p`,{className:Ha.rationale,children:n.taste.rationale}):null,n.diff?(0,I.jsxs)(`details`,{className:Ha.diffDetails,children:[(0,I.jsxs)(`summary`,{children:[`Diff (`,n.diff.split(`
4
4
  `).length,` lines)`]}),(0,I.jsx)(`pre`,{className:Ha.diff,children:n.diff})]}):(0,I.jsx)(`p`,{className:Ha.error,children:`No diff recorded for this proposal.`})]}):null}function Wa({drillIn:e}){return e.runId?(0,I.jsx)(Da,{runId:e.runId}):e.proposalId?(0,I.jsx)(Ua,{proposalId:e.proposalId}):null}var Ga={row:`_row_194dy_1`,summary:`_summary_194dy_9`,sourceTag:`_sourceTag_194dy_31`,when:`_when_194dy_53`,repo:`_repo_194dy_61`,title:`_title_194dy_70`,expandHint:`_expandHint_194dy_80`,body:`_body_194dy_86`,detailText:`_detailText_194dy_90`},Ka={"daemon-tick":`Daemon`,merge:`Merge`,"agent-action":`Agent`,run:`Run`,proposal:`Proposal`};function qa(e){let t=new Date(e);return`${t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})} ${t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}`}function Ja({entry:e}){let t=!!e.drillIn,[n,r]=(0,A.useState)(!1);return(0,I.jsxs)(`details`,{className:Ga.row,"data-state-key":`journal-${e.id}`,onToggle:e=>r(e.currentTarget.open),children:[(0,I.jsxs)(`summary`,{className:Ga.summary,"data-focus-key":`journal-${e.id}`,children:[(0,I.jsx)(`span`,{className:Ga.sourceTag,"data-source":e.source,children:Ka[e.source]}),(0,I.jsx)(`span`,{className:Ga.when,title:e.ts,children:qa(e.ts)}),(0,I.jsx)(b,{status:e.statusLabel}),e.repo?(0,I.jsx)(`span`,{className:Ga.repo,children:e.repo}):null,(0,I.jsx)(`span`,{className:Ga.title,children:e.title}),(0,I.jsx)(ne,{quality:e.sourceQuality}),t?(0,I.jsx)(`span`,{className:Ga.expandHint,"aria-hidden":`true`,children:`why? ▾`}):null]}),(0,I.jsxs)(`div`,{className:Ga.body,children:[(0,I.jsx)(`p`,{className:Ga.detailText,children:e.detail}),n&&e.drillIn?(0,I.jsx)(Wa,{drillIn:e.drillIn}):null]})]})}var Ya={view:`_view_1omi1_1`,header:`_header_1omi1_9`,title:`_title_1omi1_16`,windowNote:`_windowNote_1omi1_23`,freshness:`_freshness_1omi1_30`,freshnessLabel:`_freshnessLabel_1omi1_37`,errorBanner:`_errorBanner_1omi1_42`,panel:`_panel_1omi1_50`,list:`_list_1omi1_57`,empty:`_empty_1omi1_63`},Xa=8e3;function Za(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<5?`just now`:t<60?`${t}s ago`:`${Math.round(t/60)}m ago`}function Qa(){let e=P().state?.windowToday===!0,t=w(_e),n=w(ve),r=w(we),i=w(ue),a=ee(_e);(0,A.useEffect)(()=>{let e=setInterval(a,Xa);return()=>clearInterval(e)},[a]);let[o,s]=(0,A.useState)(new Set(za)),[c,l]=(0,A.useState)(``),[u,d]=(0,A.useState)(e?`today`:`24h`),[p,m]=(0,A.useState)(e?Ma():864e5),h=(0,A.useMemo)(()=>ja({logs:t.data,fleetActivity:n.data,runs:r.data,inbox:i.data}),[t.data,n.data,r.data,i.data]),g=(0,A.useMemo)(()=>Na(h,{sources:o,query:c,windowMs:p}),[h,o,c,p]),_=(0,A.useRef)(new Map);function v(e){let t=g.find(t=>new Date(t.ts).getTime()<=e+36e5);t&&_.current.get(t.id)?.scrollIntoView({behavior:`smooth`,block:`center`})}let b=t.status===`loading`&&n.status===`loading`&&r.status===`loading`&&i.status===`loading`,x=[t,n,r,i].some(e=>e.status===`refreshing`),S=Math.max(t.updatedAt??0,n.updatedAt??0,r.updatedAt??0,i.updatedAt??0),C=[t.status===`error`?`daemon log: ${t.error?.message}`:null,n.status===`error`?`fleet activity: ${n.error?.message}`:null,r.status===`error`?`runs: ${r.error?.message}`:null,i.status===`error`?`inbox: ${i.error?.message}`:null].filter(e=>e!==null);return(0,I.jsxs)(`div`,{className:Ya.view,children:[(0,I.jsxs)(`header`,{className:Ya.header,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:Ya.title,children:`Work Journal`}),(0,I.jsx)(`p`,{className:Ya.windowNote,children:`Merges the daemon log (last 200 lines), fleet activity (last ~20 merges/ticks/agent actions), recent runs (last 200), and the pending-proposal inbox. The read API does not expose the full on-disk history beyond this window.`})]}),(0,I.jsxs)(`div`,{className:Ya.freshness,"aria-live":`polite`,children:[x?(0,I.jsx)(y,{}):null,S>0?(0,I.jsxs)(`span`,{className:Ya.freshnessLabel,children:[`Updated `,Za(S)]}):null]})]}),C.length>0?(0,I.jsxs)(`div`,{className:Ya.errorBanner,role:`alert`,children:[`Some sources failed to load: `,C.join(`; `)]}):null,(0,I.jsx)(ka,{}),b?(0,I.jsxs)(`div`,{className:Ya.panel,children:[(0,I.jsx)(f,{}),(0,I.jsx)(f,{}),(0,I.jsx)(f,{}),(0,I.jsx)(f,{})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Va,{entries:h,hours:24,onScrubTo:v}),(0,I.jsx)(Ra,{sources:o,onSourcesChange:s,query:c,onQueryChange:l,windowValue:u,onWindowChange:(e,t)=>{d(e),m(t)}}),(0,I.jsx)(`div`,{className:Ya.panel,children:g.length===0?(0,I.jsx)(`p`,{className:Ya.empty,children:`Nothing matches the current filters in this window.`}):(0,I.jsx)(`ul`,{className:Ya.list,children:g.map(e=>(0,I.jsx)(`li`,{ref:t=>{t?_.current.set(e.id,t):_.current.delete(e.id)},children:(0,I.jsx)(Ja,{entry:e})},e.id))})})]})]})}var $a={view:`_view_7836g_1`,header:`_header_7836g_7`,title:`_title_7836g_15`,freshness:`_freshness_7836g_21`,freshnessLabel:`_freshnessLabel_7836g_27`,filterRow:`_filterRow_7836g_32`,windowGroup:`_windowGroup_7836g_38`,windowButton:`_windowButton_7836g_45`,windowButtonActive:`_windowButtonActive_7836g_64`,kpiGrid:`_kpiGrid_7836g_70`,chartsGrid:`_chartsGrid_7836g_76`,error:`_error_7836g_82`},eo=[`1d`,`7d`,`30d`],to={ok:`success`,warn:`warning`,over:`danger`};function no(e){let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}function ro(){let[e,t]=(0,A.useState)(`7d`),n=w(fe(e));return(0,I.jsxs)(`div`,{className:$a.view,children:[(0,I.jsxs)(`header`,{className:$a.header,children:[(0,I.jsx)(`h1`,{className:$a.title,children:`Pulse`}),(0,I.jsxs)(`div`,{className:$a.freshness,"aria-live":`polite`,children:[n.status===`refreshing`?(0,I.jsx)(y,{}):null,n.updatedAt?(0,I.jsxs)(`span`,{className:$a.freshnessLabel,children:[`Updated `,ao(n.updatedAt)]}):null]})]}),(0,I.jsxs)(`div`,{className:$a.filterRow,role:`group`,"aria-label":`Time window`,children:[(0,I.jsx)(`div`,{className:$a.windowGroup,children:eo.map(n=>(0,I.jsx)(`button`,{type:`button`,className:`${$a.windowButton} ${n===e?$a.windowButtonActive:``}`,"aria-pressed":n===e,onClick:()=>t(n),children:n},n))}),n.data?(0,I.jsx)(b,{status:n.data.budget.level,tone:to[n.data.budget.level],children:n.data.budget.message}):null]}),n.status===`loading`?(0,I.jsx)(x,{count:4}):n.status===`error`?(0,I.jsx)(`div`,{className:$a.error,role:`alert`,children:n.error?.message??`Failed to load pulse data.`}):n.data?(0,I.jsx)(io,{rollup:n.data}):null]})}function io({rollup:e}){let t=[{id:`cost`,label:`Est. cost (USD)`,points:e.byDay.map(e=>({x:Date.parse(`${e.day}T00:00:00Z`),y:e.estCostUsd}))}],n=[...e.byProject].sort((e,t)=>t.estCostUsd-e.estCostUsd).slice(0,8),r=n.map(e=>({label:no(e.project),value:e.estCostUsd})),i=[...e.byModel].sort((e,t)=>t.estCostUsd-e.estCostUsd).slice(0,8),a=i.map(e=>({label:e.model,value:e.estCostUsd}));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:$a.kpiGrid,children:[(0,I.jsx)(k,{label:`Est. cost`,value:Be(e.totals.estCostUsd),caption:e.window}),(0,I.jsx)(k,{label:`Tokens`,value:ze(e.totals.tokensIn+e.totals.tokensOut),caption:`${ze(e.totals.tokensIn)} in / ${ze(e.totals.tokensOut)} out`}),(0,I.jsx)(k,{label:`Sessions`,value:String(e.totals.sessions)}),(0,I.jsx)(k,{label:`Commits`,value:String(e.totals.commits)})]}),(0,I.jsxs)(`div`,{className:$a.chartsGrid,children:[(0,I.jsx)(Ie,{title:`Cost over time`,description:`since ${new Date(e.since).toLocaleDateString()}`,empty:e.byDay.length===0,emptyMessage:`No activity recorded in this window.`,table:(0,I.jsx)(Ve,{caption:`Daily cost`,rowKey:e=>e.day,rows:e.byDay,columns:[{key:`day`,label:`Day`,render:e=>e.day},{key:`cost`,label:`Cost`,numeric:!0,render:e=>Be(e.estCostUsd)},{key:`sessions`,label:`Sessions`,numeric:!0,render:e=>String(e.sessions)}]}),children:(0,I.jsx)(Re,{series:t,area:!0,ariaLabel:`Estimated cost over time`,formatX:e=>new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`}),formatY:e=>Be(e)})}),(0,I.jsx)(Ie,{title:`Top projects by cost`,empty:r.length===0,emptyMessage:`No project activity in this window.`,table:(0,I.jsx)(Ve,{caption:`Cost by project`,rowKey:e=>e.project,rows:n,columns:[{key:`project`,label:`Project`,render:e=>no(e.project)},{key:`sessions`,label:`Sessions`,numeric:!0,render:e=>String(e.sessions)},{key:`commits`,label:`Commits`,numeric:!0,render:e=>String(e.commits)},{key:`cost`,label:`Cost`,numeric:!0,render:e=>Be(e.estCostUsd)}]}),children:(0,I.jsx)(Fe,{data:r,orientation:`horizontal`,ariaLabel:`Top projects by estimated cost`,formatValue:e=>Be(e)})}),(0,I.jsx)(Ie,{title:`Cost by model`,empty:a.length===0,emptyMessage:`No model activity in this window.`,table:(0,I.jsx)(Ve,{caption:`Cost by model`,rowKey:e=>e.model,rows:i,columns:[{key:`model`,label:`Model`,render:e=>e.model},{key:`calls`,label:`Calls`,numeric:!0,render:e=>String(e.calls)},{key:`tokens`,label:`Tokens`,numeric:!0,render:e=>ze(e.tokensIn+e.tokensOut)},{key:`cost`,label:`Cost`,numeric:!0,render:e=>Be(e.estCostUsd)}]}),children:(0,I.jsx)(Fe,{data:a,ariaLabel:`Cost by model`,formatValue:e=>Be(e)})})]})]})}function ao(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<5?`just now`:t<60?`${t}s ago`:`${Math.round(t/60)}m ago`}var z={view:`_view_44i9i_1`,header:`_header_44i9i_7`,title:`_title_44i9i_15`,searchRow:`_searchRow_44i9i_21`,searchInput:`_searchInput_44i9i_27`,resultCount:`_resultCount_44i9i_43`,results:`_results_44i9i_48`,row:`_row_44i9i_57`,rowHeader:`_rowHeader_44i9i_64`,rowTitle:`_rowTitle_44i9i_72`,rowMeta:`_rowMeta_44i9i_78`,badge:`_badge_44i9i_87`,snippet:`_snippet_44i9i_97`,tags:`_tags_44i9i_107`,tag:`_tag_44i9i_107`,skeletons:`_skeletons_44i9i_123`,empty:`_empty_44i9i_129`,error:`_error_44i9i_136`},oo=50,so=300;function co(e,t){let[n,r]=(0,A.useState)(e);return(0,A.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function lo(e,t=220){let n=e.trim();return n.length>t?`${n.slice(0,t-1)}…`:n}function uo(e){let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.floor((Date.now()-t)/864e5);return n<=0?`today`:n===1?`yesterday`:n<30?`${n}d ago`:`${Math.floor(n/30)}mo ago`}function fo(){let[e,t]=(0,A.useState)(``),n=co(e,so),r=w(le(n)),i=n.trim().length>0,a=r.data,{rows:o,totalCount:s}=(0,A.useMemo)(()=>{if(!a)return{rows:[],totalCount:0};if(i)return{rows:a,totalCount:a.length};let e=a;return{rows:[...e].sort((e,t)=>Date.parse(t.ts)-Date.parse(e.ts)).slice(0,oo),totalCount:e.length}},[a,i]),c=(0,A.useMemo)(()=>{if(!a||i)return[];let e=a,t=new Map;for(let n of e){let e=n.project??`(unscoped)`;t.set(e,(t.get(e)??0)+1)}return[...t.entries()].sort((e,t)=>t[1]-e[1]).slice(0,8).map(([e,t])=>({label:e,value:t}))},[a,i]);return(0,I.jsxs)(`div`,{className:z.view,children:[(0,I.jsxs)(`header`,{className:z.header,children:[(0,I.jsx)(`h1`,{className:z.title,children:`Genome`}),(0,I.jsx)(`div`,{"aria-live":`polite`,children:r.status===`refreshing`?(0,I.jsx)(y,{}):null})]}),(0,I.jsxs)(`div`,{className:z.searchRow,children:[(0,I.jsx)(`input`,{type:`search`,className:z.searchInput,placeholder:`Search the genome (title, tags, body text)…`,value:e,onChange:e=>t(e.target.value),"aria-label":`Search cross-repo knowledge`}),a?(0,I.jsx)(`span`,{className:z.resultCount,children:i?`${s} match${s===1?``:`es`}`:`showing ${o.length} of ${s}`}):null]}),!i&&c.length>0?(0,I.jsx)(Ie,{title:`Top projects by genome entries`,description:`browse mode — all loaded entries`,children:(0,I.jsx)(Fe,{data:c,orientation:`horizontal`,ariaLabel:`Top projects by genome entry count`,formatValue:e=>ze(e)})}):null,r.status===`loading`?(0,I.jsxs)(`div`,{className:z.skeletons,"aria-hidden":`true`,children:[(0,I.jsx)(f,{}),(0,I.jsx)(f,{}),(0,I.jsx)(f,{}),(0,I.jsx)(f,{})]}):r.status===`error`?(0,I.jsx)(`div`,{className:z.error,role:`alert`,children:r.error?.message??`Failed to load genome data.`}):o.length===0?(0,I.jsx)(`p`,{className:z.empty,children:i?`No genome entries match "${n}".`:`No genome entries recorded yet.`}):(0,I.jsx)(`ul`,{className:z.results,children:o.map(e=>{let t=de(e)?e:null,n=t?t.entry:e;return(0,I.jsxs)(`li`,{className:z.row,children:[(0,I.jsxs)(`div`,{className:z.rowHeader,children:[(0,I.jsx)(`span`,{className:z.rowTitle,children:n.title}),(0,I.jsxs)(`span`,{className:z.rowMeta,children:[t?(0,I.jsxs)(`span`,{className:z.badge,children:[t.method,` · `,t.score.toFixed(2)]}):null,(0,I.jsx)(`span`,{children:uo(n.ts)})]})]}),(0,I.jsxs)(`div`,{className:z.rowMeta,children:[(0,I.jsx)(`span`,{className:z.badge,children:n.project??`unscoped`}),(0,I.jsx)(`span`,{className:z.badge,children:n.source})]}),(0,I.jsx)(`p`,{className:z.snippet,children:lo(n.text)}),n.tags.length>0?(0,I.jsx)(`div`,{className:z.tags,children:n.tags.map(e=>(0,I.jsx)(`span`,{className:z.tag,children:e},e))}):null]},n.id)})})]})}var B={view:`_view_1frm3_1`,header:`_header_1frm3_7`,title:`_title_1frm3_15`,filterRow:`_filterRow_1frm3_21`,windowGroup:`_windowGroup_1frm3_27`,windowButton:`_windowButton_1frm3_34`,windowButtonActive:`_windowButtonActive_1frm3_53`,kpiGrid:`_kpiGrid_1frm3_59`,chartsGrid:`_chartsGrid_1frm3_65`,section:`_section_1frm3_71`,sectionTitle:`_sectionTitle_1frm3_77`,goalsList:`_goalsList_1frm3_83`,goalRow:`_goalRow_1frm3_92`,goalObjective:`_goalObjective_1frm3_102`,meterTrack:`_meterTrack_1frm3_107`,meterFill:`_meterFill_1frm3_115`,goalMeta:`_goalMeta_1frm3_121`,error:`_error_1frm3_126`,notAvailable:`_notAvailable_1frm3_135`},po=[`7d`,`30d`,`all`];function mo(e){return`${e.engine}:${e.model}`}function ho(){let[e,t]=(0,A.useState)(`30d`),n=w(se),r=w(ye(e)),i=n.data?.production;return(0,I.jsxs)(`div`,{className:B.view,children:[(0,I.jsxs)(`header`,{className:B.header,children:[(0,I.jsx)(`h1`,{className:B.title,children:`Production`}),(0,I.jsx)(`div`,{"aria-live":`polite`,children:n.status===`refreshing`||r.status===`refreshing`?(0,I.jsx)(y,{}):null})]}),n.status===`loading`?(0,I.jsx)(x,{count:4}):n.status===`error`?(0,I.jsx)(`div`,{className:B.error,role:`alert`,children:n.error?.message??`Failed to load production summary.`}):i?(0,I.jsx)(go,{production:i}):(0,I.jsx)(`p`,{className:B.notAvailable,children:`Production summary not available on this server (older producer, or not yet populated).`}),(0,I.jsx)(`div`,{className:B.filterRow,role:`group`,"aria-label":`Model stats window`,children:(0,I.jsx)(`div`,{className:B.windowGroup,children:po.map(n=>(0,I.jsx)(`button`,{type:`button`,className:`${B.windowButton} ${n===e?B.windowButtonActive:``}`,"aria-pressed":n===e,onClick:()=>t(n),children:n},n))})}),r.status===`loading`?(0,I.jsx)(x,{count:3}):r.status===`error`?(0,I.jsx)(`div`,{className:B.error,role:`alert`,children:r.error?.message??`Failed to load per-model stats.`}):r.data?(0,I.jsx)(_o,{result:r.data}):null]})}function go({production:e}){let t=e.judgeVerdicts24h,n=e.judgeFailures24h??{total:0,parse:0,network:0},r=[{label:`ship`,value:t.ship},{label:`review`,value:t.review},{label:`noise`,value:t.noise},{label:`harmful`,value:t.harmful}],i=e.shipsPerDayTrend.map(e=>({label:Le(e.date),value:e.count})),a=e.shipsPerDayTrend.reduce((e,t)=>e+t.count,0),o=D(e.proposalSourceQuality),s=D(e.judgeTraceSourceQuality);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:B.kpiGrid,children:[(0,I.jsx)(k,{label:`Proposals (24h)`,value:(0,I.jsx)(E,{quality:e.proposalSourceQuality,label:`proposals`,children:String(e.proposals24h.total)}),caption:(0,I.jsx)(E,{quality:e.proposalSourceQuality,label:`pending proposals`,children:`${e.proposals24h.pending} pending`})}),(0,I.jsx)(k,{label:`Auto-merges today`,value:(0,I.jsx)(E,{quality:e.proposalSourceQuality,label:`auto-merges`,children:String(e.autoMergesToday.count)})}),(0,I.jsx)(k,{label:`Judged (24h)`,value:(0,I.jsx)(E,{quality:e.judgeTraceSourceQuality,label:`judge verdicts`,children:String(t.total)})}),(0,I.jsx)(k,{label:`Judge failures (24h)`,value:(0,I.jsx)(E,{quality:e.judgeFailureSourceQuality,label:`judge failures`,children:String(n.total)}),caption:(0,I.jsx)(E,{quality:e.judgeFailureSourceQuality,children:`${n.parse} parse · ${n.network} network`})}),(0,I.jsx)(k,{label:`Active goals`,value:(0,I.jsx)(E,{quality:e.activeGoalsSourceQuality,label:`active goals`,children:String(e.activeGoals.length)})})]}),(0,I.jsxs)(`div`,{className:B.chartsGrid,children:[(0,I.jsxs)(Ie,{title:`Ships per day`,description:`last 7 days`,empty:o&&i.length===0,emptyMessage:`No ship history recorded yet.`,table:o?(0,I.jsx)(Ve,{caption:`Ships per day`,rowKey:e=>e.label,rows:i,columns:[{key:`day`,label:`Day`,render:e=>e.label},{key:`count`,label:`Ships`,numeric:!0,render:e=>String(e.value??0)}]}):void 0,children:[o?a===0?(0,I.jsx)(`p`,{className:B.notAvailable,children:`0 ships in the last 7 days — this is the real number, not a loading state.`}):null:(0,I.jsx)(E,{quality:e.proposalSourceQuality,label:`ship history`,children:`ship history`}),o?(0,I.jsx)(Fe,{data:i,ariaLabel:`Ships per day, last 7 days`,formatValue:e=>String(e)}):null]}),(0,I.jsx)(Ie,{title:`Judge verdict breakdown`,description:`last 24h`,empty:s&&t.total===0,emptyMessage:`No judge verdicts recorded in the last 24h.`,children:s?(0,I.jsx)(Fe,{data:r,ariaLabel:`Judge verdict breakdown, last 24h`,formatValue:e=>String(e)}):(0,I.jsx)(E,{quality:e.judgeTraceSourceQuality,label:`judge verdicts`,children:`judge verdicts`})})]}),D(e.activeGoalsSourceQuality)?e.activeGoals.length>0?(0,I.jsxs)(`div`,{className:B.section,children:[(0,I.jsx)(`h2`,{className:B.sectionTitle,children:`Active goals`}),(0,I.jsx)(`ul`,{className:B.goalsList,children:e.activeGoals.map(e=>{let t=e.totalMilestones>0?e.doneMilestones/e.totalMilestones:0;return(0,I.jsxs)(`li`,{className:B.goalRow,children:[(0,I.jsx)(`span`,{className:B.goalObjective,children:e.objective}),(0,I.jsx)(`div`,{className:B.meterTrack,children:(0,I.jsx)(`div`,{className:B.meterFill,style:{width:`${Math.round(t*100)}%`}})}),(0,I.jsxs)(`span`,{className:B.goalMeta,children:[e.doneMilestones,` / `,e.totalMilestones,` milestones`]})]},e.goalId)})})]}):null:(0,I.jsxs)(`div`,{className:B.section,children:[(0,I.jsx)(`h2`,{className:B.sectionTitle,children:`Active goals`}),(0,I.jsx)(E,{quality:e.activeGoalsSourceQuality,label:`active goals`,children:`active goals`})]})]})}function _o({result:e}){let t=[...e.models].sort((e,t)=>t.dispatches-e.dispatches).slice(0,12),n=t.map(e=>({label:mo(e),value:e.judged>0?e.shipRate:null}));return(0,I.jsx)(`div`,{className:B.chartsGrid,children:(0,I.jsx)(Ie,{title:`Ship rate by model`,description:`judged proposals in the selected window`,empty:t.length===0,emptyMessage:`No dispatch history for this window.`,table:(0,I.jsx)(Ve,{caption:`Per-model economics`,rowKey:mo,rows:t,columns:[{key:`model`,label:`Model`,render:e=>mo(e)},{key:`dispatches`,label:`Dispatches`,numeric:!0,render:e=>String(e.dispatches)},{key:`shipRate`,label:`Ship rate`,numeric:!0,render:e=>e.judged>0?Pe(e.shipRate):`—`},{key:`merged`,label:`Merged`,numeric:!0,render:e=>String(e.merged)},{key:`costPerMerged`,label:`Cost / merge`,numeric:!0,render:e=>e.costPerMergedUsd===null?`—`:Be(e.costPerMergedUsd)},{key:`bestOfN`,label:`Best-of-N win rate`,numeric:!0,render:t=>t.bestOfNAvailable?(0,I.jsx)(E,{quality:e.bestOfNSource,label:`best-of-N win rate`,children:Pe(t.bestOfN.winRate)}):`—`}]}),children:(0,I.jsx)(Fe,{data:n,ariaLabel:`Ship rate by model`,formatValue:e=>Pe(e)})})})}var V={view:`_view_ruego_1`,header:`_header_ruego_7`,title:`_title_ruego_15`,freshness:`_freshness_ruego_21`,freshnessLabel:`_freshnessLabel_ruego_27`,kpiGrid:`_kpiGrid_ruego_32`,chartsGrid:`_chartsGrid_ruego_38`,section:`_section_ruego_44`,sectionTitle:`_sectionTitle_ruego_50`,list:`_list_ruego_56`,row:`_row_ruego_65`,rowTitle:`_rowTitle_ruego_75`,meterTrack:`_meterTrack_ruego_84`,meterFill:`_meterFill_ruego_92`,rowMeta:`_rowMeta_ruego_98`,effectiveness:`_effectiveness_ruego_103`,effectivenessHeadline:`_effectivenessHeadline_ruego_110`,error:`_error_ruego_116`,notAvailable:`_notAvailable_ruego_125`};function vo(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<5?`just now`:t<60?`${t}s ago`:`${Math.round(t/60)}m ago`}function yo(){let e=w(ge),t=w(se);return(0,I.jsxs)(`div`,{className:V.view,children:[(0,I.jsxs)(`header`,{className:V.header,children:[(0,I.jsx)(`h1`,{className:V.title,children:`Portfolio`}),(0,I.jsxs)(`div`,{className:V.freshness,"aria-live":`polite`,children:[e.status===`refreshing`||t.status===`refreshing`?(0,I.jsx)(y,{}):null,e.updatedAt?(0,I.jsxs)(`span`,{className:V.freshnessLabel,children:[`Updated `,vo(e.updatedAt)]}):null]})]}),e.status===`loading`?(0,I.jsx)(x,{count:6}):e.status===`error`?(0,I.jsx)(`div`,{className:V.error,role:`alert`,children:e.error?.message??`Failed to load portfolio.`}):e.data===null?(0,I.jsx)(`p`,{className:V.notAvailable,children:`No portfolio roll-up available — either this server has no enrolled repos, or it predates the portfolio feature.`}):e.data?(0,I.jsx)(bo,{portfolio:e.data}):null]})}function bo({portfolio:e}){let{health:t,goalsInFlight:n,backlogTop:r,cost:i,effectiveness:a,today:o}=e,s=t.worstRepos.map(e=>({label:e.repo.split(`/`).filter(Boolean).pop()??e.repo,value:e.score}));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:V.kpiGrid,children:[(0,I.jsx)(k,{label:`Portfolio health`,value:`${t.averageScore.toFixed(0)} (${t.averageGrade})`,caption:`${t.reposScored} repos scored`,delta:o.healthScoreDelta===null?null:{value:o.healthScoreDelta,goodWhenPositive:!0}}),(0,I.jsx)(k,{label:`Goals in flight`,value:String(n.length)}),(0,I.jsx)(k,{label:`Backlog top items`,value:String(r.length),delta:o.pendingProposalsDelta===null?null:{value:o.pendingProposalsDelta,versus:`pending proposals`}}),(0,I.jsx)(k,{label:`Spend`,value:Be(i.spentUsd),caption:`${i.window} window`,delta:o.spendUsdDelta===null?null:{value:o.spendUsdDelta,goodWhenPositive:!1}}),(0,I.jsx)(k,{label:`Local savings`,value:Be(i.localSavingsUsd)}),(0,I.jsx)(k,{label:`Projected monthly`,value:Be(i.projectedMonthlyUsd)})]}),a?(0,I.jsxs)(`div`,{className:V.effectiveness,children:[(0,I.jsx)(`p`,{className:V.effectivenessHeadline,children:a.headline}),(0,I.jsxs)(`span`,{className:V.rowMeta,children:[`Success rate `,Pe(a.successRate),a.effectivenessDeltaPct===null?``:` (${a.effectivenessDeltaPct>=0?`+`:``}${a.effectivenessDeltaPct.toFixed(1)}pp)`]})]}):null,(0,I.jsxs)(`div`,{className:V.chartsGrid,children:[(0,I.jsx)(Ie,{title:`Worst-scoring repos`,empty:s.length===0,emptyMessage:`No enrolled repos scored yet.`,table:(0,I.jsx)(Ve,{caption:`Worst-scoring repos`,rowKey:e=>e.repo,rows:t.worstRepos,columns:[{key:`repo`,label:`Repo`,render:e=>e.repo},{key:`score`,label:`Score`,numeric:!0,render:e=>e.score.toFixed(0)},{key:`grade`,label:`Grade`,render:e=>e.grade}]}),children:(0,I.jsx)(Fe,{data:s,orientation:`horizontal`,ariaLabel:`Worst-scoring repos by health score`,formatValue:e=>e.toFixed(0)})}),(0,I.jsxs)(`div`,{className:V.section,children:[(0,I.jsx)(`h2`,{className:V.sectionTitle,children:`In-flight goals`}),n.length===0?(0,I.jsx)(`p`,{className:V.notAvailable,children:`No goals currently in flight.`}):(0,I.jsx)(`ul`,{className:V.list,children:n.map(e=>(0,I.jsxs)(`li`,{className:V.row,children:[(0,I.jsxs)(`span`,{className:V.rowTitle,children:[e.objective,(0,I.jsxs)(`span`,{className:V.rowMeta,children:[Math.round(e.fractionDone*100),`%`]})]}),(0,I.jsx)(`div`,{className:V.meterTrack,children:(0,I.jsx)(`div`,{className:V.meterFill,style:{width:`${Math.round(e.fractionDone*100)}%`}})}),(0,I.jsx)(`span`,{className:V.rowMeta,children:e.nextActionable?`Next: ${e.nextActionable}`:`Nothing actionable queued`})]},e.goalId))})]})]}),(0,I.jsxs)(`div`,{className:V.section,children:[(0,I.jsx)(`h2`,{className:V.sectionTitle,children:`Top backlog`}),r.length===0?(0,I.jsx)(`p`,{className:V.notAvailable,children:`Backlog is empty.`}):(0,I.jsx)(Ve,{caption:`Top backlog items`,rowKey:e=>e.title,rows:r,columns:[{key:`title`,label:`Item`,render:e=>e.title},{key:`repo`,label:`Repo`,render:e=>e.repo??`—`},{key:`score`,label:`Score`,numeric:!0,render:e=>e.score.toFixed(1)}]})]})]})}var H={view:`_view_1eb19_1`,header:`_header_1eb19_8`,title:`_title_1eb19_16`,freshness:`_freshness_1eb19_22`,count:`_count_1eb19_28`,filters:`_filters_1eb19_34`,field:`_field_1eb19_45`,fieldLabel:`_fieldLabel_1eb19_51`,input:`_input_1eb19_56`,select:`_select_1eb19_57`,clear:`_clear_1eb19_74`,tableWrap:`_tableWrap_1eb19_87`,table:`_table_1eb19_87`,statusCol:`_statusCol_1eb19_101`,engineCol:`_engineCol_1eb19_104`,providerCol:`_providerCol_1eb19_107`,tokensCol:`_tokensCol_1eb19_110`,costCol:`_costCol_1eb19_113`,stepsCol:`_stepsCol_1eb19_116`,createdCol:`_createdCol_1eb19_119`,row:`_row_1eb19_143`,sortHeader:`_sortHeader_1eb19_151`,goalLink:`_goalLink_1eb19_168`,numeric:`_numeric_1eb19_180`,date:`_date_1eb19_186`,empty:`_empty_1eb19_192`,error:`_error_1eb19_199`};function xo(e){return e.usage.tokensIn+e.usage.tokensOut}function So(e,t){if(!t)return!0;let n=t.toLowerCase();return e.id.toLowerCase().includes(n)||e.goal.toLowerCase().includes(n)}function Co(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function wo(){let e=(0,A.useRef)(null);Me(`/work/runs`,e);let t=hn(),n=w(we),[r,i]=(0,A.useState)(0),a=(0,A.useRef)(new Map),[o,s]=(0,A.useState)(``),[c,l]=(0,A.useState)(`all`),[u,d]=(0,A.useState)(`all`),[p,m]=(0,A.useState)(`all`),[h,g]=(0,A.useState)(``),[_,v]=(0,A.useState)(`createdAt`),[x,S]=(0,A.useState)(`desc`),C=(0,A.useMemo)(()=>n.data??[],[n.data]),{statuses:T,engines:ee,providers:te}=(0,A.useMemo)(()=>{let e=new Set,t=new Set,n=new Set;for(let r of C)e.add(r.status),t.add(r.engine),n.add(r.provider);return{statuses:Array.from(e).sort(),engines:Array.from(t).sort(),providers:Array.from(n).sort()}},[C]),ne=h?new Date(h).getTime():null,E=(0,A.useMemo)(()=>{let e=C.filter(e=>{if(c!==`all`&&e.status!==c||u!==`all`&&e.engine!==u||p!==`all`&&e.provider!==p)return!1;if(ne!==null){let t=new Date(e.createdAt).getTime();if(Number.isNaN(t)||t<ne)return!1}return!!So(e,o.trim())});return e=[...e].sort((e,t)=>{let n=0;switch(_){case`createdAt`:n=e.createdAt.localeCompare(t.createdAt);break;case`updatedAt`:n=e.updatedAt.localeCompare(t.updatedAt);break;case`tokens`:n=xo(e)-xo(t);break;case`estCostUsd`:n=e.usage.estCostUsd-t.usage.estCostUsd;break;case`steps`:n=e.steps.length-t.steps.length;break;case`status`:n=e.status.localeCompare(t.status)}return x===`asc`?n:-n}),e},[C,c,u,p,ne,o,_,x]);(0,A.useEffect)(()=>{i(e=>Math.min(e,Math.max(E.length-1,0)))},[E.length]);function re(e){if(E.length!==0){if(e.key===`ArrowDown`){e.preventDefault();let t=Math.min(r+1,E.length-1);i(t),a.current.get(E[t].id)?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let t=Math.max(r-1,0);i(t),a.current.get(E[t].id)?.focus()}else if(e.key===`Enter`){let e=E[r];e&&t(`/work/runs/${e.id}`)}}}function D(e){e===_?S(e=>e===`asc`?`desc`:`asc`):(v(e),S(`desc`))}function ie(e){return e===_?x===`asc`?` ↑`:` ↓`:``}return(0,I.jsxs)(`div`,{ref:e,className:H.view,children:[(0,I.jsxs)(`header`,{className:H.header,children:[(0,I.jsx)(`h1`,{className:H.title,children:`Runs`}),(0,I.jsxs)(`div`,{className:H.freshness,"aria-live":`polite`,children:[n.status===`refreshing`?(0,I.jsx)(y,{}):null,(0,I.jsxs)(`span`,{className:H.count,children:[E.length,` of `,C.length,` runs (server caps at 200 most recent)`]})]})]}),(0,I.jsxs)(`form`,{className:H.filters,role:`search`,"aria-label":`Filter runs`,onSubmit:e=>e.preventDefault(),children:[(0,I.jsxs)(`label`,{className:H.field,children:[(0,I.jsx)(`span`,{className:H.fieldLabel,children:`Search`}),(0,I.jsx)(`input`,{type:`text`,className:H.input,placeholder:`goal or run id (e.g. repo/project name)`,value:o,onChange:e=>s(e.target.value)})]}),(0,I.jsxs)(`label`,{className:H.field,children:[(0,I.jsx)(`span`,{className:H.fieldLabel,children:`Status`}),(0,I.jsxs)(`select`,{className:H.select,value:c,onChange:e=>l(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),T.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]}),(0,I.jsxs)(`label`,{className:H.field,children:[(0,I.jsx)(`span`,{className:H.fieldLabel,children:`Engine`}),(0,I.jsxs)(`select`,{className:H.select,value:u,onChange:e=>d(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),ee.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]}),(0,I.jsxs)(`label`,{className:H.field,children:[(0,I.jsx)(`span`,{className:H.fieldLabel,children:`Provider`}),(0,I.jsxs)(`select`,{className:H.select,value:p,onChange:e=>m(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),te.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]}),(0,I.jsxs)(`label`,{className:H.field,children:[(0,I.jsx)(`span`,{className:H.fieldLabel,children:`Since`}),(0,I.jsx)(`input`,{type:`date`,className:H.input,value:h,onChange:e=>g(e.target.value)})]}),(c!==`all`||u!==`all`||p!==`all`||h||o)&&(0,I.jsx)(`button`,{type:`button`,className:H.clear,onClick:()=>{s(``),l(`all`),d(`all`),m(`all`),g(``)},children:`Clear filters`})]}),n.status===`loading`?(0,I.jsxs)(`div`,{className:H.tableWrap,children:[(0,I.jsx)(f,{}),(0,I.jsx)(f,{}),(0,I.jsx)(f,{})]}):n.status===`error`?(0,I.jsx)(`div`,{className:H.error,role:`alert`,children:n.error?.message??`Failed to load runs.`}):E.length===0?(0,I.jsx)(`p`,{className:H.empty,children:`No runs match the current filters.`}):(0,I.jsx)(`div`,{className:H.tableWrap,children:(0,I.jsxs)(`table`,{className:H.table,onKeyDown:re,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:`Goal`}),(0,I.jsx)(`th`,{scope:`col`,className:H.statusCol,children:(0,I.jsxs)(`button`,{type:`button`,className:H.sortHeader,onClick:()=>D(`status`),children:[`Status`,ie(`status`)]})}),(0,I.jsx)(`th`,{scope:`col`,className:H.engineCol,children:`Engine`}),(0,I.jsx)(`th`,{scope:`col`,className:H.providerCol,children:`Provider`}),(0,I.jsx)(`th`,{scope:`col`,className:H.tokensCol,children:(0,I.jsxs)(`button`,{type:`button`,className:H.sortHeader,onClick:()=>D(`tokens`),children:[`Tokens in/out`,ie(`tokens`)]})}),(0,I.jsx)(`th`,{scope:`col`,className:H.costCol,children:(0,I.jsxs)(`button`,{type:`button`,className:H.sortHeader,onClick:()=>D(`estCostUsd`),children:[`Est cost`,ie(`estCostUsd`)]})}),(0,I.jsx)(`th`,{scope:`col`,className:H.stepsCol,children:(0,I.jsxs)(`button`,{type:`button`,className:H.sortHeader,onClick:()=>D(`steps`),children:[`Steps`,ie(`steps`)]})}),(0,I.jsx)(`th`,{scope:`col`,className:H.createdCol,children:(0,I.jsxs)(`button`,{type:`button`,className:H.sortHeader,onClick:()=>D(`createdAt`),children:[`Created`,ie(`createdAt`)]})})]})}),(0,I.jsx)(`tbody`,{children:E.map((e,t)=>(0,I.jsxs)(`tr`,{ref:t=>{t?a.current.set(e.id,t):a.current.delete(e.id)},tabIndex:t===r?0:-1,onFocus:()=>i(t),"aria-current":t===r?`true`:void 0,className:H.row,children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(kr,{to:`/work/runs/${e.id}`,"data-focus-key":`run-${e.id}`,className:H.goalLink,title:e.goal,tabIndex:-1,children:e.goal})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(b,{status:e.status})}),(0,I.jsx)(`td`,{children:e.engine}),(0,I.jsx)(`td`,{children:e.provider}),(0,I.jsxs)(`td`,{className:H.numeric,children:[e.usage.tokensIn.toLocaleString(),` / `,e.usage.tokensOut.toLocaleString()]}),(0,I.jsxs)(`td`,{className:H.numeric,children:[`$`,e.usage.estCostUsd.toFixed(4)]}),(0,I.jsx)(`td`,{className:H.numeric,children:e.steps.length}),(0,I.jsx)(`td`,{className:H.date,children:Co(e.createdAt)})]},e.id))})]})})]})}var U={view:`_view_16nop_1`,header:`_header_16nop_8`,eyebrow:`_eyebrow_16nop_16`,title:`_title_16nop_22`,freshness:`_freshness_16nop_29`,metaGrid:`_metaGrid_16nop_35`,numeric:`_numeric_16nop_55`,section:`_section_16nop_59`,sectionTitle:`_sectionTitle_16nop_65`,resultText:`_resultText_16nop_70`,taskList:`_taskList_16nop_79`,taskItem:`_taskItem_16nop_85`,taskHeader:`_taskHeader_16nop_98`,taskId:`_taskId_16nop_105`,taskGoal:`_taskGoal_16nop_111`,taskDeps:`_taskDeps_16nop_116`,depLink:`_depLink_16nop_122`,depMissing:`_depMissing_16nop_127`,taskError:`_taskError_16nop_132`,taskUsage:`_taskUsage_16nop_141`,stepList:`_stepList_16nop_148`,stepItem:`_stepItem_16nop_155`,stepTs:`_stepTs_16nop_164`,stepKind:`_stepKind_16nop_170`,stepTask:`_stepTask_16nop_176`,stepSummary:`_stepSummary_16nop_180`,empty:`_empty_16nop_185`,error:`_error_16nop_190`};function To(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Eo(e){return`task-${encodeURIComponent(e)}`}function Do(){let{id:e}=yn(),t=(0,A.useRef)(null);Me(`/work/runs/${e??``}`,t);let n=w(oe(e??``));if(!e)return(0,I.jsx)(`div`,{className:U.view,children:(0,I.jsx)(`p`,{className:U.error,role:`alert`,children:`No run id in URL.`})});if(n.status===`loading`)return(0,I.jsxs)(`div`,{ref:t,className:U.view,children:[(0,I.jsx)(g,{width:`60%`}),(0,I.jsx)(g,{width:`30%`}),(0,I.jsx)(g,{width:`80%`})]});if(n.status===`error`||!n.data)return(0,I.jsx)(`div`,{ref:t,className:U.view,children:(0,I.jsx)(`p`,{className:U.error,role:`alert`,children:n.error?.message??`Run ${e} not found.`})});let r=n.data,i=new Map(r.tasks.map(e=>[e.id,e]));return(0,I.jsxs)(`div`,{ref:t,className:U.view,children:[(0,I.jsxs)(`header`,{className:U.header,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`p`,{className:U.eyebrow,children:[`Run `,r.id]}),(0,I.jsx)(`h1`,{className:U.title,children:r.goal})]}),(0,I.jsxs)(`div`,{className:U.freshness,"aria-live":`polite`,children:[n.status===`refreshing`?(0,I.jsx)(y,{}):null,(0,I.jsx)(b,{status:r.status})]})]}),(0,I.jsxs)(`dl`,{className:U.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Engine`}),(0,I.jsx)(`dd`,{children:r.engine})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Provider`}),(0,I.jsx)(`dd`,{children:r.provider})]}),r.engineModel?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Model`}),(0,I.jsx)(`dd`,{children:r.engineModel})]}):null,(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Tokens in / out`}),(0,I.jsxs)(`dd`,{className:U.numeric,children:[r.usage.tokensIn.toLocaleString(),` / `,r.usage.tokensOut.toLocaleString()]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Est cost`}),(0,I.jsxs)(`dd`,{className:U.numeric,children:[`$`,r.usage.estCostUsd.toFixed(4)]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Steps`}),(0,I.jsx)(`dd`,{className:U.numeric,children:r.usage.steps})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Budget (tokens / steps)`}),(0,I.jsxs)(`dd`,{className:U.numeric,children:[r.budget.maxTokens.toLocaleString(),` / `,r.budget.maxSteps]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Created`}),(0,I.jsx)(`dd`,{children:To(r.createdAt)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Updated`}),(0,I.jsx)(`dd`,{children:To(r.updatedAt)})]}),r.terminationReason?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Termination reason`}),(0,I.jsx)(`dd`,{children:r.terminationReason})]}):null]}),r.result?(0,I.jsxs)(`section`,{className:U.section,children:[(0,I.jsx)(`h2`,{className:U.sectionTitle,children:`Result`}),(0,I.jsx)(`p`,{className:U.resultText,children:r.result})]}):null,(0,I.jsxs)(`section`,{className:U.section,children:[(0,I.jsxs)(`h2`,{className:U.sectionTitle,children:[`Tasks (`,r.tasks.length,`)`]}),r.tasks.length===0?(0,I.jsx)(`p`,{className:U.empty,children:`No tasks recorded.`}):(0,I.jsx)(`ul`,{className:U.taskList,children:r.tasks.map(e=>(0,I.jsxs)(`li`,{id:Eo(e.id),className:U.taskItem,tabIndex:-1,children:[(0,I.jsxs)(`div`,{className:U.taskHeader,children:[(0,I.jsx)(`span`,{className:U.taskId,children:e.id}),(0,I.jsx)(b,{status:e.status})]}),(0,I.jsx)(`p`,{className:U.taskGoal,children:e.goal}),e.deps.length>0?(0,I.jsxs)(`p`,{className:U.taskDeps,children:[`depends on:`,` `,e.deps.map((e,t)=>(0,I.jsxs)(`span`,{children:[t>0?`, `:``,i.has(e)?(0,I.jsx)(`a`,{href:`#${Eo(e)}`,className:U.depLink,children:e}):(0,I.jsxs)(`span`,{className:U.depMissing,children:[e,` (unresolved)`]})]},e))]}):null,e.error?(0,I.jsx)(`p`,{className:U.taskError,role:`alert`,children:e.error}):null,e.usage?(0,I.jsxs)(`p`,{className:U.taskUsage,children:[e.usage.tokensIn.toLocaleString(),` / `,e.usage.tokensOut.toLocaleString(),` tokens · $`,e.usage.estCostUsd.toFixed(4)]}):null]},e.id))})]}),(0,I.jsxs)(`section`,{className:U.section,children:[(0,I.jsxs)(`h2`,{className:U.sectionTitle,children:[`Step log (`,r.steps.length,`)`]}),r.steps.length===0?(0,I.jsx)(`p`,{className:U.empty,children:`No steps recorded.`}):(0,I.jsx)(`ol`,{className:U.stepList,children:r.steps.map((e,t)=>(0,I.jsxs)(`li`,{className:U.stepItem,children:[(0,I.jsx)(`span`,{className:U.stepTs,children:To(e.ts)}),(0,I.jsx)(`span`,{className:U.stepKind,children:e.kind}),(0,I.jsx)(`span`,{className:U.stepTask,children:e.taskId?(0,I.jsx)(`a`,{href:`#${Eo(e.taskId)}`,className:U.depLink,children:e.taskId}):null}),(0,I.jsx)(`span`,{className:U.stepSummary,children:e.summary})]},`${e.ts}-${t}`))})]})]})}var W={view:`_view_1kj6a_1`,header:`_header_1kj6a_8`,title:`_title_1kj6a_16`,freshness:`_freshness_1kj6a_22`,count:`_count_1kj6a_28`,filters:`_filters_1kj6a_34`,field:`_field_1kj6a_45`,fieldLabel:`_fieldLabel_1kj6a_51`,input:`_input_1kj6a_56`,select:`_select_1kj6a_57`,listWrap:`_listWrap_1kj6a_73`,listHeader:`_listHeader_1kj6a_80`,sortHeader:`_sortHeader_1kj6a_90`,list:`_list_1kj6a_73`,item:`_item_1kj6a_112`,goalLink:`_goalLink_1kj6a_124`,goalText:`_goalText_1kj6a_140`,burndown:`_burndown_1kj6a_150`,burndownTrack:`_burndownTrack_1kj6a_156`,burndownFill:`_burndownFill_1kj6a_164`,burndownLabel:`_burndownLabel_1kj6a_170`,numeric:`_numeric_1kj6a_177`,date:`_date_1kj6a_184`,empty:`_empty_1kj6a_191`,error:`_error_1kj6a_198`};function Oo(e){return e.tasks.filter(e=>e.status===`done`).length}function ko(e){return Math.max(e.plan?.tasks.length??0,e.tasks.length)}function Ao(e){return e.usage??{tokensIn:0,tokensOut:0,estCostUsd:0}}function jo(e){let t=Ao(e);return t.tokensIn+t.tokensOut}function Mo(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function No(){let e=(0,A.useRef)(null);Me(`/work/swarms`,e);let t=w(ce),n=(0,A.useMemo)(()=>t.data??[],[t.data]),[r,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(`all`),[s,c]=(0,A.useState)(`createdAt`),[l,u]=(0,A.useState)(`desc`),d=(0,A.useMemo)(()=>Array.from(new Set(n.map(e=>e.status))).sort(),[n]),p=(0,A.useMemo)(()=>{let e=n.filter(e=>{if(a!==`all`&&e.status!==a)return!1;if(!r.trim())return!0;let t=r.trim().toLowerCase();return e.id.toLowerCase().includes(t)||e.goal.toLowerCase().includes(t)});return e=[...e].sort((e,t)=>{let n=0;switch(s){case`createdAt`:n=e.createdAt.localeCompare(t.createdAt);break;case`updatedAt`:n=e.updatedAt.localeCompare(t.updatedAt);break;case`progress`:n=(ko(e)>0?Oo(e)/ko(e):0)-(ko(t)>0?Oo(t)/ko(t):0);break;case`tokens`:n=jo(e)-jo(t);break;case`estCostUsd`:n=Ao(e).estCostUsd-Ao(t).estCostUsd}return l===`asc`?n:-n}),e},[n,a,r,s,l]);function m(e){e===s?u(e=>e===`asc`?`desc`:`asc`):(c(e),u(`desc`))}function h(e){return e===s?l===`asc`?` ↑`:` ↓`:``}return(0,I.jsxs)(`div`,{ref:e,className:W.view,children:[(0,I.jsxs)(`header`,{className:W.header,children:[(0,I.jsx)(`h1`,{className:W.title,children:`Swarms`}),(0,I.jsxs)(`div`,{className:W.freshness,"aria-live":`polite`,children:[t.status===`refreshing`?(0,I.jsx)(y,{}):null,(0,I.jsxs)(`span`,{className:W.count,children:[p.length,` of `,n.length,` swarms`]})]})]}),(0,I.jsxs)(`form`,{className:W.filters,role:`search`,"aria-label":`Filter swarms`,onSubmit:e=>e.preventDefault(),children:[(0,I.jsxs)(`label`,{className:W.field,children:[(0,I.jsx)(`span`,{className:W.fieldLabel,children:`Search`}),(0,I.jsx)(`input`,{type:`text`,className:W.input,placeholder:`goal or swarm id`,value:r,onChange:e=>i(e.target.value)})]}),(0,I.jsxs)(`label`,{className:W.field,children:[(0,I.jsx)(`span`,{className:W.fieldLabel,children:`Status`}),(0,I.jsxs)(`select`,{className:W.select,value:a,onChange:e=>o(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),d.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]})]}),t.status===`loading`?(0,I.jsxs)(`div`,{className:W.listWrap,children:[(0,I.jsx)(f,{}),(0,I.jsx)(f,{}),(0,I.jsx)(f,{})]}):t.status===`error`?(0,I.jsx)(`div`,{className:W.error,role:`alert`,children:t.error?.message??`Failed to load swarms.`}):p.length===0?(0,I.jsx)(`p`,{className:W.empty,children:`No swarms match the current filters.`}):(0,I.jsxs)(`div`,{className:W.listWrap,children:[(0,I.jsxs)(`div`,{className:W.listHeader,children:[(0,I.jsx)(`span`,{children:`Goal`}),(0,I.jsxs)(`button`,{type:`button`,className:W.sortHeader,onClick:()=>m(`progress`),children:[`Progress`,h(`progress`)]}),(0,I.jsxs)(`button`,{type:`button`,className:W.sortHeader,onClick:()=>m(`tokens`),children:[`Tokens`,h(`tokens`)]}),(0,I.jsxs)(`button`,{type:`button`,className:W.sortHeader,onClick:()=>m(`estCostUsd`),children:[`Cost`,h(`estCostUsd`)]}),(0,I.jsxs)(`button`,{type:`button`,className:W.sortHeader,onClick:()=>m(`createdAt`),children:[`Created`,h(`createdAt`)]})]}),(0,I.jsx)(`ul`,{className:W.list,children:p.map(e=>{let t=Oo(e),n=ko(e),r=n>0?Math.round(t/n*100):0,i=Ao(e);return(0,I.jsxs)(`li`,{className:W.item,children:[(0,I.jsxs)(kr,{to:`/work/swarms/${e.id}`,"data-focus-key":`swarm-${e.id}`,className:W.goalLink,title:e.goal,children:[(0,I.jsx)(`span`,{className:W.goalText,children:e.goal}),(0,I.jsx)(b,{status:e.status})]}),(0,I.jsxs)(`div`,{className:W.burndown,children:[(0,I.jsx)(`div`,{className:W.burndownTrack,children:(0,I.jsx)(`div`,{className:W.burndownFill,style:{width:`${r}%`}})}),(0,I.jsxs)(`span`,{className:W.burndownLabel,children:[t,`/`,n]})]}),(0,I.jsxs)(`span`,{className:W.numeric,children:[i.tokensIn.toLocaleString(),`/`,i.tokensOut.toLocaleString()]}),(0,I.jsxs)(`span`,{className:W.numeric,children:[`$`,i.estCostUsd.toFixed(4)]}),(0,I.jsx)(`span`,{className:W.date,children:Mo(e.createdAt)})]},e.id)})})]})]})}var Po={svg:`_svg_2w2xr_1`,phaseLabel:`_phaseLabel_2w2xr_7`,edge:`_edge_2w2xr_14`,arrowHead:`_arrowHead_2w2xr_19`,nodeLink:`_nodeLink_2w2xr_23`,nodeRect:`_nodeRect_2w2xr_26`,nodeId:`_nodeId_2w2xr_31`,nodeGoal:`_nodeGoal_2w2xr_37`,neutral:`_neutral_2w2xr_45`,statusDot:`_statusDot_2w2xr_49`,info:`_info_2w2xr_53`,running:`_running_2w2xr_61`,success:`_success_2w2xr_69`,warning:`_warning_2w2xr_77`,danger:`_danger_2w2xr_85`,unknown:`_unknown_2w2xr_93`,empty:`_empty_2w2xr_105`},Fo={scaffold:0,build:1,integrate:2,verify:3,review:4};function Io(e,t){let n=new Map;for(let t of e?.tasks??[])n.set(t.id,{id:t.id,phase:t.phase,goal:t.goal,deps:t.deps,status:`pending`});for(let e of t){let t=n.get(e.id);n.set(e.id,{id:e.id,phase:e.phase||t?.phase||`build`,goal:t?.goal??``,deps:t?.deps??[],status:e.status})}return Array.from(n.values())}function Lo(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}var Ro=140,zo=48,Bo=20;function Vo({tasks:e,taskAnchorPrefix:t=`dag-task`}){if(e.length===0)return(0,I.jsx)(`p`,{className:Po.empty,children:`No tasks in this swarm.`});let n=new Map;for(let t of e){let e=t.phase||`build`,r=n.get(e)??[];r.push(t),n.set(e,r)}let r=Array.from(n.keys()).sort((e,t)=>(Fo[e]??99)-(Fo[t]??99)),i=new Map,a=Bo;for(let e of r)i.set(e,a),a+=200;let o=a+Bo,s=new Map;for(let e of r){let t=Bo;for(let r of n.get(e)){let n=i.get(e);s.set(r.id,{x:n,y:t,cx:n+Ro/2,cy:t+zo/2}),t+=68}}let c=Math.max(...Array.from(s.values()).map(e=>e.y+zo))+40,l=[];for(let t of e){let e=s.get(t.id);if(e)for(let n of t.deps){let r=s.get(n);if(!r)continue;let i=r.x+Ro,a=r.cy,o=e.x,c=e.cy,u=(i+o)/2;l.push({key:`${n}->${t.id}`,d:`M ${i} ${a} C ${u} ${a}, ${u} ${c}, ${o} ${c}`})}}return(0,I.jsxs)(`svg`,{width:o,height:c,viewBox:`0 0 ${o} ${c}`,className:Po.svg,role:`img`,"aria-label":`Swarm task dependency graph`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsx)(`marker`,{id:`dag-arrow`,markerWidth:`8`,markerHeight:`8`,refX:`6`,refY:`3`,orient:`auto`,children:(0,I.jsx)(`path`,{d:`M0,0 L0,6 L8,3 z`,className:Po.arrowHead})})}),r.map(e=>(0,I.jsx)(`text`,{x:i.get(e)+Ro/2,y:14,textAnchor:`middle`,className:Po.phaseLabel,children:e},e)),l.map(e=>(0,I.jsx)(`path`,{d:e.d,className:Po.edge,fill:`none`,markerEnd:`url(#dag-arrow)`},e.key)),e.map(e=>{let n=s.get(e.id);if(!n)return null;let r=_(e.status);return(0,I.jsx)(`g`,{transform:`translate(${n.x},${n.y})`,children:(0,I.jsxs)(`a`,{href:`#${t}-${encodeURIComponent(e.id)}`,className:Po.nodeLink,children:[(0,I.jsx)(`title`,{children:`${e.id} — ${e.goal} (${e.status})`}),(0,I.jsx)(`rect`,{width:Ro,height:zo,rx:6,ry:6,className:`${Po.nodeRect} ${Po[r]}`}),(0,I.jsx)(`circle`,{cx:10,cy:zo/2,r:4,className:`${Po.statusDot} ${Po[r]}`}),(0,I.jsx)(`text`,{x:20,y:17,className:Po.nodeId,children:Lo(e.id,18)}),(0,I.jsx)(`text`,{x:20,y:33,className:Po.nodeGoal,children:Lo(e.goal,20)})]})},e.id)})]})}var G={view:`_view_19up6_1`,header:`_header_19up6_8`,eyebrow:`_eyebrow_19up6_16`,title:`_title_19up6_22`,freshness:`_freshness_19up6_29`,burndownRow:`_burndownRow_19up6_35`,burndownTrack:`_burndownTrack_19up6_41`,burndownFill:`_burndownFill_19up6_49`,burndownLabel:`_burndownLabel_19up6_55`,metaGrid:`_metaGrid_19up6_62`,numeric:`_numeric_19up6_80`,mono:`_mono_19up6_84`,section:`_section_19up6_90`,sectionTitle:`_sectionTitle_19up6_96`,resultText:`_resultText_19up6_101`,escalationList:`_escalationList_19up6_110`,escalationItem:`_escalationItem_19up6_115`,escalationJson:`_escalationJson_19up6_120`,dagWrap:`_dagWrap_19up6_130`,taskList:`_taskList_19up6_138`,taskItem:`_taskItem_19up6_144`,taskHeader:`_taskHeader_19up6_157`,taskId:`_taskId_19up6_163`,taskPhase:`_taskPhase_19up6_169`,taskGoal:`_taskGoal_19up6_176`,taskDeps:`_taskDeps_19up6_181`,error:`_error_19up6_188`},Ho=`dag-task`;function Uo(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Wo(){let{id:e}=yn(),t=(0,A.useRef)(null);Me(`/work/swarms/${e??``}`,t);let n=w(Te(e??``));if(!e)return(0,I.jsx)(`div`,{className:G.view,children:(0,I.jsx)(`p`,{className:G.error,role:`alert`,children:`No swarm id in URL.`})});if(n.status===`loading`)return(0,I.jsxs)(`div`,{ref:t,className:G.view,children:[(0,I.jsx)(g,{width:`60%`}),(0,I.jsx)(g,{width:`30%`}),(0,I.jsx)(g,{width:`80%`})]});if(n.status===`error`||!n.data)return(0,I.jsx)(`div`,{ref:t,className:G.view,children:(0,I.jsx)(`p`,{className:G.error,role:`alert`,children:n.error?.message??`Swarm ${e} not found.`})});let r=n.data,i=r.tasks.filter(e=>e.status===`done`).length,a=Math.max(r.plan?.tasks.length??0,r.tasks.length),o=a>0?Math.round(i/a*100):0,s=Io(r.plan,r.tasks),c=r.usage??{tokensIn:0,tokensOut:0,estCostUsd:0};return(0,I.jsxs)(`div`,{ref:t,className:G.view,children:[(0,I.jsxs)(`header`,{className:G.header,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`p`,{className:G.eyebrow,children:[`Swarm `,r.id]}),(0,I.jsx)(`h1`,{className:G.title,children:r.goal})]}),(0,I.jsxs)(`div`,{className:G.freshness,"aria-live":`polite`,children:[n.status===`refreshing`?(0,I.jsx)(y,{}):null,(0,I.jsx)(b,{status:r.status})]})]}),(0,I.jsxs)(`div`,{className:G.burndownRow,children:[(0,I.jsx)(`div`,{className:G.burndownTrack,children:(0,I.jsx)(`div`,{className:G.burndownFill,style:{width:`${o}%`}})}),(0,I.jsxs)(`span`,{className:G.burndownLabel,children:[i,`/`,a,` tasks done (`,o,`%)`]})]}),(0,I.jsxs)(`dl`,{className:G.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Tokens in / out`}),(0,I.jsxs)(`dd`,{className:G.numeric,children:[c.tokensIn.toLocaleString(),` / `,c.tokensOut.toLocaleString()]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Est cost`}),(0,I.jsxs)(`dd`,{className:G.numeric,children:[`$`,c.estCostUsd.toFixed(4)]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Parallelism`}),(0,I.jsx)(`dd`,{className:G.numeric,children:r.parallel})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Created`}),(0,I.jsx)(`dd`,{children:Uo(r.createdAt)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Updated`}),(0,I.jsx)(`dd`,{children:Uo(r.updatedAt)})]}),r.project?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Project`}),(0,I.jsx)(`dd`,{className:G.mono,children:r.project})]}):null]}),r.escalations&&r.escalations.length>0?(0,I.jsxs)(`section`,{className:G.section,children:[(0,I.jsxs)(`h2`,{className:G.sectionTitle,children:[`Escalations (`,r.escalations.length,`)`]}),(0,I.jsx)(`ul`,{className:G.escalationList,children:r.escalations.map((e,t)=>(0,I.jsx)(`li`,{className:G.escalationItem,children:(0,I.jsx)(`pre`,{className:G.escalationJson,children:JSON.stringify(e,null,2)})},t))})]}):null,r.result?(0,I.jsxs)(`section`,{className:G.section,children:[(0,I.jsx)(`h2`,{className:G.sectionTitle,children:`Result`}),(0,I.jsx)(`p`,{className:G.resultText,children:r.result})]}):null,(0,I.jsxs)(`section`,{className:G.section,children:[(0,I.jsx)(`h2`,{className:G.sectionTitle,children:`Task graph`}),(0,I.jsx)(`div`,{className:G.dagWrap,children:(0,I.jsx)(Vo,{tasks:s,taskAnchorPrefix:Ho})})]}),(0,I.jsxs)(`section`,{className:G.section,children:[(0,I.jsxs)(`h2`,{className:G.sectionTitle,children:[`Tasks (`,s.length,`)`]}),(0,I.jsx)(`ul`,{className:G.taskList,children:s.map(e=>(0,I.jsxs)(`li`,{id:`${Ho}-${e.id}`,"data-focus-key":`swarm-task-${e.id}`,className:G.taskItem,tabIndex:-1,children:[(0,I.jsxs)(`div`,{className:G.taskHeader,children:[(0,I.jsx)(`span`,{className:G.taskId,children:e.id}),(0,I.jsx)(`span`,{className:G.taskPhase,children:e.phase}),(0,I.jsx)(b,{status:e.status})]}),(0,I.jsx)(`p`,{className:G.taskGoal,children:e.goal}),e.deps.length>0?(0,I.jsxs)(`p`,{className:G.taskDeps,children:[`depends on: `,e.deps.join(`, `)]}):null]},e.id))})]})]})}var K={view:`_view_1bwoy_1`,header:`_header_1bwoy_8`,title:`_title_1bwoy_16`,freshness:`_freshness_1bwoy_22`,callout:`_callout_1bwoy_28`,calloutTitle:`_calloutTitle_1bwoy_39`,calloutBody:`_calloutBody_1bwoy_44`,calloutCommand:`_calloutCommand_1bwoy_48`,metaGrid:`_metaGrid_1bwoy_59`,section:`_section_1bwoy_77`,sectionTitle:`_sectionTitle_1bwoy_83`,serviceError:`_serviceError_1bwoy_88`,tickTableWrap:`_tickTableWrap_1bwoy_96`,tickTable:`_tickTable_1bwoy_96`,date:`_date_1bwoy_124`,numeric:`_numeric_1bwoy_130`,dryRun:`_dryRun_1bwoy_135`,empty:`_empty_1bwoy_140`,error:`_error_1bwoy_145`},Go={missing:`No daemon state file has been written yet — the daemon may never have run on this machine.`,malformed:`The daemon state file exists but failed to parse.`,unreadable:`The daemon state file could not be read. This is also the exact signal produced when a state-recovery marker is present (a prior repair left a quarantine in progress) — the API does not distinguish the two cases, so treat this as "inspect before trusting displayed daemon state."`,inconsistent:`The daemon state file and the live lock/activity check disagree — the daemon may be mid-restart.`,unavailable:`The daemon state read path itself failed (I/O error or similar).`};function Ko(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function qo({quality:e}){let t=e.reason,n=Go[t]??`Daemon state could not be verified.`;return(0,I.jsxs)(`section`,{className:K.callout,role:`alert`,children:[(0,I.jsxs)(`p`,{className:K.calloutTitle,children:[`Daemon state is unknown (`,t,`)`]}),(0,I.jsx)(`p`,{className:K.calloutBody,children:n}),(0,I.jsx)(`p`,{className:K.calloutBody,children:`Real remedy — preview or execute a state recovery from a terminal on this machine:`}),(0,I.jsx)(`pre`,{className:K.calloutCommand,children:`ashlr daemon recover-state --dry-run --expected-sha256 <sha256> [--json]
5
5
  ashlr daemon recover-state --execute --plan-id <uuid> --plan-sha256 <sha256> --authorize <plan-sha256> [--json]`}),(0,I.jsx)(`p`,{className:K.calloutBody,children:`If a quarantine already exists and needs resolving instead:`}),(0,I.jsx)(`pre`,{className:K.calloutCommand,children:`ashlr daemon resolve-state --dry-run --quarantine-plan-id <uuid> --quarantine-receipt-sha256 <sha256> [--json]
6
6
  ashlr daemon resolve-state --execute --plan-id <uuid> --plan-sha256 <sha256> --authorize <plan-sha256> --confirm <plan-sha256> [--json]`})]})}function Jo(){let e=(0,A.useRef)(null);Me(`/control/daemon`,e);let t=w(be),n=w(me),r=t.data?.daemon,i=n.data;return(0,I.jsxs)(`div`,{ref:e,className:K.view,children:[(0,I.jsxs)(`header`,{className:K.header,children:[(0,I.jsx)(`h1`,{className:K.title,children:`Daemon`}),(0,I.jsxs)(`div`,{className:K.freshness,"aria-live":`polite`,children:[t.status===`refreshing`||n.status===`refreshing`?(0,I.jsx)(y,{}):null,r?(0,I.jsx)(E,{quality:r.sourceQuality,label:`daemon state`,children:(0,I.jsx)(b,{status:r.running?`running`:`pending`,children:r.running?`running`:`stopped`})}):null]})]}),t.status===`loading`?(0,I.jsx)(g,{width:`60%`}):t.status===`error`||!r?(0,I.jsx)(`p`,{className:K.error,role:`alert`,children:t.error?.message??`Failed to load control snapshot.`}):(0,I.jsxs)(I.Fragment,{children:[D(r.sourceQuality)?null:(0,I.jsx)(qo,{quality:r.sourceQuality}),(0,I.jsxs)(`dl`,{className:K.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Runtime state`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:r.sourceQuality,label:`runtime state`,children:r.runtimeState})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`PID`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:r.sourceQuality,label:`pid`,children:r.pid??`—`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Last tick`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:r.sourceQuality,label:`last tick`,children:Ko(r.lastTickAt)})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Today's spend`}),(0,I.jsx)(`dd`,{children:(0,I.jsxs)(E,{quality:r.sourceQuality,label:`spend`,children:[`$`,r.todaySpentUsd.toFixed(2)]})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Direction mode`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:r.sourceQuality,label:`direction mode`,children:r.activeDirectionMode??`none`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Direction reason`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:r.sourceQuality,label:`direction reason`,children:r.activeDirectionReason??`—`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Autonomy control loop`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:r.sourceQuality,label:`autonomy control loop`,children:r.autonomyControlLoop?`enabled`:`disabled`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Autonomy control mode`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:r.sourceQuality,label:`autonomy control mode`,children:r.autonomyControlMode})})]})]}),(0,I.jsxs)(`section`,{className:K.section,children:[(0,I.jsx)(`h2`,{className:K.sectionTitle,children:`OS service`}),(0,I.jsxs)(`dl`,{className:K.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Registration state`}),(0,I.jsx)(`dd`,{children:r.service.registrationState})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Installed`}),(0,I.jsx)(`dd`,{children:r.service.installed?`yes`:`no`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Running`}),(0,I.jsx)(`dd`,{children:r.service.running?`yes`:`no`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Runtime state`}),(0,I.jsx)(`dd`,{children:r.service.runtimeState??`unknown`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Platform`}),(0,I.jsx)(`dd`,{children:r.service.platformSpec})]})]}),r.service.errorLog?(0,I.jsx)(`p`,{className:K.serviceError,role:`alert`,children:r.service.errorLog}):null]})]}),(0,I.jsxs)(`section`,{className:K.section,children:[(0,I.jsx)(`h2`,{className:K.sectionTitle,children:`Recent ticks`}),n.status===`loading`?(0,I.jsx)(g,{width:`80%`}):!i||!i.ticks||i.ticks.length===0?(0,I.jsx)(`p`,{className:K.empty,children:`No tick history available.`}):(0,I.jsx)(`div`,{className:K.tickTableWrap,children:(0,I.jsxs)(`table`,{className:K.tickTable,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:`Time`}),(0,I.jsx)(`th`,{scope:`col`,children:`Reason`}),(0,I.jsx)(`th`,{scope:`col`,children:`Items`}),(0,I.jsx)(`th`,{scope:`col`,children:`Proposals`}),(0,I.jsx)(`th`,{scope:`col`,children:`Spend`})]})}),(0,I.jsx)(`tbody`,{children:[...i.ticks].reverse().slice(0,20).map((e,t)=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{className:K.date,children:Ko(e.ts)}),(0,I.jsxs)(`td`,{children:[e.reason,e.dryRun?(0,I.jsx)(`span`,{className:K.dryRun,children:` (dry-run)`}):null]}),(0,I.jsx)(`td`,{className:K.numeric,children:e.itemsConsidered}),(0,I.jsx)(`td`,{className:K.numeric,children:e.proposalsCreated}),(0,I.jsxs)(`td`,{className:K.numeric,children:[`$`,e.spentUsd.toFixed(4)]})]},`${e.ts}-${t}`))})]})})]})]})}var q={view:`_view_ssrhq_1`,header:`_header_ssrhq_8`,title:`_title_ssrhq_14`,freshness:`_freshness_ssrhq_20`,section:`_section_ssrhq_26`,sectionTitle:`_sectionTitle_ssrhq_32`,killSwitchRow:`_killSwitchRow_ssrhq_37`,pauseButton:`_pauseButton_ssrhq_47`,resumeButton:`_resumeButton_ssrhq_65`,mutationError:`_mutationError_ssrhq_83`,metaGrid:`_metaGrid_ssrhq_91`,numeric:`_numeric_ssrhq_109`,lockWarning:`_lockWarning_ssrhq_113`,tableWrap:`_tableWrap_ssrhq_117`,table:`_table_ssrhq_117`,mono:`_mono_ssrhq_144`,empty:`_empty_ssrhq_149`,error:`_error_ssrhq_154`,confirmBody:`_confirmBody_ssrhq_162`,confirmActions:`_confirmActions_ssrhq_168`,cancelButton:`_cancelButton_ssrhq_174`,confirmButton:`_confirmButton_ssrhq_186`};function Yo(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Xo(){let e=(0,A.useRef)(null);Me(`/control/fleet`,e);let t=w(xe),n=w(ve),r=d(),[i,a]=(0,A.useState)(null),[o,s]=(0,A.useState)(!1),[c,l]=(0,A.useState)(!1),[u,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(null);async function h(e){f(!0),m(null);try{e===`pause`?await ke():await Ee()}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1),a(null)}}function _(e){m(null),a(e),s(!0)}function v(){s(!1),r.hasHold?i&&h(i):l(!0)}(0,A.useEffect)(()=>{c||i&&(r.hasHold?h(i):a(null))},[c]);let x=t.data,S=x?.killSwitch,C=S?{sourceState:S.sourceState,complete:S.sourceState===`healthy`,reason:S.reason}:void 0,T=x?.killed===!0;return(0,I.jsxs)(`div`,{ref:e,className:q.view,children:[(0,I.jsxs)(`header`,{className:q.header,children:[(0,I.jsx)(`h1`,{className:q.title,children:`Fleet`}),(0,I.jsx)(`div`,{className:q.freshness,"aria-live":`polite`,children:t.status===`refreshing`||n.status===`refreshing`?(0,I.jsx)(y,{}):null})]}),t.status===`loading`?(0,I.jsx)(g,{width:`60%`}):t.status===`error`||!x?(0,I.jsx)(`p`,{className:q.error,role:`alert`,children:t.error?.message??`Failed to load fleet status.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`section`,{className:q.section,children:[(0,I.jsx)(`h2`,{className:q.sectionTitle,children:`Kill switch`}),(0,I.jsx)(`div`,{className:q.killSwitchRow,children:(0,I.jsx)(E,{quality:C,label:`kill switch`,renderControl:()=>(0,I.jsx)(`button`,{type:`button`,className:T?q.resumeButton:q.pauseButton,onClick:()=>_(T?`resume`:`pause`),disabled:u,children:u?`Working…`:T?`Resume fleet`:`Pause fleet`}),children:(0,I.jsx)(b,{status:T?`paused`:`running`,children:T?`engaged — fleet paused`:`clear — fleet active`})})}),p?(0,I.jsx)(`p`,{className:q.mutationError,role:`alert`,children:p}):null]}),(0,I.jsxs)(`section`,{className:q.section,children:[(0,I.jsx)(`h2`,{className:q.sectionTitle,children:`Queue depth`}),(0,I.jsxs)(`dl`,{className:q.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Backlog items`}),(0,I.jsx)(`dd`,{className:q.numeric,children:x.queue.backlogItems})]}),x.queue.eligibleBacklogItems===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Eligible`}),(0,I.jsx)(`dd`,{className:q.numeric,children:x.queue.eligibleBacklogItems})]}),x.queue.cooldownItems===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Cooldown`}),(0,I.jsx)(`dd`,{className:q.numeric,children:x.queue.cooldownItems})]}),x.queue.pendingItems===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Pending`}),(0,I.jsx)(`dd`,{className:q.numeric,children:x.queue.pendingItems})]}),x.queue.nextEligibleAt===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Next eligible`}),(0,I.jsx)(`dd`,{children:Yo(x.queue.nextEligibleAt)})]})]})]}),(0,I.jsxs)(`section`,{className:q.section,children:[(0,I.jsx)(`h2`,{className:q.sectionTitle,children:`Lease health`}),x.queue.shared?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`dl`,{className:q.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Active claims`}),(0,I.jsx)(`dd`,{className:q.numeric,children:x.queue.shared.activeClaims})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Owned by this machine`}),(0,I.jsx)(`dd`,{className:q.numeric,children:x.queue.shared.ownedClaims})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Reclaimable (expired)`}),(0,I.jsx)(`dd`,{className:q.numeric,children:x.queue.shared.reclaimableClaims})]}),x.queue.shared.executingClaims===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Executing`}),(0,I.jsx)(`dd`,{className:q.numeric,children:x.queue.shared.executingClaims})]}),x.queue.shared.ambiguousClaims===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Ambiguous (needs reconciliation)`}),(0,I.jsx)(`dd`,{className:q.numeric,children:x.queue.shared.ambiguousClaims})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Next lease expiry`}),(0,I.jsx)(`dd`,{children:Yo(x.queue.shared.nextLeaseExpiryAt)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Advisory lock`}),(0,I.jsxs)(`dd`,{children:[x.queue.shared.lock.present?x.queue.shared.lock.stale?`present, stale`:`present, healthy`:`absent`,x.queue.shared.lock.recoveryRequired?(0,I.jsx)(`span`,{className:q.lockWarning,children:` — recovery required`}):null]})]})]}),x.queue.shared.claimsByMachine.length>0?(0,I.jsx)(`div`,{className:q.tableWrap,children:(0,I.jsxs)(`table`,{className:q.table,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:`Machine`}),(0,I.jsx)(`th`,{scope:`col`,children:`Active`}),(0,I.jsx)(`th`,{scope:`col`,children:`Expired`}),(0,I.jsx)(`th`,{scope:`col`,children:`Executing`})]})}),(0,I.jsx)(`tbody`,{children:x.queue.shared.claimsByMachine.map(e=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{className:q.mono,children:e.machineId}),(0,I.jsx)(`td`,{className:q.numeric,children:e.active}),(0,I.jsx)(`td`,{className:q.numeric,children:e.expired}),(0,I.jsx)(`td`,{className:q.numeric,children:e.executing??`—`})]},e.machineId))})]})}):null]}):(0,I.jsx)(`p`,{className:q.empty,children:`Shared fleet queue is not in use on this deployment.`})]})]}),(0,I.jsxs)(`section`,{className:q.section,children:[(0,I.jsx)(`h2`,{className:q.sectionTitle,children:`Recent activity`}),n.status===`loading`?(0,I.jsx)(g,{width:`70%`}):n.status===`error`||!n.data?(0,I.jsx)(`p`,{className:q.error,role:`alert`,children:n.error?.message??`Failed to load fleet activity.`}):(0,I.jsxs)(`dl`,{className:q.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Cooldown items`}),(0,I.jsx)(`dd`,{className:q.numeric,children:n.data.cooldownCount})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Engines ready`}),(0,I.jsxs)(`dd`,{className:q.numeric,children:[n.data.engineReadiness.filter(e=>e.installed&&e.authed===!0).length,` /`,` `,n.data.engineReadiness.length]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Recent auto-merges`}),(0,I.jsx)(`dd`,{className:q.numeric,children:x?.merges.recent??`—`})]})]})]}),(0,I.jsxs)(te,{open:o,onClose:()=>{s(!1),a(null)},titleId:`fleet-kill-switch-confirm`,title:i===`resume`?`Resume the fleet?`:`Pause the fleet?`,children:[(0,I.jsx)(`p`,{className:q.confirmBody,children:i===`resume`?`This clears the global kill switch. Autonomous dispatch will resume across the fleet.`:`This engages the global kill switch. Autonomous dispatch halts fleet-wide until explicitly resumed.`}),(0,I.jsxs)(`div`,{className:q.confirmActions,children:[(0,I.jsx)(`button`,{type:`button`,className:q.cancelButton,onClick:()=>{s(!1),a(null)},children:`Cancel`}),(0,I.jsx)(`button`,{type:`button`,className:q.confirmButton,onClick:v,children:i===`resume`?`Yes, resume`:`Yes, pause`})]})]}),(0,I.jsx)(je,{open:c,onClose:()=>l(!1),reason:i===`resume`?`Resuming the fleet requires the dispatch token.`:`Pausing the fleet requires the dispatch token.`})]})}var J={view:`_view_1fet3_1`,header:`_header_1fet3_8`,title:`_title_1fet3_14`,freshness:`_freshness_1fet3_20`,unavailable:`_unavailable_1fet3_26`,counts:`_counts_1fet3_35`,countTile:`_countTile_1fet3_41`,countValue:`_countValue_1fet3_51`,countLabel:`_countLabel_1fet3_57`,critical:`_critical_1fet3_64`,high:`_high_1fet3_65`,medium:`_medium_1fet3_68`,low:`_low_1fet3_71`,filters:`_filters_1fet3_75`,field:`_field_1fet3_86`,fieldLabel:`_fieldLabel_1fet3_92`,input:`_input_1fet3_97`,select:`_select_1fet3_98`,tableWrap:`_tableWrap_1fet3_114`,table:`_table_1fet3_114`,mono:`_mono_1fet3_141`,empty:`_empty_1fet3_146`,error:`_error_1fet3_153`},Zo={critical:`danger`,high:`danger`,medium:`warning`,low:`neutral`},Qo={critical:0,high:1,medium:2,low:3};function $o(){let e=(0,A.useRef)(null);Me(`/control/security`,e);let t=w(be),n=t.data?.security,[r,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(`all`),[s,c]=(0,A.useState)(`all`),l=(0,A.useMemo)(()=>Array.from(new Set((n?.findings??[]).map(e=>e.repo))).sort(),[n]),u=(0,A.useMemo)(()=>(n?.findings??[]).filter(e=>a===`all`||e.severity===a).filter(e=>s===`all`||e.repo===s).filter(e=>{if(!r.trim())return!0;let t=r.trim().toLowerCase();return e.title.toLowerCase().includes(t)||e.repo.toLowerCase().includes(t)}).sort((e,t)=>(Qo[e.severity]??9)-(Qo[t.severity]??9)),[n,a,s,r]);return(0,I.jsxs)(`div`,{ref:e,className:J.view,children:[(0,I.jsxs)(`header`,{className:J.header,children:[(0,I.jsx)(`h1`,{className:J.title,children:`Security`}),(0,I.jsx)(`div`,{className:J.freshness,"aria-live":`polite`,children:t.status===`refreshing`?(0,I.jsx)(y,{}):null})]}),t.status===`loading`?(0,I.jsx)(g,{width:`60%`}):t.status===`error`||!n?(0,I.jsx)(`p`,{className:J.error,role:`alert`,children:t.error?.message??`Failed to load control snapshot.`}):n.available?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:J.counts,children:[(0,I.jsxs)(`div`,{className:`${J.countTile} ${J.critical}`,children:[(0,I.jsx)(`span`,{className:J.countValue,children:n.counts.critical}),(0,I.jsx)(`span`,{className:J.countLabel,children:`Critical`})]}),(0,I.jsxs)(`div`,{className:`${J.countTile} ${J.high}`,children:[(0,I.jsx)(`span`,{className:J.countValue,children:n.counts.high}),(0,I.jsx)(`span`,{className:J.countLabel,children:`High`})]}),(0,I.jsxs)(`div`,{className:`${J.countTile} ${J.medium}`,children:[(0,I.jsx)(`span`,{className:J.countValue,children:n.counts.medium}),(0,I.jsx)(`span`,{className:J.countLabel,children:`Medium`})]}),(0,I.jsxs)(`div`,{className:`${J.countTile} ${J.low}`,children:[(0,I.jsx)(`span`,{className:J.countValue,children:n.counts.low}),(0,I.jsx)(`span`,{className:J.countLabel,children:`Low`})]})]}),(0,I.jsxs)(`form`,{className:J.filters,role:`search`,"aria-label":`Filter findings`,onSubmit:e=>e.preventDefault(),children:[(0,I.jsxs)(`label`,{className:J.field,children:[(0,I.jsx)(`span`,{className:J.fieldLabel,children:`Search`}),(0,I.jsx)(`input`,{type:`text`,className:J.input,placeholder:`title or repo`,value:r,onChange:e=>i(e.target.value)})]}),(0,I.jsxs)(`label`,{className:J.field,children:[(0,I.jsx)(`span`,{className:J.fieldLabel,children:`Severity`}),(0,I.jsxs)(`select`,{className:J.select,value:a,onChange:e=>o(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),(0,I.jsx)(`option`,{value:`critical`,children:`Critical`}),(0,I.jsx)(`option`,{value:`high`,children:`High`}),(0,I.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,I.jsx)(`option`,{value:`low`,children:`Low`})]})]}),(0,I.jsxs)(`label`,{className:J.field,children:[(0,I.jsx)(`span`,{className:J.fieldLabel,children:`Repo`}),(0,I.jsxs)(`select`,{className:J.select,value:s,onChange:e=>c(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),l.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]})]}),u.length===0?(0,I.jsx)(`p`,{className:J.empty,children:`No findings match the current filters.`}):(0,I.jsx)(`div`,{className:J.tableWrap,children:(0,I.jsxs)(`table`,{className:J.table,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:`Severity`}),(0,I.jsx)(`th`,{scope:`col`,children:`Repo`}),(0,I.jsx)(`th`,{scope:`col`,children:`Finding`})]})}),(0,I.jsx)(`tbody`,{children:u.map((e,t)=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(b,{status:e.severity,tone:Zo[e.severity]??`neutral`})}),(0,I.jsx)(`td`,{className:J.mono,children:e.repo}),(0,I.jsx)(`td`,{children:e.title})]},`${e.repo}-${e.title}-${t}`))})]})})]}):(0,I.jsx)(`p`,{className:J.unavailable,children:`No cached security data available — the backlog is absent, empty, or has no security-source findings. This is not the same as "clean": it means binshield hasn't produced cached findings for this fleet yet.`})]})}var Y={view:`_view_1yeql_1`,header:`_header_1yeql_8`,title:`_title_1yeql_14`,freshness:`_freshness_1yeql_20`,count:`_count_1yeql_26`,missionCard:`_missionCard_1yeql_31`,sectionTitle:`_sectionTitle_1yeql_41`,missionState:`_missionState_1yeql_49`,sourceGrid:`_sourceGrid_1yeql_54`,list:`_list_1yeql_68`,goalCard:`_goalCard_1yeql_74`,goalHeader:`_goalHeader_1yeql_88`,goalObjective:`_goalObjective_1yeql_95`,progressRow:`_progressRow_1yeql_100`,progressTrack:`_progressTrack_1yeql_106`,progressFill:`_progressFill_1yeql_114`,progressLabel:`_progressLabel_1yeql_120`,nextActionable:`_nextActionable_1yeql_127`,mono:`_mono_1yeql_132`,milestoneList:`_milestoneList_1yeql_136`,milestoneItem:`_milestoneItem_1yeql_142`,milestoneTitle:`_milestoneTitle_1yeql_149`,noMilestones:`_noMilestones_1yeql_153`,empty:`_empty_1yeql_158`,error:`_error_1yeql_165`};function es(){let e=(0,A.useRef)(null);Me(`/goals`,e);let t=w(he),n=w(O),r=t.data??[],i=n.data;return(0,I.jsxs)(`div`,{ref:e,className:Y.view,children:[(0,I.jsxs)(`header`,{className:Y.header,children:[(0,I.jsx)(`h1`,{className:Y.title,children:`Goals`}),(0,I.jsxs)(`div`,{className:Y.freshness,"aria-live":`polite`,children:[t.status===`refreshing`||n.status===`refreshing`?(0,I.jsx)(y,{}):null,(0,I.jsxs)(`span`,{className:Y.count,children:[r.length,` goals`]})]})]}),n.status===`loading`?(0,I.jsx)(g,{width:`50%`}):n.status===`success`&&i?(0,I.jsxs)(`section`,{className:Y.missionCard,children:[(0,I.jsx)(`h2`,{className:Y.sectionTitle,children:`Mission state`}),(0,I.jsx)(`p`,{className:Y.missionState,children:i.state}),(0,I.jsxs)(`dl`,{className:Y.sourceGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Briefing`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:i.sources.briefing??void 0,label:`briefing source`,children:`available`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Goals source`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:i.sources.goals??void 0,label:`goals source`,children:`available`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Enrollment`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:i.sources.enrollment??void 0,label:`enrollment source`,children:`available`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Proposals`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(E,{quality:i.sources.proposals??void 0,label:`proposals source`,children:`available`})})]})]})]}):null,t.status===`loading`?(0,I.jsxs)(`div`,{className:Y.list,children:[(0,I.jsx)(g,{width:`90%`}),(0,I.jsx)(g,{width:`70%`})]}):t.status===`error`?(0,I.jsx)(`p`,{className:Y.error,role:`alert`,children:t.error?.message??`Failed to load goals.`}):r.length===0?(0,I.jsx)(`p`,{className:Y.empty,children:`No active goals.`}):(0,I.jsx)(`ul`,{className:Y.list,children:r.map(e=>{let t=Math.round((e.progress.fractionDone??0)*100);return(0,I.jsxs)(`li`,{className:Y.goalCard,"data-focus-key":`goal-${e.id}`,tabIndex:0,children:[(0,I.jsxs)(`div`,{className:Y.goalHeader,children:[(0,I.jsx)(`h3`,{className:Y.goalObjective,children:e.objective}),(0,I.jsx)(b,{status:e.status})]}),(0,I.jsxs)(`div`,{className:Y.progressRow,children:[(0,I.jsx)(`div`,{className:Y.progressTrack,children:(0,I.jsx)(`div`,{className:Y.progressFill,style:{width:`${t}%`}})}),(0,I.jsxs)(`span`,{className:Y.progressLabel,children:[t,`%`]})]}),e.progress.nextActionableId?(0,I.jsxs)(`p`,{className:Y.nextActionable,children:[`Next actionable milestone id: `,(0,I.jsx)(`span`,{className:Y.mono,children:e.progress.nextActionableId})]}):null,e.milestones.length>0?(0,I.jsx)(`ol`,{className:Y.milestoneList,children:[...e.milestones].sort((e,t)=>e.order-t.order).map(e=>(0,I.jsxs)(`li`,{className:Y.milestoneItem,children:[(0,I.jsx)(b,{status:e.status}),(0,I.jsx)(`span`,{className:Y.milestoneTitle,children:e.title})]},e.title))}):(0,I.jsx)(`p`,{className:Y.noMilestones,children:`No milestones yet.`})]},e.id)})})]})}var X={list:`_list_1nh33_1`,filters:`_filters_1nh33_8`,filterField:`_filterField_1nh33_14`,filterLabel:`_filterLabel_1nh33_21`,summary:`_summary_1nh33_36`,batchBar:`_batchBar_1nh33_44`,batchApprove:`_batchApprove_1nh33_61`,batchReject:`_batchReject_1nh33_66`,skeletons:`_skeletons_1nh33_71`,error:`_error_1nh33_77`,empty:`_empty_1nh33_85`,table:`_table_1nh33_94`,checkboxCol:`_checkboxCol_1nh33_121`,repoCol:`_repoCol_1nh33_125`,kindCol:`_kindCol_1nh33_129`,ageCol:`_ageCol_1nh33_133`,statusCol:`_statusCol_1nh33_137`,whyCol:`_whyCol_1nh33_141`,row:`_row_1nh33_145`,rowActive:`_rowActive_1nh33_155`,titleLink:`_titleLink_1nh33_159`,repoCell:`_repoCell_1nh33_172`,age:`_age_1nh33_133`,why:`_why_1nh33_141`},ts=[{value:`pending`,label:`Pending`},{value:`rejected`,label:`Rejected`},{value:`approved`,label:`Approved`},{value:`applied`,label:`Applied`},{value:`failed`,label:`Failed`},{value:`awaiting-host-merge`,label:`Awaiting host merge`},{value:`all`,label:`All statuses`}];function ns(e){let t=Date.parse(e);if(Number.isNaN(t))return`—`;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`${n}s`;let r=Math.round(n/60);if(r<60)return`${r}m`;let i=Math.round(r/60);return i<24?`${i}h`:`${Math.round(i/24)}d`}function rs({selectedId:e,onDispatchDisabled:t}){let[n,r]=(0,A.useState)(`pending`),[i,a]=(0,A.useState)(``),[o,s]=(0,A.useState)(``),[l,u]=(0,A.useState)(``),[d,m]=(0,A.useState)(new Set),[h,g]=(0,A.useState)(0),[_,v]=(0,A.useState)(null),[x,S]=(0,A.useState)(!1),[C,T]=(0,A.useState)(!1),[ee,te]=(0,A.useState)(!1),[ne,E]=(0,A.useState)(null),re=(0,A.useRef)(null),D=(0,A.useRef)(new Map),ie=hn(),ae=w(Ce({status:n,since:i||void 0,limit:500})),O=(0,A.useMemo)(()=>{let e=ae.data?.proposals??[],t=o.trim().toLowerCase(),n=l.trim().toLowerCase();return e.filter(e=>!(t&&!e.title.toLowerCase().includes(t)&&!(e.summary??``).toLowerCase().includes(t)||n&&!(e.repo??``).toLowerCase().includes(n)))},[ae.data,o,l]);(0,A.useEffect)(()=>{g(e=>Math.min(e,Math.max(O.length-1,0)))},[O.length]);function oe(e,t){t===`pending`&&m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function se(e){if(O.length!==0){if(e.key===`ArrowDown`){e.preventDefault();let t=Math.min(h+1,O.length-1);g(t),D.current.get(O[t].id)?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let t=Math.max(h-1,0);g(t),D.current.get(O[t].id)?.focus()}else if(e.key===`Enter`){let e=O[h];e&&ie(`/inbox/${encodeURIComponent(e.id)}`)}else if(e.key===` `){let t=O[h];t&&(e.preventDefault(),oe(t.id,t.status))}else e.key===`/`&&(e.preventDefault(),re.current?.focus())}}function ce(e){d.size!==0&&(E(null),v(e),c()?T(!0):S(!0))}function le(){S(!1),c()?T(!0):v(null)}async function ue(){if(!_)return;te(!0),E(null);let e=Array.from(d),n=[];for(let r of e)try{_===`approve`?await Oe(r):await De(r)}catch(e){if(e instanceof p){te(!1),T(!1),v(null),t();return}n.push(r)}te(!1),n.length>0?(E(`${n.length} of ${e.length} failed (already decided, or a transient error). Selection kept for retry.`),m(new Set(n))):(T(!1),v(null),m(new Set))}let de=d.size;return(0,I.jsxs)(`div`,{className:X.list,children:[(0,I.jsxs)(`div`,{className:X.filters,children:[(0,I.jsxs)(`label`,{className:X.filterField,children:[(0,I.jsx)(`span`,{className:X.filterLabel,children:`Status`}),(0,I.jsx)(`select`,{value:n,onChange:e=>r(e.target.value),children:ts.map(e=>(0,I.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,I.jsxs)(`label`,{className:X.filterField,children:[(0,I.jsx)(`span`,{className:X.filterLabel,children:`Since`}),(0,I.jsx)(`input`,{type:`date`,value:i,onChange:e=>a(e.target.value)})]}),(0,I.jsxs)(`label`,{className:X.filterField,children:[(0,I.jsx)(`span`,{className:X.filterLabel,children:`Repo`}),(0,I.jsx)(`input`,{type:`text`,placeholder:`filter by repo`,value:l,onChange:e=>u(e.target.value)})]}),(0,I.jsxs)(`label`,{className:X.filterField,children:[(0,I.jsx)(`span`,{className:X.filterLabel,children:`Search`}),(0,I.jsx)(`input`,{ref:re,type:`search`,placeholder:`title or summary — press / to focus`,value:o,onChange:e=>s(e.target.value)})]})]}),(0,I.jsxs)(`div`,{className:X.summary,"aria-live":`polite`,children:[ae.status===`refreshing`?(0,I.jsx)(y,{}):null,ae.data?(0,I.jsxs)(`span`,{children:[O.length,` shown of `,ae.data.total,` total`,ae.data.truncated?` · narrow filters to see more`:``]}):null]}),de>0?(0,I.jsxs)(`div`,{className:X.batchBar,children:[(0,I.jsxs)(`span`,{children:[de,` selected`]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>m(new Set),children:`Clear`}),(0,I.jsxs)(`button`,{type:`button`,className:X.batchReject,onClick:()=>ce(`reject`),children:[`Reject `,de]}),(0,I.jsxs)(`button`,{type:`button`,className:X.batchApprove,onClick:()=>ce(`approve`),children:[`Approve `,de]})]}):null,ae.status===`loading`?(0,I.jsxs)(`div`,{className:X.skeletons,children:[(0,I.jsx)(f,{}),(0,I.jsx)(f,{}),(0,I.jsx)(f,{}),(0,I.jsx)(f,{})]}):ae.status===`error`?(0,I.jsx)(`div`,{className:X.error,role:`alert`,children:ae.error?.message??`Failed to load proposals.`}):O.length===0?(0,I.jsxs)(`p`,{className:X.empty,children:[`No `,n===`all`?``:n+` `,`proposals match`,o||l?` this filter`:``,`.`]}):(0,I.jsxs)(`table`,{className:X.table,role:`grid`,"aria-label":`Proposals`,onKeyDown:se,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,className:X.checkboxCol}),(0,I.jsx)(`th`,{scope:`col`,children:`Title`}),(0,I.jsx)(`th`,{scope:`col`,className:X.repoCol,children:`Repo`}),(0,I.jsx)(`th`,{scope:`col`,className:X.kindCol,children:`Kind`}),(0,I.jsx)(`th`,{scope:`col`,className:X.ageCol,children:`Age`}),(0,I.jsx)(`th`,{scope:`col`,className:X.statusCol,children:`Status`}),(0,I.jsx)(`th`,{scope:`col`,className:X.whyCol,children:`Why`})]})}),(0,I.jsx)(`tbody`,{children:O.map((t,n)=>(0,I.jsxs)(`tr`,{ref:e=>{e?D.current.set(t.id,e):D.current.delete(t.id)},"data-focus-key":`proposal-${t.id}`,tabIndex:n===h?0:-1,className:`${X.row} ${t.id===e?X.rowActive:``}`,onFocus:()=>g(n),"aria-selected":t.id===e,children:[(0,I.jsx)(`td`,{className:X.checkboxCol,children:(0,I.jsx)(`input`,{type:`checkbox`,checked:d.has(t.id),disabled:t.status!==`pending`,title:t.status===`pending`?void 0:`Only pending proposals can be approved/rejected`,onChange:()=>oe(t.id,t.status),onClick:e=>e.stopPropagation()})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(kr,{to:`/inbox/${encodeURIComponent(t.id)}`,className:X.titleLink,title:t.title,children:t.title})}),(0,I.jsx)(`td`,{className:X.repoCell,title:t.repo??void 0,children:t.repo?t.repo.split(`/`).pop():`—`}),(0,I.jsx)(`td`,{children:t.kind}),(0,I.jsx)(`td`,{className:X.age,children:ns(t.createdAt)}),(0,I.jsx)(`td`,{children:(0,I.jsx)(b,{status:t.status})}),(0,I.jsx)(`td`,{className:X.why,title:t.decisionReason??void 0,children:t.decisionReason??`—`})]},t.id))})]}),(0,I.jsx)(je,{open:x,onClose:le,reason:`${_===`approve`?`Approving`:`Rejecting`} ${de} proposals requires the dispatch token.`}),(0,I.jsx)(Ae,{open:C,onClose:()=>{T(!1),v(null),E(null)},title:_===`approve`?`Approve ${de} proposals?`:`Reject ${de} proposals?`,body:_===`approve`?(0,I.jsxs)(I.Fragment,{children:[`This applies all `,de,` selected proposals to their repos now, one at a time. This cannot be undone from this dialog.`]}):(0,I.jsxs)(I.Fragment,{children:[`This rejects all `,de,` selected proposals. They stay visible in history as rejected.`]}),confirmLabel:_===`approve`?`Approve ${de}`:`Reject ${de}`,destructive:_===`reject`,busy:ee,error:ne,onConfirm:()=>void ue()})]})}var Z={panel:`_panel_1n6q8_1`,error:`_error_1n6q8_8`,header:`_header_1n6q8_16`,titleRow:`_titleRow_1n6q8_22`,title:`_title_1n6q8_22`,metaRow:`_metaRow_1n6q8_35`,metaItem:`_metaItem_1n6q8_44`,riskBadge:`_riskBadge_1n6q8_48`,risk_low:`_risk_low_1n6q8_54`,risk_medium:`_risk_medium_1n6q8_55`,risk_high:`_risk_high_1n6q8_56`,summary:`_summary_1n6q8_58`,evidence:`_evidence_1n6q8_64`,evidenceRow:`_evidenceRow_1n6q8_74`,evidenceLabel:`_evidenceLabel_1n6q8_81`,muted:`_muted_1n6q8_89`,rationaleNote:`_rationaleNote_1n6q8_94`,failedChecks:`_failedChecks_1n6q8_101`,diffSection:`_diffSection_1n6q8_107`,actions:`_actions_1n6q8_111`,actionConsequence:`_actionConsequence_1n6q8_124`,actionError:`_actionError_1n6q8_133`,rejectButton:`_rejectButton_1n6q8_144`,approveButton:`_approveButton_1n6q8_165`,decided:`_decided_1n6q8_176`},is={"judge-ship-would-merge":{label:`Ship (would merge)`,tone:`success`},"judge-ship-review-required":{label:`Ship (review required)`,tone:`success`},"judge-review":{label:`Review`,tone:`warning`},"judge-noise":{label:`Noise`,tone:`neutral`},"judge-harmful":{label:`Harmful`,tone:`danger`},"judge-verdict-unrecognized":{label:`Unrecognized verdict`,tone:`unknown`},"judge-parse-failure":{label:`Judge parse failure — not a review`,tone:`unknown`},"judge-network-failure":{label:`Judge network failure — not a review`,tone:`unknown`}};function as(e){let t=e.filter(e=>e.action===`judged`&&e.judgeReasonCode);return t.length===0?null:t.reduce((e,t)=>Date.parse(t.ts)>Date.parse(e.ts)?t:e)}function os(e){if(!e)return`—`;let t=Date.parse(e);if(Number.isNaN(t))return`—`;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`${n}s ago`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function ss(e,t){let n=t&&t.length>0?t:`the target repository`;return e===`pr`?`Approving pushes a branch to ${n}'s remote and opens a real pull request. Other people can see it immediately, and it cannot be undone from here.`:e===`patch`?`Approving writes this diff to ${n} on disk now. Nothing is pushed, but the working tree changes.`:`Approving applies this ${e} proposal to ${n} now.`}function cs({id:e,onDispatchDisabled:t}){let n=w(pe(e)),[r,i]=(0,A.useState)(null),[a,o]=(0,A.useState)(!1),[s,l]=(0,A.useState)(!1),[u,d]=(0,A.useState)(!1),[f,m]=(0,A.useState)(null);function h(e){m(null),i(e),c()?l(!0):o(!0)}function _(){o(!1),c()?l(!0):i(null)}async function v(){if(r){d(!0),m(null);try{r===`approve`?await Oe(e):await De(e),l(!1),i(null)}catch(e){e instanceof p?(l(!1),i(null),t()):m(e instanceof Error?e.message:`Action failed. Try again.`)}finally{d(!1)}}}if(n.status===`loading`)return(0,I.jsxs)(`div`,{className:Z.panel,children:[(0,I.jsx)(g,{width:`60%`}),(0,I.jsx)(g,{width:`30%`}),(0,I.jsx)(g,{width:`90%`})]});if(n.status===`error`||!n.data)return(0,I.jsx)(`div`,{className:Z.error,role:`alert`,children:n.error?.message??`Failed to load this proposal.`});let x=n.data,S=x.decisionEvidence,C=as(S.decisions),T=C?.judgeReasonCode?is[C.judgeReasonCode]:null,ee=x.status===`pending`;return(0,I.jsxs)(`div`,{className:Z.panel,children:[(0,I.jsxs)(`header`,{className:Z.header,children:[(0,I.jsxs)(`div`,{className:Z.titleRow,children:[(0,I.jsx)(`h2`,{className:Z.title,children:x.title}),n.status===`refreshing`?(0,I.jsx)(y,{}):null]}),(0,I.jsxs)(`div`,{className:Z.metaRow,children:[(0,I.jsx)(b,{status:x.status}),(0,I.jsx)(`span`,{className:Z.metaItem,children:x.kind}),(0,I.jsx)(`span`,{className:Z.metaItem,title:x.repo??void 0,children:x.repo??`no repo`}),(0,I.jsxs)(`span`,{className:Z.metaItem,children:[`created `,os(x.createdAt)]}),x.decidedAt?(0,I.jsxs)(`span`,{className:Z.metaItem,children:[`decided `,os(x.decidedAt)]}):null,x.riskClass?(0,I.jsxs)(`span`,{className:`${Z.riskBadge} ${Z[`risk_${x.riskClass}`]}`,children:[x.riskClass,` risk`]}):null]}),x.summary?(0,I.jsx)(`p`,{className:Z.summary,children:x.summary}):null]}),(0,I.jsxs)(`section`,{className:Z.evidence,"aria-label":`Evidence`,children:[(0,I.jsxs)(`div`,{className:Z.evidenceRow,children:[(0,I.jsx)(`span`,{className:Z.evidenceLabel,children:`Judge verdict`}),(0,I.jsx)(E,{quality:S.sourceQuality,label:`judge verdict`,children:T?(0,I.jsx)(b,{status:C.judgeReasonCode,tone:T.tone,children:T.label}):(0,I.jsx)(`span`,{className:Z.muted,children:`not yet judged`})})]}),C?.judgeRationaleState?(0,I.jsxs)(`p`,{className:Z.rationaleNote,children:[`Model rationale:`,` `,C.judgeRationaleState===`not-persisted`?`not persisted`:`legacy (redacted)`]}):null,x.decisionReason?(0,I.jsxs)(`div`,{className:Z.evidenceRow,children:[(0,I.jsx)(`span`,{className:Z.evidenceLabel,children:`Decision reason`}),(0,I.jsx)(`span`,{children:x.decisionReason})]}):null,x.verifyResult?(0,I.jsxs)(`div`,{className:Z.evidenceRow,children:[(0,I.jsx)(`span`,{className:Z.evidenceLabel,children:`Verification`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(b,{status:x.verifyResult.passed?`success`:`failed`,children:x.verifyResult.passed?`passed`:`failed`}),x.verifyResult.ran&&x.verifyResult.ran.length>0?(0,I.jsxs)(`span`,{className:Z.muted,children:[` · ran `,x.verifyResult.ran.map(e=>e.kind).join(`, `)]}):null,x.verifyResult.failed&&x.verifyResult.failed.length>0?(0,I.jsxs)(`p`,{className:Z.failedChecks,children:[`Failed: `,x.verifyResult.failed.join(`, `)]}):null]})]}):null,x.evidenceOutcome?(0,I.jsxs)(`div`,{className:Z.evidenceRow,children:[(0,I.jsx)(`span`,{className:Z.evidenceLabel,children:`Gates`}),(0,I.jsxs)(`span`,{className:Z.muted,children:[x.evidenceOutcome.gateCount??0,` gate`,x.evidenceOutcome.gateCount===1?``:`s`,x.evidenceOutcome.policyAction?` · policy: ${x.evidenceOutcome.policyAction}`:``,x.evidenceOutcome.trustBasis?` · trust: ${x.evidenceOutcome.trustBasis}`:``]})]}):null,x.result?(0,I.jsxs)(`div`,{className:Z.evidenceRow,children:[(0,I.jsx)(`span`,{className:Z.evidenceLabel,children:`Result`}),(0,I.jsx)(`span`,{children:x.result})]}):null]}),(0,I.jsx)(`section`,{className:Z.diffSection,"aria-label":`Diff`,children:(0,I.jsx)(He,{diff:x.diff,proposalKind:x.kind})}),ee?(0,I.jsxs)(`footer`,{className:Z.actions,children:[f&&!s?(0,I.jsx)(`p`,{className:Z.actionError,role:`alert`,children:f}):null,(0,I.jsx)(`p`,{className:Z.actionConsequence,children:ss(x.kind,x.repo)}),(0,I.jsx)(`button`,{type:`button`,className:Z.rejectButton,onClick:()=>h(`reject`),children:`Reject`}),(0,I.jsx)(`button`,{type:`button`,className:Z.approveButton,onClick:()=>h(`approve`),children:`Approve`})]}):(0,I.jsxs)(`footer`,{className:Z.decided,children:[`This proposal is already `,(0,I.jsx)(`strong`,{children:x.status}),` — no further action available.`]}),(0,I.jsx)(je,{open:a,onClose:_,reason:r===`approve`?`Approving a proposal mutates the fleet and requires the dispatch token.`:`Rejecting a proposal requires the dispatch token.`}),(0,I.jsx)(Ae,{open:s,onClose:()=>{l(!1),i(null),m(null)},title:r===`approve`?`Approve this proposal?`:`Reject this proposal?`,body:r===`approve`?(0,I.jsxs)(I.Fragment,{children:[`This applies `,(0,I.jsx)(`strong`,{children:x.title}),` to `,(0,I.jsx)(`code`,{children:x.repo}),` now.`,` `,ss(x.kind,x.repo),` Review the diff above before confirming.`]}):(0,I.jsxs)(I.Fragment,{children:[`This rejects `,(0,I.jsx)(`strong`,{children:x.title}),` and discards it. It stays visible in history (status: rejected) but will never be applied. Nothing is written to `,(0,I.jsx)(`code`,{children:x.repo}),`.`]}),confirmLabel:r===`approve`?x.kind===`pr`?`Approve and open the pull request`:`Approve and apply`:`Reject`,destructive:r===`approve`,busy:u,error:f,onConfirm:()=>void v()})]})}var ls={view:`_view_19z5m_1`,header:`_header_19z5m_8`,title:`_title_19z5m_14`,subtitle:`_subtitle_19z5m_20`,dispatchBanner:`_dispatchBanner_19z5m_25`,layout:`_layout_19z5m_39`,listPane:`_listPane_19z5m_57`,detailPane:`_detailPane_19z5m_61`,emptyDetail:`_emptyDetail_19z5m_69`,hint:`_hint_19z5m_81`};function us(){let{id:e}=yn(),[t,n]=(0,A.useState)(!1);return(0,I.jsxs)(`div`,{className:ls.view,children:[(0,I.jsxs)(`header`,{className:ls.header,children:[(0,I.jsx)(`h1`,{className:ls.title,children:`Inbox`}),(0,I.jsx)(`p`,{className:ls.subtitle,children:`Review proposals, inspect diffs and judge evidence, approve or reject.`})]}),t?(0,I.jsxs)(`div`,{className:ls.dispatchBanner,role:`alert`,children:[`This server was started without `,(0,I.jsx)(`code`,{children:`--allow-dispatch`}),`, so approve/reject are read-only right now. Restart `,(0,I.jsx)(`code`,{children:`ashlr serve --allow-dispatch`}),` to enable them. Browsing and diff review still work.`]}):null,(0,I.jsxs)(`div`,{className:ls.layout,children:[(0,I.jsx)(`div`,{className:ls.listPane,children:(0,I.jsx)(rs,{selectedId:e??null,onDispatchDisabled:()=>n(!0)})}),(0,I.jsx)(`div`,{className:ls.detailPane,children:e?(0,I.jsx)(cs,{id:e,onDispatchDisabled:()=>n(!0)}):(0,I.jsxs)(`div`,{className:ls.emptyDetail,children:[(0,I.jsx)(`p`,{children:`Select a proposal to review its diff and evidence.`}),(0,I.jsx)(`p`,{className:ls.hint,children:`↑/↓ to move · Enter to open · Space to select · / to search`})]})})]})]})}var Q={cockpit:`_cockpit_1km3b_1`,decisionSpine:`_decisionSpine_1km3b_9`,mission:`_mission_1km3b_18`,titleLine:`_titleLine_1km3b_25`,revision:`_revision_1km3b_39`,northStar:`_northStar_1km3b_44`,bottleneck:`_bottleneck_1km3b_52`,nextActionLabel:`_nextActionLabel_1km3b_60`,fieldLabel:`_fieldLabel_1km3b_61`,nextAction:`_nextAction_1km3b_60`,exception:`_exception_1km3b_79`,attention:`_attention_1km3b_84`,clear:`_clear_1km3b_89`,spectrum:`_spectrum_1km3b_106`,bets:`_bets_1km3b_107`,sectionHeading:`_sectionHeading_1km3b_113`,capabilityList:`_capabilityList_1km3b_133`,betList:`_betList_1km3b_134`,capabilityLane:`_capabilityLane_1km3b_141`,bet:`_bet_1km3b_107`,laneIdentity:`_laneIdentity_1km3b_155`,laneName:`_laneName_1km3b_162`,headroomTrack:`_headroomTrack_1km3b_167`,headroomFill:`_headroomFill_1km3b_174`,ample:`_ample_1km3b_181`,usable:`_usable_1km3b_182`,tight:`_tight_1km3b_183`,none:`_none_1km3b_184`,unknown:`_unknown_1km3b_185`,allocation:`_allocation_1km3b_187`,reset:`_reset_1km3b_188`,betAllocation:`_betAllocation_1km3b_189`,assurance:`_assurance_1km3b_190`,betDecision:`_betDecision_1km3b_216`,betEvidence:`_betEvidence_1km3b_217`,betThesis:`_betThesis_1km3b_227`,empty:`_empty_1km3b_251`,omitted:`_omitted_1km3b_252`,authorityNote:`_authorityNote_1km3b_253`};function ds(e){return e===`complete`?`success`:e===`pending`?`running`:e===`incomplete`?`warning`:`unknown`}function fs(e){return e===`ready`?`success`:e===`tight`?`warning`:e===`unavailable`?`danger`:`unknown`}function ps(e){return e===`continue`?`running`:e===`observing`?`info`:`warning`}function ms(e){return e===`effective`?`success`:e===`refuted`?`danger`:e===`pending`?`running`:`unknown`}function hs({capability:e}){return(0,I.jsxs)(`li`,{className:Q.capabilityLane,children:[(0,I.jsxs)(`div`,{className:Q.laneIdentity,children:[(0,I.jsx)(`span`,{className:Q.laneName,children:e.label}),(0,I.jsx)(b,{status:e.state,tone:fs(e.state)})]}),(0,I.jsx)(`div`,{className:Q.headroomTrack,role:`img`,"aria-label":`${e.label} headroom: ${e.headroom}`,children:(0,I.jsx)(`span`,{className:`${Q.headroomFill} ${Q[e.headroom]}`})}),(0,I.jsx)(`span`,{className:Q.allocation,children:e.allocationLabel}),(0,I.jsx)(`span`,{className:Q.reset,"data-urgency":e.resetUrgency,children:e.resetLabel})]})}function gs({bet:e}){return(0,I.jsxs)(`li`,{className:Q.bet,children:[(0,I.jsxs)(`div`,{className:Q.betDecision,children:[(0,I.jsx)(b,{status:e.decision,tone:ps(e.decision)}),(0,I.jsx)(`span`,{className:Q.assurance,children:e.assurance})]}),(0,I.jsxs)(`div`,{className:Q.betThesis,children:[(0,I.jsx)(`h3`,{children:e.title}),(0,I.jsx)(`p`,{children:e.valueCase})]}),(0,I.jsx)(`span`,{className:Q.betAllocation,children:e.allocationLabel}),(0,I.jsxs)(`div`,{className:Q.betEvidence,children:[(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:Q.fieldLabel,children:`Outcome`}),(0,I.jsx)(b,{status:e.outcome.state,tone:ms(e.outcome.state),children:e.outcome.label})]}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:Q.fieldLabel,children:`Evidence`}),(0,I.jsx)(b,{status:e.evidence.state,tone:ds(e.evidence.state),children:e.evidence.label})]})]})]})}function _s({snapshot:e}){let t=e.activeValueBets.slice(0,3),n=Math.max(0,e.activeValueBets.length-t.length),r=e.nextAction;return(0,I.jsxs)(`section`,{className:Q.cockpit,"aria-labelledby":`agent-os-title`,children:[(0,I.jsxs)(`header`,{className:Q.decisionSpine,children:[(0,I.jsxs)(`div`,{className:Q.mission,children:[(0,I.jsxs)(`div`,{className:Q.titleLine,children:[(0,I.jsx)(`h2`,{id:`agent-os-title`,children:`Agent OS`}),(0,I.jsx)(b,{status:e.sourceState,tone:e.sourceState===`healthy`?`success`:e.sourceState===`degraded`?`warning`:`unknown`}),(0,I.jsx)(`span`,{className:Q.revision,children:e.livingEndState.revisionLabel})]}),(0,I.jsx)(`p`,{className:Q.northStar,children:e.livingEndState.northStar}),(0,I.jsxs)(`p`,{className:Q.bottleneck,children:[(0,I.jsx)(`span`,{children:`Current bottleneck`}),e.livingEndState.currentBottleneck]})]}),(0,I.jsxs)(`aside`,{className:`${Q.nextAction} ${r?Q[r.kind]:Q.clear}`,"aria-label":`Exception-first next action`,children:[(0,I.jsx)(`span`,{className:Q.nextActionLabel,children:`Next action`}),(0,I.jsx)(`strong`,{children:r?.title??`No verified next action available`}),(0,I.jsx)(`p`,{children:r?.reason??`No exception or clearance evidence was provided.`}),r?(0,I.jsxs)(b,{status:r.evidenceState,tone:ds(r.evidenceState),children:[r.evidenceState,` evidence`]}):null]})]}),(0,I.jsxs)(`section`,{className:Q.spectrum,"aria-labelledby":`capability-spectrum-title`,children:[(0,I.jsxs)(`div`,{className:Q.sectionHeading,children:[(0,I.jsx)(`h3`,{id:`capability-spectrum-title`,children:`Capability spectrum`}),(0,I.jsx)(`p`,{children:`Usable model runway, ordered by reset urgency`})]}),e.capabilitySpectrum.length>0?(0,I.jsx)(`ul`,{className:Q.capabilityList,children:e.capabilitySpectrum.map(e=>(0,I.jsx)(hs,{capability:e},e.lane))}):(0,I.jsx)(`p`,{className:Q.empty,children:`Capability evidence is not available.`})]}),(0,I.jsxs)(`section`,{className:Q.bets,"aria-labelledby":`active-value-bets-title`,children:[(0,I.jsxs)(`div`,{className:Q.sectionHeading,children:[(0,I.jsx)(`h3`,{id:`active-value-bets-title`,children:`Active value bets`}),(0,I.jsxs)(`p`,{children:[t.length,` of 3 portfolio slots visible`]})]}),t.length>0?(0,I.jsx)(`ol`,{className:Q.betList,children:t.map(e=>(0,I.jsx)(gs,{bet:e},e.key))}):(0,I.jsx)(`p`,{className:Q.empty,children:`No active value bet is verified.`}),n>0?(0,I.jsxs)(`p`,{className:Q.omitted,children:[n,` lower-ranked `,n===1?`bet is`:`bets are`,` held outside this view.`]}):null]}),(0,I.jsx)(`p`,{className:Q.authorityNote,children:`Observation only. This view cannot dispatch, merge, release, deploy, or change policy.`})]})}var $={view:`_view_k4f4y_1`,header:`_header_k4f4y_8`,eyebrow:`_eyebrow_k4f4y_15`,title:`_title_k4f4y_24`,subtitle:`_subtitle_k4f4y_31`,freshness:`_freshness_k4f4y_37`,loading:`_loading_k4f4y_44`,unavailable:`_unavailable_k4f4y_45`,unavailableHeading:`_unavailableHeading_k4f4y_75`,boundary:`_boundary_k4f4y_82`};function vs(e){return e.authority===`observation-only`&&e.sameUserTamperResistant===!1&&e.rollbackProtected===!1&&e.historicalAuthority===!1&&e.executionAuthority===!1&&e.proposalAuthority===!1&&e.mergeAuthority===!1&&e.deployAuthority===!1&&e.publicationAuthority===!1&&e.externalMutationAuthority===!1}function ys(e){return e.reason?e.reason:e.sourceState===`missing`?`No authenticated Agent OS snapshot has been recorded.`:e.authentication===`authenticated`?e.sameUserTamperResistant===!1?vs(e)?e.complete?e.snapshot?`The Agent OS snapshot is degraded.`:`No verified Agent OS snapshot is available.`:`The snapshot chain is incomplete.`:`The response crossed the observation-only authority boundary.`:`The response made an unsupported same-user tamper-resistance claim.`:`Snapshot authentication is unavailable or invalid.`}function bs(e){return e.sourceState===`healthy`&&e.complete&&e.authentication===`authenticated`&&vs(e)&&e.snapshot!==null?`success`:e.sourceState===`degraded`||e.authentication===`invalid`||!vs(e)?`warning`:`unknown`}function xs(){let e=(0,A.useRef)(null);Me(`/agent-os`,e);let t=w(Se),n=t.data,r=n?.sourceState===`healthy`&&n.complete&&n.authentication===`authenticated`&&vs(n)&&n.snapshot!==null;return(0,I.jsxs)(`div`,{ref:e,className:$.view,children:[(0,I.jsxs)(`header`,{className:$.header,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:$.eyebrow,children:`Overview`}),(0,I.jsx)(`h1`,{className:$.title,children:`Agent-native engineering OS`}),(0,I.jsx)(`p`,{className:$.subtitle,children:`Authenticated fleet intelligence. Observation only.`})]}),(0,I.jsxs)(`div`,{className:$.freshness,"aria-live":`polite`,children:[t.status===`refreshing`?(0,I.jsx)(y,{}):null,n?(0,I.jsx)(b,{status:n.sourceState,tone:bs(n),children:n.sourceState}):null]})]}),t.status===`loading`?(0,I.jsxs)(`section`,{className:$.loading,"aria-label":`Loading Agent OS snapshot`,children:[(0,I.jsx)(g,{width:`65%`}),(0,I.jsx)(g,{width:`90%`}),(0,I.jsx)(g,{width:`75%`})]}):t.status===`error`?(0,I.jsxs)(`section`,{className:$.unavailable,role:`alert`,children:[(0,I.jsx)(`h2`,{children:`Agent OS snapshot unavailable`}),(0,I.jsx)(`p`,{children:t.error?.message??`The read-only Agent OS endpoint could not be reached.`}),(0,I.jsx)(`p`,{className:$.boundary,children:`No capability, value, or next-action values are inferred when the source cannot be read.`})]}):n&&r&&n.snapshot?(0,I.jsx)(_s,{snapshot:n.snapshot}):n?(0,I.jsxs)(`section`,{className:$.unavailable,role:`status`,children:[(0,I.jsxs)(`div`,{className:$.unavailableHeading,children:[(0,I.jsx)(`h2`,{children:n.sourceState===`missing`?`No Agent OS snapshot yet`:`Agent OS snapshot degraded`}),(0,I.jsx)(b,{status:n.authentication,tone:n.authentication===`authenticated`?`success`:`warning`})]}),(0,I.jsx)(`p`,{children:ys(n)}),(0,I.jsx)(`p`,{className:$.boundary,children:`The cockpit remains hidden until a complete authenticated observation-only snapshot is available.`})]}):(0,I.jsxs)(`section`,{className:$.unavailable,role:`status`,children:[(0,I.jsx)(`h2`,{children:`Agent OS snapshot unavailable`}),(0,I.jsx)(`p`,{children:`No response was provided by the read-only Agent OS endpoint.`})]})]})}function Ss(){return(0,I.jsx)(Wn,{children:(0,I.jsxs)(F,{element:(0,I.jsx)(Xi,{}),children:[(0,I.jsx)(F,{index:!0,element:(0,I.jsx)(Vn,{to:`/overview`,replace:!0})}),Vr.map(e=>e.implemented?null:(0,I.jsx)(F,{path:e.path,element:(0,I.jsx)(Qi,{title:e.label,description:e.description})},e.path)),(0,I.jsx)(F,{path:`/overview`,element:(0,I.jsx)(fa,{})}),(0,I.jsx)(F,{path:`/agent-os`,element:(0,I.jsx)(xs,{})}),(0,I.jsx)(F,{path:`/universe`,element:(0,I.jsx)(Ne,{})}),(0,I.jsx)(F,{path:`/journal`,element:(0,I.jsx)(Qa,{})}),(0,I.jsx)(F,{path:`/intelligence/pulse`,element:(0,I.jsx)(ro,{})}),(0,I.jsx)(F,{path:`/intelligence/genome`,element:(0,I.jsx)(fo,{})}),(0,I.jsx)(F,{path:`/intelligence/production`,element:(0,I.jsx)(ho,{})}),(0,I.jsx)(F,{path:`/portfolio`,element:(0,I.jsx)(yo,{})}),(0,I.jsx)(F,{path:`/work/runs`,element:(0,I.jsx)(wo,{})}),(0,I.jsx)(F,{path:`/work/runs/:id`,element:(0,I.jsx)(Do,{})}),(0,I.jsx)(F,{path:`/work/swarms`,element:(0,I.jsx)(No,{})}),(0,I.jsx)(F,{path:`/work/swarms/:id`,element:(0,I.jsx)(Wo,{})}),(0,I.jsx)(F,{path:`/control/daemon`,element:(0,I.jsx)(Jo,{})}),(0,I.jsx)(F,{path:`/control/fleet`,element:(0,I.jsx)(Xo,{})}),(0,I.jsx)(F,{path:`/control/security`,element:(0,I.jsx)($o,{})}),(0,I.jsx)(F,{path:`/goals`,element:(0,I.jsx)(es,{})}),(0,I.jsx)(F,{path:`/inbox`,element:(0,I.jsx)(us,{})}),(0,I.jsx)(F,{path:`/inbox/:id`,element:(0,I.jsx)(us,{})}),(0,I.jsx)(F,{path:`*`,element:(0,I.jsx)(Vn,{to:`/overview`,replace:!0})})]})})}function Cs(e){(0,A.useEffect)(()=>{if(e!==`checking`)return;let t=!1;return o(se.key,se.fetch).then(()=>{if(t)return;let e=u(se.key);l(e.status===`success`)}),()=>{t=!0}},[e])}function ws(){let e=h();return Cs(e),(0,I.jsx)(re,{children:e===`checking`?(0,I.jsx)(`div`,{"aria-live":`polite`,className:`visually-hidden`,children:`Checking for an existing session…`}):e===`unauthenticated`?(0,I.jsx)(C,{}):(0,I.jsxs)(Or,{children:[(0,I.jsx)(v,{}),(0,I.jsx)(Ss,{})]})})}export{ws as App};
7
- //# sourceMappingURL=App-BbVoUCIi.js.map
7
+ //# sourceMappingURL=App-vtaHB9mp.js.map