@usine/server 0.4.0 → 0.4.1-next.241.gf648872

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 (138) hide show
  1. package/dist/web/assets/CompositeItem-DL5QWzlf.js +1 -0
  2. package/dist/web/assets/ToolbarRootContext-aq6udDVh.js +1 -0
  3. package/dist/web/assets/X.es-ClvLjC9g.js +1 -0
  4. package/dist/web/assets/_agent-DtbWtI4O.js +1 -0
  5. package/dist/web/assets/_loop-CPLcEe-u.js +1 -0
  6. package/dist/web/assets/_name-B-JwwOOx.js +1 -0
  7. package/dist/web/assets/_name-BHymV4y2.js +1 -0
  8. package/dist/web/assets/_name-DHT3Z3pi.js +1 -0
  9. package/dist/web/assets/_name-DOdPCzeN.js +1 -0
  10. package/dist/web/assets/_name-LDfdPJ04.js +6 -0
  11. package/dist/web/assets/_number-CXWY3_sQ.js +1 -0
  12. package/dist/web/assets/_number-DHT3Z3pi.js +1 -0
  13. package/dist/web/assets/_number-DdcjkCP5.js +1 -0
  14. package/dist/web/assets/_run-ChuAgP8W.js +8 -0
  15. package/dist/web/assets/_run-DHT3Z3pi.js +1 -0
  16. package/dist/web/assets/_worker-ve1pwBJ6.js +1 -0
  17. package/dist/web/assets/action-Bma79eWY.js +1 -0
  18. package/dist/web/assets/agents-BXym4S3E.js +1 -0
  19. package/dist/web/assets/agents-WFIojkKz.js +1 -0
  20. package/dist/web/assets/boot-screen-Su4MyrBh.js +1 -0
  21. package/dist/web/assets/button-4rhhIcK8.js +1 -0
  22. package/dist/web/assets/collapsible-CTA-Hwrn.js +1 -0
  23. package/dist/web/assets/{core-wi-Hu_JV.js → core-S_rVxu-b.js} +1 -1
  24. package/dist/web/assets/drawer-Dw6v2BLr.js +1 -0
  25. package/dist/web/assets/dropdown-menu-B5_S4hH-.js +1 -0
  26. package/dist/web/assets/edit-and-retry-CzObi4mf.js +1 -0
  27. package/dist/web/assets/empty-B9bymfss.js +1 -0
  28. package/dist/web/assets/error-alert-NXb1Z8Xz.js +1 -0
  29. package/dist/web/assets/{file-error-SjG2jLJ9.js → file-error-C2s0qbxi.js} +1 -1
  30. package/dist/web/assets/fill-cell-CjksmixH.js +1 -0
  31. package/dist/web/assets/heading-Bp50m3v1.js +1 -0
  32. package/dist/web/assets/index-CPkHl5O3.js +10 -0
  33. package/dist/web/assets/index-jplYOAsa.css +2 -0
  34. package/dist/web/assets/label-badge-DIiohsEI.js +1 -0
  35. package/dist/web/assets/link-C7GfYrMt.js +1 -0
  36. package/dist/web/assets/list-wEAoFt_l.js +1 -0
  37. package/dist/web/assets/loops-xOfOUTbc.js +1 -0
  38. package/dist/web/assets/{markdown-BnyfnuCL.js → markdown-BNebzGGH.js} +3 -3
  39. package/dist/web/assets/matchContext-D_B3XAQH.js +2 -0
  40. package/dist/web/assets/model-DXxFqTtA.js +1 -0
  41. package/dist/web/assets/moves-D_bvNew_.js +1 -0
  42. package/dist/web/assets/not-found-CTNKT4RI.js +1 -0
  43. package/dist/web/assets/outcome-o7LagK-q.js +5 -0
  44. package/dist/web/assets/overview-BdUgx_pE.js +1 -0
  45. package/dist/web/assets/page-BuzrT_cg.js +1 -0
  46. package/dist/web/assets/project-not-found-CutZoVCI.js +1 -0
  47. package/dist/web/assets/pull-request-marks-BLxcb-0V.js +1 -0
  48. package/dist/web/assets/queries-BnlycW8v.js +1 -0
  49. package/dist/web/assets/queries-BwtMk72-.js +1 -0
  50. package/dist/web/assets/reload-yp-6_O8x.js +1 -0
  51. package/dist/web/assets/repositories-MlGwURyP.js +1 -0
  52. package/dist/web/assets/route-Boaf6qM7.js +1 -0
  53. package/dist/web/assets/route-BxsfSGun.js +1 -0
  54. package/dist/web/assets/{routes-BLy5TGH_.js → routes-D25foI3P.js} +19 -19
  55. package/dist/web/assets/routes-DHT3Z3pi.js +1 -0
  56. package/dist/web/assets/run-again-BwF1g66X.js +1 -0
  57. package/dist/web/assets/section-B0ipDPYr.js +1 -0
  58. package/dist/web/assets/section-BhUxD7-H.js +1 -0
  59. package/dist/web/assets/section-BwxXJ9H0.js +1 -0
  60. package/dist/web/assets/settings-DQka4c7B.js +1 -0
  61. package/dist/web/assets/slots-n0NbUO7Z.js +1 -0
  62. package/dist/web/assets/status-badge-CLPsMXtK.js +1 -0
  63. package/dist/web/assets/strings-C9Xdiz_K.js +1 -0
  64. package/dist/web/assets/strings-qxNeGv33.js +301 -0
  65. package/dist/web/assets/table-hbKjhjeL.js +1 -0
  66. package/dist/web/assets/tasks-B51Y5ks_.js +1 -0
  67. package/dist/web/assets/tasks-DHT3Z3pi.js +1 -0
  68. package/dist/web/assets/usage-Bu-ewmBl.js +1 -0
  69. package/dist/web/assets/use-now-vNgLntlV.js +1 -0
  70. package/dist/web/assets/useAnchoredPopupScrollLock-CeE46geY.js +1 -0
  71. package/dist/web/assets/useNavigate-AT5VkfZa.js +1 -0
  72. package/dist/web/assets/usePositioner-B7VCT5LN.js +1 -0
  73. package/dist/web/assets/useRouter-Hur3RN7j.js +1 -0
  74. package/dist/web/assets/useTimeout-BC05Ghyu.js +1 -0
  75. package/dist/web/assets/with-selector-Dwf291_Q.js +1 -0
  76. package/dist/web/assets/workers-BeOqCiLJ.js +1 -0
  77. package/dist/web/index.html +20 -15
  78. package/package.json +9 -9
  79. package/dist/web/assets/CompositeItem-DU6IyNMY.js +0 -1
  80. package/dist/web/assets/ToolbarRootContext-Cytu6o2e.js +0 -1
  81. package/dist/web/assets/X.es-B7iqdxa_.js +0 -1
  82. package/dist/web/assets/_agent-BVKD5odk.js +0 -1
  83. package/dist/web/assets/_loop-BFLzamuo.js +0 -1
  84. package/dist/web/assets/_name-Bh4AQ9sR.js +0 -6
  85. package/dist/web/assets/_name-CMVsmWzq.js +0 -1
  86. package/dist/web/assets/_name-DCkgEma_.js +0 -1
  87. package/dist/web/assets/_name-Ds_pWi15.js +0 -1
  88. package/dist/web/assets/_number-B9aYwvcQ.js +0 -1
  89. package/dist/web/assets/_run-BZWt47QS.js +0 -8
  90. package/dist/web/assets/_worker-Dgfufm5p.js +0 -1
  91. package/dist/web/assets/action-rCd1FeAz.js +0 -1
  92. package/dist/web/assets/agents-Drbg6qpH.js +0 -1
  93. package/dist/web/assets/agents-_6-dEjrY.js +0 -1
  94. package/dist/web/assets/button-DVWXde__.js +0 -1
  95. package/dist/web/assets/collapsible-IOhZV1qg.js +0 -1
  96. package/dist/web/assets/drawer-BiqnR_8i.js +0 -1
  97. package/dist/web/assets/dropdown-menu-C9D1kRkO.js +0 -1
  98. package/dist/web/assets/edit-and-retry-BgOR6mvP.js +0 -1
  99. package/dist/web/assets/error-alert-9tKpTE3v.js +0 -1
  100. package/dist/web/assets/fill-cell-ClM88KFD.js +0 -1
  101. package/dist/web/assets/heading-lX1a1LNN.js +0 -1
  102. package/dist/web/assets/index-BymNZU1Q.js +0 -10
  103. package/dist/web/assets/index-Dyjfp3ET.css +0 -2
  104. package/dist/web/assets/label-badge-aIGT1Bry.js +0 -1
  105. package/dist/web/assets/list-v8WJp2Eq.js +0 -1
  106. package/dist/web/assets/loops-BFoFf_og.js +0 -1
  107. package/dist/web/assets/mark-CC3RwMy_.js +0 -1
  108. package/dist/web/assets/matchContext-BquevSJS.js +0 -2
  109. package/dist/web/assets/model-BerBT6R0.js +0 -1
  110. package/dist/web/assets/moves-Dg9sshX5.js +0 -1
  111. package/dist/web/assets/overview-C_tFKGZ8.js +0 -1
  112. package/dist/web/assets/page-DWnGi6wA.js +0 -301
  113. package/dist/web/assets/project-not-found-CodaBVdu.js +0 -1
  114. package/dist/web/assets/pull-request-marks-DE00nqGW.js +0 -1
  115. package/dist/web/assets/queries-B1SHA_r4.js +0 -1
  116. package/dist/web/assets/reload-Dsl0zjJ7.js +0 -1
  117. package/dist/web/assets/repositories-BdxmD192.js +0 -1
  118. package/dist/web/assets/route-B_gphTYG.js +0 -1
  119. package/dist/web/assets/route-Cc7dKnn5.js +0 -1
  120. package/dist/web/assets/run-again-BTKagSXR.js +0 -1
  121. package/dist/web/assets/section-B3pWIIBa.js +0 -1
  122. package/dist/web/assets/section-CD-MB5r3.js +0 -1
  123. package/dist/web/assets/section-Id99HktI.js +0 -1
  124. package/dist/web/assets/settings-YrDysQXW.js +0 -1
  125. package/dist/web/assets/slots-BraHmbNr.js +0 -1
  126. package/dist/web/assets/status-badge-DnvNo1tG.js +0 -1
  127. package/dist/web/assets/strings-CW2XaR5f.js +0 -1
  128. package/dist/web/assets/table-BjyI4fVI.js +0 -1
  129. package/dist/web/assets/tasks-DCL8kLmD.js +0 -1
  130. package/dist/web/assets/transcript-sxRJzx6t.js +0 -5
  131. package/dist/web/assets/usage-CLQJdX9-.js +0 -1
  132. package/dist/web/assets/use-now-0P8TUXeg.js +0 -1
  133. package/dist/web/assets/useAnchoredPopupScrollLock-CQ83Wy-r.js +0 -1
  134. package/dist/web/assets/useNavigate-BW1WdocJ.js +0 -1
  135. package/dist/web/assets/usePositioner-rNCxnHO-.js +0 -1
  136. package/dist/web/assets/useTimeout-_TcdZXP6.js +0 -1
  137. package/dist/web/assets/with-selector-DoElmmtd.js +0 -1
  138. package/dist/web/assets/workers-BH5CBOR3.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{i as e,s as t}from"./useRouter-Hur3RN7j.js";function n(e){return e[e.length-1]}function r(e,t){return typeof e==`function`?e(t):e}var i=Object.prototype.hasOwnProperty;function a(e){for(let t in e)if(i.call(e,t))return!0;return!1}var o=()=>Object.create(null),s=(e,t)=>c(e,t,!0);function c(e,t,r,a=0){if(e===t)return e;if(a++>500)return t;let s=Array.isArray(e)&&Array.isArray(t);if(!s&&!(l(e)&&l(t)))return t;let u=Object.keys(e),d=u.length,f=Object.keys(t),p=f.length;if(s?d!==e.length||p!==t.length||d&&n(u)!==`${d-1}`||p&&n(f)!==`${p-1}`:d!==Object.getOwnPropertyNames(e).length||p!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let m=0,h,g,_;if(s){for(;m<p&&(_=m,g=e[_],h=t[_],h=g===h?g:typeof g==`object`?c(g,h,r,a):h,h===g);m++);if(m===p&&d===p)return e}else{let n=d===p,o=!0;for(;m<p;m++){_=f[m],g=e[_];let s=t[_];h=g===s?g:typeof g==`object`?c(g,s,r,a):s,n&&=h===g&&(u[m]===_||i.call(e,_)),o&&=Object.is(h,s),u[m]=h}if(n)return Object.getOwnPropertySymbols(e).length?t:e;if(o)return t}let v=s?f.fill(0):r?o():{};for(let n=0;n<p;n++)_=s?n:f[n],s?(g=e[_],n>m&&(h=t[_],h=g===h?g:typeof g==`object`?c(g,h,r,a):h),v[_]=n<m?g:h):v[_]=u[n];return v}function l(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function u(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!u(a,o,n,r))return!1}return!0}if(l(e)&&l(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!u(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!u(e[a],t[a],n,r)))return!1;return i===0}return!1}function d(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var f=/[\x00-\x1f\x7f"<>`{}]/g;function p(e){return e.replace(f,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function m(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return p(t)}var h=[`http:`,`https:`,`mailto:`,`tel:`];function g(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var _=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function v(e,t){if(!e)return!1;if(_.test(e))return!0;let n=g(e);return n?!t.has(n):!1}function y(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=m(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=m(r?e.slice(r):e)}return t}function b(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function x(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function S(){throw Error(`Invariant failed`)}function C(e){return e.replace(/\/{2,}/g,`/`)}function w(e){return e===`/`?e:e.replace(/^\/+/,``)}function T(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function E(e){return T(w(e))}function D(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ee(e,t,r=`never`,i){if(t.includes(`//`)&&(t=C(t)),t.startsWith(`/`))return t.length===1||r===`preserve`?t:r===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let a=t===`.`,o;if(i){o=a?e:e+`\0`+t;let n=i.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else{for(e.includes(`//`)&&(e=C(e)),s=e.split(`/`);s.length>1&&n(s)===``;)s.pop();let r=t.split(`/`);for(let e=0,t=r.length;e<t;e++){let n=r[e];n===``?e?e===t-1&&s.push(n):s=[n]:n===`..`?s.length>1?s.pop():s=[``]:n===`.`||s.push(n)}}s.length>1&&(n(s)===``?r===`never`&&s.pop():r===`always`&&s.push(``));let c=s.join(`/`),l=(a?C(c):c)||`/`;return o&&i&&i.set(o,l),l}function O(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function k(e){return e==null||e===``}function te(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function ne(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&k(f)){if(c===`/`&&!d)continue;f=``}o+=c+te(s,f,r)+(d||``)}}return o+a||`/`}function re(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function ie(e){return e?.isNotFound===!0}function ae(){try{return sessionStorage}catch{return}}var oe=`tsr-scroll-restoration-v1_3`,se=ae();function ce(){try{return JSON.parse(se?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var A=ce(),le=`data-scroll-restoration-id`,ue=e=>e.state.__TSR_key||e.href;function de(e){let t=e.getAttribute(le);if(t)return`[${le}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var fe=!1,pe=`window`;function me(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function he(e){let t=new Set;for(let n of e){if(n===pe)continue;let e=me(n);e&&t.add(e)}return t}function ge(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||ue,a=new Set,o=e=>{let t=A[e]||={};for(let e of a)e===document?t[pe]={scrollX,scrollY}:e.isConnected&&(t[de(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,fe=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{fe||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{se?.setItem(oe,JSON.stringify(A))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=A[d];if(e){let t=A[u];for(let n in e){if(n===pe){if(s)continue}else{let e=me(n);if(!e||s&&o&&(l??=he(o),l.has(e)))continue}t||=A[u]={},t[n]??=e[n]}}}fe=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=he(o));let t=e&&i&&c,s=r.e?A[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===pe){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=me(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{fe=!1}}))}function _e(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function ve(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function ye(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=ve(r):Array.isArray(t)?t.push(ve(r)):n[e]=[t,ve(r)]}return n}var be=/^(?:\s|["[{\d-]|fa|nu|tr)/,xe=Ce(JSON.parse),Se=we(JSON.stringify,JSON.parse);function Ce(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=ye(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!be.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function we(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!be.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=_e(e,r);return t?`?${t}`:``}}var Te=`__root__`;function Ee(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function De(e){return e instanceof Response&&!!e.options}function j(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var M=4,Oe=5;function ke(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Ae(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function N(e,t,r,i,a,o){let s=r,c=t.fullPath??t.from,l=t.options,u=c.length,d=c.endsWith(`/`)?u-1:u,f=l?.caseSensitive??e,p=l?.params?.parse??l?.parseParams,m,h=o?r-1:0;if(!i||c.includes(`$`)){m=o?.slice()??[];let e=n(m);e&&typeof e!=`string`&&e[0]===2&&(m[m.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+c.substring(r-(c[r-2]===`/`?2:1),d)],h=u)}for(;s<u;){let e=s,t=c.indexOf(`/`,e),n=t===-1?u:t,r=Ae(c,e,n);s=n+1;let o;if(typeof r==`string`){if(!i)continue;let e=r,t;f?t=i.static??=new Map:(e=r.toLowerCase(),t=i.staticInsensitive??=new Map);let n=t.get(e);if(n)o=n;else{let n=P(i);o=n,t.set(e,n)}}else{let t=r[0],l=r[2],g=r[3]??``;if(t===2&&(n=u,s=n+1),m&&h<n&&(h<e-1&&m.push(c.slice(h,e-1)),r[2]=`/`+l,t===2&&r[3]!==void 0&&d<u&&(r[3]=g.slice(0,-1)),m.push(r),h=n),!i)continue;let _=f&&!!(l||g);f||(l=l.toLowerCase(),g=g.toLowerCase());let v=t===1?i.dynamic??=[]:t===3?i.optional??=[]:i.wildcard??=[],y=t!==2&&!p&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===l&&e.suffix===g);if(y)o=y;else{let e=P(i,t,_,l,g);o=e,v.push(e),v.length===2&&a?.push(v)}}i=o}m&&h<d&&m.push(c.slice(h,d));let g=m?.slice();if(!i)return g;if(p&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=P(i,Oe);(i.pathless??=[]).push(e),i=e}let _=(t.path||!t.children)&&!t.isRoot;if(_&&d<u){let e=P(i,M);i.index=e,i=e}return i.parse=p??null,i.priority=l?.params?.priority??0,i.route||(i.data=g,_&&(i.route=t)),[i,s,g]}function je(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function P(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Me(e,t){let n=P(),r=[];function i(e,t,n,a){let[o,s,c]=N(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(je);t.masksTree=n,t.flatCache=j(1e3)}function Ne(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Le(e,t.masksTree);return t.flatCache.set(e,r),r}function Pe(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=P(),N(t,{from:e},1,o),i.singleCache.set(a,o)),Le(r,o,n)}function Fe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Le(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ze(a.route)),t.matchCache.set(r,a),a}function Ie(e,t=!1){let n=P(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&S(),i[e.id]=e,o!==0&&e.path){let t=T(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=N(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(je);return{processedTree:{segmentTree:n,singleCache:j(1e3),matchCache:j(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Le(e,t,n=!1){let r=e.split(`/`),i=Ve(e,r,t,n);if(!i)return null;let[a]=Re(e,r,i);return{route:i.node.route,rawParams:a}}function Re(e,t,n){let r=Be(n.node),i=n.node.data&&ke(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===M)break;if(u.kind===Oe){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function ze(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Be(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ve(e,t,r,i){if(e===`/`&&r.index)return{node:r.index,skipped:0};let a=!n(t),o=a&&e!==`/`,s=t.length-+!!a,c=[{node:r,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],l=null,u=null;for(;c.length;){let n=c.pop(),{node:r,index:a,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(r.kind===2&&r.route&&!I(u,n))continue;if(r.parse){if(!Ue(e,t,n))continue;g=n.rawParams,h=n.extract}i&&r.route&&r.kind!==M&&I(l,n)&&(l=n);let _=a===s;if(_&&(r.route&&(!o||r.kind===M||r.kind===2)&&I(u,n)&&(u=n),!r.optional&&!r.wildcard&&!r.index&&!r.pathless))continue;let v=_?void 0:t[a],y;if(_&&r.index){let n={node:r.index,index:a,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},i=!0;if(r.index.parse&&(Ue(e,t,n)||(i=!1)),i){if(!p&&!m&&!d&&He(f,s))return n;I(u,n)&&(u=n)}}if(r.wildcard)for(let e=r.wildcard.length-1;e>=0;e--){let n=r.wildcard[e],{prefix:i,suffix:o}=n;if(!i||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(i)){if(o){if(_)continue;let e=t.slice(a).join(`/`),r=e.slice(-o.length);if((n.caseSensitive?r:r.toLowerCase())!==o||e.length-o.length<i.length)continue}c.push({node:n,index:s,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(r.optional){let e=d|1<<r.depth+1;for(let t=r.optional.length-1;t>=0;t--){let n=r.optional[t];c.push({node:n,index:a,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=r.optional.length-1;e>=0;e--){let t=r.optional[e],{prefix:n,suffix:i}=t;if(n||i){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||i&&e.indexOf(i,e.length-i.length)<n.length)continue}c.push({node:t,index:a+1,skipped:d,statics:f,dynamics:p,optionals:m+F(s,a),extract:h,rawParams:g})}}if(!_&&r.dynamic&&v)for(let e=r.dynamic.length-1;e>=0;e--){let t=r.dynamic[e],{prefix:n,suffix:i}=t;if(n||i){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||i&&e.indexOf(i,e.length-i.length)<n.length)continue}c.push({node:t,index:a+1,skipped:d,statics:f,dynamics:p+F(s,a),optionals:m,extract:h,rawParams:g})}if(!_&&r.staticInsensitive){let e=r.staticInsensitive.get(y??=v.toLowerCase());e&&c.push({node:e,index:a+1,skipped:d,statics:f+F(s,a),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&r.static){let e=r.static.get(v);e&&c.push({node:e,index:a+1,skipped:d,statics:f+F(s,a),dynamics:p,optionals:m,extract:h,rawParams:g})}if(r.pathless)for(let e=r.pathless.length-1;e>=0;e--){let t=r.pathless[e];c.push({node:t,index:a,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(u)return u;if(i&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function F(e,t){return 2**(e-t-1)}function He(e,t){return e===2**(t-1)-1}function Ue(e,t,n){let r,i;try{[r,i]=Re(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function I(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===M)>(e.node.kind===M)||t.node.kind===M==(e.node.kind===M)&&t.node.depth>e.node.depth)))}function We(e,t,n){let r=E(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=C(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>Ge(n,s.input({url:e})),output:({url:e})=>s.output({url:Ke(n,e)})}:s}function Ge(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Ke(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function qe(e){let t=e;return{get(){return t},set(e){t=r(e,t)}}}function Je(e){return{get(){return e()}}}function Ye(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{x(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var L=`__TSR_index`,Xe=`popstate`,Ze=`beforeunload`,Qe=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function R(e){let t=Qe.exec(e);return t?`/`+e.slice(t[0].length):e}function $e(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
2
+ \r`.includes(e)?``:encodeURIComponent(e))),R(e)}function et(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=rt(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[L];i=tt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[L];i=tt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[L]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function tt(e,t){let n=it();return{...t,key:n,__TSR_key:n,[L]:e}}function nt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>$e(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>rt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=it();t.history.replaceState({[L]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=rt(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[L]-l.state[L],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=et({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ze,x,{capture:!0}),t.removeEventListener(Xe,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(Ze,x,{capture:!0}),t.addEventListener(Xe,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function rt(e,t){let n=$e(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=it();t={[L]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function it(){return(Math.random()+1).toString(36).slice(7)}function at(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function ot(e){return e.pathname+e.search+e.hash}function st(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function ct(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function lt({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function ut(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function dt(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var ft=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:nt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&E(n)?We(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Ye(this.latestLocation,e),ge(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ie(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Me(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:j(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:y(e),external:!1,searchStr:o,search:s(t?.search,i),hash:y(r.slice(1)),state:c(t?.state,a)}}let o=Ge(this.rewrite,new URL(i,this.origin)),l=this.options.parseSearch(o.search),u=this.options.stringifySearch(l);return o.search=u,{href:o.href.replace(o.origin,``),publicHref:i,pathname:y(R(o.pathname)),external:!!this.rewrite&&at(o,this.origin),searchStr:u,search:s(t?.search,l),hash:y(o.hash.slice(1)),state:c(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Fe(T(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=rt(n.href,{});n={...n,to:Ge(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,s=()=>(t=!0,r),c=()=>i??=this.matchRoutesLightweight(s()),l=n.to?`${n.to}`:`.`,u=ee(l[0]===`/`?``:n.unsafeRelative===`path`?s().pathname:n.from??c()[1],l,this.options.trailingSlash,this.resolvePathCache),d=this.routesByPath[T(u)],f=u.includes(`$`),p;if(d)p=d._branch??=ze(d);else if(f)p=[];else{let[e,t,n]=this.getMatchedRoutes(u);p=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(p=[...p,this.options.notFoundRoute])}let m=f?d?._interpolation??N(!1,{fullPath:u},0):void 0,h;for(let e of p){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=c()[3];if(h??=_t(n.params,e),!a(h))break;h===e&&(h=Object.assign(o(),h));try{Object.assign(h,t(h))}catch{}}}h??=_t(n.params,vt(n.params,m)?c()[3]:yt);let g=e.leaveParams?u:R(y(m?ne(u,m,h,this.pathParamsDecoder):u)),_=bt(p,e._includeValidateSearch),v=()=>{let t=c()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};p.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,gt(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},x=_.length?xt(_,v(),n):n.search===!0?v():typeof n.search==`function`?n.search(v()):n.search||yt,S=this.options.stringifySearch(x),C=n.hash===!0?s().hash:typeof n.hash==`function`?n.hash(s().hash):n.hash||void 0,w=C?`#${C}`:``,E=n.state?n.state===!0?s().state:typeof n.state==`function`?n.state(s().state):n.state:yt,D=`${g}${S}${w}`,O,k,te=!1;if(this.rewrite){let e=new URL(D,this.origin),t=e.origin,n=Ke(this.rewrite,e);O=ot(e),at(n,t)?(k=n.href,te=!0):k=R(ot(n))}else O=b(D),k=O;return{publicHref:k,href:O,pathname:g,search:x,searchStr:S,state:E,hash:C??``,external:te,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Ne(r.pathname,this.processedTree);if(t){let i=Object.assign(o(),t.rawParams),{from:a,params:s,...c}=t.route,l=_t(s,i);r.maskedLocation=n({from:e.from,...c,params:l})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return pt(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=T(this.latestLocation.href)===T(n.href)&&u(lt(n.state),lt(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?g(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return pt(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await $t(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(ct(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&st(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(_.test(n)||(r=g(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:at(e,this.origin)||(n=ot(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=z,this.preloadRoute=e=>en(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?ee(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Pe(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!u(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?u(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=O(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Se,parseSearch:e.parseSearch??xe,protocolAllowlist:e.protocolAllowlist??h}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=N(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,l=!1;(i?i.path!==`/`&&r[`**`]:T(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:l=!0);let u=l?St(this.options.notFoundMode,a):void 0,d=Array(a.length),f=this._committed,p=(e,t)=>{let n=f[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?f.find(t=>t.routeId===e.id):void 0},m;for(let n=0;n<a.length;n++){let i=a[n],l=d[n-1],f,h,g;{let n=l?.search??e.search,r=l?._strictSearch??void 0;try{let e=gt(i.options.validateSearch,{...n})??void 0;f={...n,...e},h={...r,...e}}catch(e){let r=e;if(e instanceof mt||(r=new mt(e.message,{cause:e})),t?.throwOnError)throw r;f=n,h={},g=r}}let _=``,v=``;try{_=i.options.loaderDeps?.({search:f})??``,v=_&&JSON.stringify(_)||``}catch(e){if(t?.throwOnError)throw e;g??=e}let y=o(),b=i._interpolation?ne(i.fullPath,i._interpolation,r,this.pathParamsDecoder,y):i.fullPath,x=i.id+b+v,S=p(i,n),C=this._cache.get(x)??(S?.id===x?S:void 0);m=C?._strictParams??Object.assign(y,m);let w;if(!C)try{Ct(i,m)}catch(e){if(w=ie(e)||De(e)?e:new ht(e.message,{cause:e}),t?.throwOnError)throw w}let T=S?`stay`:`enter`,E;if(C)E={...C,cause:T,search:s(S?S.search:C.search,f),_strictSearch:h,searchError:g};else{let e=st(i)?`pending`:`success`;E={id:x,ssr:i.options.ssr,index:n,routeId:i.id,params:S?.params??m,_strictParams:m,pathname:b,updatedAt:Date.now(),search:S?s(S.search,f):f,_strictSearch:h,searchError:g,status:e,isFetching:!1,error:void 0,paramsError:w,context:{},abortController:t?._controller??new AbortController,cause:T,loaderDeps:S?c(S.loaderDeps,_):_,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let D=u===i.id;E._notFound&&!D&&(E.error=void 0),E._notFound=D,d[n]=E}for(let e=0;e<d.length;e++){let n=d[e];n.params=n.cause===`stay`?s(n.params,m):m,t?._controller&&(n.context={})}return d}matchRoutesLightweight(e){let t=n(this.stores.ids.get()),r=t?this.stores.byRoute.get(t).get():void 0,i=r?.id,a=this.lightweightCache.get(e);if(a&&a[0]===i)return a[1];let[o,s]=this.getMatchedRoutes(e.pathname),c=n(o),l={...e.search};for(let e of o)try{Object.assign(l,gt(e.options.validateSearch,l))}catch{}let u=r&&r.routeId===c.id&&r.pathname===e.pathname,d;if(u)d=r.params;else{let e=s;for(let t of o)try{Ct(t,e)}catch{}d=e}let f=[o,c.fullPath,l,d];return this.lightweightCache.set(e,[i,f]),f}};async function pt(e,t,{replace:n,ignoreBlocker:r}){if(!v(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var mt=class extends Error{},ht=class extends Error{};function gt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new mt(`Async validation not supported`);if(n.issues)throw new mt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function _t(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function vt(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!i.call(e,t[1]))}var yt=Object.freeze({});function bt(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=gt(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function xt(e,t,n){let i=(t,a,o)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return a;let e=r(n.search,a);return o&&(o.explicit=e),e}return e[t]({search:a,next:(e,n)=>{if(n){let n=o||{};return{search:i(t+1,e,n),meta:n}}return i(t+1,e,o)},meta:o})};return i(0,t)}function St(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Te}function Ct(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function wt(e,t){return e.options[t]?.preload?.()}function Tt(e,t){let n=wt(e,`component`),r=wt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function z(e,t,n){let r=()=>t===!1?void 0:t?wt(e,t):Tt(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Et(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Dt(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var B=0,V=1,Ot=2,H=3,U=[4];function W(e){return typeof e[0]==`number`}function G(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function K(e,t){return e.routesById[t.routeId]}function q(e,t,n){return De(e)?[H,e]:ie(e)?(e.routeId||=n,[Ot,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[V,e]):[B,e]}function kt(e,t){let n=q(t,!0,e.id);if(n[0]!==V)return n;try{e.options.onError?.(n[1])}catch(t){n=q(t,!0,e.id)}return n}function J(e,t,n,r,i){return i[0].signal.aborted?U:Vt(e,t,n,kt(n,r),i)}async function At(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=K(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return Y(e,r),[i,J(e,t,u,a,n)]}if(c.aborted)return[i,U];let p=r.paramsError??r.searchError;if(p!==void 0)return Y(e,r),[i,J(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{Z(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?G(a,c):a);if(c.aborted)return[i,U];let s=Vt(e,t,u,q(o,!1,u.id),n);if(s[0]!==B)return Y(e,r),[i,s];r.context={...r.context,...o}}catch(a){return Y(e,r),[i,J(e,t,u,a,n)]}finally{r.status=h,Z(e,r,!1,n[0])}}i()}function jt(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function Y(e,t){let n=t._flight;t._flight=void 0,jt(e,t,n)?.abort()}function X(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=jt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Mt(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Z(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Nt(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Pt(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return U;if(!i)return[B,void 0];let l=n._flight;Z(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Nt(e,t,n,r,s,a,!!o[3]))).then(e=>q(e,!1,r.id),e=>q(e,!0,r.id)).then(t=>(t[0]!==B&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===V&&l[2]?kt(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Vt(e,t,r,await G(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return Y(e,n),U}finally{Z(e,n,!1,s)}}function Ft(e,t,n){t[0]!==H&&(e.status=`success`,e.error=void 0,t[0]===B?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function It(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&Y(e,r)}function Lt(e,t){return t[0]===V||t[0]===Ot?{...e,status:t[0]===V?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Rt(e,t,n,r,i,a,o){let s=t[1][n],c=K(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Nt(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=U)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,Y(e,s),p=J(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,jt(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?Pt(e,t,s,c,g,i,a).then(t=>(Ft(s,t,l),t[0]===B&&(m&&!a[0].signal.aborted&&It(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[B,s.loaderData]),T=(async()=>{try{let e=z(c,void 0,C);e&&await G(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,J(e,t,c,r,a)]}let r=await w;x&&r[0]===B&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>Lt(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=Pt(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,Ft(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>Lt(E,e))}async function zt(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=K(e,t[n]);try{let e=z(i,!1);e&&await G(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Q(e,t){t[2]&&=(X(e,t[2].map(e=>e[3])),void 0)}async function Bt(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=H)throw[a,t];!i&&t[0]!==B&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===H)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Vt(e,t,n,r,i,a){for(;r[0]===H;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[H,t]:[H,t,a]}return[H,o,n]}catch(e){r=a?[V,e]:kt(n,e),a=!0}}return r}async function Ht(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Ot?zt(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=H)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==B&&t[0]<H&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=H){let n=s[1];if(n[0]!==H||n[1].options.reloadDocument||n[2])return Q(e,t),n;c=!0,s=[0,[V,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===V?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=K(e,u);try{await G(i?Promise.resolve().then(()=>z(m,l===V?`errorComponent`:`notFoundComponent`)):Promise.all([z(m),z(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Q(e,t),U}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Q(e,t),X(e,o),p()):u.status=`success`}return t}async function Ut(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=K(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await G(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Wt(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await zt(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=Rt(e,i,t,u,f,r,l)},m=await At(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Ot){let t=await zt(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=H&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Ht(e,i,u,r[0],Bt(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Bt(i[2],void 0,void 0,h.then(e=>W(e)?0:Et(n).length,()=>0))),o=await h}catch(t){if(Q(e,i),t===a&&a.aborted)return U;throw t}return W(o)?o:Ut(e,o,a,r[6]===n.length?r[6]:0)}function Gt(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=K(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Gt(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function $(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Kt(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Et(t[3]).some(e=>e.id===n[1]))return;let i;try{await G(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function qt(e,t){e._committed=t,e.stores.setMatches(t)}function Jt(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Et(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=K(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=ut(n);qt(e,n),X(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),dt(e,i,n,a,l,t)}async function Yt(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Xt(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Zt(e,t,n,r,i){let a=n.map(e=>({...e}));Mt(a);for(let t of r)Y(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Ht(e,o,r,t[0],i)}catch(t){throw X(e,a),t}if(W(s))X(e,a),s[0]===H&&e._tx===t&&e._committed===n&&await Xt(e,t,s);else if(await Ut(e,s,t[0].signal),e._tx!==t||e._committed!==n)X(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),Y(e,n))}qt(e,a),X(e,n,a)}}async function Qt(e,t,n,r,i,a){let o=await Wt(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(W(o)){let n=o[0]===H&&e._tx===t;if((!n||o[1].options.reloadDocument)&&$(e,t),X(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){$(e,t);return}await Xt(e,t,o);return}let s=o[1];if(e._tx===t&&await Kt(e,t),e._tx!==t){$(e,t),X(e,s),Q(e,o);return}let c=t[2],l=ct(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Kt(e,t),e._tx!==t){$(e,t),X(e,s),Q(e,o);return}let n=await e.startTransition(()=>{$(e,t),Jt(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&Zt(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):Q(e,o)})}async function $t(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=ct(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Yt(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});Mt(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){X(e,m),await Yt(e,n);return}e._preflight=void 0;let g,_=()=>Qt(e,y,f,()=>Gt(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>Yt(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&Z(e,t,!1)}n[0].abort(),X(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Gt(e,y),g?.(_()),await y[5]):(X(e,y[3]),y[3]=[],g?.(),await Yt(e,y))}async function en(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),Mt(a),o=(e._preloads??=new Map).set(i,a),s=await Wt(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),X(e,a)),i.abort()}if(!W(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){ie(e)||console.error(e);return}}}var tn=t(e(),1);function nn(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Dt(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var rn=tn.createContext(void 0),an=tn.createContext(void 0);export{c as C,d as S,u as _,ct as a,a as b,Ee as c,re as d,C as f,S as g,T as h,ft as i,Te as l,w as m,an as n,qe as o,D as p,rn as r,Je as s,nn as t,ie as u,r as v,v as x,g as y};
@@ -0,0 +1 @@
1
+ import{a as e}from"./queries-BwtMk72-.js";import{A as t,Gt as n,J as r,g as i,o as a,p as o,qt as s}from"./strings-qxNeGv33.js";var c=(e,t)=>{if(e.attempts.length===0)return n();let r=0;for(let i of e.attempts){let e=i.outcome===null?t:i.endedAt===null?NaN:Date.parse(i.endedAt);if(Number.isNaN(e))return n();r+=Math.max(0,e-Date.parse(i.startedAt))}return s(r)},l=e=>{let t=e.attempts.at(-1)?.outcome;return e.state===`Failed`&&t?._tag===`Failed`?s(t.failure):n()},u=e=>{let t=e.attempts.at(-1);return e.closedAt??t?.endedAt??t?.startedAt??e.openedAt},d=(e,t)=>{let n=new Set(t.items.map(({itemKey:e})=>e));return e.filter(({item:e})=>n.has(e.itemKey))},f=(e,t)=>d(e,t)[0]??null,p=({reason:e})=>`run`in e?e.run:null,m=t=>String(e(t).origin.number),h=({reason:e})=>r(e,{AwaitingApproval:()=>!0,WaitingForStop:()=>!0,QueuedForWorker:()=>!0,SuppressedForOperator:()=>!0,CycleBudgetUsedUp:()=>!0,RunFailed:({run:e})=>e.canResolveFailure,ClosedUnchanged:()=>!1,LoopPaused:()=>!1,AwaitingPoll:()=>!1}),g=(e,...t)=>[...e].reverse().find(({state:e})=>t.includes(e)),_=(e,n,r)=>{let i=g(e.runs,`Running`);if(i!==void 0)return{_tag:`Running`,run:i};let a=g(e.runs,`Waiting`);if(a!==void 0)return{_tag:`AwaitingApproval`,run:a};let o=g(e.runs,`Pending`,`Queued`);if(o!==void 0){let e=r.find(e=>p(e)?.id===o.id);return e===void 0?{_tag:`Queued`,run:o}:{_tag:`Stalled`,stall:e,run:o}}if(t(e.state))return{_tag:`Done`};let s=d(r,e),c=s.find(h);if(c!==void 0)return{_tag:`Stalled`,stall:c,run:p(c)??n};let[l]=s;return l===void 0?e.needsYou?{_tag:`NeedsAttention`}:{_tag:`Ended`,run:n}:{_tag:`Idle`,stall:l}},v=({status:e,last:t})=>{switch(e._tag){case`Running`:return[0,Date.parse(e.run.openedAt)];case`AwaitingApproval`:return[1,Date.parse(e.run.openedAt)];case`Queued`:case`Stalled`:return[2,Date.parse(e.run.openedAt)];case`Idle`:case`NeedsAttention`:case`Done`:case`Ended`:return[3,Date.parse(u(t))]}},y=(e,t)=>e.flatMap(({items:e})=>e).flatMap(e=>{let n=e.runs.at(-1);return n===void 0?[]:[{task:e,last:n,status:_(e,n,t)}]}).map(e=>({row:e,place:v(e)})).sort(({row:e,place:[t,n]},{row:r,place:[i,a]})=>t-i||a-n||r.task.number-e.task.number).map(({row:e})=>e),b=[`in flight`,`needs attention`,`done`],x=({task:e,status:t})=>{switch(t._tag){case`Running`:case`AwaitingApproval`:case`Queued`:case`Stalled`:return`in flight`;case`Idle`:return e.needsYou?`needs attention`:null;case`NeedsAttention`:return`needs attention`;case`Done`:return`done`;case`Ended`:return null}},S=e=>{let t=b.flatMap(t=>{let n=e.filter(e=>x(e)===t).length;return n===0?[]:[`${n} ${t}`]});return t.length===0?void 0:t.join(`, `)},C=(e,t)=>e.runningSince.reduce((e,n)=>e+Math.max(0,t-Date.parse(n)),e.durationMillis),w=e=>e.pools.some(({unpriced:e})=>e),T=(e,t)=>{let n=e.flatMap(({task:e})=>e.usage.cost===null?[]:[e.usage.cost]);return{runs:e.reduce((e,{task:t})=>e+t.runs.length,0),durationMillis:e.reduce((e,{task:n})=>e+C(n.usage,t),0),unmeasured:e.reduce((e,{task:t})=>e+t.usage.unmeasured,0),tokens:e.reduce((e,{task:t})=>e+t.usage.tokens,0),unpriced:e.some(({task:e})=>w(e.usage)),usd:n.length===0?null:n.reduce((e,{usd:t})=>e+t,0)}},E=`Some attempts have no recorded timing; the real figure is higher`,D=`Some sessions have no price yet; the real figure is higher`,O=e=>[{figure:String(e.runs),words:e.runs===1?`run`:`runs`,lowerBound:null},{figure:a(e.durationMillis),words:`elapsed`,lowerBound:e.unmeasured>0?E:null},{figure:o(e.tokens),words:`tokens`,lowerBound:null},...e.usd===null?[]:[{figure:i(e.usd),words:`estimated`,lowerBound:e.unpriced?D:null}]],k=e=>{let t=new Map;for(let{loop:n,state:r}of e.runs)t.set(n,r);return[...t].map(([e,t])=>({loop:e,state:t}))},A=e=>{switch(e){case`issue-comment`:return`Comment`;case`review`:return`Review`;case`review-comment`:return`Review comment`}};export{l as a,C as c,y as d,f,E as g,D as h,u as i,k as l,O as m,A as n,p as o,T as p,w as r,S as s,c as t,m as u};
@@ -0,0 +1 @@
1
+ import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{D as n,k as r}from"./page-BuzrT_cg.js";import{d as i}from"./error-alert-NXb1Z8Xz.js";import{vn as a}from"./queries-BwtMk72-.js";import{l as o,n as s}from"./overview-BdUgx_pE.js";import{W as c}from"./button-4rhhIcK8.js";import{A as l,G as u,q as d,v as f}from"./strings-qxNeGv33.js";var p=t(e(),1),m=new Map([[`bold`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z`}))],[`duotone`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z`,opacity:`0.2`}),p.createElement(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`}))],[`fill`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z`}))],[`light`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z`}))],[`regular`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`}))],[`thin`,p.createElement(p.Fragment,null,p.createElement(`path`,{d:`M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z`}))]]),h=p.forwardRef((e,t)=>p.createElement(c,{ref:t,...e,weights:m}));h.displayName=`ArrowSquareOutIcon`;var g=(e,t)=>t.canResolveFailure&&!e.items.some(({itemKey:e,state:n})=>e===t.itemKey&&l(n)),_=e=>{let t=[...e.runs].reverse().find(t=>g(e,t));if(t===void 0)return null;let n=t.attempts;for(let e=n.length-1;e>=0;--e){let r=n[e]?.outcome;if(r?._tag===`Failed`)return{run:t,message:o(r.failure)}}return null},v=new Set(u),y=e=>{let t=e.run;return t!==null&&(v.has(t.state)||g(e,t))?t:null},b=e=>{let t=e.attempts.at(-1);switch(e.state){case`Pending`:case`Waiting`:case`Queued`:return e.openedAt;case`Running`:return t!==void 0&&t.outcome===null?t.startedAt:null;case`Failed`:return t?.endedAt??null;case`Succeeded`:case`Canceled`:return null}},x=(e,t)=>{let n=new Set(t._tag===`WritableBoardLane`?t.labels:[]);for(let e of t.sources)`label`in e&&n.add(e.label);return e.labels.filter(e=>!n.has(e))},S=e=>e===`saving`?`Moving…`:`Saved on GitHub · syncing…`,C=e=>[`board-moves`,e],w=(e,t)=>{if(e.phase===`saving`)return!0;let n=t.flatMap(({items:e})=>e).find(({itemKey:t})=>t===e.itemKey);if(n===void 0||n.state!==e.source.state)return!1;let r=n.labels.filter(t=>e.laneLabels.includes(t));return r.length===e.source.labels.length&&r.every(t=>e.source.labels.includes(t))},T=e=>{let t=r(),{data:o=[]}=a({queryKey:C(e.repository),queryFn:n,initialData:[],gcTime:1/0}),c=(e,n)=>t.setQueryData(C(e),(e=[])=>n(e)),l=o.filter(t=>w(t,e.board.lanes));a({...s(),enabled:l.length>0,refetchInterval:1e3}),(0,p.useEffect)(()=>{t.setQueryData(C(e.repository),t=>{let n=t?.filter(t=>w(t,e.board.lanes));return n?.length===t?.length?t:n})},[t,e.repository,e.board.lanes,o]);let u=i({mutationFn:({repository:e,item:t,toLane:n})=>{let{owner:r,name:i}=d(e);return f(e=>e.moveBoardItem({params:{owner:r,repository:i,item:t},payload:{toLane:n}}))},onSuccess:(e,{repository:n,itemKey:r})=>(c(n,e=>e.map(e=>e.itemKey===r?{...e,phase:`syncing`}:e)),t.invalidateQueries({queryKey:s().queryKey})),onError:(e,{repository:n,itemKey:r})=>(c(n,e=>e.filter(e=>e.itemKey!==r)),t.invalidateQueries({queryKey:s().queryKey}))}),m=(t,n)=>{let r=e.board.lanes.find(({items:e})=>e.some(({itemKey:e})=>e===t.itemKey)),i=r?.items.find(({itemKey:e})=>e===t.itemKey);if(n._tag!==`WritableBoardLane`||i===void 0||r?.id===n.id||l.some(({itemKey:e})=>e===t.itemKey))return;let a=e.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[]);c(e.repository,e=>[...e,{itemKey:t.itemKey,toLane:n.id,source:{state:i.state,labels:i.labels.filter(e=>a.includes(e))},laneLabels:a,phase:`saving`}]),u.mutate({repository:e.repository,itemKey:t.itemKey,item:t.number,toLane:n.id})},h=u.variables?.repository===e.repository;return{moves:l,moveItem:m,isPending:h&&u.isPending,error:h?u.error:null}};export{b as a,y as i,S as n,_ as o,x as r,h as s,T as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./useRouter-Hur3RN7j.js";import{r as t}from"./overview-BdUgx_pE.js";import{t as n}from"./link-C7GfYrMt.js";import{t as r}from"./boot-screen-Su4MyrBh.js";import{t as i}from"./button-4rhhIcK8.js";var a=`Task not found`,o=(e,t)=>`#${t} is not among the newest items on the ${e} board`,s=`Back to the board`,c=e(),l=({repository:e,number:l})=>(0,c.jsx)(r,{title:a,description:o(e,l),tone:`error`,inPanel:!0,children:(0,c.jsx)(i,{variant:`outline`,nativeButton:!1,render:(0,c.jsx)(n,{to:`/projects/$owner/$name`,params:t(e)}),children:s})});export{l as t};
@@ -0,0 +1,5 @@
1
+ import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{n as r,r as i}from"./page-BuzrT_cg.js";import{t as a,u as o}from"./error-alert-NXb1Z8Xz.js";import{a as s,c,s as l}from"./queries-BwtMk72-.js";import{D as u,O as d,c as f,f as p,h as m,l as h,m as ee,u as g,y as _}from"./overview-BdUgx_pE.js";import{d as te,i as ne,n as re,r as ie,t as ae,u as oe}from"./dropdown-menu-B5_S4hH-.js";import{D as v,W as y,t as b}from"./button-4rhhIcK8.js";import{$ as se,Bt as ce,E as le,Ft as x,Gt as S,Ht as ue,It as C,J as w,Jt as de,Kt as T,Lt as E,Pt as fe,Q as pe,Rt as me,St as he,Ut as D,Wt as O,Y as k,at as A,bt as ge,ct as _e,f as ve,gt as ye,it as be,n as xe,nt as Se,o as j,ot as M,pt as N,qt as P,r as F,rt as Ce,tt as we,ut as I,wt as Te,zt as Ee}from"./strings-qxNeGv33.js";import{A as De,M as Oe,at as ke,j as Ae,rt as je,st as Me}from"./index-CPkHl5O3.js";import{t as Ne}from"./use-now-vNgLntlV.js";import{t as Pe}from"./heading-Bp50m3v1.js";import{t as Fe}from"./pull-request-marks-BLxcb-0V.js";import{n as L}from"./status-badge-CLPsMXtK.js";import{n as Ie}from"./usage-Bu-ewmBl.js";import{t as Le}from"./markdown-BNebzGGH.js";var R=n(e(),1),Re=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M188,86.11V84c0-14.62-10.83-27.55-30.51-36.4C140.87,40.12,119,36,96,36S51.13,40.12,34.51,47.6C14.83,56.45,4,69.38,4,84v40c0,14.62,10.83,27.55,30.51,36.4A131.67,131.67,0,0,0,68,169.88V172c0,14.62,10.83,27.55,30.51,36.4C115.13,215.88,137,220,160,220s44.87-4.12,61.49-11.6C241.17,199.55,252,186.62,252,172V132C252,109.86,226.71,92.08,188,86.11ZM228,132c0,7.75-21.77,22.48-61.81,23.88C180.33,147.4,188,136.3,188,124V110.44C213.88,115.15,228,125.48,228,132ZM107.37,147.63c-3.63.24-7.42.37-11.37.37-5.08,0-9.89-.22-14.43-.61a10.94,10.94,0,0,0-1.14-.09c-1.51-.14-3-.3-4.43-.48V130.93A187,187,0,0,0,96,132a187,187,0,0,0,20-1.07v15.89c-2.49.3-5.07.56-7.75.75C108,147.58,107.66,147.6,107.37,147.63ZM164,117.14V124c0,4.78-8.28,12.21-24,17.54v-15a115.32,115.32,0,0,0,17.49-6.13Q160.93,118.86,164,117.14ZM96,60c44,0,68,15.85,68,24s-24,24-68,24S28,92.15,28,84,52,60,96,60ZM28,124v-6.86q3.08,1.71,6.51,3.26A115.32,115.32,0,0,0,52,126.53v15C36.28,136.21,28,128.78,28,124Zm64,48v0c1.33,0,2.66,0,4,0q5.44,0,10.77-.32,4.45,1.57,9.23,2.86v15C100.28,184.21,92,176.78,92,172Zm48,22.82V178.94A186.45,186.45,0,0,0,160,180a187,187,0,0,0,20-1.07v15.89a170.08,170.08,0,0,1-40,0Zm64-5.28v-15a115.32,115.32,0,0,0,17.49-6.13q3.44-1.54,6.51-3.26V172C228,176.78,219.72,184.21,204,189.54Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M240,132c0,19.88-35.82,36-80,36-19.6,0-37.56-3.17-51.47-8.44h0C146.76,156.85,176,142,176,124V96.72h0C212.52,100.06,240,114.58,240,132ZM176,84c0-19.88-35.82-36-80-36S16,64.12,16,84s35.82,36,80,36S176,103.88,176,84Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M184,89.57V84c0-25.08-37.83-44-88-44S8,58.92,8,84v40c0,20.89,26.25,37.49,64,42.46V172c0,25.08,37.83,44,88,44s88-18.92,88-44V132C248,111.3,222.58,94.68,184,89.57ZM232,132c0,13.22-30.79,28-72,28-3.73,0-7.43-.13-11.08-.37C170.49,151.77,184,139,184,124V105.74C213.87,110.19,232,122.27,232,132ZM72,150.25V126.46A183.74,183.74,0,0,0,96,128a183.74,183.74,0,0,0,24-1.54v23.79A163,163,0,0,1,96,152,163,163,0,0,1,72,150.25Zm96-40.32V124c0,8.39-12.41,17.4-32,22.87V123.5C148.91,120.37,159.84,115.71,168,109.93ZM96,56c41.21,0,72,14.78,72,28s-30.79,28-72,28S24,97.22,24,84,54.79,56,96,56ZM24,124V109.93c8.16,5.78,19.09,10.44,32,13.57v23.37C36.41,141.4,24,132.39,24,124Zm64,48v-4.17c2.63.1,5.29.17,8,.17,3.88,0,7.67-.13,11.39-.35A121.92,121.92,0,0,0,120,171.41v23.46C100.41,189.4,88,180.39,88,172Zm48,26.25V174.4a179.48,179.48,0,0,0,24,1.6,183.74,183.74,0,0,0,24-1.54v23.79a165.45,165.45,0,0,1-48,0Zm64-3.38V171.5c12.91-3.13,23.84-7.79,32-13.57V172C232,180.39,219.59,189.4,200,194.87Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M184,89.57V84c0-25.08-37.83-44-88-44S8,58.92,8,84v40c0,20.89,26.25,37.49,64,42.46V172c0,25.08,37.83,44,88,44s88-18.92,88-44V132C248,111.3,222.58,94.68,184,89.57ZM56,146.87C36.41,141.4,24,132.39,24,124V109.93c8.16,5.78,19.09,10.44,32,13.57Zm80-23.37c12.91-3.13,23.84-7.79,32-13.57V124c0,8.39-12.41,17.4-32,22.87Zm-16,71.37C100.41,189.4,88,180.39,88,172v-4.17c2.63.1,5.29.17,8,.17,3.88,0,7.67-.13,11.39-.35A121.92,121.92,0,0,0,120,171.41Zm0-44.62A163,163,0,0,1,96,152a163,163,0,0,1-24-1.75V126.46A183.74,183.74,0,0,0,96,128a183.74,183.74,0,0,0,24-1.54Zm64,48a165.45,165.45,0,0,1-48,0V174.4a179.48,179.48,0,0,0,24,1.6,183.74,183.74,0,0,0,24-1.54ZM232,172c0,8.39-12.41,17.4-32,22.87V171.5c12.91-3.13,23.84-7.79,32-13.57Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M224.56,103.81C213.43,97.75,198.47,93.39,182,91.34V84c0-12.12-9.58-23.1-27-30.93C139.16,45.93,118.2,42,96,42S52.84,45.93,37,53.07C19.58,60.9,10,71.88,10,84v40c0,12.12,9.58,23.1,27,30.93,10.49,4.72,23.21,8,37,9.73V172c0,12.12,9.58,23.1,27,30.93C116.84,210.07,137.8,214,160,214s43.16-3.93,59-11.07c17.39-7.83,27-18.81,27-30.93V132C246,121.35,238.39,111.34,224.56,103.81Zm-5.74,10.54C228.61,119.68,234,126,234,132c0,14.19-30.39,30-74,30a166.9,166.9,0,0,1-21.21-1.34A110.79,110.79,0,0,0,155,154.93c17.39-7.83,27-18.81,27-30.93V103.43C196.4,105.36,209.3,109.16,218.82,114.35ZM108.16,153.58c-3.92.27-8,.42-12.16.42-5.3,0-10.4-.24-15.28-.67a2.22,2.22,0,0,0-.37,0c-3.58-.33-7-.77-10.35-1.3V124.12A178,178,0,0,0,96,126a178,178,0,0,0,26-1.88V152c-4.34.69-8.91,1.22-13.69,1.56ZM170,105.89V124c0,9.54-13.75,19.8-36,25.51V121.85a115,115,0,0,0,21-6.92A66.2,66.2,0,0,0,170,105.89ZM96,54c43.61,0,74,15.81,74,30s-30.39,30-74,30S22,98.19,22,84,52.39,54,96,54ZM22,124V105.89a66.2,66.2,0,0,0,15,9,115,115,0,0,0,21,6.92v27.66C35.75,143.8,22,133.54,22,124Zm64,48v-6.28c3.3.18,6.63.28,10,.28q5.91,0,11.66-.37A123.17,123.17,0,0,0,122,169.84v27.67C99.75,191.8,86,181.54,86,172Zm48,28V172.1a177.84,177.84,0,0,0,26,1.9,178,178,0,0,0,26-1.88V200a170,170,0,0,1-52,0Zm64-2.49V169.85a115,115,0,0,0,21-6.92,66.2,66.2,0,0,0,15-9V172C234,181.54,220.25,191.8,198,197.51Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M184,89.57V84c0-25.08-37.83-44-88-44S8,58.92,8,84v40c0,20.89,26.25,37.49,64,42.46V172c0,25.08,37.83,44,88,44s88-18.92,88-44V132C248,111.3,222.58,94.68,184,89.57ZM232,132c0,13.22-30.79,28-72,28-3.73,0-7.43-.13-11.08-.37C170.49,151.77,184,139,184,124V105.74C213.87,110.19,232,122.27,232,132ZM72,150.25V126.46A183.74,183.74,0,0,0,96,128a183.74,183.74,0,0,0,24-1.54v23.79A163,163,0,0,1,96,152,163,163,0,0,1,72,150.25Zm96-40.32V124c0,8.39-12.41,17.4-32,22.87V123.5C148.91,120.37,159.84,115.71,168,109.93ZM96,56c41.21,0,72,14.78,72,28s-30.79,28-72,28S24,97.22,24,84,54.79,56,96,56ZM24,124V109.93c8.16,5.78,19.09,10.44,32,13.57v23.37C36.41,141.4,24,132.39,24,124Zm64,48v-4.17c2.63.1,5.29.17,8,.17,3.88,0,7.67-.13,11.39-.35A121.92,121.92,0,0,0,120,171.41v23.46C100.41,189.4,88,180.39,88,172Zm48,26.25V174.4a179.48,179.48,0,0,0,24,1.6,183.74,183.74,0,0,0,24-1.54v23.79a165.45,165.45,0,0,1-48,0Zm64-3.38V171.5c12.91-3.13,23.84-7.79,32-13.57V172C232,180.39,219.59,189.4,200,194.87Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M180,93.11V84c0-22.43-36.9-40-84-40S12,61.57,12,84v40c0,19.14,26.86,34.72,64,38.89V172c0,22.43,36.9,40,84,40s84-17.57,84-40V132C244,113.12,217.87,97.37,180,93.11ZM236,132c0,15.45-30.54,32-76,32a165.71,165.71,0,0,1-28-2.34v-1.39c28.61-6.31,48-20,48-36.27V101.17C212.22,105,236,117.93,236,132ZM108.19,155.59Q102.3,156,96,156c-5.47,0-10.72-.25-15.73-.69l-.27,0h0c-4.16-.38-8.16-.9-12-1.56V121.8A174.87,174.87,0,0,0,96,124a174.87,174.87,0,0,0,28-2.2v31.92a155,155,0,0,1-15.52,1.85ZM172,101.32V124c0,10.88-15.16,22.3-40,28.11V120.27C149.63,116.38,163.75,109.69,172,101.32ZM96,52c45.46,0,76,16.55,76,32s-30.54,32-76,32S20,99.45,20,84,50.54,52,96,52ZM20,124V101.32c8.25,8.37,22.37,15.06,40,19v31.84C35.16,146.3,20,134.88,20,124Zm64,48v-8.4c3.91.26,7.92.4,12,.4s8.06-.14,12-.39a123.93,123.93,0,0,0,16,4.63v31.87C99.16,194.3,84,182.88,84,172Zm48,29.72V169.77A174.48,174.48,0,0,0,160,172a174.87,174.87,0,0,0,28-2.2v31.92a173.07,173.07,0,0,1-56,0ZM236,172c0,10.88-15.16,22.3-40,28.11V168.27c17.63-3.89,31.75-10.58,40-19Z`}))]]),ze=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,44a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,44Zm0,168a72,72,0,1,1,72-72A72.08,72.08,0,0,1,128,212ZM164.49,99.51a12,12,0,0,1,0,17l-28,28a12,12,0,0,1-17-17l28-28A12,12,0,0,1,164.49,99.51ZM92,16A12,12,0,0,1,104,4h48a12,12,0,0,1,0,24H104A12,12,0,0,1,92,16Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,136a88,88,0,1,1-88-88A88,88,0,0,1,216,136Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm0,176a80,80,0,1,1,80-80A80.09,80.09,0,0,1,128,216ZM173.66,90.34a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32l40-40A8,8,0,0,1,173.66,90.34ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm45.66,61.66-40,40a8,8,0,0,1-11.32-11.32l40-40a8,8,0,0,1,11.32,11.32ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,42a94,94,0,1,0,94,94A94.11,94.11,0,0,0,128,42Zm0,176a82,82,0,1,1,82-82A82.1,82.1,0,0,1,128,218ZM172.24,91.76a6,6,0,0,1,0,8.48l-40,40a6,6,0,1,1-8.48-8.48l40-40A6,6,0,0,1,172.24,91.76ZM98,16a6,6,0,0,1,6-6h48a6,6,0,0,1,0,12H104A6,6,0,0,1,98,16Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,40a96,96,0,1,0,96,96A96.11,96.11,0,0,0,128,40Zm0,176a80,80,0,1,1,80-80A80.09,80.09,0,0,1,128,216ZM173.66,90.34a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32l40-40A8,8,0,0,1,173.66,90.34ZM96,16a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,16Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,44a92,92,0,1,0,92,92A92.1,92.1,0,0,0,128,44Zm0,176a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,220ZM170.83,93.17a4,4,0,0,1,0,5.66l-40,40a4,4,0,1,1-5.66-5.66l40-40A4,4,0,0,1,170.83,93.17ZM100,16a4,4,0,0,1,4-4h48a4,4,0,0,1,0,8H104A4,4,0,0,1,100,16Z`}))]]),Be=R.forwardRef((e,t)=>R.createElement(y,{ref:t,...e,weights:Re}));Be.displayName=`CoinsIcon`;var Ve=R.forwardRef((e,t)=>R.createElement(y,{ref:t,...e,weights:ze}));Ve.displayName=`TimerIcon`;var He=M({number:Ce,title:A,url:A,state:A,body:ge(Se(A)),author:ge(Se(M({login:A}))),labels:ge(M({nodes:k(M({name:A}))}))}),Ue=_e(le),We=I(He),z=e=>D(We(e),e=>({kind:e.url.includes(`/pull/`)?`Pull request`:`Issue`,number:e.number,title:e.title,url:e.url,state:e.state.charAt(0)+e.state.slice(1).toLowerCase(),author:E(e.author?.login),labels:e.labels?.nodes.map(({name:e})=>e)??[],body:x(E(e.body),e=>e.trim()!==``)})),Ge=new Map([[`Issue Open`,`issue-open`],[`Issue Closed`,`issue-closed`],[`Pull request Open`,`pr-open`],[`Pull request Closed`,`pr-closed`],[`Pull request Merged`,`pr-merged`]]),Ke=({kind:e,number:t,url:n,state:r})=>({kind:e===`Pull request`?`pr`:`issue`,number:t,url:n,state:Ge.get(`${e} ${r}`)??null}),qe=(e,t,n)=>D(Ue(e.itemKey),([,r,i])=>{let a=ce(C(c(t,e.itemKey),({items:t})=>E(t.find(({itemKey:t})=>t===e.itemKey)))),o=ce(x(n===void 0?S():z(n),e=>e.number===i));return{number:i,url:a?.url??o?.url??`https://github.com/${r}/issues/${i}`,title:E(a?.title??o?.title),pullRequest:a===void 0?o?.kind===`Pull request`:a.kind===`pr`}}),Je=(e,t)=>O(z(t),{onNone:()=>`Opened by ${e}`,onSome:({kind:t,number:n,state:r,labels:i})=>`${e} matched ${t.toLowerCase()} #${n}: ${r.toLowerCase()}${i.length===0?``:`, labeled ${i.join(`, `)}`}`}),Ye=(e,t,n,r)=>{let i=D(n,s),a=O(n,{onNone:()=>[],onSome:({items:e})=>e}),o=C(E(e.pullRequestUrl),e=>l(e,a)),c=D(t,({number:e,url:t,pullRequest:n})=>a.find(t=>t.number===e)??{kind:r===null?n||fe(o,t=>t.number===e)?`pr`:`issue`:r.startsWith(`pr-`)?`pr`:`issue`,number:e,url:t,state:r}),u=O(i,{onNone:()=>c,onSome:({origin:e})=>P(e)});return{heading:u,title:D(i,({origin:e})=>e.title),pullRequest:x(T(o,()=>x(c,({kind:e})=>e===`pr`)),e=>!fe(u,({number:t})=>t===e.number))}},B=t(),Xe=(e,t)=>me(C(t,({title:e})=>e),()=>`${e.loop} on ${e.repository}`),Ze=({endedMillis:e,since:t})=>{let n=Ne(1e3);return(0,B.jsx)(B.Fragment,{children:j(e+Math.max(0,n-Date.parse(t)))})},Qe=({duration:e})=>(0,B.jsxs)(`span`,{title:e.unmeasured===0?`Total attempt time`:`${e.unmeasured} ${e.unmeasured===1?`attempt`:`attempts`} not counted: no recorded end time`,className:`font-mono text-xs tabular-nums`,children:[e.unmeasured>0&&`at least `,e.runningSince===null?j(e.endedMillis):(0,B.jsx)(Ze,{endedMillis:e.endedMillis,since:e.runningSince})]}),$e=({detail:e})=>{let{machine:t,run:n}=e;return t===null||t.state!==`ready`||t.id===null||t.attemptId===null||t.attemptId!==n.attempts.at(-1)?.id?null:(0,B.jsx)(`span`,{className:`font-mono text-xs`,title:`${u[t.provider]} ${d[t.provider]} ${t.id}`,children:t.id})},et=({detail:e,overview:t,placement:n,shared:a,actions:o,as:s,className:l})=>{let{run:u}=e,d=qe(u,t,e.eventPayload),f=Ye(u,d,c(t,u.itemKey),e.settledItemState);return(0,B.jsx)(i,{actionsBeside:n===`page`?`lg`:`never`,...l===void 0?{}:{className:l},eyebrow:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(r,{icon:Me,title:`Loop`,children:u.loop}),(0,B.jsx)(r,{icon:je,title:`Agent`,children:u.agent})]}),heading:(0,B.jsx)(Pe,{variant:`page`,item:f.heading,title:me(f.title,()=>Xe(u,d)),...s===void 0?{}:{as:s},...a?{style:{viewTransitionName:`run-title`}}:{}}),facts:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-2 font-medium text-foreground`,style:a?{viewTransitionName:`run-state`}:void 0,children:[(0,B.jsx)(L,{state:u.state}),_(u,e.unconfirmedStop,e.machine)]}),(0,B.jsx)(Fe,{pullRequests:de(f.pullRequest)}),e.worker!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(r,{icon:Ve,children:(0,B.jsx)(Qe,{duration:e.duration})}),n===`page`&&e.usage.sessions.length>0&&(0,B.jsx)(r,{icon:Be,children:(0,B.jsx)(Ie,{usage:e.usage,attempts:u.attempts})}),(0,B.jsxs)(r,{icon:ke,title:`Worker`,children:[e.worker,(0,B.jsx)($e,{detail:e})]})]}),u.loopPaused&&(0,B.jsx)(`span`,{children:`Loop paused`})]}),actions:o})},V=e=>w(e,{Approve:()=>m.approve,Retry:()=>m.retry,EditRetry:()=>`Edit and retry`,RunAgain:()=>m.runAgain,EditRunAgain:()=>`Edit and run again`,Resolve:({question:e})=>e?`Mark answered`:`Mark resolved`,Cancel:()=>m.cancel}),tt=e=>{let t=e.attempts.at(-1),n=t?.outcome?._tag===`Failed`?t.outcome.failure._tag:null,r=[...e.canApprove?[{_tag:`Approve`}]:[],...e.canRetry?[{_tag:`Retry`},{_tag:`EditRetry`}]:[],...e.canRunAgain?[{_tag:`RunAgain`},{_tag:`EditRunAgain`}]:[],...e.canResolveFailure&&t!==void 0?[{_tag:`Resolve`,attemptId:t.id,question:n===`QuestionFailure`}]:[],...e.canCancel?[{_tag:`Cancel`}]:[]],i=e=>e.flatMap(e=>r.filter(t=>t._tag===e)),a=(()=>{if(e.canApprove){let[e=null]=i([`Approve`]);return{primary:e,secondary:null,more:i([`Cancel`])}}if(e.state===`Failed`){let t=e.canResolveFailure&&(n===`QuestionFailure`||n===`BlockedFailure`),[r=null,a=null,...o]=i(t?[`Resolve`,`EditRetry`,`Retry`]:[`Retry`,`EditRetry`,`Resolve`]);return{primary:r,secondary:a,more:o}}let[t=null,...r]=i(e.canRunAgain?[`RunAgain`,`EditRunAgain`]:[`Cancel`]);return{primary:null,secondary:t,more:r}})(),o=new Set([a.primary,a.secondary,...a.more]);return{...a,more:[...a.more,...r.filter(e=>!o.has(e))]}},nt=({detail:e,onEdit:t,openRun:n,className:r})=>{let{run:i,agentDefinitionChanged:o}=e,s=(0,R.useId)(),c=Ae(),l=Oe(),[u,d]=(0,R.useState)(!1),f=c.isPending||l.isPending,p=e=>c.mutate({runId:i.id,request:e},{onSuccess:()=>d(!1)}),h=e=>w(e,{Approve:()=>p({action:`approve`}),Retry:()=>p({action:`retry`}),EditRetry:()=>t(`retry`),RunAgain:()=>l.mutate(De(i),{onSuccess:e=>{e._tag===`Claimed`&&n(e.runId)}}),EditRunAgain:()=>t(`runAgain`),Resolve:({attemptId:e})=>p({action:`resolveFailure`,attemptId:e}),Cancel:()=>d(!0)}),{primary:g,secondary:_,more:y}=tt(i);return g===null&&_===null&&y.length===0?null:(0,B.jsxs)(`div`,{className:v(`max-w-sm space-y-2`,r),children:[(0,B.jsx)(`div`,{role:`group`,"aria-label":`Run actions`,className:`flex flex-wrap items-center gap-2`,children:u?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(b,{variant:`destructive`,disabled:f,onClick:()=>p({action:`cancel`}),children:m.confirmCancel}),(0,B.jsx)(b,{variant:`ghost`,disabled:f,onClick:()=>d(!1),children:m.keepRunning})]}):(0,B.jsxs)(B.Fragment,{children:[g!==null&&(0,B.jsx)(b,{disabled:f,"aria-describedby":g._tag===`Retry`?s:void 0,onClick:()=>h(g),children:V(g)}),_!==null&&(0,B.jsx)(b,{variant:_._tag===`Cancel`?`ghost`:`outline`,disabled:f,"aria-describedby":_._tag===`Retry`?s:void 0,onClick:()=>h(_),children:V(_)}),y.length>0&&(0,B.jsxs)(ae,{children:[(0,B.jsx)(oe,{disabled:f,render:(0,B.jsx)(b,{variant:`ghost`,size:`icon`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`More actions`,children:(0,B.jsx)(te,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,B.jsx)(re,{align:`end`,className:`w-auto min-w-44`,children:(0,B.jsx)(ie,{children:y.map(e=>(0,B.jsx)(ne,{"aria-describedby":e._tag===`Retry`?s:void 0,variant:e._tag===`Cancel`?`destructive`:`default`,onClick:()=>h(e),children:V(e)},e._tag))})})]})]})}),i.canRetry&&(0,B.jsxs)(`div`,{className:`space-y-1 text-xs wrap-anywhere text-muted-foreground`,children:[(0,B.jsx)(`p`,{id:s,children:ee(i.agentBrain)}),o&&(0,B.jsxs)(`p`,{children:[`The loaded definition of `,i.agent,` has changed. Edit and retry uses the current definition.`]})]}),l.data?._tag===`CycleBlocked`&&(0,B.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),c.isError&&(0,B.jsx)(a,{message:c.error.message}),l.isError&&(0,B.jsx)(a,{message:l.error.message})]})},rt=(e,t,n)=>{let r=new Set(e.map(({sequence:e})=>e)),i=[...new Map([...t,...e].map(e=>[e.sequence,e])).values()].sort((e,t)=>e.sequence-t.sequence),a=new Map,o=new Map,s=(e,t)=>JSON.stringify([e,t]);for(let e of i){let t=e.payload;if(t._tag!==`SessionEvent`)continue;let i=t.event;if(i._tag===`PoolRateLimitsUpdated`||i._tag===`SessionTokensUpdated`)continue;let c=s(e.attemptId,i.session.id),l=a.get(c);l===void 0&&(l={attemptId:e.attemptId,session:i.session,first:e,harnessSession:S(),latestSequence:e.sequence,status:n.has(e.attemptId)?`Stopped`:`Live`,held:!1,paused:!1,idle:!1,events:[],interventions:[]},a.set(c,l),i.session._tag===`ParentSession`&&o.set(e.attemptId,l)),l.latestSequence=e.sequence,i._tag===`SessionStarted`&&(l.harnessSession=i.harnessSession),i._tag===`SessionFinished`&&(l.status=`Finished`),i._tag===`SessionIdle`&&(l.idle=!0),i._tag===`SessionResumed`&&(l.idle=!1),r.has(e.sequence)&&l.events.push({sequence:e.sequence,receivedAt:e.receivedAt,event:i})}let c=[],l=(e,t)=>JSON.stringify([e,t.inputSequence]),u=new Map;for(let{attemptId:e,payload:t}of i)(t._tag===`InterventionApplied`||t._tag===`InterventionRejected`)&&u.set(l(e,t),t);let d=new Set;for(let e of i){let t=e.payload;if(t._tag!==`InterventionApplied`&&t._tag!==`InterventionRejected`)continue;let n=l(e.attemptId,t),i={...e,payload:u.get(n)??t},f=t.intervention.target,p=f._tag===`Parent`?o.get(e.attemptId):a.get(s(e.attemptId,f.sessionId)),m=r.has(e.sequence)&&!d.has(n);m&&d.add(n),p===void 0?m&&c.push(i):(e.sequence>p.latestSequence&&(p.latestSequence=e.sequence),t._tag===`InterventionApplied`&&(p.held=t.state.held,p.paused=t.state.paused),m&&p.interventions.push(i))}return{groups:a,unmatched:c}},H=e=>({key:`event:${e.sequence}`,attemptId:e.attemptId,sequence:e.sequence,latestSequence:e.sequence,receivedAt:e.receivedAt}),U=(e,t,n)=>({_tag:`Notice`,...H(e),...t,origin:n,queued:null}),W=e=>`${e} ${e===1?`retry`:`retries`}`,it=(e,t)=>{let n=[],r=new Map;for(let i of e.events){let a=i.event,o={...i,attemptId:e.attemptId};if(a._tag===`ToolStarted`||a._tag===`ToolFinished`){let n=JSON.stringify([e.attemptId,e.session.id,a.callId]),s=r.get(n),c=s?.start??S();r.set(n,{_tag:`Tool`,...H(o),key:n,sequence:s?.sequence??i.sequence,receivedAt:s?.receivedAt??i.receivedAt,name:a.tool,start:a._tag===`ToolStarted`?P({receivedAt:i.receivedAt,input:a.input}):c,state:a._tag===`ToolFinished`?{_tag:a.isError?`Error`:`Finished`,receivedAt:i.receivedAt,output:a.output}:s?.state??{_tag:t===`Live`?`Running`:`Stopped`}});continue}if(a._tag===`ProviderRetrying`||a._tag===`ProviderRecovered`){n.push(U(o,a._tag===`ProviderRetrying`?{kind:`status`,label:`${e.session.agent}: provider unreachable`,detail:a.message,format:`plain`,tone:`warning`}:{kind:`status`,label:`${e.session.agent}: provider reachable again`,detail:`After ${W(a.retries)}`,format:`plain`,tone:`plain`},{_tag:`Provider`,session:e.session,event:a}));continue}let s=w(a,{TextOutput:({text:t})=>({kind:`message`,label:e.session.agent,detail:t,format:`markdown`,tone:`plain`}),SessionStarted:()=>({kind:`status`,label:`${e.session.agent} started`,detail:xe(e.session.brain),format:`plain`,tone:`plain`}),SessionIdle:()=>({kind:`status`,label:`${e.session.agent} idle`,detail:`Session open for operator input`,format:`plain`,tone:`plain`}),SessionResumed:()=>({kind:`status`,label:`${e.session.agent} resumed`,detail:``,format:`plain`,tone:`plain`}),SessionFinished:()=>({kind:`status`,label:`${e.session.agent} finished`,detail:``,format:`plain`,tone:`plain`})});n.push(U(o,s,{_tag:`Session`,session:e.session,event:a._tag}))}return[...n,...r.values()].sort((e,t)=>e.sequence-t.sequence)},at=e=>{let{action:t,operator:n,target:r}=e.payload.intervention,i=e.payload._tag===`InterventionRejected`,a=t._tag===`OperatorMessage`||t._tag===`Steer`,o=e.payload._tag===`InterventionApplied`&&e.payload.state.queued?r._tag===`Parent`?`parent`:`child`:null,s=`${n} released the ${r._tag===`Parent`?`parent`:`child`}`;return{...U(e,{kind:a?`message`:`status`,label:i?`${n} · not delivered`:a?n:t._tag===`Release`?s:`${n} paused the session`,detail:i?`${a?`${t.message}\n\n`:``}${e.payload.message}`:a?t.message:``,format:a?`markdown`:`plain`,tone:i?`failed`:`plain`},{_tag:`Operator`,operator:n}),queued:o}},ot=(e,t,n=[])=>{let r=new Set(t.filter(({outcome:e})=>e!==null).map(({id:e})=>e));for(let{attemptId:t,payload:n}of e)(n._tag===`Final`||n._tag===`Failed`||n._tag===`Interrupted`)&&r.add(t);let{groups:i,unmatched:a}=rt(e,n,r),o=[];for(let t of[...e].sort((e,t)=>e.sequence-t.sequence)){let e=t.payload;e._tag!==`InterventionApplied`&&e._tag!==`InterventionRejected`&&(t.direction!==`inbound`||t.operator===void 0||e._tag===`Cancel`)&&e._tag!==`SessionEvent`&&o.push(U(t,w(e,{Started:({parentModel:e,conflictingSalvage:t})=>({kind:`status`,label:`Attempt started`,detail:O(t,{onNone:()=>e,onSome:t=>`${e}. ${f(t)}`}),format:`plain`,tone:`plain`}),Final:({result:e})=>({kind:`status`,label:`Attempt finished`,detail:e.message,format:`markdown`,tone:`plain`}),Failed:({failure:e})=>({kind:`status`,label:`Attempt failed`,detail:h(e),format:`plain`,tone:`failed`}),Cancel:()=>({kind:`status`,label:`Cancel requested`,detail:`Attempt stopping`,format:`plain`,tone:`plain`}),Interrupted:()=>({kind:`status`,label:`Interrupted`,detail:`Acknowledged by the parent session`,format:`plain`,tone:`plain`}),Steer:({message:e})=>({kind:`message`,label:`Operator`,detail:e,format:`markdown`,tone:`plain`}),Interrupt:()=>({kind:`status`,label:`Interrupt requested`,detail:`Sent by the operator`,format:`plain`,tone:`plain`}),OperatorMessage:({message:e})=>({kind:`message`,label:`Operator`,detail:e,format:`markdown`,tone:`plain`}),Release:()=>({kind:`status`,label:`Released`,detail:`Held child released by the operator`,format:`plain`,tone:`plain`}),WorkerUnresponsive:({worker:e,lastAnsweredAt:t,reason:n})=>({kind:`status`,label:`${e} silent since ${F(he(t))}`,detail:n,format:`plain`,tone:`warning`}),WorkerResponsive:({worker:e,lastAnsweredAt:n})=>({kind:`status`,label:`${e} answering again`,detail:`Silent for ${j(Date.parse(t.receivedAt)-Te(n))}`,format:`plain`,tone:`plain`})}),{_tag:`Envelope`,payload:e}))}let s=[];for(let[e,t]of i)s.push({_tag:`Session`,...H(t.first),key:e,latestSequence:t.latestSequence,session:t.session,harnessSession:t.harnessSession,status:t.status,held:t.status===`Live`&&t.held,paused:t.status===`Live`&&t.paused,idle:t.status===`Live`&&t.idle,entries:[...it(t,t.status),...t.interventions.map(e=>at(e))].sort((e,t)=>e.sequence-t.sequence)});return o.push(...a.map(e=>{let t=at(e),n=e.payload.intervention.target;return{...t,label:`${t.label} · ${n._tag===`Parent`?`parent`:n.sessionId}`}})),{sessions:s,terminalAttempts:r,items:[...o,...s.flatMap(e=>e.session._tag===`ChildSession`?[e]:e.entries)].sort((e,t)=>e.sequence-t.sequence)}},st=e=>{if(e.status!==`Live`)return e.status;if(e.paused)return`Paused`;if(e.held)return e.idle?`Held, waiting for input`:`Held, working`;if(e.idle)return`Waiting for input`;let t=[...e.entries].reverse().find(e=>e._tag===`Tool`&&e.state._tag===`Running`);return t?._tag===`Tool`?`Running ${t.name}`:`Working`},G=be(A,se),ct=M({type:we([`text`,`inputText`]),text:A}),K=e=>N(G)(e)?e:{},q=e=>N(A)(e)?e:void 0,lt=e=>{if(e===`cwd`)return`Working directory`;if(e===`durationMs`)return`Duration (ms)`;let t=e.replace(/([a-z])([A-Z])/gu,`$1 $2`).replaceAll(`_`,` `).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)},J=(e,t,n=`text`)=>({_tag:`Code`,label:e,text:t,language:n}),Y=(e,t,n=[])=>{let r=Object.entries(t).filter(([e])=>!n.includes(e)).map(([e,t])=>({label:lt(e),value:t}));return r.length===0?[]:[{_tag:`Fields`,label:e,fields:r}]},X=(e,t,n=`text`)=>{if(e==null)return[];if(N(A)(e))return[J(t,e,n)];if(Array.isArray(e))return e.flatMap(e=>N(ct)(e)?[J(t,e.text,n)]:X(e,t,n));if(!N(G)(e))return[{_tag:`Fields`,label:t,fields:[{label:`Value`,value:e}]}];let r=[],i={};for(let[a,o]of Object.entries(e))a===`content`&&Array.isArray(o)?r.push(...X(o,t,n)):[`text`,`stdout`,`stderr`,`aggregatedOutput`,`message`].includes(a)?r.push(...X(o,a===`text`?t:lt(a),n)):a===`error`?r.push(...X(o,`Error`)):i[a]=o;return[...r,...Y(t,i)]},ut=M({oldText:A,newText:A}),dt=M({path:A,diff:A,kind:M({type:A})}),ft=I(k(dt)),pt=pe.check(ye(1)),Z=e=>/\.[cm]?tsx?$/iu.test(e)?`typescript`:/\.json$/iu.test(e)?`json`:`text`,mt=e=>X(e,`Confirmation`).map(e=>e._tag===`Code`?{_tag:`Text`,label:e.label,text:e.text}:e),ht=(e,t,n)=>{let r=K(e),i=K(t),a=ft(i.changes??r.changes),o=q(r.path)??q(r.file_path),s=N(pt)(r.offset)?r.offset:void 0,c=N(pt)(r.limit)?r.limit:void 0,l=s??(r.offset===void 0?1:void 0),u=n===`read`&&(s!==void 0||c!==void 0)?[l===void 0?``:`From line ${l}`,c===void 0?``:`up to ${c} ${c===1?`line`:`lines`}`].filter(e=>e!==``).join(` · `):``,d=[o??`File details unavailable`,u].filter(e=>e!==``).join(` · `),f=q(K(i.details).patch)??q(K(i.details).diff),p=I(k(ut))(r.edits),m=me(p,()=>N(A)(r.old_string)&&N(A)(r.new_string)?[{oldText:r.old_string,newText:r.new_string}]:[]);return{activity:{_tag:`Files`,operation:i.type===`fileChange`||r.type===`fileChange`?`change`:n,paths:O(a,{onNone:()=>o===void 0?[]:[o],onSome:e=>e.map(({path:e})=>e)})},title:{read:`Read file`,edit:`Edit file`,write:`Write file`}[n],subject:n===`read`?d:o??O(a,{onNone:()=>`File details unavailable`,onSome:e=>e.length===1?e[0]?.path??`File details unavailable`:`${e.length} files`}),input:[...Y(`Options`,r,[`path`,`file_path`,`edits`,`old_string`,`new_string`,`content`,`changes`,`type`,`id`,`status`,...n===`read`&&s!==void 0?[`offset`]:[],...n===`read`&&c!==void 0?[`limit`]:[]]),...(f===void 0?m:[]).flatMap(({oldText:e,newText:t},n)=>[J(m.length===1?`Before`:`Before ${n+1}`,e,Z(o??``)),J(m.length===1?`After`:`After ${n+1}`,t,Z(o??``))]),...N(A)(r.content)?[J(`Content`,r.content,Z(o??``))]:[],...t===void 0?O(ft(r.changes),{onNone:()=>[],onSome:e=>e.map(({path:e,diff:t})=>J(e,t,`diff`))}):[]],output:O(ft(i.changes),{onNone:()=>f===void 0?n===`read`?X(t,o??`Output`,Z(o??``)):mt(t):[J(o??`Changes`,f,`diff`),...mt(Object.fromEntries(Object.entries(i).filter(([e])=>e!==`details`))),...Y(`Metadata`,K(i.details),[`patch`,`diff`])],onSome:e=>e.map(({path:e,diff:t,kind:n})=>J(`${e} · ${n.type}`,t,`diff`))})}},gt=e=>{switch(e.toLowerCase()){case`bash`:case`powershell`:case`shell`:case`command`:return`command`;case`read`:return`read`;case`edit`:case`file_change`:return`edit`;case`write`:return`write`;case`grep`:case`glob`:case`find`:case`ls`:case`web_search`:return`search`;case`subagent`:case`agent`:case`task`:return`agent`;default:return`tool`}},_t=({input:e,output:t})=>{let n=K(e??t),r=K(t),i=q(n.command)??q(r.command);return{activity:{_tag:`Command`,command:i},title:`Command`,subject:i??`Command details unavailable`,input:[...i===void 0?[]:[J(`Command`,i,`bash`)],...Y(`Options`,n,[`command`,`type`,`id`,`status`,`aggregatedOutput`,`exitCode`,`durationMs`,`processId`,`source`,`commandActions`])],output:r.type===`commandExecution`?[...X(r.aggregatedOutput,`Output`),...Y(`Execution`,r,[`type`,`id`,`status`,`command`,`cwd`,`aggregatedOutput`,`processId`,`source`,`commandActions`])]:X(t,`Output`)}},vt=({input:e,output:t,name:n})=>{let r=K(e??t),i=K(t),a=K(r.action);return{activity:{_tag:`Search`},title:n.toLowerCase()===`ls`?`List files`:`Search`,subject:q(r.pattern)??q(r.query)??q(a.query)??q(a.url)??q(r.path)??`Search details unavailable`,input:Y(`Search`,r,[`type`,`id`]),output:i.type===`webSearch`?Y(`Search`,i,[`type`,`id`]):X(t,`Results`)}},yt=({input:e,output:t})=>{let n=K(e),r=q(n.task)??q(n.prompt);return{activity:{_tag:`Delegation`},title:`Delegate`,subject:q(n.description)??r??`Delegated task`,input:[...r===void 0?[]:[{_tag:`Text`,label:`Task`,text:r}],...Y(`Agent`,n,[`task`,`prompt`])],output:X(t,`Report`).map(e=>e._tag===`Code`?{_tag:`Text`,label:e.label,text:e.text}:e)}},bt=({input:e,output:t,name:n})=>{let r=K(e),i=K(t),a=r.type===`mcpToolCall`||r.type===`dynamicToolCall`||i.type===`mcpToolCall`||i.type===`dynamicToolCall`,o=a?r.arguments??i.arguments:e;return{activity:{_tag:`Tool`},title:(a?[q(r.server)??q(i.server)??q(r.namespace)??q(i.namespace),q(r.tool)??q(i.tool)].filter(e=>e!==void 0).join(` · `):n)||n,subject:N(G)(o)?`${Object.keys(o).length} parameters`:N(A)(o)?o:`Tool details`,input:X(o,`Parameters`),output:a?[...X(i.result??i.contentItems,`Output`),...X(i.error,`Error`)]:X(t,`Output`)}},xt=e=>{let t={name:e.name,input:O(e.start,{onNone:()=>void 0,onSome:({input:e})=>e}),output:w(e.state,{Running:()=>void 0,Stopped:()=>void 0,Finished:({output:e})=>e,Error:({output:e})=>e})},n=gt(e.name);return{category:n,...{command:_t,read:({input:e,output:t})=>ht(e,t,`read`),edit:({input:e,output:t})=>ht(e,t,`edit`),write:({input:e,output:t})=>ht(e,t,`write`),search:vt,agent:yt,tool:bt}[n](t)}},Q=(e,t)=>{let n=Math.max(0,Math.floor((t-Date.parse(e))/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m ${n%60}s`:`${Math.floor(r/60)}h ${r%60}m`},St=({since:e,className:t})=>{let n=Ne(1e3);return(0,B.jsx)(`time`,{dateTime:e,"aria-live":`off`,className:v(`font-mono tabular-nums`,t),title:`Since ${ve(e)}`,children:Q(e,n)})},Ct=e=>{if(e.status!==`Live`)return{label:e.status,detail:``,since:S()};if(e.paused||e.held||e.idle)return{label:st(e),detail:``,since:S()};let t=[...e.entries].reverse().find(e=>e._tag===`Tool`&&e.state._tag===`Running`);if(t?._tag!==`Tool`)return{label:`Working`,detail:``,since:S()};let n=xt(t);return{label:{command:`Running command`,read:`Reading file`,edit:`Editing file`,write:`Writing file`,search:`Searching`,agent:`Delegating`,tool:`Running ${n.title}`}[n.category],detail:n.subject,since:D(t.start,({receivedAt:e})=>e)}},wt=e=>{let t=e.filter(({status:e})=>e===`Live`);return t.filter(({session:e})=>e._tag===`ChildSession`).sort((e,t)=>t.latestSequence-e.latestSequence)[0]??t.find(({session:e})=>e._tag===`ParentSession`)},Tt=({chapter:e})=>{let t=Ne(1e3),n=wt(e.sessions),r=n===void 0?{label:`Parent session starting`,detail:``,since:S()}:Ct(n);return(0,B.jsxs)(`div`,{role:`status`,"aria-label":`Current activity`,className:`min-w-0 space-y-0.5 text-xs`,children:[(0,B.jsxs)(`p`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(L,{state:`Running`}),n!==void 0&&(0,B.jsx)(`span`,{className:`shrink-0 font-medium text-foreground`,children:n.session._tag===`ParentSession`?`Parent`:n.session.agent}),(0,B.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:r.label}),O(r.since,{onNone:()=>null,onSome:e=>(0,B.jsx)(`span`,{"aria-live":`off`,className:`ml-auto shrink-0 font-mono tabular-nums text-muted-foreground`,title:`Started ${ve(e)}`,children:Q(e,t)})})]}),r.detail!==``&&(0,B.jsx)(`p`,{className:`truncate pl-3.5 font-mono text-muted-foreground`,title:r.detail,children:r.detail}),O(e.lastActivityAt,{onNone:()=>null,onSome:e=>(0,B.jsxs)(`p`,{"aria-live":`off`,className:`pl-3.5 text-muted-foreground`,children:[`Last activity `,Q(e,t),` ago`]})}),e.connectivity.map(e=>(0,B.jsx)(Et,{warning:e,now:t},e._tag===`WorkerSilent`?e.worker:`${e.agent}:${e.since}`))]})},Et=({warning:e,now:t})=>{let n=w(e,{WorkerSilent:({worker:e,lastAnsweredAt:t})=>({text:`${e} silent since ${F(t)}`,since:t,detail:null}),ProviderRetrying:({agent:e,retries:t,since:n,message:r})=>({text:`${e}: provider unreachable, ${W(t)} since ${F(n)}`,since:n,detail:r})});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2 pl-3.5`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 text-warning`,children:[(0,B.jsx)(`span`,{className:`sr-only`,children:`Warning: `}),n.text]}),(0,B.jsx)(`span`,{"aria-live":`off`,className:`ml-auto shrink-0 font-mono tabular-nums text-muted-foreground`,title:`Since ${ve(n.since)}`,children:Q(n.since,t)})]}),n.detail!==null&&(0,B.jsx)(`p`,{className:`truncate pl-3.5 text-muted-foreground`,title:n.detail,children:n.detail})]})},Dt=e=>{let t=null,n=new Map;for(let{payload:r,receivedAt:i}of e)if(r._tag===`WorkerUnresponsive`)t={_tag:`WorkerSilent`,worker:r.worker,lastAnsweredAt:he(r.lastAnsweredAt)};else if(r._tag===`WorkerResponsive`)t=null;else if(r._tag===`SessionEvent`){let e=r.event;e._tag===`ProviderRetrying`?n.set(e.session.id,{_tag:`ProviderRetrying`,sessionId:e.session.id,agent:e.session.agent,message:e.message,retries:e.retries,since:n.get(e.session.id)?.since??i}):(e._tag===`ProviderRecovered`||e._tag===`SessionIdle`||e._tag===`SessionFinished`)&&n.delete(e.session.id)}return[...t===null?[]:[t],...n.values()]},Ot=/^\s*\[usine:(blocked|question|failed)\]/u,kt=e=>{let t=Ot.exec(e)?.[1];return t===`blocked`||t===`question`?t:null},At=e=>e.replace(Ot,``).trimStart(),jt=e=>At(e).replace(/\s+/gu,` `).trim(),Mt=e=>e.replace(/^\s{0,3}(?:#{1,6}\s+|[-*+]\s+|\d+[.)]\s+|>\s?)/u,``).replace(/!?\[([^\]]*)\]\([^)]*\)/gu,`$1`).replace(/`([^`]*)`/gu,`$1`).replace(/(\*\*|__)(.+?)\1/gu,`$2`).replace(/(^|[\s(])\*(\S(?:.*?\S)?)\*(?=[\s).,;:!?]|$)/gu,`$1$2`).trim(),Nt=e=>e.replace(/```[\s\S]*?(?:```|$)/gu,`
2
+ `).split(`
3
+ `).map(Mt).filter(e=>e!==``).join(` `),$=e=>{let t=At(e).replace(/```[\s\S]*?(?:```|$)/gu,`
4
+ `).split(`
5
+ `).map(Mt).filter(e=>e!==``)[0]??``;return/^(.*?[.!?…])(?=\s|$)/u.exec(t)?.[1]??t},Pt=32,Ft=12,It=e=>{if(e.length<=Pt)return e;let t=/^(.+?)(?:[,;:]\s|\s[—–-]\s)/u.exec(e)?.[1];if(t!==void 0&&t.length>=Ft&&t.length<=Pt)return t;let n=e.slice(0,33).lastIndexOf(` `);return`${(n>0?e.slice(0,n):e.split(` `)[0]??e).replace(/[\s,;:.—–-]+$/u,``)}…`},Lt=e=>({name:e.session._tag===`ParentSession`?`Parent`:e.session.agent,sessionKey:e.key}),Rt=e=>e.origin._tag===`Envelope`&&(e.origin.payload._tag===`Final`||e.origin.payload._tag===`Failed`||e.origin.payload._tag===`Interrupted`),zt=e=>w(e,{Succeeded:({message:e})=>Ee(e),Failed:({failure:e})=>e._tag===`AgentFailure`||e._tag===`BlockedFailure`||e._tag===`QuestionFailure`?h(e):null,Canceled:()=>null}),Bt=(e,t)=>{let n=t?.salvage??null,r=e?.origin._tag===`Envelope`&&e.origin.payload._tag===`Final`?P(e.origin.payload.result.message):S(),i=t?.outcome;if(i!=null)return w(i,{Succeeded:()=>({_tag:`Succeeded`,message:r}),Failed:({failure:e})=>({_tag:`Failed`,failure:e,salvage:n}),Canceled:()=>({_tag:`Canceled`,salvage:n})});if(e?.origin._tag!==`Envelope`)return null;let a=e.origin.payload;return a._tag===`Final`?{_tag:`Succeeded`,message:r}:a._tag===`Failed`?{_tag:`Failed`,failure:a.failure,salvage:n}:a._tag===`Interrupted`?{_tag:`Canceled`,salvage:n}:null},Vt=({direction:e,payload:t})=>e===`outbound`&&t._tag!==`WorkerUnresponsive`&&t._tag!==`WorkerResponsive`&&(t._tag!==`SessionEvent`||t.event._tag!==`PoolRateLimitsUpdated`&&t.event._tag!==`ProviderRetrying`),Ht=e=>e.detail===``?e.label:`${e.label}. ${e.detail}`,Ut=e=>e._tag===`Envelope`?e.payload._tag===`WorkerUnresponsive`?{_tag:`WorkerSilent`}:e.payload._tag===`WorkerResponsive`?{_tag:`WorkerAnswers`}:null:null,Wt=(e,t,n,r,i)=>{let a=[],o=t===null?null:zt(t),s=o===null?null:jt(o),c=new Set,l=null,u=[],d=null,p=new Map,m=()=>{let[e,...t]=u;e!==void 0&&d!==null&&a.push({_tag:`Burst`,key:`burst:${e.key}`,speaker:d,tools:[e,...t]}),u=[],d=null};for(let{entry:t,session:n}of e){if(t._tag===`Tool`){let e=n??{name:`Parent`,sessionKey:null};if(xt(t).category===`agent`){m(),a.push({_tag:`Delegation`,key:t.key,speaker:e,tool:t});continue}d!==null&&d.sessionKey!==e.sessionKey&&m(),d=e,u.push(t);continue}if(Rt(t))continue;let e=t.origin,r={key:t.key,sequence:t.sequence,latestSequence:t.latestSequence,receivedAt:t.receivedAt};if(e._tag===`Session`){let i=n??{name:e.session.agent,sessionKey:null};if(e.event===`TextOutput`){let n=jt(t.detail);if(s!==null&&n===s){l??={receivedAt:t.receivedAt,speaker:i};continue}let o=e.session._tag===`ChildSession`;if(!o&&c.has(n))continue;o&&c.add(n),m();let u=kt(t.detail);a.push({_tag:`Message`,...r,speaker:i,from:`agent`,text:At(t.detail),format:t.format,undelivered:!1,queued:null,blocked:u===`blocked`,question:u===`question`});continue}(e.event===`SessionIdle`||e.event===`SessionResumed`)&&(m(),a.push({_tag:`Note`,...r,speaker:i,text:e.event===`SessionIdle`?`Waiting for operator input`:`Resumed`,tone:`plain`,connectivity:null}))}else if(e._tag===`Provider`){let i=n??{name:e.session.agent,sessionKey:null},o=e.event;if(m(),o._tag===`ProviderRecovered`){p.delete(e.session.id),a.push({_tag:`Note`,...r,speaker:i,text:`Provider reachable again after ${W(o.retries)}`,tone:`plain`,connectivity:null});continue}let s=`Provider unreachable, ${W(o.retries)} so far. ${o.message}`,c=p.get(e.session.id),l=c===void 0?void 0:a[c];if(c===a.length-1&&l?._tag===`Note`){a[c]={...l,latestSequence:t.latestSequence,text:s};continue}p.set(e.session.id,a.length),a.push({_tag:`Note`,...r,speaker:i,text:s,tone:`warning`,connectivity:{_tag:`ProviderRetrying`,sessionId:e.session.id}})}else if(e._tag===`Envelope`&&e.payload._tag===`Started`){let t=e.payload.conflictingSalvage;ue(t)&&(m(),a.push({_tag:`Note`,...r,speaker:null,text:f(t.value),tone:`plain`,connectivity:null}))}else m(),a.push(t.kind===`message`?{_tag:`Message`,...r,speaker:{name:e._tag===`Operator`?e.operator:t.label,sessionKey:n?.sessionKey??null},from:`operator`,text:t.detail,format:t.format,undelivered:t.tone===`failed`,queued:t.queued,blocked:!1,question:!1}:{_tag:`Note`,...r,speaker:null,text:Ht(t),tone:t.tone,connectivity:Ut(e)})}if(m(),t!==null){let e=n===void 0?S():P({key:n.key,sequence:n.sequence,latestSequence:n.latestSequence,receivedAt:n.receivedAt});a.push({_tag:`Ending`,key:n?.key??`ending:${i}`,position:e,receivedAt:T(E(l?.receivedAt),()=>T(D(e,({receivedAt:e})=>e),()=>E(r?.endedAt))),speaker:l?.speaker??null,end:t,outOfMemory:r?.outOfMemory??null})}return a},Gt=(e,t,n)=>{let r=new Map;for(let t of e.sessions)for(let e of t.entries)r.set(e.key,t);let i=e.items.flatMap(e=>e._tag===`Session`?e.entries:[e]).sort((e,t)=>e.sequence-t.sequence),a=[...[...t].sort((e,t)=>e.number-t.number).map(({id:e})=>e),...i.map(({attemptId:e})=>e)];return{chapters:[...new Set(a)].map(a=>{let s=t.find(({id:e})=>e===a),c=i.filter(e=>e.attemptId===a),l=[...c].reverse().find(e=>e._tag===`Notice`&&Rt(e)),u=c.find(e=>e._tag===`Notice`&&e.origin._tag===`Envelope`&&e.origin.payload._tag===`Started`),d=Bt(l,s),f=n.filter(e=>e.attemptId===a),p=[...f].reverse().find(Vt),m=d===null&&!e.terminalAttempts.has(a);return{key:`attempt:${a}`,attemptId:a,attempt:E(s),live:m,parentModel:u?._tag===`Notice`&&u.origin._tag===`Envelope`&&u.origin.payload._tag===`Started`?P(u.origin.payload.parentModel):S(),sessions:e.sessions.filter(e=>e.attemptId===a).sort((e,t)=>Number(e.session._tag===`ChildSession`)-Number(t.session._tag===`ChildSession`)||e.sequence-t.sequence),rows:Wt(c.map(e=>{let t=r.get(e.key);return{entry:e,session:t===void 0?null:Lt(t)}}),d,l,s,a),meters:o(f),endedAt:T(E(s?.endedAt),()=>E(l?.receivedAt)),lastActivityAt:E(p?.receivedAt),connectivity:m?Dt(f):[]}})}},Kt=e=>e.rows.flatMap(e=>{let t=(t,n)=>[{key:e.key,...t,text:n,label:It(n)}];if(e._tag===`Message`){let{sessionKey:n,name:r}=e.speaker;return e.from===`operator`?t({sessionKey:n,kind:`operator`,speaker:r,tone:e.undelivered?`failed`:`plain`},$(e.text)):t({sessionKey:n,kind:e.blocked?`blocker`:e.question?`question`:`turn`,speaker:r,tone:e.blocked?`failed`:`plain`},$(e.text))}if(e._tag===`Note`)return e.connectivity===null&&e.tone!==`failed`?[]:t({sessionKey:e.speaker?.sessionKey??null,kind:e.connectivity===null?`operator`:`notice`,speaker:e.speaker?.name??null,tone:e.tone},$(e.text));if(e._tag!==`Ending`)return[];let n=(n,r)=>t({sessionKey:e.speaker?.sessionKey??null,kind:`ending`,speaker:null,tone:r},n);return w(e.end,{Succeeded:({message:e})=>n(O(e,{onNone:()=>`Succeeded`,onSome:$}),`plain`),Failed:({failure:e})=>n($(h(e)),`failed`),Canceled:()=>n(`Canceled`,`plain`)})}),qt=e=>{let t=[];for(let n of Kt(e)){let e=t.at(-1);n.kind===`turn`?e?._tag===`Turns`&&e.sessionKey===n.sessionKey?t[t.length-1]={...e,turns:[...e.turns,n]}:t.push({_tag:`Turns`,key:`turns:${n.key}`,speaker:n.speaker??`Parent`,sessionKey:n.sessionKey,turns:[n]}):t.push({_tag:`Mark`,checkpoint:n})}return t},Jt=e=>e.chapters.flatMap(e=>{let t=new Set(Kt(e).map(({key:e})=>e)),n=(t,n=!1)=>({id:t,attemptId:e.attemptId,checkpoint:n});return[n(e.key),n(`history:${e.attemptId}`),n(`empty:${e.attemptId}`),...e.rows.map(e=>n(e.key,t.has(e.key))),n(`activity:${e.attemptId}`)]}),Yt=(e,t)=>{let n=new Set(t),r=e.findIndex(({id:e})=>n.has(e)),i=e[r];if(i===void 0)return null;let a=e.slice(0,r+1).reverse().find(e=>e.attemptId===i.attemptId&&e.checkpoint);return{attemptId:i.attemptId,checkpointKey:a?.id??null}},Xt=({failure:e,className:t})=>(0,B.jsxs)(`div`,{className:v(`rounded-lg border border-destructive/25 bg-destructive/8 px-3 pt-2 pb-2.5 text-sm`,t),children:[(0,B.jsx)(`p`,{className:`font-medium text-destructive`,children:g(e)}),(0,B.jsx)(Le,{className:`wrap-anywhere`,children:h(e)})]}),Zt=({salvage:e})=>(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground wrap-anywhere`,children:e===null?`No salvage branch`:w(e,{Pushed:({ref:e,commit:t})=>(0,B.jsxs)(B.Fragment,{children:[`Unfinished work pushed to `,(0,B.jsx)(`span`,{className:`font-mono`,children:e}),` at`,` `,(0,B.jsx)(`span`,{className:`font-mono`,children:t.slice(0,7)})]}),PartlyPushed:({ref:e,commit:t,path:n,message:r})=>(0,B.jsxs)(B.Fragment,{children:[`Unfinished work pushed to `,(0,B.jsx)(`span`,{className:`font-mono`,children:e}),` at`,` `,(0,B.jsx)(`span`,{className:`font-mono`,children:t.slice(0,7)}),`, except files kept at`,` `,(0,B.jsx)(`span`,{className:`font-mono`,children:n}),`. `,r]}),Retained:({path:e,message:t})=>(0,B.jsxs)(B.Fragment,{children:[`Salvage incomplete: unfinished work at `,(0,B.jsx)(`span`,{className:`font-mono`,children:e}),`, retried at each startup while the worker is configured. Last error: `,t]}),Rejected:({path:e,message:t})=>(0,B.jsxs)(B.Fragment,{children:[`Salvage rejected: unfinished work at `,(0,B.jsx)(`span`,{className:`font-mono`,children:e}),`. The remote refused its push, so startup doesn't retry it until its commit changes. Error:`,` `,t]})})}),Qt=({end:e})=>w(e,{Failed:({failure:e,salvage:t})=>(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(Xt,{failure:e}),(0,B.jsx)(Zt,{salvage:t})]}),Succeeded:({message:e})=>(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,B.jsx)(L,{state:`Succeeded`}),`Succeeded`]}),O(e,{onNone:()=>null,onSome:e=>(0,B.jsx)(Le,{className:`text-md wrap-anywhere`,children:e})})]}),Canceled:({salvage:e})=>(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,B.jsx)(L,{state:`Canceled`}),`Canceled`]}),(0,B.jsx)(Zt,{salvage:e})]})}),$t=({kills:e})=>(0,B.jsxs)(`p`,{className:`text-xs text-warning wrap-anywhere`,children:[(0,B.jsx)(`span`,{className:`sr-only`,children:`Warning: `}),p(e)]}),en=({end:e,outOfMemory:t})=>t===null?(0,B.jsx)(Qt,{end:e}):(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(Qt,{end:e}),(0,B.jsx)($t,{kills:t})]});export{Yt as a,Tt as c,ot as d,nt as f,Je as g,Ke as h,Jt as i,St as l,z as m,qt as n,zt as o,et as p,Gt as r,Nt as s,en as t,xt as u};
@@ -0,0 +1 @@
1
+ import{J as e,Wt as t,a as n,f as r,q as i,t as a,v as o}from"./strings-qxNeGv33.js";function s(e){return e}var c={hetzner:`Hetzner`,boat:`Boat`},l={hetzner:`server`,boat:`sandbox`},u=(e,t)=>`Creating a ${c[e.provider]} machine, started ${a(e.since,t)}`,d={capacity:`no capacity`,quota:`quota reached`,refused:`refused by the provider`,provider:`provider error`,unreachable:`unreachable`,timeout:`SSH timeout`},f=({reason:e})=>e===`check`?`Preflight failed on the first machine of the day`:`Machine creation failed: ${d[e]}`,p=(e,t)=>new Date(e).toDateString()===new Date(t).toDateString()?r(e).slice(11):n(e),m=({blocked:e,retryAt:t},n)=>`${e?`Next try`:`Pause ended`} at ${p(t,n)}`,h=({failures:e,failedAt:t},n)=>`${e===1?`Failed once`:`Failed ${e} times in a row`}, last at ${p(t,n)}`,g={approve:`Approve`,retry:`Retry`,runAgain:`Run again`,cancel:`Cancel run`,confirmCancel:`Confirm cancel`,keepRunning:`Keep running`},_=`Opening a run…`,v=`No run opened: cycle budget used up. Reset it in Needs attention`,y=n=>e(n,{Event:()=>`From the event`,OperatorRetry:({operator:e})=>t(e,{onNone:()=>`Retried`,onSome:e=>`Retried by ${e}`}),EditAndRetry:({operator:e})=>t(e,{onNone:()=>`Edited and retried`,onSome:e=>`Edited and retried by ${e}`}),InfraRetry:()=>`Retried after an infrastructure failure`,AfterRestart:()=>`Started again after a restart`}),b=(e,{runId:t,attemptNumber:n,worker:r})=>t===e?`Waiting for attempt ${n} to stop on ${r}`:`Waiting for attempt ${n} of an earlier run to stop on ${r}`,x=(e,t=null,n=null)=>{if(t!==null)return b(e.id,t);if(e.state===`Queued`&&n?.state===`creating`)return`Queued, creating a ${c[n.provider]} machine`;let r=e.attempts.length,i=r===0?``:` after ${r} ${r===1?`attempt`:`attempts`}`;switch(e.state){case`Pending`:return`Pending`;case`Waiting`:return`Waiting for approval`;case`Queued`:return`Queued, no free worker`;case`Running`:return`Running, attempt ${e.attempts.at(-1)?.number??1}`;case`Succeeded`:return r>1?`Succeeded${i}`:`Succeeded`;case`Failed`:return`Failed${i}`;case`Canceled`:return`Canceled${i}`}},S=t=>e(t,{InfraFailure:()=>`Infrastructure failure`,DefectFailure:()=>`Executor defect`,AgentFailure:()=>`Agent failure`,BlockedFailure:()=>`Agent blocked`,QuestionFailure:()=>`Question from the agent`,RunawayFailure:()=>`Runaway guard`,ChildSessionBudgetFailure:()=>`Child session budget exhausted`}),C=e=>`Opened ${r(e)}`,w={ui:`from the UI`,"github-ask":`from GitHub`},T={approve:`Approving…`,retry:`Retrying…`,cancel:`Canceling…`,resolveFailure:`Marking resolved…`},E=t=>e(t,{InfraFailure:({message:e})=>e,DefectFailure:({message:e})=>e,AgentFailure:({message:e})=>e,BlockedFailure:({message:e})=>e,QuestionFailure:({question:e})=>e,RunawayFailure:({ceiling:e})=>e===`wall-clock`?`Time limit reached: settings.max_attempt_minutes`:`Token limit reached: settings.max_attempt_tokens`,ChildSessionBudgetFailure:({attemptedChildren:e,maxChildren:t})=>`Child session budget of ${t} used; child ${e} did not start`}),D=e=>e===`parent`?`Queued until the delegated task ends`:`Queued until the current child step ends`,O=({ref:e,commit:t})=>`Not applied: the previous attempt's work on ${e} at ${t.slice(0,7)} conflicts with the current revision. It is still on ${e}`,k=({kills:e,memoryMib:t})=>`The kernel killed ${e} ${e===1?`process`:`processes`} for memory across containers in this attempt. The last container with recorded kills had a ${t} MiB memory limit`,A=e=>`Retry uses ${e.harness} · ${e.model} from the saved agent definition.`,j={loading:`Loading…`,loadEarlier:`Load earlier`,empty:`No activity recorded`},M=e=>t(e,{onNone:()=>`Attempt`,onSome:({number:e})=>`Attempt ${e}`}),N=e=>`${e.completedCycles} completed rounds. ${e.counts.map(({loop:e,admitted:t})=>`${e}: ${t} ${t===1?`run`:`runs`}`).join(`; `)}`,P=t=>e(t,{CycleBudgetNeed:({ask:e,itemLabel:t})=>({title:`Cycle budget exhausted`,detail:`${t}: ${N(e)}`,repository:e.repository,runId:null}),ApprovalNeed:({loop:e,repository:t,runId:n,item:r})=>({title:`${e}: approval needed`,detail:r===null?`Open the run for the task text`:r.title,repository:t,runId:n}),RunFailureNeed:({failure:e,loop:t,repository:n,runId:r})=>({title:e._tag===`QuestionFailure`?`Question from ${t}`:e._tag===`BlockedFailure`?`${t}: blocked`:`${t}: ${S(e).toLowerCase()}`,detail:E(e),repository:n,runId:r}),BoardProjectionNeed:({failure:e})=>({title:`Item not shown on the board`,detail:e.message,repository:e.repository,runId:null}),PollFailureNeed:({failure:e})=>({title:e.errorTag,detail:e.message,repository:e.repository,runId:null}),PreflightFindingNeed:({finding:e})=>({title:`Label preflight failed`,detail:`${e.label}: ${e.message}`,repository:e.repository,runId:null}),ScheduleFailureNeed:({failure:t})=>({title:e(t,{ScheduleTickFailure:({errorTag:e})=>e,ScheduleAgentFailure:({loop:e})=>`${e}: agent not loaded`,ScheduleCronFailure:({loop:e})=>`${e}: schedule not computed`}),detail:t.message,repository:t._tag===`ScheduleTickFailure`?t.repository:null,runId:null}),ConfigFileNeed:({kind:e,error:t})=>({title:e===`loop`?`Loop file not loaded`:`Agent file not loaded`,detail:`${t.file}: ${t.message.replace(/\.$/u,``)}. Fix the file, then reload the configuration from Configuration > Loops`,repository:null,runId:null}),UnconfiguredWorkerNeed:({worker:e,attempts:t,running:n})=>({title:`Worker not configured`,detail:n>0?`${e} is not in usine.yaml. ${n} ${n===1?`attempt`:`attempts`} still running on it. Discard the leftovers after they end`:`${e} is not in usine.yaml. Startup does not reconcile the ${t} recorded ${t===1?`attempt`:`attempts`} on it. Add the worker back and restart usine up, or discard the leftovers`,repository:null,runId:null}),UnconfirmedStopNeed:({loop:e,repository:t,runId:n,attemptNumber:r,worker:i})=>({title:`${e}: parent task not stopped`,detail:`Attempt ${r} still ending on ${i}, using one slot. No new attempt on this item until it stops. Stop retried every few minutes`,repository:t,runId:n})}),F=e=>({...i(e),repository:e}),I=e=>{let t=new Map;for(let n of e){let e=P(n).repository;e!==null&&t.set(e,(t.get(e)??0)+1)}return t},L=2e3,R=15e3,z=()=>s({queryKey:[`overview`],queryFn:()=>o(e=>e.overview()),refetchInterval:e=>{let t=e.state.data;return t?._tag===`NeedsSetup`?!1:t?.projects.some(e=>e.runs.some(({canCancel:e})=>e))===!0?L:R}});export{f as C,c as D,m as E,l as O,j as S,u as T,v as _,P as a,b,O as c,C as d,k as f,T as g,g as h,N as i,s as k,E as l,A as m,z as n,w as o,D as p,F as r,y as s,I as t,S as u,_ as v,h as w,M as x,x as y};
@@ -0,0 +1 @@
1
+ import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{D as r}from"./button-4rhhIcK8.js";var i=n(e(),1),a=t(),o=i.createContext(void 0),s=e=>{let t=i.useContext(o);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},c=({client:e,children:t})=>(i.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,a.jsx)(o.Provider,{value:e,children:t})),l={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},u=new class{#e=l;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function d(e){setTimeout(e,0)}var f=typeof window>`u`||`Deno`in globalThis;function p(){}function m(e,t){return typeof e==`function`?e(t):e}function h(e){return typeof e==`number`&&e>=0&&e!==1/0}function g(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _(e,t){return typeof e==`function`?e(t):e}function v(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==b(o,t.options))return!1}else if(!S(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function y(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(x(t.options.mutationKey)!==x(a))return!1}else if(!S(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function b(e,t){return(t?.queryKeyHashFn||x)(e)}function x(e){return JSON.stringify(e,(e,t)=>E(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function S(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!S(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!S(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function C(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=T(e)&&T(t);if(!r&&!(E(e)&&E(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=C(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function w(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function T(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(e){if(!D(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!D(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function D(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return new Promise(t=>{u.setTimeout(t,e)})}function O(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:C(e,t)}function ne(e){return e}function re(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ie(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===k?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function j(e,t){return typeof e==`function`?e(...t):!!e}function ae(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var oe=()=>f,M=()=>oe(),N=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},P=new class extends N{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},se=d;function ce(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=se,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var F=ce(),I=new class extends N{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function le(e){return Math.min(1e3*2**e,3e4)}function L(e){return(e??`online`)!==`online`||I.isOnline()}var R=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function z(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(p);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new R(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>P.isFocused()&&(e.networkMode===`always`||I.isOnline())&&e.canRun(),m=()=>L(e.networkMode)&&e.canRun(),h=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(h).catch(r=>{if(c())return;let i=e.retry??(M()?0:3),a=e.retryDelay??le,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?g(r):(n++,e.onFail?.(n,r),te(o).then(()=>f()?void 0:_(f)).then(()=>{t?g(r):v()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:m,start:()=>(m()?v():_(m).then(v),s)}}var B=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),h(this.gcTime)&&(this.#e=u.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(M()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(u.clearTimeout(this.#e),this.#e=void 0)}};function ue(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ae(e,()=>t.signal,()=>n=!0)},u=A(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ie:re;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?H:V,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:V(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function V(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function H(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var de=class extends B{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=G(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=G(this.options);e.data!==void 0&&(this.setState(W(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=O(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(p).catch(p):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>_(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>_(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!g(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=A(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ue(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=z({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof R&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof R){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...U(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...W(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),F.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function U(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:L(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function W(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function G(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var K=class extends N{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),q(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof _(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!w(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Y(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||_(this.options.staleTime,this.#t)!==_(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return w(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(p)),t}#h(e){return!M()&&_(this.options.enabled,this.#t)!==!1&&h(e)}#g(){this.#b();let e=_(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=g(this.#r.dataUpdatedAt,e)+1;this.#u=u.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return _(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=u.setInterval(()=>{(this.options.refetchIntervalInBackground||P.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(u.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(u.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&q(e,t),o=i&&Y(e,n,t,r);(a||o)&&(l={...l,...U(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=O(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=O(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&g,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:X(e,t),refetch:this.refetch,isEnabled:_(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),w(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();F.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function fe(e,t){return _(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||_(t.retryOnMount,e)!==!1)}function q(e,t){return fe(e,t)||e.state.data!==void 0&&J(e,t,t.refetchOnMount)}function J(e,t,n){if(_(t.enabled,e)!==!1&&_(t.staleTime,e)!==`static`){let r=_(n,e);return r===`always`||r!==!1&&X(e,t)}return!1}function Y(e,t,n,r){return(e!==t||_(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&X(e,n)}function X(e,t){return _(t.enabled,e)!==!1&&e.isStaleByTime(_(t.staleTime,e))}var Z=i.createContext(!1),pe=()=>i.useContext(Z);Z.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var he=i.createContext(me()),ge=()=>i.useContext(he),_e=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?j(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},ve=e=>{i.useEffect(()=>{e.clearReset()},[e])},ye=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||j(n,[e.error,r])),be=(e,t)=>t.state.data===void 0,Q=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},xe=(e,t)=>e?.suspense&&t.isPending,Se=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $(e,t,n){let r=pe(),a=ge(),o=s(n),c=o.defaultQueryOptions(e),l=o.getQueryCache().get(c.queryHash),u=e.subscribed!==!1;c._optimisticResults=r?`isRestoring`:u?`optimistic`:void 0,Q(c),_e(c,a,l),ve(a);let[d]=i.useState(()=>new t(o,c)),f=d.getOptimisticResult(c),m=!r&&u;if(i.useSyncExternalStore(i.useCallback(e=>{let t=m?d.subscribe(F.batchCalls(e)):p;return d.updateResult(),t},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),i.useEffect(()=>{d.setOptions(c)},[c,d]),xe(c,f))throw Se(c,d,a);if(ye({result:f,errorResetBoundary:a,throwOnError:c.throwOnError,query:l,suspense:c.suspense}))throw f.error;return c.notifyOnChangeProps?f:d.trackResult(f)}function Ce(e,t){return $({...e,enabled:!0,suspense:!0,throwOnError:be,placeholderData:void 0},K,t)}var we=({title:e,leading:t,counts:n,children:i,actions:o,className:s})=>(0,a.jsxs)(`header`,{className:r(`flex flex-wrap items-baseline gap-x-3 gap-y-1`,s),children:[(0,a.jsxs)(`h1`,{className:`flex items-baseline gap-2 text-xl font-semibold wrap-anywhere`,children:[t!==void 0&&(0,a.jsx)(`span`,{className:`flex h-7 shrink-0 items-center self-start`,children:t}),(0,a.jsx)(`span`,{className:`min-w-0`,children:e})]}),n!==void 0&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground tabular-nums`,children:n}),i,o!==void 0&&(0,a.jsx)(`div`,{className:`ml-auto flex items-center gap-2 self-center`,children:o})]}),Te=({children:e,width:t=`prose`})=>(0,a.jsx)(`main`,{className:`px-4 pt-5 pb-6 md:px-5`,children:(0,a.jsx)(`div`,{className:r(`flex flex-col gap-4`,t===`prose`&&`max-w-3xl`),children:e})}),Ee={lg:`lg:flex-row lg:items-start lg:justify-between lg:gap-6`,sm:`sm:flex-row sm:items-start sm:justify-between sm:gap-6`,never:``},De=({eyebrow:e,heading:t,facts:n,actions:i,actionsBeside:o,className:s})=>(0,a.jsxs)(`header`,{className:r(`flex flex-col gap-3`,Ee[o],s),children:[(0,a.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e!==void 0&&(0,a.jsx)(`p`,{className:`flex flex-wrap items-center gap-x-3.5 gap-y-1 text-xs text-muted-foreground`,children:e}),t,n!==void 0&&(0,a.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1.5 pt-0.5 text-sm text-muted-foreground`,children:n})]}),i!==void 0&&(0,a.jsx)(`div`,{className:`shrink-0`,children:i})]}),Oe=({icon:e,title:t,children:n})=>(0,a.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:t,children:[(0,a.jsx)(e,{"aria-hidden":`true`,className:`size-[1em] shrink-0 text-faint`}),n]});export{C,k as D,j as E,c as O,S,w as T,b as _,Ce as a,v as b,de as c,I as d,F as f,x as g,m as h,we as i,s as k,B as l,N as m,Oe as n,$ as o,P as p,De as r,K as s,Te as t,z as u,ne as v,_ as w,p as x,y};
@@ -0,0 +1 @@
1
+ import{r as e}from"./useRouter-Hur3RN7j.js";import{t}from"./link-C7GfYrMt.js";import{t as n}from"./boot-screen-Su4MyrBh.js";import{t as r}from"./button-4rhhIcK8.js";var i=e(),a=()=>(0,i.jsx)(n,{title:`Project not found`,description:`This repository is not under repos in usine.yaml.`,tone:`error`,inPanel:!0,children:(0,i.jsx)(r,{variant:`outline`,nativeButton:!1,render:(0,i.jsx)(t,{to:`/`}),children:`Back to Overview`})});export{a as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./useRouter-Hur3RN7j.js";import{n as t}from"./queries-BwtMk72-.js";import{D as n}from"./button-4rhhIcK8.js";var r=e(),i=({pullRequests:e,linked:i=!0,className:a})=>e.length===0?null:(0,r.jsx)(`span`,{className:n(`inline-flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,a),children:e.map(e=>(0,r.jsx)(t,{item:e,linked:i},e.number))});export{i as t};
@@ -0,0 +1 @@
1
+ import{k as e}from"./overview-BdUgx_pE.js";import{v as t}from"./strings-qxNeGv33.js";var n=5e3,r=()=>e({queryKey:[`configuration`],queryFn:()=>t(e=>e.configuration()),refetchInterval:n}),i=()=>e({queryKey:[`agents`],queryFn:()=>t(e=>e.agents())});export{r as n,i as t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{o as r,s as i}from"./page-BuzrT_cg.js";import{k as a,n as o}from"./overview-BdUgx_pE.js";import{n as s,t as c}from"./with-selector-Dwf291_Q.js";import{a as l,c as u,d,i as f,l as p,n as m,p as h,r as g,s as _,t as v,u as y}from"./useTimeout-BC05Ghyu.js";import{A as b,B as x,D as S,H as C,P as w,R as T,S as ee,V as E,_ as D,b as te,d as O,h as k,j as ne,k as A,m as re,s as ie,v as j,x as M,y as N,z as P}from"./button-4rhhIcK8.js";import{Lt as F,Mt as I,Ut as L,Wt as R,v as z}from"./strings-qxNeGv33.js";function B(e,t){return r(e,i,t)}var V=n(e(),1);function H(e){return e?.ownerDocument||document}function U(){let[,e]=V.useState({});return V.useCallback(()=>{e({})},[])}var ae=0;function oe(e,t=`mui`){let n=V.useRef(void 0),r=U(),i=e??n.current;return V.useEffect(()=>{n.current??(ae+=1,n.current=`${t}-${ae}`,e??r())},[e,t,r]),i}var se=ne.useId;function W(e,t){if(se!==void 0){let n=se();return e??(t?`${t}-${n}`:n)}return oe(e,t)}function ce(e){return W(e,`base-ui`)}function le(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:G,platform:K,maxTouchPoints:q}=le(),J=G.toLowerCase(),Y=K.toLowerCase(),ue=/^i(os$|p)/.test(Y)||Y===`macintel`&&q>1,de=`android`,fe=Y===de||J.includes(de),pe=!ue&&Y.startsWith(`mac`);Y.startsWith(`win`),!fe&&/^(linux|chrome os)/.test(Y);var me=pe||ue,he=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!he&&J.includes(`firefox`),!he&&J.includes(`chrom`);var ge=me,_e=/jsdom|happydom/.test(J),X=t();function Z(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ee(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ve(e,t){let n=e;for(;n;){if(D(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(ee(n)?n.host:null)}return null}function ye(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var be=`data-base-ui-focusable`,xe=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Se=`ArrowLeft`,Ce=`ArrowRight`,we=`ArrowUp`,Te=`ArrowDown`,Ee=`data-open`,De=`data-closed`,Oe=u,ke=_,Ae=`data-anchor-hidden`,je=`data-popup-open`,Me=`data-pressed`,Ne={[je]:``},Pe={[je]:``,[Me]:``},Fe={[Ee]:``},Ie={[De]:``},Le={[Ae]:``},Re={open(e){return e?Ne:null}},ze={open(e){return e?Pe:null}},Be={open(e){return e?Fe:Ie},anchorHidden(e){return e?Le:null}},Ve={...Be,...f},He=`data-trigger-disabled`;function Ue(e,t){if(!D(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(He);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(He);return!1}function We(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Ge(e){return e.matches(`html,body`)}function Ke(e){return j(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function qe(e){return ve(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${xe}`)!=null}function Je(e){return e?e.getAttribute(`role`)===`combobox`&&Ke(e):!1}function Ye(e){if(!e||_e)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Xe(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ze(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Ze(e,t.id,n)])}function Qe(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function $e(e){e.preventDefault(),e.stopPropagation()}function et(e){return`nativeEvent`in e}function tt(e){return e.pointerType===``&&e.isTrusted?!0:fe&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function nt(e){return _e?!1:!fe&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(fe||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function rt(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function it(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function at(e,t){return t<0||t>=e.length}function ot(e,t){return lt(e.current,{disabledIndices:t})}function st(e,t){return lt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ct(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>lt(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:at(e,u)?-1:u,wrapped:d}}function lt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&ut(e,a,r));return a}function ut(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!ft(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function dt(e){return e.visibility===`hidden`||e.visibility===`collapse`}function ft(e,t=e?ie(e):null){return!e||!e.isConnected||!t||dt(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var pt=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function mt(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ee(n)?n.host:null}function ht(e){for(let t of Array.from(e.children))if(O(t)===`summary`)return t;return null}function gt(e,t){let n=ht(t);return!!n&&(e===n||Q(n,e))}function _t(e){let t=e?O(e):``;return e!=null&&e.matches(pt)&&(t!==`summary`||e.parentElement!=null&&O(e.parentElement)===`details`&&ht(e.parentElement)===e)&&(t!==`details`||ht(e)==null)&&(t!==`input`||e.type!==`hidden`)}function vt(e){if(!_t(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=mt(t)){let n=t!==e,r=O(t)===`slot`;if(t.hasAttribute(`inert`)||n&&O(t)===`details`&&!t.open&&!gt(e,t)||t.hasAttribute(`hidden`)||!r&&!yt(t,n))return!1}return!0}function yt(e,t){let n=ie(e);return t?n.display!==`none`:ft(e,n)}function bt(e){let t=e.tabIndex;if(t<0){let t=O(e);if(t===`details`||t===`audio`||t===`video`||j(e)&&e.isContentEditable)return 0}return t}function xt(e){if(O(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function St(e,t){let n=xt(e);if(!n)return!0;let r=t.find(e=>{let t=xt(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=xt(e);return t?.name===n.name&&t.form===n.form})===n}function Ct(e){if(j(e)&&O(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return j(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function wt(e,t){Ct(e).forEach(e=>{_t(e)&&t.push(e),wt(e,t)})}function Tt(e,t,n){Ct(e).forEach(e=>{j(e)&&e.matches(t)&&n.push(e),Tt(e,t,n)})}function Et(e){return vt(e)&&bt(e)>=0}function Dt(e){let t=[];return wt(e,t),t.filter(vt)}function Ot(e){let t=Dt(e);return t.filter(e=>bt(e)>=0&&St(e,t))}function kt(e,t){let n=Ot(e),r=n.length;if(r===0)return;let i=Z(H(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function At(e){return kt(H(e).body,1)||e}function jt(e){return kt(H(e).body,-1)||e}function Mt(e,t,n){if(!e)return null;let r=[];wt(H(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(vt);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Q(n,o)&&Et(o)&&St(o,a))return o}return r[i]}function Nt(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function Pt(e){Ot(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Ft(e){let t=[];Tt(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function It(e,t,n,r){let i=!1,a=!1,o=r??T;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Lt(e,t,n){let r=n??T;return{reason:e,event:t??new Event(`base-ui`),...r}}var Rt=`none`,zt=`trigger-press`,Bt=`trigger-hover`,Vt=`trigger-focus`,Ht=`outside-press`,Ut=`item-press`,Wt=`close-press`,Gt=`focus-out`,Kt=`escape-key`,qt=`list-navigation`,Jt=`keyboard`,Yt=`pointer`,Xt=`cancel-open`,Zt=`sibling-open`,Qt=`disabled`,$t=`imperative-action`;function $(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function en(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function tn(e){let t=C(nn,e).current;return t.next=e,A(t.effect),t}function nn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var rn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},an={...rn,position:`fixed`,margin:0,top:0,left:0};({...rn});var on=V.forwardRef(function(e,t){let[n,r]=V.useState();A(()=>{ge&&he&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,X.jsx)(`span`,{...e,ref:t,style:an,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function sn(e){return`data-base-ui-${e}`}var cn=0;function ln(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(cn);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),P;let o=requestAnimationFrame(a);return cn=o,()=>{cn===o&&(cancelAnimationFrame(o),cn=0)}}var un=`data-base-ui-inert`,dn=new WeakMap,fn=new WeakSet,pn=new WeakMap,mn=0;function hn(e){return e?ee(e)?e.host:hn(e.parentNode):null}var gn=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=hn(t);return e.contains(n)?n:null}).filter(e=>e!=null),_n=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},vn=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{O(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function yn(e,t,n,{mark:r=!0}){let i=gn(t,e),a=r?vn(t,_n(i),new Set(i)):[],o=[],s=[];if(n){let e=gn(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);vn(t,_n(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(dn.get(e)||0)+1;dn.set(e,r),o.push(e),r===1&&n&&fn.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(pn.get(e)||0)+1;pn.set(e,t),s.push(e),t===1&&e.setAttribute(un,``)}),mn+=1,()=>{o.forEach(e=>{let t=(dn.get(e)||0)-1;dn.set(e,t),t||(fn.has(e)||e.removeAttribute(`aria-hidden`),fn.delete(e))}),r&&s.forEach(e=>{let t=(pn.get(e)||0)-1;pn.set(e,t),t||e.removeAttribute(un)}),--mn,mn||(dn=new WeakMap,fn=new WeakSet,pn=new WeakMap)}}function bn(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=H(e[0]).body;return yn(e,i,n,{mark:r})}var xn=n(h(),1),Sn={style:{transition:`none`}},Cn=`data-base-ui-click-trigger`,wn={fallbackAxisSide:`none`},Tn={fallbackAxisSide:`end`},En={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Dn=V.createContext(null),On=()=>V.useContext(Dn),kn=sn(`portal`);function An(e={}){let{ref:t,container:n,componentProps:r=T,elementProps:i}=e,a=W(),o=On()?.portalNode,[s,c]=V.useState(null),[l,u]=V.useState(null),d=b(e=>{e!==null&&u(e)}),f=V.useRef(null);A(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(te(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=w(`div`,r,{ref:[t,d],props:[{id:a,[kn]:``},i]}),m=s&&p?xn.createPortal(p,s):null;return{node:l,nodeId:V.isValidElement(p)?p.props.id:void 0,subtree:m}}var jn=V.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=An({container:o,ref:t,componentProps:e,elementProps:c}),f=V.useRef(null),p=V.useRef(null),m=V.useRef(null),h=V.useRef(null),[g,_]=V.useState(null),v=V.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;V.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Nt(e)&&(e.type===`focusin`?v.current&&=(Ft(l),!1):(Pt(l),v.current=!0))}return en($(l,`focusin`,e,!0),$(l,`focusout`,e,!0))},[l,y]),A(()=>{l&&b===!0&&v.current&&(Ft(l),v.current=!1)},[b,l]);let S=V.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,X.jsxs)(V.Fragment,{children:[d,(0,X.jsxs)(Dn.Provider,{value:S,children:[x&&l&&(0,X.jsx)(on,{"data-type":`outside`,ref:f,onFocus:e=>{Nt(e,l)?m.current?.focus():jt(g?g.domReference:null)?.focus()}}),x&&l&&(0,X.jsx)(`span`,{role:s,"aria-owns":u,style:En}),l&&xn.createPortal(a,l),x&&l&&(0,X.jsx)(on,{"data-type":`outside`,ref:p,onFocus:e=>{Nt(e,l)?h.current?.focus():(At(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,It(`focus-out`,e.nativeEvent)))}})]})]})});function Mn(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Nn=class{nodesRef={current:[]};events=Mn();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Pn=V.createContext(null),Fn=V.createContext(null),In=()=>V.useContext(Pn)?.id||null,Ln=e=>{let t=V.useContext(Fn);return e??t};function Rn(e){let t=W(),n=Ln(e),r=In();return A(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function zn(e){let{children:t,id:n}=e,r=In();return(0,X.jsx)(Pn.Provider,{value:V.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Bn(e){let{children:t,externalTree:n}=e,r=C(()=>n??new Nn).current;return(0,X.jsx)(Fn.Provider,{value:r,children:t})}function Vn(e,t){let n=k(ye(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(tt(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Hn=20,Un=[];function Wn(){Un=Un.filter(e=>e.deref()?.isConnected)}function Gn(e){Wn(),e&&O(e)!==`body`&&(Un.push(new WeakRef(e)),Un.length>Hn&&(Un=Un.slice(-20)))}function Kn(){return Wn(),Un[Un.length-1]?.deref()}function qn(e){return e?Et(e)?e:Ot(e)[0]||e:null}function Jn(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Dt(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Et(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Yn(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:f,previousFocusableElement:h,beforeContentFocusGuardRef:g,externalTree:_,getInsideElements:v}=e,y=t.useState(`open`),x=t.useState(`domReferenceElement`),S=t.useState(`floatingElement`),{events:C,dataRef:w}=t.context,T=b(()=>w.current.floatingContext?.nodeId),ee=i===!1,D=Je(x)&&ee,te=tn(i),k=tn(a),ne=tn(o),re=tn(u),ie=tn(y),M=Ln(_),N=On(),P=V.useRef(!1),F=V.useRef(!1),I=V.useRef(!1),L=V.useRef(null),R=V.useRef(``),z=V.useRef(``),B=V.useRef(null),U=V.useRef(null),ae=E(B,g,N?.beforeInsideRef),oe=E(U,N?.afterInsideRef),se=m(),W=m(),ce=d(),le=N!=null,G=Xe(S),K=b((e=G)=>e?Ot(e):[]),q=b(()=>v?.().filter(e=>e!=null)??[]);V.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(G,Z(H(G)))&&K().length===0&&!D&&$e(e)}return $(H(G),`keydown`,e)},[r,G,c,D,K]),V.useEffect(()=>{if(r||!y)return;let e=H(G);function t(){I.current=!1}function n(e){let t=ye(e),n=q(),r=Q(S,t)||Q(x,t)||Q(N?.portalNode,t)||n.some(e=>e===t||Q(e,t));I.current=!r,z.current=e.pointerType||`keyboard`,ve(t,`[data-base-ui-click-trigger]`)&&(F.current=!0,W.start(0,()=>{F.current=!1}))}function i(){z.current=`keyboard`}return en($(e,`pointerdown`,n,!0),$(e,`pointerup`,t,!0),$(e,`pointercancel`,t,!0),$(e,`keydown`,i,!0),t)},[r,S,x,G,y,N,W,q]),V.useEffect(()=>{if(r||!l)return;let e=H(G);function n(){F.current=!0,W.start(0,()=>{F.current=!1})}function i(e){let t=ye(e);Et(t)&&(L.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=ye(n);c&&r==null&&a!=null&&Q(S,a)&&Gn(a),queueMicrotask(()=>{let o=T(),l=t.context.triggerElements,u=q(),d=r?.hasAttribute(sn(`focus-guard`))&&[B.current,U.current,N?.beforeInsideRef.current,N?.afterInsideRef.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,p(h),p(f)].includes(r),m=!(Q(x,r)||Q(S,r)||Q(r,S)||Q(N?.portalNode,r)||u.some(e=>e===r||Q(e,r))||l.hasMatchingElement(e=>Q(e,r))||d||M&&(Ze(M.nodesRef.current,o).find(e=>Q(e.context?.elements.floating,r)||Q(e.context?.elements.domReference,r))||Qe(M.nodesRef.current,o).find(e=>[e.context?.elements.floating,Xe(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===x&&G&&Jn(G),s&&i!==x&&!ft(a)&&Z(e)===e.body){if(j(G)&&(G.focus(),s===`popup`)){ce.request(()=>{G.focus()});return}let e=K(),t=L.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||G;j(n)&&n.focus()}w.current.insideReactTree?w.current.insideReactTree=!1:(D||!c)&&r&&m&&!F.current&&(D||r!==Kn())&&(P.current=!0,t.setOpen(!1,It(Gt,n)))})}function o(){I.current||(w.current.insideReactTree=!0,se.start(0,()=>{w.current.insideReactTree=!1}))}let u=j(x)?x:null;if(S||u)return en(u&&$(u,`focusout`,a),u&&$(u,`pointerdown`,n),S&&$(S,`focusin`,i),S&&$(S,`focusout`,a),S&&N&&$(S,`focusout`,o,!0))},[r,x,S,G,c,M,N,t,l,s,K,D,T,w,se,W,ce,f,h,q]),V.useEffect(()=>{if(r||!S||!y)return;let e=Array.from(N?.portalNode?.querySelectorAll(`[${sn(`portal`)}]`)||[]),t=(M?Qe(M.nodesRef.current,T()):[]).find(e=>Je(e.context?.elements.domReference||null))?.context?.elements.domReference,n=bn([S,...e,B.current,U.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,...q(),t,p(h),p(f),D?x:null].filter(e=>e!=null),{ariaHidden:c||D,mark:!1}),i=bn([S,...e].filter(e=>e!=null));return()=>{i(),n()}},[y,r,x,S,c,N,D,M,T,f,h,q]),A(()=>{if(!y||r||!j(G))return;R.current=``,z.current=``;let e=H(G),t=Z(e);queueMicrotask(()=>{let n=te.current,r=typeof n==`function`?n(re.current||``):n;if(r===void 0||r===!1||Q(G,t))return;let i=null,a=()=>(i??=K(G),i[0]||G),o;o=r===!0||r===null?a():p(r),o||=a();let s=Q(G,Z(e)),c=w.current.openEvent,l=c?.type===`mousedown`&&tt(c);ln(o,{sync:l,preventScroll:o===G,shouldFocus(){if(!ie.current)return!1;if(s)return!0;let t=Z(e);return!(t!==o&&Q(G,t))}})})},[r,y,G,K,te,re,ie,w]);let J=V.useRef(null);A(()=>{if(r||!G){J.current=null;return}J.current&&=(J.current.cancelled=!0,null);let e=H(G),t=Z(e),n=re.current==null;Gn(t);function i(e){if(e.open||(R.current=Vn(e.nativeEvent,z.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(sn(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(P.current=!0),e.reason===`outside-press`){if(e.nested)P.current=!1;else if(tt(e.nativeEvent)||nt(e.nativeEvent))P.current=!1;else{let e=!1;H(G).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}}C.on(`openchange`,i);function a(e){let r=k.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=x?.isConnected?x:null,o=t?.isConnected&&O(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Kn()||null,typeof i==`boolean`?s:p(i)||s||null}return()=>{C.off(`openchange`,i);let t=Z(e),n=q(),r=Q(S,t)||n.some(e=>e===t||Q(e,t))||M&&Ze(M.nodesRef.current,T(),!1).some(e=>Q(e.context?.elements.floating,t)),o=k.current,s=R.current,c=a(s),l={cancelled:!1};J.current=l,queueMicrotask(()=>{J.current===l&&(J.current=null);let n=qn(c),i=ne.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!P.current&&j(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}P.current=!1})}},[r,S,G,k,ne,re,C,M,x,T,q]),A(()=>{if(!he||y||!S)return;let e=Z(H(S));j(e)&&Ke(e)&&Q(S,e)&&e.blur()},[y,S]),A(()=>{if(!r&&N)return N.setFocusManagerState({modal:c,closeOnFocusOut:l,open:y,onOpenChange:t.setOpen,domReference:x}),()=>{N.setFocusManagerState(null)}},[r,N,c,y,t,l,x]),A(()=>{if(!r&&G)return Jn(G),()=>{queueMicrotask(Wn)}},[r,G]);let Y=!r&&(!c||!D)&&(le||c);return(0,X.jsxs)(V.Fragment,{children:[Y&&(0,X.jsx)(on,{"data-type":`inside`,ref:ae,onFocus:e=>{if(c){let e=K();ln(e[e.length-1])}else N?.portalNode&&(P.current=!1,Nt(e,N.portalNode)?At(x)?.focus():p(h??N.beforeOutsideRef)?.focus())}}),n,Y&&(0,X.jsx)(on,{"data-type":`inside`,ref:oe,onFocus:e=>{c?ln(K()[0]):N?.portalNode&&(l&&(P.current=!0),Nt(e,N.portalNode)?jt(x)?.focus():p(f??N.afterOutsideRef)?.focus())}})]})}function Xn(){return!1}function Zn(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Qn(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Xn,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Ln(c),h=b(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,y=b(()=>a),{escapeKey:x,outsidePress:S}=Zn(s),C=V.useRef(!1),w=V.useRef(!1),T=V.useRef(!1),E=V.useRef(!1),te=V.useRef(!1),O=V.useRef(``),k=V.useRef(null),ne=m(),A=m(),M=m(),P=b(()=>{A.clear(),d.current.insideReactTree=!1}),F=b(e=>{let t=d.current.floatingContext?.nodeId;return(p?Ze(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),I=b(t=>We(t,e.select(`floatingElement`))||We(t,e.select(`domReferenceElement`))),L=b(t=>{o()&&e.setOpen(!1,It(zt,t.nativeEvent))}),R=b(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=et(t)?t.nativeEvent:t;if(te.current||i.isComposing||!x&&F(`__escapeKeyBubbles`))return;let a=It(Kt,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!x&&!a.isPropagationAllowed&&t.stopPropagation()}),z=b(()=>{d.current.insideReactTree=!0,A.start(0,P)}),B=b(t=>{if(!l||!n||t.button!==0)return;let r=ye(t.nativeEvent);Q(e.select(`floatingElement`),r)&&(C.current||(C.current=!0,w.current=!1))}),U=b(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&C.current&&(w.current=!0)});V.useEffect(()=>{function e(e){e.open||(E.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),V.useEffect(()=>P,[P]),V.useEffect(()=>{if(!l||!n)return l||(E.current=!1,te.current=!1,O.current=``,k.current=null),P;d.current.__escapeKeyBubbles=x,d.current.__outsidePressBubbles=S;let t=new v,i=H(u);function a(){M.clear(),te.current=!0}function o(){te.current=!0,M.start(he?5:0,()=>{te.current=!1})}function s(){T.current=!0,t.start(0,()=>{T.current=!1})}function c(){C.current=!1,w.current=!1}function f(){let e=O.current,t=e===`pen`||!e?`mouse`:e,n=y(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=d.current.floatingContext?.nodeId,n=p&&Ze(p.nodesRef.current,t).some(t=>We(e,t.context?.elements.floating));return I(e)||n}function b(n){if(m(n)){n.type!==`click`&&!I(n)&&(t.clear(),T.current=!1),P();return}if(d.current.insideReactTree){P();return}let r=ye(n),i=`[${sn(`inert`)}]`,a=D(r)?r.getRootNode():null,o=Array.from((ee(a)?a:H(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Q(e,r))))return;let c=D(r)?r:null;for(;c&&!N(c);){let e=re(c);if(N(e)||!D(e))break;c=e}if(!(o.length&&D(r)&&!Ge(r)&&!Q(r,e.select(`floatingElement`))&&o.every(e=>!Q(c,e)))){if(j(r)&&!(`touches`in n)){let e=N(r),t=ie(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!h(n)){if(f()===`intentional`){if(n.detail!==0&&!tt(n)&&!E.current)return;if(T.current){t.clear(),T.current=!1;return}}(typeof g!=`function`||g(n))&&(F(`__outsidePressBubbles`)||(e.setOpen(!1,It(Ht,n)),P()))}}}function A(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!I(t)&&b(t)}function L(t){if(f()!==`sloppy`||!e.select(`open`)||!n||I(t))return;let r=t.touches[0];r&&(k.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},ne.start(1e3,()=>{k.current&&(k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1)}))}function z(e,t){let n=ye(e);if(!n)return;let r=$(n,e.type,()=>{t(e),r()})}function B(e){O.current=`touch`,z(e,L)}function V(e){ne.clear(),e.type===`pointerdown`&&(e.button===0&&(E.current=!0),O.current=e.pointerType),(e.type!==`mousedown`||!k.current||k.current.dismissOnMouseDown)&&z(e,e=>{e.type===`pointerdown`?A(e):b(e)})}function U(e){if(e.type===`pointercancel`&&(E.current=!1),!C.current)return;let n=w.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():h(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),T.current=!0,P())))}function ae(e){if(f()!==`sloppy`||!k.current||I(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-k.current.startX),r=Math.abs(t.clientY-k.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(k.current.dismissOnTouchEnd=!0),i>10&&(b(e),ne.clear(),k.current=null)}function oe(e){z(e,ae)}function se(e){f()===`sloppy`&&k.current&&!I(e)&&(k.current.dismissOnTouchEnd&&b(e),ne.clear(),k.current=null)}function W(e){z(e,se)}let ce=en(r&&en($(i,`keydown`,R),$(i,`compositionstart`,a),$(i,`compositionend`,o)),_&&en($(i,`click`,V,!0),$(i,`pointerdown`,V,!0),$(i,`pointerup`,U,!0),$(i,`pointercancel`,U,!0),$(i,`mousedown`,V,!0),$(i,`mouseup`,U,!0),$(i,`touchstart`,B,{capture:!0,passive:!0}),$(i,`touchmove`,oe,{capture:!0,passive:!0}),$(i,`touchend`,W,{capture:!0,passive:!0})));return()=>{ce(),t.clear(),c(),T.current=!1}},[d,u,r,_,g,l,n,x,S,R,P,y,F,I,p,e,ne,M]);let ae=V.useMemo(()=>({onKeyDown:R,onPointerDown:L,onClick:L}),[R,L]),oe=V.useMemo(()=>({onKeyDown:R,onPointerDown:U,onMouseDown:U,onClickCapture:z,onMouseDownCapture(e){z(),B(e)},onPointerDownCapture(e){z(),B(e)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[R,z,B,U]);return V.useMemo(()=>n?{reference:ae,floating:oe,trigger:ae}:{},[n,ae,oe])}function $n(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),A(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};D(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function er(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=b(i),{mounted:c,setMounted:u,transitionStatus:d}=g(t,!1,!1,o),f=!t&&r;A(()=>{t&&s(!1)},[t,s]);let p=V.useRef(c),m=V.useRef(!1),h=U(),_=()=>{p.current=!1,u(!1),a()};A(()=>{p.current=c,m.current&&(m.current=!1,!t&&c&&_())});let v=b(()=>{p.current&&(t?(m.current=!0,h()):_())});return l({enabled:c&&!t&&!f,open:t,ref:n,onComplete(){t||v()}}),{mounted:c,transitionStatus:d,preventUnmountingOnClose:f,forceUnmount:v}}var tr={tabIndex:-1,[be]:``};function nr(e){return t=>t!==`touch`||e.current}function rr(e,t=!1){let n=W(),r=In()!=null,i=C(()=>e(n,r)).current;return $n({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function ir({handle:e,store:t}){return A(()=>e.attachStore(t),[e,t]),null}function ar(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function or(e,t){let n=V.useRef(null);return b(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),ar(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),ar(t))})}function sr(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function cr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function lr(e,t,n,r={}){let i=n.reason,a=i===Bt,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=cr(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=sr(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?xn.flushSync(l):l()}function ur(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=or(e,n),o=b(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=b(e=>{a(e),e&&o(e)});return A(()=>(s(t.current),()=>s(null)),[s,t,n,e]),A(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function dr(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=V.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);A(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=It(Rt);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function fr(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=er({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return C(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function pr(e,t){e.useSyncedValues(t),A(()=>()=>{e.update({activeTriggerProps:T,inactiveTriggerProps:T,popupProps:T})},[e])}function mr(e,t){A(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),A(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var hr=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},gr=s(),_r=c(),vr=[],yr=void 0;function br(){return yr}function xr(e){vr.push(e)}function Sr(e){let t=(t,n)=>{let r=C(wr).current,i;try{yr=r;for(let e of vr)e.before(r);i=e(t,n);for(let e of vr)e.after(r);r.didInitialize=!0}finally{yr=void 0}return i};return t.displayName=e.displayName||e.name,t}function Cr(e){return V.forwardRef(Sr(e))}function wr(){return{didInitialize:!1}}var Tr=x(19)?Or:kr;function Er(e,t,n,r,i){return Tr(e,t,n,r,i)}function Dr(e,t,n,r,i){let a=V.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,gr.useSyncExternalStore)(e.subscribe,a,a)}xr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,gr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Or(e,t,n,r,i){let a=br();if(!a)return Dr(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function kr(e,t,n,r,i){return(0,_r.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Ar=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Er(this,e,t,n,r)}},jr=class extends Ar{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){V.useDebugValue(e);let n=this;A(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;A(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);A(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){V.useDebugValue(e);let n=this,r=t!==void 0;A(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return V.useDebugValue(e),Er(this,this.selectors[e],t,n,r)}useContextCallback(e,t){V.useDebugValue(e);let n=b(t??P);this.context[e]=n}useStateSetter(e){let t=V.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Mr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Nr=class extends jr{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Mn(),nested:n,triggerElements:i},Mr),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&it(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Pr(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Nr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:T,inactiveTriggerProps:T,popupProps:T}}var Fr=e=>e.triggerIdProp??e.activeTriggerId,Ir=e=>e.openProp??e.open,Lr=e=>(e.popupElement?.id??e.floatingId)||void 0;function Rr(e,t){return t!==void 0&&Ir(e)&&Fr(e)===t}function zr(e,t){return Rr(e,t)?!0:t!==void 0&&Ir(e)&&Fr(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Br={open:Ir,mounted:e=>e.mounted,transitionStatus:e=>Ir(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Fr,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Lr,isTriggerActive:(e,t)=>t!==void 0&&Fr(e)===t,isOpenedByTrigger:(e,t)=>Rr(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Fr(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>zr(e,t)?Lr(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},Vr=`ArrowUp`,Hr=`ArrowDown`,Ur=`ArrowLeft`,Wr=`ArrowRight`,Gr=`Home`,Kr=new Set([Vr,Hr,Ur,Wr,Gr,`End`]),qr=[`Shift`,`Control`,`Alt`,`Meta`];function Jr(e){return j(e)&&e.tagName===`INPUT`}function Yr(e){return!!(Jr(e)&&e.selectionStart!=null||j(e)&&e.tagName===`TEXTAREA`)}function Xr(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Zr(e,t,`left`),a=Qr(e),o=Qr(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Zr(e,t,`top`),r=Qr(e),i=Qr(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Zr(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Qr(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function $r(e){return x(19)?e:e?`true`:void 0}var ei=V.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,X.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),ti={},ni={},ri=``;function ii(e,t){return M(e)?e:t}function ai(e,t,n){return/hidden|clip/.test(e.getComputedStyle(ii(t,n)).overflowY)}function oi(e){if(typeof document>`u`)return!1;let t=H(e);return k(t).innerWidth-t.documentElement.clientWidth>0}function si(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=H(e),n=t.documentElement,r=t.body,i=ii(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function ci(e){let t=H(e),n=t.documentElement,r=t.body,i=ii(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function li(e){let t=H(e),n=t.documentElement,r=t.body,i=k(n),a=0,o=0,s=!1,c=y.create();if(he&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,ti={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ri=n.style.scrollBehavior,ni={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=ii(n,r);s=si(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,ti),Object.assign(r.style,ni),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=ri)}function d(){u(),c.request(l)}l();let f=$(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ui=new class{lockCount=0;restore=null;timeoutLock=v.create();timeoutUnlock=v.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=H(e),n=t.documentElement,r=t.body,i=k(n);if(ai(i,n,r)){let t=new i.MutationObserver(()=>{ai(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=ue||!oi(e);this.restore=a?ci(e):li(e)}};function di(e=!0,t=null){A(()=>{if(e)return ui.acquire(t)},[e,t])}var fi=V.createContext(void 0);function pi(){return V.useContext(fi)?.direction??`ltr`}var mi=(e,t)=>e.number-t.number,hi=e=>{let t=[...e].sort(mi),n=t.find(({kind:e})=>e===`issue`)??t[0]??e[0];return{origin:n,pullRequests:t.filter(({kind:e,number:t})=>e===`pr`&&t!==n.number)}},gi=e=>hi(I(e.items)?e.items:[e]),_i=(e,t)=>F(e?.projects.flatMap(({board:e})=>e.lanes).flatMap(({items:e})=>e).find(e=>e.items.some(e=>e.itemKey===t))),vi=(e,t)=>R(_i(e,t.itemKey),{onNone:()=>hi([t]),onSome:gi}),yi=()=>B(o()).data,bi=e=>L(F(/\/pull\/(\d+)/u.exec(e)?.[1]),Number),xi=(e,t)=>L(bi(e),n=>t.find(e=>e.number===n)??{kind:`pr`,number:n,url:e,state:null});function Si(e){"@babel/helpers - typeof";return Si=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Si(e)}var Ci=[`aria-hidden`,`aria-label`,`aria-labelledby`,`tabIndex`,`className`,`fill`,`size`,`verticalAlign`,`id`,`title`,`style`];function wi(){return wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wi.apply(null,arguments)}function Ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ei(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ti(Object(n),!0).forEach(function(t){Di(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ti(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Di(e,t,n){return(t=Oi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oi(e){var t=ki(e,`string`);return Si(t)==`symbol`?t:t+``}function ki(e,t){if(Si(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Si(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ai(e,t){if(e==null)return{};var n,r,i=ji(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ji(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Mi={small:16,medium:32,large:64};function Ni(e,t,n,r,i){var a=e[`aria-hidden`],o=e[`aria-label`],s=e[`aria-labelledby`],c=e.tabIndex,l=e.className,u=l===void 0?``:l,d=e.fill,f=d===void 0?`currentColor`:d,p=e.size,m=p===void 0?16:p,h=e.verticalAlign,g=h===void 0?`text-bottom`:h,_=e.id,v=e.title,y=e.style,b=Ai(e,Ci),x=Mi[m]||m,S=Pi(i,x),C=r[S].width,w=C/S*x,T=r[S].path,ee=o||s,E=a===void 0?ee?void 0:`true`:a,D=ee&&E!==`true`?`img`:void 0;return V.createElement(`svg`,wi({ref:t,"data-component":`Octicon`},b,{"aria-hidden":E,tabIndex:c,focusable:c>=0?`true`:`false`,"aria-label":o,"aria-labelledby":s,className:`${n} ${u}`.trim(),role:D,viewBox:`0 0 ${C} ${S}`,width:w,height:x,fill:f,id:_,display:`inline-block`,overflow:`visible`,style:Ei({verticalAlign:g},y)}),v?V.createElement(`title`,null,v):null,T)}function Pi(e,t){return e.map(function(e){return parseInt(e,10)}).reduce(function(e,n){return n<=t?n:e},e[0])}var Fi=[`16`,`24`],Ii={16:{width:16,path:V.createElement(`path`,{d:`M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218ZM4.25 13.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm8.5-4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM5 3.25a.75.75 0 1 0 0 .005V3.25Z`})},24:{width:24,path:V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M15 13.25a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm-12.5 6a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm0-14.5a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM5.75 6.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 6.5Zm0 14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 21Zm12.5-6a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 18.25 15Z`}),V.createElement(`path`,{d:`M6.5 7.25c0 2.9 2.35 5.25 5.25 5.25h4.5V14h-4.5A6.75 6.75 0 0 1 5 7.25Z`}),V.createElement(`path`,{d:`M5.75 16.75A.75.75 0 0 1 5 16V8a.75.75 0 0 1 1.5 0v8a.75.75 0 0 1-.75.75Z`}))}},Li=V.forwardRef(function(e,t){return Ni(e,t,`octicon octicon-git-merge`,Ii,Fi)});Li.displayName=`GitMergeIcon`;var Ri=[`16`,`24`],zi={16:{width:16,path:V.createElement(`path`,{d:`M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z`})},24:{width:24,path:V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M16 19.25a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm-14.5 0a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm0-14.5a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM4.75 3a1.75 1.75 0 1 0 .001 3.501A1.75 1.75 0 0 0 4.75 3Zm0 14.5a1.75 1.75 0 1 0 .001 3.501A1.75 1.75 0 0 0 4.75 17.5Zm14.5 0a1.75 1.75 0 1 0 .001 3.501 1.75 1.75 0 0 0-.001-3.501Z`}),V.createElement(`path`,{d:`M13.405 1.72a.75.75 0 0 1 0 1.06L12.185 4h4.065A3.75 3.75 0 0 1 20 7.75v8.75a.75.75 0 0 1-1.5 0V7.75a2.25 2.25 0 0 0-2.25-2.25h-4.064l1.22 1.22a.75.75 0 0 1-1.061 1.06l-2.5-2.5a.75.75 0 0 1 0-1.06l2.5-2.5a.75.75 0 0 1 1.06 0ZM4.75 7.25A.75.75 0 0 1 5.5 8v8A.75.75 0 0 1 4 16V8a.75.75 0 0 1 .75-.75Z`}))}},Bi=V.forwardRef(function(e,t){return Ni(e,t,`octicon octicon-git-pull-request`,zi,Ri)});Bi.displayName=`GitPullRequestIcon`;var Vi=[`16`,`24`],Hi={16:{width:16,path:V.createElement(`path`,{d:`M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1Zm9.5 5.5a.75.75 0 0 1 .75.75v3.378a2.251 2.251 0 1 1-1.5 0V7.25a.75.75 0 0 1 .75-.75Zm-2.03-5.273a.75.75 0 0 1 1.06 0l.97.97.97-.97a.748.748 0 0 1 1.265.332.75.75 0 0 1-.205.729l-.97.97.97.97a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-.97-.97-.97.97a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l.97-.97-.97-.97a.75.75 0 0 1 0-1.06ZM2.5 3.25a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0ZM3.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm9.5 0a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z`})},24:{width:24,path:V.createElement(`path`,{d:`M22.266 2.711a.75.75 0 1 0-1.061-1.06l-1.983 1.983-1.984-1.983a.75.75 0 1 0-1.06 1.06l1.983 1.983-1.983 1.984a.75.75 0 0 0 1.06 1.06l1.984-1.983 1.983 1.983a.75.75 0 0 0 1.06-1.06l-1.983-1.984 1.984-1.983ZM4.75 1.5a3.25 3.25 0 0 1 .745 6.414A.827.827 0 0 1 5.5 8v8a.827.827 0 0 1-.005.086A3.25 3.25 0 0 1 4.75 22.5a3.25 3.25 0 0 1-.745-6.414A.827.827 0 0 1 4 16V8c0-.029.002-.057.005-.086A3.25 3.25 0 0 1 4.75 1.5ZM16 19.25a3.252 3.252 0 0 1 2.5-3.163V9.625a.75.75 0 0 1 1.5 0v6.462a3.252 3.252 0 0 1-.75 6.413A3.25 3.25 0 0 1 16 19.25ZM3 4.75a1.75 1.75 0 1 0 3.501-.001A1.75 1.75 0 0 0 3 4.75Zm0 14.5a1.75 1.75 0 1 0 3.501-.001A1.75 1.75 0 0 0 3 19.25Zm16.25-1.75a1.75 1.75 0 1 0 .001 3.501 1.75 1.75 0 0 0-.001-3.501Z`})}},Ui=V.forwardRef(function(e,t){return Ni(e,t,`octicon octicon-git-pull-request-closed`,Hi,Vi)});Ui.displayName=`GitPullRequestClosedIcon`;var Wi=[`16`,`24`],Gi={16:{width:16,path:V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M11.28 6.78a.75.75 0 0 0-1.06-1.06L7.25 8.69 5.78 7.22a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.06 0l3.5-3.5Z`}),V.createElement(`path`,{d:`M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 1 0-13 0 6.5 6.5 0 0 0 13 0Z`}))},24:{width:24,path:V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M17.28 9.28a.75.75 0 0 0-1.06-1.06l-5.97 5.97-2.47-2.47a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l6.5-6.5Z`}),V.createElement(`path`,{d:`M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Z`}))}},Ki=V.forwardRef(function(e,t){return Ni(e,t,`octicon octicon-issue-closed`,Gi,Wi)});Ki.displayName=`IssueClosedIcon`;var qi=[`16`,`24`],Ji={16:{width:16,path:V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z`}),V.createElement(`path`,{d:`M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z`}))},24:{width:24,path:V.createElement(`path`,{d:`M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z`})}},Yi=V.forwardRef(function(e,t){return Ni(e,t,`octicon octicon-issue-opened`,Ji,qi)});Yi.displayName=`IssueOpenedIcon`;var Xi={"issue-open":{icon:Yi,tone:`text-run-succeeded`,word:`open`},"issue-closed":{icon:Ki,tone:`text-primary`,word:`closed`},"issue-unknown":{icon:Yi,tone:`text-muted-foreground`,word:null},"pr-open":{icon:Bi,tone:`text-run-succeeded`,word:`open`},"pr-merged":{icon:Li,tone:`text-primary`,word:`merged`},"pr-closed":{icon:Ui,tone:`text-run-failed`,word:`closed`},"pr-unknown":{icon:Bi,tone:`text-muted-foreground`,word:null}},Zi=({kind:e,state:t})=>Xi[t??`${e}-unknown`],Qi=e=>e===`pr`?`Pull request`:`Issue`,$i=({kind:e,number:t})=>`${Qi(e).toLowerCase()} #${t}`,ea=e=>{let{word:t}=Zi(e);return`${Qi(e.kind)} #${e.number}${t===null?``:`, ${t}`}`},ta=({item:e,size:t=`inline`,linked:n=!0,numbered:r=!0,className:i})=>{let{icon:a,tone:o}=Zi(e),s=ea(e),c=S(`inline-flex items-baseline gap-1 whitespace-nowrap`,t===`title`&&`gap-1.5`,o,i),l=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(a,{size:t===`title`?16:14,className:`shrink-0 self-center`}),r&&(0,X.jsxs)(`span`,{className:S(`font-mono tabular-nums`,t===`title`?`text-md`:`text-xs`),children:[`#`,e.number]})]});return n?(0,X.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,draggable:!1,title:s,"aria-label":s,className:S(c,`rounded-sm underline-offset-4 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring/70`),children:l}):(0,X.jsx)(`span`,{role:`img`,title:s,"aria-label":s,className:c,children:l})},na=3e3,ra=15e3,ia=()=>a({queryKey:[`desk`],queryFn:()=>z(e=>e.desk()),refetchInterval:e=>{let t=e.state.data;return t!==void 0&&(t.running.length>0||t.notMoving.some(({reason:e})=>e._tag===`QueuedForWorker`))?na:ra}});export{An as $,De as $t,tr as A,lt as At,mr as B,$e as Bt,Xr as C,Vt as Ct,Sr as D,Lt as Dt,jr as E,It as Et,sr as F,at as Ft,Yn as G,Je as Gt,or as H,Xe as Ht,dr as I,ut as It,Rn as J,He as Jt,zn as K,Ke as Kt,fr as L,rt as Lt,lr as M,ot as Mt,cr as N,ct as Nt,Cr as O,Mt as Ot,nr as P,ft as Pt,jn as Q,Re as Qt,pr as R,tt as Rt,Yr as S,Zt as St,Br as T,zt as Tt,$n as U,qe as Ut,ur as V,Ze as Vt,Qn as W,Ue as Wt,Ln as X,Ve as Xt,In as Y,Be as Yt,Nn as Z,ze as Zt,Wr as _,H as _n,Jt as _t,gi as a,Ce as an,sn as at,Gr as b,Ht as bt,_i as c,ve as cn,en as ct,pi as d,_e as dn,Wt as dt,ke as en,Cn as et,di as f,ge as fn,Qt as ft,Ur as g,ce as gn,Ut as gt,Hr as h,pe as hn,$t as ht,$i as i,Se as in,ln as it,ir as j,st as jt,hr as k,Nt as kt,hi as l,Q as ln,$ as lt,$r as m,ue as mn,Gt as mt,ta as n,Oe as nn,wn as nt,vi as o,we as on,on as ot,ei as p,he as pn,Kt as pt,Bn as q,Ye as qt,ea as r,Te as rn,Tn as rt,xi as s,Z as sn,tn as st,ia as t,Ee as tn,Sn as tt,yi as u,ye as un,Xt as ut,Vr as v,B as vn,qt as vt,Pr as w,Bt as wt,qr as x,Yt as xt,Kr as y,Rt as yt,rr as z,nt as zt};
@@ -0,0 +1 @@
1
+ import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{k as r}from"./page-BuzrT_cg.js";import{a as i,d as a,i as o,n as s,s as c,t as l}from"./error-alert-NXb1Z8Xz.js";import{n as u}from"./overview-BdUgx_pE.js";import{W as d,t as f}from"./button-4rhhIcK8.js";import{v as p}from"./strings-qxNeGv33.js";import{n as m,t as h}from"./queries-BnlycW8v.js";var g=n(e(),1),_=new Map([[`bold`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),g.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),v=new Map([[`bold`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z`}))],[`duotone`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),g.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),y=g.forwardRef((e,t)=>g.createElement(d,{ref:t,...e,weights:_}));y.displayName=`ArrowClockwiseIcon`;var b=g.forwardRef((e,t)=>g.createElement(d,{ref:t,...e,weights:v}));b.displayName=`CheckCircleIcon`;var x=e=>{let t=[[`Loops`,e.loops],[`Agents`,e.agents],[`Labels`,e.labels],[`Repositories`,e.repos],[`Workers`,e.workers]].flatMap(([e,{added:t,removed:n,changed:r}])=>[[`added`,t],[`removed`,n],[`changed`,r]].flatMap(([t,n])=>n.length===0?[]:[`${e} ${t}: ${n.join(`, `)}`]));return e.settingsChanged&&t.push(`Settings changed`),e.operatorChanged&&t.push(`Operator login changed`),t.length===0&&t.push(`Nothing changed`),t},S=e=>{let t=[...x(e)],n=e.quarantinedLoops.length+e.invalidAgents.length;return n>0&&t.push(n===1?`1 file not loaded, listed in Needs attention`:`${n} files not loaded, listed in Needs attention`),t},C=t(),w=()=>{let e=r();return a({mutationFn:()=>p(e=>e.reload()),onSuccess:()=>Promise.all([e.invalidateQueries({queryKey:u().queryKey}),e.invalidateQueries({queryKey:h().queryKey}),e.invalidateQueries({queryKey:c})]),onSettled:()=>e.invalidateQueries({queryKey:m().queryKey})})},T=({reload:e})=>(0,C.jsxs)(f,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(),children:[(0,C.jsx)(y,{"data-icon":`inline-start`,"aria-hidden":`true`}),e.isPending?`Reloading…`:`Reload configuration`]}),E=({reload:e})=>e.isError?(0,C.jsx)(l,{title:`Configuration not reloaded`,message:e.error.message}):e.isSuccess?(0,C.jsxs)(s,{children:[(0,C.jsx)(b,{weight:`fill`,className:`text-run-succeeded`}),(0,C.jsx)(i,{children:`Configuration reloaded`}),(0,C.jsxs)(o,{children:[(0,C.jsx)(`ul`,{children:S(e.data).map(e=>(0,C.jsx)(`li`,{children:e},e))}),(0,C.jsx)(`p`,{className:`mt-1`,children:`Applies to new runs; open runs are unchanged`})]})]}):null;export{b as a,x as i,E as n,w as r,T as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./useRouter-Hur3RN7j.js";import{a as t}from"./page-BuzrT_cg.js";import{n}from"./useNavigate-AT5VkfZa.js";import{t as r}from"./link-C7GfYrMt.js";import{D as i}from"./button-4rhhIcK8.js";import{q as a}from"./strings-qxNeGv33.js";import{n as o}from"./queries-BnlycW8v.js";import{et as s}from"./index-CPkHl5O3.js";import{a as c,i as l,n as u,o as d,r as f,t as p}from"./table-hbKjhjeL.js";import{t as m}from"./fill-cell-CjksmixH.js";import{d as h,l as g,s as _,t as v}from"./section-BhUxD7-H.js";import{t as y}from"./repositories-D4wYJfa_.js";var b=e(),x=e=>{let t=[...e.declaredLabels,...y(e)];if(t.length===0)return{text:`No labels`,problem:!1};if(t.some(({onGitHub:e})=>e===null))return{text:`Not polled yet`,problem:!1};let n=e=>new Set(e.map(({name:e})=>e.toLowerCase())).size,r=n(t.filter(({failure:e})=>e!==null)),i=n(t.filter(({onGitHub:e})=>e===!1)),a=[...r>0?[`${r} failed`]:[],...i>0?[`${i} missing on GitHub`]:[]];return a.length===0?{text:`All on GitHub`,problem:!1}:{text:a.join(`, `),problem:!0}},S=({repository:e})=>{let t=n(),o=a(e.name),c=x(e);return(0,b.jsxs)(g,{open:()=>void t({to:`/configuration/repositories/$owner/$name`,params:o}),children:[(0,b.jsx)(f,{className:`py-3`,children:(0,b.jsxs)(r,{to:`/configuration/repositories/$owner/$name`,params:o,onClick:e=>e.stopPropagation(),className:i(h,`flex w-fit items-center gap-2`),children:[(0,b.jsx)(s,{repository:e.name}),e.name]})}),(0,b.jsx)(f,{className:`hidden @2xl:table-cell`,children:e.tags.length===0?(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:`None`}):e.tags.join(`, `)}),(0,b.jsx)(f,{className:`text-right tabular-nums`,children:e.lanes.length===0?(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:`Proposed`}):e.lanes.length}),(0,b.jsx)(f,{className:i(`max-sm:whitespace-normal`,c.problem?`text-destructive`:`text-muted-foreground`),children:c.text}),(0,b.jsx)(m,{className:`hidden whitespace-normal text-muted-foreground sm:table-cell`,children:e.loops.length===0?`No loop`:e.loops.join(`, `)})]})},C=({configuration:e})=>(0,b.jsx)(v,{title:`Repositories`,counts:`${e.repositories.length} ${e.repositories.length===1?`repository`:`repositories`}`,children:e.repositories.length===0?(0,b.jsxs)(_,{title:`No repositories registered`,children:[`Add each repository under `,(0,b.jsx)(`code`,{children:`repos`}),` in `,(0,b.jsx)(`code`,{children:`usine.yaml`}),`, then reload the configuration.`]}):(0,b.jsx)(`div`,{className:`@container -mx-2`,children:(0,b.jsxs)(p,{children:[(0,b.jsx)(c,{children:(0,b.jsxs)(d,{className:`hover:bg-transparent`,children:[(0,b.jsx)(l,{children:`Repository`}),(0,b.jsx)(l,{className:`hidden @2xl:table-cell`,children:`Tags`}),(0,b.jsx)(l,{className:`text-right`,children:`Lanes`}),(0,b.jsx)(l,{children:`Labels`}),(0,b.jsx)(l,{className:`hidden sm:table-cell`,children:`Loops`})]})}),(0,b.jsx)(u,{children:e.repositories.map(e=>(0,b.jsx)(S,{repository:e},e.name))})]})})}),w=()=>{let{data:e}=t(o());return(0,b.jsx)(C,{configuration:e})};export{w as component};
@@ -0,0 +1 @@
1
+ import{u as e}from"./index-CPkHl5O3.js";var t=e;export{t as component};
@@ -0,0 +1 @@
1
+ import{d as e}from"./index-CPkHl5O3.js";var t=e;export{t as errorComponent};